@exaudeus/workrail 3.75.0 → 3.76.0

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.
Files changed (29) hide show
  1. package/dist/console-ui/assets/index-DFZjlsUM.js +28 -0
  2. package/dist/console-ui/index.html +1 -1
  3. package/dist/coordinators/adaptive-pipeline.d.ts +8 -0
  4. package/dist/coordinators/context-assembly.d.ts +4 -0
  5. package/dist/coordinators/context-assembly.js +156 -0
  6. package/dist/coordinators/modes/full-pipeline.d.ts +1 -1
  7. package/dist/coordinators/modes/full-pipeline.js +140 -27
  8. package/dist/coordinators/modes/implement-shared.d.ts +3 -2
  9. package/dist/coordinators/modes/implement-shared.js +16 -6
  10. package/dist/coordinators/modes/implement.js +49 -3
  11. package/dist/coordinators/pipeline-run-context.d.ts +1811 -0
  12. package/dist/coordinators/pipeline-run-context.js +114 -0
  13. package/dist/manifest.json +52 -28
  14. package/dist/trigger/coordinator-deps.js +131 -0
  15. package/dist/v2/durable-core/domain/artifact-contract-validator.js +99 -0
  16. package/dist/v2/durable-core/schemas/artifacts/discovery-handoff.d.ts +39 -0
  17. package/dist/v2/durable-core/schemas/artifacts/discovery-handoff.js +10 -1
  18. package/dist/v2/durable-core/schemas/artifacts/index.d.ts +2 -1
  19. package/dist/v2/durable-core/schemas/artifacts/index.js +12 -1
  20. package/dist/v2/durable-core/schemas/artifacts/phase-handoff.d.ts +89 -0
  21. package/dist/v2/durable-core/schemas/artifacts/phase-handoff.js +56 -0
  22. package/docs/authoring-v2.md +12 -0
  23. package/docs/ideas/backlog.md +391 -1
  24. package/package.json +1 -1
  25. package/workflows/coding-task-workflow-agentic.json +9 -6
  26. package/workflows/mr-review-workflow.agentic.v2.json +2 -2
  27. package/workflows/wr.discovery.json +2 -1
  28. package/workflows/wr.shaping.json +7 -4
  29. package/dist/console-ui/assets/index-BvBihscd.js +0 -28
@@ -0,0 +1,28 @@
1
+ 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),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(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},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=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.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(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 N(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,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(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 ee(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P=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)},F={map:ee,forEach:function(e,t,n){ee(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ee(e,function(){t++}),t},toArray:function(e){return ee(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=F,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},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=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.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 E(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)T.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 E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,P)}catch(e){P(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.5`})),d=o(((e,t)=>{t.exports=u()})),f=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}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();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`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(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.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 o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.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=c(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=c(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})}}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=c(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=c(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})}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 s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.5`})),h=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=m()})),g=o((e=>{var t=p(),n=d(),r=h();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){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n: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 u(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 f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function ee(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?ee(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var te=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},ne=[],re=-1;function L(e){return{current:e}}function R(e){0>re||(e.current=ne[re],ne[re]=null,re--)}function z(e,t){re++,ne[re]=e.current,e.current=t}var ie=L(null),ae=L(null),oe=L(null),se=L(null);function ce(e,t){switch(z(oe,t),z(ae,e),z(ie,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Kd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Kd(t),e=qd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}R(ie),z(ie,e)}function le(){R(ie),R(ae),R(oe)}function ue(e){e.memoizedState!==null&&z(se,e);var t=ie.current,n=qd(t,e.type);t!==n&&(z(ae,e),z(ie,n))}function de(e){ae.current===e&&(R(ie),R(ae)),se.current===e&&(R(se),np._currentValue=I)}var fe,pe;function me(e){if(fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||``,pe=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+fe+e+pe}var he=!1;function ge(e,t){if(!e||he)return``;he=!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}e.call(n.prototype)}}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(`
4
+ `),l=s.split(`
5
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{he=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?me(n):``}function _e(e,t){switch(e.tag){case 26:case 27:case 5:return me(e.type);case 16:return me(`Lazy`);case 13:return e.child!==t&&t!==null?me(`Suspense Fallback`):me(`Suspense`);case 19:return me(`SuspenseList`);case 0:case 15:return ge(e.type,!1);case 11:return ge(e.type.render,!1);case 1:return ge(e.type,!0);case 31:return me(`Activity`);default:return``}}function ve(e){try{var t=``,n=null;do t+=_e(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var ye=Object.prototype.hasOwnProperty,be=t.unstable_scheduleCallback,xe=t.unstable_cancelCallback,Se=t.unstable_shouldYield,Ce=t.unstable_requestPaint,we=t.unstable_now,Te=t.unstable_getCurrentPriorityLevel,Ee=t.unstable_ImmediatePriority,De=t.unstable_UserBlockingPriority,Oe=t.unstable_NormalPriority,ke=t.unstable_LowPriority,Ae=t.unstable_IdlePriority,je=t.log,Me=t.unstable_setDisableYieldValue,Ne=null,Pe=null;function Fe(e){if(typeof je==`function`&&Me(e),Pe&&typeof Pe.setStrictMode==`function`)try{Pe.setStrictMode(Ne,e)}catch{}}var Ie=Math.clz32?Math.clz32:ze,Le=Math.log,Re=Math.LN2;function ze(e){return e>>>=0,e===0?32:31-(Le(e)/Re|0)|0}var Be=256,Ve=262144,B=4194304;function V(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function He(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=V(n))):i=V(o):i=V(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=V(n))):i=V(o)):i=V(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ue(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function We(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ge(){var e=B;return B<<=1,!(B&62914560)&&(B=4194304),e}function Ke(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Je(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ie(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ye(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ye(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ie(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Xe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ie(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ze(e,t){var n=t&-t;return n=n&42?1:Qe(n),(n&(e.suspendedLanes|t))===0?n:0}function Qe(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function $e(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function et(){var e=F.p;return e===0?(e=window.event,e===void 0?32:vp(e.type)):e}function tt(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var nt=Math.random().toString(36).slice(2),rt=`__reactFiber$`+nt,it=`__reactProps$`+nt,at=`__reactContainer$`+nt,ot=`__reactEvents$`+nt,st=`__reactListeners$`+nt,ct=`__reactHandles$`+nt,lt=`__reactResources$`+nt,ut=`__reactMarker$`+nt;function dt(e){delete e[rt],delete e[it],delete e[ot],delete e[st],delete e[ct]}function ft(e){var t=e[rt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[at]||n[rt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=gf(e);e!==null;){if(n=e[rt])return n;e=gf(e)}return t}e=n,n=e.parentNode}return null}function pt(e){if(e=e[rt]||e[at]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function mt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function ht(e){var t=e[lt];return t||=e[lt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function gt(e){e[ut]=!0}var _t=new Set,vt={};function yt(e,t){bt(e,t),bt(e+`Capture`,t)}function bt(e,t){for(vt[e]=t,e=0;e<t.length;e++)_t.add(t[e])}var xt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),St={},Ct={};function wt(e){return ye.call(Ct,e)?!0:ye.call(St,e)?!1:xt.test(e)?Ct[e]=!0:(St[e]=!0,!1)}function Tt(e,t,n){if(wt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Et(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Dt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Ot(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function kt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function At(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function jt(e){if(!e._valueTracker){var t=kt(e)?`checked`:`value`;e._valueTracker=At(e,t,``+e[t])}}function Mt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=kt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Nt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Pt=/[\n"\\]/g;function Ft(e){return e.replace(Pt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function It(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Ot(t)):e.value!==``+Ot(t)&&(e.value=``+Ot(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Rt(e,o,Ot(n)):Rt(e,o,Ot(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Ot(s):e.removeAttribute(`name`)}function Lt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){jt(e);return}n=n==null?``:``+Ot(n),t=t==null?n:``+Ot(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),jt(e)}function Rt(e,t,n){t===`number`&&Nt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function zt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Ot(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Bt(e,t,n){if(t!=null&&(t=``+Ot(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Ot(n)}function Vt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(te(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Ot(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),jt(e)}function Ht(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ut=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Wt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Ut.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Gt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Wt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Wt(e,o,t[o])}function Kt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var qt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Jt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Yt(e){return Jt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Xt(){}var Zt=null;function Qt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $t=null,en=null;function tn(e){var t=pt(e);if(t&&(e=t.stateNode)){var n=e[it]||null;a:switch(e=t.stateNode,t.type){case`input`:if(It(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Ft(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[it]||null;if(!a)throw Error(i(90));It(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Mt(r)}break a;case`textarea`:Bt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&zt(e,!!n.multiple,t,!1)}}}var nn=!1;function rn(e,t,n){if(nn)return e(t,n);nn=!0;try{return e(t)}finally{if(nn=!1,($t!==null||en!==null)&&(Cu(),$t&&(t=$t,e=en,en=$t=null,tn(t),e)))for(t=0;t<e.length;t++)tn(e[t])}}function an(e,t){var n=e.stateNode;if(n===null)return null;var r=n[it]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var on=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),sn=!1;if(on)try{var cn={};Object.defineProperty(cn,`passive`,{get:function(){sn=!0}}),window.addEventListener(`test`,cn,cn),window.removeEventListener(`test`,cn,cn)}catch{sn=!1}var ln=null,un=null,dn=null;function fn(){if(dn)return dn;var e,t=un,n=t.length,r,i=`value`in ln?ln.value:ln.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return dn=i.slice(e,1<r?1-r:void 0)}function pn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function mn(){return!0}function hn(){return!1}function gn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?mn:hn,this.isPropagationStopped=hn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=mn)},persist:function(){},isPersistent:mn}),t}var _n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vn=gn(_n),yn=m({},_n,{view:0,detail:0}),bn=gn(yn),xn,Sn,Cn,wn=m({},yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Cn&&(Cn&&e.type===`mousemove`?(xn=e.screenX-Cn.screenX,Sn=e.screenY-Cn.screenY):Sn=xn=0,Cn=e),xn)},movementY:function(e){return`movementY`in e?e.movementY:Sn}}),Tn=gn(wn),En=gn(m({},wn,{dataTransfer:0})),Dn=gn(m({},yn,{relatedTarget:0})),On=gn(m({},_n,{animationName:0,elapsedTime:0,pseudoElement:0})),kn=gn(m({},_n,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),An=gn(m({},_n,{data:0})),jn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Mn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Nn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Pn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nn[e])?!!t[e]:!1}function Fn(){return Pn}var In=gn(m({},yn,{key:function(e){if(e.key){var t=jn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=pn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Mn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fn,charCode:function(e){return e.type===`keypress`?pn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?pn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Ln=gn(m({},wn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Rn=gn(m({},yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fn})),zn=gn(m({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0})),Bn=gn(m({},wn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Vn=gn(m({},_n,{newState:0,oldState:0})),Hn=[9,13,27,32],Un=on&&`CompositionEvent`in window,Wn=null;on&&`documentMode`in document&&(Wn=document.documentMode);var Gn=on&&`TextEvent`in window&&!Wn,Kn=on&&(!Un||Wn&&8<Wn&&11>=Wn),qn=` `,Jn=!1;function Yn(e,t){switch(e){case`keyup`:return Hn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Xn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Zn=!1;function Qn(e,t){switch(e){case`compositionend`:return Xn(t);case`keypress`:return t.which===32?(Jn=!0,qn):null;case`textInput`:return e=t.data,e===qn&&Jn?null:e;default:return null}}function $n(e,t){if(Zn)return e===`compositionend`||!Un&&Yn(e,t)?(e=fn(),dn=un=ln=null,Zn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Kn&&t.locale!==`ko`?null:t.data;default:return null}}var er={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!er[e.type]:t===`textarea`}function nr(e,t,n,r){$t?en?en.push(r):en=[r]:$t=r,t=Ad(t,`onChange`),0<t.length&&(n=new vn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var rr=null,ir=null;function ar(e){Cd(e,0)}function or(e){if(Mt(mt(e)))return e}function sr(e,t){if(e===`change`)return t}var cr=!1;if(on){var lr;if(on){var ur=`oninput`in document;if(!ur){var dr=document.createElement(`div`);dr.setAttribute(`oninput`,`return;`),ur=typeof dr.oninput==`function`}lr=ur}else lr=!1;cr=lr&&(!document.documentMode||9<document.documentMode)}function fr(){rr&&(rr.detachEvent(`onpropertychange`,pr),ir=rr=null)}function pr(e){if(e.propertyName===`value`&&or(ir)){var t=[];nr(t,ir,e,Qt(e)),rn(ar,t)}}function mr(e,t,n){e===`focusin`?(fr(),rr=t,ir=n,rr.attachEvent(`onpropertychange`,pr)):e===`focusout`&&fr()}function hr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return or(ir)}function gr(e,t){if(e===`click`)return or(t)}function _r(e,t){if(e===`input`||e===`change`)return or(t)}function vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var yr=typeof Object.is==`function`?Object.is:vr;function br(e,t){if(yr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ye.call(t,i)||!yr(e[i],t[i]))return!1}return!0}function xr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sr(e,t){var n=xr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=xr(n)}}function Cr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Nt(e.document)}return t}function Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Er=on&&`documentMode`in document&&11>=document.documentMode,Dr=null,Or=null,kr=null,Ar=!1;function jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ar||Dr==null||Dr!==Nt(r)||(r=Dr,`selectionStart`in r&&Tr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),kr&&br(kr,r)||(kr=r,r=Ad(Or,`onSelect`),0<r.length&&(t=new vn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Dr)))}function Mr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Nr={animationend:Mr(`Animation`,`AnimationEnd`),animationiteration:Mr(`Animation`,`AnimationIteration`),animationstart:Mr(`Animation`,`AnimationStart`),transitionrun:Mr(`Transition`,`TransitionRun`),transitionstart:Mr(`Transition`,`TransitionStart`),transitioncancel:Mr(`Transition`,`TransitionCancel`),transitionend:Mr(`Transition`,`TransitionEnd`)},Pr={},Fr={};on&&(Fr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Nr.animationend.animation,delete Nr.animationiteration.animation,delete Nr.animationstart.animation),`TransitionEvent`in window||delete Nr.transitionend.transition);function Ir(e){if(Pr[e])return Pr[e];if(!Nr[e])return e;var t=Nr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Fr)return Pr[e]=t[n];return e}var Lr=Ir(`animationend`),Rr=Ir(`animationiteration`),zr=Ir(`animationstart`),Br=Ir(`transitionrun`),Vr=Ir(`transitionstart`),Hr=Ir(`transitioncancel`),Ur=Ir(`transitionend`),Wr=new Map,Gr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Gr.push(`scrollEnd`);function Kr(e,t){Wr.set(e,t),yt(t,[e])}var qr=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)},H=[],Jr=0,Yr=0;function Xr(){for(var e=Jr,t=Yr=Jr=0;t<e;){var n=H[t];H[t++]=null;var r=H[t];H[t++]=null;var i=H[t];H[t++]=null;var a=H[t];if(H[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ei(n,i,a)}}function Zr(e,t,n,r){H[Jr++]=e,H[Jr++]=t,H[Jr++]=n,H[Jr++]=r,Yr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Qr(e,t,n,r){return Zr(e,t,n,r),ti(e)}function $r(e,t){return Zr(e,null,null,t),ti(e)}function ei(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ie(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ti(e){if(50<mu)throw mu=0,hu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ni={};function ri(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ii(e,t,n,r){return new ri(e,t,n,r)}function ai(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oi(e,t){var n=e.alternate;return n===null?(n=ii(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function si(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ci(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ai(e)&&(s=1);else if(typeof e==`string`)s=qf(e,n,ie.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ii(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return li(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ii(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ii(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ii(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ii(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function li(e,t,n,r){return e=ii(7,e,r,t),e.lanes=n,e}function ui(e,t,n){return e=ii(6,e,null,t),e.lanes=n,e}function di(e){var t=ii(18,null,null,0);return t.stateNode=e,t}function fi(e,t,n){return t=ii(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var pi=new WeakMap;function mi(e,t){if(typeof e==`object`&&e){var n=pi.get(e);return n===void 0?(t={value:e,source:t,stack:ve(t)},pi.set(e,t),t):n}return{value:e,source:t,stack:ve(t)}}var hi=[],gi=0,_i=null,vi=0,yi=[],bi=0,xi=null,Si=1,Ci=``;function wi(e,t){hi[gi++]=vi,hi[gi++]=_i,_i=e,vi=t}function Ti(e,t,n){yi[bi++]=Si,yi[bi++]=Ci,yi[bi++]=xi,xi=e;var r=Si;e=Ci;var i=32-Ie(r)-1;r&=~(1<<i),n+=1;var a=32-Ie(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Si=1<<32-Ie(t)+i|n<<i|r,Ci=a+e}else Si=1<<a|n<<i|r,Ci=e}function Ei(e){e.return!==null&&(wi(e,1),Ti(e,1,0))}function Di(e){for(;e===_i;)_i=hi[--gi],hi[gi]=null,vi=hi[--gi],hi[gi]=null;for(;e===xi;)xi=yi[--bi],yi[bi]=null,Ci=yi[--bi],yi[bi]=null,Si=yi[--bi],yi[bi]=null}function Oi(e,t){yi[bi++]=Si,yi[bi++]=Ci,yi[bi++]=xi,Si=t.id,Ci=t.overflow,xi=e}var ki=null,Ai=null,U=!1,ji=null,Mi=!1,Ni=Error(i(519));function Pi(e){throw Bi(mi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ni}function Fi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[rt]=e,t[it]=r,n){case`dialog`:J(`cancel`,t),J(`close`,t);break;case`iframe`:case`object`:case`embed`:J(`load`,t);break;case`video`:case`audio`:for(n=0;n<xd.length;n++)J(xd[n],t);break;case`source`:J(`error`,t);break;case`img`:case`image`:case`link`:J(`error`,t),J(`load`,t);break;case`details`:J(`toggle`,t);break;case`input`:J(`invalid`,t),Lt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:J(`invalid`,t);break;case`textarea`:J(`invalid`,t),Vt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Id(t.textContent,n)?(r.popover!=null&&(J(`beforetoggle`,t),J(`toggle`,t)),r.onScroll!=null&&J(`scroll`,t),r.onScrollEnd!=null&&J(`scrollend`,t),r.onClick!=null&&(t.onclick=Xt),t=!0):t=!1,t||Pi(e,!0)}function Ii(e){for(ki=e.return;ki;)switch(ki.tag){case 5:case 31:case 13:Mi=!1;return;case 27:case 3:Mi=!0;return;default:ki=ki.return}}function Li(e){if(e!==ki)return!1;if(!U)return Ii(e),U=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Jd(e.type,e.memoizedProps)),n=!n),n&&Ai&&Pi(e),Ii(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ai=hf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ai=hf(e)}else t===27?(t=Ai,nf(e.type)?(e=mf,mf=null,Ai=e):Ai=t):Ai=ki?pf(e.stateNode.nextSibling):null;return!0}function Ri(){Ai=ki=null,U=!1}function zi(){var e=ji;return e!==null&&(eu===null?eu=e:eu.push.apply(eu,e),ji=null),e}function Bi(e){ji===null?ji=[e]:ji.push(e)}var Vi=L(null),Hi=null,Ui=null;function Wi(e,t,n){z(Vi,t._currentValue),t._currentValue=n}function Gi(e){e._currentValue=Vi.current,R(Vi)}function Ki(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function qi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ki(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ki(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ji(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;yr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===se.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[np]:e.push(np))}a=a.return}e!==null&&qi(t,e,n,r),t.flags|=262144}function Yi(e){for(e=e.firstContext;e!==null;){if(!yr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Xi(e){Hi=e,Ui=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zi(e){return $i(Hi,e)}function Qi(e,t){return Hi===null&&Xi(e),$i(e,t)}function $i(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ui===null){if(e===null)throw Error(i(308));Ui=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ui=Ui.next=t;return n}var ea=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ta=t.unstable_scheduleCallback,na=t.unstable_NormalPriority,ra={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ia(){return{controller:new ea,data:new Map,refCount:0}}function aa(e){e.refCount--,e.refCount===0&&ta(na,function(){e.controller.abort()})}var oa=null,sa=0,ca=0,la=null;function ua(e,t){if(oa===null){var n=oa=[];sa=0,ca=hd(),la={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return sa++,t.then(da,da),t}function da(){if(--sa===0&&oa!==null){la!==null&&(la.status=`fulfilled`);var e=oa;oa=null,ca=0,la=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function fa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var pa=P.S;P.S=function(e,t){ru=we(),typeof t==`object`&&t&&typeof t.then==`function`&&ua(e,t),pa!==null&&pa(e,t)};var ma=L(null);function ha(){var e=ma.current;return e===null?Bl.pooledCache:e}function ga(e,t){t===null?z(ma,ma.current):z(ma,t.pool)}function _a(){var e=ha();return e===null?null:{parent:ra._currentValue,pool:e}}var va=Error(i(460)),ya=Error(i(474)),ba=Error(i(542)),xa={then:function(){}};function Sa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ca(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Xt,Xt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Da(e),e;default:if(typeof t.status==`string`)t.then(Xt,Xt);else{if(e=Bl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Da(e),e}throw Ta=t,va}}function wa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ta=e,va):e}}var Ta=null;function Ea(){if(Ta===null)throw Error(i(459));var e=Ta;return Ta=null,e}function Da(e){if(e===va||e===ba)throw Error(i(483))}var Oa=null,ka=0;function Aa(e){var t=ka;return ka+=1,Oa===null&&(Oa=[]),Ca(Oa,e,t)}function ja(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ma(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Na(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=oi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ui(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&wa(i)===t.type)?(t=a(t,n.props),ja(t,n),t.return=e,t):(t=ci(n.type,n.key,n.props,null,e.mode,r),ja(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=fi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=li(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ui(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=ci(t.type,t.key,t.props,null,e.mode,n),ja(n,t),n.return=e,n;case v:return t=fi(t,e.mode,n),t.return=e,t;case O:return t=wa(t),f(e,t,n)}if(te(t)||M(t))return t=li(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Aa(t),n);if(t.$$typeof===C)return f(e,Qi(e,t),n);Ma(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=wa(n),p(e,t,n,r)}if(te(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Aa(n),r);if(n.$$typeof===C)return p(e,t,Qi(e,n),r);Ma(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=wa(r),m(e,t,n,r,i)}if(te(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Aa(r),i);if(r.$$typeof===C)return m(e,t,n,Qi(t,r),i);Ma(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),U&&wi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return U&&wi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),U&&wi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),U&&wi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return U&&wi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),U&&wi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&wa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ja(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=li(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ci(o.type,o.key,o.props,null,e.mode,c),ja(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=fi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=wa(o),b(e,r,o,c)}if(te(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Aa(o),c);if(o.$$typeof===C)return b(e,r,Qi(e,o),c);Ma(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=ui(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ka=0;var i=b(e,t,n,r);return Oa=null,i}catch(t){if(t===va||t===ba)throw t;var a=ii(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Pa=Na(!0),Fa=Na(!1),Ia=!1;function La(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ra(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function za(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ba(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,G&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ti(e),ei(e,null,n),t}return Zr(e,r,t,n),ti(e)}function Va(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xe(e,n)}}function Ha(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ua=!1;function Wa(){if(Ua){var e=la;if(e!==null)throw e}}function Ga(e,t,n,r){Ua=!1;var i=e.updateQueue;Ia=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(q&f)===f:(r&f)===f){f!==0&&f===ca&&(Ua=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ia=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Jl|=o,e.lanes=o,e.memoizedState=d}}function Ka(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function qa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ka(n[e],t)}var Ja=L(null),Ya=L(0);function Xa(e,t){e=Kl,z(Ya,e),z(Ja,t),Kl=e|t.baseLanes}function Za(){z(Ya,Kl),z(Ja,Ja.current)}function Qa(){Kl=Ya.current,R(Ja),R(Ya)}var $a=L(null),eo=null;function to(e){var t=e.alternate;z(oo,oo.current&1),z($a,e),eo===null&&(t===null||Ja.current!==null||t.memoizedState!==null)&&(eo=e)}function no(e){z(oo,oo.current),z($a,e),eo===null&&(eo=e)}function ro(e){e.tag===22?(z(oo,oo.current),z($a,e),eo===null&&(eo=e)):io(e)}function io(){z(oo,oo.current),z($a,$a.current)}function ao(e){R($a),eo===e&&(eo=null),R(oo)}var oo=L(0);function so(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||uf(n)||df(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var co=0,W=null,lo=null,uo=null,fo=!1,po=!1,mo=!1,ho=0,go=0,_o=null,vo=0;function yo(){throw Error(i(321))}function bo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!yr(e[n],t[n]))return!1;return!0}function xo(e,t,n,r,i,a){return co=a,W=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?Rs:zs,mo=!1,a=n(r,i),mo=!1,po&&(a=Co(t,n,r,i)),So(e),a}function So(e){P.H=Ls;var t=lo!==null&&lo.next!==null;if(co=0,uo=lo=W=null,fo=!1,go=0,_o=null,t)throw Error(i(300));e===null||nc||(e=e.dependencies,e!==null&&Yi(e)&&(nc=!0))}function Co(e,t,n,r){W=e;var a=0;do{if(po&&(_o=null),go=0,po=!1,25<=a)throw Error(i(301));if(a+=1,uo=lo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=Bs,o=t(n,r)}while(po);return o}function wo(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?jo(t):t,e=e.useState()[0],(lo===null?null:lo.memoizedState)!==e&&(W.flags|=1024),t}function To(){var e=ho!==0;return ho=0,e}function Eo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Do(e){if(fo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}fo=!1}co=0,uo=lo=W=null,po=!1,go=ho=0,_o=null}function Oo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return uo===null?W.memoizedState=uo=e:uo=uo.next=e,uo}function ko(){if(lo===null){var e=W.alternate;e=e===null?null:e.memoizedState}else e=lo.next;var t=uo===null?W.memoizedState:uo.next;if(t!==null)uo=t,lo=e;else{if(e===null)throw W.alternate===null?Error(i(467)):Error(i(310));lo=e,e={memoizedState:lo.memoizedState,baseState:lo.baseState,baseQueue:lo.baseQueue,queue:lo.queue,next:null},uo===null?W.memoizedState=uo=e:uo=uo.next=e}return uo}function Ao(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function jo(e){var t=go;return go+=1,_o===null&&(_o=[]),e=Ca(_o,e,t),t=W,(uo===null?t.memoizedState:uo.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?Rs:zs),e}function Mo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return jo(e);if(e.$$typeof===C)return Zi(e)}throw Error(i(438,String(e)))}function No(e){var t=null,n=W.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=W.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Ao(),W.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function Po(e,t){return typeof t==`function`?t(e):t}function Fo(e){return Io(ko(),lo,e)}function Io(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(co&f)===f:(q&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ca&&(d=!0);else if((co&p)===p){u=u.next,p===ca&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,W.lanes|=p,Jl|=p;f=u.action,mo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,W.lanes|=f,Jl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!yr(o,e.memoizedState)&&(nc=!0,d&&(n=la,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Lo(e){var t=ko(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);yr(o,t.memoizedState)||(nc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ro(e,t,n){var r=W,a=ko(),o=U;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!yr((lo||a).memoizedState,n);if(s&&(a.memoizedState=n,nc=!0),a=a.queue,ls(Vo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||uo!==null&&uo.memoizedState.tag&1){if(r.flags|=2048,is(9,{destroy:void 0},Bo.bind(null,r,a,n,t),null),Bl===null)throw Error(i(349));o||co&127||zo(r,t,n)}return n}function zo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=W.updateQueue,t===null?(t=Ao(),W.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Bo(e,t,n,r){t.value=n,t.getSnapshot=r,Ho(t)&&Uo(e)}function Vo(e,t,n){return n(function(){Ho(t)&&Uo(e)})}function Ho(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yr(e,n)}catch{return!0}}function Uo(e){var t=$r(e,2);t!==null&&vu(t,e,2)}function Wo(e){var t=Oo();if(typeof e==`function`){var n=e;if(e=n(),mo){Fe(!0);try{n()}finally{Fe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:e},t}function Go(e,t,n,r){return e.baseState=n,Io(e,lo,typeof r==`function`?r:Po)}function Ko(e,t,n,r,a){if(Ps(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,qo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function qo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),Jo(e,t,s)}catch(n){Xo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),Jo(e,t,a)}catch(n){Xo(e,t,n)}}function Jo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Yo(e,t,n)},function(n){return Xo(e,t,n)}):Yo(e,t,n)}function Yo(e,t,n){t.status=`fulfilled`,t.value=n,Zo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,qo(e,n)))}function Xo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Zo(t),t=t.next;while(t!==r)}e.action=null}function Zo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Qo(e,t){return t}function $o(e,t){if(U){var n=Bl.formState;if(n!==null){a:{var r=W;if(U){if(Ai){b:{for(var i=Ai,a=Mi;i.nodeType!==8;){if(!a){i=null;break b}if(i=pf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ai=pf(i.nextSibling),r=i.data===`F!`;break a}}Pi(r)}r=!1}r&&(t=n[0])}}return n=Oo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qo,lastRenderedState:t},n.queue=r,n=js.bind(null,W,r),r.dispatch=n,r=Wo(!1),a=Ns.bind(null,W,!1,r.queue),r=Oo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ko.bind(null,W,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function es(e){return ts(ko(),lo,e)}function ts(e,t,n){if(t=Io(e,t,Qo)[0],e=Fo(Po)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=jo(t)}catch(e){throw e===va?ba:e}else r=t;t=ko();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(W.flags|=2048,is(9,{destroy:void 0},ns.bind(null,i,n),null)),[r,a,e]}function ns(e,t){e.action=t}function rs(e){var t=ko(),n=lo;if(n!==null)return ts(t,n,e);ko(),t=t.memoizedState,n=ko();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function is(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=W.updateQueue,t===null&&(t=Ao(),W.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function as(){return ko().memoizedState}function os(e,t,n,r){var i=Oo();W.flags|=e,i.memoizedState=is(1|t,{destroy:void 0},n,r===void 0?null:r)}function ss(e,t,n,r){var i=ko();r=r===void 0?null:r;var a=i.memoizedState.inst;lo!==null&&r!==null&&bo(r,lo.memoizedState.deps)?i.memoizedState=is(t,a,n,r):(W.flags|=e,i.memoizedState=is(1|t,a,n,r))}function cs(e,t){os(8390656,8,e,t)}function ls(e,t){ss(2048,8,e,t)}function us(e){W.flags|=4;var t=W.updateQueue;if(t===null)t=Ao(),W.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ds(e){var t=ko().memoizedState;return us({ref:t,nextImpl:e}),function(){if(G&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function fs(e,t){return ss(4,2,e,t)}function ps(e,t){return ss(4,4,e,t)}function ms(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function hs(e,t,n){n=n==null?null:n.concat([e]),ss(4,4,ms.bind(null,t,e),n)}function gs(){}function _s(e,t){var n=ko();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&bo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function vs(e,t){var n=ko();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&bo(t,r[1]))return r[0];if(r=e(),mo){Fe(!0);try{e()}finally{Fe(!1)}}return n.memoizedState=[r,t],r}function ys(e,t,n){return n===void 0||co&1073741824&&!(q&261930)?e.memoizedState=t:(e.memoizedState=n,e=_u(),W.lanes|=e,Jl|=e,n)}function bs(e,t,n,r){return yr(n,t)?n:Ja.current===null?!(co&42)||co&1073741824&&!(q&261930)?(nc=!0,e.memoizedState=n):(e=_u(),W.lanes|=e,Jl|=e,t):(e=ys(e,n,r),yr(e,t)||(nc=!0),e)}function xs(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,Ns(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ms(e,t,fa(c,r),gu(e)):Ms(e,t,r,gu(e))}catch(n){Ms(e,t,{then:function(){},status:`rejected`,reason:n},gu())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function Ss(){}function Cs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ws(e).queue;xs(e,a,t,I,n===null?Ss:function(){return Ts(e),n(r)})}function ws(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:I},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ts(e){var t=ws(e);t.next===null&&(t=e.alternate.memoizedState),Ms(e,t.next.queue,{},gu())}function Es(){return Zi(np)}function Ds(){return ko().memoizedState}function Os(){return ko().memoizedState}function ks(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=gu();e=za(n);var r=Ba(t,e,n);r!==null&&(vu(r,t,n),Va(r,t,n)),t={cache:ia()},e.payload=t;return}t=t.return}}function As(e,t,n){var r=gu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ps(e)?Fs(t,n):(n=Qr(e,t,n,r),n!==null&&(vu(n,e,r),Is(n,t,r)))}function js(e,t,n){Ms(e,t,n,gu())}function Ms(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ps(e))Fs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,yr(s,o))return Zr(e,t,i,0),Bl===null&&Xr(),!1}catch{}if(n=Qr(e,t,i,r),n!==null)return vu(n,e,r),Is(n,t,r),!0}return!1}function Ns(e,t,n,r){if(r={lane:2,revertLane:hd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ps(e)){if(t)throw Error(i(479))}else t=Qr(e,n,r,2),t!==null&&vu(t,e,2)}function Ps(e){var t=e.alternate;return e===W||t!==null&&t===W}function Fs(e,t){po=fo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Is(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xe(e,n)}}var Ls={readContext:Zi,use:Mo,useCallback:yo,useContext:yo,useEffect:yo,useImperativeHandle:yo,useLayoutEffect:yo,useInsertionEffect:yo,useMemo:yo,useReducer:yo,useRef:yo,useState:yo,useDebugValue:yo,useDeferredValue:yo,useTransition:yo,useSyncExternalStore:yo,useId:yo,useHostTransitionStatus:yo,useFormState:yo,useActionState:yo,useOptimistic:yo,useMemoCache:yo,useCacheRefresh:yo};Ls.useEffectEvent=yo;var Rs={readContext:Zi,use:Mo,useCallback:function(e,t){return Oo().memoizedState=[e,t===void 0?null:t],e},useContext:Zi,useEffect:cs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),os(4194308,4,ms.bind(null,t,e),n)},useLayoutEffect:function(e,t){return os(4194308,4,e,t)},useInsertionEffect:function(e,t){os(4,2,e,t)},useMemo:function(e,t){var n=Oo();t=t===void 0?null:t;var r=e();if(mo){Fe(!0);try{e()}finally{Fe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Oo();if(n!==void 0){var i=n(t);if(mo){Fe(!0);try{n(t)}finally{Fe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=As.bind(null,W,e),[r.memoizedState,e]},useRef:function(e){var t=Oo();return e={current:e},t.memoizedState=e},useState:function(e){e=Wo(e);var t=e.queue,n=js.bind(null,W,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:gs,useDeferredValue:function(e,t){return ys(Oo(),e,t)},useTransition:function(){var e=Wo(!1);return e=xs.bind(null,W,e.queue,!0,!1),Oo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=W,a=Oo();if(U){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Bl===null)throw Error(i(349));q&127||zo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,cs(Vo.bind(null,r,o,e),[e]),r.flags|=2048,is(9,{destroy:void 0},Bo.bind(null,r,o,n,t),null),n},useId:function(){var e=Oo(),t=Bl.identifierPrefix;if(U){var n=Ci,r=Si;n=(r&~(1<<32-Ie(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=ho++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=vo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Es,useFormState:$o,useActionState:$o,useOptimistic:function(e){var t=Oo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ns.bind(null,W,!0,n),n.dispatch=t,[e,t]},useMemoCache:No,useCacheRefresh:function(){return Oo().memoizedState=ks.bind(null,W)},useEffectEvent:function(e){var t=Oo(),n={impl:e};return t.memoizedState=n,function(){if(G&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},zs={readContext:Zi,use:Mo,useCallback:_s,useContext:Zi,useEffect:ls,useImperativeHandle:hs,useInsertionEffect:fs,useLayoutEffect:ps,useMemo:vs,useReducer:Fo,useRef:as,useState:function(){return Fo(Po)},useDebugValue:gs,useDeferredValue:function(e,t){return bs(ko(),lo.memoizedState,e,t)},useTransition:function(){var e=Fo(Po)[0],t=ko().memoizedState;return[typeof e==`boolean`?e:jo(e),t]},useSyncExternalStore:Ro,useId:Ds,useHostTransitionStatus:Es,useFormState:es,useActionState:es,useOptimistic:function(e,t){return Go(ko(),lo,e,t)},useMemoCache:No,useCacheRefresh:Os};zs.useEffectEvent=ds;var Bs={readContext:Zi,use:Mo,useCallback:_s,useContext:Zi,useEffect:ls,useImperativeHandle:hs,useInsertionEffect:fs,useLayoutEffect:ps,useMemo:vs,useReducer:Lo,useRef:as,useState:function(){return Lo(Po)},useDebugValue:gs,useDeferredValue:function(e,t){var n=ko();return lo===null?ys(n,e,t):bs(n,lo.memoizedState,e,t)},useTransition:function(){var e=Lo(Po)[0],t=ko().memoizedState;return[typeof e==`boolean`?e:jo(e),t]},useSyncExternalStore:Ro,useId:Ds,useHostTransitionStatus:Es,useFormState:rs,useActionState:rs,useOptimistic:function(e,t){var n=ko();return lo===null?(n.baseState=e,[e,n.queue.dispatch]):Go(n,lo,e,t)},useMemoCache:No,useCacheRefresh:Os};Bs.useEffectEvent=ds;function Vs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Hs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=gu(),i=za(r);i.payload=t,n!=null&&(i.callback=n),t=Ba(e,i,r),t!==null&&(vu(t,e,r),Va(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=gu(),i=za(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ba(e,i,r),t!==null&&(vu(t,e,r),Va(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gu(),r=za(n);r.tag=2,t!=null&&(r.callback=t),t=Ba(e,r,n),t!==null&&(vu(t,e,n),Va(t,e,n))}};function Us(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!br(n,r)||!br(i,a):!0}function Ws(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Hs.enqueueReplaceState(t,t.state,null)}function Gs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ks(e){qr(e)}function qs(e){console.error(e)}function Js(e){qr(e)}function Ys(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Xs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Zs(e,t,n){return n=za(n),n.tag=3,n.payload={element:null},n.callback=function(){Ys(e,t)},n}function Qs(e){return e=za(e),e.tag=3,e}function $s(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Xs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Xs(t,n,r),typeof i!=`function`&&(ou===null?ou=new Set([this]):ou.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function ec(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ji(t,n,a,!0),n=$a.current,n!==null){switch(n.tag){case 31:case 13:return eo===null?Au():n.alternate===null&&ql===0&&(ql=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Yu(e,r,a)),!1;case 22:return n.flags|=65536,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Yu(e,r,a)),!1}throw Error(i(435,n.tag))}return Yu(e,r,a),Au(),!1}if(U)return t=$a.current,t===null?(r!==Ni&&(t=Error(i(423),{cause:r}),Bi(mi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=mi(r,n),a=Zs(e.stateNode,r,a),Ha(e,a),ql!==4&&(ql=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ni&&(e=Error(i(422),{cause:r}),Bi(mi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=mi(o,n),$l===null?$l=[o]:$l.push(o),ql!==4&&(ql=2),t===null)return!0;r=mi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Zs(n.stateNode,r,e),Ha(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ou===null||!ou.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Qs(a),$s(a,e,n,r),Ha(n,a),!1}n=n.return}while(n!==null);return!1}var tc=Error(i(461)),nc=!1;function rc(e,t,n,r){t.child=e===null?Fa(t,null,n,r):Pa(t,e.child,n,r)}function ic(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Xi(t),r=xo(e,t,n,o,a,i),s=To(),e!==null&&!nc?(Eo(e,t,i),Oc(e,t,i)):(U&&s&&Ei(t),t.flags|=1,rc(e,t,r,i),t.child)}function ac(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ai(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,oc(e,t,a,r,i)):(e=ci(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!kc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?br:n,n(o,r)&&e.ref===t.ref)return Oc(e,t,i)}return t.flags|=1,e=oi(a,r),e.ref=t.ref,e.return=t,t.child=e}function oc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(br(a,r)&&e.ref===t.ref)if(nc=!1,t.pendingProps=r=a,kc(e,i))e.flags&131072&&(nc=!0);else return t.lanes=e.lanes,Oc(e,t,i)}return mc(e,t,n,r,i)}function sc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return lc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ga(t,a===null?null:a.cachePool),a===null?Za():Xa(t,a),ro(t);else return r=t.lanes=536870912,lc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ga(t,null),Za(),io(t)):(ga(t,a.cachePool),Xa(t,a),io(t),t.memoizedState=null);return rc(e,t,i,n),t.child}function cc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function lc(e,t,n,r,i){var a=ha();return a=a===null?null:{parent:ra._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ga(t,null),Za(),ro(t),e!==null&&Ji(e,t,r,!0),t.childLanes=i,null}function uc(e,t){return t=Cc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function dc(e,t,n){return Pa(t,e.child,null,n),e=uc(t,t.pendingProps),e.flags|=2,ao(t),t.memoizedState=null,e}function fc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(U){if(r.mode===`hidden`)return e=uc(t,r),t.lanes=536870912,cc(null,e);if(no(t),(e=Ai)?(e=lf(e,Mi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xi===null?null:{id:Si,overflow:Ci},retryLane:536870912,hydrationErrors:null},n=di(e),n.return=t,t.child=n,ki=t,Ai=null)):e=null,e===null)throw Pi(t);return t.lanes=536870912,null}return uc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(no(t),a)if(t.flags&256)t.flags&=-257,t=dc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(nc||Ji(e,t,n,!1),a=(n&e.childLanes)!==0,nc||a){if(r=Bl,r!==null&&(s=Ze(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,$r(e,s),vu(r,e,s),tc;Au(),t=dc(e,t,n)}else e=o.treeContext,Ai=pf(s.nextSibling),ki=t,U=!0,ji=null,Mi=!1,e!==null&&Oi(t,e),t=uc(t,r),t.flags|=4096;return t}return e=oi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function pc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function mc(e,t,n,r,i){return Xi(t),n=xo(e,t,n,r,void 0,i),r=To(),e!==null&&!nc?(Eo(e,t,i),Oc(e,t,i)):(U&&r&&Ei(t),t.flags|=1,rc(e,t,n,i),t.child)}function hc(e,t,n,r,i,a){return Xi(t),t.updateQueue=null,n=Co(t,r,n,i),So(e),r=To(),e!==null&&!nc?(Eo(e,t,a),Oc(e,t,a)):(U&&r&&Ei(t),t.flags|=1,rc(e,t,n,a),t.child)}function gc(e,t,n,r,i){if(Xi(t),t.stateNode===null){var a=ni,o=n.contextType;typeof o==`object`&&o&&(a=Zi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Hs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},La(t),o=n.contextType,a.context=typeof o==`object`&&o?Zi(o):ni,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Vs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Hs.enqueueReplaceState(a,a.state,null),Ga(t,r,a,i),Wa(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Gs(n,s);a.props=c;var l=a.context,u=n.contextType;o=ni,typeof u==`object`&&u&&(o=Zi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Ws(t,a,r,o),Ia=!1;var f=t.memoizedState;a.state=f,Ga(t,r,a,i),Wa(),l=t.memoizedState,s||f!==l||Ia?(typeof d==`function`&&(Vs(t,n,d,r),l=t.memoizedState),(c=Ia||Us(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ra(e,t),o=t.memoizedProps,u=Gs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ni,typeof l==`object`&&l&&(c=Zi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Ws(t,a,r,c),Ia=!1,f=t.memoizedState,a.state=f,Ga(t,r,a,i),Wa();var p=t.memoizedState;o!==d||f!==p||Ia||e!==null&&e.dependencies!==null&&Yi(e.dependencies)?(typeof s==`function`&&(Vs(t,n,s,r),p=t.memoizedState),(u=Ia||Us(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Yi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,pc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Pa(t,e.child,null,i),t.child=Pa(t,null,n,i)):rc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Oc(e,t,i),e}function _c(e,t,n,r){return Ri(),t.flags|=256,rc(e,t,n,r),t.child}var vc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function yc(e){return{baseLanes:e,cachePool:_a()}}function bc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Zl),e}function xc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(oo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(U){if(a?to(t):io(t),(e=Ai)?(e=lf(e,Mi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xi===null?null:{id:Si,overflow:Ci},retryLane:536870912,hydrationErrors:null},n=di(e),n.return=t,t.child=n,ki=t,Ai=null)):e=null,e===null)throw Pi(t);return df(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(io(t),a=t.mode,c=Cc({mode:`hidden`,children:c},a),r=li(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=yc(n),r.childLanes=bc(e,s,n),t.memoizedState=vc,cc(null,r)):(to(t),Sc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(to(t),t.flags&=-257,t=wc(e,t,n)):t.memoizedState===null?(io(t),c=r.fallback,a=t.mode,r=Cc({mode:`visible`,children:r.children},a),c=li(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Pa(t,e.child,null,n),r=t.child,r.memoizedState=yc(n),r.childLanes=bc(e,s,n),t.memoizedState=vc,t=cc(null,r)):(io(t),t.child=e.child,t.flags|=128,t=null);else if(to(t),df(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Bi({value:r,source:null,stack:null}),t=wc(e,t,n)}else if(nc||Ji(e,t,n,!1),s=(n&e.childLanes)!==0,nc||s){if(s=Bl,s!==null&&(r=Ze(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,$r(e,r),vu(s,e,r),tc;uf(c)||Au(),t=wc(e,t,n)}else uf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ai=pf(c.nextSibling),ki=t,U=!0,ji=null,Mi=!1,e!==null&&Oi(t,e),t=Sc(t,r.children),t.flags|=4096);return t}return a?(io(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=oi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=li(c,a,n,null),c.flags|=2):c=oi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,cc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=yc(n):(a=c.cachePool,a===null?a=_a():(l=ra._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=bc(e,s,n),t.memoizedState=vc,cc(e.child,r)):(to(t),n=e.child,e=n.sibling,n=oi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Sc(e,t){return t=Cc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Cc(e,t){return e=ii(22,e,null,t),e.lanes=0,e}function wc(e,t,n){return Pa(t,e.child,null,n),e=Sc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Tc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ki(e.return,t,n)}function Ec(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Dc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=oo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,z(oo,o),rc(e,t,r,n),r=U?vi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Tc(e,n,t);else if(e.tag===19)Tc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&so(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ec(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&so(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ec(t,!0,n,null,a,r);break;case`together`:Ec(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Oc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Jl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ji(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=oi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=oi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function kc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Yi(e))):!0}function Ac(e,t,n){switch(t.tag){case 3:ce(t,t.stateNode.containerInfo),Wi(t,ra,e.memoizedState.cache),Ri();break;case 27:case 5:ue(t);break;case 4:ce(t,t.stateNode.containerInfo);break;case 10:Wi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,no(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(to(t),e=Oc(e,t,n),e===null?null:e.sibling):xc(e,t,n):(to(t),t.flags|=128,null);to(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ji(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Dc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),z(oo,oo.current),r)break;return null;case 22:return t.lanes=0,sc(e,t,n,t.pendingProps);case 24:Wi(t,ra,e.memoizedState.cache)}return Oc(e,t,n)}function jc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)nc=!0;else{if(!kc(e,n)&&!(t.flags&128))return nc=!1,Ac(e,t,n);nc=!!(e.flags&131072)}else nc=!1,U&&t.flags&1048576&&Ti(t,vi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=wa(t.elementType),t.type=e,typeof e==`function`)ai(e)?(r=Gs(e,r),t.tag=1,t=gc(null,t,e,r,n)):(t.tag=0,t=mc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=ic(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=ac(null,t,e,r,n);break a}}throw t=ee(e)||e,Error(i(306,t,``))}}return t;case 0:return mc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Gs(r,t.pendingProps),gc(e,t,r,a,n);case 3:a:{if(ce(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ra(e,t),Ga(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Wi(t,ra,r),r!==o.cache&&qi(t,[ra],n,!0),Wa(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=_c(e,t,r,n);break a}else if(r!==a){a=mi(Error(i(424)),t),Bi(a),t=_c(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ai=pf(e.firstChild),ki=t,U=!0,ji=null,Mi=!0,n=Fa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ri(),r===a){t=Oc(e,t,n);break a}rc(e,t,r,n)}t=t.child}return t;case 26:return pc(e,t),e===null?(n=Pf(t.type,null,t.pendingProps,null))?t.memoizedState=n:U||(n=t.type,e=t.pendingProps,r=Gd(oe.current).createElement(n),r[rt]=t,r[it]=e,zd(r,n,e),gt(r),t.stateNode=r):t.memoizedState=Pf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ue(t),e===null&&U&&(r=t.stateNode=_f(t.type,t.pendingProps,oe.current),ki=t,Mi=!0,a=Ai,nf(t.type)?(mf=a,Ai=pf(r.firstChild)):Ai=a),rc(e,t,t.pendingProps.children,n),pc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&U&&((a=r=Ai)&&(r=sf(r,t.type,t.pendingProps,Mi),r===null?a=!1:(t.stateNode=r,ki=t,Ai=pf(r.firstChild),Mi=!1,a=!0)),a||Pi(t)),ue(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Jd(a,o)?r=null:s!==null&&Jd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=xo(e,t,wo,null,null,n),np._currentValue=a),pc(e,t),rc(e,t,r,n),t.child;case 6:return e===null&&U&&((e=n=Ai)&&(n=cf(n,t.pendingProps,Mi),n===null?e=!1:(t.stateNode=n,ki=t,Ai=null,e=!0)),e||Pi(t)),null;case 13:return xc(e,t,n);case 4:return ce(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pa(t,null,r,n):rc(e,t,r,n),t.child;case 11:return ic(e,t,t.type,t.pendingProps,n);case 7:return rc(e,t,t.pendingProps,n),t.child;case 8:return rc(e,t,t.pendingProps.children,n),t.child;case 12:return rc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Wi(t,t.type,r.value),rc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Xi(t),a=Zi(a),r=r(a),t.flags|=1,rc(e,t,r,n),t.child;case 14:return ac(e,t,t.type,t.pendingProps,n);case 15:return oc(e,t,t.type,t.pendingProps,n);case 19:return Dc(e,t,n);case 31:return fc(e,t,n);case 22:return sc(e,t,n,t.pendingProps);case 24:return Xi(t),r=Zi(ra),e===null?(a=ha(),a===null&&(a=Bl,o=ia(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},La(t),Wi(t,ra,a)):((e.lanes&n)!==0&&(Ra(e,t),Ga(t,null,null,n),Wa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Wi(t,ra,r),r!==a.cache&&qi(t,[ra],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Wi(t,ra,r))),rc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Mc(e){e.flags|=4}function Nc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Du())e.flags|=8192;else throw Ta=xa,ya}else e.flags&=-16777217}function Pc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Jf(t))if(Du())e.flags|=8192;else throw Ta=xa,ya}function Fc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ge(),e.lanes|=t,Ql|=t)}function Ic(e,t){if(!U)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Lc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Rc(e,t,n){var r=t.pendingProps;switch(Di(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lc(t),null;case 1:return Lc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Gi(ra),le(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Li(t)?Mc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,zi())),Lc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Mc(t),o===null?(Lc(t),Nc(t,a,null,r,n)):(Lc(t),Pc(t,o))):o?o===e.memoizedState?(Lc(t),t.flags&=-16777217):(Mc(t),Lc(t),Pc(t,o)):(e=e.memoizedProps,e!==r&&Mc(t),Lc(t),Nc(t,a,e,r,n)),null;case 27:if(de(t),n=oe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Lc(t),null}e=ie.current,Li(t)?Fi(t,e):(e=_f(a,r,n),t.stateNode=e,Mc(t))}return Lc(t),null;case 5:if(de(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Lc(t),null}if(o=ie.current,Li(t))Fi(t,o);else{var s=Gd(oe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[rt]=t,o[it]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(zd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Mc(t)}}return Lc(t),Nc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Mc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=oe.current,Li(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ki,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[rt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Id(e.nodeValue,n)),e||Pi(t,!0)}else e=Gd(e).createTextNode(r),e[rt]=t,t.stateNode=e}return Lc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Li(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[rt]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Lc(t),e=!1}else n=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ao(t),t):(ao(t),null);if(t.flags&128)throw Error(i(558))}return Lc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Li(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[rt]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Lc(t),a=!1}else a=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ao(t),t):(ao(t),null)}return ao(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Fc(t,t.updateQueue),Lc(t),null);case 4:return le(),e===null&&Ed(t.stateNode.containerInfo),Lc(t),null;case 10:return Gi(t.type),Lc(t),null;case 19:if(R(oo),r=t.memoizedState,r===null)return Lc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Ic(r,!1);else{if(ql!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=so(e),o!==null){for(t.flags|=128,Ic(r,!1),e=o.updateQueue,t.updateQueue=e,Fc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)si(n,e),n=n.sibling;return z(oo,oo.current&1|2),U&&wi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&we()>iu&&(t.flags|=128,a=!0,Ic(r,!1),t.lanes=4194304)}else{if(!a)if(e=so(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Fc(t,e),Ic(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!U)return Lc(t),null}else 2*we()-r.renderingStartTime>iu&&n!==536870912&&(t.flags|=128,a=!0,Ic(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Lc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=we(),e.sibling=null,n=oo.current,z(oo,a?n&1|2:n&1),U&&wi(t,r.treeForkCount),e);case 22:case 23:return ao(t),Qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Lc(t),t.subtreeFlags&6&&(t.flags|=8192)):Lc(t),n=t.updateQueue,n!==null&&Fc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&R(ma),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Gi(ra),Lc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function zc(e,t){switch(Di(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gi(ra),le(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return de(t),null;case 31:if(t.memoizedState!==null){if(ao(t),t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ao(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return R(oo),null;case 4:return le(),null;case 10:return Gi(t.type),null;case 22:case 23:return ao(t),Qa(),e!==null&&R(ma),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Gi(ra),null;case 25:return null;default:return null}}function Bc(e,t){switch(Di(t),t.tag){case 3:Gi(ra),le();break;case 26:case 27:case 5:de(t);break;case 4:le();break;case 31:t.memoizedState!==null&&ao(t);break;case 13:ao(t);break;case 19:R(oo);break;case 10:Gi(t.type);break;case 22:case 23:ao(t),Qa(),e!==null&&R(ma);break;case 24:Gi(ra)}}function Vc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ju(t,t.return,e)}}function Hc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Ju(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ju(t,t.return,e)}}function Uc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{qa(t,n)}catch(t){Ju(e,e.return,t)}}}function Wc(e,t,n){n.props=Gs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ju(e,t,n)}}function Gc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ju(e,t,n)}}function Kc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Ju(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Ju(e,t,n)}else n.current=null}function qc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ju(e,e.return,t)}}function Jc(e,t,n){try{var r=e.stateNode;Bd(r,e.type,n,t),r[it]=t}catch(t){Ju(e,e.return,t)}}function Yc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&nf(e.type)||e.tag===4}function Xc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Yc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&nf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Xt));else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&nf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}function $c(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);zd(t,r,n),t[rt]=e,t[it]=n}catch(t){Ju(e,e.return,t)}}var el=!1,tl=!1,nl=!1,rl=typeof WeakSet==`function`?WeakSet:Set,il=null;function al(e,t){if(e=e.containerInfo,Ud=dp,e=wr(e),Tr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Wd={focusedElem:e,selectionRange:n},dp=!1,il=t;il!==null;)if(t=il,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,il=e;else for(;il!==null;){switch(t=il,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Gs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ju(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)of(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:of(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,il=e;break}il=t.return}}function ol(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:xl(e,n),r&4&&Vc(5,n);break;case 1:if(xl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ju(n,n.return,e)}else{var i=Gs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ju(n,n.return,e)}}r&64&&Uc(n),r&512&&Gc(n,n.return);break;case 3:if(xl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{qa(e,t)}catch(e){Ju(n,n.return,e)}}break;case 27:t===null&&r&4&&$c(n);case 26:case 5:xl(e,n),t===null&&r&4&&qc(n),r&512&&Gc(n,n.return);break;case 12:xl(e,n);break;case 31:xl(e,n),r&4&&fl(e,n);break;case 13:xl(e,n),r&4&&pl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Qu.bind(null,n),ff(e,n))));break;case 22:if(r=n.memoizedState!==null||el,!r){t=t!==null&&t.memoizedState!==null||tl,i=el;var a=tl;el=r,(tl=t)&&!a?Cl(e,n,(n.subtreeFlags&8772)!=0):xl(e,n),el=i,tl=a}break;case 30:break;default:xl(e,n)}}function sl(e){var t=e.alternate;t!==null&&(e.alternate=null,sl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&dt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var cl=null,ll=!1;function ul(e,t,n){for(n=n.child;n!==null;)dl(e,t,n),n=n.sibling}function dl(e,t,n){if(Pe&&typeof Pe.onCommitFiberUnmount==`function`)try{Pe.onCommitFiberUnmount(Ne,n)}catch{}switch(n.tag){case 26:tl||Kc(n,t),ul(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:tl||Kc(n,t);var r=cl,i=ll;nf(n.type)&&(cl=n.stateNode,ll=!1),ul(e,t,n),vf(n.stateNode),cl=r,ll=i;break;case 5:tl||Kc(n,t);case 6:if(r=cl,i=ll,cl=null,ul(e,t,n),cl=r,ll=i,cl!==null)if(ll)try{(cl.nodeType===9?cl.body:cl.nodeName===`HTML`?cl.ownerDocument.body:cl).removeChild(n.stateNode)}catch(e){Ju(n,t,e)}else try{cl.removeChild(n.stateNode)}catch(e){Ju(n,t,e)}break;case 18:cl!==null&&(ll?(e=cl,rf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Lp(e)):rf(cl,n.stateNode));break;case 4:r=cl,i=ll,cl=n.stateNode.containerInfo,ll=!0,ul(e,t,n),cl=r,ll=i;break;case 0:case 11:case 14:case 15:Hc(2,n,t),tl||Hc(4,n,t),ul(e,t,n);break;case 1:tl||(Kc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Wc(n,t,r)),ul(e,t,n);break;case 21:ul(e,t,n);break;case 22:tl=(r=tl)||n.memoizedState!==null,ul(e,t,n),tl=r;break;default:ul(e,t,n)}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Lp(e)}catch(e){Ju(t,t.return,e)}}}function pl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Lp(e)}catch(e){Ju(t,t.return,e)}}function ml(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new rl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new rl),t;default:throw Error(i(435,e.tag))}}function hl(e,t){var n=ml(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=$u.bind(null,e,t);t.then(r,r)}})}function gl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(nf(c.type)){cl=c.stateNode,ll=!1;break a}break;case 5:cl=c.stateNode,ll=!1;break a;case 3:case 4:cl=c.stateNode.containerInfo,ll=!0;break a}c=c.return}if(cl===null)throw Error(i(160));dl(o,s,a),cl=null,ll=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)vl(t,e),t=t.sibling}var _l=null;function vl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gl(t,e),yl(e),r&4&&(Hc(3,e,e.return),Vc(3,e),Hc(5,e,e.return));break;case 1:gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),r&64&&el&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=_l;if(gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ut]||o[rt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),zd(o,r,n),o[rt]=e,gt(o),r=o;break a;case`link`:var s=Gf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Gf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),zd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[rt]=e,gt(o),r=o}e.stateNode=r}else Kf(a,e.type,e.stateNode);else e.stateNode=Bf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Jc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Kf(a,e.type,e.stateNode):Bf(a,r,e.memoizedProps))}break;case 27:gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),n!==null&&r&4&&Jc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(gl(t,e),yl(e),r&512&&(tl||n===null||Kc(n,n.return)),e.flags&32){a=e.stateNode;try{Ht(a,``)}catch(t){Ju(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Jc(e,a,n===null?a:n.memoizedProps)),r&1024&&(nl=!0);break;case 6:if(gl(t,e),yl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ju(e,e.return,t)}}break;case 3:if(Wf=null,a=_l,_l=xf(t.containerInfo),gl(t,e),_l=a,yl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Lp(t.containerInfo)}catch(t){Ju(e,e.return,t)}nl&&(nl=!1,bl(e));break;case 4:r=_l,_l=xf(e.stateNode.containerInfo),gl(t,e),yl(e),_l=r;break;case 12:gl(t,e),yl(e);break;case 31:gl(t,e),yl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 13:gl(t,e),yl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(nu=we()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=el,d=tl;if(el=u||a,tl=d||l,gl(t,e),tl=d,el=u,yl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||el||tl||Sl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Ju(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Ju(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?af(m,!0):af(l.stateNode,!1)}catch(e){Ju(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,hl(e,n))));break;case 19:gl(t,e),yl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,hl(e,r)));break;case 30:break;case 21:break;default:gl(t,e),yl(e)}}function yl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Yc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Qc(e,Xc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Ht(o,``),n.flags&=-33),Qc(e,Xc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Zc(e,Xc(e),s);break;default:throw Error(i(161))}}catch(t){Ju(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function xl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ol(e,t.alternate,t),t=t.sibling}function Sl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Hc(4,t,t.return),Sl(t);break;case 1:Kc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Wc(t,t.return,n),Sl(t);break;case 27:vf(t.stateNode);case 26:case 5:Kc(t,t.return),Sl(t);break;case 22:t.memoizedState===null&&Sl(t);break;case 30:Sl(t);break;default:Sl(t)}e=e.sibling}}function Cl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Cl(i,a,n),Vc(4,a);break;case 1:if(Cl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ju(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ka(c[i],s)}catch(e){Ju(r,r.return,e)}}n&&o&64&&Uc(a),Gc(a,a.return);break;case 27:$c(a);case 26:case 5:Cl(i,a,n),n&&r===null&&o&4&&qc(a),Gc(a,a.return);break;case 12:Cl(i,a,n);break;case 31:Cl(i,a,n),n&&o&4&&fl(i,a);break;case 13:Cl(i,a,n),n&&o&4&&pl(i,a);break;case 22:a.memoizedState===null&&Cl(i,a,n),Gc(a,a.return);break;case 30:break;default:Cl(i,a,n)}t=t.sibling}}function wl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&aa(n))}function Tl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e))}function El(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Dl(e,t,n,r),t=t.sibling}function Dl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:El(e,t,n,r),i&2048&&Vc(9,t);break;case 1:El(e,t,n,r);break;case 3:El(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e)));break;case 12:if(i&2048){El(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Ju(t,t.return,e)}}else El(e,t,n,r);break;case 31:El(e,t,n,r);break;case 13:El(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?El(e,t,n,r):(a._visibility|=2,Ol(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?El(e,t,n,r):kl(e,t),i&2048&&wl(o,t);break;case 24:El(e,t,n,r),i&2048&&Tl(t.alternate,t);break;default:El(e,t,n,r)}}function Ol(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Ol(a,o,s,c,i),Vc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ol(a,o,s,c,i)):u._visibility&2?Ol(a,o,s,c,i):kl(a,o),i&&l&2048&&wl(o.alternate,o);break;case 24:Ol(a,o,s,c,i),i&&l&2048&&Tl(o.alternate,o);break;default:Ol(a,o,s,c,i)}t=t.sibling}}function kl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:kl(n,r),i&2048&&wl(r.alternate,r);break;case 24:kl(n,r),i&2048&&Tl(r.alternate,r);break;default:kl(n,r)}t=t.sibling}}var Al=8192;function jl(e,t,n){if(e.subtreeFlags&Al)for(e=e.child;e!==null;)Ml(e,t,n),e=e.sibling}function Ml(e,t,n){switch(e.tag){case 26:jl(e,t,n),e.flags&Al&&e.memoizedState!==null&&Yf(n,_l,e.memoizedState,e.memoizedProps);break;case 5:jl(e,t,n);break;case 3:case 4:var r=_l;_l=xf(e.stateNode.containerInfo),jl(e,t,n),_l=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Al,Al=16777216,jl(e,t,n),Al=r):jl(e,t,n));break;default:jl(e,t,n)}}function Nl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Pl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];il=r,Ll(r,e)}Nl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Fl(e),e=e.sibling}function Fl(e){switch(e.tag){case 0:case 11:case 15:Pl(e),e.flags&2048&&Hc(9,e,e.return);break;case 3:Pl(e);break;case 12:Pl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Il(e)):Pl(e);break;default:Pl(e)}}function Il(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];il=r,Ll(r,e)}Nl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Hc(8,t,t.return),Il(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Il(t));break;default:Il(t)}e=e.sibling}}function Ll(e,t){for(;il!==null;){var n=il;switch(n.tag){case 0:case 11:case 15:Hc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:aa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,il=r;else a:for(n=e;il!==null;){r=il;var i=r.sibling,a=r.return;if(sl(r),r===n){il=null;break a}if(i!==null){i.return=a,il=i;break a}il=a}}}var Rl={getCacheForType:function(e){var t=Zi(ra),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Zi(ra).controller.signal}},zl=typeof WeakMap==`function`?WeakMap:Map,G=0,Bl=null,K=null,q=0,Vl=0,Hl=null,Ul=!1,Wl=!1,Gl=!1,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=null,eu=null,tu=!1,nu=0,ru=0,iu=1/0,au=null,ou=null,su=0,cu=null,lu=null,uu=0,du=0,fu=null,pu=null,mu=0,hu=null;function gu(){return G&2&&q!==0?q&-q:P.T===null?et():hd()}function _u(){if(Zl===0)if(!(q&536870912)||U){var e=Ve;Ve<<=1,!(Ve&3932160)&&(Ve=262144),Zl=e}else Zl=536870912;return e=$a.current,e!==null&&(e.flags|=32),Zl}function vu(e,t,n){(e===Bl&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)&&(Tu(e,0),Su(e,q,Zl,!1)),qe(e,n),(!(G&2)||e!==Bl)&&(e===Bl&&(!(G&2)&&(Yl|=n),ql===4&&Su(e,q,Zl,!1)),sd(e))}function yu(e,t,n){if(G&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ue(e,t),a=r?Nu(e,t):ju(e,t,!0),o=r;do{if(a===0){Wl&&!r&&Su(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!xu(n)){a=ju(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=$l;var l=c.current.memoizedState.isDehydrated;if(l&&(Tu(c,s).flags|=256),s=ju(c,s,!1),s!==2){if(Gl&&!l){c.errorRecoveryDisabledLanes|=o,Yl|=o,a=4;break a}o=eu,eu=a,o!==null&&(eu===null?eu=o:eu.push.apply(eu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Tu(e,0),Su(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Su(r,t,Zl,!Ul);break a;case 2:eu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=nu+300-we(),10<a)){if(Su(r,t,Zl,!Ul),He(r,0,!0)!==0)break a;uu=t,r.timeoutHandle=Zd(bu.bind(null,r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,`Throttled`,-0,0),a);break a}bu(r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,null,-0,0)}}break}while(1);sd(e)}function bu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xt},Ml(t,a,d);var m=(a&62914560)===a?nu-we():(a&4194048)===a?ru-we():0;if(m=Zf(d,m),m!==null){uu=a,e.cancelPendingCommit=m(Bu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Su(e,a,o,!l);return}}Bu(e,t,a,n,r,i,o,s,c)}function xu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!yr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Su(e,t,n,r){t&=~Xl,t&=~Yl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ie(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ye(e,n,t)}function Cu(){return G&6?!0:(cd(0,!1),!1)}function wu(){if(K!==null){if(Vl===0)var e=K.return;else e=K,Ui=Hi=null,Do(e),Oa=null,ka=0,e=K;for(;e!==null;)Bc(e.alternate,e),e=e.return;K=null}}function Tu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),uu=0,wu(),Bl=e,K=n=oi(e.current,null),q=t,Vl=0,Hl=null,Ul=!1,Wl=Ue(e,t),Gl=!1,Ql=Zl=Xl=Yl=Jl=ql=0,eu=$l=null,tu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ie(r),a=1<<i;t|=e[i],r&=~a}return Kl=t,Xr(),n}function Eu(e,t){W=null,P.H=Ls,t===va||t===ba?(t=Ea(),Vl=3):t===ya?(t=Ea(),Vl=4):Vl=t===tc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Hl=t,K===null&&(ql=1,Ys(e,mi(t,e.current)))}function Du(){var e=$a.current;return e===null?!0:(q&4194048)===q?eo===null:(q&62914560)===q||q&536870912?e===eo:!1}function Ou(){var e=P.H;return P.H=Ls,e===null?Ls:e}function ku(){var e=P.A;return P.A=Rl,e}function Au(){ql=4,Ul||(q&4194048)!==q&&$a.current!==null||(Wl=!0),!(Jl&134217727)&&!(Yl&134217727)||Bl===null||Su(Bl,q,Zl,!1)}function ju(e,t,n){var r=G;G|=2;var i=Ou(),a=ku();(Bl!==e||q!==t)&&(au=null,Tu(e,t)),t=!1;var o=ql;a:do try{if(Vl!==0&&K!==null){var s=K,c=Hl;switch(Vl){case 8:wu(),o=6;break a;case 3:case 2:case 9:case 6:$a.current===null&&(t=!0);var l=Vl;if(Vl=0,Hl=null,Lu(e,s,c,l),n&&Wl){o=0;break a}break;default:l=Vl,Vl=0,Hl=null,Lu(e,s,c,l)}}Mu(),o=ql;break}catch(t){Eu(e,t)}while(1);return t&&e.shellSuspendCounter++,Ui=Hi=null,G=r,P.H=i,P.A=a,K===null&&(Bl=null,q=0,Xr()),o}function Mu(){for(;K!==null;)Fu(K)}function Nu(e,t){var n=G;G|=2;var r=Ou(),a=ku();Bl!==e||q!==t?(au=null,iu=we()+500,Tu(e,t)):Wl=Ue(e,t);a:do try{if(Vl!==0&&K!==null){t=K;var o=Hl;b:switch(Vl){case 1:Vl=0,Hl=null,Lu(e,t,o,1);break;case 2:case 9:if(Sa(o)){Vl=0,Hl=null,Iu(t);break}t=function(){Vl!==2&&Vl!==9||Bl!==e||(Vl=7),sd(e)},o.then(t,t);break a;case 3:Vl=7;break a;case 4:Vl=5;break a;case 7:Sa(o)?(Vl=0,Hl=null,Iu(t)):(Vl=0,Hl=null,Lu(e,t,o,7));break;case 5:var s=null;switch(K.tag){case 26:s=K.memoizedState;case 5:case 27:var c=K;if(s?Jf(s):c.stateNode.complete){Vl=0,Hl=null;var l=c.sibling;if(l!==null)K=l;else{var u=c.return;u===null?K=null:(K=u,Ru(u))}break b}}Vl=0,Hl=null,Lu(e,t,o,5);break;case 6:Vl=0,Hl=null,Lu(e,t,o,6);break;case 8:wu(),ql=6;break a;default:throw Error(i(462))}}Pu();break}catch(t){Eu(e,t)}while(1);return Ui=Hi=null,P.H=r,P.A=a,G=n,K===null?(Bl=null,q=0,Xr(),ql):0}function Pu(){for(;K!==null&&!Se();)Fu(K)}function Fu(e){var t=jc(e.alternate,e,Kl);e.memoizedProps=e.pendingProps,t===null?Ru(e):K=t}function Iu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=hc(n,t,t.pendingProps,t.type,void 0,q);break;case 11:t=hc(n,t,t.pendingProps,t.type.render,t.ref,q);break;case 5:Do(t);default:Bc(n,t),t=K=si(t,Kl),t=jc(n,t,Kl)}e.memoizedProps=e.pendingProps,t===null?Ru(e):K=t}function Lu(e,t,n,r){Ui=Hi=null,Do(t),Oa=null,ka=0;var i=t.return;try{if(ec(e,i,t,n,q)){ql=1,Ys(e,mi(n,e.current)),K=null;return}}catch(t){if(i!==null)throw K=i,t;ql=1,Ys(e,mi(n,e.current)),K=null;return}t.flags&32768?(U||r===1?e=!0:Wl||q&536870912?e=!1:(Ul=e=!0,(r===2||r===9||r===3||r===6)&&(r=$a.current,r!==null&&r.tag===13&&(r.flags|=16384))),zu(t,e)):Ru(t)}function Ru(e){var t=e;do{if(t.flags&32768){zu(t,Ul);return}e=t.return;var n=Rc(t.alternate,t,Kl);if(n!==null){K=n;return}if(t=t.sibling,t!==null){K=t;return}K=t=e}while(t!==null);ql===0&&(ql=5)}function zu(e,t){do{var n=zc(e.alternate,e);if(n!==null){n.flags&=32767,K=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){K=e;return}K=e=n}while(e!==null);ql=6,K=null}function Bu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Gu();while(su!==0);if(G&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Yr,Je(e,n,o,s,c,l),e===Bl&&(K=Bl=null,q=0),lu=t,cu=e,uu=n,du=o,fu=a,pu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,ed(Oe,function(){return Ku(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=P.T,P.T=null,a=F.p,F.p=2,s=G,G|=4;try{al(e,t,n)}finally{G=s,F.p=a,P.T=r}}su=1,Vu(),Hu(),Uu()}}function Vu(){if(su===1){su=0;var e=cu,t=lu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=G;G|=4;try{vl(t,e);var a=Wd,o=wr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Cr(s.ownerDocument.documentElement,s)){if(c!==null&&Tr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Sr(s,h),v=Sr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}dp=!!Ud,Wd=Ud=null}finally{G=i,F.p=r,P.T=n}}e.current=t,su=2}}function Hu(){if(su===2){su=0;var e=cu,t=lu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=G;G|=4;try{ol(e,t.alternate,t)}finally{G=i,F.p=r,P.T=n}}su=3}}function Uu(){if(su===4||su===3){su=0,Ce();var e=cu,t=lu,n=uu,r=pu;t.subtreeFlags&10256||t.flags&10256?su=5:(su=0,lu=cu=null,Wu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ou=null),$e(n),t=t.stateNode,Pe&&typeof Pe.onCommitFiberRoot==`function`)try{Pe.onCommitFiberRoot(Ne,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=F.p,F.p=2,P.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{P.T=t,F.p=i}}uu&3&&Gu(),sd(e),i=e.pendingLanes,n&261930&&i&42?e===hu?mu++:(mu=0,hu=e):mu=0,cd(0,!1)}}function Wu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,aa(t)))}function Gu(){return Vu(),Hu(),Uu(),Ku()}function Ku(){if(su!==5)return!1;var e=cu,t=du;du=0;var n=$e(uu),r=P.T,a=F.p;try{F.p=32>n?32:n,P.T=null,n=fu,fu=null;var o=cu,s=uu;if(su=0,lu=cu=null,uu=0,G&6)throw Error(i(331));var c=G;if(G|=4,Fl(o.current),Dl(o,o.current,s,n),G=c,cd(0,!1),Pe&&typeof Pe.onPostCommitFiberRoot==`function`)try{Pe.onPostCommitFiberRoot(Ne,o)}catch{}return!0}finally{F.p=a,P.T=r,Wu(e,t)}}function qu(e,t,n){t=mi(n,t),t=Zs(e.stateNode,t,2),e=Ba(e,t,2),e!==null&&(qe(e,2),sd(e))}function Ju(e,t,n){if(e.tag===3)qu(e,e,n);else for(;t!==null;){if(t.tag===3){qu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ou===null||!ou.has(r))){e=mi(n,e),n=Qs(2),r=Ba(t,n,2),r!==null&&($s(n,r,t,e),qe(r,2),sd(r));break}}t=t.return}}function Yu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Gl=!0,i.add(n),e=Xu.bind(null,e,t,n),t.then(e,e))}function Xu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Bl===e&&(q&n)===n&&(ql===4||ql===3&&(q&62914560)===q&&300>we()-nu?!(G&2)&&Tu(e,0):Xl|=n,Ql===q&&(Ql=0)),sd(e)}function Zu(e,t){t===0&&(t=Ge()),e=$r(e,t),e!==null&&(qe(e,t),sd(e))}function Qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zu(e,n)}function $u(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Zu(e,n)}function ed(e,t){return be(e,t)}var td=null,nd=null,rd=!1,id=!1,ad=!1,od=0;function sd(e){e!==nd&&e.next===null&&(nd===null?td=nd=e:nd=nd.next=e),id=!0,rd||(rd=!0,md())}function cd(e,t){if(!ad&&id){ad=!0;do for(var n=!1,r=td;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ie(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,pd(r,a))}else a=q,a=He(r,r===Bl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ue(r,a)||(n=!0,pd(r,a));r=r.next}while(n);ad=!1}}function ld(){ud()}function ud(){id=rd=!1;var e=0;od!==0&&Xd()&&(e=od);for(var t=we(),n=null,r=td;r!==null;){var i=r.next,a=dd(r,t);a===0?(r.next=null,n===null?td=i:n.next=i,i===null&&(nd=n)):(n=r,(e!==0||a&3)&&(id=!0)),r=i}su!==0&&su!==5||cd(e,!1),od!==0&&(od=0)}function dd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ie(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=We(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Bl,n=q,n=He(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&xe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ue(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&xe(r),$e(n)){case 2:case 8:n=De;break;case 32:n=Oe;break;case 268435456:n=Ae;break;default:n=Oe}return r=fd.bind(null,e),n=be(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&xe(r),e.callbackPriority=2,e.callbackNode=null,2}function fd(e,t){if(su!==0&&su!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Gu()&&e.callbackNode!==n)return null;var r=q;return r=He(e,e===Bl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(yu(e,r,t),dd(e,we()),e.callbackNode!=null&&e.callbackNode===n?fd.bind(null,e):null)}function pd(e,t){if(Gu())return null;yu(e,t,!0)}function md(){ef(function(){G&6?be(Ee,ld):ud()})}function hd(){if(od===0){var e=ca;e===0&&(e=Be,Be<<=1,!(Be&261888)&&(Be=256)),od=e}return od}function gd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Yt(``+e)}function _d(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function vd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=gd((i[it]||null).action),o=r.submitter;o&&(t=(t=o[it]||null)?gd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new vn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(od!==0){var e=o?_d(i,o):new FormData(i);Cs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?_d(i,o):new FormData(i),Cs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var yd=0;yd<Gr.length;yd++){var bd=Gr[yd];Kr(bd.toLowerCase(),`on`+(bd[0].toUpperCase()+bd.slice(1)))}Kr(Lr,`onAnimationEnd`),Kr(Rr,`onAnimationIteration`),Kr(zr,`onAnimationStart`),Kr(`dblclick`,`onDoubleClick`),Kr(`focusin`,`onFocus`),Kr(`focusout`,`onBlur`),Kr(Br,`onTransitionRun`),Kr(Vr,`onTransitionStart`),Kr(Hr,`onTransitionCancel`),Kr(Ur,`onTransitionEnd`),bt(`onMouseEnter`,[`mouseout`,`mouseover`]),bt(`onMouseLeave`,[`mouseout`,`mouseover`]),bt(`onPointerEnter`,[`pointerout`,`pointerover`]),bt(`onPointerLeave`,[`pointerout`,`pointerover`]),yt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),yt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),yt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),yt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),yt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),yt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var xd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Sd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(xd));function Cd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){qr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){qr(e)}i.currentTarget=null,a=c}}}}function J(e,t){var n=t[ot];n===void 0&&(n=t[ot]=new Set);var r=e+`__bubble`;n.has(r)||(Dd(t,e,2,!1),n.add(r))}function wd(e,t,n){var r=0;t&&(r|=4),Dd(n,e,r,t)}var Td=`_reactListening`+Math.random().toString(36).slice(2);function Ed(e){if(!e[Td]){e[Td]=!0,_t.forEach(function(t){t!==`selectionchange`&&(Sd.has(t)||wd(t,!1,e),wd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Td]||(t[Td]=!0,wd(`selectionchange`,!1,t))}}function Dd(e,t,n,r){switch(vp(t)){case 2:var i=fp;break;case 8:i=pp;break;default:i=mp}n=i.bind(null,t,n,e),i=void 0,!sn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Od(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ft(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}rn(function(){var r=a,i=Qt(n),s=[];a:{var c=Wr.get(e);if(c!==void 0){var l=vn,u=e;switch(e){case`keypress`:if(pn(n)===0)break a;case`keydown`:case`keyup`:l=In;break;case`focusin`:u=`focus`,l=Dn;break;case`focusout`:u=`blur`,l=Dn;break;case`beforeblur`:case`afterblur`:l=Dn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Tn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=En;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Rn;break;case Lr:case Rr:case zr:l=On;break;case Ur:l=zn;break;case`scroll`:case`scrollend`:l=bn;break;case`wheel`:l=Bn;break;case`copy`:case`cut`:case`paste`:l=kn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Ln;break;case`toggle`:case`beforetoggle`:l=Vn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=an(m,p),g!=null&&d.push(kd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Zt&&(u=n.relatedTarget||n.fromElement)&&(ft(u)||u[at]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ft(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Tn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Ln,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:mt(l),h=u==null?c:mt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ft(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=jd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Md(s,c,l,d,!1),u!==null&&f!==null&&Md(s,f,u,d,!0)}}a:{if(c=r?mt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=sr;else if(tr(c))if(cr)v=_r;else{v=hr;var y=mr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Kt(r.elementType)&&(v=sr):v=gr;if(v&&=v(e,r)){nr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Rt(c,`number`,c.value)}switch(y=r?mt(r):window,e){case`focusin`:(tr(y)||y.contentEditable===`true`)&&(Dr=y,Or=r,kr=null);break;case`focusout`:kr=Or=Dr=null;break;case`mousedown`:Ar=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ar=!1,jr(s,n,i);break;case`selectionchange`:if(Er)break;case`keydown`:case`keyup`:jr(s,n,i)}var b;if(Un)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Zn?Yn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Kn&&n.locale!==`ko`&&(Zn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Zn&&(b=fn()):(ln=i,un=`value`in ln?ln.value:ln.textContent,Zn=!0)),y=Ad(r,x),0<y.length&&(x=new An(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Xn(n),b!==null&&(x.data=b)))),(b=Gn?Qn(e,n):$n(e,n))&&(x=Ad(r,`onBeforeInput`),0<x.length&&(y=new An(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),vd(s,e,r,n,i)}Cd(s,t)})}function kd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ad(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=an(e,n),i!=null&&r.unshift(kd(e,i,a)),i=an(e,t),i!=null&&r.push(kd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function jd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Md(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=an(n,a),l!=null&&o.unshift(kd(n,l,c))):i||(l=an(n,a),l!=null&&o.push(kd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Nd=/\r\n?/g,Pd=/\u0000|\uFFFD/g;function Fd(e){return(typeof e==`string`?e:``+e).replace(Nd,`
9
+ `).replace(Pd,``)}function Id(e,t){return t=Fd(t),Fd(e)===t}function Ld(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Ht(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Ht(e,``+r);break;case`className`:Et(e,`class`,r);break;case`tabIndex`:Et(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Et(e,n,r);break;case`style`:Gt(e,r,o);break;case`data`:if(t!==`object`){Et(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Yt(``+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}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Ld(e,t,`name`,a.name,a,null),Ld(e,t,`formEncType`,a.formEncType,a,null),Ld(e,t,`formMethod`,a.formMethod,a,null),Ld(e,t,`formTarget`,a.formTarget,a,null)):(Ld(e,t,`encType`,a.encType,a,null),Ld(e,t,`method`,a.method,a,null),Ld(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Yt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`onScroll`:r!=null&&J(`scroll`,e);break;case`onScrollEnd`:r!=null&&J(`scrollend`,e);break;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));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=Yt(``+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`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`:J(`beforetoggle`,e),J(`toggle`,e),Tt(e,`popover`,r);break;case`xlinkActuate`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Tt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=qt.get(n)||n,Tt(e,n,r))}}function Rd(e,t,n,r,a,o){switch(n){case`style`:Gt(e,r,o);break;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));e.innerHTML=n}}break;case`children`:typeof r==`string`?Ht(e,r):(typeof r==`number`||typeof r==`bigint`)&&Ht(e,``+r);break;case`onScroll`:r!=null&&J(`scroll`,e);break;case`onScrollEnd`:r!=null&&J(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!vt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[it]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Tt(e,n,r)}}}function zd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:J(`error`,e),J(`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:Ld(e,t,o,s,n,null)}}a&&Ld(e,t,`srcSet`,n.srcSet,n,null),r&&Ld(e,t,`src`,n.src,n,null);return;case`input`:J(`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:Ld(e,t,r,d,n,null)}}Lt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in J(`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:Ld(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&zt(e,!!r,n,!0):zt(e,!!r,t,!1);return;case`textarea`:for(s in J(`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:Ld(e,t,s,c,n,null)}Vt(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:Ld(e,t,l,r,n,null)}return;case`dialog`:J(`beforetoggle`,e),J(`toggle`,e),J(`cancel`,e),J(`close`,e);break;case`iframe`:case`object`:J(`load`,e);break;case`video`:case`audio`:for(r=0;r<xd.length;r++)J(xd[r],e);break;case`image`:J(`error`,e),J(`load`,e);break;case`details`:J(`toggle`,e);break;case`embed`:case`source`:case`link`:J(`error`,e),J(`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:Ld(e,t,u,r,n,null)}return;default:if(Kt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Rd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Ld(e,t,c,r,n,null))}function Bd(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)||Ld(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`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Ld(e,t,p,m,r,f)}}It(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)||Ld(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`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Ld(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?zt(e,!!n,n?[]:``,!1):zt(e,!!n,t,!0)):zt(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:Ld(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`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Ld(e,t,s,a,r,o)}Bt(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:Ld(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`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Ld(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)&&Ld(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:Ld(e,t,u,p,r,m)}return;default:if(Kt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Rd(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||Rd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Ld(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||Ld(e,t,f,p,r,m)}function Vd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Hd(){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&&Vd(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&&Vd(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 Ud=null,Wd=null;function Gd(e){return e.nodeType===9?e:e.ownerDocument}function Kd(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 qd(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 Jd(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 Yd=null;function Xd(){var e=window.event;return e&&e.type===`popstate`?e===Yd?!1:(Yd=e,!0):(Yd=null,!1)}var Zd=typeof setTimeout==`function`?setTimeout:void 0,Qd=typeof clearTimeout==`function`?clearTimeout:void 0,$d=typeof Promise==`function`?Promise:void 0,ef=typeof queueMicrotask==`function`?queueMicrotask:$d===void 0?Zd:function(e){return $d.resolve(null).then(e).catch(tf)};function tf(e){setTimeout(function(){throw e})}function nf(e){return e===`head`}function rf(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),Lp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)vf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ut]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vf(e.ownerDocument.body);n=i}while(n);Lp(t)}function af(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 of(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`:of(n),dt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function sf(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[ut])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=pf(e.nextSibling),e===null)break}return null}function cf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=pf(e.nextSibling),e===null))return null;return e}function lf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=pf(e.nextSibling),e===null))return null;return e}function uf(e){return e.data===`$?`||e.data===`$~`}function df(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function ff(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 pf(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 mf=null;function hf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return pf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function gf(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 _f(e,t,n){switch(t=Gd(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 vf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);dt(e)}var yf=new Map,bf=new Set;function xf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Sf=F.d;F.d={f:Cf,r:wf,D:Df,C:Of,L:kf,m:Af,X:Mf,S:jf,M:Nf};function Cf(){var e=Sf.f(),t=Cu();return e||t}function wf(e){var t=pt(e);t!==null&&t.tag===5&&t.type===`form`?Ts(t):Sf.r(e)}var Tf=typeof document>`u`?null:document;function Ef(e,t,n){var r=Tf;if(r&&typeof t==`string`&&t){var i=Ft(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bf.has(i)||(bf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),zd(t,`link`,e),gt(t),r.head.appendChild(t)))}}function Df(e){Sf.D(e),Ef(`dns-prefetch`,e,null)}function Of(e,t){Sf.C(e,t),Ef(`preconnect`,e,t)}function kf(e,t,n){Sf.L(e,t,n);var r=Tf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ft(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ft(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ft(n.imageSizes)+`"]`)):i+=`[href="`+Ft(e)+`"]`;var a=i;switch(t){case`style`:a=Ff(e);break;case`script`:a=Y(e)}yf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),yf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(If(a))||t===`script`&&r.querySelector(zf(a))||(t=r.createElement(`link`),zd(t,`link`,e),gt(t),r.head.appendChild(t)))}}function Af(e,t){Sf.m(e,t);var n=Tf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ft(r)+`"][href="`+Ft(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Y(e)}if(!yf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),yf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zf(a)))return}r=n.createElement(`link`),zd(r,`link`,e),gt(r),n.head.appendChild(r)}}}function jf(e,t,n){Sf.S(e,t,n);var r=Tf;if(r&&e){var i=ht(r).hoistableStyles,a=Ff(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(If(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=yf.get(a))&&Hf(e,n);var c=o=r.createElement(`link`);gt(c),zd(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,Vf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mf(e,t){Sf.X(e,t);var n=Tf;if(n&&e){var r=ht(n).hoistableScripts,i=Y(e),a=r.get(i);a||(a=n.querySelector(zf(i)),a||(e=m({src:e,async:!0},t),(t=yf.get(i))&&Uf(e,t),a=n.createElement(`script`),gt(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nf(e,t){Sf.M(e,t);var n=Tf;if(n&&e){var r=ht(n).hoistableScripts,i=Y(e),a=r.get(i);a||(a=n.querySelector(zf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=yf.get(i))&&Uf(e,t),a=n.createElement(`script`),gt(a),zd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pf(e,t,n,r){var a=(a=oe.current)?xf(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`?(t=Ff(n.href),n=ht(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,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=Ff(n.href);var o=ht(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(If(e)))&&!o._p&&(s.instance=o,s.state.loading=5),yf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},yf.set(e,n),o||Rf(a,e,n,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`?(t=Y(n),n=ht(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Ff(e){return`href="`+Ft(e)+`"`}function If(e){return`link[rel="stylesheet"][`+e+`]`}function Lf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Rf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),zd(t,`link`,n),gt(t),e.head.appendChild(t))}function Y(e){return`[src="`+Ft(e)+`"]`}function zf(e){return`script[async]`+e}function Bf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ft(n.href)+`"]`);if(r)return t.instance=r,gt(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),gt(r),zd(r,`style`,a),Vf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Ff(n.href);var o=e.querySelector(If(a));if(o)return t.state.loading|=4,t.instance=o,gt(o),o;r=Lf(n),(a=yf.get(a))&&Hf(r,a),o=(e.ownerDocument||e).createElement(`link`),gt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),zd(o,`link`,r),t.state.loading|=4,Vf(o,n.precedence,e),t.instance=o;case`script`:return o=Y(n.src),(a=e.querySelector(zf(o)))?(t.instance=a,gt(a),a):(r=n,(a=yf.get(o))&&(r=m({},n),Uf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),gt(a),zd(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,Vf(r,n.precedence,e));return t.instance}function Vf(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 Hf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Uf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wf=null;function Gf(e,t,n){if(Wf===null){var r=new Map,i=Wf=new Map;i.set(n,r)}else i=Wf,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[ut]||a[rt]||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 Kf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qf(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 Jf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Yf(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=Ff(r.href),a=t.querySelector(If(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Qf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,gt(a);return}a=t.ownerDocument||t,r=Lf(r),(i=yf.get(i))&&Hf(r,i),a=a.createElement(`link`),gt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),zd(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=Qf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Xf=0;function Zf(e,t){return e.stylesheets&&e.count===0&&ep(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ep(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Xf===0&&(Xf=62500*Hd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ep(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Xf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Qf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ep(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var $f=null;function ep(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,$f=new Map,t.forEach(tp,e),$f=null,Qf.call(e))}function tp(e,t){if(!(t.state.loading&4)){var n=$f.get(e);if(n)var r=n.get(null);else{n=new Map,$f.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=Qf.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 np={$$typeof:C,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function rp(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=Ke(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ke(0),this.hiddenUpdates=Ke(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ip(e,t,n,r,i,a,o,s,c,l,u,d){return e=new rp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ii(3,null,null,t),e.current=a,a.stateNode=e,t=ia(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},La(a),e}function ap(e){return e?(e=ni,e):ni}function op(e,t,n,r,i,a){i=ap(i),r.context===null?r.context=i:r.pendingContext=i,r=za(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ba(e,r,t),n!==null&&(vu(n,e,t),Va(n,e,t))}function sp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function cp(e,t){sp(e,t),(e=e.alternate)&&sp(e,t)}function lp(e){if(e.tag===13||e.tag===31){var t=$r(e,67108864);t!==null&&vu(t,e,67108864),cp(e,67108864)}}function up(e){if(e.tag===13||e.tag===31){var t=gu();t=Qe(t);var n=$r(e,t);n!==null&&vu(n,e,t),cp(e,t)}}var dp=!0;function fp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,mp(e,t,n,r)}finally{F.p=a,P.T=i}}function pp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,mp(e,t,n,r)}finally{F.p=a,P.T=i}}function mp(e,t,n,r){if(dp){var i=hp(r);if(i===null)Od(e,t,r,gp,n),Dp(e,r);else if(kp(i,e,t,n,r))r.stopPropagation();else if(Dp(e,r),t&4&&-1<Ep.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=V(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ie(o);s.entanglements[1]|=c,o&=~c}sd(a),!(G&6)&&(iu=we()+500,cd(0,!1))}}break;case 31:case 13:s=$r(a,2),s!==null&&vu(s,a,2),Cu(),cp(a,2)}if(a=hp(r),a===null&&Od(e,t,r,gp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Od(e,t,r,null,n)}}function hp(e){return e=Qt(e),_p(e)}var gp=null;function _p(e){if(gp=null,e=ft(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 gp=e,null}function vp(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`resize`: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`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`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Te()){case Ee:return 2;case De:return 8;case Oe:case ke:return 32;case Ae:return 268435456;default:return 32}default:return 32}}var yp=!1,bp=null,xp=null,Sp=null,Cp=new Map,wp=new Map,Tp=[],Ep=`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 Dp(e,t){switch(e){case`focusin`:case`focusout`:bp=null;break;case`dragenter`:case`dragleave`:xp=null;break;case`mouseover`:case`mouseout`:Sp=null;break;case`pointerover`:case`pointerout`:Cp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:wp.delete(t.pointerId)}}function Op(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&&lp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function kp(e,t,n,r,i){switch(t){case`focusin`:return bp=Op(bp,e,t,n,r,i),!0;case`dragenter`:return xp=Op(xp,e,t,n,r,i),!0;case`mouseover`:return Sp=Op(Sp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Cp.set(a,Op(Cp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,wp.set(a,Op(wp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ap(e){var t=ft(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,tt(e.priority,function(){up(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,tt(e.priority,function(){up(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 jp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=hp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Zt=r,n.target.dispatchEvent(r),Zt=null}else return t=pt(n),t!==null&&lp(t),e.blockedOn=n,!1;t.shift()}return!0}function Mp(e,t,n){jp(e)&&n.delete(t)}function Np(){yp=!1,bp!==null&&jp(bp)&&(bp=null),xp!==null&&jp(xp)&&(xp=null),Sp!==null&&jp(Sp)&&(Sp=null),Cp.forEach(Mp),wp.forEach(Mp)}function Pp(e,n){e.blockedOn===n&&(e.blockedOn=null,yp||(yp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Np)))}var Fp=null;function Ip(e){Fp!==e&&(Fp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Fp===e&&(Fp=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(_p(r||n)===null)continue;break}var a=pt(n);a!==null&&(e.splice(t,3),t-=3,Cs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Lp(e){function t(t){return Pp(t,e)}bp!==null&&Pp(bp,e),xp!==null&&Pp(xp,e),Sp!==null&&Pp(Sp,e),Cp.forEach(t),wp.forEach(t);for(var n=0;n<Tp.length;n++){var r=Tp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Tp.length&&(n=Tp[0],n.blockedOn===null);)Ap(n),n.blockedOn===null&&Tp.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[it]||null;if(typeof a==`function`)o||Ip(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[it]||null)s=o.formAction;else if(_p(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Ip(n)}}}function Rp(){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 zp(e){this._internalRoot=e}Bp.prototype.render=zp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;op(n,gu(),e,t,null,null)},Bp.prototype.unmount=zp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;op(e.current,2,null,e,null,null),Cu(),t[at]=null}};function Bp(e){this._internalRoot=e}Bp.prototype.unstable_scheduleHydration=function(e){if(e){var t=et();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Tp.length&&t!==0&&t<Tp[n].priority;n++);Tp.splice(n,0,e),n===0&&Ap(e)}};var Vp=n.version;if(Vp!==`19.2.5`)throw Error(i(527,Vp,`19.2.5`));F.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=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Hp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Up=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Up.isDisabled&&Up.supportsFiber)try{Ne=Up.inject(Hp),Pe=Up}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ks,s=qs,c=Js;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=ip(e,1,!1,null,null,n,r,null,o,s,c,Rp),e[at]=t.current,Ed(e),new zp(t)}})),_=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=g()})),v=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},y=new class extends v{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},b={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},x=new class{#e=b;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function S(e){setTimeout(e,0)}var C=typeof window>`u`||`Deno`in globalThis;function w(){}function T(e,t){return typeof e==`function`?e(t):e}function E(e){return typeof e==`number`&&e>=0&&e!==1/0}function D(e,t){return Math.max(e+(t||0)-Date.now(),0)}function O(e,t){return typeof e==`function`?e(t):e}function k(e,t){return typeof e==`function`?e(t):e}function A(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==M(o,t.options))return!1}else if(!ee(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function j(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(N(t.options.mutationKey)!==N(a))return!1}else if(!ee(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function M(e,t){return(t?.queryKeyHashFn||N)(e)}function N(e){return JSON.stringify(e,(e,t)=>ne(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ee(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>ee(e[n],t[n])):!1}var te=Object.prototype.hasOwnProperty;function P(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=I(e)&&I(t);if(!r&&!(ne(e)&&ne(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:te.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=P(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function F(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function I(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ne(e){if(!re(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!re(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function re(e){return Object.prototype.toString.call(e)===`[object Object]`}function L(e){return new Promise(t=>{x.setTimeout(t,e)})}function R(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:P(e,t)}function z(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ie(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ae=Symbol();function oe(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===ae?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function se(e,t){return typeof e==`function`?e(...t):!!e}function ce(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var le=(()=>{let e=()=>C;return{isServer(){return e()},setIsServer(t){e=t}}})();function ue(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var de=S;function fe(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=de,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var pe=fe(),me=new class extends v{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function he(e){return Math.min(1e3*2**e,3e4)}function ge(e){return(e??`online`)===`online`?me.isOnline():!0}var _e=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ve(e){let t=!1,n=0,r,i=ue(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new _e(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>y.isFocused()&&(e.networkMode===`always`||me.isOnline())&&e.canRun(),u=()=>ge(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(le.isServer()?0:3),o=e.retryDelay??he,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),L(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var ye=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),E(this.gcTime)&&(this.#e=x.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(le.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(x.clearTimeout(this.#e),this.#e=void 0)}};function be(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ce(e,()=>t.signal,()=>n=!0)},u=oe(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?ie:z;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Se:xe,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:xe(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function xe(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Se(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Ce=class extends ye{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Ee(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Ee(this.options);e.data!==void 0&&(this.setState(Te(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=R(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(w).catch(w):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>k(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ae||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>O(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!D(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=oe(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?be(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=ve({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof _e&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof _e){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...we(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Te(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),pe.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function we(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ge(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Te(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Ee(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var De=class extends v{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=ue(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ke(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ae(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ae(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof k(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!F(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&je(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||k(this.options.enabled,this.#t)!==k(t.enabled,this.#t)||O(this.options.staleTime,this.#t)!==O(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||k(this.options.enabled,this.#t)!==k(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Ne(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(w)),t}#g(){this.#b();let e=O(this.options.staleTime,this.#t);if(le.isServer()||this.#r.isStale||!E(e))return;let t=D(this.#r.dataUpdatedAt,e)+1;this.#d=x.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(le.isServer()||k(this.options.enabled,this.#t)===!1||!E(this.#p)||this.#p===0)&&(this.#f=x.setInterval(()=>{(this.options.refetchIntervalInBackground||y.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(x.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(x.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&ke(e,t),o=i&&je(e,n,t,r);(a||o)&&(l={...l,...we(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=R(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=R(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Me(e,t),refetch:this.refetch,promise:this.#o,isEnabled:k(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=ue())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!F(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){pe.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Oe(e,t){return k(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&k(t.retryOnMount,e)===!1)}function ke(e,t){return Oe(e,t)||e.state.data!==void 0&&Ae(e,t,t.refetchOnMount)}function Ae(e,t,n){if(k(t.enabled,e)!==!1&&O(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Me(e,t)}return!1}function je(e,t,n,r){return(e!==t||k(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Me(e,n)}function Me(e,t){return k(t.enabled,e)!==!1&&e.isStaleByTime(O(t.staleTime,e))}function Ne(e,t){return!F(e.getCurrentResult(),t)}var Pe=class extends ye{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Fe(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=ve({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),pe.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Fe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ie=class extends v{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Pe({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Le(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Le(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Le(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Le(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){pe.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>j(t,e))}findAll(e={}){return this.getAll().filter(t=>j(e,t))}notify(e){pe.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return pe.batch(()=>Promise.all(e.map(e=>e.continue().catch(w))))}};function Le(e){return e.options.scope?.id}var Re=class extends v{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??M(r,t),a=this.get(i);return a||(a=new Ce({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){pe.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>A(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>A(e,t)):t}notify(e){pe.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){pe.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){pe.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ze=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Re,this.#t=e.mutationCache||new Ie,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=y.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=me.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(O(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=T(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return pe.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;pe.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return pe.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=pe.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(w).catch(w)}invalidateQueries(e,t={}){return pe.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=pe.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(w)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(w)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(O(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(w).catch(w)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(w).catch(w)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return me.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(N(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ee(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(N(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ee(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=M(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===ae&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Be=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})),Ve=o(((e,t)=>{t.exports=Be()})),B=l(d(),1),V=Ve(),He=B.createContext(void 0),Ue=e=>{let t=B.useContext(He);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},We=({client:e,children:t})=>(B.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,V.jsx)(He.Provider,{value:e,children:t})),Ge=B.createContext(!1),Ke=()=>B.useContext(Ge);Ge.Provider;function qe(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Je=B.createContext(qe()),Ye=()=>B.useContext(Je),Xe=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?se(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Ze=e=>{B.useEffect(()=>{e.clearReset()},[e])},Qe=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||se(n,[e.error,r])),$e=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},et=(e,t)=>e.isLoading&&e.isFetching&&!t,tt=(e,t)=>e?.suspense&&t.isPending,nt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function rt(e,t,n){let r=Ke(),i=Ye(),a=Ue(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,$e(o),Xe(o,i,s),Ze(i);let c=!a.getQueryCache().get(o.queryHash),[l]=B.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(B.useSyncExternalStore(B.useCallback(e=>{let t=d?l.subscribe(pe.batchCalls(e)):w;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),B.useEffect(()=>{l.setOptions(o)},[o,l]),tt(o,u))throw nt(o,l,i);if(Qe({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!le.isServer()&&et(u,r)&&(c?nt(o,l,i):s?.promise)?.catch(w).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function it(e,t){return rt(e,De,t)}var at=typeof window<`u`?B.useLayoutEffect:B.useEffect;function ot(e){let t=B.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function st(e,t,n={},r={}){B.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function ct(e){let t=B.useRef(null);return B.useImperativeHandle(e,()=>t.current,[]),t}function lt(e){return e[e.length-1]}function ut(e){return typeof e==`function`}function dt(e,t){return ut(e)?e(t):e}var ft=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable;function mt(e){for(let t in e)if(ft.call(e,t))return!0;return!1}var ht=()=>Object.create(null),gt=(e,t)=>_t(e,t,ht);function _t(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=xt(e)&&xt(i);if(!a&&!(yt(e)&&yt(i)))return i;let o=a?e:vt(e);if(!o)return i;let s=a?i:vt(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:ft.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=_t(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function vt(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!pt.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!pt.call(e,t))return!1;r.push(t)}return r}function yt(e){if(!bt(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!bt(n)||!n.hasOwnProperty(`isPrototypeOf`))}function bt(e){return Object.prototype.toString.call(e)===`[object Object]`}function xt(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function St(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!St(e[r],t[r],n))return!1;return!0}if(yt(e)&&yt(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!St(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!St(e[o],t[o],n)))return!1;return i===a}return!1}function Ct(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function wt(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function Tt(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function Et(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return Tt(t)}var Dt=[`http:`,`https:`,`mailto:`,`tel:`];function Ot(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function kt(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=Et(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=Et(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function At(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function jt(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Mt(){throw Error(`Invariant failed`)}function Nt(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var Pt=4,Ft=5;function It(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function Lt(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=It(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Rt(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=n.options?.params?.parse??n.options?.parseParams;for(;s<o;){let e=Lt(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=Vt(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=Vt(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Ht(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Ht(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=Ht(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=Vt(n.fullPath??n.from);e.kind=Ft,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=Vt(n.fullPath??n.from);e.kind=Pt,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=l??null,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)Rt(e,t,r,s,i,a,o)}function zt(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Bt(e){if(e.pathless)for(let t of e.pathless)Bt(t);if(e.static)for(let t of e.static.values())Bt(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())Bt(t);if(e.dynamic?.length){e.dynamic.sort(zt);for(let t of e.dynamic)Bt(t)}if(e.optional?.length){e.optional.sort(zt);for(let t of e.optional)Bt(t)}if(e.wildcard?.length){e.wildcard.sort(zt);for(let t of e.wildcard)Bt(t)}}function Vt(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null}}function Ht(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,caseSensitive:n,prefix:r,suffix:i}}function Ut(e,t){let n=Vt(`/`),r=new Uint16Array(6);for(let t of e)Rt(!1,r,t,1,n,0);Bt(n),t.masksTree=n,t.flatCache=Nt(1e3)}function Wt(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=Yt(e,t.masksTree);return t.flatCache.set(e,r),r}function Gt(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Vt(`/`),Rt(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Yt(r,o,n)}function Kt(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Yt(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Zt(a.route)),t.matchCache.set(r,a),a}function qt(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Jt(e,t=!1,n){let r=Vt(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return Rt(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&Mt(),a[e.id]=e,s!==0&&e.path){let t=qt(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),Bt(r),{processedTree:{segmentTree:r,singleCache:Nt(1e3),matchCache:Nt(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Yt(e,t,n=!1){let r=e.split(`/`),i=$t(e,r,t,n);if(!i)return null;let[a]=Xt(e,r,i);return{route:i.node.route,rawParams:a}}function Xt(e,t,n){let r=Qt(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===Pt)break;if(u.kind===Ft){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function Zt(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Qt(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function $t(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!lt(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,depth:f,statics:p,dynamics:m,optionals:h}=n,{extract:g,rawParams:_}=n;if(i.kind===2&&i.route&&!rn(l,n))continue;if(i.parse){if(!nn(e,t,n))continue;_=n.rawParams,g=n.extract}r&&i.route&&i.kind!==Pt&&rn(c,n)&&(c=n);let v=u===o;if(v&&(i.route&&(!a||i.kind===Pt||i.kind===2)&&rn(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let y=v?void 0:t[u],b;if(v&&i.index){let n={node:i.index,index:u,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_},r=!0;if(i.index.parse&&(nn(e,t,n)||(r=!1)),r){if(!m&&!h&&!d&&tn(p,o))return n;rn(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(v||!(n.caseSensitive?y:b??=y.toLowerCase()).startsWith(r)))){if(a){if(v)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}if(i.optional){let e=d|1<<f,t=f+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:u,skipped:e,depth:t,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?y:b??=y.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:u+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+en(o,u),extract:g,rawParams:_})}}if(!v&&i.dynamic&&y)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,depth:f+1,statics:p,dynamics:m+en(o,u),optionals:h,extract:g,rawParams:_})}if(!v&&i.staticInsensitive){let e=i.staticInsensitive.get(b??=y.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+en(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v&&i.static){let e=i.static.get(y);e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+en(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(i.pathless){let e=f+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:u,skipped:d,depth:e,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function en(e,t){return 2**(e-t-1)}function tn(e,t){return e===2**(t-1)-1}function nn(e,t,n){let r,i;try{[r,i]=Xt(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function rn(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Pt)>(e.node.kind===Pt)||t.node.kind===Pt==(e.node.kind===Pt)&&t.depth>e.depth))):!0}function an(e){return on(e.filter(e=>e!==void 0).join(`/`))}function on(e){return e.replace(/\/{2,}/g,`/`)}function sn(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function cn(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function ln(e){return cn(sn(e))}function un(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function dn(e,t,n){return un(e,n)===un(t,n)}function fn({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&lt(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(lt(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=on(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function pn(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function mn(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>gn(e,n)).join(`/`):gn(r,n):r}function hn({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=Lt(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=mn(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=mn(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=mn(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function gn(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function _n(e){return e?.isNotFound===!0}function vn(){try{return typeof window<`u`&&typeof window.sessionStorage==`object`?window.sessionStorage:void 0}catch{return}}var yn=`tsr-scroll-restoration-v1_3`;function bn(){let e=vn();if(!e)return null;let t={};try{let n=JSON.parse(e.getItem(`tsr-scroll-restoration-v1_3`)||`{}`);yt(n)&&(t=n)}catch{}return{get state(){return t},set:e=>{t=dt(e,t)||t},persist:()=>{try{e.setItem(yn,JSON.stringify(t))}catch{}}}}var xn=bn(),Sn=e=>e.state.__TSR_key||e.href;function Cn(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var wn=!1,Tn=`window`,En=`data-scroll-restoration-id`;function Dn(e,t){if(!xn)return;let n=xn;if((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,wn=!1;let r=e.options.getScrollRestorationKey||Sn,i=new Map;window.history.scrollRestoration=`manual`;let a=t=>{if(!(wn||!e.isScrollRestoring))if(t.target===document||t.target===window)i.set(Tn,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{let e=t.target;i.set(e,{scrollX:e.scrollLeft||0,scrollY:e.scrollTop||0})}},o=t=>{if(!e.isScrollRestoring||!t||i.size===0||!n)return;let r=n.state[t]||={};for(let[e,t]of i){let n;if(e===Tn)n=Tn;else if(e.isConnected){let t=e.getAttribute(En);n=t?`[${En}="${t}"]`:Cn(e)}n&&(r[n]=t)}};document.addEventListener(`scroll`,a,!0),e.subscribe(`onBeforeLoad`,e=>{o(e.fromLocation?r(e.fromLocation):void 0),i.clear()}),window.addEventListener(`pagehide`,()=>{o(r(e.stores.resolvedLocation.get()??e.stores.location.get())),n.persist()}),e.subscribe(`onRendered`,t=>{let a=r(t.toLocation),o=e.options.scrollRestorationBehavior,s=e.options.scrollToTopSelectors;if(i.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))){wn=!0;try{let t=e.isScrollRestoring?n.state[a]:void 0,r=!1;if(t)for(let e in t){let n=t[e];if(!yt(n))continue;let{scrollX:i,scrollY:a}=n;if(!(!Number.isFinite(i)||!Number.isFinite(a))){if(e===Tn)window.scrollTo({top:a,left:i,behavior:o}),r=!0;else if(e){let t;try{t=document.querySelector(e)}catch{continue}t&&(t.scrollLeft=i,t.scrollTop=a,r=!0)}}}if(!r){let t=e.history.location.hash.slice(1);if(t){let e=window.history.state?.__hashScrollIntoViewOptions??!0;if(e){let n=document.getElementById(t);n&&n.scrollIntoView(e)}}else{let e={top:0,left:0,behavior:o};if(window.scrollTo(e),s)for(let t of s){if(t===Tn)continue;let n=typeof t==`function`?t():document.querySelector(t);n&&n.scrollTo(e)}}}}finally{wn=!1}e.isScrollRestoring&&n.set(e=>(e[a]||={},e))}})}function On(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function kn(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function An(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=kn(r):Array.isArray(t)?t.push(kn(r)):n[e]=[t,kn(r)]}return n}var jn=Nn(JSON.parse),Mn=Pn(JSON.stringify,JSON.parse);function Nn(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=An(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Pn(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=On(e,r);return t?`?${t}`:``}}var Fn=`__root__`;function In(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Ln(e){return e instanceof Response&&!!e.options}function Rn(e){return{input:({url:t})=>{for(let n of e)t=Bn(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Vn(e[n],t);return t}}}function zn(e){let t=ln(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=an([`/`,t,e.pathname]),e)}}function Bn(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Vn(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Hn(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>Un(o,_.get())),x=r(()=>Un(s,v.get())),S=r(()=>Un(c,y.get())),C=r(()=>_.get()[0]),w=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),T=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),E=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),D=Nt(64);function O(e){let t=D.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),D.set(e,t)),t}let k={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:w,matchRouteDeps:T,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:E,getRouteMatchStore:O,setMatches:A,setPending:j,setCached:M};A(e.matches),a?.(k);function A(e){Wn(e,o,_,n,i)}function j(e){Wn(e,s,v,n,i)}function M(e){Wn(e,c,y,n,i)}return k}function Un(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function Wn(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}jt(n.get(),a)||n.set(a)})}var Gn=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Kn=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),qn=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),Jn=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},Yn=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},Xn=(e,t,n)=>{if(!(!Ln(n)&&!_n(n)))throw Ln(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:Ln(n)?`redirected`:_n(n)?`notFound`:r.status===`pending`?`success`:r.status,context:Jn(e,t.index),isFetching:!1,error:n})),_n(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Ln(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},Zn=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Qn=(e,t,n)=>{let r=Jn(e,n);e.updateMatch(t,e=>({...e,context:r}))},$n=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,Xn(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(t){n=t,Xn(e,e.router.getMatch(i),n)}e.updateMatch(i,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Ln(n)&&!_n(n)&&(e.serialError??=n)},er=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!qn(e,t)&&(n.options.loader||n.options.beforeLoad||dr(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{Gn(e)},i);r._nonReactive.pendingTimeout=t}},tr=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;er(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&Xn(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},nr=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Ct(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&$n(e,n,o,`PARSE_PARAMS`),s&&$n(e,n,s,`VALIDATE_SEARCH`),er(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=Ct();let f={...Jn(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=qn(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(Ln(r)||_n(r))&&(u(),$n(e,n,r,`BEFORE_LOAD`)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),wt(y))return u(),y.catch(t=>{$n(e,n,t,`BEFORE_LOAD`)}).then(v)}catch(t){u(),$n(e,n,t,`BEFORE_LOAD`)}v(y)},rr=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>nr(e,n,t,i),s=()=>{if(Zn(e,n))return;let t=tr(e,n,i);return wt(t)?t.then(o):o()};return a()},ir=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},ar=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=Jn(e,r),d=qn(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},or=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{ur(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(ar(e,t,n,r,i)),l=!!s&&wt(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;Xn(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:Jn(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:Jn(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,_n(t)&&await i.options.notFoundComponent?.preload?.(),Xn(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,Xn(e,e.router.getMatch(n),t)}!Ln(o)&&!_n(o)&&await ur(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:Jn(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),Xn(e,r,t)}},sr=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(ar(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await or(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){Ln(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await or(e,t,i,n,d):Qn(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(Zn(e,i)){if(!e.router.getMatch(i))return e.matches[n];Qn(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=qn(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&Xn(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=Ct(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function cr(e){let t=e,n=[];Kn(t.router)&&Gn(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=rr(t,e);wt(n)&&await n}catch(e){if(Ln(e))throw e;if(_n(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?Yn(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(sr(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(Ln(e))throw e;_n(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=Yn(t,l);e===void 0&&Mt();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await ur(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await ur(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=ir(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=Gn(t);if(wt(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function lr(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function ur(e,t=fr){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===fr?(()=>{if(e._componentsPromise===void 0){let t=lr(e,fr);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():lr(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function dr(e){for(let t of fr)if(e.options[t]?.preload)return!0;return!1}var fr=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`],pr=`__TSR_index`,mr=`popstate`,hr=`beforeunload`;function gr(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=xr(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[pr];i=_r(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[pr];i=_r(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[pr]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function _r(e,t){t||={};let n=Sr();return{...t,key:n,__TSR_key:n,[pr]:e}}function vr(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>xr(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Sr();t.history.replaceState({[pr]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=xr(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[pr]-l.state[pr],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=gr({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(hr,S,{capture:!0}),t.removeEventListener(mr,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(hr,S,{capture:!0}),t.addEventListener(mr,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function yr(e){let t=e?.window??(typeof document<`u`?window:void 0);return vr({window:t,parseLocation:()=>{let e=t.location.hash.split(`#`).slice(1),n=e[0]??`/`,r=t.location.search,i=e.slice(1);return xr(`${n}${r}${i.length===0?``:`#${i.join(`#`)}`}`,t.history.state)},createHref:e=>`${t.location.pathname}${t.location.search}#${e}`})}function br(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function xr(e,t){let n=br(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Sr();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[pr]:0,key:a,__TSR_key:a}}}function Sr(){return(Math.random()+1).toString(36).substring(7)}function Cr(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var wr=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.routeBranchCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=pn(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=vr()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=Nt(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=Hn(Dr(this.latestLocation),e),Dn(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=ln(o);t&&t!==`/`&&e.push(zn({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Rn(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a)`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Jt(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&Ut(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:kt(e).path,external:!1,searchStr:o,search:gt(t?.search,i),hash:kt(r.slice(1)).path,state:_t(t?.state,a)}}let o=new URL(i,this.origin),s=Bn(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:kt(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:gt(t?.search,c),hash:kt(s.hash.slice(1)).path,state:_t(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>fn({base:e,to:t.includes(`//`)?on(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>kr({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=t.to?`${t.to}`:void 0,o=r.search,s=Object.assign(Object.create(null),r.params),c=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),l=a?this.resolvePathWithBase(c,a):c,u=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,dt(t.params,s)),d=this.routesByPath[cn(l)],f;if(d)f=this.getRouteBranch(d);else if(l.includes(`$`))f=[];else{let e=this.getMatchedRoutes(l);f=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(f=[...f,this.options.notFoundRoute])}if(f.length&&mt(u))for(let e of f){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(u,t(u))}catch{}}let p=e.leaveParams?l:kt(hn({path:l,params:u,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,m=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};f.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Or(t.options.validateSearch,{...e,...m}))}catch{}}),m=e}m=Ar({search:m,dest:t,destRoutes:f,_includeValidateSearch:e._includeValidateSearch}),m=gt(o,m);let h=this.options.stringifySearch(m),g=t.hash===!0?n.hash:t.hash?dt(t.hash,n.hash):void 0,_=g?`#${g}`:``,v=t.state===!0?n.state:t.state?dt(t.state,n.state):{};v=_t(n.state,v);let y=`${p}${h}${_}`,b,x,S=!1;if(this.rewrite){let e=new URL(y,this.origin),t=Vn(this.rewrite,e);b=e.href.replace(e.origin,``),t.origin===this.origin?x=t.pathname+t.search+t.hash:(x=t.href,S=!0)}else b=At(y),x=b;return{publicHref:x,href:b,pathname:p,search:m,searchStr:h,state:v,hash:g??``,external:S,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=Wt(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,dt(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=St(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},i=cn(this.latestLocation.href)===cn(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=Ct(()=>{a?.resolve(),a=void 0}),i&&r())this.load();else{let{maskedLocation:r,hashScrollIntoView:i,...a}=n;r&&(a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(a.unmaskOnReload??this.options.unmaskOnReload??!1)&&(a.state.__tempKey=this.tempLocationKey)),a.state.__hashScrollIntoViewOptions=i??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=xr(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Bn(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(Ot(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t,n,r,i=this.stores.resolvedLocation.get()??this.stores.location.get();for(r=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=Cr(t,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...n}),this.emit({type:`onBeforeLoad`,...n}),await cr({router:this,sync:e?.sync,forceStaleReload:i.href===t.href,matches:this.stores.pendingMatches.get(),location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){Ln(e)?(t=e,this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):_n(e)&&(n=e);let r=t?t.status:n?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(r),this.stores.redirect.set(t)})}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.stores.matches.get().some(e=>e.status===`error`)&&(a=500),a!==void 0&&this.stores.statusCode.set(a)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Cr(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&Ot(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=ur,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await cr({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(Ln(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});_n(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=Gt(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!St(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?St(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Mn,parseSearch:e.parseSearch??jn,protocolAllowlist:e.protocolAllowlist??Dt}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=Zt(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n,{matchedRoutes:a}=n,o=!1;(r?r.path!==`/`&&i[`**`]:cn(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Mr(this.options.notFoundMode,a):void 0,c=Array(a.length),l=new Map;for(let e of this.stores.matchStores.values())e.routeId&&l.set(e.routeId,e.get());for(let n=0;n<a.length;n++){let r=a[n],o=c[n-1],u,d,f;{let n=o?.search??e.search,i=o?._strictSearch??void 0;try{let e=Or(r.options.validateSearch,{...n})??void 0;u={...n,...e},d={...i,...e},f=void 0}catch(e){let r=e;if(e instanceof Tr||(r=new Tr(e.message,{cause:e})),t?.throwOnError)throw r;u=n,d={},f=r}}let p=r.options.loaderDeps?.({search:u})??``,m=p?JSON.stringify(p):``,{interpolatedPath:h,usedParams:g}=hn({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),_=r.id+h+m,v=this.getMatch(_),y=l.get(r.id),b=v?._strictParams??g,x;if(!v)try{Nr(r,b)}catch(e){if(x=_n(e)||Ln(e)?e:new Er(e.message,{cause:e}),t?.throwOnError)throw x}Object.assign(i,b);let S=y?`stay`:`enter`,C;if(v)C={...v,cause:S,params:y?.params??i,_strictParams:b,search:gt(y?y.search:v.search,u),_strictSearch:d};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||dr(r)?`pending`:`success`;C={id:_,ssr:r.options.ssr,index:n,routeId:r.id,params:y?.params??i,_strictParams:b,pathname:h,updatedAt:Date.now(),search:y?gt(y.search,u):u,_strictSearch:d,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:x,__routeContext:void 0,_nonReactive:{loadPromise:Ct()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:S,loaderDeps:y?_t(y.loaderDeps,p):p,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(C.globalNotFound=s===r.id),C.searchError=f;let w=this.getParentContext(o);C.context={...w,...C.__routeContext,...C.__beforeLoadContext},c[n]=C}for(let t=0;t<c.length;t++){let n=c[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=l.get(n.routeId);if(n.params=o?gt(o.params,i):i,!a){let i=c[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:c,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return c}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),r=lt(t),i={...e.search};for(let e of t)try{Object.assign(i,Or(e.options.validateSearch,i))}catch{}let a=lt(this.stores.matchesId.get()),o=a&&this.stores.matchStores.get(a)?.get(),s=o&&o.routeId===r.id&&o.pathname===e.pathname,c;if(s)c=o.params;else{let e=Object.assign(Object.create(null),n);for(let n of t)try{Nr(n,e)}catch{}c=e}return{matchedRoutes:t,fullPath:r.fullPath,search:i,params:c}}},Tr=class extends Error{},Er=class extends Error{};function Dr(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Or(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Tr(`Async validation not supported`);if(n.issues)throw new Tr(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function kr({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=cn(e),a,o=Kt(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function Ar({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return jr(n)(e,t,r??!1)}function jr(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...Or(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:dt(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function Mr(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return Fn}function Nr(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}var Pr=`Error preloading route! ☝️`,Fr=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Fn:this.parentRoute||Mt();let r=n?Fn:t?.path;r&&r!==`/`&&(r=sn(r));let i=t?.id||r,a=n?Fn:an([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=an([`/`,a]));let o=a===`__root__`?`/`:an([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=cn(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>In({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},Ir=class extends Fr{constructor(e){super(e)}};function Lr(e){if(typeof document<`u`&&document.querySelector){let t=e.stores.location.get(),n=t.state.__hashScrollIntoViewOptions??!0;if(n&&t.hash!==``){let e=document.getElementById(t.hash);e&&e.scrollIntoView(n)}}}function Rr(e){let t=e.errorComponent??Br;return(0,V.jsx)(zr,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?B.createElement(t,{error:n,reset:r}):e.children})}var zr=class extends B.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function Br({error:e}){let[t,n]=B.useState(!1);return(0,V.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,V.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,V.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,V.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,V.jsx)(`div`,{children:(0,V.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,V.jsx)(`code`,{children:e.message}):null})}):null]})}function Vr({children:e,fallback:t=null}){return Hr()?(0,V.jsx)(B.Fragment,{children:e}):(0,V.jsx)(B.Fragment,{children:t})}function Hr(){return B.useSyncExternalStore(Ur,()=>!0,()=>!1)}function Ur(){return()=>{}}var Wr=B.createContext(null);function Gr(e){return B.useContext(Wr)}var Kr=B.createContext(void 0),qr=B.createContext(void 0),H=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(H||{});function Jr({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Yr(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var Xr=[],Zr=0,{link:Qr,unlink:$r,propagate:ei,checkDirty:ti,shallowPropagate:ni}=Jr({update(e){return e._update()},notify(e){Xr[ii++]=e,e.flags&=~H.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=H.Mutable|H.Dirty,ci(e))}}),ri=0,ii=0,ai,oi=0;function si(e){try{++oi,e()}finally{--oi||li()}}function ci(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=$r(n,e)}function li(){if(!(oi>0)){for(;ri<ii;){let e=Xr[ri];Xr[ri++]=void 0,e.notify()}ri=0,ii=0}}function ui(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?H.None:H.Mutable,get(){return ai!==void 0&&Qr(i,ai,Zr),i._snapshot},subscribe(e){let t=Yr(e),n={current:!1},r=di(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=ai,o=t?.compare??Object.is;if(n)ai=i,++Zr,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=H.Mutable|H.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{ai=a,n&&(i.flags&=~H.RecursedCheck),ci(i)}}};return n?(i.flags=H.Mutable|H.Dirty,i.get=function(){let e=i.flags;if(e&H.Dirty||e&H.Pending&&ti(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&ni(e)}}else e&H.Pending&&(i.flags=e&~H.Pending);return ai!==void 0&&Qr(i,ai,Zr),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(ei(e),ni(e),li())}},i}function di(e){let t=()=>{let t=ai;ai=n,++Zr,n.depsTail=void 0,n.flags=H.Watching|H.RecursedCheck;try{return e()}finally{ai=t,n.flags&=~H.RecursedCheck,ci(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:H.Watching|H.RecursedCheck,notify(){let e=this.flags;e&H.Dirty||e&H.Pending&&ti(this.deps,this)?t():this.flags=H.Watching},stop(){this.flags=H.None,this.depsTail=void 0,ci(this)}};return t(),n}var fi=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),pi=o(((e,t)=>{t.exports=fi()})),mi=o((e=>{var t=d(),n=pi();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),hi=l(o(((e,t)=>{t.exports=mi()}))(),1);function gi(e,t){return e===t}function _i(e,t,n=gi){let r=(0,B.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,B.useCallback)(()=>e?.get(),[e]);return(0,hi.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var vi={get:()=>void 0,subscribe:()=>({unsubscribe:()=>{}})};function yi(e){let t=Gr(),n=B.useContext(e.from?qr:Kr),r=e.from??n,i=r?e.from?t.stores.getRouteMatchStore(r):t.stores.matchStores.get(r):void 0,a=B.useRef(void 0);return _i(i??vi,n=>{if((e.shouldThrow??!0)&&!n&&Mt(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=_t(a.current,r);return a.current=e,e}return r})}function bi(e){return yi({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function xi(e){let{select:t,...n}=e;return yi({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Si(e){return yi({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Ci(e){return yi({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function wi(e){let t=Gr();return B.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Ti(e){return yi({...e,select:t=>e.select?e.select(t.context):t.context})}var Ei=h();function Di(e,t){let n=Gr(),r=ct(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:_,disabled:v,style:y,className:b,onClick:x,onBlur:S,onFocus:C,onMouseEnter:w,onMouseLeave:T,onTouchStart:E,ignoreBlocker:D,params:O,search:k,hash:A,state:j,mask:M,reloadDocument:N,unsafeRelative:ee,from:te,_fromLocation:P,...F}=e,I=Hr(),ne=B.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),re=_i(n.stores.location,e=>e,(e,t)=>e.href===t.href),L=B.useMemo(()=>{let e={_fromLocation:re,...ne};return n.buildLocation(e)},[n,re,ne]),R=L.maskedLocation?L.maskedLocation.publicHref:L.publicHref,z=L.maskedLocation?L.maskedLocation.external:L.external,ie=B.useMemo(()=>Fi(R,z,n.history,v),[v,z,R,n.history]),ae=B.useMemo(()=>{if(ie?.external)return Ot(ie.href,n.protocolAllowlist)?void 0:ie.href;if(!Ii(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),Ot(s,n.protocolAllowlist)?void 0:s}catch{}},[s,ie,n.protocolAllowlist]),oe=B.useMemo(()=>{if(ae)return!1;if(o?.exact){if(!dn(re.pathname,L.pathname,n.basepath))return!1}else{let e=un(re.pathname,n.basepath),t=un(L.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!St(re.search,L.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?I&&re.hash===L.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,re,ae,I,L.hash,L.pathname,L.search,n.basepath]),se=oe?dt(i,{})??ki:Oi,ce=oe?Oi:dt(a,{})??Oi,le=[b,se.className,ce.className].filter(Boolean).join(` `),ue=(y||se.style||ce.style)&&{...y,...se.style,...ce.style},[de,fe]=B.useState(!1),pe=B.useRef(!1),me=e.reloadDocument||ae?!1:c??n.options.defaultPreload,he=l??n.options.defaultPreloadDelay??0,ge=B.useCallback(()=>{n.preloadRoute({...ne,_builtLocation:L}).catch(e=>{console.warn(e),console.warn(Pr)})},[n,ne,L]);st(r,B.useCallback(e=>{e?.isIntersecting&&ge()},[ge]),Ni,{disabled:!!v||me!==`viewport`}),B.useEffect(()=>{pe.current||!v&&me===`render`&&(ge(),pe.current=!0)},[v,ge,me]);let _e=e=>{let t=e.currentTarget.getAttribute(`target`),r=_===void 0?t:_;if(!v&&!Ri(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,Ei.flushSync)(()=>{fe(!0)});let t=n.subscribe(`onResolved`,()=>{t(),fe(!1)});n.navigate({...ne,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:D})}};if(ae)return{...F,ref:r,href:ae,...g&&{children:g},..._&&{target:_},...v&&{disabled:v},...y&&{style:y},...b&&{className:b},...x&&{onClick:x},...S&&{onBlur:S},...C&&{onFocus:C},...w&&{onMouseEnter:w},...T&&{onMouseLeave:T},...E&&{onTouchStart:E}};let ve=e=>{if(v||me!==`intent`)return;if(!he){ge();return}let t=e.currentTarget;if(Mi.has(t))return;let n=setTimeout(()=>{Mi.delete(t),ge()},he);Mi.set(t,n)},ye=e=>{v||me!==`intent`||ge()},be=e=>{if(v||!me||!he)return;let t=e.currentTarget,n=Mi.get(t);n&&(clearTimeout(n),Mi.delete(t))};return{...F,...se,...ce,href:ie?.href,ref:r,onClick:Pi([x,_e]),onBlur:Pi([S,be]),onFocus:Pi([C,ve]),onMouseEnter:Pi([w,ve]),onMouseLeave:Pi([T,be]),onTouchStart:Pi([E,ye]),disabled:!!v,target:_,...ue&&{style:ue},...le&&{className:le},...v&&Ai,...oe&&U,...I&&de&&ji}}var Oi={},ki={className:`active`},Ai={role:`link`,"aria-disabled":!0},U={"data-status":`active`,"aria-current":`page`},ji={"data-transitioning":`transitioning`},Mi=new WeakMap,Ni={rootMargin:`100px`},Pi=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Fi(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Ii(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Li=B.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Di(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return B.createElement(`a`,t,o)}return B.createElement(n,a,o)});function Ri(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var zi=class extends Fr{constructor(e){super(e),this.useMatch=e=>yi({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Ti({...e,from:this.id}),this.useSearch=e=>Ci({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Si({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>xi({...e,from:this.id}),this.useLoaderData=e=>bi({...e,from:this.id}),this.useNavigate=()=>wi({from:this.fullPath}),this.Link=B.forwardRef((e,t)=>(0,V.jsx)(Li,{ref:t,from:this.fullPath,...e}))}};function Bi(e){return new zi(e)}var Vi=class extends Ir{constructor(e){super(e),this.useMatch=e=>yi({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Ti({...e,from:this.id}),this.useSearch=e=>Ci({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Si({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>xi({...e,from:this.id}),this.useLoaderData=e=>bi({...e,from:this.id}),this.useNavigate=()=>wi({from:this.fullPath}),this.Link=B.forwardRef((e,t)=>(0,V.jsx)(Li,{ref:t,from:this.fullPath,...e}))}};function Hi(e){return new Vi(e)}function Ui(e){let t=Gr(),n=`not-found-${_i(t.stores.location,e=>e.pathname)}-${_i(t.stores.status,e=>e)}`;return(0,V.jsx)(Rr,{getResetKey:()=>n,onCatch:(t,n)=>{if(_n(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(_n(t))return e.fallback?.(t);throw t},children:e.children})}function Wi(){return(0,V.jsx)(`p`,{children:`Not Found`})}function Gi(e){return(0,V.jsx)(V.Fragment,{children:e.children})}function Ki(e,t,n){return t.options.notFoundComponent?(0,V.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,V.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,V.jsx)(Wi,{})}var qi=B.memo(function({matchId:e}){let t=Gr(),n=t.stores.matchStores.get(e);n||Mt();let r=_i(t.stores.loadedAt,e=>e),i=_i(n,e=>e);return(0,V.jsx)(Ji,{router:t,matchId:e,resetKey:r,matchState:B.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function Ji({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,V.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?B.Suspense:Gi,f=s?Rr:Gi,p=l?Ui:Gi;return(0,V.jsxs)(i.isRoot?i.options.shellComponent??Gi:Gi,{children:[(0,V.jsx)(Kr.Provider,{value:t,children:(0,V.jsx)(d,{fallback:o,children:(0,V.jsx)(f,{getResetKey:()=>n,errorComponent:s||Br,onCatch:(e,t)=>{if(_n(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,V.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return B.createElement(l,e)},children:u||r._displayPending?(0,V.jsx)(Vr,{fallback:o,children:(0,V.jsx)(Xi,{matchId:t})}):(0,V.jsx)(Xi,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Yi,{resetKey:n}),(e.options.scrollRestoration,null)]}):null]})}function Yi({resetKey:e}){let t=Gr(),n=B.useRef(void 0);return at(()=>{let e=t.latestLocation.href;(n.current===void 0||n.current!==e)&&(t.emit({type:`onRendered`,...Cr(t.stores.location.get(),t.stores.resolvedLocation.get())}),n.current=e)},[t.latestLocation.state.__TSR_key,e,t]),null}var Xi=B.memo(function({matchId:e}){let t=Gr(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||Mt();let i=_i(r,e=>e),a=i.routeId,o=t.routesById[a],s=B.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=B.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,V.jsx)(e,{},s):(0,V.jsx)(Zi,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=Ct();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return _n(i.error)||Mt(),Ki(t,o,i.error);if(i.status===`redirected`)throw Ln(i.error)||Mt(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),Zi=B.memo(function(){let e=Gr(),t=B.useContext(Kr),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=_i(a,e=>[e?.routeId,e?.globalNotFound??!1]),i=_i(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,V.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||Mt(),Ki(e,a,void 0);if(!i)return null;let s=(0,V.jsx)(qi,{matchId:i});return n===`__root__`?(0,V.jsx)(B.Suspense,{fallback:o,children:s}):s});function Qi(){let e=Gr(),t=B.useRef({router:e,mounted:!1}),[n,r]=B.useState(!1),i=_i(e.stores.isLoading,e=>e),a=_i(e.stores.hasPending,e=>e),o=ot(i),s=i||n||a,c=ot(s),l=i||a,u=ot(l);return e.startTransition=e=>{r(!0),B.startTransition(()=>{e(),r(!1)})},B.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return cn(e.latestLocation.publicHref)!==cn(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),at(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),at(()=>{o&&!i&&e.emit({type:`onLoad`,...Cr(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),at(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...Cr(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,u,e]),at(()=>{if(c&&!s){let t=Cr(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),si(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())}),t.hrefChanged&&Lr(e)}},[s,c,e]),null}function $i(){let e=Gr(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,V.jsx)(t,{}):null,r=(0,V.jsxs)(typeof document<`u`&&e.ssr?Gi:B.Suspense,{fallback:n,children:[(0,V.jsx)(Qi,{}),(0,V.jsx)(ea,{})]});return e.options.InnerWrap?(0,V.jsx)(e.options.InnerWrap,{children:r}):r}function ea(){let e=Gr(),t=_i(e.stores.firstId,e=>e),n=_i(e.stores.loadedAt,e=>e),r=t?(0,V.jsx)(qi,{matchId:t}):null;return(0,V.jsx)(Kr.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,V.jsx)(Rr,{getResetKey:()=>n,errorComponent:Br,onCatch:void 0,children:r})})}function ta(){let e=Gr();return _i(e.stores.matchRouteDeps,e=>e),B.useCallback(t=>{let{pending:n,caseSensitive:r,fuzzy:i,includeSearch:a,...o}=t;return e.matchRoute(o,{pending:n,caseSensitive:r,fuzzy:i,includeSearch:a})},[e])}var na=e=>({createMutableStore:ui,createReadonlyStore:ui,batch:si}),ra=e=>new ia(e),ia=class extends wr{constructor(e){super(e,na)}};function aa({router:e,children:t,...n}){mt(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,V.jsx)(Wr.Provider,{value:e,children:t});return e.options.Wrap?(0,V.jsx)(e.options.Wrap,{children:r}):r}function oa({router:e,...t}){return(0,V.jsx)(aa,{router:e,...t,children:(0,V.jsx)($i,{})})}function sa(e){let t=Gr({warn:e?.router===void 0}),n=e?.router||t,r=(0,B.useRef)(void 0);return _i(n.stores.__store,t=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){let n=_t(r.current,e.select(t));return r.current=n,n}return e.select(t)}return t})}var ca=_(),la=new Set,ua=new WeakMap,da=new WeakMap,fa=new WeakMap,pa=new WeakMap,ma=new WeakMap,ha=new WeakMap,ga=new WeakMap,_a=new WeakMap,va=new WeakSet,ya,ba=0,xa=0,Sa=`__aa_tgt`,Ca=`__aa_del`,wa=`__aa_new`,Ta=e=>{let t=Fa(e);t&&t.forEach(e=>La(e))},Ea=e=>{e.forEach(e=>{e.target===ya&&Aa(),ua.has(e.target)&&ka(e.target)})};function Da(e){let t=e.getBoundingClientRect(),n=ya?.clientWidth||0,r=ya?.clientHeight||0;return t.bottom<0||t.top>r||t.right<0||t.left>n}function Oa(e){pa.get(e)?.disconnect();let t=ua.get(e),n=0;t||(t=Ba(e),ua.set(e,t));let{offsetWidth:r,offsetHeight:i}=ya,a=[t.top-5,r-(t.left+5+t.width),i-(t.top+5+t.height),t.left-5].map(e=>`${-1*Math.floor(e)}px`).join(` `),o=new IntersectionObserver(()=>{++n>1&&ka(e)},{root:ya,threshold:1,rootMargin:a});o.observe(e),pa.set(e,o)}function ka(e,t=!0){clearTimeout(_a.get(e));let n=Ha(e),r=t?qa(n)?500:n.duration:0;_a.set(e,setTimeout(async()=>{let t=fa.get(e);try{await t?.finished,ua.set(e,Ba(e)),Oa(e)}catch{}},r))}function Aa(){clearTimeout(_a.get(ya)),_a.set(ya,setTimeout(()=>{la.forEach(e=>Ga(e,e=>Ma(()=>ka(e))))},100))}function ja(e){setTimeout(()=>{ha.set(e,setInterval(()=>Ma(ka.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function Ma(e){typeof requestIdleCallback==`function`?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}var Na,Pa=typeof window<`u`&&`ResizeObserver`in window;Pa&&(ya=document.documentElement,new MutationObserver(Ta),Na=new ResizeObserver(Ea),window.addEventListener(`scroll`,()=>{xa=window.scrollY,ba=window.scrollX}),Na.observe(ya));function Fa(e){return e.reduce((e,t)=>[...e,...Array.from(t.addedNodes),...Array.from(t.removedNodes)],[]).every(e=>e.nodeName===`#comment`)?!1:e.reduce((e,t)=>{if(e===!1)return!1;if(t.target instanceof Element){if(Ia(t.target),!e.has(t.target)){e.add(t.target);for(let n=0;n<t.target.children.length;n++){let r=t.target.children.item(n);if(r){if(Ca in r)return!1;Ia(t.target,r),e.add(r)}}}if(t.removedNodes.length)for(let n=0;n<t.removedNodes.length;n++){let r=t.removedNodes[n];if(Ca in r)return!1;r instanceof Element&&(e.add(r),Ia(t.target,r),da.set(r,[t.previousSibling,t.nextSibling]))}}return e},new Set)}function Ia(e,t){!t&&!(Sa in e)?Object.defineProperty(e,Sa,{value:e}):t&&!(Sa in t)&&Object.defineProperty(t,Sa,{value:e})}function La(e){var t;let n=e.isConnected,r=ua.has(e);n&&da.has(e)&&da.delete(e),fa.get(e)?.playState!==`finished`&&((t=fa.get(e))==null||t.cancel()),wa in e?Ya(e):r&&n?Ja(e):r&&!n?Za(e):Ya(e)}function Ra(e){return Number(e.replace(/[^0-9.\-]/g,``))}function za(e){let t=e.parentElement;for(;t;){if(t.scrollLeft||t.scrollTop)return{x:t.scrollLeft,y:t.scrollTop};t=t.parentElement}return{x:0,y:0}}function Ba(e){let t=e.getBoundingClientRect(),{x:n,y:r}=za(e);return{top:t.top+r,left:t.left+n,width:t.width,height:t.height}}function Va(e,t,n){let r=t.width,i=t.height,a=n.width,o=n.height,s=getComputedStyle(e);if(s.getPropertyValue(`box-sizing`)===`content-box`){let e=Ra(s.paddingTop)+Ra(s.paddingBottom)+Ra(s.borderTopWidth)+Ra(s.borderBottomWidth),t=Ra(s.paddingLeft)+Ra(s.paddingRight)+Ra(s.borderRightWidth)+Ra(s.borderLeftWidth);r-=t,a-=t,i-=e,o-=e}return[r,a,i,o].map(Math.round)}function Ha(e){return Sa in e&&ga.has(e[Sa])?ga.get(e[Sa]):{duration:250,easing:`ease-in-out`}}function Ua(e){if(Sa in e)return e[Sa]}function Wa(e){let t=Ua(e);return t?va.has(t):!1}function Ga(e,...t){t.forEach(t=>t(e,ga.has(e)));for(let n=0;n<e.children.length;n++){let r=e.children.item(n);r&&t.forEach(e=>e(r,ga.has(r)))}}function Ka(e){return Array.isArray(e)?e:[e]}function qa(e){return typeof e==`function`}function Ja(e){let t=ua.get(e),n=Ba(e);if(!Wa(e))return ua.set(e,n);if(Da(e)){ua.set(e,n),Oa(e);return}let r;if(!t)return;let i=Ha(e);if(typeof i!=`function`){let a=t.left-n.left,o=t.top-n.top,s=t.left+t.width-(n.left+n.width);t.top+t.height-(n.top+n.height)==0&&(o=0),s==0&&(a=0);let[c,l,u,d]=Va(e,t,n),f={transform:`translate(${a}px, ${o}px)`},p={transform:`translate(0, 0)`};c!==l&&(f.width=`${c}px`,p.width=`${l}px`),u!==d&&(f.height=`${u}px`,p.height=`${d}px`),r=e.animate([f,p],{duration:i.duration,easing:i.easing})}else{let[a]=Ka(i(e,`remain`,t,n));r=new Animation(a),r.play()}fa.set(e,r),ua.set(e,n),r.addEventListener(`finish`,ka.bind(null,e,!1),{once:!0})}function Ya(e){wa in e&&delete e[wa];let t=Ba(e);ua.set(e,t);let n=Ha(e);if(!Wa(e))return;if(Da(e)){Oa(e);return}let r;if(typeof n!=`function`)r=e.animate([{transform:`scale(.98)`,opacity:0},{transform:`scale(0.98)`,opacity:0,offset:.5},{transform:`scale(1)`,opacity:1}],{duration:n.duration*1.5,easing:`ease-in`});else{let[i]=Ka(n(e,`add`,t));r=new Animation(i),r.play()}fa.set(e,r),r.addEventListener(`finish`,ka.bind(null,e,!1),{once:!0})}function Xa(e,t){var n;e.remove(),ua.delete(e),da.delete(e),fa.delete(e),(n=pa.get(e))==null||n.disconnect(),setTimeout(()=>{if(Ca in e&&delete e[Ca],Object.defineProperty(e,wa,{value:!0,configurable:!0}),t&&e instanceof HTMLElement)for(let n in t)e.style[n]=``},0)}function Za(e){var t;if(!da.has(e)||!ua.has(e))return;let[n,r]=da.get(e);Object.defineProperty(e,Ca,{value:!0,configurable:!0});let i=window.scrollX,a=window.scrollY;if(r&&r.parentNode&&r.parentNode instanceof Element?r.parentNode.insertBefore(e,r):n&&n.parentNode?n.parentNode.appendChild(e):(t=Ua(e))==null||t.appendChild(e),!Wa(e))return Xa(e);let[o,s,c,l]=$a(e),u=Ha(e),d=ua.get(e);(i!==ba||a!==xa)&&Qa(e,i,a,u);let f,p={position:`absolute`,top:`${o}px`,left:`${s}px`,width:`${c}px`,height:`${l}px`,margin:`0`,pointerEvents:`none`,transformOrigin:`center`,zIndex:`100`};if(!qa(u))Object.assign(e.style,p),f=e.animate([{transform:`scale(1)`,opacity:1},{transform:`scale(.98)`,opacity:0}],{duration:u.duration,easing:`ease-out`});else{let[t,n]=Ka(u(e,`remove`,d));n?.styleReset!==!1&&(p=n?.styleReset||p,Object.assign(e.style,p)),f=new Animation(t),f.play()}fa.set(e,f),f.addEventListener(`finish`,()=>Xa(e,p),{once:!0})}function Qa(e,t,n,r){let i=ba-t,a=xa-n,o=document.documentElement.style.scrollBehavior;if(getComputedStyle(ya).scrollBehavior===`smooth`&&(document.documentElement.style.scrollBehavior=`auto`),window.scrollTo(window.scrollX+i,window.scrollY+a),!e.parentElement)return;let s=e.parentElement,c=s.clientHeight,l=s.clientWidth,u=performance.now();function d(){requestAnimationFrame(()=>{if(!qa(r)){let e=c-s.clientHeight,t=l-s.clientWidth;u+r.duration>performance.now()?(window.scrollTo({left:window.scrollX-t,top:window.scrollY-e}),c=s.clientHeight,l=s.clientWidth,d()):document.documentElement.style.scrollBehavior=o}})}d()}function $a(e){let t=ua.get(e),[n,,r]=Va(e,t,Ba(e)),i=e.parentElement;for(;i&&(getComputedStyle(i).position===`static`||i instanceof HTMLBodyElement);)i=i.parentElement;i||=document.body;let a=getComputedStyle(i),o=!fa.has(e)||fa.get(e)?.playState===`finished`?Ba(i):ua.get(i);return[Math.round(t.top-o.top)-Ra(a.borderTopWidth),Math.round(t.left-o.left)-Ra(a.borderLeftWidth),n,r]}function eo(e,t={}){if(Pa&&Na&&!(window.matchMedia(`(prefers-reduced-motion: reduce)`).matches&&!qa(t)&&!t.disrespectUserMotionPreference)){va.add(e),getComputedStyle(e).position===`static`&&Object.assign(e.style,{position:`relative`}),Ga(e,ka,ja,e=>Na?.observe(e)),qa(t)?ga.set(e,t):ga.set(e,{duration:250,easing:`ease-in-out`,...t});let n=new MutationObserver(Ta);n.observe(e,{childList:!0}),ma.set(e,n),la.add(e)}return Object.freeze({parent:e,enable:()=>{va.add(e)},disable:()=>{va.delete(e),Ga(e,e=>{let t=fa.get(e);try{t?.cancel()}catch{}fa.delete(e);let n=_a.get(e);n&&clearTimeout(n),_a.delete(e);let r=ha.get(e);r&&clearInterval(r),ha.delete(e)})},isEnabled:()=>va.has(e),destroy:()=>{va.delete(e),la.delete(e),ga.delete(e),ma.get(e)?.disconnect(),ma.delete(e),Ga(e,e=>{Na?.unobserve(e);let t=fa.get(e);try{t?.cancel()}catch{}fa.delete(e),pa.get(e)?.disconnect(),pa.delete(e);let n=ha.get(e);n&&clearInterval(n),ha.delete(e);let r=_a.get(e);r&&clearTimeout(r),_a.delete(e),ua.delete(e),da.delete(e)})}})}function to(e){let[t,n]=(0,B.useState)(),r=(0,B.useMemo)(()=>e,[]),i=(0,B.useCallback)(e=>{e instanceof HTMLElement?n(eo(e,r)):n(void 0)},[r]),a=(0,B.useCallback)(e=>{t&&(e?t.enable():t.disable())},[t]);return(0,B.useEffect)(()=>()=>{var e;(e=t?.destroy)==null||e.call(t)},[t]),[i,a]}function no({label:e,color:t,pulse:n=!1,className:r=``,style:i,role:a,"aria-label":o}){return(0,V.jsxs)(`span`,{className:`font-mono text-[10px] font-bold uppercase tracking-[0.20em]${n?` badge-live`:``}${r?` ${r}`:``}`,style:t?{color:t,...i}:i,role:a,"aria-label":o,children:[`[ `,e,` ]`]})}var ro={in_progress:{label:`IN PROGRESS`,pulse:!0},dormant:{label:`DORMANT`,pulse:!1,color:`var(--text-muted)`},complete:{label:`COMPLETE`,pulse:!1,color:`var(--success)`},complete_with_gaps:{label:`GAPS`,pulse:!1,color:`var(--warning)`},blocked:{label:`BLOCKED`,pulse:!1,color:`var(--blocked)`}};function io({status:e}){let{label:t,pulse:n,color:r}=ro[e];return(0,V.jsx)(no,{label:t,pulse:n,color:r})}function ao({health:e}){return e===`healthy`?null:(0,V.jsx)(`span`,{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium`,style:{backgroundColor:`var(--error)20`,color:`var(--error)`},children:`Corrupt`})}function oo({children:e,variant:t=`default`,className:n=``}){return(0,V.jsx)(`span`,{className:`font-mono text-[10px] px-1.5 py-0.5 text-[var(--text-secondary)] inline-flex items-center ${t===`outlined`?`border border-[var(--border)]`:`bg-[var(--bg-secondary)]`} ${n}`,children:e})}var so=1;function co(e){return`polygon(${e}px 0, 100% 0, 100% 100%, 0 100%, 0 ${e}px)`}function W({cut:e=12,borderColor:t=`var(--border)`,background:n=`var(--bg-card)`,dropShadow:r,backdropFilter:i,className:a,style:o,children:s}){let c=co(e);return(0,V.jsxs)(`div`,{className:a,style:{filter:r?`${r}`:void 0,...o},children:[(0,V.jsx)(`div`,{"aria-hidden":!0,style:{position:`absolute`,inset:0,background:t,clipPath:c,pointerEvents:`none`}}),(0,V.jsx)(`div`,{style:{position:`absolute`,inset:so,background:n,backdropFilter:i??void 0,WebkitBackdropFilter:i??void 0,clipPath:c,display:`flex`,flexDirection:`column`,overflow:`hidden`},children:s})]})}var lo=(0,B.forwardRef)(function({variant:e=`list`,onClick:t,onKeyDown:n,onFocus:r,tabIndex:i,className:a=``,style:o,children:s,"aria-label":c,cut:l=10,borderColor:u},d){if(e===`hero`)return(0,V.jsx)(W,{cut:l,borderColor:u,className:`relative ${a}`,style:o,children:s});let f=`energy-card group cursor-pointer bg-[var(--bg-card)] border border-[var(--border)] hover:border-[var(--accent)] transition-colors focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1 focus-visible:outline-none ${{grid:`flex flex-col min-h-[160px]`,list:`w-full text-left`}[e]} ${a}`,p=e===`grid`&&(0,V.jsx)(`div`,{className:`h-[3px] w-full bg-[var(--accent)] opacity-60 group-hover:opacity-100 transition-opacity shrink-0`});return t?(0,V.jsxs)(`button`,{ref:d,type:`button`,onClick:t,onKeyDown:n,onFocus:r,tabIndex:i,"aria-label":c,className:f,style:o,children:[p,s]}):(0,V.jsxs)(`div`,{"aria-label":c,className:f,style:o,children:[p,s]})});function uo({children:e,className:t=``,style:n}){return(0,V.jsx)(`div`,{className:`branch-tree-line ${t}`,style:n,children:e})}function fo(e){let t=Date.now()-e;if(t<0)return`just now`;let n=Math.floor(t/1e3);if(n<60)return`just now`;let r=Math.floor(n/60);if(r<60)return`${r}m ago`;let i=Math.floor(r/60);if(i<24)return`${i}h ago`;let a=Math.floor(i/24);if(a<7)return`${a}d ago`;let o=Math.floor(a/7);return o<5?`${o}w ago`:`${Math.floor(a/30)}mo ago`}function po({viewModel:e}){let{state:t,dispatch:n,onSelectSession:r}=e;if(t.kind===`loading`)return(0,V.jsx)(`div`,{className:`flex items-center justify-center py-20`,children:(0,V.jsx)(`div`,{className:`text-[var(--text-secondary)] text-sm`,children:`Loading sessions...`})});if(t.kind===`error`)return(0,V.jsxs)(`div`,{className:`text-[var(--error)] bg-[var(--bg-card)] rounded-lg p-4`,children:[`Failed to load sessions: `,t.message]});let{rawSearch:i,sort:a,groupBy:o,statusFilter:s,page:c,totalPages:l,isGrouped:u,processed:d,statusCounts:f,flatPageSessions:p,getSessionNavProps:m,sessionContainerProps:h,sortAxes:g,groupAxes:_,statusFilterOptions:v,viewMode:y,sessionTree:b}=t,x=y===`tree`;return d.total===0?(0,V.jsxs)(`div`,{className:`text-center py-16`,children:[(0,V.jsx)(`p`,{className:`text-[var(--text-secondary)] text-lg`,children:`No v2 sessions found`}),(0,V.jsx)(`p`,{className:`text-[var(--text-muted)] text-sm mt-2`,children:`Sessions will appear here when workflows are executed with v2 tools enabled.`})]}):(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`h2`,{className:`text-lg font-medium text-[var(--text-primary)]`,children:[`Sessions`,(0,V.jsx)(`span`,{className:`text-[var(--text-muted)] font-normal ml-2 text-sm`,children:x||d.filtered===d.total?d.total:`${d.filtered} / ${d.total}`})]}),(0,V.jsx)(`div`,{className:`flex items-center gap-0 border border-[var(--border)] rounded-md overflow-hidden`,children:[`flat`,`tree`].map(e=>(0,V.jsx)(`button`,{type:`button`,onClick:()=>n({type:`view_mode_changed`,viewMode:e}),className:`px-3 py-1.5 text-xs font-mono uppercase tracking-wider transition-colors cursor-pointer ${y===e?`bg-[var(--accent)] text-[#0f131f] font-bold`:`bg-[var(--bg-secondary)] text-[var(--text-muted)] hover:text-[var(--text-primary)]`}`,"aria-pressed":y===e,children:e},e))})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 ${x?`opacity-40 pointer-events-none select-none`:``}`,children:[(0,V.jsxs)(`div`,{className:`relative flex-1 min-w-[200px] max-w-[360px]`,children:[(0,V.jsx)(`input`,{type:`text`,value:i,disabled:x,"aria-disabled":x,onChange:e=>n({type:`search_changed`,value:e.target.value}),placeholder:`Search sessions...`,className:`w-full bg-[var(--bg-secondary)] border border-[var(--border)] rounded-md px-3 py-1.5 text-sm text-[var(--text-primary)] placeholder-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)] transition-colors`}),i&&(0,V.jsx)(`button`,{onClick:()=>n({type:`search_changed`,value:``}),className:`absolute right-2 top-1/2 -translate-y-1/2 text-[var(--text-muted)] hover:text-[var(--text-primary)] text-xs`,children:`clear`})]}),(0,V.jsx)(mo,{label:`Sort`,value:a,options:g,onChange:e=>n({type:`sort_changed`,sort:e})}),(0,V.jsx)(mo,{label:`Group`,value:o,options:_,onChange:e=>n({type:`group_changed`,groupBy:e})})]}),x&&(0,V.jsx)(`p`,{className:`text-[var(--text-muted)] text-xs font-mono`,children:`Tree view -- filters disabled`}),(0,V.jsx)(`div`,{className:`flex flex-wrap gap-1.5 ${x?`opacity-40 pointer-events-none select-none`:``}`,children:v.map(e=>{let t=f[e.value]??0;return e.value!==`all`&&t===0?null:(0,V.jsxs)(`button`,{onClick:()=>n({type:`status_changed`,statusFilter:e.value}),className:`px-2.5 py-1 rounded-full text-xs font-medium transition-colors cursor-pointer ${s===e.value?`bg-[var(--accent)] text-white`:`bg-[var(--bg-secondary)] text-[var(--text-secondary)] hover:bg-[var(--bg-card)] hover:text-[var(--text-primary)]`}`,children:[e.label,(0,V.jsx)(`span`,{className:`ml-1 opacity-70`,children:t})]},e.value)})}),x?(0,V.jsx)(bo,{sessionTree:b,onSelectSession:r}):d.filtered===0?(0,V.jsx)(`div`,{className:`text-center py-12 text-[var(--text-muted)] text-sm`,children:`No sessions match the current filters`}):u?(0,V.jsx)(`div`,{className:`space-y-6`,children:d.groups.map(e=>(0,V.jsx)(ho,{label:e.label,sessions:e.sessions,sort:a,statusFilter:s,onSelectSession:r},e.label+`-`+a+`-`+s))}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{...h,className:`space-y-2`,children:p.map((e,t)=>(0,V.jsx)(_o,{session:e,onClick:()=>r(e.sessionId),navProps:m(t)},e.sessionId))}),l>1&&(0,V.jsx)(go,{page:c,totalPages:l,onPageChange:e=>n({type:`page_changed`,page:e})})]})]})}function mo({label:e,value:t,options:n,onChange:r}){return(0,V.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs text-[var(--text-muted)]`,children:[e,(0,V.jsx)(`select`,{value:t,onChange:e=>r(e.target.value),className:`bg-[var(--bg-secondary)] border border-[var(--border)] rounded-md px-2 py-1.5 text-xs text-[var(--text-primary)] focus:outline-none focus:border-[var(--accent)] cursor-pointer`,children:n.map(e=>(0,V.jsx)(`option`,{value:e.value,children:e.label},e.value))})]})}function ho({label:e,sessions:t,sort:n,statusFilter:r,onSelectSession:i}){let[a,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)(0);(0,B.useEffect)(()=>c(0),[t.length]);let l=Math.ceil(t.length/25),u=s*25,d=u+25,f=t.slice(u,d);return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`button`,{onClick:()=>o(!a),className:`flex items-center gap-2 mb-2 cursor-pointer group`,children:[(0,V.jsx)(`span`,{className:`text-[var(--text-muted)] text-xs transition-transform duration-150`,style:{transform:a?`rotate(-90deg)`:`rotate(0deg)`},children:`▼`}),(0,V.jsx)(`span`,{className:`text-sm font-medium text-[var(--text-secondary)] group-hover:text-[var(--text-primary)] transition-colors`,children:e}),(0,V.jsxs)(`span`,{className:`text-xs text-[var(--text-muted)]`,children:[`(`,t.length,`)`]})]}),!a&&(0,V.jsxs)(`div`,{className:`ml-4`,children:[(0,V.jsx)(`div`,{className:`space-y-2`,children:f.map(e=>(0,V.jsx)(_o,{session:e,onClick:()=>i(e.sessionId)},e.sessionId))}),l>1&&(0,V.jsx)(`div`,{className:`mt-2`,children:(0,V.jsx)(go,{page:s,totalPages:l,onPageChange:c})})]})]})}function go({page:e,totalPages:t,onPageChange:n}){return(0,V.jsxs)(`div`,{className:`flex items-center justify-center gap-2 pt-2`,children:[(0,V.jsx)(`button`,{onClick:()=>n(e-1),disabled:e===0,className:`px-3 py-1.5 text-xs rounded-md bg-[var(--bg-secondary)] border border-[var(--border)] text-[var(--text-secondary)] disabled:opacity-30 disabled:cursor-not-allowed hover:bg-[var(--bg-card)] transition-colors cursor-pointer`,children:`Prev`}),(0,V.jsxs)(`span`,{className:`text-xs text-[var(--text-muted)]`,children:[e+1,` / `,t]}),(0,V.jsx)(`button`,{onClick:()=>n(e+1),disabled:e>=t-1,className:`px-3 py-1.5 text-xs rounded-md bg-[var(--bg-secondary)] border border-[var(--border)] text-[var(--text-secondary)] disabled:opacity-30 disabled:cursor-not-allowed hover:bg-[var(--bg-card)] transition-colors cursor-pointer`,children:`Next`})]})}function _o({session:e,onClick:t,navProps:n}){let r=e.sessionTitle,i=e.workflowName??e.workflowId,a=fo(e.lastModifiedMs);return(0,V.jsxs)(lo,{variant:`list`,onClick:t,tabIndex:n?.tabIndex,onKeyDown:n?.onKeyDown,onFocus:n?.onFocus,ref:n?.ref,className:`rounded-lg px-4 py-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,V.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,V.jsx)(`div`,{className:`text-sm font-medium text-[var(--text-primary)] line-clamp-1 group-hover:text-[var(--accent)] transition-colors`,children:r??i??`Unnamed session`})}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,V.jsx)(`span`,{className:`text-[10px] text-[var(--text-muted)] tabular-nums`,children:a}),e.isAutonomous&&e.isLive&&(0,V.jsx)(no,{label:`LIVE`,pulse:!0,color:`#f4c430`,"aria-label":`Autonomous session actively running`}),(0,V.jsx)(ao,{health:e.health}),(0,V.jsx)(io,{status:e.status})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mt-1.5 flex-wrap`,children:[r&&i&&(0,V.jsx)(yo,{children:i}),e.gitBranch&&(0,V.jsx)(yo,{icon:`branch`,children:e.gitBranch}),(0,V.jsxs)(yo,{icon:`graph`,children:[e.nodeCount,`N / `,e.edgeCount,`E`]}),e.tipCount>1&&(0,V.jsxs)(yo,{icon:`fork`,children:[e.tipCount,` tips`]}),e.hasUnresolvedGaps&&(0,V.jsx)(`span`,{className:`inline-flex items-center gap-1 text-[10px] text-[var(--warning)]`,children:`gaps`})]}),(0,V.jsx)(`div`,{className:`mt-1.5 font-mono text-[10px] text-[var(--text-muted)] opacity-60 group-hover:opacity-100 transition-opacity truncate`,children:e.sessionId})]})}var vo={branch:(0,V.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`currentColor`,className:`shrink-0`,children:(0,V.jsx)(`path`,{d:`M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.5 2.5 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Z`})}),graph:(0,V.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`currentColor`,className:`shrink-0`,children:(0,V.jsx)(`path`,{d:`M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.5 2.5 0 0 1 2 11.5Z`})}),fork:(0,V.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 16 16`,fill:`currentColor`,className:`shrink-0`,children:(0,V.jsx)(`path`,{d:`M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm2.122-.75a2.25 2.25 0 1 0-3.244 0A2.5 2.5 0 0 0 2 5v5.5A2.5 2.5 0 0 0 4.5 13h3.25a.75.75 0 0 0 0-1.5H4.5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a1 1 0 0 1 1 1v5.5a1 1 0 0 1-1 1H8.75Z`})})};function yo({children:e,icon:t}){return(0,V.jsxs)(oo,{className:`gap-1 rounded text-[var(--text-muted)] max-w-[200px] truncate`,children:[t&&vo[t],e]})}function bo({sessionTree:e,onSelectSession:t}){let{roots:n}=e,[r,i]=(0,B.useState)(new Set);(0,B.useEffect)(()=>{let e=n.filter(e=>e.children.length>0&&e.session.status===`in_progress`).map(e=>e.session.sessionId);e.length!==0&&i(t=>e.every(e=>t.has(e))?t:new Set([...t,...e]))},[n]);let a=e=>{i(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return n.length===0?(0,V.jsx)(`div`,{className:`text-center py-12 text-[var(--text-muted)] text-sm`,children:`No sessions found`}):(0,V.jsx)(`div`,{className:`space-y-2`,children:n.map(e=>(0,V.jsx)(xo,{node:e,isExpanded:r.has(e.session.sessionId),onToggle:()=>a(e.session.sessionId),onSelectSession:t},e.session.sessionId))})}function xo({node:e,isExpanded:t,onToggle:n,onSelectSession:r}){let i=e.children.length>0;return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`flex items-start gap-1`,children:[i?(0,V.jsx)(`button`,{type:`button`,onClick:n,"aria-expanded":t,"aria-label":`${t?`Collapse`:`Expand`} children of ${e.session.sessionTitle??e.session.sessionId}`,className:`flex items-center justify-center w-11 h-11 shrink-0 text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1 focus-visible:outline-none`,children:(0,V.jsx)(`span`,{className:`text-xs transition-transform duration-150`,style:{transform:t?`rotate(90deg)`:`rotate(0deg)`},children:`▶`})}):(0,V.jsx)(`div`,{className:`w-11 shrink-0`}),(0,V.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,V.jsx)(So,{session:e.session,hasChildren:i,isExpanded:t,childCount:e.children.length,onClick:()=>r(e.session.sessionId)})})]}),i&&t&&(0,V.jsx)(`div`,{className:`ml-11`,children:(0,V.jsx)(uo,{children:(0,V.jsx)(`div`,{className:`space-y-2 pt-1`,children:e.children.map(e=>(0,V.jsx)(Co,{session:e,onClick:()=>r(e.sessionId)},e.sessionId))})})})]})}function So({session:e,hasChildren:t,isExpanded:n,childCount:r,onClick:i}){let a=e.sessionTitle,o=e.workflowName??e.workflowId,s=fo(e.lastModifiedMs);return(0,V.jsxs)(lo,{variant:`list`,onClick:i,className:`rounded-lg px-4 py-3`,style:{borderLeft:`3px solid var(--accent)`},children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,V.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,V.jsx)(`div`,{className:`text-sm font-medium text-[var(--text-primary)] line-clamp-1 group-hover:text-[var(--accent)] transition-colors`,children:a??o??`Unnamed session`})}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,V.jsx)(`span`,{className:`text-[10px] text-[var(--text-muted)] tabular-nums`,children:s}),e.isAutonomous&&e.isLive&&(0,V.jsx)(no,{label:`LIVE`,pulse:!0,color:`#f4c430`}),(0,V.jsx)(no,{label:`COORD`,color:`var(--accent)`}),(0,V.jsx)(io,{status:e.status})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 mt-1.5 flex-wrap`,children:[a&&o&&(0,V.jsx)(oo,{className:`rounded text-[var(--text-muted)] max-w-[200px] truncate`,children:o}),t&&!n&&(0,V.jsxs)(oo,{className:`rounded text-[var(--accent)]`,children:[r,` `,r===1?`child`:`children`]})]}),(0,V.jsx)(`div`,{className:`mt-1.5 font-mono text-[10px] text-[var(--text-muted)] opacity-60 group-hover:opacity-100 transition-opacity truncate`,children:e.sessionId})]})}function Co({session:e,onClick:t}){let n=e.sessionTitle,r=e.workflowName??e.workflowId,i=fo(e.lastModifiedMs);return(0,V.jsxs)(lo,{variant:`list`,onClick:t,className:`rounded-lg px-4 py-2.5`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,V.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,V.jsx)(`div`,{className:`text-sm font-medium text-[var(--text-primary)] line-clamp-1 group-hover:text-[var(--accent)] transition-colors`,children:n??r??`Unnamed session`})}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,V.jsx)(`span`,{className:`text-[10px] text-[var(--text-muted)] tabular-nums`,children:i}),(0,V.jsx)(io,{status:e.status})]})]}),(0,V.jsx)(`div`,{className:`mt-1 font-mono text-[10px] text-[var(--text-muted)] opacity-60 truncate`,children:e.sessionId})]})}var wo=[{workflow:`coding task workflow`,task:`add a dark mode toggle to the settings page`},{workflow:`coding task workflow`,task:`write tests for the authentication module`},{workflow:`coding task workflow`,task:`refactor the data layer to use a repository pattern`},{workflow:`coding task workflow`,task:`add pagination to the search results view`},{workflow:`bug investigation workflow`,task:`find why the API returns 500 on logout`},{workflow:`bug investigation workflow`,task:`trace why notifications stop sending after 24 hours`},{workflow:`bug investigation workflow`,task:`figure out why the build is failing on CI but not locally`},{workflow:`MR review workflow`,task:`review my latest changes on this branch`},{workflow:`MR review workflow`,task:`review PR #123 before it merges`}],To=[`The DAG view shows every node the agent created, including blocked attempts and alternative paths.`,`Dormant sessions have been idle for over an hour -- return to the original conversation to resume.`,`Gaps are open questions the agent flagged but could not resolve. Check them in the node detail panel.`,`The preferred tip node (highlighted in yellow in the DAG) is the most recent forward position.`,`Complete with gaps means the workflow finished but left critical follow-ups unresolved.`,`The tip count badge shows how many execution paths a session explored.`,`Use j and k to navigate between branches, Enter to expand, and / to open the full session archive.`];function Eo(e){return e[Math.floor(Math.random()*e.length)]}function Do({viewModel:e,sessionListViewModel:t,hidden:n=!1}){let{state:r,dispatch:i,scrollYRef:a,onSelectSession:o}=e,s=(0,B.useRef)(new Map),c=(0,B.useRef)(!0);if((0,B.useEffect)(()=>{if(c.current){c.current=!1;return}if(!n){let e=requestAnimationFrame(()=>{window.scrollTo({top:a.current})});return()=>cancelAnimationFrame(e)}},[n,a]),r.kind===`loading`)return(0,V.jsx)(`div`,{className:`flex items-center justify-center py-32 ${n?`hidden`:``}`,children:(0,V.jsx)(`span`,{className:`font-mono text-[11px] text-[var(--text-muted)] uppercase tracking-[0.25em] motion-safe:animate-pulse`,children:`// LOADING WORKSPACE...`})});if(r.kind===`error`)return(0,V.jsxs)(`div`,{className:`p-4 ${n?`hidden`:``}`,style:{borderLeft:`3px solid var(--error)`},children:[(0,V.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--error)] block mb-1`,children:`// ERROR`}),(0,V.jsxs)(`span`,{className:`text-sm text-[var(--text-secondary)]`,children:[`Failed to load workspace: `,r.message]})]});let{scope:l,focusedIndex:u,archive:d,repoGroups:f,orderedItems:p,archiveRepos:m,dormantHiddenCount:h,worktreesFetching:g,hasAnySessions:_}=r;return d===null?(0,V.jsxs)(`div`,{className:`space-y-6 ${n?`hidden`:``}`,children:[_?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h1`,{className:`font-mono text-2xl font-bold uppercase tracking-[0.12em] leading-none`,style:{color:`var(--accent)`,textShadow:`0 0 28px rgba(244,196,48,0.35)`},children:`Workspace`}),(0,V.jsxs)(`p`,{className:`font-mono text-[10px] tracking-[0.25em] text-[var(--text-muted)] mt-1.5`,children:[`// `,p.length,` session`,p.length===1?``:`s`]})]}),(0,V.jsx)(Ho,{scope:l,onChange:e=>i({type:`scope_changed`,scope:e})})]}),p.length===0?(0,V.jsx)(`p`,{className:`font-mono text-[11px] text-[var(--text-muted)] text-center py-8`,children:`// no sessions match current filter`}):(0,V.jsx)(`div`,{className:`space-y-6`,children:f.map((e,t)=>(0,V.jsx)(ko,{group:e,showHeader:!0,scope:l,focusedIndex:u,groupOffset:f.slice(0,t).reduce((e,t)=>e+t.sortedItems.length,0),worktreesFetching:g,onSelectSession:o,expandStateRef:s},e.repoRoot))}),h>0&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>i({type:`scope_changed`,scope:`all`}),className:`font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors text-left`,children:[`// `,h,` dormant session`,h===1?``:`s`,` hidden — show all`]}),(0,V.jsx)(Uo,{repos:m,onOpen:e=>i({type:`archive_opened`,repoName:e})})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Wo,{prompt:Eo(wo)}),(0,V.jsx)(Go,{})]}),(0,V.jsx)(Go,{})]}):(0,V.jsxs)(`div`,{className:`space-y-4 ${n?`hidden`:``}`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`button`,{onClick:()=>i({type:`archive_closed`}),className:`font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors`,children:`// WORKSPACE ←`}),d.repoName&&(0,V.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)]`,children:d.repoName})]}),(0,V.jsx)(po,{viewModel:t})]})}var Oo=12;function ko({group:e,showHeader:t,scope:n,focusedIndex:r,groupOffset:i,worktreesFetching:a,onSelectSession:o,expandStateRef:s}){let[c,l]=(0,B.useState)(!1),u=c?e.sortedItems:e.sortedItems.slice(0,Oo),d=e.sortedItems.length-Oo,f=e.sortedItems.filter(e=>e.primarySession?.status===`in_progress`||e.primarySession?.status===`blocked`).length;return(0,V.jsxs)(`section`,{children:[t&&(0,V.jsx)(`div`,{style:{position:`sticky`,top:`var(--app-header-height)`,zIndex:10},className:`mb-3`,children:(0,V.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-2`,style:{background:`var(--bg-secondary)`,borderLeft:`3px solid var(--accent)`,borderBottom:`1px solid rgba(244,196,48,0.15)`},children:[(0,V.jsx)(`span`,{className:`font-mono text-[12px] font-bold uppercase tracking-[0.25em] text-[var(--text-primary)]`,children:e.repoName}),f>0&&(0,V.jsx)(no,{label:`${f} ACTIVE`,color:`var(--accent-strong)`}),(0,V.jsx)(`div`,{className:`flex-1 h-px`,style:{background:`rgba(244,196,48,0.12)`}})]})}),(0,V.jsxs)(`div`,{className:`space-y-3`,children:[u.map((e,t)=>{let c=r===i+t;if(e.allSessions.length===0)return(0,V.jsx)(Po,{item:e,isFocused:c,worktreesFetching:a,expandStateRef:s},`${e.branch}\0${e.repoRoot}`);if(e.allSessions.length>1)return(0,V.jsx)(jo,{item:e,isFocused:c,scope:n,worktreesFetching:a,onSelectSession:o,expandStateRef:s},`${e.branch}\0${e.repoRoot}`);let l=e.allSessions[0];return(0,V.jsxs)(uo,{style:c?{outline:`2px solid var(--accent)`,outlineOffset:`2px`}:void 0,children:[(0,V.jsx)(Mo,{item:e,worktreesFetching:a,filesExpanded:!1,onToggleFiles:()=>{},unpushedExpanded:!1,onToggleUnpushed:()=>{}}),(0,V.jsx)(`div`,{className:`pl-3 mt-px`,children:(0,V.jsx)(No,{session:l,item:e,showBranch:!1,onSelect:()=>o(l.sessionId)})})]},`${e.branch}\0${e.repoRoot}`)}),!c&&d>0&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>l(!0),className:`w-full text-left px-3 py-2 font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors`,children:[`+ `,d,` more `,d===1?`branch`:`branches`]})]})]})}var Ao=(e,t)=>{let n=e=>e.status===`in_progress`||e.status===`dormant`?0:e.status===`blocked`?1:2,r=n(e)-n(t);return r===0?t.lastModifiedMs-e.lastModifiedMs:r};function jo({item:e,isFocused:t,scope:n,worktreesFetching:r,onSelectSession:i,expandStateRef:a}){let o=`${e.branch}\0${e.repoRoot}`,s=()=>a.current?.get(o)??{filesExpanded:!1,unpushedExpanded:!1},[c,l]=(0,B.useState)(!1),[u,d]=(0,B.useState)(()=>s().filesExpanded),[f,p]=(0,B.useState)(()=>s().unpushedExpanded),m=[...e.allSessions].sort(Ao),h=(0,B.useCallback)(()=>{d(e=>{let t=!e,n=a.current?.get(o)??{filesExpanded:!1,unpushedExpanded:!1};return a.current?.set(o,{...n,filesExpanded:t}),t})},[o,a]),g=(0,B.useCallback)(()=>{p(e=>{let t=!e,n=a.current?.get(o)??{filesExpanded:!1,unpushedExpanded:!1};return a.current?.set(o,{...n,unpushedExpanded:t}),t})},[o,a]),_=e=>e.status===`dormant`&&n===`all`,v=m.filter(e=>e.status===`in_progress`||e.status===`blocked`||_(e)),y=m.filter(e=>e.status!==`in_progress`&&e.status!==`blocked`&&!_(e));return(0,V.jsxs)(uo,{style:t?{outline:`2px solid var(--accent)`,outlineOffset:`2px`}:void 0,children:[(0,V.jsx)(Mo,{item:e,worktreesFetching:r,filesExpanded:u,onToggleFiles:h,unpushedExpanded:f,onToggleUnpushed:g}),u&&e.worktree&&e.worktree.changedFiles.length>0&&(0,V.jsx)(Ro,{files:e.worktree.changedFiles}),f&&e.worktree&&(0,V.jsx)(zo,{commits:e.worktree.unpushedCommits,count:e.worktree.aheadCount}),(0,V.jsxs)(`div`,{className:`pl-3 mt-px space-y-px`,children:[v.map(e=>(0,V.jsx)(No,{session:e,showBranch:!1,onSelect:()=>i(e.sessionId)},e.sessionId)),y.length>0&&(0,V.jsxs)(V.Fragment,{children:[c&&y.map(e=>(0,V.jsx)(No,{session:e,showBranch:!1,onSelect:()=>i(e.sessionId)},e.sessionId)),(0,V.jsx)(`button`,{type:`button`,onClick:()=>l(e=>!e),className:`w-full text-left px-3 py-1.5 font-mono text-[10px] text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors`,children:c?`// hide history`:`+ ${y.length} completed workflow${y.length===1?``:`s`}`})]})]})]})}function Mo({item:e,worktreesFetching:t,filesExpanded:n,onToggleFiles:r,unpushedExpanded:i,onToggleUnpushed:a}){let o=fo(e.activityMs);return(0,V.jsxs)(`div`,{className:`flex items-center gap-2 py-1 pr-3`,children:[(0,V.jsx)(`span`,{className:`font-mono text-[11px] font-medium text-[var(--text-secondary)] truncate flex-1`,children:e.branch}),e.worktree?.isMerged&&e.worktree.branch!==null&&e.worktree.branch!==`main`&&(0,V.jsx)(Bo,{}),(0,V.jsx)(Fo,{item:e,fetching:t,compact:!0,filesExpanded:n,onToggleFiles:r,unpushedExpanded:i,onToggleUnpushed:a}),(0,V.jsx)(`span`,{className:`font-mono text-[10px] text-[var(--text-muted)] tabular-nums shrink-0`,children:o})]})}function No({session:e,item:t,showBranch:n=!0,onSelect:r}){let i=fo(e.lastModifiedMs),a=e.sessionTitle?.trim()||e.workflowName||e.workflowId||e.sessionId.slice(0,8),o=e.workflowName??e.workflowId??null,s=e.status===`dormant`;return(0,V.jsx)(lo,{variant:`list`,onClick:r,className:`px-4 py-3`,style:{borderLeft:`3px solid ${e.status===`in_progress`?`var(--accent-strong)`:e.status===`blocked`?`var(--blocked)`:s?`rgba(244, 196, 48, 0.55)`:`rgba(244, 196, 48, 0.15)`}`},children:(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,V.jsxs)(`div`,{className:`min-w-0 flex-1 flex items-start gap-2`,children:[s&&(0,V.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full shrink-0 mt-[3px] bg-[var(--accent)]`,"aria-hidden":`true`,title:`Dormant`}),(0,V.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,V.jsx)(`p`,{className:`text-sm text-[var(--text-primary)] group-hover:text-[var(--accent)] transition-colors leading-snug line-clamp-1 mb-0.5`,children:a}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap min-w-0`,children:[n&&t&&(0,V.jsx)(`span`,{className:`font-mono text-[10px] text-[var(--text-muted)] truncate max-w-[200px]`,children:t.branch}),o&&e.sessionTitle&&(0,V.jsx)(`span`,{className:`font-mono text-[10px] text-[var(--text-muted)] shrink-0`,children:o}),n&&t?.worktree&&(0,V.jsx)(Fo,{item:t,fetching:!1,compact:!0})]})]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[e.hasUnresolvedGaps&&(0,V.jsx)(`span`,{className:`text-[10px] text-[var(--warning)]`,title:`Unresolved gaps`,children:`⚠`}),(0,V.jsx)(io,{status:e.status}),(0,V.jsx)(`span`,{className:`font-mono text-[10px] text-[var(--text-muted)] tabular-nums`,children:i})]})]})})}function Po({item:e,isFocused:t,worktreesFetching:n,expandStateRef:r}){let i=`${e.branch}\0${e.repoRoot}`,a=()=>r.current?.get(i)??{filesExpanded:!1,unpushedExpanded:!1},[o,s]=(0,B.useState)(()=>a().filesExpanded),[c,l]=(0,B.useState)(()=>a().unpushedExpanded),[u]=to(),d=fo(e.activityMs),f=(0,B.useCallback)(()=>{s(e=>{let t=!e,n=r.current?.get(i)??{filesExpanded:!1,unpushedExpanded:!1};return r.current?.set(i,{...n,filesExpanded:t}),t})},[i,r]),p=(0,B.useCallback)(()=>{l(e=>{let t=!e,n=r.current?.get(i)??{filesExpanded:!1,unpushedExpanded:!1};return r.current?.set(i,{...n,unpushedExpanded:t}),t})},[i,r]);return(0,V.jsxs)(`div`,{ref:u,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-2 rounded ${t?`ring-2 ring-[var(--accent)] ring-offset-1`:``}`,children:[(0,V.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full shrink-0 bg-[var(--border)]`,title:`No sessions`}),(0,V.jsx)(`span`,{className:`font-mono text-xs text-[var(--text-muted)] truncate flex-1`,children:e.branch}),e.worktree?.isMerged&&e.worktree.branch!==null&&e.worktree.branch!==`main`&&(0,V.jsx)(Bo,{}),(0,V.jsx)(Fo,{item:e,fetching:n,compact:!0,filesExpanded:o,onToggleFiles:f,unpushedExpanded:c,onToggleUnpushed:p}),e.worktree?.headMessage&&(0,V.jsx)(`span`,{className:`text-[10px] text-[var(--text-muted)] truncate hidden sm:block max-w-[200px] opacity-60`,children:e.worktree.headMessage}),(0,V.jsx)(`span`,{className:`text-[10px] text-[var(--text-muted)] tabular-nums shrink-0`,children:d})]}),o&&e.worktree&&e.worktree.changedFiles.length>0&&(0,V.jsx)(Ro,{files:e.worktree.changedFiles}),c&&e.worktree&&(0,V.jsx)(zo,{commits:e.worktree.unpushedCommits,count:e.worktree.aheadCount})]})}function Fo({item:e,fetching:t,compact:n=!1,filesExpanded:r,onToggleFiles:i,unpushedExpanded:a,onToggleUnpushed:o}){if(t&&e.worktree===void 0||e.worktree?.enrichment===null)return(0,V.jsx)(`span`,{className:`flex gap-1`,children:(0,V.jsx)(Vo,{})});let s=e.worktree;if(!s)return null;let c=s.changedCount,l=s.aheadCount;if(c===0&&l===0)return null;let u=`text-xs px-1.5 py-0.5 rounded bg-orange-500/10 text-orange-400 border border-orange-500/20 tabular-nums${n?` text-[10px]`:``}`;return(0,V.jsxs)(`span`,{className:`flex items-center gap-1`,children:[c>0&&(i?(0,V.jsxs)(`button`,{type:`button`,"aria-expanded":r??!1,"aria-label":`Show ${c} uncommitted file${c===1?``:`s`}`,title:`${c} file${c===1?``:`s`} edited but not yet committed — click to expand`,onClick:i,className:`${u} cursor-pointer hover:bg-orange-500/20 transition-colors focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1${r?` ring-1 ring-orange-500/40`:``}`,children:[c,` uncommitted`]}):(0,V.jsxs)(`span`,{title:`${c} file${c===1?``:`s`} edited but not yet committed`,className:u,children:[c,` uncommitted`]})),l>0&&(o?(0,V.jsxs)(`button`,{type:`button`,"aria-expanded":a??!1,"aria-label":`Show ${l} unpushed commit${l===1?``:`s`}`,title:`${l} commit${l===1?``:`s`} not yet pushed -- click to expand`,onClick:o,className:`text-xs px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400 border border-blue-500/20 cursor-pointer hover:bg-blue-500/20 transition-colors focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1 tabular-nums${n?` text-[10px]`:``}${a?` ring-1 ring-blue-500/40`:``}`,children:[l,` unpushed`]}):(0,V.jsxs)(`span`,{title:`${l} commit${l===1?``:`s`} not yet pushed`,className:`text-xs px-1.5 py-0.5 rounded bg-blue-500/10 text-blue-400 border border-blue-500/20 tabular-nums${n?` text-[10px]`:``}`,children:[l,` unpushed`]}))]})}var Io={modified:`var(--warning)`,added:`var(--success)`,deleted:`var(--error)`,untracked:`#a0a0a0`,renamed:`var(--accent)`,other:`#a0a0a0`},Lo={modified:`M`,added:`A`,deleted:`D`,untracked:`?`,renamed:`R`,other:`~`};function Ro({files:e}){return(0,V.jsx)(`div`,{className:`mx-3 mb-1 max-h-48 overflow-y-auto rounded border border-[var(--border)] bg-[var(--bg-card)]`,children:e.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-0.5 hover:bg-[var(--bg-tertiary)]`,children:[(0,V.jsx)(`span`,{className:`text-[10px] font-mono font-semibold w-3 shrink-0 tabular-nums`,style:{color:Io[e.status]},title:e.status,children:Lo[e.status]}),(0,V.jsx)(`span`,{className:`font-mono text-[11px] text-[var(--text-secondary)] truncate`,children:e.path})]},t))})}function zo({commits:e,count:t}){return e.length===0?(0,V.jsx)(`div`,{className:`mx-3 mb-1 px-2 py-1.5 rounded border border-[var(--border)] bg-[var(--bg-card)]`,children:(0,V.jsx)(`span`,{className:`text-[11px] text-[var(--text-muted)] italic`,children:t!==void 0&&t>0?`${t} commit${t===1?``:`s`} ahead -- details unavailable`:`No unpushed commits`})}):(0,V.jsx)(`div`,{className:`mx-3 mb-1 max-h-48 overflow-y-auto rounded border border-[var(--border)] bg-[var(--bg-card)]`,children:e.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-0.5 hover:bg-[var(--bg-tertiary)]`,children:[(0,V.jsx)(`span`,{className:`font-mono text-[10px] text-[var(--text-muted)] shrink-0 tabular-nums w-14`,children:e.hash}),(0,V.jsx)(`span`,{className:`font-mono text-[11px] text-[var(--text-secondary)] truncate`,children:e.message})]},t))})}function Bo(){return(0,V.jsx)(`span`,{title:`Merged into main`,className:`text-[10px] px-1.5 py-0.5 rounded bg-green-500/10 text-green-400 border border-green-500/20 shrink-0`,children:`merged`})}function Vo(){return(0,V.jsx)(`span`,{className:`inline-block h-5 w-20 rounded bg-[var(--bg-tertiary)] motion-safe:animate-pulse`})}function Ho({scope:e,onChange:t}){return(0,V.jsx)(`div`,{className:`flex items-center gap-1`,children:[`active`,`all`].map(n=>(0,V.jsx)(`button`,{type:`button`,onClick:()=>t(n),className:`font-mono text-[10px] uppercase tracking-[0.20em] px-2.5 py-1 transition-colors capitalize ${e===n?`border border-[var(--accent)] text-[var(--accent)] bg-transparent`:`border border-transparent text-[var(--text-muted)] hover:text-[var(--text-secondary)]`}`,children:n===`active`?`Active`:`All`},n))})}function Uo({repos:e,onOpen:t}){return(0,V.jsxs)(`div`,{className:`flex flex-col gap-1 pt-2 border-t border-[var(--border)]`,children:[e.map(([e,n])=>(0,V.jsx)(`button`,{type:`button`,onClick:()=>t(n),className:`font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors text-left`,children:`// SESSION ARCHIVE →`},e)),e.length>1&&(0,V.jsx)(`button`,{type:`button`,onClick:()=>t(void 0),className:`font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors text-left`,children:`// ALL SESSIONS →`})]})}function Wo({prompt:e}){return(0,V.jsxs)(`div`,{className:`flex flex-col items-center gap-8 py-20 text-center`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`font-mono text-[11px] uppercase tracking-[0.30em] text-[var(--text-muted)] mb-3`,children:`// WORKSPACE READY`}),(0,V.jsx)(`h2`,{className:`text-xl font-semibold text-[var(--text-primary)] mb-3`,children:`Ready when you are`}),(0,V.jsx)(`p`,{className:`text-sm text-[var(--text-muted)] max-w-sm leading-relaxed`,children:`Sessions appear here when your agent runs a workflow. Start one by telling your agent:`})]}),(0,V.jsx)(`div`,{className:`relative h-[100px] max-w-lg w-full`,children:(0,V.jsx)(W,{cut:12,borderColor:`var(--border)`,background:`var(--bg-card)`,className:`absolute inset-0`,children:(0,V.jsxs)(`div`,{className:`px-6 py-5 text-left`,children:[(0,V.jsx)(`p`,{className:`font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)] mb-2`,children:`Try this prompt`}),(0,V.jsxs)(`p`,{className:`text-[var(--text-primary)] text-sm leading-relaxed`,children:[`"Use the`,` `,(0,V.jsx)(`span`,{className:`text-[var(--accent)] font-medium`,children:e.workflow}),` `,`to `,e.task,`"`]})]})})}),(0,V.jsxs)(`p`,{className:`font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)]`,children:[`// `,wo.length,` PROMPTS AVAILABLE`]})]})}function Go(){let[e,t]=(0,B.useState)(()=>Math.floor(Math.random()*To.length)),[n,r]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{let e=null,n=setInterval(()=>{r(!0),e=setTimeout(()=>{t(e=>(e+1)%To.length),r(!1),e=null},300)},6e4);return()=>{clearInterval(n),e!==null&&clearTimeout(e)}},[]),(0,V.jsx)(`div`,{className:`flex items-start gap-3 border border-[var(--border)] px-4 py-3`,style:{borderLeft:`3px solid rgba(244, 196, 48, 0.4)`},children:(0,V.jsxs)(`div`,{style:{opacity:+!n,transition:`opacity 300ms`},children:[(0,V.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--accent)]`,children:`// TIP`}),(0,V.jsx)(`p`,{className:`text-sm text-[var(--text-secondary)] mt-1 leading-relaxed`,children:To[e]})]})})}function Ko({children:e,color:t,className:n=``,style:r}){return(0,V.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-[0.30em] ${n}`,style:{color:t??`var(--text-muted)`,...r},children:e})}function qo(e){return e.replace(/_/g,` `).replace(/([A-Z])/g,` $1`).replace(/\s+/g,` `).toUpperCase().trim()}function Jo(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Jo(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var Yo={value:()=>{}};function Xo(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new Zo(n)}function Zo(e){this._=e}function Qo(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}Zo.prototype=Xo.prototype={constructor:Zo,on:function(e,t){var n=this._,r=Qo(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=$o(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=es(n[i],e.name,t);else if(t==null)for(i in n)n[i]=es(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Zo(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function $o(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function es(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Yo,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var ts={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function ns(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),ts.hasOwnProperty(t)?{space:ts[t],local:e}:e}function rs(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function is(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function as(e){var t=ns(e);return(t.local?is:rs)(t)}function os(){}function ss(e){return e==null?os:function(){return this.querySelector(e)}}function cs(e){typeof e!=`function`&&(e=ss(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new Xc(r,this._parents)}function ls(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function us(){return[]}function ds(e){return e==null?us:function(){return this.querySelectorAll(e)}}function fs(e){return function(){return ls(e.apply(this,arguments))}}function ps(e){e=typeof e==`function`?fs(e):ds(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new Xc(r,i)}function ms(e){return function(){return this.matches(e)}}function hs(e){return function(t){return t.matches(e)}}var gs=Array.prototype.find;function _s(e){return function(){return gs.call(this.children,e)}}function vs(){return this.firstElementChild}function ys(e){return this.select(e==null?vs:_s(typeof e==`function`?e:hs(e)))}var bs=Array.prototype.filter;function xs(){return Array.from(this.children)}function Ss(e){return function(){return bs.call(this.children,e)}}function Cs(e){return this.selectAll(e==null?xs:Ss(typeof e==`function`?e:hs(e)))}function ws(e){typeof e!=`function`&&(e=ms(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Xc(r,this._parents)}function Ts(e){return Array(e.length)}function Es(){return new Xc(this._enter||this._groups.map(Ts),this._parents)}function Ds(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ds.prototype={constructor:Ds,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Os(e){return function(){return e}}function ks(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new Ds(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function As(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new Ds(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function js(e){return e.__data__}function Ms(e,t){if(!arguments.length)return Array.from(this,js);var n=t?As:ks,r=this._parents,i=this._groups;typeof e!=`function`&&(e=Os(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=Ns(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new Xc(o,r),o._enter=s,o._exit=c,o}function Ns(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Ps(){return new Xc(this._exit||this._groups.map(Ts),this._parents)}function Fs(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function Is(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new Xc(s,this._parents)}function Ls(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Rs(e){e||=zs;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new Xc(i,this._parents).order()}function zs(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Bs(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Vs(){return Array.from(this)}function Hs(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Us(){let e=0;for(let t of this)++e;return e}function Ws(){return!this.node()}function Gs(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function Ks(e){return function(){this.removeAttribute(e)}}function qs(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Js(e,t){return function(){this.setAttribute(e,t)}}function Ys(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Xs(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Zs(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Qs(e,t){var n=ns(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?qs:Ks:typeof t==`function`?n.local?Zs:Xs:n.local?Ys:Js)(n,t))}function $s(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ec(e){return function(){this.style.removeProperty(e)}}function tc(e,t,n){return function(){this.style.setProperty(e,t,n)}}function nc(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function rc(e,t,n){return arguments.length>1?this.each((t==null?ec:typeof t==`function`?nc:tc)(e,t,n??``)):ic(this.node(),e)}function ic(e,t){return e.style.getPropertyValue(t)||$s(e).getComputedStyle(e,null).getPropertyValue(t)}function ac(e){return function(){delete this[e]}}function oc(e,t){return function(){this[e]=t}}function sc(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function cc(e,t){return arguments.length>1?this.each((t==null?ac:typeof t==`function`?sc:oc)(e,t)):this.node()[e]}function lc(e){return e.trim().split(/^|\s+/)}function uc(e){return e.classList||new dc(e)}function dc(e){this._node=e,this._names=lc(e.getAttribute(`class`)||``)}dc.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function fc(e,t){for(var n=uc(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function pc(e,t){for(var n=uc(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function mc(e){return function(){fc(this,e)}}function hc(e){return function(){pc(this,e)}}function gc(e,t){return function(){(t.apply(this,arguments)?fc:pc)(this,e)}}function _c(e,t){var n=lc(e+``);if(arguments.length<2){for(var r=uc(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?gc:t?mc:hc)(n,t))}function vc(){this.textContent=``}function yc(e){return function(){this.textContent=e}}function bc(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function xc(e){return arguments.length?this.each(e==null?vc:(typeof e==`function`?bc:yc)(e)):this.node().textContent}function Sc(){this.innerHTML=``}function Cc(e){return function(){this.innerHTML=e}}function wc(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function Tc(e){return arguments.length?this.each(e==null?Sc:(typeof e==`function`?wc:Cc)(e)):this.node().innerHTML}function Ec(){this.nextSibling&&this.parentNode.appendChild(this)}function Dc(){return this.each(Ec)}function Oc(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function kc(){return this.each(Oc)}function Ac(e){var t=typeof e==`function`?e:as(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function jc(){return null}function Mc(e,t){var n=typeof e==`function`?e:as(e),r=t==null?jc:typeof t==`function`?t:ss(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Nc(){var e=this.parentNode;e&&e.removeChild(this)}function Pc(){return this.each(Nc)}function Fc(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ic(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Lc(e){return this.select(e?Ic:Fc)}function Rc(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function zc(e){return function(t){e.call(this,t,this.__data__)}}function Bc(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function Vc(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function Hc(e,t,n){return function(){var r=this.__on,i,a=zc(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Uc(e,t,n){var r=Bc(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?Hc:Vc,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function Wc(e,t,n){var r=$s(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Gc(e,t){return function(){return Wc(this,e,t)}}function Kc(e,t){return function(){return Wc(this,e,t.apply(this,arguments))}}function qc(e,t){return this.each((typeof t==`function`?Kc:Gc)(e,t))}function*Jc(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Yc=[null];function Xc(e,t){this._groups=e,this._parents=t}function Zc(){return new Xc([[document.documentElement]],Yc)}function Qc(){return this}Xc.prototype=Zc.prototype={constructor:Xc,select:cs,selectAll:ps,selectChild:ys,selectChildren:Cs,filter:ws,data:Ms,enter:Es,exit:Ps,join:Fs,merge:Is,selection:Qc,order:Ls,sort:Rs,call:Bs,nodes:Vs,node:Hs,size:Us,empty:Ws,each:Gs,attr:Qs,style:rc,property:cc,classed:_c,text:xc,html:Tc,raise:Dc,lower:kc,append:Ac,insert:Mc,remove:Pc,clone:Lc,datum:Rc,on:Uc,dispatch:qc,[Symbol.iterator]:Jc};function $c(e){return typeof e==`string`?new Xc([[document.querySelector(e)]],[document.documentElement]):new Xc([[e]],Yc)}function el(e){let t;for(;t=e.sourceEvent;)e=t;return e}function tl(e,t){if(e=el(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var nl={passive:!1},rl={capture:!0,passive:!1};function il(e){e.stopImmediatePropagation()}function al(e){e.preventDefault(),e.stopImmediatePropagation()}function ol(e){var t=e.document.documentElement,n=$c(e).on(`dragstart.drag`,al,rl);`onselectstart`in t?n.on(`selectstart.drag`,al,rl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function sl(e,t){var n=e.document.documentElement,r=$c(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,al,rl),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var cl=e=>()=>e;function ll(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}ll.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function ul(e){return!e.ctrlKey&&!e.button}function dl(){return this.parentNode}function fl(e,t){return t??{x:e.x,y:e.y}}function pl(){return navigator.maxTouchPoints||`ontouchstart`in this}function ml(){var e=ul,t=dl,n=fl,r=pl,i={},a=Xo(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,nl).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!(u||!e.call(this,n,r))){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&($c(n.view).on(`mousemove.drag`,m,rl).on(`mouseup.drag`,h,rl),ol(n.view),il(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(al(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){$c(e.view).on(`mousemove.drag mouseup.drag`,null),sl(e.view,l),al(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r)){var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s,c;for(s=0;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(il(n),c(`start`,n,i[s]))}}function _(e){var t=e.changedTouches,n=t.length,r,a;for(r=0;r<n;++r)(a=i[t[r].identifier])&&(al(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(il(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=tl(l||r,t),p,m,h;if((h=n.call(e,new ll(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=tl(l||a,t),_=o;break}u.call(r,e,new ll(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:cl(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:cl(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:cl(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:cl(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function hl(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function gl(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function _l(){}var vl=.7,yl=1/vl,bl=`\\s*([+-]?\\d+)\\s*`,xl=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,Sl=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,Cl=/^#([0-9a-f]{3,8})$/,wl=RegExp(`^rgb\\(${bl},${bl},${bl}\\)$`),Tl=RegExp(`^rgb\\(${Sl},${Sl},${Sl}\\)$`),El=RegExp(`^rgba\\(${bl},${bl},${bl},${xl}\\)$`),Dl=RegExp(`^rgba\\(${Sl},${Sl},${Sl},${xl}\\)$`),Ol=RegExp(`^hsl\\(${xl},${Sl},${Sl}\\)$`),kl=RegExp(`^hsla\\(${xl},${Sl},${Sl},${xl}\\)$`),Al={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};hl(_l,Fl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:jl,formatHex:jl,formatHex8:Ml,formatHsl:Nl,formatRgb:Pl,toString:Pl});function jl(){return this.rgb().formatHex()}function Ml(){return this.rgb().formatHex8()}function Nl(){return Gl(this).formatHsl()}function Pl(){return this.rgb().formatRgb()}function Fl(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=Cl.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Il(t):n===3?new G(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ll(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ll(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=wl.exec(e))?new G(t[1],t[2],t[3],1):(t=Tl.exec(e))?new G(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=El.exec(e))?Ll(t[1],t[2],t[3],t[4]):(t=Dl.exec(e))?Ll(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ol.exec(e))?Wl(t[1],t[2]/100,t[3]/100,1):(t=kl.exec(e))?Wl(t[1],t[2]/100,t[3]/100,t[4]):Al.hasOwnProperty(e)?Il(Al[e]):e===`transparent`?new G(NaN,NaN,NaN,0):null}function Il(e){return new G(e>>16&255,e>>8&255,e&255,1)}function Ll(e,t,n,r){return r<=0&&(e=t=n=NaN),new G(e,t,n,r)}function Rl(e){return e instanceof _l||(e=Fl(e)),e?(e=e.rgb(),new G(e.r,e.g,e.b,e.opacity)):new G}function zl(e,t,n,r){return arguments.length===1?Rl(e):new G(e,t,n,r??1)}function G(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}hl(G,zl,gl(_l,{brighter(e){return e=e==null?yl:yl**+e,new G(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?vl:vl**+e,new G(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new G(Hl(this.r),Hl(this.g),Hl(this.b),Vl(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Bl,formatHex:Bl,formatHex8:K,formatRgb:q,toString:q}));function Bl(){return`#${Ul(this.r)}${Ul(this.g)}${Ul(this.b)}`}function K(){return`#${Ul(this.r)}${Ul(this.g)}${Ul(this.b)}${Ul((isNaN(this.opacity)?1:this.opacity)*255)}`}function q(){let e=Vl(this.opacity);return`${e===1?`rgb(`:`rgba(`}${Hl(this.r)}, ${Hl(this.g)}, ${Hl(this.b)}${e===1?`)`:`, ${e})`}`}function Vl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Hl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ul(e){return e=Hl(e),(e<16?`0`:``)+e.toString(16)}function Wl(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ql(e,t,n,r)}function Gl(e){if(e instanceof ql)return new ql(e.h,e.s,e.l,e.opacity);if(e instanceof _l||(e=Fl(e)),!e)return new ql;if(e instanceof ql)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new ql(o,s,c,e.opacity)}function Kl(e,t,n,r){return arguments.length===1?Gl(e):new ql(e,t,n,r??1)}function ql(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}hl(ql,Kl,gl(_l,{brighter(e){return e=e==null?yl:yl**+e,new ql(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?vl:vl**+e,new ql(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new G(Xl(e>=240?e-240:e+120,i,r),Xl(e,i,r),Xl(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ql(Jl(this.h),Yl(this.s),Yl(this.l),Vl(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Vl(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Jl(this.h)}, ${Yl(this.s)*100}%, ${Yl(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Jl(e){return e=(e||0)%360,e<0?e+360:e}function Yl(e){return Math.max(0,Math.min(1,e||0))}function Xl(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var Zl=e=>()=>e;function Ql(e,t){return function(n){return e+n*t}}function $l(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function eu(e){return(e=+e)==1?tu:function(t,n){return n-t?$l(t,n,e):Zl(isNaN(t)?n:t)}}function tu(e,t){var n=t-e;return n?Ql(e,n):Zl(isNaN(e)?t:e)}var nu=(function e(t){var n=eu(t);function r(e,t){var r=n((e=zl(e)).r,(t=zl(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=tu(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function ru(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function iu(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function au(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=mu(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function ou(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function su(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function cu(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=mu(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var lu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,uu=new RegExp(lu.source,`g`);function du(e){return function(){return e}}function fu(e){return function(t){return e(t)+``}}function pu(e,t){var n=lu.lastIndex=uu.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=lu.exec(e))&&(i=uu.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:su(r,i)})),n=uu.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?fu(c[0].x):du(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function mu(e,t){var n=typeof t,r;return t==null||n===`boolean`?Zl(t):(n===`number`?su:n===`string`?(r=Fl(t))?(t=r,nu):pu:t instanceof Fl?nu:t instanceof Date?ou:iu(t)?ru:Array.isArray(t)?au:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?cu:su)(e,t)}var hu=180/Math.PI,gu={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function _u(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*hu,skewX:Math.atan(c)*hu,scaleX:o,scaleY:s}}var vu;function yu(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?gu:_u(t.a,t.b,t.c,t.d,t.e,t.f)}function bu(e){return e==null||(vu||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),vu.setAttribute(`transform`,e),!(e=vu.transform.baseVal.consolidate()))?gu:(e=e.matrix,_u(e.a,e.b,e.c,e.d,e.e,e.f))}function xu(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:su(e,i)},{i:c-2,x:su(r,a)})}else (i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:su(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:su(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:su(e,n)},{i:s-2,x:su(t,r)})}else (n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var Su=xu(yu,`px, `,`px)`,`deg)`),Cu=xu(bu,`, `,`)`,`)`),wu=1e-12;function Tu(e){return((e=Math.exp(e))+1/e)/2}function Eu(e){return((e=Math.exp(e))-1/e)/2}function Du(e){return((e=Math.exp(2*e))-1)/(e+1)}var Ou=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<wu)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=Tu(y),c=s/(n*g)*(i*Du(t*r+y)-Eu(y));return[a+c*d,o+c*f,s*i/Tu(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),ku=0,Au=0,ju=0,Mu=1e3,Nu,Pu,Fu=0,Iu=0,Lu=0,Ru=typeof performance==`object`&&performance.now?performance:Date,zu=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Bu(){return Iu||=(zu(Vu),Ru.now()+Lu)}function Vu(){Iu=0}function Hu(){this._call=this._time=this._next=null}Hu.prototype=Uu.prototype={constructor:Hu,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Bu():+n)+(t==null?0:+t),!this._next&&Pu!==this&&(Pu?Pu._next=this:Nu=this,Pu=this),this._call=e,this._time=n,Ju()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ju())}};function Uu(e,t,n){var r=new Hu;return r.restart(e,t,n),r}function Wu(){Bu(),++ku;for(var e=Nu,t;e;)(t=Iu-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ku}function Gu(){Iu=(Fu=Ru.now())+Lu,ku=Au=0;try{Wu()}finally{ku=0,qu(),Iu=0}}function Ku(){var e=Ru.now(),t=e-Fu;t>Mu&&(Lu-=t,Fu=e)}function qu(){for(var e,t=Nu,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Nu=n);Pu=e,Ju(r)}function Ju(e){ku||(Au&&=clearTimeout(Au),e-Iu>24?(e<1/0&&(Au=setTimeout(Gu,e-Ru.now()-Lu)),ju&&=clearInterval(ju)):(ju||=(Fu=Ru.now(),setInterval(Ku,Mu)),ku=1,zu(Gu)))}function Yu(e,t,n){var r=new Hu;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var Xu=Xo(`start`,`end`,`cancel`,`interrupt`),Zu=[];function Qu(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;nd(e,n,{name:t,index:r,group:i,on:Xu,tween:Zu,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function $u(e,t){var n=td(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function ed(e,t){var n=td(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function td(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function nd(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Uu(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return Yu(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(Yu(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function rd(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function id(e){return this.each(function(){rd(this,e)})}function ad(e,t){var n,r;return function(){var i=ed(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function od(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=ed(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function sd(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=td(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?ad:od)(n,e,t))}function cd(e,t,n){var r=e._id;return e.each(function(){var e=ed(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return td(e,r).value[t]}}function ld(e,t){var n;return(typeof t==`number`?su:t instanceof Fl?nu:(n=Fl(t))?(t=n,nu):pu)(e,t)}function ud(e){return function(){this.removeAttribute(e)}}function dd(e){return function(){this.removeAttributeNS(e.space,e.local)}}function fd(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function pd(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function md(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function hd(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function gd(e,t){var n=ns(e),r=n===`transform`?Cu:ld;return this.attrTween(e,typeof t==`function`?(n.local?hd:md)(n,r,cd(this,`attr.`+e,t)):t==null?(n.local?dd:ud)(n):(n.local?pd:fd)(n,r,t))}function _d(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function vd(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function yd(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&vd(e,i)),n}return i._value=t,i}function bd(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&_d(e,i)),n}return i._value=t,i}function xd(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=ns(e);return this.tween(n,(r.local?yd:bd)(r,t))}function Sd(e,t){return function(){$u(this,e).delay=+t.apply(this,arguments)}}function Cd(e,t){return t=+t,function(){$u(this,e).delay=t}}function J(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Sd:Cd)(t,e)):td(this.node(),t).delay}function wd(e,t){return function(){ed(this,e).duration=+t.apply(this,arguments)}}function Td(e,t){return t=+t,function(){ed(this,e).duration=t}}function Ed(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?wd:Td)(t,e)):td(this.node(),t).duration}function Dd(e,t){if(typeof t!=`function`)throw Error();return function(){ed(this,e).ease=t}}function Od(e){var t=this._id;return arguments.length?this.each(Dd(t,e)):td(this.node(),t).ease}function kd(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();ed(this,e).ease=n}}function Ad(e){if(typeof e!=`function`)throw Error();return this.each(kd(this._id,e))}function jd(e){typeof e!=`function`&&(e=ms(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new sf(r,this._parents,this._name,this._id)}function Md(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new sf(o,this._parents,this._name,this._id)}function Nd(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function Pd(e,t,n){var r,i,a=Nd(t)?$u:ed;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Fd(e,t){var n=this._id;return arguments.length<2?td(this.node(),n).on.on(e):this.each(Pd(n,e,t))}function Id(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Ld(){return this.on(`end.remove`,Id(this._id))}function Rd(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=ss(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,Qu(l[f],t,n,f,l,td(u,n)));return new sf(a,this._parents,t,n)}function zd(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=ds(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=td(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&Qu(p,t,n,h,f,m);a.push(f),o.push(u)}return new sf(a,o,t,n)}var Bd=Zc.prototype.constructor;function Vd(){return new Bd(this._groups,this._parents)}function Hd(e,t){var n,r,i;return function(){var a=ic(this,e),o=(this.style.removeProperty(e),ic(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Ud(e){return function(){this.style.removeProperty(e)}}function Wd(e,t,n){var r,i=n+``,a;return function(){var o=ic(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Gd(e,t,n){var r,i,a;return function(){var o=ic(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),ic(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Kd(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=ed(this,e),l=c.on,u=c.value[a]==null?s||=Ud(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function qd(e,t,n){var r=(e+=``)==`transform`?Su:ld;return t==null?this.styleTween(e,Hd(e,r)).on(`end.style.`+e,Ud(e)):typeof t==`function`?this.styleTween(e,Gd(e,r,cd(this,`style.`+e,t))).each(Kd(this._id,e)):this.styleTween(e,Wd(e,r,t),n).on(`end.style.`+e,null)}function Jd(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Yd(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Jd(e,a,n)),r}return a._value=t,a}function Xd(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,Yd(e,t,n??``))}function Zd(e){return function(){this.textContent=e}}function Qd(e){return function(){var t=e(this);this.textContent=t??``}}function $d(e){return this.tween(`text`,typeof e==`function`?Qd(cd(this,`text`,e)):Zd(e==null?``:e+``))}function ef(e){return function(t){this.textContent=e.call(this,t)}}function tf(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&ef(r)),t}return r._value=e,r}function nf(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,tf(e))}function rf(){for(var e=this._name,t=this._id,n=lf(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=td(c,t);Qu(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new sf(r,this._parents,e,n)}function af(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=ed(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var of=0;function sf(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function cf(e){return Zc().transition(e)}function lf(){return++of}var uf=Zc.prototype;sf.prototype=cf.prototype={constructor:sf,select:Rd,selectAll:zd,selectChild:uf.selectChild,selectChildren:uf.selectChildren,filter:jd,merge:Md,selection:Vd,transition:rf,call:uf.call,nodes:uf.nodes,node:uf.node,size:uf.size,empty:uf.empty,each:uf.each,on:Fd,attr:gd,attrTween:xd,style:qd,styleTween:Xd,text:$d,textTween:nf,remove:Ld,tween:sd,delay:J,duration:Ed,ease:Od,easeVarying:Ad,end:af,[Symbol.iterator]:uf[Symbol.iterator]};function df(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var ff={time:null,delay:0,duration:250,ease:df};function pf(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function mf(e){var t,n;e instanceof sf?(t=e._id,e=e._name):(t=lf(),(n=ff).time=Bu(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&Qu(c,e,t,l,o,n||pf(c,t));return new sf(r,this._parents,e,t)}Zc.prototype.interrupt=id,Zc.prototype.transition=mf;var hf=e=>()=>e;function gf(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function _f(e,t,n){this.k=e,this.x=t,this.y=n}_f.prototype={constructor:_f,scale:function(e){return e===1?this:new _f(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new _f(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var vf=new _f(1,0,0);yf.prototype=_f.prototype;function yf(e){for(;!e.__zoom;)if(!(e=e.parentNode))return vf;return e.__zoom}function bf(e){e.stopImmediatePropagation()}function xf(e){e.preventDefault(),e.stopImmediatePropagation()}function Sf(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function Cf(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function wf(){return this.__zoom||vf}function Tf(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Ef(){return navigator.maxTouchPoints||`ontouchstart`in this}function Df(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function Of(){var e=Sf,t=Cf,n=Df,r=Tf,i=Ef,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Ou,l=Xo(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,wf).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,wf),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(vf.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new _f(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new _f(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new _f(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=$c(this.that).datum();l.call(e,this.that,new gf(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=tl(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],rd(this),s.start();xf(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=$c(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=tl(t,i),l=t.clientX,u=t.clientY;ol(t.view),bf(t),a.mouse=[c,this.__zoom.invert(c)],rd(this),a.start();function d(e){if(xf(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=tl(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),sl(e.view,a.moved),xf(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=tl(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);xf(r),s>0?$c(this).transition().duration(s).call(x,d,c,r):$c(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(bf(t),s=0;s<i;++s)c=r[s],l=tl(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),rd(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(xf(e),s=0;s<a;++s)c=i[s],l=tl(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(bf(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=tl(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=$c(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:hf(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:hf(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:hf(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:hf([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var kf={error001:()=>`[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The React Flow parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`},Af=[[-1/0,-1/0],[1/0,1/0]],jf=[`Enter`,` `,`Escape`],Mf={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},Nf;(function(e){e.Strict=`strict`,e.Loose=`loose`})(Nf||={});var Pf;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(Pf||={});var Ff;(function(e){e.Partial=`partial`,e.Full=`full`})(Ff||={});var If={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},Lf;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(Lf||={});var Rf;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(Rf||={});var Y;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(Y||={});var zf={[Y.Left]:Y.Right,[Y.Right]:Y.Left,[Y.Top]:Y.Bottom,[Y.Bottom]:Y.Top};function Bf(e){return e===null?null:e?`valid`:`invalid`}var Vf=e=>`id`in e&&`source`in e&&`target`in e,Hf=e=>`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),Uf=e=>`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),Wf=(e,t=[0,0])=>{let{width:n,height:r}=Cp(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},Gf=(e,t={nodeOrigin:[0,0]})=>e.length===0?{x:0,y:0,width:0,height:0}:op(e.reduce((e,n)=>{let r=typeof n==`string`,i=!t.nodeLookup&&!r?n:void 0;return t.nodeLookup&&(i=r?t.nodeLookup.get(n):Uf(n)?n:t.nodeLookup.get(n.id)),ip(e,i?cp(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),Kf=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=ip(n,cp(e)),r=!0)}),r?op(n):{x:0,y:0,width:0,height:0}},qf=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s={...hp(t,[n,r,i]),width:t.width/i,height:t.height/i},c=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??null,l=e.height??t.height??t.initialHeight??null,u=up(s,sp(t)),d=(i??0)*(l??0),f=a&&u>0;(!t.internals.handleBounds||f||u>=d||t.dragging)&&c.push(t)}return c},Jf=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function Yf(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{e.measured.width&&e.measured.height&&(t?.includeHiddenNodes||!e.hidden)&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function Xf({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return Promise.resolve(!0);let s=bp(Kf(Yf(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),Promise.resolve(!0)}function Zf({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent)if(!s)a?.(`005`,kf.error005());else{let e=s.measured.width,t=s.measured.height;e&&t&&(d=[[c,l],[c+e,l+t]])}else s&&Sp(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=Sp(d)?ep(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,kf.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function Qf({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=Jf(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var $f=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ep=(e={x:0,y:0},t,n)=>({x:$f(e.x,t[0][0],t[1][0]-(n?.width??0)),y:$f(e.y,t[0][1],t[1][1]-(n?.height??0))});function tp(e,t,n){let{width:r,height:i}=Cp(n),{x:a,y:o}=n.internals.positionAbsolute;return ep(e,[[a,o],[a+r,o+i]],t)}var np=(e,t,n)=>e<t?$f(Math.abs(e-t),1,t)/t:e>n?-$f(Math.abs(e-n),1,t)/t:0,rp=(e,t,n=15,r=40)=>[np(e.x,r,t.width-r)*n,np(e.y,r,t.height-r)*n],ip=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),ap=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),op=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),sp=(e,t=[0,0])=>{let{x:n,y:r}=Uf(e)?e.internals.positionAbsolute:Wf(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},cp=(e,t=[0,0])=>{let{x:n,y:r}=Uf(e)?e.internals.positionAbsolute:Wf(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},lp=(e,t)=>op(ip(ap(e),ap(t))),up=(e,t)=>{let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},dp=e=>fp(e.width)&&fp(e.height)&&fp(e.x)&&fp(e.y),fp=e=>!isNaN(e)&&isFinite(e),pp=(e,t)=>{},mp=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),hp=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?mp(s,o):s},gp=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function _p(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function vp(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=_p(e,n),i=_p(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=_p(e.top??e.y??0,n),i=_p(e.bottom??e.y??0,n),a=_p(e.left??e.x??0,t),o=_p(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function yp(e,t,n,r,i,a){let{x:o,y:s}=gp(e,[t,n,r]),{x:c,y:l}=gp({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var bp=(e,t,n,r,i,a)=>{let o=vp(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=$f(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=yp(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},xp=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function Sp(e){return e!=null&&e!==`parent`}function Cp(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function wp(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Tp(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function Ep(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Dp(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function Op(e){return{...Mf,...e||{}}}function kp(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=Fp(e),s=hp({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?mp(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var Ap=e=>({width:e.offsetWidth,height:e.offsetHeight}),jp=e=>e?.getRootNode?.()||window?.document,Mp=[`INPUT`,`SELECT`,`TEXTAREA`];function Np(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?Mp.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var Pp=e=>`clientX`in e,Fp=(e,t)=>{let n=Pp(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},Ip=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...Ap(t)}})};function Lp({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function Rp(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function zp({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Y.Left:return[t-Rp(t-r,a),n];case Y.Right:return[t+Rp(r-t,a),n];case Y.Top:return[t,n-Rp(n-i,a)];case Y.Bottom:return[t,n+Rp(i-n,a)]}}function Bp({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:r,targetY:i,targetPosition:a=Y.Top,curvature:o=.25}){let[s,c]=zp({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=zp({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=Lp({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function Vp({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function Hp({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function Up({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=ip(cp(e),cp(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),up({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},op(a))>0}var Wp=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,Gp=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),Kp=(e,t,n={})=>{if(!e.source||!e.target)return kf.error006(),t;let r=n.getEdgeId||Wp,i;return i=Vf(e)?{...e}:{...e,id:r(e)},Gp(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function qp({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=Vp({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var Jp={[Y.Left]:{x:-1,y:0},[Y.Right]:{x:1,y:0},[Y.Top]:{x:0,y:-1},[Y.Bottom]:{x:0,y:1}},Yp=({source:e,sourcePosition:t=Y.Bottom,target:n})=>t===Y.Left||t===Y.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Xp=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function Zp({source:e,sourcePosition:t=Y.Bottom,target:n,targetPosition:r=Y.Top,center:i,offset:a,stepPosition:o}){let s=Jp[t],c=Jp[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=Yp({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=Vp({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y};return[[e,...x.x!==m[0].x||x.y!==m[0].y?[x]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],h,g,y,b]}function Qp(e,t,n,r){let i=Math.min(Xp(e,t)/2,Xp(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function $p({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:r,targetY:i,targetPosition:a=Y.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=Zp({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=Qp(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function em(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function tm(e){let{sourceNode:t,targetNode:n}=e;if(!em(t)||!em(n))return null;let r=t.internals.handleBounds||nm(t.handles),i=n.internals.handleBounds||nm(n.handles),a=im(r?.source??[],e.sourceHandle),o=im(e.connectionMode===Nf.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,kf.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||Y.Bottom,c=o?.position||Y.Top,l=rm(t,a,s),u=rm(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function nm(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function rm(e,t,n=Y.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??Cp(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case Y.Top:return{x:i+o/2,y:a};case Y.Right:return{x:i+o,y:a+s/2};case Y.Bottom:return{x:i+o/2,y:a+s};case Y.Left:return{x:i,y:a+s/2}}}function im(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function am(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function om(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=am(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var sm=1e3,cm=10,lm={nodeOrigin:[0,0],nodeExtent:Af,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},um={...lm,checkEquality:!0};function dm(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function fm(e,t,n){let r=dm(lm,n);for(let n of e.values())if(n.parentId)_m(n,e,t,r);else{let e=ep(Wf(n,r.nodeOrigin),Sp(n.extent)?n.extent:r.nodeExtent,Cp(n));n.internals.positionAbsolute=e}}function pm(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function mm(e){return e===`manual`}function hm(e,t,n,r={}){let i=dm(um,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!mm(i.zIndexMode)?sm:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=ep(Wf(u,i.nodeOrigin),Sp(u.extent)?u.extent:i.nodeExtent,Cp(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:pm(u,e),z:vm(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),u.parentId&&_m(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function gm(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function _m(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=dm(lm,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}gm(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*cm),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=ym(e,u,o,s,a&&!mm(c)?sm:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function vm(e,t,n){let r=fp(e.zIndex)?e.zIndex:0;return mm(n)?r:r+(e.selected?t:0)}function ym(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=Cp(e),l=Wf(e,n),u=Sp(e.extent)?ep(l,e.extent,c):l,d=ep({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=tp(d,c,t));let f=vm(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function bm(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=lp(a.get(n.parentId)?.expandedRect??sp(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=Cp(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function xm(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=Ap(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=Sp(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;e.parentId&&e.extent===`parent`?h=tp(h,s,t.get(e.parentId)):m&&(h=ep(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:Ip(`source`,r.nodeElement,p,d,e.id),target:Ip(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&_m(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:sp(g,i)}))}}if(f.length>0){let e=bm(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function Sm({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r),s=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(s)}function Cm(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function wm(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;Cm(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),Cm(`target`,s,c,e,i,o),t.set(r.id,r)}}function Tm(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:Tm(n,t):!1}function Em(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function Dm(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!Tm(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function Om({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function km({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=mp(a,t);return{x:o.x-a.x,y:o.y-a.y}}function Am({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=$c(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?ap(Kf(s)):null,x=v&&l?km({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:mp(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=Zf({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=Om({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=rp(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=kp(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=Dm(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=Om({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=ml().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=kp(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=Fp(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=kp(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=Fp(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=Fp(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!(!d||p)&&(c=!1,d=!1,cancelAnimationFrame(o),s.size>0)){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=Om({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!Em(t,`.${g}`,v))&&(!_||Em(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function jm(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())up(i,sp(e))>0&&r.push(e);return r}var Mm=250;function Nm(e,t,n,r){let i=[],a=1/0,o=jm(e,n,t+Mm);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=rm(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function Pm(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...rm(o,c,c.position,!0)}:c}function Fm(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Im(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var Lm=()=>!0;function Rm(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=Lm,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=jp(e.target),E=0,D,{x:O,y:k}=Fp(e),A=Fm(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=Pm(i,A,r,c,t);if(!N)return;let ee=Fp(e,j),te=!1,P=null,F=!1,I=null;function ne(){if(!u||!j)return;let[e,t]=rp(ee,j,S);f({x:e,y:t}),E=requestAnimationFrame(ne)}let re={...N,nodeId:i,type:A,position:N.position},L=c.get(i),R={inProgress:!0,isValid:null,from:rm(L,re,Y.Left,!0),fromHandle:re,fromPosition:re.position,fromNode:L,to:ee,toHandle:null,toPosition:zf[re.position],toNode:null,pointer:ee};function z(){M=!0,y(R),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&z();function ie(e){if(!M){let{x:t,y:n}=Fp(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;z()}if(!x()||!re){ae(e);return}let a=b();ee=Fp(e,j),D=Nm(hp(ee,a,!1,[1,1]),n,c,re),te||=(ne(),!0);let s=zm(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});I=s.handleDomNode,P=s.connection,F=Im(!!D,s.isValid);let u=c.get(i),f=u?rm(u,re,Y.Left,!0):R.from,p={...R,from:f,isValid:F,to:s.toHandle&&F?gp({x:s.toHandle.x,y:s.toHandle.y},a):ee,toHandle:s.toHandle,toPosition:F&&s.toHandle?s.toHandle.position:zf[re.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:ee};y(p),R=p}function ae(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||I)&&P&&F&&h?.(P);let{inProgress:t,...n}=R,r={...n,toPosition:R.toHandle?R.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),te=!1,F=!1,P=null,I=null,T.removeEventListener(`mousemove`,ie),T.removeEventListener(`mouseup`,ae),T.removeEventListener(`touchmove`,ie),T.removeEventListener(`touchend`,ae)}}T.addEventListener(`mousemove`,ie),T.addEventListener(`mouseup`,ae),T.addEventListener(`touchmove`,ie),T.addEventListener(`touchend`,ae)}function zm(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=Lm,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=Fp(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=Fm(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===Nf.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=Pm(t,e,a,u,n,!0)}return _}var Bm={onPointerDown:Rm,isValid:zm};function Vm({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=$c(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&xp()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=Of().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:tl}}var Hm=e=>({x:e.x,y:e.y,zoom:e.k}),Um=({x:e,y:t,zoom:n})=>vf.translate(e,t).scale(n),Wm=(e,t)=>e.target.closest(`.${t}`),Gm=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Km=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,qm=(e,t=0,n=Km,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},Jm=e=>{let t=e.ctrlKey&&xp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function Ym({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(Wm(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=tl(u),t=d*2**Jm(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===Pf.Vertical?0:u.deltaX*f,m=i===Pf.Horizontal?0:u.deltaY*f;!xp()&&u.shiftKey&&i!==Pf.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=Hm(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c?.(u,h),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,s?.(u,h))}}function Xm({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=Wm(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function Zm({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=Hm(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function Qm({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&Gm(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,Hm(a.transform))}}function $m({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&Gm(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=Hm(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function eh({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:s,noPanClassName:c,lib:l,connectionInProgress:u}){return d=>{let f=e||t,p=n&&d.ctrlKey,m=d.type===`wheel`;if(d.button===1&&d.type===`mousedown`&&(Wm(d,`${l}-flow__node`)||Wm(d,`${l}-flow__edge`)))return!0;if(!r&&!f&&!i&&!a&&!n||o||u&&!m||Wm(d,s)&&m||Wm(d,c)&&(!m||i&&m&&!e)||!n&&d.ctrlKey&&m)return!1;if(!n&&d.type===`touchstart`&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!i&&!p&&m||!r&&(d.type===`mousedown`||d.type===`touchstart`)||Array.isArray(r)&&!r.includes(d.button)&&d.type===`mousedown`)return!1;let h=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||m)&&h}}function th({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=Of().scaleExtent([t,n]).translateExtent(r),f=$c(e).call(d);v({x:i.x,y:i.y,zoom:$f(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let p=f.on(`wheel.zoom`),m=f.on(`dblclick.zoom`);d.wheelDelta(Jm);function h(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate===`linear`?mu:Ou).transform(qm(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)}function g({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:h,panOnScrollSpeed:g,preventScrolling:v,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,zoomActivationKeyPressed:S,lib:C,onTransformChange:w,connectionInProgress:T,paneClickDistance:E,selectionOnDrag:D}){r&&!l.isZoomingOrPanning&&_();let O=i&&!S&&!r;d.clickDistance(D?1/0:!fp(E)||E<0?0:E);let k=O?Ym({zoomPanValues:l,noWheelClassName:e,d3Selection:f,d3Zoom:d,panOnScrollMode:h,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):Xm({noWheelClassName:e,preventScrolling:v,d3ZoomHandler:p});if(f.on(`wheel.zoom`,k,{passive:!1}),!r){let e=Zm({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});d.on(`start`,e);let t=Qm({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:w});d.on(`zoom`,t);let r=$m({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});d.on(`end`,r)}let A=eh({zoomActivationKeyPressed:S,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:C,connectionInProgress:T});d.filter(A),x?f.on(`dblclick.zoom`,m):f.on(`dblclick.zoom`,null)}function _(){d.on(`zoom`,null)}async function v(e,t,n){let r=Um(e),i=d?.constrain()(r,t,n);return i&&await h(i),new Promise(e=>e(i))}async function y(e,t){let n=Um(e);return await h(n,t),new Promise(e=>e(n))}function b(e){if(f){let t=Um(e),n=f.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&d?.transform(f,t,null,{sync:!0})}}function x(){let e=f?yf(f.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}function S(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate===`linear`?mu:Ou).scaleTo(qm(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)}function C(e,t){return f?new Promise(n=>{d?.interpolate(t?.interpolate===`linear`?mu:Ou).scaleBy(qm(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)}function w(e){d?.scaleExtent(e)}function T(e){d?.translateExtent(e)}function E(e){let t=!fp(e)||e<0?0:e;d?.clickDistance(t)}return{update:g,destroy:_,setViewport:y,setViewportConstrained:v,getViewport:x,scaleTo:S,scaleBy:C,setScaleExtent:w,setTranslateExtent:T,syncViewport:b,setClickDistance:E}}var nh;(function(e){e.Line=`line`,e.Handle=`handle`})(nh||={});function rh({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function ih(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function ah(e,t){return Math.max(0,t-e)}function oh(e,t){return Math.max(0,e-t)}function sh(e,t,n){return Math.max(0,t-e,e-n)}function ch(e,t){return e?!t:t}function lh(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),O=-a[0]*x,k=-a[1]*S,A=sh(E,h,g),j=sh(D,_,v);if(o){let e=0,t=0;c&&w<0?e=ah(y+w+O,o[0][0]):!c&&w>0&&(e=oh(y+E+O,o[1][0])),l&&T<0?t=ah(b+T+k,o[0][1]):!l&&T>0&&(t=oh(b+D+k,o[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(s){let e=0,t=0;c&&w>0?e=oh(y+w,s[0][0]):!c&&w<0&&(e=ah(y+E,s[1][0])),l&&T>0?t=oh(b+T,s[0][1]):!l&&T<0&&(t=ah(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=sh(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?oh(b+k+E/C,o[1][1])*C:ah(b+k+(c?w:-w)/C,o[0][1])*C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?ah(b+E/C,s[1][1])*C:oh(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=sh(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?oh(y+D*C+O,o[1][0])/C:ah(y+(l?T:-T)*C+O,o[0][0])/C,j=Math.max(j,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?ah(y+D*C,s[1][0])/C:oh(y+(l?T:-T)*C,s[0][0])/C,j=Math.max(j,e)}}}T+=T<0?j:-j,w+=w<0?A:-A,i&&(f?E>D*C?T=(ch(c,l)?-w:w)/C:w=(ch(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let M=c?y+w:y,N=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+M,y:a[1]*T*(l?-1:1)+N}}var uh={width:0,height:0,x:0,y:0},dh={...uh,pointerX:0,pointerY:0,aspectRatio:1};function fh(e){return[[0,0],[e.measured.width,e.measured.height]]}function ph(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function mh({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=$c(e),o={controlDirection:ih(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...uh},h={...dh};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:ih(e)};let g,_=null,v=[],y,b,x,S=!1,C=ml().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=kp(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId),b=y&&g.extent===`parent`?fh(y):void 0),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=ph(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=kp(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:C,height:w}=m,T={},E=g.origin??s,{width:D,height:O,x:k,y:A}=lh(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,E,b,x),j=D!==C,M=O!==w,N=k!==u&&j,ee=A!==f&&M;if(!N&&!ee&&!j&&!M)return;if((N||ee||E[0]===1||E[1]===1)&&(T.x=N?k:m.x,T.y=ee?A:m.y,m.x=T.x,m.y=T.y,v.length>0)){let e=k-u,t=A-f;for(let n of v)n.position={x:n.position.x-e+E[0]*(D-C),y:n.position.y-t+E[1]*(O-w)},l.push(n)}if((j||M)&&(T.width=j&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?D:m.width,T.height=M&&(!o.resizeDirection||o.resizeDirection===`vertical`)?O:m.height,m.width=T.width,m.height=T.height),y&&g.expandParent){let e=E[0]*(T.width??0);T.x&&T.x<e&&(m.x=e,h.x-=T.x-e);let t=E[1]*(T.height??0);T.y&&T.y<t&&(m.y=t,h.y-=T.y-t)}let te=rh({width:m.width,prevWidth:C,height:m.height,prevHeight:w,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),P={...m,direction:te};p?.(e,P)!==!1&&(S=!0,d?.(e,P),r(T,l))}).on(`end`,e=>{S&&=(f?.(e,{...m}),i?.({...m}),!1)});a.call(C)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var hh=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},gh=e=>e?hh(e):hh,{useDebugValue:_h}=B.default,{useSyncExternalStoreWithSelector:vh}=hi.default,yh=e=>e;function bh(e,t=yh,n){let r=vh(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return _h(r),r}var xh=(e,t)=>{let n=gh(e),r=(e,r=t)=>bh(n,e,r);return Object.assign(r,n),r},Sh=(e,t)=>e?xh(e,t):xh;function Ch(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var wh=(0,B.createContext)(null),Th=wh.Provider,Eh=kf.error001();function X(e,t){let n=(0,B.useContext)(wh);if(n===null)throw Error(Eh);return bh(n,e,t)}function Dh(){let e=(0,B.useContext)(wh);if(e===null)throw Error(Eh);return(0,B.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var Oh={display:`none`},kh={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},Ah=`react-flow__node-desc`,jh=`react-flow__edge-desc`,Mh=`react-flow__aria-live`,Nh=e=>e.ariaLiveMessage,Ph=e=>e.ariaLabelConfig;function Fh({rfId:e}){let t=X(Nh);return(0,V.jsx)(`div`,{id:`${Mh}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:kh,children:t})}function Ih({rfId:e,disableKeyboardA11y:t}){let n=X(Ph);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{id:`${Ah}-${e}`,style:Oh,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,V.jsx)(`div`,{id:`${jh}-${e}`,style:Oh,children:n[`edge.a11yDescription.default`]}),!t&&(0,V.jsx)(Fh,{rfId:e})]})}var Lh=(0,B.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>(0,V.jsx)(`div`,{className:Jo([`react-flow__panel`,n,...`${e}`.split(`-`)]),style:r,ref:a,...i,children:t}));Lh.displayName=`Panel`;function Rh({proOptions:e,position:t=`bottom-right`}){return e?.hideAttribution?null:(0,V.jsx)(Lh,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev`,children:(0,V.jsx)(`a`,{href:`https://reactflow.dev`,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var zh=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},Bh=e=>e.id;function Vh(e,t){return Ch(e.selectedNodes.map(Bh),t.selectedNodes.map(Bh))&&Ch(e.selectedEdges.map(Bh),t.selectedEdges.map(Bh))}function Hh({onSelectionChange:e}){let t=Dh(),{selectedNodes:n,selectedEdges:r}=X(zh,Vh);return(0,B.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var Uh=e=>!!e.onSelectionChangeHandlers;function Wh({onSelectionChange:e}){let t=X(Uh);return e||t?(0,V.jsx)(Hh,{onSelectionChange:e}):null}var Gh=typeof window<`u`?B.useLayoutEffect:B.useEffect,Kh=[0,0],qh={x:0,y:0,zoom:1},Jh=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode`.split(`.`),`rfId`],Yh=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Xh={translateExtent:Af,nodeOrigin:Kh,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function Zh(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=X(Yh,Ch),l=Dh();Gh(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=Xh,s()}),[]);let u=(0,B.useRef)(Xh);return Gh(()=>{for(let s of Jh){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:Op(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},Jh.map(t=>e[t])),null}function Qh(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function $h(e){let[t,n]=(0,B.useState)(e===`system`?null:e);return(0,B.useEffect)(()=>{if(e!==`system`){n(e);return}let t=Qh(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?Qh()?.matches?`dark`:`light`:t}var eg=typeof document<`u`?document:null;function tg(e=null,t={target:eg,actInsideInputWithModifier:!0}){let[n,r]=(0,B.useState)(!1),i=(0,B.useRef)(!1),a=(0,B.useRef)(new Set([])),[o,s]=(0,B.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(`+`,`
10
+ `).replace(`
11
+
12
+ `,`
13
+ +`).split(`
14
+ `));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,B.useEffect)(()=>{let n=t?.target??eg,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&Np(e))return!1;let n=rg(e.code,s);if(a.current.add(e[n]),ng(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=rg(e.code,s);ng(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function ng(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function rg(e,t){return t.includes(e)?`code`:`key`}var ig=()=>{let e=Dh();return(0,B.useMemo)(()=>({zoomIn:t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):Promise.resolve(!1)},zoomOut:t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):Promise.resolve(!1)},zoomTo:(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=bp(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return hp(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=gp(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function ag(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)og(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function og(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes===`width`)&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes===`height`)&&(t.height=e.dimensions.height))),typeof e.resizing==`boolean`&&(t.resizing=e.resizing);break}}function sg(e,t){return ag(e,t)}function cg(e,t){return ag(e,t)}function lg(e,t){return{id:e,type:`select`,selected:t}}function ug(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);!(a.selected===void 0&&!e)&&a.selected!==e&&(n&&(a.selected=e),r.push(lg(a.id,e)))}return r}function dg({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function fg(e){return{id:e.id,type:`remove`}}var pg=e=>Hf(e),mg=e=>Vf(e);function hg(e){return(0,B.forwardRef)(e)}function gg(e){let[t,n]=(0,B.useState)(BigInt(0)),[r]=(0,B.useState)(()=>_g(()=>n(e=>e+BigInt(1))));return Gh(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function _g(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var vg=(0,B.createContext)(null);function yg({children:e}){let t=Dh(),n=gg((0,B.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=dg({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=gg((0,B.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(dg({items:s,lookup:o}))},[])),i=(0,B.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,V.jsx)(vg.Provider,{value:i,children:e})}function bg(){let e=(0,B.useContext)(vg);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var xg=e=>!!e.panZoom;function Sg(){let e=ig(),t=Dh(),n=bg(),r=X(xg),i=(0,B.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=pg(e)?e:n.get(e.id),a=i.parentId?Tp(i.position,i.measured,i.parentId,n,r):i.position;return sp({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height})},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&pg(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&mg(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await Qf({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(fg);o?.(f),c(e)}if(m){let e=d.map(fg);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=dp(e),o=i?e:a(e),s=r!==void 0;return o?(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let c=sp(s?r:a),l=up(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=dp(e)?e:a(e);if(!r)return!1;let i=up(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return Gf(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??Dp();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,B.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var Cg=e=>e.selected,wg=typeof window<`u`?window:void 0;function Tg({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=Dh(),{deleteElements:r}=Sg(),i=tg(e,{actInsideInputWithModifier:!1}),a=tg(t,{target:wg});(0,B.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(Cg),edges:e.filter(Cg)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,B.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function Eg(e){let t=Dh();(0,B.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=Ap(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,kf.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t&&e.current&&t.unobserve(e.current)}}},[])}var Dg={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},Og=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function kg({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=Pf.Free,zoomOnDoubleClick:o=!0,panOnDrag:s=!0,defaultViewport:c,translateExtent:l,minZoom:u,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:p=!0,children:m,noWheelClassName:h,noPanClassName:g,onViewportChange:_,isControlledViewport:v,paneClickDistance:y,selectionOnDrag:b}){let x=Dh(),S=(0,B.useRef)(null),{userSelectionActive:C,lib:w,connectionInProgress:T}=X(Og,Ch),E=tg(f),D=(0,B.useRef)();Eg(S);let O=(0,B.useCallback)(e=>{_?.({x:e[0],y:e[1],zoom:e[2]}),v||x.setState({transform:e})},[_,v]);return(0,B.useEffect)(()=>{if(S.current){D.current=th({domNode:S.current,minZoom:u,maxZoom:d,translateExtent:l,viewport:c,onDraggingChange:e=>x.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=x.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=x.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=x.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=D.current.getViewport();return x.setState({panZoom:D.current,transform:[e,t,n],domNode:S.current.closest(`.react-flow`)}),()=>{D.current?.destroy()}}},[]),(0,B.useEffect)(()=>{D.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:s,zoomActivationKeyPressed:E,preventScrolling:p,noPanClassName:g,userSelectionActive:C,noWheelClassName:h,lib:w,onTransformChange:O,connectionInProgress:T,selectionOnDrag:b,paneClickDistance:y})},[e,t,n,r,i,a,o,s,E,p,g,C,h,w,O,T,b,y]),(0,V.jsx)(`div`,{className:`react-flow__renderer`,ref:S,style:Dg,children:m})}var Ag=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function jg(){let{userSelectionActive:e,userSelectionRect:t}=X(Ag,Ch);return e&&t?(0,V.jsx)(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var Mg=(e,t)=>n=>{n.target===t.current&&e?.(n)},Ng=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function Pg({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Ff.Full,panOnDrag:r,paneClickDistance:i,selectionOnDrag:a,onSelectionStart:o,onSelectionEnd:s,onPaneClick:c,onPaneContextMenu:l,onPaneScroll:u,onPaneMouseEnter:d,onPaneMouseMove:f,onPaneMouseLeave:p,children:m}){let h=Dh(),{userSelectionActive:g,elementsSelectable:_,dragging:v,connectionInProgress:y}=X(Ng,Ch),b=_&&(e||g),x=(0,B.useRef)(null),S=(0,B.useRef)(),C=(0,B.useRef)(new Set),w=(0,B.useRef)(new Set),T=(0,B.useRef)(!1),E=e=>{if(T.current||y){T.current=!1;return}c?.(e),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},D=e=>{if(Array.isArray(r)&&r?.includes(2)){e.preventDefault();return}l?.(e)},O=u?e=>u(e):void 0;return(0,V.jsxs)(`div`,{className:Jo([`react-flow__pane`,{draggable:r===!0||Array.isArray(r)&&r.includes(0),dragging:v,selection:e}]),onClick:b?void 0:Mg(E,x),onContextMenu:Mg(D,x),onWheel:Mg(O,x),onPointerEnter:b?void 0:d,onPointerMove:b?e=>{let{userSelectionRect:r,transform:a,nodeLookup:s,edgeLookup:c,connectionLookup:l,triggerNodeChanges:u,triggerEdgeChanges:d,defaultEdgeOptions:f,resetSelectedElements:p}=h.getState();if(!S.current||!r)return;let{x:m,y:g}=Fp(e.nativeEvent,S.current),{startX:_,startY:v}=r;if(!T.current){let n=t?0:i;if(Math.hypot(m-_,g-v)<=n)return;p(),o?.(e)}T.current=!0;let y={startX:_,startY:v,x:m<_?m:_,y:g<v?g:v,width:Math.abs(m-_),height:Math.abs(g-v)},b=C.current,x=w.current;C.current=new Set(qf(s,y,a,n===Ff.Partial,!0).map(e=>e.id)),w.current=new Set;let E=f?.selectable??!0;for(let e of C.current){let t=l.get(e);if(t)for(let{edgeId:e}of t.values()){let t=c.get(e);t&&(t.selectable??E)&&w.current.add(e)}}Ep(b,C.current)||u(ug(s,C.current,!0)),Ep(x,w.current)||d(ug(c,w.current)),h.setState({userSelectionRect:y,userSelectionActive:!0,nodesSelectionActive:!1})}:f,onPointerUp:b?e=>{e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!g&&e.target===x.current&&h.getState().userSelectionRect&&E?.(e),h.setState({userSelectionActive:!1,userSelectionRect:null}),T.current&&(s?.(e),h.setState({nodesSelectionActive:C.current.size>0})))}:void 0,onPointerDownCapture:b?n=>{let{domNode:r}=h.getState();if(S.current=r?.getBoundingClientRect(),!S.current)return;let i=n.target===x.current;if(!i&&n.target.closest(`.nokey`)||!e||!(a&&i||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),T.current=!1;let{x:o,y:s}=Fp(n.nativeEvent,S.current);h.setState({userSelectionRect:{width:0,height:0,startX:o,startY:s,x:o,y:s}}),i||(n.stopPropagation(),n.preventDefault())}:void 0,onClickCapture:b?e=>{T.current&&=(e.stopPropagation(),!1)}:void 0,onPointerLeave:p,ref:x,style:Dg,children:[m,(0,V.jsx)(jg,{})]})}function Fg({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);if(!l){c?.(`012`,kf.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function Ig({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=Dh(),[c,l]=(0,B.useState)(!1),u=(0,B.useRef)();return(0,B.useEffect)(()=>{u.current=Am({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{Fg({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}})},[]),(0,B.useEffect)(()=>{if(!(t||!e.current||!u.current))return u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o}),()=>{u.current?.destroy()}},[n,r,t,a,e,i,o]),c}var Lg=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function Rg(){let e=Dh();return(0,B.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=Lg(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=mp(t,i));let{position:a,positionAbsolute:s}=Zf({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var zg=(0,B.createContext)(null),Bg=zg.Provider;zg.Consumer;var Vg=()=>(0,B.useContext)(zg),Hg=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Ug=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o,u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===Nf.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function Wg({type:e=`source`,position:t=Y.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let m=o||null,h=e===`target`,g=Dh(),_=Vg(),{connectOnClick:v,noPanClassName:y,rfId:b}=X(Hg,Ch),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=X(Ug(_,m,e),Ch);_||g.getState().onError?.(`010`,kf.error010());let O=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t}=g.getState();t(Kp(i,e))}n?.(i),s?.(i)},k=e=>{if(!_)return;let t=Pp(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();Bm.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:_,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:O,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,V.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:Jo([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,y,l,{source:!h,target:h,connectable:r,connectablestart:i,connectableend:a,clickconnecting:C,connectingfrom:x,connectingto:S,valid:D,connectionindicator:r&&(!T||w)&&(T||E?a:i)}]),onMouseDown:k,onTouchStart:k,onClick:v?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!_||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:_,handleId:m,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:_,type:e,id:m}});return}let p=jp(t.target),h=n||c,{connection:v,isValid:y}=Bm.isValid(t.nativeEvent,{handle:{nodeId:_,id:m,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:h,flowId:u,doc:p,lib:l,nodeLookup:d});y&&v&&O(v);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var Gg=(0,B.memo)(hg(Wg));function Kg({data:e,isConnectable:t,sourcePosition:n=Y.Bottom}){return(0,V.jsxs)(V.Fragment,{children:[e?.label,(0,V.jsx)(Gg,{type:`source`,position:n,isConnectable:t})]})}function qg({data:e,isConnectable:t,targetPosition:n=Y.Top,sourcePosition:r=Y.Bottom}){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Gg,{type:`target`,position:n,isConnectable:t}),e?.label,(0,V.jsx)(Gg,{type:`source`,position:r,isConnectable:t})]})}function Jg(){return null}function Yg({data:e,isConnectable:t,targetPosition:n=Y.Top}){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Gg,{type:`target`,position:n,isConnectable:t}),e?.label]})}var Xg={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Zg={input:Kg,default:qg,output:Yg,group:Jg};function Qg(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var $g=e=>{let{width:t,height:n,x:r,y:i}=Kf(e.nodeLookup,{filter:e=>!!e.selected});return{width:fp(t)?t:null,height:fp(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function e_({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=Dh(),{width:i,height:a,transformString:o,userSelectionActive:s}=X($g,Ch),c=Rg(),l=(0,B.useRef)(null);(0,B.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(Ig({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,V.jsx)(`div`,{className:Jo([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,V.jsx)(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(Xg,e.key)&&(e.preventDefault(),c({direction:Xg[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var t_=typeof window<`u`?window:void 0,n_=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function r_({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:h,zoomActivationKeyCode:g,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:b,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:w,defaultViewport:T,translateExtent:E,minZoom:D,maxZoom:O,preventScrolling:k,onSelectionContextMenu:A,noWheelClassName:j,noPanClassName:M,disableKeyboardA11y:N,onViewportChange:ee,isControlledViewport:te}){let{nodesSelectionActive:P,userSelectionActive:F}=X(n_,Ch),I=tg(l,{target:t_}),ne=tg(h,{target:t_}),re=ne||w,L=ne||b,R=u&&re!==!0,z=I||F||R;return Tg({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,V.jsx)(kg,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:L,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!I&&re,defaultViewport:T,translateExtent:E,minZoom:D,maxZoom:O,zoomActivationKeyCode:g,preventScrolling:k,noWheelClassName:j,noPanClassName:M,onViewportChange:ee,isControlledViewport:te,paneClickDistance:s,selectionOnDrag:R,children:(0,V.jsxs)(Pg,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:re,isSelecting:!!z,selectionMode:d,selectionKeyPressed:I,paneClickDistance:s,selectionOnDrag:R,children:[e,P&&(0,V.jsx)(e_,{onSelectionContextMenu:A,noPanClassName:M,disableKeyboardA11y:N})]})})}r_.displayName=`FlowRenderer`;var i_=(0,B.memo)(r_),a_=e=>t=>e?qf(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function o_(e){return X((0,B.useCallback)(a_(e),[e]),Ch)}var s_=e=>e.updateNodeInternals;function c_(){let e=X(s_),[t]=(0,B.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,B.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function l_({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=Dh(),a=(0,B.useRef)(null),o=(0,B.useRef)(null),s=(0,B.useRef)(e.sourcePosition),c=(0,B.useRef)(e.targetPosition),l=(0,B.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,B.useEffect)(()=>{a.current&&!e.hidden&&(!u||o.current!==a.current)&&(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),(0,B.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,B.useEffect)(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function u_({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:m,rfId:h,nodeTypes:g,nodeClickDistance:_,onError:v}){let{node:y,internals:b,isParent:x}=X(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},Ch),S=y.type||`default`,C=g?.[S]||Zg[S];C===void 0&&(v?.(`003`,kf.error003(S)),S=`default`,C=g?.default||Zg.default);let w=!!(y.draggable||s&&y.draggable===void 0),T=!!(y.selectable||c&&y.selectable===void 0),E=!!(y.connectable||l&&y.connectable===void 0),D=!!(y.focusable||u&&y.focusable===void 0),O=Dh(),k=wp(y),A=l_({node:y,nodeType:S,hasDimensions:k,resizeObserver:d}),j=Ig({nodeRef:A,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),M=Rg();if(y.hidden)return null;let N=Cp(y),ee=Qg(y),te=T||w||t||n||r||i,P=n?e=>n(e,{...b.userNode}):void 0,F=r?e=>r(e,{...b.userNode}):void 0,I=i?e=>i(e,{...b.userNode}):void 0,ne=a?e=>a(e,{...b.userNode}):void 0,re=o?e=>o(e,{...b.userNode}):void 0,L=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=O.getState();T&&(!r||!w||i>0)&&Fg({id:e,store:O,nodeRef:A}),t&&t(n,{...b.userNode})},R=t=>{if(!(Np(t.nativeEvent)||m)){if(jf.includes(t.key)&&T)Fg({id:e,store:O,unselect:t.key===`Escape`,nodeRef:A});else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(Xg,t.key)){t.preventDefault();let{ariaLabelConfig:e}=O.getState();O.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~b.positionAbsolute.x,y:~~b.positionAbsolute.y})}),M({direction:Xg[t.key],factor:t.shiftKey?4:1})}}},z=()=>{if(m||!A.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=O.getState();i&&(qf(new Map([[e,y]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(y.position.x+N.width/2,y.position.y+N.height/2,{zoom:t[2]}))};return(0,V.jsx)(`div`,{className:Jo([`react-flow__node`,`react-flow__node-${S}`,{[p]:w},y.className,{selected:y.selected,selectable:T,parent:x,draggable:w,dragging:j}]),ref:A,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:te?`all`:`none`,visibility:k?`visible`:`hidden`,...y.style,...ee},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:P,onMouseMove:F,onMouseLeave:I,onContextMenu:ne,onClick:L,onDoubleClick:re,onKeyDown:D?R:void 0,tabIndex:D?0:void 0,onFocus:D?z:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${Ah}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:(0,V.jsx)(Bg,{value:e,children:(0,V.jsx)(C,{id:e,data:y.data,type:S,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:y.selected??!1,selectable:T,draggable:w,deletable:y.deletable??!0,isConnectable:E,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:j,dragHandle:y.dragHandle,zIndex:b.z,parentId:y.parentId,...N})})})}var d_=(0,B.memo)(u_),f_=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function p_(e){let{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:a}=X(f_,Ch),o=o_(e.onlyRenderVisibleElements),s=c_();return(0,V.jsx)(`div`,{className:`react-flow__nodes`,style:Dg,children:o.map(o=>(0,V.jsx)(d_,{id:o,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},o))})}p_.displayName=`NodeRenderer`;var m_=(0,B.memo)(p_);function h_(e){return X((0,B.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&Up({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),Ch)}var g_=({color:e=`none`,strokeWidth:t=1})=>(0,V.jsx)(`polyline`,{className:`arrow`,style:{strokeWidth:t,...e&&{stroke:e}},strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`}),__=({color:e=`none`,strokeWidth:t=1})=>(0,V.jsx)(`polyline`,{className:`arrowclosed`,style:{strokeWidth:t,...e&&{stroke:e,fill:e}},strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`}),v_={[Rf.Arrow]:g_,[Rf.ArrowClosed]:__};function y_(e){let t=Dh();return(0,B.useMemo)(()=>Object.prototype.hasOwnProperty.call(v_,e)?v_[e]:(t.getState().onError?.(`009`,kf.error009(e)),null),[e])}var b_=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=y_(t);return c?(0,V.jsx)(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:(0,V.jsx)(c,{color:n,strokeWidth:o})}):null},x_=({defaultColor:e,rfId:t})=>{let n=X(e=>e.edges),r=X(e=>e.defaultEdgeOptions),i=(0,B.useMemo)(()=>om(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,V.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,V.jsx)(`defs`,{children:i.map(e=>(0,V.jsx)(b_,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};x_.displayName=`MarkerDefinitions`;var S_=(0,B.memo)(x_);function C_({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=(0,B.useState)({x:1,y:0,width:0,height:0}),p=Jo([`react-flow__edge-textwrapper`,l]),m=(0,B.useRef)(null);return(0,B.useEffect)(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,V.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,V.jsx)(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),(0,V.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}C_.displayName=`EdgeText`;var w_=(0,B.memo)(C_);function T_({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`path`,{...u,d:e,fill:`none`,className:Jo([`react-flow__edge-path`,u.className])}),l?(0,V.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&fp(t)&&fp(n)?(0,V.jsx)(w_,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function E_({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Y.Left||e===Y.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function D_({sourceX:e,sourceY:t,sourcePosition:n=Y.Bottom,targetX:r,targetY:i,targetPosition:a=Y.Top}){let[o,s]=E_({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=E_({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=Lp({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function O_(e){return(0,B.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})=>{let[v,y,b]=D_({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s});return(0,V.jsx)(T_,{id:e.isInternal?void 0:t,path:v,labelX:y,labelY:b,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})})}var k_=O_({isInternal:!1}),A_=O_({isInternal:!0});k_.displayName=`SimpleBezierEdge`,A_.displayName=`SimpleBezierEdgeInternal`;function j_(e){return(0,B.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=Y.Bottom,targetPosition:m=Y.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=$p({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition});return(0,V.jsx)(T_,{id:e.isInternal?void 0:t,path:y,labelX:b,labelY:x,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})})}var M_=j_({isInternal:!1}),N_=j_({isInternal:!0});M_.displayName=`SmoothStepEdge`,N_.displayName=`SmoothStepEdgeInternal`;function P_(e){return(0,B.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,V.jsx)(M_,{...n,id:r,pathOptions:(0,B.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var F_=P_({isInternal:!1}),I_=P_({isInternal:!0});F_.displayName=`StepEdge`,I_.displayName=`StepEdgeInternal`;function L_(e){return(0,B.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{let[g,_,v]=qp({sourceX:n,sourceY:r,targetX:i,targetY:a});return(0,V.jsx)(T_,{id:e.isInternal?void 0:t,path:g,labelX:_,labelY:v,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}var R_=L_({isInternal:!1}),z_=L_({isInternal:!0});R_.displayName=`StraightEdge`,z_.displayName=`StraightEdgeInternal`;function B_(e){return(0,B.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=Y.Bottom,targetPosition:s=Y.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=Bp({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature});return(0,V.jsx)(T_,{id:e.isInternal?void 0:t,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:v})})}var V_=B_({isInternal:!1}),H_=B_({isInternal:!0});V_.displayName=`BezierEdge`,H_.displayName=`BezierEdgeInternal`;var U_={default:H_,straight:z_,step:I_,smoothstep:N_,simplebezier:A_},W_={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},G_=(e,t,n)=>n===Y.Left?e-t:n===Y.Right?e+t:e,K_=(e,t,n)=>n===Y.Top?e-t:n===Y.Bottom?e+t:e,q_=`react-flow__edgeupdater`;function J_({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,V.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:Jo([q_,`${q_}-${s}`]),cx:G_(t,r,e),cy:K_(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function Y_({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let m=Dh(),h=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:h,rfId:g,panBy:_,updateConnection:v}=m.getState(),y=t.type===`target`;Bm.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>m.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>m.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),_=e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),v=()=>p(!0),y=()=>p(!1);return(0,V.jsxs)(V.Fragment,{children:[(e===!0||e===`source`)&&(0,V.jsx)(J_,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,V.jsx)(J_,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function X_({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:m,edgeTypes:h,noPanClassName:g,onError:_,disableKeyboardA11y:v}){let y=X(t=>t.edgeLookup.get(e)),b=X(e=>e.defaultEdgeOptions);y=b?{...b,...y}:y;let x=y.type||`default`,S=h?.[x]||U_[x];S===void 0&&(_?.(`011`,kf.error011(x)),x=`default`,S=h?.default||U_.default);let C=!!(y.focusable||t&&y.focusable===void 0),w=d!==void 0&&(y.reconnectable||n&&y.reconnectable===void 0),T=!!(y.selectable||r&&y.selectable===void 0),E=(0,B.useRef)(null),[D,O]=(0,B.useState)(!1),[k,A]=(0,B.useState)(!1),j=Dh(),{zIndex:M,sourceX:N,sourceY:ee,targetX:te,targetY:P,sourcePosition:F,targetPosition:I}=X((0,B.useCallback)(t=>{let n=t.nodeLookup.get(y.source),r=t.nodeLookup.get(y.target);if(!n||!r)return{zIndex:y.zIndex,...W_};let i=tm({id:e,sourceNode:n,targetNode:r,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:t.connectionMode,onError:_});return{zIndex:Hp({selected:y.selected,zIndex:y.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode}),...i||W_}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),Ch),ne=(0,B.useMemo)(()=>y.markerStart?`url('#${am(y.markerStart,m)}')`:void 0,[y.markerStart,m]),re=(0,B.useMemo)(()=>y.markerEnd?`url('#${am(y.markerEnd,m)}')`:void 0,[y.markerEnd,m]);if(y.hidden||N===null||ee===null||te===null||P===null)return null;let L=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=j.getState();T&&(j.setState({nodesSelectionActive:!1}),y.selected&&a?(r({nodes:[],edges:[y]}),E.current?.blur()):n([e])),i&&i(t,y)},R=a?e=>{a(e,{...y})}:void 0,z=o?e=>{o(e,{...y})}:void 0,ie=s?e=>{s(e,{...y})}:void 0,ae=c?e=>{c(e,{...y})}:void 0,oe=l?e=>{l(e,{...y})}:void 0;return(0,V.jsx)(`svg`,{style:{zIndex:M},children:(0,V.jsxs)(`g`,{className:Jo([`react-flow__edge`,`react-flow__edge-${x}`,y.className,g,{selected:y.selected,animated:y.animated,inactive:!T&&!i,updating:D,selectable:T}]),onClick:L,onDoubleClick:R,onContextMenu:z,onMouseEnter:ie,onMouseMove:ae,onMouseLeave:oe,onKeyDown:C?t=>{if(!v&&jf.includes(t.key)&&T){let{unselectNodesAndEdges:n,addSelectedEdges:r}=j.getState();t.key===`Escape`?(E.current?.blur(),n({edges:[y]})):r([e])}}:void 0,tabIndex:C?0:void 0,role:y.ariaRole??(C?`group`:`img`),"aria-roledescription":`edge`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":C?`${jh}-${m}`:void 0,ref:E,...y.domAttributes,children:[!k&&(0,V.jsx)(S,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:T,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:N,sourceY:ee,targetX:te,targetY:P,sourcePosition:F,targetPosition:I,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:ne,markerEnd:re,pathOptions:`pathOptions`in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),w&&(0,V.jsx)(Y_,{edge:y,isReconnectable:w,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:N,sourceY:ee,targetX:te,targetY:P,sourcePosition:F,targetPosition:I,setUpdateHover:O,setReconnecting:A})]})})}var Z_=(0,B.memo)(X_),Q_=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function $_({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:h}){let{edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,onError:y}=X(Q_,Ch),b=h_(t);return(0,V.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,V.jsx)(S_,{defaultColor:e,rfId:n}),b.map(e=>(0,V.jsx)(Z_,{id:e,edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:h},e))]})}$_.displayName=`EdgeRenderer`;var ev=(0,B.memo)($_),tv=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function nv({children:e}){return(0,V.jsx)(`div`,{className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:X(tv)},children:e})}function rv(e){let t=Sg(),n=(0,B.useRef)(!1);(0,B.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var iv=e=>e.panZoom?.syncViewport;function av(e){let t=X(iv),n=Dh();return(0,B.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function ov(e){return e.connection.inProgress?{...e.connection,to:hp(e.connection.to,e.transform)}:{...e.connection}}function sv(e){return e?t=>e(ov(t)):ov}function cv(e){return X(sv(e),Ch)}var lv=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function uv({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=X(lv,Ch);return a&&i&&c?(0,V.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,V.jsx)(`g`,{className:Jo([`react-flow__connection`,Bf(s)]),children:(0,V.jsx)(dv,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var dv=({style:e,type:t=Lf.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:p}=cv();if(!i)return;if(n)return(0,V.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:Bf(r),toNode:u,toHandle:d,pointer:p});let m=``,h={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case Lf.Bezier:[m]=Bp(h);break;case Lf.SimpleBezier:[m]=D_(h);break;case Lf.Step:[m]=$p({...h,borderRadius:0});break;case Lf.SmoothStep:[m]=$p(h);break;default:[m]=qp(h)}return(0,V.jsx)(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};dv.displayName=`ConnectionLine`;var fv={};function pv(e=fv){(0,B.useRef)(e),Dh(),(0,B.useEffect)(()=>{},[e])}function mv(){Dh(),(0,B.useRef)(!1),(0,B.useEffect)(()=>{},[])}function hv({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:h,connectionLineComponent:g,connectionLineContainerStyle:_,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:w,onlyRenderVisibleElements:T,elementsSelectable:E,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,preventScrolling:j,defaultMarkerColor:M,zoomOnScroll:N,zoomOnPinch:ee,panOnScroll:te,panOnScrollSpeed:P,panOnScrollMode:F,zoomOnDoubleClick:I,panOnDrag:ne,onPaneClick:re,onPaneMouseEnter:L,onPaneMouseMove:R,onPaneMouseLeave:z,onPaneScroll:ie,onPaneContextMenu:ae,paneClickDistance:oe,nodeClickDistance:se,onEdgeContextMenu:ce,onEdgeMouseEnter:le,onEdgeMouseMove:ue,onEdgeMouseLeave:de,reconnectRadius:fe,onReconnect:pe,onReconnectStart:me,onReconnectEnd:he,noDragClassName:ge,noWheelClassName:_e,noPanClassName:ve,disableKeyboardA11y:ye,nodeExtent:be,rfId:xe,viewport:Se,onViewportChange:Ce}){return pv(e),pv(t),mv(),rv(n),av(Se),(0,V.jsx)(i_,{onPaneClick:re,onPaneMouseEnter:L,onPaneMouseMove:R,onPaneMouseLeave:z,onPaneContextMenu:ae,onPaneScroll:ie,paneClickDistance:oe,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:N,zoomOnPinch:ee,zoomOnDoubleClick:I,panOnScroll:te,panOnScrollSpeed:P,panOnScrollMode:F,panOnDrag:ne,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,onSelectionContextMenu:d,preventScrolling:j,noDragClassName:ge,noWheelClassName:_e,noPanClassName:ve,disableKeyboardA11y:ye,onViewportChange:Ce,isControlledViewport:!!Se,children:(0,V.jsxs)(nv,{children:[(0,V.jsx)(ev,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:pe,onReconnectStart:me,onReconnectEnd:he,onlyRenderVisibleElements:T,onEdgeContextMenu:ce,onEdgeMouseEnter:le,onEdgeMouseMove:ue,onEdgeMouseLeave:de,reconnectRadius:fe,defaultMarkerColor:M,noPanClassName:ve,disableKeyboardA11y:ye,rfId:xe}),(0,V.jsx)(uv,{style:h,type:m,component:g,containerStyle:_}),(0,V.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,V.jsx)(m_,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:se,onlyRenderVisibleElements:T,noPanClassName:ve,noDragClassName:ge,disableKeyboardA11y:ye,nodeExtent:be,rfId:xe}),(0,V.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}hv.displayName=`GraphView`;var gv=(0,B.memo)(hv),_v=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??Af;wm(h,g,_);let{nodesInitialized:x}=hm(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=bp(Kf(p,{filter:e=>!!((e.width||e.initialWidth)&&(e.height||e.initialHeight))}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:Af,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Nf.Strict,domNode:null,paneDragging:!1,noPanClassName:`nopan`,nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...If},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:pp,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:Mf,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},vv=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>Sh((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await Xf({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{..._v({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,elevateNodesOnSelect:i,fitViewQueued:a,zIndexMode:o,nodesSelectionActive:s}=m(),{nodesInitialized:c,hasSelectedNodes:l}=hm(e,t,n,{nodeOrigin:r,nodeExtent:d,elevateNodesOnSelect:i,checkEquality:!0,zIndexMode:o}),u=s&&l;a&&c?(h(),p({nodes:e,nodesInitialized:c,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:u})):p({nodes:e,nodesInitialized:c,nodesSelectionActive:u})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();wm(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=xm(e,n,r,i,a,o,l);d&&(fm(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=rm(e,o.fromHandle,Y.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=bm(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n(sg(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(cg(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){i(e.map(e=>lg(e,!0)));return}i(ug(r,new Set([...e]),!0)),a(ug(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){a(e.map(e=>lg(e,!0)));return}a(ug(n,new Set([...e]))),i(ug(r,new Set,!0))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s){if(!e.selected)continue;let t=i.get(e.id);t&&(t.selected=!1),l.push(lg(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(lg(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,lg(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,lg(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();e[0][0]===o[0][0]&&e[0][1]===o[0][1]&&e[1][0]===o[1][0]&&e[1][1]===o[1][1]||(hm(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return Sm({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return Promise.resolve(!1);let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{p({connection:{...If}})},updateConnection:e=>{p({connection:e})},reset:()=>p({..._v()})}},Object.is);function yv({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){let[m]=(0,B.useState)(()=>vv({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,V.jsx)(Th,{value:m,children:(0,V.jsx)(yg,{children:p})})}function bv({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return(0,B.useContext)(wh)?(0,V.jsx)(V.Fragment,{children:e}):(0,V.jsx)(yv,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}var xv={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function Sv({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onNodesDelete:E,onEdgesDelete:D,onDelete:O,onSelectionChange:k,onSelectionDragStart:A,onSelectionDrag:j,onSelectionDragStop:M,onSelectionContextMenu:N,onSelectionStart:ee,onSelectionEnd:te,onBeforeDelete:P,connectionMode:F,connectionLineType:I=Lf.Bezier,connectionLineStyle:ne,connectionLineComponent:re,connectionLineContainerStyle:L,deleteKeyCode:R=`Backspace`,selectionKeyCode:z=`Shift`,selectionOnDrag:ie=!1,selectionMode:ae=Ff.Full,panActivationKeyCode:oe=`Space`,multiSelectionKeyCode:se=xp()?`Meta`:`Control`,zoomActivationKeyCode:ce=xp()?`Meta`:`Control`,snapToGrid:le,snapGrid:ue,onlyRenderVisibleElements:de=!1,selectNodesOnDrag:fe,nodesDraggable:pe,autoPanOnNodeFocus:me,nodesConnectable:he,nodesFocusable:ge,nodeOrigin:_e=Kh,edgesFocusable:ve,edgesReconnectable:ye,elementsSelectable:be=!0,defaultViewport:xe=qh,minZoom:Se=.5,maxZoom:Ce=2,translateExtent:we=Af,preventScrolling:Te=!0,nodeExtent:Ee,defaultMarkerColor:De=`#b1b1b7`,zoomOnScroll:Oe=!0,zoomOnPinch:ke=!0,panOnScroll:Ae=!1,panOnScrollSpeed:je=.5,panOnScrollMode:Me=Pf.Free,zoomOnDoubleClick:Ne=!0,panOnDrag:Pe=!0,onPaneClick:Fe,onPaneMouseEnter:Ie,onPaneMouseMove:Le,onPaneMouseLeave:Re,onPaneScroll:ze,onPaneContextMenu:Be,paneClickDistance:Ve=1,nodeClickDistance:He=0,children:Ue,onReconnect:We,onReconnectStart:Ge,onReconnectEnd:Ke,onEdgeContextMenu:qe,onEdgeDoubleClick:Je,onEdgeMouseEnter:Ye,onEdgeMouseMove:Xe,onEdgeMouseLeave:Ze,reconnectRadius:Qe=10,onNodesChange:$e,onEdgesChange:et,noDragClassName:tt=`nodrag`,noWheelClassName:nt=`nowheel`,noPanClassName:rt=`nopan`,fitView:it,fitViewOptions:at,connectOnClick:ot,attributionPosition:st,proOptions:ct,defaultEdgeOptions:lt,elevateNodesOnSelect:ut=!0,elevateEdgesOnSelect:dt=!1,disableKeyboardA11y:ft=!1,autoPanOnConnect:pt,autoPanOnNodeDrag:mt,autoPanSpeed:ht,connectionRadius:gt,isValidConnection:_t,onError:vt,style:yt,id:bt,nodeDragThreshold:xt,connectionDragThreshold:St,viewport:Ct,onViewportChange:wt,width:Tt,height:Et,colorMode:Dt=`light`,debug:Ot,onScroll:kt,ariaLabelConfig:At,zIndexMode:jt=`basic`,...Mt},Nt){let Pt=bt||`1`,Ft=$h(Dt),It=(0,B.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),kt?.(e)},[kt]);return(0,V.jsx)(`div`,{"data-testid":`rf__wrapper`,...Mt,onScroll:It,style:{...yt,...xv},ref:Nt,className:Jo([`react-flow`,i,Ft]),id:bt,role:`application`,children:(0,V.jsxs)(bv,{nodes:e,edges:t,width:Tt,height:Et,fitView:it,fitViewOptions:at,minZoom:Se,maxZoom:Ce,nodeOrigin:_e,nodeExtent:Ee,zIndexMode:jt,children:[(0,V.jsx)(Zh,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:pe,autoPanOnNodeFocus:me,nodesConnectable:he,nodesFocusable:ge,edgesFocusable:ve,edgesReconnectable:ye,elementsSelectable:be,elevateNodesOnSelect:ut,elevateEdgesOnSelect:dt,minZoom:Se,maxZoom:Ce,nodeExtent:Ee,onNodesChange:$e,onEdgesChange:et,snapToGrid:le,snapGrid:ue,connectionMode:F,translateExtent:we,connectOnClick:ot,defaultEdgeOptions:lt,fitView:it,fitViewOptions:at,onNodesDelete:E,onEdgesDelete:D,onDelete:O,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onSelectionDrag:j,onSelectionDragStart:A,onSelectionDragStop:M,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:rt,nodeOrigin:_e,rfId:Pt,autoPanOnConnect:pt,autoPanOnNodeDrag:mt,autoPanSpeed:ht,onError:vt,connectionRadius:gt,isValidConnection:_t,selectNodesOnDrag:fe,nodeDragThreshold:xt,connectionDragThreshold:St,onBeforeDelete:P,debug:Ot,ariaLabelConfig:At,zIndexMode:jt}),(0,V.jsx)(gv,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,nodeTypes:a,edgeTypes:o,connectionLineType:I,connectionLineStyle:ne,connectionLineComponent:re,connectionLineContainerStyle:L,selectionKeyCode:z,selectionOnDrag:ie,selectionMode:ae,deleteKeyCode:R,multiSelectionKeyCode:se,panActivationKeyCode:oe,zoomActivationKeyCode:ce,onlyRenderVisibleElements:de,defaultViewport:xe,translateExtent:we,minZoom:Se,maxZoom:Ce,preventScrolling:Te,zoomOnScroll:Oe,zoomOnPinch:ke,zoomOnDoubleClick:Ne,panOnScroll:Ae,panOnScrollSpeed:je,panOnScrollMode:Me,panOnDrag:Pe,onPaneClick:Fe,onPaneMouseEnter:Ie,onPaneMouseMove:Le,onPaneMouseLeave:Re,onPaneScroll:ze,onPaneContextMenu:Be,paneClickDistance:Ve,nodeClickDistance:He,onSelectionContextMenu:N,onSelectionStart:ee,onSelectionEnd:te,onReconnect:We,onReconnectStart:Ge,onReconnectEnd:Ke,onEdgeContextMenu:qe,onEdgeDoubleClick:Je,onEdgeMouseEnter:Ye,onEdgeMouseMove:Xe,onEdgeMouseLeave:Ze,reconnectRadius:Qe,defaultMarkerColor:De,noDragClassName:tt,noWheelClassName:nt,noPanClassName:rt,rfId:Pt,disableKeyboardA11y:ft,nodeExtent:Ee,viewport:Ct,onViewportChange:wt}),(0,V.jsx)(Wh,{onSelectionChange:k}),Ue,(0,V.jsx)(Rh,{proOptions:ct,position:st}),(0,V.jsx)(Ih,{rfId:Pt,disableKeyboardA11y:ft})]})})}var Cv=hg(Sv);kf.error014();function wv({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,V.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Jo([`react-flow__background-pattern`,n,r])})}function Tv({radius:e,className:t}){return(0,V.jsx)(`circle`,{cx:e,cy:e,r:e,className:Jo([`react-flow__background-pattern`,`dots`,t])})}var Ev;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(Ev||={});var Dv={[Ev.Dots]:1,[Ev.Lines]:1,[Ev.Cross]:6},Ov=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function kv({id:e,variant:t=Ev.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=(0,B.useRef)(null),{transform:f,patternId:p}=X(Ov,Ch),m=r||Dv[t],h=t===Ev.Dots,g=t===Ev.Cross,_=Array.isArray(n)?n:[n,n],v=[_[0]*f[2]||1,_[1]*f[2]||1],y=m*f[2],b=Array.isArray(a)?a:[a,a],x=g?[y,y]:v,S=[b[0]*f[2]||1+x[0]/2,b[1]*f[2]||1+x[1]/2],C=`${p}${e||``}`;return(0,V.jsxs)(`svg`,{className:Jo([`react-flow__background`,l]),style:{...c,...Dg,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,V.jsx)(`pattern`,{id:C,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${S[0]},-${S[1]})`,children:h?(0,V.jsx)(Tv,{radius:y/2,className:u}):(0,V.jsx)(wv,{dimensions:x,lineWidth:i,variant:t,className:u})}),(0,V.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${C})`})]})}kv.displayName=`Background`,(0,B.memo)(kv);function Av(){return(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,V.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function jv(){return(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,V.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function Mv(){return(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,V.jsx)(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})})}function Nv(){return(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,V.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})})}function Pv(){return(0,V.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,V.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})})}function Fv({children:e,className:t,...n}){return(0,V.jsx)(`button`,{type:`button`,className:Jo([`react-flow__controls-button`,t]),...n,children:e})}var Iv=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Lv({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p}){let m=Dh(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=X(Iv,Ch),{zoomIn:y,zoomOut:b,fitView:x}=Sg();return(0,V.jsxs)(Lh,{className:Jo([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??v[`controls.ariaLabel`],children:[t&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Fv,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:(0,V.jsx)(Av,{})}),(0,V.jsx)(Fv,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:(0,V.jsx)(jv,{})})]}),n&&(0,V.jsx)(Fv,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:(0,V.jsx)(Mv,{})}),r&&(0,V.jsx)(Fv,{className:`react-flow__controls-interactive`,onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),c?.(!h)},title:v[`controls.interactive.ariaLabel`],"aria-label":v[`controls.interactive.ariaLabel`],children:h?(0,V.jsx)(Pv,{}):(0,V.jsx)(Nv,{})}),u]})}Lv.displayName=`Controls`,(0,B.memo)(Lv);function Rv({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:m,backgroundColor:h}=a||{},g=o||m||h;return(0,V.jsx)(`rect`,{className:Jo([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:g,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var zv=(0,B.memo)(Rv),Bv=e=>e.nodes.map(e=>e.id),Vv=e=>e instanceof Function?e:()=>e;function Hv({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=zv,onClick:o}){let s=X(Bv,Ch),c=Vv(t),l=Vv(e),u=Vv(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,V.jsx)(V.Fragment,{children:s.map(e=>(0,V.jsx)(Wv,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function Uv({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=X(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=Cp(r);return{node:r,x:i,y:a,width:o,height:s}},Ch);return!l||l.hidden||!wp(l)?null:(0,V.jsx)(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var Wv=(0,B.memo)(Uv),Gv=(0,B.memo)(Hv),Kv=200,qv=150,Jv=e=>!e.hidden,Yv=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?lp(Kf(e.nodeLookup,{filter:Jv}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Xv=`react-flow__minimap-desc`;function Zv({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:p,onNodeClick:m,pannable:h=!1,zoomable:g=!1,ariaLabel:_,inversePan:v,zoomStep:y=1,offsetScale:b=5}){let x=Dh(),S=(0,B.useRef)(null),{boundingRect:C,viewBB:w,rfId:T,panZoom:E,translateExtent:D,flowWidth:O,flowHeight:k,ariaLabelConfig:A}=X(Yv,Ch),j=e?.width??Kv,M=e?.height??qv,N=C.width/j,ee=C.height/M,te=Math.max(N,ee),P=te*j,F=te*M,I=b*te,ne=C.x-(P-C.width)/2-I,re=C.y-(F-C.height)/2-I,L=P+I*2,R=F+I*2,z=`${Xv}-${T}`,ie=(0,B.useRef)(0),ae=(0,B.useRef)();ie.current=te,(0,B.useEffect)(()=>{if(S.current&&E)return ae.current=Vm({domNode:S.current,panZoom:E,getTransform:()=>x.getState().transform,getViewScale:()=>ie.current}),()=>{ae.current?.destroy()}},[E]),(0,B.useEffect)(()=>{ae.current?.update({translateExtent:D,width:O,height:k,inversePan:v,pannable:h,zoomStep:y,zoomable:g})},[h,g,v,y,D,O,k]);let oe=p?e=>{let[t,n]=ae.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,se=m?(0,B.useCallback)((e,t)=>{let n=x.getState().nodeLookup.get(t).internals.userNode;m(e,n)},[]):void 0,ce=_??A[`minimap.ariaLabel`];return(0,V.jsx)(Lh,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*te:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`number`?o:void 0},className:Jo([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,V.jsxs)(`svg`,{width:j,height:M,viewBox:`${ne} ${re} ${L} ${R}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":z,ref:S,onClick:oe,children:[ce&&(0,V.jsx)(`title`,{id:z,children:ce}),(0,V.jsx)(Gv,{onClick:se,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,V.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${ne-I},${re-I}h${L+I*2}v${R+I*2}h${-L-I*2}z
15
+ M${w.x},${w.y}h${w.width}v${w.height}h${-w.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}Zv.displayName=`MiniMap`,(0,B.memo)(Zv);var Qv=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,$v={[nh.Line]:`right`,[nh.Handle]:`bottom-right`};function ey({nodeId:e,position:t,variant:n=nh.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:m,onResizeStart:h,onResize:g,onResizeEnd:_}){let v=Vg(),y=typeof e==`string`?e:v,b=Dh(),x=(0,B.useRef)(null),S=n===nh.Handle,C=X((0,B.useCallback)(Qv(S&&p),[S,p]),Ch),w=(0,B.useRef)(null),T=t??$v[n];return(0,B.useEffect)(()=>{if(!(!x.current||!y))return w.current||=mh({domNode:x.current,nodeId:y,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=b.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=b.getState(),o=[],s={x:e.x,y:e.y},c=r.get(y);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=bm([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...Tp({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:y,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:y,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:y,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};b.getState().triggerNodeChanges([n])}}),w.current.update({controlPosition:T,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:_,shouldResize:m}),()=>{w.current?.destroy()}},[T,s,c,l,u,d,h,g,_,m]),(0,V.jsx)(`div`,{className:Jo([`react-flow__resize-control`,`nodrag`,...T.split(`-`),n,r]),ref:x,style:{...i,scale:C,...o&&{[S?`backgroundColor`:`borderColor`]:o}},children:a})}(0,B.memo)(ey);function ty(e){if(e.nodes.length===0)return{nodes:[],edges:[],graphWidth:112,graphHeight:112,currentNodeId:null,startNodeId:null,latestBranchNodeId:null,summary:{currentNodeLabel:`No active node`,lineageNodeCount:0,sideNodeCount:0,alternateBranchCount:0,blockedAttemptCount:0}};let t=new Map(e.nodes.map(e=>[e.nodeId,e])),n=new Map;for(let t of e.nodes){if(!t.parentNodeId)continue;let e=n.get(t.parentNodeId)??[];e.push(t),n.set(t.parentNodeId,e)}for(let e of n.values())e.sort((e,t)=>e.createdAtEventIndex-t.createdAtEventIndex);let r=ny(e),i=r?ry(r,t):new Set,a=iy(e.nodes,t),o=new Map,s=new Map,c=new Map,l=new Set,u=new Set,d=0,f=0,p=()=>{d+=1;let e=Math.ceil(d/2);return d%2==1?-e:e},m=(e,t,r,i)=>{if(o.has(e))return;o.set(e,t),s.set(e,r),c.set(e,i);let a=n.get(e)??[];if(a.length===0)return;let[l,...u]=a;l&&m(l.nodeId,t,r,i);let d=1;for(let e of u){let n=t<0?t-d:t+d;m(e.nodeId,n,r,i),d+=1}},h=[...i].sort((e,t)=>(a.get(e)??0)-(a.get(t)??0));for(let e of h){o.set(e,0),s.set(e,`active`),c.set(e,null);let t=n.get(e)??[];for(let e of t){if(i.has(e.nodeId))continue;f+=1;let t=e.nodeKind===`blocked_attempt`?`blocked`:`alternate`;t===`blocked`?u.add(e.nodeId):l.add(e.nodeId),m(e.nodeId,p(),t,f)}}let g=e.nodes.filter(e=>!e.parentNodeId||!t.has(e.parentNodeId)).sort((e,t)=>e.createdAtEventIndex-t.createdAtEventIndex);for(let e of g)if(!o.has(e.nodeId)){if(!i.has(e.nodeId)){f+=1;let t=e.nodeKind===`blocked_attempt`?`blocked`:`alternate`;t===`blocked`?u.add(e.nodeId):l.add(e.nodeId),m(e.nodeId,p(),t,f);continue}o.set(e.nodeId,0),s.set(e.nodeId,`active`),c.set(e.nodeId,null)}for(let t of e.nodes)if(!o.has(t.nodeId)){f+=1;let e=t.nodeKind===`blocked_attempt`?`blocked`:`alternate`;e===`blocked`?u.add(t.nodeId):l.add(t.nodeId),m(t.nodeId,p(),e,f)}let _=Math.min(...o.values()),v=Math.max(...o.values()),y=oy(e.nodes,a,t,i),b=e.nodes.map(e=>{let t=i.has(e.nodeId),n=y.get(e.nodeId)??0;return{node:e,depth:n,lane:o.get(e.nodeId)??0,x:656+n*268,y:56+((o.get(e.nodeId)??0)-_)*112,isActiveLineage:t,isCurrent:e.nodeId===r,branchKind:s.get(e.nodeId)??`alternate`,branchIndex:c.get(e.nodeId)??null}}),x=b.reduce((e,t)=>Math.max(e,t.depth),0),S=r?t.get(r)??null:null,C=[...l,...u].map(e=>t.get(e)).filter(e=>!!e).sort((e,t)=>t.createdAtEventIndex-e.createdAtEventIndex)[0]??null,w={currentNodeLabel:S?.stepLabel??(S?.isPreferredTip&&(e.status===`complete`||e.status===`complete_with_gaps`)?`Complete`:null)??(S?ay(S.nodeId):`No active node`),lineageNodeCount:i.size,sideNodeCount:e.nodes.length-i.size,alternateBranchCount:l.size,blockedAttemptCount:e.nodes.filter(e=>e.nodeKind===`blocked_attempt`).length},T=new Set(b.map(e=>e.node.nodeId));return{nodes:b,edges:e.edges.filter(e=>T.has(e.fromNodeId)&&T.has(e.toNodeId)),graphWidth:1312+x*268+220,graphHeight:112+(v-_)*112+124,currentNodeId:r,startNodeId:h[0]??g[0]?.nodeId??null,latestBranchNodeId:C?.nodeId??null,summary:w}}function ny(e){if(e.preferredTipNodeId)return e.preferredTipNodeId;let t=e.nodes.find(e=>e.isPreferredTip);if(t)return t.nodeId;let n=e.nodes.filter(e=>e.isTip).sort((e,t)=>t.createdAtEventIndex-e.createdAtEventIndex)[0];return n?n.nodeId:[...e.nodes].sort((e,t)=>t.createdAtEventIndex-e.createdAtEventIndex)[0]?.nodeId??null}function ry(e,t){let n=new Set,r=e;for(;r&&!n.has(r);){n.add(r);let e=t.get(r)?.parentNodeId??null;r=e&&t.has(e)?e:null}return n}function iy(e,t){let n=new Map,r=new Set,i=e=>{let a=n.get(e);if(a!==void 0)return a;if(r.has(e))return n.set(e,0),0;r.add(e);let o=t.get(e)?.parentNodeId??null;if(!o||!t.has(o))return n.set(e,0),r.delete(e),0;let s=i(o)+1;return n.set(e,s),r.delete(e),s};for(let t of e)i(t.nodeId);return n}function ay(e){return e.slice(-8)}function oy(e,t,n,r){let i=new Map;for(let e of r)i.set(e,t.get(e)??0);let a=new Set,o=e=>{let r=i.get(e);if(r!==void 0)return r;if(a.has(e)){let n=t.get(e)??0;return i.set(e,n),n}a.add(e);let s=n.get(e)?.parentNodeId??null;if(!s||!n.has(s)){let n=t.get(e)??0;return i.set(e,n),a.delete(e),n}let c=o(s)+1;return i.set(e,c),a.delete(e),c};for(let t of e)i.has(t.nodeId)||o(t.nodeId);return i}function sy(e,t){if(e.length===0)return{nodes:[],requiredWidth:0,requiredHeight:0};let n=t.nodes.filter(e=>e.isActiveLineage);if(n.length===0)return{nodes:[],requiredWidth:0,requiredHeight:0};let r=656+(n.reduce((e,t)=>Math.max(e,t.depth),0)+1)*268;return{nodes:e.map((e,t)=>({stepId:e.stepId,stepLabel:e.stepLabel,x:r,y:56+t*112})),requiredWidth:r+220+600,requiredHeight:56+e.length*112+124}}function cy(e){return/\btrue\b|\bpass/i.test(e.summary)}function ly(e){return e.refs.find(e=>e.kind===`loop_id`)?.value??null}function uy(e){let t=[...e.filter(e=>e.kind!==`context_fact`)].sort((e,t)=>e.recordedAtEventIndex-t.recordedAtEventIndex),n=[],r=new Map,i=[];for(let e of t)if(e.kind===`entered_loop`){let t=ly(e);t?(r.set(t,{enteredItem:e,innerItems:[]}),i.push(t)):n.push({kind:`standalone`,item:e})}else if(e.kind===`exited_loop`){let t=ly(e),a=t?r.get(t):void 0;if(a&&t){r.delete(t);let o=i.lastIndexOf(t);o!==-1&&i.splice(o,1);let s=Math.max(1,a.innerItems.filter(e=>e.kind===`selected_next_step`).length);n.push({kind:`loop_group`,loopId:t,enteredItem:a.enteredItem,innerItems:a.innerItems,exitedItem:e,iterationCount:s})}else n.push({kind:`standalone`,item:e})}else{let t=i.at(-1),a=t?r.get(t):void 0;a?a.innerItems.push(e):n.push({kind:`standalone`,item:e})}for(let[,e]of r){n.push({kind:`standalone`,item:e.enteredItem});for(let t of e.innerItems)n.push({kind:`standalone`,item:t})}return n}function dy(e){switch(e.kind){case`evaluated_condition`:return`condition`;case`detected_non_tip_advance`:return`fork`;case`divergence`:return`divergence`;case`selected_next_step`:return`advance`;default:return null}}function fy(e,t){let n=null,r=-1;for(let i of t){let t=dy(i);t!==null&&(i.recordedAtEventIndex>e.createdAtEventIndex||i.recordedAtEventIndex>r&&(r=i.recordedAtEventIndex,n={kind:t,summary:i.summary}))}return n}function py(e){let t=[];for(let n of e){if(n.kind!==`loop_group`)continue;let e=n.enteredItem.refs.filter(e=>e.kind===`node_id`).map(e=>e.value),r=n.exitedItem.refs.filter(e=>e.kind===`node_id`).map(e=>e.value),i=n.innerItems.flatMap(e=>e.refs.filter(e=>e.kind===`node_id`).map(e=>e.value)),a=[...new Set([...e,...r,...i])];t.push({loopId:n.loopId,iterationCount:n.iterationCount,nodeIds:a})}return t}function my(e,t){let n=e.items.filter(e=>e.refs.some(e=>e.kind===`node_id`&&e.value===t));return{whySelected:n.filter(e=>e.kind===`selected_next_step`),conditions:n.filter(e=>e.kind===`evaluated_condition`),loops:n.filter(e=>e.kind===`entered_loop`||e.kind===`exited_loop`),divergences:n.filter(e=>e.kind===`divergence`),forks:n.filter(e=>e.kind===`detected_non_tip_advance`)}}function hy({run:e,selectedNodeId:t=null,onNodeClick:n}){let r=(0,B.useRef)(null),i=(0,B.useRef)(null),a=(0,B.useRef)(!1),[o,s]=(0,B.useState)(null),[c,l]=(0,B.useState)(null),u=(0,B.useRef)(null);(0,B.useEffect)(()=>()=>{u.current!==null&&clearTimeout(u.current)},[]);let d=(0,B.useMemo)(()=>ty(e),[e]),f=(0,B.useMemo)(()=>new Map(d.nodes.map(e=>[e.node.nodeId,e])),[d.nodes]),p=e.status===`in_progress`,m=(0,B.useCallback)((e,t=`smooth`)=>{if(!e)return;let n=i.current,a=f.get(e);if(!n||!a)return;r.current?.scrollIntoView({behavior:t,block:`nearest`});let o=a.isActiveLineage?220:172,s=a.isActiveLineage?124:104;n.scrollTo({left:Math.max(0,a.x-n.clientWidth/2+o/2),top:Math.max(0,a.y-n.clientHeight/2+s/2),behavior:t})},[f]);(0,B.useEffect)(()=>{a.current||d.currentNodeId&&(a.current=!0,m(d.currentNodeId,`auto`))},[]);let h=(0,B.useMemo)(()=>{if(!e.executionTraceSummary)return null;let t=e.executionTraceSummary,n=new Map;for(let r of e.nodes){if(r.nodeKind!==`blocked_attempt`)continue;let e=my(t,r.nodeId),i=[...e.divergences,...e.forks,...e.conditions,...e.whySelected];n.set(r.nodeId,i)}return n},[e.executionTraceSummary,e.nodes]),{nodes:g,edges:_}=(0,B.useMemo)(()=>{let n=d.currentNodeId?d.edges.find(e=>e.toNodeId===d.currentNodeId)?.fromNodeId??null:null;return{nodes:d.nodes.map(n=>{let{node:r,isActiveLineage:i,isCurrent:a}=n,o=r.nodeId===t,s=i?220:172,c=Cy(r,i,a,o),l=xy(r,i),u=ky(r,n.branchKind,n.branchIndex,e.status),f=h?.get(r.nodeId),m=r.nodeKind===`blocked_attempt`&&f!==void 0&&f.length>0,g=i?124:104,_=m?g+80:g;return{id:r.nodeId,position:{x:n.x,y:n.y},data:{label:(0,V.jsx)(gy,{node:r,isActiveLineage:i,isCurrent:a,isSelected:o,isLiveRun:p,branchKind:n.branchKind,branchIndex:n.branchIndex,displayLabel:u,stepNumber:i?n.depth+1:null,totalSteps:i?d.summary.lineageNodeCount:null,causeItems:f})},style:{width:s,height:_,padding:0,borderRadius:0,border:`1px solid ${c}`,background:l,color:`var(--text-primary)`,boxShadow:o?`0 0 0 1px rgba(244, 179, 65, 0.7), 0 0 18px rgba(244, 179, 65, 0.16)`:a?`0 0 0 1px rgba(0, 240, 255, 0.65), 0 0 24px rgba(0, 240, 255, 0.18)`:i?`0 0 16px rgba(0, 240, 255, 0.1)`:`none`,opacity:i?1:.72,cursor:`pointer`,display:`flex`,alignItems:`stretch`,justifyContent:`stretch`}}}),edges:d.edges.map((e,t)=>{let r=f.get(e.fromNodeId),i=f.get(e.toNodeId),a=!!(r?.isActiveLineage&&i?.isActiveLineage),o=p&&!!d.currentNodeId&&e.toNodeId===d.currentNodeId&&e.fromNodeId===n;return{id:`lineage-edge-${t}`,source:e.fromNodeId,target:e.toNodeId,type:`smoothstep`,animated:o,className:o?`workrail-current-lineage-edge`:void 0,style:{stroke:o?`var(--accent-strong)`:a?e.edgeKind===`checkpoint`?`var(--success)`:`var(--accent-strong)`:`rgba(123, 141, 167, 0.45)`,strokeWidth:o?2.6:a?2.2:1.5,opacity:a?1:.72}}})}},[h,p,d.currentNodeId,d.edges,d.nodes,f,t]),v=(0,B.useMemo)(()=>{if(!e.executionTraceSummary)return null;let t=e.executionTraceSummary.items;return d.edges.map(e=>{let n=f.get(e.fromNodeId),r=f.get(e.toNodeId);if(!n||!r||!n.isActiveLineage||!r.isActiveLineage)return null;let i=fy(e,t);if(!i)return null;let a=(n.x+220/2+r.x+220/2)/2,o=(n.y+124/2+r.y+124/2)/2;return{edgeKey:`${e.fromNodeId}->${e.toNodeId}`,x:a,y:o,cause:i}}).filter(e=>e!==null)},[d.edges,f,e.executionTraceSummary]),y=(0,B.useMemo)(()=>e.executionTraceSummary?py(uy(e.executionTraceSummary.items)).filter(e=>e.iterationCount>1).map(e=>{let t=e.nodeIds.map(e=>f.get(e)).filter(e=>e!==void 0);if(t.length===0)return null;let n=t.map(e=>e.y),r=Math.min(...n),i=t.reduce((e,t)=>e.y>t.y?e:t),a=Math.max(...n)+(i.isActiveLineage?124:104);return{key:e.loopId,iterationCount:e.iterationCount,topY:r,bottomY:a,gutterX:564}}).filter(e=>e!==null):null,[d.nodes,f,e.executionTraceSummary]),b=(0,B.useMemo)(()=>{if(!e.executionTraceSummary)return null;let t=e.skippedSteps??[];return t.length===0?null:sy(t,d)},[d,e.executionTraceSummary,e.skippedSteps]),x=(0,B.useCallback)((e,t)=>{n?.(t.id)},[n]),S=(0,B.useCallback)((e,t)=>{let n=f.get(t.id)?.node.stepLabel??null;if(!n||n.length<=35)return;let r=i.current?.getBoundingClientRect();if(!r)return;let a=e.clientX-r.left+12,o=e.clientY-r.top+16,c=Math.min(a,(i.current?.clientWidth??9999)-272);u.current!==null&&clearTimeout(u.current),u.current=setTimeout(()=>{s(n),l({x:c,y:o})},300)},[f]),C=(0,B.useCallback)(()=>{u.current!==null&&(clearTimeout(u.current),u.current=null),s(null),l(null)},[]),w=(0,B.useCallback)((e,t)=>{let n=i.current?.getBoundingClientRect();if(!n)return;let r=e.clientX-n.left+12,a=e.clientY-n.top+16,o=Math.min(r,(i.current?.clientWidth??9999)-272);u.current!==null&&clearTimeout(u.current),u.current=setTimeout(()=>{s(t),l({x:o,y:a})},300)},[]),T=(0,B.useCallback)(()=>{u.current!==null&&(clearTimeout(u.current),u.current=null),s(null),l(null)},[]);return(0,V.jsxs)(`div`,{ref:r,className:`h-full flex flex-col bg-[var(--bg-primary)]`,children:[(0,V.jsxs)(`div`,{className:`border-b border-[var(--border)] px-4 py-3 console-blueprint-grid`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,V.jsx)(vy,{label:`Current`,value:d.summary.currentNodeLabel,emphasis:!0}),(0,V.jsx)(vy,{label:`Status`,value:Oy(e.status)}),(0,V.jsx)(vy,{label:`Active lineage`,value:`${d.summary.lineageNodeCount} nodes`}),(0,V.jsx)(vy,{label:`Alternate branches`,value:`${d.summary.alternateBranchCount}`}),(0,V.jsx)(vy,{label:`Historical nodes`,value:`${d.summary.sideNodeCount}`}),(0,V.jsx)(vy,{label:`Blocked attempts`,value:`${d.summary.blockedAttemptCount}`}),(0,V.jsx)(vy,{label:`Critical gaps`,value:e.hasUnresolvedCriticalGaps?`Present`:`None`})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(yy,{onClick:()=>m(d.startNodeId),children:`Start`}),(0,V.jsx)(yy,{onClick:()=>m(d.currentNodeId),children:`Current`}),(0,V.jsx)(yy,{onClick:()=>m(d.latestBranchNodeId),children:`Latest branch`})]})]}),(0,V.jsx)(_y,{model:d,selectedNodeId:t,runStatus:e.status,onNavigateToNode:m}),e.executionTraceSummary!==null&&e.executionTraceSummary.contextFacts.length>0&&(0,V.jsx)(`div`,{className:`flex flex-wrap gap-2 mt-3`,children:e.executionTraceSummary.contextFacts.map(e=>(0,V.jsxs)(`div`,{className:`inline-flex items-center gap-2 px-2 py-1 font-mono text-[10px] uppercase tracking-[0.16em]`,style:{color:`var(--text-muted)`,backgroundColor:`rgba(123, 141, 167, 0.08)`,border:`1px solid rgba(123, 141, 167, 0.20)`},children:[(0,V.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:qo(e.key)}),(0,V.jsx)(`span`,{style:{color:`var(--text-muted)`},children:`//`}),(0,V.jsx)(`span`,{style:{color:`var(--text-primary)`},children:e.value})]},e.key))})]}),(0,V.jsxs)(`div`,{ref:i,className:`relative flex-1 overflow-auto lineage-scroll-surface`,children:[(0,V.jsxs)(`div`,{style:{width:Math.max(d.graphWidth,b?.requiredWidth??0,960),height:Math.max(d.graphHeight+(h&&h.size>0?40:0),360)},children:[(0,V.jsx)(Cv,{nodes:g,edges:_,fitView:!1,defaultViewport:{x:0,y:0,zoom:1},proOptions:{hideAttribution:!0},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!1,zoomOnScroll:!1,zoomOnPinch:!1,zoomOnDoubleClick:!1,preventScrolling:!1,colorMode:`dark`,onNodeClick:x,onNodeMouseEnter:S,onNodeMouseLeave:C,style:{background:`transparent`}}),v&&v.map(e=>(0,V.jsx)(Ny,{x:e.x,y:e.y,cause:e.cause,onMouseEnter:w,onMouseLeave:T},e.edgeKey)),y&&y.map(e=>(0,V.jsx)(jy,{topY:e.topY,bottomY:e.bottomY,gutterX:e.gutterX,iterationCount:e.iterationCount},e.key)),b&&b.nodes.map(e=>(0,V.jsx)(Py,{x:e.x,y:e.y,stepLabel:e.stepLabel??e.stepId,onMouseEnter:w,onMouseLeave:T},e.stepId))]}),o&&c&&(0,V.jsx)(`div`,{style:{position:`absolute`,left:c.x,top:c.y,pointerEvents:`none`,zIndex:50,maxWidth:260,background:`rgba(10, 12, 20, 0.96)`,border:`1px solid rgba(123, 141, 167, 0.35)`,padding:`6px 10px`,fontSize:12,lineHeight:1.5,color:`var(--text-primary)`,wordWrap:`break-word`,boxShadow:`0 4px 16px rgba(0,0,0,0.4)`},children:o})]})]})}function gy({node:e,isActiveLineage:t,isCurrent:n,isSelected:r,isLiveRun:i,branchKind:a,branchIndex:o,displayLabel:s,stepNumber:c,totalSteps:l,causeItems:u}){let d=Ty(e),f=e.nodeKind===`blocked_attempt`&&u!==void 0&&u.length>0,[p,m]=(0,B.useState)(!1);return(0,V.jsxs)(`div`,{className:`relative flex h-full w-full flex-col text-left overflow-hidden ${n&&i?`workrail-current-lineage-node`:``} ${r?`workrail-selected-lineage-node`:``}`,children:[d&&(0,V.jsx)(`div`,{style:{position:`absolute`,left:0,top:0,bottom:0,width:3,background:d,pointerEvents:`none`}}),(0,V.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-hidden px-3 py-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,V.jsx)(Ko,{color:Sy(a,t),children:Dy(e.nodeKind,a,o)}),(0,V.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[r&&(0,V.jsx)(Ko,{color:`var(--warning)`,children:`Selected`}),n&&(0,V.jsx)(Ko,{color:i?`var(--accent-strong)`:`var(--text-secondary)`,children:`Current`})]})]}),(0,V.jsx)(`div`,{className:t?`text-sm font-medium leading-snug`:`text-[13px] leading-snug`,style:{color:`var(--text-primary)`,display:`-webkit-box`,WebkitLineClamp:t?4:3,WebkitBoxOrient:`vertical`,overflow:`hidden`},children:s})]}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-t border-[rgba(255,255,255,0.06)] bg-[rgba(0,0,0,0.18)] px-3 py-2`,children:[(0,V.jsx)(Ko,{color:`var(--text-secondary)`,className:`min-w-0 truncate text-[11px]`,children:c!==null&&l!==null?`${c} / ${l}`:`evt ${e.createdAtEventIndex}`}),e.isTip?(0,V.jsx)(Ko,{className:`shrink-0`,color:e.isPreferredTip?`var(--warning)`:`var(--text-muted)`,children:e.isPreferredTip?`Preferred tip`:`Tip`}):(0,V.jsx)(Ko,{className:`shrink-0`,color:`transparent`,children:`spacer`})]}),f&&(0,V.jsxs)(`div`,{style:{borderTop:`1px solid rgba(239, 68, 68, 0.25)`,background:`rgba(80, 24, 31, 0.80)`,overflow:`hidden`,transition:`height 120ms ease`,height:p?72:32,flexShrink:0},children:[(0,V.jsx)(`div`,{className:`flex items-center px-3`,style:{height:32},children:(0,V.jsx)(`button`,{type:`button`,"aria-expanded":p,onClick:e=>{e.stopPropagation(),m(e=>!e)},className:`font-mono text-[9px] uppercase tracking-[0.22em] px-2 py-0.5 transition-colors`,style:{color:p?`var(--text-muted)`:`var(--accent)`,border:`1px solid ${p?`rgba(123,141,167,0.25)`:`rgba(244,196,48,0.40)`}`,background:p?`rgba(123,141,167,0.06)`:`rgba(244,196,48,0.08)`},children:p?`[ CLOSE ]`:`[ CAUSE ]`})}),p&&u&&u[0]&&(0,V.jsx)(`div`,{className:`px-3 pb-2 font-mono text-[9px] leading-relaxed`,style:{color:`var(--text-secondary)`},children:u[0].summary})]})]})}function _y({model:e,selectedNodeId:t,runStatus:n,onNavigateToNode:r}){let i=e.nodes.filter(e=>e.isActiveLineage),a=e.nodes.filter(e=>!e.isActiveLineage).slice(-8);return(0,V.jsx)(`div`,{className:`mt-3 border border-[var(--border)] bg-[rgba(10,10,10,0.38)] px-3 py-2 corner-brackets`,children:(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(Ko,{children:`Lineage rail`}),i.map(e=>(0,V.jsx)(by,{label:e.node.stepLabel??ay(e.node.nodeId),isCurrent:e.isCurrent,isSelected:e.node.nodeId===t,tone:`active`,onClick:()=>r(e.node.nodeId)},e.node.nodeId)),a.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`mx-1 h-px w-6 bg-[var(--border)]`}),a.map(e=>(0,V.jsx)(by,{label:ky(e.node,e.branchKind,e.branchIndex,n),isCurrent:!1,isSelected:e.node.nodeId===t,tone:e.branchKind===`blocked`?`blocked`:`side`,onClick:()=>r(e.node.nodeId)},e.node.nodeId))]})]})})}function vy({label:e,value:t,emphasis:n=!1}){return(0,V.jsxs)(`div`,{className:`min-w-[120px] border px-3 py-2`,style:{borderColor:n?`rgba(0, 240, 255, 0.42)`:`var(--border)`,background:n?`rgba(0, 240, 255, 0.08)`:`rgba(15, 19, 31, 0.78)`},children:[(0,V.jsx)(Ko,{children:e}),(0,V.jsx)(`div`,{className:`mt-1 text-sm text-[var(--text-primary)]`,children:t})]})}function yy({children:e,onClick:t}){return(0,V.jsx)(`button`,{type:`button`,onClick:t,className:`border border-[var(--border)] bg-[var(--bg-primary)] px-3 py-2 font-mono text-[11px] uppercase tracking-[0.30em] text-[var(--text-secondary)] transition-colors hover:border-[var(--accent-strong)] hover:text-[var(--text-primary)]`,children:e})}function by({label:e,isCurrent:t,isSelected:n,tone:r,onClick:i}){return(0,V.jsx)(`button`,{type:`button`,title:e,onClick:i,className:`border px-2 py-1 font-mono text-[10px] uppercase tracking-[0.16em] text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]`,style:{background:n?`rgba(244, 179, 65, 0.16)`:r===`active`?t?`rgba(0, 240, 255, 0.2)`:`rgba(0, 240, 255, 0.08)`:r===`blocked`?`rgba(239, 68, 68, 0.12)`:`rgba(125, 136, 156, 0.12)`,borderColor:n?`rgba(244, 179, 65, 0.48)`:r===`active`?t?`rgba(0, 240, 255, 0.6)`:`rgba(0, 240, 255, 0.32)`:r===`blocked`?`rgba(239, 68, 68, 0.34)`:`rgba(125, 136, 156, 0.3)`},children:Ay(e)})}function xy(e,t){return e.nodeKind===`blocked_attempt`?t?`rgba(80, 24, 31, 0.92)`:`rgba(52, 24, 30, 0.82)`:e.nodeKind===`checkpoint`?t?`rgba(18, 61, 51, 0.92)`:`rgba(18, 43, 38, 0.82)`:t?`rgba(27, 31, 44, 0.96)`:`rgba(24, 28, 39, 0.82)`}function Sy(e,t){return e===`blocked`?`var(--error)`:e===`alternate`?t?`var(--accent-strong)`:`rgba(186, 197, 219, 0.72)`:t?`var(--accent-strong)`:`var(--text-muted)`}function Cy(e,t,n,r){return r?`var(--warning)`:n?`var(--accent-strong)`:e.nodeKind===`blocked_attempt`?t?`var(--error)`:`rgba(239, 68, 68, 0.5)`:e.nodeKind===`checkpoint`?t?`var(--success)`:`rgba(34, 197, 94, 0.45)`:t?`rgba(0, 240, 255, 0.55)`:`rgba(123, 141, 167, 0.45)`}var wy=[{test:e=>e.hasFailedValidations,color:`var(--error)`},{test:e=>e.hasGaps,color:`var(--warning)`},{test:e=>e.hasRecap||e.hasArtifacts,color:`var(--accent)`}];function Ty(e){return wy.find(t=>t.test(e))?.color??null}function Ey(e){switch(e){case`blocked_attempt`:return`Blocked`;case`checkpoint`:return`Checkpoint`;case`step`:return`Step`}}function Dy(e,t,n){return t===`blocked`?n?`Blocked branch ${n}`:`Blocked branch`:t===`alternate`?n?`Alt branch ${n}`:`Alt branch`:Ey(e)}function Oy(e){switch(e){case`complete`:return`Complete`;case`complete_with_gaps`:return`Complete with gaps`;case`blocked`:return`Blocked`;case`in_progress`:return`In progress`}}function ky(e,t,n,r){return e.stepLabel?e.stepLabel:t===`blocked`?n?`Blocked attempt ${n}`:`Blocked attempt`:t===`alternate`?n?`Alternate path ${n}`:`Alternate path`:e.isPreferredTip&&(r===`complete`||r===`complete_with_gaps`)?`Complete`:ay(e.nodeId)}function Ay(e){return e.length>18?`${e.slice(0,18)}…`:e}function jy({topY:e,bottomY:t,gutterX:n,iterationCount:r}){let i=t-e;return i<=0?null:(0,V.jsxs)(`div`,{style:{position:`absolute`,left:n,top:e,width:32,height:i,pointerEvents:`none`,zIndex:1},children:[(0,V.jsx)(`div`,{style:{position:`absolute`,left:14,top:0,bottom:0,width:3,background:`var(--accent)`,opacity:.7}}),(0,V.jsx)(`div`,{style:{position:`absolute`,left:0,top:-2,whiteSpace:`nowrap`},children:(0,V.jsx)(Ko,{color:`var(--accent)`,style:{fontSize:9},children:`[ LOOP ]`})}),(0,V.jsx)(`div`,{style:{position:`absolute`,left:0,bottom:-2,whiteSpace:`nowrap`},children:(0,V.jsx)(Ko,{color:`var(--accent)`,style:{fontSize:9},children:`[ // ${r}x ]`})})]})}var My={condition:{char:`C`,color:`#f4c430`},fork:{char:`F`,color:`var(--warning)`},divergence:{char:`D`,color:`var(--error)`},advance:{char:`>`,color:`rgba(0,175,192,0.60)`}};function Ny({x:e,y:t,cause:n,onMouseEnter:r,onMouseLeave:i}){let a=My[n.kind];return(0,V.jsx)(`div`,{style:{position:`absolute`,left:e-5,top:t-5,width:10,height:10,transform:`rotate(45deg)`,background:a.color,zIndex:1,pointerEvents:`auto`,cursor:`default`,display:`flex`,alignItems:`center`,justifyContent:`center`},onMouseEnter:e=>r(e,n.summary),onMouseLeave:i,children:(0,V.jsx)(`span`,{style:{display:`block`,transform:`rotate(-45deg)`,fontSize:7,lineHeight:1,fontFamily:`monospace`,fontWeight:700,color:`rgba(0,0,0,0.75)`,userSelect:`none`,pointerEvents:`none`},children:a.char})})}function Py({x:e,y:t,stepLabel:n,onMouseEnter:r,onMouseLeave:i}){return(0,V.jsxs)(`div`,{style:{position:`absolute`,left:e,top:t,width:220,height:124,opacity:.25,pointerEvents:`auto`,cursor:`default`,border:`1px dashed rgba(123, 141, 167, 0.55)`,background:`rgba(24, 28, 39, 0.60)`,display:`flex`,flexDirection:`column`,overflow:`hidden`,zIndex:0},onMouseEnter:e=>r(e,n),onMouseLeave:i,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3 pt-3`,children:[(0,V.jsx)(Ko,{color:`rgba(123, 141, 167, 0.70)`,children:`Skipped`}),(0,V.jsx)(Ko,{color:`rgba(123, 141, 167, 0.55)`,className:`text-[9px]`,children:`[ SKIPPED ]`})]}),(0,V.jsx)(`div`,{className:`grow px-3 pt-2 text-sm leading-snug`,style:{color:`rgba(186, 197, 219, 0.65)`,display:`-webkit-box`,WebkitLineClamp:4,WebkitBoxOrient:`vertical`,overflow:`hidden`},children:n}),(0,V.jsx)(`div`,{className:`flex items-center border-t px-3 py-2`,style:{borderColor:`rgba(255,255,255,0.04)`,background:`rgba(0,0,0,0.12)`},children:(0,V.jsx)(Ko,{color:`rgba(123, 141, 167, 0.45)`,className:`text-[11px]`,children:`not executed`})})]})}function Fy({label:e,color:t,bgColor:n}){return(0,V.jsx)(`span`,{className:`shrink-0 inline-flex items-center px-2 py-0.5 font-mono text-[10px] uppercase tracking-[0.20em]`,style:{color:t,backgroundColor:n,border:`1px solid ${t}40`},children:e})}function Iy(e){switch(e.kind){case`selected_next_step`:return{label:`STEP`,color:`var(--accent)`,bgColor:`rgba(244, 196, 48, 0.12)`};case`evaluated_condition`:return cy(e)?{label:`CONDITION`,color:`var(--success)`,bgColor:`rgba(34, 197, 94, 0.12)`}:{label:`CONDITION`,color:`var(--text-muted)`,bgColor:`rgba(123, 141, 167, 0.10)`};case`detected_non_tip_advance`:return{label:`FORK`,color:`var(--warning)`,bgColor:`rgba(251, 146, 60, 0.12)`};case`divergence`:return{label:`DIVERGE`,color:`var(--error)`,bgColor:`rgba(239, 68, 68, 0.12)`};case`entered_loop`:case`exited_loop`:return{label:`LOOP`,color:`var(--accent)`,bgColor:`rgba(0, 240, 255, 0.10)`};case`context_fact`:return{label:`FACT`,color:`var(--text-muted)`,bgColor:`rgba(123, 141, 167, 0.10)`};default:return{label:`INFO`,color:`var(--text-secondary)`,bgColor:`rgba(123, 141, 167, 0.08)`}}}function Ly({group:e}){let[t,n]=(0,B.useState)(e.iterationCount<=3),r=e.iterationCount;return(0,V.jsxs)(`li`,{className:`flex flex-col gap-1 py-1.5 border-b border-[var(--border)] last:border-0`,children:[(0,V.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,V.jsxs)(`span`,{className:`shrink-0 inline-flex items-center px-2 py-0.5 font-mono text-[10px] uppercase tracking-[0.20em]`,style:{color:`var(--accent)`,backgroundColor:`rgba(0, 240, 255, 0.10)`,border:`1px solid rgba(0, 240, 255, 0.25)`},children:[`LOOP: `,r]}),(0,V.jsx)(`span`,{className:`text-xs text-[var(--text-secondary)] leading-relaxed flex-1`,children:e.enteredItem.summary}),(0,V.jsxs)(`span`,{className:`font-mono text-[10px] text-[var(--text-muted)] shrink-0`,children:[`#`,e.enteredItem.recordedAtEventIndex]})]}),(0,V.jsxs)(`div`,{className:`text-[10px] font-mono text-[var(--text-muted)] pl-[calc(theme(spacing.2)+theme(spacing.3)+4ch)]`,children:[`stopped when: `,e.exitedItem.summary]}),e.innerItems.length>0&&(0,V.jsxs)(`div`,{className:`pl-4 mt-1`,children:[(0,V.jsx)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`font-mono text-[10px] text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors`,children:t?`[ collapse ]`:`[ expand ${e.innerItems.length} inner items ]`}),t&&(0,V.jsx)(`ol`,{className:`mt-1 space-y-1`,children:e.innerItems.map(e=>{let t=Iy(e);return(0,V.jsxs)(`li`,{className:`flex items-start gap-2 text-xs text-[var(--text-muted)]`,children:[(0,V.jsx)(Fy,{label:t.label,color:t.color,bgColor:t.bgColor}),(0,V.jsx)(`span`,{className:`flex-1 leading-relaxed`,children:e.summary}),(0,V.jsxs)(`span`,{className:`font-mono text-[10px] shrink-0`,children:[`#`,e.recordedAtEventIndex]})]},e.recordedAtEventIndex)})})]})]})}function Ry({runStatus:e}){let t=(()=>{switch(e){case`complete`:case`complete_with_gaps`:return{text:`// ------ RUN COMPLETE ------`,color:`var(--success)`};case`blocked`:return{text:`// ------ RUN BLOCKED ------`,color:`var(--error)`};case`in_progress`:return{text:`// ------ IN PROGRESS ------`,color:`var(--accent)`}}})();return(0,V.jsx)(`div`,{className:`font-mono text-[11px] text-center py-3 mt-1`,style:{color:t.color},children:t.text})}function zy({facts:e}){return e.length===0?null:(0,V.jsx)(`div`,{className:`flex flex-wrap gap-2 px-4 py-2 border-b border-[var(--border)] bg-[rgba(0,240,255,0.03)]`,children:e.map(e=>(0,V.jsxs)(`div`,{className:`inline-flex items-center gap-2 px-2 py-1 font-mono text-[10px] uppercase tracking-[0.16em]`,style:{color:`var(--text-muted)`,backgroundColor:`rgba(123, 141, 167, 0.08)`,border:`1px solid rgba(123, 141, 167, 0.20)`},children:[(0,V.jsx)(`span`,{style:{color:`var(--text-secondary)`},children:qo(e.key)}),(0,V.jsx)(`span`,{style:{color:`var(--text-muted)`},children:`//`}),(0,V.jsx)(`span`,{style:{color:`var(--text-primary)`},children:e.value})]},e.key))})}var By=80;function Vy({summary:e,runStatus:t}){let n=uy(e.items),r=(0,B.useRef)(null),i=(0,B.useRef)(n.length),[a,o]=(0,B.useState)(0),[s,c]=(0,B.useState)(!0);return(0,B.useEffect)(()=>{let e=r.current;if(!e)return;let t=i.current,a=n.length-t;i.current=n.length,!(a<=0)&&(s?(e.scrollTo({top:e.scrollHeight,behavior:`smooth`}),o(0)):o(e=>e+a))},[n.length,s]),(0,B.useEffect)(()=>{let e=r.current;if(!e)return;function t(){if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight;c(t<=By),t<=By&&o(0)}return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},[]),n.length===0?(0,V.jsx)(`div`,{className:`h-full flex items-center justify-center`,children:(0,V.jsx)(`span`,{className:`font-mono text-xs text-[var(--text-muted)]`,children:`// TRACE -- no routing decisions were recorded for this run`})}):(0,V.jsxs)(`div`,{className:`h-full flex flex-col bg-[var(--bg-primary)] relative`,children:[(0,V.jsx)(zy,{facts:e.contextFacts}),(0,V.jsxs)(`div`,{ref:r,className:`flex-1 overflow-y-auto px-4 py-2`,children:[(0,V.jsx)(`ol`,{className:`space-y-0`,children:n.map(e=>{if(e.kind===`loop_group`)return(0,V.jsx)(Ly,{group:e},e.enteredItem.recordedAtEventIndex);let{item:t}=e,n=Iy(t);return(0,V.jsxs)(`li`,{className:`flex items-start gap-3 py-1.5 border-b border-[var(--border)] last:border-0`,children:[(0,V.jsx)(Fy,{label:n.label,color:n.color,bgColor:n.bgColor}),(0,V.jsx)(`span`,{className:`text-xs text-[var(--text-secondary)] leading-relaxed flex-1`,children:t.summary}),(0,V.jsxs)(`span`,{className:`font-mono text-[10px] text-[var(--text-muted)] shrink-0`,children:[`#`,t.recordedAtEventIndex]})]},t.recordedAtEventIndex)})}),(0,V.jsx)(Ry,{runStatus:t})]}),!s&&a>0&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{r.current?.scrollTo({top:r.current.scrollHeight,behavior:`smooth`}),o(0)},className:`absolute bottom-4 left-1/2 -translate-x-1/2 font-mono text-[10px] uppercase tracking-[0.20em] px-3 py-1.5 transition-colors`,style:{backgroundColor:`rgba(0, 240, 255, 0.15)`,border:`1px solid rgba(0, 240, 255, 0.35)`,color:`var(--accent)`},children:[`[ `,a,` NEW ]`]})]})}function Hy(e,t){return e.isLoading?{state:`loading`}:e.isError?{state:`error`,message:e.error instanceof Error?e.error.message:`Could not load performance data.`,retry:t}:e.data===null?{state:`devModeOff`}:e.data===void 0?{state:`loading`}:e.data.devMode===!1?{state:`devModeOff`}:{state:`data`,data:e.data}}var Uy=class extends Error{constructor(e,t){super(`HTTP ${e}: ${t}`),this.status=e,this.name=`HttpError`}};async function Wy(e){let t=await fetch(e);if(!t.ok)throw new Uy(t.status,t.statusText);let n=await t.json();if(!n.success||!n.data)throw Error(n.error??`Unknown error`);return n.data}function Gy(){return it({queryKey:[`sessions`],queryFn:()=>Wy(`/api/v2/sessions`),refetchInterval:3e4,staleTime:25e3})}function Ky(e){return it({queryKey:[`session`,e],queryFn:()=>Wy(`/api/v2/sessions/${e}`),enabled:!!e,refetchInterval:5e3,refetchIntervalInBackground:!1,staleTime:3e3})}function qy(e,t){return it({queryKey:[`node`,e,t],queryFn:()=>Wy(`/api/v2/sessions/${e}/nodes/${t}`),enabled:!!t})}function Jy(e,t){return it({queryKey:[`diff-summary`,e],queryFn:()=>Wy(`/api/v2/sessions/${e}/diff-summary`),enabled:t,staleTime:1/0,refetchInterval:!1,refetchOnWindowFocus:!1,retry:!1})}function Yy(){return it({queryKey:[`worktrees`],queryFn:()=>Wy(`/api/v2/worktrees`),refetchInterval:3e4,staleTime:2e4})}function Xy(){return it({queryKey:[`workflows`],queryFn:()=>Wy(`/api/v2/workflows`),staleTime:1/0,refetchInterval:!1})}function Zy(){let e=it({queryKey:[`perf`,`tool-calls`],queryFn:async()=>{try{return await Wy(`/api/v2/perf/tool-calls`)}catch(e){if(e instanceof Uy&&e.status===404)return null;throw e}},refetchInterval:5e3,staleTime:3e3,refetchIntervalInBackground:!1});return Hy(e,()=>void e.refetch())}function Qy(e){return it({queryKey:[`workflow`,e],queryFn:()=>Wy(`/api/v2/workflows/${e}`),enabled:e!==null,staleTime:1/0,refetchInterval:!1})}function $y(){return it({queryKey:[`triggers`],queryFn:async()=>{try{return await Wy(`/api/v2/triggers`)}catch(e){if(e instanceof Uy&&e.status===503)return{triggers:[]};throw e}},staleTime:3e4,refetchInterval:6e4})}async function eb(e){let t=await fetch(`/api/v2/auto/dispatch`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>({error:t.statusText}));throw new Uy(t.status,e.error??t.statusText)}let n=await t.json();if(!n.success||!n.data)throw Error(n.error??`Dispatch failed`);return n.data}function tb(){let e=Ue();(0,B.useEffect)(()=>{let t=null,n=null;function r(){t=new EventSource(`/api/v2/workspace/events`),t.onmessage=t=>{try{let n=JSON.parse(t.data);n.type===`change`?e.invalidateQueries({queryKey:[`sessions`]}):n.type===`worktrees-updated`&&e.invalidateQueries({queryKey:[`worktrees`]})}catch{}},t.onerror=()=>{t?.close(),t=null,n=setTimeout(r,5e3)}}return r(),()=>{n!==null&&clearTimeout(n),t?.close()}},[e])}function nb(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var rb=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ib=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ab={};function ob(e,t){return((t||ab).jsx?ib:rb).test(e)}var sb=/[ \t\n\f\r]/g;function cb(e){return typeof e==`object`?e.type===`text`?lb(e.value):!1:lb(e)}function lb(e){return e.replace(sb,``)===``}var ub=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};ub.prototype.normal={},ub.prototype.property={},ub.prototype.space=void 0;function db(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ub(n,r,t)}function fb(e){return e.toLowerCase()}var pb=class{constructor(e,t){this.attribute=t,this.property=e}};pb.prototype.attribute=``,pb.prototype.booleanish=!1,pb.prototype.boolean=!1,pb.prototype.commaOrSpaceSeparated=!1,pb.prototype.commaSeparated=!1,pb.prototype.defined=!1,pb.prototype.mustUseProperty=!1,pb.prototype.number=!1,pb.prototype.overloadedBoolean=!1,pb.prototype.property=``,pb.prototype.spaceSeparated=!1,pb.prototype.space=void 0;var mb=s({boolean:()=>Z,booleanish:()=>gb,commaOrSpaceSeparated:()=>bb,commaSeparated:()=>yb,number:()=>Q,overloadedBoolean:()=>_b,spaceSeparated:()=>vb}),hb=0,Z=xb(),gb=xb(),_b=xb(),Q=xb(),vb=xb(),yb=xb(),bb=xb();function xb(){return 2**++hb}var Sb=Object.keys(mb),Cb=class extends pb{constructor(e,t,n,r){let i=-1;if(super(e,t),wb(this,`space`,r),typeof n==`number`)for(;++i<Sb.length;){let e=Sb[i];wb(this,Sb[i],(n&mb[e])===mb[e])}}};Cb.prototype.defined=!0;function wb(e,t,n){n&&(e[t]=n)}function Tb(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Cb(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[fb(r)]=r,n[fb(a.attribute)]=r}return new ub(t,n,e.space)}var Eb=Tb({properties:{ariaActiveDescendant:null,ariaAtomic:gb,ariaAutoComplete:null,ariaBusy:gb,ariaChecked:gb,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:vb,ariaCurrent:null,ariaDescribedBy:vb,ariaDetails:null,ariaDisabled:gb,ariaDropEffect:vb,ariaErrorMessage:null,ariaExpanded:gb,ariaFlowTo:vb,ariaGrabbed:gb,ariaHasPopup:null,ariaHidden:gb,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:vb,ariaLevel:Q,ariaLive:null,ariaModal:gb,ariaMultiLine:gb,ariaMultiSelectable:gb,ariaOrientation:null,ariaOwns:vb,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:gb,ariaReadOnly:gb,ariaRelevant:null,ariaRequired:gb,ariaRoleDescription:vb,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:gb,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Db(e,t){return t in e?e[t]:t}function Ob(e,t){return Db(e,t.toLowerCase())}var kb=Tb({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:yb,acceptCharset:vb,accessKey:vb,action:null,allow:null,allowFullScreen:Z,allowPaymentRequest:Z,allowUserMedia:Z,alt:null,as:null,async:Z,autoCapitalize:null,autoComplete:vb,autoFocus:Z,autoPlay:Z,blocking:vb,capture:null,charSet:null,checked:Z,cite:null,className:vb,cols:Q,colSpan:null,content:null,contentEditable:gb,controls:Z,controlsList:vb,coords:Q|yb,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Z,defer:Z,dir:null,dirName:null,disabled:Z,download:_b,draggable:gb,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Z,formTarget:null,headers:vb,height:Q,hidden:_b,high:Q,href:null,hrefLang:null,htmlFor:vb,httpEquiv:vb,id:null,imageSizes:null,imageSrcSet:null,inert:Z,inputMode:null,integrity:null,is:null,isMap:Z,itemId:null,itemProp:vb,itemRef:vb,itemScope:Z,itemType:vb,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Z,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:Z,muted:Z,name:null,nonce:null,noModule:Z,noValidate:Z,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Z,optimum:Q,pattern:null,ping:vb,placeholder:null,playsInline:Z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Z,referrerPolicy:null,rel:vb,required:Z,reversed:Z,rows:Q,rowSpan:Q,sandbox:vb,scope:null,scoped:Z,seamless:Z,selected:Z,shadowRootClonable:Z,shadowRootDelegatesFocus:Z,shadowRootMode:null,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:gb,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:Z,useMap:null,value:gb,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:vb,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Z,declare:Z,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:Z,noHref:Z,noShade:Z,noWrap:Z,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:gb,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Z,disableRemotePlayback:Z,prefix:null,property:null,results:Q,security:null,unselectable:null},space:`html`,transform:Ob}),Ab=Tb({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:bb,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:vb,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:Z,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:yb,g2:yb,glyphName:yb,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:bb,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:vb,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:bb,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:bb,rev:bb,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:bb,requiredFeatures:bb,requiredFonts:bb,requiredFormats:bb,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:bb,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:bb,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:bb,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Db}),jb=Tb({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Mb=Tb({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Ob}),Nb=Tb({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Pb={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Fb=/[A-Z]/g,Ib=/-[a-z]/g,Lb=/^data[-\w.:]+$/i;function Rb(e,t){let n=fb(t),r=t,i=pb;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Lb.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Ib,Bb);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Ib.test(e)){let n=e.replace(Fb,zb);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Cb}return new i(r,t)}function zb(e){return`-`+e.toLowerCase()}function Bb(e){return e.charAt(1).toUpperCase()}var Vb=db([Eb,kb,jb,Mb,Nb],`html`),Hb=db([Eb,Ab,jb,Mb,Nb],`svg`);function Ub(e){return e.join(` `).trim()}var Wb=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
16
+ `,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),Gb=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(Wb());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),Kb=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),qb=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Gb()),r=Kb();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),Jb=Xb(`end`),Yb=Xb(`start`);function Xb(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Zb(e){let t=Yb(e),n=Jb(e);if(t&&n)return{start:t,end:n}}function Qb(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?ex(e.position):`start`in e||`end`in e?ex(e):`line`in e||`column`in e?$b(e):``}function $b(e){return tx(e&&e.line)+`:`+tx(e&&e.column)}function ex(e){return $b(e&&e.start)+`-`+$b(e&&e.end)}function tx(e){return e&&typeof e==`number`?e:1}var nx=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Qb(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};nx.prototype.file=``,nx.prototype.name=``,nx.prototype.reason=``,nx.prototype.message=``,nx.prototype.stack=``,nx.prototype.column=void 0,nx.prototype.line=void 0,nx.prototype.ancestors=void 0,nx.prototype.cause=void 0,nx.prototype.fatal=void 0,nx.prototype.place=void 0,nx.prototype.ruleId=void 0,nx.prototype.source=void 0;var rx=l(qb(),1),ix={}.hasOwnProperty,ax=new Map,ox=/[A-Z]/g,sx=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),cx=new Set([`td`,`th`]),lx=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function ux(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=xx(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=bx(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Hb:Vb,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=dx(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function dx(e,t,n){if(t.type===`element`)return fx(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return px(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return hx(e,t,n);if(t.type===`mdxjsEsm`)return mx(e,t);if(t.type===`root`)return gx(e,t,n);if(t.type===`text`)return _x(e,t)}function fx(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Hb,e.schema=i),e.ancestors.push(t);let a=Dx(e,t.tagName,!1),o=Sx(e,t),s=wx(e,t);return sx.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!cb(e):!0})),vx(e,o,a,t),yx(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function px(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Ox(e,t.position)}function mx(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Ox(e,t.position)}function hx(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Hb,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Dx(e,t.name,!0),o=Cx(e,t),s=wx(e,t);return vx(e,o,a,t),yx(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function gx(e,t,n){let r={};return yx(r,wx(e,t)),e.create(t,e.Fragment,r,n)}function _x(e,t){return t.value}function vx(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function yx(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function bx(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function xx(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Yb(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Sx(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&ix.call(t.properties,i)){let a=Tx(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&cx.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Cx(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Ox(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Ox(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function wx(e,t){let n=[],r=-1,i=e.passKeys?new Map:ax;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=dx(e,a,o);s!==void 0&&n.push(s)}return n}function Tx(e,t,n){let r=Rb(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?nb(n):Ub(n)),r.property===`style`){let t=typeof n==`object`?n:Ex(e,String(n));return e.stylePropertyNameCase===`css`&&(t=kx(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Pb[r.property]||r.property:r.attribute,n]}}function Ex(e,t){try{return(0,rx.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new nx("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=lx+`#cannot-parse-style-attribute`,r}}function Dx(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=ob(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=ob(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return ix.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Ox(e)}function Ox(e,t){let n=new nx("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=lx+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function kx(e){let t={},n;for(n in e)ix.call(e,n)&&(t[Ax(n)]=e[n]);return t}function Ax(e){let t=e.replace(ox,jx);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function jx(e){return`-`+e.toLowerCase()}var Mx={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},Nx={};function Px(e,t){let n=t||Nx;return Fx(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function Fx(e,t,n){if(Lx(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Ix(e.children,t,n)}return Array.isArray(e)?Ix(e,t,n):``}function Ix(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Fx(e[i],t,n);return r.join(``)}function Lx(e){return!!(e&&typeof e==`object`)}var Rx=document.createElement(`i`);function zx(e){let t=`&`+e+`;`;Rx.innerHTML=t;let n=Rx.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function Bx(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Vx(e,t){return e.length>0?(Bx(e,e.length,0,t),e):t}var Hx={}.hasOwnProperty;function Ux(e){let t={},n=-1;for(;++n<e.length;)Wx(t,e[n]);return t}function Wx(e,t){let n;for(n in t){let r=(Hx.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Hx.call(r,a)||(r[a]=[]);let e=i[a];Gx(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Gx(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Bx(e,0,0,r)}function Kx(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function qx(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Jx=aS(/[A-Za-z]/),Yx=aS(/[\dA-Za-z]/),Xx=aS(/[#-'*+\--9=?A-Z^-~]/);function Zx(e){return e!==null&&(e<32||e===127)}var Qx=aS(/\d/),$x=aS(/[\dA-Fa-f]/),eS=aS(/[!-/:-@[-`{-~]/);function $(e){return e!==null&&e<-2}function tS(e){return e!==null&&(e<0||e===32)}function nS(e){return e===-2||e===-1||e===32}var rS=aS(/\p{P}|\p{S}/u),iS=aS(/\s/);function aS(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function oS(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Yx(e.charCodeAt(n+1))&&Yx(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function sS(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return nS(r)?(e.enter(n),s(r)):t(r)}function s(r){return nS(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var cS={tokenize:lS};function lS(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),sS(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return $(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var uS={tokenize:fS},dS={tokenize:pS};function fS(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Bx(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(dS,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(dS,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return $(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;Bx(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function pS(e,t,n){return sS(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function mS(e){if(e===null||tS(e)||iS(e))return 1;if(rS(e))return 2}function hS(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var gS={name:`attention`,resolveAll:_S,tokenize:vS};function _S(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};yS(d,-c),yS(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Vx(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Vx(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=Vx(l,hS(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Vx(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Vx(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Bx(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function vS(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=mS(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=mS(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function yS(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var bS={name:`autolink`,tokenize:xS};function xS(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Jx(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Yx(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||Yx(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Zx(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Xx(t)?(e.consume(t),l):n(t)}function u(e){return Yx(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||Yx(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var SS={partial:!0,tokenize:CS};function CS(e,t,n){return r;function r(t){return nS(t)?sS(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||$(e)?t(e):n(e)}}var wS={continuation:{tokenize:ES},exit:DS,name:`blockQuote`,tokenize:TS};function TS(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return nS(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function ES(e,t,n){let r=this;return i;function i(t){return nS(t)?sS(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(wS,t,n)(r)}}function DS(e){e.exit(`blockQuote`)}var OS={name:`characterEscape`,tokenize:kS};function kS(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return eS(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var AS={name:`characterReference`,tokenize:jS};function jS(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=Yx,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=$x,u):(e.enter(`characterReferenceValue`),a=7,o=Qx,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Yx&&!zx(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var MS={partial:!0,tokenize:FS},NS={concrete:!0,name:`codeFenced`,tokenize:PS};function PS(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),nS(t)?sS(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||$(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(MS,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):nS(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),sS(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||$(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&nS(t)?sS(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||$(t)?e.check(MS,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||$(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),nS(t)?sS(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),nS(t)?sS(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||$(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function FS(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var IS={name:`codeIndented`,tokenize:RS},LS={partial:!0,tokenize:zS};function RS(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),sS(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):$(t)?e.attempt(LS,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||$(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function zS(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):sS(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):$(e)?i(e):n(e)}}var BS={name:`codeText`,previous:HS,resolve:VS,tokenize:US};function VS(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function HS(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function US(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||$(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var WS=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&GS(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),GS(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),GS(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);GS(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);GS(this.left,t.reverse())}}};function GS(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function KS(e){let t={},n=-1,r,i,a,o,s,c,l,u=new WS(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,qS(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Bx(e,0,1/0,u.slice(0)),!l}function qS(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var JS={resolve:XS,tokenize:ZS},YS={partial:!0,tokenize:QS};function XS(e){return KS(e),e}function ZS(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):$(t)?e.check(YS,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function QS(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),sS(e,a,`linePrefix`)}function a(i){if(i===null||$(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function $S(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Zx(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||$(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||tS(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Zx(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function eC(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):$(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||$(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!nS(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function tC(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),sS(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||$(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function nC(e,t){let n;return r;function r(i){return $(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):nS(i)?sS(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var rC={name:`definition`,tokenize:aC},iC={partial:!0,tokenize:oC};function aC(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return eC.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=qx(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return tS(t)?nC(e,l)(t):l(t)}function l(t){return $S(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(iC,d,d)(t)}function d(t){return nS(t)?sS(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||$(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function oC(e,t,n){return r;function r(t){return tS(t)?nC(e,i)(t):n(t)}function i(t){return tC(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return nS(t)?sS(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||$(e)?t(e):n(e)}}var sC={name:`hardBreakEscape`,tokenize:cC};function cC(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return $(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var lC={name:`headingAtx`,resolve:uC,tokenize:dC};function uC(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},Bx(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function dC(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||tS(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||$(n)?(e.exit(`atxHeading`),t(n)):nS(n)?sS(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||tS(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var fC=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),pC=[`pre`,`script`,`style`,`textarea`],mC={concrete:!0,name:`htmlFlow`,resolveTo:_C,tokenize:vC},hC={partial:!0,tokenize:bC},gC={partial:!0,tokenize:yC};function _C(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function vC(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:P):Jx(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Jx(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return Jx(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||tS(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&pC.includes(l)?(i=1,r.interrupt?t(s):O(s)):fC.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Yx(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return nS(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Jx(t)?(e.consume(t),b):nS(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Yx(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):nS(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):nS(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||$(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||tS(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||nS(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||$(t)?O(t):nS(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),F):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),te):$(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(hC,I,k)(t)):t===null||$(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(gC,A,I)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||$(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),P):O(t)}function N(t){return t===47?(e.consume(t),o=``,ee):O(t)}function ee(t){if(t===62){let n=o.toLowerCase();return pC.includes(n)?(e.consume(t),F):O(t)}return Jx(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ee):O(t)}function te(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),F):t===45&&i===2?(e.consume(t),P):O(t)}function F(t){return t===null||$(t)?(e.exit(`htmlFlowData`),I(t)):(e.consume(t),F)}function I(n){return e.exit(`htmlFlow`),t(n)}}function yC(e,t,n){let r=this;return i;function i(t){return $(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function bC(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(SS,t,n)}}var xC={name:`htmlText`,tokenize:SC};function SC(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Jx(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Jx(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):$(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):$(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):$(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):$(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return Jx(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Yx(t)?(e.consume(t),S):C(t)}function C(t){return $(t)?(o=C,N(t)):nS(t)?(e.consume(t),C):M(t)}function w(t){return t===45||Yx(t)?(e.consume(t),w):t===47||t===62||tS(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||Jx(t)?(e.consume(t),E):$(t)?(o=T,N(t)):nS(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||Yx(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):$(t)?(o=D,N(t)):nS(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):$(t)?(o=O,N(t)):nS(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):$(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||tS(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||tS(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return nS(t)?sS(e,te,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):te(t)}function te(t){return e.enter(`htmlTextData`),o(t)}}var CC={name:`labelEnd`,resolveAll:DC,resolveTo:OC,tokenize:kC},wC={tokenize:AC},TC={tokenize:jC},EC={tokenize:MC};function DC(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Bx(e,0,e.length,n),e}function OC(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=Vx(s,e.slice(a+1,a+r+3)),s=Vx(s,[[`enter`,u,t]]),s=Vx(s,hS(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Vx(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=Vx(s,e.slice(o+1)),s=Vx(s,[[`exit`,c,t]]),Bx(e,a,e.length,s),e}function kC(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(qx(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(wC,u,o?u:d)(t):t===91?e.attempt(TC,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(EC,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function AC(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return tS(t)?nC(e,a)(t):a(t)}function a(t){return t===41?u(t):$S(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return tS(t)?nC(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?tC(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return tS(t)?nC(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function jC(e,t,n){let r=this;return i;function i(t){return eC.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(qx(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function MC(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var NC={name:`labelStartImage`,resolveAll:CC.resolveAll,tokenize:PC};function PC(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var FC={name:`labelStartLink`,resolveAll:CC.resolveAll,tokenize:IC};function IC(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var LC={name:`lineEnding`,tokenize:RC};function RC(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),sS(e,t,`linePrefix`)}}var zC={name:`thematicBreak`,tokenize:BC};function BC(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||$(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),nS(t)?sS(e,s,`whitespace`)(t):s(t))}}var VC={continuation:{tokenize:GC},exit:qC,name:`list`,tokenize:WC},HC={partial:!0,tokenize:JC},UC={partial:!0,tokenize:KC};function WC(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Qx(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(zC,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Qx(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(SS,r.interrupt?n:u,e.attempt(HC,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return nS(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function GC(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(SS,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,sS(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!nS(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(UC,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,sS(e,e.attempt(VC,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function KC(e,t,n){let r=this;return sS(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function qC(e){e.exit(this.containerState.type)}function JC(e,t,n){let r=this;return sS(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!nS(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var YC={name:`setextUnderline`,resolveTo:XC,tokenize:ZC};function XC(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function ZC(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),nS(t)?sS(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||$(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var QC={tokenize:$C};function $C(e){let t=this,n=e.attempt(SS,r,e.attempt(this.parser.constructs.flowInitial,i,sS(e,e.attempt(this.parser.constructs.flow,i,e.attempt(JS,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var ew={resolveAll:iw()},tw=rw(`string`),nw=rw(`text`);function rw(e){return{resolveAll:iw(e===`text`?aw:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function iw(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function aw(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var ow=s({attentionMarkers:()=>mw,contentInitial:()=>cw,disable:()=>hw,document:()=>sw,flow:()=>uw,flowInitial:()=>lw,insideSpan:()=>pw,string:()=>dw,text:()=>fw}),sw={42:VC,43:VC,45:VC,48:VC,49:VC,50:VC,51:VC,52:VC,53:VC,54:VC,55:VC,56:VC,57:VC,62:wS},cw={91:rC},lw={[-2]:IS,[-1]:IS,32:IS},uw={35:lC,42:zC,45:[YC,zC],60:mC,61:YC,95:zC,96:NS,126:NS},dw={38:AS,92:OS},fw={[-5]:LC,[-4]:LC,[-3]:LC,33:NC,38:AS,42:gS,60:[bS,xC],91:FC,92:[sC,OS],93:CC,95:gS,96:BS},pw={null:[gS,ew]},mw={null:[42,95]},hw={null:[]};function gw(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Vx(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=hS(a,l.events,l),l.events):[]}function f(e,t){return vw(p(e),t)}function p(e){return _w(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){$(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Bx(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function _w(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function vw(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
17
+ `;break;case-3:o=`\r
18
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function yw(e){let t={constructs:Ux([ow,...(e||{}).extensions||[]]),content:n(cS),defined:[],document:n(uS),flow:n(QC),lazy:{},string:n(tw),text:n(nw)};return t;function n(e){return n;function n(n){return gw(t,e,n)}}}function bw(e){for(;!KS(e););return e}var xw=/[\0\t\n\r]/g;function Sw(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(xw.lastIndex=u,c=xw.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Cw=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ww(e){return e.replace(Cw,Tw)}function Tw(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Kx(n.slice(t?2:1),t?16:10)}return zx(n)||e}var Ew={}.hasOwnProperty;function Dw(e,t,n){return typeof t!=`string`&&(n=t,t=void 0),Ow(n)(bw(yw(n).document().write(Sw()(e,t,!0))))}function Ow(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(he),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(de),blockQuote:a(oe),characterEscape:T,characterReference:T,codeFenced:a(se),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(se,o),codeText:a(ce,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(le),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ue),hardBreakEscape:a(fe),hardBreakTrailing:a(fe),htmlFlow:a(pe,o),htmlFlowData:T,htmlText:a(pe,o),htmlTextData:T,image:a(me),label:o,link:a(he),listItem:a(_e),listItemValue:f,listOrdered:a(ge,d),listUnordered:a(ge),paragraph:a(ve),reference:ne,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(de),strong:a(ye),thematicBreak:a(xe)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ae,autolinkProtocol:ie,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:L,characterReferenceMarkerNumeric:L,characterReferenceValue:R,characterReference:z,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:te,labelText:ee,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:re,resourceDestinationString:P,resourceTitleString:F,resource:I,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Aw(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];Ew.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Mw).call(a,void 0,e[0])}for(r.position={start:kw(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:kw(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:kw(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Mw).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Qb({start:e.start,end:e.end})+`): it’s not open`);n.position.end=kw(e.end)}function u(){return Px(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=qx(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=be(),n.position={start:kw(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=kw(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=kw(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ee(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=ww(t),n.identifier=qx(t).toLowerCase()}function te(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function P(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function F(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function I(){this.data.inReference=void 0}function ne(){this.data.referenceType=`collapsed`}function re(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=qx(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function L(e){this.data.characterReferenceType=e.type}function R(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Kx(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=zx(t);let i=this.stack[this.stack.length-1];i.value+=r}function z(e){let t=this.stack.pop();t.position.end=kw(e.end)}function ie(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ae(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function oe(){return{type:`blockquote`,children:[]}}function se(){return{type:`code`,lang:null,meta:null,value:``}}function ce(){return{type:`inlineCode`,value:``}}function le(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ue(){return{type:`emphasis`,children:[]}}function de(){return{type:`heading`,depth:0,children:[]}}function fe(){return{type:`break`}}function pe(){return{type:`html`,value:``}}function me(){return{type:`image`,title:null,url:``,alt:null}}function he(){return{type:`link`,title:null,url:``,children:[]}}function ge(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function _e(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function ve(){return{type:`paragraph`,children:[]}}function ye(){return{type:`strong`,children:[]}}function be(){return{type:`text`,value:``}}function xe(){return{type:`thematicBreak`}}}function kw(e){return{line:e.line,column:e.column,offset:e.offset}}function Aw(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Aw(e,r):jw(e,r)}}function jw(e,t){let n;for(n in t)if(Ew.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Mw(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Qb({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Qb({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Qb({start:t.start,end:t.end})+`) is still open`)}function Nw(e){let t=this;t.parser=n;function n(n){return Dw(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Pw(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Fw(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
19
+ `}]}function Iw(e,t){let n=t.value?t.value+`
20
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function Lw(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Rw(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zw(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=oS(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function Bw(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Vw(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Hw(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Uw(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Hw(e,t);let i={src:oS(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Ww(e,t){let n={src:oS(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Gw(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Kw(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Hw(e,t);let i={href:oS(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function qw(e,t){let n={href:oS(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Jw(e,t,n){let r=e.all(t),i=n?Yw(n):Xw(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
21
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
22
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Yw(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Xw(n[r])}return t}function Xw(e){return e.spread??e.children.length>1}function Zw(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Qw(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $w(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function eT(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tT(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Yb(t.children[1]),o=Jb(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function nT(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function rT(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var iT=9,aT=32;function oT(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(sT(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(sT(t.slice(i),i>0,!1)),a.join(``)}function sT(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===iT||t===aT;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===iT||t===aT;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function cT(e,t){let n={type:`text`,value:oT(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function lT(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var uT={blockquote:Pw,break:Fw,code:Iw,delete:Lw,emphasis:Rw,footnoteReference:zw,heading:Bw,html:Vw,imageReference:Uw,image:Ww,inlineCode:Gw,linkReference:Kw,link:qw,listItem:Jw,list:Zw,paragraph:Qw,root:$w,strong:eT,table:tT,tableCell:rT,tableRow:nT,text:cT,thematicBreak:lT,toml:dT,yaml:dT,definition:dT,footnoteDefinition:dT};function dT(){}var fT=typeof self==`object`?self:globalThis,pT=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new fT[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new fT[a](o),i)};return r},mT=e=>pT(new Map,e)(0),hT=``,{toString:gT}={},{keys:_T}=Object,vT=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=gT.call(e).slice(8,-1);switch(n){case`Array`:return[1,hT];case`Object`:return[2,hT];case`Date`:return[3,hT];case`RegExp`:return[4,hT];case`Map`:return[5,hT];case`Set`:return[6,hT];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},yT=([e,t])=>e===0&&(t===`function`||t===`symbol`),bT=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=vT(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of _T(r))(e||!yT(vT(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(yT(vT(n))||yT(vT(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!yT(vT(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},xT=(e,{json:t,lossy:n}={})=>{let r=[];return bT(!(t||n),!!t,new Map,r)(e),r},ST=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?mT(xT(e,t)):structuredClone(e):(e,t)=>mT(xT(e,t));function CT(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function wT(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function TT(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||CT,r=e.options.footnoteBackLabel||wT,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=oS(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...ST(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
23
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
24
+ `}]}}var ET=(function(e){if(e==null)return jT;if(typeof e==`function`)return AT(e);if(typeof e==`object`)return Array.isArray(e)?DT(e):OT(e);if(typeof e==`string`)return kT(e);throw Error(`Expected function, string, or object as test`)});function DT(e){let t=[],n=-1;for(;++n<e.length;)t[n]=ET(e[n]);return AT(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function OT(e){let t=e;return AT(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function kT(e){return AT(t);function t(t){return t&&t.type===e}}function AT(e){return t;function t(t,n,r){return!!(MT(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function jT(){return!0}function MT(e){return typeof e==`object`&&!!e&&`type`in e}function NT(e){return e}var PT=[];function FT(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=ET(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+NT(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=PT,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=IT(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function IT(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?PT:[e]}function LT(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),FT(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var RT={}.hasOwnProperty,zT={};function BT(e,t){let n=t||zT,r=new Map,i=new Map,a={all:s,applyData:HT,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...uT,...n.handlers},one:o,options:n,patch:VT,wrap:WT};return LT(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(RT.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=ST(n);return r.children=a.all(e),r}return ST(e)}return(a.options.unknownHandler||UT)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=GT(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=GT(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function VT(e,t){e.position&&(t.position=Zb(e))}function HT(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,ST(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function UT(e,t){let n=t.data||{},r=`value`in t&&!(RT.call(n,`hProperties`)||RT.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function WT(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
25
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
26
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
27
+ `}),n}function GT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function KT(e,t){let n=BT(e,t),r=n.one(e,void 0),i=TT(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
28
+ `},i)),a}function qT(e,t){return e&&`run`in e?async function(n,r){let i=KT(n,{file:r,...t});await e.run(i,r)}:function(n,r){return KT(n,{file:r,...e||t})}}function JT(e){if(e)throw e}var YT=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function XT(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function ZT(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?QT(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function QT(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var $T={basename:eE,dirname:tE,extname:nE,join:rE,sep:`/`};function eE(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);oE(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function tE(e){if(oE(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function nE(e){oE(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function rE(...e){let t=-1,n;for(;++t<e.length;)oE(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:iE(n)}function iE(e){oE(e);let t=e.codePointAt(0)===47,n=aE(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function aE(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function oE(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var sE={cwd:cE};function cE(){return`/`}function lE(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function uE(e){if(typeof e==`string`)e=new URL(e);else if(!lE(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return dE(e)}function dE(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var fE=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],pE=class{constructor(e){let t;t=e?lE(e)?{path:e}:typeof e==`string`||_E(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:sE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<fE.length;){let e=fE[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)fE.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?$T.basename(this.path):void 0}set basename(e){hE(e,`basename`),mE(e,`basename`),this.path=$T.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?$T.dirname(this.path):void 0}set dirname(e){gE(this.basename,`dirname`),this.path=$T.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?$T.extname(this.path):void 0}set extname(e){if(mE(e,`extname`),gE(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=$T.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){lE(e)&&(e=uE(e)),hE(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?$T.basename(this.path,this.extname):void 0}set stem(e){hE(e,`stem`),mE(e,`stem`),this.path=$T.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new nx(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function mE(e,t){if(e&&e.includes($T.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+$T.sep+"`")}function hE(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function gE(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function _E(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var vE=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),yE=l(YT(),1),bE={}.hasOwnProperty,xE=new class e extends vE{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=ZT()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,yE.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(wE(`data`,this.frozen),this.namespace[e]=t,this):bE.call(this.namespace,e)&&this.namespace[e]||void 0:e?(wE(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=DE(e),n=this.parser||this.Parser;return SE(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),SE(`process`,this.parser||this.Parser),CE(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=DE(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);kE(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),SE(`processSync`,this.parser||this.Parser),CE(`processSync`,this.compiler||this.Compiler),this.process(e,r),EE(`processSync`,`process`,t),n;function r(e,r){t=!0,JT(e),n=r}}run(e,t,n){TE(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=DE(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),EE(`runSync`,`run`,n),r;function i(e,t){JT(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=DE(t),r=this.compiler||this.Compiler;return CE(`stringify`,r),TE(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(wE(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,yE.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];XT(o)&&XT(r)&&(r=(0,yE.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function SE(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function CE(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function wE(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function TE(e){if(!XT(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function EE(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function DE(e){return OE(e)?e:new pE(e)}function OE(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function kE(e){return typeof e==`string`||AE(e)}function AE(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var jE=[],ME={allowDangerousHtml:!0},NE=/^(https?|ircs?|mailto|xmpp)$/i,PE=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function FE(e){let t=IE(e),n=LE(e);return RE(t.runSync(t.parse(n),n),e)}function IE(e){let t=e.rehypePlugins||jE,n=e.remarkPlugins||jE,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ME}:ME;return xE().use(Nw).use(n).use(qT,r).use(t)}function LE(e){let t=e.children||``,n=new pE;return typeof t==`string`?n.value=t:``+t,n}function RE(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||zE;for(let e of PE)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return LT(e,l),ux(e,{Fragment:V.Fragment,components:i,ignoreInvalidStyle:!0,jsx:V.jsx,jsxs:V.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Mx)if(Object.hasOwn(Mx,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Mx[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function zE(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||NE.test(e.slice(0,t))?e:``}function BE({children:e,className:t}){return(0,V.jsx)(`div`,{className:`markdown-view ${t??``}`,children:(0,V.jsx)(FE,{children:e})})}function VE({sessionId:e,nodeId:t,runStatus:n=`complete`,currentNodeId:r=null,executionTraceSummary:i=null}){let{data:a,isLoading:o,error:s}=qy(e,t);return t?(0,V.jsxs)(`div`,{children:[(0,V.jsx)(HE,{stepLabel:a?.stepLabel??null,nodeId:t}),(0,V.jsxs)(`div`,{className:`p-4 space-y-4`,children:[o&&(0,V.jsx)(`div`,{className:`text-[var(--text-secondary)] text-sm`,children:`Loading...`}),s&&(0,V.jsx)(`div`,{className:`text-[var(--error)] text-sm bg-[var(--bg-primary)] border border-[var(--border)] px-4 py-3`,children:s.message}),a&&(0,V.jsx)(qE,{detail:a,runStatus:n,currentNodeId:r,executionTraceSummary:i})]})]}):(0,V.jsx)(`div`,{className:`px-5 py-8 text-sm text-[var(--text-secondary)]`,children:`Select a node in the lineage to inspect its recap, validations, gaps, and artifacts.`})}function HE({stepLabel:e,nodeId:t}){return(0,V.jsxs)(`div`,{className:`px-5 py-4 border-b border-[var(--border)] console-blueprint-grid`,children:[(0,V.jsx)(`div`,{className:`text-base font-semibold text-[var(--text-primary)] leading-tight`,children:e??`Untitled node`}),(0,V.jsx)(`div`,{className:`mt-1 font-mono text-[11px] text-[var(--text-muted)] truncate`,children:t})]})}function UE({item:e}){return(0,V.jsxs)(`div`,{className:`flex items-start gap-2 text-xs py-1`,children:[(0,V.jsx)(`span`,{className:`flex-1 text-[var(--text-secondary)] leading-relaxed`,children:e.summary}),(0,V.jsxs)(`span`,{className:`font-mono text-[10px] text-[var(--text-muted)] shrink-0`,children:[`#`,e.recordedAtEventIndex]})]})}function WE({nodeId:e,nodeKind:t,executionTraceSummary:n}){let{whySelected:r,conditions:i,loops:a,divergences:o,forks:s}=my(n,e);return n.items.some(t=>t.kind!==`context_fact`&&t.refs.some(t=>t.kind===`node_id`&&t.value===e))?(0,V.jsx)(cD,{title:`Routing context`,children:(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(r.length>0||t===`blocked_attempt`)&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`mb-1.5 flex items-center gap-2`,children:(0,V.jsx)(Fy,{label:`WHY SELECTED`,color:`var(--accent)`,bgColor:`rgba(244,196,48,0.10)`})}),r.length>0?(0,V.jsx)(`div`,{className:`space-y-1 pl-2 border-l border-[var(--border)]`,children:r.map((e,t)=>(0,V.jsx)(UE,{item:e},t))}):t===`blocked_attempt`?(0,V.jsx)(`div`,{className:`pl-2 border-l border-[var(--border)]`,children:(0,V.jsx)(`span`,{className:`text-xs text-[var(--text-muted)]`,children:`This step was attempted but not selected as the preferred path.`})}):null]}),i.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`mb-1.5`,children:(0,V.jsx)(Fy,{label:`CONDITIONS EVALUATED`,color:`var(--text-secondary)`,bgColor:`rgba(168,159,140,0.10)`})}),(0,V.jsx)(`div`,{className:`space-y-1 pl-2 border-l border-[var(--border)]`,children:[...i.filter(e=>!cy(e)),...i.filter(e=>cy(e))].map((e,t)=>{let n=cy(e);return(0,V.jsxs)(`div`,{className:`flex items-start gap-2 text-xs py-0.5`,children:[(0,V.jsx)(Fy,{label:n?`PASS`:`SKIP`,color:n?`var(--success)`:`var(--warning)`,bgColor:n?`rgba(34,197,94,0.10)`:`rgba(251,191,36,0.10)`}),(0,V.jsx)(`span`,{className:`flex-1 text-[var(--text-secondary)] leading-relaxed`,children:e.summary})]},t)})})]}),a.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`mb-1.5`,children:(0,V.jsx)(Fy,{label:`LOOP`,color:`var(--accent-strong)`,bgColor:`rgba(0,240,255,0.10)`})}),(0,V.jsx)(`div`,{className:`space-y-1 pl-2 border-l border-[var(--border)]`,children:a.map((e,t)=>(0,V.jsx)(UE,{item:e},t))})]}),o.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`mb-1.5`,children:(0,V.jsx)(Fy,{label:`DIVERGENCE`,color:`var(--error)`,bgColor:`rgba(255,107,107,0.10)`})}),(0,V.jsx)(`div`,{className:`space-y-1 pl-2 border-l border-[var(--border)]`,children:o.map((e,t)=>(0,V.jsx)(UE,{item:e},t))})]}),s.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`mb-1.5`,children:(0,V.jsx)(Fy,{label:`FORK`,color:`var(--warning)`,bgColor:`rgba(251,191,36,0.10)`})}),(0,V.jsx)(`div`,{className:`space-y-1 pl-2 border-l border-[var(--border)]`,children:s.map((e,t)=>(0,V.jsx)(UE,{item:e},t))})]})]})}):(0,V.jsx)(cD,{title:`Routing context`,children:t===`blocked_attempt`&&r.length===0?(0,V.jsxs)(`div`,{className:`flex items-start gap-2 py-1`,children:[(0,V.jsx)(Fy,{label:`WHY SELECTED`,color:`var(--text-muted)`,bgColor:`rgba(123,141,167,0.08)`}),(0,V.jsx)(`span`,{className:`text-xs text-[var(--text-muted)] leading-relaxed`,children:`This step was attempted but not selected as the preferred path.`})]}):(0,V.jsx)(`span`,{className:`font-mono text-xs text-[var(--text-muted)]`,children:`// no routing trace for this node`})})}function GE({items:e}){let[t,n]=(0,B.useState)(!1);return(0,V.jsx)(cD,{title:`Run routing`,children:(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:()=>n(e=>!e),className:`flex items-center gap-2 font-mono text-[10px] uppercase tracking-[0.20em] text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors`,children:[(0,V.jsx)(Fy,{label:`RUN ROUTING`,color:`var(--text-muted)`,bgColor:`rgba(123,141,167,0.08)`}),(0,V.jsxs)(`span`,{className:`text-[var(--text-muted)]`,children:[`// `,e.length,` ambient items`]}),(0,V.jsx)(`span`,{children:t?`[-]`:`[+]`})]}),t&&(0,V.jsx)(`div`,{className:`mt-2 space-y-1 pl-2 border-l border-[var(--border)]`,children:e.map((e,t)=>(0,V.jsxs)(`div`,{className:`flex items-start gap-2 text-xs py-0.5`,children:[(0,V.jsx)(`span`,{className:`shrink-0 inline-flex items-center px-2 py-0.5 font-mono text-[10px] uppercase tracking-[0.16em]`,style:{color:`var(--text-muted)`,backgroundColor:`rgba(123,141,167,0.08)`,border:`1px solid rgba(123,141,167,0.20)`},children:e.kind.replace(/_/g,` `).toUpperCase()}),(0,V.jsx)(`span`,{className:`flex-1 text-[var(--text-secondary)] leading-relaxed`,children:e.summary}),(0,V.jsxs)(`span`,{className:`font-mono text-[10px] text-[var(--text-muted)] shrink-0`,children:[`#`,e.recordedAtEventIndex]})]},t))})]})})}var KE=[{id:`routing`,column:`primary`,render:({detail:e,executionTraceSummary:t})=>t===null?null:(0,V.jsx)(WE,{nodeId:e.nodeId,nodeKind:e.nodeKind,executionTraceSummary:t},`routing`)},{id:`run_routing`,column:`primary`,render:({executionTraceSummary:e})=>{if(e===null)return null;let t=e.items.filter(e=>!e.refs.some(e=>e.kind===`node_id`));return t.length===0?null:(0,V.jsx)(GE,{items:t},`run_routing`)}},{id:`recap`,column:`primary`,render:({detail:e,runStatus:t,currentNodeId:n})=>e.recapMarkdown?(0,V.jsx)($E,{markdown:e.recapMarkdown},`recap`):t===`in_progress`&&e.nodeId===n&&!e.recapMarkdown?(0,V.jsx)(JE,{detail:e},`recap-in-progress`):null},{id:`validations`,column:`primary`,render:({detail:e})=>e.validations.length>0?(0,V.jsx)(tD,{validations:e.validations},`validations`):null},{id:`gaps`,column:`primary`,render:({detail:e})=>e.gaps.length>0?(0,V.jsx)(rD,{gaps:e.gaps},`gaps`):null},{id:`advance-outcome`,column:`primary`,render:({detail:e})=>e.advanceOutcome?(0,V.jsx)(eD,{outcome:e.advanceOutcome},`advance-outcome`):null},{id:`artifacts`,column:`primary`,render:({detail:e})=>e.artifacts.length>0?(0,V.jsx)(sD,{artifacts:e.artifacts},`artifacts`):null},{id:`node-meta`,column:`primary`,render:({detail:e})=>(0,V.jsx)(QE,{detail:e},`node-meta`)}];function qE(e){return(0,V.jsx)(`div`,{className:`space-y-4`,children:KE.map(t=>t.render(e))})}function JE({detail:e}){return(0,V.jsx)(cD,{title:`Recap`,children:(0,V.jsxs)(`div`,{className:`space-y-4 text-sm text-[var(--text-secondary)]`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(YE,{children:`In progress`}),(0,V.jsxs)(`span`,{className:`font-mono text-xs text-[var(--text-muted)]`,children:[`event #`,e.createdAtEventIndex]})]}),(0,V.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-[minmax(0,1.15fr)_minmax(0,0.85fr)]`,children:[(0,V.jsx)(XE,{label:`Current focus`,value:e.stepLabel??`Current workflow step`,supportingText:`This step is still running, so the recap will appear once execution finishes.`}),(0,V.jsx)(XE,{label:`Current state`,value:`Waiting for step completion`,supportingText:`The node has been created and selected as the current workflow position.`,mono:!0})]}),(0,V.jsxs)(`div`,{className:`bg-[var(--bg-primary)] border border-[var(--border)] overflow-hidden`,children:[(0,V.jsx)(`div`,{className:`px-4 py-3 border-b border-[var(--border)]`,children:(0,V.jsx)(Ko,{children:`What lands here next`})}),(0,V.jsxs)(`div`,{className:`p-4 grid gap-3 md:grid-cols-3`,children:[(0,V.jsx)(ZE,{title:`Recap`,description:`A step summary is written when this node completes.`}),(0,V.jsx)(ZE,{title:`Validations`,description:`Validation results appear if this step records contract checks.`}),(0,V.jsx)(ZE,{title:`Artifacts`,description:`Generated outputs show up here after the step produces them.`})]})]})]})})}function YE({children:e}){return(0,V.jsx)(`span`,{className:`inline-flex items-center px-2 py-1 font-medium text-xs`,style:{backgroundColor:`rgba(0, 219, 233, 0.12)`,color:`var(--accent-strong)`},children:e})}function XE({label:e,value:t,supportingText:n,mono:r=!1}){return(0,V.jsxs)(`div`,{className:`bg-[var(--bg-primary)] border border-[var(--border)] px-4 py-3 space-y-2`,children:[(0,V.jsx)(Ko,{children:e}),(0,V.jsx)(`div`,{className:r?`font-mono text-sm text-[var(--text-primary)]`:`text-[var(--text-primary)]`,children:t}),(0,V.jsx)(`div`,{className:`text-xs text-[var(--text-muted)] leading-relaxed`,children:n})]})}function ZE({title:e,description:t}){return(0,V.jsxs)(`div`,{className:`border border-[var(--border)] bg-[rgba(255,255,255,0.02)] px-3 py-3 space-y-2`,children:[(0,V.jsx)(Ko,{color:`var(--text-secondary)`,children:e}),(0,V.jsx)(`div`,{className:`text-xs text-[var(--text-muted)] leading-relaxed`,children:t})]})}function QE({detail:e}){return(0,V.jsx)(cD,{title:`Node details`,children:(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(lD,{label:`Kind`,value:(0,V.jsx)(dD,{kind:e.nodeKind})}),(0,V.jsx)(lD,{label:`Event index`,value:String(e.createdAtEventIndex),mono:!0}),(0,V.jsx)(lD,{label:`Parent`,value:e.parentNodeId??`Root`,mono:!0}),(0,V.jsx)(lD,{label:`Tip state`,value:e.isTip?e.isPreferredTip?`Preferred tip`:`Tip`:`Historical`})]})})}function $E({markdown:e}){return(0,V.jsx)(cD,{title:`Recap`,children:(0,V.jsx)(BE,{children:e})})}function eD({outcome:e}){let t=e.kind===`advanced`;return(0,V.jsx)(cD,{title:`Advance outcome`,children:(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-xs`,children:[(0,V.jsx)(`span`,{className:`inline-flex items-center px-2 py-1 font-medium`,style:{backgroundColor:t?`var(--success)20`:`var(--blocked)20`,color:t?`var(--success)`:`var(--blocked)`},children:t?`Advanced`:`Blocked`}),(0,V.jsxs)(`span`,{className:`text-[var(--text-muted)]`,children:[`attempt `,e.attemptId.slice(-8),` at event #`,e.recordedAtEventIndex]})]})})}function tD({validations:e}){return(0,V.jsx)(cD,{title:`Validations (${e.length})`,children:(0,V.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>(0,V.jsx)(nD,{validation:e},e.validationId))})})}function nD({validation:e}){let t=e.outcome===`pass`;return(0,V.jsxs)(`div`,{className:`bg-[var(--bg-primary)] border border-[var(--border)] px-4 py-3 text-xs space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`inline-flex items-center px-2 py-1 font-medium`,style:{backgroundColor:t?`var(--success)20`:`var(--error)20`,color:t?`var(--success)`:`var(--error)`},children:t?`Pass`:`Fail`}),(0,V.jsx)(`span`,{className:`text-[var(--text-muted)] font-mono`,children:e.contractRef})]}),e.issues.length>0&&(0,V.jsxs)(`div`,{className:`space-y-1`,children:[(0,V.jsx)(`div`,{className:`text-[var(--text-muted)] mb-1`,children:`Issues`}),(0,V.jsx)(`ul`,{className:`list-disc list-inside text-[var(--error)] space-y-0.5`,children:e.issues.map((e,t)=>(0,V.jsx)(`li`,{children:e},t))})]}),e.suggestions.length>0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[var(--text-muted)] mb-1`,children:`Suggestions`}),(0,V.jsx)(`ul`,{className:`list-disc list-inside text-[var(--text-secondary)] space-y-0.5`,children:e.suggestions.map((e,t)=>(0,V.jsx)(`li`,{children:e},t))})]})]})}function rD({gaps:e}){return(0,V.jsx)(cD,{title:`Gaps (${e.length})`,children:(0,V.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>(0,V.jsxs)(`div`,{className:`flex items-start gap-3 text-xs bg-[var(--bg-primary)] border border-[var(--border)] px-3 py-3`,children:[(0,V.jsx)(`span`,{className:`shrink-0 inline-flex items-center px-2 py-1 font-medium`,style:{backgroundColor:e.isResolved?`var(--success)20`:e.severity===`critical`?`var(--error)20`:`var(--warning)20`,color:e.isResolved?`var(--success)`:e.severity===`critical`?`var(--error)`:`var(--warning)`},children:e.isResolved?`Resolved`:e.severity===`critical`?`Critical`:`Non-critical`}),(0,V.jsx)(`span`,{className:`text-[var(--text-secondary)] leading-relaxed`,children:e.summary})]},e.gapId))})})}var iD=1e5,aD=[{prefix:`text/`,render:e=>(0,V.jsx)(`pre`,{className:`text-[var(--text-secondary)] whitespace-pre-wrap break-words font-mono max-h-40 overflow-y-auto`,children:typeof e==`string`?e:String(e)})},{prefix:`application/json`,render:e=>(0,V.jsx)(`pre`,{className:`text-[var(--text-secondary)] whitespace-pre-wrap break-words font-mono max-h-40 overflow-y-auto`,children:typeof e==`string`?e:JSON.stringify(e,null,2)})}];function oD(e){if(e.byteLength>iD)return(0,V.jsxs)(`div`,{className:`text-[var(--text-muted)] italic`,children:[`Content too large to display (`,fD(e.byteLength),` -- limit `,fD(iD),`)`]});let t=aD.find(t=>e.contentType.startsWith(t.prefix));return t?t.render(e.content):(0,V.jsx)(`pre`,{className:`text-[var(--text-secondary)] whitespace-pre-wrap break-words font-mono max-h-40 overflow-y-auto`,children:typeof e.content==`string`?e.content:JSON.stringify(e.content,null,2)})}function sD({artifacts:e}){return(0,V.jsx)(cD,{title:`Artifacts (${e.length})`,children:(0,V.jsx)(`div`,{className:`space-y-2`,children:e.map(e=>(0,V.jsxs)(`div`,{className:`bg-[var(--bg-primary)] border border-[var(--border)] px-4 py-3 text-xs space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-[var(--text-muted)]`,children:[(0,V.jsx)(`span`,{children:e.contentType}),(0,V.jsx)(`span`,{children:`//`}),(0,V.jsx)(`span`,{children:fD(e.byteLength)})]}),oD(e)]},e.sha256))})})}function cD({title:e,children:t}){return(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`mb-2`,children:(0,V.jsx)(Ko,{children:e})}),t]})}function lD({label:e,value:t,mono:n=!1}){return(0,V.jsxs)(`div`,{className:`bg-[var(--bg-primary)] border border-[var(--border)] px-4 py-3`,children:[(0,V.jsx)(Ko,{children:e}),(0,V.jsx)(`div`,{className:n?`mt-2 font-mono text-sm text-[var(--text-secondary)] truncate`:`mt-2 text-sm text-[var(--text-primary)]`,children:t})]})}var uD={step:{label:`Step`,color:`var(--accent)`},checkpoint:{label:`Checkpoint`,color:`var(--success)`},blocked_attempt:{label:`Blocked`,color:`var(--error)`}};function dD({kind:e}){let t=uD[e];return(0,V.jsx)(`span`,{className:`inline-flex items-center px-2 py-1 font-medium`,style:{backgroundColor:`${t.color}20`,color:t.color},children:t.label})}function fD(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function pD(e){return e.length>16?`\u2026${e.slice(-16)}`:e}function mD({data:e}){let t=e.runs[0]??null,n=t?.workflowName??t?.workflowId??`--`,r=t?.workflowHash?.slice(0,12)??`--`;return(0,V.jsxs)(`div`,{className:`bg-[var(--bg-card)] border border-[var(--border)] px-5 py-4 corner-brackets`,style:{backdropFilter:`blur(12px)`,WebkitBackdropFilter:`blur(12px)`},children:[e.sessionTitle&&(0,V.jsx)(`h2`,{className:`text-base font-medium text-[var(--text-primary)] mb-3`,children:e.sessionTitle}),(0,V.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-8 gap-y-2`,children:[(0,V.jsx)(`dt`,{className:`font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-muted)] self-center`,children:`Session`}),(0,V.jsx)(`dd`,{className:`font-mono text-xs text-[var(--text-secondary)] self-center`,children:pD(e.sessionId)}),(0,V.jsx)(`dt`,{className:`font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-muted)] self-center`,children:`Workflow`}),(0,V.jsx)(`dd`,{className:`text-sm text-[var(--text-primary)] self-center`,children:n}),(0,V.jsx)(`dt`,{className:`font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-muted)] self-center`,children:`Hash`}),(0,V.jsx)(`dd`,{className:`font-mono text-xs text-[var(--text-secondary)] self-center`,children:r}),(0,V.jsx)(`dt`,{className:`font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-muted)] self-center`,children:`Status`}),(0,V.jsxs)(`dd`,{className:`self-center flex items-center gap-2`,children:[(0,V.jsx)(ao,{health:e.health}),e.health===`healthy`&&(0,V.jsx)(`span`,{className:`text-sm text-[var(--text-primary)]`,children:`Healthy`})]}),(0,V.jsx)(`dt`,{className:`font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-muted)] self-center`,children:`Runs`}),(0,V.jsxs)(`dd`,{className:`text-sm text-[var(--text-primary)] self-center`,children:[e.runs.length,` run`,e.runs.length===1?``:`s`]})]})]})}function hD(e){if(e<6e4)return`${Math.round(e/1e3)}s`;let t=Math.floor(e/6e4),n=Math.round(e%6e4/1e3);return n>0?`${t}m ${n}s`:`${t}m`}function gD({sessionId:e,metrics:t}){let[n,r]=(0,B.useState)({kind:`idle`}),i=Jy(e,!1),a=t.startGitSha!==null&&t.endGitSha!==null,o=async()=>{r({kind:`loading`});try{let e=await i.refetch();e.isSuccess&&e.data?r({kind:`loaded`,linesAdded:e.data.linesAdded,linesRemoved:e.data.linesRemoved,filesChanged:e.data.filesChanged}):r({kind:`error`,message:e.error instanceof Error?e.error.message:`Diff computation failed`})}catch(e){r({kind:`error`,message:e instanceof Error?e.message:`Diff computation failed`})}};return(0,V.jsxs)(`div`,{className:`bg-[var(--bg-card)] border border-[var(--border)] px-5 py-4 corner-brackets space-y-4`,style:{backdropFilter:`blur(12px)`,WebkitBackdropFilter:`blur(12px)`},children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-muted)]`,children:`Session Metrics`}),(0,V.jsx)(`span`,{className:`font-mono text-[10px] text-[var(--text-muted)]`,children:`Session-level totals across all runs.`})]}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[t.outcome!==null&&(0,V.jsx)(`span`,{className:`px-2 py-1 text-xs font-mono border border-[var(--border)] text-[var(--text-secondary)] bg-[var(--bg-card)]`,children:t.outcome}),t.durationMs!==void 0&&(0,V.jsx)(`span`,{className:`px-2 py-1 text-xs font-mono border border-[var(--border)] text-[var(--text-secondary)] bg-[var(--bg-card)]`,children:hD(t.durationMs)}),t.filesChanged!==null&&(0,V.jsxs)(`span`,{className:`px-2 py-1 text-xs font-mono border border-[var(--border)] text-[var(--text-secondary)] bg-[var(--bg-card)]`,children:[t.filesChanged,` file`,t.filesChanged===1?``:`s`,` changed`]}),t.captureConfidence!==`none`&&(0,V.jsxs)(`span`,{className:`px-2 py-1 text-xs font-mono border border-[var(--border)] text-[var(--text-muted)] bg-[var(--bg-card)]`,children:[t.captureConfidence,` confidence`]})]}),(0,V.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-8 gap-y-2`,children:[t.gitBranch!==null&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{className:`font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)] self-center`,children:`Git Branch`}),(0,V.jsx)(`dd`,{className:`font-mono text-xs text-[var(--text-secondary)] self-center`,children:t.gitBranch})]}),t.startGitSha!==null&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{className:`font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)] self-center`,children:`Start SHA`}),(0,V.jsx)(`dd`,{className:`font-mono text-xs text-[var(--text-secondary)] self-center`,children:t.startGitSha.slice(0,12)})]}),t.endGitSha!==null&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{className:`font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)] self-center`,children:`End SHA`}),(0,V.jsx)(`dd`,{className:`font-mono text-xs text-[var(--text-secondary)] self-center`,children:t.endGitSha.slice(0,12)})]}),t.durationMs!==void 0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{className:`font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)] self-center`,children:`Duration`}),(0,V.jsx)(`dd`,{className:`font-mono text-xs text-[var(--text-secondary)] self-center`,children:hD(t.durationMs)})]}),t.agentCommitShas.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{className:`font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)] self-start`,children:`Commits`}),(0,V.jsx)(`dd`,{className:`font-mono text-xs text-[var(--text-secondary)]`,children:t.agentCommitShas.map(e=>(0,V.jsx)(`div`,{children:e.slice(0,12)},e))})]}),t.outcome!==null&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{className:`font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)] self-center`,children:`Outcome`}),(0,V.jsxs)(`dd`,{className:`text-xs text-[var(--text-secondary)] self-center`,children:[t.outcome,` `,(0,V.jsx)(`span`,{className:`text-[var(--text-muted)]`,children:`(agent-reported)`})]})]}),t.filesChanged!==null&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{className:`font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)] self-center`,children:`Files Changed`}),(0,V.jsxs)(`dd`,{className:`text-xs text-[var(--text-secondary)] self-center`,children:[t.filesChanged,` `,(0,V.jsx)(`span`,{className:`text-[var(--text-muted)]`,children:`(agent-reported)`})]})]}),t.linesAdded!==null&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{className:`font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)] self-center`,children:`Lines Added`}),(0,V.jsxs)(`dd`,{className:`text-xs text-[var(--text-secondary)] self-center`,children:[t.linesAdded,` `,(0,V.jsx)(`span`,{className:`text-[var(--text-muted)]`,children:`(agent-reported)`})]})]}),t.linesRemoved!==null&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{className:`font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)] self-center`,children:`Lines Removed`}),(0,V.jsxs)(`dd`,{className:`text-xs text-[var(--text-secondary)] self-center`,children:[t.linesRemoved,` `,(0,V.jsx)(`span`,{className:`text-[var(--text-muted)]`,children:`(agent-reported)`})]})]}),t.prNumbers.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{className:`font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)] self-center`,children:`PRs`}),(0,V.jsxs)(`dd`,{className:`text-xs text-[var(--text-secondary)] self-center`,children:[t.prNumbers.join(`, `),` `,(0,V.jsx)(`span`,{className:`text-[var(--text-muted)]`,children:`(agent-reported)`})]})]}),n.kind===`loaded`&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{className:`font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)] self-center`,children:`LOC Added`}),(0,V.jsxs)(`dd`,{className:`text-xs text-[var(--text-secondary)] self-center`,children:[n.linesAdded,` `,(0,V.jsx)(`span`,{className:`text-[var(--text-muted)]`,children:`(git diff)`})]}),(0,V.jsx)(`dt`,{className:`font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)] self-center`,children:`LOC Removed`}),(0,V.jsxs)(`dd`,{className:`text-xs text-[var(--text-secondary)] self-center`,children:[n.linesRemoved,` `,(0,V.jsx)(`span`,{className:`text-[var(--text-muted)]`,children:`(git diff)`})]})]})]}),a&&n.kind!==`loaded`&&(0,V.jsxs)(`div`,{className:`flex items-center gap-3 pt-1`,children:[n.kind===`idle`&&(0,V.jsx)(`button`,{type:`button`,onClick:()=>{o()},className:`font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)] hover:text-[var(--text-primary)] border border-[var(--border)] px-3 py-1.5 transition-colors`,children:`Load diff`}),n.kind===`loading`&&(0,V.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)]`,children:`Computing...`}),n.kind===`error`&&(0,V.jsxs)(`span`,{className:`text-xs text-[var(--error)]`,children:[n.message,` `,(0,V.jsx)(`button`,{type:`button`,onClick:()=>{o()},className:`underline text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors`,children:`Retry`})]})]})]})}function _D({runs:e}){let t=e.some(e=>e.preferredTipNodeId!==null),n=e.some(e=>e.executionTraceSummary!==null);return(0,V.jsxs)(`div`,{className:`border border-[var(--border)] px-4 py-3 text-xs text-[var(--text-muted)] space-y-1`,children:[(0,V.jsx)(`p`,{children:t?`Nodes with a gold border are the current execution tips — click any node to inspect its execution detail.`:`Click any node in the DAG to inspect its execution detail.`}),n&&(0,V.jsxs)(`p`,{children:[`This run has execution trace data. Click`,` `,(0,V.jsx)(`span`,{className:`font-mono uppercase tracking-[0.16em]`,children:`[ TRACE ]`}),` `,`to see why certain steps ran, were skipped, or repeated.`]})]})}function vD({viewModel:e}){let{state:t,onSelectNode:n,onCloseNode:r}=e;if(t.kind===`loading`)return(0,V.jsx)(`div`,{className:`text-[var(--text-secondary)]`,children:`Loading session...`});if(t.kind===`error`)return(0,V.jsxs)(`div`,{className:`text-[var(--error)] bg-[var(--bg-card)] rounded-lg p-4`,children:[`Failed to load session: `,t.message]});let{sessionId:i,data:a,selectedNode:o,selectedRun:s}=t;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsx)(mD,{data:a}),a.metrics!==null&&(0,V.jsx)(gD,{sessionId:i,metrics:a.metrics}),a.runs.length===0?(0,V.jsx)(`div`,{className:`text-center py-16 text-[var(--text-secondary)]`,children:`No runs in this session`}):(0,V.jsxs)(V.Fragment,{children:[o===null&&(0,V.jsx)(_D,{runs:a.runs}),(0,V.jsx)(`div`,{className:`space-y-6`,children:a.runs.map(e=>(0,V.jsx)(yD,{run:e,selectedNodeId:o?.runId===e.runId?o.nodeId:null,onNodeClick:n},e.runId))})]})]}),(0,V.jsxs)(W,{cut:18,borderColor:`rgba(244, 196, 48, 0.35)`,background:`rgba(27, 31, 44, 0.78)`,dropShadow:`drop-shadow(0 16px 48px rgba(0,0,0,0.9)) drop-shadow(0 2px 12px rgba(244,196,48,0.15))`,backdropFilter:`blur(16px)`,className:`fixed top-3 right-3 bottom-3 w-[560px] max-w-[calc(92vw-12px)] transition-transform duration-200 ease-out`,style:{zIndex:40,transform:o?`translateX(0)`:`translateX(calc(100% + 12px))`},children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0 console-blueprint-grid`,children:[(0,V.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-muted)]`,children:`Node detail`}),(0,V.jsx)(`button`,{onClick:r,className:`text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors text-xl leading-none px-1`,"aria-label":`Close`,children:`×`})]}),(0,V.jsx)(`div`,{className:`flex-1 overflow-auto`,children:(0,V.jsx)(VE,{sessionId:i,nodeId:o?.nodeId??null,runStatus:s?.status??`complete`,currentNodeId:s?.preferredTipNodeId??null,executionTraceSummary:s?.executionTraceSummary??null})})]})]})}function yD({run:e,selectedNodeId:t,onNodeClick:n}){let r=e.executionTraceSummary!==null,[i,a]=(0,B.useState)(`dag`);return(0,V.jsxs)(W,{cut:10,background:`rgba(27, 31, 44, 0.72)`,backdropFilter:`blur(8px)`,className:`relative`,style:{height:r?`542px`:`506px`},children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-[var(--border)] shrink-0`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`span`,{className:`text-sm font-medium text-[var(--text-primary)]`,children:e.workflowName??e.workflowId??`Run`}),(0,V.jsx)(`span`,{className:`font-mono text-xs text-[var(--text-muted)]`,children:e.runId}),(0,V.jsxs)(`span`,{className:`font-mono text-xs text-[var(--text-muted)]`,children:[e.nodes.length,` nodes · `,e.tipNodeIds.length,` tip`,e.tipNodeIds.length===1?``:`s`]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.hasUnresolvedCriticalGaps&&(0,V.jsx)(`span`,{className:`text-xs text-[var(--warning)]`,children:`Critical gaps`}),(0,V.jsx)(io,{status:e.status})]})]}),r&&(0,V.jsxs)(`div`,{role:`tablist`,"aria-label":`Run view mode`,className:`flex items-center border-b border-[var(--border)] shrink-0 h-9 px-2 gap-0.5`,onKeyDown:e=>{e.key===`ArrowRight`&&(e.preventDefault(),a(`trace`)),e.key===`ArrowLeft`&&(e.preventDefault(),a(`dag`))},children:[(0,V.jsxs)(`button`,{type:`button`,id:`tab-dag`,role:`tab`,tabIndex:i===`dag`?0:-1,"aria-selected":i===`dag`,onClick:()=>a(`dag`),className:[`tab-btn px-3 py-1.5 font-mono text-[10px] uppercase tracking-[0.25em] transition-colors duration-150`,i===`dag`?`tab-btn--active text-[var(--accent)]`:`text-[var(--text-secondary)] hover:text-[var(--text-primary)]`].join(` `),style:i===`dag`?{backgroundColor:`rgba(244, 196, 48, 0.06)`}:void 0,children:[(0,V.jsx)(`span`,{className:`tab-corner tab-corner--tl`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`tab-corner tab-corner--tr`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`tab-corner tab-corner--bl`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`tab-corner tab-corner--br`,"aria-hidden":`true`}),`DAG`]}),(0,V.jsxs)(`button`,{type:`button`,id:`tab-trace`,role:`tab`,tabIndex:i===`trace`?0:-1,"aria-selected":i===`trace`,onClick:()=>a(`trace`),className:[`tab-btn px-3 py-1.5 font-mono text-[10px] uppercase tracking-[0.25em] transition-colors duration-150`,i===`trace`?`tab-btn--active text-[var(--accent)]`:`text-[var(--text-secondary)] hover:text-[var(--text-primary)]`].join(` `),style:i===`trace`?{backgroundColor:`rgba(244, 196, 48, 0.06)`}:void 0,children:[(0,V.jsx)(`span`,{className:`tab-corner tab-corner--tl`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`tab-corner tab-corner--tr`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`tab-corner tab-corner--bl`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`tab-corner tab-corner--br`,"aria-hidden":`true`}),`TRACE`]})]}),(0,V.jsx)(`div`,{role:`tabpanel`,"aria-labelledby":i===`dag`?`tab-dag`:`tab-trace`,className:`flex-1`,children:i===`trace`&&e.executionTraceSummary!==null?(0,V.jsx)(Vy,{summary:e.executionTraceSummary,runStatus:e.status}):(0,V.jsx)(hy,{run:e,selectedNodeId:t,onNodeClick:t=>n(e.runId,t)})})]})}function bD(){let[e,t]=(0,B.useState)(0),[n,r]=(0,B.useState)(0),[i,a]=(0,B.useState)(38),[o,s]=(0,B.useState)(62),[c,l]=(0,B.useState)(3),[u,d]=(0,B.useState)(2),[f,p]=(0,B.useState)(``),[m,h]=(0,B.useState)(!1),g=(0,B.useRef)(!1),_=(0,B.useRef)(null),v=(0,B.useRef)(null),y=(0,B.useRef)(null),b=(e,n,i,o,c,u)=>{g.current=!0,h(!0),t(e=>e+1),r(Math.floor(Math.random()*4)),a(5+Math.floor(Math.random()*80)),s(5+Math.floor(Math.random()*80)),l(2+Math.floor(Math.random()*40)),d(2+Math.floor(Math.random()*25)),p(i===`horizontal`?n===`next`?`modal-content--exit-h-next`:`modal-content--exit-h-prev`:n===`next`?`modal-content--exit-v-next`:`modal-content--exit-v-prev`),c.current&&(c.current.scrollTop=0);let f=u[e].id;setTimeout(()=>{o(f),p(i===`horizontal`?n===`next`?`modal-content--enter-h-next`:`modal-content--enter-h-prev`:n===`next`?`modal-content--enter-v-next`:`modal-content--enter-v-prev`),h(!1)},80),setTimeout(()=>{if(p(``),g.current=!1,_.current!==null){let e=_.current;_.current=null;let t=e>u.findIndex(e=>e.id===v.current)?`next`:`prev`;y.current?.(e,t,`horizontal`,o,c,u)}},240)};return y.current=b,{state:{isAnimating:g.current,contentAnimClass:f,borderFlashing:m,scanline:e>0?{key:e,crtOffset:n,glitchY:i,glitchY2:o,glitchW:c,glitchW2:u}:null},startTransition:b,navigate:(e,t,n,r,i,a)=>{if(t.length<=1)return;let o=t.findIndex(t=>t.id===e);if(o===-1)return;let s=n===`next`?(o+1)%t.length:(o-1+t.length)%t.length;if(g.current){_.current=s;return}b(s,n,r,i,a,t)},selectedWorkflowIdRef:v}}var xD=[{id:`coding`,label:`Coding`},{id:`review_audit`,label:`Review & Audit`},{id:`investigation`,label:`Investigation`},{id:`design`,label:`Design`},{id:`documentation`,label:`Documentation`},{id:`tickets`,label:`Tickets`},{id:`learning`,label:`Learning`},{id:`authoring`,label:`Workflow Authoring`}],SD=Object.fromEntries(xD.map(e=>[e.id,e.label]));function CD({label:e,count:t,countLabel:n=`workflow`,showRule:r=!0,separator:i=`//`}){return(0,V.jsxs)(`div`,{className:`flex items-center gap-3 mb-3 mt-2`,children:[(0,V.jsxs)(`span`,{className:`font-mono text-[11px] uppercase tracking-[0.30em] text-[var(--text-secondary)] shrink-0`,children:[e,t==null?``:` ${i} ${t} ${n}${t===1?``:`s`}`]}),r&&(0,V.jsx)(`div`,{className:`flex-1 h-px bg-[var(--border)]`})]})}function wD({segments:e,className:t=``}){return(0,V.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:`flex items-center gap-0 ${t}`,children:e.map((t,n)=>{let r=n===e.length-1,i=!!t.onClick;return(0,V.jsxs)(`span`,{className:`flex items-center`,children:[(0,V.jsx)(`span`,{className:`font-mono text-[10px] tracking-[0.25em] text-[var(--text-muted)] mx-1`,children:`//`}),i?(0,V.jsx)(`button`,{type:`button`,onClick:t.onClick,className:`font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors cursor-pointer`,children:t.label.toUpperCase()}):(0,V.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-[0.25em] ${r?`text-[var(--text-secondary)]`:`text-[var(--text-muted)]`}`,"aria-current":r?`page`:void 0,children:t.label.toUpperCase()})]},n)})})}function TD({viewModel:e}){let{state:t}=e;if(t.kind===`not_found`)return(0,V.jsx)(`div`,{className:`space-y-5 max-w-3xl`,children:(0,V.jsx)(jD,{message:``,is404:!0,onRetry:()=>void 0,onBack:t.onBack})});if(t.kind===`error`)return(0,V.jsx)(`div`,{className:`space-y-5 max-w-3xl`,children:(0,V.jsx)(jD,{message:t.message,is404:!1,onRetry:t.onRetry,onBack:t.onBack})});if(t.kind===`loading`){let{cached:e,activeTagLabel:n,onBack:r}=t;return(0,V.jsxs)(`div`,{className:`space-y-5 max-w-3xl`,children:[(0,V.jsx)(wD,{segments:n?[{label:`Workflows`,onClick:r},{label:n}]:[{label:`Workflows`,onClick:r}]}),e?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(ED,{name:e.name,description:e.description,tags:e.tags,source:e.source,stepCount:void 0}),(0,V.jsx)(`div`,{className:`space-y-4`,children:(0,V.jsx)(kD,{})})]}):(0,V.jsx)(AD,{})]})}let{workflow:n,name:r,description:i,tags:a,source:o,activeTagLabel:s,onPrev:c,onNext:l,onBack:u}=t;return(0,V.jsxs)(`div`,{className:`space-y-5 max-w-3xl`,children:[(0,V.jsx)(wD,{segments:s?[{label:`Workflows`,onClick:u},{label:s}]:[{label:`Workflows`,onClick:u}]}),(0,V.jsx)(ED,{name:r,description:i,tags:a,source:o,stepCount:n.stepCount}),(c??l)&&(0,V.jsxs)(`div`,{className:`flex items-center gap-4`,children:[c&&(0,V.jsxs)(`button`,{type:`button`,onClick:c,className:`font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors`,children:[`<`,` PREV`]}),l&&(0,V.jsxs)(`button`,{type:`button`,onClick:l,className:`font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors`,children:[`NEXT `,`>`]})]}),(0,V.jsx)(DD,{detail:n,name:r}),(0,V.jsx)(wD,{segments:[{label:`Workflows`,onClick:u}]})]})}function ED({name:e,description:t,tags:n,source:r,stepCount:i}){return(0,V.jsxs)(`div`,{className:`border border-[var(--border)] px-5 py-5 console-blueprint-grid`,children:[(0,V.jsx)(`p`,{className:`font-mono text-[10px] uppercase tracking-[0.35em] text-[var(--text-muted)] mb-2`,children:`// Workflow`}),(0,V.jsx)(`h2`,{className:`font-mono text-xl font-bold uppercase tracking-[0.08em] leading-tight mb-3`,style:{color:`var(--accent)`,textShadow:`0 0 24px rgba(244,196,48,0.45), 0 0 48px rgba(244,196,48,0.15)`},children:e}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[i!=null&&i>0&&(0,V.jsxs)(`span`,{className:`font-mono text-[10px] px-1.5 py-0.5 border border-[var(--border)] text-[var(--text-secondary)]`,children:[i,` step`,i===1?``:`s`]}),n.filter(e=>e!==`routines`).map(e=>(0,V.jsx)(`span`,{"aria-hidden":`true`,className:`font-mono text-[10px] px-1.5 py-0.5 bg-[var(--bg-secondary)] text-[var(--text-muted)]`,children:e},e)),r&&(0,V.jsxs)(`span`,{"aria-hidden":`true`,className:`font-mono text-[10px] px-1.5 py-0.5 border border-[var(--border)] text-[var(--text-muted)]`,children:[`src: `,r.displayName]})]}),t&&(0,V.jsx)(`p`,{className:`text-sm text-[var(--text-secondary)] leading-relaxed mt-3`,children:t})]})}function DD({detail:e,name:t}){let n=e.about!==void 0&&e.about.length>0,r=e.examples!==void 0&&e.examples.length>0,i=e.preconditions!==void 0&&e.preconditions.length>0;return n||r||i?(0,V.jsxs)(`div`,{className:`space-y-6`,children:[n&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{className:`text-xs font-semibold text-[var(--text-muted)] uppercase tracking-wider mb-3`,children:`About`}),(0,V.jsx)(BE,{children:e.about})]}),r&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{className:`text-xs font-semibold text-[var(--text-muted)] uppercase tracking-wider mb-3`,children:`Try it with:`}),(0,V.jsx)(`ul`,{className:`space-y-2`,children:e.examples.map(e=>(0,V.jsxs)(`li`,{className:`flex items-start gap-3 bg-[var(--bg-card)] border border-[var(--border)] rounded-none px-4 py-3`,children:[(0,V.jsx)(`div`,{"aria-hidden":`true`,className:`w-0.5 shrink-0 self-stretch rounded-full`,style:{backgroundColor:`var(--accent)`}}),(0,V.jsxs)(`span`,{className:`text-sm text-[var(--text-secondary)] leading-relaxed`,children:[`"`,e,`"`]})]},e))})]}),i&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{className:`text-xs font-semibold text-[var(--text-muted)] uppercase tracking-wider mb-3`,children:`Before you start:`}),(0,V.jsx)(`ul`,{className:`space-y-1.5`,children:e.preconditions.map(e=>(0,V.jsxs)(`li`,{className:`flex items-start gap-2 text-sm text-[var(--text-secondary)]`,children:[(0,V.jsx)(`span`,{className:`shrink-0 text-[var(--text-muted)] mt-0.5`,children:`•`}),(0,V.jsx)(`span`,{children:e})]},e))})]}),(0,V.jsx)(OD,{name:t})]}):(0,V.jsx)(`p`,{className:`text-sm text-[var(--text-muted)] italic`,children:`No additional documentation available.`})}function OD({name:e}){let[t,n]=(0,B.useState)(!1),r=`Use the ${e} to [your goal]`;return(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{className:`text-xs font-semibold text-[var(--text-muted)] uppercase tracking-wider mb-3`,children:`Start with this prompt`}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3 border border-[var(--border)] px-4 py-3`,children:[(0,V.jsxs)(`span`,{className:`flex-1 text-sm text-[var(--text-secondary)] font-mono truncate`,children:[`"`,r,`"`]}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>{navigator.clipboard.writeText(r).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)})},className:`shrink-0 text-xs font-mono text-[var(--accent)] hover:text-[var(--text-primary)] transition-colors`,children:t?`Copied!`:`Copy`})]})]})}function kD(){return(0,V.jsxs)(`div`,{className:`space-y-3 motion-safe:animate-pulse`,children:[(0,V.jsx)(`div`,{className:`h-3 w-16 rounded bg-[var(--bg-tertiary)]`}),(0,V.jsx)(`div`,{className:`h-4 w-full rounded bg-[var(--bg-tertiary)]`}),(0,V.jsx)(`div`,{className:`h-4 w-5/6 rounded bg-[var(--bg-tertiary)]`}),(0,V.jsx)(`div`,{className:`h-4 w-4/6 rounded bg-[var(--bg-tertiary)]`})]})}function AD(){return(0,V.jsxs)(`div`,{className:`space-y-6 motion-safe:animate-pulse`,children:[(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(`div`,{className:`h-6 w-1/2 rounded bg-[var(--bg-tertiary)]`}),(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(`div`,{className:`h-5 w-16 rounded bg-[var(--bg-tertiary)]`}),(0,V.jsx)(`div`,{className:`h-5 w-24 rounded bg-[var(--bg-tertiary)]`})]}),(0,V.jsx)(`div`,{className:`h-4 w-full rounded bg-[var(--bg-tertiary)]`})]}),(0,V.jsx)(kD,{})]})}function jD({message:e,is404:t,onRetry:n,onBack:r}){return(0,V.jsxs)(`div`,{className:`space-y-4 bg-[var(--bg-card)] border border-[var(--border)] p-4`,children:[(0,V.jsx)(`p`,{className:`text-sm text-[var(--error)]`,children:t?`Workflow not found.`:e}),(0,V.jsxs)(`div`,{className:`flex gap-3`,children:[!t&&(0,V.jsx)(`button`,{type:`button`,onClick:n,className:`text-sm text-[var(--accent)] hover:text-[var(--accent-hover)] transition-colors`,children:`Try again`}),(0,V.jsxs)(`button`,{type:`button`,onClick:r,"aria-label":`Back to workflows list`,className:`font-mono text-[10px] uppercase tracking-[0.25em] text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors`,children:[`<`,` WORKFLOWS`]})]})]})}function MD(e){if(e.size<2)return 1;let t=new Set;for(let n of e.values())t.add(Math.round(n.getBoundingClientRect().top));if(t.size<2){let t=Math.round(e.get(0)?.getBoundingClientRect().top??0),n=0;for(let r of e.values())Math.round(r.getBoundingClientRect().top)===t&&n++;return Math.max(1,n)}let n=Math.round(e.get(0)?.getBoundingClientRect().top??0),r=0;for(let t of e.values())Math.round(t.getBoundingClientRect().top)===n&&r++;return Math.max(1,r)}function ND(e,t,n,r){if(n===0)return 0;let i=(e??(t>0?-1:n))+t;return r?(i%n+n)%n:Math.max(0,Math.min(n-1,i))}function PD(e,t,n,r,i){if(n===0)return 0;let a=e??0,o=a%r,s=Math.floor(a/r),c=Math.ceil(n/r),l=s+t;l=i?(l%c+c)%c:Math.max(0,Math.min(c-1,l));let u=l*r+o;return Math.min(u,n-1)}function FD({count:e,cols:t=`auto`,onActivate:n,loop:r=!0}){let[i,a]=(0,B.useState)(null),o=(0,B.useRef)(new Map),s=(0,B.useCallback)(e=>{a(e),e!==null&&o.current.get(e)?.focus()},[]),c=(0,B.useCallback)(()=>t===`auto`?MD(o.current):Math.max(1,t),[t]);return{focusedIndex:i,setFocusedIndex:s,getItemProps:(0,B.useCallback)(t=>({tabIndex:i===null?t===0?0:-1:i===t?0:-1,onFocus:()=>{a(t)},onKeyDown:i=>{let a=c(),o=null;switch(i.key){case`ArrowRight`:case`d`:case`D`:o=ND(t,1,e,r);break;case`ArrowLeft`:case`a`:case`A`:o=ND(t,-1,e,r);break;case`ArrowDown`:case`s`:case`S`:o=PD(t,1,e,a,r);break;case`ArrowUp`:case`w`:case`W`:o=PD(t,-1,e,a,r);break;case`Home`:o=0;break;case`End`:o=e-1;break;case`Enter`:case` `:i.preventDefault(),n?.(t);return;default:return}o!==null&&(i.preventDefault(),s(o))},ref:e=>{e?o.current.set(t,e):o.current.delete(t)}}),[i,e,r,c,n,s]),containerProps:{role:`grid`}}}function ID(e){let t=Qy(e),n=()=>{t.refetch()};return t.isLoading?{kind:`loading`}:t.error?t.error instanceof Uy&&t.error.status===404?{kind:`not_found`}:{kind:`error`,message:t.error instanceof Error?t.error.message:`Could not load workflow details.`,refetch:n}:t.data?{kind:`ready`,detail:t.data,refetch:n}:{kind:`loading`}}function LD(){let e=Xy();return{workflows:e.data?.workflows.filter(e=>!e.tags.includes(`routines`)),isLoading:e.isLoading,error:e.error instanceof Error?e.error:null,refetch:e.refetch}}function RD(e,t){if(!e)return{prevWorkflow:null,nextWorkflow:null};let n=t.findIndex(t=>t.id===e);return n===-1?{prevWorkflow:null,nextWorkflow:null}:{prevWorkflow:n>0?t[n-1]??null:null,nextWorkflow:n<t.length-1?t[n+1]??null:null}}function zD({workflowId:e,activeTag:t,onBack:n,onNavigateToWorkflow:r}){let i=ID(e),a=LD().workflows,o=(0,B.useRef)(null),s=(0,B.useRef)(null),c=(0,B.useRef)(r);c.current=r;let l=a??[],{prevWorkflow:u,nextWorkflow:d}=(0,B.useMemo)(()=>RD(e,l),[e,l]),f=u?()=>c.current(u.id):null,p=d?()=>c.current(d.id):null;o.current=f,s.current=p;let m=i.kind===`ready`;return(0,B.useEffect)(()=>{if(!m)return;function e(e){e.metaKey||e.ctrlKey||e.altKey||(e.key===`ArrowLeft`?(e.preventDefault(),o.current?.()):e.key===`ArrowRight`&&(e.preventDefault(),s.current?.()))}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[m]),{state:(0,B.useMemo)(()=>{let r=a?.find(t=>t.id===e)??void 0,o=t?SD[t]??t:null;if(i.kind===`not_found`)return{kind:`not_found`,onBack:n};if(i.kind===`error`)return{kind:`error`,message:i.message,onBack:n,onRetry:i.refetch};if(i.kind===`ready`){let t=i.detail;return{kind:`ready`,workflow:t,name:t.name??r?.name??e??``,description:t.description??r?.description??null,tags:t.tags??r?.tags??[],source:t.source??r?.source??null,activeTagLabel:o,adjacentWorkflows:l,onPrev:f,onNext:p,onBack:n}}return{kind:`loading`,cached:r??null,activeTagLabel:o,onBack:n}},[i,a,e,t,l,f,p,n])}}function BD(e){let t=new Set(xD.map(e=>e.id)),n=new Map,r=[];for(let i of e){let e=i.tags.find(e=>e!==`routines`&&t.has(e));if(e){let t=n.get(e)??[];t.push(i),n.set(e,t)}else r.push(i)}let i=xD.filter(e=>n.has(e.id)).map(e=>({tagId:e.id,label:e.label,workflows:n.get(e.id)}));return r.length>0&&i.push({tagId:null,label:`Other`,workflows:r}),i}function VD({viewModel:e}){let{state:t,dispatch:n,triggerRef:r,onCardSelect:i}=e,a=(0,B.useRef)(null),o=(0,B.useRef)(null),s=bD(),c=t.kind===`ready`?t.selectedWorkflowId:null;if((0,B.useEffect)(()=>{if(c){let e=requestAnimationFrame(()=>a.current?.focus());return()=>cancelAnimationFrame(e)}},[c]),t.kind===`loading`)return(0,V.jsx)(GD,{});if(t.kind===`error`)return(0,V.jsx)(KD,{message:t.message,onRetry:t.onRetry});let{selectedTag:l,selectedSource:u,hintVisible:d,filteredWorkflows:f,flatWorkflows:p,availableSources:m,sourceFilteredWorkflows:h,tagFilteredWorkflows:g}=t,_=new Set(xD.map(e=>e.id)),v=new Set(h.flatMap(e=>e.tags)),y=new Map(xD.map(e=>[e.id,h.filter(t=>t.tags.includes(e.id)).length])),b=h.filter(e=>!e.tags.some(e=>e!==`routines`&&_.has(e))).length,x=h.length,S=g.length;return(0,V.jsx)(HD,{selectedWorkflowId:c,selectedTag:l,selectedSource:u,hintVisible:d,filteredWorkflows:f,flatWorkflows:p,availableSources:m,tagsWithWorkflows:v,countByTag:y,otherCount:b,allTagCount:x,allSourceCount:S,countBySource:new Map(m.map(e=>[e.displayName,g.filter(t=>t.source.displayName===e.displayName).length])),currentIndex:p.findIndex(e=>e.id===c),dispatch:n,onCardSelect:i,triggerRef:r,modalPanelRef:a,scrollRef:o,modalTransition:s})}function HD({selectedWorkflowId:e,selectedTag:t,selectedSource:n,hintVisible:r,filteredWorkflows:i,flatWorkflows:a,availableSources:o,tagsWithWorkflows:s,countByTag:c,otherCount:l,allTagCount:u,allSourceCount:d,countBySource:f,currentIndex:p,dispatch:m,onCardSelect:h,modalPanelRef:g,scrollRef:_,modalTransition:v}){let y=zD({workflowId:e,activeTag:t,onBack:()=>m({type:`modal_closed`}),onNavigateToWorkflow:e=>m({type:`workflow_selected`,id:e})}),b=(0,B.useCallback)((t,n)=>{v.navigate(e,a,t,n,e=>{m({type:`workflow_selected`,id:e}),v.selectedWorkflowIdRef.current=e},_)},[a,e,v,m,_]);(0,B.useEffect)(()=>{if(!e)return;let t=[`ArrowLeft`,`ArrowRight`,`a`,`A`,`d`,`D`],n=[`ArrowUp`,`ArrowDown`,`w`,`W`,`s`,`S`],r=e=>{if(n.includes(e.key)){e.preventDefault(),e.stopPropagation();return}t.includes(e.key)&&(e.preventDefault(),e.stopPropagation(),b([`ArrowLeft`,`a`,`A`].includes(e.key)?`prev`:`next`,`horizontal`))};return document.addEventListener(`keydown`,r,{capture:!0}),()=>{document.removeEventListener(`keydown`,r,{capture:!0})}},[e,b]);let{getItemProps:x,containerProps:S}=FD({count:a.length,cols:`auto`,onActivate:(0,B.useCallback)(e=>{let t=a[e];if(!t)return;let n=document.activeElement;n instanceof HTMLButtonElement&&h(t.id,n)},[a,h])});return(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h1`,{className:`font-mono text-2xl font-bold uppercase tracking-[0.12em] leading-none`,style:{color:`var(--accent)`,textShadow:`0 0 28px rgba(244,196,48,0.35)`},children:`Workflows`}),(0,V.jsxs)(`p`,{className:`font-mono text-[10px] tracking-[0.25em] text-[var(--text-muted)] mt-1.5`,children:[`// `,i.length,` available`]})]}),(0,V.jsxs)(`div`,{role:`group`,"aria-label":`Filter workflows by category`,className:`flex flex-wrap gap-1.5`,children:[(0,V.jsx)(UD,{label:`All`,count:u,isActive:t===null,disabled:!1,onClick:()=>m({type:`tag_changed`,tag:null})}),xD.filter(e=>s.has(e.id)).map(e=>(0,V.jsx)(UD,{label:e.label,count:c.get(e.id)??0,isActive:t===e.id,disabled:!1,onClick:()=>m({type:`tag_changed`,tag:t===e.id?null:e.id})},e.id)),l>0&&(0,V.jsx)(UD,{label:`Other`,count:l,isActive:t===`__other__`,disabled:!1,onClick:()=>m({type:`tag_changed`,tag:t===`__other__`?null:`__other__`})})]}),o.length>1&&(0,V.jsxs)(`div`,{role:`group`,"aria-label":`Filter workflows by source`,className:`flex flex-wrap gap-1.5`,children:[(0,V.jsx)(UD,{label:`All Sources`,count:d,isActive:n===null,disabled:!1,onClick:()=>m({type:`source_changed`,source:null})}),o.map(e=>(0,V.jsx)(UD,{label:e.displayName,count:f.get(e.displayName)??0,isActive:n===e.displayName,disabled:!1,onClick:()=>m({type:`source_changed`,source:n===e.displayName?null:e.displayName})},e.id))]}),i.length===0?(0,V.jsxs)(`div`,{className:`py-8 text-center space-y-3`,children:[(0,V.jsx)(`p`,{className:`text-sm text-[var(--text-muted)]`,children:`No workflows in this category.`}),t!==null&&(0,V.jsx)(`button`,{type:`button`,onClick:()=>m({type:`tag_changed`,tag:null}),className:`text-sm text-[var(--accent)] hover:text-[var(--accent-hover)] transition-colors`,children:`Clear filter`})]}):t===null?(0,V.jsx)(`div`,{className:`space-y-6`,children:(()=>{let t=0;return BD(i).map(n=>(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(CD,{label:n.label,count:n.workflows.length,showRule:!0}),(0,V.jsx)(`div`,{...S,className:`grid grid-cols-2 lg:grid-cols-3 gap-3`,children:n.workflows.map(n=>(0,V.jsx)(WD,{workflow:n,onSelect:e=>h(n.id,e),navProps:x(t++),isActive:n.id===e},n.id))})]},n.tagId??`__other__`))})()}):(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(CD,{label:t===`__other__`?`Other`:SD[t]??t,count:i.length,showRule:!0}),(0,V.jsx)(`div`,{...S,className:`grid grid-cols-2 lg:grid-cols-3 gap-3`,children:i.map((t,n)=>(0,V.jsx)(WD,{workflow:t,onSelect:e=>h(t.id,e),navProps:x(n),isActive:t.id===e},t.id))})]}),(0,V.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-end justify-center p-4 pointer-events-none`,"aria-hidden":!e,children:[e&&(0,V.jsx)(`div`,{className:`absolute inset-0 pointer-events-auto`,style:{background:`rgba(0,0,0,0.22)`,backdropFilter:`blur(2px)`},onClick:()=>m({type:`modal_closed`})}),(0,V.jsx)(`div`,{ref:g,tabIndex:-1,role:`dialog`,"aria-modal":`true`,"aria-label":`Workflow detail${e?`: ${a.find(t=>t.id===e)?.name??``}`:``}`,className:`relative w-full max-w-3xl ${e?`pointer-events-auto`:`pointer-events-none`}${v.state.borderFlashing?` modal-border-flashing`:``}`,style:{height:`85vh`,transform:e?`translateY(0) scale(1)`:`translateY(24px) scale(0.97)`,opacity:+!!e,transition:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`opacity 150ms ease-out`:`transform 250ms ease-out, opacity 250ms ease-out`,backdropFilter:`blur(2px)`,WebkitBackdropFilter:`blur(2px)`},children:(0,V.jsxs)(W,{cut:20,borderColor:`rgba(244, 196, 48, 0.45)`,background:`rgba(15, 19, 31, 0.50)`,dropShadow:`drop-shadow(0 4px 24px rgba(244,196,48,0.15))`,className:`h-full flex flex-col`,children:[v.state.scanline!==null&&(0,V.jsx)(`div`,{className:`modal-scanline`,"aria-hidden":`true`,style:{"--crt-offset":`${v.state.scanline.crtOffset}px`,"--glitch-y":`${v.state.scanline.glitchY}%`,"--glitch-y2":`${v.state.scanline.glitchY2}%`,"--glitch-w":`${v.state.scanline.glitchW}px`,"--glitch-w2":`${v.state.scanline.glitchW2}px`,clipPath:co(20)}},v.state.scanline.key),(0,V.jsxs)(`div`,{className:`flex items-center justify-between px-6 py-4 border-b border-[var(--border)] shrink-0 console-blueprint-grid`,style:{background:`rgba(15, 19, 31, 0.55)`},children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,V.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-[0.30em] text-[var(--text-secondary)]`,children:`Workflow`}),p>=0&&(0,V.jsxs)(`span`,{className:`font-mono text-[10px] tracking-[0.20em] text-[var(--text-secondary)]`,children:[`[ `,p+1,` / `,a.length,` ]`]}),(0,V.jsx)(`span`,{className:`font-mono text-[9px] tracking-[0.15em] text-[var(--text-secondary)] transition-opacity duration-600`,style:{opacity:r?.5:0},"aria-hidden":`true`,children:`[ A / D ] NAV`})]}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>m({type:`modal_closed`}),className:`text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors text-xl leading-none`,"aria-label":`Close`,children:`×`})]}),(0,V.jsxs)(`div`,{ref:_,className:`flex-1 overflow-auto overscroll-contain px-6 py-5 ${v.state.contentAnimClass}`,style:{"--text-muted":`var(--text-secondary)`},children:[(0,V.jsx)(`div`,{"aria-live":`polite`,"aria-atomic":`true`,className:`sr-only`,children:a.find(t=>t.id===e)?.name??``}),e&&(0,V.jsx)(TD,{viewModel:y})]})]})})]})]})}function UD({label:e,count:t,isActive:n,disabled:r,onClick:i}){return(0,V.jsxs)(`button`,{type:`button`,onClick:i,disabled:r,"aria-pressed":n,className:[`px-3 py-2 min-w-[44px] min-h-[44px] rounded-none text-xs font-medium transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-2`,`disabled:opacity-50 disabled:cursor-not-allowed`,n?`border border-[var(--accent)] text-[var(--accent)] bg-transparent`:`text-[var(--text-muted)] hover:text-[var(--text-secondary)] hover:bg-[var(--bg-card)]`].join(` `),children:[e,` · `,t,n&&(0,V.jsx)(`span`,{className:`sr-only`,children:`(selected)`})]})}function WD({workflow:e,onSelect:t,navProps:n,isActive:r}){let i=e.tags.filter(e=>e!==`routines`).map(e=>SD[e]??e);return(0,V.jsx)(lo,{variant:`grid`,onClick:e=>t(e.currentTarget),"aria-label":[e.name,e.description,i.length>0?`Tag: ${i.join(`, `)}`:null,`Source: ${e.source.displayName}`].filter(Boolean).join(`. `),style:r?{borderColor:`var(--accent)`,boxShadow:`0 0 0 1px rgba(244,196,48,0.4), 0 0 16px rgba(244,196,48,0.12)`}:void 0,...n,children:(0,V.jsxs)(`div`,{className:`flex flex-col flex-1 p-4 gap-2 min-w-0`,children:[(0,V.jsx)(`p`,{className:`text-sm font-medium text-[var(--text-primary)] group-hover:text-[var(--accent)] transition-colors leading-snug line-clamp-2`,children:e.name}),(0,V.jsx)(`p`,{className:`text-xs text-[var(--text-secondary)] line-clamp-3 leading-relaxed flex-1`,children:e.description}),(0,V.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mt-auto pt-2 border-t border-[var(--border)]`,children:[(0,V.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.slice(0,1).map(e=>(0,V.jsx)(`span`,{className:`font-mono text-[9px] px-1.5 py-0.5 bg-[var(--bg-secondary)] text-[var(--text-muted)]`,children:e},e))}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[e.stepCount!=null&&e.stepCount>0&&(0,V.jsxs)(`span`,{className:`font-mono text-[9px] text-[var(--text-muted)]`,children:[e.stepCount,`s`]}),(0,V.jsxs)(`span`,{className:`font-mono text-[9px] text-[var(--text-muted)] max-w-[80px] truncate`,children:[`src: `,e.source.displayName]})]})]})]})})}function GD(){return(0,V.jsx)(`div`,{className:`space-y-6 motion-safe:animate-pulse`,children:[0,1].map(e=>(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,V.jsx)(`div`,{className:`h-3 w-24 bg-[var(--bg-tertiary)]`}),(0,V.jsx)(`div`,{className:`flex-1 h-px bg-[var(--bg-tertiary)]`})]}),(0,V.jsx)(`div`,{className:`grid grid-cols-2 lg:grid-cols-3 gap-3`,children:[0,1,2,3,4,5].map(e=>(0,V.jsxs)(`div`,{className:`min-h-[160px] bg-[var(--bg-card)] border border-[var(--border)] flex flex-col`,children:[(0,V.jsx)(`div`,{className:`h-[3px] bg-[var(--bg-tertiary)]`}),(0,V.jsxs)(`div`,{className:`p-4 flex flex-col gap-2 flex-1`,children:[(0,V.jsx)(`div`,{className:`h-4 w-3/4 bg-[var(--bg-tertiary)]`}),(0,V.jsx)(`div`,{className:`h-3 w-full bg-[var(--bg-tertiary)]`}),(0,V.jsx)(`div`,{className:`h-3 w-5/6 bg-[var(--bg-tertiary)]`}),(0,V.jsxs)(`div`,{className:`mt-auto pt-2 border-t border-[var(--border)] flex justify-between`,children:[(0,V.jsx)(`div`,{className:`h-3 w-12 bg-[var(--bg-tertiary)]`}),(0,V.jsx)(`div`,{className:`h-3 w-16 bg-[var(--bg-tertiary)]`})]})]})]},e))})]},e))})}function KD({message:e,onRetry:t}){return(0,V.jsxs)(`div`,{className:`space-y-3 py-8 text-center`,children:[(0,V.jsx)(`p`,{className:`text-sm text-[var(--error)]`,children:e}),(0,V.jsx)(`button`,{type:`button`,onClick:t,className:`text-sm text-[var(--accent)] hover:text-[var(--accent-hover)] transition-colors`,children:`Try again`})]})}var qD=[{value:`recent`,label:`Recent first`,compareFn:(e,t)=>t.startedAtMs-e.startedAtMs},{value:`slowest`,label:`Slowest first`,compareFn:(e,t)=>t.durationMs-e.durationMs}],JD={success:{color:`var(--success)`,label:`OK`,isError:!1},error:{color:`var(--error)`,label:`Error`,isError:!0},unknown_tool:{color:`var(--warning)`,label:`Unknown`,isError:!0}};function YD(e,t){let n=qD.find(e=>e.value===t);return[...e].sort(n.compareFn)}function XD(e){return e.reduce((e,t)=>Math.max(e,t.durationMs),0)}function ZD(e){return e.filter(e=>JD[e.outcome].isError).length}function QD(e){return e.length===0?null:Math.round(e.reduce((e,t)=>e+t.durationMs,0)/e.length)}function $D(e){return e.length===0?null:e.reduce((e,t)=>Math.max(e,t.startedAtMs),0)}function eO(e,t){return t>0?Math.round(e/t*120):0}function tO(e){return`${e} recorded`}var nO=[{key:`tool`,label:`Tool`,minWidth:`180px`},{key:`duration`,label:`Duration`,width:`220px`},{key:`started`,label:`Started`,width:`100px`},{key:`outcome`,label:`Outcome`}];function rO({viewModel:e}){let{state:t}=e;if(t.kind===`loading`)return(0,V.jsx)(sO,{});if(t.kind===`devModeOff`)return(0,V.jsx)(`div`,{className:`flex items-center justify-center py-16`,children:(0,V.jsx)(`p`,{className:`text-sm text-[var(--text-muted)] text-center`,children:`nothing to see here`})});if(t.kind===`error`)return(0,V.jsxs)(`div`,{className:`space-y-3 py-8 text-center`,children:[(0,V.jsx)(`p`,{className:`text-sm text-[var(--error)]`,children:t.message}),(0,V.jsx)(`button`,{type:`button`,onClick:t.retry,className:`text-sm text-[var(--accent)] hover:text-[var(--accent-hover)] transition-colors`,children:`Try again`})]});let{sorted:n,maxDuration:r,errorCount:i,avgMs:a,lastCallMs:o,countLabel:s,sortOrder:c,onSortChange:l}=t;return(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`p`,{className:`text-sm text-[var(--text-secondary)]`,children:[s,` | `,(0,V.jsxs)(`span`,{style:{color:i>0?`var(--error)`:`var(--text-muted)`},children:[i,` errors`]}),` | `,`avg `,a===null?`--`:`${a}ms`,` | `,`last call `,o===null?`no calls yet`:fo(o)]}),(0,V.jsx)(`div`,{role:`radiogroup`,"aria-label":`Sort order`,className:`flex items-center gap-1`,children:qD.map(e=>(0,V.jsx)(oO,{label:e.label,isActive:c===e.value,onClick:()=>l(e.value)},e.value))}),(0,V.jsxs)(`table`,{className:`w-full text-sm border-collapse`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsx)(`tr`,{className:`text-xs text-[var(--text-muted)] border-b border-[var(--border)]`,children:nO.map(e=>(0,V.jsx)(`th`,{scope:`col`,className:`text-left py-2 pr-4 font-medium`,style:{width:e.width,minWidth:e.minWidth},children:e.label},e.key))})}),(0,V.jsx)(`tbody`,{children:n.length===0?(0,V.jsx)(`tr`,{children:(0,V.jsx)(`td`,{colSpan:nO.length,className:`py-8 text-center text-sm text-[var(--text-muted)]`,children:`No tool calls recorded yet. Run a workflow to see timing data.`})}):n.map((e,t)=>(0,V.jsx)(iO,{obs:e,maxDuration:r},`${e.startedAtMs}-${e.toolName}-${t}`))})]})]})}function iO({obs:e,maxDuration:t}){let n=JD[e.outcome].isError,r=eO(e.durationMs,t);return(0,V.jsxs)(`tr`,{className:`border-b border-[var(--border)] hover:bg-[var(--bg-card)] transition-colors`,style:{borderLeft:n?`2px solid var(--error)`:`2px solid transparent`},children:[(0,V.jsx)(`td`,{className:`py-2 pr-4 font-mono text-[var(--text-primary)] overflow-hidden text-ellipsis`,title:e.toolName,style:{minWidth:`180px`,maxWidth:`240px`},children:(0,V.jsx)(`span`,{className:`block truncate`,children:e.toolName})}),(0,V.jsxs)(`td`,{className:`py-2 pr-4`,style:{width:`220px`},children:[(0,V.jsxs)(`span`,{className:`font-mono text-[var(--text-primary)]`,children:[e.durationMs,`ms`]}),(0,V.jsx)(`div`,{"aria-hidden":`true`,className:`h-1 rounded mt-1`,style:{backgroundColor:`var(--accent)`,width:`${r}px`,maxWidth:`120px`}})]}),(0,V.jsx)(`td`,{className:`py-2 pr-4 text-[var(--text-secondary)]`,style:{width:`100px`},children:fo(e.startedAtMs)}),(0,V.jsx)(`td`,{className:`py-2`,children:(0,V.jsx)(aO,{outcome:e.outcome})})]})}function aO({outcome:e}){let t=JD[e];return(0,V.jsx)(`span`,{className:`inline-block px-2 py-0.5 rounded text-xs font-medium`,style:{color:t.color,backgroundColor:`color-mix(in srgb, ${t.color} 12%, transparent)`},children:t.label})}function oO({label:e,isActive:t,onClick:n}){return(0,V.jsx)(`button`,{type:`button`,role:`radio`,onClick:n,"aria-checked":t,className:[`px-3 py-2 rounded text-xs font-medium min-w-[44px] transition-colors`,t?`text-[var(--text-primary)]`:`text-[var(--text-muted)] hover:text-[var(--text-secondary)]`].join(` `),children:e})}function sO(){return(0,V.jsxs)(`div`,{className:`space-y-3 animate-pulse`,"aria-busy":`true`,"aria-label":`Loading performance data`,children:[(0,V.jsx)(`div`,{className:`h-4 w-64 rounded bg-[var(--bg-tertiary)]`}),(0,V.jsxs)(`div`,{className:`flex gap-1`,children:[(0,V.jsx)(`div`,{className:`h-8 w-24 rounded bg-[var(--bg-tertiary)]`}),(0,V.jsx)(`div`,{className:`h-8 w-24 rounded bg-[var(--bg-tertiary)]`})]}),(0,V.jsxs)(`div`,{className:`flex gap-4 border-b border-[var(--border)] pb-2`,children:[(0,V.jsx)(`div`,{className:`h-3 w-20 rounded bg-[var(--bg-tertiary)]`}),(0,V.jsx)(`div`,{className:`h-3 w-16 rounded bg-[var(--bg-tertiary)]`}),(0,V.jsx)(`div`,{className:`h-3 w-14 rounded bg-[var(--bg-tertiary)]`}),(0,V.jsx)(`div`,{className:`h-3 w-14 rounded bg-[var(--bg-tertiary)]`})]}),Array.from({length:8}).map((e,t)=>(0,V.jsxs)(`div`,{className:`flex gap-4 py-2`,children:[(0,V.jsx)(`div`,{className:`h-4 rounded bg-[var(--bg-tertiary)]`,style:{minWidth:`180px`,width:`180px`}}),(0,V.jsxs)(`div`,{className:`space-y-1`,style:{width:`220px`},children:[(0,V.jsx)(`div`,{className:`h-4 w-16 rounded bg-[var(--bg-tertiary)]`}),(0,V.jsx)(`div`,{className:`h-1 w-20 rounded bg-[var(--bg-tertiary)]`})]}),(0,V.jsx)(`div`,{className:`h-4 w-16 rounded bg-[var(--bg-tertiary)]`,style:{width:`100px`}}),(0,V.jsx)(`div`,{className:`h-5 w-12 rounded bg-[var(--bg-tertiary)]`})]},t))]})}var cO=`workrail:auto:mru-workflow`;function lO(){try{return localStorage.getItem(cO)}catch{return null}}function uO(e){try{localStorage.setItem(cO,e)}catch{}}function dO(){let e=Xy(),t=$y(),n=e.data?.workflows??[],r=t.data?.triggers??[],[i,a]=(0,B.useState)(()=>lO()??``),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(``),[u,d]=(0,B.useState)(!1),[f,p]=(0,B.useState)(null),[m,h]=(0,B.useState)(!1),[g,_]=(0,B.useState)(!0),v=(0,B.useRef)(null);(0,B.useEffect)(()=>{!i&&n.length>0&&a(n[0]?.id??``)},[i,n]);let y=e=>{a(e),uO(e)},b=async()=>{if(!(!i||!c.trim()||!o.trim())){d(!0),p(null),h(!1);try{await eb({workflowId:i,goal:c.trim(),workspacePath:o.trim()}),h(!0),l(``),setTimeout(()=>v.current?.focus(),100)}catch(e){p(e instanceof Error?e.message:`Dispatch failed`)}finally{d(!1)}}},x=!!i&&!!c.trim()&&!!o.trim()&&!u;return(0,V.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,V.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,V.jsx)(Ko,{color:`var(--accent)`,children:`Dispatch`})}),(0,V.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,V.jsx)(Ko,{children:`Workflow`}),e.isLoading?(0,V.jsx)(`div`,{className:`text-[var(--text-muted)] text-xs`,children:`Loading workflows...`}):n.length===0?(0,V.jsx)(`div`,{className:`text-[var(--text-muted)] text-xs`,children:`No workflows available`}):(0,V.jsx)(`select`,{value:i,onChange:e=>y(e.target.value),className:`w-full bg-[var(--bg-secondary)] border border-[var(--border)] rounded-md px-3 py-2 text-sm text-[var(--text-primary)] focus:outline-none focus:border-[var(--accent)] cursor-pointer`,children:n.map(e=>(0,V.jsx)(`option`,{value:e.id,children:e.name??e.id},e.id))})]}),(0,V.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,V.jsx)(Ko,{children:`Workspace path`}),(0,V.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),placeholder:`/path/to/repo`,className:`w-full bg-[var(--bg-secondary)] border border-[var(--border)] rounded-md px-3 py-2 text-sm font-mono text-[var(--text-primary)] placeholder-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]`})]}),(0,V.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,V.jsx)(Ko,{children:`Goal`}),(0,V.jsx)(`textarea`,{ref:v,value:c,onChange:e=>l(e.target.value),placeholder:`// describe the task...`,rows:4,className:`w-full bg-[var(--bg-secondary)] border border-[var(--border)] rounded-md px-3 py-2 text-sm font-mono text-[var(--text-primary)] placeholder-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)] resize-y`,onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&e.key===`Enter`&&x&&(e.preventDefault(),b())}})]}),(0,V.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,V.jsx)(`button`,{onClick:()=>void b(),disabled:!x,className:`self-start disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer`,children:(0,V.jsx)(no,{label:u?`RUNNING...`:`RUN`,color:x?`var(--accent)`:void 0,pulse:u})}),m&&(0,V.jsx)(`div`,{className:`text-[var(--success)] font-mono text-[10px] uppercase tracking-[0.20em]`,children:`Dispatched -- check Queue pane`}),f&&(0,V.jsx)(`div`,{className:`text-[var(--error)] text-xs font-mono`,children:f})]}),(0,V.jsxs)(`div`,{className:`border-t border-[var(--border)] pt-4`,children:[(0,V.jsxs)(`button`,{onClick:()=>_(!g),className:`flex items-center gap-2 mb-2 cursor-pointer group`,children:[(0,V.jsx)(`span`,{className:`text-[var(--text-muted)] text-xs transition-transform duration-150`,style:{transform:g?`rotate(-90deg)`:`rotate(0deg)`},children:`▼`}),(0,V.jsx)(no,{label:`TRIGGERS`,color:`var(--text-secondary)`}),r.length>0&&(0,V.jsxs)(`span`,{className:`text-xs text-[var(--text-muted)]`,children:[`(`,r.length,`)`]})]}),!g&&(0,V.jsx)(`div`,{className:`space-y-2`,children:t.isLoading?(0,V.jsx)(`div`,{className:`text-[var(--text-muted)] text-xs pl-4`,children:`Loading triggers...`}):r.length===0?(0,V.jsx)(`div`,{className:`text-[var(--text-muted)] text-xs pl-4`,children:`No triggers configured. Set WORKRAIL_TRIGGERS_ENABLED=true and create triggers.yml.`}):r.map(e=>(0,V.jsxs)(`div`,{className:`pl-4 border-l-2 border-[var(--border)] text-xs space-y-0.5`,children:[(0,V.jsx)(`div`,{className:`font-mono text-[var(--text-primary)] text-[11px]`,children:e.id}),(0,V.jsx)(`div`,{className:`text-[var(--text-muted)]`,children:e.workflowId}),(0,V.jsx)(`div`,{className:`text-[var(--text-muted)] truncate`,children:e.goal})]},e.id))})]})]})}function fO(e){let t=0,n=0,r=0;for(let i of e)i.status===`in_progress`?t++:i.status===`blocked`?n++:(i.status===`complete`||i.status===`complete_with_gaps`)&&r++;return{running:t,blocked:n,completed:r}}function pO(){let{data:e,isLoading:t,isError:n}=Gy(),r=(e?.sessions??[]).filter(e=>e.isAutonomous),{running:i,blocked:a,completed:o}=fO(r);return t?(0,V.jsx)(`div`,{className:`flex items-center justify-center py-20`,children:(0,V.jsx)(`div`,{className:`text-[var(--text-secondary)] text-sm`,children:`Loading sessions...`})}):n?(0,V.jsx)(`div`,{className:`text-[var(--error)] bg-[var(--bg-card)] rounded-lg p-4 text-sm`,children:`Failed to load sessions`}):(0,V.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,V.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,V.jsx)(Ko,{color:`var(--accent)`,children:`Queue`})}),(0,V.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap`,children:[(0,V.jsx)(mO,{count:i,label:`RUNNING`,color:`var(--accent)`,pulse:!0}),(0,V.jsx)(mO,{count:a,label:`BLOCKED`,color:`var(--blocked)`}),(0,V.jsx)(mO,{count:o,label:`COMPLETED`,color:`var(--success)`})]}),r.length===0?(0,V.jsxs)(`div`,{className:`text-center py-16`,children:[(0,V.jsx)(`p`,{className:`text-[var(--text-secondary)] text-sm`,children:`No autonomous sessions yet`}),(0,V.jsx)(`p`,{className:`text-[var(--text-muted)] text-xs mt-1`,children:`Dispatch a workflow from the left pane to start.`})]}):(0,V.jsx)(`div`,{className:`space-y-2`,children:r.map(e=>(0,V.jsx)(hO,{session:e},e.sessionId))})]})}function mO({count:e,label:t,color:n,pulse:r}){return(0,V.jsx)(no,{label:`${e} ${t}`,color:e>0?n:`var(--text-muted)`,pulse:r&&e>0})}function hO({session:e}){let[t,n]=(0,B.useState)(!1),r=wi(),i=e.sessionTitle??e.workflowName??e.workflowId??`Unnamed session`,a=fo(e.lastModifiedMs);return(0,V.jsxs)(`div`,{className:`bg-[var(--bg-card)] border border-[var(--border)] rounded-lg overflow-hidden`,children:[(0,V.jsxs)(`button`,{onClick:()=>n(!t),className:`w-full px-4 py-3 flex items-center gap-3 text-left cursor-pointer hover:bg-[var(--bg-secondary)] transition-colors group`,children:[(0,V.jsx)(`span`,{className:`text-[var(--text-muted)] text-xs transition-transform duration-150 shrink-0`,style:{transform:t?`rotate(90deg)`:`rotate(0deg)`},children:`▶`}),(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsx)(`div`,{className:`text-sm font-medium text-[var(--text-primary)] truncate group-hover:text-[var(--accent)] transition-colors`,children:i}),(0,V.jsx)(`div`,{className:`font-mono text-[10px] text-[var(--text-muted)] opacity-60 truncate`,children:e.sessionId})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,V.jsx)(`span`,{className:`text-[10px] text-[var(--text-muted)] tabular-nums`,children:a}),e.isLive&&(0,V.jsx)(no,{label:`LIVE`,pulse:!0,color:`var(--accent)`,"aria-label":`Actively running`}),(0,V.jsx)(io,{status:e.status})]})]}),t&&(0,V.jsxs)(`div`,{className:`px-4 pb-4 border-t border-[var(--border)] pt-3 space-y-3`,children:[e.recapSnippet?(0,V.jsx)(`div`,{className:`text-xs text-[var(--text-secondary)] font-mono whitespace-pre-wrap leading-relaxed`,children:e.recapSnippet}):(0,V.jsx)(`div`,{className:`text-xs text-[var(--text-muted)]`,children:`No recap available yet.`}),(0,V.jsx)(`button`,{onClick:()=>void r({to:`/session/$sessionId`,params:{sessionId:e.sessionId}}),className:`cursor-pointer`,children:(0,V.jsx)(no,{label:`OPEN IN DAG`,color:`var(--accent)`})})]})]})}function gO(){return(0,V.jsxs)(`div`,{className:`flex flex-col md:flex-row gap-6`,children:[(0,V.jsx)(`div`,{className:`w-full md:w-2/5 shrink-0`,children:(0,V.jsx)(dO,{})}),(0,V.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,V.jsx)(pO,{})})]})}function _O(){let e=Gy(),t=Yy();tb();let n=e.data?.sessions;return{sessions:n,worktreeRepos:t.data?.repos??[],isLoading:e.isLoading,error:e.error instanceof Error?e.error:null,refetch:e.refetch,worktreesFetching:t.isFetching,liveCount:n?.filter(e=>e.status===`in_progress`).length??0,blockedCount:n?.filter(e=>e.status===`blocked`).length??0}}var vO={scope:`active`,focusedIndex:-1,archive:null};function yO(e){throw Error(`Unhandled WorkspaceEvent type: ${String(e.type)}`)}function bO(e,t){switch(t.type){case`scope_changed`:return{...e,scope:t.scope,focusedIndex:-1};case`focus_moved`:return{...e,focusedIndex:t.index};case`archive_opened`:return{...e,archive:{repoName:t.repoName}};case`archive_closed`:return{...e,archive:null};default:return yO(t)}}var xO=720*60*60*1e3,SO={in_progress:0,dormant:0,blocked:1,complete_with_gaps:2,complete:3};function CO(e){if(e.length!==0)return[...e].sort((e,t)=>{let n=SO[e.status]-SO[t.status];return n===0?t.lastModifiedMs-e.lastModifiedMs:n})[0]}function wO(e,t,n){let r=e.primarySession?.status;if(r===`in_progress`||r===`blocked`)return`visible`;let i=(e.worktree?.changedCount??0)>0,a=(e.worktree?.aheadCount??0)>0;return i||a?`visible`:r===`dormant`?t===`all`?`visible`:`hidden`:n-e.activityMs<xO||t===`all`?`visible`:`hidden`}function TO(e){switch(e.primarySession?.status){case`in_progress`:return 0;case`blocked`:return 1;case`dormant`:return 2;default:return(e.worktree?.changedCount??0)>0||(e.worktree?.aheadCount??0)>0?3:4}}function EO(e,t,n){return[...e].filter(e=>wO(e,t,n)===`visible`).sort((e,t)=>{let n=TO(e)-TO(t);return n===0?t.activityMs-e.activityMs:n})}function DO(e,t){let n=new Map;for(let e of t)for(let t of e.worktrees)t.branch!==null&&n.set(`${t.branch}\0${e.repoRoot}`,{wt:t,repoName:e.repoName,repoRoot:e.repoRoot});let r=new Map;for(let[e,t]of n){let[n]=e.split(`\0`),i=r.get(n)??[];i.push(t),r.set(n,i)}let i=new Map;for(let t of e){if(t.gitBranch===null)continue;let e=r.get(t.gitBranch)??[];if(e.length===0){if(!t.repoRoot)continue;let e=`${t.gitBranch}\0${t.repoRoot}`,r=i.get(e);if(r?r.push(t):i.set(e,[t]),!n.has(e)){let r=t.repoRoot.split(`/`).at(-1)??t.repoRoot;n.set(e,{wt:void 0,repoName:r,repoRoot:t.repoRoot})}continue}let a=e;if(t.repoRoot!==null){let n=e.filter(e=>e.repoRoot===t.repoRoot);n.length>0&&(a=n)}for(let e of a){let n=`${t.gitBranch}\0${e.repoRoot}`,r=i.get(n);r?r.push(t):i.set(n,[t])}}let a=[],o=new Set;for(let[e,t]of i){let[r,i]=e.split(`\0`),s=n.get(e),c=CO(t),l=Math.max(c?.lastModifiedMs??0,s?.wt?.headTimestampMs??0),u=s?.repoName??i.split(`/`).at(-1)??i;a.push({branch:r,repoRoot:i,repoName:u,worktree:s?.wt,primarySession:c,allSessions:t,activityMs:l}),o.add(e)}for(let[e,{wt:t,repoName:r,repoRoot:i}]of n){if(o.has(e))continue;let[n]=e.split(`\0`);a.push({branch:n,repoRoot:i,repoName:r,worktree:t,primarySession:void 0,allSessions:[],activityMs:t?.headTimestampMs??0})}return a}function OO(e,t,n,r){let i=DO(e,t),a=new Map;for(let e of i)a.has(e.repoRoot)||a.set(e.repoRoot,e.repoName);let o=new Map;for(let e of i){let t=o.get(e.repoRoot)??[];t.push(e),o.set(e.repoRoot,t)}let s=[...o.entries()].map(([e,t])=>({repoRoot:e,repoName:t[0].repoName,sortedItems:EO(t,n,r)})).filter(e=>e.sortedItems.length>0).sort((e,t)=>{let n=+!e.sortedItems.some(e=>e.primarySession?.status===`in_progress`||e.primarySession?.status===`blocked`),r=+!t.sortedItems.some(e=>e.primarySession?.status===`in_progress`||e.primarySession?.status===`blocked`);return n===r?e.repoName.localeCompare(t.repoName):n-r}),c=s.flatMap(e=>e.sortedItems),l=n===`active`?i.filter(e=>e.primarySession?.status===`dormant`&&(e.worktree?.changedCount??0)===0&&(e.worktree?.aheadCount??0)===0).length:0;return{repoGroups:s,orderedItems:c,archiveRepos:[...a.entries()].map(([e,t])=>[e,t]),dormantHiddenCount:l}}function kO({items:e,focusedIndex:t,scope:n,archive:r,dispatch:i,onSelectSession:a,onRefetch:o,disabled:s}){let c=(0,B.useRef)(e);c.current=e;let l=(0,B.useRef)(t);l.current=t;let u=(0,B.useRef)(n);u.current=n;let d=(0,B.useRef)(r);d.current=r;let f=(0,B.useRef)(s);f.current=s;let p=(0,B.useRef)(i);p.current=i;let m=(0,B.useRef)(a);m.current=a;let h=(0,B.useRef)(o);h.current=o,(0,B.useEffect)(()=>{function e(e){if(f.current||e.metaKey||e.ctrlKey||e.altKey)return;let t=document.activeElement;if(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)return;let n=c.current,r=l.current;switch(e.key){case`j`:case`ArrowDown`:e.preventDefault(),p.current({type:`focus_moved`,index:Math.min(r+1,n.length-1)});break;case`k`:case`ArrowUp`:e.preventDefault(),p.current({type:`focus_moved`,index:Math.max(r-1,0)});break;case`Enter`:case` `:if(e.preventDefault(),r>=0&&r<n.length){let e=n[r]?.primarySession?.sessionId;e&&m.current(e)}break;case`Escape`:d.current!==null&&p.current({type:`archive_closed`});break;case`/`:e.preventDefault(),p.current({type:`archive_opened`,repoName:void 0});break;case`r`:e.preventDefault(),h.current();break;case`a`:e.preventDefault(),p.current({type:`scope_changed`,scope:u.current===`active`?`all`:`active`});break}}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[])}function AO(e=!1){let t=wi(),n=_O(),[r,i]=(0,B.useReducer)(bO,vO),a=(0,B.useRef)(0),o=(0,B.useCallback)(e=>{a.current=window.scrollY,t({to:`/session/$sessionId`,params:{sessionId:e}})},[t]),s=i,c=(0,B.useMemo)(()=>n.sessions?OO(n.sessions,n.worktreeRepos,r.scope,Date.now()):null,[n.sessions,n.worktreeRepos,r.scope]);kO({items:c?.orderedItems??[],focusedIndex:r.focusedIndex,scope:r.scope,archive:r.archive,dispatch:s,onSelectSession:o,onRefetch:n.refetch,disabled:e});let{isLoading:l,error:u,worktreesFetching:d,sessions:f,liveCount:p,blockedCount:m}=n;return{state:(0,B.useMemo)(()=>l?{kind:`loading`}:u?{kind:`error`,message:u.message}:c?{kind:`ready`,scope:r.scope,focusedIndex:r.focusedIndex,archive:r.archive,repoGroups:c.repoGroups,orderedItems:c.orderedItems,archiveRepos:c.archiveRepos,dormantHiddenCount:c.dormantHiddenCount,worktreesFetching:d,hasAnySessions:(f?.length??0)>0,liveCount:p,blockedCount:m}:{kind:`loading`},[l,u,d,f,c,r,p,m]),dispatch:s,scrollYRef:a,onSelectSession:o}}function jO(){let e=Gy();return{sessions:e.data?.sessions,isLoading:e.isLoading,error:e.error instanceof Error?e.error:null}}function MO(e=``){return{rawSearch:e,sort:`recent`,groupBy:`none`,statusFilter:`all`,page:0,viewMode:`flat`}}function NO(e){throw Error(`Unhandled SessionListEvent type: ${String(e.type)}`)}function PO(e,t){switch(t.type){case`search_changed`:return{...e,rawSearch:t.value,page:0};case`sort_changed`:return{...e,sort:t.sort,page:0};case`group_changed`:return{...e,groupBy:t.groupBy,page:0};case`status_changed`:return{...e,statusFilter:t.statusFilter,page:0};case`page_changed`:return{...e,page:t.page};case`view_mode_changed`:return t.viewMode===`tree`?{...e,viewMode:`tree`,rawSearch:``,statusFilter:`all`,page:0}:{...e,viewMode:`flat`,page:0};default:return NO(t)}}var FO={in_progress:0,blocked:1,dormant:2,complete_with_gaps:3,complete:4},IO=[{value:`recent`,label:`Recent`,compareFn:(e,t)=>t.lastModifiedMs-e.lastModifiedMs},{value:`status`,label:`Status`,compareFn:(e,t)=>FO[e.status]-FO[t.status]||t.lastModifiedMs-e.lastModifiedMs},{value:`workflow`,label:`Workflow`,compareFn:(e,t)=>(e.workflowName??e.workflowId??``).localeCompare(t.workflowName??t.workflowId??``)||t.lastModifiedMs-e.lastModifiedMs},{value:`nodes`,label:`Node count`,compareFn:(e,t)=>t.nodeCount-e.nodeCount||t.lastModifiedMs-e.lastModifiedMs}],LO=[{value:`none`,label:`No grouping`,keyFn:null},{value:`workflow`,label:`Workflow`,keyFn:e=>e.workflowName??e.workflowId??`Unknown workflow`},{value:`status`,label:`Status`,keyFn:e=>e.status,groupCompareFn:(e,t)=>(FO[e]??99)-(FO[t]??99)},{value:`branch`,label:`Branch`,keyFn:e=>e.gitBranch??`No branch`}],RO=[{value:`all`,label:`All`},{value:`in_progress`,label:`In Progress`},{value:`dormant`,label:`Dormant`},{value:`complete`,label:`Complete`},{value:`complete_with_gaps`,label:`Gaps`},{value:`blocked`,label:`Blocked`}];function zO(e,t,n){let r=e;if(n!==`all`&&(r=r.filter(e=>e.status===n)),t.trim()){let e=t.toLowerCase();r=r.filter(t=>(t.sessionTitle??``).toLowerCase().includes(e)||(t.workflowName??``).toLowerCase().includes(e)||(t.workflowId??``).toLowerCase().includes(e)||t.sessionId.toLowerCase().includes(e)||(t.gitBranch??``).toLowerCase().includes(e))}return r}function BO(e,t){let n=IO.find(e=>e.value===t)??IO[0];return[...e].sort(n.compareFn)}function VO(e,t){let n=LO.find(e=>e.value===t)??LO[0];if(!n.keyFn)return[{label:``,sessions:e}];let r=new Map;for(let t of e){let e=n.keyFn(t),i=r.get(e)??[];i.push(t),r.set(e,i)}let i=n.groupCompareFn??((e,t)=>e.localeCompare(t));return Array.from(r.entries()).sort(([e],[t])=>i(e,t)).map(([e,t])=>({label:e,sessions:t}))}function HO(e){let t={all:e.length};for(let n of e)t[n.status]=(t[n.status]??0)+1;return t}function UO(e){let t=new Set(e.map(e=>e.sessionId)),n=new Map,r=new Set,i=new Set;for(let a of e){let e=a.parentSessionId;if(!e||e===a.sessionId)continue;if(!t.has(e)){r.add(a.sessionId);continue}i.add(a.sessionId);let o=n.get(e)??[];o.push(a),n.set(e,o)}let a=[];for(let t of e)i.has(t.sessionId)||a.push({session:t,children:n.get(t.sessionId)??[]});return{roots:a,orphanChildIds:r}}function WO(e,t){let[n,r]=(0,B.useState)(e),i=(0,B.useRef)(null);return(0,B.useEffect)(()=>(i.current!==null&&clearTimeout(i.current),i.current=setTimeout(()=>r(e),t),()=>{i.current!==null&&clearTimeout(i.current)}),[e,t]),n}function GO({onSelectSession:e,initialSearch:t=``}){let n=jO(),[r,i]=(0,B.useReducer)(PO,void 0,()=>MO(t)),a=WO(r.rawSearch,200),o=(0,B.useRef)([]),s=(0,B.useCallback)(t=>{let n=o.current[t];n&&e(n.sessionId)},[e]),{sessions:c,isLoading:l,error:u}=n,d=(0,B.useMemo)(()=>c?HO(c):{},[c]),f=(0,B.useMemo)(()=>{if(!c)return null;let e=zO(c,a,r.statusFilter);return{groups:VO(BO(e,r.sort),r.groupBy),total:c.length,filtered:e.length}},[c,a,r.statusFilter,r.sort,r.groupBy]),p=(0,B.useMemo)(()=>UO(c||[]),[c]),m=r.groupBy!==`none`,h=f?Math.ceil(f.filtered/25):0,g=r.page*25,_=g+25,v=(0,B.useMemo)(()=>!f||m?[]:f.groups[0]?.sessions.slice(g,_)??[],[f,m,g,_]);o.current=v;let{getItemProps:y,containerProps:b}=FD({count:v.length,cols:1,onActivate:s});return{state:(0,B.useMemo)(()=>l?{kind:`loading`}:u?{kind:`error`,message:u.message}:f?{kind:`ready`,rawSearch:r.rawSearch,sort:r.sort,groupBy:r.groupBy,statusFilter:r.statusFilter,page:r.page,totalPages:h,isGrouped:m,processed:f,statusCounts:d,flatPageSessions:v,getSessionNavProps:y,sessionContainerProps:b,sortAxes:IO,groupAxes:LO,statusFilterOptions:RO,viewMode:r.viewMode,sessionTree:p}:{kind:`loading`},[l,u,f,r,h,m,d,v,y,b,p]),dispatch:i,onSelectSession:e}}var KO={selectedWorkflowId:null,selectedTag:null,selectedSource:null,hintVisible:!1};function qO(e){throw Error(`Unhandled WorkflowsEvent type: ${String(e.type)}`)}function JO(e,t){switch(t.type){case`workflow_selected`:return{...e,selectedWorkflowId:t.id,hintVisible:t.id!==null};case`tag_changed`:return{...e,selectedTag:t.tag,selectedWorkflowId:null,hintVisible:!1};case`source_changed`:return{...e,selectedSource:t.source,selectedWorkflowId:null,hintVisible:!1};case`modal_closed`:return{...e,selectedWorkflowId:null,hintVisible:!1};case`hint_dismissed`:return{...e,hintVisible:!1};default:return qO(t)}}function YO(e){let t=new Set;for(let n of e)for(let e of n.tags)e!==`routines`&&t.add(e);let n=xD.map(e=>e.id).filter(e=>t.has(e)),r=[...t].filter(e=>!xD.some(t=>t.id===e)).sort();return[...n,...r]}function XO(e){let t=new Map;for(let n of e)t.has(n.source.kind)||t.set(n.source.kind,{id:n.source.kind,displayName:n.source.displayName});return[...t.values()]}function ZO(e,t,n){let r=new Set(xD.map(e=>e.id)),i=e;return t!==null&&(i=t===`__other__`?i.filter(e=>!e.tags.some(e=>e!==`routines`&&r.has(e))):i.filter(e=>e.tags.includes(t))),n!==null&&(i=i.filter(e=>e.source.displayName===n)),i}function QO(e,t){if(t!==null)return e;let n=new Set(xD.map(e=>e.id)),r=new Map,i=[];for(let t of e){let e=t.tags.find(e=>e!==`routines`&&n.has(e));if(e){let n=r.get(e)??[];n.push(t),r.set(e,n)}else i.push(t)}let a=[];for(let{id:e}of xD){let t=r.get(e);t&&a.push(...t)}return a.push(...i),a}function $O({initialTag:e,onSelectTag:t}){let n=LD(),[r,i]=(0,B.useReducer)(JO,{...KO,selectedTag:e});(0,B.useEffect)(()=>{e!==r.selectedTag&&i({type:`tag_changed`,tag:e})},[e]);let a=(0,B.useRef)(null),o=(0,B.useCallback)((e,t)=>{a.current=t,t.blur(),i({type:`workflow_selected`,id:e})},[]);(0,B.useEffect)(()=>{if(!r.selectedWorkflowId&&a.current){let e=a.current;a.current=null,e.focus()}},[r.selectedWorkflowId]),(0,B.useEffect)(()=>{if(!r.selectedWorkflowId)return;let e=window.scrollY;return document.body.style.overflow=`hidden`,document.body.style.position=`fixed`,document.body.style.top=`-${e}px`,document.body.style.width=`100%`,()=>{document.body.style.overflow=``,document.body.style.position=``,document.body.style.top=``,document.body.style.width=``,window.scrollTo(0,e)}},[r.selectedWorkflowId]),(0,B.useEffect)(()=>{if(!r.selectedWorkflowId)return;let e=e=>{e.key===`Escape`&&i({type:`modal_closed`})};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r.selectedWorkflowId]);let{isLoading:s,error:c,workflows:l}=n,u=(0,B.useMemo)(()=>{if(s)return{kind:`loading`};if(c)return{kind:`error`,message:c.message,onRetry:n.refetch};if(!l)return{kind:`loading`};let e=YO(l),t=XO(l),i=ZO(l,r.selectedTag,r.selectedSource),a=QO(i,r.selectedTag),o=ZO(l,null,r.selectedSource),u=ZO(l,r.selectedTag,null);return{kind:`ready`,selectedWorkflowId:r.selectedWorkflowId,selectedTag:r.selectedTag,selectedSource:r.selectedSource,hintVisible:r.hintVisible,availableTags:e,availableSources:t,filteredWorkflows:i,flatWorkflows:a,sourceFilteredWorkflows:o,tagFilteredWorkflows:u}},[s,c,l,r,n.refetch]),d=u.kind===`ready`?u.flatWorkflows.length:0;return(0,B.useEffect)(()=>{if(!r.selectedWorkflowId||d<=1)return;let e=setTimeout(()=>i({type:`hint_dismissed`}),3e3);return()=>clearTimeout(e)},[r.selectedWorkflowId,d]),{state:u,dispatch:(0,B.useCallback)(e=>{e.type===`tag_changed`&&t(e.tag),i(e)},[t]),triggerRef:a,onCardSelect:o}}function ek(){let e=Zy();switch(e.state){case`loading`:return{kind:`loading`};case`devModeOff`:return{kind:`devModeOff`};case`error`:return{kind:`error`,message:e.message,retry:e.retry};case`data`:return{kind:`ready`,observations:e.data.observations}}}function tk(){let e=ek(),[t,n]=(0,B.useState)(`recent`);return{state:(0,B.useMemo)(()=>{if(e.kind===`loading`)return{kind:`loading`};if(e.kind===`devModeOff`)return{kind:`devModeOff`};if(e.kind===`error`)return{kind:`error`,message:e.message,retry:e.retry};let{observations:r}=e,i=YD(r,t);return{kind:`ready`,sorted:i,maxDuration:XD(i),errorCount:ZD(r),avgMs:QD(r),lastCallMs:$D(r),countLabel:tO(r.length),sortOrder:t,onSortChange:n}},[e,t])}}function nk(e){let t=Ky(e);return{data:t.data,isLoading:t.isLoading,error:t.error instanceof Error?t.error:null}}function rk(e){let t=nk(e),[n,r]=(0,B.useState)(null),i=(0,B.useCallback)((e,t)=>{r(n=>n?.runId===e&&n?.nodeId===t?null:{runId:e,nodeId:t})},[]),a=(0,B.useCallback)(()=>{r(null)},[]),{isLoading:o,error:s,data:c}=t,l=(0,B.useMemo)(()=>!c||!n?null:c.runs.find(e=>e.runId===n.runId)??null,[c,n]);return{state:(0,B.useMemo)(()=>o?{kind:`loading`}:s?{kind:`error`,message:s.message}:c?{kind:`ready`,sessionId:e,data:c,selectedNode:n,selectedRun:l}:{kind:`loading`},[o,s,c,e,n,l]),onSelectNode:i,onCloseNode:a}}var ik=[{id:`workspace`,path:`/`},{id:`workflows`,path:`/workflows`},{id:`auto`,path:`/auto`},{id:`perf`,path:`/perf`}];function ak(){let e=wi(),t=ta(),{location:n}=sa(),r=t({to:`/session/$sessionId`}),i=t({to:`/workflows`}),a=t({to:`/workflows/$workflowId`}),o=t({to:`/perf`}),s=t({to:`/auto`}),c=i!==!1||a!==!1?`workflows`:o===!1?s===!1?`workspace`:`auto`:`perf`,l=r!==!1,u=a!==!1,d=l?r.sessionId:null,f=u?a.workflowId:null,p=new URLSearchParams(n.search).get(`tag`),m=AO(l),h=GO({onSelectSession:m.onSelectSession}),g=m.state.kind===`ready`?m.state.liveCount:0,_=m.state.kind===`ready`?m.state.blockedCount:0,v=(0,B.useCallback)(()=>{e({to:`/`})},[e]),y=(0,B.useCallback)(t=>{e({to:`/workflows`,search:{tag:t??void 0}})},[e]),b=(0,B.useCallback)(()=>{e({to:`/workflows`,search:{tag:p??void 0}})},[e,p]),x=(0,B.useCallback)(t=>{e({to:`/workflows/$workflowId`,params:{workflowId:t},search:{tag:p??void 0}})},[e,p]),S=$O({initialTag:p,onSelectTag:y}),C=zD({workflowId:f,activeTag:p,onBack:b,onNavigateToWorkflow:x}),w=rk(d??``),T=tk(),[E,D]=(0,B.useState)(null),O=(0,B.useCallback)((e,t)=>{t(),D(e),setTimeout(()=>D(null),200)},[]),k=(0,B.useRef)(null);return(0,B.useEffect)(()=>{let t=k.current;if(!t)return;function n(t){if(t.key===`ArrowLeft`||t.key===`ArrowRight`){t.preventDefault();let n=ik.findIndex(e=>e.id===c),r=ik[t.key===`ArrowRight`?(n+1)%ik.length:(n-1+ik.length)%ik.length];e({to:r.path,...r.path===`/workflows`?{search:{tag:void 0}}:{}})}}return t.addEventListener(`keydown`,n),()=>t.removeEventListener(`keydown`,n)},[c,e]),(0,V.jsxs)(`div`,{className:`min-h-screen`,style:{"--app-header-height":`56px`},children:[(0,V.jsxs)(`header`,{style:{background:`rgba(23, 27, 40, 0.92)`,backdropFilter:`blur(24px)`,WebkitBackdropFilter:`blur(24px)`,borderBottom:`1px solid rgba(244, 196, 48, 0.25)`,boxShadow:`0 4px 24px rgba(0,0,0,0.4)`},className:`fixed top-0 w-full z-50 flex items-center h-14 px-4 gap-6`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[(0,V.jsx)(W,{cut:8,borderColor:`rgba(244, 196, 48, 0.5)`,background:`rgba(27, 31, 44, 0.8)`,className:`relative w-10 h-10`,children:(0,V.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,V.jsx)(`span`,{className:`font-mono text-[11px] font-bold text-[var(--accent)] tracking-widest`,children:`WR`})})}),(0,V.jsxs)(`div`,{className:`hidden sm:flex flex-col leading-none`,children:[(0,V.jsx)(`span`,{className:`font-mono text-[11px] font-bold text-[var(--text-primary)] tracking-[0.25em] uppercase`,children:`WR_CONSOLE`}),(0,V.jsxs)(`span`,{className:`font-mono text-[9px] text-[var(--text-muted)] tracking-[0.15em]`,children:[`// V`,`3.75.0`]})]})]}),l&&d?(0,V.jsx)(`nav`,{className:`flex items-center flex-1 justify-center`,children:(0,V.jsx)(wD,{segments:[{label:`Workspace`,onClick:v},{label:d?.slice(-12)??``}]})}):(0,V.jsxs)(`div`,{role:`tablist`,"aria-label":`Console sections`,ref:k,className:`flex items-center gap-1 flex-1 justify-center`,children:[(0,V.jsxs)(`button`,{role:`tab`,id:`tab-workspace`,"aria-selected":c===`workspace`,"aria-controls":`panel-workspace`,tabIndex:c===`workspace`?0:-1,onClick:()=>O(`workspace`,()=>void e({to:`/`})),className:[`tab-btn px-4 py-2.5 font-mono text-[10px] uppercase tracking-[0.30em] transition-colors duration-150`,`focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1 focus-visible:outline-none`,c===`workspace`?`tab-btn--active text-[var(--accent)] text-glow-amber`:`text-[var(--text-secondary)] hover:text-[var(--text-primary)]`,E===`workspace`?`tab-activating`:``].join(` `),style:c===`workspace`?{backgroundColor:`rgba(244, 196, 48, 0.06)`}:void 0,children:[(0,V.jsx)(`span`,{className:`tab-corner tab-corner--tl`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`tab-corner tab-corner--tr`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`tab-corner tab-corner--bl`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`tab-corner tab-corner--br`,"aria-hidden":`true`}),`Workspace`]}),(0,V.jsxs)(`button`,{role:`tab`,id:`tab-workflows`,"aria-selected":c===`workflows`,"aria-controls":`panel-workflows`,tabIndex:c===`workflows`?0:-1,onClick:()=>O(`workflows`,()=>void e({to:`/workflows`,search:{tag:void 0}})),className:[`tab-btn px-4 py-2.5 font-mono text-[10px] uppercase tracking-[0.30em] transition-colors duration-150`,`focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1 focus-visible:outline-none`,c===`workflows`?`tab-btn--active text-[var(--accent)] text-glow-amber`:`text-[var(--text-secondary)] hover:text-[var(--text-primary)]`,E===`workflows`?`tab-activating`:``].join(` `),style:c===`workflows`?{backgroundColor:`rgba(244, 196, 48, 0.06)`}:void 0,children:[(0,V.jsx)(`span`,{className:`tab-corner tab-corner--tl`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`tab-corner tab-corner--tr`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`tab-corner tab-corner--bl`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`tab-corner tab-corner--br`,"aria-hidden":`true`}),`Workflows`]}),(0,V.jsxs)(`button`,{role:`tab`,id:`tab-auto`,"aria-selected":c===`auto`,"aria-controls":`panel-auto`,tabIndex:c===`auto`?0:-1,onClick:()=>O(`auto`,()=>void e({to:`/auto`})),className:[`tab-btn px-4 py-2.5 font-mono text-[10px] uppercase tracking-[0.30em] transition-colors duration-150`,`focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1 focus-visible:outline-none`,c===`auto`?`tab-btn--active text-[var(--accent)] text-glow-amber`:`text-[var(--text-secondary)] hover:text-[var(--text-primary)]`,E===`auto`?`tab-activating`:``].join(` `),style:c===`auto`?{backgroundColor:`rgba(244, 196, 48, 0.06)`}:void 0,children:[(0,V.jsx)(`span`,{className:`tab-corner tab-corner--tl`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`tab-corner tab-corner--tr`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`tab-corner tab-corner--bl`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`tab-corner tab-corner--br`,"aria-hidden":`true`}),`Auto`]}),(0,V.jsxs)(`button`,{role:`tab`,id:`tab-perf`,"aria-selected":c===`perf`,"aria-controls":`panel-perf`,tabIndex:c===`perf`?0:-1,onClick:()=>O(`perf`,()=>void e({to:`/perf`})),className:[`tab-btn px-4 py-2.5 font-mono text-[10px] uppercase tracking-[0.30em] transition-colors duration-150`,`focus-visible:ring-2 focus-visible:ring-[var(--accent)] focus-visible:ring-offset-1 focus-visible:outline-none`,c===`perf`?`tab-btn--active text-[var(--accent)] text-glow-amber`:`text-[var(--text-secondary)] hover:text-[var(--text-primary)]`,E===`perf`?`tab-activating`:``].join(` `),style:c===`perf`?{backgroundColor:`rgba(244, 196, 48, 0.06)`}:void 0,children:[(0,V.jsx)(`span`,{className:`tab-corner tab-corner--tl`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`tab-corner tab-corner--tr`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`tab-corner tab-corner--bl`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`tab-corner tab-corner--br`,"aria-hidden":`true`}),`Performance`]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[g>0&&(0,V.jsx)(no,{label:`${Math.min(g,9)}${g>9?`+`:``} LIVE`,color:`var(--accent-strong)`,pulse:!0,role:`status`,"aria-label":`${g} live session${g===1?``:`s`}`}),_>0&&(0,V.jsx)(no,{label:`${Math.min(_,9)}${_>9?`+`:``} BLOCKED`,color:`var(--blocked)`,role:`status`,"aria-label":`${_} blocked session${_===1?``:`s`}`})]})]}),(0,V.jsxs)(`main`,{className:`p-6`,style:{paddingTop:`calc(56px + 1.5rem)`},children:[(0,V.jsxs)(`div`,{id:`panel-workspace`,role:`tabpanel`,"aria-labelledby":`tab-workspace`,hidden:c===`workflows`||c===`perf`||c===`auto`,children:[(0,V.jsx)(Do,{viewModel:m,sessionListViewModel:h,hidden:l}),l&&d&&(0,V.jsx)(vD,{viewModel:w})]}),c===`workflows`&&(0,V.jsx)(`div`,{id:`panel-workflows`,role:`tabpanel`,"aria-labelledby":`tab-workflows`,children:u&&f?(0,V.jsx)(TD,{viewModel:C}):(0,V.jsx)(VD,{viewModel:S})}),c===`auto`&&(0,V.jsx)(`div`,{id:`panel-auto`,role:`tabpanel`,"aria-labelledby":`tab-auto`,children:(0,V.jsx)(gO,{})}),c===`perf`&&(0,V.jsx)(`div`,{id:`panel-perf`,role:`tabpanel`,"aria-labelledby":`tab-perf`,children:(0,V.jsx)(rO,{viewModel:T})})]})]})}var ok=Hi({component:ak}),sk=Bi({getParentRoute:()=>ok,path:`/`,component:()=>null}),ck=Bi({getParentRoute:()=>ok,path:`/session/$sessionId`,component:()=>null}),lk=Bi({getParentRoute:()=>ok,path:`/workflows`,validateSearch:e=>({tag:typeof e.tag==`string`?e.tag:void 0}),component:()=>null}),uk=Bi({getParentRoute:()=>ok,path:`/workflows/$workflowId`,validateSearch:e=>({tag:typeof e.tag==`string`?e.tag:void 0}),component:()=>null}),dk=Bi({getParentRoute:()=>ok,path:`/perf`,component:()=>null}),fk=Bi({getParentRoute:()=>ok,path:`/auto`,component:()=>null}),pk=ra({routeTree:ok.addChildren([sk,ck,lk,uk,dk,fk]),history:yr()}),mk=new ze({defaultOptions:{queries:{refetchInterval:5e3,staleTime:2e3}}});(0,ca.createRoot)(document.getElementById(`root`)).render((0,V.jsx)(B.StrictMode,{children:(0,V.jsx)(We,{client:mk,children:(0,V.jsx)(oa,{router:pk})})}));