flowforge-map 0.1.0__py3-none-any.whl
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.
- flowforge/__init__.py +0 -0
- flowforge/_classic.html +289 -0
- flowforge/_dashboard/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- flowforge/_dashboard/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- flowforge/_dashboard/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- flowforge/_dashboard/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- flowforge/_dashboard/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
- flowforge/_dashboard/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
- flowforge/_dashboard/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
- flowforge/_dashboard/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
- flowforge/_dashboard/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
- flowforge/_dashboard/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
- flowforge/_dashboard/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- flowforge/_dashboard/assets/index-BGT5seIN.css +1 -0
- flowforge/_dashboard/assets/index-BoGikST6.js +52 -0
- flowforge/_dashboard/favicon.svg +1 -0
- flowforge/_dashboard/index.html +16 -0
- flowforge/_example/trip-planner/.env.example +3 -0
- flowforge/_example/trip-planner/.gitignore +2 -0
- flowforge/_example/trip-planner/.mcp.json +20 -0
- flowforge/_example/trip-planner/README.md +48 -0
- flowforge/_example/trip-planner/config.py +27 -0
- flowforge/_example/trip-planner/mcp_servers/currency.py +10 -0
- flowforge/_example/trip-planner/planner.py +113 -0
- flowforge/_example/trip-planner/requirements.txt +3 -0
- flowforge/_example/trip-planner/services/__init__.py +0 -0
- flowforge/_example/trip-planner/services/geo.py +49 -0
- flowforge/_example/trip-planner/services/llm.py +18 -0
- flowforge/_example/trip-planner/services/mcp_tools.py +26 -0
- flowforge/_example/trip-planner/services/weather.py +25 -0
- flowforge/_example/trip-planner/tools/packing_list.py +24 -0
- flowforge/_example/trip-planner/trips/.gitkeep +0 -0
- flowforge/_workflows/diamond_mock.json +71 -0
- flowforge/_workflows/stripe_to_razorpay.json +38 -0
- flowforge/agent/__init__.py +5 -0
- flowforge/agent/server.py +333 -0
- flowforge/api/__init__.py +0 -0
- flowforge/api/agent.py +79 -0
- flowforge/api/checks.py +255 -0
- flowforge/api/connectors.py +289 -0
- flowforge/api/flowmap.py +174 -0
- flowforge/api/runs.py +284 -0
- flowforge/api/scan.py +117 -0
- flowforge/api/security.py +31 -0
- flowforge/api/stats.py +80 -0
- flowforge/checks/__init__.py +13 -0
- flowforge/checks/models.py +41 -0
- flowforge/checks/probes.py +359 -0
- flowforge/cli.py +108 -0
- flowforge/connectors/__init__.py +0 -0
- flowforge/connectors/catalog.py +84 -0
- flowforge/connectors/models.py +149 -0
- flowforge/connectors/presets.py +192 -0
- flowforge/connectors/registry.py +85 -0
- flowforge/connectors/runtime.py +47 -0
- flowforge/connectors/secrets.py +53 -0
- flowforge/example_data.py +247 -0
- flowforge/flow/__init__.py +328 -0
- flowforge/flow/advice.py +132 -0
- flowforge/flow/curly.py +884 -0
- flowforge/flow/index.py +116 -0
- flowforge/flow/order.py +181 -0
- flowforge/flow/reach.py +145 -0
- flowforge/flow/rewrite.py +146 -0
- flowforge/flowmap/__init__.py +1 -0
- flowforge/flowmap/diff.py +145 -0
- flowforge/flowmap/fixture.py +283 -0
- flowforge/flowmap/models.py +258 -0
- flowforge/flowmap/planner.py +131 -0
- flowforge/flowmap/service.py +379 -0
- flowforge/flowmap/validate.py +228 -0
- flowforge/home.py +58 -0
- flowforge/main.py +137 -0
- flowforge/nodes/__init__.py +3 -0
- flowforge/nodes/base.py +74 -0
- flowforge/nodes/check_node.py +50 -0
- flowforge/nodes/http_node.py +161 -0
- flowforge/nodes/llm_node.py +158 -0
- flowforge/nodes/local_node.py +164 -0
- flowforge/nodes/mcp_node.py +243 -0
- flowforge/nodes/mock_node.py +40 -0
- flowforge/scan/__init__.py +6 -0
- flowforge/scan/facts.py +47 -0
- flowforge/scan/files.py +112 -0
- flowforge/scan/manifests.py +65 -0
- flowforge/scan/mcp_config.py +75 -0
- flowforge/scan/models.py +73 -0
- flowforge/scan/patterns.py +86 -0
- flowforge/scan/python_ast.py +246 -0
- flowforge/scan/scanner.py +344 -0
- flowforge/scan/services.py +58 -0
- flowforge/scan/urls.py +60 -0
- flowforge/scheduler/__init__.py +0 -0
- flowforge/scheduler/cache.py +76 -0
- flowforge/scheduler/critical_path.py +65 -0
- flowforge/scheduler/durations.py +35 -0
- flowforge/scheduler/executor.py +390 -0
- flowforge/scheduler/graph.py +108 -0
- flowforge/scheduler/rate_limit.py +36 -0
- flowforge/schema.py +81 -0
- flowforge/security/__init__.py +0 -0
- flowforge/security/finders.py +127 -0
- flowforge/security/findings.py +169 -0
- flowforge/security/logfilter.py +129 -0
- flowforge/spa.py +52 -0
- flowforge/state.py +73 -0
- flowforge/storage.py +481 -0
- flowforge/templating.py +60 -0
- flowforge_map-0.1.0.dist-info/METADATA +335 -0
- flowforge_map-0.1.0.dist-info/RECORD +113 -0
- flowforge_map-0.1.0.dist-info/WHEEL +4 -0
- flowforge_map-0.1.0.dist-info/entry_points.txt +3 -0
- flowforge_map-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,52 @@
|
|
|
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,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function ee(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function 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===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=N(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(ee(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 P(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,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ne=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function re(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,ne)}catch(e){ne(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function F(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else re(F.bind(null,e))}var I={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=I,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=F,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=re,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),m=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),ee=Symbol.for(`react.profiler`),N=Symbol.for(`react.consumer`),P=Symbol.for(`react.context`),te=Symbol.for(`react.forward_ref`),ne=Symbol.for(`react.suspense`),re=Symbol.for(`react.suspense_list`),F=Symbol.for(`react.memo`),I=Symbol.for(`react.lazy`),ie=Symbol.for(`react.activity`),ae=Symbol.for(`react.legacy_hidden`),oe=Symbol.for(`react.memo_cache_sentinel`),se=Symbol.for(`react.view_transition`),ce=Symbol.for(`react.recoverable`),le=Symbol.iterator;function ue(e){return typeof e!=`object`||!e?null:(e=le&&e[le]||e[`@@iterator`],typeof e==`function`?e:null)}var de=Symbol.for(`react.client.reference`);function fe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===de?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case ee:return`Profiler`;case M:return`StrictMode`;case ne:return`Suspense`;case re:return`SuspenseList`;case ie:return`Activity`;case se:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case P:return e.displayName||`Context`;case N:return(e._context.displayName||`Context`)+`.Consumer`;case te:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case F:return t=e.displayName||null,t===null?fe(e.type)||`Memo`:t;case I:t=e._payload,e=e._init;try{return fe(e(t))}catch{}}return null}var pe=Array.isArray,L=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me={pending:!1,data:null,method:null,action:null},he=[],ge=-1;function _e(e){return{current:e}}function ve(e){0>ge||(e.current=he[ge],he[ge]=null,ge--)}function ye(e,t){ge++,he[ge]=e.current,e.current=t}var be=_e(null),xe=_e(null),Se=_e(null),Ce=_e(null);function we(e,t){switch(ye(Se,t),ye(xe,e),ye(be,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?dp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=dp(t),e=fp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ve(be),ye(be,e)}function Te(){ve(be),ve(xe),ve(Se)}function Ee(e){var t=e.memoizedState;t!==null&&(ch._currentValue=t.memoizedState,ye(Ce,e)),t=be.current;var n=fp(t,e.type);t!==n&&(ye(xe,e),ye(be,n))}function De(e){xe.current===e&&(ve(be),ve(xe)),Ce.current===e&&(ve(Ce),ch._currentValue=me)}var Oe,ke;function Ae(e){if(Oe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Oe=t&&t[1]||``,ke=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+Oe+e+ke}var je=!1;function Me(e,t){if(!e||je)return``;je=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
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{je=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ae(n):``}function Ne(e,t){switch(e.tag){case 26:case 27:case 5:return Ae(e.type);case 16:return Ae(`Lazy`);case 13:return e.child!==t&&t!==null?Ae(`Suspense Fallback`):Ae(`Suspense`);case 19:return Ae(`SuspenseList`);case 0:case 15:return Me(e.type,!1);case 11:return Me(e.type.render,!1);case 1:return Me(e.type,!0);case 31:return Ae(`Activity`);case 30:return Ae(`ViewTransition`);default:return``}}function Pe(e){try{var t=``,n=null;do t+=Ne(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var Fe=Object.prototype.hasOwnProperty,Ie=t.unstable_scheduleCallback,Le=t.unstable_cancelCallback,Re=t.unstable_shouldYield,ze=t.unstable_requestPaint,Be=t.unstable_now,Ve=t.unstable_getCurrentPriorityLevel,He=t.unstable_ImmediatePriority,Ue=t.unstable_UserBlockingPriority,We=t.unstable_NormalPriority,Ge=t.unstable_LowPriority,Ke=t.unstable_IdlePriority,qe=t.log,Je=t.unstable_setDisableYieldValue,Ye=null,Xe=null;function Ze(e){if(typeof qe==`function`&&Je(e),Xe&&typeof Xe.setStrictMode==`function`)try{Xe.setStrictMode(Ye,e)}catch{}}var Qe=Math.clz32?Math.clz32:tt,$e=Math.log,et=Math.LN2;function tt(e){return e>>>=0,e===0?32:31-($e(e)/et|0)|0}var nt=256,rt=262144,it=4194304;function at(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&-e;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 ot(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=at(n))):i=at(o):i=at(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=at(n))):i=at(o)):i=at(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 st(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ct(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-Qe(n),i=1<<r;t|=e[r],n&=~i}return t}function lt(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 ut(){var e=it;return it<<=1,!(it&62914560)&&(it=4194304),e}function dt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ft(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function pt(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-Qe(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&&mt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function mt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Qe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ht(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Qe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function gt(e,t){var n=t&-t;return n=n&42?1:_t(n),(n&(e.suspendedLanes|t))===0?n:0}function _t(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 vt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function yt(){var e=R.p;return e===0?(e=window.event,e===void 0?32:wh(e.type)):e}function bt(e,t){var n=R.p;try{return R.p=e,t()}finally{R.p=n}}var xt=Math.random().toString(36).slice(2),St=`__reactFiber$`+xt,Ct=`__reactProps$`+xt,wt=`__reactContainer$`+xt,Tt=`__reactEvents$`+xt,Et=`__reactListeners$`+xt,Dt=`__reactHandles$`+xt,Ot=`__reactResources$`+xt,kt=`__reactMarker$`+xt,At=`__reactLoad$`+xt;function jt(e){delete e[St],delete e[Ct],delete e[Et],delete e[Dt]}function Mt(e){var t;if(t=e[St])return t;for(var n=e.parentNode;n;){if(t=n[wt]||n[St]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pm(e);e!==null;){if(n=e[St])return n;e=pm(e)}return t}e=n,n=e.parentNode}return null}function Nt(e){if(e=e[St]||e[wt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Ft(e){var t=e[Ot];return t||=e[Ot]={hoistableStyles:new Map,hoistableScripts:new Map},t}function It(e){e[kt]=!0}function Lt(e){e[At]=void 0}var Rt=new Set,zt={};function Bt(e,t){Vt(e,t),Vt(e+`Capture`,t)}function Vt(e,t){for(zt[e]=t,e=0;e<t.length;e++)Rt.add(t[e])}var Ht=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]*$`),Ut={},Wt={};function Gt(e){return Fe.call(Wt,e)?!0:Fe.call(Ut,e)?!1:Ht.test(e)?Wt[e]=!0:(Ut[e]=!0,!1)}var Kt=!1;function qt(){var e=Kt;return Kt=!1,e}function Jt(e,t,n){if(Gt(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 Yt(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 Xt(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 Zt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Qt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function $t(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 en(e){if(!e._valueTracker){var t=Qt(e)?`checked`:`value`;e._valueTracker=$t(e,t,``+e[t])}}function tn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Qt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var nn=/[\n"\\]/g;function rn(e){return e.replace(nn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function an(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=``+Zt(t)):e.value!==``+Zt(t)&&(e.value=``+Zt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):sn(e,Zt(n)):o===`number`&&e.value==t?sn(e,Zt(e.value)):sn(e,Zt(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=``+Zt(s):e.removeAttribute(`name`)}function on(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)){en(e);return}n=n==null?``:``+Zt(n),t=t==null?n:``+Zt(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),en(e)}function sn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function cn(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=``+Zt(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 ln(e,t,n){t!=null&&(t=``+Zt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Zt(n)}function un(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(pe(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Zt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),en(e)}function dn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var fn=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 pn(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||fn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function mn(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]=``,Kt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(pn(e,a,r),Kt=!0)}else for(var o in t)t.hasOwnProperty(o)&&pn(e,o,t[o])}function hn(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 gn=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`],[`maskType`,`mask-type`],[`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`]]),_n=/^[\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 vn(e){return _n.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function yn(){}var bn=null;function xn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sn=null,Cn=null;function wn(e){var t=Nt(e);if(t&&(e=t.stateNode)){var n=e[Ct]||null;a:switch(e=t.stateNode,t.type){case`input`:if(an(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="`+rn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Ct]||null;if(!a)throw Error(i(90));an(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&&tn(r)}break a;case`textarea`:ln(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&cn(e,!!n.multiple,t,!1)}}}var Tn=!1;function En(e,t,n){if(Tn)return e(t,n);Tn=!0;try{return e(t)}finally{if(Tn=!1,(Sn!==null||Cn!==null)&&(zd(),Sn&&(t=Sn,e=Cn,Cn=Sn=null,wn(t),e)))for(t=0;t<e.length;t++)wn(e[t])}}function Dn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Ct]||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,kn=!1;if(On)try{var An={};Object.defineProperty(An,"passive",{get:function(){kn=!0}}),window.addEventListener(`test`,An,An),window.removeEventListener(`test`,An,An)}catch{kn=!1}var jn=null,Mn=null,Nn=null;function Pn(){if(Nn)return Nn;var e,t=Mn,n=t.length,r,i=`value`in jn?jn.value:jn.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 Nn=i.slice(e,1<r?1-r:void 0)}function Fn(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 In(){return!0}function Ln(){return!1}function Rn(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)?In:Ln,this.isPropagationStopped=Ln,this}return D(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=In)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=In)},persist:function(){},isPersistent:In}),t}var zn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bn=Rn(zn),Vn=D({},zn,{view:0,detail:0}),Hn=Rn(Vn),Un,Wn,Gn,Kn=D({},Vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rr,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!==Gn&&(Gn&&e.type===`mousemove`?(Un=e.screenX-Gn.screenX,Wn=e.screenY-Gn.screenY):Wn=Un=0,Gn=e),Un)},movementY:function(e){return`movementY`in e?e.movementY:Wn}}),qn=Rn(Kn),Jn=Rn(D({},Kn,{dataTransfer:0})),Yn=Rn(D({},Vn,{relatedTarget:0})),Xn=Rn(D({},zn,{animationName:0,elapsedTime:0,pseudoElement:0})),Zn=Rn(D({},zn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Qn=Rn(D({},zn,{data:0})),$n={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},er={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`},tr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function nr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tr[e])?!!t[e]:!1}function rr(){return nr}var ir=Rn(D({},Vn,{key:function(e){if(e.key){var t=$n[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?er[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rr,charCode:function(e){return e.type===`keypress`?Fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ar=Rn(D({},Kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),or=Rn(D({},zn,{submitter:0})),sr=Rn(D({},Vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rr})),cr=Rn(D({},zn,{propertyName:0,elapsedTime:0,pseudoElement:0})),lr=Rn(D({},Kn,{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})),ur=Rn(D({},zn,{newState:0,oldState:0,source:0})),dr=[9,13,27,32],fr=On&&`CompositionEvent`in window,pr=null;On&&`documentMode`in document&&(pr=document.documentMode);var mr=On&&`TextEvent`in window&&!pr,hr=On&&(!fr||pr&&8<pr&&11>=pr),gr=` `,_r=!1;function vr(e,t){switch(e){case`keyup`:return dr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function yr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var br=!1;function xr(e,t){switch(e){case`compositionend`:return yr(t);case`keypress`:return t.which===32?(_r=!0,gr):null;case`textInput`:return e=t.data,e===gr&&_r?null:e;default:return null}}function Sr(e,t){if(br)return e===`compositionend`||!fr&&vr(e,t)?(e=Pn(),Nn=Mn=jn=null,br=!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 hr&&t.locale!==`ko`?null:t.data;default:return null}}var Cr={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 wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Cr[e.type]:t===`textarea`}function Tr(e,t,n,r){Sn?Cn?Cn.push(r):Cn=[r]:Sn=r,t=Jf(t,`onChange`),0<t.length&&(n=new Bn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Er=null,Dr=null;function Or(e){Hf(e,0)}function kr(e){if(tn(Pt(e)))return e}function Ar(e,t){if(e===`change`)return t}var jr=!1;if(On){var Mr;if(On){var Nr=`oninput`in document;if(!Nr){var Pr=document.createElement(`div`);Pr.setAttribute(`oninput`,`return;`),Nr=typeof Pr.oninput==`function`}Mr=Nr}else Mr=!1;jr=Mr&&(!document.documentMode||9<document.documentMode)}function Fr(){Er&&(Er.detachEvent(`onpropertychange`,Ir),Dr=Er=null)}function Ir(e){if(e.propertyName===`value`&&kr(Dr)){var t=[];Tr(t,Dr,e,xn(e)),En(Or,t)}}function Lr(e,t,n){e===`focusin`?(Fr(),Er=t,Dr=n,Er.attachEvent(`onpropertychange`,Ir)):e===`focusout`&&Fr()}function Rr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return kr(Dr)}function zr(e,t){if(e===`click`)return kr(t)}function Br(e,t){if(e===`input`||e===`change`)return kr(t)}function Vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Hr=typeof Object.is==`function`?Object.is:Vr;function Ur(e,t){if(Hr(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(!Fe.call(t,i)||!Hr(e[i],t[i]))return!1}return!0}function Wr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Gr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kr(e,t){var n=Gr(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=Gr(n)}}function qr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Wr(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=Wr(e.document)}return t}function Yr(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 Xr=On&&`documentMode`in document&&11>=document.documentMode,Zr=null,Qr=null,$r=null,ei=!1;function ti(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ei||Zr==null||Zr!==Wr(r)||(r=Zr,`selectionStart`in r&&Yr(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}),$r&&Ur($r,r)||($r=r,r=Jf(Qr,`onSelect`),0<r.length&&(t=new Bn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Zr)))}function ni(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ri={animationend:ni(`Animation`,`AnimationEnd`),animationiteration:ni(`Animation`,`AnimationIteration`),animationstart:ni(`Animation`,`AnimationStart`),transitionrun:ni(`Transition`,`TransitionRun`),transitionstart:ni(`Transition`,`TransitionStart`),transitioncancel:ni(`Transition`,`TransitionCancel`),transitionend:ni(`Transition`,`TransitionEnd`)},ii={},ai={};On&&(ai=document.createElement(`div`).style,`AnimationEvent`in window||(delete ri.animationend.animation,delete ri.animationiteration.animation,delete ri.animationstart.animation),`TransitionEvent`in window||delete ri.transitionend.transition);function oi(e){if(ii[e])return ii[e];if(!ri[e])return e;var t=ri[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ai)return ii[e]=t[n];return e}var si=oi(`animationend`),ci=oi(`animationiteration`),li=oi(`animationstart`),ui=oi(`transitionrun`),di=oi(`transitionstart`),fi=oi(`transitioncancel`),pi=oi(`transitionend`),mi=new Map,hi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);hi.push(`scrollEnd`);function gi(e,t){mi.set(e,t),Bt(t,[e])}var _i=0;function vi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=bd.identifierPrefix;var n=_i++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function yi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Od;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function bi(e,t){return e=yi(e),t=yi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var xi=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)},Si=[],Ci=0,wi=0;function Ti(){for(var e=Ci,t=wi=Ci=0;t<e;){var n=Si[t];Si[t++]=null;var r=Si[t];Si[t++]=null;var i=Si[t];Si[t++]=null;var a=Si[t];if(Si[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&&ki(n,i,a)}}function Ei(e,t,n,r){Si[Ci++]=e,Si[Ci++]=t,Si[Ci++]=n,Si[Ci++]=r,wi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Di(e,t,n,r){return Ei(e,t,n,r),Ai(e)}function Oi(e,t){return Ei(e,null,null,t),Ai(e)}function ki(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-Qe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ai(e){if(50<kd)throw kd=0,Ad=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ji={};function Mi(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 Ni(e,t,n,r){return new Mi(e,t,n,r)}function Pi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fi(e,t){var n=e.alternate;return n===null?(n=Ni(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&1206910976,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 Ii(e,t){e.flags&=1206910978;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 Li(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Pi(r)&&(s=1);else if(typeof r==`string`)s=Jm(e,n,be.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ie:return e=Ni(31,n,t,a),e.elementType=ie,e.lanes=o,e;case j:return Ri(n.children,a,o,t);case M:s=8,a|=24;break;case ee:return e=Ni(12,n,t,a|2),e.elementType=ee,e.lanes=o,e;case ne:return e=Ni(13,n,t,a),e.elementType=ne,e.lanes=o,e;case re:return e=Ni(19,n,t,a),e.elementType=re,e.lanes=o,e;case ae:case se:return e=a|32,e=Ni(30,n,t,e),e.elementType=se,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case P:s=10;break a;case N:s=9;break a;case te:s=11;break a;case F:s=14;break a;case I:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ni(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ri(e,t,n,r){return e=Ni(7,e,r,t),e.lanes=n,e}function zi(e,t,n){return e=Ni(6,e,null,t),e.lanes=n,e}function Bi(e){var t=Ni(18,null,null,0);return t.stateNode=e,t}function Vi(e,t,n){return t=Ni(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Hi=new WeakMap;function Ui(e,t){if(typeof e==`object`&&e){var n=Hi.get(e);return n===void 0?(t={value:e,source:t,stack:Pe(t)},Hi.set(e,t),t):n}return{value:e,source:t,stack:Pe(t)}}var z=[],Wi=0,Gi=null,Ki=0,qi=[],Ji=0,Yi=null,Xi=1,Zi=``;function Qi(e,t){z[Wi++]=Ki,z[Wi++]=Gi,Gi=e,Ki=t}function $i(e,t,n){qi[Ji++]=Xi,qi[Ji++]=Zi,qi[Ji++]=Yi,Yi=e;var r=Xi;e=Zi;var i=32-Qe(r)-1;r&=~(1<<i),n+=1;var a=32-Qe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Xi=1<<32-Qe(t)+i|n<<i|r,Zi=a+e}else Xi=1<<a|n<<i|r,Zi=e}function ea(e){e.return!==null&&(Qi(e,1),$i(e,1,0))}function ta(e){for(;e===Gi;)Gi=z[--Wi],z[Wi]=null,Ki=z[--Wi],z[Wi]=null;for(;e===Yi;)Yi=qi[--Ji],qi[Ji]=null,Zi=qi[--Ji],qi[Ji]=null,Xi=qi[--Ji],qi[Ji]=null}function na(e,t){qi[Ji++]=Xi,qi[Ji++]=Zi,qi[Ji++]=Yi,Xi=t.id,Zi=t.overflow,Yi=e}var ra=null,ia=null,B=!1,aa=null,V=!1,H=Error(i(519));function U(e){throw ua(Ui(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),H}function W(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[St]=e,t[Ct]=r,n){case`dialog`:Z(`cancel`,t),Z(`close`,t);break;case`iframe`:case`object`:case`embed`:Z(`load`,t);break;case`video`:case`audio`:for(n=0;n<Bf.length;n++)Z(Bf[n],t);break;case`source`:Z(`error`,t);break;case`img`:case`image`:case`link`:Z(`error`,t),Z(`load`,t);break;case`details`:Z(`toggle`,t);break;case`input`:Z(`invalid`,t),on(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Z(`invalid`,t);break;case`textarea`:Z(`invalid`,t),un(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||ep(t.textContent,n)?(r.popover!=null&&(Z(`beforetoggle`,t),Z(`toggle`,t)),r.onScroll!=null&&Z(`scroll`,t),r.onScrollEnd!=null&&Z(`scrollend`,t),r.onClick!=null&&(t.onclick=yn),t=!0):t=!1,t||U(e,!0)}function oa(e){for(ra=e.return;ra;)switch(ra.tag){case 5:case 31:case 13:V=!1;return;case 27:case 3:V=!0;return;default:ra=ra.return}}function sa(e){if(e!==ra)return!1;if(!B)return oa(e),B=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||mp(e.type,e.memoizedProps)),n=!n),n&&ia&&U(e),oa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ia=fm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ia=fm(e)}else t===27?(t=ia,Cp(e.type)?(e=dm,dm=null,ia=e):ia=t):ia=ra?um(e.stateNode.nextSibling):null;return!0}function ca(){ia=ra=null,B=!1}function la(){var e=aa;return e!==null&&(fd===null?fd=e:fd.push.apply(fd,e),aa=null),e}function ua(e){aa===null?aa=[e]:aa.push(e)}var da=_e(null),fa=null,pa=null;function ma(e,t,n){ye(da,t._currentValue),t._currentValue=n}function ha(e){e._currentValue=da.current,ve(da)}function ga(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 _a(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),ga(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),ga(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ga(a.return,n,e),s=a.child,s=s===null?null:s.sibling):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 va(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;Hr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Ce.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ch]:e.push(ch))}a=a.return}return e!==null&&_a(t,e,n,r),t.flags|=262144,e!==null}function ya(e){for(e=e.firstContext;e!==null;){if(!Hr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ba(e){fa=e,pa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xa(e){return Ca(fa,e)}function Sa(e,t){return fa===null&&ba(e),Ca(e,t)}function Ca(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},pa===null){if(e===null)throw Error(i(308));pa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else pa=pa.next=t;return n}var wa=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,Ea=t.unstable_NormalPriority,Da={$$typeof:P,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Oa(){return{controller:new wa,data:new Map,refCount:0}}function ka(e){e.refCount--,e.refCount===0&&Ta(Ea,function(){e.controller.abort()})}function Aa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var ja=null;function Ma(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Na=null,Pa=0,Fa=0,Ia=null;function La(e,t){if(Na===null){var n=Na=[];Pa=0,Fa=Ff(),Ia={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Pa++,t.then(Ra,Ra),t}function Ra(){if(--Pa===0&&(ja=null,Na!==null)){Ia!==null&&(Ia.status=`fulfilled`);var e=Na;Na=null,Fa=0,Ia=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function za(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 Ba=L.S;L.S=function(e,t){if(hd=Be(),typeof t==`object`&&t&&typeof t.then==`function`&&La(e,t),ja!==null)for(var n=xf;n!==null;)Aa(n,ja),n=n.next;if(n=e.types,n!==null){for(var r=xf;r!==null;)Aa(r,n),r=r.next;if(Fa!==0){r=ja,r===null&&(r=ja=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ba!==null&&Ba(e,t)};var Va=_e(null);function Ha(){var e=Va.current;return e===null?Xu.pooledCache:e}function Ua(e,t){t===null?ye(Va,Va.current):ye(Va,t.pool)}function Wa(){var e=Ha();return e===null?null:{parent:Da._currentValue,pool:e}}var Ga=Error(i(460)),Ka=Error(i(474)),G=Error(i(542)),qa={then:function(){}};function Ja(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ya(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(yn,yn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,$a(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(yn,yn);else{if(e=Xu,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,$a(e),e}throw Za=t,Ga}}function Xa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Za=e,Ga):e}}var Za=null;function Qa(){if(Za===null)throw Error(i(459));var e=Za;return Za=null,e}function $a(e){if(e===Ga||e===G)throw Error(i(483))}var eo=null,to=0;function K(e){var t=to;return to+=1,eo===null&&(eo=[]),Ya(eo,e,t)}function no(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ro(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function io(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=Fi(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|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=zi(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===j?(e=d(e,t,n.props.children,r,n.key),no(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===I&&Xa(i)===t.type)?(t=a(t,n.props),no(t,n),t.return=e,t):(t=Li(n.type,n.key,n.props,null,e.mode,r),no(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=Vi(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=Ri(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=zi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Li(t.type,t.key,t.props,null,e.mode,n),no(n,t),n.return=e,n;case A:return t=Vi(t,e.mode,n),t.return=e,t;case I:return t=Xa(t),f(e,t,n)}if(pe(t)||ue(t))return t=Ri(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,K(t),n);if(t.$$typeof===P)return f(e,Sa(e,t),n);ro(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 k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case I:return n=Xa(n),p(e,t,n,r)}if(pe(n)||ue(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,K(n),r);if(n.$$typeof===P)return p(e,t,Sa(e,n),r);ro(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 k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case I:return r=Xa(r),m(e,t,n,r,i)}if(pe(r)||ue(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,K(r),i);if(r.$$typeof===P)return m(e,t,n,Sa(t,r),i);ro(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),B&&Qi(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 B&&Qi(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(_.key===null?h:_.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)}),B&&Qi(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),B&&Qi(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 B&&Qi(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(_.key===null?g:_.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)}),B&&Qi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),no(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===I&&Xa(l)===r.type){n(e,r.sibling),c=a(r,o.props),no(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Ri(o.props.children,e.mode,c,o.key),no(c,o),c.return=e,e=c):(c=Li(o.type,o.key,o.props,null,e.mode,c),no(c,o),c.return=e,e=c)}return s(e);case A: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}n(e,r);break}t(e,r),r=r.sibling}c=Vi(o,e.mode,c),c.return=e,e=c}return s(e);case I:return o=Xa(o),_(e,r,o,c)}if(pe(o))return h(e,r,o,c);if(ue(o)){if(l=ue(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,K(o),c);if(o.$$typeof===P)return _(e,r,Sa(e,o),c);ro(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=zi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{to=0;var i=_(e,t,n,r);return eo=null,i}catch(t){if(t===Ga||t===G)throw t;var a=Ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ao=io(!0),oo=io(!1),so=!1;function q(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function J(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 co(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function lo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Yu&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ai(e),ki(e,null,n),t}return Ei(e,r,t,n),Ai(e)}function uo(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,ht(e,n)}}function fo(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}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var po=!1;function mo(){if(po){var e=Ia;if(e!==null)throw e}}function ho(e,t,n,r){po=!1;var i=e.updateQueue;so=!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?(Qu&f)===f:(r&f)===f){f!==0&&f===Fa&&(po=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:so=!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),od|=o,e.lanes=o,e.memoizedState=d}}function go(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function _o(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)go(n[e],t)}var vo=_e(null),yo=_e(0);function bo(e,t){e=id,ye(yo,e),ye(vo,t),id=e|t.baseLanes}function xo(){ye(yo,id),ye(vo,vo.current)}function So(){id=yo.current,ve(vo),ve(yo)}var Co=_e(null),wo=null;function To(e){var t=e.alternate;ye(Ao,Ao.current&1),ye(Co,e),wo===null&&(t===null||vo.current!==null||t.memoizedState!==null)&&(wo=e)}function Eo(e){ye(Ao,Ao.current),ye(Co,e),wo===null&&(wo=e)}function Do(e){e.tag===22?(ye(Ao,Ao.current),ye(Co,e),wo===null&&(wo=e)):Oo()}function Oo(){ye(Ao,Ao.current),ye(Co,Co.current)}function ko(e){ve(Co),wo===e&&(wo=null),ve(Ao)}var Ao=_e(0);function jo(e,t){ye(Co,Co.current),ye(Ao,t)}function Mo(e){ve(Ao),ve(Co),wo===e&&(wo=null)}function No(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||sm(n)||cm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 Po=0,Y=null,Fo=null,Io=null,Lo=!1,Ro=!1,zo=!1,Bo=0,Vo=0,Ho=null,Uo=0;function Wo(){throw Error(i(321))}function Go(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Hr(e[n],t[n]))return!1;return!0}function Ko(e,t,n,r,i,a){return Po=a,Y=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,L.H=e===null||e.memoizedState===null?lc:uc,zo=!1,a=n(r,i),zo=!1,Ro&&(a=Jo(t,n,r,i)),qo(e),a}function qo(e){L.H=cc;var t=Fo!==null&&Fo.next!==null;if(Po=0,Io=Fo=Y=null,Lo=!1,Vo=0,Ho=null,t)throw Error(i(300));e===null||Dc||(e=e.dependencies,e!==null&&ya(e)&&(Dc=!0))}function Jo(e,t,n,r){Y=e;var a=0;do{if(Ro&&(Ho=null),Vo=0,Ro=!1,25<=a)throw Error(i(301));if(a+=1,Io=Fo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}L.H=dc,o=t(n,r)}while(Ro);return o}function Yo(){var e=L.H,t=e.useState()[0];return t=typeof t.then==`function`?ns(t):t,e=e.useState()[0],(Fo===null?null:Fo.memoizedState)!==e&&(Y.flags|=1024),t}function Xo(){var e=Bo!==0;return Bo=0,e}function Zo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Qo(e){if(Lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Lo=!1}Po=0,Io=Fo=Y=null,Ro=!1,Vo=Bo=0,Ho=null}function $o(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Io===null?Y.memoizedState=Io=e:Io=Io.next=e,Io}function es(){if(Fo===null){var e=Y.alternate;e=e===null?null:e.memoizedState}else e=Fo.next;var t=Io===null?Y.memoizedState:Io.next;if(t!==null)Io=t,Fo=e;else{if(e===null)throw Y.alternate===null?Error(i(467)):Error(i(310));Fo=e,e={memoizedState:Fo.memoizedState,baseState:Fo.baseState,baseQueue:Fo.baseQueue,queue:Fo.queue,next:null},Io===null?Y.memoizedState=Io=e:Io=Io.next=e}return Io}function ts(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ns(e){var t=Vo;return Vo+=1,Ho===null&&(Ho=[]),e=Ya(Ho,e,t),t=Y,(Io===null?t.memoizedState:Io.next)===null&&(t=t.alternate,L.H=t===null||t.memoizedState===null?lc:uc),e}function rs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ns(e);if(e.$$typeof===ce)return;if(e.$$typeof===P)return xa(e)}throw Error(i(438,String(e)))}function is(e){var t=null,n=Y.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Y.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=ts(),Y.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]=oe;return t.index++,n}function as(e,t){return typeof t==`function`?t(e):t}function os(e){return ss(es(),Fo,e)}function ss(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?(Po&f)===f:(Qu&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===Fa&&(d=!0);else if((Po&p)===p){u=u.next,p===Fa&&(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,Y.lanes|=p,od|=p;f=u.action,zo&&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,Y.lanes|=f,od|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Hr(o,e.memoizedState)&&(Dc=!0,d&&(n=Ia,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 cs(e){var t=es(),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);Hr(o,t.memoizedState)||(Dc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ls(e,t,n){var r=Y,a=es(),o=B;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Hr((Fo||a).memoizedState,n);if(s&&(a.memoizedState=n,Dc=!0),a=a.queue,Ps(fs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Io!==null&&!!(Io.memoizedState.tag&1),ks(e?9:8,{destroy:void 0},ds.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Xu===null)throw Error(i(349));o||Po&127||us(r,t,n)}return n}function us(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Y.updateQueue,t===null?(t=ts(),Y.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ds(e,t,n,r){t.value=n,t.getSnapshot=r,ps(t)&&ms(e)}function fs(e,t,n){return n(function(){ps(t)&&ms(e)})}function ps(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Hr(e,n)}catch{return!0}}function ms(e){var t=Oi(e,2);t!==null&&Pd(t,e,2)}function hs(e){var t=$o();if(typeof e==`function`){var n=e;if(e=n(),zo){Ze(!0);try{n()}finally{Ze(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:e},t}function gs(e,t,n,r){return e.baseState=n,ss(e,Fo,typeof r==`function`?r:as)}function _s(e,t,n,r,a){if(ac(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)}};L.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,vs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function vs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=L.T,o={};o.types=a===null?null:a.types,L.T=o;try{var s=n(i,r),c=L.S;c!==null&&c(o,s),ys(e,t,s)}catch(n){xs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),L.T=a}}else try{a=n(i,r),ys(e,t,a)}catch(n){xs(e,t,n)}}function ys(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){bs(e,t,n)},function(n){return xs(e,t,n)}):bs(e,t,n)}function bs(e,t,n){t.status=`fulfilled`,t.value=n,Ss(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,vs(e,n)))}function xs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ss(t),t=t.next;while(t!==r)}e.action=null}function Ss(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Cs(e,t){return t}function ws(e,t){if(B){var n=Xu.formState;if(n!==null){a:{var r=Y;if(B){if(ia){b:{for(var i=ia,a=V;i.nodeType!==8;)if(!a||(i=um(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ia=um(i.nextSibling),r=i.data===`F!`;break a}}U(r)}r=!1}r&&(t=n[0])}}return n=$o(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cs,lastRenderedState:t},n.queue=r,n=nc.bind(null,Y,r),r.dispatch=n,r=hs(!1),a=ic.bind(null,Y,!1,r.queue),r=$o(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=_s.bind(null,Y,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ts(e){return Es(es(),Fo,e)}function Es(e,t,n){if(t=ss(e,t,Cs)[0],e=os(as)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ns(t)}catch(e){throw e===Ga?G:e}else r=t;t=es();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Y.flags|=2048,ks(9,{destroy:void 0},Ds.bind(null,i,n),null)),[r,a,e]}function Ds(e,t){e.action=t}function Os(e){var t=es(),n=Fo;if(n!==null)return Es(t,n,e);es(),t=t.memoizedState,n=es();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ks(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Y.updateQueue,t===null&&(t=ts(),Y.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 es().memoizedState}function js(e,t,n,r){var i=$o();Y.flags|=e,i.memoizedState=ks(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ms(e,t,n,r){var i=es();r=r===void 0?null:r;var a=i.memoizedState.inst;Fo!==null&&r!==null&&Go(r,Fo.memoizedState.deps)?i.memoizedState=ks(t,a,n,r):(Y.flags|=e,i.memoizedState=ks(1|t,a,n,r))}function Ns(e,t){js(8390656,8,e,t)}function Ps(e,t){Ms(2048,8,e,t)}function Fs(e){Y.flags|=4;var t=Y.updateQueue;if(t===null)t=ts(),Y.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Is(e){var t=es().memoizedState;return Fs({ref:t,nextImpl:e}),function(){if(Yu&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Ls(e,t){return Ms(4,2,e,t)}function Rs(e,t){return Ms(4,4,e,t)}function zs(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 Bs(e,t,n){n=n==null?null:n.concat([e]),Ms(4,4,zs.bind(null,t,e),n)}function Vs(){}function Hs(e,t){var n=es();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Go(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Us(e,t){var n=es();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Go(t,r[1]))return r[0];if(r=e(),zo){Ze(!0);try{e()}finally{Ze(!1)}}return n.memoizedState=[r,t],r}function Ws(e,t,n){return n===void 0||Po&1073741824&&!(Qu&261930)?e.memoizedState=t:(e.memoizedState=n,e=Md(),Y.lanes|=e,od|=e,n)}function Gs(e,t,n,r){return Hr(n,t)?n:vo.current===null?!(Po&106)||Po&1073741824&&!(Qu&261930)?(Dc=!0,e.memoizedState=n):(e=Md(),Y.lanes|=e,od|=e,t):(e=Ws(e,n,r),Hr(e,t)||(Dc=!0),e)}function Ks(e,t,n,r,i){var a=R.p;R.p=a!==0&&8>a?a:8;var o=L.T,s={};s.types=o===null?null:o.types,L.T=s,ic(e,!1,t,n);try{var c=i(),l=L.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?rc(e,t,za(c,r),jd(e)):rc(e,t,r,jd(e))}catch(n){rc(e,t,{then:function(){},status:`rejected`,reason:n},jd())}finally{R.p=a,o!==null&&s.types!==null&&(o.types=s.types),L.T=o}}function qs(){}function Js(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ys(e).queue;Ks(e,a,t,me,n===null?qs:function(){return Xs(e),n(r)})}function Ys(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:me,baseState:me,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:me},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Xs(e){var t=Ys(e);t.next===null&&(t=e.alternate.memoizedState),rc(e,t.next.queue,{},jd())}function Zs(){return xa(ch)}function Qs(){return es().memoizedState}function $s(){return es().memoizedState}function ec(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=jd();e=co(n);var r=lo(t,e,n);r!==null&&(Pd(r,t,n),uo(r,t,n)),t={cache:Oa()},e.payload=t;return}t=t.return}}function tc(e,t,n){var r=jd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ac(e)?oc(t,n):(n=Di(e,t,n,r),n!==null&&(Pd(n,e,r),sc(n,t,r)))}function nc(e,t,n){rc(e,t,n,jd())}function rc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ac(e))oc(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,Hr(s,o))return Ei(e,t,i,0),Xu===null&&Ti(),!1}catch{}if(n=Di(e,t,i,r),n!==null)return Pd(n,e,r),sc(n,t,r),!0}return!1}function ic(e,t,n,r){if(r={lane:2,revertLane:Ff(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ac(e)){if(t)throw Error(i(479))}else t=Di(e,n,r,2),t!==null&&Pd(t,e,2)}function ac(e){var t=e.alternate;return e===Y||t!==null&&t===Y}function oc(e,t){Ro=Lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function sc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ht(e,n)}}var cc={readContext:xa,use:rs,useCallback:Wo,useContext:Wo,useEffect:Wo,useImperativeHandle:Wo,useLayoutEffect:Wo,useInsertionEffect:Wo,useMemo:Wo,useReducer:Wo,useRef:Wo,useState:Wo,useDebugValue:Wo,useDeferredValue:Wo,useTransition:Wo,useSyncExternalStore:Wo,useId:Wo,useHostTransitionStatus:Wo,useFormState:Wo,useActionState:Wo,useOptimistic:Wo,useMemoCache:Wo,useCacheRefresh:Wo,useEffectEvent:Wo},lc={readContext:xa,use:rs,useCallback:function(e,t){return $o().memoizedState=[e,t===void 0?null:t],e},useContext:xa,useEffect:Ns,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),js(4194308,4,zs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return js(4194308,4,e,t)},useInsertionEffect:function(e,t){js(4,2,e,t)},useMemo:function(e,t){var n=$o();t=t===void 0?null:t;var r=e();if(zo){Ze(!0);try{e()}finally{Ze(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=$o();if(n!==void 0){var i=n(t);if(zo){Ze(!0);try{n(t)}finally{Ze(!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=tc.bind(null,Y,e),[r.memoizedState,e]},useRef:function(e){var t=$o();return e={current:e},t.memoizedState=e},useState:function(e){e=hs(e);var t=e.queue,n=nc.bind(null,Y,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Vs,useDeferredValue:function(e,t){return Ws($o(),e,t)},useTransition:function(){var e=hs(!1);return e=Ks.bind(null,Y,e.queue,!0,!1),$o().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Y,a=$o();if(B){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Xu===null)throw Error(i(349));Qu&127||us(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ns(fs.bind(null,r,o,e),[e]),r.flags|=2048,ks(9,{destroy:void 0},ds.bind(null,r,o,n,t),null),n},useId:function(){var e=$o(),t=Xu.identifierPrefix;if(B){var n=Zi,r=Xi;n=(r&~(1<<32-Qe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Bo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Uo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Zs,useFormState:ws,useActionState:ws,useOptimistic:function(e){var t=$o();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ic.bind(null,Y,!0,n),n.dispatch=t,[e,t]},useMemoCache:is,useCacheRefresh:function(){return $o().memoizedState=ec.bind(null,Y)},useEffectEvent:function(e){var t=$o(),n={impl:e};return t.memoizedState=n,function(){if(Yu&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},uc={readContext:xa,use:rs,useCallback:Hs,useContext:xa,useEffect:Ps,useImperativeHandle:Bs,useInsertionEffect:Ls,useLayoutEffect:Rs,useMemo:Us,useReducer:os,useRef:As,useState:function(){return os(as)},useDebugValue:Vs,useDeferredValue:function(e,t){return Gs(es(),Fo.memoizedState,e,t)},useTransition:function(){var e=os(as)[0],t=es().memoizedState;return[typeof e==`boolean`?e:ns(e),t]},useSyncExternalStore:ls,useId:Qs,useHostTransitionStatus:Zs,useFormState:Ts,useActionState:Ts,useOptimistic:function(e,t){return gs(es(),Fo,e,t)},useMemoCache:is,useCacheRefresh:$s,useEffectEvent:Is},dc={readContext:xa,use:rs,useCallback:Hs,useContext:xa,useEffect:Ps,useImperativeHandle:Bs,useInsertionEffect:Ls,useLayoutEffect:Rs,useMemo:Us,useReducer:cs,useRef:As,useState:function(){return cs(as)},useDebugValue:Vs,useDeferredValue:function(e,t){var n=es();return Fo===null?Ws(n,e,t):Gs(n,Fo.memoizedState,e,t)},useTransition:function(){var e=cs(as)[0],t=es().memoizedState;return[typeof e==`boolean`?e:ns(e),t]},useSyncExternalStore:ls,useId:Qs,useHostTransitionStatus:Zs,useFormState:Os,useActionState:Os,useOptimistic:function(e,t){var n=es();return Fo===null?(n.baseState=e,[e,n.queue.dispatch]):gs(n,Fo,e,t)},useMemoCache:is,useCacheRefresh:$s,useEffectEvent:Is};function fc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var pc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=jd(),i=co(r);i.payload=t,n!=null&&(i.callback=n),t=lo(e,i,r),t!==null&&(Pd(t,e,r),uo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=jd(),i=co(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=lo(e,i,r),t!==null&&(Pd(t,e,r),uo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=jd(),r=co(n);r.tag=2,t!=null&&(r.callback=t),t=lo(e,r,n),t!==null&&(Pd(t,e,n),uo(t,e,n))}};function mc(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?!Ur(n,r)||!Ur(i,a):!0}function hc(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&&pc.enqueueReplaceState(t,t.state,null)}function gc(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=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function _c(e){xi(e)}function vc(e){console.error(e)}function yc(e){xi(e)}function bc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function xc(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 Sc(e,t,n){return n=co(n),n.tag=3,n.payload={element:null},n.callback=function(){bc(e,t)},n}function Cc(e){return e=co(e),e.tag=3,e}function wc(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(){xc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){xc(t,n,r),typeof i!=`function`&&(vd===null?vd=new Set([this]):vd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Tc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&va(t,n,a,!0),n=Co.current,n!==null){switch(n.tag){case 31:case 13:case 19:return wo===null?Kd():n.alternate===null&&ad===0&&(ad=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===qa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),hf(e,r,a)),!1;case 22:return n.flags|=65536,r===qa?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)),hf(e,r,a)),!1}throw Error(i(435,n.tag))}return hf(e,r,a),Kd(),!1}if(B)return t=Co.current,t===null?(r!==H&&(t=Error(i(423),{cause:r}),ua(Ui(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ui(r,n),a=Sc(e.stateNode,r,a),fo(e,a),ad!==4&&(ad=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==H&&(e=Error(i(422),{cause:r}),ua(Ui(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ui(o,n),dd===null?dd=[o]:dd.push(o),ad!==4&&(ad=2),t===null)return!0;r=Ui(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Sc(n.stateNode,r,e),fo(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`&&(vd===null||!vd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Cc(a),wc(a,e,n,r),fo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Ec=Error(i(461)),Dc=!1;function Oc(e,t,n,r){t.child=e===null?oo(t,null,n,r):ao(t,e.child,n,r)}function kc(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 ba(t),r=Ko(e,t,n,o,a,i),s=Xo(),e!==null&&!Dc?(Zo(e,t,i),rl(e,t,i)):(B&&s&&ea(t),t.flags|=1,Oc(e,t,r,i),t.child)}function Ac(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Pi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,jc(e,t,a,r,i)):(e=Li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!il(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ur:n,n(o,r)&&e.ref===t.ref)return rl(e,t,i)}return t.flags|=1,e=Fi(a,r),e.ref=t.ref,e.return=t,t.child=e}function jc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ur(a,r)&&e.ref===t.ref){if(Dc=!1,t.pendingProps=r=a,il(e,i))e.flags&131072&&(Dc=!0);else return t.lanes=e.lanes,rl(e,t,i)}}return zc(e,t,n,r,i)}function Mc(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 Pc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ua(t,a===null?null:a.cachePool),a===null?xo():bo(t,a),Do(t);else return r=t.lanes=536870912,Pc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ua(t,null),xo(),Oo()):(Ua(t,a.cachePool),bo(t,a),Oo(),t.memoizedState=null);return Oc(e,t,i,n),t.child}function Nc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Pc(e,t,n,r,i){var a=Ha();return a=a===null?null:{parent:Da._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ua(t,null),xo(),Do(t),e!==null&&va(e,t,r,!0),t.childLanes=i,null}function Fc(e,t){return t=Jc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Ic(e,t,n){return ao(t,e.child,null,n),e=Fc(t,t.pendingProps),e.flags|=2,ko(t),t.memoizedState=null,e}function Lc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(B){if(r.mode===`hidden`)return e=Fc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Nc(null,e);if(Eo(t),(e=ia)?(e=om(e,V),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yi===null?null:{id:Xi,overflow:Zi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ra=t,ia=null)):e=null,e===null)throw U(t);return t.lanes=536870912,null}return Fc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Eo(t),a){if(t.flags&256)t.flags&=-257,t=Ic(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Dc||va(e,t,n,!1),a=(n&e.childLanes)!==0,Dc||a){if(vo.current===null){if(r=Xu,r!==null&&(s=gt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Oi(e,s),Pd(r,e,s),Ec;Kd()}t=Ic(e,t,n)}else e=o.treeContext,ia=um(s.nextSibling),ra=t,B=!0,aa=null,V=!1,e!==null&&na(t,e),t=Fc(t,r),t.flags|=134221824;return t}return e=Fi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Rc(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 zc(e,t,n,r,i){return ba(t),n=Ko(e,t,n,r,void 0,i),r=Xo(),e!==null&&!Dc?(Zo(e,t,i),rl(e,t,i)):(B&&r&&ea(t),t.flags|=1,Oc(e,t,n,i),t.child)}function Bc(e,t,n,r,i,a){return ba(t),t.updateQueue=null,n=Jo(t,r,n,i),qo(e),r=Xo(),e!==null&&!Dc?(Zo(e,t,a),rl(e,t,a)):(B&&r&&ea(t),t.flags|=1,Oc(e,t,n,a),t.child)}function Vc(e,t,n,r,i){if(ba(t),t.stateNode===null){var a=ji,o=n.contextType;typeof o==`object`&&o&&(a=xa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=pc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},q(t),o=n.contextType,a.context=typeof o==`object`&&o?xa(o):ji,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(fc(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&&pc.enqueueReplaceState(a,a.state,null),ho(t,r,a,i),mo(),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=gc(n,s);a.props=c;var l=a.context,u=n.contextType;o=ji,typeof u==`object`&&u&&(o=xa(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)&&hc(t,a,r,o),so=!1;var f=t.memoizedState;a.state=f,ho(t,r,a,i),mo(),l=t.memoizedState,s||f!==l||so?(typeof d==`function`&&(fc(t,n,d,r),l=t.memoizedState),(c=so||mc(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,J(e,t),o=t.memoizedProps,u=gc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ji,typeof l==`object`&&l&&(c=xa(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)&&hc(t,a,r,c),so=!1,f=t.memoizedState,a.state=f,ho(t,r,a,i),mo();var p=t.memoizedState;o!==d||f!==p||so||e!==null&&e.dependencies!==null&&ya(e.dependencies)?(typeof s==`function`&&(fc(t,n,s,r),p=t.memoizedState),(u=so||mc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ya(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,Rc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=ao(t,e.child,null,i),t.child=ao(t,null,n,i)):Oc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=rl(e,t,i),e}function Hc(e,t,n,r){return ca(),t.flags|=256,Oc(e,t,n,r),t.child}var Uc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wc(e){return{baseLanes:e,cachePool:Wa()}}function Gc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ld),e}function Kc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Ao.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(B){if(i?To(t):Oo(),(e=ia)?(e=om(e,V),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yi===null?null:{id:Xi,overflow:Zi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ra=t,ia=null)):e=null,e===null)throw U(t);return t.lanes=cm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Oo(),i=t.mode,a=Jc({mode:`hidden`,children:a},i),r=Ri(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Wc(n),r.childLanes=Gc(e,o,n),t.memoizedState=Uc,Nc(null,r)):(To(t),qc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Xc(e,t,a,o,r,c,s,n)}return i?(Oo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Fi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ri(i,a,n,null),i.flags|=2):i=Fi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Nc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Wc(n):(a=i.cachePool,a===null?a=Wa():(s=Da._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Gc(e,o,n),t.memoizedState=Uc,Nc(e.child,r)):(To(t),n=e.child,e=n.sibling,n=Fi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function qc(e,t){return t=Jc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Jc(e,t){return e=Ni(22,e,null,t),e.lanes=0,e}function Yc(e,t,n){return ao(t,e.child,null,n),e=qc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Xc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(To(t),t.flags&=-257,Yc(e,t,c)):t.memoizedState===null?(Oo(),o=a.fallback,s=t.mode,a=Jc({mode:`visible`,children:a.children},s),o=Ri(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,ao(t,e.child,null,c),a=t.child,a.memoizedState=Wc(c),a.childLanes=Gc(e,r,c),t.memoizedState=Uc,Nc(null,a)):(Oo(),t.child=e.child,t.flags|=128,null);if(To(t),cm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ua({value:a,source:null,stack:null})),Yc(e,t,c)}if(Dc||va(e,t,c,!1),r=(c&e.childLanes)!==0,Dc||r){if(vo.current!==null)return Yc(e,t,c);if(r=Xu,r!==null&&(a=gt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Oi(e,a),Pd(r,e,a),Ec;return sm(o)||Kd(),Yc(e,t,c)}return sm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ia=um(o.nextSibling),ra=t,B=!0,aa=null,V=!1,e!==null&&na(t,e),t=qc(t,a.children),t.flags|=134221824,t)}function Zc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ga(e.return,t,n)}function Qc(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&No(n)===null&&(t=e),e=e.sibling}return t}function $c(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 el(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function tl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Ao.current;if(t.flags&128)return jo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,jo(t,o),i===`backwards`&&e!==null?(el(e),Oc(e,t,r,n),el(e)):Oc(e,t,r,n),r=B?Ki:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Zc(e,n,t);else if(e.tag===19)Zc(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`backwards`:n=Qc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,el(t)),$c(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&No(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}$c(t,!0,n,null,a,r);break;case`together`:$c(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=Qc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),$c(t,!1,i,n,a,r)}return t.child}function nl(e,t,n){var r=t.pendingProps;return ma(t,t.type,r.value),Oc(e,t,r.children,n),t.child}function rl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),od|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(va(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=Fi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function il(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ya(e)))}function al(e,t,n){switch(t.tag){case 3:we(t,t.stateNode.containerInfo),ma(t,Da,e.memoizedState.cache),ca();break;case 27:case 5:Ee(t);break;case 4:we(t,t.stateNode.containerInfo);break;case 10:ma(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Eo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return To(t),t.flags|=128,null;r=va(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Kc(e,t,n):(To(t),e=rl(e,t,n),e===null?null:e.sibling)}To(t);break;case 19:if(t.flags&128)return tl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(va(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return tl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),jo(t,Ao.current),r)break;return null;case 22:return t.lanes=0,Mc(e,t,n,t.pendingProps);case 24:ma(t,Da,e.memoizedState.cache)}return rl(e,t,n)}function ol(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Dc=!0;else{if(!il(e,n)&&!(t.flags&128))return Dc=!1,al(e,t,n);Dc=!!(e.flags&131072)}}else Dc=!1,B&&t.flags&1048576&&$i(t,Ki,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Xa(t.elementType),t.type=e,typeof e==`function`)Pi(e)?(r=gc(e,r),t.tag=1,t=Vc(null,t,e,r,n)):(t.tag=0,t=zc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===te){t.tag=11,t=kc(null,t,e,r,n);break a}if(a===F){t.tag=14,t=Ac(null,t,e,r,n);break a}if(a===P){t.tag=10,t.type=e,t=nl(null,t,n);break a}}throw t=fe(e)||e,Error(i(306,t,``))}}return t;case 0:return zc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=gc(r,t.pendingProps),Vc(e,t,r,a,n);case 3:a:{if(we(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,J(e,t),ho(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ma(t,Da,r),r!==o.cache&&_a(t,[Da],n,!0),mo(),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=Hc(e,t,r,n);break a}if(r!==a){a=Ui(Error(i(424)),t),ua(a),t=Hc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ia=um(e.firstChild),ra=t,B=!0,aa=null,V=!0,n=oo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ca(),r===a){t=rl(e,t,n);break a}Oc(e,t,r,n)}t=t.child}return t;case 26:return Rc(e,t),e===null?(n=Pm(t.type,null,t.pendingProps,null))?t.memoizedState=n:B||(t.stateNode=pp(t.type,t.pendingProps,Se.current,t)):t.memoizedState=Pm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ee(t),e===null&&B&&(r=t.stateNode=gm(t.type,t.pendingProps,Se.current),ra=t,V=!0,a=ia,Cp(t.type)?(dm=a,ia=um(r.firstChild)):ia=a),Oc(e,t,t.pendingProps.children,n),Rc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&B&&((a=r=ia)&&(r=im(r,t.type,t.pendingProps,V),r===null?a=!1:(t.stateNode=r,ra=t,ia=um(r.firstChild),V=!1,a=!0)),a||U(t)),Ee(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,mp(a,o)?r=null:s!==null&&mp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Ko(e,t,Yo,null,null,n),ch._currentValue=a),Rc(e,t),Oc(e,t,r,n),t.child;case 6:return e===null&&B&&((e=n=ia)&&(n=am(n,t.pendingProps,V),n===null?e=!1:(t.stateNode=n,ra=t,ia=null,e=!0)),e||U(t)),null;case 13:return Kc(e,t,n);case 4:return we(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ao(t,null,r,n):Oc(e,t,r,n),t.child;case 11:return kc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Rc(e,t),Oc(e,t,r,n),t.child;case 8:return Oc(e,t,t.pendingProps.children,n),t.child;case 12:return Oc(e,t,t.pendingProps.children,n),t.child;case 10:return nl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ba(t),a=xa(a),r=r(a),t.flags|=1,Oc(e,t,r,n),t.child;case 14:return Ac(e,t,t.type,t.pendingProps,n);case 15:return jc(e,t,t.type,t.pendingProps,n);case 19:return tl(e,t,n);case 31:return Lc(e,t,n);case 22:return Mc(e,t,n,t.pendingProps);case 24:return ba(t),r=xa(Da),e===null?(a=Ha(),a===null&&(a=Xu,o=Oa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},q(t),ma(t,Da,a)):((e.lanes&n)!==0&&(J(e,t),ho(t,null,null,n),mo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ma(t,Da,r),r!==a.cache&&_a(t,[Da],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ma(t,Da,r))),Oc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:B&&ea(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Rc(e,t),Oc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function sl(e){e.flags|=4}function cl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Ym(t,r):Ym(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Ud())e.flags|=8192;else throw Za=qa,Ka}}else e.flags&=-16777217}function ll(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Xm(t)){if(Ud())e.flags|=8192;else throw Za=qa,Ka}}function ul(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ut(),e.lanes|=t,ud|=t)}function dl(e,t){if(!B)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function fl(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&1206910976,r|=i.flags&1206910976,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 pl(e,t,n){var r=t.pendingProps;switch(ta(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fl(t),null;case 1:return fl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ha(Da),Te(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(sa(t)?sl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,la())),fl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(sl(t),o===null?(fl(t),cl(t,a,null,r,n)):(fl(t),ll(t,o))):o?o===e.memoizedState?(fl(t),t.flags&=-16777217):(sl(t),fl(t),ll(t,o)):(e=e.memoizedProps,e!==r&&sl(t),fl(t),cl(t,a,e,r,n)),null;case 27:if(De(t),n=Se.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return fl(t),t.subtreeFlags&=-33554433,null}e=be.current,sa(t)?W(t,e):(e=gm(a,r,n),t.stateNode=e,sl(t))}return fl(t),t.subtreeFlags&=-33554433,null;case 5:if(De(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return fl(t),t.subtreeFlags&=-33554433,null}if(o=be.current,sa(t))W(t,o);else{var s=up(Se.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[St]=t,o[Ct]=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(rp(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&&sl(t)}}return fl(t),t.subtreeFlags&=-33554433,cl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Se.current,sa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ra,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[St]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ep(e.nodeValue,n)),e||U(t,!0)}else e=up(e).createTextNode(r),e[St]=t,t.stateNode=e}return fl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=sa(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[St]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;fl(t),e=!1}else n=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ko(t),t):(ko(t),null);if(t.flags&128)throw Error(i(558))}return fl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=sa(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[St]=t}else ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;fl(t),a=!1}else a=la(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ko(t),t):(ko(t),null)}return ko(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),ul(t,t.updateQueue),fl(t),null);case 4:return Te(),e===null&&Wf(t.stateNode.containerInfo),t.flags|=67108864,fl(t),null;case 10:return ha(t.type),fl(t),null;case 19:if(Mo(t),r=t.memoizedState,r===null)return fl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)dl(r,!1);else{if(ad!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=No(e),o!==null){for(t.flags|=128,dl(r,!1),e=o.updateQueue,t.updateQueue=e,ul(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ii(n,e),n=n.sibling;return jo(t,Ao.current&1|2),B&&Qi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Be()>gd&&(t.flags|=128,a=!0,dl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=No(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,ul(t,e),dl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!B)return fl(t),null}else 2*Be()-r.renderingStartTime>gd&&n!==536870912&&(t.flags|=128,a=!0,dl(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)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Be(),e.sibling=null,o=Ao.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||B?jo(t,o):(n=o,ye(Co,t),ye(Ao,n),wo===null&&(wo=t)),B&&Qi(t,r.treeForkCount),e}return fl(t),null;case 22:case 23:return ko(t),So(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(fl(t),t.subtreeFlags&6&&(t.flags|=8192)):fl(t),n=t.updateQueue,n!==null&&ul(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&&ve(Va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ha(Da),fl(t),null;case 25:return null;case 30:return t.flags|=33554432,fl(t),null}throw Error(i(156,t.tag))}function ml(e,t){switch(ta(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ha(Da),Te(),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(ko(t),t.alternate===null)throw Error(i(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ko(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Mo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Te(),null;case 10:return ha(t.type),null;case 22:case 23:return ko(t),So(),e!==null&&ve(Va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ha(Da),null;case 25:return null;default:return null}}function hl(e,t){switch(ta(t),t.tag){case 3:ha(Da),Te();break;case 26:case 27:case 5:De(t);break;case 4:Te();break;case 31:t.memoizedState!==null&&ko(t);break;case 13:ko(t);break;case 19:Mo(t);break;case 10:ha(t.type);break;case 22:case 23:ko(t),So(),e!==null&&ve(Va);break;case 24:ha(Da)}}function gl(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){mf(t,t.return,e)}}function _l(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){mf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){mf(t,t.return,e)}}function vl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{_o(t,n)}catch(t){mf(e,e.return,t)}}}function yl(e,t,n){n.props=gc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){mf(e,t,n)}}function bl(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:var i=e.stateNode,a=vi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Fp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Ip(e);h(e.child,!1,$p,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){mf(e,t,n)}}function xl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){mf(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){mf(e,t,n)}else n.current=null}}function Sl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)tm(e.stateNode,t[n])}function Cl(e){for(var t=e.return;t!==null&&(El(t)&&tm(e.stateNode,t.stateNode),!Tl(t));)t=t.return}function wl(e){for(var t=e.return;t!==null&&(El(t)&&nm(e.stateNode,t.stateNode),!Tl(t));)t=t.return}function Tl(e){return e.tag===5||e.tag===3||e.tag===27}function El(e){return e&&e.tag===7&&e.stateNode!==null}function Dl(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){mf(e,e.return,t)}}function Ol(e,t,n){try{var r=e.stateNode;ap(r,e.type,n,t),r[Ct]=t}catch(t){mf(e,e.return,t)}}function kl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Cp(e.type)||e.tag===4}function Al(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||kl(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&&Cp(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 jl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=yn)),Sl(e,r),Kt=!0;else if(i!==4&&(i===27&&(Sl(e,r),r=null,Cp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(jl(e,t,n,r),e=e.sibling;e!==null;)jl(e,t,n,r),e=e.sibling}function Ml(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Sl(e,r),Kt=!0;else if(i!==4&&(i===27&&(Sl(e,r),r=null,Cp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ml(e,t,n,r),e=e.sibling;e!==null;)Ml(e,t,n,r),e=e.sibling}function Nl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);rp(t,r,n),t[St]=e,t[Ct]=n}catch(t){mf(e,e.return,t)}}var Pl=!1,Fl=null;function Il(e){(e.tag===30||e.subtreeFlags&33554432)&&(Pl=!0)}var Ll=null;function Rl(){var e=Ll;return Ll=null,e}var zl=0;function Bl(e,t,n,r,i){return zl=0,Vl(e.child,t,n,r,i)}function Vl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=kp(o);r.push(s),s.view&&(a=!0)}else a||kp(o).view&&(a=!0);Pl=!0,Ep(o,zl===0?t:t+`_`+zl,n),zl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Vl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Hl(e,t){for(;e!==null;)e.tag===5?Dp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Hl(e.child,t)),e=e.sibling}function Ul(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Ul(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=bi(t.default,t.share),t!==`none`&&(Bl(e,n,t,null,!1)||Hl(e.child,!1))}e=e.sibling}}function Wl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=vi(r,n),a=bi(r.default,n.paired?r.share:r.enter);a===`none`?Ul(e):Bl(e,i,a,null,!1)?(Ul(e),n.paired||t||Nd(e,r.onEnter)):Hl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Wl(e,t),e=e.sibling;else Ul(e)}function Gl(e){if(Fl!==null&&Fl.size!==0){var t=Fl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=bi(n.default,n.share);if(a!==`none`&&(Bl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Nd(e,n.onShare)):Hl(e.child,!1)),t.delete(r),t.size===0)break}}}Gl(e)}e=e.sibling}}}function Kl(e){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode),r=Fl===null?void 0:Fl.get(n),i=bi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Bl(e,n,i,null,!1)?r===void 0?Nd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Fl.delete(n),Nd(e,t.onShare)):Hl(e.child,!1)),Fl!==null&&Gl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Kl(e),e=e.sibling;else Fl!==null&&Gl(e)}function ql(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode);t=bi(t.default,t.update),e.flags&=-5,t!==`none`&&Bl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&ql(e);e=e.sibling}}function Jl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Hl(e.child,!1))}Jl(e)}e=e.sibling}}function Yl(e){if(e.tag===30)e.stateNode.paired=null,Hl(e.child,!1),Jl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Yl(e),e=e.sibling;else Jl(e)}function Xl(e){for(e=e.child;e!==null;)e.tag===30?Hl(e.child,!1):e.subtreeFlags&33554432&&Xl(e),e=e.sibling}function Zl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&zl<a.length){var l=a[zl],u=kp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Ep(c,zl===0?n:n+`_`+zl,i),s&&e.flags&4||(Ll===null&&(Ll=[]),Ll.push(c,zl===0?r:r+`_`+zl,t.memoizedProps)),zl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Zl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Ql(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=vi(n,r),a=bi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Ap)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;zl=0,i=Zl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Nd(e,n.onUpdate))}else e.subtreeFlags&33554432&&Ql(e,t);e=e.sibling}}var $l=!1,X=!1,eu=!1,tu=!1,nu=typeof WeakSet==`function`?WeakSet:Set,ru=null,iu=!1,au=!1,ou=!1,su=!1;function cu(e,t,n){if(e=e.containerInfo,cp=_h,e=Jr(e),Yr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(lp={focusedElem:e,selectionRange:r},_h=!1,n=(n&335544064)===n,ru=t,t=n?9270:1024;ru!==null;){if(e=ru,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Kl(r[a]);if(e.alternate===null&&e.flags&2)n&&Il(e),lu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Kl(r),lu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Il(e),lu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,ru=r):(n&&ql(e),lu(n))}}Fl=null}function lu(e){for(;ru!==null;){var t=ru,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=gc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){mf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)rm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:rm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=vi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=bi(a.default,a.update),a!==`none`&&Bl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,ru=r;break}ru=t.return}}function uu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Au(e,n),r&4&&gl(5,n);break;case 1:if(Au(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){mf(n,n.return,e)}else{var i=gc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){mf(n,n.return,e)}}}r&64&&vl(n),r&512&&bl(n,n.return);break;case 3:if(Au(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{_o(e,t)}catch(e){mf(n,n.return,e)}}break;case 27:t===null&&r&4&&Nl(n);case 26:case 5:Au(e,n),t===null&&r&4&&Dl(n),r&512&&bl(n,n.return);break;case 12:Au(e,n);break;case 31:Au(e,n),r&4&&yu(e,n);break;case 13:Au(e,n),r&4&&bu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=vf.bind(null,n),lm(e,n))));break;case 22:if(r=n.memoizedState!==null||$l,!r){var a=t!==null&&t.memoizedState!==null||X;t=$l,i=X,$l=r,(X=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Mu(e,n,r)):Au(e,n),$l=t,X=i}break;case 30:Au(e,n),r&512&&bl(n,n.return);break;case 7:r&512&&bl(n,n.return);default:Au(e,n)}}function du(e,t){for(e=e.child;e!==null;)fu(e,t),e=e.sibling}function fu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){mf(e,e.return,t)}pu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Kt=!0}catch(t){mf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Tp(s,!0):Tp(e.stateNode,!1)}catch(t){mf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&du(e,t);break;default:du(e,t)}}function pu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:fu(n,r);break a;case 22:n.memoizedState===null&&pu(n,r);break a;default:pu(n,r)}}e=e.sibling}}function mu(e){var t=e.alternate;t!==null&&(e.alternate=null,mu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&jt(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 hu=null,gu=!1;function _u(e,t,n){for(n=n.child;n!==null;)vu(e,t,n),n=n.sibling}function vu(e,t,n){if(Xe&&typeof Xe.onCommitFiberUnmount==`function`)try{Xe.onCommitFiberUnmount(Ye,n)}catch{}switch(n.tag){case 26:X||xl(n,t),_u(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!X&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:X||xl(n,t),wl(n);var r=hu,i=gu;Cp(n.type)&&(hu=n.stateNode,gu=!1),_u(e,t,n),_m(n.stateNode,n.type,n.memoizedProps),hu=r,gu=i;break;case 5:X||xl(n,t),wl(n);case 6:if(n.tag===6&&wl(n),r=hu,i=gu,hu=null,_u(e,t,n),hu=r,gu=i,hu!==null){if(gu)try{(hu.nodeType===9?hu.body:hu.nodeName===`HTML`?hu.ownerDocument.body:hu).removeChild(n.stateNode),Kt=!0}catch(e){mf(n,t,e)}else try{hu.removeChild(n.stateNode),Kt=!0}catch(e){mf(n,t,e)}}break;case 18:hu!==null&&(gu?(e=hu,wp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):wp(hu,n.stateNode));break;case 4:r=hu,i=gu,hu=n.stateNode.containerInfo,gu=!0,_u(e,t,n),hu=r,gu=i;break;case 0:case 11:case 14:case 15:_l(2,n,t),X||_l(4,n,t),_u(e,t,n);break;case 1:X||(xl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&yl(n,t,r)),_u(e,t,n);break;case 21:_u(e,t,n);break;case 22:X=(r=X)||n.memoizedState!==null,_u(e,t,n),X=r;break;case 30:xl(n,t),_u(e,t,n);break;case 7:X||xl(n,t),_u(e,t,n);break;default:_u(e,t,n)}}function yu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){mf(t,t.return,e)}}}function bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){mf(t,t.return,e)}}function xu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nu),t;default:throw Error(i(435,e.tag))}}function Su(e,t){var n=xu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=yf.bind(null,e,t);t.then(r,r)}})}function Cu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Cp(l.type)){hu=l.stateNode,gu=!1;break a}break;case 5:hu=l.stateNode,gu=!1;break a;case 3:case 4:hu=l.stateNode.containerInfo,gu=!0;break a}l=l.return}if(hu===null)throw Error(i(160));vu(s,c,o),hu=null,gu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Tu(t,e,n),t=t.sibling}var wu=null;function Tu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Cu(t,e,n),Eu(e),a&4&&(_l(3,e,e.return),gl(3,e),_l(5,e,e.return));break;case 1:Cu(t,e,n),Eu(e),a&512&&(X||r===null||xl(r,r.return)),a&64&&$l&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=wu,Cu(t,e,n),Eu(e),a&512&&(X||r===null||xl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if($l)e.stateNode=pp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[kt]||r[St]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),rp(r,t,n),r[St]=e,It(r),t=r;break a;case`link`:if(o=Km(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),rp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Km(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),rp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[St]=e,It(r),t=r}e.stateNode=t}}else $l||qm(o,e.type,e.stateNode)}else e.stateNode=Vm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Ol(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||X||t.parentNode.removeChild(t)):a.count--,n===null?$l||qm(o,e.type,e.stateNode):Vm(o,n,e.memoizedProps))}break;case 27:Cu(t,e,n),Eu(e),a&512&&(X||r===null||xl(r,r.return)),r!==null&&a&4&&Ol(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=eu,eu=!1,Cu(t,e,n),eu=o,Eu(e),a&512&&(X||r===null||xl(r,r.return)),e.flags&32){t=e.stateNode;try{dn(t,``),Kt=!0}catch(t){mf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Ol(e,t,r===null?t:r.memoizedProps)),a&1024&&(tu=!0);break;case 6:if(Cu(t,e,n),Eu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Kt=!0}catch(t){mf(e,e.return,t)}}break;case 3:if(Kt=!1,Gm=null,o=wu,wu=xm(t.containerInfo),Cu(t,e,n),wu=o,Eu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){mf(e,e.return,t)}tu&&(tu=!1,Du(e)),Kt=!1;break;case 4:a=eu,eu=$l,r=qt(),o=wu,wu=xm(e.stateNode.containerInfo),Cu(t,e,n),Eu(e),wu=o,Kt&&au&&(ou=!0),Kt=r,eu=a;break;case 12:Cu(t,e,n),Eu(e);break;case 31:Cu(t,e,n),Eu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 13:Cu(t,e,n),Eu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(md=Be()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=$l,l=X,u=eu;$l=c||o,eu=u||o,X=l||s,Cu(t,e,n),X=l,eu=u,$l=c,Eu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||$l||X||(t=s||X,n=$l,r=X,$l=o||$l,X=t,ju(e,2),$l=n,X=r),!o&&eu||du(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Su(e,n))));break;case 19:Cu(t,e,n),Eu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Su(e,t)));break;case 30:a&512&&(X||r===null||xl(r,r.return)),a=qt(),o=au,s=(n&335544064)===n,c=e.memoizedProps,au=s&&bi(c.default,c.update)!==`none`,Cu(t,e,n),Eu(e),s&&r!==null&&Kt&&(e.flags|=4),au=o,Kt=a;break;case 21:break;case 7:a&512&&(X||r===null||xl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Cu(t,e,n),Eu(e)}}function Eu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(kl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(El(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Tl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Ml(e,Al(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(dn(l,``),n.flags&=-33),Ml(e,Al(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;jl(e,Al(e),u,s);break;default:throw Error(i(161))}}catch(t){mf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Du(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Du(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,_h=!0,t.reset(),_h=!1),e=e.sibling}}function Ou(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)ku(t,e),t=t.sibling;else Ql(t,!1)}function ku(e,t){var n=e.alternate;if(n===null)Wl(e,!1);else switch(e.tag){case 3:if(su=iu=!1,Rl(),Ou(t,e),!iu&&!ou){if(e=Ll,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Dp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),su=!0}Ll=null;break;case 5:Ou(t,e);break;case 4:r=iu,iu=!1,Ou(t,e),iu&&(ou=!0),iu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Ou(t,e):Wl(e,!1));break;case 30:r=iu,i=Rl(),iu=!1,Ou(t,e),iu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=vi(a,o),o=vi(n.memoizedProps,o);var s=bi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,zl=0,t=Zl(e,n,t,o,s,a,!0),zl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Nd(e,e.memoizedProps.onUpdate),Ll=i):i!==null&&(i.push.apply(i,Ll),Ll=i),iu=e.flags&32?!0:r;break;default:Ou(t,e)}}function Au(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)uu(e,t.alternate,t),t=t.sibling}function ju(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:_l(4,n,n.return),ju(n,r);break;case 1:xl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&yl(n,n.return,i),ju(n,r);break;case 27:r&2&&_m(n.stateNode,n.type,n.memoizedProps);case 5:xl(n,n.return),n.tag!==5&&n.tag!==27||wl(n),ju(n,r);break;case 6:wl(n);break;case 26:xl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||X||i.parentNode.removeChild(i),ju(n,r);break;case 22:n.memoizedState===null&&ju(n,r);break;case 30:xl(n,n.return),ju(n,r);break;case 7:xl(n,n.return);default:ju(n,r)}e=e.sibling}}function Mu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Mu(i,a,n),gl(4,a);break;case 1:if(Mu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){mf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)go(l[i],c)}catch(e){mf(r,r.return,e)}}s&&o&64&&vl(a),bl(a,a.return);break;case 27:n&2&&Nl(a);case 5:a.tag!==5&&a.tag!==27||Cl(a),Mu(i,a,n),s&&r===null&&o&4&&Dl(a),bl(a,a.return);break;case 6:Cl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||$l||qm(xm(c.ownerDocument),a.type,c),Mu(i,a,n),s&&r===null&&o&4&&Dl(a),bl(a,a.return);break;case 12:Mu(i,a,n);break;case 31:Mu(i,a,n),s&&o&4&&yu(i,a);break;case 13:Mu(i,a,n),s&&o&4&&bu(i,a);break;case 22:a.memoizedState===null&&Mu(i,a,n),bl(a,a.return);break;case 30:Mu(i,a,n),bl(a,a.return);break;case 7:bl(a,a.return);default:Mu(i,a,n)}t=t.sibling}}function Nu(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&&ka(n))}function Pu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ka(e))}function Fu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Iu(e,t,n,r),t=t.sibling;else i&&Xl(t)}function Iu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Yl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Fu(e,t,n,r),a&2048&&gl(9,t);break;case 1:Fu(e,t,n,r);break;case 3:Fu(e,t,n,r),i&&su&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&ka(a)));break;case 12:if(a&2048){Fu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){mf(t,t.return,e)}}else Fu(e,t,n,r);break;case 31:Fu(e,t,n,r);break;case 13:Fu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&Yl(t),o._visibility&2?Fu(e,t,n,r):(o._visibility|=2,Lu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Yl(s),o._visibility&2?Fu(e,t,n,r):Ru(e,t)),a&2048&&Nu(s,t);break;case 24:Fu(e,t,n,r),a&2048&&Pu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Hl(a.child,!0),Hl(t.child,!0))),Fu(e,t,n,r);break;default:Fu(e,t,n,r)}}function Lu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!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:Lu(a,o,s,c,i),gl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Lu(a,o,s,c,i)):u._visibility&2?Lu(a,o,s,c,i):Ru(a,o),i&&l&2048&&Nu(o.alternate,o);break;case 24:Lu(a,o,s,c,i),i&&l&2048&&Pu(o.alternate,o);break;default:Lu(a,o,s,c,i)}t=t.sibling}}function Ru(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:Ru(n,r),i&2048&&Nu(r.alternate,r);break;case 24:Ru(n,r),i&2048&&Pu(r.alternate,r);break;default:Ru(n,r)}t=t.sibling}}var zu=8192;function Bu(e,t,n){if(e.subtreeFlags&zu)for(e=e.child;e!==null;)Vu(e,t,n),e=e.sibling}function Vu(e,t,n){switch(e.tag){case 26:Bu(e,t,n),e.flags&zu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Qm(n,e)):$m(n,wu,e.memoizedState,e.memoizedProps));break;case 5:Bu(e,t,n),e.flags&zu&&(e=e.stateNode,(t&335544128)===t&&Qm(n,e));break;case 3:case 4:var r=wu;wu=xm(e.stateNode.containerInfo),Bu(e,t,n),wu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=zu,zu=16777216,Bu(e,t,n),zu=r):Bu(e,t,n));break;case 30:if((e.flags&zu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Fl===null&&(Fl=new Map),Fl.set(r,i)}Bu(e,t,n);break;default:Bu(e,t,n)}}function Hu(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 Uu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ru=r,Ku(r,e)}Hu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Wu(e),e=e.sibling}function Wu(e){switch(e.tag){case 0:case 11:case 15:Uu(e),e.flags&2048&&_l(9,e,e.return);break;case 3:Uu(e);break;case 12:Uu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Gu(e)):Uu(e);break;default:Uu(e)}}function Gu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ru=r,Ku(r,e)}Hu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:_l(8,t,t.return),Gu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Gu(t));break;default:Gu(t)}e=e.sibling}}function Ku(e,t){for(;ru!==null;){var n=ru;switch(n.tag){case 0:case 11:case 15:_l(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:ka(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ru=r;else a:for(n=e;ru!==null;){r=ru;var i=r.sibling,a=r.return;if(mu(r),r===n){ru=null;break a}if(i!==null){i.return=a,ru=i;break a}ru=a}}}var qu={getCacheForType:function(e){var t=xa(Da),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return xa(Da).controller.signal}},Ju=typeof WeakMap==`function`?WeakMap:Map,Yu=0,Xu=null,Zu=null,Qu=0,$u=0,ed=null,td=!1,nd=!1,rd=!1,id=0,ad=0,od=0,sd=0,cd=0,ld=0,ud=0,dd=null,fd=null,pd=!1,md=0,hd=0,gd=1/0,_d=null,vd=null,yd=0,bd=null,xd=null,Sd=0,Cd=0,wd=null,Td=null,Ed=null,Dd=null,Od=null,kd=0,Ad=null;function jd(){return Yu&2&&Qu!==0?Qu&-Qu:L.T===null?yt():Ff()}function Md(){if(ld===0){if(!(Qu&536870912)||B){var e=rt;rt<<=1,!(rt&3932160)&&(rt=262144),ld=e}else ld=536870912}return e=Co.current,e!==null&&(e.flags|=32),ld}function Nd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Fp(vi(e.memoizedProps,n))),Dd===null&&(Dd=[]),Dd.push(t.bind(null,r))}}function Pd(e,t,n){(e===Xu&&($u===2||$u===9)||e.cancelPendingCommit!==null)&&(Vd(e,0),Rd(e,Qu,ld,!1)),ft(e,n),(!(Yu&2)||e!==Xu)&&(e===Xu&&(!(Yu&2)&&(sd|=n),ad===4&&Rd(e,Qu,ld,!1)),Df(e))}function Fd(e,t,n){if(Yu&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||st(e,t),a=r?Yd(e,t):qd(e,t,!0),o=r;do{if(a===0){nd&&!r&&Rd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Ld(n))a=qd(e,t,!1),o=!1;else{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=dd;var l=c.current.memoizedState.isDehydrated;if(l&&(Vd(c,s).flags|=256),s=qd(c,s,!1),s!==2&&s!==6){if(rd&&!l){c.errorRecoveryDisabledLanes|=o,sd|=o,a=4;break a}o=fd,fd=a,o!==null&&(fd===null?fd=o:fd.push.apply(fd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Vd(e,0),Rd(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&&(t&62914560)!==t)break;case 6:Rd(r,t,ld,!td);break a;case 2:fd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=md+300-Be(),10<a)){if(Rd(r,t,ld,!td),ot(r,0,!0)!==0)break a;Sd=t,r.timeoutHandle=_p(Id.bind(null,r,n,fd,_d,pd,t,ld,sd,ud,td,o,`Throttled`,-0,0),a);break a}Id(r,n,fd,_d,pd,t,ld,sd,ud,td,o,null,-0,0)}break}}while(1);Df(e)}function Id(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yn},Fl=null,Vu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=rh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?md-Be():(a&4194048)===a?hd-Be():0,m=th(d,m),m!==null)?(Sd=a,e.cancelPendingCommit=m(nf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Rd(e,a,o,!l)):nf(e,t,a,n,r,i,o,s,c,l,u,d)}function Ld(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(!Hr(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 Rd(e,t,n,r){t=ct(e,t),t&=~cd,t&=~sd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Qe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&mt(e,n,t)}function zd(){return Yu&6?!0:(Of(0,!1),!1)}function Bd(){if(Zu!==null){if($u===0)var e=Zu.return;else e=Zu,pa=fa=null,Qo(e),eo=null,to=0,e=Zu;for(;e!==null;)hl(e.alternate,e),e=e.return;Zu=null}}function Vd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,vp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Sd=0,Bd(),Xu=e,Zu=n=Fi(e.current,null),Qu=t,$u=0,ed=null,td=!1,nd=st(e,t),rd=!1,ud=ld=cd=sd=od=ad=0,fd=dd=null,pd=!1,id=ct(e,t),Ti(),n}function Hd(e,t){Y=null,L.H=cc,t===Ga||t===G?(t=Qa(),$u=3):t===Ka?(t=Qa(),$u=4):$u=t===Ec?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ed=t,Zu===null&&(ad=1,bc(e,Ui(t,e.current)))}function Ud(){var e=Co.current;return e===null?!0:(Qu&4194048)===Qu?wo===null:(Qu&62914560)===Qu||Qu&536870912?e===wo:!1}function Wd(){var e=L.H;return L.H=cc,e===null?cc:e}function Gd(){var e=L.A;return L.A=qu,e}function Kd(){ad=4,td||(Qu&4194048)!==Qu&&Co.current!==null||(nd=!0),!(od&134217727)&&!(sd&134217727)||Xu===null||Rd(Xu,Qu,ld,!1)}function qd(e,t,n){var r=Yu;Yu|=2;var i=Wd(),a=Gd();(Xu!==e||Qu!==t)&&(_d=null,Vd(e,t)),t=!1;var o=ad;a:do try{if($u!==0&&Zu!==null){var s=Zu,c=ed;switch($u){case 8:Bd(),o=6;break a;case 3:case 2:case 9:case 6:Co.current===null&&(t=!0);var l=$u;if($u=0,ed=null,$d(e,s,c,l),n&&nd){o=0;break a}break;default:l=$u,$u=0,ed=null,$d(e,s,c,l)}}Jd(),o=ad;break}catch(t){Hd(e,t)}while(1);return t&&e.shellSuspendCounter++,pa=fa=null,Yu=r,L.H=i,L.A=a,Zu===null&&(Xu=null,Qu=0,Ti()),o}function Jd(){for(;Zu!==null;)Zd(Zu)}function Yd(e,t){var n=Yu;Yu|=2;var r=Wd(),a=Gd();Xu!==e||Qu!==t?(_d=null,gd=Be()+500,Vd(e,t)):nd=st(e,t);a:do try{if($u!==0&&Zu!==null){t=Zu;var o=ed;b:switch($u){case 1:$u=0,ed=null,$d(e,t,o,1);break;case 2:case 9:if(Ja(o)){$u=0,ed=null,Qd(t);break}t=function(){$u!==2&&$u!==9||Xu!==e||($u=7),Df(e)},o.then(t,t);break a;case 3:$u=7;break a;case 4:$u=5;break a;case 7:Ja(o)?($u=0,ed=null,Qd(t)):($u=0,ed=null,$d(e,t,o,7));break;case 5:var s=null;switch(Zu.tag){case 26:s=Zu.memoizedState;case 5:case 27:var c=Zu;if(s?Xm(s):c.stateNode.complete){$u=0,ed=null;var l=c.sibling;if(l!==null)Zu=l;else{var u=c.return;u===null?Zu=null:(Zu=u,ef(u))}break b}}$u=0,ed=null,$d(e,t,o,5);break;case 6:$u=0,ed=null,$d(e,t,o,6);break;case 8:Bd(),ad=6;break a;default:throw Error(i(462))}}Xd();break}catch(t){Hd(e,t)}while(1);return pa=fa=null,L.H=r,L.A=a,Yu=n,Zu===null?(Xu=null,Qu=0,Ti(),ad):0}function Xd(){for(;Zu!==null&&!Re();)Zd(Zu)}function Zd(e){var t=ol(e.alternate,e,id);e.memoizedProps=e.pendingProps,t===null?ef(e):Zu=t}function Qd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Bc(n,t,t.pendingProps,t.type,void 0,Qu);break;case 11:t=Bc(n,t,t.pendingProps,t.type.render,t.ref,Qu);break;case 5:Qo(t);var r=t;r===ra&&(B?(oa(r),r.tag===5&&r.stateNode!=null&&(ia=r.stateNode)):(oa(r),B=!0));default:hl(n,t),t=Zu=Ii(t,id),t=ol(n,t,id)}e.memoizedProps=e.pendingProps,t===null?ef(e):Zu=t}function $d(e,t,n,r){pa=fa=null,Qo(t),eo=null,to=0;var i=t.return;try{if(Tc(e,i,t,n,Qu)){ad=1,bc(e,Ui(n,e.current)),Zu=null;return}}catch(t){if(i!==null)throw Zu=i,t;ad=1,bc(e,Ui(n,e.current)),Zu=null;return}t.flags&32768?(B||r===1?e=!0:nd||Qu&536870912?e=!1:(td=e=!0,(r===2||r===9||r===3||r===6)&&(r=Co.current,r!==null&&r.tag===13&&(r.flags|=16384))),tf(t,e)):ef(t)}function ef(e){var t=e;do{if(t.flags&32768){tf(t,td);return}e=t.return;var n=pl(t.alternate,t,id);if(n!==null){Zu=n;return}if(t=t.sibling,t!==null){Zu=t;return}Zu=t=e}while(t!==null);ad===0&&(ad=5)}function tf(e,t){do{var n=ml(e.alternate,e);if(n!==null){n.flags&=32767,Zu=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Zu=e;return}Zu=e=n}while(e!==null);ad=6,Zu=null}function nf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do df();while(yd!==0);if(Yu&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Xu&&(Zu=Xu=null,Qu=0),xd=t,bd=e,Sd=n,wd=a,Td=r,rf(e,t,n,s,c,l,f)}}function rf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Cd=s,s|=wi,pt(e,n,s,r,i,a),Dd=null,(n&335544064)===n?(Od=Ma(e),r=10262):(Od=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,bf(We,function(){return ff(),null})):(e.callbackNode=null,e.callbackPriority=0),Pl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=L.T,L.T=null,i=R.p,R.p=2,a=Yu,Yu|=4;try{cu(e,t,n)}finally{Yu=a,R.p=i,L.T=r}}yd=1,Pl?Ed=Np(o,e.containerInfo,Od,sf,cf,of,lf,ff,af,null,null):(sf(),cf(),lf())}function af(e){if(yd!==0){var t=bd.onRecoverableError;t(e,{componentStack:null})}}function of(){yd===3&&(yd=0,ku(xd,bd),yd=4)}function sf(){if(yd===1){yd=0;var e=bd,t=xd,n=Sd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=L.T,L.T=null;var i=R.p;R.p=2;var a=Yu;Yu|=4;try{au=ou=!1,Tu(t,e,n),n=lp;var o=Jr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&qr(s.ownerDocument.documentElement,s)){if(c!==null&&Yr(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 _=Kr(s,h),v=Kr(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}}_h=!!cp,lp=cp=null}finally{Yu=a,R.p=i,L.T=r}}e.current=t,yd=2}}function cf(){if(yd===2){yd=0;var e=bd,t=xd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=L.T,L.T=null;var r=R.p;R.p=2;var i=Yu;Yu|=4;try{uu(e,t.alternate,t)}finally{Yu=i,R.p=r,L.T=n}}yd=3}}function lf(){if(yd===4||yd===3){yd=0;var e=Ed;Ed=null,ze();var t=bd,n=xd,r=Sd,i=Td,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?yd=5:(yd=0,xd=bd=null,uf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(vd=null),vt(r),n=n.stateNode,Xe&&typeof Xe.onCommitFiberRoot==`function`)try{Xe.onCommitFiberRoot(Ye,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=L.T,a=R.p,R.p=2,L.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{L.T=n,R.p=a}}if(i=Dd,o=Od,Od=null,i!==null&&(Dd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Sd&3&&df(),Df(t),a=t.pendingLanes,r&261930&&a&42?t===Ad?kd++:(kd=0,Ad=t):(kd=0,Ad=null),Of(0,!1)}}function uf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ka(t)))}function df(){return Ed!==null&&(Ed.skipTransition(),Ed=null),sf(),cf(),lf(),ff()}function ff(){if(yd!==5)return!1;var e=bd,t=Cd;Cd=0;var n=vt(Sd),r=L.T,a=R.p;try{R.p=32>n?32:n,L.T=null,n=wd,wd=null;var o=bd,s=Sd;if(yd=0,xd=bd=null,Sd=0,Yu&6)throw Error(i(331));var c=Yu;if(Yu|=4,Wu(o.current),Iu(o,o.current,s,n),Yu=c,Of(0,!1),Xe&&typeof Xe.onPostCommitFiberRoot==`function`)try{Xe.onPostCommitFiberRoot(Ye,o)}catch{}return!0}finally{R.p=a,L.T=r,uf(e,t)}}function pf(e,t,n){t=Ui(n,t),t=Sc(e.stateNode,t,2),e=lo(e,t,2),e!==null&&(ft(e,2),Df(e))}function mf(e,t,n){if(e.tag===3)pf(e,e,n);else for(;t!==null;){if(t.tag===3){pf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(vd===null||!vd.has(r))){e=Ui(n,e),n=Cc(2),r=lo(t,n,2),r!==null&&(wc(n,r,t,e),ft(r,2),Df(r));break}}t=t.return}}function hf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ju;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)||(rd=!0,i.add(n),e=gf.bind(null,e,t,n),t.then(e,e))}function gf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Xu===e&&(Qu&n)===n&&(ad===4||ad===3&&(Qu&62914560)===Qu&&300>Be()-md?Yu&2?cd|=n:Vd(e,0):cd|=n,ud===Qu&&(ud=0)),Df(e)}function _f(e,t){t===0&&(t=ut()),e=Oi(e,t),e!==null&&(ft(e,t),Df(e))}function vf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),_f(e,n)}function yf(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),_f(e,n)}function bf(e,t){return Ie(e,t)}var xf=null,Sf=null,Cf=!1,wf=!1,Tf=!1,Ef=0;function Df(e){e!==Sf&&e.next===null&&(Sf===null?xf=Sf=e:Sf=Sf.next=e),wf=!0,Cf||(Cf=!0,Pf())}function Of(e,t){if(!Tf&&wf){Tf=!0;do for(var n=!1,r=xf;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-Qe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Nf(r,a))}else a=Qu,a=ot(r,r===Xu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||st(r,a)||(n=!0,Nf(r,a))}r=r.next}while(n);Tf=!1}}function kf(){Af()}function Af(){wf=Cf=!1;var e=0;Ef!==0&&gp()&&(e=Ef);for(var t=Be(),n=null,r=xf;r!==null;){var i=r.next,a=jf(r,t);a===0?(r.next=null,n===null?xf=i:n.next=i,i===null&&(Sf=n)):(n=r,(e!==0||a&3)&&(wf=!0)),r=i}yd!==0&&yd!==5||Of(e,!1),Ef!==0&&(Ef=0)}function jf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Qe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=lt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Xu,n=Qu,n=ot(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&($u===2||$u===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Le(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||st(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Le(r),vt(n)){case 2:case 8:n=Ue;break;case 32:n=We;break;case 268435456:n=Ke;break;default:n=We}return r=Mf.bind(null,e),n=Ie(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Le(r),e.callbackPriority=2,e.callbackNode=null,2}function Mf(e,t){if(yd!==0&&yd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(df()&&e.callbackNode!==n)return null;var r=Qu;return r=ot(e,e===Xu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Fd(e,r,t),jf(e,Be()),e.callbackNode!=null&&e.callbackNode===n?Mf.bind(null,e):null)}function Nf(e,t){if(df())return null;Fd(e,t,!0)}function Pf(){xp(function(){Yu&6?Ie(He,kf):Af()})}function Ff(){if(Ef===0){var e=Fa;e===0&&(e=nt,nt<<=1,!(nt&261888)&&(nt=256)),Ef=e}return Ef}function If(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:vn(e)}function Lf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=If((i[Ct]||null).action),o=r.submitter;o&&(t=(t=o[Ct]||null)?If(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Bn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Ef!==0){var e=new FormData(i,o);Js(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Js(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Rf=0;Rf<hi.length;Rf++){var zf=hi[Rf];gi(zf.toLowerCase(),`on`+(zf[0].toUpperCase()+zf.slice(1)))}gi(si,`onAnimationEnd`),gi(ci,`onAnimationIteration`),gi(li,`onAnimationStart`),gi(`dblclick`,`onDoubleClick`),gi(`focusin`,`onFocus`),gi(`focusout`,`onBlur`),gi(ui,`onTransitionRun`),gi(di,`onTransitionStart`),gi(fi,`onTransitionCancel`),gi(pi,`onTransitionEnd`),Vt(`onMouseEnter`,[`mouseout`,`mouseover`]),Vt(`onMouseLeave`,[`mouseout`,`mouseover`]),Vt(`onPointerEnter`,[`pointerout`,`pointerover`]),Vt(`onPointerLeave`,[`pointerout`,`pointerover`]),Bt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Bt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Bt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Bt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Bt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Bt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Bf=`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(` `),Vf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Bf));function Hf(e,t){t=!!(t&4);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){xi(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){xi(e)}i.currentTarget=null,a=c}}}}function Z(e,t){var n=t[Tt];n===void 0&&(n=t[Tt]=new Set);var r=e+`__bubble`;n.has(r)||(Gf(t,e,2,!1),n.add(r))}function Uf(e,t,n){var r=0;t&&(r|=4),Gf(n,e,r,t)}var Q=`_reactListening`+Math.random().toString(36).slice(2);function Wf(e){if(!e[Q]){e[Q]=!0,Rt.forEach(function(t){t!==`selectionchange`&&(Vf.has(t)||Uf(t,!1,e),Uf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Q]||(t[Q]=!0,Uf(`selectionchange`,!1,t))}}function Gf(e,t,n,r){switch(wh(t)){case 2:var i=vh;break;case 8:i=yh;break;default:i=bh}n=i.bind(null,t,n,e),i=void 0,!kn||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 Kf(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=Mt(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}En(function(){var r=a,i=xn(n),s=[];a:{var c=mi.get(e);if(c!==void 0){var l=Bn,u=e;switch(e){case`keypress`:if(Fn(n)===0)break a;case`keydown`:case`keyup`:l=ir;break;case`focusin`:u=`focus`,l=Yn;break;case`focusout`:u=`blur`,l=Yn;break;case`beforeblur`:case`afterblur`:l=Yn;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=qn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=sr;break;case si:case ci:case li:l=Xn;break;case pi:l=cr;break;case`scroll`:case`scrollend`:l=Hn;break;case`wheel`:l=lr;break;case`copy`:case`cut`:case`paste`:l=Zn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=ar;break;case`submit`:l=or;break;case`toggle`:case`beforetoggle`:l=ur}var d=!!(t&4),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=Dn(m,p),g!=null&&d.push(qf(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(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==bn&&(u=n.relatedTarget||n.fromElement)&&(Mt(u)||u[wt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Mt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=qn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=ar,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Pt(c),h=l==null?u:Pt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Mt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,Yf):null,c!==null&&Xf(s,u,c,d,!1),l!==null&&f!==null&&Xf(s,f,l,d,!0)))}a:{if(c=r?Pt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Ar;else if(wr(c)){if(jr)_=Br;else{_=Rr;var v=Lr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&hn(r.elementType)&&(_=Ar):_=zr;if(_&&=_(e,r)){Tr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Pt(r):window,e){case`focusin`:(wr(v)||v.contentEditable===`true`)&&(Zr=v,Qr=r,$r=null);break;case`focusout`:$r=Qr=Zr=null;break;case`mousedown`:ei=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ei=!1,ti(s,n,i);break;case`selectionchange`:if(Xr)break;case`keydown`:case`keyup`:ti(s,n,i)}var y;if(fr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else br?vr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(hr&&n.locale!==`ko`&&(br||b!==`onCompositionStart`?b===`onCompositionEnd`&&br&&(y=Pn()):(jn=i,Mn=`value`in jn?jn.value:jn.textContent,br=!0)),v=Jf(r,b),0<v.length&&(b=new Qn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=yr(n),y!==null&&(b.data=y)))),(y=mr?xr(e,n):Sr(e,n))&&(b=Jf(r,`onBeforeInput`),0<b.length&&(v=new Qn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Lf(s,e,r,n,i)}Hf(s,t)})}function qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jf(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=Dn(e,n),i!=null&&r.unshift(qf(e,i,a)),i=Dn(e,t),i!=null&&r.push(qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Yf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Xf(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=Dn(n,a),l!=null&&o.unshift(qf(n,l,c))):i||(l=Dn(n,a),l!=null&&o.push(qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Zf=/\r\n?/g,Qf=/\u0000|\uFFFD/g;function $f(e){return(typeof e==`string`?e:``+e).replace(Zf,`
|
|
9
|
+
`).replace(Qf,``)}function ep(e,t){return t=$f(t),$f(e)===t}function tp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&dn(e,``+r);else return;break;case`className`:Yt(e,`class`,r);break;case`tabIndex`:Yt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Yt(e,n,r);break;case`style`:mn(e,r,o);return;case`data`:if(t!==`object`){Yt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&tp(e,t,`name`,a.name,a,null),tp(e,t,`formEncType`,a.formEncType,a,null),tp(e,t,`formMethod`,a.formMethod,a,null),tp(e,t,`formTarget`,a.formTarget,a,null)):(tp(e,t,`encType`,a.encType,a,null),tp(e,t,`method`,a.method,a,null),tp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=yn);return;case`onScroll`:r!=null&&Z(`scroll`,e);return;case`onScrollEnd`:r!=null&&Z(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=vn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Z(`beforetoggle`,e),Z(`toggle`,e),Jt(e,`popover`,r);break;case`xlinkActuate`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Jt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=gn.get(n)||n,Jt(e,n,r);else return}Kt=!0}function np(e,t,n,r,a,o){switch(n){case`style`:mn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)dn(e,``+r);else return;break;case`onScroll`:r!=null&&Z(`scroll`,e);return;case`onScrollEnd`:r!=null&&Z(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=yn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!zt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Ct]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Kt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Jt(e,n,r)}return}Kt=!0}function rp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Z(`error`,e),Z(`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:tp(e,t,o,s,n,null)}}a&&tp(e,t,`srcSet`,n.srcSet,n,null),r&&tp(e,t,`src`,n.src,n,null);return;case`input`:Z(`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:tp(e,t,r,d,n,null)}}on(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Z(`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:tp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&cn(e,!!r,n,!0):cn(e,!!r,t,!1);return;case`textarea`:for(s in Z(`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:tp(e,t,s,c,n,null)}un(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:tp(e,t,l,r,n,null)}return;case`dialog`:Z(`beforetoggle`,e),Z(`toggle`,e),Z(`cancel`,e),Z(`close`,e);break;case`iframe`:case`object`:Z(`load`,e);break;case`video`:case`audio`:for(r=0;r<Bf.length;r++)Z(Bf[r],e);break;case`image`:Z(`error`,e),Z(`load`,e);break;case`details`:Z(`toggle`,e);break;case`embed`:case`source`:case`link`:Z(`error`,e),Z(`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:tp(e,t,u,r,n,null)}return;default:if(hn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&np(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&tp(e,t,c,r,n,null))}var ip={};function ap(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)||tp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Kt=!0),o=m;break;case`name`:m!==f&&(Kt=!0),a=m;break;case`checked`:m!==f&&(Kt=!0),u=m;break;case`defaultChecked`:m!==f&&(Kt=!0),d=m;break;case`value`:m!==f&&(Kt=!0),s=m;break;case`defaultValue`:m!==f&&(Kt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&tp(e,t,p,m,r,f)}}an(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||tp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Kt=!0),p=o;break;case`defaultValue`:o!==l&&(Kt=!0),c=o;break;case`multiple`:o!==l&&(Kt=!0),s=o;default:o!==l&&tp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?cn(e,!!n,n?[]:``,!1):cn(e,!!n,t,!0)):cn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:tp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Kt=!0),p=a;break;case`defaultValue`:a!==o&&(Kt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&tp(e,t,s,a,r,o)}ln(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:tp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Kt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:tp(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)&&tp(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:tp(e,t,u,p,r,m)}return;default:if(hn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&np(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||np(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&tp(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||tp(e,t,f,p,r,m)}function op(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function sp(){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&&op(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&&op(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 cp=null,lp=null;function up(e){return e.nodeType===9?e:e.ownerDocument}function dp(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 fp(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 pp(e,t,n,r){return n=up(n).createElement(e),n[St]=r,n[Ct]=t,rp(n,e,t),It(n),n}function mp(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 hp=null;function gp(){var e=window.event;return e&&e.type===`popstate`?e!==hp&&(hp=e,!0):(hp=null,!1)}var _p=typeof setTimeout==`function`?setTimeout:void 0,vp=typeof clearTimeout==`function`?clearTimeout:void 0,yp=typeof Promise==`function`?Promise:void 0,bp=typeof requestAnimationFrame==`function`?requestAnimationFrame:_p,xp=typeof queueMicrotask==`function`?queueMicrotask:yp===void 0?_p:function(e){return yp.resolve(null).then(e).catch(Sp)};function Sp(e){setTimeout(function(){throw e})}function Cp(e){return e===`head`}function wp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)vm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,vm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[kt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&vm(e.ownerDocument.body)}n=i}while(n);Hh(t)}function Tp(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 Ep(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Dp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Op(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function kp(e){return Op(e.getBoundingClientRect(),getComputedStyle(e),e)}function Ap(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Op(t,n,e)}function jp(e){return e.documentElement.clientHeight}function Mp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Np(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(jp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Zm(f),u>eh){s.length=o;break}f=new Promise(Mp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Pp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Pp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Pp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Pp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Fp(e){return{name:e,group:new Pp(`group`,e),imagePair:new Pp(`image-pair`,e),old:new Pp(`old`,e),new:new Pp(`new`,e)}}function Ip(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Ip.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Vp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=zp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Lp,e,s,r)}this._eventListeners=a}};function Lp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Ip.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Vp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=zp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Rp,e,n,i),r.splice(t,1),a!==null&&a()}};function Rp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function zp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Bp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Vp(e,t,n,r){if(e.length===0)return-1;r=Bp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Bp(a.optionsOrUseCapture)===r)return i}return-1}Ip.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,zp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,zp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Ip.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Hp,e,void 0,void 0)};function Hp(e,t){return e.tag!==6&&(e=b(e),mm(e,t))}Ip.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Up,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Hp(t[n],e);n--);};function Up(e,t){return t.push(e),!1}Ip.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=up(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,Wp,e,void 0,void 0))};function Wp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Ip.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Gp,e,void 0,void 0)};function Gp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Ip.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,Kp,e,void 0,void 0);for(var n=t=0;n<qp.length;n++){var r=qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):qp[t++]=r}qp.length=t}};function Kp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var qp=[],Jp=!1;function Yp(e,t,n){qp.push({fragmentInstance:e,observer:t,instance:n}),Jp||(Jp=!0,hm(function(){Jp=!1;var e=qp;qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Ip.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,Xp,e,void 0,void 0),e};function Xp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Ip.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Ip.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Up,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Zp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Zp(e,t,n,r,i){var a=Mt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Qp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Ip.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,Up,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Qp(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),Qp(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function $p(e,t){return e=b(e),em(e,t),!1}function em(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<qp.length;i++){var a=qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(qp[r++]=a)}qp.length=r,n.observe(e)}),em(e,t))}function nm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,zp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Yp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function rm(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`:rm(n),jt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function im(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[kt])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=um(e.nextSibling),e===null)break}return null}function am(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=um(e.nextSibling),e===null))return null;return e}function om(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=um(e.nextSibling),e===null))return null;return e}function sm(e){return e.data===`$?`||e.data===`$~`}function cm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function lm(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 um(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 dm=null;function fm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return um(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function pm(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 mm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function hm(e){bp(function(){bp(function(t){return e(t)})})}function gm(e,t,n){switch(t=up(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 _m(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&tp(e,t,r,null,ip,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===yn&&(e.onclick=null),jt(e)}function vm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);jt(e)}var ym=new Map,bm=new Set;function xm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Sm=R.d;R.d={f:Cm,r:wm,D:Dm,C:Om,L:km,m:Am,X:Mm,S:jm,M:Nm};function Cm(){var e=Sm.f(),t=zd();return e||t}function wm(e){var t=Nt(e);t!==null&&t.tag===5&&t.type===`form`?Xs(t):Sm.r(e)}var Tm=typeof document>`u`?null:document;function Em(e,t,n){var r=Tm;if(r&&typeof t==`string`&&t){var i=rn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),bm.has(i)||(bm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),rp(t,`link`,e),It(t),r.head.appendChild(t)))}}function Dm(e){Sm.D(e),Em(`dns-prefetch`,e,null)}function Om(e,t){Sm.C(e,t),Em(`preconnect`,e,t)}function km(e,t,n){Sm.L(e,t,n);var r=Tm;if(r&&e&&t){var i=`link[rel="preload"][as="`+rn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+rn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+rn(n.imageSizes)+`"]`)):i+=`[href="`+rn(e)+`"]`;var a=i;switch(t){case`style`:a=Fm(e);break;case`script`:a=zm(e)}if(!(ym.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),ym.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Im(a))||t===`script`&&r.querySelector(Bm(a))))){var o=r.createElement(`link`);rp(o,`link`,e),t===`style`&&(o[At]=!0,o.onload=o.onerror=function(){Lt(o)}),It(o),r.head.appendChild(o)}}}function Am(e,t){Sm.m(e,t);var n=Tm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+rn(r)+`"][href="`+rn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=zm(e)}if(!ym.has(a)&&(e=D({rel:`modulepreload`,href:e},t),ym.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Bm(a)))return}r=n.createElement(`link`),rp(r,`link`,e),It(r),n.head.appendChild(r)}}}function jm(e,t,n){Sm.S(e,t,n);var r=Tm;if(r&&e){var i=Ft(r).hoistableStyles,a=Fm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Im(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=ym.get(a))&&Um(e,n);var c=o=r.createElement(`link`);It(c),rp(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,Hm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Mm(e,t){Sm.X(e,t);var n=Tm;if(n&&e){var r=Ft(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=D({src:e,async:!0},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),It(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t){Sm.M(e,t);var n=Tm;if(n&&e){var r=Ft(n).hoistableScripts,i=zm(e),a=r.get(i);a||(a=n.querySelector(Bm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=ym.get(i))&&Wm(e,t),a=n.createElement(`script`),It(a),rp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pm(e,t,n,r){var a=(a=Se.current)?xm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Fm(n.href),t=Ft(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Fm(n.href);var o=Ft(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(Im(e)))?o._p||(s.instance=o,s.state.loading=5):(o=ym.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ym.set(e,o)),Rm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=zm(n),t=Ft(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Fm(e){return`href="`+rn(e)+`"`}function Im(e){return`link[rel="stylesheet"][`+e+`]`}function Lm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Rm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[At]){r.loading=1;return}}else t=e.createElement(`link`),t[At]=!0,t.onload=t.onerror=Lt.bind(null,t),rp(t,`link`,n),It(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function zm(e){return`[src="`+rn(e)+`"]`}function Bm(e){return`script[async]`+e}function Vm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+rn(n.href)+`"]`);if(r)return t.instance=r,It(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),It(r),rp(r,`style`,a),Hm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Fm(n.href);var o=e.querySelector(Im(a));if(o)return t.state.loading|=4,t.instance=o,It(o),o;r=Lm(n),(a=ym.get(a))&&Um(r,a),o=(e.ownerDocument||e).createElement(`link`),It(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),rp(o,`link`,r),t.state.loading|=4,Hm(o,n.precedence,e),t.instance=o;case`script`:return o=zm(n.src),(a=e.querySelector(Bm(o)))?(t.instance=a,It(a),a):(r=n,(a=ym.get(o))&&(r=D({},n),Wm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),It(a),rp(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,Hm(r,n.precedence,e));return t.instance}function Hm(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 Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Wm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Gm=null;function Km(e,t,n){if(Gm===null){var r=new Map,i=Gm=new Map;i.set(n,r)}else i=Gm,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[kt]||a[St]||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 qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Jm(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 Ym(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Xm(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Zm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Qm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Zm(t),e.suspenseyImages.push(t)),e=ih.bind(e),t.decode().then(e,e))}function $m(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=Fm(r.href),a=t.querySelector(Im(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=rh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,It(a);return}a=t.ownerDocument||t,r=Lm(r),(i=ym.get(i))&&Um(r,i),a=a.createElement(`link`),It(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),rp(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=rh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var eh=0;function th(e,t){return e.stylesheets&&e.count===0&&oh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&eh===0&&(eh=62500*sp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&oh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>eh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function nh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)oh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function rh(){this.count--,nh(this)}function ih(){this.imgCount--,nh(this)}var ah=null;function oh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ah=new Map,t.forEach(sh,e),ah=null,rh.call(e))}function sh(e,t){if(!(t.state.loading&4)){var n=ah.get(e);if(n)var r=n.get(null);else{n=new Map,ah.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=rh.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 ch={$$typeof:P,Provider:null,Consumer:null,_currentValue:me,_currentValue2:me,_threadCount:0};function lh(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=dt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dt(0),this.hiddenUpdates=dt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function uh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new lh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ni(3,null,null,t),e.current=a,a.stateNode=e,t=Oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},q(a),e}function dh(e){return e?(e=ji,e):ji}function fh(e,t,n,r,i,a){i=dh(i),r.context===null?r.context=i:r.pendingContext=i,r=co(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=lo(e,r,t),n!==null&&(Pd(n,e,t),uo(n,e,t))}function ph(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mh(e,t){ph(e,t),(e=e.alternate)&&ph(e,t)}function hh(e){if(e.tag===13||e.tag===31){var t=Oi(e,67108864);t!==null&&Pd(t,e,67108864),mh(e,67108864)}}function gh(e){if(e.tag===13||e.tag===31){var t=jd();t=_t(t);var n=Oi(e,t);n!==null&&Pd(n,e,t),mh(e,t)}}var _h=!0;function vh(e,t,n,r){var i=L.T;L.T=null;var a=R.p;try{R.p=2,bh(e,t,n,r)}finally{R.p=a,L.T=i}}function yh(e,t,n,r){var i=L.T;L.T=null;var a=R.p;try{R.p=8,bh(e,t,n,r)}finally{R.p=a,L.T=i}}function bh(e,t,n,r){if(_h){var i=xh(r);if(i===null)Kf(e,t,r,Sh,n),Nh(e,r);else if(Fh(i,e,t,n,r))r.stopPropagation();else if(Nh(e,r),t&4&&-1<Mh.indexOf(e)){for(;i!==null;){var a=Nt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=at(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Qe(o);s.entanglements[1]|=c,o&=~c}Df(a),!(Yu&6)&&(gd=Be()+500,Of(0,!1))}}break;case 31:case 13:s=Oi(a,2),s!==null&&Pd(s,a,2),zd(),mh(a,2)}if(a=xh(r),a===null&&Kf(e,t,r,Sh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Kf(e,t,r,null,n)}}function xh(e){return e=xn(e),Ch(e)}var Sh=null;function Ch(e){if(Sh=null,e=Mt(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 Sh=e,null}function wh(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ve()){case He:return 2;case Ue:return 8;case We:case Ge:return 32;case Ke:return 268435456;default:return 32}default:return 32}}var Th=!1,Eh=null,Dh=null,Oh=null,kh=new Map,Ah=new Map,jh=[],Mh=`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 Nh(e,t){switch(e){case`focusin`:case`focusout`:Eh=null;break;case`dragenter`:case`dragleave`:Dh=null;break;case`mouseover`:case`mouseout`:Oh=null;break;case`pointerover`:case`pointerout`:kh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ah.delete(t.pointerId)}}function Ph(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=Nt(t),t!==null&&hh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Fh(e,t,n,r,i){switch(t){case`focusin`:return Eh=Ph(Eh,e,t,n,r,i),!0;case`dragenter`:return Dh=Ph(Dh,e,t,n,r,i),!0;case`mouseover`:return Oh=Ph(Oh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return kh.set(a,Ph(kh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ah.set(a,Ph(Ah.get(a)||null,e,t,n,r,i)),!0}return!1}function $(e){var t=Mt(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,bt(e.priority,function(){gh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,bt(e.priority,function(){gh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=xh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);bn=r,n.target.dispatchEvent(r),bn=null}else return t=Nt(n),t!==null&&hh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){Th=!1,Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh!==null&&Ih(Oh)&&(Oh=null),kh.forEach(Lh),Ah.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,Th||(Th=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Ch(r||n)===null)continue;break}var a=Nt(n);a!==null&&(e.splice(t,3),t-=3,Js(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh!==null&&zh(Oh,e),kh.forEach(t),Ah.forEach(t);for(var n=0;n<jh.length;n++){var r=jh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<jh.length&&(n=jh[0],n.blockedOn===null);)$(n),n.blockedOn===null&&jh.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[Ct]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Ct]||null)s=o.formAction;else if(Ch(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;fh(n,jd(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fh(e.current,2,null,e,null,null),zd(),t[wt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=yt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<jh.length&&t!==0&&t<jh[n].priority;n++);jh.splice(n,0,e),n===0&&$(e)}};var Kh=n.version;if(Kh!==`19.3.0`)throw Error(i(527,Kh,`19.3.0`));R.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:L,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Ye=Jh.inject(qh),Xe=Jh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=_c,s=vc,c=yc;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=uh(e,1,!1,null,null,n,r,null,o,s,c,Uh),e[wt]=t.current,Wf(e),new Wh(t)}})),g=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=`modulepreload`,v=function(e){return`/`+e},y={},b=function(e){return e.pathname.endsWith(`.css`)},x=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=v(t,n);let r=s(t);if(r.href in y)return;y[r.href]=!0;let i=b(r);if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let o=document.createElement(`link`);if(o.rel=i?`stylesheet`:_,i||(o.as=`script`),o.crossOrigin=``,o.href=r.href,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),i)return new Promise((e,t)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${r}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},S=c(u(),1),C=e=>{throw TypeError(e)},w=(e,t,n)=>t.has(e)||C(`Cannot `+n),T=(e,t,n)=>(w(e,t,`read from private field`),n?n.call(e):t.get(e)),E=(e,t,n)=>t.has(e)?C(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),D=(e,t,n,r)=>(w(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),O=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,k=/^[\\/]{2}/;function A(e,t){return t+e.replace(/\\/g,`/`)}var j=`popstate`;function M(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function ee(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return re(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:F(t)}return ie(t,n,null,e)}function N(e,t){if(e===!1||e==null)throw Error(t)}function P(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function te(){return Math.random().toString(36).substring(2,10)}function ne(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function re(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?I(t):t,state:n,key:t&&t.key||r||te(),mask:i}}function F({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function I(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function ie(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=M(e)?e:re(h.location,e,t);n&&n(r,e),l=u()+1;let d=ne(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=M(e)?e:re(h.location,e,t);n&&n(r,e),l=u();let i=ne(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return ae(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(j,d),c=e,()=>{i.removeEventListener(j,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function ae(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),N(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:F(t);return i=i.replace(/ $/,`%20`),!n&&k.test(i)&&(i=r+i),new URL(i,r)}var oe,se=class{constructor(e){if(E(this,oe,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(T(this,oe).has(e))return T(this,oe).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){T(this,oe).set(e,t)}};oe=new WeakMap;var ce=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function le(e){return ce.has(e)}var ue=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function de(e){return ue.has(e)}function fe(e){return e.index===!0}function pe(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(N(e.index!==!0||!e.children,`Cannot specify children on an index route`),N(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),fe(e)){let n={...e,id:s};return r[s]=L(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=L(n,t(n)),e.children&&(n.children=pe(e.children,t,o,r,i)),n}})}function L(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function R(e,t,n=`/`){return me(e,t,n,!1)}function me(e,t,n,r,i){let a=Pe((typeof t==`string`?I(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ge(e),s=null,c=Ne(a);for(let e=0;s==null&&e<o.length;++e)s=ke(o[e],c,r);return s}function he(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function ge(e){let t=_e(e);return ye(t),t}function _e(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;N(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=We([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(N(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),_e(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:De(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Me(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ve(e.path))a(e,t,!0,n)}),t}function ve(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ve(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function ye(e){e.sort((e,t)=>e.score===t.score?Oe(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var be=/^:[\w-]+$/,xe=3,Se=2,Ce=1,we=10,Te=-2,Ee=e=>e===`*`;function De(e,t){let n=e.split(`/`),r=n.length;return n.some(Ee)&&(r+=Te),t&&(r+=Se),n.filter(e=>!Ee(e)).reduce((e,t)=>e+(be.test(t)?xe:t===``?Ce:we),r)}function Oe(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function ke(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?je(u,l,s.matcher,s.compiledParams):Ae(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Ae({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:We([a,d.pathname]),pathnameBase:Ke(We([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=We([a,d.pathnameBase]))}return o}function Ae(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Me(e.path,e.caseSensitive,e.end);return je(e,t,n,r)}function je(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=Ge(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=Ge(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Me(e,t=!1,n=!0){P(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Ne(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return P(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Pe(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Fe({basename:e,pathname:t}){return t===`/`?e:We([e,t])}var Ie=e=>O.test(e);function Le(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?I(e):e,a;return n?(n=Ue(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?Re(n.substring(1),`/`):Re(n,t)):a=t,{pathname:a,search:qe(r),hash:Je(i)}}function Re(e,t){let n=Ge(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ze(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Be(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Ve(e){let t=Be(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function He(e,t,n,r=!1){let i;typeof e==`string`?i=I(e):(i={...e},N(!i.pathname||!i.pathname.includes(`?`),ze(`?`,`pathname`,`search`,i)),N(!i.pathname||!i.pathname.includes(`#`),ze(`#`,`pathname`,`hash`,i)),N(!i.search||!i.search.includes(`#`),ze(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Le(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Ue=e=>e.replace(/[\\/]{2,}/g,`/`),We=e=>Ue(e.join(`/`));function Ge(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var Ke=e=>Ge(e).replace(/^\/*/,`/`),qe=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Je=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ye=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Xe=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Ze(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Qe(e){return We(e.map(e=>e.route.path).filter(Boolean))||`/`}var $e=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function et(e,t){let n=e;if(typeof n!=`string`||!O.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if($e)try{let e=new URL(window.location.href),r=k.test(n)?new URL(A(n,e.protocol)):new URL(n),a=Pe(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{P(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var tt=Symbol(`Uninstrumented`);function nt(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=it(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=it(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[tt]??i,a=it(n[e],t,(...e)=>ot(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[tt]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[tt]??e,r=it(n.middleware,t,(...e)=>ot(e[0]));return r?(r[tt]=t,r):e})),r}function rt(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[tt]??e.navigate,r=it(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?F(n):`.`,...st(e,r??{})}});r&&(r[tt]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[tt]??e.fetch,r=it(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...st(e,i??{})}});r&&(r[tt]=t,e.fetch=r)}return e}function it(e,t,n){return e.length===0?null:async(...r)=>{let i=await at(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function at(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=at(e,t,n,r-1),a=await o,N(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function ot(e){let{request:t,context:n,params:r,pattern:i}=e;return{request:ct(t),params:{...r},pattern:i,context:lt(n)}}function st(e,t){return{currentUrl:F(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function ct(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function lt(e){if(dt(e)){let t={...e};return Object.freeze(t),t}return{get:t=>e.get(t)}}var ut=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function dt(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===ut}var ft=new URL(`http://localhost`);function pt(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),ft)}catch{return ft}}function mt(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function ht(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function gt(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!mt(i,n),s=!mt(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!ht(e,i)||!mt(i,a)))throw Error(`External navigation is not allowed`)}var _t=[`POST`,`PUT`,`PATCH`,`DELETE`],vt=new Set(_t),yt=[`GET`,..._t],bt=new Set(yt),xt=new Set([301,302,303,307,308]),St=new Set([307,308]),Ct={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},wt={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Tt={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Et=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Dt=`remix-router-transitions`,Ot=Symbol(`ResetLoaderData`),kt,At,jt,Mt,Nt=class{constructor(e){E(this,kt),E(this,At),E(this,jt),E(this,Mt),D(this,kt,e),D(this,At,ge(e))}get stableRoutes(){return T(this,kt)}get activeRoutes(){return T(this,jt)??T(this,kt)}get branches(){return T(this,Mt)??T(this,At)}get hasHMRRoutes(){return T(this,jt)!=null}setRoutes(e){D(this,kt,e),D(this,At,ge(e))}setHmrRoutes(e){D(this,jt,e),D(this,Mt,ge(e))}commitHmrRoutes(){T(this,jt)&&(D(this,kt,T(this,jt)),D(this,At,T(this,Mt)),D(this,jt,void 0),D(this,Mt,void 0))}};kt=new WeakMap,At=new WeakMap,jt=new WeakMap,Mt=new WeakMap;function Pt(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;N(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||Et,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...nt(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new Nt(pe(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||Zt,u={...e.future},d=null,f=new Set,p=null,m=null,h=null,g=null,_=e.hydrationData!=null,v=me(s.activeRoutes,e.history.location,c,!1,s.branches),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=Cn(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Sn(s.activeRoutes);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&st(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=st(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}else if(v.some(e=>e.route.lazy))x=!1,S=!x;else if(!v.some(e=>zt(e.route)))x=!0,S=!x;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=v;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}S=!1,x=!0,r.forEach(e=>{let r=Bt(e.route,t,n);S||=r.renderFallback,x&&=!r.shouldLoad})}let C,w={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,renderFallback:S,navigation:Ct,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},T=`POP`,E=null,D=!1,O,A=!1,j=new Map,M=null,ee=!1,te=!1,ne=new Set,ie=new Map,oe=0,ce=-1,le=new Map,ue=new Set,de=new Map,fe=new Map,L=new Set,R=new Map,ge,_e=null;function ve(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(ge){ge(),ge=void 0;return}P(R.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=$e({currentLocation:w.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{ge=e});e.history.go(r*-1),Qe(i,{state:`blocked`,location:n,proceed(){Qe(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(w.blockers);e.set(i,Tt),xe({blockers:e})}}),E?.resolve(),E=null}else return Te(t,n)}),n){qn(t,j);let e=()=>Jn(t,j);t.addEventListener(`pagehide`,e),M=()=>t.removeEventListener(`pagehide`,e)}return w.initialized||Te(`POP`,w.location,{initialHydration:!0}),C}function ye(){d&&d(),M&&M(),f.clear(),O&&O.abort(),w.fetchers.forEach((e,t)=>Ue(w.fetchers,t)),w.blockers.forEach((e,t)=>Xe(t))}function be(e){if(f.add(e),p){let{newErrors:t}=p;p=null,e(w,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>f.delete(e)}function xe(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),w={...w,...e};let n=[],r=[];w.fetchers.forEach((e,t)=>{e.state===`idle`&&(L.has(t)?n.push(t):r.push(t))}),L.forEach(e=>{!w.fetchers.has(e)&&!ie.has(e)&&n.push(e)}),f.size===0&&(p={newErrors:e.errors??null}),[...f].forEach(r=>r(w,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>Ue(w.fetchers,e)),r.forEach(e=>w.fetchers.delete(e))}function Se(t,n,{flushSync:r}={}){let i=w.actionData!=null&&w.navigation.formMethod!=null&&Rn(w.navigation.formMethod)&&w.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?w.actionData:null;let o=n.loaderData?yn(w.loaderData,n.loaderData,n.matches||[],n.errors):w.loaderData,c=w.blockers;c.size>0&&(c=new Map(c),c.forEach((e,t)=>c.set(t,Tt)));let l=!ee&&ot(t,n.matches||w.matches),u=D===!0||w.navigation.formMethod!=null&&Rn(w.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),ee||T===`POP`||(T===`PUSH`?e.history.push(t,t.state):T===`REPLACE`&&e.history.replace(t,t.state));let d;if(T===`POP`&&!ee&&t!==w.location){let e=j.get(w.location.pathname);e&&e.has(t.pathname)?d={currentLocation:w.location,nextLocation:t}:j.has(t.pathname)&&(d={currentLocation:t,nextLocation:w.location})}else if(A){let e=j.get(w.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),j.set(w.location.pathname,e)),d={currentLocation:w.location,nextLocation:t}}xe({...n,actionData:a,loaderData:o,historyAction:T,location:t,initialized:!0,renderFallback:!1,navigation:Ct,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),T=`POP`,D=!1,A=!1,ee=!1,te=!1,E?.resolve(),E=null,_e?.resolve(),_e=null}async function Ce(t,n){if(E?.resolve(),E=null,typeof t==`number`){E||=Yn();let n=E.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=Lt(!1,It(w.location,w.matches,c,t,n?.fromRouteId,n?.relative),n),o;if(n?.mask){let t=typeof n.mask==`string`?I(n.mask):{...w.location.mask,...n.mask};if(o={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},k.test(o.pathname))throw Error(`External navigation is not allowed`);o.pathname.startsWith(`\\`)&&(o.pathname=o.pathname.replace(/^\\+/,`/`)),gt(typeof n.mask==`string`?n.mask:F(n.mask),F(o),e.history.createURL(`/`),`reject`)}let s=w.location,l=re(s,r,n&&n.state,void 0,o);l={...l,...e.history.encodeLocation(l)},gt(t==null?e.history.createHref(w.location):typeof t==`string`?t:F(t),e.history.createHref(l.mask||l),e.history.createURL(`/`),`reject`);let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&Rn(i.formMethod)&&i.formAction===w.location.pathname+w.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=$e({currentLocation:s,nextLocation:l,historyAction:d});m?Qe(m,{state:`blocked`,location:l,proceed(){Qe(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),Ce(t,n)},reset(){let e=new Map(w.blockers);e.set(m,Tt),xe({blockers:e})}}):await Te(d,l,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})}function we(){_e||=Yn(),Re(),xe({revalidation:`loading`});let e=_e.promise;return w.navigation.state===`submitting`?e:w.navigation.state===`idle`?(Te(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),e):(Te(T||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:A===!0}),e)}async function Te(t,n,r){O&&O.abort(),O=null,T=t,ee=(r&&r.startUninterruptedRevalidation)===!0,at(w.location,w.matches),D=(r&&r.preventScrollReset)===!0,A=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&w.matches&&w.matches.length>0&&!y?w.matches:me(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&w.initialized&&!te&&En(w.location,n)&&!(r&&r.submission&&Rn(r.submission.formMethod))){Se(n,{matches:a},{flushSync:o});return}let l=st(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),!a){let{error:e,notFoundMatches:t,route:r}=et(n.pathname);Se(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;O=new AbortController;let d=pn(e.history,n,O.signal,r&&r.submission),f=e.getContext?await e.getContext():new se,p;if(r&&r.pendingError)p=[xn(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&Rn(r.submission.formMethod)){let i=await Ee(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if(jn(t)&&Ze(t.error)&&t.error.status===404){O=null,Se(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=Hn(n,a,t,r.submission),o=!1,l.active=!1,d=pn(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await De(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(O=null,Se(n,{matches:h||a,...bn(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function Ee(t,n,i,l,u,d,f,p,m={}){if(Re(),xe({navigation:Un(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await ct(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Sn(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=xn(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=et(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=Bn(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:Cn(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await Fe(t,n,rn(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(Mn(h)){let n;return n=m&&m.replace!=null?m.replace:fn(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===w.location.pathname+w.location.search,await Ne(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if(jn(h)){let e=xn(l,g.route.id);return(m&&m.replace)!==!0&&(T=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function De(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||Hn(n,i,l,p),x=p||m||Vn(b),S=!ee&&!g;if(d){if(S){let e=Oe(v);xe({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await ct(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Sn(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=xn(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=et(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:T,revalidatingFetchers:E}=Rt(t,u,a,o,e.history,w,i,x,n,g?[]:r,g===!0,te,ne,L,de,ue,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(ce=++oe,!e.dataStrategy&&!T.some(e=>e.shouldLoad)&&!T.some(e=>e.route.middleware&&e.route.middleware.length>0)&&E.length===0){let e=new Map(w.fetchers),t=qe(e);return Se(n,{matches:i,loaderData:{},errors:v&&jn(v[1])?{[v[0]]:v[1].error}:null,...bn(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=Oe(v);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=ke(E)),xe(e,{flushSync:_})}E.forEach(e=>{Ge(e.key),e.controller&&ie.set(e.key,e.controller)});let D=()=>E.forEach(e=>Ge(e.key));O&&O.signal.addEventListener(`abort`,D);let{loaderResults:k,fetcherResults:A}=await Le(T,E,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener(`abort`,D),E.forEach(e=>ie.delete(e.key));let j=wn(k);if(j)return await Ne(t,j.result,!0,{replace:h}),{shortCircuited:!0};if(j=wn(A),j)return ue.add(j.key),await Ne(t,j.result,!0,{replace:h}),{shortCircuited:!0};let M=new Map(w.fetchers),{loaderData:N,errors:P}=vn(w,i,k,v,E,A,M);g&&w.errors&&(P={...w.errors,...P});let re=qe(M),F=Je(ce,M),I=re||F||E.length>0;return{matches:i,loaderData:N,errors:P,...I?{workingFetchers:M}:{}}}function Oe(e){if(e&&!jn(e[1]))return{[e[0]]:e[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function ke(e){let t=new Map(w.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=Wn(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function Ae(t,n,r,i){Ge(t);let a=(i&&i.flushSync)===!0,o=s.activeRoutes,l=It(w.location,w.matches,c,r,n,i?.relative),u=me(o,l,c,!1,s.branches),d=st(u,o,l);if(d.active&&d.matches&&(u=d.matches),!u){Be(t,n,Cn(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=Lt(!0,l,i);if(m){Be(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new se,g=(i&&i.preventScrollReset)===!0;p&&Rn(p.formMethod)?await je(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate):(de.set(t,{routeId:n,path:f}),await Me(t,n,f,u,h,d.active,a,g,p))}async function je(t,n,i,l,u,d,f,p,m,h){Re(),de.delete(t),ze(t,Gn(m,w.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=pn(e.history,i,g.signal,m);if(d){let e=await ct(l,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Be(t,n,e.error,{flushSync:f});return}if(e.matches)l=e.matches;else{Be(t,n,Cn(404,{pathname:i}),{flushSync:f});return}}let v=Bn(l,i);if(!v.route.action&&!v.route.lazy){Be(t,n,Cn(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}ie.set(t,g);let y=oe,b=rn(a,o,_,i,l,v,r,u),x=await Fe(_,i,b,u,t),S=x[v.route.id];if(!S){for(let e of b)if(x[e.route.id]){S=x[e.route.id];break}}if(_.signal.aborted){ie.get(t)===g&&ie.delete(t);return}if(L.has(t)){if(Mn(S)||jn(S)){ze(t,Kn(void 0));return}}else{if(Mn(S)){if(ie.delete(t),ce>y){ze(t,Kn(void 0));return}return ue.add(t),ze(t,Wn(m)),Ne(_,S,!1,{fetcherSubmission:m,preventScrollReset:p})}if(jn(S)){Be(t,n,S.error);return}}let C=w.navigation.location||w.location,E=pn(e.history,C,g.signal),D=s.activeRoutes,k=w.navigation.state===`idle`?w.matches:me(D,w.navigation.location,c,!1,s.branches);N(k,`Didn't find any matches after fetcher action`);let A=++oe;le.set(t,A);let{dsMatches:j,revalidatingFetchers:M}=Rt(E,u,a,o,e.history,w,k,m,C,r,!1,te,ne,L,de,ue,D,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,S],h),ee=Wn(m,S.data),P=new Map(w.fetchers);P.set(t,ee),M.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=P.get(t),r=Wn(void 0,n?n.data:void 0);P.set(t,r),Ge(t),e.controller&&ie.set(t,e.controller)}),xe({fetchers:P});let re=()=>M.forEach(e=>Ge(e.key));g.signal.addEventListener(`abort`,re);let{loaderResults:F,fetcherResults:I}=await Le(j,M,E,C,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,re),le.delete(t),ie.delete(t),M.forEach(e=>ie.delete(e.key));let ae=w.fetchers.has(t),se=e=>{if(!ae)return e;let n=new Map(e.fetchers);return n.set(t,Kn(S.data)),{...e,fetchers:n}},fe=wn(F);if(fe)return w=se(w),Ne(E,fe.result,!1,{preventScrollReset:p});if(fe=wn(I),fe)return ue.add(fe.key),w=se(w),Ne(E,fe.result,!1,{preventScrollReset:p});let pe=new Map(w.fetchers);ae&&pe.set(t,Kn(S.data));let{loaderData:R,errors:he}=vn(w,k,F,void 0,M,I,pe);Je(A,pe),w.navigation.state===`loading`&&A>ce?(N(T,`Expected pending action`),O&&O.abort(),Se(w.navigation.location,{matches:k,loaderData:R,errors:he,fetchers:pe})):(xe({errors:he,loaderData:yn(w.loaderData,R,k,he),fetchers:pe}),te=!1)}async function Me(t,n,i,s,c,l,u,d,f){let p=w.fetchers.get(t);ze(t,Wn(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=pn(e.history,i,m.signal);if(l){let e=await ct(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){Be(t,n,e.error,{flushSync:u});return}if(e.matches)s=e.matches;else{Be(t,n,Cn(404,{pathname:i}),{flushSync:u});return}}let g=Bn(s,i);ie.set(t,m);let _=oe,v=await Fe(h,i,rn(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(ie.get(t)===m&&ie.delete(t),!h.signal.aborted){if(L.has(t))ze(t,Kn(void 0));else if(Mn(y)){if(ce>_){ze(t,Kn(void 0));return}ue.add(t),await Ne(h,y,!1,{preventScrollReset:d})}else jn(y)?Be(t,n,y.error):ze(t,Kn(y.data))}}async function Ne(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(E?.resolve(),E=null),i.response.headers.has(`X-Remix-Revalidate`)&&(te=!0);let d=i.response.headers.get(`Location`);N(d,`Expected a Location header on the redirect Response`);let f=d,p=new URL(r.url);d=fn(d,p,c,e.history),gt(f,d,p,`allow-explicit`);let m=re(w.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(Ie(d)){let n=ae(t,d,!0);e=n.origin!==t.location.origin||Pe(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}O=null;let h=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:g,formAction:_,formEncType:v}=w.navigation;!o&&!s&&g&&_&&v&&(o=Vn(w.navigation));let y=o||s;St.has(i.response.status)&&y&&Rn(y.formMethod)?await Te(h,m,{submission:{...y,formAction:d},preventScrollReset:l||D,enableViewTransition:a?A:void 0}):await Te(h,m,{overrideNavigation:Hn(m,[],h,o),fetcherSubmission:s,preventScrollReset:l||D,enableViewTransition:a?A:void 0})}async function Fe(e,t,n,r,i){let a,o={};try{a=await an(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!Rn(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!w.loaderData.hasOwnProperty(e.route.id)&&(!w.errors||!w.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(An(r)){let i=r.result;o[t]={type:`redirect`,response:ln(i,e,t,n,c)}}else o[t]=await cn(r);return o}async function Le(e,t,n,r,i){let a=Fe(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Fe(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:Cn(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Re(){te=!0,de.forEach((e,t)=>{ie.has(t)&&ne.add(t),Ge(t)})}function ze(e,t,n={}){let r=new Map(w.fetchers);r.set(e,t),xe({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function Be(e,t,n,r={}){let i=xn(w.matches,t),a=new Map(w.fetchers);Ue(a,e),xe({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Ve(e){return fe.set(e,(fe.get(e)||0)+1),L.has(e)&&L.delete(e),w.fetchers.get(e)||wt}function He(e,t){Ge(e,t?.reason),ze(e,Kn(null))}function Ue(e,t){let n=w.fetchers.get(t);ie.has(t)&&!(n&&n.state===`loading`&&le.has(t))&&Ge(t),de.delete(t),le.delete(t),ue.delete(t),L.delete(t),ne.delete(t),e.delete(t)}function We(e){let t=(fe.get(e)||0)-1;t<=0?(fe.delete(e),L.add(e)):fe.set(e,t),xe({fetchers:new Map(w.fetchers)})}function Ge(e,t){let n=ie.get(e);n&&(n.abort(t),ie.delete(e))}function Ke(e,t){for(let n of e){let e=t.get(n);N(e,`Expected fetcher: ${n}`);let r=Kn(e.data);t.set(n,r)}}function qe(e){let t=[],n=!1;for(let r of ue){let i=e.get(r);N(i,`Expected fetcher: ${r}`),i.state===`loading`&&(ue.delete(r),t.push(r),n=!0)}return Ke(t,e),n}function Je(e,t){let n=[];for(let[r,i]of le)if(i<e){let e=t.get(r);N(e,`Expected fetcher: ${r}`),e.state===`loading`&&(Ge(r),le.delete(r),n.push(r))}return Ke(n,t),n.length>0}function Ye(e,t){let n=w.blockers.get(e)||Tt;return R.get(e)!==t&&R.set(e,t),n}function Xe(e){w.blockers.delete(e),R.delete(e)}function Qe(e,t){let n=w.blockers.get(e)||Tt;N(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(w.blockers);r.set(e,t),xe({blockers:r})}function $e({currentLocation:e,nextLocation:t,historyAction:n}){if(R.size===0)return;R.size>1&&P(!1,`A router only supports one blocker at a time`);let r=Array.from(R.entries()),[i,a]=r[r.length-1],o=w.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function et(e){let t=Cn(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=Sn(n);return{notFoundMatches:r,route:i,error:t}}function tt(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===Ct){_=!0;let e=ot(w.location,w.matches);e!=null&&xe({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function it(e,t){return h&&h(e,t.map(e=>he(e,w.loaderData)))||e.key}function at(e,t){if(m&&g){let n=it(e,t);m[n]=g()}}function ot(e,t){if(m){let n=it(e,t),r=m[n];if(typeof r==`number`)return r}return null}function st(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:me(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:me(n,r,c,!0,e)}}return{active:!1,matches:null}}async function ct(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||Wt(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=me(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=me(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&<(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=me(s.activeRoutes,n,c,!0,u),!f||lt(l,f))return{type:`success`,matches:null};l=f}}function lt(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function ut(e){o={},s.setHmrRoutes(pe(e,a,void 0,o))}function dt(e,t,n=!1){Wt(e,t,s,o,a,n),s.hasHMRRoutes||xe({})}return C={get basename(){return c},get future(){return u},get state(){return w},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:ve,subscribe:be,enableScrollRestoration:tt,navigate:Ce,fetch:Ae,revalidate:we,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Ve,resetFetcher:He,deleteFetcher:We,dispose:ye,getBlocker:Ye,deleteBlocker:Xe,patchRoutes:dt,_internalFetchControllers:ie,_internalSetRoutes:ut,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){xe(e)}},e.instrumentations&&(C=rt(C,e.instrumentations.map(e=>e.router).filter(Boolean))),C}function Ft(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function It(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=He(r||`.`,Ve(o),Pe(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=zn(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=Fe({basename:n,pathname:c.pathname})),F(c)}function Lt(e,t,n){if(!n||!Ft(n))return{path:t};if(n.formMethod&&!Ln(n.formMethod))return{path:t,error:Cn(405,{method:n.formMethod})};let r=()=>({path:t,error:Cn(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=Tn(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!Rn(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}
|
|
10
|
+
`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!Rn(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}N(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=hn(n.formData),s=n.formData;else if(n.body instanceof FormData)o=hn(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=gn(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=gn(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(Rn(c.formMethod))return{path:t,submission:c};let l=I(t);return e&&l.search&&zn(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:F(l),submission:c}}function Rt(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?jn(b[1])?b[1].error:b[1].data:void 0,C=i.createURL(a.location),w=i.createURL(c),T;if(u&&a.errors){let e=Object.keys(a.errors)[0];T=o.findIndex(t=>t.route.id===e)}else if(b&&jn(b[1])){let e=b[0];T=o.findIndex(t=>t.route.id===e)-1}let E=b?b[1].statusCode:void 0,D=E&&E>=400,O={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:E},k=Qe(o),A=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!zt(s))f=!1;else if(u){let{shouldLoad:e}=Bt(s,a.loaderData,a.errors);f=e}else Vt(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return nn(n,r,e,c,k,i,l,t,f);let p=!1;typeof x==`boolean`?p=x:D?p=!1:d||C.pathname+C.search===w.pathname+w.search?p=!0:C.search===w.search?Ht(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p},h=Ut(i,m);return nn(n,r,e,c,k,i,l,t,h,m,x)}),j=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,b=me(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;j.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let S=Bn(b,e.path),C=new AbortController,w=pn(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=rn(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=rn(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!D&&d;let a={...O,defaultShouldRevalidate:i};Ut(S,a)&&(T=rn(n,r,w,e.path,b,S,l,t,a))}T&&j.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:A,revalidatingFetchers:j}}function zt(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Bt(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!zt(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function Vt(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function Ht(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function Ut(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Wt(e,t,n,r,i,a){let o;if(e){let t=r[e];N(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>Gt(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=pe(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=pe([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function Gt(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index!==t.index||e.path!==t.path||e.caseSensitive!==t.caseSensitive?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>Gt(e,t)))??!1}var Kt=new WeakMap,qt=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(N(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=Kt.get(i);o||(o={},Kt.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=le(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)P(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)P(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},Jt=new WeakMap;function Yt(e,t,n,r,i){let a=n[e.id];if(N(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=Jt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{N(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=de(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?P(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?P(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return Jt.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=qt({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function Xt(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Zt(e){return e.matches.some(e=>e.route.middleware)?Qt(e,()=>Xt(e)):Xt(e)}function Qt(e,t){return $t(e,t,e=>{if(In(e))throw e;return e},On,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=xn(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function $t(e,t,n,r,i){let{matches:a,...o}=e;return await en(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function en(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await en(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function tn(e,t,n,r,i){let a=qt({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Yt(r.route,Rn(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function nn(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=tn(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?Ut(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?Ut(a,{...l,defaultShouldRevalidate:e}):Ut(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!Rn(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(Rn(n.method)||!p)?on({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function rn(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?nn(e,t,n,r,Qe(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:tn(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function an(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:mn(t,n),pattern:Qe(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return Qt(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function on({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=Rn(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:mn(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a){if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw Cn(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw Cn(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function sn(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function cn(e){let{result:t,type:n}=e;if(Pn(t)){let e;try{e=await sn(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new Xe(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?Nn(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:Dn(t),statusCode:Ze(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Ze(t)?t.status:void 0}:Nn(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function ln(e,t,n,r,i){let a=e.headers.get(`Location`);if(N(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!Ie(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=It(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var un=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function dn(e){try{return un.includes(new URL(e).protocol)}catch{return!1}}function fn(e,t,n,r){if(Ie(e)){let r=e,i=k.test(r)?new URL(A(r,t.protocol)):new URL(r);if(dn(i.toString()))throw Error(`Invalid redirect location`);let a=Pe(i.pathname,n)!=null;if(i.origin===t.origin&&a)return Ue(i.pathname)+i.search+i.hash}try{if(dn(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function pn(e,t,n,r){let i=e.createURL(Tn(t)).toString(),a={signal:n};if(r&&Rn(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?hn(r.formData):r.formData}return new Request(i,a)}function mn(e,t){let n=new URL(e.url),r=typeof t==`string`?I(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function hn(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function gn(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function _n(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&jn(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(N(!Mn(f),`Cannot handle redirect results in processLoaderData`),jn(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=xn(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=Ot),c||(c=!0,s=Ze(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function vn(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=_n(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(N(s,`Did not find corresponding fetcher result`),jn(s)){let t=xn(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(Mn(s))N(!1,`Unhandled fetcher revalidation redirect`);else{let e=Kn(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function yn(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==Ot).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function bn(e){return e?jn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function xn(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function Sn(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function Cn(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new Xe(e||500,o,Error(s),!0)}function wn(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(Mn(r))return{key:n,result:r}}}function Tn(e){return F({...typeof e==`string`?I(e):e,hash:``})}function En(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Dn(e){return new Xe(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function On(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&kn(t))}function kn(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function An(e){return Pn(e.result)&&xt.has(e.result.status)}function jn(e){return e.type===`error`}function Mn(e){return(e&&e.type)===`redirect`}function Nn(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function Pn(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function Fn(e){return xt.has(e)}function In(e){return Pn(e)&&Fn(e.status)&&e.headers.has(`Location`)}function Ln(e){return bt.has(e.toUpperCase())}function Rn(e){return vt.has(e.toUpperCase())}function zn(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function Bn(e,t){let n=typeof t==`string`?I(t).search:t.search;if(e[e.length-1].route.index&&zn(n||``))return e[e.length-1];let r=Be(e);return r[r.length-1]}function Vn(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(t&&n&&r){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function Hn(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Un(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function Wn(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Gn(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Kn(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function qn(e,t){try{let n=e.sessionStorage.getItem(Dt);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function Jn(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Dt,JSON.stringify(n))}catch(e){P(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Yn(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Xn=S.createContext(null);Xn.displayName=`DataRouter`;var Zn=S.createContext(null);Zn.displayName=`DataRouterState`;var Qn=S.createContext(!1);function $n(){return S.useContext(Qn)}var er=S.createContext({isTransitioning:!1});er.displayName=`ViewTransition`;var tr=S.createContext(new Map);tr.displayName=`Fetchers`;var nr=S.createContext(null);nr.displayName=`Await`;var rr=S.createContext(null);rr.displayName=`Navigation`;var ir=S.createContext(null);ir.displayName=`Location`;var ar=S.createContext({outlet:null,matches:[],isDataRoute:!1});ar.displayName=`Route`;var or=S.createContext(null);or.displayName=`RouteError`;var sr=`REACT_ROUTER_ERROR`,cr=`REDIRECT`,lr=`ROUTE_ERROR_RESPONSE`;function ur(e){if(e.startsWith(`${sr}:${cr}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function dr(e){if(e.startsWith(`${sr}:${lr}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Xe(t.status,t.statusText,t.data)}catch{}}function fr(e,{relative:t}={}){N(pr(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=S.useContext(rr),{hash:i,pathname:a,search:o}=Sr(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:We([n,a])),r.createHref({pathname:s,search:o,hash:i})}function pr(){return S.useContext(ir)!=null}function mr(){return N(pr(),`useLocation() may be used only in the context of a <Router> component.`),S.useContext(ir).location}var hr=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function gr(e){S.useContext(rr).static||S.useLayoutEffect(e)}function _r(){let{isDataRoute:e}=S.useContext(ar);return e?zr():vr()}function vr(){N(pr(),`useNavigate() may be used only in the context of a <Router> component.`);let e=S.useContext(Xn),{basename:t,navigator:n}=S.useContext(rr),{matches:r}=S.useContext(ar),{pathname:i}=mr(),a=JSON.stringify(Ve(r)),o=S.useRef(!1);return gr(()=>{o.current=!0}),S.useCallback((r,s={})=>{if(P(o.current,hr),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=He(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:We([t,c.pathname])),gt(typeof r==`string`?r:F(r),n.createHref(c),pt(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var yr=S.createContext(null);function br(e){let t=S.useContext(ar).outlet;return S.useMemo(()=>t&&S.createElement(yr.Provider,{value:e},t),[t,e])}function xr(){let{matches:e}=S.useContext(ar);return e[e.length-1]?.params??{}}function Sr(e,{relative:t}={}){let{matches:n}=S.useContext(ar),{pathname:r}=mr(),i=JSON.stringify(Ve(n));return S.useMemo(()=>He(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Cr(e,t,n){N(pr(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=S.useContext(rr),{matches:i}=S.useContext(ar),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Vr(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
11
|
+
|
|
12
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=mr(),d;if(t){let e=typeof t==`string`?I(t):t;N(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):R(e,{pathname:p});P(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),P(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=Ar(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:We([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:We([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?S.createElement(ir.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function wr(){let e=Rr(),t=Ze(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=S.createElement(S.Fragment,null,S.createElement(`p`,null,`💿 Hey developer 👋`),S.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,S.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,S.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),S.createElement(S.Fragment,null,S.createElement(`h2`,null,`Unexpected Application Error!`),S.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?S.createElement(`pre`,{style:i},n):null,o)}var Tr=S.createElement(wr,null),Er=class extends S.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=dr(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:S.createElement(ar.Provider,{value:this.props.routeContext},S.createElement(or.Provider,{value:e,children:this.props.component}));return this.context?S.createElement(Or,{error:e},t):t}};Er.contextType=Qn;var Dr=new WeakMap;function Or({children:e,error:t}){let{basename:n,navigator:r}=S.useContext(rr);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=ur(t.digest);if(e){let i=Dr.get(t);if(i)throw i;let a=et(e.location,n),o=a.absoluteURL||a.to;if(gt(e.location,o,pt(r),`allow-explicit`),dn(o))throw Error(`Invalid redirect location`);if($e&&!Dr.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Dr.set(t,n),n}}return S.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function kr({routeContext:e,match:t,children:n}){let r=S.useContext(Xn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),S.createElement(ar.Provider,{value:e},n)}function Ar(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);N(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Qe(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Tr,o&&(s<0&&c===0?(Vr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?S.createElement(n.route.Component,null):n.route.element?n.route.element:e,S.createElement(kr,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?S.createElement(Er,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function jr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Mr(e){let t=S.useContext(Xn);return N(t,jr(e)),t}function Nr(e){let t=S.useContext(Zn);return N(t,jr(e)),t}function Pr(e){let t=S.useContext(ar);return N(t,jr(e)),t}function Fr(e){let t=Pr(e),n=t.matches[t.matches.length-1];return N(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Ir(){return Fr(`useRouteId`)}function Lr(){let{matches:e,loaderData:t}=Nr(`useMatches`);return S.useMemo(()=>e.map(e=>he(e,t)),[e,t])}function Rr(){let e=S.useContext(or),t=Nr(`useRouteError`),n=Fr(`useRouteError`);return e===void 0?t.errors?.[n]:e}function zr(){let{router:e}=Mr(`useNavigate`),t=Fr(`useNavigate`),n=S.useRef(!1);return gr(()=>{n.current=!0}),S.useCallback(async(r,i={})=>{P(n.current,hr),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Br={};function Vr(e,t,n){!t&&!Br[e]&&(Br[e]=!0,P(!1,n))}var Hr={};function Ur(e,t){!e&&!Hr[t]&&(Hr[t]=!0,console.warn(t))}var Wr=S.useOptimistic,Gr=()=>void 0;function Kr(e){return Wr?Wr(e):[e,Gr]}function qr(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&P(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:S.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&P(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:S.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&P(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:S.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Jr=[`HydrateFallback`,`hydrateFallbackElement`],Yr=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function Xr({router:e,flushSync:t,onError:n,useTransitions:r}){r=$n()||r;let[i,a]=S.useState(e.state),[o,s]=Kr(i),[c,l]=S.useState(),[u,d]=S.useState({isTransitioning:!1}),[f,p]=S.useState(),[m,h]=S.useState(),[g,_]=S.useState(),v=S.useRef(new Map),y=S.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:g})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:Qe(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&v.current.set(t,e.data)}),o.forEach(e=>v.current.delete(e)),Ur(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let y=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(Ur(g==null||y,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!g||!y)t&&u?t(()=>a(i)):r===!1?a(i):S.startTransition(()=>{r===!0&&s(e=>Zr(e,i)),a(i)});else if(t&&u){t(()=>{m&&(f?.resolve(),m.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:g.currentLocation,nextLocation:g.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>h(n))}else m?(f?.resolve(),m.skipTransition(),_({state:i,currentLocation:g.currentLocation,nextLocation:g.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}))},[e.window,t,m,f,r,s,n]);S.useLayoutEffect(()=>e.subscribe(y),[e,y]),S.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new Yr)},[u]),S.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):S.startTransition(()=>{r===!0&&s(e=>Zr(e,t)),a(t)}),await n});i.finished.finally(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})}),h(i)}},[c,f,e.window,r,s]),S.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,m,o.location,c]),S.useEffect(()=>{!u.isTransitioning&&g&&(l(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),_(void 0))},[u.isTransitioning,g]);let b=S.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),x=e.basename||`/`,C=S.useMemo(()=>({router:e,navigator:b,static:!1,basename:x,onError:n}),[e,b,x,n]);return S.createElement(S.Fragment,null,S.createElement(Xn.Provider,{value:C},S.createElement(Zn.Provider,{value:o},S.createElement(tr.Provider,{value:v.current},S.createElement(er.Provider,{value:u},S.createElement(ni,{basename:x,location:o.location,navigationType:o.historyAction,navigator:b,useTransitions:r},S.createElement(Qr,{routes:e.routes,manifest:e.manifest,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function Zr(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var Qr=S.memo($r);function $r({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Cr(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function ei({to:e,replace:t,state:n,relative:r}){N(pr(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=S.useContext(rr);P(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=S.useContext(ar),{pathname:s}=mr(),c=_r(),l=He(e,Ve(o),s,r===`path`);gt(typeof e==`string`?e:F(e),a.createHref(l),pt(a),`reject`);let u=JSON.stringify(l);return S.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function ti(e){return br(e.context)}function ni({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){N(!pr(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=S.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=I(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=S.useMemo(()=>{let e=Pe(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return P(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:S.createElement(rr.Provider,{value:c},S.createElement(ir.Provider,{children:t,value:h}))}S.Component;var ri=`get`,ii=`application/x-www-form-urlencoded`;function ai(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function oi(e){return ai(e)&&e.tagName.toLowerCase()===`button`}function si(e){return ai(e)&&e.tagName.toLowerCase()===`form`}function ci(e){return ai(e)&&e.tagName.toLowerCase()===`input`}function li(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ui(e,t){return e.button===0&&(!t||t===`_self`)&&!li(e)}function di(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function fi(e,t){let n=di(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var pi=null;function mi(){if(pi===null)try{new FormData(document.createElement(`form`),0),pi=!1}catch{pi=!0}return pi}var hi=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function gi(e){return e!=null&&!hi.has(e)?(P(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ii}"`),null):e}function _i(e,t){let n,r,i,a,o;if(si(e)){let o=e.getAttribute(`action`);r=o?Pe(o,t):null,n=e.getAttribute(`method`)||ri,i=gi(e.getAttribute(`enctype`))||ii,a=new FormData(e)}else if(oi(e)||ci(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Pe(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||ri,i=gi(e.getAttribute(`formenctype`))||gi(o.getAttribute(`enctype`))||ii,a=new FormData(o,e),!mi()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(ai(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=ri,r=null,i=ii,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function vi(e,t){if(e===!1||e==null)throw Error(t)}function yi(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&Pe(i.pathname,t)===`/`?`${Ge(t)}/_root.${r}`:`${Ge(i.pathname)}.${r}`,i}async function bi(e,t){if(e.id in t)return t[e.id];try{let n=await x(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function xi(e){return e!=null&&typeof e.page==`string`}function Si(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Ci(e,t,n){return Oi((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await bi(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Si).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function wi(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Ti(e,t,{includeHydrateFallback:n}={}){return Ei(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Ei(e){return[...new Set(e)]}function Di(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Oi(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!xi(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Di(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function ki(){let e=S.useContext(Xn);return vi(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Ai(){let e=S.useContext(Zn);return vi(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var ji=S.createContext(void 0);ji.displayName=`FrameworkContext`;function Mi(){let e=S.useContext(ji);return vi(e,`You must render this element inside a <HydratedRouter> element`),e}function Ni(e,t){let n=S.useContext(ji),[r,i]=S.useState(!1),[a,o]=S.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=S.useRef(null);S.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),S.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Pi(s,p),onBlur:Pi(c,m),onMouseEnter:Pi(l,p),onMouseLeave:Pi(u,m),onTouchStart:Pi(d,p)}]:[a,f,{}]:[!1,f,{}]}function Pi(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Fi({page:e,...t}){let n=$n(),{nonce:r}=Mi(),{router:i}=ki(),a=S.useMemo(()=>R(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?S.createElement(Li,{page:e,matches:a,...t}):S.createElement(Ri,{page:e,matches:a,...t})):null}function Ii(e){let{manifest:t,routeModules:n}=Mi(),[r,i]=S.useState([]);return S.useEffect(()=>{let r=!1;return Ci(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Li({page:e,matches:t,...n}){let r=mr(),{future:i}=Mi(),{basename:a}=ki(),o=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=yi(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return S.createElement(S.Fragment,null,o.map(e=>S.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Ri({page:e,matches:t,...n}){let r=mr(),{future:i,manifest:a,routeModules:o}=Mi(),{basename:s}=ki(),{loaderData:c,matches:l}=Ai(),u=S.useMemo(()=>wi(e,t,l,a,r,`data`),[e,t,l,a,r]),d=S.useMemo(()=>wi(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=yi(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=S.useMemo(()=>Ti(d,a),[d,a]),m=Ii(d);return S.createElement(S.Fragment,null,f.map(e=>S.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>S.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>S.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function zi(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}S.Component;var Bi=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Bi&&(window.__reactRouterVersion=`7.18.4`)}catch{}function Vi(e,t){return Pt({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:ee({window:t?.window}),hydrationData:t?.hydrationData||Hi(),routes:e,mapRouteProperties:qr,hydrationRouteProperties:Jr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function Hi(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:Ui(e.errors)}),e}function Ui(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new Xe(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&Ye.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}var z=S.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=S.useContext(rr),v=typeof l==`string`&&O.test(l),y=et(l,h);l=y.to;let b=fr(l,{relative:r}),x=mr(),C=null;if(o){let e=He(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:We([h,e.pathname])),C=g.createHref(e)}let[w,T,E]=Ni(n,p),D=Ji(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function k(t){e&&e(t),t.defaultPrevented||D(t)}let A=!(y.isExternal||i),j=S.createElement(`a`,{...p,...E,href:(A?C:void 0)||y.absoluteURL||b,onClick:A?k:e,ref:zi(m,T),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return w&&!v?S.createElement(S.Fragment,null,j,S.createElement(Fi,{page:b})):j});z.displayName=`Link`;var Wi=S.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Sr(a,{relative:c.relative}),d=mr(),f=S.useContext(Zn),{navigator:p,basename:m}=S.useContext(rr),h=f!=null&&ea(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=Pe(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),C={isActive:b,isPending:x,isTransitioning:h},w=b?e:void 0,T;T=typeof n==`function`?n(C):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return S.createElement(z,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Wi.displayName=`NavLink`;var Gi=S.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=ri,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=S.useContext(rr),g=Qi(),_=$i(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&O.test(s);return S.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?S.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Gi.displayName=`Form`;function Ki(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function qi(e){let t=S.useContext(Xn);return N(t,Ki(e)),t}function Ji(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=_r(),d=mr(),f=Sr(e,{relative:o});return S.useCallback(p=>{if(ui(p,t)){p.preventDefault();let t=n===void 0?F(d)===F(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?S.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Yi(e){P(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=S.useRef(di(e)),n=S.useRef(!1),r=mr(),i=S.useMemo(()=>fi(r.search,n.current?null:t.current),[r.search]),a=_r();return[i,S.useCallback((e,t)=>{let r=di(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var Xi=0,Zi=()=>`__${String(++Xi)}__`;function Qi(){let{router:e}=qi(`useSubmit`),{basename:t}=S.useContext(rr),n=Ir(),r=e.fetch,i=e.navigate;return S.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=_i(e,t);if(a.navigate===!1){let e=a.fetcherKey||Zi();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function $i(e,{relative:t}={}){let{basename:n}=S.useContext(rr),r=S.useContext(ar);N(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Sr(e||`.`,{relative:t})},o=mr();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:We([n,a.pathname])),F(a)}function ea(e,{relative:t}={}){let n=S.useContext(er);N(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=qi(`useViewTransitionState`),i=Sr(e,{relative:t});if(!n.isTransitioning)return!1;let a=Pe(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Pe(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ae(i.pathname,o)!=null||Ae(i.pathname,a)!=null}var ta=c(m(),1);function na(e){return S.createElement(Xr,{flushSync:ta.flushSync,...e})}var ra=g(),ia=class extends Error{status;constructor(e,t){super(t),this.status=e}};async function B(e,t={}){let n=new Headers(t.headers);n.set(`Accept`,`application/json`),t.body&&!(t.body instanceof FormData)&&n.set(`Content-Type`,`application/json`);let r=await fetch(e,{...t,headers:n});if(!r.ok){let e=r.statusText||`HTTP ${r.status}`;try{let t=await r.json();typeof t?.detail==`string`&&(e=t.detail)}catch{}throw new ia(r.status,e)}return r.status===204?void 0:await r.json()}var aa={get:e=>B(e),post:(e,t)=>B(e,{method:`POST`,body:t instanceof FormData?t:JSON.stringify(t??{})}),put:(e,t)=>B(e,{method:`PUT`,body:JSON.stringify(t)}),del:e=>B(e,{method:`DELETE`})};function V(e,t){let[n,r]=(0,S.useState)(),[i,a]=(0,S.useState)(),[o,s]=(0,S.useState)(e!==null),[c,l]=(0,S.useState)(0),u=(0,S.useCallback)(()=>l(e=>e+1),[]),d=(0,S.useRef)(!0);return(0,S.useEffect)(()=>{if(e===null)return;let t=!1;return d.current&&s(!0),aa.get(e).then(e=>!t&&(r(e),a(void 0))).catch(e=>!t&&a(e)).finally(()=>{t||(s(!1),d.current=!1)}),()=>{t=!0}},[e,c]),(0,S.useEffect)(()=>{if(!t||e===null)return;let n=window.setInterval(u,t);return()=>window.clearInterval(n)},[t,e,u]),{data:n,error:i,loading:o,reload:u}}var H=`<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>`,U=`</title><path d="`,W=`"/></svg>`,oa={title:`Adyen`,slug:`adyen`,get svg(){return H+`Adyen`+U+this.path+W},path:`M11.64703 9.88245v2.93377c0 .13405.10867.24271.24272.24271h.46316V9.88245h1.76474v5.1503c0 .46916-.38033.8495-.8495.8495H9.94303v-1.23507h2.40991v-.52942h-1.62108c-.46917 0-.8495-.38033-.8495-.8495V9.88245h1.76467Zm-8.26124.00001c.46917 0 .8495.38034.8495.8495v3.3858H.8495c-.46916 0-.8495-.38033-.8495-.8495v-.94805c0-.46917.38034-.8495.8495-.8495h.91521v1.3455c0 .13406.10867.24272.24272.24272h.46316V11.184c0-.13405-.10867-.24271-.24272-.24271l-2.16719-.00002V9.88246Zm5.79068-1.76471v6.00001H5.79068c-.46917 0-.8495-.38033-.8495-.8495v-2.53631c0-.46917.38033-.8495.8495-.8495h.91515v2.93377c0 .13405.10867.24271.24272.24271h.46316l.00005-4.94118h1.76471Zm9.03286 1.76471a.8495.8495 0 0 1 .8495.8495v.94805c0 .46917-.38033.8495-.8495.8495h-.9152v-1.3455c0-.13404-.10868-.2427-.24272-.2427h-.46317v1.8749c0 .13406.10867.24272.24272.24272h2.16719v1.05883h-3.32511c-.46917 0-.8495-.38033-.8495-.8495v-3.3858Zm4.94117 0c.46916 0 .8495.38034.8495.8495v3.3858h-1.7647V11.184c-.0004-.13388-.10884-.24232-.24272-.24272h-.46316v3.1765H19.7647V9.88245Z`,source:`https://www.adyen.com/press-and-media/presskit`,hex:`0ABF53`,guidelines:`https://www.adyen.com/press-and-media/presskit`},sa={title:`Airtable`,slug:`airtable`,get svg(){return H+`Airtable`+U+this.path+W},path:`M11.992 1.966c-.434 0-.87.086-1.28.257L1.779 5.917c-.503.208-.49.908.012 1.116l8.982 3.558a3.266 3.266 0 0 0 2.454 0l8.982-3.558c.503-.196.503-.908.012-1.116l-8.957-3.694a3.255 3.255 0 0 0-1.272-.257zM23.4 8.056a.589.589 0 0 0-.222.045l-10.012 3.877a.612.612 0 0 0-.38.564v8.896a.6.6 0 0 0 .821.552L23.62 18.1a.583.583 0 0 0 .38-.551V8.653a.6.6 0 0 0-.6-.596zM.676 8.095a.644.644 0 0 0-.48.19C.086 8.396 0 8.53 0 8.69v8.355c0 .442.515.737.908.54l6.27-3.006.307-.147 2.969-1.436c.466-.22.43-.908-.061-1.092L.883 8.138a.57.57 0 0 0-.207-.044z`,source:`https://airtable.com/newsroom`,hex:`18BFFF`},ca={title:`Claude`,slug:`claude`,get svg(){return H+`Claude`+U+this.path+W},path:`m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z`,source:`https://claude.ai`,hex:`D97757`},la={title:`Claude Code`,slug:`claudecode`,get svg(){return H+`Claude Code`+U+this.path+W},path:`M21 10.5h3v3h-3v3h-1.5v3H18v-3h-1.5v3H15v-3H9v3H7.5v-3H6v3H4.5v-3H3v-3H0v-3h3v-6h18Zm-15 0h1.5v-3H6Zm10.5 0H18v-3h-1.5z`,source:`https://code.claude.com`,hex:`D97757`},ua={title:`Deepgram`,slug:`deepgram`,get svg(){return H+`Deepgram`+U+this.path+W},path:`M11.203 24H1.517a.364.364 0 0 1-.258-.62l6.239-6.275a.366.366 0 0 1 .259-.108h3.52c2.723 0 5.025-2.127 5.107-4.845a5.004 5.004 0 0 0-4.999-5.148H7.613v4.646c0 .2-.164.364-.365.364H.968a.365.365 0 0 1-.363-.364V.364C.605.164.768 0 .969 0h10.416c6.684 0 12.111 5.485 12.01 12.187C23.293 18.77 17.794 24 11.202 24z`,source:`https://deepgram.com/company/newsroom`,hex:`13EF93`,guidelines:`https://deepgram.com/company/newsroom`},da={title:`DeepSeek`,slug:`deepseek`,get svg(){return H+`DeepSeek`+U+this.path+W},path:`M23.748 4.651c-.254-.124-.364.113-.512.233-.051.04-.094.09-.137.137-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.155-.708-.311-.955-.65-.172-.24-.219-.509-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.094.172.187.129.323-.082.28-.18.553-.266.833-.055.179-.137.218-.328.14a5.5 5.5 0 0 1-1.737-1.179c-.857-.828-1.631-1.743-2.597-2.46a12 12 0 0 0-.689-.47c-.985-.957.13-1.743.387-1.836.27-.098.094-.433-.778-.428-.872.003-1.67.295-2.687.685a3 3 0 0 1-.465.136 9.6 9.6 0 0 0-2.883-.101c-1.885.21-3.39 1.1-4.497 2.622C.082 8.776-.231 10.854.152 13.02c.403 2.284 1.568 4.175 3.36 5.653 1.857 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.132-.284 4.994-1.86.47.234.962.328 1.78.398.629.058 1.235-.031 1.705-.129.735-.155.684-.836.418-.961-2.155-1.004-1.682-.595-2.112-.926 1.095-1.295 2.768-3.598 3.284-6.733.05-.346.115-.834.108-1.114-.004-.171.035-.238.23-.257a4.2 4.2 0 0 0 1.545-.475c1.397-.763 1.96-2.016 2.093-3.517.02-.23-.004-.467-.247-.588M11.58 18.168c-2.088-1.642-3.101-2.183-3.52-2.16-.39.024-.32.472-.234.763.09.288.207.487.371.74.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.168-1.361-.801-2.5-1.86-3.301-3.306-.775-1.393-1.225-2.888-1.299-4.482-.02-.385.094-.522.477-.592a4.7 4.7 0 0 1 1.53-.038c2.131.311 3.946 1.264 5.467 2.774.868.86 1.525 1.887 2.202 2.89.72 1.066 1.494 2.082 2.48 2.915.348.291.626.513.892.677-.802.09-2.14.109-3.055-.615zm1.001-6.44a.306.306 0 0 1 .415-.287.3.3 0 0 1 .113.074.3.3 0 0 1 .086.214c0 .17-.136.307-.308.307a.303.303 0 0 1-.306-.307m3.11 1.596c-.2.081-.4.151-.591.16a1.25 1.25 0 0 1-.798-.254c-.274-.23-.47-.358-.551-.758a1.7 1.7 0 0 1 .015-.588c.07-.327-.007-.537-.238-.727-.188-.156-.426-.199-.689-.199a.6.6 0 0 1-.254-.078.253.253 0 0 1-.114-.358 1 1 0 0 1 .192-.21c.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.392.451.462.576.685.915.176.264.336.536.446.848.066.194-.02.353-.25.45`,source:`https://www.deepseek.com`,hex:`5786FE`},fa={title:`Discord`,slug:`discord`,get svg(){return H+`Discord`+U+this.path+W},path:`M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z`,source:`https://discord.com/branding`,hex:`5865F2`,guidelines:`https://discord.com/branding`},pa={title:`Docker`,slug:`docker`,get svg(){return H+`Docker`+U+this.path+W},path:`M13.983 11.078h2.119a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.119a.185.185 0 00-.185.185v1.888c0 .102.083.185.185.185m-2.954-5.43h2.118a.186.186 0 00.186-.186V3.574a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m0 2.716h2.118a.187.187 0 00.186-.186V6.29a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.887c0 .102.082.185.185.186m-2.93 0h2.12a.186.186 0 00.184-.186V6.29a.185.185 0 00-.185-.185H8.1a.185.185 0 00-.185.185v1.887c0 .102.083.185.185.186m-2.964 0h2.119a.186.186 0 00.185-.186V6.29a.185.185 0 00-.185-.185H5.136a.186.186 0 00-.186.185v1.887c0 .102.084.185.186.186m5.893 2.715h2.118a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m-2.93 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.083.185.185.185m-2.964 0h2.119a.185.185 0 00.185-.185V9.006a.185.185 0 00-.184-.186h-2.12a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-2.92 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.082.185.185.185M23.763 9.89c-.065-.051-.672-.51-1.954-.51-.338.001-.676.03-1.01.087-.248-1.7-1.653-2.53-1.716-2.566l-.344-.199-.226.327c-.284.438-.49.922-.612 1.43-.23.97-.09 1.882.403 2.661-.595.332-1.55.413-1.744.42H.751a.751.751 0 00-.75.748 11.376 11.376 0 00.692 4.062c.545 1.428 1.355 2.48 2.41 3.124 1.18.723 3.1 1.137 5.275 1.137.983.003 1.963-.086 2.93-.266a12.248 12.248 0 003.823-1.389c.98-.567 1.86-1.288 2.61-2.136 1.252-1.418 1.998-2.997 2.553-4.4h.221c1.372 0 2.215-.549 2.68-1.009.309-.293.55-.65.707-1.046l.098-.288Z`,source:`https://www.docker.com/company/newsroom/media-resources`,hex:`2496ED`},ma={title:`ElevenLabs`,slug:`elevenlabs`,get svg(){return H+`ElevenLabs`+U+this.path+W},path:`M4.6035 0v24h4.9317V0zm9.8613 0v24h4.9317V0z`,source:`https://elevenlabs.io/brand`,hex:`000000`,guidelines:`https://elevenlabs.io/brand`},ha={title:`Firebase`,slug:`firebase`,get svg(){return H+`Firebase`+U+this.path+W},path:`M19.455 8.369c-.538-.748-1.778-2.285-3.681-4.569-.826-.991-1.535-1.832-1.884-2.245a146 146 0 0 0-.488-.576l-.207-.245-.113-.133-.022-.032-.01-.005L12.57 0l-.609.488c-1.555 1.246-2.828 2.851-3.681 4.64-.523 1.064-.864 2.105-1.043 3.176-.047.241-.088.489-.121.738-.209-.017-.421-.028-.632-.033-.018-.001-.035-.002-.059-.003a7.46 7.46 0 0 0-2.28.274l-.317.089-.163.286c-.765 1.342-1.198 2.869-1.252 4.416-.07 2.01.477 3.954 1.583 5.625 1.082 1.633 2.61 2.882 4.42 3.611l.236.095.071.025.003-.001a9.59 9.59 0 0 0 2.941.568q.171.006.342.006c1.273 0 2.513-.249 3.69-.742l.008.004.313-.145a9.63 9.63 0 0 0 3.927-3.335c1.01-1.49 1.577-3.234 1.641-5.042.075-2.161-.643-4.304-2.133-6.371m-7.083 6.695c.328 1.244.264 2.44-.191 3.558-1.135-1.12-1.967-2.352-2.475-3.665-.543-1.404-.87-2.74-.974-3.975.48.157.922.366 1.315.622 1.132.737 1.914 1.902 2.325 3.461zm.207 6.022c.482.368.99.712 1.513 1.028-.771.21-1.565.302-2.369.273a8 8 0 0 1-.373-.022c.458-.394.869-.823 1.228-1.279zm1.347-6.431c-.516-1.957-1.527-3.437-3.002-4.398-.647-.421-1.385-.741-2.194-.95.011-.134.026-.268.043-.4.014-.113.03-.216.046-.313.133-.689.332-1.37.589-2.025.099-.25.206-.499.321-.74l.004-.008c.177-.358.376-.719.61-1.105l.092-.152-.003-.001c.544-.851 1.197-1.627 1.942-2.311l.288.341c.672.796 1.304 1.548 1.878 2.237 1.291 1.549 2.966 3.583 3.612 4.48 1.277 1.771 1.893 3.579 1.83 5.375-.049 1.395-.461 2.755-1.195 3.933-.694 1.116-1.661 2.05-2.8 2.708-.636-.318-1.559-.839-2.539-1.599.79-1.575.952-3.28.479-5.072zm-2.575 5.397c-.725.939-1.587 1.55-2.09 1.856-.081-.029-.163-.06-.243-.093l-.065-.026c-1.49-.616-2.747-1.656-3.635-3.01-.907-1.384-1.356-2.993-1.298-4.653.041-1.19.338-2.327.882-3.379.316-.07.638-.114.96-.131l.084-.002c.162-.003.324-.003.478 0 .227.011.454.035.677.07.073 1.513.445 3.145 1.105 4.852.637 1.644 1.694 3.162 3.144 4.515z`,source:`https://firebase.google.com/brand-guidelines`,hex:`DD2C00`,guidelines:`https://firebase.google.com/brand-guidelines`},ga={title:`GitHub`,slug:`github`,get svg(){return H+`GitHub`+U+this.path+W},path:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`,source:`https://github.com/logos`,hex:`181717`,guidelines:`https://github.com/logos`},_a={title:`GitLab`,slug:`gitlab`,get svg(){return H+`GitLab`+U+this.path+W},path:`m23.6004 9.5927-.0337-.0862L20.3.9814a.851.851 0 0 0-.3362-.405.8748.8748 0 0 0-.9997.0539.8748.8748 0 0 0-.29.4399l-2.2055 6.748H7.5375l-2.2057-6.748a.8573.8573 0 0 0-.29-.4412.8748.8748 0 0 0-.9997-.0537.8585.8585 0 0 0-.3362.4049L.4332 9.5015l-.0325.0862a6.0657 6.0657 0 0 0 2.0119 7.0105l.0113.0087.03.0213 4.976 3.7264 2.462 1.8633 1.4995 1.1321a1.0085 1.0085 0 0 0 1.2197 0l1.4995-1.1321 2.4619-1.8633 5.006-3.7489.0125-.01a6.0682 6.0682 0 0 0 2.0094-7.003z`,source:`https://about.gitlab.com/press/press-kit/`,hex:`FC6D26`,guidelines:`https://about.gitlab.com/handbook/marketing/corporate-marketing/brand-activation/trademark-guidelines/`},va={title:`Gmail`,slug:`gmail`,get svg(){return H+`Gmail`+U+this.path+W},path:`M24 5.457v13.909c0 .904-.732 1.636-1.636 1.636h-3.819V11.73L12 16.64l-6.545-4.91v9.273H1.636A1.636 1.636 0 0 1 0 19.366V5.457c0-2.023 2.309-3.178 3.927-1.964L5.455 4.64 12 9.548l6.545-4.91 1.528-1.145C21.69 2.28 24 3.434 24 5.457z`,source:`https://fonts.gstatic.com/s/i/productlogos/gmail_2020q4/v8/192px.svg`,hex:`EA4335`},ya={title:`Google Drive`,slug:`googledrive`,get svg(){return H+`Google Drive`+U+this.path+W},path:`M12.01 1.485c-2.082 0-3.754.02-3.743.047.01.02 1.708 3.001 3.774 6.62l3.76 6.574h3.76c2.081 0 3.753-.02 3.742-.047-.005-.02-1.708-3.001-3.775-6.62l-3.76-6.574zm-4.76 1.73a789.828 789.861 0 0 0-3.63 6.319L0 15.868l1.89 3.298 1.885 3.297 3.62-6.335 3.618-6.33-1.88-3.287C8.1 4.704 7.255 3.22 7.25 3.214zm2.259 12.653-.203.348c-.114.198-.96 1.672-1.88 3.287a423.93 423.948 0 0 1-1.698 2.97c-.01.026 3.24.042 7.222.042h7.244l1.796-3.157c.992-1.734 1.85-3.23 1.906-3.323l.104-.167h-7.249z`,source:`https://developers.google.com/drive/web/branding`,hex:`4285F4`},ba={title:`Google Gemini`,slug:`googlegemini`,get svg(){return H+`Google Gemini`+U+this.path+W},path:`M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81`,source:`https://gemini.google.com`,hex:`8E75B2`},xa={title:`Google Sheets`,slug:`googlesheets`,get svg(){return H+`Google Sheets`+U+this.path+W},path:`M11.318 12.545H7.91v-1.909h3.41v1.91zM14.728 0v6h6l-6-6zm1.363 10.636h-3.41v1.91h3.41v-1.91zm0 3.273h-3.41v1.91h3.41v-1.91zM20.727 6.5v15.864c0 .904-.732 1.636-1.636 1.636H4.909a1.636 1.636 0 0 1-1.636-1.636V1.636C3.273.732 4.005 0 4.909 0h9.318v6.5h6.5zm-3.273 2.773H6.545v7.909h10.91v-7.91zm-6.136 4.636H7.91v1.91h3.41v-1.91z`,source:`https://sheets.google.com`,hex:`34A853`},Sa={title:`Hugging Face`,slug:`huggingface`,get svg(){return H+`Hugging Face`+U+this.path+W},path:`M12.025 1.13c-5.77 0-10.449 4.647-10.449 10.378 0 1.112.178 2.181.503 3.185.064-.222.203-.444.416-.577a.96.96 0 0 1 .524-.15c.293 0 .584.124.84.284.278.173.48.408.71.694.226.282.458.611.684.951v-.014c.017-.324.106-.622.264-.874s.403-.487.762-.543c.3-.047.596.06.787.203s.31.313.4.467c.15.257.212.468.233.542.01.026.653 1.552 1.657 2.54.616.605 1.01 1.223 1.082 1.912.055.537-.096 1.059-.38 1.572.637.121 1.294.187 1.967.187.657 0 1.298-.063 1.921-.178-.287-.517-.44-1.041-.384-1.581.07-.69.465-1.307 1.081-1.913 1.004-.987 1.647-2.513 1.657-2.539.021-.074.083-.285.233-.542.09-.154.208-.323.4-.467a1.08 1.08 0 0 1 .787-.203c.359.056.604.29.762.543s.247.55.265.874v.015c.225-.34.457-.67.683-.952.23-.286.432-.52.71-.694.257-.16.547-.284.84-.285a.97.97 0 0 1 .524.151c.228.143.373.388.43.625l.006.04a10.3 10.3 0 0 0 .534-3.273c0-5.731-4.678-10.378-10.449-10.378M8.327 6.583a1.5 1.5 0 0 1 .713.174 1.487 1.487 0 0 1 .617 2.013c-.183.343-.762-.214-1.102-.094-.38.134-.532.914-.917.71a1.487 1.487 0 0 1 .69-2.803m7.486 0a1.487 1.487 0 0 1 .689 2.803c-.385.204-.536-.576-.916-.71-.34-.12-.92.437-1.103.094a1.487 1.487 0 0 1 .617-2.013 1.5 1.5 0 0 1 .713-.174m-10.68 1.55a.96.96 0 1 1 0 1.921.96.96 0 0 1 0-1.92m13.838 0a.96.96 0 1 1 0 1.92.96.96 0 0 1 0-1.92M8.489 11.458c.588.01 1.965 1.157 3.572 1.164 1.607-.007 2.984-1.155 3.572-1.164.196-.003.305.12.305.454 0 .886-.424 2.328-1.563 3.202-.22-.756-1.396-1.366-1.63-1.32q-.011.001-.02.006l-.044.026-.01.008-.03.024q-.018.017-.035.036l-.032.04a1 1 0 0 0-.058.09l-.014.025q-.049.088-.11.19a1 1 0 0 1-.083.116 1.2 1.2 0 0 1-.173.18q-.035.029-.075.058a1.3 1.3 0 0 1-.251-.243 1 1 0 0 1-.076-.107c-.124-.193-.177-.363-.337-.444-.034-.016-.104-.008-.2.022q-.094.03-.216.087-.06.028-.125.063l-.13.074q-.067.04-.136.086a3 3 0 0 0-.135.096 3 3 0 0 0-.26.219 2 2 0 0 0-.12.121 2 2 0 0 0-.106.128l-.002.002a2 2 0 0 0-.09.132l-.001.001a1.2 1.2 0 0 0-.105.212q-.013.036-.024.073c-1.139-.875-1.563-2.317-1.563-3.203 0-.334.109-.457.305-.454m.836 10.354c.824-1.19.766-2.082-.365-3.194-1.13-1.112-1.789-2.738-1.789-2.738s-.246-.945-.806-.858-.97 1.499.202 2.362c1.173.864-.233 1.45-.685.64-.45-.812-1.683-2.896-2.322-3.295s-1.089-.175-.938.647 2.822 2.813 2.562 3.244-1.176-.506-1.176-.506-2.866-2.567-3.49-1.898.473 1.23 2.037 2.16c1.564.932 1.686 1.178 1.464 1.53s-3.675-2.511-4-1.297c-.323 1.214 3.524 1.567 3.287 2.405-.238.839-2.71-1.587-3.216-.642-.506.946 3.49 2.056 3.522 2.064 1.29.33 4.568 1.028 5.713-.624m5.349 0c-.824-1.19-.766-2.082.365-3.194 1.13-1.112 1.789-2.738 1.789-2.738s.246-.945.806-.858.97 1.499-.202 2.362c-1.173.864.233 1.45.685.64.451-.812 1.683-2.896 2.322-3.295s1.089-.175.938.647-2.822 2.813-2.562 3.244 1.176-.506 1.176-.506 2.866-2.567 3.49-1.898-.473 1.23-2.037 2.16c-1.564.932-1.686 1.178-1.464 1.53s3.675-2.511 4-1.297c.323 1.214-3.524 1.567-3.287 2.405.238.839 2.71-1.587 3.216-.642.506.946-3.49 2.056-3.522 2.064-1.29.33-4.568 1.028-5.713-.624`,source:`https://huggingface.co/brand`,hex:`FFD21E`,guidelines:`https://huggingface.co/brand`},Ca={title:`Jira`,slug:`jira`,get svg(){return H+`Jira`+U+this.path+W},path:`M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0Z`,source:`https://atlassian.design/resources/logo-library`,hex:`0052CC`,guidelines:`https://atlassian.design/foundations/logos/`},wa={title:`Linear`,slug:`linear`,get svg(){return H+`Linear`+U+this.path+W},path:`M2.886 4.18A11.982 11.982 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556c-.524.33-1.075.62-1.65.866L.951 7.277c.247-.575.537-1.126.866-1.65ZM.322 9.163l14.515 14.515c-.71.172-1.443.282-2.195.322L0 11.358a12 12 0 0 1 .322-2.195Zm-.17 4.862 9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z`,source:`https://linear.app`,hex:`5E6AD2`},Ta={title:`Mistral AI`,slug:`mistralai`,get svg(){return H+`Mistral AI`+U+this.path+W},path:`M17.143 3.429v3.428h-3.429v3.429h-3.428V6.857H6.857V3.43H3.43v13.714H0v3.428h10.286v-3.428H6.857v-3.429h3.429v3.429h3.429v-3.429h3.428v3.429h-3.428v3.428H24v-3.428h-3.43V3.429z`,source:`https://chat.mistral.ai`,hex:`FA520F`},Ea={title:`Model Context Protocol`,slug:`modelcontextprotocol`,get svg(){return H+`Model Context Protocol`+U+this.path+W},path:`M13.85 0a4.16 4.16 0 0 0-2.95 1.217L1.456 10.66a.835.835 0 0 0 0 1.18.835.835 0 0 0 1.18 0l9.442-9.442a2.49 2.49 0 0 1 3.541 0 2.49 2.49 0 0 1 0 3.541L8.59 12.97l-.1.1a.835.835 0 0 0 0 1.18.835.835 0 0 0 1.18 0l.1-.098 7.03-7.034a2.49 2.49 0 0 1 3.542 0l.049.05a2.49 2.49 0 0 1 0 3.54l-8.54 8.54a1.96 1.96 0 0 0 0 2.755l1.753 1.753a.835.835 0 0 0 1.18 0 .835.835 0 0 0 0-1.18l-1.753-1.753a.266.266 0 0 1 0-.394l8.54-8.54a4.185 4.185 0 0 0 0-5.9l-.05-.05a4.16 4.16 0 0 0-2.95-1.218c-.2 0-.401.02-.6.048a4.17 4.17 0 0 0-1.17-3.552A4.16 4.16 0 0 0 13.85 0m0 3.333a.84.84 0 0 0-.59.245L6.275 10.56a4.186 4.186 0 0 0 0 5.902 4.186 4.186 0 0 0 5.902 0L19.16 9.48a.835.835 0 0 0 0-1.18.835.835 0 0 0-1.18 0l-6.985 6.984a2.49 2.49 0 0 1-3.54 0 2.49 2.49 0 0 1 0-3.54l6.983-6.985a.835.835 0 0 0 0-1.18.84.84 0 0 0-.59-.245`,source:`https://github.com/modelcontextprotocol/docs/blob/573dc60c2e7aab2605b29d0bf27194aa7b02e4fb/logo/light.svg`,hex:`000000`},Da={title:`MongoDB`,slug:`mongodb`,get svg(){return H+`MongoDB`+U+this.path+W},path:`M17.193 9.555c-1.264-5.58-4.252-7.414-4.573-8.115-.28-.394-.53-.954-.735-1.44-.036.495-.055.685-.523 1.184-.723.566-4.438 3.682-4.74 10.02-.282 5.912 4.27 9.435 4.888 9.884l.07.05A73.49 73.49 0 0111.91 24h.481c.114-1.032.284-2.056.51-3.07.417-.296.604-.463.85-.693a11.342 11.342 0 003.639-8.464c.01-.814-.103-1.662-.197-2.218zm-5.336 8.195s0-8.291.275-8.29c.213 0 .49 10.695.49 10.695-.381-.045-.765-1.76-.765-2.405z`,source:`https://www.mongodb.com/pressroom`,hex:`47A248`},Oa={title:`Notion`,slug:`notion`,get svg(){return H+`Notion`+U+this.path+W},path:`M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z`,source:`https://www.notion.so`,hex:`000000`},ka={title:`NVIDIA`,slug:`nvidia`,get svg(){return H+`NVIDIA`+U+this.path+W},path:`M8.948 8.798v-1.43a6.7 6.7 0 0 1 .424-.018c3.922-.124 6.493 3.374 6.493 3.374s-2.774 3.851-5.75 3.851c-.398 0-.787-.062-1.158-.185v-4.346c1.528.185 1.837.857 2.747 2.385l2.04-1.714s-1.492-1.952-4-1.952a6.016 6.016 0 0 0-.796.035m0-4.735v2.138l.424-.027c5.45-.185 9.01 4.47 9.01 4.47s-4.08 4.964-8.33 4.964c-.37 0-.733-.035-1.095-.097v1.325c.3.035.61.062.91.062 3.957 0 6.82-2.023 9.593-4.408.459.371 2.34 1.263 2.73 1.652-2.633 2.208-8.772 3.984-12.253 3.984-.335 0-.653-.018-.971-.053v1.864H24V4.063zm0 10.326v1.131c-3.657-.654-4.673-4.46-4.673-4.46s1.758-1.944 4.673-2.262v1.237H8.94c-1.528-.186-2.73 1.245-2.73 1.245s.68 2.412 2.739 3.11M2.456 10.9s2.164-3.197 6.5-3.533V6.201C4.153 6.59 0 10.653 0 10.653s2.35 6.802 8.948 7.42v-1.237c-4.84-.6-6.492-5.936-6.492-5.936z`,source:`https://www.nvidia.com/en-us`,hex:`76B900`},Aa={title:`Ollama`,slug:`ollama`,get svg(){return H+`Ollama`+U+this.path+W},path:`M16.361 10.26a.894.894 0 0 0-.558.47l-.072.148.001.207c0 .193.004.217.059.353.076.193.152.312.291.448.24.238.51.3.872.205a.86.86 0 0 0 .517-.436.752.752 0 0 0 .08-.498c-.064-.453-.33-.782-.724-.897a1.06 1.06 0 0 0-.466 0zm-9.203.005c-.305.096-.533.32-.65.639a1.187 1.187 0 0 0-.06.52c.057.309.31.59.598.667.362.095.632.033.872-.205.14-.136.215-.255.291-.448.055-.136.059-.16.059-.353l.001-.207-.072-.148a.894.894 0 0 0-.565-.472 1.02 1.02 0 0 0-.474.007Zm4.184 2c-.131.071-.223.25-.195.383.031.143.157.288.353.407.105.063.112.072.117.136.004.038-.01.146-.029.243-.02.094-.036.194-.036.222.002.074.07.195.143.253.064.052.076.054.255.059.164.005.198.001.264-.03.169-.082.212-.234.15-.525-.052-.243-.042-.28.087-.355.137-.08.281-.219.324-.314a.365.365 0 0 0-.175-.48.394.394 0 0 0-.181-.033c-.126 0-.207.03-.355.124l-.085.053-.053-.032c-.219-.13-.259-.145-.391-.143a.396.396 0 0 0-.193.032zm.39-2.195c-.373.036-.475.05-.654.086-.291.06-.68.195-.951.328-.94.46-1.589 1.226-1.787 2.114-.04.176-.045.234-.045.53 0 .294.005.357.043.524.264 1.16 1.332 2.017 2.714 2.173.3.033 1.596.033 1.896 0 1.11-.125 2.064-.727 2.493-1.571.114-.226.169-.372.22-.602.039-.167.044-.23.044-.523 0-.297-.005-.355-.045-.531-.288-1.29-1.539-2.304-3.072-2.497a6.873 6.873 0 0 0-.855-.031zm.645.937a3.283 3.283 0 0 1 1.44.514c.223.148.537.458.671.662.166.251.26.508.303.82.02.143.01.251-.043.482-.08.345-.332.705-.672.957a3.115 3.115 0 0 1-.689.348c-.382.122-.632.144-1.525.138-.582-.006-.686-.01-.853-.042-.57-.107-1.022-.334-1.35-.68-.264-.28-.385-.535-.45-.946-.03-.192.025-.509.137-.776.136-.326.488-.73.836-.963.403-.269.934-.46 1.422-.512.187-.02.586-.02.773-.002zm-5.503-11a1.653 1.653 0 0 0-.683.298C5.617.74 5.173 1.666 4.985 2.819c-.07.436-.119 1.04-.119 1.503 0 .544.064 1.24.155 1.721.02.107.031.202.023.208a8.12 8.12 0 0 1-.187.152 5.324 5.324 0 0 0-.949 1.02 5.49 5.49 0 0 0-.94 2.339 6.625 6.625 0 0 0-.023 1.357c.091.78.325 1.438.727 2.04l.13.195-.037.064c-.269.452-.498 1.105-.605 1.732-.084.496-.095.629-.095 1.294 0 .67.009.803.088 1.266.095.555.288 1.143.503 1.534.071.128.243.393.264.407.007.003-.014.067-.046.141a7.405 7.405 0 0 0-.548 1.873c-.062.417-.071.552-.071.991 0 .56.031.832.148 1.279L3.42 24h1.478l-.05-.091c-.297-.552-.325-1.575-.068-2.597.117-.472.25-.819.498-1.296l.148-.29v-.177c0-.165-.003-.184-.057-.293a.915.915 0 0 0-.194-.25 1.74 1.74 0 0 1-.385-.543c-.424-.92-.506-2.286-.208-3.451.124-.486.329-.918.544-1.154a.787.787 0 0 0 .223-.531c0-.195-.07-.355-.224-.522a3.136 3.136 0 0 1-.817-1.729c-.14-.96.114-2.005.69-2.834.563-.814 1.353-1.336 2.237-1.475.199-.033.57-.028.776.01.226.04.367.028.512-.041.179-.085.268-.19.374-.431.093-.215.165-.333.36-.576.234-.29.46-.489.822-.729.413-.27.884-.467 1.352-.561.17-.035.25-.04.569-.04.319 0 .398.005.569.04a4.07 4.07 0 0 1 1.914.997c.117.109.398.457.488.602.034.057.095.177.132.267.105.241.195.346.374.43.14.068.286.082.503.045.343-.058.607-.053.943.016 1.144.23 2.14 1.173 2.581 2.437.385 1.108.276 2.267-.296 3.153-.097.15-.193.27-.333.419-.301.322-.301.722-.001 1.053.493.539.801 1.866.708 3.036-.062.772-.26 1.463-.533 1.854a2.096 2.096 0 0 1-.224.258.916.916 0 0 0-.194.25c-.054.109-.057.128-.057.293v.178l.148.29c.248.476.38.823.498 1.295.253 1.008.231 2.01-.059 2.581a.845.845 0 0 0-.044.098c0 .006.329.009.732.009h.73l.02-.074.036-.134c.019-.076.057-.3.088-.516.029-.217.029-1.016 0-1.258-.11-.875-.295-1.57-.597-2.226-.032-.074-.053-.138-.046-.141.008-.005.057-.074.108-.152.376-.569.607-1.284.724-2.228.031-.26.031-1.378 0-1.628-.083-.645-.182-1.082-.348-1.525a6.083 6.083 0 0 0-.329-.7l-.038-.064.131-.194c.402-.604.636-1.262.727-2.04a6.625 6.625 0 0 0-.024-1.358 5.512 5.512 0 0 0-.939-2.339 5.325 5.325 0 0 0-.95-1.02 8.097 8.097 0 0 1-.186-.152.692.692 0 0 1 .023-.208c.208-1.087.201-2.443-.017-3.503-.19-.924-.535-1.658-.98-2.082-.354-.338-.716-.482-1.15-.455-.996.059-1.8 1.205-2.116 3.01a6.805 6.805 0 0 0-.097.726c0 .036-.007.066-.015.066a.96.96 0 0 1-.149-.078A4.857 4.857 0 0 0 12 3.03c-.832 0-1.687.243-2.456.698a.958.958 0 0 1-.148.078c-.008 0-.015-.03-.015-.066a6.71 6.71 0 0 0-.097-.725C8.997 1.392 8.337.319 7.46.048a2.096 2.096 0 0 0-.585-.041Zm.293 1.402c.248.197.523.759.682 1.388.03.113.06.244.069.292.007.047.026.152.041.233.067.365.098.76.102 1.24l.002.475-.12.175-.118.178h-.278c-.324 0-.646.041-.954.124l-.238.06c-.033.007-.038-.003-.057-.144a8.438 8.438 0 0 1 .016-2.323c.124-.788.413-1.501.696-1.711.067-.05.079-.049.157.013zm9.825-.012c.17.126.358.46.498.888.28.854.36 2.028.212 3.145-.019.14-.024.151-.057.144l-.238-.06a3.693 3.693 0 0 0-.954-.124h-.278l-.119-.178-.119-.175.002-.474c.004-.669.066-1.19.214-1.772.157-.623.434-1.185.68-1.382.078-.062.09-.063.159-.012z`,source:`https://github.com/ollama/ollama/issues/2152#issuecomment-1905286922`,hex:`000000`},ja={title:`OpenRouter`,slug:`openrouter`,get svg(){return H+`OpenRouter`+U+this.path+W},path:`M16.778 1.844v1.919q-.569-.026-1.138-.032-.708-.008-1.415.037c-1.93.126-4.023.728-6.149 2.237-2.911 2.066-2.731 1.95-4.14 2.75-.396.223-1.342.574-2.185.798-.841.225-1.753.333-1.751.333v4.229s.768.108 1.61.333c.842.224 1.789.575 2.185.799 1.41.798 1.228.683 4.14 2.75 2.126 1.509 4.22 2.11 6.148 2.236.88.058 1.716.041 2.555.005v1.918l7.222-4.168-7.222-4.17v2.176c-.86.038-1.611.065-2.278.021-1.364-.09-2.417-.357-3.979-1.465-2.244-1.593-2.866-2.027-3.68-2.508.889-.518 1.449-.906 3.822-2.59 1.56-1.109 2.614-1.377 3.978-1.466.667-.044 1.418-.017 2.278.02v2.176L24 6.014Z`,source:`https://openrouter.ai`,hex:`94A3B8`},Ma={title:`PayPal`,slug:`paypal`,get svg(){return H+`PayPal`+U+this.path+W},path:`M15.607 4.653H8.941L6.645 19.251H1.82L4.862 0h7.995c3.754 0 6.375 2.294 6.473 5.513-.648-.478-2.105-.86-3.722-.86m6.57 5.546c0 3.41-3.01 6.853-6.958 6.853h-2.493L11.595 24H6.74l1.845-11.538h3.592c4.208 0 7.346-3.634 7.153-6.949a5.24 5.24 0 0 1 2.848 4.686M9.653 5.546h6.408c.907 0 1.942.222 2.363.541-.195 2.741-2.655 5.483-6.441 5.483H8.714Z`,source:`https://www.paypal.com/us`,hex:`002991`,guidelines:`https://newsroom.paypal-corp.com/media-resources`},Na={title:`Perplexity`,slug:`perplexity`,get svg(){return H+`Perplexity`+U+this.path+W},path:`M22.3977 7.0896h-2.3106V.0676l-7.5094 6.3542V.1577h-1.1554v6.1966L4.4904 0v7.0896H1.6023v10.3976h2.8882V24l6.932-6.3591v6.2005h1.1554v-6.0469l6.9318 6.1807v-6.4879h2.8882V7.0896zm-3.4657-4.531v4.531h-5.355l5.355-4.531zm-13.2862.0676 4.8691 4.4634H5.6458V2.6262zM2.7576 16.332V8.245h7.8476l-6.1149 6.1147v1.9723H2.7576zm2.8882 5.0404v-3.8852h.0001v-2.6488l5.7763-5.7764v7.0111l-5.7764 5.2993zm12.7086.0248-5.7766-5.1509V9.0618l5.7766 5.7766v6.5588zm2.8882-5.0652h-1.733v-1.9723L13.3948 8.245h7.8478v8.087z`,source:`https://www.perplexity.ai`,hex:`1FB8CD`},Pa={title:`PostgreSQL`,slug:`postgresql`,get svg(){return H+`PostgreSQL`+U+this.path+W},path:`M23.5594 14.7228a.5269.5269 0 0 0-.0563-.1191c-.139-.2632-.4768-.3418-1.0074-.2321-1.6533.3411-2.2935.1312-2.5256-.0191 1.342-2.0482 2.445-4.522 3.0411-6.8297.2714-1.0507.7982-3.5237.1222-4.7316a1.5641 1.5641 0 0 0-.1509-.235C21.6931.9086 19.8007.0248 17.5099.0005c-1.4947-.0158-2.7705.3461-3.1161.4794a9.449 9.449 0 0 0-.5159-.0816 8.044 8.044 0 0 0-1.3114-.1278c-1.1822-.0184-2.2038.2642-3.0498.8406-.8573-.3211-4.7888-1.645-7.2219.0788C.9359 2.1526.3086 3.8733.4302 6.3043c.0409.818.5069 3.334 1.2423 5.7436.4598 1.5065.9387 2.7019 1.4334 3.582.553.9942 1.1259 1.5933 1.7143 1.7895.4474.1491 1.1327.1441 1.8581-.7279.8012-.9635 1.5903-1.8258 1.9446-2.2069.4351.2355.9064.3625 1.39.3772a.0569.0569 0 0 0 .0004.0041 11.0312 11.0312 0 0 0-.2472.3054c-.3389.4302-.4094.5197-1.5002.7443-.3102.064-1.1344.2339-1.1464.8115-.0025.1224.0329.2309.0919.3268.2269.4231.9216.6097 1.015.6331 1.3345.3335 2.5044.092 3.3714-.6787-.017 2.231.0775 4.4174.3454 5.0874.2212.5529.7618 1.9045 2.4692 1.9043.2505 0 .5263-.0291.8296-.0941 1.7819-.3821 2.5557-1.1696 2.855-2.9059.1503-.8707.4016-2.8753.5388-4.1012.0169-.0703.0357-.1207.057-.1362.0007-.0005.0697-.0471.4272.0307a.3673.3673 0 0 0 .0443.0068l.2539.0223.0149.001c.8468.0384 1.9114-.1426 2.5312-.4308.6438-.2988 1.8057-1.0323 1.5951-1.6698zM2.371 11.8765c-.7435-2.4358-1.1779-4.8851-1.2123-5.5719-.1086-2.1714.4171-3.6829 1.5623-4.4927 1.8367-1.2986 4.8398-.5408 6.108-.13-.0032.0032-.0066.0061-.0098.0094-2.0238 2.044-1.9758 5.536-1.9708 5.7495-.0002.0823.0066.1989.0162.3593.0348.5873.0996 1.6804-.0735 2.9184-.1609 1.1504.1937 2.2764.9728 3.0892.0806.0841.1648.1631.2518.2374-.3468.3714-1.1004 1.1926-1.9025 2.1576-.5677.6825-.9597.5517-1.0886.5087-.3919-.1307-.813-.5871-1.2381-1.3223-.4796-.839-.9635-2.0317-1.4155-3.5126zm6.0072 5.0871c-.1711-.0428-.3271-.1132-.4322-.1772.0889-.0394.2374-.0902.4833-.1409 1.2833-.2641 1.4815-.4506 1.9143-1.0002.0992-.126.2116-.2687.3673-.4426a.3549.3549 0 0 0 .0737-.1298c.1708-.1513.2724-.1099.4369-.0417.156.0646.3078.26.3695.4752.0291.1016.0619.2945-.0452.4444-.9043 1.2658-2.2216 1.2494-3.1676 1.0128zm2.094-3.988-.0525.141c-.133.3566-.2567.6881-.3334 1.003-.6674-.0021-1.3168-.2872-1.8105-.8024-.6279-.6551-.9131-1.5664-.7825-2.5004.1828-1.3079.1153-2.4468.079-3.0586-.005-.0857-.0095-.1607-.0122-.2199.2957-.2621 1.6659-.9962 2.6429-.7724.4459.1022.7176.4057.8305.928.5846 2.7038.0774 3.8307-.3302 4.7363-.084.1866-.1633.3629-.2311.5454zm7.3637 4.5725c-.0169.1768-.0358.376-.0618.5959l-.146.4383a.3547.3547 0 0 0-.0182.1077c-.0059.4747-.054.6489-.115.8693-.0634.2292-.1353.4891-.1794 1.0575-.11 1.4143-.8782 2.2267-2.4172 2.5565-1.5155.3251-1.7843-.4968-2.0212-1.2217a6.5824 6.5824 0 0 0-.0769-.2266c-.2154-.5858-.1911-1.4119-.1574-2.5551.0165-.5612-.0249-1.9013-.3302-2.6462.0044-.2932.0106-.5909.019-.8918a.3529.3529 0 0 0-.0153-.1126 1.4927 1.4927 0 0 0-.0439-.208c-.1226-.4283-.4213-.7866-.7797-.9351-.1424-.059-.4038-.1672-.7178-.0869.067-.276.1831-.5875.309-.9249l.0529-.142c.0595-.16.134-.3257.213-.5012.4265-.9476 1.0106-2.2453.3766-5.1772-.2374-1.0981-1.0304-1.6343-2.2324-1.5098-.7207.0746-1.3799.3654-1.7088.5321a5.6716 5.6716 0 0 0-.1958.1041c.0918-1.1064.4386-3.1741 1.7357-4.4823a4.0306 4.0306 0 0 1 .3033-.276.3532.3532 0 0 0 .1447-.0644c.7524-.5706 1.6945-.8506 2.802-.8325.4091.0067.8017.0339 1.1742.081 1.939.3544 3.2439 1.4468 4.0359 2.3827.8143.9623 1.2552 1.9315 1.4312 2.4543-1.3232-.1346-2.2234.1268-2.6797.779-.9926 1.4189.543 4.1729 1.2811 5.4964.1353.2426.2522.4522.2889.5413.2403.5825.5515.9713.7787 1.2552.0696.087.1372.1714.1885.245-.4008.1155-1.1208.3825-1.0552 1.717-.0123.1563-.0423.4469-.0834.8148-.0461.2077-.0702.4603-.0994.7662zm.8905-1.6211c-.0405-.8316.2691-.9185.5967-1.0105a2.8566 2.8566 0 0 0 .135-.0406 1.202 1.202 0 0 0 .1342.103c.5703.3765 1.5823.4213 3.0068.1344-.2016.1769-.5189.3994-.9533.6011-.4098.1903-1.0957.333-1.7473.3636-.7197.0336-1.0859-.0807-1.1721-.151zm.5695-9.2712c-.0059.3508-.0542.6692-.1054 1.0017-.055.3576-.112.7274-.1264 1.1762-.0142.4368.0404.8909.0932 1.3301.1066.887.216 1.8003-.2075 2.7014a3.5272 3.5272 0 0 1-.1876-.3856c-.0527-.1276-.1669-.3326-.3251-.6162-.6156-1.1041-2.0574-3.6896-1.3193-4.7446.3795-.5427 1.3408-.5661 2.1781-.463zm.2284 7.0137a12.3762 12.3762 0 0 0-.0853-.1074l-.0355-.0444c.7262-1.1995.5842-2.3862.4578-3.4385-.0519-.4318-.1009-.8396-.0885-1.2226.0129-.4061.0666-.7543.1185-1.0911.0639-.415.1288-.8443.1109-1.3505.0134-.0531.0188-.1158.0118-.1902-.0457-.4855-.5999-1.938-1.7294-3.253-.6076-.7073-1.4896-1.4972-2.6889-2.0395.5251-.1066 1.2328-.2035 2.0244-.1859 2.0515.0456 3.6746.8135 4.8242 2.2824a.908.908 0 0 1 .0667.1002c.7231 1.3556-.2762 6.2751-2.9867 10.5405zm-8.8166-6.1162c-.025.1794-.3089.4225-.6211.4225a.5821.5821 0 0 1-.0809-.0056c-.1873-.026-.3765-.144-.5059-.3156-.0458-.0605-.1203-.178-.1055-.2844.0055-.0401.0261-.0985.0925-.1488.1182-.0894.3518-.1226.6096-.0867.3163.0441.6426.1938.6113.4186zm7.9305-.4114c.0111.0792-.049.201-.1531.3102-.0683.0717-.212.1961-.4079.2232a.5456.5456 0 0 1-.075.0052c-.2935 0-.5414-.2344-.5607-.3717-.024-.1765.2641-.3106.5611-.352.297-.0414.6111.0088.6356.1851z`,source:`https://wiki.postgresql.org/wiki/Logo`,hex:`4169E1`,guidelines:`https://www.postgresql.org/about/policies/trademarks/`},Fa={title:`Razorpay`,slug:`razorpay`,get svg(){return H+`Razorpay`+U+this.path+W},path:`M22.436 0l-11.91 7.773-1.174 4.276 6.625-4.297L11.65 24h4.391l6.395-24zM14.26 10.098L3.389 17.166 1.564 24h9.008l3.688-13.902Z`,source:`https://razorpay.com/newsroom/brand-assets/`,hex:`0C2451`,guidelines:`https://razorpay.com/newsroom/brand-assets/`},Ia={title:`Redis`,slug:`redis`,get svg(){return H+`Redis`+U+this.path+W},path:`M22.71 13.145c-1.66 2.092-3.452 4.483-7.038 4.483-3.203 0-4.397-2.825-4.48-5.12.701 1.484 2.073 2.685 4.214 2.63 4.117-.133 6.94-3.852 6.94-7.239 0-4.05-3.022-6.972-8.268-6.972-3.752 0-8.4 1.428-11.455 3.685C2.59 6.937 3.885 9.958 4.35 9.626c2.648-1.904 4.748-3.13 6.784-3.744C8.12 9.244.886 17.05 0 18.425c.1 1.261 1.66 4.648 2.424 4.648.232 0 .431-.133.664-.365a100.49 100.49 0 0 0 5.54-6.765c.222 3.104 1.748 6.898 6.014 6.898 3.819 0 7.604-2.756 9.33-8.965.2-.764-.73-1.361-1.261-.73zm-4.349-5.013c0 1.959-1.926 2.922-3.685 2.922-.941 0-1.664-.247-2.235-.568 1.051-1.592 2.092-3.225 3.21-4.973 1.972.334 2.71 1.43 2.71 2.619z`,source:`https://redis.io/brand-guidelines`,hex:`FF4438`,guidelines:`https://redis.io/brand-guidelines`},La={title:`Replicate`,slug:`replicate`,get svg(){return H+`Replicate`+U+this.path+W},path:`M24 10.262v2.712h-9.518V24h-3.034V10.262zm0-5.131v2.717H8.755V24H5.722V5.131zM24 0v2.717H3.034V24H0V0z`,source:`https://replicate.com`,hex:`000000`},Ra={title:`Resend`,slug:`resend`,get svg(){return H+`Resend`+U+this.path+W},path:`M14.679 0c4.648 0 7.413 2.765 7.413 6.434s-2.765 6.434-7.413 6.434H12.33L24 24h-8.245l-8.88-8.44c-.636-.588-.93-1.273-.93-1.86 0-.831.587-1.565 1.713-1.883l4.574-1.224c1.737-.465 2.936-1.81 2.936-3.572 0-2.153-1.761-3.4-3.939-3.4H0V0z`,source:`https://resend.com/brand`,hex:`000000`,guidelines:`https://resend.com/brand`},za={title:`Sentry`,slug:`sentry`,get svg(){return H+`Sentry`+U+this.path+W},path:`M13.91 2.505c-.873-1.448-2.972-1.448-3.844 0L6.904 7.92a15.478 15.478 0 0 1 8.53 12.811h-2.221A13.301 13.301 0 0 0 5.784 9.814l-2.926 5.06a7.65 7.65 0 0 1 4.435 5.848H2.194a.365.365 0 0 1-.298-.534l1.413-2.402a5.16 5.16 0 0 0-1.614-.913L.296 19.275a2.182 2.182 0 0 0 .812 2.999 2.24 2.24 0 0 0 1.086.288h6.983a9.322 9.322 0 0 0-3.845-8.318l1.11-1.922a11.47 11.47 0 0 1 4.95 10.24h5.915a17.242 17.242 0 0 0-7.885-15.28l2.244-3.845a.37.37 0 0 1 .504-.13c.255.14 9.75 16.708 9.928 16.9a.365.365 0 0 1-.327.543h-2.287c.029.612.029 1.223 0 1.831h2.297a2.206 2.206 0 0 0 1.922-3.31z`,source:`https://sentry.io/branding/`,hex:`362D59`},Ba={title:`Shopify`,slug:`shopify`,get svg(){return H+`Shopify`+U+this.path+W},path:`M15.337 23.979l7.216-1.561s-2.604-17.613-2.625-17.73c-.018-.116-.114-.192-.211-.192s-1.929-.136-1.929-.136-1.275-1.274-1.439-1.411c-.045-.037-.075-.057-.121-.074l-.914 21.104h.023zM11.71 11.305s-.81-.424-1.774-.424c-1.447 0-1.504.906-1.504 1.141 0 1.232 3.24 1.715 3.24 4.629 0 2.295-1.44 3.76-3.406 3.76-2.354 0-3.54-1.465-3.54-1.465l.646-2.086s1.245 1.066 2.28 1.066c.675 0 .975-.545.975-.932 0-1.619-2.654-1.694-2.654-4.359-.034-2.237 1.571-4.416 4.827-4.416 1.257 0 1.875.361 1.875.361l-.945 2.715-.02.01zM11.17.83c.136 0 .271.038.405.135-.984.465-2.064 1.639-2.508 3.992-.656.213-1.293.405-1.889.578C7.697 3.75 8.951.84 11.17.84V.83zm1.235 2.949v.135c-.754.232-1.583.484-2.394.736.466-1.777 1.333-2.645 2.085-2.971.193.501.309 1.176.309 2.1zm.539-2.234c.694.074 1.141.867 1.429 1.755-.349.114-.735.231-1.158.366v-.252c0-.752-.096-1.371-.271-1.871v.002zm2.992 1.289c-.02 0-.06.021-.078.021s-.289.075-.714.21c-.423-1.233-1.176-2.37-2.508-2.37h-.115C12.135.209 11.669 0 11.265 0 8.159 0 6.675 3.877 6.21 5.846c-1.194.365-2.063.636-2.16.674-.675.213-.694.232-.772.87-.075.462-1.83 14.063-1.83 14.063L15.009 24l.927-21.166z`,source:`https://www.shopify.com/brand-assets`,hex:`7AB55C`,guidelines:`https://www.shopify.com/brand-assets`},Va={title:`Square`,slug:`square`,get svg(){return H+`Square`+U+this.path+W},path:`M4.01 0A4.01 4.01 0 000 4.01v15.98c0 2.21 1.8 4 4.01 4.01h15.98C22.2 24 24 22.2 24 19.99V4A4.01 4.01 0 0019.99 0H4zm1.62 4.36h12.74c.7 0 1.26.57 1.26 1.27v12.74c0 .7-.56 1.27-1.26 1.27H5.63c-.7 0-1.26-.57-1.26-1.27V5.63a1.27 1.27 0 011.26-1.27zm3.83 4.35a.73.73 0 00-.73.73v5.09c0 .4.32.72.72.72h5.1a.73.73 0 00.73-.72V9.44a.73.73 0 00-.73-.73h-5.1Z`,source:`https://squareup.com`,hex:`3E4348`},Ha={title:`Stripe`,slug:`stripe`,get svg(){return H+`Stripe`+U+this.path+W},path:`M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.594-7.305h.003z`,source:`https://stripe.com/newsroom/information`,hex:`635BFF`},Ua={title:`Supabase`,slug:`supabase`,get svg(){return H+`Supabase`+U+this.path+W},path:`M11.9 1.036c-.015-.986-1.26-1.41-1.874-.637L.764 12.05C-.33 13.427.65 15.455 2.409 15.455h9.579l.113 7.51c.014.985 1.259 1.408 1.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z`,source:`https://github.com/supabase/supabase/blob/4031a7549f5d46da7bc79c01d56be4177dc7c114/packages/common/assets/images/supabase-logo-wordmark--light.svg`,hex:`3FCF8E`},Wa={title:`Telegram`,slug:`telegram`,get svg(){return H+`Telegram`+U+this.path+W},path:`M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z`,source:`https://telegram.org/tour/screenshots`,hex:`26A5E4`},Ga={title:`Vercel`,slug:`vercel`,get svg(){return H+`Vercel`+U+this.path+W},path:`m12 1.608 12 20.784H0Z`,source:`https://vercel.com/geist/brands`,hex:`000000`,guidelines:`https://vercel.com/geist/brands`},Ka={title:`WhatsApp`,slug:`whatsapp`,get svg(){return H+`WhatsApp`+U+this.path+W},path:`M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z`,source:`https://about.meta.com/brand/resources/whatsapp/whatsapp-brand`,hex:`25D366`,guidelines:`https://about.meta.com/brand/resources/whatsapp/whatsapp-brand`},G=(e,t)=>({title:e.title,path:e.path,tile:t??(e.hex===`000000`?`#16191D`:`#${e.hex}`)}),qa={razorpay:G(Fa,`#3395FF`),stripe:G(Ha,`#635BFF`),gemini:G(ba,`#4285F4`),nim:G(ka,`#76B900`),claude:G(ca,`#D97757`),claudecode:G(la,`#D97757`),ollama:G(Aa,`#1F2328`),mistral:G(Ta),openrouter:G(ja),deepseek:G(da),perplexity:G(Na),huggingface:G(Sa),paypal:G(Ma),square:G(Va),adyen:G(oa),github:G(ga),gitlab:G(_a),docker:G(pa),sentry:G(za),vercel:G(Ga),linear:G(wa),jira:G(Ca),postgres:G(Pa),supabase:G(Ua),mongodb:G(Da),redis:G(Ia),notion:G(Oa),gdrive:G(ya),gmail:G(va),gsheets:G(xa),airtable:G(sa),discord:G(fa),telegram:G(Wa),whatsapp:G(Ka),resend:G(Ra),shopify:G(Ba),firebase:G(ha),elevenlabs:G(ma),replicate:G(La),deepgram:G(ua),custom_mcp:G(Ea)},Ja={openai:`#10A37F`,groq:`#F55036`,together:`#0B5FE0`,cohere:`#39594D`,sirius:`#0B7A70`,playwright:`#2EAD33`,slack:`#4A154B`,twilio:`#C81E34`,higgsfield:`#2A2A30`,stability:`#5B3FD1`,runway:`#16191D`,assemblyai:`#2545D3`,inventory:`#2F6FD6`,codex:`#1F2328`,antigravity:`#4285F4`};function Ya(e){if(qa[e.id])return e.id;let t=e.connection??{},n=String(t.base_url??``).toLowerCase();if(e.type===`llm`&&t.provider===`anthropic`)return`claude`;if(n.includes(`nvidia.com`))return`nim`;if(n.includes(`googleapis.com`))return`gemini`;if(n.includes(`:11434`))return`ollama`;if(n.includes(`razorpay.com`))return`razorpay`;if(n.includes(`stripe.com`))return`stripe`}function Xa(e){let t=Ya(e);return t?qa[t]:void 0}var Za={llm:`#6B46C1`,mcp:`#2E9E5B`,http:`#2F6FD6`,local:`#3A4756`};function Qa(e){return e.style?.color??Xa(e)?.tile??Ja[e.id]??Za[e.type]??`#3A4756`}function $a(e){let t=parseInt(e.replace(`#`,``).slice(0,6),16);if(Number.isNaN(t))return`#FFFFFF`;let n=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4},r=.2126*n(t>>16&255)+.7152*n(t>>8&255)+.0722*n(t&255),i=1.05/(r+.05);return(r+.05)/.062200000000000005>i?`#0F1D26`:`#FFFFFF`}function eo(e){let t=e.trim().split(/\s+/).filter(Boolean);if(t.length>=2)return(t[0][0]+t[1][0]).toUpperCase();let n=t[0]??`?`;return(n[0].toUpperCase()+(n[1]??``)).slice(0,2)}var to=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})),K=o(((e,t)=>{t.exports=to()}))();function no({c:e,size:t=40}){let n=Qa(e),r=$a(n),i=Math.round(t*.26),a={width:t,height:t,flex:`0 0 ${t}px`,borderRadius:i,background:n,color:r,display:`grid`,placeItems:`center`,overflow:`hidden`,position:`relative`,boxShadow:`inset 0 1px 0 rgb(255 255 255 / 25%), 0 2px 6px -2px rgb(15 29 38 / 35%)`};if(e.logo_url)return(0,K.jsx)(`span`,{style:{...a,background:`var(--surface)`},"aria-hidden":`true`,children:(0,K.jsx)(`img`,{src:e.logo_url,alt:``,width:t,height:t,style:{objectFit:`cover`,width:`100%`,height:`100%`}})});let o=e.style?.logo,s=Xa(e);if(s&&o?.type!==`none`){let e=Math.round(t*.56);return(0,K.jsx)(`span`,{style:a,"aria-hidden":`true`,"data-brand":s.title,children:(0,K.jsx)(`svg`,{viewBox:`0 0 24 24`,width:e,height:e,fill:r,role:`img`,children:(0,K.jsx)(`path`,{d:s.path})})})}let c=o?.type===`letters`?o.text:o?.type===`none`?``:eo(e.name);return(0,K.jsx)(`span`,{style:{...a,font:`500 ${Math.round(t*.36)}px/1 var(--mono)`},"aria-hidden":`true`,children:c})}function ro(e,t=1){return e==null?`—`:e<1e3&&e>0?`${(e/1e3).toFixed(2)} s`:e>=6e4?`${Math.floor(e/6e4)} min ${Math.round(e%6e4/1e3)} s`:`${(e/1e3).toFixed(t)} s`}var io=e=>e==null?`—`:Math.round(e).toLocaleString(`en-US`);function ao(e,t=new Date){if(!e)return`—`;let n=new Date(e),r=n.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,hour12:!1}),i=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),a=Math.round((i(t)-i(n))/864e5);return a===0?`today ${r}`:a===1?`yesterday ${r}`:`${n.toLocaleDateString([],{day:`numeric`,month:`short`})} ${r}`}function oo(e){return e?new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,hour12:!1}):`—`}var so=e=>e.slice(0,6);function q({children:e,size:t=20}){return(0,K.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:e})}var J={hub:e=>(0,K.jsxs)(q,{size:e,children:[(0,K.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,K.jsx)(`circle`,{cx:`4`,cy:`6`,r:`2`}),(0,K.jsx)(`circle`,{cx:`20`,cy:`6`,r:`2`}),(0,K.jsx)(`circle`,{cx:`4`,cy:`18`,r:`2`}),(0,K.jsx)(`circle`,{cx:`20`,cy:`18`,r:`2`}),(0,K.jsx)(`path`,{d:`M6 7l4 3M18 7l-4 3M6 17l4-3M18 17l-4-3`})]}),plug:e=>(0,K.jsx)(q,{size:e,children:(0,K.jsx)(`path`,{d:`M9 2v6M15 2v6M7 8h10v4a5 5 0 0 1-10 0V8zM12 17v5`})}),list:e=>(0,K.jsxs)(q,{size:e,children:[(0,K.jsx)(`path`,{d:`M9 6h11M9 12h11M9 18h11`}),(0,K.jsx)(`circle`,{cx:`4.5`,cy:`6`,r:`1`}),(0,K.jsx)(`circle`,{cx:`4.5`,cy:`12`,r:`1`}),(0,K.jsx)(`circle`,{cx:`4.5`,cy:`18`,r:`1`})]}),play:e=>(0,K.jsx)(q,{size:e,children:(0,K.jsx)(`path`,{d:`M7 4.5v15l12-7.5-12-7.5z`})}),check:e=>(0,K.jsx)(q,{size:e,children:(0,K.jsx)(`path`,{d:`M5 12.5l4.5 4.5L19 7.5`})}),history:e=>(0,K.jsxs)(q,{size:e,children:[(0,K.jsx)(`path`,{d:`M3 12a9 9 0 1 0 3-6.7L3 8`}),(0,K.jsx)(`path`,{d:`M3 3v5h5M12 7v5l3 2`})]}),shield:e=>(0,K.jsxs)(q,{size:e,children:[(0,K.jsx)(`path`,{d:`M12 3l8 3v6c0 4.5-3.4 8.2-8 9-4.6-.8-8-4.5-8-9V6l8-3z`}),(0,K.jsx)(`path`,{d:`M9 12l2 2 4-4`})]}),plus:e=>(0,K.jsx)(q,{size:e,children:(0,K.jsx)(`path`,{d:`M12 5v14M5 12h14`})}),sun:e=>(0,K.jsxs)(q,{size:e,children:[(0,K.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`}),(0,K.jsx)(`path`,{d:`M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4`})]}),moon:e=>(0,K.jsx)(q,{size:e,children:(0,K.jsx)(`path`,{d:`M20 14.5A8.5 8.5 0 0 1 9.5 4 8.5 8.5 0 1 0 20 14.5z`})}),monitor:e=>(0,K.jsxs)(q,{size:e,children:[(0,K.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`12`,rx:`2`}),(0,K.jsx)(`path`,{d:`M8 20h8M12 16v4`})]}),menu:e=>(0,K.jsx)(q,{size:e,children:(0,K.jsx)(`path`,{d:`M4 7h16M4 12h16M4 17h16`})}),spark:e=>(0,K.jsxs)(q,{size:e,children:[(0,K.jsx)(`path`,{d:`M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8L12 3z`}),(0,K.jsx)(`path`,{d:`M19 16l.7 2 2 .7-2 .7-.7 2-.7-2-2-.7 2-.7.7-2z`})]}),lock:e=>(0,K.jsxs)(q,{size:e,children:[(0,K.jsx)(`rect`,{x:`5`,y:`11`,width:`14`,height:`10`,rx:`2`}),(0,K.jsx)(`path`,{d:`M8 11V8a4 4 0 0 1 8 0v3`})]}),stop:e=>(0,K.jsx)(q,{size:e,children:(0,K.jsx)(`rect`,{x:`6`,y:`6`,width:`12`,height:`12`,rx:`2`})}),arrow:e=>(0,K.jsx)(q,{size:e,children:(0,K.jsx)(`path`,{d:`M5 12h14M13 6l6 6-6 6`})}),refresh:e=>(0,K.jsx)(q,{size:e,children:(0,K.jsx)(`path`,{d:`M20 11a8 8 0 1 0-2.3 5.7M20 4v7h-7`})}),bolt:e=>(0,K.jsx)(q,{size:e,children:(0,K.jsx)(`path`,{d:`M13 2L4 14h7l-1 8 9-12h-7l1-8z`})}),map:e=>(0,K.jsxs)(q,{size:e,children:[(0,K.jsx)(`rect`,{x:`3`,y:`3`,width:`7`,height:`7`,rx:`1.5`}),(0,K.jsx)(`rect`,{x:`14`,y:`14`,width:`7`,height:`7`,rx:`1.5`}),(0,K.jsx)(`path`,{d:`M6.5 10v2a4 4 0 0 0 4 4H14`})]}),activity:e=>(0,K.jsx)(q,{size:e,children:(0,K.jsx)(`path`,{d:`M3 12h4l3 8 4-16 3 8h4`})}),minus:e=>(0,K.jsx)(q,{size:e,children:(0,K.jsx)(`path`,{d:`M5 12h14`})}),fit:e=>(0,K.jsx)(q,{size:e,children:(0,K.jsx)(`path`,{d:`M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5`})}),tidy:e=>(0,K.jsxs)(q,{size:e,children:[(0,K.jsx)(`rect`,{x:`3`,y:`4`,width:`7`,height:`6`,rx:`1.5`}),(0,K.jsx)(`rect`,{x:`14`,y:`4`,width:`7`,height:`6`,rx:`1.5`}),(0,K.jsx)(`rect`,{x:`8.5`,y:`14`,width:`7`,height:`6`,rx:`1.5`})]}),route:e=>(0,K.jsxs)(q,{size:e,children:[(0,K.jsx)(`circle`,{cx:`6`,cy:`19`,r:`2.5`}),(0,K.jsx)(`circle`,{cx:`18`,cy:`5`,r:`2.5`}),(0,K.jsx)(`path`,{d:`M8.5 19H16a3.5 3.5 0 0 0 0-7H8a3.5 3.5 0 0 1 0-7h7.5`})]}),file:e=>(0,K.jsxs)(q,{size:e,children:[(0,K.jsx)(`path`,{d:`M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z`}),(0,K.jsx)(`path`,{d:`M14 3v6h6`})]}),fileCode:e=>(0,K.jsxs)(q,{size:e,children:[(0,K.jsx)(`path`,{d:`M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z`}),(0,K.jsx)(`path`,{d:`M14 3v6h6M10 13l-2 2 2 2M14 13l2 2-2 2`})]}),addBox:e=>(0,K.jsxs)(q,{size:e,children:[(0,K.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`4`}),(0,K.jsx)(`path`,{d:`M12 8v8M8 12h8`})]}),search:e=>(0,K.jsxs)(q,{size:e,children:[(0,K.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7`}),(0,K.jsx)(`path`,{d:`M20 20l-3.5-3.5`})]}),close:e=>(0,K.jsx)(q,{size:e,children:(0,K.jsx)(`path`,{d:`M6 6l12 12M18 6L6 18`})}),code:e=>(0,K.jsx)(q,{size:e,children:(0,K.jsx)(`path`,{d:`M8 8l-4 4 4 4M16 8l4 4-4 4`})}),flag:e=>(0,K.jsx)(q,{size:e,children:(0,K.jsx)(`path`,{d:`M5 21V4M5 4h11l-2 4 2 4H5`})}),question:e=>(0,K.jsxs)(q,{size:e,children:[(0,K.jsx)(`circle`,{cx:`12`,cy:`12`,r:`9`}),(0,K.jsx)(`path`,{d:`M9.6 9.4a2.5 2.5 0 1 1 3.4 2.4c-.6.3-1 .8-1 1.5v.5M12 17v.01`})]}),key:e=>(0,K.jsxs)(q,{size:e,children:[(0,K.jsx)(`circle`,{cx:`8`,cy:`15`,r:`4`}),(0,K.jsx)(`path`,{d:`M10.8 12.2L20 3M16 7l3 3M14 9l2 2`})]}),pencil:e=>(0,K.jsx)(q,{size:e,children:(0,K.jsx)(`path`,{d:`M4 20h4L19 9l-4-4L4 16zM13.5 6.5l4 4`})}),download:e=>(0,K.jsx)(q,{size:e,children:(0,K.jsx)(`path`,{d:`M12 4v11M7 10l5 5 5-5M5 20h14`})}),copy:e=>(0,K.jsxs)(q,{size:e,children:[(0,K.jsx)(`rect`,{x:`8`,y:`8`,width:`12`,height:`12`,rx:`2`}),(0,K.jsx)(`path`,{d:`M16 8V5a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h3`})]}),share:e=>(0,K.jsx)(q,{size:e,children:(0,K.jsx)(`path`,{d:`M12 15V4M7 9l5-5 5 5M5 14v5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5`})}),chevron:e=>(0,K.jsx)(q,{size:e,children:(0,K.jsx)(`path`,{d:`M6 9l6 6 6-6`})})};function co({tone:e,children:t,dot:n=!1,pulse:r=!1}){return(0,K.jsxs)(`span`,{className:`chip tone-${e}`,children:[n&&(0,K.jsx)(`span`,{className:`dot${r?` heartbeat`:``}`,"aria-hidden":`true`}),t]})}function lo(){return typeof window<`u`&&!!window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches}function uo({value:e,format:t,durationMs:n=900}){let[r,i]=(0,S.useState)(()=>lo()?e:0),a=(0,S.useRef)(0);return(0,S.useEffect)(()=>{if(lo()){i(e);return}let t=performance.now(),r=a.current,o=requestAnimationFrame(function s(c){let l=Math.min(1,(c-t)/n),u=1-(1-l)**3;i(r+(e-r)*u),l<1?o=requestAnimationFrame(s):a.current=e});return()=>cancelAnimationFrame(o)},[e,n]),(0,K.jsx)(K.Fragment,{children:t(r)})}function fo({value:e,label:t,tone:n,children:r}){return(0,K.jsxs)(`div`,{className:`stat${n?` tone-${n}`:``}`,children:[(0,K.jsx)(`div`,{className:`value`,style:n?{color:`var(--${n})`}:void 0,children:e}),(0,K.jsx)(`div`,{className:`label`,children:t}),r]})}function po({height:e=14,width:t=`100%`,count:n=1}){return(0,K.jsx)(`span`,{"aria-hidden":`true`,style:{display:`flex`,flexDirection:`column`,gap:8},children:Array.from({length:n},(n,r)=>(0,K.jsx)(`span`,{className:`skeleton`,style:{height:e,width:t}},r))})}function mo({lines:e=4}){return(0,K.jsxs)(`section`,{className:`card`,"aria-busy":`true`,"aria-label":`Loading`,children:[(0,K.jsx)(po,{height:20,width:`40%`}),(0,K.jsx)(po,{count:e})]})}function ho({tone:e=`slate`,icon:t,title:n,children:r,action:i}){return(0,K.jsxs)(`div`,{className:`empty`,children:[(0,K.jsx)(`span`,{className:`art`,style:{background:`var(--${e}-bg)`,color:`var(--${e})`},"aria-hidden":`true`,children:t}),(0,K.jsx)(`h2`,{children:n}),r&&(0,K.jsx)(`p`,{children:r}),i]})}function go({error:e,what:t}){return(0,K.jsxs)(`div`,{className:`error-box`,role:`alert`,children:[(0,K.jsxs)(`b`,{children:[`Couldn't load `,t,`.`]}),` `,e.message]})}var _o={get_map:{ask:`What does it call?`,icon:J.map},check_health:{ask:`Is anything down?`,icon:J.activity},get_security_findings:{ask:`Is anything unsafe?`,icon:J.shield},get_flow:{ask:`What waits for what?`,icon:J.route},get_advice:{ask:`What could run together?`,icon:J.bolt},what_changed:{ask:`What did the edit change?`,icon:J.refresh}},vo={claude:{id:`claudecode`},codex:{id:`codex`,letters:`Cx`},antigravity:{id:`antigravity`,letters:`AG`}};function yo(){let[e,t]=(0,S.useState)();return[e,e=>{navigator.clipboard.writeText(e).then(()=>t(`Copied`),()=>t(`Couldn't copy: select the text instead`)),window.setTimeout(()=>t(void 0),2500)}]}function bo({c:e}){let[t,n]=(0,S.useState)(`claude`),[r,i]=yo(),a=e.agents[t],o=e.last_call;return(0,K.jsxs)(`section`,{className:`card ca-setup`,"aria-label":`Set-up`,children:[(0,K.jsx)(`h2`,{className:`ca-label`,children:`Set up`}),(0,K.jsx)(`div`,{className:`ca-agents`,role:`tablist`,"aria-label":`Agent`,"aria-orientation":`vertical`,children:Object.entries(e.agents).map(([e,r])=>(0,K.jsxs)(`button`,{type:`button`,role:`tab`,id:`ca-tab-${e}`,"aria-selected":t===e,"aria-controls":`ca-panel`,className:`ca-agent`,onClick:()=>n(e),children:[(0,K.jsx)(no,{size:36,c:{id:vo[e]?.id??e,type:`local`,name:r.name,style:vo[e]?.letters?{color:null,logo:{type:`letters`,text:vo[e].letters}}:void 0}}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`b`,{children:r.name}),(0,K.jsx)(`small`,{children:r.how===`terminal`?`a terminal command`:`a config file`})]}),t===e&&(0,K.jsx)(`i`,{className:`ca-tick`,"aria-hidden":`true`,children:J.check(14)})]},e))}),(0,K.jsxs)(`div`,{role:`tabpanel`,id:`ca-panel`,"aria-labelledby":`ca-tab-${t}`,className:`ca-panel`,children:[(0,K.jsxs)(`button`,{className:`btn primary ca-copy`,type:`button`,onClick:()=>i(a.text),children:[J.copy(16),` `,a.how===`terminal`?`Copy set-up command`:`Copy config`]}),(0,K.jsx)(`span`,{className:`ca-said`,"aria-live":`polite`,children:r}),(0,K.jsxs)(`details`,{className:`ca-show`,children:[(0,K.jsxs)(`summary`,{children:[`Show `,a.how===`terminal`?`the command`:`the config`]}),(0,K.jsx)(`pre`,{"aria-label":`${a.name} set-up`,children:a.text}),a.file_text&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`p`,{className:`ca-or`,children:[`or add the same to `,(0,K.jsx)(`code`,{children:a.file})]}),(0,K.jsx)(`pre`,{"aria-label":`${a.name} config file`,children:a.file_text}),(0,K.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>i(a.file_text),children:[J.copy(14),` Copy`]})]})]}),(0,K.jsxs)(`ol`,{className:`ca-steps`,children:[(0,K.jsxs)(`li`,{children:[(0,K.jsx)(`b`,{children:`1`}),(0,K.jsx)(`span`,{children:a.how===`terminal`?`Paste it in a terminal`:(0,K.jsxs)(K.Fragment,{children:[`Paste it into `,(0,K.jsx)(`code`,{children:a.file})]})})]}),(0,K.jsxs)(`li`,{children:[(0,K.jsx)(`b`,{children:`2`}),(0,K.jsxs)(`span`,{children:[`Restart `,a.name]})]}),(0,K.jsxs)(`li`,{children:[(0,K.jsx)(`b`,{children:`3`}),(0,K.jsxs)(`span`,{children:[`Ask it: `,(0,K.jsx)(`q`,{children:`What slows this app down?`})]})]})]}),!a.checked&&(0,K.jsxs)(`p`,{className:`ca-note`,children:[J.question(15),` Where this file lives differs between versions of `,a.name,`.`]})]}),(0,K.jsxs)(`div`,{className:`ca-last${o?` on`:``}`,role:`status`,children:[(0,K.jsx)(`i`,{"aria-hidden":`true`}),o?(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`b`,{children:`Connected`}),` · last call `,ao(o.at)]}):(0,K.jsx)(`span`,{children:`Waiting for your agent's first question`})]})]})}function xo({repo:e}){let t=V(e?`/agent/preview`:null);return(0,K.jsxs)(`section`,{"aria-labelledby":`ca-gets`,children:[(0,K.jsxs)(`h2`,{className:`ca-label`,id:`ca-gets`,children:[`What your agent gets`,t.data&&(0,K.jsxs)(K.Fragment,{children:[` from `,(0,K.jsx)(`span`,{children:t.data.repo})]})]}),!e&&(0,K.jsx)(`p`,{className:`ca-note`,children:`Scan a folder first: your agent asks about that folder.`}),t.error&&(0,K.jsx)(go,{error:t.error,what:`the preview`}),e&&!t.data&&!t.error&&(0,K.jsx)(mo,{lines:4}),t.data&&(0,K.jsx)(`ul`,{className:`ca-cards`,children:t.data.cards.map(e=>{let t=_o[e.tool];return(0,K.jsxs)(`li`,{className:`ca-card tone-${e.tone}`,children:[(0,K.jsxs)(`span`,{className:`ca-ask`,children:[t?.icon(15),` `,t?.ask]}),e.headline&&(0,K.jsx)(`strong`,{children:e.headline}),e.sub&&(0,K.jsx)(`span`,{className:`ca-sub`,children:e.sub}),(0,K.jsx)(`code`,{children:e.tool})]},e.tool)})})]})}function So({calls:e}){return(0,K.jsxs)(`section`,{"aria-labelledby":`ca-asked`,children:[(0,K.jsxs)(`h2`,{className:`ca-label`,id:`ca-asked`,children:[`What your agent asked `,(0,K.jsx)(`span`,{className:`ca-live`,children:`live`})]}),(0,K.jsx)(`ol`,{className:`card ca-calls`,children:e.map((e,t)=>(0,K.jsxs)(`li`,{children:[(0,K.jsx)(`time`,{dateTime:e.at,children:oo(e.at)}),(0,K.jsxs)(`span`,{className:`ca-tool`,children:[_o[e.tool]?.icon(14),(0,K.jsx)(`code`,{children:e.tool})]}),(0,K.jsx)(`span`,{className:`ca-got`,children:e.got??`answered`})]},`${e.at}-${t}`))})]})}function Co(){let e=V(`/agent/connect`,5e3);if(e.error)return(0,K.jsx)(go,{error:e.error,what:`the agent set-up`});if(!e.data)return(0,K.jsx)(mo,{lines:6});let t=e.data,n=t.calls??[];return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`header`,{className:`page-head`,children:(0,K.jsxs)(`div`,{className:`titles`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`MCP server · read-only`}),(0,K.jsx)(`h1`,{children:`Connect your coding agent`}),(0,K.jsx)(`p`,{className:`lede`,children:`Your agent asks FlowForge about this app, then makes the change itself.`})]})}),(0,K.jsxs)(`div`,{className:`ca-grid`,children:[(0,K.jsx)(bo,{c:t}),(0,K.jsxs)(`div`,{className:`ca-right`,children:[(0,K.jsx)(xo,{repo:t.repo}),n.length>0&&(0,K.jsx)(So,{calls:n})]})]}),(0,K.jsxs)(`p`,{className:`ca-safe`,children:[J.shield(16),` Read-only · key values never sent · never edits your code · MCP servers start only after your yes on Checks`]})]})}function wo(e){return e==null?``:e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(1)} s`}var To={up:`Up`,warn:`Needs a look`,down:`Down`,skipped:`Not checked`,unchecked:`Not checked yet`,unconfirmed:`Not checked`,checking:`Checking`};function Eo(e){let t=t=>Oo(e,t),n=[`${t(`up`)} up`];return t(`warn`)&&n.push(`${t(`warn`)} need${t(`warn`)===1?`s`:``} a look`),t(`down`)&&n.push(`${t(`down`)} down`),n.join(`, `)}var Do=e=>e===`down`||e===`warn`,Oo=(e,t)=>e.filter(e=>e===t).length,ko={down:0,warn:1,checking:2,skipped:3,unchecked:4,up:5,unconfirmed:6};function Ao(e){return[...e].sort((e,t)=>ko[e.status]-ko[t.status]||e.name.localeCompare(t.name))}function jo({statuses:e,label:t,size:n}){return(0,K.jsx)(`span`,{className:`hsq-strip${n?` ${n}`:``}`,role:`img`,"aria-label":t,children:e.map((e,t)=>(0,K.jsx)(`i`,{className:`sq ${e}`},t))})}function Mo({status:e,style:t}){return(0,K.jsx)(`span`,{className:`hdot ${e}`,style:t,"aria-hidden":`true`})}function No({item:e,othersUp:t}){return e.status!==`down`||![`api`,`llm`].includes(e.kind)||!t?null:(0,K.jsxs)(`p`,{className:`hc-net`,children:[J.check(14),`Your internet works: `,t,` other`,t===1?``:`s`,` answered when last checked.`]})}function Po(e,t,n){if(e===`checking`)return`checking…`;if(e===`unchecked`||e===`unconfirmed`||e===`skipped`)return``;let r=wo(n),i=(t.split(`, but `)[1]??``).replace(/: [\d.]+ m?s$/,``),a=t.includes(`needs a key`)?`needs a key`:e===`warn`?i:``;return e===`down`?t.toLowerCase():[r,a].filter(Boolean).join(` · `)}function Y({asking:e,onStart:t,onWithout:n,onCancel:r}){let i=(e,t,n)=>`${e} ${e===1?t:n}`,a=e.plan.starts.length;return(0,K.jsxs)(`section`,{className:`hc-confirm`,"aria-label":`Before checking`,children:[(0,K.jsxs)(`h3`,{children:[`Checking starts `,a,` MCP server`,a===1?``:`s`,` on this computer`]}),(0,K.jsx)(`p`,{children:`Each one starts in the repo folder, lists its tools, and stops. They get none of your environment variables or keys.`}),(0,K.jsx)(`div`,{className:`hc-cmds`,role:`list`,children:e.plan.starts.map(e=>(0,K.jsxs)(`div`,{className:`hc-cmd`,role:`listitem`,children:[(0,K.jsx)(`b`,{children:e.name}),(0,K.jsx)(`code`,{children:e.command}),(0,K.jsx)(`span`,{className:`hc-from${e.origin.includes(`this repo`)?` repo`:``}`,children:e.origin}),e.source&&(0,K.jsx)(`span`,{className:`hc-src`,children:e.source})]},e.id))}),(0,K.jsxs)(`ul`,{className:`hc-promise`,children:[e.requests>0&&(0,K.jsxs)(`li`,{children:[J.check(16),i(e.requests,`API or LLM gets`,`APIs and LLMs get`),` one request each, without keys`]}),e.lookedFor>0&&(0,K.jsxs)(`li`,{children:[J.check(16),i(e.lookedFor,`local program is`,`local programs are`),` only looked for, never run`]}),(0,K.jsxs)(`li`,{children:[J.check(16),`No code or key leaves this computer`]})]}),(0,K.jsxs)(`div`,{className:`hc-actions`,children:[(0,K.jsx)(`button`,{className:`btn primary`,type:`button`,onClick:t,children:`Start them and check`}),(0,K.jsx)(`button`,{className:`btn`,type:`button`,onClick:n,children:`Check without them`}),(0,K.jsx)(`button`,{className:`btn ghost`,type:`button`,onClick:r,children:`Cancel`})]})]})}function Fo(e){let[t,n]=(0,S.useState)([]),[r,i]=(0,S.useState)(!1);return(0,S.useEffect)(()=>{if(n([]),i(!1),!e||typeof EventSource>`u`)return;let t=new EventSource(`/runs/${encodeURIComponent(e)}/events`),r=[],a=0,o=()=>{a=0,n(e=>e.concat(r.splice(0)))};return t.onmessage=e=>{r.push(JSON.parse(e.data)),a||=requestAnimationFrame(o)},t.addEventListener(`end`,()=>{a&&cancelAnimationFrame(a),o(),i(!0),t.close()}),t.onerror=()=>{t.readyState===EventSource.CLOSED&&i(!0)},()=>{a&&cancelAnimationFrame(a),t.close()}},[e]),{events:t,ended:r}}var Io=20;function Lo(e){return typeof e==`object`&&!!e&&`id`in e&&`status`in e}function Ro(e=!0){let t=V(e?`/checks`:null),[n,r]=(0,S.useState)(null),[i,a]=(0,S.useState)(null),[o,s]=(0,S.useState)(),c=(0,S.useRef)(0),{events:l,ended:u}=Fo(n?.id),d=(0,S.useMemo)(()=>{let e={};if(!n)return e;for(let t of n.ids)e[t]={status:`checking`,summary:`Checking…`};for(let t of l)t.type===`step`&&t.state===`succeeded`&&Lo(t.output)&&(e[t.output.id]=t.output);return e},[n,l]),f=!!n&&t.data?.run_id===n.id,p=t.reload;(0,S.useEffect)(()=>{if(!n||!u)return;if(f||c.current>=Io){r(null);return}let e=window.setTimeout(()=>{c.current+=1,p()},300);return()=>window.clearTimeout(e)},[n,u,f,p,t.data]);let m=(0,S.useMemo)(()=>(t.data?.items??[]).map(e=>{let t=d[e.id];return t?{...e,...t,history:e.history}:e}),[t.data,d]),h=(0,S.useMemo)(()=>m.filter(e=>e.status!==`unconfirmed`).map(e=>e.id),[m]),g=(0,S.useCallback)(async e=>{s(void 0),a(null);try{let t=await aa.post(`/checks`,e);c.current=0,r({id:t.run_id,ids:e.ids??h})}catch(e){s(e instanceof Error?e.message:String(e))}},[h]),_=(0,S.useCallback)(async e=>{s(void 0);try{let t=await aa.get(`/checks/plan`),n=e?t.starts.filter(t=>e.includes(t.id)):t.starts;if(!t.confirmed&&n.length){let r=m.filter(t=>(e??h).includes(t.id)&&!n.some(e=>e.id===t.id));a({plan:{...t,starts:n},ids:e,requests:r.filter(e=>e.kind!==`local`).length,lookedFor:r.filter(e=>e.kind===`local`).length});return}await g(e?{ids:e}:{})}catch(e){s(e instanceof Error?e.message:String(e))}},[g,m,h]),v=(0,S.useCallback)(()=>{i&&g(i.ids?{ids:i.ids,confirm:!0}:{confirm:!0})},[i,g]),y=(0,S.useCallback)(()=>{if(!i)return;let e=new Set(i.plan.starts.map(e=>e.id)),t=(i.ids??h).filter(t=>!e.has(t));t.length?g({ids:t}):a(null)},[i,h,g]),b=n?n.ids.filter(e=>d[e]&&d[e].status!==`checking`).length:0;return{view:t.data,loadError:t.error,items:m,error:o,asking:i,running:!!n,progress:n?{done:b,total:n.ids.length}:null,checkNow:_,confirm:v,withoutStarts:y,cancel:()=>a(null)}}var zo={llm:`llm`,api:`http`,mcp:`mcp`,local:`local`},Bo={llm:`LLM`,api:`API`,mcp:`MCP server`,local:`Local program`};function Vo({item:e,size:t=26}){return(0,K.jsx)(no,{c:{id:e.catalog??e.id,type:zo[e.kind]??`http`,name:e.name},size:t})}function Ho({item:e,othersUp:t}){let n=V(`/checks/${encodeURIComponent(e.id)}`),r=n.data?.find(e=>e.fix)?.fix??e.fix;return(0,K.jsxs)(`section`,{className:`ck-side`,"aria-label":`${e.name} history`,children:[(0,K.jsx)(`header`,{children:(0,K.jsxs)(`b`,{children:[(0,K.jsx)(Vo,{item:e}),e.name]})}),n.data&&n.data.length===0&&(0,K.jsx)(`p`,{style:{padding:`12px 16px`,margin:0,color:`var(--muted)`},children:`Not checked yet.`}),(0,K.jsx)(`ul`,{className:`ck-tl`,children:n.data?.map(e=>(0,K.jsxs)(`li`,{children:[(0,K.jsx)(Mo,{status:e.status}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`b`,{children:e.summary}),e.reason&&(0,K.jsx)(`p`,{children:e.reason})]}),(0,K.jsx)(`time`,{dateTime:e.at,children:ao(e.at)})]},`${e.run_id}-${e.at}`))}),r&&n.data?.[0]?.status!==`up`&&(0,K.jsxs)(`p`,{className:`hc-fix`,children:[(0,K.jsx)(`span`,{children:`Likely fix`}),r]}),(0,K.jsx)(`div`,{style:{padding:`0 16px`},children:(0,K.jsx)(No,{item:e,othersUp:t})})]})}function Uo(){let e=Ro(),[t,n]=(0,S.useState)(!1),[r,i]=(0,S.useState)(null),a=(0,S.useMemo)(()=>Ao(e.items),[e.items]),o=a.filter(e=>Do(e.status)).length,s=t?a.filter(e=>Do(e.status)):a,c=a.find(e=>e.id===r)??a.find(e=>Do(e.status))??a[0],l=e.view,u=(0,K.jsxs)(`div`,{className:`page-head`,children:[(0,K.jsxs)(`div`,{className:`titles`,children:[(0,K.jsx)(`h1`,{children:`Checks`}),(0,K.jsx)(`p`,{className:`lede`,children:l?.example?`Example results: nothing was sent anywhere.`:`Is everything your app depends on up, fast and safe to call?`})]}),a.length>0&&(0,K.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:()=>void e.checkNow(),disabled:e.running,children:[J.activity(18),` `,e.running?`Checking… ${e.progress?.done??0} of ${e.progress?.total??0}`:`Check now`]})]});if(e.loadError)return(0,K.jsxs)(`div`,{className:`ck`,children:[u,(0,K.jsx)(go,{error:e.loadError,what:`the checks`})]});if(!l)return(0,K.jsx)(`div`,{className:`ck`,"aria-busy":`true`,children:u});if(a.length===0)return(0,K.jsxs)(`div`,{className:`ck`,children:[u,(0,K.jsx)(ho,{tone:`teal`,icon:J.activity(28),title:`Nothing to check yet`,action:(0,K.jsx)(z,{className:`btn primary`,to:`/`,children:`Scan a folder`}),children:`Checks need a map: scan a folder first, then check what it depends on.`})]});let d=a.map(e=>e.status),f=e=>Oo(d,e);return(0,K.jsxs)(`div`,{className:`ck`,children:[u,e.asking&&(0,K.jsx)(`div`,{style:{borderRadius:`var(--r-lg)`,overflow:`hidden`,border:`1px solid var(--line)`},children:(0,K.jsx)(Y,{asking:e.asking,onStart:e.confirm,onWithout:e.withoutStarts,onCancel:e.cancel})}),e.error&&(0,K.jsx)(`div`,{className:`notice`,role:`alert`,children:e.error}),(0,K.jsxs)(`div`,{className:`ck-overview`,children:[(0,K.jsxs)(`span`,{className:`ck-counts`,children:[f(`down`)>0&&(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`b`,{style:{color:`var(--coral)`},children:f(`down`)}),` down`]}),f(`warn`)>0&&(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`b`,{style:{color:`var(--amber)`},children:f(`warn`)}),` need`,f(`warn`)===1?`s`:``,` a look`]}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`b`,{children:f(`up`)}),` up`]})]}),(0,K.jsx)(`span`,{className:`ck-when`,children:l.checked_at?`last check ${ao(l.checked_at)}${l.took_ms?`, took ${wo(l.took_ms)}`:``}`:`never checked`})]}),(0,K.jsxs)(`div`,{className:`ck-split`,children:[(0,K.jsxs)(`div`,{className:`ck-table-wrap`,children:[(0,K.jsxs)(`div`,{className:`ck-bar`,children:[(0,K.jsxs)(`span`,{className:`seg`,role:`group`,"aria-label":`Which dependencies`,children:[(0,K.jsxs)(`button`,{type:`button`,"aria-pressed":!t,onClick:()=>n(!1),children:[`All `,a.length]}),(0,K.jsxs)(`button`,{type:`button`,"aria-pressed":t,onClick:()=>n(!0),children:[`Problems `,o]})]}),(0,K.jsx)(`small`,{children:`Problems first, then by name`})]}),(0,K.jsxs)(`table`,{children:[(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{scope:`col`,children:`Dependency`}),(0,K.jsx)(`th`,{scope:`col`,children:`Result`}),(0,K.jsx)(`th`,{scope:`col`,className:`ck-lat`,children:`Latency`}),(0,K.jsx)(`th`,{scope:`col`,children:`Last checks`}),(0,K.jsx)(`th`,{scope:`col`,children:`Checked`})]})}),(0,K.jsx)(`tbody`,{children:s.map(e=>(0,K.jsxs)(`tr`,{className:e.id===c?.id?`sel`:void 0,children:[(0,K.jsx)(`th`,{scope:`row`,children:(0,K.jsxs)(`button`,{className:`ck-name`,type:`button`,onClick:()=>i(e.id),"aria-pressed":e.id===c?.id,children:[(0,K.jsx)(Mo,{status:e.status}),(0,K.jsx)(Vo,{item:e}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`b`,{children:e.name}),(0,K.jsx)(`small`,{children:Bo[e.kind]??e.kind})]})]})}),(0,K.jsx)(`td`,{className:`ck-res ${e.status}`,children:e.status===`down`?`${To.down}: ${e.summary}`:e.summary}),(0,K.jsx)(`td`,{className:`ck-lat${e.latency_ms?``:` none`}`,children:wo(e.latency_ms)||`–`}),(0,K.jsx)(`td`,{children:(0,K.jsx)(jo,{statuses:e.history,size:`tall`,label:`last ${e.history.length} checks: ${Eo(e.history)}`})}),(0,K.jsx)(`td`,{className:`ck-at${e.at?``:` none`}`,children:e.at?oo(e.at):`–`})]},e.id))})]})]}),c&&(0,K.jsx)(Ho,{item:c,othersUp:a.filter(e=>e.status===`up`&&e.id!==c.id).length},c.id)]}),(0,K.jsxs)(`div`,{className:`ck-foot`,children:[(0,K.jsx)(`span`,{children:`Checks use no keys. Results stay on this computer.`}),(0,K.jsx)(z,{to:`/runs`,children:`Workflow runs (advanced)`})]})]})}var Wo=(0,S.createContext)({project:`My project`,example:!1,version:``}),Go=()=>(0,S.useContext)(Wo),Ko=`flowforge.theme`;function qo(){try{let e=localStorage.getItem(Ko);return e===`light`||e===`dark`?e:`system`}catch{return`system`}}function Jo(){let[e,t]=(0,S.useState)(qo);(0,S.useEffect)(()=>{e===`system`?document.documentElement.removeAttribute(`data-theme`):document.documentElement.setAttribute(`data-theme`,e);try{localStorage.setItem(Ko,e)}catch{}},[e]);let n={system:`light`,light:`dark`,dark:`system`},r={system:`Theme: system`,light:`Theme: light`,dark:`Theme: dark`}[e],i={system:J.monitor(20),light:J.sun(20),dark:J.moon(20)}[e];return(0,K.jsxs)(`button`,{type:`button`,className:`rail-item rail-theme`,onClick:()=>t(n[e]),"aria-label":`${r}. Change theme`,title:r,children:[i,(0,K.jsx)(`span`,{children:`Theme`})]})}var Yo=[{to:`/`,label:`Map`,icon:J.map(20),active:/^\/($|map(\/|$)|connectors(\/|$))/},{to:`/checks`,label:`Checks`,icon:J.activity(20),active:/^\/(checks|runs|live)(\/|$)/},{to:`/connect`,label:`Connect agent`,icon:J.code(20),active:/^\/connect$/}];function Xo(){return Lr().some(e=>e.handle?.bleed)}function Zo(){let e=V(`/meta`),t=mr(),n=Xo(),r=e.data??{project:`My project`,example:!1,version:``};return(0,K.jsxs)(Wo.Provider,{value:r,children:[(0,K.jsx)(`a`,{className:`skip-link`,href:`#main`,children:`Skip to content`}),(0,K.jsxs)(`div`,{className:`shell${n?` bleed`:``}`,children:[(0,K.jsxs)(`nav`,{className:`rail`,"aria-label":`Main`,children:[(0,K.jsx)(z,{to:`/`,className:`rail-brand`,"aria-label":`FlowForge, flow map`,children:(0,K.jsx)(`img`,{src:`/favicon.svg`,width:34,height:34,alt:``})}),Yo.map(e=>(0,K.jsxs)(z,{to:e.to,className:`rail-item`,title:e.soon?`${e.label}: arrives in ${e.soon}`:e.label,"aria-current":e.active.test(t.pathname)?`page`:void 0,children:[e.icon,(0,K.jsx)(`span`,{children:e.label}),e.soon&&(0,K.jsxs)(`span`,{className:`visually-hidden`,children:[`(arrives in `,e.soon,`)`]})]},e.to)),(0,K.jsx)(`span`,{className:`rail-gap`}),(0,K.jsx)(Jo,{})]}),(0,K.jsx)(`main`,{className:`main`,id:`main`,tabIndex:-1,children:(0,K.jsx)(`div`,{className:`page${n?``:` page-enter`}`,children:(0,K.jsx)(ti,{})},t.pathname)})]})]})}function Qo(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=Qo(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var $o={value:()=>{}};function es(){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 ts(n)}function ts(e){this._=e}function ns(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}})}ts.prototype=es.prototype={constructor:ts,on:function(e,t){var n=this._,r=ns(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=rs(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=is(n[i],e.name,t);else if(t==null)for(i in n)n[i]=is(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 ts(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 rs(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function is(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=$o,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var as={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 os(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),as.hasOwnProperty(t)?{space:as[t],local:e}:e}function ss(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 cs(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ls(e){var t=os(e);return(t.local?cs:ss)(t)}function us(){}function ds(e){return e==null?us:function(){return this.querySelector(e)}}function fs(e){typeof e!=`function`&&(e=ds(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 el(r,this._parents)}function ps(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ms(){return[]}function hs(e){return e==null?ms:function(){return this.querySelectorAll(e)}}function gs(e){return function(){return ps(e.apply(this,arguments))}}function _s(e){e=typeof e==`function`?gs(e):hs(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 el(r,i)}function vs(e){return function(){return this.matches(e)}}function ys(e){return function(t){return t.matches(e)}}var bs=Array.prototype.find;function xs(e){return function(){return bs.call(this.children,e)}}function Ss(){return this.firstElementChild}function Cs(e){return this.select(e==null?Ss:xs(typeof e==`function`?e:ys(e)))}var ws=Array.prototype.filter;function Ts(){return Array.from(this.children)}function Es(e){return function(){return ws.call(this.children,e)}}function Ds(e){return this.selectAll(e==null?Ts:Es(typeof e==`function`?e:ys(e)))}function Os(e){typeof e!=`function`&&(e=vs(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 el(r,this._parents)}function ks(e){return Array(e.length)}function As(){return new el(this._enter||this._groups.map(ks),this._parents)}function js(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}js.prototype={constructor:js,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 Ms(e){return function(){return e}}function Ns(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 js(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function Ps(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 js(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function Fs(e){return e.__data__}function Is(e,t){if(!arguments.length)return Array.from(this,Fs);var n=t?Ps:Ns,r=this._parents,i=this._groups;typeof e!=`function`&&(e=Ms(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=Ls(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 el(o,r),o._enter=s,o._exit=c,o}function Ls(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Rs(){return new el(this._exit||this._groups.map(ks),this._parents)}function zs(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 Bs(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 el(s,this._parents)}function Vs(){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 Hs(e){e||=Us;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 el(i,this._parents).order()}function Us(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ws(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Gs(){return Array.from(this)}function Ks(){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 qs(){let e=0;for(let t of this)++e;return e}function Js(){return!this.node()}function Ys(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 Xs(e){return function(){this.removeAttribute(e)}}function Zs(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Qs(e,t){return function(){this.setAttribute(e,t)}}function $s(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ec(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function tc(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 nc(e,t){var n=os(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?Zs:Xs:typeof t==`function`?n.local?tc:ec:n.local?$s:Qs)(n,t))}function rc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ic(e){return function(){this.style.removeProperty(e)}}function ac(e,t,n){return function(){this.style.setProperty(e,t,n)}}function oc(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function sc(e,t,n){return arguments.length>1?this.each((t==null?ic:typeof t==`function`?oc:ac)(e,t,n??``)):cc(this.node(),e)}function cc(e,t){return e.style.getPropertyValue(t)||rc(e).getComputedStyle(e,null).getPropertyValue(t)}function lc(e){return function(){delete this[e]}}function uc(e,t){return function(){this[e]=t}}function dc(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function fc(e,t){return arguments.length>1?this.each((t==null?lc:typeof t==`function`?dc:uc)(e,t)):this.node()[e]}function pc(e){return e.trim().split(/^|\s+/)}function mc(e){return e.classList||new hc(e)}function hc(e){this._node=e,this._names=pc(e.getAttribute(`class`)||``)}hc.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 gc(e,t){for(var n=mc(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function _c(e,t){for(var n=mc(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function vc(e){return function(){gc(this,e)}}function yc(e){return function(){_c(this,e)}}function bc(e,t){return function(){(t.apply(this,arguments)?gc:_c)(this,e)}}function xc(e,t){var n=pc(e+``);if(arguments.length<2){for(var r=mc(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?bc:t?vc:yc)(n,t))}function Sc(){this.textContent=``}function Cc(e){return function(){this.textContent=e}}function wc(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function Tc(e){return arguments.length?this.each(e==null?Sc:(typeof e==`function`?wc:Cc)(e)):this.node().textContent}function Ec(){this.innerHTML=``}function Dc(e){return function(){this.innerHTML=e}}function Oc(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function kc(e){return arguments.length?this.each(e==null?Ec:(typeof e==`function`?Oc:Dc)(e)):this.node().innerHTML}function Ac(){this.nextSibling&&this.parentNode.appendChild(this)}function jc(){return this.each(Ac)}function Mc(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Nc(){return this.each(Mc)}function Pc(e){var t=typeof e==`function`?e:ls(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Fc(){return null}function Ic(e,t){var n=typeof e==`function`?e:ls(e),r=t==null?Fc:typeof t==`function`?t:ds(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Lc(){var e=this.parentNode;e&&e.removeChild(this)}function Rc(){return this.each(Lc)}function zc(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Bc(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Vc(e){return this.select(e?Bc:zc)}function Hc(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function Uc(e){return function(t){e.call(this,t,this.__data__)}}function Wc(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 Gc(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 Kc(e,t,n){return function(){var r=this.__on,i,a=Uc(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 qc(e,t,n){var r=Wc(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}}else{for(s=t?Kc:Gc,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function Jc(e,t,n){var r=rc(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 Yc(e,t){return function(){return Jc(this,e,t)}}function Xc(e,t){return function(){return Jc(this,e,t.apply(this,arguments))}}function Zc(e,t){return this.each((typeof t==`function`?Xc:Yc)(e,t))}function*Qc(){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 $c=[null];function el(e,t){this._groups=e,this._parents=t}function tl(){return new el([[document.documentElement]],$c)}function nl(){return this}el.prototype=tl.prototype={constructor:el,select:fs,selectAll:_s,selectChild:Cs,selectChildren:Ds,filter:Os,data:Is,enter:As,exit:Rs,join:zs,merge:Bs,selection:nl,order:Vs,sort:Hs,call:Ws,nodes:Gs,node:Ks,size:qs,empty:Js,each:Ys,attr:nc,style:sc,property:fc,classed:xc,text:Tc,html:kc,raise:jc,lower:Nc,append:Pc,insert:Ic,remove:Rc,clone:Vc,datum:Hc,on:qc,dispatch:Zc,[Symbol.iterator]:Qc};function rl(e){return typeof e==`string`?new el([[document.querySelector(e)]],[document.documentElement]):new el([[e]],$c)}function il(e){let t;for(;t=e.sourceEvent;)e=t;return e}function al(e,t){if(e=il(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 ol={passive:!1},sl={capture:!0,passive:!1};function cl(e){e.stopImmediatePropagation()}function ll(e){e.preventDefault(),e.stopImmediatePropagation()}function ul(e){var t=e.document.documentElement,n=rl(e).on(`dragstart.drag`,ll,sl);`onselectstart`in t?n.on(`selectstart.drag`,ll,sl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function dl(e,t){var n=e.document.documentElement,r=rl(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,ll,sl),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 fl=e=>()=>e;function pl(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}})}pl.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function ml(e){return!e.ctrlKey&&!e.button}function hl(){return this.parentNode}function gl(e,t){return t??{x:e.x,y:e.y}}function _l(){return navigator.maxTouchPoints||`ontouchstart`in this}function vl(){var e=ml,t=hl,n=gl,r=_l,i={},a=es(`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`,_,ol).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&&(rl(n.view).on(`mousemove.drag`,m,sl).on(`mouseup.drag`,h,sl),ul(n.view),cl(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(ll(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){rl(e.view).on(`mousemove.drag mouseup.drag`,null),dl(e.view,l),ll(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(cl(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(ll(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])&&(cl(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=al(l||r,t),p,m,h;if((h=n.call(e,new pl(`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=al(l||a,t),_=o}u.call(r,e,new pl(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:fl(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:fl(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:fl(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:fl(!!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 yl(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function bl(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function xl(){}var Sl=.7,Cl=1/Sl,wl=`\\s*([+-]?\\d+)\\s*`,Tl=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,El=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,Dl=/^#([0-9a-f]{3,8})$/,Ol=RegExp(`^rgb\\(${wl},${wl},${wl}\\)$`),kl=RegExp(`^rgb\\(${El},${El},${El}\\)$`),Al=RegExp(`^rgba\\(${wl},${wl},${wl},${Tl}\\)$`),jl=RegExp(`^rgba\\(${El},${El},${El},${Tl}\\)$`),Ml=RegExp(`^hsl\\(${Tl},${El},${El}\\)$`),Nl=RegExp(`^hsla\\(${Tl},${El},${El},${Tl}\\)$`),Pl={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};yl(xl,zl,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Fl,formatHex:Fl,formatHex8:Il,formatHsl:Ll,formatRgb:Rl,toString:Rl});function Fl(){return this.rgb().formatHex()}function Il(){return this.rgb().formatHex8()}function Ll(){return Ql(this).formatHsl()}function Rl(){return this.rgb().formatRgb()}function zl(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=Dl.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Bl(t):n===3?new Wl(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Vl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Vl(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=Ol.exec(e))?new Wl(t[1],t[2],t[3],1):(t=kl.exec(e))?new Wl(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Al.exec(e))?Vl(t[1],t[2],t[3],t[4]):(t=jl.exec(e))?Vl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ml.exec(e))?Zl(t[1],t[2]/100,t[3]/100,1):(t=Nl.exec(e))?Zl(t[1],t[2]/100,t[3]/100,t[4]):Pl.hasOwnProperty(e)?Bl(Pl[e]):e===`transparent`?new Wl(NaN,NaN,NaN,0):null}function Bl(e){return new Wl(e>>16&255,e>>8&255,e&255,1)}function Vl(e,t,n,r){return r<=0&&(e=t=n=NaN),new Wl(e,t,n,r)}function Hl(e){return e instanceof xl||(e=zl(e)),e?(e=e.rgb(),new Wl(e.r,e.g,e.b,e.opacity)):new Wl}function Ul(e,t,n,r){return arguments.length===1?Hl(e):new Wl(e,t,n,r??1)}function Wl(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}yl(Wl,Ul,bl(xl,{brighter(e){return e=e==null?Cl:Cl**+e,new Wl(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Sl:Sl**+e,new Wl(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Wl(Yl(this.r),Yl(this.g),Yl(this.b),Jl(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:Gl,formatHex:Gl,formatHex8:Kl,formatRgb:ql,toString:ql}));function Gl(){return`#${Xl(this.r)}${Xl(this.g)}${Xl(this.b)}`}function Kl(){return`#${Xl(this.r)}${Xl(this.g)}${Xl(this.b)}${Xl((isNaN(this.opacity)?1:this.opacity)*255)}`}function ql(){let e=Jl(this.opacity);return`${e===1?`rgb(`:`rgba(`}${Yl(this.r)}, ${Yl(this.g)}, ${Yl(this.b)}${e===1?`)`:`, ${e})`}`}function Jl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Yl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Xl(e){return e=Yl(e),(e<16?`0`:``)+e.toString(16)}function Zl(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new X(e,t,n,r)}function Ql(e){if(e instanceof X)return new X(e.h,e.s,e.l,e.opacity);if(e instanceof xl||(e=zl(e)),!e)return new X;if(e instanceof X)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 X(o,s,c,e.opacity)}function $l(e,t,n,r){return arguments.length===1?Ql(e):new X(e,t,n,r??1)}function X(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}yl(X,$l,bl(xl,{brighter(e){return e=e==null?Cl:Cl**+e,new X(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Sl:Sl**+e,new X(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 Wl(nu(e>=240?e-240:e+120,i,r),nu(e,i,r),nu(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new X(eu(this.h),tu(this.s),tu(this.l),Jl(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=Jl(this.opacity);return`${e===1?`hsl(`:`hsla(`}${eu(this.h)}, ${tu(this.s)*100}%, ${tu(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function eu(e){return e=(e||0)%360,e<0?e+360:e}function tu(e){return Math.max(0,Math.min(1,e||0))}function nu(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 ru=e=>()=>e;function iu(e,t){return function(n){return e+n*t}}function au(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function ou(e){return(e=+e)==1?su:function(t,n){return n-t?au(t,n,e):ru(isNaN(t)?n:t)}}function su(e,t){var n=t-e;return n?iu(e,n):ru(isNaN(e)?t:e)}var cu=(function e(t){var n=ou(t);function r(e,t){var r=n((e=Ul(e)).r,(t=Ul(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=su(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 lu(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 uu(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function du(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=bu(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 fu(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function pu(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function mu(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]=bu(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var hu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,gu=new RegExp(hu.source,`g`);function _u(e){return function(){return e}}function vu(e){return function(t){return e(t)+``}}function yu(e,t){var n=hu.lastIndex=gu.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=hu.exec(e))&&(i=gu.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:pu(r,i)})),n=gu.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?vu(c[0].x):_u(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 bu(e,t){var n=typeof t,r;return t==null||n===`boolean`?ru(t):(n===`number`?pu:n===`string`?(r=zl(t))?(t=r,cu):yu:t instanceof zl?cu:t instanceof Date?fu:uu(t)?lu:Array.isArray(t)?du:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?mu:pu)(e,t)}var xu=180/Math.PI,Su={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Cu(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)*xu,skewX:Math.atan(c)*xu,scaleX:o,scaleY:s}}var wu;function Tu(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?Su:Cu(t.a,t.b,t.c,t.d,t.e,t.f)}function Eu(e){return e==null||(wu||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),wu.setAttribute(`transform`,e),!(e=wu.transform.baseVal.consolidate()))?Su:(e=e.matrix,Cu(e.a,e.b,e.c,e.d,e.e,e.f))}function Du(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:pu(e,i)},{i:c-2,x:pu(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:pu(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:pu(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:pu(e,n)},{i:s-2,x:pu(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 Ou=Du(Tu,`px, `,`px)`,`deg)`),ku=Du(Eu,`, `,`)`,`)`),Au=1e-12;function ju(e){return((e=Math.exp(e))+1/e)/2}function Mu(e){return((e=Math.exp(e))-1/e)/2}function Nu(e){return((e=Math.exp(2*e))-1)/(e+1)}var Pu=(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<Au)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=ju(y),c=s/(n*g)*(i*Nu(t*r+y)-Mu(y));return[a+c*d,o+c*f,s*i/ju(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),Fu=0,Iu=0,Lu=0,Ru=1e3,zu,Bu,Vu=0,Hu=0,Uu=0,Wu=typeof performance==`object`&&performance.now?performance:Date,Gu=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ku(){return Hu||=(Gu(qu),Wu.now()+Uu)}function qu(){Hu=0}function Ju(){this._call=this._time=this._next=null}Ju.prototype=Yu.prototype={constructor:Ju,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Ku():+n)+(t==null?0:+t),!this._next&&Bu!==this&&(Bu?Bu._next=this:zu=this,Bu=this),this._call=e,this._time=n,ed()},stop:function(){this._call&&(this._call=null,this._time=1/0,ed())}};function Yu(e,t,n){var r=new Ju;return r.restart(e,t,n),r}function Xu(){Ku(),++Fu;for(var e=zu,t;e;)(t=Hu-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Fu}function Zu(){Hu=(Vu=Wu.now())+Uu,Fu=Iu=0;try{Xu()}finally{Fu=0,$u(),Hu=0}}function Qu(){var e=Wu.now(),t=e-Vu;t>Ru&&(Uu-=t,Vu=e)}function $u(){for(var e,t=zu,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:zu=n);Bu=e,ed(r)}function ed(e){Fu||(Iu&&=clearTimeout(Iu),e-Hu>24?(e<1/0&&(Iu=setTimeout(Zu,e-Wu.now()-Uu)),Lu&&=clearInterval(Lu)):(Lu||=(Vu=Wu.now(),setInterval(Qu,Ru)),Fu=1,Gu(Zu)))}function td(e,t,n){var r=new Ju;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var nd=es(`start`,`end`,`cancel`,`interrupt`),rd=[];function id(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;cd(e,n,{name:t,index:r,group:i,on:nd,tween:rd,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function ad(e,t){var n=sd(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function od(e,t){var n=sd(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function sd(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function cd(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Yu(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 td(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(td(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 ld(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n)(r=n[o]).name===t?(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=!1;a&&delete e.__transition}}function ud(e){return this.each(function(){ld(this,e)})}function dd(e,t){var n,r;return function(){var i=od(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 fd(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=od(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 pd(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=sd(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?dd:fd)(n,e,t))}function md(e,t,n){var r=e._id;return e.each(function(){var e=od(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return sd(e,r).value[t]}}function hd(e,t){var n;return(typeof t==`number`?pu:t instanceof zl?cu:(n=zl(t))?(t=n,cu):yu)(e,t)}function gd(e){return function(){this.removeAttribute(e)}}function _d(e){return function(){this.removeAttributeNS(e.space,e.local)}}function vd(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 yd(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 bd(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 xd(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 Sd(e,t){var n=os(e),r=n===`transform`?ku:hd;return this.attrTween(e,typeof t==`function`?(n.local?xd:bd)(n,r,md(this,`attr.`+e,t)):t==null?(n.local?_d:gd)(n):(n.local?yd:vd)(n,r,t))}function Cd(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function wd(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Td(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&wd(e,i)),n}return i._value=t,i}function Ed(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Cd(e,i)),n}return i._value=t,i}function Dd(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=os(e);return this.tween(n,(r.local?Td:Ed)(r,t))}function Od(e,t){return function(){ad(this,e).delay=+t.apply(this,arguments)}}function kd(e,t){return t=+t,function(){ad(this,e).delay=t}}function Ad(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Od:kd)(t,e)):sd(this.node(),t).delay}function jd(e,t){return function(){od(this,e).duration=+t.apply(this,arguments)}}function Md(e,t){return t=+t,function(){od(this,e).duration=t}}function Nd(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?jd:Md)(t,e)):sd(this.node(),t).duration}function Pd(e,t){if(typeof t!=`function`)throw Error();return function(){od(this,e).ease=t}}function Fd(e){var t=this._id;return arguments.length?this.each(Pd(t,e)):sd(this.node(),t).ease}function Id(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();od(this,e).ease=n}}function Ld(e){if(typeof e!=`function`)throw Error();return this.each(Id(this._id,e))}function Rd(e){typeof e!=`function`&&(e=vs(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 mf(r,this._parents,this._name,this._id)}function zd(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 mf(o,this._parents,this._name,this._id)}function Bd(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 Vd(e,t,n){var r,i,a=Bd(t)?ad:od;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Hd(e,t){var n=this._id;return arguments.length<2?sd(this.node(),n).on.on(e):this.each(Vd(n,e,t))}function Ud(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Wd(){return this.on(`end.remove`,Ud(this._id))}function Gd(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=ds(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,id(l[f],t,n,f,l,sd(u,n)));return new mf(a,this._parents,t,n)}function Kd(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=hs(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=sd(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&id(p,t,n,h,f,m);a.push(f),o.push(u)}return new mf(a,o,t,n)}var qd=tl.prototype.constructor;function Jd(){return new qd(this._groups,this._parents)}function Yd(e,t){var n,r,i;return function(){var a=cc(this,e),o=(this.style.removeProperty(e),cc(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Xd(e){return function(){this.style.removeProperty(e)}}function Zd(e,t,n){var r,i=n+``,a;return function(){var o=cc(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Qd(e,t,n){var r,i,a;return function(){var o=cc(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),cc(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function $d(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=od(this,e),l=c.on,u=c.value[a]==null?s||=Xd(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function ef(e,t,n){var r=(e+=``)==`transform`?Ou:hd;return t==null?this.styleTween(e,Yd(e,r)).on(`end.style.`+e,Xd(e)):typeof t==`function`?this.styleTween(e,Qd(e,r,md(this,`style.`+e,t))).each($d(this._id,e)):this.styleTween(e,Zd(e,r,t),n).on(`end.style.`+e,null)}function tf(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function nf(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&tf(e,a,n)),r}return a._value=t,a}function rf(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,nf(e,t,n??``))}function af(e){return function(){this.textContent=e}}function of(e){return function(){var t=e(this);this.textContent=t??``}}function sf(e){return this.tween(`text`,typeof e==`function`?of(md(this,`text`,e)):af(e==null?``:e+``))}function cf(e){return function(t){this.textContent=e.call(this,t)}}function lf(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&cf(r)),t}return r._value=e,r}function uf(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,lf(e))}function df(){for(var e=this._name,t=this._id,n=hf(),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=sd(c,t);id(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new mf(r,this._parents,e,n)}function ff(){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=od(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 pf=0;function mf(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function hf(){return++pf}var gf=tl.prototype;mf.prototype={constructor:mf,select:Gd,selectAll:Kd,selectChild:gf.selectChild,selectChildren:gf.selectChildren,filter:Rd,merge:zd,selection:Jd,transition:df,call:gf.call,nodes:gf.nodes,node:gf.node,size:gf.size,empty:gf.empty,each:gf.each,on:Hd,attr:Sd,attrTween:Dd,style:ef,styleTween:rf,text:sf,textTween:uf,remove:Wd,tween:pd,delay:Ad,duration:Nd,ease:Fd,easeVarying:Ld,end:ff,[Symbol.iterator]:gf[Symbol.iterator]};function _f(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var vf={time:null,delay:0,duration:250,ease:_f};function yf(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function bf(e){var t,n;e instanceof mf?(t=e._id,e=e._name):(t=hf(),(n=vf).time=Ku(),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])&&id(c,e,t,l,o,n||yf(c,t));return new mf(r,this._parents,e,t)}tl.prototype.interrupt=ud,tl.prototype.transition=bf;var xf=e=>()=>e;function Sf(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 Cf(e,t,n){this.k=e,this.x=t,this.y=n}Cf.prototype={constructor:Cf,scale:function(e){return e===1?this:new Cf(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Cf(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 wf=new Cf(1,0,0);Tf.prototype=Cf.prototype;function Tf(e){for(;!e.__zoom;)if(!(e=e.parentNode))return wf;return e.__zoom}function Ef(e){e.stopImmediatePropagation()}function Df(e){e.preventDefault(),e.stopImmediatePropagation()}function Of(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function kf(){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 Af(){return this.__zoom||wf}function jf(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Mf(){return navigator.maxTouchPoints||`ontouchstart`in this}function Nf(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 Pf(){var e=Of,t=kf,n=Nf,r=jf,i=Mf,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Pu,l=es(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,Af).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`,Af),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(wf.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 Cf(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 Cf(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 Cf(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=rl(this.that).datum();l.call(e,this.that,new Sf(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=al(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)],ld(this),s.start();Df(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=rl(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=al(t,i),l=t.clientX,u=t.clientY;ul(t.view),Ef(t),a.mouse=[c,this.__zoom.invert(c)],ld(this),a.start();function d(e){if(Df(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]=al(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),dl(e.view,a.moved),Df(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=al(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);Df(r),s>0?rl(this).transition().duration(s).call(x,d,c,r):rl(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(Ef(t),s=0;s<i;++s)c=r[s],l=al(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)),ld(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(Df(e),s=0;s<a;++s)c=i[s],l=al(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(Ef(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=al(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=rl(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:xf(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:xf(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:xf(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:xf([[+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 Ff={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}flow.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 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.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},If=[[-1/0,-1/0],[1/0,1/0]],Lf=[`Enter`,` `,`Escape`],Rf={"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`},zf;(function(e){e.Strict=`strict`,e.Loose=`loose`})(zf||={});var Bf;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(Bf||={});var Vf;(function(e){e.Partial=`partial`,e.Full=`full`})(Vf||={});var Hf={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},Z;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(Z||={});var Uf;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(Uf||={});var Q;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(Q||={});var Wf={[Q.Left]:Q.Right,[Q.Right]:Q.Left,[Q.Top]:Q.Bottom,[Q.Bottom]:Q.Top},Gf=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,Kf=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),qf=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),Jf=(e,t=[0,0])=>{let{width:n,height:r}=Op(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},Yf=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((e,r)=>{let i=typeof r==`string`,a=!t.nodeLookup&&!i?r:void 0;return t.nodeLookup&&(a=i?t.nodeLookup.get(r):qf(r)?r:t.nodeLookup.get(r.id)),a?(n=!0,cp(e,fp(a,t.nodeOrigin))):e},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?up(r):{x:0,y:0,width:0,height:0}},Xf=(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=cp(n,fp(e)),r=!0)}),r?up(n):{x:0,y:0,width:0,height:0}},Zf=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];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??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=mp(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d},Qf=(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 $f(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=Op(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function ep({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=Tp(Xf($f(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}),!0}function tp({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`,Ff.error005());else{let{width:e,height:t}=Op(s);e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&Dp(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=Dp(d)?ip(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,Ff.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 np({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=Qf(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 rp=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),ip=(e={x:0,y:0},t,n)=>({x:rp(e.x,t[0][0],t[1][0]-(n?.width??0)),y:rp(e.y,t[0][1],t[1][1]-(n?.height??0))});function ap(e,t,n){let{width:r,height:i}=Op(n),{x:a,y:o}=n.internals.positionAbsolute;return ip(e,[[a,o],[a+r,o+i]],t)}var op=(e,t,n)=>e<t?rp(Math.abs(e-t),1,t)/t:e>n?-rp(Math.abs(e-n),1,t)/t:0,sp=(e,t,n=15,r=40)=>[op(e.x,r,t.width-r)*n,op(e.y,r,t.height-r)*n],cp=(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)}),lp=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),up=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),dp=(e,t=[0,0])=>{let{x:n,y:r}=qf(e)?e.internals.positionAbsolute:Jf(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}},fp=(e,t=[0,0])=>{let{x:n,y:r}=qf(e)?e.internals.positionAbsolute:Jf(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)}},pp=(e,t)=>up(cp(lp(e),lp(t))),mp=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},hp=(e,t)=>mp(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),gp=e=>_p(e.width)&&_p(e.height)&&_p(e.x)&&_p(e.y),_p=e=>!isNaN(e)&&isFinite(e),vp=(e,t)=>(e,t)=>{},yp=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),bp=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?yp(s,o):s},xp=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Sp(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(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Cp(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=Sp(e,n),i=Sp(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=Sp(e.top??e.y??0,n),i=Sp(e.bottom??e.y??0,n),a=Sp(e.left??e.x??0,t),o=Sp(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 wp(e,t,n,r,i,a){let{x:o,y:s}=xp(e,[t,n,r]),{x:c,y:l}=xp({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 Tp=(e,t,n,r,i,a)=>{let o=Cp(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=rp(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=wp(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}},Ep=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function Dp(e){return e!=null&&e!==`parent`}function Op(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function kp(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Ap(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 jp(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Mp(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function Np(e){return{...Rf,...e||{}}}function Pp(e){return e===null?null:e?`valid`:`invalid`}function Fp(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=Vp(e),s=bp({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?yp(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var Ip=e=>({width:e.offsetWidth,height:e.offsetHeight}),Lp=e=>e?.getRootNode?.()||window?.document,Rp=[`INPUT`,`SELECT`,`TEXTAREA`];function zp(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?Rp.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var Bp=e=>`clientX`in e,Vp=(e,t)=>{let n=Bp(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)}},Hp=(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,...Ip(t)}})};function Up({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 Wp(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Gp({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Q.Left:return[t-Wp(t-r,a),n];case Q.Right:return[t+Wp(r-t,a),n];case Q.Top:return[t,n-Wp(n-i,a)];case Q.Bottom:return[t,n+Wp(i-n,a)]}}function Kp({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:i,targetPosition:a=Q.Top,curvature:o=.25}){let[s,c]=Gp({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=Gp({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=Up({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 qp({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 Jp({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 Yp({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=cp(fp(e),fp(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),hp({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},up(a))>0}var Xp=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,Zp=(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)),Qp=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,Ff.error006()),t;let r=n.getEdgeId||Xp,i;return i=Gf(e)?{...e}:{...e,id:r(e)},Zp(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function $p({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=qp({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var em={[Q.Left]:{x:-1,y:0},[Q.Right]:{x:1,y:0},[Q.Top]:{x:0,y:-1},[Q.Bottom]:{x:0,y:1}},tm=({source:e,sourcePosition:t=Q.Bottom,target:n})=>t===Q.Left||t===Q.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},nm=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function rm({source:e,sourcePosition:t=Q.Bottom,target:n,targetPosition:r=Q.Top,center:i,offset:a,stepPosition:o}){let s=em[t],c=em[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=tm({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]=qp({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 im(e,t,n,r){let i=Math.min(nm(e,t)/2,nm(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 am({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:i,targetPosition:a=Q.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=rm({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+=im(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 om(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function sm(e){let{sourceNode:t,targetNode:n}=e;if(!om(t)||!om(n))return null;let r=t.internals.handleBounds||cm(t.handles),i=n.internals.handleBounds||cm(n.handles),a=um(r?.source??[],e.sourceHandle),o=um(e.connectionMode===zf.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,Ff.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||Q.Bottom,c=o?.position||Q.Top,l=lm(t,a,s),u=lm(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function cm(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 lm(e,t,n=Q.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??Op(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case Q.Top:return{x:i+o/2,y:a};case Q.Right:return{x:i+o,y:a+s/2};case Q.Bottom:return{x:i+o/2,y:a+s};case Q.Left:return{x:i,y:a+s/2}}}function um(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function dm(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function fm(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=dm(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 pm=1e3,mm=10,hm={nodeOrigin:[0,0],nodeExtent:If,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},gm={...hm,checkEquality:!0};function _m(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function vm(e,t,n){let r=_m(hm,n);for(let n of e.values())if(n.parentId)Cm(n,e,t,r);else{let e=ip(Jf(n,r.nodeOrigin),Dp(n.extent)?n.extent:r.nodeExtent,Op(n));n.internals.positionAbsolute=e}}function ym(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 bm(e){return e===`manual`}function xm(e,t,n,r={}){let i=_m(gm,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!bm(i.zIndexMode)?pm: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=ip(Jf(u,i.nodeOrigin),Dp(u.extent)?u.extent:i.nodeExtent,Op(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:ym(u,e),z:wm(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&&Cm(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function Sm(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 Cm(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=_m(hm,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}Sm(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*mm),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=Tm(e,u,o,s,a&&!bm(c)?pm: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 wm(e,t,n){let r=_p(e.zIndex)?e.zIndex:0;return bm(n)?r:r+(e.selected?t:0)}function Tm(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=Op(e),l=Jf(e,n),u=Dp(e.extent)?ip(l,e.extent,c):l,d=ip({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=ap(d,c,t));let f=wm(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function Em(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=pp(a.get(n.parentId)?.expandedRect??dp(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=Op(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 Dm(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=Ip(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=Dp(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=ap(h,s,n))}else m&&(h=ip(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:Hp(`source`,r.nodeElement,p,d,e.id),target:Hp(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&Cm(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:dp(g,i)}))}}if(f.length>0){let e=Em(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function Om({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function km(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 Am(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}`;km(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),km(`target`,s,c,e,i,o),t.set(r.id,r)}}function jm(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:jm(n,t):!1}function Mm(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 Nm(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!jm(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 Pm({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 Fm({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=yp(a,t);return{x:o.x-a.x,y:o.y-a.y}}function Im({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=rl(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?lp(Xf(s)):null,x=v&&l?Fm({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)}:yp(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}=tp({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]=Pm({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]=sp(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=Fp(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=Nm(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=Pm({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=vl().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=Fp(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=Vp(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=Fp(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=Vp(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=Vp(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p)p&&s.size>0&&t().updateNodePositions(s,!1);else if(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]=Pm({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||!Mm(t,`.${g}`,v))&&(!_||Mm(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function Lm(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())hp(i,dp(e))>0&&r.push(e);return r}var Rm=250;function zm(e,t,n,r){let i=[],a=1/0,o=Lm(e,n,t+Rm);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}=lm(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 Bm(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,...lm(o,c,c.position,!0)}:c}function Vm(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Hm(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var Um=()=>!0;function Wm(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:_=Um,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=Lp(e.target),E=0,D,{x:O,y:k}=Vp(e),A=Vm(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let ee=Bm(i,A,r,c,t);if(!ee)return;let N=Vp(e,j),P=!1,te=null,ne=!1,re=null;function F(){if(!u||!j)return;let[e,t]=sp(N,j,S);f({x:e,y:t}),E=requestAnimationFrame(F)}let I={...ee,nodeId:i,type:A,position:ee.position},ie=c.get(i),ae={inProgress:!0,isValid:null,from:lm(ie,I,Q.Left,!0),fromHandle:I,fromPosition:I.position,fromNode:ie,to:N,toHandle:null,toPosition:Wf[I.position],toNode:null,pointer:N};function oe(){M=!0,y(ae),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&oe();function se(e){if(!M){let{x:t,y:n}=Vp(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;oe()}if(!x()||!I){ce(e);return}let a=b();N=Vp(e,j),D=zm(bp(N,a,!1,[1,1]),n,c,I),P||=(F(),!0);let s=Gm(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});re=s.handleDomNode,te=s.connection,ne=Hm(!!D,s.isValid);let u=c.get(i),f=u?lm(u,I,Q.Left,!0):ae.from,p={...ae,from:f,isValid:ne,to:s.toHandle&&ne?xp({x:s.toHandle.x,y:s.toHandle.y},a):N,toHandle:s.toHandle,toPosition:ne&&s.toHandle?s.toHandle.position:Wf[I.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:N};y(p),ae=p}function ce(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||re)&&te&&ne&&h?.(te);let{inProgress:t,...n}=ae,r={...n,toPosition:ae.toHandle?ae.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),P=!1,ne=!1,te=null,re=null,T.removeEventListener(`mousemove`,se),T.removeEventListener(`mouseup`,ce),T.removeEventListener(`touchmove`,se),T.removeEventListener(`touchend`,ce)}}T.addEventListener(`mousemove`,se),T.addEventListener(`mouseup`,ce),T.addEventListener(`touchmove`,se),T.addEventListener(`touchend`,ce)}function Gm(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=Um,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}=Vp(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=Vm(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===zf.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=Bm(t,e,a,u,n,!0)}return _}var Km={onPointerDown:Wm,isValid:Gm};function qm({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=rl(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&&Ep()?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=Pf().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:al}}var Jm=e=>({x:e.x,y:e.y,zoom:e.k}),Ym=({x:e,y:t,zoom:n})=>wf.translate(e,t).scale(n),Xm=(e,t)=>e.target.closest(`.${t}`),Zm=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Qm=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,$m=(e,t=0,n=Qm,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},eh=e=>{let t=e.ctrlKey&&Ep()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function th({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(Xm(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=al(u),t=d*2**eh(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===Bf.Vertical?0:u.deltaX*f,m=i===Bf.Horizontal?0:u.deltaY*f;!Ep()&&u.shiftKey&&i!==Bf.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=Jm(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function nh({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=Xm(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function rh({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=Jm(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 ih({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&Zm(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,Jm(a.transform))}}function ah({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&Zm(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=Jm(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function oh({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:c,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{let p=t||n,m=r&&f.ctrlKey,h=f.type===`wheel`;if(f.button===1&&f.type===`mousedown`&&(Xm(f,`${u}-flow__node`)||Xm(f,`${u}-flow__edge`)||Xm(f,`${u}-flow__selection`)||Xm(f,`${u}-flow__nodesselection`)))return!0;if(!i&&!p&&!a&&!o&&!r||s||d&&!h||Xm(f,c)&&h||Xm(f,l)&&(!h||a&&h&&!t)||!r&&f.ctrlKey&&h)return!1;if(!r&&f.type===`touchstart`&&f.touches?.length>1)return f.preventDefault(),!1;if(!p&&!a&&!m&&h||!i&&(f.type===`mousedown`||f.type===`touchstart`)||Array.isArray(i)&&!i.includes(f.button)&&f.type===`mousedown`)return!1;let g=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||h||e)&&g}}function sh({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:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]];(typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null)?.observe(e);let f=Pf().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=rl(e).call(f);y({x:i.x,y:i.y,zoom:rp(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(eh);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?bu:Pu).transform($m(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function _({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:g,preventScrolling:_,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,panActivationKeyPressed:S=!1,zoomActivationKeyPressed:C,lib:w,onTransformChange:T,connectionInProgress:E,paneClickDistance:D,selectionOnDrag:O}){r&&!l.isZoomingOrPanning&&v();let k=i&&!C&&!r;f.clickDistance(O?1/0:!_p(D)||D<0?0:D);let A=k?th({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):nh({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,A,{passive:!1});let j=rh({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,j);let M=ih({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:T});f.on(`zoom`,M);let ee=ah({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,ee);let N=oh({panActivationKeyPressed:S,zoomActivationKeyPressed:C,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:w,connectionInProgress:E});f.filter(N),x?p.on(`dblclick.zoom`,h):p.on(`dblclick.zoom`,null)}function v(){f.on(`zoom`,null)}async function y(e,t,n){let r=Ym(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=Ym(e);return await g(n,t),n}function x(e){if(p){let t=Ym(e),n=p.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&f?.transform(p,t,null,{sync:!0})}}function S(){let e=p?Tf(p.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function C(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?bu:Pu).scaleTo($m(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?bu:Pu).scaleBy($m(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function T(e){f?.scaleExtent(e)}function E(e){f?.translateExtent(e)}function D(e){let t=!_p(e)||e<0?0:e;f?.clickDistance(t)}return{update:_,destroy:v,setViewport:b,setViewportConstrained:y,getViewport:S,scaleTo:C,scaleBy:w,setScaleExtent:T,setTranslateExtent:E,syncViewport:x,setClickDistance:D}}var ch;(function(e){e.Line=`line`,e.Handle=`handle`})(ch||={});function lh({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 uh(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 dh(e,t){return Math.max(0,t-e)}function fh(e,t){return Math.max(0,e-t)}function ph(e,t,n){return Math.max(0,t-e,e-n)}function mh(e,t){return e?!t:t}function hh(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=ph(E,h,g),j=ph(D,_,v);if(o){let e=0,t=0;c&&w<0?e=dh(y+w+O,o[0][0]):!c&&w>0&&(e=fh(y+E+O,o[1][0])),l&&T<0?t=dh(b+T+k,o[0][1]):!l&&T>0&&(t=fh(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=fh(y+w,s[0][0]):!c&&w<0&&(e=dh(y+E,s[1][0])),l&&T>0?t=fh(b+T,s[0][1]):!l&&T<0&&(t=dh(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=ph(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?fh(b+k+E/C,o[1][1])*C:dh(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?dh(b+E/C,s[1][1])*C:fh(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=ph(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?fh(y+D*C+O,o[1][0])/C:dh(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?dh(y+D*C,s[1][0])/C:fh(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=(mh(c,l)?-w:w)/C:w=(mh(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let M=c?y+w:y,ee=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)+ee}}var gh={width:0,height:0,x:0,y:0},_h={...gh,pointerX:0,pointerY:0,aspectRatio:1};function vh(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 yh({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=rl(e),o={controlDirection:uh(`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={...gh},h={..._h};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:uh(e)};let g,_=null,v=[],y,b,x,S=vl().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}=Fp(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,b=Dp(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),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=vh(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=Fp(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:S,height:C}=m,w={},T=g.origin??s,{width:E,height:D,x:O,y:k}=hh(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,T,b,x),A=E!==S,j=D!==C,M=O!==u&&A,ee=k!==f&&j;if(!M&&!ee&&!A&&!j)return;let N={prevValues:{...m},startX:h.x,startY:h.y,childNodes:v.map(e=>({...e,position:{...e.position}}))};if((M||ee||T[0]===1||T[1]===1)&&(w.x=M?O:m.x,w.y=ee?k:m.y,m.x=w.x,m.y=w.y,v.length>0)){let e=O-u,t=k-f;for(let n of v)n.position={x:n.position.x-e+T[0]*(E-S),y:n.position.y-t+T[1]*(D-C)},l.push(n)}if((A||j)&&(w.width=A&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?E:m.width,w.height=j&&(!o.resizeDirection||o.resizeDirection===`vertical`)?D:m.height,m.width=w.width,m.height=w.height),y&&g.expandParent){let e=T[0]*(w.width??0);w.x&&w.x<e&&(m.x=e,h.x-=w.x-e);let t=T[1]*(w.height??0);w.y&&w.y<t&&(m.y=t,h.y-=w.y-t)}let P=lh({width:m.width,prevWidth:S,height:m.height,prevHeight:C,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),te={...m,direction:P};p?.(e,te)===!1?(m=N.prevValues,h.x=N.startX,h.y=N.startY,v.forEach((e,t)=>{e.position=N.childNodes[t].position})):(d?.(e,te),r(w,l))}).on(`end`,e=>{f?.(e,{...m}),i?.({...m})});a.call(S)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var bh=o((e=>{var t=u();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 d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),xh=o(((e,t)=>{t.exports=bh()})),Sh=o((e=>{var t=u(),n=xh();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}})),Ch=c(o(((e,t)=>{t.exports=Sh()}))(),1),wh=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},Th=e=>e?wh(e):wh,{useDebugValue:Eh}=S.default,{useSyncExternalStoreWithSelector:Dh}=Ch.default,Oh=e=>e;function kh(e,t=Oh,n){let r=Dh(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Eh(r),r}var Ah=(e,t)=>{let n=Th(e),r=(e,r=t)=>kh(n,e,r);return Object.assign(r,n),r},jh=(e,t)=>e?Ah(e,t):Ah;function Mh(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 Nh=(0,S.createContext)(null),Ph=Nh.Provider,Fh=Ff.error001(`react`);function $(e,t){let n=(0,S.useContext)(Nh);if(n===null)throw Error(Fh);return kh(n,e,t)}function Ih(){let e=(0,S.useContext)(Nh);if(e===null)throw Error(Fh);return(0,S.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var Lh={display:`none`},Rh={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},zh=`react-flow__node-desc`,Bh=`react-flow__edge-desc`,Vh=`react-flow__aria-live`,Hh=e=>e.ariaLiveMessage,Uh=e=>e.ariaLabelConfig;function Wh({rfId:e}){let t=$(Hh);return(0,K.jsx)(`div`,{id:`${Vh}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:Rh,children:t})}function Gh({rfId:e,disableKeyboardA11y:t}){let n=$(Uh);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{id:`${zh}-${e}`,style:Lh,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,K.jsx)(`div`,{id:`${Bh}-${e}`,style:Lh,children:n[`edge.a11yDescription.default`]}),!t&&(0,K.jsx)(Wh,{rfId:e})]})}var Kh=(0,S.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>{let o=`${e}`.split(`-`);return(0,K.jsx)(`div`,{className:Qo([`react-flow__panel`,n,...o]),style:r,ref:a,...i,children:t})});Kh.displayName=`Panel`;var qh=`https://reactflow.dev?utm_source=attribution`;function Jh({proOptions:e,position:t=`bottom-right`}){return(0,S.useEffect)(()=>{},[]),e?.hideAttribution?null:(0,K.jsx)(Kh,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${qh}`,children:(0,K.jsx)(`a`,{href:qh,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var Yh=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}},Xh=e=>e.id;function Zh(e,t){return Mh(e.selectedNodes.map(Xh),t.selectedNodes.map(Xh))&&Mh(e.selectedEdges.map(Xh),t.selectedEdges.map(Xh))}function Qh({onSelectionChange:e}){let t=Ih(),{selectedNodes:n,selectedEdges:r}=$(Yh,Zh);return(0,S.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var $h=e=>!!e.onSelectionChangeHandlers;function eg({onSelectionChange:e}){let t=$($h);return e||t?(0,K.jsx)(Qh,{onSelectionChange:e}):null}var tg=[0,0],ng={x:0,y:0,zoom:1},rg=[...`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`],ig=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}),ag={translateExtent:If,nodeOrigin:tg,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function og(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=$(ig,Mh),l=Ih();(0,S.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=ag,s()}),[]);let u=(0,S.useRef)(ag);return(0,S.useEffect)(()=>{for(let s of rg){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:Np(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},rg.map(t=>e[t])),null}function sg(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function cg(e){let[t,n]=(0,S.useState)(e===`system`?null:e);return(0,S.useEffect)(()=>{if(e!==`system`){n(e);return}let t=sg(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?sg()?.matches?`dark`:`light`:t}var lg=typeof document<`u`?document:null;function ug(e=null,t={target:lg,actInsideInputWithModifier:!0}){let[n,r]=(0,S.useState)(!1),i=(0,S.useRef)(!1),a=(0,S.useRef)(new Set([])),[o,s]=(0,S.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(/\+/g,`
|
|
13
|
+
`).replace(`
|
|
14
|
+
|
|
15
|
+
`,`
|
|
16
|
+
+`).split(`
|
|
17
|
+
`));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,S.useEffect)(()=>{let n=t?.target??lg,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)&&zp(e))return!1;let n=fg(e.code,s);if(a.current.add(e[n]),dg(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=fg(e.code,s);dg(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 dg(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function fg(e,t){return t.includes(e)?`code`:`key`}var pg=()=>{let e=Ih();return(0,S.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!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),!0):!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=Tp(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!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 bp(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=xp(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function mg(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)hg(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 hg(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)}}function gg(e,t){return mg(e,t)}function _g(e,t){return mg(e,t)}function vg(e,t){return{id:e,type:`select`,selected:t}}function yg(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(vg(a.id,e)))}return r}function bg({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 xg(e){return{id:e.id,type:`remove`}}var Sg=vp(`React Flow`,`https://reactflow.dev/`);function Cg(e,t,n={}){return Qp(e,t,{...n,onError:n.onError??Sg})}var wg=e=>Kf(e),Tg=e=>Gf(e);function Eg(e){return(0,S.forwardRef)(e)}var Dg=typeof window<`u`?S.useLayoutEffect:S.useEffect;function Og(e){let[t,n]=(0,S.useState)(BigInt(0)),[r]=(0,S.useState)(()=>kg(()=>n(e=>e+BigInt(1))));return Dg(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function kg(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var Ag=(0,S.createContext)(null);function jg({children:e}){let t=Ih(),n=Og((0,S.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=bg({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=Og((0,S.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(bg({items:s,lookup:o}))},[])),i=(0,S.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,K.jsx)(Ag.Provider,{value:i,children:e})}function Mg(){let e=(0,S.useContext)(Ag);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var Ng=e=>!!e.panZoom;function Pg(){let e=pg(),t=Ih(),n=Mg(),r=$(Ng),i=(0,S.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=wg(e)?e:n.get(e.id),a=i.parentId?Ap(i.position,i.measured,i.parentId,n,r):i.position;return dp({...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&&wg(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&&Tg(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 np({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(xg);o?.(f),c(e)}if(m){let e=d.map(xg);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=gp(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=dp(s?r:a),l=hp(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=gp(e)?e:a(e);if(!r)return!1;let i=hp(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 Yf(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??Mp();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,S.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var Fg=e=>e.selected,Ig=typeof window<`u`?window:void 0;function Lg({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=Ih(),{deleteElements:r}=Pg(),i=ug(e,{actInsideInputWithModifier:!1}),a=ug(t,{target:Ig});(0,S.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(Fg),edges:e.filter(Fg)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,S.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function Rg(e){let t=Ih();(0,S.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=Ip(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,Ff.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 zg={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},Bg=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function Vg({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:i,panOnScrollSpeed:a=.5,panOnScrollMode:o=Bf.Free,zoomOnDoubleClick:s=!0,panOnDrag:c=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:p,preventScrolling:m=!0,children:h,noWheelClassName:g,noPanClassName:_,onViewportChange:v,isControlledViewport:y,paneClickDistance:b,selectionOnDrag:x}){let C=Ih(),w=(0,S.useRef)(null),{userSelectionActive:T,lib:E,connectionInProgress:D}=$(Bg,Mh),O=ug(p),k=(0,S.useRef)();Rg(w);let A=(0,S.useCallback)(e=>{v?.({x:e[0],y:e[1],zoom:e[2]}),y||C.setState({transform:e})},[v,y]);return(0,S.useEffect)(()=>{if(w.current){k.current=sh({domNode:w.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:l,onDraggingChange:e=>C.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=C.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=C.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=C.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=k.current.getViewport();return C.setState({panZoom:k.current,transform:[e,t,n],domNode:w.current.closest(`.react-flow`)}),()=>{k.current?.destroy()}}},[]),(0,S.useEffect)(()=>{k.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:i,panOnScrollSpeed:a,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:c,zoomActivationKeyPressed:O,preventScrolling:m,noPanClassName:_,userSelectionActive:T,noWheelClassName:g,lib:E,onTransformChange:A,connectionInProgress:D,selectionOnDrag:x,paneClickDistance:b})},[e,t,n,r,i,a,o,s,c,O,m,_,T,g,E,A,D,x,b]),(0,K.jsx)(`div`,{className:`react-flow__renderer`,ref:w,style:zg,children:h})}var Hg=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Ug(){let{userSelectionActive:e,userSelectionRect:t}=$(Hg,Mh);return e&&t?(0,K.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 Wg=(e,t)=>n=>{n.target===t.current&&e?.(n)},Gg=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function Kg({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Vf.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:c,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:m,children:h}){let g=(0,S.useRef)(0),_=Ih(),{userSelectionActive:v,elementsSelectable:y,dragging:b,panBy:x,autoPanSpeed:C}=$(Gg,Mh),w=y&&(e||v),T=(0,S.useRef)(null),E=(0,S.useRef)(),D=(0,S.useRef)(new Set),O=(0,S.useRef)(new Set),k=(0,S.useRef)(!1),A=(0,S.useRef)(!1),j=(0,S.useRef)({x:0,y:0}),M=(0,S.useRef)(!1),ee=e=>{A.current||k.current||_.getState().connection.inProgress?(A.current=!1,k.current=!1):(l?.(e),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1}))},N=e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():u?.(e)},P=d?e=>d(e):void 0,te=e=>{A.current&&=(e.stopPropagation(),!1)},ne=n=>{if(n.pointerType===`touch`&&r!==!1&&!t)return;let{domNode:i,transform:a}=_.getState();if(E.current=i?.getBoundingClientRect(),!E.current)return;let s=n.target===T.current;if(!s&&n.target.closest(`.nokey`)||!e||!(o&&s||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),A.current=!1;let{x:c,y:l}=Vp(n.nativeEvent,E.current),u=bp({x:c,y:l},a);_.setState({userSelectionRect:{width:0,height:0,startX:u.x,startY:u.y,x:c,y:l}}),s||(n.stopPropagation(),n.preventDefault())};function re(e,t){let{userSelectionRect:r}=_.getState();if(!r)return;let{transform:i,nodeLookup:a,edgeLookup:o,connectionLookup:s,triggerNodeChanges:c,triggerEdgeChanges:l,defaultEdgeOptions:u}=_.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=xp(d,i),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},h=D.current,g=O.current;D.current=new Set(Zf(a,m,i,n===Vf.Partial,!0).map(e=>e.id)),O.current=new Set;let v=u?.selectable??!0;for(let e of D.current){let t=s.get(e);if(t)for(let{edgeId:e}of t.values()){let t=o.get(e);t&&(t.selectable??v)&&O.current.add(e)}}jp(h,D.current)||c(yg(a,D.current,!0)),jp(g,O.current)||l(yg(o,O.current)),_.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function F(){if(!i||!E.current)return;let[e,t]=sp(j.current,E.current,C);x({x:e,y:t}).then(e=>{if(!A.current||!e){g.current=requestAnimationFrame(F);return}let{x:t,y:n}=j.current;re(t,n),g.current=requestAnimationFrame(F)})}let I=()=>{cancelAnimationFrame(g.current),g.current=0,M.current=!1};(0,S.useEffect)(()=>()=>I(),[]);let ie=e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=_.getState();if(!E.current||!n)return;let{x:o,y:c}=Vp(e.nativeEvent,E.current);j.current={x:o,y:c};let l=xp({x:n.startX,y:n.startY},r);if(!A.current){let n=t?0:a;if(Math.hypot(o-l.x,c-l.y)<=n)return;i(),s?.(e)}A.current=!0,M.current||=(F(),!0),re(o,c)},ae=e=>{w?e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!v&&e.target===T.current&&_.getState().userSelectionRect&&ee?.(e),_.setState({userSelectionActive:!1,userSelectionRect:null}),A.current&&(c?.(e),_.setState({nodesSelectionActive:D.current.size>0})),I()):e.target===T.current&&_.getState().connection.inProgress&&(k.current=!0)},oe=e=>{e.target?.releasePointerCapture?.(e.pointerId),I()},se=r===!0||Array.isArray(r)&&r.includes(0);return(0,K.jsxs)(`div`,{className:Qo([`react-flow__pane`,{draggable:se,dragging:b,selection:e}]),onClick:w?void 0:Wg(ee,T),onContextMenu:Wg(N,T),onWheel:Wg(P,T),onPointerEnter:w?void 0:f,onPointerMove:w?ie:p,onPointerUp:ae,onPointerCancel:w?oe:void 0,onPointerDownCapture:w?ne:void 0,onClickCapture:w?te:void 0,onPointerLeave:m,ref:T,style:zg,children:[h,(0,K.jsx)(Ug,{})]})}function qg({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);l?(t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])):c?.(`012`,Ff.error012(e))}function Jg({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=Ih(),[c,l]=(0,S.useState)(!1),u=(0,S.useRef)();return(0,S.useEffect)(()=>{if(!t)return u.current=Im({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{qg({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,s,e]),(0,S.useEffect)(()=>{!t&&e.current&&u.current&&u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o})},[n,r,t,a,e,i,o]),c}var Yg=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function Xg(){let e=Ih();return(0,S.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=Yg(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=yp(t,i));let{position:a,positionAbsolute:s}=tp({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,S.createContext)(null),Qg=Zg.Provider;Zg.Consumer;var $g=()=>(0,S.useContext)(Zg),e_=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),t_=(0,S.createContext)(null);function n_({children:e}){let t=$(e_,Mh);return(0,K.jsx)(t_.Provider,{value:t,children:e})}function r_(){let e=(0,S.useContext)(t_);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var i_={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},a_=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return i_;let 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===zf.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function o_({type:e=`source`,position:t=Q.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=Ih(),_=$g(),{connectOnClick:v,noPanClassName:y,rfId:b}=r_(),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=$(a_(_,m,e),Mh);_||g.getState().onError?.(`010`,Ff.error010());let O=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=g.getState();t(Cg(i,e,{onError:n}))}n?.(i),s?.(i)},k=e=>{if(!_)return;let t=Bp(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();Km.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,K.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:Qo([`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=Lp(t.target),h=n||c,{connection:v,isValid:y}=Km.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 s_=(0,S.memo)(Eg(o_));function c_({data:e,isConnectable:t,sourcePosition:n=Q.Bottom}){return(0,K.jsxs)(K.Fragment,{children:[e?.label,(0,K.jsx)(s_,{type:`source`,position:n,isConnectable:t})]})}function l_({data:e,isConnectable:t,targetPosition:n=Q.Top,sourcePosition:r=Q.Bottom}){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(s_,{type:`target`,position:n,isConnectable:t}),e?.label,(0,K.jsx)(s_,{type:`source`,position:r,isConnectable:t})]})}function u_(){return null}function d_({data:e,isConnectable:t,targetPosition:n=Q.Top}){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(s_,{type:`target`,position:n,isConnectable:t}),e?.label]})}var f_={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},p_={input:c_,default:l_,output:d_,group:u_};function m_(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 h_=e=>{let{width:t,height:n,x:r,y:i}=Xf(e.nodeLookup,{filter:e=>!!e.selected});return{width:_p(t)?t:null,height:_p(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 g_({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=Ih(),{width:i,height:a,transformString:o,userSelectionActive:s}=$(h_,Mh),c=Xg(),l=(0,S.useRef)(null);(0,S.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(Jg({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,K.jsx)(`div`,{className:Qo([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,K.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(f_,e.key)&&(e.preventDefault(),c({direction:f_[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var __=typeof window<`u`?window:void 0,v_=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function y_({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,autoPanOnSelection:T,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,preventScrolling:A,onSelectionContextMenu:j,noWheelClassName:M,noPanClassName:ee,disableKeyboardA11y:N,onViewportChange:P,isControlledViewport:te}){let{nodesSelectionActive:ne,userSelectionActive:re}=$(v_,Mh),F=ug(l,{target:__}),I=ug(h,{target:__}),ie=I||w,ae=I||b,oe=u&&ie!==!0,se=F||re||oe;return Lg({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,K.jsx)(Vg,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:ae,panActivationKeyPressed:I,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!F&&ie,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,zoomActivationKeyCode:g,preventScrolling:A,noWheelClassName:M,noPanClassName:ee,onViewportChange:P,isControlledViewport:te,paneClickDistance:s,selectionOnDrag:oe,children:(0,K.jsxs)(Kg,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:ie,autoPanOnSelection:T,isSelecting:!!se,selectionMode:d,selectionKeyPressed:F,paneClickDistance:s,selectionOnDrag:oe,children:[e,ne&&(0,K.jsx)(g_,{onSelectionContextMenu:j,noPanClassName:ee,disableKeyboardA11y:N})]})})}y_.displayName=`FlowRenderer`;var b_=(0,S.memo)(y_),x_=e=>t=>e?Zf(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 S_(e){return $((0,S.useCallback)(x_(e),[e]),Mh)}var C_=e=>e.updateNodeInternals;function w_(){let e=$(C_),[t]=(0,S.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,S.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function T_({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=Ih(),a=(0,S.useRef)(null),o=(0,S.useRef)(null),s=(0,S.useRef)(e.sourcePosition),c=(0,S.useRef)(e.targetPosition),l=(0,S.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,S.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,S.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,S.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 E_({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}=$(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},Mh),S=y.type||`default`,C=g?.[S]||p_[S];C===void 0&&(v?.(`003`,Ff.error003(S)),S=`default`,C=g?.default||p_.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=Ih(),k=kp(y),A=T_({node:y,nodeType:S,hasDimensions:k,resizeObserver:d}),j=Jg({nodeRef:A,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),M=Xg();if(y.hidden)return null;let ee=Op(y),N=m_(y),P=T||w||t||n||r||i,te=n?e=>n(e,{...b.userNode}):void 0,ne=r?e=>r(e,{...b.userNode}):void 0,re=i?e=>i(e,{...b.userNode}):void 0,F=a?e=>a(e,{...b.userNode}):void 0,I=o?e=>o(e,{...b.userNode}):void 0,ie=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=O.getState();T&&(!r||!w||i>0)&&qg({id:e,store:O,nodeRef:A}),t&&t(n,{...b.userNode})},ae=t=>{if(!(zp(t.nativeEvent)||m)){if(Lf.includes(t.key)&&T){let n=t.key===`Escape`;qg({id:e,store:O,unselect:n,nodeRef:A})}else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(f_,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:f_[t.key],factor:t.shiftKey?4:1})}}},oe=()=>{if(m||!A.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=O.getState();i&&(Zf(new Map([[e,y]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(y.position.x+ee.width/2,y.position.y+ee.height/2,{zoom:t[2]}))};return(0,K.jsx)(`div`,{className:Qo([`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:P?`all`:`none`,visibility:k?`visible`:`hidden`,...y.style,...N},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:te,onMouseMove:ne,onMouseLeave:re,onContextMenu:F,onClick:ie,onDoubleClick:I,onKeyDown:D?ae:void 0,tabIndex:D?0:void 0,onFocus:D?oe:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${zh}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:(0,K.jsx)(Qg,{value:e,children:(0,K.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,...ee})})})}var D_=(0,S.memo)(E_),O_=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function k_(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=$(O_,Mh),a=S_(e.onlyRenderVisibleElements),o=w_();return(0,K.jsx)(`div`,{className:`react-flow__nodes`,style:zg,children:a.map(a=>(0,K.jsx)(D_,{id:a,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:o,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}k_.displayName=`NodeRenderer`;var A_=(0,S.memo)(k_);function j_(e){return $((0,S.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&&Yp({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),Mh)}var M_=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return(0,K.jsx)(`polyline`,{className:`arrow`,style:n,strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`})},N_=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,K.jsx)(`polyline`,{className:`arrowclosed`,style:n,strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`})},P_={[Uf.Arrow]:M_,[Uf.ArrowClosed]:N_};function F_(e){let t=Ih();return(0,S.useMemo)(()=>Object.prototype.hasOwnProperty.call(P_,e)?P_[e]:(t.getState().onError?.(`009`,Ff.error009(e)),null),[e])}var I_=({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=F_(t);return c?(0,K.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,K.jsx)(c,{color:n,strokeWidth:o})}):null},L_=({defaultColor:e,rfId:t})=>{let n=$(e=>e.edges),r=$(e=>e.defaultEdgeOptions),i=(0,S.useMemo)(()=>fm(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,K.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,K.jsx)(`defs`,{children:i.map(e=>(0,K.jsx)(I_,{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};L_.displayName=`MarkerDefinitions`;var R_=(0,S.memo)(L_);function z_({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,S.useState)({x:1,y:0,width:0,height:0}),p=Qo([`react-flow__edge-textwrapper`,l]),m=(0,S.useRef)(null);return(0,S.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,K.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,K.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,K.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}z_.displayName=`EdgeText`;var B_=(0,S.memo)(z_);function V_({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`path`,{...u,d:e,fill:`none`,className:Qo([`react-flow__edge-path`,u.className])}),l?(0,K.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&_p(t)&&_p(n)?(0,K.jsx)(B_,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function H_({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Q.Left||e===Q.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function U_({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:r,targetY:i,targetPosition:a=Q.Top}){let[o,s]=H_({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=H_({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=Up({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 W_(e){return(0,S.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]=U_({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s}),x=e.isInternal?void 0:t;return(0,K.jsx)(V_,{id:x,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 G_=W_({isInternal:!1}),K_=W_({isInternal:!0});G_.displayName=`SimpleBezierEdge`,K_.displayName=`SimpleBezierEdgeInternal`;function q_(e){return(0,S.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=Q.Bottom,targetPosition:m=Q.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=am({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition}),S=e.isInternal?void 0:t;return(0,K.jsx)(V_,{id:S,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 J_=q_({isInternal:!1}),Y_=q_({isInternal:!0});J_.displayName=`SmoothStepEdge`,Y_.displayName=`SmoothStepEdgeInternal`;function X_(e){return(0,S.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,K.jsx)(J_,{...n,id:r,pathOptions:(0,S.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var Z_=X_({isInternal:!1}),Q_=X_({isInternal:!0});Z_.displayName=`StepEdge`,Q_.displayName=`StepEdgeInternal`;function $_(e){return(0,S.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]=$p({sourceX:n,sourceY:r,targetX:i,targetY:a}),y=e.isInternal?void 0:t;return(0,K.jsx)(V_,{id:y,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 ev=$_({isInternal:!1}),tv=$_({isInternal:!0});ev.displayName=`StraightEdge`,tv.displayName=`StraightEdgeInternal`;function nv(e){return(0,S.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=Q.Bottom,targetPosition:s=Q.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]=Kp({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature}),S=e.isInternal?void 0:t;return(0,K.jsx)(V_,{id:S,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 rv=nv({isInternal:!1}),iv=nv({isInternal:!0});rv.displayName=`BezierEdge`,iv.displayName=`BezierEdgeInternal`;var av={default:iv,straight:tv,step:Q_,smoothstep:Y_,simplebezier:K_},ov={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},sv=(e,t,n)=>n===Q.Left?e-t:n===Q.Right?e+t:e,cv=(e,t,n)=>n===Q.Top?e-t:n===Q.Bottom?e+t:e,lv=`react-flow__edgeupdater`;function uv({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,K.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:Qo([lv,`${lv}-${s}`]),cx:sv(t,r,e),cy:cv(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function dv({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=Ih(),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`;Km.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,K.jsxs)(K.Fragment,{children:[(e===!0||e===`source`)&&(0,K.jsx)(uv,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,K.jsx)(uv,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function fv({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=$(t=>t.edgeLookup.get(e)),b=$(e=>e.defaultEdgeOptions);y=b?{...b,...y}:y;let x=y.type||`default`,C=h?.[x]||av[x];C===void 0&&(_?.(`011`,Ff.error011(x)),x=`default`,C=h?.default||av.default);let w=!!(y.focusable||t&&y.focusable===void 0),T=d!==void 0&&(y.reconnectable||n&&y.reconnectable===void 0),E=!!(y.selectable||r&&y.selectable===void 0),D=(0,S.useRef)(null),[O,k]=(0,S.useState)(!1),[A,j]=(0,S.useState)(!1),M=Ih(),{zIndex:ee=y.zIndex,sourceX:N,sourceY:P,targetX:te,targetY:ne,sourcePosition:re,targetPosition:F}=$((0,S.useCallback)(t=>{let n=t.nodeLookup.get(y.source),r=t.nodeLookup.get(y.target);if(!n||!r)return ov;let i=sm({id:e,sourceNode:n,targetNode:r,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:t.connectionMode,onError:_}),a=Jp({selected:y.selected,zIndex:y.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||ov,zIndex:a}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex,_]),Mh),I=(0,S.useMemo)(()=>y.markerStart?`url('#${dm(y.markerStart,m)}')`:void 0,[y.markerStart,m]),ie=(0,S.useMemo)(()=>y.markerEnd?`url('#${dm(y.markerEnd,m)}')`:void 0,[y.markerEnd,m]);if(y.hidden||N===null||P===null||te===null||ne===null)return null;let ae=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=M.getState();E&&(M.setState({nodesSelectionActive:!1}),y.selected&&a?(r({nodes:[],edges:[y]}),D.current?.blur()):n([e])),i&&i(t,y)},oe=a?e=>{a(e,{...y})}:void 0,se=o?e=>{o(e,{...y})}:void 0,ce=s?e=>{s(e,{...y})}:void 0,le=c?e=>{c(e,{...y})}:void 0,ue=l?e=>{l(e,{...y})}:void 0;return(0,K.jsx)(`svg`,{style:{zIndex:ee},children:(0,K.jsxs)(`g`,{className:Qo([`react-flow__edge`,`react-flow__edge-${x}`,y.className,g,{selected:y.selected,animated:y.animated,inactive:!E&&!i,updating:O,selectable:E}]),onClick:ae,onDoubleClick:oe,onContextMenu:se,onMouseEnter:ce,onMouseMove:le,onMouseLeave:ue,onKeyDown:w?t=>{if(!v&&Lf.includes(t.key)&&E){let{unselectNodesAndEdges:n,addSelectedEdges:r}=M.getState();t.key===`Escape`?(D.current?.blur(),n({edges:[y]})):r([e])}}:void 0,tabIndex:w?0:void 0,role:y.ariaRole??(w?`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":w?`${Bh}-${m}`:void 0,ref:D,...y.domAttributes,children:[!A&&(0,K.jsx)(C,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:E,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:P,targetX:te,targetY:ne,sourcePosition:re,targetPosition:F,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:I,markerEnd:ie,pathOptions:`pathOptions`in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),T&&(0,K.jsx)(dv,{edge:y,isReconnectable:T,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:N,sourceY:P,targetX:te,targetY:ne,sourcePosition:re,targetPosition:F,setUpdateHover:k,setReconnecting:j})]})})}var pv=(0,S.memo)(fv),mv=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function hv({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}=$(mv,Mh),b=j_(t);return(0,K.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,K.jsx)(R_,{defaultColor:e,rfId:n}),b.map(e=>(0,K.jsx)(pv,{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))]})}hv.displayName=`EdgeRenderer`;var gv=(0,S.memo)(hv),_v=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function vv({children:e}){let t=Ih(),n=(0,S.useRef)(null),[r]=(0,S.useState)(()=>t.getState().transform);return Dg(()=>{let e=null,r=()=>{let r=t.getState().transform;e&&r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]||(e=r,n.current&&(n.current.style.transform=_v(r)))};return r(),t.subscribe(r)},[t]),(0,K.jsx)(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:_v(r)},children:e})}function yv(e){let t=Pg(),n=(0,S.useRef)(!1);(0,S.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var bv=e=>e.panZoom?.syncViewport;function xv(e){let t=$(bv),n=Ih();return(0,S.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function Sv(e){return e.connection.inProgress?{...e.connection,to:bp(e.connection.to,e.transform)}:{...e.connection}}function Cv(e){return e?t=>e(Sv(t)):Sv}function wv(e){return $(Cv(e),Mh)}var Tv=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function Ev({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=$(Tv,Mh);return a&&i&&c?(0,K.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,K.jsx)(`g`,{className:Qo([`react-flow__connection`,Pp(s)]),children:(0,K.jsx)(Dv,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var Dv=({style:e,type:t=Z.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}=wv();if(!i)return;if(n)return(0,K.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:Pp(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 Z.Bezier:[m]=Kp(h);break;case Z.SimpleBezier:[m]=U_(h);break;case Z.Step:[m]=am({...h,borderRadius:0});break;case Z.SmoothStep:[m]=am(h);break;default:[m]=$p(h)}return(0,K.jsx)(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};Dv.displayName=`ConnectionLine`;var Ov={};function kv(e=Ov){(0,S.useRef)(e),Ih(),(0,S.useEffect)(()=>{},[e])}function Av(){Ih(),(0,S.useRef)(!1),(0,S.useEffect)(()=>{},[])}function jv({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:ee,zoomOnPinch:N,panOnScroll:P,panOnScrollSpeed:te,panOnScrollMode:ne,zoomOnDoubleClick:re,panOnDrag:F,autoPanOnSelection:I,onPaneClick:ie,onPaneMouseEnter:ae,onPaneMouseMove:oe,onPaneMouseLeave:se,onPaneScroll:ce,onPaneContextMenu:le,paneClickDistance:ue,nodeClickDistance:de,onEdgeContextMenu:fe,onEdgeMouseEnter:pe,onEdgeMouseMove:L,onEdgeMouseLeave:R,reconnectRadius:me,onReconnect:he,onReconnectStart:ge,onReconnectEnd:_e,noDragClassName:ve,noWheelClassName:ye,noPanClassName:be,disableKeyboardA11y:xe,nodeExtent:Se,rfId:Ce,viewport:we,onViewportChange:Te,nodesDraggable:Ee}){return kv(e),kv(t),Av(),yv(n),xv(we),(0,K.jsx)(b_,{onPaneClick:ie,onPaneMouseEnter:ae,onPaneMouseMove:oe,onPaneMouseLeave:se,onPaneContextMenu:le,onPaneScroll:ce,paneClickDistance:ue,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:ee,zoomOnPinch:N,zoomOnDoubleClick:re,panOnScroll:P,panOnScrollSpeed:te,panOnScrollMode:ne,panOnDrag:F,autoPanOnSelection:I,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,onSelectionContextMenu:d,preventScrolling:j,noDragClassName:ve,noWheelClassName:ye,noPanClassName:be,disableKeyboardA11y:xe,onViewportChange:Te,isControlledViewport:!!we,children:(0,K.jsxs)(vv,{children:[(0,K.jsx)(gv,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:he,onReconnectStart:ge,onReconnectEnd:_e,onlyRenderVisibleElements:T,onEdgeContextMenu:fe,onEdgeMouseEnter:pe,onEdgeMouseMove:L,onEdgeMouseLeave:R,reconnectRadius:me,defaultMarkerColor:M,noPanClassName:be,disableKeyboardA11y:xe,rfId:Ce}),(0,K.jsx)(Ev,{style:h,type:m,component:g,containerStyle:_}),(0,K.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,K.jsx)(A_,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:de,onlyRenderVisibleElements:T,noPanClassName:be,noDragClassName:ve,disableKeyboardA11y:xe,nodeExtent:Se,rfId:Ce,nodesDraggable:Ee}),(0,K.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}jv.displayName=`GraphView`;var Mv=(0,S.memo)(jv),Nv=vp(`React Flow`,`https://reactflow.dev/`),Pv=({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??If;Am(h,g,_);let{nodesInitialized:x}=xm(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=Tp(Xf(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:If,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:zf.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:{...Hf},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Nv,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:Rf,zIndexMode:f,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},Fv=({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})=>jh((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 ep({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...Pv({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,nodeExtent:i,elevateNodesOnSelect:a,fitViewQueued:o,zIndexMode:s,nodesSelectionActive:c}=m(),{nodesInitialized:l,hasSelectedNodes:u}=xm(e,t,n,{nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,checkEquality:!0,zIndexMode:s}),d=c&&u;o&&l?(h(),p({nodes:e,nodesInitialized:l,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:d})):p({nodes:e,nodesInitialized:l,nodesSelectionActive:d})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();Am(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}=Dm(e,n,r,i,a,o,l);d&&(vm(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=lm(e,o.fromHandle,Q.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=Em(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(gg(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(_g(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();t?i(e.map(e=>vg(e,!0))):(i(yg(r,new Set([...e]),!0)),a(yg(n)))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();t?a(e.map(e=>vg(e,!0))):(a(yg(n,new Set([...e]))),i(yg(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(vg(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(vg(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,vg(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,vg(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])&&(xm(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 Om({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!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}),!0},cancelConnection:()=>{p({connection:{...Hf}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...Pv()})}},Object.is);function Iv({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,S.useState)(()=>Fv({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,K.jsx)(Ph,{value:m,children:(0,K.jsx)(jg,{children:(0,K.jsx)(n_,{children:p})})})}function Lv({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,S.useContext)(Nh)?(0,K.jsx)(K.Fragment,{children:e}):(0,K.jsx)(Iv,{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 Rv={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function zv({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:C,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onNodesDelete:D,onEdgesDelete:O,onDelete:k,onSelectionChange:A,onSelectionDragStart:j,onSelectionDrag:M,onSelectionDragStop:ee,onSelectionContextMenu:N,onSelectionStart:P,onSelectionEnd:te,onBeforeDelete:ne,connectionMode:re,connectionLineType:F=Z.Bezier,connectionLineStyle:I,connectionLineComponent:ie,connectionLineContainerStyle:ae,deleteKeyCode:oe=`Backspace`,selectionKeyCode:se=`Shift`,selectionOnDrag:ce=!1,selectionMode:le=Vf.Full,panActivationKeyCode:ue=`Space`,multiSelectionKeyCode:de=Ep()?`Meta`:`Control`,zoomActivationKeyCode:fe=Ep()?`Meta`:`Control`,snapToGrid:pe,snapGrid:L,onlyRenderVisibleElements:R=!1,selectNodesOnDrag:me,nodesDraggable:he,autoPanOnNodeFocus:ge,nodesConnectable:_e,nodesFocusable:ve,nodeOrigin:ye=tg,edgesFocusable:be,edgesReconnectable:xe,elementsSelectable:Se=!0,defaultViewport:Ce=ng,minZoom:we=.5,maxZoom:Te=2,translateExtent:Ee=If,preventScrolling:De=!0,nodeExtent:Oe,defaultMarkerColor:ke=`#b1b1b7`,zoomOnScroll:Ae=!0,zoomOnPinch:je=!0,panOnScroll:Me=!1,panOnScrollSpeed:Ne=.5,panOnScrollMode:Pe=Bf.Free,zoomOnDoubleClick:Fe=!0,panOnDrag:Ie=!0,onPaneClick:Le,onPaneMouseEnter:Re,onPaneMouseMove:ze,onPaneMouseLeave:Be,onPaneScroll:Ve,onPaneContextMenu:He,paneClickDistance:Ue=1,nodeClickDistance:We=0,children:Ge,onReconnect:Ke,onReconnectStart:qe,onReconnectEnd:Je,onEdgeContextMenu:Ye,onEdgeDoubleClick:Xe,onEdgeMouseEnter:Ze,onEdgeMouseMove:Qe,onEdgeMouseLeave:$e,reconnectRadius:et=10,onNodesChange:tt,onEdgesChange:nt,noDragClassName:rt=`nodrag`,noWheelClassName:it=`nowheel`,noPanClassName:at=`nopan`,fitView:ot,fitViewOptions:st,connectOnClick:ct,attributionPosition:lt,proOptions:ut,defaultEdgeOptions:dt,elevateNodesOnSelect:ft=!0,elevateEdgesOnSelect:pt=!1,disableKeyboardA11y:mt=!1,autoPanOnConnect:ht,autoPanOnNodeDrag:gt,autoPanOnSelection:_t=!0,autoPanSpeed:vt,connectionRadius:yt,isValidConnection:bt,onError:xt,style:St,id:Ct,nodeDragThreshold:wt,connectionDragThreshold:Tt,viewport:Et,onViewportChange:Dt,width:Ot,height:kt,colorMode:At=`light`,debug:jt,onScroll:Mt,ariaLabelConfig:Nt,zIndexMode:Pt=`basic`,...Ft},It){let Lt=Ct||`1`,Rt=cg(At),zt=(0,S.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),Mt?.(e)},[Mt]);return(0,K.jsx)(`div`,{"data-testid":`rf__wrapper`,...Ft,onScroll:zt,style:{...St,...Rv},ref:It,className:Qo([`react-flow`,i,Rt]),id:Ct,role:`application`,children:(0,K.jsxs)(Lv,{nodes:e,edges:t,width:Ot,height:kt,fitView:ot,fitViewOptions:st,minZoom:we,maxZoom:Te,nodeOrigin:ye,nodeExtent:Oe,zIndexMode:Pt,children:[(0,K.jsx)(og,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:he,autoPanOnNodeFocus:ge,nodesConnectable:_e,nodesFocusable:ve,edgesFocusable:be,edgesReconnectable:xe,elementsSelectable:Se,elevateNodesOnSelect:ft,elevateEdgesOnSelect:pt,minZoom:we,maxZoom:Te,nodeExtent:Oe,onNodesChange:tt,onEdgesChange:nt,snapToGrid:pe,snapGrid:L,connectionMode:re,translateExtent:Ee,connectOnClick:ct,defaultEdgeOptions:dt,fitView:ot,fitViewOptions:st,onNodesDelete:D,onEdgesDelete:O,onDelete:k,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onSelectionDrag:M,onSelectionDragStart:j,onSelectionDragStop:ee,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:at,nodeOrigin:ye,rfId:Lt,autoPanOnConnect:ht,autoPanOnNodeDrag:gt,autoPanSpeed:vt,onError:xt,connectionRadius:yt,isValidConnection:bt,selectNodesOnDrag:me,nodeDragThreshold:wt,connectionDragThreshold:Tt,onBeforeDelete:ne,debug:jt,ariaLabelConfig:Nt,zIndexMode:Pt}),(0,K.jsx)(Mv,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:C,nodeTypes:a,edgeTypes:o,connectionLineType:F,connectionLineStyle:I,connectionLineComponent:ie,connectionLineContainerStyle:ae,selectionKeyCode:se,selectionOnDrag:ce,selectionMode:le,deleteKeyCode:oe,multiSelectionKeyCode:de,panActivationKeyCode:ue,zoomActivationKeyCode:fe,onlyRenderVisibleElements:R,defaultViewport:Ce,translateExtent:Ee,minZoom:we,maxZoom:Te,preventScrolling:De,zoomOnScroll:Ae,zoomOnPinch:je,zoomOnDoubleClick:Fe,panOnScroll:Me,panOnScrollSpeed:Ne,panOnScrollMode:Pe,panOnDrag:Ie,autoPanOnSelection:_t,onPaneClick:Le,onPaneMouseEnter:Re,onPaneMouseMove:ze,onPaneMouseLeave:Be,onPaneScroll:Ve,onPaneContextMenu:He,paneClickDistance:Ue,nodeClickDistance:We,onSelectionContextMenu:N,onSelectionStart:P,onSelectionEnd:te,onReconnect:Ke,onReconnectStart:qe,onReconnectEnd:Je,onEdgeContextMenu:Ye,onEdgeDoubleClick:Xe,onEdgeMouseEnter:Ze,onEdgeMouseMove:Qe,onEdgeMouseLeave:$e,reconnectRadius:et,defaultMarkerColor:ke,noDragClassName:rt,noWheelClassName:it,noPanClassName:at,rfId:Lt,disableKeyboardA11y:mt,nodeExtent:Oe,viewport:Et,onViewportChange:Dt,nodesDraggable:he}),(0,K.jsx)(eg,{onSelectionChange:A}),Ge,(0,K.jsx)(Jh,{proOptions:ut,position:lt}),(0,K.jsx)(Gh,{rfId:Lt,disableKeyboardA11y:mt})]})})}var Bv=Eg(zv),Vv=e=>e.domNode?.querySelector(`.react-flow__edgelabel-renderer`);function Hv({children:e}){let t=$(Vv);return t?(0,ta.createPortal)(e,t):null}var Uv=e=>e.domNode?.querySelector(`.react-flow__viewport-portal`);function Wv({children:e}){let t=$(Uv);return t?(0,ta.createPortal)(e,t):null}var Gv=e=>({x:e.transform[0],y:e.transform[1],zoom:e.transform[2]});function Kv(){return $(Gv,Mh)}function qv(e){let[t,n]=(0,S.useState)(e);return[t,n,(0,S.useCallback)(e=>n(t=>gg(e,t)),[])]}Ff.error014();function Jv(e){return $((0,S.useCallback)(t=>t.nodeLookup.get(e),[e]),Mh)}function Yv({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,K.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Qo([`react-flow__background-pattern`,n,r])})}function Xv({radius:e,className:t}){return(0,K.jsx)(`circle`,{cx:e,cy:e,r:e,className:Qo([`react-flow__background-pattern`,`dots`,t])})}var Zv;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(Zv||={});var Qv={[Zv.Dots]:1,[Zv.Lines]:1,[Zv.Cross]:6},$v=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function ey({id:e,variant:t=Zv.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,S.useRef)(null),{transform:f,patternId:p}=$($v,Mh),m=r||Qv[t],h=t===Zv.Dots,g=t===Zv.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,C=[b[0]*f[2]+x[0]/2,b[1]*f[2]+x[1]/2],w=`${p}${e||``}`;return(0,K.jsxs)(`svg`,{className:Qo([`react-flow__background`,l]),style:{...c,...zg,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,K.jsx)(`pattern`,{id:w,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${C[0]},-${C[1]})`,children:h?(0,K.jsx)(Xv,{radius:y/2,className:u}):(0,K.jsx)(Yv,{dimensions:x,lineWidth:i,variant:t,className:u})}),(0,K.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${w})`})]})}ey.displayName=`Background`,(0,S.memo)(ey);function ty(){return(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,K.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function ny(){return(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,K.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function ry(){return(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,K.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 iy(){return(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,K.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 ay(){return(0,K.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,K.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 oy({children:e,className:t,...n}){return(0,K.jsx)(`button`,{type:`button`,className:Qo([`react-flow__controls-button`,t]),...n,children:e})}var sy=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function cy({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=Ih(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=$(sy,Mh),{zoomIn:y,zoomOut:b,fitView:x}=Pg();return(0,K.jsxs)(Kh,{className:Qo([`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,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(oy,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:(0,K.jsx)(ty,{})}),(0,K.jsx)(oy,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:(0,K.jsx)(ny,{})})]}),n&&(0,K.jsx)(oy,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:(0,K.jsx)(ry,{})}),r&&(0,K.jsx)(oy,{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,K.jsx)(ay,{}):(0,K.jsx)(iy,{})}),u]})}cy.displayName=`Controls`,(0,S.memo)(cy);function ly({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,K.jsx)(`rect`,{className:Qo([`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 uy=(0,S.memo)(ly),dy=e=>e.nodes.map(e=>e.id),fy=e=>e instanceof Function?e:()=>e;function py({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=uy,onClick:o}){let s=$(dy,Mh),c=fy(t),l=fy(e),u=fy(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,K.jsx)(K.Fragment,{children:s.map(e=>(0,K.jsx)(hy,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function my({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}=$(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}=Op(r);return{node:r,x:i,y:a,width:o,height:s}},Mh);return!l||l.hidden||!kp(l)?null:(0,K.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 hy=(0,S.memo)(my),gy=(0,S.memo)(py),_y=200,vy=150,yy=e=>!e.hidden,by=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]},n=!1;for(let t of e.nodeLookup.values())if(!t.hidden){n=!0;break}return{viewBB:t,boundingRect:n?pp(Xf(e.nodeLookup,{filter:yy}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},xy=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,Sy=(e,t)=>xy(e.viewBB,t.viewBB)&&xy(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,Cy=`react-flow__minimap-desc`;function wy({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=Ih(),C=(0,S.useRef)(null),{boundingRect:w,panZoom:T,viewBB:E,rfId:D,translateExtent:O,flowWidth:k,flowHeight:A,ariaLabelConfig:j}=$(by,Sy),M=e?.width??_y,ee=e?.height??vy,N=w.width/M,P=w.height/ee,te=Math.max(N,P),ne=te*M,re=te*ee,F=b*te,I=w.x-(ne-w.width)/2-F,ie=w.y-(re-w.height)/2-F,ae=ne+F*2,oe=re+F*2,se=`${Cy}-${D}`,ce=(0,S.useRef)(0),le=(0,S.useRef)();ce.current=te,(0,S.useEffect)(()=>{let e=x.getState().panZoom;if(C.current&&e)return le.current=qm({domNode:C.current,panZoom:e,getTransform:()=>x.getState().transform,getViewScale:()=>ce.current}),()=>{le.current?.destroy()}},[T]),(0,S.useEffect)(()=>{le.current?.update({translateExtent:O,width:k,height:A,inversePan:v,pannable:h,zoomStep:y,zoomable:g})},[h,g,v,y,O,k,A]);let ue=p?e=>{let[t,n]=le.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,de=(0,S.useCallback)((e,t)=>{let n=x.getState().nodeLookup.get(t).internals.userNode;m?.(e,n)},[m]),fe=m?de:void 0,pe=_??j[`minimap.ariaLabel`];return(0,K.jsx)(Kh,{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:Qo([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,K.jsxs)(`svg`,{width:M,height:ee,viewBox:`${I} ${ie} ${ae} ${oe}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":se,ref:C,onClick:ue,children:[pe&&(0,K.jsx)(`title`,{id:se,children:pe}),(0,K.jsx)(gy,{onClick:fe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,K.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${I-F},${ie-F}h${ae+F*2}v${oe+F*2}h${-ae-F*2}z
|
|
18
|
+
M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}wy.displayName=`MiniMap`;var Ty=(0,S.memo)(wy),Ey=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Dy={[ch.Line]:`right`,[ch.Handle]:`bottom-right`};function Oy({nodeId:e,position:t,variant:n=ch.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=$g(),y=typeof e==`string`?e:v,b=Ih(),x=(0,S.useRef)(null),C=n===ch.Handle,w=$((0,S.useCallback)(Ey(C&&p),[C,p]),Mh),T=(0,S.useRef)(null),E=t??Dy[n];(0,S.useEffect)(()=>{if(x.current&&y)return T.current||=yh({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=Em([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...Ap({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])}}),T.current.update({controlPosition:E,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:_,shouldResize:m}),()=>{T.current?.destroy()}},[E,s,c,l,u,d,h,g,_,m]);let D=E.split(`-`);return(0,K.jsx)(`div`,{className:Qo([`react-flow__resize-control`,`nodrag`,...D,n,r]),ref:x,style:{...i,scale:w,...o&&{[C?`backgroundColor`:`borderColor`]:o}},children:a})}(0,S.memo)(Oy);var ky=[`high`,`medium`,`low`];function Ay(e){return ky.find(t=>e.some(e=>e.level===t))}function jy(){let[e,t]=(0,S.useState)();return[e,e=>{navigator.clipboard.writeText(e).then(()=>t(`Copied`),()=>t(`Couldn't copy`)),window.setTimeout(()=>t(void 0),2500)}]}function My({findings:e,onShow:t}){let[n,r]=(0,S.useState)(!1),[i,a]=jy(),o=(0,S.useRef)(null);if((0,S.useEffect)(()=>{if(!n)return;let e=e=>{o.current&&!o.current.contains(e.target)&&r(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n]),e.length===0)return null;let s=Ay(e)??`medium`;return(0,K.jsxs)(`div`,{className:`sec-chip-wrap`,ref:o,onKeyDown:e=>e.key===`Escape`&&r(!1),children:[(0,K.jsxs)(`button`,{type:`button`,className:`sec-chip lv-${s}`,"aria-expanded":n,"aria-haspopup":`dialog`,onClick:()=>r(e=>!e),children:[J.shield(16),` `,e.length,` to fix`]}),n&&(0,K.jsxs)(`div`,{className:`sec-pop`,role:`dialog`,"aria-label":`To fix`,children:[(0,K.jsx)(`ul`,{children:e.map(e=>(0,K.jsxs)(`li`,{children:[(0,K.jsx)(`i`,{className:`sec-dot lv-${e.level}`,"aria-label":e.level}),(0,K.jsxs)(`span`,{className:`sec-what`,children:[(0,K.jsx)(`b`,{children:e.title}),(0,K.jsx)(`code`,{children:e.ref})]}),(0,K.jsxs)(`span`,{className:`sec-btns`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`btn sm`,onClick:()=>a(e.prompt),title:e.fix,children:[J.copy(14),` Copy fix`]}),e.dep_id&&(0,K.jsx)(`button`,{type:`button`,className:`btn sm`,onClick:()=>{r(!1),t(e.dep_id)},children:`Show`})]})]},e.id))}),(0,K.jsxs)(`p`,{className:`sec-note`,children:[`Values are never shown. Catches known key formats, not everything.`,(0,K.jsx)(`span`,{"aria-live":`polite`,children:i&&` · ${i}`})]})]})]})}var Ny=new Set([`llm`,`api`,`mcp`,`local`]),Py={llm:`LLM`,api:`API`,mcp:`MCP server`,local:`local program`},Fy=e=>e.what?.startsWith(`through `)??!1,Iy=e=>e.what&&!Fy(e)?e.what.charAt(0).toUpperCase()+e.what.slice(1):e.title;function Ly(e){let t={};for(let n of e.edges)(t[n.target]||=[]).push(n.source);let n=Object.fromEntries(e.nodes.map(e=>[e.id,e.estimate_ms??0])),r={},i=(e,a=new Set)=>e in r?r[e]:a.has(e)?0:(a.add(e),r[e]=Math.max(0,...(t[e]??[]).map(e=>i(e,a)+n[e])),r[e]);for(let t of e.nodes)i(t.id);return r}var Ry=e=>`${(e/1e3).toFixed(1)} s`,zy=4;function By(e){return Number(e.evidence[0]?.ref?.split(`:`).pop()??0)}var Vy={dart:`Dart`,javascript:`JavaScript`,typescript:`TypeScript`},Hy=e=>Vy[e]??e;function Uy({flow:e,onPoint:t,onWatch:n,watching:r=!1,canWatch:i=!1}){let a=e.nodes.filter(e=>e.kind===`start`),o=a.length>1?e.nodes.find(t=>t.id===e.critical_path.path[0]):void 0,s=(0,S.useMemo)(()=>{let t=null;if(o){t=new Set([o.id]);for(let n=!0;n;){n=!1;for(let r of e.edges)t.has(r.source)&&!t.has(r.target)&&(t.add(r.target),n=!0)}}return e.nodes.filter(e=>Ny.has(e.kind)&&(e.estimate_ms??0)>0&&(!t||t.has(e.id))).sort((e,t)=>By(e)-By(t))},[e.nodes,e.edges,o]),c=(0,S.useMemo)(()=>Ly(e),[e]),l=e.written_ms??s.reduce((e,t)=>e+(t.estimate_ms??0),0),u=e.critical_path.length_ms,d=Math.max(l,u,1),f=e=>`${e/d*100}%`,p=Array.from({length:zy},()=>[]),m=Array(zy).fill(0);for(let e of[...s].sort((e,t)=>c[e.id]-c[t.id])){let t=c[e.id],n=e.estimate_ms??0,r=m.findIndex(e=>e<=t+1);r<0&&(r=m.indexOf(Math.min(...m))),m[r]=t+n,p[r].push({id:e.id,kind:e.kind,from:t,ms:n,est:e.estimate_source===`estimate`})}let h=0,g=l-u,_=e.critical_path.path.map(t=>e.nodes.find(e=>e.id===t)).filter(e=>e&&Ny.has(e.kind)),v=e.nodes.find(t=>t.id===e.critical_path.bottleneck);return(0,K.jsxs)(`section`,{className:`sp fx`,"aria-label":`Faster`,children:[(0,K.jsxs)(`div`,{className:`sp-sec`,children:[(0,K.jsx)(`h2`,{className:`fx-h`,children:`Faster`}),(0,K.jsxs)(`p`,{className:`fx-big`,"aria-label":`${wo(l)} as written, ${wo(u)} at best`,children:[(0,K.jsx)(`b`,{children:wo(l)}),(0,K.jsx)(`span`,{"aria-hidden":`true`,children:`→`}),(0,K.jsx)(`b`,{className:`could`,children:wo(u)})]}),(0,K.jsxs)(`small`,{className:`fx-sub`,children:[o?(0,K.jsxs)(K.Fragment,{children:[`The slowest of `,a.length,` actions, `,(0,K.jsx)(`b`,{children:o.title}),`: its `,s.length,` calls, `]}):(0,K.jsxs)(K.Fragment,{children:[`The same `,s.length,` calls, `]}),`as written and as your dependencies allow.`]}),(0,K.jsxs)(`div`,{className:`fx-times`,children:[(0,K.jsx)(`span`,{children:`As written`}),(0,K.jsx)(`div`,{className:`fx-lane`,role:`img`,"aria-label":`as written: ${wo(l)}`,children:s.map(e=>{let t=h;return h+=e.estimate_ms??0,(0,K.jsx)(`i`,{className:`fx-seg ${e.kind}${e.estimate_source===`estimate`?` est`:``}`,style:{left:f(t),width:f(e.estimate_ms??0)},title:`${Iy(e)}: ${wo(e.estimate_ms??0)}`},e.id)})}),(0,K.jsx)(`span`,{children:`Could be`}),(0,K.jsx)(`div`,{className:`fx-lanes`,role:`img`,"aria-label":`could be: ${wo(u)}`,children:p.filter(e=>e.length).map((e,t)=>(0,K.jsx)(`div`,{className:`fx-lane`,children:e.map(e=>(0,K.jsx)(`i`,{className:`fx-seg ${e.kind}${e.est?` est`:``}`,style:{left:f(e.from),width:f(e.ms)}},e.id))},t))})]}),n&&(0,K.jsxs)(`button`,{type:`button`,className:`btn fx-watch`,onClick:n,disabled:!i||r,children:[J.play(16),` `,r?`Playing…`:`Watch it run`]})]}),(e.advice??[]).length>0&&(0,K.jsxs)(`div`,{className:`sp-sec`,children:[(0,K.jsx)(`span`,{className:`sp-sh`,children:`Advice`}),(e.advice??[]).map(n=>(0,K.jsx)(Wy,{a:n,flow:e,onPoint:t},n.nodes.join()))]}),(0,K.jsxs)(`details`,{className:`fx-more`,children:[(0,K.jsxs)(`summary`,{children:[J.question(15),` About these numbers`]}),g>0&&(0,K.jsxs)(`p`,{className:`fx-cp`,children:[(0,K.jsx)(`b`,{children:wo(g)}),` faster if every call started as soon as it could.`]}),_.length>0&&(0,K.jsxs)(`p`,{className:`fx-cp`,children:[`Critical path: `,(0,K.jsx)(`b`,{children:_.map(e=>Iy(e)).join(` → `)}),`, `,wo(u),`.`,v&&(0,K.jsxs)(K.Fragment,{children:[` Slowest: `,(0,K.jsx)(`b`,{children:Iy(v)}),` (`,v.title,`), `,wo(v.estimate_ms??0),` (`,v.estimate_source===`measured`?`measured by the last check`:`an estimate`,`).`]})]}),(e.patterns??[]).length>0&&(0,K.jsxs)(`p`,{className:`fx-limits`,children:[e.patterns.map(Hy).join(`, `),` read by patterns: less exact than Python.`]}),(0,K.jsx)(`p`,{className:`fx-limits`,children:`Can't see: calls passed around as values, callbacks, or chosen at run time.`})]})]})}function Wy({a:e,flow:t,onPoint:n}){let[r,i]=(0,S.useState)(!1),[a,o]=(0,S.useState)(),s=e=>{navigator.clipboard.writeText(e).then(()=>o(`Copied`),()=>o(`Couldn't copy: select the text instead`)),window.setTimeout(()=>o(void 0),2500)},c=e.change,l=c?c.first_line+c.before.length-1:0;return(0,K.jsxs)(`div`,{className:`fx-advice`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`fx-card`,onMouseEnter:()=>n(e.nodes),onMouseLeave:()=>n(null),onFocus:()=>n(e.nodes),onBlur:()=>n(null),"aria-label":`Start these ${e.nodes.length} together, ${Ry(e.saved_ms)} faster`,children:[(0,K.jsxs)(`span`,{className:`fx-title`,children:[`Start these `,e.nodes.length,` together `,(0,K.jsxs)(`em`,{children:[`−`,Ry(e.saved_ms)]})]}),(0,K.jsx)(`span`,{className:`fx-chips`,children:e.nodes.map(e=>{let n=t.nodes.find(t=>t.id===e);return(0,K.jsx)(`i`,{children:n?Iy(n):e},e)})})]}),(0,K.jsxs)(`details`,{className:`fx-why`,children:[(0,K.jsxs)(`summary`,{children:[`Why`,e.caveat?` · one catch`:``]}),(0,K.jsx)(`p`,{className:`fx-text`,children:e.text}),e.caveat&&(0,K.jsx)(`p`,{className:`fx-caveat`,children:e.caveat}),(0,K.jsx)(`p`,{className:`fx-refs`,children:e.refs.join(`, `)})]}),(0,K.jsxs)(`div`,{className:`fx-do`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`fx-btn`,"aria-expanded":r,onClick:()=>i(e=>!e),children:[J.code(15),` `,r?`Hide the change`:`Show the change`]}),e.prompt&&(0,K.jsxs)(`button`,{type:`button`,className:`fx-btn`,onClick:()=>s(e.prompt),title:`A prompt for your coding agent`,children:[J.copy(15),` Copy prompt`]}),(0,K.jsx)(`span`,{className:`fx-said`,"aria-live":`polite`,children:a})]}),r&&(0,K.jsxs)(`section`,{className:`fx-change`,"aria-label":`The change`,children:[c?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`fx-ch-head`,children:[(0,K.jsxs)(`span`,{children:[c.path,` · line`,c.before.length>1?`s ${c.first_line}–${l}`:` ${c.first_line}`]}),c.saved_ms<e.saved_ms&&(0,K.jsxs)(`em`,{children:[`−`,Ry(c.saved_ms),` on its own`]})]}),(0,K.jsx)(`span`,{className:`fx-ch-label`,children:`Now`}),(0,K.jsx)(`pre`,{className:`fx-code now`,children:c.before.map((e,t)=>(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`b`,{children:c.first_line+t}),e||` `]},t))}),(0,K.jsx)(`span`,{className:`fx-ch-label`,children:`Could be`}),(0,K.jsx)(`pre`,{className:`fx-code could`,children:c.after.map((e,t)=>(0,K.jsx)(`span`,{children:e||` `},t))}),(0,K.jsxs)(`button`,{type:`button`,className:`fx-btn`,onClick:()=>s(c.after.join(`
|
|
19
|
+
`)),children:[J.copy(15),` Copy the new code`]}),(c.import_text||c.needs_import)&&(0,K.jsxs)(`p`,{className:`fx-note`,children:[`Add `,(0,K.jsx)(`code`,{children:c.import_text??`import asyncio`}),` at the top of `,c.path,`.`]}),c.by_hand.length>0&&(0,K.jsxs)(`div`,{className:`fx-note`,children:[(0,K.jsx)(`b`,{children:`Move by hand`}),` (or copy the prompt):`,(0,K.jsx)(`ul`,{children:c.by_hand.map(e=>(0,K.jsx)(`li`,{children:e},e))})]})]}):(0,K.jsx)(`p`,{className:`fx-note`,children:`No safe change to write out here: the calls sit in different places, or code between them uses a result. Copy the prompt for your coding agent instead.`}),(0,K.jsx)(`p`,{className:`fx-note`,children:`FlowForge never edits your code: copy it, check it, run your tests.`})]})]})}function Gy(e){let t=Ly(e),n=Object.fromEntries(e.nodes.map(e=>[e.id,e])),r={};for(let t of e.nodes){if(t.kind!==`decision`)continue;let i=e.edges.filter(e=>e.source===t.id&&e.kind===`branch`&&e.when),a=i.find(e=>n[e.target]?.kind!==`end`)??i[0];a&&i.some(e=>n[e.target]?.kind===`end`)&&(r[t.id]=a.when)}let i=new Set(e.nodes.filter(e=>e.kind===`end`).map(e=>e.id)),a=e.nodes.filter(e=>!i.has(e.id)).map(r=>{let i=(Fy(r)?e.edges.find(e=>e.target===r.id)?.source:void 0)??r.id;return{node:r.id,start_ms:t[i]??0,duration_ms:n[i]?.estimate_ms??0,outcome:`ok`,attempts:1,tokens:0,answered_by:null,note:null}});return{label:`the could-be schedule, not a recording`,steps:a,branches:r,calls:a.length,cached:0}}var Ky=Object.defineProperty,qy=(e,t,n)=>t in e?Ky(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jy=(e,t)=>{for(var n in t)Ky(e,n,{get:t[n],enumerable:!0})},Yy=(e,t,n)=>qy(e,typeof t==`symbol`?t:t+``,n),Xy={};Jy(Xy,{Graph:()=>Fb,alg:()=>lb});var Zy=Object.defineProperty,Qy=(e,t)=>{for(var n in t)Zy(e,n,{get:t[n],enumerable:!0})},$y=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e&&e.multigraph,this._isCompound=`compound`in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=typeof e==`function`?e:()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t),r=this.successors(e);if(r)for(let e of r)n.add(e);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),(t?.length??0)===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i,i):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=typeof e==`function`?e:()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,c=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,c=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,c=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let l=nb(this._isDirected,i,a,o);if(l in this._edgeLabels)return c&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[l]=c?s:this._defaultEdgeLabelFn(i,a,o);let u=rb(this._isDirected,i,a,o);return i=u.v,a=u.w,Object.freeze(u),this._edgeObjs[l]=u,eb(this._preds[a],i),eb(this._sucs[i],a),this._in[a][l]=u,this._out[i][l]=u,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?ib(this._isDirected,e):nb(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r!=`object`||!r?{label:r}:r}hasEdge(e,t,n){return(arguments.length===1?ib(this._isDirected,e):nb(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?ib(this._isDirected,e):nb(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],tb(this._preds[t],e),tb(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function eb(e,t){e[t]?e[t]++:e[t]=1}function tb(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function nb(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\0`:r)}function rb(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function ib(e,t){return nb(e,t.v,t.w,t.name)}Qy({},{read:()=>cb,write:()=>ab});function ab(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:ob(e),edges:sb(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function ob(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function sb(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function cb(e){let t=new $y(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var lb={};Qy(lb,{CycleException:()=>wb,bellmanFord:()=>db,components:()=>pb,dijkstra:()=>gb,dijkstraAll:()=>vb,findCycles:()=>bb,floydWarshall:()=>Sb,isAcyclic:()=>Eb,postorder:()=>Ab,preorder:()=>jb,prim:()=>Mb,shortestPaths:()=>Nb,tarjan:()=>yb,topsort:()=>Tb});var ub=()=>1;function db(e,t,n,r){return fb(e,String(t),n||ub,r||function(t){return e.outEdges(t)??[]})}function fb(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=i[e.v],r=i[e.w];if(!t||!r)return;let o=n(e);t.distance+o<r.distance&&(i[e.w]={distance:t.distance+o,predecessor:e.v},a=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){let n=t.v===e?t.v:t.w,r=n===t.v?t.w:t.v;c({v:n,w:r})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0,predecessor:``}});let u=s.length;for(let e=1;e<u&&(a=!1,o++,l(),a);e++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}function pb(e){let t={},n=[],r;function i(n){var a,o;n in t||(t[n]=!0,r.push(n),(a=e.successors(n))==null||a.forEach(i),(o=e.predecessors(n))==null||o.forEach(i))}return e.nodes().forEach(function(e){r=[],i(e),r.length&&n.push(r)}),n}var mb=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){if(this.size()===0)throw Error(`Queue underflow`);this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){let t=this._arr,n=t[e].priority,r;for(;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){let n=this._arr,r=this._keyIndices,i=n[e],a=n[t];n[e]=a,n[t]=i,r[a.key]=e,r[i.key]=t}},hb=()=>1;function gb(e,t,n,r){return _b(e,String(t),n||hb,r||function(t){return e.outEdges(t)??[]})}function _b(e,t,n,r){let i={},a=new mb,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t];if(!r)return;let c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l<r.distance&&(r.distance=l,r.predecessor=o,a.decrease(t,l))};for(e.nodes().forEach(function(e){let n=e===t?0:1/0;i[e]={distance:n,predecessor:``},a.add(e,n)});a.size()>0;){o=a.removeMin();let e=i[o];if(!e||e.distance===1/0)break;s=e,r(o).forEach(c)}return i}function vb(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=gb(e,i,t,n),r},{})}function yb(e){let t=0,n=[],r={},i=[];function a(o){var s;let c=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),(s=e.successors(o))==null||s.forEach(function(e){if(e in r){let t=r[e];t!=null&&t.onStack&&(c.lowlink=Math.min(c.lowlink,t.index))}else{a(e);let t=r[e];t&&(c.lowlink=Math.min(c.lowlink,t.lowlink))}}),c.lowlink===c.index){let e=[],t;do{t=n.pop();let i=r[t];i&&(i.onStack=!1),e.push(t)}while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function bb(e){return yb(e).filter(function(t){let n=t[0];return n?t.length>1||t.length===1&&(e.outEdges(n,n)??[]).length>0:!1})}var xb=()=>1;function Sb(e,t,n){return Cb(e,t||xb,n||function(t){return e.outEdges(t)??[]})}function Cb(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){let a={};r[e]=a,a[e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(a[t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let r=n.v===e?n.w:n.v,i=t(n);a[r]={distance:i,predecessor:e}})}),i.forEach(function(e){let t=r[e];t&&i.forEach(function(n){let a=r[n];a&&i.forEach(function(n){let r=a[e],i=t[n],o=a[n];if(r&&i&&o){let e=r.distance+i.distance;e<o.distance&&(o.distance=e,o.predecessor=i.predecessor)}})})}),r}var wb=class extends Error{constructor(e){super(e),this.name=`CycleException`}};function Tb(e){let t={},n={},r=[];function i(a){var o;if(a in n)throw new wb;a in t||(n[a]=!0,t[a]=!0,(o=e.predecessors(a))==null||o.forEach(i),delete n[a],r.push(a))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new wb;return r}function Eb(e){try{Tb(e)}catch(e){if(e instanceof wb)return!1;throw e}return!0}function Db(e,t,n,r,i){Array.isArray(t)||(t=[t]);let a=(t=>(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=Ob(e,t,n===`post`,o,a,r,i)}),i}function Ob(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=Ob(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function kb(e,t,n){return Db(e,t,n,function(e,t){return e.push(t),e},[])}function Ab(e,t){return kb(e,t,`post`)}function jb(e,t){return kb(e,t,`pre`)}function Mb(e,t){var n;let r=new $y,i={},a=new mb,o;function s(e){let n=e.v===o?e.w:e.v,r=a.priority(n);if(r!==void 0){let s=t(e);s<r&&(i[n]=o,a.decrease(n,s))}}if(e.nodeCount()===0)return r;e.nodes().forEach(function(e){a.add(e,1/0),r.setNode(e)});let c=e.nodes()[0];c!==void 0&&a.decrease(c,0);let l=!1;for(;a.size()>0;){if(o=a.removeMin(),o in i)r.setEdge(o,i[o]);else{if(l)throw Error(`Input graph is not connected: `+e);l=!0}(n=e.nodeEdges(o))==null||n.forEach(s)}return r}function Nb(e,t,n,r){return Pb(e,t,n,r??(t=>e.outEdges(t)??[]))}function Pb(e,t,n,r){if(n===void 0)return gb(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;o<a.length;o++){let s=a[o];if(s===void 0)continue;let c=r(s);for(let e=0;e<c.length;e++){let t=c[e];if(!t)continue;let r=t.v===s?t.v:t.w;n({v:r,w:r===t.v?t.w:t.v})<0&&(i=!0)}if(i)return db(e,t,n,r)}return gb(e,t,n,r)}var Fb=$y;function Ib(e,t,n,r){let i=r;for(;e.hasNode(i);)i=Qb(r);return n.dummy=t,e.setNode(i,n),i}function Lb(e){let t=new Fb().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function Rb(e){let t=new Fb({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function zb(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function Bb(e){let t=$b(qb(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function Vb(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=Kb(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function Hb(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=Kb(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function Ub(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),Ib(e,`border`,i,t)}function Wb(e,t=Gb){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var Gb=65535;function Kb(e,t){return t.length>Gb?e(...Wb(t).map(t=>e(...t))):e(...t)}function qb(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return Kb(Math.max,t)}function Jb(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function Yb(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function Xb(e,t){return t()}var Zb=0;function Qb(e){return e+(``+ ++Zb)}function $b(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function ex(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function tx(e,t){let n;return n=typeof t==`string`?e=>e[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function nx(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var rx=`\0`;function ix(e,t,n){if(!(e&&t&&n&&t.dummy===`edge`&&n.dummy===`edge`&&t.edgeObj&&n.edgeObj&&e[t.edgeObj.v]&&e[n.edgeObj.v]&&e[t.edgeObj.w]&&e[n.edgeObj.w]))return 0;let r=!0;t.edgeObj.w===n.edgeObj.w&&(r=!1);let i=r?e[t.edgeObj.v]?.rank??NaN:e[t.edgeObj.w]?.rank??NaN,a=Object.entries(e).find(e=>e[1].edgeObj?.v===t.edgeObj.v&&e[1].edgeObj?.w===t.edgeObj.w&&e[1].rank===i),o=Object.entries(e).find(e=>e[1].edgeObj?.v===n.edgeObj.v&&e[1].edgeObj?.w===n.edgeObj.w&&e[1].rank===i);if(!a||!o)return 0;let s=a[1].order??NaN,c=o[1].order??NaN;return isNaN(s-c)?0:s-c}var ax=`3.1.1`,ox=class{constructor(){Yy(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return sx(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&sx(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,cx)),n=n._prev;return`[`+e.join(`, `)+`]`}};function sx(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function cx(e,t){if(e!==`_next`&&e!==`_prev`)return t}var lx=ox,ux=()=>1;function dx(e,t){if(e.nodeCount()<=1)return[];let n=mx(e,t||ux);return fx(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function fx(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)px(e,t,n,o);for(;o=i.dequeue();)px(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(px(e,t,n,o,!0)||[]);break}}}return r}function px(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,hx(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,hx(t,n,o)}),e.removeNode(r.v),o}function mx(e,t){let n=new Fb,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=gx(i+r+3).map(()=>new lx),o=r+1;return n.nodes().forEach(e=>{hx(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function hx(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function gx(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function _x(e,t){(e.graph().acyclicer===`greedy`?dx(e,n(e)):vx(e,t??null)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,Qb(`rev`))});function n(e){return t=>e.edge(t).weight}}function vx(e,t){let n=[],r={},i={};function a(t){Object.hasOwn(i,t)||(i[t]=!0,r[t]=!0,e.outEdges(t).forEach(e=>{Object.hasOwn(r,e.w)?n.push(e):a(e.w)}),delete r[t])}function o(a){var s;Object.hasOwn(i,a)||(i[a]=!0,r[a]=!0,(s=e.outEdges(a))==null||s.forEach(i=>{Object.hasOwn(r,i.w)||t.node(a)?.rank>t.node(i.w)?.rank&&bx(e,i.w,i)?n.push(i):o(i.w)}),delete r[a])}let s=a;return t&&typeof t.node==`function`&&(s=o),e.sources().forEach(s),e.nodes().forEach(s),n}function yx(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function bx(e,t,n){let r=new Set;function i(t){if(e.sources().includes(t))return!0;r.add(t);for(let a of e.inEdges(t)??[])if((a.v!==n.v||a.w!==n.w)&&!r.has(a.v)&&i(a.v))return!0;return!1}return i(t)}function xx(e){e.graph().dummyChains=[],e.edges().forEach(t=>Sx(e,t))}function Sx(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=Ib(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function Cx(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function wx(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=Kb(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function Tx(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var Ex=Dx;function Dx(e){let t=new Fb({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;Ox(t,e)<i&&(a=kx(t,e),a);)o=t.hasNode(a.v)?Tx(e,a):-Tx(e,a),Ax(t,e,o);return t}function Ox(e,t){function n(r){let i=t.nodeEdges(r);i&&i.forEach(i=>{let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!Tx(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function kx(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=Tx(t,r)),i<n[0]?[i,r]:n},[1/0,null])[1]}function Ax(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}var{preorder:jx,postorder:Mx}=lb,Nx=Px;Px.initLowLimValues=Rx,Px.initCutValues=Fx,Px.calcCutValue=Lx,Px.leaveEdge=Bx,Px.enterEdge=Vx,Px.exchangeEdges=Hx;function Px(e){e=Lb(e),wx(e);let t=Ex(e);Rx(t),Fx(t,e);let n,r;for(;n=Bx(t);)r=Vx(t,e,n),Hx(t,e,n,r)}function Fx(e,t){let n=Mx(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>Ix(e,t,n))}function Ix(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=Lx(e,t,n)}function Lx(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,Wx(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function Rx(e,t){arguments.length<2&&(t=e.nodes()[0]),zx(e,{},1,t)}function zx(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=zx(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function Bx(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function Vx(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===Gx(e,e.node(t.v),s)&&c!==Gx(e,e.node(t.w),s)).reduce((e,n)=>Tx(t,n)<Tx(t,e)?n:e)}function Hx(e,t,n,r){let i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),Rx(e),Fx(e,t),Ux(e,t)}function Ux(e,t){let n=e.nodes().find(t=>!e.node(t).parent);if(!n)return;let r=jx(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function Wx(e,t,n){return e.hasEdge(t,n)}function Gx(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var Kx=qx;function qx(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:Xx(e);break;case`tight-tree`:Yx(e);break;case`longest-path`:Jx(e);break;case`none`:break;default:Xx(e)}}var Jx=wx;function Yx(e){wx(e),Ex(e)}function Xx(e){Nx(e)}var Zx=Qx;function Qx(e){let t=eS(e),n=e.graph();Array.isArray(n.dummyChains)&&n.dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=$x(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(o[c+1]).minRank<=r.rank;)c++;l=o[c]}l!==void 0&&e.setParent(n,l),n=e.successors(n)[0]}})}function $x(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function eS(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(rx).forEach(r),t}function tS(e){let t=Ib(e,`root`,{},`_root`),n=rS(e),r=Object.values(n),i=Kb(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=iS(e)+1;e.children(rx).forEach(r=>{nS(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function nS(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=Ub(e,`_bt`),l=Ub(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{nS(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function rS(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(rx).forEach(e=>n(e,1)),t}function iS(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function aS(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var oS=sS;function sS(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),i&&Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)cS(e,`borderLeft`,`_bl`,n,i,t),cS(e,`borderRight`,`_br`,n,i,t)}}e.children(rx).forEach(t)}function cS(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=Ib(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function lS(e){let t=e.graph().rankdir?.toLowerCase();(t===`lr`||t===`rl`)&&dS(e)}function uS(e){let t=e.graph().rankdir?.toLowerCase();(t===`bt`||t===`rl`)&&pS(e),(t===`lr`||t===`rl`)&&(hS(e),dS(e))}function dS(e){e.nodes().forEach(t=>fS(e.node(t))),e.edges().forEach(t=>fS(e.edge(t)))}function fS(e){let t=e.width;e.width=e.height,e.height=t}function pS(e){e.nodes().forEach(t=>mS(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(mS),Object.hasOwn(r,`y`)&&mS(r)})}function mS(e){e.y=-e.y}function hS(e){e.nodes().forEach(t=>gS(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(gS),Object.hasOwn(r,`x`)&&gS(r)})}function gS(e){let t=e.x;e.x=e.y,e.y=t}function _S(e,t=null){let n={},r=e.nodes().filter(t=>!e.children(t).length),i=r.map(t=>e.node(t).rank),a=$b(Kb(Math.max,i)+1).map(()=>[]);function o(t){if(n[t])return;n[t]=!0;let r=e.node(t);a[r.rank].push(t);let i=e.successors(t);i&&[...i].sort((e,t)=>s(e,t)).forEach(o)}r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(o);function s(n,r){return ix(t,e.node(n),e.node(r))}return a}function vS(e,t){let n=0;for(let r=1;r<t.length;++r)n+=yS(e,t[r-1],t[r]);return n}function yS(e,t,n){let r=nx(n,n.map((e,t)=>t)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function bS(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function xS(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),SS(Object.values(n).filter(e=>!e.indegree))}function SS(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&CS(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>ex(e,[`vs`,`i`,`barycenter`,`weight`]))}function CS(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function wS(e,t,n,r,i){let a={},o=null,s=null,c=i;typeof t==`boolean`?(c=t,a={}):t&&(a=t,o=n??null,s=r??null);let l=Jb(e,e=>Object.hasOwn(e,`barycenter`)),u=l.lhs,d=l.rhs.sort((e,t)=>t.i-e.i),f=[],p=0,m=0,h=0;u.sort(ES(s,o,!!c));for(let[e,t]of Object.entries(a)){let n=u.findIndex(t=>t.vs[0]===e);u.splice(n+1,0,t)}h=TS(f,d,h),u.forEach(e=>{h+=e.vs.length,f.push(e.vs),p+=e.barycenter*e.weight,m+=e.weight,h=TS(f,d,h)});let g={vs:f.flat(1)};return m&&(g.barycenter=p/m,g.weight=m),g}function TS(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function ES(e,t,n){return(r,i)=>{if(r.barycenter<i.barycenter)return-1;if(r.barycenter>i.barycenter)return 1;if(e&&(typeof r.vs[0]==`string`||typeof i.vs[0]==`string`)){let n=ix(t,e.node(r.vs[0]),e.node(i.vs[0]));if(n!==0)return n}return n?i.i-r.i:r.i-i.i}}function DS(e,t,n,r,i){var a,o;let s=null,c=i;typeof r==`boolean`?(c=r,s=null):r!==void 0&&(s=r);let l=e.children(t),u=e.node(t),d=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};d&&(l=l.filter(e=>e!==d&&e!==f));let m=bS(e,l);m.forEach(t=>{if(e.children(t.v).length){let{result:r}=DS(e,t.v,n,s,c);p[t.v]=r,Object.hasOwn(r,`barycenter`)&&kS(t,r)}});let h=xS(m,n);OS(h,p);let g={},_=!1;for(let t=0;t<h.length;t++)for(let n=t+1;n<h.length;n++)if(h[t]&&h[n]&&(a=h[t])!=null&&a.barycenter&&(o=h[n])!=null&&o.barycenter&&h[t]?.barycenter===h[n].barycenter){let r=h[t]?.vs[0]??``,i=h[n]?.vs[0]??``,a=e.node(r),o=e.node(i);if(a.dummy===`edge`&&o.dummy===`edge`&&a.edgeObj?.v===o.edgeObj?.v&&a.edgeObj?.w===o.edgeObj?.w){if(a.edgeLabel.reversed){g[i]=h[t],h.splice(t,1),t--;break}g[r]=h[n],h.splice(n,1),n--}else _=!0}let v=wS(h,g,s,e,c);if(d&&f){v.vs=[d,v.vs,f].flat(1);let t=e.predecessors(d);if(t&&t.length){let n=e.node(t[0]),r=e.predecessors(f),i=e.node(r[0]);Object.hasOwn(v,`barycenter`)||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+n.order+i.order)/(v.weight+2),v.weight+=2}}return Object.defineProperty(v,"result",{value:v,enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(v,"usedBias",{value:_,enumerable:!1,configurable:!0,writable:!0}),v}function OS(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function kS(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function AS(e,t,n,r){r||=e.nodes();let i=jS(e),a=new Fb({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function jS(e){let t;for(;e.hasNode(t=Qb(`_root`)););return t}function MS(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function NS(e,t={},n=null){if(typeof t.customOrder==`function`){t.customOrder(e,NS);return}let r=qb(e),i=PS(e,$b(1,r+1),`inEdges`),a=PS(e,$b(r-1,-1,-1),`outEdges`),o=_S(e,n);if(IS(e,o),t.disableOptimalOrderHeuristic)return;let s=1/0,c,l=t.constraints||[];for(let t=0,r=0;r<4;++t,++r){FS(t%2?i:a,t%4>=2,l,n),o=Bb(e);let u=vS(e,o);u<s?(r=0,c=Object.assign({},o),s=u):u===s&&(c=structuredClone(o))}IS(e,c)}function PS(e,t,n){let r=new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return AS(e,t,n,r.get(t)||[])})}function FS(e,t,n,r){let i=!0,a=new Fb;e.forEach(function(e){n.forEach(e=>a.setEdge(e.left,e.right));let o=e.graph().root,{result:s,usedBias:c}=DS(e,o,a,r,i);t&&c&&(i=!i),s.vs.forEach((t,n)=>e.node(t).order=n),MS(e,a,s.vs)})}function IS(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function LS(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=zS(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&BS(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function RS(e,t){let n={};function r(t,r,i,a,o){$b(r,i).forEach(r=>{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&BS(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function zS(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function BS(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function VS(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function HS(e,t,n,r,i){let a={},o={},s={};return t.forEach(e=>{e.forEach((e,t)=>{a[e]=e,o[e]=e,s[e]=t})}),t.forEach(t=>{let c=-1,l=-1,u=!1,d=t,f=t.findIndex(t=>i?.includes(t)||ZS(t,e,i));f>0&&(d=[t[f],...t.slice(0,f),...t.slice(f+1)],u=!0),d.forEach(t=>{let d=r(t);if(d&&d.length){i!=null&&i.includes(t)&&(d=d.filter(t=>ZS(t,e,i)));let r=d.sort((e,t)=>{let n=s[e],r=s[t];return(n===void 0?0:n)-(r===void 0?0:r)}),f=(r.length-1)/2;for(let e=Math.floor(f),i=Math.ceil(f);e<=i;++e){let i=r[e];if(i===void 0)continue;let d=s[i];if(d!==void 0&&o[t]===t&&c<d&&s[i]!==l&&!VS(n,t,i)){let e=a[i];e!==void 0&&(o[i]=t,o[t]=a[t]=e,c=d,u&&=(c=-1,l=s[i]??-1,!1))}}}})}),{root:a,align:o}}function US(e,t,n,r,i=!1){let a={},o=WS(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){let t=o.inEdges(e);t?a[e]=t.reduce((e,t)=>{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function WS(e,t,n,r){let i=new Fb,a=e.graph(),o=YS(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function GS(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=XS(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function KS(e,t){let n=Object.values(t),r=Kb(Math.min,n),i=Kb(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-Kb(Math.min,c);a!==`l`&&(l=i-Kb(Math.max,c)),l&&(e[o]=tx(s,e=>e+l))})})}function qS(e,t=void 0){let n=e.ul;return n?tx(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function JS(e,t){let n=Bb(e),r=Object.assign(LS(e,n),RS(e,n)),i={},a;return[`u`,`d`].forEach(o=>{a=o===`u`?n:Object.values(n).reverse(),[`l`,`r`].forEach(n=>{n===`r`&&(a=a.map(e=>Object.values(e).reverse()));let s=HS(e,a,r,t=>(o===`u`?e.predecessors(t):e.successors(t))||[],t),c=US(e,a,s.root,s.align,n===`r`);n===`r`&&(c=tx(c,e=>-e)),i[o+n]=c})}),KS(i,GS(e,i)),qS(i,e.graph().align)}function YS(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),c}}function XS(e,t){return e.node(t).width}function ZS(e,t,n){if(!n)return!1;let r=t.node(e)?.edgeObj;if(!r||t.node(e).edgeLabel.reversed)return!1;let i=n.indexOf(r?.v),a=n.indexOf(r?.w);return i!==-1&&a!==-1&&i===(a+1)%n.length||i===(a-1)%n.length}function QS(e,t){e=Rb(e),$S(e),Object.entries(JS(e,t)).forEach(([t,n])=>e.node(t).x=n)}function $S(e){let t=Bb(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);r.y=i===`top`?a+r.height/2:i===`bottom`?a+n-r.height/2:a+n/2}),a+=n+r})}var eC=new WeakMap;function tC(e,t={}){return rC(e,Xb,t),e}function nC(e,t,n){let r=t;for(;r!==void 0;){let t=e.parent(r);if(t===n)return r;r=t}}function rC(e,t,n){let r=e.nodes().filter(t=>e.children(t).length),i={};r.forEach(r=>{let a=e.node(r);if(a&&a.rankdir){let o=new Fb({multigraph:!0,compound:!0});o.setGraph({rankdir:a.rankdir});let s=e.children(r);s.forEach(t=>{let n={...e.node(t)};o.setNode(t,n);let i=e.parent(t);i&&i!==r&&s.includes(i)&&o.setParent(t,i)});let c=new Set;e.edges().forEach(t=>{let n=nC(e,t.v,r),i=nC(e,t.w,r);if(n&&i&&n!==i){let r=`${n}\0${i}`;c.has(r)||(c.add(r),o.setEdge(n,i,{...e.edge(t)}))}}),rC(o,t,n);let l=mC(o);iC(l,t,n,null),aC(o,l);let u=1/0,d=1/0,f=-1/0,p=-1/0;o.nodes().forEach(e=>{if(e===r)return;let t=o.node(e);t&&typeof t.x==`number`&&typeof t.y==`number`&&typeof t.width==`number`&&typeof t.height==`number`&&(u=Math.min(u,t.x-t.width/2),f=Math.max(f,t.x+t.width/2),d=Math.min(d,t.y-t.height/2),p=Math.max(p,t.y+t.height/2))}),(!isFinite(u)||!isFinite(d)||!isFinite(f)||!isFinite(p))&&(u=d=0,f=p=0);let m=f-u,h=p-d;i[r]={minX:u,minY:d,maxX:f,maxY:p,width:m,height:h,offsetX:u,offsetY:d},a._dagreClusterSubgraph=o}});let a=[],o=t=>{let n=[],r=(e.children(t)||[]).filter(e=>e!==t);for(;r.length>0;){let t=r.shift();n.push(t),(e.children(t)||[]).filter(e=>e!==t).forEach(e=>r.push(e))}return n},s=new Map;r.forEach(t=>{let n=e.node(t);n&&n.rankdir&&i[t]&&s.set(t,(e.children(t)||[]).filter(e=>e!==t))});let c=new Set([...s.values()].flat()),l=new Map;s.forEach((e,t)=>{c.has(t)||l.set(t,o(t))});let u=new Set([...l.values()].flat()),d=e=>{for(let[t,n]of l)if(n.includes(e))return t;return e},f=[];e.edges().forEach(t=>{(u.has(t.v)||u.has(t.w))&&f.push({edge:t,label:e.edge(t)})});let p=new Map;u.forEach(t=>{let n=e.parent(t);p.set(t,typeof n==`string`?n:void 0)}),l.forEach((t,n)=>{let r=e.node(n),o=[];t.forEach(t=>{let n=e.node(t);n&&(o.push({id:t,node:n,parent:p.get(t)}),e.removeNode(t))});let s=f.filter(({edge:e})=>t.includes(e.v)||t.includes(e.w)),c=i[n];r&&(a.push({clusterId:n,subgraph:r._dagreClusterSubgraph,bounds:c,children:t,removedNodes:o,removedEdges:s}),r.width=c.width,r.height=c.height)});let m=new Set;f.forEach(({edge:t,label:n})=>{let r=d(t.v),i=d(t.w);if(r!==i&&e.hasNode(r)&&e.hasNode(i)){let t=`${r}\0${i}`;m.has(t)||(m.add(t),e.setEdge(r,i,{...n,width:0,height:0}))}});let h=mC(e),g=iC(h,t,n,eC.get(e)??null);eC.set(e,g),aC(e,h),m.forEach(t=>{let n=t.indexOf(`\0`),r=t.slice(0,n),i=t.slice(n+1);e.hasEdge(r,i)&&e.removeEdge(r,i)}),a.forEach(({clusterId:t,subgraph:n,bounds:r,removedNodes:i,removedEdges:a})=>{let o=e.node(t),s=o?.x??0,c=o?.y??0,l=(r.minX+r.maxX)/2,u=(r.minY+r.maxY)/2;i.forEach(({id:t,node:n,parent:r})=>{e.setNode(t,n),r!==void 0&&e.setParent(t,r)}),a.forEach(({edge:t,label:n})=>{e.setEdge(t,n)}),n.nodes().forEach(r=>{if(r===t)return;let i=n.node(r),a=e.node(r);a&&i&&typeof i.x==`number`&&typeof i.y==`number`&&(a.x=s+(i.x-l),a.y=c+(i.y-u))}),delete o._dagreClusterSubgraph}),r.forEach(t=>{let n=e.node(t),r=i[t];if(n&&n.rankdir&&n._dagreClusterSubgraph&&r){let i=n._dagreClusterSubgraph,a=n.x??0,o=n.y??0,s=(r.minX+r.maxX)/2,c=(r.minY+r.maxY)/2;i.nodes().forEach(n=>{if(n===t)return;let r=i.node(n),l=e.node(n);if(l&&r&&typeof r.x==`number`&&typeof r.y==`number`){let e=r.x-s,t=r.y-c;l.x=a+e,l.y=o+t}}),delete n._dagreClusterSubgraph}})}function iC(e,t,n,r=null){var i,a;let o=n?.useDynamic!==!1,s=o&&(i=r?.graph)!=null?i:null,c=o&&(a=r?.rawNodes)!=null?a:null;t(` makeSpaceForEdgeLabels`,()=>hC(e)),t(` removeSelfEdges`,()=>wC(e)),t(` acyclic`,()=>_x(e,s)),t(` nestingGraph.run`,()=>tS(e)),t(` rank`,()=>Kx(Rb(e))),t(` injectEdgeLabelProxies`,()=>gC(e)),t(` removeEmptyRanks`,()=>Hb(e)),t(` nestingGraph.cleanup`,()=>aS(e)),t(` normalizeRanks`,()=>Vb(e)),t(` assignRankMinMax`,()=>_C(e)),t(` removeEdgeLabelProxies`,()=>vC(e)),t(` normalize.run`,()=>xx(e)),t(` parentDummyChains`,()=>Zx(e)),t(` addBorderSegments`,()=>oS(e)),t(` order`,()=>NS(e,n,c)),t(` insertSelfEdges`,()=>TC(e)),t(` adjustCoordinateSystem`,()=>lS(e)),t(` position`,()=>QS(e,n.corePath)),t(` positionSelfEdges`,()=>EC(e));let l=JSON.parse(JSON.stringify(e._nodes));return t(` removeBorderNodes`,()=>CC(e)),t(` normalize.undo`,()=>Cx(e)),t(` fixupEdgeLabelCoords`,()=>xC(e)),t(` undoCoordinateSystem`,()=>uS(e)),t(` translateGraph`,()=>yC(e)),t(` assignNodeIntersects`,()=>bC(e)),t(` reversePoints`,()=>SC(e)),t(` acyclic.undo`,()=>yx(e)),{graph:e,rawNodes:l}}function aC(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var oC=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],sC={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},cC=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],lC=[`width`,`height`,`rank`],uC={width:0,height:0},dC=[`minlen`,`weight`,`width`,`height`,`labeloffset`],fC={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},pC=[`labelpos`];function mC(e){let t=new Fb({multigraph:!0,compound:!0}),n=OC(e.graph());return t.setGraph(Object.assign({},sC,DC(n,oC),ex(n,cC))),e.nodes().forEach(n=>{let r=DC(OC(e.node(n)),lC);Object.keys(uC).forEach(e=>{r[e]===void 0&&(r[e]=uC[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=OC(e.edge(n));t.setEdge(n,Object.assign({},fC,DC(r,dC),ex(r,pC)))}),t}function hC(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,(r.labelpos??`r`).toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function gC(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);Ib(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function _C(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function vC(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function yC(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function bC(e){e.edges().forEach(t=>{if(t.v===t.w)return;let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(zb(r,a)),n.points.push(zb(i,o))})}function xC(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function SC(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function CC(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function wC(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function TC(e){Bb(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);typeof i.rank!=`number`&&(i.rank=0),i.order=r+n,(i.selfEdges||[]).forEach(t=>{Ib(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,edgeLabel:t.label},`_se`),(!Array.isArray(t.label.points)||t.label.points.length!==7)&&(t.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete i.selfEdges})})}function EC(e){e.nodes().forEach(t=>{let n=e.node(t),r=e=>typeof e==`number`&&isFinite(e);if(n.dummy===`selfedge`){let i=n,a=e.node(i.e.v),o=r(a?.x)?a.x:0,s=r(a?.y)?a.y:0,c=r(a?.width)?a.width:0,l=r(a?.height)?a.height:0,u=r(n.x)?n.x:o,d=r(n.y)?n.y:s,f=c/2,p=l/2;i.edgeLabel.points=[{x:u+f,y:d-p},{x:u+f,y:d-p},{x:u,y:d},{x:u-f,y:d+p},{x:u-f,y:d+p},{x:u,y:d},{x:u,y:d}],i.edgeLabel.x=u,i.edgeLabel.y=d,e.setEdge(i.e,i.edgeLabel),e.removeNode(t)}else n&&Array.isArray(n.selfEdges)&&n.selfEdges.forEach(e=>{if(!Array.isArray(e.label.points)||e.label.points.length!==7){let t=r(n.x)?n.x:0,i=r(n.y)?n.y:0,a=r(n.width)?n.width:0,o=r(n.height)?n.height:0,s=a/2,c=o/2;e.label.points=[{x:t+s,y:i-c},{x:t+s,y:i-c},{x:t,y:i},{x:t-s,y:i+c},{x:t-s,y:i+c},{x:t,y:i},{x:t,y:i}]}})})}function DC(e,t){return tx(ex(e,t),Number)}function OC(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}function kC(e){let t=Bb(e),n=new Fb({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{n.setNode(t,{label:t}),n.setParent(t,`layer`+e.node(t).rank)}),e.edges().forEach(e=>n.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{let r=`layer`+t;n.setNode(r,{rank:`same`}),e.reduce((e,t)=>(n.setEdge(e,t,{style:`invis`}),t))}),n}var AC={graphlib:Xy,version:ax,layout:tC,debug:kC,util:{time:Yb,notime:Xb}},jC={start:{w:176,h:48},end:{w:148,h:48},decision:{w:144,h:88},fork:{w:12,h:260},join:{w:12,h:260}},MC={w:196,h:64},NC={w:26,h:26};function PC(e){return jC[e]??MC}var FC=e=>e===`decision`?NC:PC(e);function IC(e,t,n=PC){let r=new AC.graphlib.Graph;r.setGraph({rankdir:`LR`,nodesep:56,ranksep:104,marginx:32,marginy:32}),r.setDefaultEdgeLabel(()=>({}));for(let t of e){let e=n(t.kind);r.setNode(t.id,{width:e.w,height:e.h})}for(let e of t)e.kind!==`retry`&&r.hasNode(e.source)&&r.hasNode(e.target)&&r.setEdge(e.source,e.target);AC.layout(r);let i={};for(let t of e){let e=r.node(t.id),a=n(t.kind);i[t.id]=[Math.round(e.x-a.w/2),Math.round(e.y-a.h/2)]}return i}function LC(e,t,n,r=PC){let i=e.some(e=>!n[e.id])?IC(e,t,r):{},a={};for(let t of e)a[t.id]=n[t.id]??i[t.id]??[0,0];return a}function RC(e,t){let n=PC(t);return[e[0]+n.w/2,e[1]+n.h/2]}function zC(e,t,n){if(e.kind===`retry`)return{s:`st`,t:`tt`};let r=n[e.source]?RC(n[e.source],t[e.source]):[0,0],i=n[e.target]?RC(n[e.target],t[e.target]):[0,0],a=i[1]<r[1]-40,o=i[1]>r[1]+40;return e.kind===`fallback`&&Math.abs(i[0]-r[0])<120?a?{s:`st`,t:`tb`}:o?{s:`sb`,t:`tt`}:{s:`sr`,t:`tl`}:{s:t[e.source]===`decision`&&e.kind===`branch`?a?`st`:o?`sb`:`sr`:`sr`,t:t[e.target]===`decision`&&i[1]-r[1]>60&&Math.abs(i[0]-r[0])<260?`tt`:`tl`}}var BC=[{id:`studio`,name:`Studio`,note:`cards, the familiar look`},{id:`boxed`,name:`Boxed`,note:`boxes of what runs together`},{id:`blueprint`,name:`Blueprint`,note:`an engineering drawing`},{id:`metro`,name:`Metro`,note:`a transit map`},{id:`soft`,name:`Soft`,note:`calm colour fields`}],VC=`flowforge.graphTheme`;function HC(){try{let e=localStorage.getItem(VC);return BC.some(t=>t.id===e)?e:`studio`}catch{return`studio`}}function UC(e){try{localStorage.setItem(VC,e)}catch{}}var WC={llm:`LLMs`,mcp:`MCP servers`,api:`APIs`,local:`Local programs`};function GC(e,t){let n=Object.fromEntries(t.map(e=>[e.id,e])),r=new Map;if(e.kind===`dependencies`){for(let t of e.nodes){let e=WC[t.kind];if(!e)continue;let n=r.get(e)??{label:e,note:``,ids:[]};n.ids.push(t.id),r.set(e,n)}for(let e of r.values())e.note=`${e.ids.length}`}else{let t=Ly(e);for(let n of e.nodes){if(!Ny.has(n.kind)||Fy(n))continue;let e=(t[n.id]??0).toFixed(0),i=r.get(e)??{label:`Start together`,note:`at ${((t[n.id]??0)/1e3).toFixed(1)} s`,ids:[]};i.ids.push(n.id),r.set(e,i)}for(let[e,t]of r)t.ids.length<2&&r.delete(e)}let i=[],a=0;for(let e of r.values()){let t=e.ids.map(e=>n[e]).filter(Boolean);if(!t.length)continue;let r=Math.min(...t.map(e=>e.position.x))-22,o=Math.min(...t.map(e=>e.position.y))-46,s=Math.max(...t.map(e=>e.position.x+(e.width??196)))+22,c=Math.max(...t.map(e=>e.position.y+(e.height??64)))+30;i.push({key:`box-${a++}`,label:e.label,note:e.note,x:r,y:o,w:s-r,h:c-o})}return i}var KC=340,qC=52,JC=(e,t)=>{let n=e.nodes.find(e=>e.id===t);return!!n&&Fy(n)};function YC(e,t,n=PC){let r=Ly(e),i=new Map(e.edges.filter(t=>JC(e,t.target)).map(e=>[e.target,e.source])),a=t=>{let n=e.nodes.find(e=>e.id===t);if(n.kind===`start`)return-1;if(i.has(t))return a(i.get(t))+.01;if(n.kind===`decision`||n.kind===`end`){let i=e.edges.find(n=>n.target===t&&e.nodes.find(e=>e.id===n.source)?.kind===`decision`);return n.kind===`end`&&i?a(i.source):(r[t]??0)-.5}return r[t]??0},o=new Map;for(let t of e.nodes){let e=a(t.id);o.set(e,[...o.get(e)??[],t.id])}let s={},c=t=>e.nodes.find(e=>e.id===t).kind;[...o.keys()].sort((e,t)=>e-t).forEach((e,r)=>{let a=o.get(e).sort((e,n)=>(t[e]?.[1]??0)-(t[n]?.[1]??0)),l=-(a.reduce((e,t)=>e+n(c(t)).h,0)+qC*(a.length-1))/2;for(let e of a)s[e]=[r*KC,i.has(e)?NaN:l],l+=n(c(e)).h+qC});for(let[e,t]of i)s[e]&&s[t]&&(s[e][1]=s[t][1]);return s}var XC=(e,t,n)=>Math.max(t,Math.min(n,e));function ZC(e,t,n,r,i,a,o=!1){let s=Math.max(36,Math.abs(r-e)*.5),c=Math.max(36,Math.abs(i-t)*.55);if(o&&n===Q.Top&&a===Q.Bottom)return[[e,t],[e+70,t-c],[r+70,i+c],[r,i]];if(o&&n===Q.Bottom&&a===Q.Top)return[[e,t],[e+70,t+c],[r+70,i-c],[r,i]];let l=n===Q.Right?[e+s,t]:n===Q.Top?[e,t-c]:n===Q.Bottom?[e,t+c]:[e-s,t],u=a===Q.Left?[r-s,i]:a===Q.Top?[r,i-c]:a===Q.Bottom?[r,i+c]:[r+s,i];return[[e,t],l,u,[r,i]]}function QC(e){let t=e=>Math.round(e*10)/10;return`M ${t(e[0][0])} ${t(e[0][1])} C ${t(e[1][0])} ${t(e[1][1])}, ${t(e[2][0])} ${t(e[2][1])}, ${t(e[3][0])} ${t(e[3][1])}`}function $C(e,t,n,r){let[[i,a],,,[o,s]]=t;if(n!==Q.Right||r!==Q.Left||o<=i)return QC(t);let c=e=>Math.round(e*10)/10;if(e===`boxed`||e===`blueprint`){let e=c((i+o)/2);return`M ${c(i)} ${c(a)} H ${e} V ${c(s)} H ${c(o)}`}if(e===`metro`){let e=Math.min(Math.abs(s-a),Math.max(0,o-i-24)),t=i+(o-i-e)/2;return`M ${c(i)} ${c(a)} H ${c(t)} L ${c(t+e)} ${c(a+Math.sign(s-a)*e)} V ${c(s)} H ${c(o)}`}return QC(t)}function ew(e,t){let n=1-t,r=r=>n*n*n*e[0][r]+3*n*n*t*e[1][r]+3*n*t*t*e[2][r]+t*t*t*e[3][r];return[r(0),r(1)]}function tw(e){return e.state===`active`?`ffa-blue`:e.state===`done`?`ffa-teal`:e.edge.kind===`fallback`?`ffa-coral`:e.edge.kind===`unconfirmed`?`ffa-faint`:e.edge.kind===`retry`?`ffa-muted`:e.cp?`ffa-fg`:`ffa-edge`}function nw({source:e,target:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,data:c}){let l=Jv(e),u=Jv(t);if(!c)return null;let d=c.edge,f;if(d.kind===`retry`&&l){let e=l.internals.positionAbsolute.x,t=l.internals.positionAbsolute.y,n=l.measured?.width??196;f=[[e+n-34,t],[e+n-34,t-46],[e+n-96,t-46],[e+n-96,t-1]]}else{let e=r,t=a;if(l?.type===`bar`&&o===Q.Right){let t=l.internals.positionAbsolute.y;e=XC(a,t+14,t+(l.measured?.height??260)-14)}if(u?.type===`bar`&&s===Q.Left){let n=u.internals.positionAbsolute.y;t=XC(e,n+14,n+(u.measured?.height??260)-14)}f=ZC(n,e,o,i,t,s,d.kind===`fallback`)}let p=d.kind===`retry`?QC(f):$C(c.theme,f,o,s),m=[`ff-edge`,c.to&&`to-${c.to}`,d.kind===`fallback`&&`fb`,d.kind===`unconfirmed`&&`unc`,d.kind===`retry`&&`loop`,c.cp&&c.state===`idle`&&`cp`,c.state!==`idle`&&c.state,c.dim&&`dim`].filter(Boolean).join(` `),h=c.state===`skipped`||c.dim,g=[],_=o===Q.Top||o===Q.Bottom;return d.kind===`branch`&&d.when&&g.push({at:ew(f,_?.32:.5),text:d.when,cls:`br`}),d.kind===`fallback`&&g.push({at:ew(f,.5),text:d.on||`fallback`,cls:`fb`}),d.kind===`unconfirmed`&&g.push({at:ew(f,.5),text:`unconfirmed`,cls:`unc`}),c.guard&&g.push({at:ew(f,d.when?.72:.5),text:``,cls:`guard`,shield:!0,title:`Keys and personal data are removed before the LLM sees anything`}),(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`g`,{className:m,style:{"--draw-delay":`${c.delay??0}s`},children:[(0,K.jsx)(`path`,{className:`ff-under`,d:p}),(0,K.jsx)(`path`,{className:`ff-line`,d:p,markerEnd:`url(#${tw(c)})`}),c.state===`active`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`circle`,{className:`ff-dot-glow`,r:8,children:(0,K.jsx)(`animateMotion`,{dur:`1.1s`,repeatCount:`indefinite`,path:p})}),(0,K.jsx)(`circle`,{className:`ff-dot`,r:3.6,children:(0,K.jsx)(`animateMotion`,{dur:`1.1s`,repeatCount:`indefinite`,path:p})}),(0,K.jsx)(`circle`,{className:`ff-dot`,r:3,children:(0,K.jsx)(`animateMotion`,{dur:`1.1s`,begin:`0.37s`,repeatCount:`indefinite`,path:p})}),(0,K.jsx)(`circle`,{className:`ff-dot`,r:2.4,children:(0,K.jsx)(`animateMotion`,{dur:`1.1s`,begin:`0.74s`,repeatCount:`indefinite`,path:p})})]})]}),g.length>0&&(0,K.jsx)(Hv,{children:g.map(e=>(0,K.jsx)(`span`,{className:`ff-elabel ${e.cls}${h?` off`:``}`,title:e.title,style:{transform:`translate(-50%, -50%) translate(${e.at[0]}px, ${e.at[1]}px)`},children:e.shield?J.shield(13):e.text},e.cls+e.text))})]})}var rw={flow:nw};function iw(){return(0,K.jsx)(`svg`,{width:`0`,height:`0`,"aria-hidden":`true`,style:{position:`absolute`,width:0,height:0,overflow:`hidden`},children:(0,K.jsx)(`defs`,{children:[[`ffa-edge`,`var(--edge)`,10],[`ffa-fg`,`var(--fg)`,10],[`ffa-blue`,`var(--blue)`,11],[`ffa-teal`,`var(--teal)`,11],[`ffa-coral`,`var(--coral)`,10],[`ffa-faint`,`var(--faint)`,10],[`ffa-muted`,`var(--muted)`,10]].map(([e,t,n])=>(0,K.jsx)(`marker`,{id:e,viewBox:`0 0 10 10`,refX:`8.6`,refY:`5`,markerWidth:n,markerHeight:n,markerUnits:`userSpaceOnUse`,orient:`auto`,children:(0,K.jsx)(`path`,{d:`M1 1.4 L9.2 5 L1 8.6 Z`,style:{fill:t}})},e))})})}function aw(){let[e]=Yi();return e.get(`map`)===`flow`?`flow`:`deps`}function ow(e,t=`?`){return e===`flow`?`${t}map=flow`:``}function sw({items:e,label:t=`More`,button:n}){let[r,i]=(0,S.useState)(!1),a=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(!r)return;let e=e=>{a.current&&!a.current.contains(e.target)&&i(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[r]);let o=e=>()=>{i(!1),e()};return(0,K.jsxs)(`div`,{className:`mm`,ref:a,onKeyDown:e=>e.key===`Escape`&&i(!1),children:[(0,K.jsxs)(`button`,{type:`button`,className:`btn mm-btn`,"aria-haspopup":`menu`,"aria-expanded":r,onClick:()=>i(e=>!e),children:[n??t,` `,(0,K.jsx)(`span`,{className:`mm-caret`,"aria-hidden":`true`,children:J.chevron(14)})]}),r&&(0,K.jsx)(`div`,{className:`mm-menu`,role:`menu`,"aria-label":t,children:e.map((e,t)=>e.kind===`head`?(0,K.jsx)(`span`,{className:`mm-head`,role:`presentation`,children:e.label},t):e.kind===`link`?(0,K.jsxs)(z,{role:`menuitem`,className:`mm-item`,to:e.to,onClick:()=>i(!1),children:[e.icon,e.label]},t):e.kind===`action`?(0,K.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`mm-item`,disabled:e.disabled,onClick:o(e.onClick),children:[e.icon,e.label]},t):e.kind===`toggle`?(0,K.jsxs)(`button`,{type:`button`,role:`menuitemcheckbox`,"aria-checked":e.on,className:`mm-item`,onClick:()=>e.onClick(),children:[(0,K.jsx)(`span`,{className:`mm-check`,children:e.on?J.check(14):null}),e.label]},t):(0,K.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.on,className:`mm-item`,onClick:()=>e.onClick(),children:[e.swatch?(0,K.jsx)(`i`,{className:`fm-swatch ${e.swatch}`,"aria-hidden":`true`}):(0,K.jsx)(`span`,{className:`mm-check`,children:e.on?J.check(14):null}),(0,K.jsxs)(`span`,{children:[e.label,e.note&&(0,K.jsx)(`small`,{children:e.note})]})]},t))})]})}var cw={llm:`LLM`,api:`API`,mcp:`MCP`,local:`Local`,code:`Code`,gate:`Gate`},lw={start:`Start`,end:`End`,llm:`LLM call`,api:`API call`,mcp:`MCP tool`,local:`Local command`,code:`Your code`,decision:`Decision`,fork:`Run together`,join:`Wait for all`,gate:`You approve`};function uw(){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(s_,{className:`ff-handle`,type:`target`,position:Q.Left,id:`tl`,isConnectable:!1}),(0,K.jsx)(s_,{className:`ff-handle`,type:`target`,position:Q.Top,id:`tt`,isConnectable:!1}),(0,K.jsx)(s_,{className:`ff-handle`,type:`target`,position:Q.Bottom,id:`tb`,isConnectable:!1}),(0,K.jsx)(s_,{className:`ff-handle`,type:`source`,position:Q.Right,id:`sr`,isConnectable:!1}),(0,K.jsx)(s_,{className:`ff-handle`,type:`source`,position:Q.Top,id:`st`,isConnectable:!1}),(0,K.jsx)(s_,{className:`ff-handle`,type:`source`,position:Q.Bottom,id:`sb`,isConnectable:!1})]})}function dw(e,t){let n=e.node;return[`ff-block`,`kind-${n.kind}`,e.state!==`idle`&&`st-${e.state}`,t&&`selected`,n.status===`unconfirmed`&&`unconf`,e.search,e.cp&&e.state===`idle`&&`cp`,e.diff&&!e.diffOff&&`diff-${e.diff}`,e.diffOff&&`diff-off`,e.health&&`h-${e.health.status}`,e.compact&&n.kind===`decision`&&`compact`].filter(Boolean).join(` `)}function fw({d:e}){let t=e.state;return t===`ok`&&![`decision`,`fork`,`join`].includes(e.node.kind)?(0,K.jsx)(`span`,{className:`ff-st ok`,children:J.check(12)}):t===`cached`?(0,K.jsx)(`span`,{className:`ff-st cached`,children:`cached`}):t===`failed`?(0,K.jsx)(`span`,{className:`ff-st failed`,children:`!`}):t===`waiting`?(0,K.jsx)(`span`,{className:`ff-st waiting`,children:`you`}):t===`retry`?(0,K.jsx)(`span`,{className:`ff-st retry`,children:`retry`}):null}function pw({d:e,evidence:t}){if(e.cap)return(0,K.jsx)(`span`,{className:`ff-cap ${e.state}`,children:e.cap});let n=e.health?Po(e.health.status,e.health.summary,e.health.latency_ms):``;if(!t)return n?(0,K.jsx)(`span`,{className:`ff-cap`,children:(0,K.jsx)(`em`,{className:`ff-h ${e.health?.status}`,children:n})}):null;let r=e.node.evidence[0];if(!r||[`fork`,`join`].includes(e.node.kind))return null;let i=r.type===`code`&&r.ref?r.ref.split(`/`).pop():r.type===`policy`?`added by code`:r.type===`user`?`added by you`:e.node.status===`unconfirmed`?`no call found`:``;return!i&&!n?null:(0,K.jsxs)(`span`,{className:`ff-cap`,children:[i,n&&(0,K.jsx)(`em`,{className:`ff-h ${e.health?.status}`,children:n})]})}function mw({d:e,selected:t,children:n}){let r=e.compact?FC(e.node.kind):PC(e.node.kind),i=e.node;return(0,K.jsxs)(`div`,{className:dw(e,t),style:{width:r.w,height:r.h},title:bw(e),"aria-label":`${i.title}, ${lw[i.kind]??i.kind}${e.tile?`, ${e.tile.name}`:``}${i.status===`unconfirmed`?`, unconfirmed`:``}${e.risk?`, ${e.risk} security finding`:``}`,children:[(0,K.jsx)(`span`,{className:`ff-focus`}),n,e.diffTag?(0,K.jsx)(`span`,{className:`ff-dtag ${e.diffOff?`off`:e.diff}`,children:e.diffTag}):i.yours.length>0&&(0,K.jsx)(`span`,{className:`ff-flag yours`,children:`Yours`}),e.showTip&&i.tip&&i.yours.length===0&&(0,K.jsxs)(`span`,{className:`ff-flag tip`,children:[J.spark(11),` Tip`]}),(0,K.jsx)(fw,{d:e}),e.health&&i.kind!==`start`&&(0,K.jsx)(`span`,{className:`hdot ff-hdot ${e.health.status}`,"aria-hidden":`true`}),e.risk&&(0,K.jsx)(`span`,{className:`ff-risk lv-${e.risk}`,"aria-hidden":`true`,children:`!`}),(0,K.jsx)(uw,{})]})}function hw({d:e}){let t=e.node.kind;return t===`gate`?(0,K.jsx)(`span`,{className:`ff-icon lock`,children:J.lock(18)}):t===`end`?(0,K.jsx)(`span`,{className:`ff-icon flag`,children:J.flag(18)}):e.tile?(0,K.jsx)(`span`,{className:`brand-slot`,children:(0,K.jsx)(no,{c:e.tile,size:t===`start`?34:36})}):(0,K.jsx)(`span`,{className:`ff-icon code`,children:J.code(18)})}function gw({data:e,selected:t}){let n=e.node;return e.theme===`metro`?(0,K.jsxs)(mw,{d:e,selected:t,children:[(0,K.jsxs)(`span`,{className:`ff-metro`,children:[(0,K.jsx)(`span`,{className:`ff-title`,children:xw(e)}),(0,K.jsx)(`span`,{className:`ff-track`,children:(0,K.jsx)(`i`,{className:`ff-station`})}),(0,K.jsx)(`span`,{className:`ff-sub`,children:Sw(e)})]}),(0,K.jsx)(pw,{d:e,evidence:e.showEvidence})]}):(0,K.jsxs)(mw,{d:e,selected:t,children:[(0,K.jsxs)(`span`,{className:`ff-card`,children:[(0,K.jsx)(hw,{d:e}),(0,K.jsxs)(`span`,{className:`ff-text`,children:[(0,K.jsx)(`span`,{className:`ff-title`,children:xw(e)}),(0,K.jsx)(`span`,{className:`ff-sub`,children:Sw(e)})]})]}),n.kind===`gate`&&(0,K.jsx)(`span`,{className:`ff-tag gate`,children:cw.gate}),e.retryMax&&e.state===`idle`&&(0,K.jsxs)(`span`,{className:`ff-retry`,children:[J.refresh(10),` `,e.retryMax,`×`]}),(0,K.jsx)(pw,{d:e,evidence:e.showEvidence})]})}function _w({data:e,selected:t}){let n=e.node;return(0,K.jsxs)(mw,{d:e,selected:t,children:[(0,K.jsxs)(`span`,{className:`ff-pill`,children:[(0,K.jsx)(hw,{d:e}),(0,K.jsxs)(`span`,{className:`ff-text`,children:[(0,K.jsx)(`span`,{className:`ff-title`,children:n.title}),(0,K.jsx)(`span`,{className:`ff-sub`,children:Sw(e)})]})]}),(0,K.jsx)(pw,{d:e,evidence:e.showEvidence})]})}function vw({data:e,selected:t}){return(0,K.jsxs)(mw,{d:e,selected:t,children:[(0,K.jsx)(`span`,{className:`ff-dia`}),(0,K.jsx)(`span`,{className:`ff-dia-in`}),(0,K.jsx)(`span`,{className:`ff-dtext`,children:e.node.title}),(0,K.jsx)(pw,{d:e,evidence:e.showEvidence})]})}function yw({data:e,selected:t}){return(0,K.jsxs)(mw,{d:e,selected:t,children:[(0,K.jsx)(`span`,{className:`ff-bar`}),(0,K.jsx)(`span`,{className:`ff-barlabel`,children:e.node.title})]})}function bw(e){let t=e.node.evidence.find(e=>e.type===`code`&&e.ref)?.ref;return e.compact&&e.node.kind===`decision`?[e.node.title,t].filter(Boolean).join(` · `):t??void 0}function xw(e){let t=e.node;return e.code&&Py[t.kind]?Iy(t):t.title}function Sw(e){let t=e.node,n=t.op??{};if(e.deps)return ww(t);if(e.code){if(Py[t.kind]&&Fy(t))return`${Py[t.kind]}, ${t.what}`;if(Py[t.kind])return t.what?`${t.title} · ${Py[t.kind]}`:Py[t.kind];if(t.kind===`start`)return`where it starts`;if(t.kind===`end`)return`the code stops`}return t.kind===`gate`?t.added_by===`policy`?`added by code · always`:`you approve · always`:t.kind===`start`?e.tile?`${e.tile.name} webhook`:`start`:t.kind===`end`?`end`:t.kind===`code`?t.added_by===`user`?`your step`:`your code`:t.kind===`llm`?[t.planner_connector&&t.connector!==t.planner_connector?`yours`:null,n.model??e.tile?.name].filter(Boolean).join(` · `)||`LLM`:t.kind===`mcp`?[e.tile?.name,n.tool].filter(Boolean).join(` · `):t.kind===`api`?[n.method,n.path].filter(Boolean).join(` `)||e.tile?.name||`API`:e.tile?.name??``}function Cw(e){return e.replace(/^https?:\/\//,``).replace(/\/$/,``)}function ww(e){return e.kind===`start`?e.id===`tools`?`coding tools`:`your app`:e.kind===`llm`?[e.op?.model,Cw(e.what)].filter(Boolean).join(` · `)||`LLM`:e.added_by===`user`?`added by you`:Cw(e.what)}var Tw={card:gw,pill:_w,decision:vw,bar:yw};function Ew(e){return e===`start`||e===`end`?`pill`:e===`decision`?`decision`:e===`fork`||e===`join`?`bar`:`card`}var Dw=new Set([`llm`,`api`,`mcp`,`local`]),Ow=e=>e.start_ms+e.duration_ms;function kw(e,t,n){let r=new Set(e.map(e=>e.id)),i=new Map(n.steps.filter(e=>r.has(e.node)).map(e=>[e.node,e])),a=Math.max(0,...[...i.values()].map(Ow)),o=[...i.values()].find(e=>e.outcome===`waiting`)??null,s=new Map;for(let n=0;n<e.length;n++){let n=!1;for(let r of e){if(i.has(r.id)||s.has(r.id))continue;let e=t.filter(e=>e.target===r.id&&e.kind!==`retry`),a=e.map(e=>i.has(e.source)?Ow(i.get(e.source)):s.get(e.source));if(e.length===0)s.set(r.id,0);else if(a.every(e=>e!==void 0))s.set(r.id,Math.max(...a));else continue;n=!0}if(!n)break}for(let t of e)!i.has(t.id)&&!s.has(t.id)&&s.set(t.id,a);return{steps:i,skipAt:s,gate:o,end:a,nodes:e,edges:t,branches:n.branches}}function Aw(e,t){let n=e.steps.get(t.source),r=e.steps.get(t.target);return!n||!r||t.kind===`unconfirmed`||t.kind===`retry`?!1:t.kind===`fallback`?n.outcome===`failed`:n.outcome===`failed`?!1:t.kind===`branch`?e.branches[t.source]===t.when:r.start_ms>=Ow(n)-1}var jw=e=>`${(e/1e3).toFixed(1)} s`;function Mw(e,t,n=!1,r=!1){let i=e.gate?e.gate.start_ms:1/0,a=e.gate!==null&&!n&&!r&&t>=i,o=a?i:t,s={},c={},l=0,u=0,d=0,f=new Map(e.nodes.map(e=>[e.id,e.kind]));for(let t of e.nodes){let a=e.steps.get(t.id),p=r&&e.gate!==null&&a!==void 0&&a.start_ms>i;if(!a||p){let a=p?i:e.skipAt.get(t.id)??e.end,l=e.gate!==null&&!n&&!r&&a>=i;s[t.id]=!l&&o>=a&&(a>0||o>0)?`skipped`:`idle`,s[t.id]===`skipped`&&(c[t.id]=t.status===`unconfirmed`?`not run · unconfirmed`:`not taken`);continue}if(a.outcome===`waiting`){o<a.start_ms?s[t.id]=`idle`:r?(s[t.id]=`failed`,c[t.id]=`rejected by you`):n?(s[t.id]=`ok`,c[t.id]=`approved`):(s[t.id]=`waiting`,c[t.id]=`waiting for you`);continue}if(o<a.start_ms){s[t.id]=`idle`;continue}if(o<Ow(a)){let e=a.duration_ms?(o-a.start_ms)/a.duration_ms:1;s[t.id]=a.attempts>1&&e>.35&&e<.6?`retry`:`running`,c[t.id]=s[t.id]===`retry`?a.note??`retrying`:`running…`;continue}s[t.id]=a.outcome===`cached`?`cached`:a.outcome===`failed`?`failed`:`ok`;let m=f.get(t.id)===`decision`||f.get(t.id)===`fork`||f.get(t.id)===`join`?``:jw(a.duration_ms);c[t.id]=[a.outcome===`cached`?`from cache`:m,a.outcome===`failed`?a.note:null].filter(Boolean).join(` · `),Dw.has(f.get(t.id)??``)&&a.outcome!==`cached`&&(l+=a.attempts),a.outcome===`cached`&&(u+=1),d+=a.tokens}let p={};for(let t of e.edges){let a=e.steps.get(t.source),s=e.steps.get(t.target);if(t.kind===`retry`){let e=a&&a.duration_ms?(o-a.start_ms)/a.duration_ms:-1;p[t.id]=a&&a.attempts>1&&e>.35&&e<.6?`active`:a&&o>=Ow(a)&&a.attempts>1?`done`:`idle`}else if(r&&s&&s.start_ms>i)p[t.id]=o>=i?`skipped`:`idle`;else if(Aw(e,t)&&a&&s){let e=a.outcome===`waiting`?a.start_ms:Ow(a);a.outcome===`waiting`&&!n?p[t.id]=`idle`:p[t.id]=o<e?`idle`:o<s.start_ms?`active`:`done`}else{let i=a?a.outcome===`waiting`?n||r?a.start_ms:1/0:Ow(a):e.skipAt.get(t.source)??e.end;p[t.id]=o>=i&&(i>0||o>0)?`skipped`:`idle`}}let m=!a&&o>=e.end;return{t:o,nodes:s,edges:p,caps:c,waiting:a&&e.gate?e.gate.node:null,done:m,calls:l,cached:u,tokens:d}}var Nw={start:`Start`,end:`End`,api:`API call`,mcp:`MCP tool`,llm:`LLM call`,local:`Local command`,code:`Your code`,decision:`Decision`,fork:`Run together`,join:`Wait for all`,gate:`You approve`},Pw=new Set([`llm`,`api`,`mcp`,`local`]),Fw={llm:`llm`,api:`http`,mcp:`mcp`,local:`local`},Iw={running:`Running now`,retry:`Server error. Trying again`,waiting:`Waiting for you to approve`,cached:`Answered from cache`,skipped:`Not taken in this run`},Lw=8;function Rw({item:e,othersUp:t,example:n,checking:r,onCheck:i}){let a=![`unchecked`,`unconfirmed`,`checking`].includes(e.status),o=[...V(a?`/checks/${encodeURIComponent(e.id)}?limit=${Lw}`:null).data??[]].reverse(),s=Math.max(1,...o.map(e=>e.latency_ms??0)),c=e.status===`down`?`${To.down}: ${e.summary}`:e.summary;return(0,K.jsxs)(`div`,{className:`sp-sec`,children:[(0,K.jsx)(`span`,{className:`sp-sh`,children:`Health`}),(0,K.jsxs)(`div`,{className:`sp-verdict`,children:[(0,K.jsx)(Mo,{status:e.status,style:{width:12,height:12}}),(0,K.jsxs)(`span`,{children:[c,a&&(0,K.jsx)(`small`,{children:[n?`example result`:null,e.at?`checked ${ao(e.at)}`:null,e.latency_ms?`took ${wo(e.latency_ms)}`:null].filter(Boolean).join(` · `)})]})]}),e.reason&&(0,K.jsx)(`p`,{className:`sp-reason ${e.status}`,children:e.reason}),(0,K.jsx)(No,{item:e,othersUp:t}),e.fix&&(0,K.jsxs)(`p`,{className:`hc-fix`,children:[(0,K.jsx)(`span`,{children:`Likely fix`}),e.fix]}),o.length>1&&(0,K.jsx)(`div`,{className:`sp-bars`,role:`img`,"aria-label":`last ${o.length} checks`,children:o.map(e=>(0,K.jsx)(`i`,{className:e.status,style:{height:e.latency_ms?`${Math.max(14,e.latency_ms/s*100)}%`:void 0},title:`${e.summary} · ${ao(e.at)}`},`${e.run_id}-${e.at}`))}),i&&e.status!==`unconfirmed`&&(0,K.jsx)(`div`,{className:`sp-row`,children:(0,K.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>i(e.id),disabled:r,children:[J.activity(16),` `,e.status===`checking`?`Checking…`:`Check this one`]})})]})}function zw({ev:e}){if(e.type===`code`){let t=e.first_line??1;return(0,K.jsxs)(`div`,{className:`sp-ev`,children:[(0,K.jsxs)(`div`,{className:`sp-evh`,children:[J.file(14),(0,K.jsx)(`span`,{children:e.ref}),(0,K.jsx)(`em`,{children:`found in your code`})]}),e.lines.length>0&&(0,K.jsx)(`div`,{className:`sp-code`,children:e.lines.map((n,r)=>(0,K.jsxs)(`div`,{className:`sp-cl${t+r===e.highlight?` hl`:``}`,children:[(0,K.jsx)(`b`,{children:t+r}),(0,K.jsx)(`span`,{children:n})]},r))})]})}let t={trace:J.activity(15),policy:J.shield(15),env_name:J.key(15),missing:J.question(15),user:J.pencil(15)};return(0,K.jsxs)(`div`,{className:`sp-evl ${e.type}`,children:[t[e.type],(0,K.jsxs)(`span`,{children:[e.ref&&e.type===`env_name`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`code`,{children:e.ref}),` · `]}):null,e.text]})]})}function Bw({node:e,flow:t,tile:n,state:r,cap:i,waiting:a,connectors:o,tipShown:s,layer:c,actions:l,health:u,othersUp:d,example:f,checking:p,onCheck:m,findings:h}){let[g,_]=(0,S.useState)(e.title),[v,y]=(0,S.useState)(!1),[b,x]=(0,S.useState)(),[C,w]=jy();(0,S.useEffect)(()=>{_(e.title),x(void 0)},[e.id,e.title]);let T=async(t,n=!1)=>{y(!0),x(void 0);try{n?await l.reset(e.id):t&&await l.edit(t)}catch(e){x(e instanceof Error?e.message:String(e))}finally{y(!1)}},E=t=>{t.preventDefault(),g.trim()&&g.trim()!==e.title&&T({op:`rename`,node:e.id,title:g.trim()})},D=c===`mine`,O=t.kind===`dependencies`,k=t.source===`code`,A=e.added_by===`user`,j=Pw.has(e.kind),M=[`gate`,`start`,`end`].includes(e.kind)||e.added_by===`policy`,ee=j?o.filter(t=>t.type===Fw[e.kind]):[],N=e.connector?t.apps[e.connector]:void 0,P=t.edges.find(t=>t.target===e.id&&t.id.startsWith(`user_`))?.source??``,te=r===`ok`?`Done${i?` · ${i}`:``}`:r===`failed`?`Failed${i?`: ${i}`:``}`:Iw[r],ne=e.kind===`llm`?`llm`:e.kind===`gate`?`gate`:``,re=Math.max(1,...(e.stats?.history??[]).map(e=>e.ms));return(0,K.jsxs)(`aside`,{className:`sp`,"aria-label":`Step: ${e.title}`,onKeyDown:e=>e.key===`Escape`&&l.close(),children:[(0,K.jsxs)(`div`,{className:`sp-head`,children:[e.kind===`gate`?(0,K.jsx)(`span`,{className:`ff-icon lock`,style:{width:44,height:44,borderRadius:12},children:J.lock(22)}):n?(0,K.jsx)(no,{c:n,size:44}):(0,K.jsx)(`span`,{className:`ff-icon code`,style:{width:44,height:44,borderRadius:12},children:e.kind===`end`?J.flag(22):J.code(22)}),(0,K.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,K.jsx)(`span`,{className:`sp-kind ${ne}`,children:Nw[e.kind]??e.kind}),(0,K.jsx)(`h2`,{children:e.title}),e.what&&e.kind!==`decision`&&(0,K.jsx)(`p`,{className:`sp-what`,children:e.what})]}),(0,K.jsx)(`button`,{className:`fm-ib`,type:`button`,"aria-label":`Close details`,onClick:l.close,children:J.close(18)})]}),te&&r!==`idle`&&(0,K.jsx)(`div`,{className:`sp-run ${r}`,role:`status`,children:te}),h&&h.length>0&&(0,K.jsx)(`div`,{className:`sp-sec sp-security`,role:`region`,"aria-label":`To fix`,children:(0,K.jsx)(`ul`,{children:h.map(e=>(0,K.jsxs)(`li`,{children:[(0,K.jsx)(`span`,{className:`sec-level lv-${e.level}`,children:e.level}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`b`,{children:e.title}),` `,(0,K.jsx)(`code`,{children:e.ref}),(0,K.jsx)(`span`,{className:`sp-fix`,children:e.fix}),(0,K.jsxs)(`button`,{className:`btn sm`,type:`button`,onClick:()=>w(e.prompt),children:[J.copy(14),` Copy fix prompt`]}),(0,K.jsx)(`span`,{className:`sp-said`,"aria-live":`polite`,children:C})]})]},e.id))})}),u&&(0,K.jsx)(Rw,{item:u,othersUp:d,example:f,checking:p,onCheck:m}),(e.side_effect||e.repeats||k&&e.estimate_ms)&&(0,K.jsxs)(`div`,{className:`sp-chips sp-sec`,children:[k&&e.estimate_ms!=null&&e.estimate_ms>0&&(0,K.jsxs)(`span`,{className:`sp-chip`,children:[wo(e.estimate_ms),` · `,e.estimate_source===`measured`?`measured`:`estimate`]}),e.repeats&&(0,K.jsxs)(`span`,{className:`sp-chip`,children:[J.refresh(12),` Repeats in a loop`]}),e.side_effect&&(0,K.jsx)(`span`,{className:`sp-chip side`,children:k?`Writes something`:`Side effect · behind a gate`})]}),e.kind===`gate`&&(0,K.jsxs)(`div`,{className:`sp-sec`,children:[(0,K.jsxs)(`div`,{className:`sp-lock`,children:[J.lock(18),(0,K.jsx)(`span`,{children:`Always gated. Money and messages never move without you. The Planner can add gates but never remove them.`})]}),a&&(0,K.jsxs)(`div`,{className:`sp-row`,children:[(0,K.jsx)(`button`,{className:`btn warn`,type:`button`,onClick:l.approve,children:`Approve`}),(0,K.jsx)(`button`,{className:`btn`,type:`button`,onClick:l.reject,children:`Reject`})]})]}),e.status===`unconfirmed`&&(0,K.jsxs)(`div`,{className:`sp-sec`,children:[(0,K.jsxs)(`div`,{className:`sp-unc`,children:[J.question(18),(0,K.jsx)(`span`,{children:O?`Unconfirmed: the code only mentions it, and no call was found. It isn't checked until you confirm it.`:`Unconfirmed. It never runs until you confirm it or the Planner finds code that calls it.`})]}),D&&(0,K.jsxs)(`div`,{className:`sp-row`,children:[(0,K.jsx)(`button`,{className:`btn`,type:`button`,disabled:v,onClick:()=>T({op:`confirm`,node:e.id}),children:O?`Keep it`:`Keep as my step`}),(0,K.jsx)(`button`,{className:`btn danger`,type:`button`,disabled:v,onClick:()=>T({op:`hide`,node:e.id}),children:`Hide it`})]})]}),e.kind===`decision`&&(0,K.jsxs)(`div`,{className:`sp-sec`,children:[(0,K.jsx)(`span`,{className:`sp-sh`,children:`Condition, from the code`}),e.condition&&(0,K.jsx)(`div`,{className:`sp-cond`,children:e.condition}),t.edges.filter(t=>t.source===e.id&&t.kind===`branch`).map(e=>(0,K.jsxs)(`div`,{className:`sp-br`,children:[(0,K.jsx)(`code`,{children:e.when}),(0,K.jsx)(`span`,{children:t.nodes.find(t=>t.id===e.target)?.title??e.target})]},e.id))]}),j&&(!(O||k)||e.connector)&&(0,K.jsxs)(`div`,{className:`sp-sec`,children:[(0,K.jsx)(`span`,{className:`sp-sh`,children:`App`}),(0,K.jsxs)(`div`,{className:`sp-conn`,children:[n&&(0,K.jsx)(no,{c:n,size:36}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`b`,{children:N?.name??e.connector}),(0,K.jsx)(`small`,{children:N?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`chip-dot`,style:{background:`var(--teal)`,width:7,height:7}}),N.model??N.type]}):`not connected`})]})]}),D&&ee.length>1&&(0,K.jsxs)(`label`,{className:`field`,children:[`Use another app for this step`,(0,K.jsx)(`select`,{value:e.connector??``,disabled:v,onChange:t=>T({op:`set_connector`,node:e.id,connector:t.target.value}),children:ee.map(e=>(0,K.jsx)(`option`,{value:e.id,children:e.name},e.id))})]})]}),s&&e.tip&&D&&(0,K.jsx)(`div`,{className:`sp-sec`,children:(0,K.jsxs)(`div`,{className:`sp-tip`,children:[(0,K.jsxs)(`span`,{className:`h`,children:[J.spark(15),` Better fit, found in the test run`]}),(0,K.jsx)(`p`,{children:e.tip.text}),(0,K.jsxs)(`div`,{className:`sp-row`,children:[(0,K.jsxs)(`button`,{className:`btn`,type:`button`,disabled:v,onClick:()=>T({op:`set_connector`,node:e.id,connector:e.tip.connector}),children:[`Use `,t.apps[e.tip.connector]?.name??o.find(t=>t.id===e.tip.connector)?.name??e.tip.connector]}),(0,K.jsx)(`button`,{className:`btn`,type:`button`,onClick:()=>l.dismissTip(e.id),children:`Keep it as it is`})]})]})}),e.evidence.length>0&&(0,K.jsxs)(`details`,{className:`sp-sec sp-fold`,children:[(0,K.jsxs)(`summary`,{children:[J.file(14),` Code · `,e.evidence.find(e=>e.ref)?.ref??`${e.evidence.length} places`]}),e.evidence.map((e,t)=>(0,K.jsx)(zw,{ev:e},t))]}),e.stats&&e.stats.history.length>0&&(0,K.jsxs)(`div`,{className:`sp-sec`,children:[(0,K.jsxs)(`span`,{className:`sp-sh`,children:[`Last `,e.stats.history.length,` runs`]}),(0,K.jsx)(`div`,{className:`sp-bars`,"aria-hidden":`true`,children:e.stats.history.map((e,t)=>(0,K.jsx)(`span`,{className:e.ok?``:`fail`,style:{height:`${Math.max(12,e.ms/re*100)}%`}},t))}),(0,K.jsx)(`span`,{className:`sp-note`,children:e.stats.summary})]}),D&&(0,K.jsxs)(`details`,{className:`sp-sec sp-fold`,children:[(0,K.jsxs)(`summary`,{children:[J.pencil(14),` Edit`]}),!M&&(0,K.jsxs)(`form`,{onSubmit:E,className:`sp-row`,style:{alignItems:`flex-end`},children:[(0,K.jsxs)(`label`,{className:`field`,style:{flex:`1 1 200px`},children:[`Name`,(0,K.jsx)(`input`,{value:g,maxLength:80,onChange:e=>_(e.target.value)})]}),(0,K.jsx)(`button`,{className:`btn`,type:`submit`,disabled:v||!g.trim()||g.trim()===e.title,children:`Rename`})]}),A&&(0,K.jsxs)(`label`,{className:`field`,children:[`Runs after`,(0,K.jsxs)(`select`,{value:P,disabled:v,onChange:t=>t.target.value&&T({op:`add_edge`,node:e.id,source:t.target.value}),children:[(0,K.jsx)(`option`,{value:``,children:`Pick a step`}),t.nodes.filter(t=>t.id!==e.id&&t.kind!==`end`).map(e=>(0,K.jsx)(`option`,{value:e.id,children:e.title},e.id))]})]}),(0,K.jsxs)(`div`,{className:`sp-row`,children:[e.yours.length>0&&!A&&(0,K.jsx)(`button`,{className:`btn`,type:`button`,disabled:v,onClick:()=>T(null,!0),children:`Back to the Planner's version`}),A?(0,K.jsx)(`button`,{className:`btn danger`,type:`button`,disabled:v,onClick:()=>T(null,!0),children:`Delete this step`}):(0,K.jsx)(`button`,{className:`btn danger`,type:`button`,disabled:v||M,onClick:()=>T({op:`hide`,node:e.id}),title:M?`Gates, starts and ends always stay`:void 0,children:e.kind===`gate`?`Gates can't be removed`:M?`Can't be hidden`:`Hide from my map`})]}),b&&(0,K.jsx)(`p`,{className:`sp-note`,role:`alert`,style:{color:`var(--coral)`},children:b}),(0,K.jsx)(`p`,{className:`sp-note`,children:A?`Your own step: no code calls it.`:`Edits change the map, never your code.`})]})]})}var Vw=`flowforge.tips.dismissed`,Hw={llm:`llm`,api:`http`,mcp:`mcp`,local:`local`};function Uw(e,t){return typeof window>`u`?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}function Ww(){try{return new Set(JSON.parse(localStorage.getItem(Vw)??`[]`))}catch{return new Set}}function Gw(){let e=Go(),t=aw(),[n,r]=(0,S.useState)(`mine`),i=V(`/flow?layer=${n}${ow(t,`&`)}`),a=V(i.data?.available&&(i.data.kind??`flow`)===`flow`?`/flow/trace${ow(t)}`:null),o=V(`/connectors`),[s,c]=(0,S.useState)(null);if(i.error)return(0,K.jsx)(`div`,{style:{padding:24},children:(0,K.jsx)(go,{error:i.error,what:`the map`})});if(!i.data)return(0,K.jsx)(`div`,{className:`fm`,"aria-busy":`true`,children:(0,K.jsx)(`div`,{className:`fm-stage`,children:(0,K.jsx)(`div`,{className:`fm-canvas skeleton`})})});if(!i.data.available)return(0,K.jsx)(`div`,{style:{padding:`32px clamp(16px, 3vw, 40px)`},children:(0,K.jsx)(ho,{tone:`violet`,icon:J.map(28),title:`No map yet`,action:t===`deps`&&!e.example?(0,K.jsx)(Jw,{onDone:i.reload}):void 0,children:i.data.message})});let l=i.data.source===`code`?i.data.actions??[]:[],u=l.length>1?l.find(e=>e.id===s)??l[0]:null;return(0,K.jsx)(Iv,{children:(0,K.jsx)(Zw,{map:t,flow:u?Kw(i.data,u):l.length===1?{...i.data,written_ms:l[0].written_ms}:i.data,trace:a.data??null,connectors:o.data??[],layer:n,setLayer:r,reload:i.reload,actions:l,action:u?.id??null,setAction:c},`${t}:${u?.id??``}`)})}function Kw(e,t){let n=new Set([t.id,...e.nodes.filter(e=>e.added_by===`user`).map(e=>e.id)]);for(let t=!0;t;){t=!1;for(let r of e.edges)n.has(r.source)&&!n.has(r.target)&&(n.add(r.target),t=!0)}let r=new Set(t.path),i=new Set(t.path.slice(1).map((e,n)=>`${t.path[n]}>${e}`)),a=e.nodes.filter(e=>n.has(e.id)).map(e=>({...e,on_critical_path:r.has(e.id)})),o=a.filter(e=>r.has(e.id)).sort((e,t)=>(t.estimate_ms??0)-(e.estimate_ms??0))[0];return{...e,nodes:a,positions:{},edges:e.edges.filter(e=>n.has(e.source)&&n.has(e.target)).map(e=>({...e,on_critical_path:i.has(`${e.source}>${e.target}`)})),critical_path:{path:t.path,length_ms:t.could_ms,bottleneck:o?.id??null},written_ms:t.written_ms,advice:(e.advice??[]).filter(e=>e.nodes.every(e=>n.has(e)))}}function qw({actions:e,value:t,onChange:n}){return(0,K.jsxs)(`label`,{className:`fm-action`,children:[(0,K.jsx)(`span`,{children:`Action`}),(0,K.jsx)(`select`,{value:t??``,onChange:e=>n(e.target.value),children:e.map(e=>(0,K.jsxs)(`option`,{value:e.id,children:[e.title,` · `,wo(e.written_ms)]},e.id))})]})}function Jw({onDone:e,current:t}){let[n,r]=(0,S.useState)(``),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(),[c,l]=(0,S.useState)(!1),u=async r=>{a(!0),s(void 0);try{await aa.post(`/scan`,r?{path:n.trim(),replace:!0}:{path:n.trim()}),e()}catch(e){t&&e instanceof ia&&e.status===409?l(!0):s(e instanceof Error?e.message:String(e))}finally{a(!1)}};return(0,K.jsxs)(`form`,{className:`scan-form`,onSubmit:e=>{e.preventDefault(),u(!1)},children:[(0,K.jsxs)(`label`,{className:`field`,children:[(0,K.jsx)(`span`,{children:`Folder to scan`}),(0,K.jsx)(`input`,{value:n,onChange:e=>{r(e.target.value),l(!1)},placeholder:`/home/you/my-app`,className:`mono`,autoComplete:`off`,spellCheck:!1})]}),c?(0,K.jsxs)(`div`,{className:`notice`,role:`alert`,children:[(0,K.jsxs)(`p`,{style:{margin:`0 0 10px`},children:[`A different folder: `,t,`'s map and its versions are deleted.`]}),(0,K.jsx)(`button`,{className:`btn warn`,type:`button`,onClick:()=>void u(!0),disabled:i,children:i?`Scanning…`:`Replace the map`})]}):(0,K.jsx)(`button`,{className:`btn primary`,type:`submit`,disabled:i||!n.trim(),children:i?`Scanning…`:`Scan this folder`}),o&&(0,K.jsx)(`div`,{className:`notice`,role:`alert`,children:o}),(0,K.jsx)(`small`,{children:`Read on this machine only. Nothing in it runs, and nothing is sent.`})]})}function Yw(){return(0,K.jsxs)(`div`,{className:`scan-form`,children:[(0,K.jsx)(`span`,{children:`This is example data. To map your own folder, stop FlowForge and run:`}),(0,K.jsx)(`code`,{className:`mono`,children:`uv run flowforge --repo /home/you/my-app`}),(0,K.jsx)(`small`,{children:`Read on this machine only. Nothing in it runs, and nothing is sent.`})]})}var Xw=7e3;function Zw({map:e,flow:t,trace:n,connectors:r,layer:i,setLayer:a,reload:o,actions:s=[],action:c=null,setAction:l}){let u=t.kind===`dependencies`,d=t.source===`code`,[f,p]=Yi(),m=e=>p(e===`flow`?{...Object.fromEntries(f),map:`flow`}:{}),[h,g]=(0,S.useState)(null),_=V(d?`/scan`:null),v=ow(e),y=Go(),b=_r(),x=Pg(),{zoom:C}=Kv(),[w,T,E]=qv([]),[D,O]=(0,S.useState)(null),[k,A]=(0,S.useState)(!1),j=Ro(u),M=(0,S.useMemo)(()=>Object.fromEntries(j.items.map(e=>[e.id,e])),[j.items]),ee=V(u?`/security`:null),N=(0,S.useMemo)(()=>{let e={};for(let t of ee.data?.findings??[])t.dep_id&&(e[t.dep_id]??=[]).push(t);return e},[ee.data]),[P,te]=(0,S.useState)(``),[ne,re]=(0,S.useState)(d),[F,I]=(0,S.useState)(!1),[ie,ae]=(0,S.useState)(!1),[oe,se]=(0,S.useState)(!1),[ce,le]=(0,S.useState)(!1),ue=d&&!ce,de=ue?FC:PC,fe=s.length>1,[pe,L]=(0,S.useState)(HC),R=e=>{L(e),UC(e)},[me,he]=(0,S.useState)(Ww),[ge,_e]=(0,S.useState)(null),[ve,ye]=(0,S.useState)(!1),[be,xe]=(0,S.useState)(),Se=(0,S.useRef)(0),Ce=(0,S.useRef)({}),we=(0,S.useRef)(!1),Te=(0,S.useMemo)(()=>Object.fromEntries(t.nodes.map(e=>[e.id,e.kind])),[t.nodes]),Ee=(0,S.useMemo)(()=>n??(d?Gy(t):null),[n,d,t]),De=(0,S.useMemo)(()=>Ee?kw(t.nodes,t.edges,Ee):null,[t.nodes,t.edges,Ee]),Oe=(0,S.useMemo)(()=>ge&&De?Mw(De,ge.t,ge.approved,ge.rejected):null,[ge,De]),ke=(0,S.useCallback)(e=>{if(!e)return null;let n=t.apps[e];return r.find(t=>t.id===e)||{id:e,type:n?.type??`http`,name:n?.name??e}},[t.apps,r]),Ae=(0,S.useCallback)(e=>{if(e.kind===`gate`||e.kind===`end`)return null;if(e.connector)return ke(e.connector);let t=Hw[e.kind];return(u||d)&&t?{id:e.catalog??e.id,type:t,name:e.title}:null},[ke,u,d]),je=P.trim().toLowerCase(),Me=(0,S.useMemo)(()=>new Set(je?t.nodes.filter(e=>[e.title,e.connector,t.apps[e.connector??``]?.name,e.op?.tool,e.op?.path,e.what,...e.evidence.map(e=>e.ref)].filter(Boolean).join(` `).toLowerCase().includes(je)).map(e=>e.id):[]),[je,t.nodes,t.apps]),Ne=(0,S.useCallback)(e=>{let n=t.nodes.find(t=>t.id===e);if(!n)return null;let r=t.edges.find(t=>t.kind===`retry`&&t.source===e);return{node:n,tile:Ae(n),deps:u,code:d,theme:pe,state:Oe?.nodes[e]??`idle`,cap:Oe?.caps[e]??``,cp:ne&&n.on_critical_path,search:je?Me.has(e)?`hit`:`miss`:h?h.has(e)?`hit`:`miss`:null,showTip:!me.has(e)&&!Oe,showEvidence:F,retryMax:r?.max??null,health:u&&M[e]?M[e]:void 0,risk:N[e]?Ay(N[e]):void 0,compact:ue}},[t.nodes,t.edges,Ae,u,d,pe,Oe,je,Me,ne,me,F,M,h,N,ue]),Pe=pe===`boxed`&&!u,[Fe,Ie]=(0,S.useState)(!0);(0,S.useEffect)(()=>{let e=window.setTimeout(()=>Ie(!1),2600);return()=>window.clearTimeout(e)},[]);let Le=(0,S.useCallback)(e=>{let n=n=>{let r=new Set([e]),i=[e];for(;i.length;){let e=i.pop();for(let a of t.edges){let[t,o]=n(a);t===e&&!r.has(o)&&(r.add(o),i.push(o))}}return r};return new Set([...n(e=>[e.target,e.source]),...n(e=>[e.source,e.target])])},[t.edges]),Re=(0,S.useRef)(Pe),ze=(0,S.useRef)(ue);(0,S.useEffect)(()=>{let e=LC(t.nodes,t.edges,t.positions,de),n=Pe?YC(t,e,de):e,r=Re.current!==Pe||ze.current!==ue;Re.current=Pe,ze.current=ue,T(e=>{let i=Pe||r?{}:Object.fromEntries(e.map(e=>[e.id,e.position]));return t.nodes.map(t=>{let r=de(t.kind),a=i[t.id]??{x:n[t.id][0],y:n[t.id][1]};return{id:t.id,type:Ew(t.kind),position:a,width:r.w,height:r.h,data:Ne(t.id),selected:e.find(e=>e.id===t.id)?.selected??!1}})}),r&&window.requestAnimationFrame(()=>x.fitView({padding:.08,maxZoom:1.1,duration:400}))},[t,Pe,ue]),(0,S.useEffect)(()=>{T(e=>e.map(e=>({...e,data:Ne(e.id)??e.data})))},[Ne,T]),(0,S.useEffect)(()=>{!we.current&&w.length&&(we.current=!0,window.requestAnimationFrame(()=>x.fitView({padding:.08,maxZoom:1.1})))},[w.length,x]);let Be=(0,S.useCallback)((e=!1)=>{window.clearTimeout(Se.current),Se.current=window.setTimeout(()=>{let t=Ce.current;Ce.current={},Object.keys(t).length&&aa.put(`/flow/positions${v}`,{positions:t,replace:e}).catch(()=>void 0)},e?0:400)},[v]),Ve=(0,S.useCallback)(e=>{E(e);for(let t of e)t.type===`position`&&t.position&&!t.dragging&&!Pe&&!fe&&(Ce.current[t.id]=[Math.round(t.position.x),Math.round(t.position.y)],Be())},[E,Be,Pe,fe]),He=(0,S.useCallback)(({nodes:e})=>{O(e[0]?.id??null)},[]),Ue=(0,S.useMemo)(()=>Object.fromEntries(w.map(e=>[e.id,[e.position.x,e.position.y]])),[w]),We=(0,S.useMemo)(()=>{let e=t.critical_path.path;return new Set(e.slice(1).map((t,n)=>`${e[n]}>${t}`))},[t.critical_path.path]),Ge=(0,S.useMemo)(()=>{let e=Ly(t),n=Math.max(1,...Object.values(e));return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,t/n*1.2]))},[t]),Ke=(0,S.useMemo)(()=>t.edges.filter(e=>Te[e.source]&&Te[e.target]).map(e=>{let t=zC(e,Te,Ue);return{id:e.id,source:e.source,target:e.target,type:`flow`,sourceHandle:t.s,targetHandle:t.t,focusable:!1,selectable:!1,data:{edge:e,state:Oe?.edges[e.id]??`idle`,cp:ne&&We.has(`${e.source}>${e.target}`),dim:!!je&&!(Me.has(e.source)&&Me.has(e.target)),guard:!u&&!d&&Te[e.target]===`llm`&&e.kind!==`fallback`,theme:pe,to:Te[e.target],delay:Ge[e.source]??0}}}),[t.edges,Te,Ue,Oe,ne,We,je,Me,u,d,pe,Ge]),qe=(0,S.useMemo)(()=>pe===`boxed`?GC(t,w):[],[pe,t,w]);(0,S.useEffect)(()=>{if(!ge?.running||!De)return;let e=0,t=performance.now(),n=De.gate?De.gate.start_ms:null,r=i=>{let a=i-t;t=i,_e(e=>{if(!e||!e.running)return e;let t=e.t+a*e.speed,r=n!==null&&!e.approved&&!e.rejected&&t>=n;return{...e,t:r?n:t}}),e=requestAnimationFrame(r)};return e=requestAnimationFrame(r),()=>cancelAnimationFrame(e)},[ge?.running,De]),(0,S.useEffect)(()=>{Oe?.done&&ge?.running&&_e(e=>e&&{...e,running:!1})},[Oe?.done,ge?.running]);let Je=()=>{let e=typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches,t=d?Math.max(1,(De?.end??0)/Xw):1;_e({t:e&&d?De?.end??0:0,running:!0,approved:!1,rejected:!1,speed:t}),O(null)},Ye=()=>_e(e=>e&&{...e,approved:!0,running:!0}),Xe=()=>_e(e=>e&&{...e,rejected:!0,running:!0}),Ze=async e=>{await aa.post(`/flow/overrides${v}`,e),o()},Qe=async e=>{await aa.del(`/flow/nodes/${encodeURIComponent(e)}/overrides${v}`),o()},$e=e=>{let t=new Set(me).add(e);he(t);try{localStorage.setItem(Vw,JSON.stringify([...t]))}catch{}},et=async()=>{let e=document.querySelector(`.fm-canvas`)?.getBoundingClientRect(),t=e?x.screenToFlowPosition({x:e.left+e.width/2,y:e.top+e.height/2}):{x:0,y:0},n=`${u?`dep`:`step`}_${Date.now().toString(36)}`,r=u?{id:n,kind:`api`,title:`New dependency`,what:`A dependency you added.`}:{id:n,kind:`code`,title:`New step`,what:`A step you added.`};try{await aa.put(`/flow/positions${v}`,{positions:{[n]:[Math.round(t.x-98),Math.round(t.y-32)]}}),await aa.post(`/flow/overrides${v}`,{op:`add_node`,new_node:r}),a(`mine`),o(),O(n)}catch(e){xe(e instanceof Error?e.message:String(e))}},tt=()=>{let e=IC(t.nodes,t.edges,de);if(Pe||fe){let n=Pe?YC(t,e,de):e;T(e=>e.map(e=>n[e.id]?{...e,position:{x:n[e.id][0],y:n[e.id][1]}}:e)),window.setTimeout(()=>x.fitView({padding:.08,duration:500}),30)}else T(t=>t.map(t=>e[t.id]?{...t,position:{x:e[t.id][0],y:e[t.id][1]}}:t)),Ce.current={...e},Be(!0),window.setTimeout(()=>x.fitView({padding:.08,duration:500}),30)},nt=async()=>{if(t.pending)b(`/map/recheck${v}`);else{ye(!0);try{await aa.post(`/flow/recheck${v}`),b(`/map/recheck${v}`)}catch(e){xe(e instanceof Error?e.message:String(e)),ye(!1)}}},rt=e=>{let t=x.getNode(e);t&&(O(e),T(t=>t.map(t=>({...t,selected:t.id===e}))),x.setCenter(t.position.x+(t.width??196)/2,t.position.y+(t.height??64)/2,{zoom:Math.max(C,.9),duration:450}))},it=f.get(`focus`),at=(0,S.useRef)(null);(0,S.useEffect)(()=>{if(!it||at.current===it||!w.some(e=>e.id===it))return;at.current=it,window.setTimeout(()=>rt(it),120);let e=Object.fromEntries(f);delete e.focus,p(e,{replace:!0})},[it,w]);let ot=D?t.nodes.find(e=>e.id===D):void 0,st=t.nodes.find(e=>e.id===`app`)?.title,ct=!!ge&&!Oe?.done,lt=Oe?(Oe.t/1e3).toFixed(1):`0.0`,ut=Oe?Math.round(Object.values(Oe.nodes).filter(e=>![`idle`,`running`,`retry`,`waiting`].includes(e)).length/Math.max(1,t.nodes.length)*100):0,dt=!!Oe&&!!n&&n.steps.some(e=>e.outcome===`failed`&&Oe.nodes[e.node]===`failed`),ft=u||d?t.pending?`Review the re-scan`:ve?`Re-scanning…`:`Re-scan the repo`:t.pending?`Review the re-check`:ve?`Re-checking…`:`Re-check the repo`,pt=[{kind:`head`,label:u?`Map`:`Flow`},...u?[{kind:`action`,label:`Scan another folder`,icon:J.search(16),onClick:()=>A(!0)}]:[],{kind:`toggle`,label:`Show my edits (${t.counts.edits})`,on:i===`mine`,onClick:()=>a(i===`mine`?`planner`:`mine`)},{kind:`action`,label:u?`Add a block`:`Add a step`,icon:J.addBox(16),onClick:()=>void et()},...u?[{kind:`link`,label:`Apps and connectors`,icon:J.plug(16),to:`/connectors`}]:[],{kind:`link`,label:u?`How it was mapped`:d?`How it was read`:`How it was drawn`,icon:J.question(16),to:`/map/how${v}`},{kind:`head`,label:`View`},{kind:`action`,label:`Re-tidy`,icon:J.tidy(16),onClick:tt},...u?[]:[{kind:`toggle`,label:`Critical path`,on:ne,onClick:()=>re(e=>!e)}],...d?[{kind:`toggle`,label:`Show every check`,on:ce,onClick:()=>le(e=>!e)}]:[],{kind:`toggle`,label:`File and line under blocks`,on:F,onClick:()=>I(e=>!e)},{kind:`toggle`,label:`Legend`,on:ie,onClick:()=>ae(e=>!e)},{kind:`toggle`,label:`Minimap`,on:oe,onClick:()=>se(e=>!e)}],mt=BC.map(e=>({kind:`radio`,label:e.name,note:e.note,on:e.id===pe,swatch:`sw-${e.id}`,onClick:()=>R(e.id)}));return(0,K.jsxs)(`div`,{className:`fm${Fe?` drawing`:``}`,"data-graph":pe,children:[(0,K.jsx)(iw,{}),(0,K.jsxs)(`header`,{className:`fm-top`,children:[(0,K.jsxs)(`div`,{className:`fm-proj`,children:[(0,K.jsx)(`h1`,{children:u?st??y.project:d?_.data?.name??y.project:y.project}),y.example&&(0,K.jsx)(`span`,{className:`chip tone-violet fm-ex`,children:`Example`})]}),(0,K.jsxs)(`div`,{className:`seg`,role:`group`,"aria-label":`Which map`,children:[(0,K.jsx)(`button`,{type:`button`,"aria-pressed":e===`deps`,onClick:()=>m(`deps`),children:`Dependencies`}),(0,K.jsx)(`button`,{type:`button`,"aria-pressed":e===`flow`,onClick:()=>m(`flow`),children:`Flow`})]}),fe&&l&&(0,K.jsx)(qw,{actions:s,value:c,onChange:l}),(0,K.jsxs)(`div`,{className:`fm-actions`,children:[u&&(0,K.jsx)(My,{findings:ee.data?.findings??[],onShow:rt}),!u&&!d&&(0,K.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:Je,disabled:!n||ct,children:[J.play(18),` `,ct?`Running…`:`Test run`]}),(0,K.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>void nt(),disabled:ve,children:[J.refresh(18),` `,ft]}),(0,K.jsxs)(z,{className:`btn`,to:`/map/export${v}`,children:[J.share(18),` Export`]}),(0,K.jsx)(sw,{items:mt,label:`Map style`,button:(0,K.jsxs)(K.Fragment,{children:[J.monitor(18),` Style`]})}),u&&j.items.length>0&&(0,K.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:()=>void j.checkNow(),disabled:j.running,children:[J.activity(18),` `,j.progress?`Checking ${j.progress.done}/${j.progress.total}…`:j.running?`Checking…`:`Check now`]}),(0,K.jsx)(sw,{items:pt})]})]}),j.asking&&(0,K.jsx)(Y,{asking:j.asking,onStart:j.confirm,onWithout:j.withoutStarts,onCancel:j.cancel}),j.error&&(0,K.jsx)(`div`,{className:`notice`,role:`alert`,style:{margin:`8px 16px 0`},children:j.error}),k&&(0,K.jsx)(`section`,{className:`fm-scan`,"aria-label":`Scan a folder`,children:y.example?(0,K.jsx)(Yw,{}):(0,K.jsx)(Jw,{current:st,onDone:()=>{A(!1),o()}})}),be&&(0,K.jsx)(`div`,{className:`notice`,role:`alert`,style:{margin:`8px 16px 0`},children:be}),(0,K.jsxs)(`div`,{className:`fm-stage`,children:[(0,K.jsxs)(`div`,{className:`fm-canvas`,style:{backgroundImage:`radial-gradient(var(--dot) 1.1px, transparent 1.4px)`,backgroundSize:`${22*C}px ${22*C}px`},children:[(0,K.jsxs)(Bv,{nodes:w,edges:Ke,onNodeMouseEnter:(e,t)=>{ge||g(Le(t.id))},onNodeMouseLeave:()=>g(null),onFocus:e=>{let t=e.target.closest(`.react-flow__node`)?.getAttribute(`data-id`);t&&!ge&&g(Le(t))},onBlur:e=>{e.target.closest(`.react-flow__node`)&&g(null)},nodeTypes:Tw,edgeTypes:rw,onNodesChange:Ve,onSelectionChange:He,onPaneClick:()=>O(null),nodesConnectable:!1,edgesFocusable:!1,elementsSelectable:!0,minZoom:.15,maxZoom:1.8,fitView:!0,fitViewOptions:{padding:.08,maxZoom:1.1},proOptions:{hideAttribution:!0},"aria-label":`Flow map`,zoomOnDoubleClick:!1,deleteKeyCode:null,children:[qe.length>0&&(0,K.jsx)(Wv,{children:qe.map(e=>(0,K.jsxs)(`div`,{className:`ff-box`,role:`group`,"aria-label":/^\d+$/.test(e.note)?e.label:`${e.label} ${e.note}`,style:{transform:`translate(${e.x}px, ${e.y}px)`,width:e.w,height:e.h},children:[(0,K.jsx)(`span`,{className:`ff-box-label`,children:e.label}),e.note&&(0,K.jsx)(`span`,{className:`ff-box-note`,children:e.note})]},e.key))}),oe&&(0,K.jsx)(Ty,{position:`bottom-right`,pannable:!0,zoomable:!0,ariaLabel:`Mini map`,nodeStrokeWidth:0,nodeColor:e=>{let t=e.data.node.kind;return Uw(t===`llm`?`--violet`:t===`gate`?`--amber-strong`:`--line-2`,`#9AAAB4`)},maskColor:Uw(`--mask`,`rgba(120, 140, 150, 0.18)`)})]}),(0,K.jsxs)(`div`,{className:`fm-float fm-tools`,role:`toolbar`,"aria-label":`Map tools`,children:[(0,K.jsx)(`button`,{className:`fm-ib`,type:`button`,"aria-label":`Zoom out`,onClick:()=>x.zoomOut({duration:200}),children:J.minus(18)}),(0,K.jsx)(`button`,{className:`fm-ib`,type:`button`,"aria-label":`Zoom in`,onClick:()=>x.zoomIn({duration:200}),children:J.plus(18)}),(0,K.jsx)(`button`,{className:`fm-ib`,type:`button`,"aria-label":`Fit to screen`,onClick:()=>x.fitView({padding:.08,duration:450}),children:J.fit(18)})]}),(0,K.jsxs)(`label`,{className:`fm-float fm-search`,children:[J.search(18),(0,K.jsx)(`span`,{className:`visually-hidden`,children:`Find a step`}),(0,K.jsx)(`input`,{type:`search`,name:`find-step`,placeholder:u?`Find a dependency, host or file`:`Find a step, app or file`,value:P,onChange:e=>te(e.target.value),onKeyDown:e=>{e.key===`Enter`&&Me.size&&rt([...Me][0]),e.key===`Escape`&&te(``)}}),je&&(0,K.jsxs)(`span`,{className:`c`,children:[Me.size,` found`]})]}),ie&&(0,K.jsxs)(`div`,{className:`fm-float fm-legend`,role:`region`,"aria-label":`Legend`,children:[(0,K.jsxs)(`button`,{className:`fm-lh`,type:`button`,onClick:()=>ae(!1),children:[(0,K.jsx)(`span`,{children:`Legend`}),J.close(15)]}),u?(0,K.jsx)(Qw,{}):d?(0,K.jsx)($w,{}):(0,K.jsx)(eT,{})]}),Oe&&Ee&&(d||n)&&(0,K.jsxs)(`div`,{className:`fm-float fm-hud`,role:`status`,"aria-live":`polite`,children:[(0,K.jsxs)(`span`,{className:`s`,children:[(0,K.jsx)(`span`,{className:`d`,style:{background:Oe.waiting?`var(--amber-strong)`:Oe.done?ge?.rejected?`var(--coral)`:`var(--teal)`:`var(--blue)`}}),Oe.waiting?`Waiting for you`:Oe.done?ge?.rejected?`Stopped at your gate`:d?`Schedule played`:`Test run done`:d?`Watch it run · ${Ee.label}`:`Test run · ${Ee.label}`]}),(0,K.jsxs)(`span`,{className:`m`,children:[lt,` s`,dt?` · a fallback answered`:``]}),(0,K.jsx)(`span`,{className:`fm-prog`,"aria-hidden":`true`,children:(0,K.jsx)(`span`,{style:{width:`${ut}%`}})}),!d&&(0,K.jsxs)(`span`,{className:`m`,children:[Oe.calls,` calls · `,Oe.cached,` cached · `,(Oe.tokens/1e3).toFixed(1),`k tokens`]}),Oe.waiting&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`button`,{className:`btn warn`,type:`button`,onClick:Ye,children:[`Approve: `,t.nodes.find(e=>e.id===Oe.waiting)?.title]}),(0,K.jsx)(`button`,{className:`btn`,type:`button`,onClick:Xe,children:`Reject`})]}),Oe.done&&(0,K.jsx)(`button`,{className:`btn`,type:`button`,onClick:()=>_e(null),children:`Clear`})]})]}),ot&&(0,K.jsx)(Bw,{node:ot,flow:t,tile:Ae(ot),health:u?M[ot.id]:void 0,example:y.example,checking:j.running,findings:N[ot.id],othersUp:j.items.filter(e=>e.status===`up`&&e.id!==ot.id).length,onCheck:e=>void j.checkNow([e]),state:Oe?.nodes[ot.id]??`idle`,cap:Oe?.caps[ot.id]??``,waiting:Oe?.waiting===ot.id,connectors:r,tipShown:!me.has(ot.id),layer:i,actions:{close:()=>{O(null),T(e=>e.map(e=>({...e,selected:!1})))},approve:Ye,reject:Xe,edit:Ze,reset:Qe,dismissTip:$e}},ot.id),!ot&&d&&(0,K.jsx)(Uy,{flow:t,onPoint:e=>g(e?new Set(e):null),onWatch:Je,watching:ct,canWatch:!!De})]})]})}function Qw(){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`fm-lrow`,children:[(0,K.jsx)(`span`,{className:`fm-lg`,children:(0,K.jsx)(`span`,{className:`lg-card lg-llm`})}),`LLM`]}),(0,K.jsxs)(`div`,{className:`fm-lrow`,children:[(0,K.jsx)(`span`,{className:`fm-lg`,children:(0,K.jsx)(`span`,{className:`lg-card`})}),`API, MCP server or local command`]}),(0,K.jsxs)(`div`,{className:`fm-lrow`,children:[(0,K.jsx)(`span`,{className:`fm-lg`,children:(0,K.jsx)(`span`,{className:`lg-card lg-unc`})}),`Unconfirmed: mentioned, no call found`]}),(0,K.jsx)(`div`,{className:`fm-ldiv`}),(0,K.jsxs)(`div`,{className:`fm-lrow`,children:[(0,K.jsx)(`span`,{className:`fm-lg`,children:(0,K.jsx)(`svg`,{width:`28`,height:`8`,viewBox:`0 0 28 8`,"aria-hidden":`true`,children:(0,K.jsx)(`path`,{d:`M1 4h26`,style:{stroke:`var(--edge)`,strokeWidth:2}})})}),`Uses`]}),(0,K.jsxs)(`div`,{className:`fm-lrow`,children:[(0,K.jsx)(`span`,{className:`fm-lg`,style:{color:`var(--teal)`},children:J.shield(16)}),`Scanned on your machine. Nothing sent`]}),(0,K.jsx)(`div`,{className:`fm-lhint`,children:`Drag to pan · scroll to zoom · drag a block to move it`})]})}function $w(){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`fm-lrow`,children:[(0,K.jsx)(`span`,{className:`fm-lg`,children:(0,K.jsx)(`span`,{className:`lg-card`})}),`A call to a dependency`]}),(0,K.jsxs)(`div`,{className:`fm-lrow`,children:[(0,K.jsx)(`span`,{className:`fm-lg`,children:(0,K.jsx)(`span`,{className:`lg-card lg-llm`})}),`An LLM call`]}),(0,K.jsxs)(`div`,{className:`fm-lrow`,children:[(0,K.jsx)(`span`,{className:`fm-lg`,children:(0,K.jsx)(`span`,{className:`lg-dia`})}),`An if in the code`]}),(0,K.jsx)(`div`,{className:`fm-ldiv`}),(0,K.jsxs)(`div`,{className:`fm-lrow`,children:[(0,K.jsx)(`span`,{className:`fm-lg`,children:(0,K.jsx)(`svg`,{width:`28`,height:`8`,viewBox:`0 0 28 8`,"aria-hidden":`true`,children:(0,K.jsx)(`path`,{d:`M1 4h26`,style:{stroke:`var(--edge)`,strokeWidth:2}})})}),`Waits for the call before it`]}),(0,K.jsxs)(`div`,{className:`fm-lrow`,children:[(0,K.jsx)(`span`,{className:`fm-lg`,children:(0,K.jsx)(`svg`,{width:`28`,height:`8`,viewBox:`0 0 28 8`,"aria-hidden":`true`,children:(0,K.jsx)(`path`,{d:`M1 4h26`,style:{stroke:`var(--teal)`,strokeWidth:3.5}})})}),`Critical path: sets the total time`]}),(0,K.jsx)(`div`,{className:`fm-lhint`,children:`Every block and line points to its file:line`})]})}function eT(){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`fm-lrow`,children:[(0,K.jsx)(`span`,{className:`fm-lg`,children:(0,K.jsx)(`span`,{className:`lg-card`})}),`App call or your code`]}),(0,K.jsxs)(`div`,{className:`fm-lrow`,children:[(0,K.jsx)(`span`,{className:`fm-lg`,children:(0,K.jsx)(`span`,{className:`lg-card lg-llm`})}),`LLM call`]}),(0,K.jsxs)(`div`,{className:`fm-lrow`,children:[(0,K.jsx)(`span`,{className:`fm-lg`,children:(0,K.jsx)(`span`,{className:`lg-dia`})}),`Decision (yes / no)`]}),(0,K.jsxs)(`div`,{className:`fm-lrow`,children:[(0,K.jsx)(`span`,{className:`fm-lg`,children:(0,K.jsx)(`span`,{className:`lg-bar`})}),`Run together / wait for all`]}),(0,K.jsxs)(`div`,{className:`fm-lrow`,children:[(0,K.jsx)(`span`,{className:`fm-lg`,children:(0,K.jsx)(`span`,{className:`lg-card lg-gate`})}),`You approve (payments, messages)`]}),(0,K.jsxs)(`div`,{className:`fm-lrow`,children:[(0,K.jsx)(`span`,{className:`fm-lg`,children:(0,K.jsx)(`span`,{className:`lg-card lg-unc`})}),`Unconfirmed: no evidence`]}),(0,K.jsx)(`div`,{className:`fm-ldiv`}),(0,K.jsxs)(`div`,{className:`fm-lrow`,children:[(0,K.jsx)(`span`,{className:`fm-lg`,children:(0,K.jsx)(`svg`,{width:`28`,height:`8`,viewBox:`0 0 28 8`,"aria-hidden":`true`,children:(0,K.jsx)(`path`,{d:`M1 4h26`,style:{stroke:`var(--edge)`,strokeWidth:2}})})}),`Data flows this way`]}),(0,K.jsxs)(`div`,{className:`fm-lrow`,children:[(0,K.jsx)(`span`,{className:`fm-lg`,children:(0,K.jsx)(`svg`,{width:`28`,height:`8`,viewBox:`0 0 28 8`,"aria-hidden":`true`,children:(0,K.jsx)(`path`,{d:`M1 4h26`,style:{stroke:`var(--coral)`,strokeWidth:2,strokeDasharray:`5 4`}})})}),`Fallback when a call fails`]}),(0,K.jsxs)(`div`,{className:`fm-lrow`,children:[(0,K.jsx)(`span`,{className:`fm-lg`,style:{color:`var(--teal)`},children:J.shield(16)}),`Keys and personal data removed first`]}),(0,K.jsx)(`div`,{className:`fm-ldiv`}),(0,K.jsxs)(`div`,{className:`fm-ldots`,children:[(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`i`,{style:{background:`var(--teal)`}}),`done`]}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`i`,{style:{background:`var(--blue)`}}),`running`]}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`i`,{style:{background:`var(--amber-strong)`}}),`waits for you`]}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`i`,{style:{background:`var(--coral)`}}),`failed`]}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`i`,{style:{background:`var(--violet)`}}),`Planner`]})]}),(0,K.jsx)(`div`,{className:`fm-lhint`,children:`Drag to pan · scroll to zoom · drag a step to move it`})]})}function tT(){let e=aw(),t=V(`/flow/analysis${ow(e)}`),n=V(`/flow?layer=planner${ow(e,`&`)}`),r=V(`/connectors`),[i,a]=(0,S.useState)(0),[o,s]=(0,S.useState)(0),c=(0,S.useMemo)(()=>(t.data?.stages??[]).reduce((e,t)=>e+t.duration_ms,0),[t.data]);if((0,S.useEffect)(()=>{if(!c)return;if(lo()){a(c+1);return}let e=performance.now(),t=0,n=r=>{let i=r-e;a(i),i<=c&&(t=requestAnimationFrame(n))};return t=requestAnimationFrame(n),()=>cancelAnimationFrame(t)},[c,o]),t.error)return t.error.message.includes(`hasn't drawn`)?(0,K.jsxs)(ho,{tone:`violet`,icon:J.spark(28),title:`No map yet`,children:[`Scan a folder from the map page, or try `,(0,K.jsx)(`code`,{children:`flowforge --example`}),`.`]}):(0,K.jsx)(go,{error:t.error,what:`how the map was drawn`});if(!t.data)return(0,K.jsx)(mo,{lines:8});let l=t.data;if(n.data?.available&&n.data.kind===`dependencies`)return(0,K.jsx)(rT,{a:l,nodes:n.data.nodes});let u=0,d=l.stages.length-1,f=1;for(let e=0;e<l.stages.length;e++){let t=l.stages[e].duration_ms;if(t===0||i<u+t){d=e,f=t?Math.min(1,Math.max(0,(i-u)/t)):1;break}u+=t}let p=d===l.stages.length-1,m=n.data&&n.data.available?n.data.nodes:[],h=d>3?m.length:d===3?Math.round(m.length*f):0,g=l.log.filter(([e])=>e<=i).slice(-10),_=e=>r.data?.find(t=>t.id===e)??{id:e,type:`http`,name:e};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`header`,{className:`page-head`,children:[(0,K.jsxs)(`div`,{className:`titles`,children:[(0,K.jsxs)(`span`,{className:`eyebrow`,children:[`Map v`,l.version,` · `,l.fact_sheet_hash]}),(0,K.jsx)(`h1`,{children:p?`How the Planner mapped your app`:`The Planner is mapping your app`}),(0,K.jsx)(`p`,{className:`lede`,children:`It reads code and traces calls. It sees names, never key values.`})]}),(0,K.jsxs)(`div`,{className:`actions`,children:[(0,K.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>{a(0),s(e=>e+1)},children:[J.refresh(18),` Replay`]}),(0,K.jsx)(`button`,{className:`btn`,type:`button`,onClick:()=>a(c+1),children:`Skip to the end`}),(0,K.jsx)(z,{className:`btn primary`,to:`/${ow(e)}`,children:`Open the map`})]})]}),(0,K.jsxs)(`div`,{className:`how`,children:[(0,K.jsxs)(`section`,{className:`how-stage card raised`,"aria-label":`What the Planner is doing`,children:[d===0&&(0,K.jsx)(`div`,{className:`how-files`,children:l.files.map((e,t)=>(0,K.jsxs)(`span`,{className:`how-file${f*l.files.length>t?` lit`:``}`,children:[J.file(14),e]},e))}),d===1&&(0,K.jsxs)(`div`,{className:`how-box`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`Sandbox · test mode`}),(0,K.jsxs)(`h2`,{children:[`Running the app on `,Math.round(40*f),` of 40 test orders`]}),(0,K.jsx)(`div`,{className:`fm-prog`,style:{width:`100%`,height:8},children:(0,K.jsx)(`span`,{style:{width:`${Math.round(f*100)}%`,background:`var(--blue)`}})}),(0,K.jsx)(`p`,{className:`card-note`,children:`Payments in test mode · email goes to a local sink · no real customer data`})]}),d===2&&(0,K.jsx)(`div`,{className:`how-apps`,children:l.calls.map(e=>(0,K.jsxs)(`div`,{className:`how-app${e.none?` none`:``}`,children:[(0,K.jsx)(no,{c:_(e.app),size:36}),(0,K.jsx)(`b`,{children:_(e.app).name}),(0,K.jsx)(`span`,{className:`n`,children:Math.round(e.count*Math.min(1,f*1.3))}),(0,K.jsx)(`span`,{className:`m`,children:e.meta})]},e.app))}),d>=3&&(0,K.jsxs)(`div`,{className:`how-draft`,children:[(0,K.jsxs)(`div`,{className:`how-chips`,children:[m.slice(0,h).map(e=>(0,K.jsx)(`span`,{className:`how-chip k-${e.kind}${e.status===`unconfirmed`&&d>=4?` unc`:``}`,children:e.title},e.id)),d>=4&&l.dropped.map(e=>(0,K.jsx)(`span`,{className:`how-chip dropped`,title:e.reason,children:e.title},e.title))]}),d>=4&&(0,K.jsxs)(`ul`,{className:`how-checks`,"aria-label":`Checks`,children:[(0,K.jsxs)(`li`,{className:`ok`,children:[(0,K.jsx)(`i`,{children:`✓`}),`No loops`]}),(0,K.jsxs)(`li`,{className:`ok`,children:[(0,K.jsx)(`i`,{children:`✓`}),`Every app it uses is connected`]}),l.dropped.map(e=>(0,K.jsxs)(`li`,{className:`drop`,children:[(0,K.jsx)(`i`,{children:`×`}),`Dropped “`,e.title,`”: `,e.reason]},e.title)),m.filter(e=>e.status===`unconfirmed`).map(e=>(0,K.jsxs)(`li`,{className:`unc`,children:[(0,K.jsx)(`i`,{children:`?`}),`“`,e.title,`” is unconfirmed`]},e.id)),(0,K.jsxs)(`li`,{className:`gate`,children:[(0,K.jsx)(`i`,{children:`!`}),`A gate in front of every payment and message, added by code`]})]})]}),p&&(0,K.jsxs)(`div`,{className:`how-ready`,role:`status`,children:[(0,K.jsxs)(`b`,{children:[`Map v`,l.version,` is ready`]}),(0,K.jsx)(z,{className:`btn primary`,to:`/${ow(e)}`,children:`Open the map`})]})]}),(0,K.jsxs)(`aside`,{className:`how-side`,children:[(0,K.jsxs)(`section`,{className:`card`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`Steps`}),(0,K.jsx)(`ol`,{className:`how-steps`,children:l.stages.map((e,t)=>{let n=t<d||t===d&&p,r=t===d&&!n;return(0,K.jsxs)(`li`,{className:n?`done`:r?`doing`:`todo`,children:[(0,K.jsx)(`span`,{className:`d`,children:n?J.check(14):r?J.refresh(14):t+1}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`b`,{children:e.title}),(0,K.jsx)(`small`,{children:n?e.done:r?`${e.doing}…`:`waiting`})]})]},e.title)})})]}),(0,K.jsxs)(`section`,{className:`card`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`Live log`}),(0,K.jsx)(`div`,{className:`how-log`,role:`log`,"aria-live":`polite`,children:g.map(([e,t,n])=>(0,K.jsxs)(`div`,{className:t,children:[(0,K.jsx)(`b`,{children:t}),(0,K.jsx)(`span`,{children:n})]},e))}),(0,K.jsxs)(`p`,{className:`how-priv`,children:[J.shield(16),` The Planner sees names, never values. Only apps your code calls go on the map, and gates are added by code.`]})]})]})]})]})}var nT={llm:`LLMs`,api:`APIs`,mcp:`MCP servers`,local:`Local commands`};function rT({a:e,nodes:t}){let n=t.filter(e=>e.kind!==`start`),r=Object.keys(nT).filter(e=>n.some(t=>t.kind===e));return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`header`,{className:`page-head`,children:[(0,K.jsxs)(`div`,{className:`titles`,children:[(0,K.jsxs)(`span`,{className:`eyebrow`,children:[`Map v`,e.version,` · `,e.fact_sheet_hash]}),(0,K.jsx)(`h1`,{children:`How your app was mapped`}),(0,K.jsx)(`p`,{className:`lede`,children:`Plain code read your files. Nothing ran, nothing was sent, and no AI saw them.`})]}),(0,K.jsx)(`div`,{className:`actions`,children:(0,K.jsx)(z,{className:`btn primary`,to:`/`,children:`Open the map`})})]}),(0,K.jsxs)(`div`,{className:`how`,children:[(0,K.jsx)(`section`,{className:`how-stage card raised`,"aria-label":`What the scan found`,children:(0,K.jsxs)(`div`,{className:`how-draft`,children:[r.map(e=>(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:nT[e]}),(0,K.jsx)(`div`,{className:`how-chips`,children:n.filter(t=>t.kind===e).map(e=>(0,K.jsx)(`span`,{className:`how-chip k-${e.kind}${e.status===`unconfirmed`?` unc`:``}`,children:e.title},e.id))})]},e)),(0,K.jsxs)(`ul`,{className:`how-checks`,"aria-label":`Checks`,children:[(0,K.jsxs)(`li`,{className:`ok`,children:[(0,K.jsx)(`i`,{children:`✓`}),`Every dependency points to the lines that show it`]}),n.filter(e=>e.status===`unconfirmed`).map(e=>(0,K.jsxs)(`li`,{className:`unc`,children:[(0,K.jsx)(`i`,{children:`?`}),`“`,e.title,`” is mentioned, but no call to it was found`]},e.id)),(0,K.jsxs)(`li`,{className:`ok`,children:[(0,K.jsx)(`i`,{children:`✓`}),`Known key formats in the code were masked before anything was saved`]})]})]})}),(0,K.jsxs)(`aside`,{className:`how-side`,children:[(0,K.jsxs)(`section`,{className:`card`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`Steps`}),(0,K.jsx)(`ol`,{className:`how-steps`,children:e.stages.map(e=>(0,K.jsxs)(`li`,{className:`done`,children:[(0,K.jsx)(`span`,{className:`d`,children:J.check(14)}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`b`,{children:e.title}),(0,K.jsx)(`small`,{children:e.done})]})]},e.title))})]}),(0,K.jsxs)(`section`,{className:`card`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`Files with evidence`}),(0,K.jsx)(`div`,{className:`how-files`,children:e.files.map(e=>(0,K.jsxs)(`span`,{className:`how-file lit`,children:[J.file(14),e]},e))}),(0,K.jsxs)(`p`,{className:`how-priv`,children:[J.shield(16),` Read on this machine only. Env var names are kept, never their values.`]})]})]})]})]})}var iT={add:`Added`,change:`Changed`,remove:`Removed`,conflict:`Needs you`,kept:`Yours, kept`};function aT(){let e=aw(),t=V(`/flow?layer=planner${ow(e,`&`)}`),n=t.data&&t.data.available?t.data.pending:null,r=V(n?`/flow/versions/${n}${ow(e)}`:null),i=V(`/connectors`);return t.error?(0,K.jsx)(go,{error:t.error,what:`the map`}):t.data?!t.data.available||!n?(0,K.jsx)(ho,{tone:`violet`,icon:J.refresh(28),title:`Nothing to review`,action:(0,K.jsx)(z,{className:`btn primary`,to:`/${ow(e)}`,children:`Back to the map`}),children:`Re-check the repo from the map. The Planner looks again and shows you what changed; nothing changes until you save.`}):r.error?(0,K.jsx)(go,{error:r.error,what:`the re-check`}):r.data?(0,K.jsx)(oT,{base:t.data,pending:r.data,connectors:i.data??[]}):(0,K.jsx)(mo,{lines:6}):(0,K.jsx)(mo,{lines:6})}function oT({base:e,pending:t,connectors:n}){let r=_r(),i=aw(),[a,o]=(0,S.useState)(t.default_take),[s,c]=(0,S.useState)(`diff`),[l,u]=(0,S.useState)(null),[d,f]=(0,S.useState)(!1),[p,m]=(0,S.useState)(),h=t.changes,g=(0,S.useMemo)(()=>{let e=new Map;for(let t of h)for(let n of t.nodes)e.set(n,t);return e},[h]),_=e.nodes.filter(e=>!t.nodes.some(t=>t.id===e.id)),v=(0,S.useMemo)(()=>{if(s===`old`)return e.nodes;let n=e=>{let t=g.get(e.id);return t?.type===`add`&&a[t.id]===!1},r=t.nodes.map(t=>{let n=g.get(t.id);return n&&(n.type===`change`||n.type===`conflict`)&&(a[n.id]===!1||a[n.id]===`mine`)&&s===`new`?e.nodes.find(e=>e.id===t.id)??t:t}),i=_.filter(e=>s===`diff`||a[g.get(e.id)?.id??``]===!1);return[...r.filter(e=>s===`diff`||!n(e)),...i]},[s,e.nodes,t.nodes,_,g,a]),y=new Set(v.map(e=>e.id)),b=[...t.edges,...e.edges.filter(e=>_.some(t=>t.id===e.source||t.id===e.target))].filter((e,t,n)=>y.has(e.source)&&y.has(e.target)&&n.findIndex(t=>t.id===e.id)===t),x=LC(v,b,e.positions),C=v.map(e=>{let t=g.get(e.id),r=t?a[t.id]:void 0,i=!!t&&r===!1,o={node:{...e,yours:[],on_critical_path:!1,stats:null,tip:null,planner_connector:e.connector},tile:e.connector&&e.kind!==`gate`?n.find(t=>t.id===e.connector)??{id:e.connector,type:`http`,name:e.connector}:null,state:`idle`,cap:``,search:l&&t?.id!==l?`miss`:null,cp:!1,showTip:!1,showEvidence:!1,retryMax:null,...s===`diff`&&t?{diff:t.type,diffOff:i,diffTag:i?`skipped`:{add:`new`,change:`changed`,remove:`removed`,conflict:r===`planner`?`Planner's pick`:`your call`,kept:`yours · kept`}[t.type]}:{}},c=PC(e.kind);return{id:e.id,type:Ew(e.kind),position:{x:x[e.id][0],y:x[e.id][1]},width:c.w,height:c.h,data:o,draggable:!1,selectable:!1}}),w=Object.fromEntries(v.map(e=>[e.id,e.kind])),T=b.map(e=>{let t=zC(e,w,x);return{id:e.id,source:e.source,target:e.target,type:`flow`,sourceHandle:t.s,targetHandle:t.t,focusable:!1,selectable:!1,data:{edge:e,state:`idle`,cp:!1,dim:!!l&&!g.get(e.source)&&!g.get(e.target),guard:!1}}}),E=e=>h.filter(t=>t.type===e).length,D=h.filter(e=>e.type!==`kept`&&(a[e.id]===!0||a[e.id]===`planner`)).length;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`header`,{className:`page-head`,children:[(0,K.jsxs)(`div`,{className:`titles`,children:[(0,K.jsxs)(`span`,{className:`eyebrow`,children:[`Re-check · v`,t.base_version,` → v`,t.version]}),(0,K.jsx)(`h1`,{children:`What changed in your repo`})]}),(0,K.jsx)(`div`,{className:`actions`,children:(0,K.jsx)(z,{className:`btn`,to:`/${ow(i)}`,children:`Back to the map`})})]}),(0,K.jsxs)(`section`,{className:`rc-banner`,"aria-label":`Re-check summary`,children:[(0,K.jsx)(`span`,{className:`fm-spark`,style:{width:44,height:44},children:J.spark(22)}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{children:`The Planner re-checked your repo`}),(0,K.jsxs)(`p`,{children:[t.fact_sheet_hash,` · `,ao(t.created_at)]})]}),(0,K.jsxs)(`div`,{className:`rc-counts`,children:[E(`add`)>0&&(0,K.jsxs)(`span`,{className:`rc-cnt`,children:[(0,K.jsx)(`i`,{style:{background:`var(--teal)`}}),E(`add`),` added`]}),E(`change`)>0&&(0,K.jsxs)(`span`,{className:`rc-cnt`,children:[(0,K.jsx)(`i`,{style:{background:`var(--violet)`}}),E(`change`),` changed`]}),E(`remove`)>0&&(0,K.jsxs)(`span`,{className:`rc-cnt`,children:[(0,K.jsx)(`i`,{style:{background:`var(--coral)`}}),E(`remove`),` removed`]}),E(`conflict`)>0&&(0,K.jsxs)(`span`,{className:`rc-cnt`,children:[(0,K.jsx)(`i`,{style:{background:`var(--amber-strong)`}}),E(`conflict`),` needs you`]}),E(`kept`)>0&&(0,K.jsxs)(`span`,{className:`rc-cnt`,children:[(0,K.jsx)(`i`,{style:{background:`var(--fg)`}}),E(`kept`),` of yours kept`]})]})]}),(0,K.jsxs)(`div`,{className:`rc-map`,children:[(0,K.jsx)(iw,{}),(0,K.jsx)(`div`,{className:`rc-tools`,children:(0,K.jsxs)(`div`,{className:`seg`,role:`group`,"aria-label":`What to show`,children:[(0,K.jsx)(`button`,{type:`button`,"aria-pressed":s===`diff`,onClick:()=>c(`diff`),children:`Diff`}),(0,K.jsxs)(`button`,{type:`button`,"aria-pressed":s===`old`,onClick:()=>c(`old`),children:[`v`,t.base_version,` (now)`]}),(0,K.jsxs)(`button`,{type:`button`,"aria-pressed":s===`new`,onClick:()=>c(`new`),children:[`v`,t.version,` (after)`]})]})}),(0,K.jsx)(Iv,{children:(0,K.jsx)(Bv,{nodes:C,edges:T,nodeTypes:Tw,edgeTypes:rw,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,fitView:!0,fitViewOptions:{padding:.06},minZoom:.25,maxZoom:1.5,proOptions:{hideAttribution:!0},deleteKeyCode:null,nodesFocusable:!1,"aria-label":`The map, with the changes marked`})})]}),(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h2`,{children:`Changes`}),(0,K.jsx)(`span`,{className:`card-note`,children:`Pick what to take. Nothing changes until you save.`})]}),(0,K.jsx)(`div`,{className:`rc-changes`,children:h.map(e=>(0,K.jsxs)(`div`,{className:`rc-change${l===e.id?` sel`:``}`,onMouseEnter:()=>u(e.id),onMouseLeave:()=>u(null),children:[(0,K.jsx)(`span`,{className:`rc-type ${e.type}`,children:iT[e.type]}),(0,K.jsx)(`b`,{children:e.title}),e.detail&&(0,K.jsx)(`p`,{children:e.detail}),e.evidence&&(0,K.jsx)(`span`,{className:`rc-ev`,children:e.evidence}),e.type!==`kept`&&(0,K.jsx)(`div`,{className:`seg`,role:`group`,"aria-label":`Take: ${e.title}`,children:(e.choices??[[!0,e.type===`remove`?`Remove it`:`Take it`],[!1,e.type===`remove`?`Keep it`:`Skip`]]).map(([t,n])=>(0,K.jsx)(`button`,{type:`button`,"aria-pressed":a[e.id]===t,onFocus:()=>u(e.id),onClick:()=>o(n=>({...n,[e.id]:t})),children:n},String(t)))})]},e.id))}),p&&(0,K.jsx)(`div`,{className:`error-box`,role:`alert`,children:p}),(0,K.jsxs)(`div`,{className:`rc-foot`,children:[(0,K.jsxs)(`span`,{children:[`Your edits stay on top. v`,t.base_version,` stays listed. Gates on payments and messages are kept whatever you pick.`]}),(0,K.jsxs)(`button`,{className:`btn`,type:`button`,onClick:async()=>{await aa.post(`/flow/versions/${t.version}/discard${ow(i)}`).catch(()=>void 0),r(`/${ow(i)}`)},children:[`Keep v`,t.base_version,` as it is`]}),(0,K.jsx)(`button`,{className:`btn primary`,type:`button`,onClick:async()=>{f(!0),m(void 0);try{await aa.post(`/flow/versions/${t.version}/accept${ow(i)}`,{take:a}),r(`/${ow(i)}`)}catch(e){m(e instanceof Error?e.message:String(e)),f(!1)}},disabled:d,children:d?`Saving…`:`Save as map v${t.version}${D?` · ${D} change${D>1?`s`:``}`:``}`})]})]})}function sT(e){return`<?xml version="1.0" encoding="UTF-8"?>\n${new XMLSerializer().serializeToString(e)}`}function cT(e,t,n=`text/plain`){let r=typeof t==`string`?new Blob([t],{type:n}):t,i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,document.body.append(a),a.click(),a.remove(),setTimeout(()=>URL.revokeObjectURL(i),1e3)}function lT(e,t=2){let{width:n,height:r}=e.viewBox.baseVal,i=URL.createObjectURL(new Blob([sT(e)],{type:`image/svg+xml`}));return new Promise((e,a)=>{let o=new Image;o.onload=()=>{let s=document.createElement(`canvas`);s.width=n*t,s.height=r*t;let c=s.getContext(`2d`);if(!c)return a(Error(`This browser can't draw a PNG.`));c.scale(t,t),c.drawImage(o,0,0,n,r),URL.revokeObjectURL(i),s.toBlob(t=>t?e(t):a(Error(`This browser can't draw a PNG.`)),`image/png`)},o.onerror=()=>{URL.revokeObjectURL(i),a(Error(`The map couldn't be drawn as a PNG.`))},o.src=i})}var uT=(e,t)=>`${e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``)||`app`}-mcp-map.${t}`,dT=[{kind:`decision`,label:`Decisions`},{kind:`llm`,label:`LLMs`},{kind:`mcp`,label:`MCP servers`},{kind:`api`,label:`APIs`},{kind:`local`,label:`Local programs`}];function fT(e){return e<1e3?`${Math.round(e)} ms`:e>=6e4?`${Math.floor(e/6e4)} min ${Math.round(e%6e4/1e3)} s`:`${(e/1e3).toFixed(1)} s`}var pT=new Set([`GET`,`HEAD`,`OPTIONS`]),mT=e=>e.op?.read_only===!1||!!e.op?.method&&!pT.has(e.op.method.toUpperCase()),hT=e=>e===`decision`||e===`end`||e===`gate`?`decision`:e===`llm`||e===`mcp`||e===`api`||e===`local`?e:e===`code`?`local`:null,gT=.13;function _T(e,t={}){let n=e.kind!==`dependencies`,r=e.source===`code`,i=new Set(e.critical_path.path),a=Object.fromEntries(e.nodes.map(e=>[e.id,e.kind])),o=n?Ly(e):{},s=n?[...e.nodes].sort((e,t)=>o[e.id]-o[t.id]||e.id.localeCompare(t.id)):[...e.nodes].sort((e,t)=>e.title.localeCompare(t.title)),c=[],l={};for(let e of s){let a=hT(e.kind),s=e.estimate_ms??0,u=Fy(e),d=r&&Py[e.kind]&&e.what&&!u,f=e.kind===`end`?`Stop`:d?Iy(e):e.title,p=e.kind===`llm`||e.estimate_source===`estimate`,m=[d?e.title:u?e.what:null,n&&s>0&&Py[e.kind]?`${fT(s)}${p?` est.`:``}`:null,e.status===`unconfirmed`?`unconfirmed`:null].filter(Boolean).join(` · `),h=n?o[e.id]:a?l[a]=(l[a]??-1)+1:0,g=e.id.replace(/-\d+$/,``);c.push({id:e.id,kind:e.kind,lane:a,row:0,start:h,end:n&&Py[e.kind]?h+s:h,name:f,note:m,estimate:p,critical:i.has(e.id),writes:mT(e),repeats:!!e.repeats,unconfirmed:e.status===`unconfirmed`,dep:g,health:t[g]??t[e.id]})}let u=n?Math.max(e.critical_path.length_ms,...c.map(e=>e.end),1):Math.max(1,...Object.values(l).map(e=>e+1)),d=Object.fromEntries(dT.map(e=>[e.kind,0])),f={};for(let e of c){if(!e.lane)continue;let t=f[e.lane]||=[],r=t.findIndex(t=>t<=e.start);r<0&&(r=t.length,t.push(0)),t[r]=n?Math.max(e.end,e.start+u*gT):e.start+1,e.row=r,d[e.lane]=Math.max(d[e.lane],r+1)}let p=new Set(e.nodes.filter(Fy).map(e=>e.id));return{timed:n,blocks:c,lines:e.edges.filter(e=>a[e.source]&&a[e.target]).map(e=>({from:e.source,to:e.target,when:e.when,critical:i.has(e.source)&&i.has(e.target),via:n?p.has(e.target):a[e.source]===`mcp`&&a[e.target]!==`mcp`})),rows:d,span:u,files:[...new Set(e.nodes.flatMap(e=>e.evidence.map(e=>e.ref?.split(`:`)[0]).filter(Boolean)))],calls:c.filter(e=>Py[e.kind]).length,decisions:c.filter(e=>e.kind===`decision`).length}}var vT=1600,yT=230,bT=70,xT=108,ST=62,CT=16,wT=34,TT=210,ET=`
|
|
20
|
+
.mcp-map { --paper:#FFFFFF; --ink:#111A21; --muted:#55656F; --rule:#D9E1E6; --band:#F4F7F9; --llm:#6B46C1;
|
|
21
|
+
--mcp:#1E7A4A; --api:#2457C5; --local:#4A5E6A; --control:#111A21; --up:#0B7A70; --warn:#E3A535; --down:#D2513E;
|
|
22
|
+
font-family: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
|
|
23
|
+
.mcp-map.dark { --paper:#0E1519; --ink:#E6EEF2; --muted:#9AAEB9; --rule:#24343D; --band:#121D23; --llm:#B79CFF;
|
|
24
|
+
--mcp:#5CD49A; --api:#7FA8FF; --local:#A9B8C2; --control:#E6EEF2; --up:#4FD1C0; --warn:#F2B84B; --down:#FF8C7A; }
|
|
25
|
+
.mcp-map .paper { fill: var(--paper); }
|
|
26
|
+
.mcp-map .mono { font-family: "Geist Mono", ui-monospace, Menlo, Consolas, monospace; }
|
|
27
|
+
.mcp-map .title { font-size: 26px; font-weight: 650; fill: var(--ink); letter-spacing: -.02em; }
|
|
28
|
+
.mcp-map .sub { font-size: 13px; font-weight: 500; fill: var(--muted); }
|
|
29
|
+
.mcp-map .lane { fill: var(--paper); } .mcp-map .lane.odd { fill: var(--band); }
|
|
30
|
+
.mcp-map .lane-label { font-size: 14px; font-weight: 600; fill: var(--ink); }
|
|
31
|
+
.mcp-map .lane-none { font-size: 12px; fill: var(--muted); }
|
|
32
|
+
.mcp-map .tick { stroke: var(--rule); stroke-width: 1; } .mcp-map .tick.minor { stroke-dasharray: 2 4; }
|
|
33
|
+
.mcp-map .tick-label { font-size: 11.5px; font-weight: 500; fill: var(--muted); }
|
|
34
|
+
.mcp-map .line { fill: none; stroke: var(--muted); stroke-width: 1.4; }
|
|
35
|
+
.mcp-map .line.cp { stroke: var(--ink); stroke-width: 3; } .mcp-map .line.via { stroke-dasharray: 5 4; }
|
|
36
|
+
.mcp-map .when { font-size: 10.5px; font-weight: 600; fill: var(--muted); }
|
|
37
|
+
.mcp-map .arrow { fill: var(--muted); } .mcp-map .arrow.cp { fill: var(--ink); }
|
|
38
|
+
.mcp-map .sym { fill: var(--paper); stroke: currentColor; stroke-width: 2.2; } .mcp-map .sym-in, .mcp-map .stop { fill: currentColor; }
|
|
39
|
+
.mcp-map .k-llm { color: var(--llm); } .mcp-map .k-mcp { color: var(--mcp); } .mcp-map .k-api { color: var(--api); }
|
|
40
|
+
.mcp-map .k-local, .mcp-map .k-code { color: var(--local); }
|
|
41
|
+
.mcp-map .k-decision, .mcp-map .k-end, .mcp-map .k-gate, .mcp-map .k-start { color: var(--control); }
|
|
42
|
+
.mcp-map .unconfirmed .sym { stroke-dasharray: 3 3; }
|
|
43
|
+
.mcp-map .bar { fill: currentColor; opacity: .22; } .mcp-map .bar.est { opacity: .12; stroke: currentColor; stroke-dasharray: 3 3; }
|
|
44
|
+
.mcp-map .cp .bar { opacity: .45; }
|
|
45
|
+
.mcp-map .name { font-size: 13px; font-weight: 600; fill: var(--ink); }
|
|
46
|
+
.mcp-map .note { font-size: 11px; font-weight: 500; fill: var(--muted); }
|
|
47
|
+
.mcp-map .hdot { stroke: var(--paper); stroke-width: 1.5; } .mcp-map .h-up { fill: var(--up); }
|
|
48
|
+
.mcp-map .h-warn { fill: var(--warn); } .mcp-map .h-down { fill: var(--down); }
|
|
49
|
+
.mcp-map .key-label { font-size: 12.5px; font-weight: 550; fill: var(--ink); }
|
|
50
|
+
.mcp-map .rule { stroke: var(--rule); stroke-width: 1; }
|
|
51
|
+
`;function DT({kind:e,x:t,y:n,r=13}){if(e===`llm`)return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`circle`,{cx:t,cy:n,r,className:`sym`}),(0,K.jsx)(`circle`,{cx:t,cy:n,r:r*.38,className:`sym-in`})]});if(e===`mcp`){let e=[0,1,2,3,4,5].map(e=>{let i=Math.PI/3*e+Math.PI/6;return`${t+r*Math.cos(i)},${n+r*Math.sin(i)}`});return(0,K.jsx)(`polygon`,{points:e.join(` `),className:`sym`})}return e===`api`?(0,K.jsx)(`rect`,{x:t-r*.88,y:n-r*.88,width:r*1.76,height:r*1.76,rx:r*.3,className:`sym`}):e===`local`||e===`code`?(0,K.jsx)(`polygon`,{points:`${t},${n-r} ${t+r},${n+r*.8} ${t-r},${n+r*.8}`,className:`sym`}):e===`decision`||e===`gate`?(0,K.jsx)(`rect`,{x:t-r*.7,y:n-r*.7,width:r*1.4,height:r*1.4,transform:`rotate(45 ${t} ${n})`,className:`sym`}):e===`start`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`circle`,{cx:t,cy:n,r,className:`sym`}),(0,K.jsx)(`circle`,{cx:t,cy:n,r:r*.62,className:`sym`})]}):(0,K.jsx)(`rect`,{x:t-r*.7,y:n-r*.7,width:r*1.4,height:r*1.4,className:`stop`})}var OT=[[`start`,`Entry point`],[`llm`,`LLM`],[`mcp`,`MCP server`],[`api`,`API`],[`local`,`Local program`],[`decision`,`Decision`],[`end`,`Stop`]];function kT(e){let t=e/8,n=10**Math.floor(Math.log10(t));return[1,2,5,10].map(e=>e*n).find(e=>e>=t)??t}var AT=(0,S.forwardRef)(function({map:e,app:t,sub:n,dark:r},i){let a=e.timed?vT:Math.max(vT,300+e.span*TT),o=a-yT-bT-(e.timed?150:0),s=t=>270+(e.timed?t/e.span*o:t*TT),c={},l={},u=xT;for(let t of dT)c[t.kind]=u,l[t.kind]=e.rows[t.kind]?e.rows[t.kind]*ST+32:wT,u+=l[t.kind];let d=u,f=d+(e.timed?64:30),p=f+96,m=e.blocks.filter(e=>!e.lane),h={};m.forEach((e,t)=>{let n=xT+(d-xT)*(t+1)/(m.length+1);h[e.id]={x:208,x2:208,y:n,b:e}});for(let t of e.blocks){if(!t.lane)continue;let n=s(t.start);h[t.id]={x:n,x2:e.timed?s(t.end):n,y:c[t.lane]+CT+ST*t.row+ST/2+4,b:t}}let g=[];if(e.timed)for(let t=0,n=kT(e.span);t<=e.span+n/2;t+=n)g.push(t);return(0,K.jsxs)(`svg`,{ref:i,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 ${a} ${p}`,width:a,height:p,className:`mcp-map${r?` dark`:``}`,role:`img`,"aria-label":`MCP map of ${t}`,children:[(0,K.jsx)(`title`,{children:`MCP map of ${t}`}),(0,K.jsx)(`style`,{children:ET}),(0,K.jsx)(`defs`,{children:[``,`cp`].map(e=>(0,K.jsx)(`marker`,{id:`mm-arrow${e}`,viewBox:`0 0 10 10`,refX:`9`,refY:`5`,markerWidth:`6`,markerHeight:`6`,orient:`auto-start-reverse`,children:(0,K.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,className:`arrow ${e}`})},e))}),(0,K.jsx)(`rect`,{x:0,y:0,width:a,height:p,className:`paper`}),(0,K.jsx)(`text`,{x:32,y:46,className:`title`,children:t}),(0,K.jsx)(`text`,{x:32,y:72,className:`sub mono`,children:n}),(0,K.jsx)(`text`,{x:a-32,y:46,className:`sub`,textAnchor:`end`,children:`MCP Map · rules v1`}),(0,K.jsx)(`text`,{x:a-32,y:72,className:`sub mono`,textAnchor:`end`,children:`drawn by FlowForge`}),dT.map((t,n)=>(0,K.jsxs)(`g`,{children:[(0,K.jsx)(`rect`,{x:0,y:c[t.kind],width:a,height:l[t.kind],className:`lane${n%2?` odd`:``}`}),(0,K.jsx)(`text`,{x:32,y:c[t.kind]+l[t.kind]/2+5,className:`lane-label`,children:t.label}),!e.rows[t.kind]&&(0,K.jsx)(`text`,{x:270,y:c[t.kind]+l[t.kind]/2+4,className:`lane-none`,children:`none`})]},t.kind)),g.map(e=>(0,K.jsxs)(`g`,{children:[(0,K.jsx)(`line`,{x1:s(e),y1:xT,x2:s(e),y2:d+6,className:`tick`}),(0,K.jsx)(`text`,{x:s(e),y:d+24,className:`tick-label mono`,textAnchor:`middle`,children:fT(e)})]},e)),e.timed&&(0,K.jsx)(`text`,{x:32,y:d+24,className:`tick-label`,children:`time from the start →`}),e.lines.map(e=>{let t=h[e.from],n=h[e.to];if(!t||!n)return null;let r=t.b.kind===`start`?t.x+15:t.x2+(t.b.kind===`decision`?10:0),i=n.x-15,a=i>r+8,o=Math.min(70,Math.max(24,(i-r)/2)),s=n.y>t.y?1:-1,c=!a&&Math.abs(n.x-t.x2)<30,l=a?`M${r},${t.y} C${r+o},${t.y} ${i-o},${n.y} ${i},${n.y}`:c?`M${n.x},${t.y+s*8} V${n.y-s*16}`:`M${t.x},${t.y+s*15} V${n.y} H${i}`,u=[`line`,e.critical&&`cp`,e.via&&`via`].filter(Boolean).join(` `);return(0,K.jsxs)(`g`,{children:[(0,K.jsx)(`path`,{d:l,className:u,markerEnd:`url(#mm-arrow${e.critical?`cp`:``})`}),e.when&&(0,K.jsx)(`text`,{x:c?n.x-6:i-4,y:c?n.y-s*22:n.y-7,className:`when`,textAnchor:`end`,children:e.when})]},`${e.from}>${e.to}`)}),Object.values(h).map(({x:e,x2:t,y:n,b:r})=>(0,K.jsxs)(`g`,{className:[`k-${r.kind}`,r.critical&&`cp`,r.unconfirmed&&`unconfirmed`].filter(Boolean).join(` `),children:[t-e>2&&(0,K.jsx)(`rect`,{x:e,y:n-5,width:t-e,height:10,rx:5,className:`bar${r.estimate?` est`:``}`}),(0,K.jsx)(DT,{kind:r.kind,x:e,y:n}),r.lane?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`text`,{x:e+20,y:n-13,className:`name`,children:r.name}),(r.note||r.writes||r.repeats)&&(0,K.jsx)(`text`,{x:e+20,y:n+25,className:`note mono`,children:[r.note,r.writes&&`✎ writes`,r.repeats&&`↻ repeats`].filter(Boolean).join(` `)})]}):(0,K.jsx)(`text`,{x:e,y:n+32,className:`name`,textAnchor:`middle`,children:r.name}),r.health&&[`up`,`warn`,`down`].includes(r.health)&&(0,K.jsx)(`circle`,{cx:e+11,cy:n-11,r:4,className:`hdot h-${r.health}`})]},r.id)),(0,K.jsx)(`line`,{x1:32,y1:f-22,x2:a-32,y2:f-22,className:`rule`}),OT.map(([e,t],n)=>(0,K.jsxs)(`g`,{className:`k-${e}`,children:[(0,K.jsx)(DT,{kind:e,x:44+n*150,y:f+4,r:10}),(0,K.jsx)(`text`,{x:62+n*150,y:f+9,className:`key-label`,children:t})]},e)),(0,K.jsxs)(`g`,{children:[e.timed&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`path`,{d:`M32,${f+48} H76`,className:`line cp`}),(0,K.jsx)(`text`,{x:86,y:f+52,className:`key-label`,children:`critical path: sets the total time`})]}),(0,K.jsx)(`path`,{d:`M344,${f+48} H388`,className:`line via`}),(0,K.jsx)(`text`,{x:398,y:f+52,className:`key-label`,children:`through another server`}),e.timed&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`rect`,{x:604,y:f+43,width:44,height:10,rx:5,className:`bar est`,style:{color:`var(--muted)`}}),(0,K.jsx)(`text`,{x:658,y:f+52,className:`key-label`,children:`estimate, not measured`})]}),(0,K.jsx)(`circle`,{cx:870,cy:f+48,r:4,className:`hdot h-up`}),(0,K.jsx)(`circle`,{cx:882,cy:f+48,r:4,className:`hdot h-warn`}),(0,K.jsx)(`circle`,{cx:894,cy:f+48,r:4,className:`hdot h-down`}),(0,K.jsx)(`text`,{x:906,y:f+52,className:`key-label`,children:`health: up · needs a look · down`}),(0,K.jsx)(`text`,{x:1160,y:f+52,className:`key-label`,children:`✎ writes ↻ repeats in a loop`})]})]})}),jT={start:e=>`((${e}))`,llm:e=>`([${e}])`,mcp:e=>`{{${e}}}`,api:e=>`[${e}]`,local:e=>`[/${e}/]`,decision:e=>`{${e}}`,end:e=>`[[${e}]]`},MT={llm:`#6B46C1`,mcp:`#1E7A4A`,api:`#2457C5`,local:`#4A5E6A`},NT=new Set([`end`,`graph`,`flowchart`,`subgraph`,`style`,`class`,`classDef`,`click`,`linkStyle`,`direction`]),PT=e=>{let t=e.replace(/[^\w-]/g,`_`);return NT.has(t)?`n_${t}`:t},FT=e=>e.replace(/"/g,`#quot;`).replace(/[<>]/g,e=>e===`<`?`#lt;`:`#gt;`);function IT(e){return`"${FT(e.name)}${e.note?`<br/>${FT(e.note)}`:``}${e.writes?` ✎`:``}${e.repeats?` ↻`:``}"`}function LT(e,t){let n=_T(e),r=[`flowchart LR`,` %% MCP map of ${t}, read from ${(n.files.length>2?`${n.files.length} files`:n.files.join(`, `))||`the repo`} by FlowForge (rules: docs/mcp-map.md)`];for(let e of n.blocks){let t=jT[e.kind]??jT.local;r.push(` ${PT(e.id)}${t(e.kind===`start`||e.kind===`end`?`"${FT(e.name)}"`:IT(e))}`)}for(let e of n.lines){let t=e.via?`-.->`:e.critical?`==>`:`-->`;r.push(` ${PT(e.from)} ${t}${e.when?`|${FT(e.when)}|`:``} ${PT(e.to)}`)}for(let[e,t]of Object.entries(MT)){let i=n.blocks.filter(t=>t.kind===e).map(e=>PT(e.id));i.length&&r.push(` classDef ${e} stroke:${t},stroke-width:2px`,` class ${i.join(`,`)} ${e}`)}return r.join(`
|
|
52
|
+
`)}var RT=e=>new Date(e).toLocaleDateString(`en-GB`,{day:`numeric`,month:`short`,year:`numeric`});function zT(){let e=aw(),t=V(`/flow?layer=mine${ow(e,`&`)}`),n=V(`/scan`),r=V(`/checks`),i=Go(),a=(0,S.useRef)(null),[o,s]=(0,S.useState)(!1),[c,l]=(0,S.useState)(),u=(0,S.useRef)(0),d=t.data?.available?t.data:null,f=(0,S.useMemo)(()=>Object.fromEntries((r.data?.items??[]).map(e=>[e.id,e.status])),[r.data]),p=(0,S.useMemo)(()=>d?_T(d,f):null,[d,f]);if(t.error)return(0,K.jsx)(go,{error:t.error,what:`the map`});if(!t.data)return(0,K.jsx)(mo,{lines:8});if(!d||!p)return(0,K.jsx)(ho,{tone:`violet`,icon:J.map(28),title:`No map to export yet`,children:`Scan a folder from the map page first.`});let m=n.data?.name??d.nodes.find(e=>e.id===`app`)?.title??i.project,h=p.files.length>2?`${p.files.length} files`:p.files.join(`, `)||`the repo`,g=p.timed?`MCP map, read from ${h} on ${RT(d.created_at)}. ${p.calls} calls, ${p.decisions} decisions, ${fT(p.span)} at best.`:`Dependency map, read from ${h} on ${RT(d.created_at)}. ${p.calls} dependencies.`,_=LT(d,m),v=e=>{l(e),window.clearTimeout(u.current),u.current=window.setTimeout(()=>l(void 0),2500)},y=async(e,t)=>{try{await e(),v(t)}catch(e){v(e instanceof Error?e.message:String(e))}},b=()=>{if(!a.current)throw Error(`The map isn't drawn yet.`);return a.current};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`header`,{className:`page-head`,children:[(0,K.jsxs)(`div`,{className:`titles`,children:[(0,K.jsxs)(`span`,{className:`eyebrow`,children:[p.timed?`Flow`:`Dependencies`,` · map v`,d.version]}),(0,K.jsx)(`h1`,{children:`MCP Map`}),(0,K.jsx)(`p`,{className:`lede`,children:`The map to send: lanes are kinds, time runs left to right.`})]}),(0,K.jsxs)(`div`,{className:`actions`,children:[(0,K.jsxs)(`div`,{className:`seg`,role:`group`,"aria-label":`Paper`,children:[(0,K.jsx)(`button`,{type:`button`,"aria-pressed":!o,onClick:()=>s(!1),children:`Light paper`}),(0,K.jsx)(`button`,{type:`button`,"aria-pressed":o,onClick:()=>s(!0),children:`Dark paper`})]}),(0,K.jsx)(z,{className:`btn`,to:`/${ow(e)}`,children:`Back to the map`})]})]}),(0,K.jsxs)(`div`,{className:`mm-actions`,role:`group`,"aria-label":`Export`,children:[(0,K.jsxs)(`button`,{className:`btn primary`,type:`button`,onClick:()=>void y(()=>cT(uT(m,`svg`),sT(b()),`image/svg+xml`),`Saved the SVG`),children:[J.download(18),` Download SVG `,(0,K.jsx)(`small`,{children:`documents, web`})]}),(0,K.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>void y(async()=>cT(uT(m,`png`),await lT(b(),2)),`Saved the PNG`),children:[J.download(18),` PNG (2×) `,(0,K.jsx)(`small`,{children:`slides, chat`})]}),(0,K.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>window.print(),children:[J.file(18),` PDF `,(0,K.jsx)(`small`,{children:`reports, A4`})]}),(0,K.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>void y(()=>navigator.clipboard.writeText(_),`Copied`),children:[J.copy(18),` Copy as Mermaid `,(0,K.jsx)(`small`,{children:`READMEs, PRs`})]}),(0,K.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>void y(()=>cT(uT(m,`json`),JSON.stringify({mcp_map:1,app:m,flow:d},null,2),`application/json`),`Saved the Flow JSON`),children:[J.fileCode(18),` Flow JSON `,(0,K.jsx)(`small`,{children:`tools, every file:line`})]}),(0,K.jsx)(`span`,{className:`mm-said`,role:`status`,children:c})]}),(0,K.jsx)(`div`,{className:`mm-frame mm-print`,children:(0,K.jsx)(AT,{ref:a,map:p,app:m,sub:g,dark:o})}),(0,K.jsxs)(`details`,{className:`mm-mermaid`,children:[(0,K.jsx)(`summary`,{children:`See the Mermaid text`}),(0,K.jsx)(`pre`,{children:_})]}),(0,K.jsxs)(`p`,{className:`mm-rules`,children:[`The six rules are in `,(0,K.jsx)(`code`,{children:`docs/mcp-map.md`}),`. Key values never appear: the map holds only what the scan already masked.`]})]})}var BT=[`#E4572E`,`#F2A900`,`#2E9E5B`,`#0B7A70`,`#2F6FD6`,`#635BFF`,`#C2398D`,`#3A4756`],VT=[{id:`llm`,label:`LLM`,desc:`OpenAI-style APIs, Claude, Ollama on your own machine`,needsKey:!0},{id:`mcp`,label:`MCP server`,desc:`Any server. Its tools appear on their own.`,needsKey:!1},{id:`http`,label:`HTTP API`,desc:`Razorpay, Stripe, any REST API`,needsKey:!0},{id:`local`,label:`Local command`,desc:`Scripts, Sirius, models on your computer`,needsKey:!1}],HT={type:`mcp`,id:``,name:``,role:``,provider:`openai_compatible`,baseUrl:``,model:``,command:``,args:``,cwd:``,authHeader:`Authorization`,authScheme:`bearer`,keyVar:``,mode:``,rpm:``,color:BT[0],logo:`letters`,letters:``,slot:``},UT=[/sk_(live|test)_/i,/rk_(live|test)_/i,/rzp_(live|test)_/i,/\bAIza[0-9A-Za-z_-]{10,}/i,/nvapi-/i,/sk-ant-/i,/\bsk-[A-Za-z0-9]{16,}/i,/eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\./,/-----BEGIN [A-Z ]*PRIVATE KEY-----/],WT=/^[A-Z_][A-Z0-9_]*$/;function GT(e){return UT.some(t=>t.test(e))}function KT(e){let t=e.toLowerCase().normalize(`NFKD`).replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``).slice(0,40);return/^[a-z]/.test(t)?t:t?`app-${t}`:``}function qT(e){let t=e.trim().split(/\s+/).filter(Boolean);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():(t[0]??``).slice(0,2).replace(/^./,e=>e.toUpperCase())}function JT(e){return[...e.matchAll(/"([^"]*)"|'([^']*)'|(\S+)/g)].map(e=>e[1]??e[2]??e[3])}function YT(e){let t={};e.name.trim()||(t.name=`Give it a name.`);let n=e.id||KT(e.name);e.name.trim()&&!/^[A-Za-z][A-Za-z0-9_-]{0,63}$/.test(n)&&(t.id=`Use letters, numbers, - or _, starting with a letter.`),[`llm`,`mcp`,`http`,`local`,`mock`].includes(n)&&(t.id=`"${n}" is reserved. Pick another short name.`),e.keyVar&>(e.keyVar)?t.keyVar=`That looks like a key itself. Put the key in your .env file and type only its name here, like GEMINI_API_KEY.`:e.keyVar&&!WT.test(e.keyVar)&&(t.keyVar=`Use the variable's name: capital letters, numbers and _, like GEMINI_API_KEY.`);for(let[n,r]of Object.entries(e))n!==`keyVar`&&typeof r==`string`&>(r)&&(t[n]=`That looks like a key. Keys go in your .env file, never in this form.`);return e.type===`llm`&&(e.model.trim()||(t.model=`Which model should it use?`),e.provider===`openai_compatible`&&!e.baseUrl.trim()&&(t.baseUrl=`Where is the API? For example https://api.example.com/v1`)),e.type===`mcp`&&!e.command.trim()&&(t.command=`Which program starts the server? For example npx or uvx`),e.type===`local`&&(e.command.trim()||(t.command=`Which program should it run?`),e.cwd.trim()||(t.cwd=`Which folder should it run in?`)),e.rpm&&!(Number(e.rpm)>0)&&(t.rpm=`A number of calls a minute, or leave it empty for no limit.`),e.logo===`letters`&&e.letters.length>2&&(t.letters=`Two letters at most.`),t}function XT(e,t){let n=e=>GT(e)?``:e.trim(),r=n(e.id)||KT(e.name),i=e.keyVar&&WT.test(e.keyVar)&&!GT(e.keyVar)?`env:${e.keyVar}`:null,a;a=e.type===`llm`?{provider:e.provider,model:n(e.model),...e.provider===`openai_compatible`||e.baseUrl?{base_url:n(e.baseUrl)}:{}}:e.type===`mcp`?{command:n(e.command),args:JT(n(e.args)),...i&&e.keyVar?{env_refs:{[e.keyVar]:i}}:{}}:e.type===`http`?{base_url:n(e.baseUrl)||null,auth_header:i?n(e.authHeader)||`Authorization`:null,auth_scheme:i?e.authScheme:null}:{command:JT(n(e.command)),cwd:n(e.cwd),...i&&e.keyVar?{env_refs:{[e.keyVar]:i}}:{}};let o=e.logo===`upload`&&t?{type:`upload`,file:t.file}:e.logo===`letters`?{type:`letters`,text:(n(e.letters)||qT(e.name)).slice(0,2)}:{type:`none`},s={id:r,type:e.type,name:n(e.name),role:n(e.role),style:{color:e.color,logo:o},connection:a};return i&&(e.type===`llm`||e.type===`http`)&&(s.secret_ref=i),e.mode&&(s.mode=e.mode),e.slot.trim()&&(s.slot=n(e.slot)),Number(e.rpm)>0&&(s.rate_limit_rpm=Number(e.rpm)),s}function ZT(e,t=BT[0]){let n=e.connection??{},r=n.env_refs??{},i=e.secret_ref??Object.values(r)[0]??null,a=e.style?.logo;return{...HT,type:e.type??`mcp`,id:e.id??``,name:e.name??``,role:e.role??``,provider:n.provider??`openai_compatible`,baseUrl:String(n.base_url??``),model:String(n.model??``),command:Array.isArray(n.command)?n.command.join(` `):String(n.command??``),args:Array.isArray(n.args)?n.args.join(` `):``,cwd:String(n.cwd??``),authHeader:String(n.auth_header??`Authorization`),authScheme:n.auth_scheme??`bearer`,keyVar:i?i.replace(/^(env|vault):/,``):``,mode:e.mode??``,rpm:e.rate_limit_rpm?String(e.rate_limit_rpm):``,color:e.style?.color??t,logo:a?.type??`letters`,letters:a?.type===`letters`?a.text:``,slot:e.slot??``}}var QT=1048576,$T=[`image/png`,`image/jpeg`,`image/webp`];function eE({label:e,error:t,hint:n,children:r}){return(0,K.jsxs)(`label`,{className:`field`,children:[e,r,t?(0,K.jsx)(`span`,{className:`error`,role:`alert`,children:t}):n?(0,K.jsx)(`span`,{className:`hint`,children:n}):null]})}function tE(){let{id:e}=xr(),t=!!e,n=_r(),r=V(t?`/connectors/${encodeURIComponent(e)}`:null),i=V(`/connectors`),a=V(t?null:`/presets`),[o,s]=(0,S.useState)(HT),[c,l]=(0,S.useState)(new Set),[u,d]=(0,S.useState)(!1),[f,p]=(0,S.useState)(!1),[m,h]=(0,S.useState)(),[g,_]=(0,S.useState)(null),[v,y]=(0,S.useState)();(0,S.useEffect)(()=>{r.data&&s(ZT(r.data))},[r.data]);let[b]=Yi(),x=(0,S.useRef)(!1);(0,S.useEffect)(()=>{if(t||x.current)return;let e=b.get(`preset`);if(e){if(!a.data||!i.data)return;x.current=!0;let t=a.data.find(t=>t.preset===e);t&&O(t);return}let n=b.get(`type`),r=b.get(`name`);(n||r)&&(x.current=!0,s(e=>({...e,...n&&VT.some(e=>e.id===n)?{type:n}:{},...r?{name:r,id:KT(r)}:{}})))},[b,a.data,i.data,t]),(0,S.useEffect)(()=>{if(!g)return y(void 0);let e=URL.createObjectURL(g);return y(e),()=>URL.revokeObjectURL(e)},[g]);let C=(e,t)=>{s(n=>({...n,[e]:t})),l(t=>new Set(t).add(e))},w=YT(o),T=e=>u||c.has(e)?w[e]:void 0,E=(0,S.useMemo)(()=>XT(o,t&&r.data?.style.logo.type===`upload`&&o.logo===`upload`?{file:r.data.style.logo.file}:null),[o,t,r.data]),D=VT.find(e=>e.id===o.type);function O(e){let t=new Set((i.data??[]).map(e=>e.id)),n=e.id??``;for(let r=2;n&&t.has(n);r++)n=`${e.id}-${r}`;s({...ZT({...e,id:n},e.style?.color??BT[0])}),l(new Set)}function k(e){if(h(void 0),e){if(!$T.includes(e.type))return h(`Logos must be PNG, JPEG or WebP images.`);if(e.size>QT)return h(`Logos must be 1 MB or smaller.`);_(e),C(`logo`,`upload`)}}async function A(){if(d(!0),h(void 0),!Object.keys(w).length){if(o.logo===`upload`&&!g&&!(t&&r.data?.style.logo.type===`upload`))return h(`Choose an image for the logo, or pick Letters or Colour only.`);p(!0);try{let r={...E,...o.logo===`upload`&&g?{style:{color:o.color,logo:{type:`letters`,text:``}}}:{}},i=t?await aa.put(`/connectors/${encodeURIComponent(e)}`,r):await aa.post(`/connectors`,r);if(g){let e=new FormData;e.append(`file`,g),await aa.post(`/connectors/${encodeURIComponent(i.id)}/logo`,e)}n(`/connectors/${i.id}`)}catch(e){h(e.message)}finally{p(!1)}}}if(t&&r.error)return(0,K.jsx)(go,{error:r.error,what:`this app`});if(t&&!r.data)return(0,K.jsx)(mo,{lines:6});if(t&&r.data?.managed_by===`file`)return(0,K.jsxs)(`div`,{className:`notice`,children:[`This app comes from `,(0,K.jsx)(`code`,{children:`connectors.json`}),`; edit that file to change it.`]});let j={id:E.id||`new`,type:o.type,name:o.name||`Your app`,connection:E.connection,style:E.style,logo_url:o.logo===`upload`?v??r.data?.logo_url:void 0};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`header`,{className:`page-head`,children:(0,K.jsxs)(`div`,{className:`titles`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:t?`Edit ${r.data?.name}`:`Add an app`}),(0,K.jsx)(`h1`,{children:`Connect it, colour it, name it`}),(0,K.jsx)(`span`,{className:`lede`,children:`Four ways to connect cover every app, MCP server and model.`})]})}),!t&&a.data&&(0,K.jsxs)(`section`,{className:`card`,"aria-labelledby":`preset-title`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,id:`preset-title`,children:`Start from a ready-made app`}),(0,K.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:10},children:a.data.filter(e=>!e.preset.startsWith(`custom`)).map(e=>(0,K.jsxs)(`button`,{type:`button`,className:`btn`,onClick:()=>O(e),children:[(0,K.jsx)(no,{c:{id:e.preset,type:e.type,name:e.name??e.preset,style:e.style,connection:e.connection},size:24}),e.name]},e.preset))})]}),(0,K.jsxs)(`section`,{className:`card`,"aria-labelledby":`type-title`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,id:`type-title`,children:`1 · How does it connect?`}),(0,K.jsx)(`div`,{className:`grid`,style:{"--min":`200px`},children:VT.map(e=>(0,K.jsxs)(`button`,{type:`button`,className:`choice`,"aria-pressed":o.type===e.id,disabled:t&&o.type!==e.id,onClick:()=>C(`type`,e.id),children:[(0,K.jsx)(`b`,{children:e.label}),(0,K.jsx)(`span`,{children:e.desc})]},e.id))})]}),(0,K.jsxs)(`div`,{className:`grid`,style:{"--min":`440px`},children:[(0,K.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16},children:[(0,K.jsxs)(`section`,{className:`card`,"aria-labelledby":`name-title`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,id:`name-title`,children:`2 · Name it`}),(0,K.jsx)(eE,{label:`Name`,error:T(`name`),children:(0,K.jsx)(`input`,{value:o.name,onChange:e=>C(`name`,e.target.value),placeholder:`Image studio`,autoComplete:`off`})}),(0,K.jsx)(eE,{label:`What it does`,error:T(`role`),children:(0,K.jsx)(`input`,{value:o.role,onChange:e=>C(`role`,e.target.value),placeholder:`makes product photos`,autoComplete:`off`})}),(0,K.jsx)(eE,{label:`Short name (used in plans)`,error:T(`id`),hint:t?`Short names can't be changed.`:void 0,children:(0,K.jsx)(`input`,{value:o.id||KT(o.name),onChange:e=>C(`id`,e.target.value),disabled:t,className:`mono`,spellCheck:!1,autoComplete:`off`})})]}),(0,K.jsxs)(`section`,{className:`card`,"aria-labelledby":`connect-title`,children:[(0,K.jsxs)(`span`,{className:`eyebrow`,id:`connect-title`,children:[`3 · Connect it · `,D.label]}),o.type===`llm`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(eE,{label:`Provider`,children:(0,K.jsxs)(`select`,{value:o.provider,onChange:e=>C(`provider`,e.target.value),children:[(0,K.jsx)(`option`,{value:`openai_compatible`,children:`OpenAI-style API (NIM, Gemini, Ollama, OpenRouter…)`}),(0,K.jsx)(`option`,{value:`anthropic`,children:`Anthropic (Claude)`})]})}),o.provider===`openai_compatible`&&(0,K.jsx)(eE,{label:`Base URL`,error:T(`baseUrl`),children:(0,K.jsx)(`input`,{value:o.baseUrl,onChange:e=>C(`baseUrl`,e.target.value),placeholder:`https://api.example.com/v1`,className:`mono`,autoComplete:`off`})}),(0,K.jsx)(eE,{label:`Model`,error:T(`model`),children:(0,K.jsx)(`input`,{value:o.model,onChange:e=>C(`model`,e.target.value),placeholder:`model-name`,className:`mono`,autoComplete:`off`})})]}),o.type===`mcp`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(eE,{label:`Command`,error:T(`command`),children:(0,K.jsx)(`input`,{value:o.command,onChange:e=>C(`command`,e.target.value),placeholder:`npx`,className:`mono`,autoComplete:`off`})}),(0,K.jsx)(eE,{label:`Arguments`,error:T(`args`),children:(0,K.jsx)(`input`,{value:o.args,onChange:e=>C(`args`,e.target.value),placeholder:`my-image-mcp`,className:`mono`,autoComplete:`off`})})]}),o.type===`http`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(eE,{label:`Base URL`,error:T(`baseUrl`),hint:`The key is only ever sent to this address.`,children:(0,K.jsx)(`input`,{value:o.baseUrl,onChange:e=>C(`baseUrl`,e.target.value),placeholder:`https://api.example.com`,className:`mono`,autoComplete:`off`})}),(0,K.jsx)(eE,{label:`Auth header name`,error:T(`authHeader`),children:(0,K.jsx)(`input`,{value:o.authHeader,onChange:e=>C(`authHeader`,e.target.value),placeholder:`Authorization`,autoComplete:`off`})}),(0,K.jsx)(eE,{label:`Auth style`,children:(0,K.jsxs)(`select`,{value:o.authScheme,onChange:e=>C(`authScheme`,e.target.value),children:[(0,K.jsx)(`option`,{value:`bearer`,children:`Bearer token`}),(0,K.jsx)(`option`,{value:`basic`,children:`Basic (id:secret)`}),(0,K.jsx)(`option`,{value:`raw`,children:`The key as-is`})]})}),(0,K.jsx)(eE,{label:`Mode`,children:(0,K.jsxs)(`select`,{value:o.mode,onChange:e=>C(`mode`,e.target.value),children:[(0,K.jsx)(`option`,{value:``,children:`Not a payment app`}),(0,K.jsx)(`option`,{value:`test`,children:`Test mode`}),(0,K.jsx)(`option`,{value:`live`,children:`Live mode`})]})})]}),o.type===`local`&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(eE,{label:`Command`,error:T(`command`),hint:`Runs directly, never through a shell. .bat and .cmd files are refused.`,children:(0,K.jsx)(`input`,{value:o.command,onChange:e=>C(`command`,e.target.value),placeholder:`./scan.sh`,className:`mono`,autoComplete:`off`})}),(0,K.jsx)(eE,{label:`Run in folder`,error:T(`cwd`),hint:`It can't reach files outside this folder.`,children:(0,K.jsx)(`input`,{value:o.cwd,onChange:e=>C(`cwd`,e.target.value),placeholder:`project/tools`,className:`mono`,autoComplete:`off`})})]}),(0,K.jsx)(eE,{label:D.needsKey?`Key: the name of the variable in your .env file`:`Key variable passed to the program (optional)`,error:T(`keyVar`),hint:(0,K.jsxs)(K.Fragment,{children:[`Put `,(0,K.jsxs)(`code`,{children:[o.keyVar||`NAME`,`=your-key`]}),` in `,(0,K.jsx)(`code`,{children:`.env`}),`. FlowForge saves only the name, never the key.`]}),children:(0,K.jsx)(`input`,{value:o.keyVar,onChange:e=>C(`keyVar`,e.target.value.toUpperCase()),placeholder:`GEMINI_API_KEY`,className:`mono`,spellCheck:!1,autoComplete:`off`})}),(0,K.jsx)(eE,{label:`Rate limit (calls a minute, optional)`,error:T(`rpm`),children:(0,K.jsx)(`input`,{value:o.rpm,onChange:e=>C(`rpm`,e.target.value),inputMode:`numeric`,placeholder:`no limit`,autoComplete:`off`})})]})]}),(0,K.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:16},children:[(0,K.jsxs)(`section`,{className:`card`,"aria-labelledby":`style-title`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,id:`style-title`,children:`4 · Style it`}),(0,K.jsx)(`span`,{className:`card-note`,id:`colour-label`,children:`Colour`}),(0,K.jsxs)(`div`,{role:`radiogroup`,"aria-labelledby":`colour-label`,style:{display:`flex`,flexWrap:`wrap`,gap:10,alignItems:`center`},children:[BT.map(e=>(0,K.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":o.color===e,"aria-label":`Colour ${e}`,onClick:()=>C(`color`,e),className:`swatch`,style:{background:e,boxShadow:`0 0 0 2px ${o.color===e?`var(--fg)`:`var(--line)`}`}},e)),(0,K.jsxs)(`label`,{className:`swatch custom`,title:`Pick any colour`,style:{background:BT.includes(o.color)?`var(--surface-2)`:o.color},children:[(0,K.jsx)(`span`,{className:`visually-hidden`,children:`Custom colour`}),(0,K.jsx)(`input`,{type:`color`,value:o.color,onChange:e=>C(`color`,e.target.value.toUpperCase())}),BT.includes(o.color)&&(0,K.jsx)(`span`,{"aria-hidden":`true`,children:`+`})]})]}),(0,K.jsx)(`span`,{className:`card-note`,id:`logo-label`,children:`Logo`}),(0,K.jsx)(`div`,{role:`radiogroup`,"aria-labelledby":`logo-label`,style:{display:`flex`,flexWrap:`wrap`,gap:8},children:[[`letters`,`Letters`],[`upload`,`Upload image`],[`none`,`Colour only`]].map(([e,t])=>(0,K.jsx)(`button`,{type:`button`,role:`radio`,"aria-checked":o.logo===e,className:`filter`,onClick:()=>C(`logo`,e),children:t},e))}),o.logo===`letters`&&(0,K.jsx)(eE,{label:`Letters`,error:T(`letters`),children:(0,K.jsx)(`input`,{value:o.letters,maxLength:2,onChange:e=>C(`letters`,e.target.value),placeholder:o.name?qT(o.name):`Is`,style:{maxWidth:120}})}),o.logo===`upload`&&(0,K.jsx)(eE,{label:`Image`,hint:`PNG, JPEG or WebP, under 1 MB. SVG isn't accepted.`,children:(0,K.jsx)(`input`,{type:`file`,accept:`image/png,image/jpeg,image/webp`,onChange:e=>k(e.target.files?.[0]),style:{paddingTop:10}})})]}),(0,K.jsxs)(`section`,{className:`card raised`,"aria-labelledby":`preview-title`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,id:`preview-title`,children:`Preview · on the map`}),(0,K.jsxs)(`div`,{className:`hub-tile`,style:{boxShadow:`var(--shadow-1)`},children:[(0,K.jsx)(no,{c:j,size:44}),(0,K.jsxs)(`span`,{className:`hub-text`,children:[(0,K.jsx)(`b`,{children:o.name||`Your app`}),(0,K.jsxs)(`span`,{children:[o.role||`what it does`,` · `,D.label]})]}),(0,K.jsx)(`span`,{className:`hub-dot tone-slate`,"aria-hidden":`true`})]}),(0,K.jsx)(`span`,{className:`card-note`,children:`The dot turns green once it has run, or passed "Test connection" on its page.`}),(0,K.jsx)(`span`,{className:`eyebrow`,children:`What gets saved (no secrets)`}),(0,K.jsx)(`pre`,{className:`code`,"aria-label":`What gets saved`,children:JSON.stringify(E,null,2)})]})]})]}),m&&(0,K.jsxs)(`div`,{className:`error-box`,role:`alert`,children:[(0,K.jsx)(`b`,{children:`Couldn't save it.`}),` `,m]}),u&&Object.keys(w).length>0&&(0,K.jsx)(`div`,{className:`notice`,role:`alert`,children:`Some answers need another look; they're marked above.`}),(0,K.jsxs)(`div`,{className:`actions`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`btn primary`,onClick:A,disabled:f,style:{minHeight:48,padding:`0 22px`},children:[J.check(18),` `,f?`Saving…`:t?`Save changes`:`Add to project`]}),(0,K.jsx)(z,{to:t?`/connectors/${e}`:`/`,className:`btn`,style:{minHeight:48},children:`Cancel`})]}),!t&&(0,K.jsx)(`p`,{className:`card-note`,children:`After adding, open its page to test the connection.`})]})}var nE=new Set([`nim`,`gemini`,`claude`,`ollama`,`razorpay`,`stripe`,`fetch`]),rE=[`llm`,`pay`,`dev`,`data`,`media`,`custom`];function iE(e){return nE.has(e.id)?`/connectors/new?preset=${e.id}`:e.id.startsWith(`custom_`)?`/connectors/new?type=${e.type}`:`/connectors/new?type=${e.type}&name=${encodeURIComponent(e.name)}`}function aE({item:e,size:t=40}){let n=e.color?{color:e.color,logo:{type:`letters`,text:eo(e.name)}}:void 0;return(0,K.jsx)(no,{c:{id:e.id,type:e.type,name:e.name,style:n},size:t})}function oE({live:e}){return(0,K.jsxs)(`span`,{className:`cat-badge ${e?`live`:`demo`}`,children:[(0,K.jsx)(`i`,{}),e?`Live`:`Demo only`]})}function sE({item:e,onTest:t}){return(0,K.jsxs)(`article`,{className:`cat-card`,children:[(0,K.jsxs)(`div`,{className:`cat-head`,children:[(0,K.jsx)(aE,{item:e}),(0,K.jsxs)(`span`,{className:`cat-name`,children:[(0,K.jsx)(`b`,{children:e.name}),(0,K.jsx)(`small`,{children:e.kind})]}),(0,K.jsx)(oE,{live:e.live})]}),(0,K.jsx)(`p`,{children:e.description}),(0,K.jsx)(`span`,{className:`cat-meta`,children:e.meta}),(0,K.jsxs)(`div`,{className:`cat-actions`,children:[(0,K.jsxs)(`button`,{className:`btn small`,type:`button`,onClick:()=>t(e),children:[J.play(16),` Test run`]}),e.status===`none`?(0,K.jsx)(z,{className:`btn small primary cat-add`,to:iE(e),children:`Add`}):(0,K.jsxs)(z,{className:`cat-state ${e.status===`on_map`?``:`idle`}`,to:`/connectors/${e.id}`,children:[(0,K.jsx)(`i`,{}),e.status===`on_map`?`On the map`:`Connected · not in code`]})]})]})}function cE({item:e,onClose:t}){let n=_r(),[r,i]=(0,S.useState)(),[a,o]=(0,S.useState)(),[s,c]=(0,S.useState)(0),l=(0,S.useRef)(null),[u,d]=(0,S.useState)(0);return(0,S.useEffect)(()=>{let t=!1,n=[];return c(0),i(void 0),aa.post(`/catalog/${encodeURIComponent(e.id)}/test`).then(e=>{t||(i(e),lo()?c(3):[450,950,1450].forEach((e,t)=>n.push(window.setTimeout(()=>c(t+1),e))))}).catch(e=>!t&&o(e instanceof Error?e.message:String(e))),()=>{t=!0,n.forEach(window.clearTimeout)}},[e.id,u]),(0,S.useEffect)(()=>{l.current?.focus()},[]),(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`cat-scrim`,onClick:t,"aria-hidden":`true`}),(0,K.jsxs)(`aside`,{className:`cat-drawer`,role:`dialog`,"aria-modal":`true`,"aria-label":`Test run: ${e.name}`,onKeyDown:e=>e.key===`Escape`&&t(),children:[(0,K.jsxs)(`div`,{className:`cat-dhead`,children:[(0,K.jsx)(aE,{item:e,size:44}),(0,K.jsxs)(`div`,{style:{flex:1,minWidth:0},children:[(0,K.jsx)(oE,{live:e.live}),(0,K.jsxs)(`h2`,{children:[`Test run: `,e.name]})]}),(0,K.jsx)(`button`,{ref:l,className:`fm-ib`,type:`button`,"aria-label":`Close test run`,onClick:t,children:J.close(18)})]}),a&&(0,K.jsx)(`div`,{className:`cat-dsec`,children:(0,K.jsx)(`div`,{className:`error-box`,role:`alert`,children:a})}),r&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`cat-dsec`,children:(0,K.jsxs)(`div`,{className:`cat-mode ${e.live?`live`:`demo`}`,children:[J.shield(18),(0,K.jsx)(`span`,{children:r.mode})]})}),(0,K.jsxs)(`div`,{className:`cat-dsec`,children:[(0,K.jsx)(`span`,{className:`sp-sh`,children:`What happens`}),(0,K.jsx)(`ol`,{className:`cat-steps`,children:r.steps.map((e,t)=>(0,K.jsxs)(`li`,{className:s>t?`done`:s===t?`doing`:``,children:[(0,K.jsx)(`span`,{className:`d`,children:s>t?J.check(13):s===t?J.refresh(13):null}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`b`,{children:e.title}),(0,K.jsx)(`code`,{children:e.text})]})]},e.title))})]}),s>=3&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`cat-dsec`,role:`status`,children:[(0,K.jsxs)(`span`,{className:`sp-sh`,children:[`Result · `,r.stats]}),(0,K.jsx)(`pre`,{className:`code`,children:r.result})]}),(0,K.jsxs)(`div`,{className:`cat-dsec`,children:[(0,K.jsx)(`span`,{className:`sp-sh`,children:`What the Planner learns from it`}),(0,K.jsx)(`ul`,{className:`cat-learn`,children:r.learns.map(e=>(0,K.jsx)(`li`,{children:e},e))})]}),(0,K.jsxs)(`div`,{className:`cat-dsec cat-row`,children:[e.status===`none`&&(0,K.jsx)(`button`,{className:`btn primary`,type:`button`,onClick:()=>n(iE(e)),children:`Add to project`}),(0,K.jsx)(`button`,{className:`btn`,type:`button`,onClick:()=>d(e=>e+1),children:`Run again`})]})]})]})]})]})}function lE(){let e=V(`/catalog`),[t,n]=(0,S.useState)(``),[r,i]=(0,S.useState)(`all`),[a,o]=(0,S.useState)(!1),[s,c]=(0,S.useState)(null),l=(0,S.useMemo)(()=>e.data?[...e.data.items,...e.data.own]:[],[e.data]);if(e.error)return(0,K.jsx)(go,{error:e.error,what:`the catalog`});if(!e.data)return(0,K.jsx)(mo,{lines:6});let u=e.data.categories,d=t.trim().toLowerCase(),f=l.filter(e=>(!a||e.live)&&(r===`all`||e.category===r)&&(!d||`${e.name} ${e.description} ${e.kind} ${e.meta}`.toLowerCase().includes(d))),p=r===`all`&&!d&&!a,m=p?rE.map(e=>({key:e,title:u[e]??e,items:l.filter(t=>t.category===e)})):[{key:`results`,title:r===`all`?`Results`:u[r]??r,items:f}],h=l.filter(e=>e.status===`on_map`),g=l.filter(e=>e.status===`connected`),_=l.filter(e=>e.live).length;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`header`,{className:`page-head`,children:[(0,K.jsxs)(`div`,{className:`titles`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`Connectors`}),(0,K.jsx)(`h1`,{children:`Connect as many apps as you like`}),(0,K.jsxs)(`p`,{className:`lede`,children:[l.length,` apps. `,_,` work for real today; every one has a test run on example data.`]})]}),(0,K.jsx)(`div`,{className:`actions`,children:(0,K.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>{i(`custom`),n(``),o(!1)},children:[J.plus(18),` Add your own`]})})]}),(0,K.jsxs)(`section`,{className:`cat-hero`,"aria-label":`How the map stays honest`,children:[(0,K.jsx)(`span`,{className:`fm-spark`,style:{width:52,height:52},children:J.spark(26)}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`eyebrow`,style:{color:`var(--violet)`},children:`How the map stays honest`}),(0,K.jsx)(`p`,{children:`Only apps your code already calls go on the map. Anything else you connect waits here, off the map, until your code uses it.`})]}),(0,K.jsxs)(`div`,{className:`cat-strips`,children:[(0,K.jsxs)(`div`,{className:`cat-strip`,"aria-label":`On the map`,children:[(0,K.jsx)(`span`,{className:`lbl`,children:`On the map`}),h.length?h.map(e=>(0,K.jsxs)(z,{className:`cat-pt`,to:`/connectors/${e.id}`,children:[(0,K.jsx)(aE,{item:e,size:26}),e.name,(0,K.jsx)(`i`,{})]},e.id)):(0,K.jsx)(`span`,{className:`cat-none`,children:`nothing yet`})]}),(0,K.jsxs)(`div`,{className:`cat-strip`,"aria-label":`Connected, not in your code`,children:[(0,K.jsx)(`span`,{className:`lbl`,children:`Connected, not in your code`}),g.length?g.map(e=>(0,K.jsxs)(z,{className:`cat-pt idle`,to:`/connectors/${e.id}`,children:[(0,K.jsx)(aE,{item:e,size:26}),e.name,(0,K.jsx)(`i`,{})]},e.id)):(0,K.jsx)(`span`,{className:`cat-none`,children:`none`})]})]})]}),(0,K.jsxs)(`div`,{className:`cat-controls`,children:[(0,K.jsxs)(`label`,{className:`cat-search`,children:[J.search(18),(0,K.jsx)(`span`,{className:`visually-hidden`,children:`Search apps`}),(0,K.jsx)(`input`,{type:`search`,placeholder:`Search ${l.length} apps: Stripe, Postgres, voice…`,value:t,onChange:e=>n(e.target.value)})]}),(0,K.jsx)(`div`,{className:`cat-chips`,role:`group`,"aria-label":`Category`,children:[`all`,...rE].map(e=>(0,K.jsxs)(`button`,{type:`button`,className:`filter`,"aria-pressed":r===e,onClick:()=>i(e),children:[e===`all`?`All`:u[e]??e,(0,K.jsx)(`span`,{className:`n`,children:e===`all`?l.length:l.filter(t=>t.category===e).length})]},e))}),(0,K.jsx)(`button`,{type:`button`,className:`filter`,"aria-pressed":a,onClick:()=>o(e=>!e),children:`Live only`})]}),m.map(e=>e.items.length>0&&(0,K.jsxs)(`section`,{className:`cat-sec`,"aria-labelledby":`cat-${e.key}`,children:[(0,K.jsxs)(`div`,{className:`cat-sech`,children:[(0,K.jsx)(`h2`,{id:`cat-${e.key}`,children:e.title}),(0,K.jsxs)(`span`,{children:[e.items.length,` · `,e.items.filter(e=>e.live).length,` live`]})]}),(0,K.jsx)(`div`,{className:`cat-grid`,children:e.items.map(e=>(0,K.jsx)(sE,{item:e,onTest:c},e.id))})]},e.key)),!p&&f.length===0&&(0,K.jsx)(`div`,{className:`empty`,children:(0,K.jsxs)(`p`,{children:[`Nothing matches “`,t,`”. Any app with an API, an MCP server or a command line can be added as your own.`]})}),(0,K.jsx)(`p`,{className:`card-note`,children:`Live means FlowForge can call it today with your own key or on your machine. Demo only means the test run uses example data; the real integration comes per app. Logos are Simple Icons marks used only to name the app; apps without one get letters.`}),s&&(0,K.jsx)(cE,{item:s,onClose:()=>c(null)})]})}var uE={running:[`blue`,`running`],succeeded:[`teal`,`succeeded`],failed:[`coral`,`failed`],error:[`coral`,`error`],stopped:[`slate`,`stopped`],interrupted:[`slate`,`interrupted`],waiting:[`amber`,`waiting for you`]},dE={pending:[`slate`,`waiting`],ready:[`slate`,`ready`],running:[`blue`,`running`],succeeded:[`teal`,`done`],failed:[`coral`,`failed`],skipped:[`slate`,`skipped`]},fE={ok:`teal`,failing:`coral`,missing_key:`amber`,idle:`slate`},pE=e=>uE[e]??[`slate`,e],mE=e=>dE[e]??[`slate`,e],hE=e=>fE[e]??`slate`,gE={llm:{label:`llm`,tone:`violet`},mcp:{label:`mcp`,tone:`teal`},http:{label:`http`,tone:`blue`},local:{label:`script`,tone:`slate`},mock:{label:`demo`,tone:`slate`},gate:{label:`gate`,tone:`amber`}},_E={llm:`LLM`,mcp:`MCP server`,http:`HTTP API`,local:`Local command`},vE={provider:`Provider`,base_url:`Base URL`,model:`Model`,temperature_default:`Default temperature`,command:`Command`,args:`Arguments`,cwd:`Runs in folder`,env:`Settings passed in`,env_refs:`Keys passed in`,auth_header:`Auth header`,auth_scheme:`Auth style`,max_output_bytes:`Output cap`};function yE(e){return Array.isArray(e)?e.join(` `)||`—`:e&&typeof e==`object`?Object.entries(e).map(([e,t])=>`${e}=${String(t)}`).join(`, `)||`—`:e==null||e===``?`—`:String(e)}function bE(e){return e.secret?e.secret.status===`set`?{text:`configured ••••••`,tone:`var(--teal)`}:e.secret.status===`example`?{text:`example (no key)`,tone:`var(--violet)`}:{text:`missing`,tone:`var(--amber)`}:{text:`No key needed`,tone:`var(--muted)`}}function xE(){let{id:e=``}=xr(),t=Go(),n=_r(),r=V(`/connectors/${encodeURIComponent(e)}`),i=V(`/health/tools`,5e3),a=V(`/connectors/${encodeURIComponent(e)}/activity`,5e3),o=r.data?.type===`mcp`,s=V(o&&!t.example?`/connectors/${encodeURIComponent(e)}/tools`:null),[c,l]=(0,S.useState)(null),[u,d]=(0,S.useState)(!1),[f,p]=(0,S.useState)(!1),[m,h]=(0,S.useState)();if(r.error)return r.error instanceof ia&&r.error.status===404?(0,K.jsx)(ho,{icon:J.plug(30),title:`No app with that name`,action:(0,K.jsx)(z,{to:`/connectors`,className:`btn`,children:`See all apps`})}):(0,K.jsx)(go,{error:r.error,what:`this app`});if(!r.data)return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(mo,{lines:2}),(0,K.jsx)(mo,{lines:5})]});let g=r.data,_=i.data?.find(e=>e.id===g.id),v=bE(g),y=g.type===`mcp`||g.type===`local`,b=g.managed_by===`app`;async function x(){d(!0);try{l(await aa.post(`/connectors/${encodeURIComponent(g.id)}/test`)),i.reload()}catch(e){l({ok:!1,message:e.message})}finally{d(!1)}}async function C(){if(!f)p(!0);else try{await aa.del(`/connectors/${encodeURIComponent(g.id)}`),n(`/connectors`)}catch(e){h(e.message),p(!1)}}let w=_?_.status===`ok`?(0,K.jsxs)(co,{tone:`teal`,dot:!0,children:[`Connected`,g.mode?` · ${g.mode} mode`:``]}):(0,K.jsx)(co,{tone:hE(_.status),dot:!0,children:_.label}):null,T=[...new Map((a.data??[]).map(e=>[e.step_id,e])).values()];return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`nav`,{className:`crumbs`,"aria-label":`Breadcrumb`,children:[(0,K.jsx)(z,{to:`/`,children:t.project}),(0,K.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,K.jsx)(z,{to:`/connectors`,children:`Connectors`}),(0,K.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,K.jsx)(`b`,{children:g.name})]}),(0,K.jsxs)(`header`,{className:`card raised`,style:{flexDirection:`row`,flexWrap:`wrap`,alignItems:`center`,gap:16},children:[(0,K.jsx)(no,{c:g,size:60}),(0,K.jsxs)(`div`,{style:{flex:`1 1 220px`,display:`flex`,flexDirection:`column`,gap:2},children:[(0,K.jsx)(`h1`,{style:{fontSize:30},children:g.name}),(0,K.jsx)(`span`,{className:`lede`,children:[g.role,_E[g.type],g.slot&&`slot: ${g.slot}`].filter(Boolean).join(` · `)})]}),(0,K.jsxs)(`div`,{className:`actions`,children:[w,(0,K.jsx)(`button`,{type:`button`,className:`btn`,onClick:x,disabled:!y||u,title:y?`Makes one harmless check`:`Testing LLM and HTTP apps arrives in Phase 4`,children:u?`Testing…`:`Test connection`}),(0,K.jsx)(`button`,{type:`button`,className:`btn violet`,disabled:!0,title:`Swapping an app arrives in Phase 6`,children:`Swap app`})]})]}),c&&(0,K.jsxs)(`div`,{className:c.ok?`notice`:`error-box`,role:`status`,style:c.ok?{background:`var(--teal-bg)`}:void 0,children:[(0,K.jsx)(`b`,{children:c.ok?`It works. `:`It didn't work. `}),c.message]}),!y&&(0,K.jsxs)(`p`,{className:`card-note`,children:[`Testing `,_E[g.type],` apps from here arrives in Phase 4; a run will tell you straight away if the key or address is wrong.`]}),m&&(0,K.jsxs)(`div`,{className:`error-box`,role:`alert`,children:[(0,K.jsx)(`b`,{children:`Couldn't do that.`}),` `,m]}),(0,K.jsxs)(`div`,{className:`grid`,style:{"--min":`400px`},children:[(0,K.jsxs)(`section`,{className:`card`,"aria-labelledby":`conn-title`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,id:`conn-title`,children:`Connection`}),(0,K.jsxs)(`div`,{className:`row`,children:[(0,K.jsx)(`span`,{children:`Type`}),(0,K.jsx)(`b`,{children:_E[g.type]})]}),g.mode&&(0,K.jsxs)(`div`,{className:`row`,children:[(0,K.jsx)(`span`,{children:`Mode`}),(0,K.jsx)(`b`,{style:{textTransform:`capitalize`},children:g.mode})]}),(0,K.jsxs)(`div`,{className:`row`,children:[(0,K.jsx)(`span`,{children:`Key`}),(0,K.jsx)(`b`,{style:{color:v.tone},children:v.text})]}),g.secret&&(0,K.jsxs)(`div`,{className:`row`,children:[(0,K.jsx)(`span`,{children:`Read from`}),(0,K.jsx)(`b`,{className:`mono`,style:{fontSize:14},children:g.secret.ref})]}),(0,K.jsxs)(`div`,{className:`row`,children:[(0,K.jsx)(`span`,{children:`Rate limit`}),(0,K.jsx)(`b`,{children:g.rate_limit_rpm?`${g.rate_limit_rpm} calls a minute`:`none`})]}),_?.rate&&(0,K.jsxs)(`div`,{className:`row`,children:[(0,K.jsx)(`span`,{children:`Left this minute`}),(0,K.jsxs)(`b`,{children:[_.rate.left,` of `,_.rate.rpm]})]}),g.fallback&&(0,K.jsxs)(`div`,{className:`row`,children:[(0,K.jsx)(`span`,{children:`If it keeps failing`}),(0,K.jsxs)(`b`,{children:[`tries `,(0,K.jsx)(z,{to:`/connectors/${g.fallback}`,children:g.fallback})]})]}),(0,K.jsxs)(`div`,{className:`row`,children:[(0,K.jsx)(`span`,{children:`Last test call`}),(0,K.jsx)(`b`,{children:_?.last_test?`${_.last_test.ok?`OK`:`failed`}, ${ao(_.last_test.at)}`:`—`})]}),(0,K.jsx)(`p`,{className:`card-note`,children:g.secret?.status===`missing`?(0,K.jsxs)(K.Fragment,{children:[`Add `,(0,K.jsxs)(`code`,{children:[g.secret.ref.replace(`env:`,``),`=…`]}),` to your `,(0,K.jsx)(`code`,{children:`.env`}),` and restart FlowForge (see `,(0,K.jsx)(`code`,{children:`api-connect.md`}),`).`]}):`Keys live in your .env file. FlowForge stores only the name and never shows the value.`})]}),(0,K.jsxs)(`section`,{className:`card`,"aria-labelledby":`form-title`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,id:`form-title`,children:`The form you filled in`}),Object.entries(g.connection).map(([e,t])=>(0,K.jsxs)(`div`,{className:`row`,children:[(0,K.jsx)(`span`,{children:vE[e]??e}),(0,K.jsx)(`b`,{className:e===`base_url`||e===`command`||e===`cwd`?`mono`:void 0,style:{fontSize:14,textAlign:`right`,overflowWrap:`anywhere`},children:yE(t)})]},e)),b?(0,K.jsxs)(`div`,{className:`actions`,children:[(0,K.jsx)(z,{to:`/connectors/${g.id}/edit`,className:`btn small`,children:`Edit this form`}),g.deletable&&(0,K.jsx)(`button`,{type:`button`,className:`btn small danger`,onClick:C,onBlur:()=>p(!1),children:f?`Click again to remove`:`Remove app`})]}):(0,K.jsxs)(`p`,{className:`card-note`,children:[`This app comes from `,(0,K.jsx)(`code`,{children:`connectors.json`}),`; edit that file to change it.`]})]})]}),(0,K.jsxs)(`section`,{className:`card`,"aria-labelledby":`tasks-title`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,id:`tasks-title`,children:`Tasks inside this box`}),(0,K.jsx)(`span`,{className:`card-note`,children:o?`The tools this server offers`:`What this app has done recently`})]}),o&&t.example&&(0,K.jsx)(`p`,{className:`card-note`,children:`In example mode MCP servers aren't started, so their tools aren't listed.`}),o&&s.loading&&(0,K.jsx)(`p`,{className:`card-note`,children:`Asking the server for its tools…`}),o&&s.error&&(0,K.jsxs)(`p`,{className:`card-note`,children:[`Couldn't reach the server: `,s.error.message]}),(o?s.data??[]:[]).map(e=>(0,K.jsxs)(`div`,{className:`task-row`,children:[(0,K.jsx)(`span`,{className:`tag tone-teal`,children:`tool`}),(0,K.jsx)(`b`,{children:e.name}),(0,K.jsx)(`span`,{className:`card-note`,children:e.description})]},e.name)),!o&&T.map(e=>(0,K.jsxs)(`div`,{className:`task-row`,children:[(0,K.jsx)(`span`,{className:`tag tone-${gE[g.type].tone}`,children:gE[g.type].label}),(0,K.jsx)(`b`,{children:e.title}),(0,K.jsxs)(`span`,{className:`card-note`,children:[e.plan,` · `,ro(e.duration_ms)]})]},e.step_id)),!o&&T.length===0&&(0,K.jsx)(`p`,{className:`card-note`,children:`Nothing yet. Tasks appear here once a run uses this app.`})]}),(0,K.jsxs)(`section`,{className:`card`,style:{background:`var(--violet-bg)`,borderColor:`transparent`},"aria-labelledby":`planner-title`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,id:`planner-title`,style:{color:`var(--violet)`},children:`Suggested by the Planner`}),(0,K.jsx)(co,{tone:`violet`,children:`Arrives in Phase 5`})]}),(0,K.jsx)(`p`,{children:`The Planner will read this app's tools, API and your code, and propose tasks you confirm once in Plan review. A suggestion with no real tool, route or file behind it is dropped before you see it.`})]}),(0,K.jsxs)(`section`,{className:`card`,"aria-labelledby":`activity-title`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,id:`activity-title`,children:`Recent activity`}),a.data?a.data.length===0?(0,K.jsx)(`p`,{className:`card-note`,children:`No calls yet.`}):(0,K.jsx)(`ol`,{className:`event-log`,style:{maxHeight:`none`},children:a.data.slice(0,12).map(e=>{let[t,n]=mE(e.state);return(0,K.jsxs)(`li`,{style:{whiteSpace:`normal`,flexWrap:`wrap`},children:[(0,K.jsx)(`span`,{className:`t`,children:oo(e.at)}),(0,K.jsx)(z,{to:`/runs/${e.run_id}`,children:e.plan}),(0,K.jsxs)(`span`,{children:[`· `,e.title,` ·`]}),(0,K.jsx)(`span`,{style:{color:`var(--${t})`},children:e.cache_hit?`from cache`:n}),e.duration_ms!==null&&(0,K.jsx)(`span`,{className:`t`,children:ro(e.duration_ms)}),e.error&&(0,K.jsx)(`span`,{style:{color:`var(--coral)`},children:e.error})]},`${e.run_id}-${e.step_id}`)})}):(0,K.jsx)(mo,{lines:3})]})]})}function SE(){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`header`,{className:`page-head`,children:[(0,K.jsxs)(`div`,{className:`titles`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`Paused until you decide`}),(0,K.jsx)(`h1`,{children:`Approvals`})]}),(0,K.jsx)(co,{tone:`amber`,children:`Arrives in V2`})]}),(0,K.jsx)(ho,{tone:`amber`,icon:J.check(30),title:`Nothing is waiting for you`,children:`When approval gates arrive, any payment, code change or other step with side effects pauses here first. You'll see why it was proposed, what happens if you approve, and whether it can be undone. The Planner can never turn that off.`})]})}var CE=(e,t)=>`${Math.max(0,Math.min(100,e/t*100))}%`;function wE({rows:e,scaleS:t,nowS:n,live:r,selected:i,onSelect:a}){let o=[0,.25,.5,.75,1].map(e=>e*t);return(0,K.jsxs)(`div`,{className:`gantt`,role:`list`,"aria-label":`Who ran when`,children:[e.map(e=>{let[r,o]=mE(e.state),s=e.state===`running`,c=e.end??(s?n:null),l=gE[e.type]??{label:e.type,tone:`slate`},u=`: ${e.cacheHit?`answered from cache`:o}${e.start!==null&&c!==null?`, ${(c-e.start).toFixed(1)} s`:``}${e.critical?`, on the slowest chain`:``}`;return(0,K.jsxs)(`div`,{role:`listitem`,className:`gantt-row${i===e.id?` is-selected`:``}`,children:[(0,K.jsxs)(`button`,{type:`button`,className:`gantt-label`,onClick:()=>a?.(e.id),"aria-pressed":i===e.id,children:[(0,K.jsx)(`span`,{className:`gantt-n`,children:e.n}),(0,K.jsx)(`span`,{className:`gantt-title`,children:e.title}),(0,K.jsx)(`span`,{className:`tag tone-${l.tone}`,children:l.label}),(0,K.jsx)(`span`,{className:`visually-hidden`,children:u})]}),(0,K.jsxs)(`div`,{className:`gantt-track`,onClick:()=>a?.(e.id),"aria-hidden":`true`,children:[e.start!==null&&c!==null&&(0,K.jsx)(`div`,{className:`gantt-bar state-${e.state}${e.cacheHit?` is-cache`:``}${e.critical?` is-critical`:``}${s?` running-stripes pulse`:``}`,style:{left:CE(e.start,t),width:`max(6px, ${CE(c-e.start,t)})`,"--tone":`var(--${r})`},children:e.cacheHit&&(0,K.jsx)(`span`,{className:`gantt-chip`,children:`cache`})}),e.start===null&&e.expectedStart!==null&&e.expectedEnd!==null&&(0,K.jsx)(`div`,{className:`gantt-bar is-expected${e.critical?` is-critical`:``}`,style:{left:CE(e.expectedStart,t),width:`max(6px, ${CE(e.expectedEnd-e.expectedStart,t)})`}}),e.state===`skipped`&&(0,K.jsx)(`span`,{className:`gantt-skip`,children:`skipped`})]})]},e.id)}),(0,K.jsxs)(`div`,{className:`gantt-row gantt-axis`,"aria-hidden":`true`,children:[(0,K.jsx)(`span`,{}),(0,K.jsxs)(`div`,{className:`gantt-ticks`,children:[o.map(e=>(0,K.jsx)(`span`,{children:e===0?`0 s`:`${Number(e.toFixed(1))}${e===t?` s`:``}`},e)),r&&(0,K.jsx)(`span`,{className:`gantt-now`,style:{left:CE(n,t)}})]})]})]})}var TE=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function EE(e){let t=[e,TE(e)&&e.rows,TE(e)&&e.body,TE(e)&&TE(e.body)&&e.body.data,TE(e)&&TE(e.structured)&&e.structured.rows];for(let e of t)if(Array.isArray(e)&&e.length>0&&e.every(TE))return e;return null}function DE(e){if(typeof e==`string`)return e;if(!TE(e))return null;for(let t of[`text`,`stdout`,`content`,`body`])if(typeof e[t]==`string`&&e[t])return e[t];return null}function OE(e){return!TE(e)||!Array.isArray(e.blocks)?[]:e.blocks.filter(e=>e.kind===`image`&&typeof e.data_b64==`string`&&typeof e.mime==`string`).map((e,t)=>({src:`data:${e.mime};base64,${e.data_b64}`,alt:`Image ${t+1} from this step`}))}function kE(e){let t=[];return EE(e)&&t.push(`table`),OE(e).length&&t.push(`image`),DE(e)!==null&&t.push(`text`),t.push(`json`),t}function AE({rows:e}){let t=[...new Set(e.flatMap(e=>Object.keys(e)))].slice(0,8);return(0,K.jsx)(`div`,{className:`table-wrap`,children:(0,K.jsxs)(`table`,{className:`data`,children:[(0,K.jsx)(`thead`,{children:(0,K.jsx)(`tr`,{children:t.map(e=>(0,K.jsx)(`th`,{scope:`col`,children:e},e))})}),(0,K.jsx)(`tbody`,{children:e.slice(0,200).map((e,n)=>(0,K.jsx)(`tr`,{children:t.map(t=>{let n=e[t],r=n===`failed`?`var(--coral)`:n===`captured`||n===`succeeded`?`var(--teal)`:void 0;return(0,K.jsx)(`td`,{style:r?{color:r,fontWeight:600}:void 0,children:typeof n==`object`?JSON.stringify(n):String(n??``)},t)})},n))})]})})}function jE({output:e,title:t}){let n=kE(e),[r,i]=(0,S.useState)(null),a=r&&n.includes(r)?r:n[0],o=e==null;return(0,K.jsxs)(`section`,{className:`card slide-in`,"aria-label":`Output of ${t}`,children:[(0,K.jsxs)(`div`,{className:`card-head`,style:{alignItems:`center`},children:[(0,K.jsxs)(`span`,{className:`eyebrow`,children:[`Output · `,t]}),!o&&(0,K.jsx)(`div`,{role:`tablist`,"aria-label":`How to show this output`,style:{display:`flex`,gap:6},children:n.map(e=>(0,K.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":e===a,className:`filter`,style:{minHeight:34},onClick:()=>i(e),children:{table:`Table`,text:`Text`,image:`Image`,json:`JSON`}[e]},e))})]}),o?(0,K.jsx)(`p`,{className:`card-note`,children:`No output yet. It appears here as soon as this step finishes.`}):a===`table`?(0,K.jsx)(AE,{rows:EE(e)}):a===`image`?(0,K.jsx)(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:12},children:OE(e).map(e=>(0,K.jsx)(`img`,{src:e.src,alt:e.alt,style:{maxWidth:`100%`,borderRadius:10}},e.alt))}):a===`text`?(0,K.jsx)(`pre`,{className:`code`,style:{whiteSpace:`pre-wrap`},children:DE(e)}):(0,K.jsx)(`pre`,{className:`code`,children:JSON.stringify(e,null,2)}),(0,K.jsx)(`span`,{className:`card-note`,children:`The viewer matches the output: table, text, image or JSON. Keys are shown as [REDACTED].`})]})}function ME(e){let t=e?.usage;return t?(t.prompt_tokens??0)+(t.completion_tokens??0):0}function NE(e,t,n,r){let i=new Map(e.map((e,t)=>[e.id,{id:e.id,n:t+1,title:e.title,type:e.type,connector:e.connector,state:`pending`,start:null,end:null,expectedStart:null,expectedEnd:null,cacheHit:!1,critical:!1,error:null,output:void 0}])),a=null,o={},s=[];for(let e of t)if(e.type===`run`&&e.state===`started`)a=e.predicted_critical_path_ms??null,s=e.predicted_critical_path??[],o=e.estimates??{};else if(e.type===`run`&&e.actual_critical_path)s=e.actual_critical_path;else if(e.type===`step`){let t=i.get(e.step_id);if(!t)continue;t.state=e.state,e.state===`running`&&(t.start=e.t),(e.state===`succeeded`||e.state===`failed`)&&(t.end=e.t,t.start===null&&(t.start=e.t),t.cacheHit=!!e.cache_hit,t.error=e.error??null,t.output=e.output),e.state===`skipped`&&(t.error=e.reason??null)}if(n){s=n.actual_critical_path;for(let e of Object.values(n.steps)){let t=i.get(e.step_id);t&&(t.state=e.state,t.start=e.started_at,t.end=e.finished_at,t.cacheHit=e.cache_hit,t.error=e.error??t.error,t.output=e.output??t.output)}}let c=new Map;for(let t of e){let e=i.get(t.id);if(e.start!==null){c.set(t.id,e.end??Math.max(r,e.start));continue}if(e.state===`skipped`)continue;let n=Math.max(r,...t.depends_on.map(e=>c.get(e)??r));e.expectedStart=n,e.expectedEnd=n+(o[t.id]??0)/1e3,c.set(t.id,e.expectedEnd)}let l=new Set(s),u=[...i.values()].map(e=>({...e,critical:l.has(e.id)})),d=Math.max(r,(a??0)/1e3,...u.map(e=>Math.max(e.end??0,e.expectedEnd??0,e.start??0)));return{rows:u,predictedMs:a,scaleS:PE(Math.max(d,.5)),criticalPath:s,tokens:u.filter(e=>!e.cacheHit).reduce((e,t)=>e+ME(t.output),0),calls:u.filter(e=>(e.state===`succeeded`||e.state===`failed`)&&!e.cacheHit).length,cacheHits:u.filter(e=>e.cacheHit).length}}function PE(e){return[.5,1,2,2.5,5,10,15,20,30,60,90,120,180,300,600].find(t=>t>=e)??Math.ceil(e/60)*60}function FE(e,t){let n=new Map(e.map((e,t)=>[e.id,t+1])),r=e=>String(n.get(e)??e),i=new Map,a=e=>{let t=e.toFixed(1);return i.has(t)||i.set(t,{t:e,started:[],done:[],cached:[],other:[]}),i.get(t)};for(let e of t){if(e.type===`end`)continue;let t=`t`in e&&typeof e.t==`number`?e.t:0;e.type===`step`?e.state===`running`?a(t).started.push(r(e.step_id)):e.state===`succeeded`?(e.cache_hit?a(t).cached:a(t).done).push(r(e.step_id)):e.state===`failed`?a(t).other.push({text:`${r(e.step_id)} failed: ${e.error??`unknown error`}`,tone:`coral`}):e.state===`skipped`&&a(t).other.push({text:`${r(e.step_id)} skipped (an earlier step failed)`,tone:`slate`}):e.type===`retry`?a(t).other.push({text:`${r(e.step_id)} retrying in ${e.delay_s.toFixed(1)}s: ${e.error}`,tone:`amber`}):e.type===`fallback`?a(t).other.push({text:`${r(e.step_id)} switched from ${e.from} to ${e.to}`,tone:`violet`}):e.type===`run`&&e.state!==`started`&&a(t).other.push({text:{succeeded:`run finished`,failed:`run finished with a failure`,stopped:`stopped by you`,interrupted:`interrupted`,error:`the engine hit an error`}[e.state]??e.state,tone:e.state===`succeeded`?`teal`:e.state===`failed`||e.state===`error`?`coral`:`slate`})}let o=e=>[...e].sort((e,t)=>Number(e)-Number(t)||e.localeCompare(t)).join(`, `),s=[];for(let e of[...i.values()].sort((e,t)=>e.t-t.t)){let t=[];e.done.length&&t.push(`${o(e.done)} done`),e.cached.length&&t.push(`${o(e.cached)} answered from cache`),e.started.length&&t.push(e.started.length>1?`${o(e.started)} started together`:`${e.started[0]} started`),t.length&&s.push({t:e.t,text:t.join(` · `)});for(let t of e.other)s.push({t:e.t,...t})}return s}var IE=e=>e.replace(/[_-]+/g,` `).replace(/^\w/,e=>e.toUpperCase());function LE(e,t){let[n,r]=(0,S.useState)(()=>Date.now());return(0,S.useEffect)(()=>{if(!t)return;if(lo()){let e=window.setInterval(()=>r(Date.now()),250);return()=>window.clearInterval(e)}let e=requestAnimationFrame(function t(){r(Date.now()),e=requestAnimationFrame(t)});return()=>cancelAnimationFrame(e)},[t]),e?Math.max(0,(n-new Date(e).getTime())/1e3):0}function RE(){let{id:e=``}=xr(),t=_r(),{events:n,ended:r}=Fo(e),i=!r,a=V(`/runs/${encodeURIComponent(e)}`,i?1500:void 0),[o,s]=(0,S.useState)(),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(),f=a.data?.status??`running`,p=f===`running`,m=LE(a.data?.summary.started_at,p),h=p?m:(a.data?.result?.makespan_ms??a.data?.summary.time_ms??0)/1e3,g=(0,S.useMemo)(()=>NE(a.data?.steps??[],n,a.data?.result??null,h),[a.data,n,h]),_=(0,S.useMemo)(()=>FE(a.data?.steps??[],n),[a.data?.steps,n]);if((0,S.useEffect)(()=>{r&&a.reload()},[r]),a.error)return a.error instanceof ia&&a.error.status===404?(0,K.jsxs)(ho,{icon:J.history(30),title:`That run doesn't exist`,children:[`It may belong to another FlowForge data folder. `,(0,K.jsx)(z,{to:`/runs`,children:`See run history`}),`.`]}):(0,K.jsx)(go,{error:a.error,what:`this run`});if(!a.data)return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(mo,{lines:2}),(0,K.jsx)(mo,{lines:6})]});let v=a.data,[y,b]=pE(f),x=g.rows.find(e=>e.id===o)??g.rows.find(e=>e.output!==void 0&&e.output!==null)??g.rows[0],C=v.result?.api_calls??g.calls,w=v.result?.cache_hits??g.cacheHits;async function T(){l(!0),d(void 0);try{await aa.post(`/runs/${encodeURIComponent(e)}/stop`)}catch(e){d(e.message)}finally{l(!1),a.reload()}}return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`header`,{className:`page-head`,children:[(0,K.jsxs)(`div`,{className:`titles`,children:[(0,K.jsxs)(`span`,{className:`eyebrow`,children:[`Run `,so(v.summary.id),` · `,v.summary.plan]}),(0,K.jsx)(`h1`,{children:p?`Running now`:{succeeded:`Finished`,failed:`Finished with a failure`,stopped:`Stopped`,interrupted:`Interrupted`,error:`Something went wrong`}[f]??b}),(0,K.jsxs)(`span`,{className:`lede`,children:[`Started `,ao(v.summary.started_at)]})]}),(0,K.jsxs)(`div`,{className:`actions`,children:[p?(0,K.jsxs)(`button`,{type:`button`,className:`btn danger`,onClick:T,disabled:c,children:[J.stop(16),` `,c?`Stopping…`:`Stop run`]}):(0,K.jsxs)(`button`,{type:`button`,className:`btn`,onClick:()=>t(`/live?again=`+encodeURIComponent(v.summary.workflow_id)),children:[J.refresh(16),` Run it again`]}),(0,K.jsx)(z,{to:`/runs`,className:`btn`,children:`Run history`})]})]}),u&&(0,K.jsxs)(`div`,{className:`error-box`,role:`alert`,children:[(0,K.jsx)(`b`,{children:`Couldn't stop it.`}),` `,u]}),v.summary.failure_reason&&!p&&(0,K.jsxs)(`div`,{className:`error-box`,role:`status`,children:[(0,K.jsx)(`b`,{children:`Why: `}),v.summary.failure_reason]}),(0,K.jsxs)(`div`,{className:`stats`,"aria-live":`polite`,children:[(0,K.jsx)(fo,{tone:y,value:(0,K.jsxs)(`span`,{style:{display:`inline-flex`,alignItems:`center`,gap:10},children:[p&&(0,K.jsx)(`span`,{className:`chip-dot pulse`}),b]}),label:`status`}),(0,K.jsx)(fo,{value:ro(h*1e3),label:g.predictedMs?`elapsed · about ${ro(g.predictedMs,0)} expected`:`elapsed`}),(0,K.jsx)(fo,{value:io(C),label:`API calls · ${io(w)} skipped by cache`}),(0,K.jsx)(fo,{value:io(g.tokens),label:p?`tokens so far`:`tokens used`})]}),(0,K.jsxs)(`section`,{className:`card raised`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h2`,{children:`Who ran when`}),(0,K.jsx)(`span`,{className:`card-note`,children:`The outlined chain is the slowest, so it sets the total time.`})]}),(0,K.jsx)(`div`,{className:`table-wrap`,children:(0,K.jsx)(wE,{rows:g.rows,scaleS:g.scaleS,nowS:h,live:p,selected:x?.id,onSelect:s})}),(0,K.jsxs)(`div`,{className:`legend`,children:[(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`i`,{style:{background:`var(--teal)`}}),`done`]}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`i`,{style:{background:`var(--blue)`}}),`running`]}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`i`,{style:{background:`color-mix(in srgb, var(--teal) 45%, var(--surface))`}}),`answered from cache`]}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`i`,{style:{border:`2px dashed var(--idle)`}}),`waiting`]}),(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`i`,{style:{background:`var(--coral)`}}),`failed`]})]})]}),(0,K.jsxs)(`div`,{className:`grid`,style:{"--min":`420px`},children:[x&&(0,K.jsx)(jE,{output:x.output,title:`${x.n} ${x.title}`},x.id),(0,K.jsxs)(`section`,{className:`card`,"aria-label":`Events`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`Events`}),(0,K.jsxs)(`ol`,{className:`event-log`,"aria-live":`polite`,children:[_.map((e,t)=>(0,K.jsxs)(`li`,{style:e.tone?{color:`var(--${e.tone})`}:void 0,children:[(0,K.jsxs)(`span`,{className:`t`,children:[e.t.toFixed(1),`s`]}),e.text]},t)),p&&(0,K.jsxs)(`li`,{className:`t`,style:{color:`var(--blue)`},children:[(0,K.jsxs)(`span`,{className:`t`,children:[h.toFixed(1),`s`]}),`running…`]})]})]})]})]})}function zE(){let e=V(`/runs?limit=10`,3e3),t=V(`/workflows`),n=_r(),[r,i]=(0,S.useState)(),[a,o]=(0,S.useState)(),s=new URLSearchParams(window.location.search).get(`again`);async function c(e){i(e),o(void 0);try{let t=await aa.get(`/workflows/${encodeURIComponent(e)}`),{run_id:r}=await aa.post(`/runs`,t);n(`/runs/${r}`)}catch(e){o(e.message),i(void 0)}}(0,S.useEffect)(()=>{s&&t.data?.includes(s)&&!r&&c(s)},[s,t.data]);let l=e.data?.find(e=>e.status===`running`);if(l&&!s)return(0,K.jsx)(ei,{to:`/runs/${l.id}`,replace:!0});let u=e.data?.filter(e=>e.status!==`running`).slice(0,3)??[];return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`header`,{className:`page-head`,children:(0,K.jsxs)(`div`,{className:`titles`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:`Live run`}),(0,K.jsx)(`h1`,{children:`Nothing is running`}),(0,K.jsx)(`span`,{className:`lede`,children:`Start a plan and watch every step as it happens.`})]})}),a&&(0,K.jsxs)(`div`,{className:`error-box`,role:`alert`,children:[(0,K.jsx)(`b`,{children:`Couldn't start it.`}),` `,a]}),(0,K.jsxs)(`section`,{className:`card raised`,children:[(0,K.jsx)(`h2`,{children:`Start a run`}),t.data?(0,K.jsx)(`div`,{className:`grid`,style:{"--min":`240px`},children:t.data.map(e=>(0,K.jsxs)(`button`,{type:`button`,className:`choice`,onClick:()=>c(e),disabled:!!r,"aria-busy":r===e,children:[(0,K.jsx)(`b`,{children:IE(e)}),(0,K.jsx)(`span`,{children:r===e?`Starting…`:`Run now`})]},e))}):(0,K.jsx)(mo,{lines:2}),(0,K.jsxs)(`p`,{className:`card-note`,children:[`Soon the Planner will propose plans from your connected apps (Phase 5). For now these are ready-made plans; developers can also send their own workflow JSON to `,(0,K.jsx)(`code`,{children:`POST /runs`}),`.`]})]}),u.length>0&&(0,K.jsxs)(`section`,{className:`card`,children:[(0,K.jsx)(`h2`,{children:`Recent runs`}),u.map(e=>(0,K.jsxs)(z,{to:`/runs/${e.id}`,className:`row`,style:{textDecoration:`none`,color:`var(--fg)`},children:[(0,K.jsxs)(`span`,{children:[e.plan,` · `,ao(e.started_at)]}),(0,K.jsx)(co,{tone:pE(e.status)[0],children:pE(e.status)[1]})]},e.id))]})]})}function BE(){let e=V(`/connectors`,8e3),t=V(`/health/tools`,4e3),n=V(`/stats/savings`,5e3),r=(t.data??[]).filter(e=>e.status===`missing_key`||e.status===`failing`);return(0,K.jsxs)(`div`,{className:`grid`,style:{"--min":`320px`},children:[n.data?(0,K.jsxs)(`section`,{className:`card rise rise-1`,"aria-labelledby":`money-title`,children:[(0,K.jsx)(`h2`,{id:`money-title`,children:`Money and time`}),(0,K.jsxs)(`div`,{className:`stats`,style:{gridTemplateColumns:`repeat(2, minmax(0, 1fr))`},children:[(0,K.jsx)(fo,{tone:`teal`,value:(0,K.jsx)(uo,{value:n.data.time_saved_ms,format:e=>ro(e)}),label:`saved vs one at a time`}),(0,K.jsx)(fo,{tone:`blue`,value:(0,K.jsx)(uo,{value:n.data.calls_skipped,format:io}),label:`calls skipped by cache`}),(0,K.jsx)(fo,{tone:`violet`,value:(0,K.jsx)(uo,{value:n.data.tokens,format:io}),label:`tokens used`}),(0,K.jsx)(fo,{tone:`amber`,value:(0,K.jsx)(uo,{value:n.data.credits,format:io}),label:`credits used`})]}),(0,K.jsxs)(`span`,{className:`card-note`,children:[`Across `,io(n.data.runs),` finished run`,n.data.runs===1?``:`s`,`.`]})]}):(0,K.jsx)(mo,{lines:4}),t.data?(0,K.jsxs)(`section`,{className:`card rise rise-2`,"aria-labelledby":`health-title`,children:[(0,K.jsx)(`h2`,{id:`health-title`,children:`App health`}),(0,K.jsx)(`ul`,{style:{listStyle:`none`,margin:0,padding:0},children:t.data.map(t=>(0,K.jsxs)(`li`,{className:`row`,style:{alignItems:`center`},children:[(0,K.jsxs)(z,{to:`/connectors/${t.id}`,style:{display:`flex`,gap:10,alignItems:`center`,color:`var(--fg)`,textDecoration:`none`},children:[(0,K.jsx)(no,{c:e.data?.find(e=>e.id===t.id)??{id:t.id,name:t.name,type:t.type},size:26}),t.name]}),(0,K.jsxs)(`span`,{style:{textAlign:`right`},children:[(0,K.jsx)(`b`,{style:{color:`var(--${hE(t.status)})`},children:t.label}),t.rate&&(0,K.jsxs)(`span`,{className:`card-note`,style:{display:`block`},children:[t.rate.left,` of `,t.rate.rpm,` calls left this minute`]})]})]},t.id))}),r.length>0&&(0,K.jsxs)(`span`,{className:`card-note`,children:[r.length,` app`,r.length>1?`s need`:` needs`,` a key or a look. See api-connect.md.`]})]}):(0,K.jsx)(mo,{lines:5})]})}var VE=[{id:`all`,label:`All`},{id:`succeeded`,label:`Succeeded`},{id:`failed`,label:`Failed`},{id:`waiting`,label:`Waiting for you`,soon:`Approval gates arrive in Phase 5`}],HE=25;function UE(){let e=Go(),[t,n]=(0,S.useState)(`all`),r=`/runs?limit=${HE}${t===`all`?``:`&status=${t}`}`,i=V(r,3e3),a=V(`/connectors`),[o,s]=(0,S.useState)([]),[c,l]=(0,S.useState)(!1),[u,d]=(0,S.useState)(!1);(0,S.useEffect)(()=>{s([]),l(!1)},[t]);let f=[...i.data??[],...o.filter(e=>!i.data?.some(t=>t.id===e.id))],p=f.find(e=>e.status===`failed`||e.status===`error`||e.status===`interrupted`),m=Object.fromEntries((a.data??[]).map(e=>[e.id,e]));async function h(){let e=f[f.length-1];if(e){d(!0);try{let t=await aa.get(`${r}&before=${encodeURIComponent(e.started_at)}`);s(e=>[...e,...t]),t.length<HE&&l(!0)}finally{d(!1)}}}return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`header`,{className:`page-head`,children:[(0,K.jsxs)(`div`,{className:`titles`,children:[(0,K.jsx)(`span`,{className:`eyebrow`,children:e.project}),(0,K.jsx)(`h1`,{children:`Runs`})]}),(0,K.jsxs)(z,{to:`/live`,className:`btn primary`,children:[J.play(18),` Start a run`]})]}),(0,K.jsx)(BE,{}),(0,K.jsxs)(`header`,{className:`page-head`,children:[(0,K.jsx)(`h2`,{children:`History`}),(0,K.jsx)(`div`,{className:`actions`,role:`group`,"aria-label":`Show runs`,children:VE.map(e=>(0,K.jsx)(`button`,{type:`button`,className:`filter`,"aria-pressed":t===e.id,disabled:!!e.soon,title:e.soon,onClick:()=>n(e.id),children:e.label},e.id))})]}),i.error?(0,K.jsx)(go,{error:i.error,what:`run history`}):i.data?f.length===0?(0,K.jsx)(ho,{icon:J.history(30),title:t===`all`?`No runs yet`:`No ${t} runs`,action:(0,K.jsxs)(z,{to:`/live`,className:`btn primary`,children:[J.play(18),` Start a run`]}),children:`Every run is stored with its events, after keys are removed, so you can look back at what happened.`}):(0,K.jsxs)(`section`,{className:`card raised`,style:{padding:`8px 20px 20px`},children:[(0,K.jsx)(`div`,{className:`table-wrap`,children:(0,K.jsxs)(`table`,{className:`data`,style:{minWidth:820},children:[(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{scope:`col`,children:`Run`}),(0,K.jsx)(`th`,{scope:`col`,children:`Plan`}),(0,K.jsx)(`th`,{scope:`col`,children:`Status`}),(0,K.jsx)(`th`,{scope:`col`,children:`Time`}),(0,K.jsx)(`th`,{scope:`col`,children:`Skipped by cache`}),(0,K.jsx)(`th`,{scope:`col`,children:`Tokens`})]})}),(0,K.jsx)(`tbody`,{children:f.map(e=>{let[t,n]=pE(e.status);return(0,K.jsxs)(`tr`,{children:[(0,K.jsxs)(`td`,{children:[(0,K.jsx)(z,{to:`/runs/${e.id}`,className:`mono`,style:{fontSize:14},children:so(e.id)}),(0,K.jsx)(`div`,{className:`card-note`,children:ao(e.started_at)})]}),(0,K.jsxs)(`td`,{children:[(0,K.jsx)(`div`,{children:e.plan}),(0,K.jsx)(`div`,{style:{display:`flex`,gap:4,marginTop:6},"aria-label":`Apps used`,children:e.connectors.slice(0,6).map(e=>(0,K.jsx)(`span`,{title:m[e]?.name??e,children:(0,K.jsx)(no,{c:m[e]??{id:e,name:e,type:`local`},size:20})},e))})]}),(0,K.jsx)(`td`,{children:(0,K.jsx)(co,{tone:t,dot:!0,pulse:e.status===`running`,children:n})}),(0,K.jsx)(`td`,{className:`num`,children:e.status===`running`?`running…`:ro(e.time_ms)}),(0,K.jsx)(`td`,{className:`num`,children:io(e.cache_hits)}),(0,K.jsx)(`td`,{className:`num`,children:io(e.tokens)})]},e.id)})})]})}),!c&&f.length>=HE&&(0,K.jsx)(`button`,{type:`button`,className:`btn`,style:{alignSelf:`flex-start`},onClick:h,disabled:u,children:u?`Loading…`:`Show older runs`})]}):(0,K.jsx)(mo,{lines:6}),p?.failure_reason&&(0,K.jsxs)(`section`,{className:`card`,style:{background:`var(--coral-bg)`,borderColor:`transparent`},"aria-label":`Why it failed`,children:[(0,K.jsxs)(`b`,{style:{color:`var(--coral)`},children:[`Why run `,(0,K.jsx)(z,{to:`/runs/${p.id}`,children:so(p.id)}),` `,p.status===`interrupted`?`was interrupted`:`failed`]}),(0,K.jsx)(`span`,{children:p.failure_reason}),(0,K.jsx)(`span`,{className:`card-note`,children:`Failures show the real reason in plain words, and skip only the steps that depended on it.`})]}),(0,K.jsxs)(`p`,{className:`card-note`,children:[e.example?`Example data. `:``,`Every run is stored with its redacted events, so nothing here contains a key.`]})]})}function WE(){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`h1`,{children:`Page not found`}),(0,K.jsxs)(`p`,{className:`lede`,children:[`That address isn't part of FlowForge. `,(0,K.jsx)(z,{to:`/`,children:`Back to the map`}),`.`]})]})}var GE=Vi([{element:(0,K.jsx)(Zo,{}),children:[{path:`/`,element:(0,K.jsx)(Gw,{}),handle:{bleed:!0}},{path:`/map/how`,element:(0,K.jsx)(tT,{})},{path:`/map/recheck`,element:(0,K.jsx)(aT,{})},{path:`/map/export`,element:(0,K.jsx)(zT,{})},{path:`/connectors`,element:(0,K.jsx)(lE,{})},{path:`/connectors/new`,element:(0,K.jsx)(tE,{})},{path:`/connectors/:id`,element:(0,K.jsx)(xE,{})},{path:`/connectors/:id/edit`,element:(0,K.jsx)(tE,{})},{path:`/plans`,element:(0,K.jsx)(ei,{to:`/`,replace:!0})},{path:`/checks`,element:(0,K.jsx)(Uo,{})},{path:`/connect`,element:(0,K.jsx)(Co,{})},{path:`/live`,element:(0,K.jsx)(zE,{})},{path:`/runs`,element:(0,K.jsx)(UE,{})},{path:`/runs/:id`,element:(0,K.jsx)(RE,{})},{path:`/approvals`,element:(0,K.jsx)(SE,{})},{path:`/security`,element:(0,K.jsx)(ei,{to:`/`,replace:!0})},{path:`*`,element:(0,K.jsx)(WE,{})}]}]);(0,ra.createRoot)(document.getElementById(`root`)).render((0,K.jsx)(S.StrictMode,{children:(0,K.jsx)(na,{router:GE})}));
|