@vohongtho.infotech/code-intel 1.0.1 → 1.0.3

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.
@@ -0,0 +1,354 @@
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,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var 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.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var te=/\/+/g;function k(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function A(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function j(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,j(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+k(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(te,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(te,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+k(a,u),c+=j(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+k(a,u++),c+=j(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return j(A(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 M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function N(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var P=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},F={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=F,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:N}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,P)}catch(e){P(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),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&&k(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&&k(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 ee=new MessageChannel,te=ee.port2;ee.port1.onmessage=D,O=function(){te.postMessage(null)}}else O=function(){_(D,0)};function k(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,k(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`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.7`})),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){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function 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}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),ee=Symbol.for(`react.activity`),te=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case ee:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var N=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},ne=[],L=-1;function re(e){return{current:e}}function R(e){0>L||(e.current=ne[L],ne[L]=null,L--)}function z(e,t){L++,ne[L]=e.current,e.current=t}var ie=re(null),B=re(null),V=re(null),H=re(null);function ae(e,t){switch(z(V,t),z(B,e),z(ie,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}R(ie),z(ie,e)}function U(){R(ie),R(B),R(V)}function W(e){e.memoizedState!==null&&z(H,e);var t=ie.current,n=Hd(t,e.type);t!==n&&(z(B,e),z(ie,n))}function G(e){B.current===e&&(R(ie),R(B)),H.current===e&&(R(H),Qf._currentValue=I)}var oe,se;function ce(e){if(oe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);oe=t&&t[1]||``,se=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+oe+e+se}var le=!1;function ue(e,t){if(!e||le)return``;le=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
+ `),l=s.split(`
5
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{le=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ce(n):``}function de(e,t){switch(e.tag){case 26:case 27:case 5:return ce(e.type);case 16:return ce(`Lazy`);case 13:return e.child!==t&&t!==null?ce(`Suspense Fallback`):ce(`Suspense`);case 19:return ce(`SuspenseList`);case 0:case 15:return ue(e.type,!1);case 11:return ue(e.type.render,!1);case 1:return ue(e.type,!0);case 31:return ce(`Activity`);default:return``}}function fe(e){try{var t=``,n=null;do t+=de(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var pe=Object.prototype.hasOwnProperty,me=t.unstable_scheduleCallback,he=t.unstable_cancelCallback,ge=t.unstable_shouldYield,_e=t.unstable_requestPaint,ve=t.unstable_now,ye=t.unstable_getCurrentPriorityLevel,be=t.unstable_ImmediatePriority,xe=t.unstable_UserBlockingPriority,Se=t.unstable_NormalPriority,Ce=t.unstable_LowPriority,we=t.unstable_IdlePriority,Te=t.log,Ee=t.unstable_setDisableYieldValue,De=null,Oe=null;function ke(e){if(typeof Te==`function`&&Ee(e),Oe&&typeof Oe.setStrictMode==`function`)try{Oe.setStrictMode(De,e)}catch{}}var Ae=Math.clz32?Math.clz32:Ne,je=Math.log,Me=Math.LN2;function Ne(e){return e>>>=0,e===0?32:31-(je(e)/Me|0)|0}var Pe=256,Fe=262144,Ie=4194304;function Le(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Re(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=Le(n))):i=Le(o):i=Le(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Le(n))):i=Le(o)):i=Le(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 ze(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Be(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 Ve(){var e=Ie;return Ie<<=1,!(Ie&62914560)&&(Ie=4194304),e}function He(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ue(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function We(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-Ae(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&&Ge(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ge(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ae(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ke(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ae(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function qe(e,t){var n=t&-t;return n=n&42?1:Je(n),(n&(e.suspendedLanes|t))===0?n:0}function Je(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 Ye(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Xe(){var e=F.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function Ze(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var Qe=Math.random().toString(36).slice(2),$e=`__reactFiber$`+Qe,et=`__reactProps$`+Qe,tt=`__reactContainer$`+Qe,nt=`__reactEvents$`+Qe,rt=`__reactListeners$`+Qe,it=`__reactHandles$`+Qe,at=`__reactResources$`+Qe,ot=`__reactMarker$`+Qe;function st(e){delete e[$e],delete e[et],delete e[nt],delete e[rt],delete e[it]}function ct(e){var t=e[$e];if(t)return t;for(var n=e.parentNode;n;){if(t=n[tt]||n[$e]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[$e])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function lt(e){if(e=e[$e]||e[tt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ut(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function dt(e){var t=e[at];return t||=e[at]={hoistableStyles:new Map,hoistableScripts:new Map},t}function ft(e){e[ot]=!0}var pt=new Set,mt={};function ht(e,t){gt(e,t),gt(e+`Capture`,t)}function gt(e,t){for(mt[e]=t,e=0;e<t.length;e++)pt.add(t[e])}var _t=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]*$`),vt={},yt={};function bt(e){return pe.call(yt,e)?!0:pe.call(vt,e)?!1:_t.test(e)?yt[e]=!0:(vt[e]=!0,!1)}function xt(e,t,n){if(bt(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 St(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 Ct(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 wt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Tt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Et(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 Dt(e){if(!e._valueTracker){var t=Tt(e)?`checked`:`value`;e._valueTracker=Et(e,t,``+e[t])}}function Ot(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Tt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function kt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var At=/[\n"\\]/g;function K(e){return e.replace(At,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function jt(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=``+wt(t)):e.value!==``+wt(t)&&(e.value=``+wt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Nt(e,o,wt(n)):Nt(e,o,wt(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=``+wt(s):e.removeAttribute(`name`)}function Mt(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)){Dt(e);return}n=n==null?``:``+wt(n),t=t==null?n:``+wt(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),Dt(e)}function Nt(e,t,n){t===`number`&&kt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Pt(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=``+wt(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 Ft(e,t,n){if(t!=null&&(t=``+wt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+wt(n)}function It(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(N(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=wt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Dt(e)}function Lt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Rt=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 zt(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||Rt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Bt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&zt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&zt(e,o,t[o])}function Vt(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 Ht=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Ut=/^[\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 Wt(e){return Ut.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Gt(){}var Kt=null;function qt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Jt=null,Yt=null;function Xt(e){var t=lt(e);if(t&&(e=t.stateNode)){var n=e[et]||null;a:switch(e=t.stateNode,t.type){case`input`:if(jt(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="`+K(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[et]||null;if(!a)throw Error(i(90));jt(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&&Ot(r)}break a;case`textarea`:Ft(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Pt(e,!!n.multiple,t,!1)}}}var Zt=!1;function Qt(e,t,n){if(Zt)return e(t,n);Zt=!0;try{return e(t)}finally{if(Zt=!1,(Jt!==null||Yt!==null)&&(vu(),Jt&&(t=Jt,e=Yt,Yt=Jt=null,Xt(t),e)))for(t=0;t<e.length;t++)Xt(e[t])}}function $t(e,t){var n=e.stateNode;if(n===null)return null;var r=n[et]||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 en=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),tn=!1;if(en)try{var nn={};Object.defineProperty(nn,"passive",{get:function(){tn=!0}}),window.addEventListener(`test`,nn,nn),window.removeEventListener(`test`,nn,nn)}catch{tn=!1}var rn=null,an=null,on=null;function sn(){if(on)return on;var e,t=an,n=t.length,r,i=`value`in rn?rn.value:rn.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 on=i.slice(e,1<r?1-r:void 0)}function cn(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 ln(){return!0}function un(){return!1}function dn(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)?ln:un,this.isPropagationStopped=un,this}return h(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=ln)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=ln)},persist:function(){},isPersistent:ln}),t}var fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pn=dn(fn),mn=h({},fn,{view:0,detail:0}),hn=dn(mn),gn,q,_n,J=h({},mn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:On,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!==_n&&(_n&&e.type===`mousemove`?(gn=e.screenX-_n.screenX,q=e.screenY-_n.screenY):q=gn=0,_n=e),gn)},movementY:function(e){return`movementY`in e?e.movementY:q}}),vn=dn(J),yn=dn(h({},J,{dataTransfer:0})),bn=dn(h({},mn,{relatedTarget:0})),xn=dn(h({},fn,{animationName:0,elapsedTime:0,pseudoElement:0})),Sn=dn(h({},fn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Cn=dn(h({},fn,{data:0})),wn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Tn={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`},En={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Dn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=En[e])?!!t[e]:!1}function On(){return Dn}var kn=dn(h({},mn,{key:function(e){if(e.key){var t=wn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=cn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Tn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:On,charCode:function(e){return e.type===`keypress`?cn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?cn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),An=dn(h({},J,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),jn=dn(h({},mn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:On})),Mn=dn(h({},fn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Nn=dn(h({},J,{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})),Pn=dn(h({},fn,{newState:0,oldState:0})),Fn=[9,13,27,32],In=en&&`CompositionEvent`in window,Ln=null;en&&`documentMode`in document&&(Ln=document.documentMode);var Rn=en&&`TextEvent`in window&&!Ln,zn=en&&(!In||Ln&&8<Ln&&11>=Ln),Bn=` `,Vn=!1;function Hn(e,t){switch(e){case`keyup`:return Fn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Un(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Wn=!1;function Gn(e,t){switch(e){case`compositionend`:return Un(t);case`keypress`:return t.which===32?(Vn=!0,Bn):null;case`textInput`:return e=t.data,e===Bn&&Vn?null:e;default:return null}}function Kn(e,t){if(Wn)return e===`compositionend`||!In&&Hn(e,t)?(e=sn(),on=an=rn=null,Wn=!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 zn&&t.locale!==`ko`?null:t.data;default:return null}}var qn={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 Jn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!qn[e.type]:t===`textarea`}function Yn(e,t,n,r){Jt?Yt?Yt.push(r):Yt=[r]:Jt=r,t=Td(t,`onChange`),0<t.length&&(n=new pn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Xn=null,Zn=null;function Qn(e){vd(e,0)}function $n(e){if(Ot(ut(e)))return e}function er(e,t){if(e===`change`)return t}var tr=!1;if(en){var nr;if(en){var rr=`oninput`in document;if(!rr){var ir=document.createElement(`div`);ir.setAttribute(`oninput`,`return;`),rr=typeof ir.oninput==`function`}nr=rr}else nr=!1;tr=nr&&(!document.documentMode||9<document.documentMode)}function ar(){Xn&&(Xn.detachEvent(`onpropertychange`,or),Zn=Xn=null)}function or(e){if(e.propertyName===`value`&&$n(Zn)){var t=[];Yn(t,Zn,e,qt(e)),Qt(Qn,t)}}function sr(e,t,n){e===`focusin`?(ar(),Xn=t,Zn=n,Xn.attachEvent(`onpropertychange`,or)):e===`focusout`&&ar()}function cr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return $n(Zn)}function lr(e,t){if(e===`click`)return $n(t)}function ur(e,t){if(e===`input`||e===`change`)return $n(t)}function dr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var fr=typeof Object.is==`function`?Object.is:dr;function pr(e,t){if(fr(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(!pe.call(t,i)||!fr(e[i],t[i]))return!1}return!0}function mr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function hr(e,t){var n=mr(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=mr(n)}}function gr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?gr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _r(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=kt(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=kt(e.document)}return t}function vr(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 yr=en&&`documentMode`in document&&11>=document.documentMode,br=null,xr=null,Sr=null,Cr=!1;function wr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Cr||br==null||br!==kt(r)||(r=br,`selectionStart`in r&&vr(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}),Sr&&pr(Sr,r)||(Sr=r,r=Td(xr,`onSelect`),0<r.length&&(t=new pn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=br)))}function Tr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Er={animationend:Tr(`Animation`,`AnimationEnd`),animationiteration:Tr(`Animation`,`AnimationIteration`),animationstart:Tr(`Animation`,`AnimationStart`),transitionrun:Tr(`Transition`,`TransitionRun`),transitionstart:Tr(`Transition`,`TransitionStart`),transitioncancel:Tr(`Transition`,`TransitionCancel`),transitionend:Tr(`Transition`,`TransitionEnd`)},Dr={},Or={};en&&(Or=document.createElement(`div`).style,`AnimationEvent`in window||(delete Er.animationend.animation,delete Er.animationiteration.animation,delete Er.animationstart.animation),`TransitionEvent`in window||delete Er.transitionend.transition);function kr(e){if(Dr[e])return Dr[e];if(!Er[e])return e;var t=Er[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Or)return Dr[e]=t[n];return e}var Ar=kr(`animationend`),jr=kr(`animationiteration`),Mr=kr(`animationstart`),Nr=kr(`transitionrun`),Pr=kr(`transitionstart`),Fr=kr(`transitioncancel`),Ir=kr(`transitionend`),Lr=new Map,Rr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Rr.push(`scrollEnd`);function zr(e,t){Lr.set(e,t),ht(t,[e])}var Br=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)},Vr=[],Hr=0,Ur=0;function Wr(){for(var e=Hr,t=Ur=Hr=0;t<e;){var n=Vr[t];Vr[t++]=null;var r=Vr[t];Vr[t++]=null;var i=Vr[t];Vr[t++]=null;var a=Vr[t];if(Vr[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&&Jr(n,i,a)}}function Gr(e,t,n,r){Vr[Hr++]=e,Vr[Hr++]=t,Vr[Hr++]=n,Vr[Hr++]=r,Ur|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Kr(e,t,n,r){return Gr(e,t,n,r),Yr(e)}function qr(e,t){return Gr(e,null,null,t),Yr(e)}function Jr(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-Ae(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Yr(e){if(50<lu)throw lu=0,uu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Xr={};function Zr(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 Qr(e,t,n,r){return new Zr(e,t,n,r)}function $r(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ei(e,t){var n=e.alternate;return n===null?(n=Qr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ti(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ni(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)$r(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,ie.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case ee:return e=Qr(31,n,t,a),e.elementType=ee,e.lanes=o,e;case y:return ri(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=Qr(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=Qr(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=Qr(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Qr(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ri(e,t,n,r){return e=Qr(7,e,r,t),e.lanes=n,e}function ii(e,t,n){return e=Qr(6,e,null,t),e.lanes=n,e}function ai(e){var t=Qr(18,null,null,0);return t.stateNode=e,t}function oi(e,t,n){return t=Qr(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var si=new WeakMap;function ci(e,t){if(typeof e==`object`&&e){var n=si.get(e);return n===void 0?(t={value:e,source:t,stack:fe(t)},si.set(e,t),t):n}return{value:e,source:t,stack:fe(t)}}var li=[],ui=0,di=null,fi=0,pi=[],mi=0,hi=null,gi=1,_i=``;function vi(e,t){li[ui++]=fi,li[ui++]=di,di=e,fi=t}function yi(e,t,n){pi[mi++]=gi,pi[mi++]=_i,pi[mi++]=hi,hi=e;var r=gi;e=_i;var i=32-Ae(r)-1;r&=~(1<<i),n+=1;var a=32-Ae(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,gi=1<<32-Ae(t)+i|n<<i|r,_i=a+e}else gi=1<<a|n<<i|r,_i=e}function bi(e){e.return!==null&&(vi(e,1),yi(e,1,0))}function xi(e){for(;e===di;)di=li[--ui],li[ui]=null,fi=li[--ui],li[ui]=null;for(;e===hi;)hi=pi[--mi],pi[mi]=null,_i=pi[--mi],pi[mi]=null,gi=pi[--mi],pi[mi]=null}function Si(e,t){pi[mi++]=gi,pi[mi++]=_i,pi[mi++]=hi,gi=t.id,_i=t.overflow,hi=e}var Ci=null,wi=null,Y=!1,Ti=null,Ei=!1,Di=Error(i(519));function Oi(e){throw Pi(ci(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Di}function ki(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[$e]=e,t[et]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<gd.length;n++)$(gd[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),Mt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),It(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||jd(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=Gt),t=!0):t=!1,t||Oi(e,!0)}function Ai(e){for(Ci=e.return;Ci;)switch(Ci.tag){case 5:case 31:case 13:Ei=!1;return;case 27:case 3:Ei=!0;return;default:Ci=Ci.return}}function ji(e){if(e!==Ci)return!1;if(!Y)return Ai(e),Y=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&wi&&Oi(e),Ai(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));wi=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));wi=uf(e)}else t===27?(t=wi,Zd(e.type)?(e=lf,lf=null,wi=e):wi=t):wi=Ci?cf(e.stateNode.nextSibling):null;return!0}function Mi(){wi=Ci=null,Y=!1}function Ni(){var e=Ti;return e!==null&&(Yl===null?Yl=e:Yl.push.apply(Yl,e),Ti=null),e}function Pi(e){Ti===null?Ti=[e]:Ti.push(e)}var Fi=re(null),Ii=null,Li=null;function Ri(e,t,n){z(Fi,t._currentValue),t._currentValue=n}function zi(e){e._currentValue=Fi.current,R(Fi)}function Bi(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 Vi(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),Bi(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),Bi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Hi(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;fr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===H.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&Vi(t,e,n,r),t.flags|=262144}function Ui(e){for(e=e.firstContext;e!==null;){if(!fr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Wi(e){Ii=e,Li=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Gi(e){return qi(Ii,e)}function Ki(e,t){return Ii===null&&Wi(e),qi(e,t)}function qi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Li===null){if(e===null)throw Error(i(308));Li=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Li=Li.next=t;return n}var Ji=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()})}},Yi=t.unstable_scheduleCallback,Xi=t.unstable_NormalPriority,Zi={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qi(){return{controller:new Ji,data:new Map,refCount:0}}function $i(e){e.refCount--,e.refCount===0&&Yi(Xi,function(){e.controller.abort()})}var ea=null,ta=0,na=0,ra=null;function ia(e,t){if(ea===null){var n=ea=[];ta=0,na=ud(),ra={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ta++,t.then(aa,aa),t}function aa(){if(--ta===0&&ea!==null){ra!==null&&(ra.status=`fulfilled`);var e=ea;ea=null,na=0,ra=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function oa(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 sa=P.S;P.S=function(e,t){Ql=ve(),typeof t==`object`&&t&&typeof t.then==`function`&&ia(e,t),sa!==null&&sa(e,t)};var ca=re(null);function la(){var e=ca.current;return e===null?Fl.pooledCache:e}function ua(e,t){t===null?z(ca,ca.current):z(ca,t.pool)}function da(){var e=la();return e===null?null:{parent:Zi._currentValue,pool:e}}var fa=Error(i(460)),pa=Error(i(474)),ma=Error(i(542)),ha={then:function(){}};function ga(e){return e=e.status,e===`fulfilled`||e===`rejected`}function _a(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Gt,Gt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,xa(e),e;default:if(typeof t.status==`string`)t.then(Gt,Gt);else{if(e=Fl,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,xa(e),e}throw ya=t,fa}}function va(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ya=e,fa):e}}var ya=null;function ba(){if(ya===null)throw Error(i(459));var e=ya;return ya=null,e}function xa(e){if(e===fa||e===ma)throw Error(i(483))}var Sa=null,Ca=0;function wa(e){var t=Ca;return Ca+=1,Sa===null&&(Sa=[]),_a(Sa,e,t)}function Ta(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ea(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Da(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=ei(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ii(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&va(i)===t.type)?(t=a(t,n.props),Ta(t,n),t.return=e,t):(t=ni(n.type,n.key,n.props,null,e.mode,r),Ta(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=oi(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=ii(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=ni(t.type,t.key,t.props,null,e.mode,n),Ta(n,t),n.return=e,n;case v:return t=oi(t,e.mode,n),t.return=e,t;case O:return t=va(t),f(e,t,n)}if(N(t)||A(t))return t=ri(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,wa(t),n);if(t.$$typeof===C)return f(e,Ki(e,t),n);Ea(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=va(n),p(e,t,n,r)}if(N(n)||A(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,wa(n),r);if(n.$$typeof===C)return p(e,t,Ki(e,n),r);Ea(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=va(r),m(e,t,n,r,i)}if(N(r)||A(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,wa(r),i);if(r.$$typeof===C)return m(e,t,n,Ki(t,r),i);Ea(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),Y&&vi(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 Y&&vi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Y&&vi(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),Y&&vi(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 Y&&vi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Y&&vi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&va(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ta(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=ri(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ni(o.type,o.key,o.props,null,e.mode,c),Ta(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=oi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=va(o),b(e,r,o,c)}if(N(o))return h(e,r,o,c);if(A(o)){if(l=A(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,wa(o),c);if(o.$$typeof===C)return b(e,r,Ki(e,o),c);Ea(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=ii(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ca=0;var i=b(e,t,n,r);return Sa=null,i}catch(t){if(t===fa||t===ma)throw t;var a=Qr(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Oa=Da(!0),ka=Da(!1),Aa=!1;function ja(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ma(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 Na(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Pa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Pl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Yr(e),Jr(e,null,n),t}return Gr(e,r,t,n),Yr(e)}function Fa(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,Ke(e,n)}}function Ia(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var La=!1;function Ra(){if(La){var e=ra;if(e!==null)throw e}}function za(e,t,n,r){La=!1;var i=e.updateQueue;Aa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Q&f)===f:(r&f)===f){f!==0&&f===na&&(La=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Aa=!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),Ul|=o,e.lanes=o,e.memoizedState=d}}function Ba(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Va(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ba(n[e],t)}var Ha=re(null),Ua=re(0);function Wa(e,t){e=Vl,z(Ua,e),z(Ha,t),Vl=e|t.baseLanes}function Ga(){z(Ua,Vl),z(Ha,Ha.current)}function Ka(){Vl=Ua.current,R(Ha),R(Ua)}var qa=re(null),Ja=null;function Ya(e){var t=e.alternate;z(eo,eo.current&1),z(qa,e),Ja===null&&(t===null||Ha.current!==null||t.memoizedState!==null)&&(Ja=e)}function Xa(e){z(eo,eo.current),z(qa,e),Ja===null&&(Ja=e)}function Za(e){e.tag===22?(z(eo,eo.current),z(qa,e),Ja===null&&(Ja=e)):Qa(e)}function Qa(){z(eo,eo.current),z(qa,qa.current)}function $a(e){R(qa),Ja===e&&(Ja=null),R(eo)}var eo=re(0);function to(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var no=0,X=null,ro=null,io=null,ao=!1,oo=!1,so=!1,co=0,lo=0,uo=null,fo=0;function po(){throw Error(i(321))}function mo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!fr(e[n],t[n]))return!1;return!0}function ho(e,t,n,r,i,a){return no=a,X=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?Ms:Ns,so=!1,a=n(r,i),so=!1,oo&&(a=_o(t,n,r,i)),go(e),a}function go(e){P.H=js;var t=ro!==null&&ro.next!==null;if(no=0,io=ro=X=null,ao=!1,lo=0,uo=null,t)throw Error(i(300));e===null||Xs||(e=e.dependencies,e!==null&&Ui(e)&&(Xs=!0))}function _o(e,t,n,r){X=e;var a=0;do{if(oo&&(uo=null),lo=0,oo=!1,25<=a)throw Error(i(301));if(a+=1,io=ro=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=Ps,o=t(n,r)}while(oo);return o}function vo(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?To(t):t,e=e.useState()[0],(ro===null?null:ro.memoizedState)!==e&&(X.flags|=1024),t}function yo(){var e=co!==0;return co=0,e}function bo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function xo(e){if(ao){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ao=!1}no=0,io=ro=X=null,oo=!1,lo=co=0,uo=null}function So(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return io===null?X.memoizedState=io=e:io=io.next=e,io}function Co(){if(ro===null){var e=X.alternate;e=e===null?null:e.memoizedState}else e=ro.next;var t=io===null?X.memoizedState:io.next;if(t!==null)io=t,ro=e;else{if(e===null)throw X.alternate===null?Error(i(467)):Error(i(310));ro=e,e={memoizedState:ro.memoizedState,baseState:ro.baseState,baseQueue:ro.baseQueue,queue:ro.queue,next:null},io===null?X.memoizedState=io=e:io=io.next=e}return io}function wo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function To(e){var t=lo;return lo+=1,uo===null&&(uo=[]),e=_a(uo,e,t),t=X,(io===null?t.memoizedState:io.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?Ms:Ns),e}function Eo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return To(e);if(e.$$typeof===C)return Gi(e)}throw Error(i(438,String(e)))}function Do(e){var t=null,n=X.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=X.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=wo(),X.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]=te;return t.index++,n}function Oo(e,t){return typeof t==`function`?t(e):t}function ko(e){return Ao(Co(),ro,e)}function Ao(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?(no&f)===f:(Q&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===na&&(d=!0);else if((no&p)===p){u=u.next,p===na&&(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,X.lanes|=p,Ul|=p;f=u.action,so&&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,X.lanes|=f,Ul|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!fr(o,e.memoizedState)&&(Xs=!0,d&&(n=ra,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 jo(e){var t=Co(),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);fr(o,t.memoizedState)||(Xs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Mo(e,t,n){var r=X,a=Co(),o=Y;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!fr((ro||a).memoizedState,n);if(s&&(a.memoizedState=n,Xs=!0),a=a.queue,rs(Fo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||io!==null&&io.memoizedState.tag&1){if(r.flags|=2048,Qo(9,{destroy:void 0},Po.bind(null,r,a,n,t),null),Fl===null)throw Error(i(349));o||no&127||No(r,t,n)}return n}function No(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=X.updateQueue,t===null?(t=wo(),X.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Po(e,t,n,r){t.value=n,t.getSnapshot=r,Io(t)&&Lo(e)}function Fo(e,t,n){return n(function(){Io(t)&&Lo(e)})}function Io(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!fr(e,n)}catch{return!0}}function Lo(e){var t=qr(e,2);t!==null&&pu(t,e,2)}function Ro(e){var t=So();if(typeof e==`function`){var n=e;if(e=n(),so){ke(!0);try{n()}finally{ke(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:e},t}function zo(e,t,n,r){return e.baseState=n,Ao(e,ro,typeof r==`function`?r:Oo)}function Bo(e,t,n,r,a){if(Os(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Vo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Vo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),Ho(e,t,s)}catch(n){Wo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),Ho(e,t,a)}catch(n){Wo(e,t,n)}}function Ho(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Uo(e,t,n)},function(n){return Wo(e,t,n)}):Uo(e,t,n)}function Uo(e,t,n){t.status=`fulfilled`,t.value=n,Go(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Vo(e,n)))}function Wo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Go(t),t=t.next;while(t!==r)}e.action=null}function Go(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ko(e,t){return t}function qo(e,t){if(Y){var n=Fl.formState;if(n!==null){a:{var r=X;if(Y){if(wi){b:{for(var i=wi,a=Ei;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){wi=cf(i.nextSibling),r=i.data===`F!`;break a}}Oi(r)}r=!1}r&&(t=n[0])}}return n=So(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ko,lastRenderedState:t},n.queue=r,n=Ts.bind(null,X,r),r.dispatch=n,r=Ro(!1),a=Ds.bind(null,X,!1,r.queue),r=So(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Bo.bind(null,X,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Jo(e){return Yo(Co(),ro,e)}function Yo(e,t,n){if(t=Ao(e,t,Ko)[0],e=ko(Oo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=To(t)}catch(e){throw e===fa?ma:e}else r=t;t=Co();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(X.flags|=2048,Qo(9,{destroy:void 0},Xo.bind(null,i,n),null)),[r,a,e]}function Xo(e,t){e.action=t}function Zo(e){var t=Co(),n=ro;if(n!==null)return Yo(t,n,e);Co(),t=t.memoizedState,n=Co();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Qo(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=X.updateQueue,t===null&&(t=wo(),X.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 $o(){return Co().memoizedState}function es(e,t,n,r){var i=So();X.flags|=e,i.memoizedState=Qo(1|t,{destroy:void 0},n,r===void 0?null:r)}function ts(e,t,n,r){var i=Co();r=r===void 0?null:r;var a=i.memoizedState.inst;ro!==null&&r!==null&&mo(r,ro.memoizedState.deps)?i.memoizedState=Qo(t,a,n,r):(X.flags|=e,i.memoizedState=Qo(1|t,a,n,r))}function ns(e,t){es(8390656,8,e,t)}function rs(e,t){ts(2048,8,e,t)}function is(e){X.flags|=4;var t=X.updateQueue;if(t===null)t=wo(),X.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function as(e){var t=Co().memoizedState;return is({ref:t,nextImpl:e}),function(){if(Pl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function os(e,t){return ts(4,2,e,t)}function ss(e,t){return ts(4,4,e,t)}function cs(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 ls(e,t,n){n=n==null?null:n.concat([e]),ts(4,4,cs.bind(null,t,e),n)}function us(){}function ds(e,t){var n=Co();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&mo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function fs(e,t){var n=Co();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&mo(t,r[1]))return r[0];if(r=e(),so){ke(!0);try{e()}finally{ke(!1)}}return n.memoizedState=[r,t],r}function ps(e,t,n){return n===void 0||no&1073741824&&!(Q&261930)?e.memoizedState=t:(e.memoizedState=n,e=fu(),X.lanes|=e,Ul|=e,n)}function ms(e,t,n,r){return fr(n,t)?n:Ha.current===null?!(no&42)||no&1073741824&&!(Q&261930)?(Xs=!0,e.memoizedState=n):(e=fu(),X.lanes|=e,Ul|=e,t):(e=ps(e,n,r),fr(e,t)||(Xs=!0),e)}function hs(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,Ds(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Es(e,t,oa(c,r),du(e)):Es(e,t,r,du(e))}catch(n){Es(e,t,{then:function(){},status:`rejected`,reason:n},du())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function gs(){}function _s(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=vs(e).queue;hs(e,a,t,I,n===null?gs:function(){return ys(e),n(r)})}function vs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:I},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ys(e){var t=vs(e);t.next===null&&(t=e.alternate.memoizedState),Es(e,t.next.queue,{},du())}function bs(){return Gi(Qf)}function xs(){return Co().memoizedState}function Ss(){return Co().memoizedState}function Cs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=du();e=Na(n);var r=Pa(t,e,n);r!==null&&(pu(r,t,n),Fa(r,t,n)),t={cache:Qi()},e.payload=t;return}t=t.return}}function ws(e,t,n){var r=du();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Os(e)?ks(t,n):(n=Kr(e,t,n,r),n!==null&&(pu(n,e,r),As(n,t,r)))}function Ts(e,t,n){Es(e,t,n,du())}function Es(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Os(e))ks(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,fr(s,o))return Gr(e,t,i,0),Fl===null&&Wr(),!1}catch{}if(n=Kr(e,t,i,r),n!==null)return pu(n,e,r),As(n,t,r),!0}return!1}function Ds(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Os(e)){if(t)throw Error(i(479))}else t=Kr(e,n,r,2),t!==null&&pu(t,e,2)}function Os(e){var t=e.alternate;return e===X||t!==null&&t===X}function ks(e,t){oo=ao=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function As(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ke(e,n)}}var js={readContext:Gi,use:Eo,useCallback:po,useContext:po,useEffect:po,useImperativeHandle:po,useLayoutEffect:po,useInsertionEffect:po,useMemo:po,useReducer:po,useRef:po,useState:po,useDebugValue:po,useDeferredValue:po,useTransition:po,useSyncExternalStore:po,useId:po,useHostTransitionStatus:po,useFormState:po,useActionState:po,useOptimistic:po,useMemoCache:po,useCacheRefresh:po};js.useEffectEvent=po;var Ms={readContext:Gi,use:Eo,useCallback:function(e,t){return So().memoizedState=[e,t===void 0?null:t],e},useContext:Gi,useEffect:ns,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),es(4194308,4,cs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return es(4194308,4,e,t)},useInsertionEffect:function(e,t){es(4,2,e,t)},useMemo:function(e,t){var n=So();t=t===void 0?null:t;var r=e();if(so){ke(!0);try{e()}finally{ke(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=So();if(n!==void 0){var i=n(t);if(so){ke(!0);try{n(t)}finally{ke(!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=ws.bind(null,X,e),[r.memoizedState,e]},useRef:function(e){var t=So();return e={current:e},t.memoizedState=e},useState:function(e){e=Ro(e);var t=e.queue,n=Ts.bind(null,X,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:us,useDeferredValue:function(e,t){return ps(So(),e,t)},useTransition:function(){var e=Ro(!1);return e=hs.bind(null,X,e.queue,!0,!1),So().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=X,a=So();if(Y){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Fl===null)throw Error(i(349));Q&127||No(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ns(Fo.bind(null,r,o,e),[e]),r.flags|=2048,Qo(9,{destroy:void 0},Po.bind(null,r,o,n,t),null),n},useId:function(){var e=So(),t=Fl.identifierPrefix;if(Y){var n=_i,r=gi;n=(r&~(1<<32-Ae(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=co++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=fo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:bs,useFormState:qo,useActionState:qo,useOptimistic:function(e){var t=So();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ds.bind(null,X,!0,n),n.dispatch=t,[e,t]},useMemoCache:Do,useCacheRefresh:function(){return So().memoizedState=Cs.bind(null,X)},useEffectEvent:function(e){var t=So(),n={impl:e};return t.memoizedState=n,function(){if(Pl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ns={readContext:Gi,use:Eo,useCallback:ds,useContext:Gi,useEffect:rs,useImperativeHandle:ls,useInsertionEffect:os,useLayoutEffect:ss,useMemo:fs,useReducer:ko,useRef:$o,useState:function(){return ko(Oo)},useDebugValue:us,useDeferredValue:function(e,t){return ms(Co(),ro.memoizedState,e,t)},useTransition:function(){var e=ko(Oo)[0],t=Co().memoizedState;return[typeof e==`boolean`?e:To(e),t]},useSyncExternalStore:Mo,useId:xs,useHostTransitionStatus:bs,useFormState:Jo,useActionState:Jo,useOptimistic:function(e,t){return zo(Co(),ro,e,t)},useMemoCache:Do,useCacheRefresh:Ss};Ns.useEffectEvent=as;var Ps={readContext:Gi,use:Eo,useCallback:ds,useContext:Gi,useEffect:rs,useImperativeHandle:ls,useInsertionEffect:os,useLayoutEffect:ss,useMemo:fs,useReducer:jo,useRef:$o,useState:function(){return jo(Oo)},useDebugValue:us,useDeferredValue:function(e,t){var n=Co();return ro===null?ps(n,e,t):ms(n,ro.memoizedState,e,t)},useTransition:function(){var e=jo(Oo)[0],t=Co().memoizedState;return[typeof e==`boolean`?e:To(e),t]},useSyncExternalStore:Mo,useId:xs,useHostTransitionStatus:bs,useFormState:Zo,useActionState:Zo,useOptimistic:function(e,t){var n=Co();return ro===null?(n.baseState=e,[e,n.queue.dispatch]):zo(n,ro,e,t)},useMemoCache:Do,useCacheRefresh:Ss};Ps.useEffectEvent=as;function Fs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Is={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=du(),i=Na(r);i.payload=t,n!=null&&(i.callback=n),t=Pa(e,i,r),t!==null&&(pu(t,e,r),Fa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=du(),i=Na(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Pa(e,i,r),t!==null&&(pu(t,e,r),Fa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=du(),r=Na(n);r.tag=2,t!=null&&(r.callback=t),t=Pa(e,r,n),t!==null&&(pu(t,e,n),Fa(t,e,n))}};function Ls(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?!pr(n,r)||!pr(i,a):!0}function Rs(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&&Is.enqueueReplaceState(t,t.state,null)}function zs(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=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Bs(e){Br(e)}function Vs(e){console.error(e)}function Hs(e){Br(e)}function Us(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ws(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 Gs(e,t,n){return n=Na(n),n.tag=3,n.payload={element:null},n.callback=function(){Us(e,t)},n}function Ks(e){return e=Na(e),e.tag=3,e}function qs(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(){Ws(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ws(t,n,r),typeof i!=`function`&&(tu===null?tu=new Set([this]):tu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Js(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Hi(t,n,a,!0),n=qa.current,n!==null){switch(n.tag){case 31:case 13:return Ja===null?Tu():n.alternate===null&&Hl===0&&(Hl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ha?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Wu(e,r,a)),!1;case 22:return n.flags|=65536,r===ha?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)),Wu(e,r,a)),!1}throw Error(i(435,n.tag))}return Wu(e,r,a),Tu(),!1}if(Y)return t=qa.current,t===null?(r!==Di&&(t=Error(i(423),{cause:r}),Pi(ci(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=ci(r,n),a=Gs(e.stateNode,r,a),Ia(e,a),Hl!==4&&(Hl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Di&&(e=Error(i(422),{cause:r}),Pi(ci(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=ci(o,n),Jl===null?Jl=[o]:Jl.push(o),Hl!==4&&(Hl=2),t===null)return!0;r=ci(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Gs(n.stateNode,r,e),Ia(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`&&(tu===null||!tu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ks(a),qs(a,e,n,r),Ia(n,a),!1}n=n.return}while(n!==null);return!1}var Ys=Error(i(461)),Xs=!1;function Zs(e,t,n,r){t.child=e===null?ka(t,null,n,r):Oa(t,e.child,n,r)}function Qs(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 Wi(t),r=ho(e,t,n,o,a,i),s=yo(),e!==null&&!Xs?(bo(e,t,i),Sc(e,t,i)):(Y&&s&&bi(t),t.flags|=1,Zs(e,t,r,i),t.child)}function $s(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!$r(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ec(e,t,a,r,i)):(e=ni(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Cc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?pr:n,n(o,r)&&e.ref===t.ref)return Sc(e,t,i)}return t.flags|=1,e=ei(a,r),e.ref=t.ref,e.return=t,t.child=e}function ec(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(pr(a,r)&&e.ref===t.ref)if(Xs=!1,t.pendingProps=r=a,Cc(e,i))e.flags&131072&&(Xs=!0);else return t.lanes=e.lanes,Sc(e,t,i)}return cc(e,t,n,r,i)}function tc(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 rc(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?Ga():Wa(t,a),Za(t);else return r=t.lanes=536870912,rc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ua(t,null),Ga(),Qa(t)):(ua(t,a.cachePool),Wa(t,a),Qa(t),t.memoizedState=null);return Zs(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 rc(e,t,n,r,i){var a=la();return a=a===null?null:{parent:Zi._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ua(t,null),Ga(),Za(t),e!==null&&Hi(e,t,r,!0),t.childLanes=i,null}function ic(e,t){return t=_c({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function ac(e,t,n){return Oa(t,e.child,null,n),e=ic(t,t.pendingProps),e.flags|=2,$a(t),t.memoizedState=null,e}function oc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Y){if(r.mode===`hidden`)return e=ic(t,r),t.lanes=536870912,nc(null,e);if(Xa(t),(e=wi)?(e=rf(e,Ei),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:hi===null?null:{id:gi,overflow:_i},retryLane:536870912,hydrationErrors:null},n=ai(e),n.return=t,t.child=n,Ci=t,wi=null)):e=null,e===null)throw Oi(t);return t.lanes=536870912,null}return ic(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Xa(t),a)if(t.flags&256)t.flags&=-257,t=ac(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Xs||Hi(e,t,n,!1),a=(n&e.childLanes)!==0,Xs||a){if(r=Fl,r!==null&&(s=qe(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,qr(e,s),pu(r,e,s),Ys;Tu(),t=ac(e,t,n)}else e=o.treeContext,wi=cf(s.nextSibling),Ci=t,Y=!0,Ti=null,Ei=!1,e!==null&&Si(t,e),t=ic(t,r),t.flags|=4096;return t}return e=ei(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function sc(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 cc(e,t,n,r,i){return Wi(t),n=ho(e,t,n,r,void 0,i),r=yo(),e!==null&&!Xs?(bo(e,t,i),Sc(e,t,i)):(Y&&r&&bi(t),t.flags|=1,Zs(e,t,n,i),t.child)}function lc(e,t,n,r,i,a){return Wi(t),t.updateQueue=null,n=_o(t,r,n,i),go(e),r=yo(),e!==null&&!Xs?(bo(e,t,a),Sc(e,t,a)):(Y&&r&&bi(t),t.flags|=1,Zs(e,t,n,a),t.child)}function uc(e,t,n,r,i){if(Wi(t),t.stateNode===null){var a=Xr,o=n.contextType;typeof o==`object`&&o&&(a=Gi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Is,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},ja(t),o=n.contextType,a.context=typeof o==`object`&&o?Gi(o):Xr,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Fs(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&&Is.enqueueReplaceState(a,a.state,null),za(t,r,a,i),Ra(),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=zs(n,s);a.props=c;var l=a.context,u=n.contextType;o=Xr,typeof u==`object`&&u&&(o=Gi(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)&&Rs(t,a,r,o),Aa=!1;var f=t.memoizedState;a.state=f,za(t,r,a,i),Ra(),l=t.memoizedState,s||f!==l||Aa?(typeof d==`function`&&(Fs(t,n,d,r),l=t.memoizedState),(c=Aa||Ls(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,Ma(e,t),o=t.memoizedProps,u=zs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Xr,typeof l==`object`&&l&&(c=Gi(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)&&Rs(t,a,r,c),Aa=!1,f=t.memoizedState,a.state=f,za(t,r,a,i),Ra();var p=t.memoizedState;o!==d||f!==p||Aa||e!==null&&e.dependencies!==null&&Ui(e.dependencies)?(typeof s==`function`&&(Fs(t,n,s,r),p=t.memoizedState),(u=Aa||Ls(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ui(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,sc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Oa(t,e.child,null,i),t.child=Oa(t,null,n,i)):Zs(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Sc(e,t,i),e}function dc(e,t,n,r){return Mi(),t.flags|=256,Zs(e,t,n,r),t.child}var fc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function pc(e){return{baseLanes:e,cachePool:da()}}function mc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Kl),e}function hc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(eo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Y){if(a?Ya(t):Qa(t),(e=wi)?(e=rf(e,Ei),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:hi===null?null:{id:gi,overflow:_i},retryLane:536870912,hydrationErrors:null},n=ai(e),n.return=t,t.child=n,Ci=t,wi=null)):e=null,e===null)throw Oi(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(Qa(t),a=t.mode,c=_c({mode:`hidden`,children:c},a),r=ri(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(null,r)):(Ya(t),gc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Ya(t),t.flags&=-257,t=vc(e,t,n)):t.memoizedState===null?(Qa(t),c=r.fallback,a=t.mode,r=_c({mode:`visible`,children:r.children},a),c=ri(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Oa(t,e.child,null,n),r=t.child,r.memoizedState=pc(n),r.childLanes=mc(e,s,n),t.memoizedState=fc,t=nc(null,r)):(Qa(t),t.child=e.child,t.flags|=128,t=null);else if(Ya(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Pi({value:r,source:null,stack:null}),t=vc(e,t,n)}else if(Xs||Hi(e,t,n,!1),s=(n&e.childLanes)!==0,Xs||s){if(s=Fl,s!==null&&(r=qe(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,qr(e,r),pu(s,e,r),Ys;af(c)||Tu(),t=vc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,wi=cf(c.nextSibling),Ci=t,Y=!0,Ti=null,Ei=!1,e!==null&&Si(t,e),t=gc(t,r.children),t.flags|=4096);return t}return a?(Qa(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ei(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ri(c,a,n,null),c.flags|=2):c=ei(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,nc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=pc(n):(a=c.cachePool,a===null?a=da():(l=Zi._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=mc(e,s,n),t.memoizedState=fc,nc(e.child,r)):(Ya(t),n=e.child,e=n.sibling,n=ei(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function gc(e,t){return t=_c({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function _c(e,t){return e=Qr(22,e,null,t),e.lanes=0,e}function vc(e,t,n){return Oa(t,e.child,null,n),e=gc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Bi(e.return,t,n)}function bc(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 xc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=eo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,z(eo,o),Zs(e,t,r,n),r=Y?fi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&yc(e,n,t);else if(e.tag===19)yc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&to(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),bc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&to(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}bc(t,!0,n,null,a,r);break;case`together`:bc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Sc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ul|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Hi(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=ei(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ei(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Ui(e))):!0}function wc(e,t,n){switch(t.tag){case 3:ae(t,t.stateNode.containerInfo),Ri(t,Zi,e.memoizedState.cache),Mi();break;case 27:case 5:W(t);break;case 4:ae(t,t.stateNode.containerInfo);break;case 10:Ri(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Xa(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Ya(t),e=Sc(e,t,n),e===null?null:e.sibling):hc(e,t,n):(Ya(t),t.flags|=128,null);Ya(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Hi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return xc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),z(eo,eo.current),r)break;return null;case 22:return t.lanes=0,tc(e,t,n,t.pendingProps);case 24:Ri(t,Zi,e.memoizedState.cache)}return Sc(e,t,n)}function Tc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Xs=!0;else{if(!Cc(e,n)&&!(t.flags&128))return Xs=!1,wc(e,t,n);Xs=!!(e.flags&131072)}else Xs=!1,Y&&t.flags&1048576&&yi(t,fi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=va(t.elementType),t.type=e,typeof e==`function`)$r(e)?(r=zs(e,r),t.tag=1,t=uc(null,t,e,r,n)):(t.tag=0,t=cc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=Qs(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=$s(null,t,e,r,n);break a}}throw t=M(e)||e,Error(i(306,t,``))}}return t;case 0:return cc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=zs(r,t.pendingProps),uc(e,t,r,a,n);case 3:a:{if(ae(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ma(e,t),za(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ri(t,Zi,r),r!==o.cache&&Vi(t,[Zi],n,!0),Ra(),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=dc(e,t,r,n);break a}else if(r!==a){a=ci(Error(i(424)),t),Pi(a),t=dc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(wi=cf(e.firstChild),Ci=t,Y=!0,Ti=null,Ei=!0,n=ka(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Mi(),r===a){t=Sc(e,t,n);break a}Zs(e,t,r,n)}t=t.child}return t;case 26:return sc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Y||(n=t.type,e=t.pendingProps,r=Bd(V.current).createElement(n),r[$e]=t,r[et]=e,Pd(r,n,e),ft(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return W(t),e===null&&Y&&(r=t.stateNode=ff(t.type,t.pendingProps,V.current),Ci=t,Ei=!0,a=wi,Zd(t.type)?(lf=a,wi=cf(r.firstChild)):wi=a),Zs(e,t,t.pendingProps.children,n),sc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Y&&((a=r=wi)&&(r=tf(r,t.type,t.pendingProps,Ei),r===null?a=!1:(t.stateNode=r,Ci=t,wi=cf(r.firstChild),Ei=!1,a=!0)),a||Oi(t)),W(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(a,o)?r=null:s!==null&&Ud(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=ho(e,t,vo,null,null,n),Qf._currentValue=a),sc(e,t),Zs(e,t,r,n),t.child;case 6:return e===null&&Y&&((e=n=wi)&&(n=nf(n,t.pendingProps,Ei),n===null?e=!1:(t.stateNode=n,Ci=t,wi=null,e=!0)),e||Oi(t)),null;case 13:return hc(e,t,n);case 4:return ae(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Oa(t,null,r,n):Zs(e,t,r,n),t.child;case 11:return Qs(e,t,t.type,t.pendingProps,n);case 7:return Zs(e,t,t.pendingProps,n),t.child;case 8:return Zs(e,t,t.pendingProps.children,n),t.child;case 12:return Zs(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ri(t,t.type,r.value),Zs(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Wi(t),a=Gi(a),r=r(a),t.flags|=1,Zs(e,t,r,n),t.child;case 14:return $s(e,t,t.type,t.pendingProps,n);case 15:return ec(e,t,t.type,t.pendingProps,n);case 19:return xc(e,t,n);case 31:return oc(e,t,n);case 22:return tc(e,t,n,t.pendingProps);case 24:return Wi(t),r=Gi(Zi),e===null?(a=la(),a===null&&(a=Fl,o=Qi(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},ja(t),Ri(t,Zi,a)):((e.lanes&n)!==0&&(Ma(e,t),za(t,null,null,n),Ra()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ri(t,Zi,r),r!==a.cache&&Vi(t,[Zi],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ri(t,Zi,r))),Zs(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ec(e){e.flags|=4}function Dc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Su())e.flags|=8192;else throw ya=ha,pa}else e.flags&=-16777217}function Oc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(Su())e.flags|=8192;else throw ya=ha,pa}function kc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ve(),e.lanes|=t,ql|=t)}function Ac(e,t){if(!Y)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function jc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Mc(e,t,n){var r=t.pendingProps;switch(xi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jc(t),null;case 1:return jc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),zi(Zi),U(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ji(t)?Ec(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ni())),jc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ec(t),o===null?(jc(t),Dc(t,a,null,r,n)):(jc(t),Oc(t,o))):o?o===e.memoizedState?(jc(t),t.flags&=-16777217):(Ec(t),jc(t),Oc(t,o)):(e=e.memoizedProps,e!==r&&Ec(t),jc(t),Dc(t,a,e,r,n)),null;case 27:if(G(t),n=V.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}e=ie.current,ji(t)?ki(t,e):(e=ff(a,r,n),t.stateNode=e,Ec(t))}return jc(t),null;case 5:if(G(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return jc(t),null}if(o=ie.current,ji(t))ki(t,o);else{var s=Bd(V.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[$e]=t,o[et]=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(Pd(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&&Ec(t)}}return jc(t),Dc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ec(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=V.current,ji(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ci,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[$e]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Oi(t,!0)}else e=Bd(e).createTextNode(r),e[$e]=t,t.stateNode=e}return jc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ji(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[$e]=t}else Mi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),e=!1}else n=Ni(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?($a(t),t):($a(t),null);if(t.flags&128)throw Error(i(558))}return jc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ji(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[$e]=t}else Mi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jc(t),a=!1}else a=Ni(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?($a(t),t):($a(t),null)}return $a(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),kc(t,t.updateQueue),jc(t),null);case 4:return U(),e===null&&xd(t.stateNode.containerInfo),jc(t),null;case 10:return zi(t.type),jc(t),null;case 19:if(R(eo),r=t.memoizedState,r===null)return jc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Ac(r,!1);else{if(Hl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=to(e),o!==null){for(t.flags|=128,Ac(r,!1),e=o.updateQueue,t.updateQueue=e,kc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ti(n,e),n=n.sibling;return z(eo,eo.current&1|2),Y&&vi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ve()>$l&&(t.flags|=128,a=!0,Ac(r,!1),t.lanes=4194304)}else{if(!a)if(e=to(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,kc(t,e),Ac(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Y)return jc(t),null}else 2*ve()-r.renderingStartTime>$l&&n!==536870912&&(t.flags|=128,a=!0,Ac(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(jc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ve(),e.sibling=null,n=eo.current,z(eo,a?n&1|2:n&1),Y&&vi(t,r.treeForkCount),e);case 22:case 23:return $a(t),Ka(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(jc(t),t.subtreeFlags&6&&(t.flags|=8192)):jc(t),n=t.updateQueue,n!==null&&kc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&R(ca),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),zi(Zi),jc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Nc(e,t){switch(xi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zi(Zi),U(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return G(t),null;case 31:if(t.memoizedState!==null){if($a(t),t.alternate===null)throw Error(i(340));Mi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if($a(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Mi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return R(eo),null;case 4:return U(),null;case 10:return zi(t.type),null;case 22:case 23:return $a(t),Ka(),e!==null&&R(ca),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return zi(Zi),null;case 25:return null;default:return null}}function Pc(e,t){switch(xi(t),t.tag){case 3:zi(Zi),U();break;case 26:case 27:case 5:G(t);break;case 4:U();break;case 31:t.memoizedState!==null&&$a(t);break;case 13:$a(t);break;case 19:R(eo);break;case 10:zi(t.type);break;case 22:case 23:$a(t),Ka(),e!==null&&R(ca);break;case 24:zi(Zi)}}function Fc(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){Uu(t,t.return,e)}}function Ic(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){Uu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Uu(t,t.return,e)}}function Lc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Va(t,n)}catch(t){Uu(e,e.return,t)}}}function Rc(e,t,n){n.props=zs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Uu(e,t,n)}}function zc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Uu(e,t,n)}}function Bc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Uu(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){Uu(e,t,n)}else n.current=null}function Vc(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){Uu(e,e.return,t)}}function Hc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[et]=t}catch(t){Uu(e,e.return,t)}}function Uc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Wc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Uc(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&&Zd(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 Gc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Gt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Gc(e,t,n),e=e.sibling;e!==null;)Gc(e,t,n),e=e.sibling}function Kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Kc(e,t,n),e=e.sibling;e!==null;)Kc(e,t,n),e=e.sibling}function qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[$e]=e,t[et]=n}catch(t){Uu(e,e.return,t)}}var Jc=!1,Yc=!1,Xc=!1,Zc=typeof WeakSet==`function`?WeakSet:Set,Qc=null;function $c(e,t){if(e=e.containerInfo,Rd=sp,e=_r(e),vr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,Qc=t;Qc!==null;)if(t=Qc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Qc=e;else for(;Qc!==null;){switch(t=Qc,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=zs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Uu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Qc=e;break}Qc=t.return}}function el(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:hl(e,n),r&4&&Fc(5,n);break;case 1:if(hl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Uu(n,n.return,e)}else{var i=zs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Uu(n,n.return,e)}}r&64&&Lc(n),r&512&&zc(n,n.return);break;case 3:if(hl(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{Va(e,t)}catch(e){Uu(n,n.return,e)}}break;case 27:t===null&&r&4&&qc(n);case 26:case 5:hl(e,n),t===null&&r&4&&Vc(n),r&512&&zc(n,n.return);break;case 12:hl(e,n);break;case 31:hl(e,n),r&4&&ol(e,n);break;case 13:hl(e,n),r&4&&sl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=qu.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||Jc,!r){t=t!==null&&t.memoizedState!==null||Yc,i=Jc;var a=Yc;Jc=r,(Yc=t)&&!a?_l(e,n,(n.subtreeFlags&8772)!=0):hl(e,n),Jc=i,Yc=a}break;case 30:break;default:hl(e,n)}}function tl(e){var t=e.alternate;t!==null&&(e.alternate=null,tl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&st(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 nl=null,rl=!1;function il(e,t,n){for(n=n.child;n!==null;)al(e,t,n),n=n.sibling}function al(e,t,n){if(Oe&&typeof Oe.onCommitFiberUnmount==`function`)try{Oe.onCommitFiberUnmount(De,n)}catch{}switch(n.tag){case 26:Yc||Bc(n,t),il(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Yc||Bc(n,t);var r=nl,i=rl;Zd(n.type)&&(nl=n.stateNode,rl=!1),il(e,t,n),pf(n.stateNode),nl=r,rl=i;break;case 5:Yc||Bc(n,t);case 6:if(r=nl,i=rl,nl=null,il(e,t,n),nl=r,rl=i,nl!==null)if(rl)try{(nl.nodeType===9?nl.body:nl.nodeName===`HTML`?nl.ownerDocument.body:nl).removeChild(n.stateNode)}catch(e){Uu(n,t,e)}else try{nl.removeChild(n.stateNode)}catch(e){Uu(n,t,e)}break;case 18:nl!==null&&(rl?(e=nl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(nl,n.stateNode));break;case 4:r=nl,i=rl,nl=n.stateNode.containerInfo,rl=!0,il(e,t,n),nl=r,rl=i;break;case 0:case 11:case 14:case 15:Ic(2,n,t),Yc||Ic(4,n,t),il(e,t,n);break;case 1:Yc||(Bc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Rc(n,t,r)),il(e,t,n);break;case 21:il(e,t,n);break;case 22:Yc=(r=Yc)||n.memoizedState!==null,il(e,t,n),Yc=r;break;default:il(e,t,n)}}function ol(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Uu(t,t.return,e)}}}function sl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Uu(t,t.return,e)}}function cl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Zc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Zc),t;default:throw Error(i(435,e.tag))}}function ll(e,t){var n=cl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function ul(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){nl=c.stateNode,rl=!1;break a}break;case 5:nl=c.stateNode,rl=!1;break a;case 3:case 4:nl=c.stateNode.containerInfo,rl=!0;break a}c=c.return}if(nl===null)throw Error(i(160));al(o,s,a),nl=null,rl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fl(t,e),t=t.sibling}var dl=null;function fl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ul(t,e),pl(e),r&4&&(Ic(3,e,e.return),Fc(3,e),Ic(5,e,e.return));break;case 1:ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),r&64&&Jc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=dl;if(ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[ot]||o[$e]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Pd(o,r,n),o[$e]=e,ft(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Pd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[$e]=e,ft(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode);else e.stateNode=If(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Hc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),n!==null&&r&4&&Hc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ul(t,e),pl(e),r&512&&(Yc||n===null||Bc(n,n.return)),e.flags&32){a=e.stateNode;try{Lt(a,``)}catch(t){Uu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Hc(e,a,n===null?a:n.memoizedProps)),r&1024&&(Xc=!0);break;case 6:if(ul(t,e),pl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Uu(e,e.return,t)}}break;case 3:if(Bf=null,a=dl,dl=gf(t.containerInfo),ul(t,e),dl=a,pl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Uu(e,e.return,t)}Xc&&(Xc=!1,ml(e));break;case 4:r=dl,dl=gf(e.stateNode.containerInfo),ul(t,e),pl(e),dl=r;break;case 12:ul(t,e),pl(e);break;case 31:ul(t,e),pl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 13:ul(t,e),pl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Zl=ve()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Jc,d=Yc;if(Jc=u||a,Yc=d||l,ul(t,e),Yc=d,Jc=u,pl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Jc||Yc||gl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Uu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Uu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?$d(m,!0):$d(l.stateNode,!1)}catch(e){Uu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ll(e,n))));break;case 19:ul(t,e),pl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ll(e,r)));break;case 30:break;case 21:break;default:ul(t,e),pl(e)}}function pl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Uc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Kc(e,Wc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Lt(o,``),n.flags&=-33),Kc(e,Wc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Gc(e,Wc(e),s);break;default:throw Error(i(161))}}catch(t){Uu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ml(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ml(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function hl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)el(e,t.alternate,t),t=t.sibling}function gl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ic(4,t,t.return),gl(t);break;case 1:Bc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Rc(t,t.return,n),gl(t);break;case 27:pf(t.stateNode);case 26:case 5:Bc(t,t.return),gl(t);break;case 22:t.memoizedState===null&&gl(t);break;case 30:gl(t);break;default:gl(t)}e=e.sibling}}function _l(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:_l(i,a,n),Fc(4,a);break;case 1:if(_l(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Uu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ba(c[i],s)}catch(e){Uu(r,r.return,e)}}n&&o&64&&Lc(a),zc(a,a.return);break;case 27:qc(a);case 26:case 5:_l(i,a,n),n&&r===null&&o&4&&Vc(a),zc(a,a.return);break;case 12:_l(i,a,n);break;case 31:_l(i,a,n),n&&o&4&&ol(i,a);break;case 13:_l(i,a,n),n&&o&4&&sl(i,a);break;case 22:a.memoizedState===null&&_l(i,a,n),zc(a,a.return);break;case 30:break;default:_l(i,a,n)}t=t.sibling}}function vl(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&&$i(n))}function yl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&$i(e))}function bl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)xl(e,t,n,r),t=t.sibling}function xl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:bl(e,t,n,r),i&2048&&Fc(9,t);break;case 1:bl(e,t,n,r);break;case 3:bl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&$i(e)));break;case 12:if(i&2048){bl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Uu(t,t.return,e)}}else bl(e,t,n,r);break;case 31:bl(e,t,n,r);break;case 13:bl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?bl(e,t,n,r):(a._visibility|=2,Sl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?bl(e,t,n,r):Cl(e,t),i&2048&&vl(o,t);break;case 24:bl(e,t,n,r),i&2048&&yl(t.alternate,t);break;default:bl(e,t,n,r)}}function Sl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Sl(a,o,s,c,i),Fc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Sl(a,o,s,c,i)):u._visibility&2?Sl(a,o,s,c,i):Cl(a,o),i&&l&2048&&vl(o.alternate,o);break;case 24:Sl(a,o,s,c,i),i&&l&2048&&yl(o.alternate,o);break;default:Sl(a,o,s,c,i)}t=t.sibling}}function Cl(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:Cl(n,r),i&2048&&vl(r.alternate,r);break;case 24:Cl(n,r),i&2048&&yl(r.alternate,r);break;default:Cl(n,r)}t=t.sibling}}var wl=8192;function Tl(e,t,n){if(e.subtreeFlags&wl)for(e=e.child;e!==null;)El(e,t,n),e=e.sibling}function El(e,t,n){switch(e.tag){case 26:Tl(e,t,n),e.flags&wl&&e.memoizedState!==null&&Gf(n,dl,e.memoizedState,e.memoizedProps);break;case 5:Tl(e,t,n);break;case 3:case 4:var r=dl;dl=gf(e.stateNode.containerInfo),Tl(e,t,n),dl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=wl,wl=16777216,Tl(e,t,n),wl=r):Tl(e,t,n));break;default:Tl(e,t,n)}}function Dl(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 Ol(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Qc=r,jl(r,e)}Dl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)kl(e),e=e.sibling}function kl(e){switch(e.tag){case 0:case 11:case 15:Ol(e),e.flags&2048&&Ic(9,e,e.return);break;case 3:Ol(e);break;case 12:Ol(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Al(e)):Ol(e);break;default:Ol(e)}}function Al(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Qc=r,jl(r,e)}Dl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ic(8,t,t.return),Al(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Al(t));break;default:Al(t)}e=e.sibling}}function jl(e,t){for(;Qc!==null;){var n=Qc;switch(n.tag){case 0:case 11:case 15:Ic(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:$i(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Qc=r;else a:for(n=e;Qc!==null;){r=Qc;var i=r.sibling,a=r.return;if(tl(r),r===n){Qc=null;break a}if(i!==null){i.return=a,Qc=i;break a}Qc=a}}}var Ml={getCacheForType:function(e){var t=Gi(Zi),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Gi(Zi).controller.signal}},Nl=typeof WeakMap==`function`?WeakMap:Map,Pl=0,Fl=null,Z=null,Q=0,Il=0,Ll=null,Rl=!1,zl=!1,Bl=!1,Vl=0,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=null,Yl=null,Xl=!1,Zl=0,Ql=0,$l=1/0,eu=null,tu=null,nu=0,ru=null,iu=null,au=0,ou=0,su=null,cu=null,lu=0,uu=null;function du(){return Pl&2&&Q!==0?Q&-Q:P.T===null?Xe():ud()}function fu(){if(Kl===0)if(!(Q&536870912)||Y){var e=Fe;Fe<<=1,!(Fe&3932160)&&(Fe=262144),Kl=e}else Kl=536870912;return e=qa.current,e!==null&&(e.flags|=32),Kl}function pu(e,t,n){(e===Fl&&(Il===2||Il===9)||e.cancelPendingCommit!==null)&&(bu(e,0),_u(e,Q,Kl,!1)),Ue(e,n),(!(Pl&2)||e!==Fl)&&(e===Fl&&(!(Pl&2)&&(Wl|=n),Hl===4&&_u(e,Q,Kl,!1)),nd(e))}function mu(e,t,n){if(Pl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||ze(e,t),a=r?Ou(e,t):Eu(e,t,!0),o=r;do{if(a===0){zl&&!r&&_u(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!gu(n)){a=Eu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Jl;var l=c.current.memoizedState.isDehydrated;if(l&&(bu(c,s).flags|=256),s=Eu(c,s,!1),s!==2){if(Bl&&!l){c.errorRecoveryDisabledLanes|=o,Wl|=o,a=4;break a}o=Yl,Yl=a,o!==null&&(Yl===null?Yl=o:Yl.push.apply(Yl,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){bu(e,0),_u(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:_u(r,t,Kl,!Rl);break a;case 2:Yl=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Zl+300-ve(),10<a)){if(_u(r,t,Kl,!Rl),Re(r,0,!0)!==0)break a;au=t,r.timeoutHandle=Kd(hu.bind(null,r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,`Throttled`,-0,0),a);break a}hu(r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,null,-0,0)}}break}while(1);nd(e)}function hu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Gt},El(t,a,d);var m=(a&62914560)===a?Zl-ve():(a&4194048)===a?Ql-ve():0;if(m=qf(d,m),m!==null){au=a,e.cancelPendingCommit=m(Fu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),_u(e,a,o,!l);return}}Fu(e,t,a,n,r,i,o,s,c)}function gu(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(!fr(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 _u(e,t,n,r){t&=~Gl,t&=~Wl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ae(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ge(e,n,t)}function vu(){return Pl&6?!0:(rd(0,!1),!1)}function yu(){if(Z!==null){if(Il===0)var e=Z.return;else e=Z,Li=Ii=null,xo(e),Sa=null,Ca=0,e=Z;for(;e!==null;)Pc(e.alternate,e),e=e.return;Z=null}}function bu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),au=0,yu(),Fl=e,Z=n=ei(e.current,null),Q=t,Il=0,Ll=null,Rl=!1,zl=ze(e,t),Bl=!1,ql=Kl=Gl=Wl=Ul=Hl=0,Yl=Jl=null,Xl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ae(r),a=1<<i;t|=e[i],r&=~a}return Vl=t,Wr(),n}function xu(e,t){X=null,P.H=js,t===fa||t===ma?(t=ba(),Il=3):t===pa?(t=ba(),Il=4):Il=t===Ys?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ll=t,Z===null&&(Hl=1,Us(e,ci(t,e.current)))}function Su(){var e=qa.current;return e===null?!0:(Q&4194048)===Q?Ja===null:(Q&62914560)===Q||Q&536870912?e===Ja:!1}function Cu(){var e=P.H;return P.H=js,e===null?js:e}function wu(){var e=P.A;return P.A=Ml,e}function Tu(){Hl=4,Rl||(Q&4194048)!==Q&&qa.current!==null||(zl=!0),!(Ul&134217727)&&!(Wl&134217727)||Fl===null||_u(Fl,Q,Kl,!1)}function Eu(e,t,n){var r=Pl;Pl|=2;var i=Cu(),a=wu();(Fl!==e||Q!==t)&&(eu=null,bu(e,t)),t=!1;var o=Hl;a:do try{if(Il!==0&&Z!==null){var s=Z,c=Ll;switch(Il){case 8:yu(),o=6;break a;case 3:case 2:case 9:case 6:qa.current===null&&(t=!0);var l=Il;if(Il=0,Ll=null,Mu(e,s,c,l),n&&zl){o=0;break a}break;default:l=Il,Il=0,Ll=null,Mu(e,s,c,l)}}Du(),o=Hl;break}catch(t){xu(e,t)}while(1);return t&&e.shellSuspendCounter++,Li=Ii=null,Pl=r,P.H=i,P.A=a,Z===null&&(Fl=null,Q=0,Wr()),o}function Du(){for(;Z!==null;)Au(Z)}function Ou(e,t){var n=Pl;Pl|=2;var r=Cu(),a=wu();Fl!==e||Q!==t?(eu=null,$l=ve()+500,bu(e,t)):zl=ze(e,t);a:do try{if(Il!==0&&Z!==null){t=Z;var o=Ll;b:switch(Il){case 1:Il=0,Ll=null,Mu(e,t,o,1);break;case 2:case 9:if(ga(o)){Il=0,Ll=null,ju(t);break}t=function(){Il!==2&&Il!==9||Fl!==e||(Il=7),nd(e)},o.then(t,t);break a;case 3:Il=7;break a;case 4:Il=5;break a;case 7:ga(o)?(Il=0,Ll=null,ju(t)):(Il=0,Ll=null,Mu(e,t,o,7));break;case 5:var s=null;switch(Z.tag){case 26:s=Z.memoizedState;case 5:case 27:var c=Z;if(s?Wf(s):c.stateNode.complete){Il=0,Ll=null;var l=c.sibling;if(l!==null)Z=l;else{var u=c.return;u===null?Z=null:(Z=u,Nu(u))}break b}}Il=0,Ll=null,Mu(e,t,o,5);break;case 6:Il=0,Ll=null,Mu(e,t,o,6);break;case 8:yu(),Hl=6;break a;default:throw Error(i(462))}}ku();break}catch(t){xu(e,t)}while(1);return Li=Ii=null,P.H=r,P.A=a,Pl=n,Z===null?(Fl=null,Q=0,Wr(),Hl):0}function ku(){for(;Z!==null&&!ge();)Au(Z)}function Au(e){var t=Tc(e.alternate,e,Vl);e.memoizedProps=e.pendingProps,t===null?Nu(e):Z=t}function ju(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=lc(n,t,t.pendingProps,t.type,void 0,Q);break;case 11:t=lc(n,t,t.pendingProps,t.type.render,t.ref,Q);break;case 5:xo(t);default:Pc(n,t),t=Z=ti(t,Vl),t=Tc(n,t,Vl)}e.memoizedProps=e.pendingProps,t===null?Nu(e):Z=t}function Mu(e,t,n,r){Li=Ii=null,xo(t),Sa=null,Ca=0;var i=t.return;try{if(Js(e,i,t,n,Q)){Hl=1,Us(e,ci(n,e.current)),Z=null;return}}catch(t){if(i!==null)throw Z=i,t;Hl=1,Us(e,ci(n,e.current)),Z=null;return}t.flags&32768?(Y||r===1?e=!0:zl||Q&536870912?e=!1:(Rl=e=!0,(r===2||r===9||r===3||r===6)&&(r=qa.current,r!==null&&r.tag===13&&(r.flags|=16384))),Pu(t,e)):Nu(t)}function Nu(e){var t=e;do{if(t.flags&32768){Pu(t,Rl);return}e=t.return;var n=Mc(t.alternate,t,Vl);if(n!==null){Z=n;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);Hl===0&&(Hl=5)}function Pu(e,t){do{var n=Nc(e.alternate,e);if(n!==null){n.flags&=32767,Z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Z=e;return}Z=e=n}while(e!==null);Hl=6,Z=null}function Fu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Bu();while(nu!==0);if(Pl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Ur,We(e,n,o,s,c,l),e===Fl&&(Z=Fl=null,Q=0),iu=t,ru=e,au=n,ou=o,su=a,cu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Yu(Se,function(){return Vu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=P.T,P.T=null,a=F.p,F.p=2,s=Pl,Pl|=4;try{$c(e,t,n)}finally{Pl=s,F.p=a,P.T=r}}nu=1,Iu(),Lu(),Ru()}}function Iu(){if(nu===1){nu=0;var e=ru,t=iu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Pl;Pl|=4;try{fl(t,e);var a=zd,o=_r(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&gr(s.ownerDocument.documentElement,s)){if(c!==null&&vr(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 _=hr(s,h),v=hr(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}}sp=!!Rd,zd=Rd=null}finally{Pl=i,F.p=r,P.T=n}}e.current=t,nu=2}}function Lu(){if(nu===2){nu=0;var e=ru,t=iu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Pl;Pl|=4;try{el(e,t.alternate,t)}finally{Pl=i,F.p=r,P.T=n}}nu=3}}function Ru(){if(nu===4||nu===3){nu=0,_e();var e=ru,t=iu,n=au,r=cu;t.subtreeFlags&10256||t.flags&10256?nu=5:(nu=0,iu=ru=null,zu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(tu=null),Ye(n),t=t.stateNode,Oe&&typeof Oe.onCommitFiberRoot==`function`)try{Oe.onCommitFiberRoot(De,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=F.p,F.p=2,P.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{P.T=t,F.p=i}}au&3&&Bu(),nd(e),i=e.pendingLanes,n&261930&&i&42?e===uu?lu++:(lu=0,uu=e):lu=0,rd(0,!1)}}function zu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,$i(t)))}function Bu(){return Iu(),Lu(),Ru(),Vu()}function Vu(){if(nu!==5)return!1;var e=ru,t=ou;ou=0;var n=Ye(au),r=P.T,a=F.p;try{F.p=32>n?32:n,P.T=null,n=su,su=null;var o=ru,s=au;if(nu=0,iu=ru=null,au=0,Pl&6)throw Error(i(331));var c=Pl;if(Pl|=4,kl(o.current),xl(o,o.current,s,n),Pl=c,rd(0,!1),Oe&&typeof Oe.onPostCommitFiberRoot==`function`)try{Oe.onPostCommitFiberRoot(De,o)}catch{}return!0}finally{F.p=a,P.T=r,zu(e,t)}}function Hu(e,t,n){t=ci(n,t),t=Gs(e.stateNode,t,2),e=Pa(e,t,2),e!==null&&(Ue(e,2),nd(e))}function Uu(e,t,n){if(e.tag===3)Hu(e,e,n);else for(;t!==null;){if(t.tag===3){Hu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(tu===null||!tu.has(r))){e=ci(n,e),n=Ks(2),r=Pa(t,n,2),r!==null&&(qs(n,r,t,e),Ue(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Nl;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)||(Bl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Fl===e&&(Q&n)===n&&(Hl===4||Hl===3&&(Q&62914560)===Q&&300>ve()-Zl?!(Pl&2)&&bu(e,0):Gl|=n,ql===Q&&(ql=0)),nd(e)}function Ku(e,t){t===0&&(t=Ve()),e=qr(e,t),e!==null&&(Ue(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(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),Ku(e,n)}function Yu(e,t){return me(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;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-Ae(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=Q,a=Re(r,r===Fl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ze(r,a)||(n=!0,cd(r,a));r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Gd()&&(e=td);for(var t=ve(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}nu!==0&&nu!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ae(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Be(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Fl,n=Q,n=Re(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Il===2||Il===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&he(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ze(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&he(r),Ye(n)){case 2:case 8:n=xe;break;case 32:n=Se;break;case 268435456:n=we;break;default:n=Se}return r=sd.bind(null,e),n=me(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&he(r),e.callbackPriority=2,e.callbackNode=null,2}function sd(e,t){if(nu!==0&&nu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Bu()&&e.callbackNode!==n)return null;var r=Q;return r=Re(e,e===Fl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(mu(e,r,t),od(e,ve()),e.callbackNode!=null&&e.callbackNode===n?sd.bind(null,e):null)}function cd(e,t){if(Bu())return null;mu(e,t,!0)}function ld(){Yd(function(){Pl&6?me(be,id):ad()})}function ud(){if(td===0){var e=na;e===0&&(e=Pe,Pe<<=1,!(Pe&261888)&&(Pe=256)),td=e}return td}function dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Wt(``+e)}function fd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function pd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=dd((i[et]||null).action),o=r.submitter;o&&(t=(t=o[et]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new pn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(td!==0){var e=o?fd(i,o):new FormData(i);_s(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?fd(i,o):new FormData(i),_s(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var md=0;md<Rr.length;md++){var hd=Rr[md];zr(hd.toLowerCase(),`on`+(hd[0].toUpperCase()+hd.slice(1)))}zr(Ar,`onAnimationEnd`),zr(jr,`onAnimationIteration`),zr(Mr,`onAnimationStart`),zr(`dblclick`,`onDoubleClick`),zr(`focusin`,`onFocus`),zr(`focusout`,`onBlur`),zr(Nr,`onTransitionRun`),zr(Pr,`onTransitionStart`),zr(Fr,`onTransitionCancel`),zr(Ir,`onTransitionEnd`),gt(`onMouseEnter`,[`mouseout`,`mouseover`]),gt(`onMouseLeave`,[`mouseout`,`mouseover`]),gt(`onPointerEnter`,[`pointerout`,`pointerover`]),gt(`onPointerLeave`,[`pointerout`,`pointerover`]),ht(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),ht(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),ht(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),ht(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),ht(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),ht(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var gd=`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(` `),_d=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(gd));function vd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Br(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){Br(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[nt];n===void 0&&(n=t[nt]=new Set);var r=e+`__bubble`;n.has(r)||(Sd(t,e,2,!1),n.add(r))}function yd(e,t,n){var r=0;t&&(r|=4),Sd(n,e,r,t)}var bd=`_reactListening`+Math.random().toString(36).slice(2);function xd(e){if(!e[bd]){e[bd]=!0,pt.forEach(function(t){t!==`selectionchange`&&(_d.has(t)||yd(t,!1,e),yd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bd]||(t[bd]=!0,yd(`selectionchange`,!1,t))}}function Sd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!tn||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 Cd(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=ct(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}Qt(function(){var r=a,i=qt(n),s=[];a:{var c=Lr.get(e);if(c!==void 0){var l=pn,u=e;switch(e){case`keypress`:if(cn(n)===0)break a;case`keydown`:case`keyup`:l=kn;break;case`focusin`:u=`focus`,l=bn;break;case`focusout`:u=`blur`,l=bn;break;case`beforeblur`:case`afterblur`:l=bn;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=vn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=yn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=jn;break;case Ar:case jr:case Mr:l=xn;break;case Ir:l=Mn;break;case`scroll`:case`scrollend`:l=hn;break;case`wheel`:l=Nn;break;case`copy`:case`cut`:case`paste`:l=Sn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=An;break;case`toggle`:case`beforetoggle`:l=Pn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=$t(m,p),g!=null&&d.push(wd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Kt&&(u=n.relatedTarget||n.fromElement)&&(ct(u)||u[tt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ct(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=vn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=An,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:ut(l),h=u==null?c:ut(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ct(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ed,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Dd(s,c,l,d,!1),u!==null&&f!==null&&Dd(s,f,u,d,!0)}}a:{if(c=r?ut(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=er;else if(Jn(c))if(tr)v=ur;else{v=cr;var y=sr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Vt(r.elementType)&&(v=er):v=lr;if(v&&=v(e,r)){Yn(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Nt(c,`number`,c.value)}switch(y=r?ut(r):window,e){case`focusin`:(Jn(y)||y.contentEditable===`true`)&&(br=y,xr=r,Sr=null);break;case`focusout`:Sr=xr=br=null;break;case`mousedown`:Cr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Cr=!1,wr(s,n,i);break;case`selectionchange`:if(yr)break;case`keydown`:case`keyup`:wr(s,n,i)}var b;if(In)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Wn?Hn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(zn&&n.locale!==`ko`&&(Wn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Wn&&(b=sn()):(rn=i,an=`value`in rn?rn.value:rn.textContent,Wn=!0)),y=Td(r,x),0<y.length&&(x=new Cn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Un(n),b!==null&&(x.data=b)))),(b=Rn?Gn(e,n):Kn(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new Cn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),pd(s,e,r,n,i)}vd(s,t)})}function wd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Td(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=$t(e,n),i!=null&&r.unshift(wd(e,i,a)),i=$t(e,t),i!=null&&r.push(wd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ed(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dd(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=$t(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=$t(n,a),l!=null&&o.push(wd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Od=/\r\n?/g,kd=/\u0000|\uFFFD/g;function Ad(e){return(typeof e==`string`?e:``+e).replace(Od,`
9
+ `).replace(kd,``)}function jd(e,t){return t=Ad(t),Ad(e)===t}function Md(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Lt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Lt(e,``+r);break;case`className`:St(e,`class`,r);break;case`tabIndex`:St(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:St(e,n,r);break;case`style`:Bt(e,r,o);break;case`data`:if(t!==`object`){St(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Wt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Md(e,t,`name`,a.name,a,null),Md(e,t,`formEncType`,a.formEncType,a,null),Md(e,t,`formMethod`,a.formMethod,a,null),Md(e,t,`formTarget`,a.formTarget,a,null)):(Md(e,t,`encType`,a.encType,a,null),Md(e,t,`method`,a.method,a,null),Md(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Wt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Gt);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Wt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:$(`beforetoggle`,e),$(`toggle`,e),xt(e,`popover`,r);break;case`xlinkActuate`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ct(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ct(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ct(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:xt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Ht.get(n)||n,xt(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:Bt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Lt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Lt(e,``+r);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Gt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!mt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[et]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):xt(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`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:Md(e,t,o,s,n,null)}}a&&Md(e,t,`srcSet`,n.srcSet,n,null),r&&Md(e,t,`src`,n.src,n,null);return;case`input`:$(`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:Md(e,t,r,d,n,null)}}Mt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in $(`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:Md(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Pt(e,!!r,n,!0):Pt(e,!!r,t,!1);return;case`textarea`:for(s in $(`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:Md(e,t,s,c,n,null)}It(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:Md(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<gd.length;r++)$(gd[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`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:Md(e,t,u,r,n,null)}return;default:if(Vt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Md(e,t,c,r,n,null))}function Fd(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)||Md(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Md(e,t,p,m,r,f)}}jt(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)||Md(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Md(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Pt(e,!!n,n?[]:``,!1):Pt(e,!!n,t,!0)):Pt(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:Md(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Md(e,t,s,a,r,o)}Ft(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:Md(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Md(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)&&Md(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:Md(e,t,u,p,r,m)}return;default:if(Vt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(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||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Md(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||Md(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){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&&Id(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&&Id(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 Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(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 Hd(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 Ud(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 Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(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),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ot]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(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 ef(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`:ef(n),st(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(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[ot])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=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(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 cf(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 lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(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 ff(e,t,n){switch(t=Bd(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 pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);st(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=F.d;F.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=vu();return e||t}function yf(e){var t=lt(e);t!==null&&t.tag===5&&t.type===`form`?ys(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=K(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),ft(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+K(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+K(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+K(n.imageSizes)+`"]`)):i+=`[href="`+K(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),ft(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+K(r)+`"][href="`+K(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),ft(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=dt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);ft(c),Pd(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,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=dt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),ft(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=dt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),ft(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=V.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=dt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=dt(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(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=dt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+K(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),ft(t),e.head.appendChild(t))}function Pf(e){return`[src="`+K(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+K(n.href)+`"]`);if(r)return t.instance=r,ft(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),ft(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,ft(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),ft(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,ft(a),a):(r=n,(a=mf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),ft(a),Pd(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,Lf(r,n.precedence,e));return t.instance}function Lf(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 Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,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[ot]||a[$e]||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 Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(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 Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(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=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,ft(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),ft(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(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=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.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=Jf.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 Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function $f(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=He(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=He(0),this.hiddenUpdates=He(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Qr(3,null,null,t),e.current=a,a.stateNode=e,t=Qi(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ja(a),e}function tp(e){return e?(e=Xr,e):Xr}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Na(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Pa(e,r,t),n!==null&&(pu(n,e,t),Fa(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=qr(e,67108864);t!==null&&pu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=du();t=Je(t);var n=qr(e,t);n!==null&&pu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,up(e,t,n,r)}finally{F.p=a,P.T=i}}function lp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,up(e,t,n,r)}finally{F.p=a,P.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Cd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=lt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Le(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ae(o);s.entanglements[1]|=c,o&=~c}nd(a),!(Pl&6)&&($l=ve()+500,rd(0,!1))}}break;case 31:case 13:s=qr(a,2),s!==null&&pu(s,a,2),vu(),ip(a,2)}if(a=dp(r),a===null&&Cd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Cd(e,t,r,null,n)}}function dp(e){return e=qt(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=ct(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 fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(ye()){case be:return 2;case xe:return 8;case Se:case Ce:return 32;case we:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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 Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(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=lt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=ct(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,Ze(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Ze(e.priority,function(){op(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 Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Kt=r,n.target.dispatchEvent(r),Kt=null}else return t=lt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=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(pp(r||n)===null)continue;break}var a=lt(n);a!==null&&(e.splice(t,3),t-=3,_s(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.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[et]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[et]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){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 Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,du(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),vu(),t[tt]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xe();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.7`)throw Error(i(527,Lp,`19.2.7`));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{De=zp.inject(Rp),Oe=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Bs,s=Vs,c=Hs;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=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[tt]=t.current,xd(e),new Fp(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()})),_=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})),v=o(((e,t)=>{t.exports=_()})),y=c(g(),1),b=c(u(),1),x=v(),S={view:`login`,serverUrl:`http://localhost:4747`,connected:!1,graphLoad:null,currentUser:null,repoName:``,nodes:[],edges:[],selectedNode:null,hoveredNodeId:null,filters:{hiddenNodeKinds:new Set([`cluster`,`flow`,`directory`]),hiddenEdgeKinds:new Set,focusDepth:`all`},search:{query:``,results:[]},chat:{messages:[],loading:!1},mode:`repo`,groupName:``,groupMembers:[],groupContracts:[],groupLinks:[],groupSyncedAt:null};function C(e,t){switch(t.type){case`SET_VIEW`:return{...e,view:t.view};case`SET_SERVER_URL`:return{...e,serverUrl:t.url};case`SET_CONNECTED`:return{...e,connected:t.connected};case`SET_CURRENT_USER`:return{...e,currentUser:t.user};case`SET_REPO_NAME`:return{...e,repoName:t.name};case`SET_GRAPH`:return{...e,nodes:t.nodes,edges:t.edges};case`SELECT_NODE`:return{...e,selectedNode:t.node};case`HOVER_NODE`:return{...e,hoveredNodeId:t.nodeId};case`SET_SEARCH`:return{...e,search:{query:t.query,results:t.results}};case`ADD_CHAT_MESSAGE`:return{...e,chat:{...e.chat,messages:[...e.chat.messages,t.message]}};case`UPDATE_LAST_CHAT_MESSAGE`:{let n=e.chat.messages.slice();return n.length===0?e:(n[n.length-1]={...n[n.length-1],...t.message},{...e,chat:{...e.chat,messages:n}})}case`SET_CHAT_LOADING`:return{...e,chat:{...e.chat,loading:t.loading}};case`CLEAR_CHAT`:return{...e,chat:{messages:[],loading:!1}};case`TOGGLE_NODE_KIND`:{let n=new Set(e.filters.hiddenNodeKinds);return n.has(t.kind)?n.delete(t.kind):n.add(t.kind),{...e,filters:{...e.filters,hiddenNodeKinds:n}}}case`TOGGLE_EDGE_KIND`:{let n=new Set(e.filters.hiddenEdgeKinds);return n.has(t.kind)?n.delete(t.kind):n.add(t.kind),{...e,filters:{...e.filters,hiddenEdgeKinds:n}}}case`SET_FOCUS_DEPTH`:return{...e,filters:{...e.filters,focusDepth:t.depth}};case`RESET_FILTERS`:return{...e,filters:S.filters};case`SET_MODE`:return{...e,mode:t.mode};case`SET_GROUP_NAME`:return{...e,groupName:t.name};case`SET_GROUP_MEMBERS`:return{...e,groupMembers:t.members};case`SET_GROUP_CONTRACTS`:return{...e,groupContracts:t.contracts,groupLinks:t.links,groupSyncedAt:t.syncedAt};case`SET_GRAPH_LOAD`:return{...e,graphLoad:t.progress};default:return e}}var w=(0,b.createContext)({state:S,dispatch:()=>{}});function T({children:e}){let[t,n]=(0,b.useReducer)(C,S);return(0,x.jsx)(w.Provider,{value:{state:t,dispatch:n},children:e})}function E(){return(0,b.useContext)(w)}var D=class{baseUrl;constructor(e){this.baseUrl=e}csrfToken=null;async getCsrfToken(){if(this.csrfToken)return this.csrfToken;let e=await(await fetch(`${this.baseUrl}/auth/csrf-token`,{credentials:`include`})).json();return this.csrfToken=e.csrfToken,this.csrfToken}async bootstrapStatus(){let e=await fetch(`${this.baseUrl}/auth/bootstrap-status`,{credentials:`include`});return e.ok?e.json():{needsBootstrap:!1}}async bootstrap(e,t){let n=await this.getCsrfToken(),r=await fetch(`${this.baseUrl}/auth/bootstrap`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":n},credentials:`include`,body:JSON.stringify({username:e,password:t})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e?.error?.message??`Bootstrap failed`)}return r.json()}async login(e,t,n=!1){let r=await this.getCsrfToken(),i=await fetch(`${this.baseUrl}/auth/login`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":r},credentials:`include`,body:JSON.stringify({username:e,password:t,rememberMe:n})});if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e?.error?.message??`Login failed`)}return i.json()}async logout(){let e=await this.getCsrfToken();await fetch(`${this.baseUrl}/auth/logout`,{method:`POST`,headers:{"X-CSRF-Token":e},credentials:`include`}),this.csrfToken=null}async authStatus(){let e=await fetch(`${this.baseUrl}/auth/status`,{credentials:`include`});return e.ok?e.json():{authenticated:!1}}async fetchGraph(e){let t=await fetch(`${this.baseUrl}/api/v1/graph/${e}`,{credentials:`include`});if(!t.ok)throw Error(`Failed to fetch graph: ${t.statusText}`);return t.json()}async fetchGraphNodes(e,t,n){let r=`${this.baseUrl}/api/v1/graph/${encodeURIComponent(e)}/nodes?limit=${n}&offset=${t}`,i=await fetch(r,{credentials:`include`});if(!i.ok)throw Error(`Failed to fetch graph nodes: ${i.statusText}`);return i.json()}async search(e,t=20,n){let r=await this.getCsrfToken(),i=await fetch(`${this.baseUrl}/api/v1/search`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":r},credentials:`include`,body:JSON.stringify({query:e,limit:t,...n})});if(!i.ok)throw Error(`Search failed: ${i.statusText}`);return i.json()}async vectorSearch(e,t=10){let n=await this.getCsrfToken(),r=await fetch(`${this.baseUrl}/api/v1/vector-search`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":n},credentials:`include`,body:JSON.stringify({query:e,limit:t})});if(!r.ok)throw Error(`Vector search failed: ${r.statusText}`);return r.json()}async vectorStatus(){let e=await fetch(`${this.baseUrl}/api/v1/vector-status`,{credentials:`include`});return e.ok?e.json():{ready:!1,building:!1}}async listRepos(){let e=await fetch(`${this.baseUrl}/api/v1/repos`,{credentials:`include`});if(!e.ok)throw Error(`Failed to list repos: ${e.statusText}`);return e.json()}async readFile(e){let t=await this.getCsrfToken(),n=await fetch(`${this.baseUrl}/api/v1/files/read`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":t},credentials:`include`,body:JSON.stringify({file_path:e})});if(!n.ok)throw Error(`Failed to read file: ${n.statusText}`);return n.json()}async inspectNode(e,t){let n=`${this.baseUrl}/api/v1/nodes/${encodeURIComponent(e)}${t?`?repo=${encodeURIComponent(t)}`:``}`,r=await fetch(n,{credentials:`include`});if(!r.ok)throw Error(`Inspect failed: ${r.statusText}`);return r.json()}async blastRadius(e,t=`both`,n=3,r){let i=await this.getCsrfToken(),a=await fetch(`${this.baseUrl}/api/v1/blast-radius`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":i},credentials:`include`,body:JSON.stringify({target:e,direction:t,max_hops:n,repo:r})});if(!a.ok)throw Error(`Blast radius failed: ${a.statusText}`);return a.json()}async grep(e){let t=await this.getCsrfToken(),n=await fetch(`${this.baseUrl}/api/v1/grep`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":t},credentials:`include`,body:JSON.stringify({pattern:e})});if(!n.ok)throw Error(`Grep failed: ${n.statusText}`);return n.json()}async listFlows(){let e=await fetch(`${this.baseUrl}/api/v1/flows`,{credentials:`include`});if(!e.ok)throw Error(`List flows failed: ${e.statusText}`);return e.json()}async listGroups(){let e=await fetch(`${this.baseUrl}/api/v1/groups`,{credentials:`include`});if(!e.ok)throw Error(`Failed to list groups: ${e.statusText}`);return e.json()}async getGroup(e){let t=await fetch(`${this.baseUrl}/api/v1/groups/${encodeURIComponent(e)}`,{credentials:`include`});if(!t.ok)throw Error(`Group not found: ${t.statusText}`);return t.json()}async getGroupContracts(e){let t=await fetch(`${this.baseUrl}/api/v1/groups/${encodeURIComponent(e)}/contracts`,{credentials:`include`});if(t.status===404)return null;if(!t.ok)throw Error(`Failed to get contracts: ${t.statusText}`);return t.json()}async syncGroup(e){let t=await this.getCsrfToken(),n=await fetch(`${this.baseUrl}/api/v1/groups/${encodeURIComponent(e)}/sync`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":t},credentials:`include`});if(!n.ok)throw Error(`Sync failed: ${n.statusText}`);return n.json()}async searchGroup(e,t,n=20){let r=await this.getCsrfToken(),i=await fetch(`${this.baseUrl}/api/v1/groups/${encodeURIComponent(e)}/search`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":r},credentials:`include`,body:JSON.stringify({q:t,limit:n})});if(!i.ok)throw Error(`Group search failed: ${i.statusText}`);return i.json()}async fetchGroupGraph(e){let t=await fetch(`${this.baseUrl}/api/v1/groups/${encodeURIComponent(e)}/graph`,{credentials:`include`});if(!t.ok)throw Error(`Failed to fetch group graph: ${t.statusText}`);return t.json()}async sourcePreview(e,t,n,r){let i=new URLSearchParams({file:e});t!==void 0&&i.set(`startLine`,String(t)),n!==void 0&&i.set(`endLine`,String(n)),r&&i.set(`repo`,r);let a=await fetch(`${this.baseUrl}/api/v1/source?${i.toString()}`,{credentials:`include`});if(!a.ok){let e=await a.json().catch(()=>({}));throw Error(e?.error?.message??`Source preview failed: ${a.statusText}`)}return a.json()}async getGroupTopology(e){let t=await fetch(`${this.baseUrl}/api/v1/groups/${encodeURIComponent(e)}/topology`,{credentials:`include`});if(!t.ok)throw Error(`Failed to get topology: ${t.statusText}`);return t.json()}async createGroup(e){let t=await this.getCsrfToken(),n=await fetch(`${this.baseUrl}/api/v1/groups`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":t},credentials:`include`,body:JSON.stringify({name:e})}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r?.error?.message??`Create group failed: ${n.statusText}`);return r}async renameGroup(e,t){let n=await this.getCsrfToken(),r=await fetch(`${this.baseUrl}/api/v1/groups/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":n},credentials:`include`,body:JSON.stringify({name:t})}),i=await r.json().catch(()=>({}));if(!r.ok)throw Error(i?.error?.message??`Rename failed: ${r.statusText}`);return i}async deleteGroup(e){let t=await this.getCsrfToken(),n=await fetch(`${this.baseUrl}/api/v1/groups/${encodeURIComponent(e)}`,{method:`DELETE`,headers:{"X-CSRF-Token":t},credentials:`include`});if(!n.ok&&n.status!==204){let e=await n.json().catch(()=>({}));throw Error(e?.error?.message??`Delete failed: ${n.statusText}`)}}async addGroupMember(e,t,n){let r=await this.getCsrfToken(),i=await fetch(`${this.baseUrl}/api/v1/groups/${encodeURIComponent(e)}/members`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":r},credentials:`include`,body:JSON.stringify({groupPath:t,registryName:n})}),a=await i.json().catch(()=>({}));if(!i.ok)throw Error(a?.error?.message??`Add member failed: ${i.statusText}`);return a}async removeGroupMember(e,t){let n=await this.getCsrfToken(),r=await fetch(`${this.baseUrl}/api/v1/groups/${encodeURIComponent(e)}/members`,{method:`DELETE`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":n},credentials:`include`,body:JSON.stringify({groupPath:t})}),i=await r.json().catch(()=>({}));if(!r.ok)throw Error(i?.error?.message??`Remove member failed: ${r.statusText}`);return i}async queryGQL(e){let t=await this.getCsrfToken(),n=await fetch(`${this.baseUrl}/api/v1/query`,{method:`POST`,headers:{"Content-Type":`application/json`,"X-CSRF-Token":t},credentials:`include`,body:JSON.stringify({gql:e})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e?.error?.message??`Query failed: ${n.statusText}`)}return n.json()}};function O(){let{state:e,dispatch:t}=E(),n=window.location.port===`5173`||window.location.port===`5174`?`http://localhost:4747`:window.location.origin,[r,i]=(0,b.useState)(n),[a,o]=(0,b.useState)(``),[s,c]=(0,b.useState)(``),[l,u]=(0,b.useState)(``),[d,f]=(0,b.useState)(!1),[p,m]=(0,b.useState)(``),[h,g]=(0,b.useState)(!1),[_,v]=(0,b.useState)(!0),[y,S]=(0,b.useState)(!1);(0,b.useEffect)(()=>{let r=new D(e.serverUrl||n);(async()=>{try{let{needsBootstrap:i}=await r.bootstrapStatus();if(i){S(!0),v(!1);return}let a=await r.authStatus();a.authenticated&&a.user&&(t({type:`SET_SERVER_URL`,url:e.serverUrl||n}),t({type:`SET_CURRENT_USER`,user:a.user}),t({type:`SET_VIEW`,view:`connect`}))}catch{}v(!1)})()},[]);let C=async e=>{if(e.preventDefault(),!a.trim()||!s.trim()){m(`Username and password are required`);return}m(``),g(!0);try{let{user:e}=await new D(r).login(a.trim(),s,d);t({type:`SET_SERVER_URL`,url:r}),t({type:`SET_CURRENT_USER`,user:e}),t({type:`SET_VIEW`,view:`connect`})}catch(e){m(e instanceof Error?e.message:`Login failed`)}finally{g(!1)}},w=async e=>{if(e.preventDefault(),!a.trim()||!s.trim()){m(`Username and password are required`);return}if(s.length<8){m(`Password must be at least 8 characters`);return}if(s!==l){m(`Passwords do not match`);return}m(``),g(!0);try{let{user:e}=await new D(r).bootstrap(a.trim(),s);t({type:`SET_SERVER_URL`,url:r}),t({type:`SET_CURRENT_USER`,user:e}),t({type:`SET_VIEW`,view:`connect`})}catch(e){m(e instanceof Error?e.message:`Setup failed`)}finally{g(!1)}};if(_)return(0,x.jsx)(`div`,{className:`flex items-center justify-center min-h-screen bg-void`,children:(0,x.jsxs)(`div`,{className:`flex items-center gap-3 text-text-muted`,children:[(0,x.jsx)(A,{className:`w-5 h-5 text-accent`}),(0,x.jsx)(`span`,{className:`text-sm`,children:`Checking session…`})]})});let T=`w-full bg-elevated text-text-primary rounded-lg px-4 py-2.5 border border-border-default focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent/30 placeholder-text-muted transition disabled:opacity-50 text-sm`,O=`block text-xs font-medium text-text-secondary uppercase tracking-widest mb-1.5`;return y?(0,x.jsx)(`div`,{className:`flex items-center justify-center min-h-screen bg-void`,children:(0,x.jsxs)(`div`,{className:`bg-deep border border-border-subtle rounded-2xl shadow-2xl w-full max-w-sm p-10`,children:[(0,x.jsx)(ee,{subtitle:`First-time Setup`}),(0,x.jsx)(`div`,{className:`mb-4 rounded-lg bg-accent/10 border border-accent/30 px-4 py-3`,children:(0,x.jsx)(`p`,{className:`text-text-secondary text-sm leading-snug`,children:`No admin account found. Create one to get started.`})}),(0,x.jsxs)(`form`,{onSubmit:w,className:`space-y-4`,children:[(0,x.jsx)(te,{label:`Server URL`,labelClass:O,children:(0,x.jsx)(`input`,{type:`text`,value:r,onChange:e=>i(e.target.value),disabled:h,className:T,placeholder:`http://localhost:4747`,autoComplete:`off`})}),(0,x.jsx)(te,{label:`Admin Username`,labelClass:O,children:(0,x.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),disabled:h,autoComplete:`username`,className:T,placeholder:`admin`})}),(0,x.jsx)(te,{label:`Password`,labelClass:O,children:(0,x.jsx)(`input`,{type:`password`,value:s,onChange:e=>c(e.target.value),disabled:h,autoComplete:`new-password`,className:T,placeholder:`••••••••`})}),(0,x.jsx)(te,{label:`Confirm Password`,labelClass:O,children:(0,x.jsx)(`input`,{type:`password`,value:l,onChange:e=>u(e.target.value),disabled:h,autoComplete:`new-password`,className:T,placeholder:`••••••••`})}),p&&(0,x.jsx)(k,{message:p}),(0,x.jsx)(`button`,{type:`submit`,disabled:h,className:`w-full bg-gradient-to-r from-accent to-accent-dim hover:opacity-90 text-white font-semibold rounded-lg py-2.5 transition flex items-center justify-center gap-2 disabled:opacity-60 disabled:cursor-not-allowed mt-2 shadow-glow`,children:h?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(A,{className:`w-4 h-4`}),` Creating account…`]}):`Create Admin Account`})]})]})}):(0,x.jsx)(`div`,{className:`flex items-center justify-center min-h-screen bg-void`,children:(0,x.jsxs)(`div`,{className:`bg-deep border border-border-subtle rounded-2xl shadow-2xl w-full max-w-sm p-10`,children:[(0,x.jsx)(ee,{subtitle:`Sign in to your account`}),(0,x.jsxs)(`form`,{onSubmit:C,className:`space-y-4`,children:[(0,x.jsx)(te,{label:`Server URL`,labelClass:O,children:(0,x.jsx)(`input`,{type:`text`,value:r,onChange:e=>i(e.target.value),disabled:h,className:T,placeholder:`http://localhost:4747`,autoComplete:`off`})}),(0,x.jsx)(te,{label:`Username`,labelClass:O,children:(0,x.jsx)(`input`,{type:`text`,value:a,onChange:e=>o(e.target.value),disabled:h,autoComplete:`username`,className:T,placeholder:`admin`})}),(0,x.jsx)(te,{label:`Password`,labelClass:O,children:(0,x.jsx)(`input`,{type:`password`,value:s,onChange:e=>c(e.target.value),disabled:h,autoComplete:`current-password`,className:T,placeholder:`••••••••`})}),(0,x.jsxs)(`label`,{className:`flex items-center gap-2.5 cursor-pointer select-none group`,children:[(0,x.jsx)(`div`,{onClick:()=>!h&&f(e=>!e),className:`w-4 h-4 rounded border flex items-center justify-center shrink-0 transition
10
+ ${d?`bg-accent border-accent`:`bg-elevated border-border-default group-hover:border-accent/60`}
11
+ ${h?`opacity-40 cursor-not-allowed`:``}`,children:d&&(0,x.jsx)(`svg`,{className:`w-2.5 h-2.5 text-white`,fill:`none`,viewBox:`0 0 12 12`,stroke:`currentColor`,strokeWidth:2.5,children:(0,x.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M2 6l3 3 5-5`})})}),(0,x.jsxs)(`span`,{className:`text-sm text-text-secondary`,children:[`Remember me `,(0,x.jsx)(`span`,{className:`text-text-muted text-xs`,children:`(stay signed in for 12 h)`})]})]}),p&&(0,x.jsx)(k,{message:p}),(0,x.jsx)(`button`,{type:`submit`,disabled:h,className:`w-full bg-gradient-to-r from-accent to-accent-dim hover:opacity-90 text-white font-semibold rounded-lg py-2.5 transition flex items-center justify-center gap-2 disabled:opacity-60 disabled:cursor-not-allowed mt-2 shadow-glow`,children:h?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(A,{className:`w-4 h-4`}),` Signing in…`]}):`Sign in`})]}),(0,x.jsxs)(`div`,{className:`mt-6 pt-5 border-t border-border-subtle`,children:[(0,x.jsxs)(`p`,{className:`text-center text-xs text-text-muted`,children:[`No account?`,` `,(0,x.jsx)(`span`,{className:`font-mono text-text-secondary`,children:`code-intel user create admin --role admin`})]}),(0,x.jsxs)(`p`,{className:`text-center text-xs text-text-muted/60 mt-1.5`,children:[`Or use a Bearer token via`,` `,(0,x.jsx)(`span`,{className:`font-mono`,children:`Authorization: Bearer <token>`})]})]})]})})}function ee({subtitle:e}){return(0,x.jsxs)(`div`,{className:`flex flex-col items-center mb-8`,children:[(0,x.jsx)(`div`,{className:`w-14 h-14 rounded-xl bg-gradient-to-br from-accent to-accent-dim flex items-center justify-center text-white text-3xl font-bold shadow-glow mb-4 select-none`,children:`◈`}),(0,x.jsx)(`h1`,{className:`text-2xl font-bold text-text-primary tracking-tight`,children:`Code Intel`}),(0,x.jsx)(`p`,{className:`text-text-muted text-sm mt-1`,children:e}),(0,x.jsxs)(`span`,{className:`mt-1.5 text-[10px] font-mono text-text-muted/50 select-none`,children:[`v`,`1.0.3`]})]})}function te({label:e,labelClass:t,children:n}){return(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`label`,{className:t,children:e}),n]})}function k({message:e}){return(0,x.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-lg bg-red-950/40 border border-red-800/50 px-4 py-3`,children:[(0,x.jsx)(`svg`,{className:`w-4 h-4 text-red-400 mt-0.5 shrink-0`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,x.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z`})}),(0,x.jsx)(`p`,{className:`text-red-400 text-sm leading-snug`,children:e})]})}function A({className:e=``}){return(0,x.jsxs)(`svg`,{className:`animate-spin ${e}`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,x.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,x.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z`})]})}function j(){let{dispatch:e}=E(),t=window.location.port===`5173`||window.location.port===`5174`?`http://localhost:4747`:window.location.origin,[n,r]=(0,b.useState)(t),[i,a]=(0,b.useState)(``),[o,s]=(0,b.useState)(!1),[c,l]=(0,b.useState)(`repo`),[u,d]=(0,b.useState)([]),[f,p]=(0,b.useState)([]),[m,h]=(0,b.useState)(``),[g,_]=(0,b.useState)(``),[v,y]=(0,b.useState)(!1),[S,C]=(0,b.useState)(null);(0,b.useEffect)(()=>{w(t)},[]);let w=async e=>{try{d(await new D(e).listRepos()),a(``)}catch{d([])}};(0,b.useEffect)(()=>{c===`group`&&T()},[c,n]);let T=async()=>{y(!0);try{p(await new D(n).listGroups())}catch{p([])}finally{y(!1)}},O=async t=>{a(``),s(!0);try{let r=new D(n);e({type:`SET_SERVER_URL`,url:n}),e({type:`SET_MODE`,mode:`repo`}),e({type:`SET_REPO_NAME`,name:t}),e({type:`SET_VIEW`,view:`loading`}),e({type:`SET_GRAPH_LOAD`,progress:{loaded:0,total:0,phase:`edges`}});let[i,a]=await Promise.all([r.fetchGraph(t),r.fetchGraphNodes(t,0,200)]),o=a.total,s=[...a.nodes],c=new Set(s.map(e=>e.id));if(e({type:`SET_GRAPH_LOAD`,progress:{loaded:s.length,total:o,phase:`nodes`}}),a.hasMore){let n=[];for(let e=200;e<o;e+=200)n.push(e);for(let i=0;i<n.length;i+=8){let a=n.slice(i,i+8),l=await Promise.all(a.map(e=>r.fetchGraphNodes(t,e,200).catch(()=>null)));for(let e of l)if(e)for(let t of e.nodes)c.has(t.id)||(c.add(t.id),s.push(t));e({type:`SET_GRAPH_LOAD`,progress:{loaded:s.length,total:o,phase:`nodes`}})}}e({type:`SET_GRAPH_LOAD`,progress:null}),e({type:`SET_GRAPH`,nodes:s,edges:i.edges}),e({type:`SET_CONNECTED`,connected:!0}),e({type:`SET_VIEW`,view:`exploring`})}catch(t){a(t instanceof Error?t.message:`Connection failed`),e({type:`SET_GRAPH_LOAD`,progress:null}),e({type:`SET_VIEW`,view:`connect`}),s(!1)}},ee=async t=>{a(``),C(t);try{let r=new D(n);e({type:`SET_SERVER_URL`,url:n}),e({type:`SET_VIEW`,view:`loading`});let[i,a]=await Promise.all([r.getGroup(t),r.fetchGroupGraph(t)]);e({type:`SET_MODE`,mode:`group`}),e({type:`SET_GROUP_NAME`,name:t}),e({type:`SET_GROUP_MEMBERS`,members:i.members}),e({type:`SET_REPO_NAME`,name:t}),e({type:`SET_GRAPH`,nodes:a.nodes,edges:a.edges}),e({type:`SET_CONNECTED`,connected:!0}),e({type:`SET_VIEW`,view:`exploring`}),r.getGroupContracts(t).then(t=>{t&&e({type:`SET_GROUP_CONTRACTS`,contracts:t.contracts,links:t.links,syncedAt:t.syncedAt})}).catch(()=>{})}catch(t){a(t instanceof Error?t.message:`Failed to load group`),e({type:`SET_VIEW`,view:`connect`})}finally{C(null)}},te=u.filter(e=>e.name.toLowerCase().includes(m.toLowerCase())||e.path.toLowerCase().includes(m.toLowerCase())),k=f.filter(e=>e.name.toLowerCase().includes(g.toLowerCase()));return(0,x.jsx)(`div`,{className:`flex items-center justify-center min-h-screen bg-void p-4`,children:(0,x.jsxs)(`div`,{className:`bg-deep border border-border-subtle rounded-2xl shadow-2xl w-full max-w-sm flex flex-col`,style:{maxHeight:`calc(100vh - 2rem)`},children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-3 px-6 pt-6 pb-4 shrink-0`,children:[(0,x.jsx)(`div`,{className:`w-9 h-9 rounded-xl bg-gradient-to-br from-accent to-accent-dim flex items-center justify-center text-white text-xl font-bold shadow-glow select-none shrink-0`,children:`◈`}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h1`,{className:`text-lg font-bold text-text-primary tracking-tight leading-tight`,children:`Code Intel`}),(0,x.jsx)(`p`,{className:`text-text-muted text-xs`,children:`Knowledge Graph Explorer`})]})]}),(0,x.jsx)(`div`,{className:`flex bg-surface mx-4 rounded-lg p-0.5 mb-3 border border-border-subtle shrink-0`,children:[`repo`,`group`].map(e=>(0,x.jsx)(`button`,{onClick:()=>l(e),className:`flex-1 py-1.5 rounded-md text-xs font-semibold transition ${c===e?`bg-gradient-to-r from-accent to-accent-dim text-white shadow`:`text-text-muted hover:text-text-secondary`}`,children:e===`repo`?`⬡ Repository`:`⬢ Group`},e))}),(0,x.jsx)(`div`,{className:`px-4 mb-3 shrink-0`,children:(0,x.jsx)(`input`,{type:`text`,value:n,onChange:e=>{r(e.target.value),w(e.target.value)},disabled:o||S!==null,className:`w-full bg-elevated text-text-primary rounded-lg px-4 py-2.5 border border-border-default focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent/30 placeholder-text-muted transition disabled:opacity-50 text-sm`,placeholder:`http://localhost:4747`})}),i&&(0,x.jsxs)(`div`,{className:`mx-4 mb-3 flex items-start gap-2 rounded-lg bg-red-950/40 border border-red-800/50 px-3 py-2 shrink-0`,children:[(0,x.jsx)(`svg`,{className:`w-3.5 h-3.5 text-red-400 mt-0.5 shrink-0`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,x.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z`})}),(0,x.jsx)(`p`,{className:`text-red-400 text-xs leading-snug`,children:i})]}),c===`repo`&&(0,x.jsx)(`div`,{className:`flex flex-col min-h-0 flex-1 px-4 pb-4`,children:u.length>0?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2 mb-2 shrink-0`,children:[(0,x.jsxs)(`div`,{className:`relative flex-1`,children:[(0,x.jsx)(`span`,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-xs pointer-events-none`,children:`⌕`}),(0,x.jsx)(`input`,{type:`text`,value:m,onChange:e=>h(e.target.value),placeholder:`Filter repos…`,className:`w-full bg-surface border border-border-subtle rounded-lg pl-7 pr-3 py-1.5 text-xs text-text-primary placeholder-text-muted focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent/30 transition`})]}),(0,x.jsxs)(`span`,{className:`text-[10px] text-text-muted shrink-0 tabular-nums`,children:[te.length,`/`,u.length]})]}),(0,x.jsx)(`div`,{className:`overflow-y-auto scrollbar-thin space-y-1.5 flex-1`,children:te.length===0?(0,x.jsxs)(`div`,{className:`text-center py-6 text-text-muted text-xs`,children:[`No repos match "`,m,`"`]}):te.map(e=>(0,x.jsxs)(`button`,{onClick:()=>O(e.name),disabled:o,className:`w-full flex items-center gap-3 bg-surface hover:bg-hover border rounded-xl px-3 py-2.5 transition group disabled:opacity-50 disabled:cursor-not-allowed text-left ${e.active?`border-accent/40 hover:border-accent/60`:`border-border-subtle hover:border-border-default`}`,children:[(0,x.jsx)(`span`,{className:`h-2 w-2 rounded-full shrink-0 ${e.active?`bg-accent shadow-glow animate-pulse`:`bg-node-function`}`}),(0,x.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(`span`,{className:`text-xs font-semibold text-text-primary truncate`,children:e.name}),e.active&&(0,x.jsx)(`span`,{className:`text-[9px] bg-accent/20 text-accent border border-accent/30 px-1 py-px rounded-full font-medium shrink-0`,children:`active`})]}),(0,x.jsxs)(`div`,{className:`text-[10px] text-text-muted mt-0.5 tabular-nums`,children:[e.nodes.toLocaleString(),`n · `,e.edges.toLocaleString(),`e`]}),e.path&&(0,x.jsx)(`div`,{className:`text-[9px] text-text-muted/40 font-mono truncate mt-0.5`,title:e.path,children:e.path})]}),o?(0,x.jsx)(M,{className:`w-3.5 h-3.5 text-accent shrink-0`}):(0,x.jsx)(`span`,{className:`text-text-muted/40 group-hover:text-accent transition text-sm shrink-0`,children:`→`})]},e.name))})]}):(0,x.jsxs)(`div`,{className:`bg-surface border border-border-subtle rounded-xl px-4 py-6 text-center`,children:[(0,x.jsx)(`p`,{className:`text-text-muted text-sm mb-2`,children:`No repositories found.`}),(0,x.jsx)(`p`,{className:`text-text-muted/60 text-xs font-mono`,children:`code-intel analyze`})]})}),c===`group`&&(0,x.jsx)(`div`,{className:`flex flex-col min-h-0 flex-1 px-4 pb-4`,children:v?(0,x.jsxs)(`div`,{className:`flex items-center justify-center py-8 text-text-muted text-sm gap-2`,children:[(0,x.jsx)(M,{className:`w-4 h-4`}),`Loading groups…`]}):f.length===0?(0,x.jsxs)(`div`,{className:`bg-surface border border-border-subtle rounded-xl px-4 py-6 text-center`,children:[(0,x.jsx)(`p`,{className:`text-text-muted text-sm mb-2`,children:`No groups found.`}),(0,x.jsx)(`p`,{className:`text-text-muted/60 text-xs font-mono`,children:`code-intel group create <name>`})]}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2 mb-2 shrink-0`,children:[(0,x.jsxs)(`div`,{className:`relative flex-1`,children:[(0,x.jsx)(`span`,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-xs pointer-events-none`,children:`⌕`}),(0,x.jsx)(`input`,{type:`text`,value:g,onChange:e=>_(e.target.value),placeholder:`Filter groups…`,className:`w-full bg-surface border border-border-subtle rounded-lg pl-7 pr-3 py-1.5 text-xs text-text-primary placeholder-text-muted focus:border-accent focus:outline-none focus:ring-1 focus:ring-accent/30 transition`})]}),(0,x.jsx)(`button`,{onClick:T,disabled:v,className:`text-xs text-accent hover:text-accent/80 transition disabled:opacity-50 shrink-0`,title:`Refresh`,children:`↻`}),(0,x.jsxs)(`span`,{className:`text-[10px] text-text-muted shrink-0 tabular-nums`,children:[k.length,`/`,f.length]})]}),(0,x.jsx)(`div`,{className:`overflow-y-auto scrollbar-thin space-y-1.5 flex-1`,children:k.length===0?(0,x.jsxs)(`div`,{className:`text-center py-6 text-text-muted text-xs`,children:[`No groups match "`,g,`"`]}):k.map(e=>(0,x.jsxs)(`button`,{onClick:()=>ee(e.name),disabled:S!==null,className:`w-full flex items-center gap-3 bg-surface hover:bg-hover border border-border-subtle hover:border-accent/40 rounded-xl px-3 py-2.5 transition group disabled:opacity-50 disabled:cursor-not-allowed text-left`,children:[(0,x.jsx)(`span`,{className:`text-accent text-base shrink-0`,children:`⬢`}),(0,x.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(`span`,{className:`text-xs font-semibold text-text-primary truncate`,children:e.name}),S===e.name&&(0,x.jsx)(M,{className:`w-3 h-3 text-accent shrink-0`})]}),(0,x.jsxs)(`div`,{className:`text-[10px] text-text-muted mt-0.5`,children:[e.memberCount,` repo`,e.memberCount===1?``:`s`,e.lastSync?` · synced ${new Date(e.lastSync).toLocaleDateString()}`:` · not synced`]})]}),(0,x.jsx)(`span`,{className:`text-text-muted/40 group-hover:text-accent transition text-sm shrink-0`,children:`→`})]},e.name))})]})})]})})}function M({className:e=``}){return(0,x.jsxs)(`svg`,{className:`animate-spin ${e}`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,x.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,x.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z`})]})}function N(){let{state:e}=E(),t=e.graphLoad,n=t&&t.total>0?Math.min(100,Math.round(t.loaded/t.total*100)):null;return(0,x.jsxs)(`div`,{className:`flex items-center justify-center min-h-screen bg-void`,children:[(0,x.jsxs)(`div`,{className:`flex flex-col items-center gap-8 w-full max-w-sm px-8`,children:[(0,x.jsxs)(`div`,{className:`relative flex items-center justify-center`,children:[(0,x.jsx)(`span`,{className:`absolute inline-flex h-20 w-20 rounded-2xl bg-accent/20 animate-ping`}),(0,x.jsx)(`div`,{className:`relative w-16 h-16 rounded-2xl bg-gradient-to-br from-accent to-accent-dim flex items-center justify-center text-white text-3xl font-bold shadow-glow select-none`,children:`◈`})]}),(0,x.jsxs)(`div`,{className:`flex flex-col items-center gap-2 text-center`,children:[(0,x.jsx)(`p`,{className:`text-text-primary text-lg font-semibold tracking-tight`,children:t?.phase===`edges`?`Fetching graph structure…`:t?`Loading nodes…`:`Building knowledge graph…`}),t?.phase===`nodes`&&t.total>0?(0,x.jsxs)(`p`,{className:`text-text-muted text-sm font-mono tabular-nums`,children:[t.loaded.toLocaleString(),` / `,t.total.toLocaleString(),` nodes`]}):(0,x.jsx)(`p`,{className:`text-text-muted text-sm`,children:e.repoName||`Preparing…`})]}),(0,x.jsxs)(`div`,{className:`w-full`,children:[(0,x.jsx)(`div`,{className:`h-1.5 w-full bg-elevated rounded-full overflow-hidden border border-border-subtle`,children:n===null?(0,x.jsx)(`div`,{className:`h-full rounded-full bg-gradient-to-r from-accent to-accent-dim animate-[shimmer_1.5s_ease-in-out_infinite]`,style:{width:`40%`,animation:`shimmer 1.5s ease-in-out infinite`}}):(0,x.jsx)(`div`,{className:`h-full rounded-full bg-gradient-to-r from-accent to-accent-dim transition-all duration-300`,style:{width:`${n}%`}})}),n!==null&&(0,x.jsxs)(`div`,{className:`flex justify-between mt-1.5 text-[10px] text-text-muted font-mono`,children:[(0,x.jsxs)(`span`,{children:[n,`%`]}),(0,x.jsxs)(`span`,{children:[t.total.toLocaleString(),` total`]})]})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-accent animate-bounce [animation-delay:-0.3s]`}),(0,x.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-accent animate-bounce [animation-delay:-0.15s]`}),(0,x.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-accent animate-bounce`})]})]}),(0,x.jsx)(`style`,{children:`
12
+ @keyframes shimmer {
13
+ 0% { transform: translateX(-100%); }
14
+ 100% { transform: translateX(300%); }
15
+ }
16
+ `})]})}var P=o(((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?v(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}x(e,t,a,{once:!0}),t!==`error`&&b(e,i,{once:!0})})}function b(e,t,n){typeof e.on==`function`&&x(e,`error`,t,n)}function x(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}}))();function F(){let e=arguments[0];for(let t=1,n=arguments.length;t<n;t++)if(arguments[t])for(let n in arguments[t])e[n]=arguments[t][n];return e}var I=F;typeof Object.assign==`function`&&(I=Object.assign);function ne(e,t,n,r){let i=e._nodes.get(t),a=null;return i&&(a=r===`mixed`?i.out&&i.out[n]||i.undirected&&i.undirected[n]:r===`directed`?i.out&&i.out[n]:i.undirected&&i.undirected[n]),a}function L(e){return typeof e==`object`&&!!e}function re(e){let t;for(t in e)return!1;return!0}function R(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function z(e,t,n){let r={enumerable:!0,configurable:!0};typeof n==`function`?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(e,t,r)}function ie(e){return!(!L(e)||e.attributes&&!Array.isArray(e.attributes))}function B(){let e=Math.floor(Math.random()*256)&255;return()=>e++}function V(){let e=arguments,t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done){t=null;continue}break}while(!0);return r}}}function H(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}var ae=class extends Error{constructor(e){super(),this.name=`GraphError`,this.message=e}},U=class e extends ae{constructor(t){super(t),this.name=`InvalidArgumentsGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},W=class e extends ae{constructor(t){super(t),this.name=`NotFoundGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},G=class e extends ae{constructor(t){super(t),this.name=`UsageGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}};function oe(e,t){this.key=e,this.attributes=t,this.clear()}oe.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function se(e,t){this.key=e,this.attributes=t,this.clear()}se.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function ce(e,t){this.key=e,this.attributes=t,this.clear()}ce.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function le(e,t,n,r,i){this.key=t,this.attributes=i,this.undirected=e,this.source=n,this.target=r}le.prototype.attach=function(){let e=`out`,t=`in`;this.undirected&&(e=t=`undirected`);let n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)},le.prototype.attachMulti=function(){let e=`out`,t=`in`,n=this.source.key,r=this.target.key;this.undirected&&(e=t=`undirected`);let i=this.source[e],a=i[r];if(a===void 0){i[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}a.previous=this,this.next=a,i[r]=this,this.target[t][n]=this},le.prototype.detach=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),delete this.source[n][t],delete this.target[r][e]},le.prototype.detachMulti=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};var ue=0,de=1,fe=2,pe=3;function me(e,t,n,r,i,a,o){let s,c,l,u;if(r=``+r,n===ue){if(s=e._nodes.get(r),!s)throw new W(`Graph.${t}: could not find the "${r}" node in the graph.`);l=i,u=a}else if(n===pe){if(i=``+i,c=e._edges.get(i),!c)throw new W(`Graph.${t}: could not find the "${i}" edge in the graph.`);let n=c.source.key,d=c.target.key;if(r===n)s=c.target;else if(r===d)s=c.source;else throw new W(`Graph.${t}: the "${r}" node is not attached to the "${i}" edge (${n}, ${d}).`);l=a,u=o}else{if(c=e._edges.get(r),!c)throw new W(`Graph.${t}: could not find the "${r}" edge in the graph.`);s=n===de?c.source:c.target,l=i,u=a}return[s,l,u]}function he(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=me(this,t,n,e,r,i);return a.attributes[o]}}function ge(e,t,n){e.prototype[t]=function(e,r){let[i]=me(this,t,n,e,r);return i.attributes}}function _e(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=me(this,t,n,e,r,i);return a.attributes.hasOwnProperty(o)}}function ve(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=me(this,t,n,e,r,i,a);return o.attributes[s]=c,this.emit(`nodeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:s}),this}}function ye(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=me(this,t,n,e,r,i,a);if(typeof c!=`function`)throw new U(`Graph.${t}: updater should be a function.`);let l=o.attributes;return l[s]=c(l[s]),this.emit(`nodeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:s}),this}}function be(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=me(this,t,n,e,r,i);return delete a.attributes[o],this.emit(`nodeAttributesUpdated`,{key:a.key,type:`remove`,attributes:a.attributes,name:o}),this}}function xe(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=me(this,t,n,e,r,i);if(!L(o))throw new U(`Graph.${t}: provided attributes are not a plain object.`);return a.attributes=o,this.emit(`nodeAttributesUpdated`,{key:a.key,type:`replace`,attributes:a.attributes}),this}}function Se(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=me(this,t,n,e,r,i);if(!L(o))throw new U(`Graph.${t}: provided attributes are not a plain object.`);return I(a.attributes,o),this.emit(`nodeAttributesUpdated`,{key:a.key,type:`merge`,attributes:a.attributes,data:o}),this}}function Ce(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=me(this,t,n,e,r,i);if(typeof o!=`function`)throw new U(`Graph.${t}: provided updater is not a function.`);return a.attributes=o(a.attributes),this.emit(`nodeAttributesUpdated`,{key:a.key,type:`update`,attributes:a.attributes}),this}}var we=[{name:e=>`get${e}Attribute`,attacher:he},{name:e=>`get${e}Attributes`,attacher:ge},{name:e=>`has${e}Attribute`,attacher:_e},{name:e=>`set${e}Attribute`,attacher:ve},{name:e=>`update${e}Attribute`,attacher:ye},{name:e=>`remove${e}Attribute`,attacher:be},{name:e=>`replace${e}Attributes`,attacher:xe},{name:e=>`merge${e}Attributes`,attacher:Se},{name:e=>`update${e}Attributes`,attacher:Ce}];function Te(e){we.forEach(function({name:t,attacher:n}){n(e,t(`Node`),ue),n(e,t(`Source`),de),n(e,t(`Target`),fe),n(e,t(`Opposite`),pe)})}function Ee(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new G(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new G(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=ne(this,a,o,n),!i)throw new W(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new G(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new W(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return i.attributes[r]}}function De(e,t,n){e.prototype[t]=function(e){let r;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new G(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new G(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let i=``+e,a=``+arguments[1];if(r=ne(this,i,a,n),!r)throw new W(`Graph.${t}: could not find an edge for the given path ("${i}" - "${a}").`)}else{if(n!==`mixed`)throw new G(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,r=this._edges.get(e),!r)throw new W(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return r.attributes}}function Oe(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new G(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new G(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=ne(this,a,o,n),!i)throw new W(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new G(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new W(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return i.attributes.hasOwnProperty(r)}}function ke(e,t,n){e.prototype[t]=function(e,r,i){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new G(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new G(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],i=arguments[3],a=ne(this,o,s,n),!a)throw new W(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new G(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new W(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return a.attributes[r]=i,this.emit(`edgeAttributesUpdated`,{key:a.key,type:`set`,attributes:a.attributes,name:r}),this}}function Ae(e,t,n){e.prototype[t]=function(e,r,i){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new G(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new G(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],i=arguments[3],a=ne(this,o,s,n),!a)throw new W(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new G(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new W(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof i!=`function`)throw new U(`Graph.${t}: updater should be a function.`);return a.attributes[r]=i(a.attributes[r]),this.emit(`edgeAttributesUpdated`,{key:a.key,type:`set`,attributes:a.attributes,name:r}),this}}function je(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new G(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new G(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=ne(this,a,o,n),!i)throw new W(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new G(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new W(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return delete i.attributes[r],this.emit(`edgeAttributesUpdated`,{key:i.key,type:`remove`,attributes:i.attributes,name:r}),this}}function Me(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new G(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new G(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=ne(this,a,o,n),!i)throw new W(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new G(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new W(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!L(r))throw new U(`Graph.${t}: provided attributes are not a plain object.`);return i.attributes=r,this.emit(`edgeAttributesUpdated`,{key:i.key,type:`replace`,attributes:i.attributes}),this}}function Ne(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new G(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new G(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=ne(this,a,o,n),!i)throw new W(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new G(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new W(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!L(r))throw new U(`Graph.${t}: provided attributes are not a plain object.`);return I(i.attributes,r),this.emit(`edgeAttributesUpdated`,{key:i.key,type:`merge`,attributes:i.attributes,data:r}),this}}function Pe(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new G(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new G(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=ne(this,a,o,n),!i)throw new W(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new G(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new W(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof r!=`function`)throw new U(`Graph.${t}: provided updater is not a function.`);return i.attributes=r(i.attributes),this.emit(`edgeAttributesUpdated`,{key:i.key,type:`update`,attributes:i.attributes}),this}}var Fe=[{name:e=>`get${e}Attribute`,attacher:Ee},{name:e=>`get${e}Attributes`,attacher:De},{name:e=>`has${e}Attribute`,attacher:Oe},{name:e=>`set${e}Attribute`,attacher:ke},{name:e=>`update${e}Attribute`,attacher:Ae},{name:e=>`remove${e}Attribute`,attacher:je},{name:e=>`replace${e}Attributes`,attacher:Me},{name:e=>`merge${e}Attributes`,attacher:Ne},{name:e=>`update${e}Attributes`,attacher:Pe}];function Ie(e){Fe.forEach(function({name:t,attacher:n}){n(e,t(`Edge`),`mixed`),n(e,t(`DirectedEdge`),`directed`),n(e,t(`UndirectedEdge`),`undirected`)})}var Le=[{name:`edges`,type:`mixed`},{name:`inEdges`,type:`directed`,direction:`in`},{name:`outEdges`,type:`directed`,direction:`out`},{name:`inboundEdges`,type:`mixed`,direction:`in`},{name:`outboundEdges`,type:`mixed`,direction:`out`},{name:`directedEdges`,type:`directed`},{name:`undirectedEdges`,type:`undirected`}];function Re(e,t,n,r){let i=!1;for(let a in t){if(a===r)continue;let o=t[a];if(i=n(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),e&&i)return o.key}}function ze(e,t,n,r){let i,a,o,s=!1;for(let c in t)if(c!==r){i=t[c];do{if(a=i.source,o=i.target,s=n(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected),e&&s)return i.key;i=i.next}while(i!==void 0)}}function Be(e,t){let n=Object.keys(e),r=n.length,i,a=0;return{[Symbol.iterator](){return this},next(){do if(i)i=i.next;else{if(a>=r)return{done:!0};let o=n[a++];if(o===t){i=void 0;continue}i=e[o]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}}}}function Ve(e,t,n,r){let i=t[n];if(!i)return;let a=i.source,o=i.target;if(r(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected)&&e)return i.key}function He(e,t,n,r){let i=t[n];if(!i)return;let a=!1;do{if(a=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),e&&a)return i.key;i=i.next}while(i!==void 0)}function Ue(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};let e={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:e}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function We(e,t){if(e.size===0)return[];if(t===`mixed`||t===e.type)return Array.from(e._edges.keys());let n=t===`undirected`?e.undirectedSize:e.directedSize,r=Array(n),i=t===`undirected`,a=e._edges.values(),o=0,s,c;for(;s=a.next(),s.done!==!0;)c=s.value,c.undirected===i&&(r[o++]=c.key);return r}function Ge(e,t,n,r){if(t.size===0)return;let i=n!==`mixed`&&n!==t.type,a=n===`undirected`,o,s,c=!1,l=t._edges.values();for(;o=l.next(),o.done!==!0;){if(s=o.value,i&&s.undirected!==a)continue;let{key:t,attributes:n,source:l,target:u}=s;if(c=r(t,n,l.key,u.key,l.attributes,u.attributes,s.undirected),e&&c)return t}}function Ke(e,t){if(e.size===0)return H();let n=t!==`mixed`&&t!==e.type,r=t===`undirected`,i=e._edges.values();return{[Symbol.iterator](){return this},next(){let e,t;for(;;){if(e=i.next(),e.done)return e;if(t=e.value,!(n&&t.undirected!==r))break}return{value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected},done:!1}}}}function qe(e,t,n,r,i,a){let o=t?ze:Re,s;if(n!==`undirected`&&(r!==`out`&&(s=o(e,i.in,a),e&&s)||r!==`in`&&(s=o(e,i.out,a,r?void 0:i.key),e&&s))||n!==`directed`&&(s=o(e,i.undirected,a),e&&s))return s}function Je(e,t,n,r){let i=[];return qe(!1,e,t,n,r,function(e){i.push(e)}),i}function Ye(e,t,n){let r=H();return e!==`undirected`&&(t!==`out`&&n.in!==void 0&&(r=V(r,Be(n.in))),t!==`in`&&n.out!==void 0&&(r=V(r,Be(n.out,t?void 0:n.key)))),e!==`directed`&&n.undirected!==void 0&&(r=V(r,Be(n.undirected))),r}function Xe(e,t,n,r,i,a,o){let s=n?He:Ve,c;if(t!==`undirected`&&(i.in!==void 0&&r!==`out`&&(c=s(e,i.in,a,o),e&&c)||i.out!==void 0&&r!==`in`&&(r||i.key!==a)&&(c=s(e,i.out,a,o),e&&c))||t!==`directed`&&i.undirected!==void 0&&(c=s(e,i.undirected,a,o),e&&c))return c}function Ze(e,t,n,r,i){let a=[];return Xe(!1,e,t,n,r,i,function(e){a.push(e)}),a}function Qe(e,t,n,r){let i=H();return e!==`undirected`&&(n.in!==void 0&&t!==`out`&&r in n.in&&(i=V(i,Ue(n.in,r))),n.out!==void 0&&t!==`in`&&r in n.out&&(t||n.key!==r)&&(i=V(i,Ue(n.out,r)))),e!==`directed`&&n.undirected!==void 0&&r in n.undirected&&(i=V(i,Ue(n.undirected,r))),i}function $e(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return[];if(!arguments.length)return We(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new W(`Graph.${n}: could not find the "${e}" node in the graph.`);return Je(this.multi,r===`mixed`?this.type:r,i,t)}if(arguments.length===2){e=``+e,t=``+t;let a=this._nodes.get(e);if(!a)throw new W(`Graph.${n}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new W(`Graph.${n}: could not find the "${t}" target node in the graph.`);return Ze(r,this.multi,i,a,t)}throw new U(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function et(e,t){let{name:n,type:r,direction:i}=t,a=`forEach`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if(!(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)){if(arguments.length===1)return n=e,Ge(!1,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new W(`Graph.${a}: could not find the "${e}" node in the graph.`);return qe(!1,this.multi,r===`mixed`?this.type:r,i,o,n)}if(arguments.length===3){e=``+e,t=``+t;let o=this._nodes.get(e);if(!o)throw new W(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new W(`Graph.${a}: could not find the "${t}" target node in the graph.`);return Xe(!1,r,this.multi,i,o,t,n)}throw new U(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};let o=`map`+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n;if(e.length===0){let i=0;r!==`directed`&&(i+=this.undirectedSize),r!==`undirected`&&(i+=this.directedSize),n=Array(i);let a=0;e.push((e,r,i,o,s,c,l)=>{n[a++]=t(e,r,i,o,s,c,l)})}else n=[],e.push((e,r,i,a,o,s,c)=>{n.push(t(e,r,i,a,o,s,c))});return this[a].apply(this,e),n};let s=`filter`+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n=[];return e.push((e,r,i,a,o,s,c)=>{t(e,r,i,a,o,s,c)&&n.push(e)}),this[a].apply(this,e),n};let c=`reduce`+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){let e=Array.prototype.slice.call(arguments);if(e.length<2||e.length>4)throw new U(`Graph.${c}: invalid number of arguments (expecting 2, 3 or 4 and got ${e.length}).`);if(typeof e[e.length-1]==`function`&&typeof e[e.length-2]!=`function`)throw new U(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let t,n;e.length===2?(t=e[0],n=e[1],e=[]):e.length===3?(t=e[1],n=e[2],e=[e[0]]):e.length===4&&(t=e[2],n=e[3],e=[e[0],e[1]]);let r=n;return e.push((e,n,i,a,o,s,c)=>{r=t(r,e,n,i,a,o,s,c)}),this[a].apply(this,e),r}}function tt(e,t){let{name:n,type:r,direction:i}=t,a=`find`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return!1;if(arguments.length===1)return n=e,Ge(!0,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new W(`Graph.${a}: could not find the "${e}" node in the graph.`);return qe(!0,this.multi,r===`mixed`?this.type:r,i,o,n)}if(arguments.length===3){e=``+e,t=``+t;let o=this._nodes.get(e);if(!o)throw new W(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new W(`Graph.${a}: could not find the "${t}" target node in the graph.`);return Xe(!0,r,this.multi,i,o,t,n)}throw new U(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};let o=`some`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>t(e,n,r,i,a,o,s)),!!this[a].apply(this,e)};let s=`every`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>!t(e,n,r,i,a,o,s)),!this[a].apply(this,e)}}function nt(e,t){let{name:n,type:r,direction:i}=t,a=n.slice(0,-1)+`Entries`;e.prototype[a]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return H();if(!arguments.length)return Ke(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(!t)throw new W(`Graph.${a}: could not find the "${e}" node in the graph.`);return Ye(r,i,t)}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new W(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new W(`Graph.${a}: could not find the "${t}" target node in the graph.`);return Qe(r,i,n,t)}throw new U(`Graph.${a}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function rt(e){Le.forEach(t=>{$e(e,t),et(e,t),tt(e,t),nt(e,t)})}var it=[{name:`neighbors`,type:`mixed`},{name:`inNeighbors`,type:`directed`,direction:`in`},{name:`outNeighbors`,type:`directed`,direction:`out`},{name:`inboundNeighbors`,type:`mixed`,direction:`in`},{name:`outboundNeighbors`,type:`mixed`,direction:`out`},{name:`directedNeighbors`,type:`directed`},{name:`undirectedNeighbors`,type:`undirected`}];function at(){this.A=null,this.B=null}at.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)},at.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function ot(e,t,n,r,i){for(let a in r){let o=r[a],s=o.source,c=o.target,l=s===n?c:s;if(t&&t.has(l.key))continue;let u=i(l.key,l.attributes);if(e&&u)return l.key}}function st(e,t,n,r,i){if(t!==`mixed`){if(t===`undirected`)return ot(e,null,r,r.undirected,i);if(typeof n==`string`)return ot(e,null,r,r[n],i)}let a=new at,o;if(t!==`undirected`){if(n!==`out`){if(o=ot(e,null,r,r.in,i),e&&o)return o;a.wrap(r.in)}if(n!==`in`){if(o=ot(e,a,r,r.out,i),e&&o)return o;a.wrap(r.out)}}if(t!==`directed`&&(o=ot(e,a,r,r.undirected,i),e&&o))return o}function ct(e,t,n){if(e!==`mixed`){if(e===`undirected`)return Object.keys(n.undirected);if(typeof t==`string`)return Object.keys(n[t])}let r=[];return st(!1,e,t,n,function(e){r.push(e)}),r}function lt(e,t,n){let r=Object.keys(n),i=r.length,a=0;return{[Symbol.iterator](){return this},next(){let o=null;do{if(a>=i)return e&&e.wrap(n),{done:!0};let s=n[r[a++]],c=s.source,l=s.target;if(o=c===t?l:c,e&&e.has(o.key)){o=null;continue}}while(o===null);return{done:!1,value:{neighbor:o.key,attributes:o.attributes}}}}}function ut(e,t,n){if(e!==`mixed`){if(e===`undirected`)return lt(null,n,n.undirected);if(typeof t==`string`)return lt(null,n,n[t])}let r=H(),i=new at;return e!==`undirected`&&(t!==`out`&&(r=V(r,lt(i,n,n.in))),t!==`in`&&(r=V(r,lt(i,n,n.out)))),e!==`directed`&&(r=V(r,lt(i,n,n.undirected))),r}function dt(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(e){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return[];e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new W(`Graph.${n}: could not find the "${e}" node in the graph.`);return ct(r===`mixed`?this.type:r,i,t)}}function ft(e,t){let{name:n,type:r,direction:i}=t,a=`forEach`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new W(`Graph.${a}: could not find the "${e}" node in the graph.`);st(!1,r===`mixed`?this.type:r,i,n,t)};let o=`map`+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(e,t){let n=[];return this[a](e,(e,r)=>{n.push(t(e,r))}),n};let s=`filter`+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(e,t){let n=[];return this[a](e,(e,r)=>{t(e,r)&&n.push(e)}),n};let c=`reduce`+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(e,t,n){if(arguments.length<3)throw new U(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let r=n;return this[a](e,(e,n)=>{r=t(r,e,n)}),r}}function pt(e,t){let{name:n,type:r,direction:i}=t,a=n[0].toUpperCase()+n.slice(1,-1),o=`find`+a;e.prototype[o]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new W(`Graph.${o}: could not find the "${e}" node in the graph.`);return st(!0,r===`mixed`?this.type:r,i,n,t)};let s=`some`+a;e.prototype[s]=function(e,t){return!!this[o](e,t)};let c=`every`+a;e.prototype[c]=function(e,t){return!this[o](e,(e,n)=>!t(e,n))}}function mt(e,t){let{name:n,type:r,direction:i}=t,a=n.slice(0,-1)+`Entries`;e.prototype[a]=function(e){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return H();e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new W(`Graph.${a}: could not find the "${e}" node in the graph.`);return ut(r===`mixed`?this.type:r,i,t)}}function ht(e){it.forEach(t=>{dt(e,t),ft(e,t),pt(e,t),mt(e,t)})}function gt(e,t,n,r,i){let a=r._nodes.values(),o=r.type,s,c,l,u,d,f,p;for(;s=a.next(),s.done!==!0;){let r=!1;if(c=s.value,o!==`undirected`)for(l in u=c.out,u){d=u[l];do{if(f=d.target,r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}if(o!==`directed`){for(l in u=c.undirected,u)if(!(t&&c.key>l)){d=u[l];do{if(f=d.target,f.key!==l&&(f=d.source),r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}}if(n&&!r&&(p=i(c.key,null,c.attributes,null,null,null,null),e&&p))return null}}function _t(e,t){let n={key:e};return re(t.attributes)||(n.attributes=I({},t.attributes)),n}function vt(e,t,n){let r={key:t,source:n.source.key,target:n.target.key};return re(n.attributes)||(r.attributes=I({},n.attributes)),e===`mixed`&&n.undirected&&(r.undirected=!0),r}function yt(e){if(!L(e))throw new U(`Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.`);if(!(`key`in e))throw new U(`Graph.import: serialized node is missing its key.`);if(`attributes`in e&&(!L(e.attributes)||e.attributes===null))throw new U(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`)}function bt(e){if(!L(e))throw new U(`Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.`);if(!(`source`in e))throw new U(`Graph.import: serialized edge is missing its source.`);if(!(`target`in e))throw new U(`Graph.import: serialized edge is missing its target.`);if(`attributes`in e&&(!L(e.attributes)||e.attributes===null))throw new U(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`);if(`undirected`in e&&typeof e.undirected!=`boolean`)throw new U(`Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.`)}var xt=B(),St=new Set([`directed`,`undirected`,`mixed`]),Ct=new Set([`domain`,`_events`,`_eventsCount`,`_maxListeners`]),wt=[{name:e=>`${e}Edge`,generateKey:!0},{name:e=>`${e}DirectedEdge`,generateKey:!0,type:`directed`},{name:e=>`${e}UndirectedEdge`,generateKey:!0,type:`undirected`},{name:e=>`${e}EdgeWithKey`},{name:e=>`${e}DirectedEdgeWithKey`,type:`directed`},{name:e=>`${e}UndirectedEdgeWithKey`,type:`undirected`}],Tt={allowSelfLoops:!0,multi:!1,type:`mixed`};function Et(e,t,n){if(n&&!L(n))throw new U(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=``+t,n||={},e._nodes.has(t))throw new G(`Graph.addNode: the "${t}" node already exist in the graph.`);let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit(`nodeAdded`,{key:t,attributes:n}),r}function Dt(e,t,n){let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit(`nodeAdded`,{key:t,attributes:n}),r}function Ot(e,t,n,r,i,a,o,s){if(!r&&e.type===`undirected`)throw new G(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type===`directed`)throw new G(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(s&&!L(s))throw new U(`Graph.${t}: invalid attributes. Expecting an object but got "${s}"`);if(a=``+a,o=``+o,s||={},!e.allowSelfLoops&&a===o)throw new G(`Graph.${t}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let c=e._nodes.get(a),l=e._nodes.get(o);if(!c)throw new W(`Graph.${t}: source node "${a}" not found.`);if(!l)throw new W(`Graph.${t}: target node "${o}" not found.`);let u={key:null,undirected:r,source:a,target:o,attributes:s};if(n)i=e._edgeKeyGenerator();else if(i=``+i,e._edges.has(i))throw new G(`Graph.${t}: the "${i}" edge already exists in the graph.`);if(!e.multi&&(r?c.undirected[o]!==void 0:c.out[o]!==void 0))throw new G(`Graph.${t}: an edge linking "${a}" to "${o}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);let d=new le(r,i,c,l,s);e._edges.set(i,d);let f=a===o;return r?(c.undirectedDegree++,l.undirectedDegree++,f&&(c.undirectedLoops++,e._undirectedSelfLoopCount++)):(c.outDegree++,l.inDegree++,f&&(c.directedLoops++,e._directedSelfLoopCount++)),e.multi?d.attachMulti():d.attach(),r?e._undirectedSize++:e._directedSize++,u.key=i,e.emit(`edgeAdded`,u),i}function kt(e,t,n,r,i,a,o,s,c){if(!r&&e.type===`undirected`)throw new G(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type===`directed`)throw new G(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(s){if(c){if(typeof s!=`function`)throw new U(`Graph.${t}: invalid updater function. Expecting a function but got "${s}"`)}else if(!L(s))throw new U(`Graph.${t}: invalid attributes. Expecting an object but got "${s}"`)}a=``+a,o=``+o;let l;if(c&&(l=s,s=void 0),!e.allowSelfLoops&&a===o)throw new G(`Graph.${t}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let u=e._nodes.get(a),d=e._nodes.get(o),f,p;if(!n&&(f=e._edges.get(i),f)){if((f.source.key!==a||f.target.key!==o)&&(!r||f.source.key!==o||f.target.key!==a))throw new G(`Graph.${t}: inconsistency detected when attempting to merge the "${i}" edge with "${a}" source & "${o}" target vs. ("${f.source.key}", "${f.target.key}").`);p=f}if(!p&&!e.multi&&u&&(p=r?u.undirected[o]:u.out[o]),p){let t=[p.key,!1,!1,!1];if(c?!l:!s)return t;if(c){let t=p.attributes;p.attributes=l(t),e.emit(`edgeAttributesUpdated`,{type:`replace`,key:p.key,attributes:p.attributes})}else I(p.attributes,s),e.emit(`edgeAttributesUpdated`,{type:`merge`,key:p.key,attributes:p.attributes,data:s});return t}s||={},c&&l&&(s=l(s));let m={key:null,undirected:r,source:a,target:o,attributes:s};if(n)i=e._edgeKeyGenerator();else if(i=``+i,e._edges.has(i))throw new G(`Graph.${t}: the "${i}" edge already exists in the graph.`);let h=!1,g=!1;u||(u=Dt(e,a,{}),h=!0,a===o&&(d=u,g=!0)),d||(d=Dt(e,o,{}),g=!0),f=new le(r,i,u,d,s),e._edges.set(i,f);let _=a===o;return r?(u.undirectedDegree++,d.undirectedDegree++,_&&(u.undirectedLoops++,e._undirectedSelfLoopCount++)):(u.outDegree++,d.inDegree++,_&&(u.directedLoops++,e._directedSelfLoopCount++)),e.multi?f.attachMulti():f.attach(),r?e._undirectedSize++:e._directedSize++,m.key=i,e.emit(`edgeAdded`,m),[i,!0,h,g]}function At(e,t){e._edges.delete(t.key);let{source:n,target:r,attributes:i}=t,a=t.undirected,o=n===r;a?(n.undirectedDegree--,r.undirectedDegree--,o&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,o&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),a?e._undirectedSize--:e._directedSize--,e.emit(`edgeDropped`,{key:t.key,attributes:i,source:n.key,target:r.key,undirected:a})}var K=class e extends P.EventEmitter{constructor(e){if(super(),e=I({},Tt,e),typeof e.multi!=`boolean`)throw new U(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!St.has(e.type))throw new U(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!=`boolean`)throw new U(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);let t=e.type===`mixed`?oe:e.type===`directed`?se:ce;R(this,`NodeDataClass`,t);let n=`geid_`+xt()+`_`,r=0;R(this,`_attributes`,{}),R(this,`_nodes`,new Map),R(this,`_edges`,new Map),R(this,`_directedSize`,0),R(this,`_undirectedSize`,0),R(this,`_directedSelfLoopCount`,0),R(this,`_undirectedSelfLoopCount`,0),R(this,`_edgeKeyGenerator`,()=>{let e;do e=n+ r++;while(this._edges.has(e));return e}),R(this,`_options`,e),Ct.forEach(e=>R(this,e,this[e])),z(this,`order`,()=>this._nodes.size),z(this,`size`,()=>this._edges.size),z(this,`directedSize`,()=>this._directedSize),z(this,`undirectedSize`,()=>this._undirectedSize),z(this,`selfLoopCount`,()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),z(this,`directedSelfLoopCount`,()=>this._directedSelfLoopCount),z(this,`undirectedSelfLoopCount`,()=>this._undirectedSelfLoopCount),z(this,`multi`,this._options.multi),z(this,`type`,this._options.type),z(this,`allowSelfLoops`,this._options.allowSelfLoops),z(this,`implementation`,()=>`graphology`)}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(``+e)}hasDirectedEdge(e,t){if(this.type===`undirected`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&!n.undirected}else if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out.hasOwnProperty(t):!1}throw new U(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,t){if(this.type===`directed`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&n.undirected}else if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.undirected.hasOwnProperty(t):!1}throw new U(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,t){if(arguments.length===1){let t=``+e;return this._edges.has(t)}else if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out!==void 0&&n.out.hasOwnProperty(t)||n.undirected!==void 0&&n.undirected.hasOwnProperty(t):!1}throw new U(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,t){if(this.type===`undirected`)return;if(e=``+e,t=``+t,this.multi)throw new G(`Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new W(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new W(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);let r=n.out&&n.out[t]||void 0;if(r)return r.key}undirectedEdge(e,t){if(this.type===`directed`)return;if(e=``+e,t=``+t,this.multi)throw new G(`Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new W(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new W(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);let r=n.undirected&&n.undirected[t]||void 0;if(r)return r.key}edge(e,t){if(this.multi)throw new G(`Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.`);e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new W(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new W(`Graph.edge: could not find the "${t}" target node in the graph.`);let r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key}areDirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new W(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.in||t in n.out}areOutNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new W(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.out}areInNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new W(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.in}areUndirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new W(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type===`directed`?!1:t in n.undirected}areNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new W(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&(t in n.in||t in n.out)||this.type!==`directed`&&t in n.undirected}areInboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new W(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.in||this.type!==`directed`&&t in n.undirected}areOutboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new W(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.out||this.type!==`directed`&&t in n.undirected}inDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new W(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree}outDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new W(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree}directedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new W(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree}undirectedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new W(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree}inboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new W(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree),n}outboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new W(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.outDegree),n}degree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new W(`Graph.degree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree),n}inDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new W(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new W(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new W(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new W(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new W(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree,r+=t.directedLoops),n-r}outboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new W(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.outDegree,r+=t.directedLoops),n-r}degreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new W(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree,r+=t.directedLoops*2),n-r}source(e){e=``+e;let t=this._edges.get(e);if(!t)throw new W(`Graph.source: could not find the "${e}" edge in the graph.`);return t.source.key}target(e){e=``+e;let t=this._edges.get(e);if(!t)throw new W(`Graph.target: could not find the "${e}" edge in the graph.`);return t.target.key}extremities(e){e=``+e;let t=this._edges.get(e);if(!t)throw new W(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(e,t){e=``+e,t=``+t;let n=this._edges.get(t);if(!n)throw new W(`Graph.opposite: could not find the "${t}" edge in the graph.`);let r=n.source.key,i=n.target.key;if(e===r)return i;if(e===i)return r;throw new W(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${r}, ${i}).`)}hasExtremity(e,t){e=``+e,t=``+t;let n=this._edges.get(e);if(!n)throw new W(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return n.source.key===t||n.target.key===t}isUndirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new W(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return t.undirected}isDirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new W(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!t.undirected}isSelfLoop(e){e=``+e;let t=this._edges.get(e);if(!t)throw new W(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return Et(this,e,t).key}mergeNode(e,t){if(t&&!L(t))throw new U(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=``+e,t||={};let n=this._nodes.get(e);return n?(t&&(I(n.attributes,t),this.emit(`nodeAttributesUpdated`,{type:`merge`,key:e,attributes:n.attributes,data:t})),[e,!1]):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit(`nodeAdded`,{key:e,attributes:t}),[e,!0])}updateNode(e,t){if(t&&typeof t!=`function`)throw new U(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=``+e;let n=this._nodes.get(e);if(n){if(t){let r=n.attributes;n.attributes=t(r),this.emit(`nodeAttributesUpdated`,{type:`replace`,key:e,attributes:n.attributes})}return[e,!1]}let r=t?t({}):{};return n=new this.NodeDataClass(e,r),this._nodes.set(e,n),this.emit(`nodeAdded`,{key:e,attributes:r}),[e,!0]}dropNode(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new W(`Graph.dropNode: could not find the "${e}" node in the graph.`);let n;if(this.type!==`undirected`){for(let e in t.out){n=t.out[e];do At(this,n),n=n.next;while(n)}for(let e in t.in){n=t.in[e];do At(this,n),n=n.next;while(n)}}if(this.type!==`directed`)for(let e in t.undirected){n=t.undirected[e];do At(this,n),n=n.next;while(n)}this._nodes.delete(e),this.emit(`nodeDropped`,{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){let e=``+arguments[0],n=``+arguments[1];if(t=ne(this,e,n,this.type),!t)throw new W(`Graph.dropEdge: could not find the "${e}" -> "${n}" edge in the graph.`)}else if(e=``+e,t=this._edges.get(e),!t)throw new W(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return At(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new G(`Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new G(`Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);e=``+e,t=``+t;let n=ne(this,e,t,`directed`);if(!n)throw new W(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return At(this,n),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new G(`Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new G(`Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);let n=ne(this,e,t,`undirected`);if(!n)throw new W(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return At(this,n),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit(`cleared`)}clearEdges(){let e=this._nodes.values(),t;for(;t=e.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit(`edgesCleared`)}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,t){return this._attributes[e]=t,this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}updateAttribute(e,t){if(typeof t!=`function`)throw new U(`Graph.updateAttribute: updater should be a function.`);let n=this._attributes[e];return this._attributes[e]=t(n),this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit(`attributesUpdated`,{type:`remove`,attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!L(e))throw new U(`Graph.replaceAttributes: provided attributes are not a plain object.`);return this._attributes=e,this.emit(`attributesUpdated`,{type:`replace`,attributes:this._attributes}),this}mergeAttributes(e){if(!L(e))throw new U(`Graph.mergeAttributes: provided attributes are not a plain object.`);return I(this._attributes,e),this.emit(`attributesUpdated`,{type:`merge`,attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!=`function`)throw new U(`Graph.updateAttributes: provided updater is not a function.`);return this._attributes=e(this._attributes),this.emit(`attributesUpdated`,{type:`update`,attributes:this._attributes}),this}updateEachNodeAttributes(e,t){if(typeof e!=`function`)throw new U(`Graph.updateEachNodeAttributes: expecting an updater function.`);if(t&&!ie(t))throw new U(`Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let n=this._nodes.values(),r,i;for(;r=n.next(),r.done!==!0;)i=r.value,i.attributes=e(i.key,i.attributes);this.emit(`eachNodeAttributesUpdated`,{hints:t||null})}updateEachEdgeAttributes(e,t){if(typeof e!=`function`)throw new U(`Graph.updateEachEdgeAttributes: expecting an updater function.`);if(t&&!ie(t))throw new U(`Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let n=this._edges.values(),r,i,a,o;for(;r=n.next(),r.done!==!0;)i=r.value,a=i.source,o=i.target,i.attributes=e(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected);this.emit(`eachEdgeAttributesUpdated`,{hints:t||null})}forEachAdjacencyEntry(e){if(typeof e!=`function`)throw new U(`Graph.forEachAdjacencyEntry: expecting a callback.`);gt(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new U(`Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.`);gt(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!=`function`)throw new U(`Graph.forEachAssymetricAdjacencyEntry: expecting a callback.`);gt(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new U(`Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.`);gt(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!=`function`)throw new U(`Graph.forEachNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)}findNode(e){if(typeof e!=`function`)throw new U(`Graph.findNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return r.key}mapNodes(e){if(typeof e!=`function`)throw new U(`Graph.mapNode: expecting a callback.`);let t=this._nodes.values(),n,r,i=Array(this.order),a=0;for(;n=t.next(),n.done!==!0;)r=n.value,i[a++]=e(r.key,r.attributes);return i}someNode(e){if(typeof e!=`function`)throw new U(`Graph.someNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return!0;return!1}everyNode(e){if(typeof e!=`function`)throw new U(`Graph.everyNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,!e(r.key,r.attributes))return!1;return!0}filterNodes(e){if(typeof e!=`function`)throw new U(`Graph.filterNodes: expecting a callback.`);let t=this._nodes.values(),n,r,i=[];for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)&&i.push(r.key);return i}reduceNodes(e,t){if(typeof e!=`function`)throw new U(`Graph.reduceNodes: expecting a callback.`);if(arguments.length<2)throw new U(`Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let n=t,r=this._nodes.values(),i,a;for(;i=r.next(),i.done!==!0;)a=i.value,n=e(n,a.key,a.attributes);return n}nodeEntries(){let e=this._nodes.values();return{[Symbol.iterator](){return this},next(){let t=e.next();if(t.done)return t;let n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}}}export(){let e=Array(this._nodes.size),t=0;this._nodes.forEach((n,r)=>{e[t++]=_t(r,n)});let n=Array(this._edges.size);return t=0,this._edges.forEach((e,r)=>{n[t++]=vt(this.type,r,e)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:n}}import(t,n=!1){if(t instanceof e)return t.forEachNode((e,t)=>{n?this.mergeNode(e,t):this.addNode(e,t)}),t.forEachEdge((e,t,r,i,a,o,s)=>{n?s?this.mergeUndirectedEdgeWithKey(e,r,i,t):this.mergeDirectedEdgeWithKey(e,r,i,t):s?this.addUndirectedEdgeWithKey(e,r,i,t):this.addDirectedEdgeWithKey(e,r,i,t)}),this;if(!L(t))throw new U(`Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.`);if(t.attributes){if(!L(t.attributes))throw new U(`Graph.import: invalid attributes. Expecting a plain object.`);n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,i,a,o,s;if(t.nodes){if(a=t.nodes,!Array.isArray(a))throw new U(`Graph.import: invalid nodes. Expecting an array.`);for(r=0,i=a.length;r<i;r++){o=a[r],yt(o);let{key:e,attributes:t}=o;n?this.mergeNode(e,t):this.addNode(e,t)}}if(t.edges){let e=!1;if(this.type===`undirected`&&(e=!0),a=t.edges,!Array.isArray(a))throw new U(`Graph.import: invalid edges. Expecting an array.`);for(r=0,i=a.length;r<i;r++){s=a[r],bt(s);let{source:t,target:i,attributes:o,undirected:c=e}=s,l;`key`in s?(l=n?c?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:c?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,l.call(this,s.key,t,i,o)):(l=n?c?this.mergeUndirectedEdge:this.mergeDirectedEdge:c?this.addUndirectedEdge:this.addDirectedEdge,l.call(this,t,i,o))}}return this}nullCopy(t){let n=new e(I({},this._options,t));return n.replaceAttributes(I({},this.getAttributes())),n}emptyCopy(e){let t=this.nullCopy(e);return this._nodes.forEach((e,n)=>{let r=I({},e.attributes);e=new t.NodeDataClass(n,r),t._nodes.set(n,e)}),t}copy(e){if(e||={},typeof e.type==`string`&&e.type!==this.type&&e.type!==`mixed`)throw new G(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi==`boolean`&&e.multi!==this.multi&&e.multi!==!0)throw new G(`Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.`);if(typeof e.allowSelfLoops==`boolean`&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new G(`Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.`);let t=this.emptyCopy(e),n=this._edges.values(),r,i;for(;r=n.next(),r.done!==!0;)i=r.value,Ot(t,`copy`,!1,i.undirected,i.key,i.source.key,i.target.key,I({},i.attributes));return t}toJSON(){return this.export()}toString(){return`[object Graph]`}inspect(){let e={};this._nodes.forEach((t,n)=>{e[n]=t.attributes});let t={},n={};this._edges.forEach((e,r)=>{let i=e.undirected?`--`:`->`,a=``,o=e.source.key,s=e.target.key,c;e.undirected&&o>s&&(c=o,o=s,s=c);let l=`(${o})${i}(${s})`;r.startsWith(`geid_`)?this.multi&&(n[l]===void 0?n[l]=0:n[l]++,a+=`${n[l]}. `):a+=`[${r}]: `,a+=l,t[a]=e.attributes});let r={};for(let e in this)this.hasOwnProperty(e)&&!Ct.has(e)&&typeof this[e]!=`function`&&typeof e!=`symbol`&&(r[e]=this[e]);return r.attributes=this._attributes,r.nodes=e,r.edges=t,R(r,`constructor`,this.constructor),r}};typeof Symbol<`u`&&(K.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=K.prototype.inspect),wt.forEach(e=>{[`add`,`merge`,`update`].forEach(t=>{let n=e.name(t),r=t===`add`?Ot:kt;e.generateKey?K.prototype[n]=function(i,a,o){return r(this,n,!0,(e.type||this.type)===`undirected`,null,i,a,o,t===`update`)}:K.prototype[n]=function(i,a,o,s){return r(this,n,!1,(e.type||this.type)===`undirected`,i,a,o,s,t===`update`)}})}),Te(K),Ie(K),rt(K),ht(K);var jt=class extends K{constructor(e){let t=I({type:`directed`},e);if(`multi`in t&&t.multi!==!1)throw new U(`DirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`directed`)throw new U(`DirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},Mt=class extends K{constructor(e){let t=I({type:`undirected`},e);if(`multi`in t&&t.multi!==!1)throw new U(`UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`undirected`)throw new U(`UndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},Nt=class extends K{constructor(e){let t=I({multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new U(`MultiGraph.from: inconsistent indication that the graph should be simple in given options!`);super(t)}},Pt=class extends K{constructor(e){let t=I({type:`directed`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new U(`MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`directed`)throw new U(`MultiDirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},Ft=class extends K{constructor(e){let t=I({type:`undirected`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new U(`MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`undirected`)throw new U(`MultiUndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}};function It(e){e.from=function(t,n){let r=new e(I({},t.options,n));return r.import(t),r}}It(K),It(jt),It(Mt),It(Nt),It(Pt),It(Ft),K.Graph=K,K.DirectedGraph=jt,K.UndirectedGraph=Mt,K.MultiGraph=Nt,K.MultiDirectedGraph=Pt,K.MultiUndirectedGraph=Ft,K.InvalidArgumentsGraphError=U,K.NotFoundGraphError=W,K.UsageGraphError=G;function Lt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Rt(e){var t=Lt(e,`string`);return typeof t==`symbol`?t:t+``}function zt(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Bt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,Rt(r.key),r)}}function Vt(e,t,n){return t&&Bt(e.prototype,t),n&&Bt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ht(e){return Ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ht(e)}function Ut(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ut=function(){return!!e})()}function Wt(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Gt(e,t){if(t&&(typeof t==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Wt(e)}function Kt(e,t,n){return t=Ht(t),Gt(e,Ut()?Reflect.construct(t,n||[],Ht(e).constructor):t.apply(e,n))}function qt(e,t){return qt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qt(e,t)}function Jt(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qt(e,t)}function Yt(e){if(Array.isArray(e))return e}function Xt(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Zt(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Qt(e,t){if(e){if(typeof e==`string`)return Zt(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zt(e,t):void 0}}function $t(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
17
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function en(e,t){return Yt(e)||Xt(e,t)||Qt(e,t)||$t()}var tn={black:`#000000`,silver:`#C0C0C0`,gray:`#808080`,grey:`#808080`,white:`#FFFFFF`,maroon:`#800000`,red:`#FF0000`,purple:`#800080`,fuchsia:`#FF00FF`,green:`#008000`,lime:`#00FF00`,olive:`#808000`,yellow:`#FFFF00`,navy:`#000080`,blue:`#0000FF`,teal:`#008080`,aqua:`#00FFFF`,darkblue:`#00008B`,mediumblue:`#0000CD`,darkgreen:`#006400`,darkcyan:`#008B8B`,deepskyblue:`#00BFFF`,darkturquoise:`#00CED1`,mediumspringgreen:`#00FA9A`,springgreen:`#00FF7F`,cyan:`#00FFFF`,midnightblue:`#191970`,dodgerblue:`#1E90FF`,lightseagreen:`#20B2AA`,forestgreen:`#228B22`,seagreen:`#2E8B57`,darkslategray:`#2F4F4F`,darkslategrey:`#2F4F4F`,limegreen:`#32CD32`,mediumseagreen:`#3CB371`,turquoise:`#40E0D0`,royalblue:`#4169E1`,steelblue:`#4682B4`,darkslateblue:`#483D8B`,mediumturquoise:`#48D1CC`,indigo:`#4B0082`,darkolivegreen:`#556B2F`,cadetblue:`#5F9EA0`,cornflowerblue:`#6495ED`,rebeccapurple:`#663399`,mediumaquamarine:`#66CDAA`,dimgray:`#696969`,dimgrey:`#696969`,slateblue:`#6A5ACD`,olivedrab:`#6B8E23`,slategray:`#708090`,slategrey:`#708090`,lightslategray:`#778899`,lightslategrey:`#778899`,mediumslateblue:`#7B68EE`,lawngreen:`#7CFC00`,chartreuse:`#7FFF00`,aquamarine:`#7FFFD4`,skyblue:`#87CEEB`,lightskyblue:`#87CEFA`,blueviolet:`#8A2BE2`,darkred:`#8B0000`,darkmagenta:`#8B008B`,saddlebrown:`#8B4513`,darkseagreen:`#8FBC8F`,lightgreen:`#90EE90`,mediumpurple:`#9370DB`,darkviolet:`#9400D3`,palegreen:`#98FB98`,darkorchid:`#9932CC`,yellowgreen:`#9ACD32`,sienna:`#A0522D`,brown:`#A52A2A`,darkgray:`#A9A9A9`,darkgrey:`#A9A9A9`,lightblue:`#ADD8E6`,greenyellow:`#ADFF2F`,paleturquoise:`#AFEEEE`,lightsteelblue:`#B0C4DE`,powderblue:`#B0E0E6`,firebrick:`#B22222`,darkgoldenrod:`#B8860B`,mediumorchid:`#BA55D3`,rosybrown:`#BC8F8F`,darkkhaki:`#BDB76B`,mediumvioletred:`#C71585`,indianred:`#CD5C5C`,peru:`#CD853F`,chocolate:`#D2691E`,tan:`#D2B48C`,lightgray:`#D3D3D3`,lightgrey:`#D3D3D3`,thistle:`#D8BFD8`,orchid:`#DA70D6`,goldenrod:`#DAA520`,palevioletred:`#DB7093`,crimson:`#DC143C`,gainsboro:`#DCDCDC`,plum:`#DDA0DD`,burlywood:`#DEB887`,lightcyan:`#E0FFFF`,lavender:`#E6E6FA`,darksalmon:`#E9967A`,violet:`#EE82EE`,palegoldenrod:`#EEE8AA`,lightcoral:`#F08080`,khaki:`#F0E68C`,aliceblue:`#F0F8FF`,honeydew:`#F0FFF0`,azure:`#F0FFFF`,sandybrown:`#F4A460`,wheat:`#F5DEB3`,beige:`#F5F5DC`,whitesmoke:`#F5F5F5`,mintcream:`#F5FFFA`,ghostwhite:`#F8F8FF`,salmon:`#FA8072`,antiquewhite:`#FAEBD7`,linen:`#FAF0E6`,lightgoldenrodyellow:`#FAFAD2`,oldlace:`#FDF5E6`,magenta:`#FF00FF`,deeppink:`#FF1493`,orangered:`#FF4500`,tomato:`#FF6347`,hotpink:`#FF69B4`,coral:`#FF7F50`,darkorange:`#FF8C00`,lightsalmon:`#FFA07A`,orange:`#FFA500`,lightpink:`#FFB6C1`,pink:`#FFC0CB`,gold:`#FFD700`,peachpuff:`#FFDAB9`,navajowhite:`#FFDEAD`,moccasin:`#FFE4B5`,bisque:`#FFE4C4`,mistyrose:`#FFE4E1`,blanchedalmond:`#FFEBCD`,papayawhip:`#FFEFD5`,lavenderblush:`#FFF0F5`,seashell:`#FFF5EE`,cornsilk:`#FFF8DC`,lemonchiffon:`#FFFACD`,floralwhite:`#FFFAF0`,snow:`#FFFAFA`,lightyellow:`#FFFFE0`,ivory:`#FFFFF0`},nn=new Int8Array(4),rn=new Int32Array(nn.buffer,0,1),an=new Float32Array(nn.buffer,0,1),on=/^\s*rgba?\s*\(/,sn=/^\s*rgba?\s*\(\s*([0-9]*)\s*,\s*([0-9]*)\s*,\s*([0-9]*)(?:\s*,\s*(.*)?)?\)\s*$/;function cn(e){var t=0,n=0,r=0,i=1;if(e[0]===`#`)e.length===4?(t=parseInt(e.charAt(1)+e.charAt(1),16),n=parseInt(e.charAt(2)+e.charAt(2),16),r=parseInt(e.charAt(3)+e.charAt(3),16)):(t=parseInt(e.charAt(1)+e.charAt(2),16),n=parseInt(e.charAt(3)+e.charAt(4),16),r=parseInt(e.charAt(5)+e.charAt(6),16)),e.length===9&&(i=parseInt(e.charAt(7)+e.charAt(8),16)/255);else if(on.test(e)){var a=e.match(sn);a&&(t=+a[1],n=+a[2],r=+a[3],a[4]&&(i=+a[4]))}return{r:t,g:n,b:r,a:i}}var ln={};for(var un in tn)ln[un]=fn(tn[un]),ln[tn[un]]=ln[un];function dn(e,t,n,r,i){return rn[0]=r<<24|n<<16|t<<8|e,i&&(rn[0]&=4278190079),an[0]}function fn(e){if(e=e.toLowerCase(),ln[e]!==void 0)return ln[e];var t=cn(e),n=t.r,r=t.g,i=t.b,a=t.a;a=a*255|0;var o=dn(n,r,i,a,!0);return ln[e]=o,o}var pn={};function mn(e){if(pn[e]!==void 0)return pn[e];var t=dn((e&16711680)>>>16,(e&65280)>>>8,e&255,255,!0);return pn[e]=t,t}function hn(e,t,n,r){return n+(t<<8)+(e<<16)}function gn(e,t,n,r,i,a){var o=Math.floor(n/a*i),s=Math.floor(e.drawingBufferHeight/a-r/a*i),c=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(o,s,1,1,e.RGBA,e.UNSIGNED_BYTE,c);var l=en(c,4);return[l[0],l[1],l[2],l[3]]}function q(e,t,n){return(t=Rt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function J(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?_n(Object(n),!0).forEach(function(t){q(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_n(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vn(e,t){for(;!{}.hasOwnProperty.call(e,t)&&(e=Ht(e))!==null;);return e}function yn(){return yn=typeof Reflect<`u`&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=vn(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},yn.apply(null,arguments)}function bn(e,t,n,r){var i=yn(Ht(1&r?e.prototype:e),t,n);return 2&r&&typeof i==`function`?function(e){return i.apply(n,e)}:i}function xn(e){return e.normalized?1:e.size}function Sn(e){var t=0;return e.forEach(function(e){return t+=xn(e)}),t}function Cn(e,t,n){var r=e===`VERTEX`?t.VERTEX_SHADER:t.FRAGMENT_SHADER,i=t.createShader(r);if(i===null)throw Error(`loadShader: error while creating the shader`);if(t.shaderSource(i,n),t.compileShader(i),!t.getShaderParameter(i,t.COMPILE_STATUS)){var a=t.getShaderInfoLog(i);throw t.deleteShader(i),Error(`loadShader: error while compiling the shader:
18
+ ${a}
19
+ ${n}`)}return i}function wn(e,t){return Cn(`VERTEX`,e,t)}function Tn(e,t){return Cn(`FRAGMENT`,e,t)}function En(e,t){var n=e.createProgram();if(n===null)throw Error(`loadProgram: error while creating the program.`);var r,i;for(r=0,i=t.length;r<i;r++)e.attachShader(n,t[r]);if(e.linkProgram(n),!e.getProgramParameter(n,e.LINK_STATUS)){var a=e.getProgramInfoLog(n);throw e.deleteProgram(n),Error(`loadProgram: error while linking the program: ${a}`)}return n}function Dn(e){var t=e.gl,n=e.buffer,r=e.program,i=e.vertexShader,a=e.fragmentShader;t.deleteShader(i),t.deleteShader(a),t.deleteProgram(r),t.deleteBuffer(n)}var On=`#define PICKING_MODE
20
+ `,kn=q(q(q(q(q(q(q(q({},WebGL2RenderingContext.BOOL,1),WebGL2RenderingContext.BYTE,1),WebGL2RenderingContext.UNSIGNED_BYTE,1),WebGL2RenderingContext.SHORT,2),WebGL2RenderingContext.UNSIGNED_SHORT,2),WebGL2RenderingContext.INT,4),WebGL2RenderingContext.UNSIGNED_INT,4),WebGL2RenderingContext.FLOAT,4),An=function(){function e(t,n,r){zt(this,e),q(this,`array`,new Float32Array),q(this,`constantArray`,new Float32Array),q(this,`capacity`,0),q(this,`verticesCount`,0);var i=this.getDefinition();if(this.VERTICES=i.VERTICES,this.VERTEX_SHADER_SOURCE=i.VERTEX_SHADER_SOURCE,this.FRAGMENT_SHADER_SOURCE=i.FRAGMENT_SHADER_SOURCE,this.UNIFORMS=i.UNIFORMS,this.ATTRIBUTES=i.ATTRIBUTES,this.METHOD=i.METHOD,this.CONSTANT_ATTRIBUTES=`CONSTANT_ATTRIBUTES`in i?i.CONSTANT_ATTRIBUTES:[],this.CONSTANT_DATA=`CONSTANT_DATA`in i?i.CONSTANT_DATA:[],this.isInstanced=`CONSTANT_ATTRIBUTES`in i,this.ATTRIBUTES_ITEMS_COUNT=Sn(this.ATTRIBUTES),this.STRIDE=this.VERTICES*this.ATTRIBUTES_ITEMS_COUNT,this.renderer=r,this.normalProgram=this.getProgramInfo(`normal`,t,i.VERTEX_SHADER_SOURCE,i.FRAGMENT_SHADER_SOURCE,null),this.pickProgram=n?this.getProgramInfo(`pick`,t,On+i.VERTEX_SHADER_SOURCE,On+i.FRAGMENT_SHADER_SOURCE,n):null,this.isInstanced){var a=Sn(this.CONSTANT_ATTRIBUTES);if(this.CONSTANT_DATA.length!==this.VERTICES)throw Error(`Program: error while getting constant data (expected ${this.VERTICES} items, received ${this.CONSTANT_DATA.length} instead)`);this.constantArray=new Float32Array(this.CONSTANT_DATA.length*a);for(var o=0;o<this.CONSTANT_DATA.length;o++){var s=this.CONSTANT_DATA[o];if(s.length!==a)throw Error(`Program: error while getting constant data (one vector has ${s.length} items instead of ${a})`);for(var c=0;c<s.length;c++)this.constantArray[o*a+c]=s[c]}this.STRIDE=this.ATTRIBUTES_ITEMS_COUNT}}return Vt(e,[{key:`kill`,value:function(){Dn(this.normalProgram),this.pickProgram&&=(Dn(this.pickProgram),null)}},{key:`getProgramInfo`,value:function(e,t,n,r,i){var a=this.getDefinition(),o=t.createBuffer();if(o===null)throw Error(`Program: error while creating the WebGL buffer.`);var s=wn(t,n),c=Tn(t,r),l=En(t,[s,c]),u={};a.UNIFORMS.forEach(function(e){var n=t.getUniformLocation(l,e);n&&(u[e]=n)});var d={};a.ATTRIBUTES.forEach(function(e){d[e.name]=t.getAttribLocation(l,e.name)});var f;if(`CONSTANT_ATTRIBUTES`in a&&(a.CONSTANT_ATTRIBUTES.forEach(function(e){d[e.name]=t.getAttribLocation(l,e.name)}),f=t.createBuffer(),f===null))throw Error(`Program: error while creating the WebGL constant buffer.`);return{name:e,program:l,gl:t,frameBuffer:i,buffer:o,constantBuffer:f||{},uniformLocations:u,attributeLocations:d,isPicking:e===`pick`,vertexShader:s,fragmentShader:c}}},{key:`bindProgram`,value:function(e){var t=this,n=0,r=e.gl,i=e.buffer;this.isInstanced?(r.bindBuffer(r.ARRAY_BUFFER,e.constantBuffer),n=0,this.CONSTANT_ATTRIBUTES.forEach(function(r){return n+=t.bindAttribute(r,e,n,!1)}),r.bufferData(r.ARRAY_BUFFER,this.constantArray,r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,e.buffer),n=0,this.ATTRIBUTES.forEach(function(r){return n+=t.bindAttribute(r,e,n,!0)}),r.bufferData(r.ARRAY_BUFFER,this.array,r.DYNAMIC_DRAW)):(r.bindBuffer(r.ARRAY_BUFFER,i),n=0,this.ATTRIBUTES.forEach(function(r){return n+=t.bindAttribute(r,e,n)}),r.bufferData(r.ARRAY_BUFFER,this.array,r.DYNAMIC_DRAW)),r.bindBuffer(r.ARRAY_BUFFER,null)}},{key:`unbindProgram`,value:function(e){var t=this;this.isInstanced?(this.CONSTANT_ATTRIBUTES.forEach(function(n){return t.unbindAttribute(n,e,!1)}),this.ATTRIBUTES.forEach(function(n){return t.unbindAttribute(n,e,!0)})):this.ATTRIBUTES.forEach(function(n){return t.unbindAttribute(n,e)})}},{key:`bindAttribute`,value:function(e,t,n,r){var i=kn[e.type];if(typeof i!=`number`)throw Error(`Program.bind: yet unsupported attribute type "${e.type}"`);var a=t.attributeLocations[e.name],o=t.gl;if(a!==-1){o.enableVertexAttribArray(a);var s=this.isInstanced?(r?this.ATTRIBUTES_ITEMS_COUNT:Sn(this.CONSTANT_ATTRIBUTES))*Float32Array.BYTES_PER_ELEMENT:this.ATTRIBUTES_ITEMS_COUNT*Float32Array.BYTES_PER_ELEMENT;if(o.vertexAttribPointer(a,e.size,e.type,e.normalized||!1,s,n),this.isInstanced&&r)if(o instanceof WebGL2RenderingContext)o.vertexAttribDivisor(a,1);else{var c=o.getExtension(`ANGLE_instanced_arrays`);c&&c.vertexAttribDivisorANGLE(a,1)}}return e.size*i}},{key:`unbindAttribute`,value:function(e,t,n){var r=t.attributeLocations[e.name],i=t.gl;if(r!==-1&&(i.disableVertexAttribArray(r),this.isInstanced&&n))if(i instanceof WebGL2RenderingContext)i.vertexAttribDivisor(r,0);else{var a=i.getExtension(`ANGLE_instanced_arrays`);a&&a.vertexAttribDivisorANGLE(r,0)}}},{key:`reallocate`,value:function(e){e!==this.capacity&&(this.capacity=e,this.verticesCount=this.VERTICES*e,this.array=new Float32Array(this.isInstanced?this.capacity*this.ATTRIBUTES_ITEMS_COUNT:this.verticesCount*this.ATTRIBUTES_ITEMS_COUNT))}},{key:`hasNothingToRender`,value:function(){return this.verticesCount===0}},{key:`renderProgram`,value:function(e,t){var n=t.gl,r=t.program;n.enable(n.BLEND),n.useProgram(r),this.setUniforms(e,t),this.drawWebGL(this.METHOD,t)}},{key:`render`,value:function(e){this.hasNothingToRender()||(this.pickProgram&&(this.pickProgram.gl.viewport(0,0,e.width*e.pixelRatio/e.downSizingRatio,e.height*e.pixelRatio/e.downSizingRatio),this.bindProgram(this.pickProgram),this.renderProgram(J(J({},e),{},{pixelRatio:e.pixelRatio/e.downSizingRatio}),this.pickProgram),this.unbindProgram(this.pickProgram)),this.normalProgram.gl.viewport(0,0,e.width*e.pixelRatio,e.height*e.pixelRatio),this.bindProgram(this.normalProgram),this.renderProgram(e,this.normalProgram),this.unbindProgram(this.normalProgram))}},{key:`drawWebGL`,value:function(e,t){var n=t.gl,r=t.frameBuffer;if(n.bindFramebuffer(n.FRAMEBUFFER,r),!this.isInstanced)n.drawArrays(e,0,this.verticesCount);else if(n instanceof WebGL2RenderingContext)n.drawArraysInstanced(e,0,this.VERTICES,this.capacity);else{var i=n.getExtension(`ANGLE_instanced_arrays`);i&&i.drawArraysInstancedANGLE(e,0,this.VERTICES,this.capacity)}}}])}(),jn=function(e){function t(){return zt(this,t),Kt(this,t,arguments)}return Jt(t,e),Vt(t,[{key:`kill`,value:function(){bn(t,`kill`,this,3)([])}},{key:`process`,value:function(e,t,n){var r=t*this.STRIDE;if(n.hidden){for(var i=r+this.STRIDE;r<i;r++)this.array[r]=0;return}return this.processVisibleItem(mn(e),r,n)}}])}(An),Mn=function(e){function t(){var e;zt(this,t);var n=[...arguments];return e=Kt(this,t,[].concat(n)),q(e,`drawLabel`,void 0),e}return Jt(t,e),Vt(t,[{key:`kill`,value:function(){bn(t,`kill`,this,3)([])}},{key:`process`,value:function(e,t,n,r,i){var a=t*this.STRIDE;if(i.hidden||n.hidden||r.hidden){for(var o=a+this.STRIDE;a<o;a++)this.array[a]=0;return}return this.processVisibleItem(mn(e),a,n,r,i)}}])}(An);function Nn(e,t){return function(){function n(r,i,a){zt(this,n),q(this,`drawLabel`,t),this.programs=e.map(function(e){return new e(r,i,a)})}return Vt(n,[{key:`reallocate`,value:function(e){this.programs.forEach(function(t){return t.reallocate(e)})}},{key:`process`,value:function(e,t,n,r,i){this.programs.forEach(function(a){return a.process(e,t,n,r,i)})}},{key:`render`,value:function(e){this.programs.forEach(function(t){return t.render(e)})}},{key:`kill`,value:function(){this.programs.forEach(function(e){return e.kill()})}}])}()}function Pn(e,t,n,r,i){var a=i.edgeLabelSize,o=i.edgeLabelFont,s=i.edgeLabelWeight,c=i.edgeLabelColor.attribute?t[i.edgeLabelColor.attribute]||i.edgeLabelColor.color||`#000`:i.edgeLabelColor.color,l=t.label;if(l){e.fillStyle=c,e.font=`${s} ${a}px ${o}`;var u=n.size,d=r.size,f=n.x,p=n.y,m=r.x,h=r.y,g=(f+m)/2,_=(p+h)/2,v=m-f,y=h-p,b=Math.sqrt(v*v+y*y);if(!(b<u+d)){f+=v*u/b,p+=y*u/b,m-=v*d/b,h-=y*d/b,g=(f+m)/2,_=(p+h)/2,v=m-f,y=h-p,b=Math.sqrt(v*v+y*y);var x=e.measureText(l).width;if(x>b){var S=`…`;for(l+=S,x=e.measureText(l).width;x>b&&l.length>1;)l=l.slice(0,-2)+S,x=e.measureText(l).width;if(l.length<4)return}var C=v>0?y>0?Math.acos(v/b):Math.asin(y/b):y>0?Math.acos(v/b)+Math.PI:Math.asin(v/b)+Math.PI/2;e.save(),e.translate(g,_),e.rotate(C),e.fillText(l,-x/2,t.size/2+a),e.restore()}}}function Fn(e,t,n){if(t.label){var r=n.labelSize,i=n.labelFont,a=n.labelWeight;e.fillStyle=n.labelColor.attribute?t[n.labelColor.attribute]||n.labelColor.color||`#000`:n.labelColor.color,e.font=`${a} ${r}px ${i}`,e.fillText(t.label,t.x+t.size+3,t.y+r/3)}}function In(e,t,n){var r=n.labelSize,i=n.labelFont;e.font=`${n.labelWeight} ${r}px ${i}`,e.fillStyle=`#FFF`,e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=8,e.shadowColor=`#000`;var a=2;if(typeof t.label==`string`){var o=e.measureText(t.label).width,s=Math.round(o+5),c=Math.round(r+2*a),l=Math.max(t.size,r/2)+a,u=Math.asin(c/2/l),d=Math.sqrt(Math.abs(l**2-(c/2)**2));e.beginPath(),e.moveTo(t.x+d,t.y+c/2),e.lineTo(t.x+l+s,t.y+c/2),e.lineTo(t.x+l+s,t.y-c/2),e.lineTo(t.x+d,t.y-c/2),e.arc(t.x,t.y,l,u,-u),e.closePath(),e.fill()}else e.beginPath(),e.arc(t.x,t.y,t.size+a,0,Math.PI*2),e.closePath(),e.fill();e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,Fn(e,t,n)}var Ln=`
21
+ precision highp float;
22
+
23
+ varying vec4 v_color;
24
+ varying vec2 v_diffVector;
25
+ varying float v_radius;
26
+
27
+ uniform float u_correctionRatio;
28
+
29
+ const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
30
+
31
+ void main(void) {
32
+ float border = u_correctionRatio * 2.0;
33
+ float dist = length(v_diffVector) - v_radius + border;
34
+
35
+ // No antialiasing for picking mode:
36
+ #ifdef PICKING_MODE
37
+ if (dist > border)
38
+ gl_FragColor = transparent;
39
+ else
40
+ gl_FragColor = v_color;
41
+
42
+ #else
43
+ float t = 0.0;
44
+ if (dist > border)
45
+ t = 1.0;
46
+ else if (dist > 0.0)
47
+ t = dist / border;
48
+
49
+ gl_FragColor = mix(v_color, transparent, t);
50
+ #endif
51
+ }
52
+ `,Rn=`
53
+ attribute vec4 a_id;
54
+ attribute vec4 a_color;
55
+ attribute vec2 a_position;
56
+ attribute float a_size;
57
+ attribute float a_angle;
58
+
59
+ uniform mat3 u_matrix;
60
+ uniform float u_sizeRatio;
61
+ uniform float u_correctionRatio;
62
+
63
+ varying vec4 v_color;
64
+ varying vec2 v_diffVector;
65
+ varying float v_radius;
66
+ varying float v_border;
67
+
68
+ const float bias = 255.0 / 254.0;
69
+
70
+ void main() {
71
+ float size = a_size * u_correctionRatio / u_sizeRatio * 4.0;
72
+ vec2 diffVector = size * vec2(cos(a_angle), sin(a_angle));
73
+ vec2 position = a_position + diffVector;
74
+ gl_Position = vec4(
75
+ (u_matrix * vec3(position, 1)).xy,
76
+ 0,
77
+ 1
78
+ );
79
+
80
+ v_diffVector = diffVector;
81
+ v_radius = size / 2.0;
82
+
83
+ #ifdef PICKING_MODE
84
+ // For picking mode, we use the ID as the color:
85
+ v_color = a_id;
86
+ #else
87
+ // For normal mode, we use the color:
88
+ v_color = a_color;
89
+ #endif
90
+
91
+ v_color.a *= bias;
92
+ }
93
+ `,zn=WebGLRenderingContext,Bn=zn.UNSIGNED_BYTE,Vn=zn.FLOAT,Hn=[`u_sizeRatio`,`u_correctionRatio`,`u_matrix`],Un=function(e){function t(){return zt(this,t),Kt(this,t,arguments)}return Jt(t,e),Vt(t,[{key:`getDefinition`,value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:Rn,FRAGMENT_SHADER_SOURCE:Ln,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:Hn,ATTRIBUTES:[{name:`a_position`,size:2,type:Vn},{name:`a_size`,size:1,type:Vn},{name:`a_color`,size:4,type:Bn,normalized:!0},{name:`a_id`,size:4,type:Bn,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:`a_angle`,size:1,type:Vn}],CONSTANT_DATA:[[t.ANGLE_1],[t.ANGLE_2],[t.ANGLE_3]]}}},{key:`processVisibleItem`,value:function(e,t,n){var r=this.array,i=fn(n.color);r[t++]=n.x,r[t++]=n.y,r[t++]=n.size,r[t++]=i,r[t++]=e}},{key:`setUniforms`,value:function(e,t){var n=t.gl,r=t.uniformLocations,i=r.u_sizeRatio,a=r.u_correctionRatio,o=r.u_matrix;n.uniform1f(a,e.correctionRatio),n.uniform1f(i,e.sizeRatio),n.uniformMatrix3fv(o,!1,e.matrix)}}])}(jn);q(Un,`ANGLE_1`,0),q(Un,`ANGLE_2`,2*Math.PI/3),q(Un,`ANGLE_3`,4*Math.PI/3);var Wn=`
94
+ precision mediump float;
95
+
96
+ varying vec4 v_color;
97
+
98
+ void main(void) {
99
+ gl_FragColor = v_color;
100
+ }
101
+ `,Gn=`
102
+ attribute vec2 a_position;
103
+ attribute vec2 a_normal;
104
+ attribute float a_radius;
105
+ attribute vec3 a_barycentric;
106
+
107
+ #ifdef PICKING_MODE
108
+ attribute vec4 a_id;
109
+ #else
110
+ attribute vec4 a_color;
111
+ #endif
112
+
113
+ uniform mat3 u_matrix;
114
+ uniform float u_sizeRatio;
115
+ uniform float u_correctionRatio;
116
+ uniform float u_minEdgeThickness;
117
+ uniform float u_lengthToThicknessRatio;
118
+ uniform float u_widenessToThicknessRatio;
119
+
120
+ varying vec4 v_color;
121
+
122
+ const float bias = 255.0 / 254.0;
123
+
124
+ void main() {
125
+ float minThickness = u_minEdgeThickness;
126
+
127
+ float normalLength = length(a_normal);
128
+ vec2 unitNormal = a_normal / normalLength;
129
+
130
+ // These first computations are taken from edge.vert.glsl and
131
+ // edge.clamped.vert.glsl. Please read it to get better comments on what's
132
+ // happening:
133
+ float pixelsThickness = max(normalLength / u_sizeRatio, minThickness);
134
+ float webGLThickness = pixelsThickness * u_correctionRatio;
135
+ float webGLNodeRadius = a_radius * 2.0 * u_correctionRatio / u_sizeRatio;
136
+ float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;
137
+ float webGLArrowHeadThickness = webGLThickness * u_widenessToThicknessRatio;
138
+
139
+ float da = a_barycentric.x;
140
+ float db = a_barycentric.y;
141
+ float dc = a_barycentric.z;
142
+
143
+ vec2 delta = vec2(
144
+ da * (webGLNodeRadius * unitNormal.y)
145
+ + db * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y + webGLArrowHeadThickness * unitNormal.x)
146
+ + dc * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y - webGLArrowHeadThickness * unitNormal.x),
147
+
148
+ da * (-webGLNodeRadius * unitNormal.x)
149
+ + db * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x + webGLArrowHeadThickness * unitNormal.y)
150
+ + dc * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x - webGLArrowHeadThickness * unitNormal.y)
151
+ );
152
+
153
+ vec2 position = (u_matrix * vec3(a_position + delta, 1)).xy;
154
+
155
+ gl_Position = vec4(position, 0, 1);
156
+
157
+ #ifdef PICKING_MODE
158
+ // For picking mode, we use the ID as the color:
159
+ v_color = a_id;
160
+ #else
161
+ // For normal mode, we use the color:
162
+ v_color = a_color;
163
+ #endif
164
+
165
+ v_color.a *= bias;
166
+ }
167
+ `,Kn=WebGLRenderingContext,qn=Kn.UNSIGNED_BYTE,Jn=Kn.FLOAT,Yn=[`u_matrix`,`u_sizeRatio`,`u_correctionRatio`,`u_minEdgeThickness`,`u_lengthToThicknessRatio`,`u_widenessToThicknessRatio`],Xn={extremity:`target`,lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function Zn(e){var t=J(J({},Xn),e||{});return function(e){function n(){return zt(this,n),Kt(this,n,arguments)}return Jt(n,e),Vt(n,[{key:`getDefinition`,value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:Gn,FRAGMENT_SHADER_SOURCE:Wn,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:Yn,ATTRIBUTES:[{name:`a_position`,size:2,type:Jn},{name:`a_normal`,size:2,type:Jn},{name:`a_radius`,size:1,type:Jn},{name:`a_color`,size:4,type:qn,normalized:!0},{name:`a_id`,size:4,type:qn,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:`a_barycentric`,size:3,type:Jn}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:`processVisibleItem`,value:function(e,n,r,i,a){if(t.extremity===`source`){var o=[i,r];r=o[0],i=o[1]}var s=a.size||1,c=i.size||1,l=r.x,u=r.y,d=i.x,f=i.y,p=fn(a.color),m=d-l,h=f-u,g=m*m+h*h,_=0,v=0;g&&(g=1/Math.sqrt(g),_=-h*g*s,v=m*g*s);var y=this.array;y[n++]=d,y[n++]=f,y[n++]=-_,y[n++]=-v,y[n++]=c,y[n++]=p,y[n++]=e}},{key:`setUniforms`,value:function(e,n){var r=n.gl,i=n.uniformLocations,a=i.u_matrix,o=i.u_sizeRatio,s=i.u_correctionRatio,c=i.u_minEdgeThickness,l=i.u_lengthToThicknessRatio,u=i.u_widenessToThicknessRatio;r.uniformMatrix3fv(a,!1,e.matrix),r.uniform1f(o,e.sizeRatio),r.uniform1f(s,e.correctionRatio),r.uniform1f(c,e.minEdgeThickness),r.uniform1f(l,t.lengthToThicknessRatio),r.uniform1f(u,t.widenessToThicknessRatio)}}])}(Mn)}Zn();var Qn=`
168
+ precision mediump float;
169
+
170
+ varying vec4 v_color;
171
+ varying vec2 v_normal;
172
+ varying float v_thickness;
173
+ varying float v_feather;
174
+
175
+ const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0);
176
+
177
+ void main(void) {
178
+ // We only handle antialiasing for normal mode:
179
+ #ifdef PICKING_MODE
180
+ gl_FragColor = v_color;
181
+ #else
182
+ float dist = length(v_normal) * v_thickness;
183
+
184
+ float t = smoothstep(
185
+ v_thickness - v_feather,
186
+ v_thickness,
187
+ dist
188
+ );
189
+
190
+ gl_FragColor = mix(v_color, transparent, t);
191
+ #endif
192
+ }
193
+ `,$n=`
194
+ attribute vec4 a_id;
195
+ attribute vec4 a_color;
196
+ attribute vec2 a_normal;
197
+ attribute float a_normalCoef;
198
+ attribute vec2 a_positionStart;
199
+ attribute vec2 a_positionEnd;
200
+ attribute float a_positionCoef;
201
+ attribute float a_radius;
202
+ attribute float a_radiusCoef;
203
+
204
+ uniform mat3 u_matrix;
205
+ uniform float u_zoomRatio;
206
+ uniform float u_sizeRatio;
207
+ uniform float u_pixelRatio;
208
+ uniform float u_correctionRatio;
209
+ uniform float u_minEdgeThickness;
210
+ uniform float u_lengthToThicknessRatio;
211
+ uniform float u_feather;
212
+
213
+ varying vec4 v_color;
214
+ varying vec2 v_normal;
215
+ varying float v_thickness;
216
+ varying float v_feather;
217
+
218
+ const float bias = 255.0 / 254.0;
219
+
220
+ void main() {
221
+ float minThickness = u_minEdgeThickness;
222
+
223
+ float radius = a_radius * a_radiusCoef;
224
+ vec2 normal = a_normal * a_normalCoef;
225
+ vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;
226
+
227
+ float normalLength = length(normal);
228
+ vec2 unitNormal = normal / normalLength;
229
+
230
+ // These first computations are taken from edge.vert.glsl. Please read it to
231
+ // get better comments on what's happening:
232
+ float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);
233
+ float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;
234
+
235
+ // Here, we move the point to leave space for the arrow head:
236
+ float direction = sign(radius);
237
+ float webGLNodeRadius = direction * radius * 2.0 * u_correctionRatio / u_sizeRatio;
238
+ float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0;
239
+
240
+ vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (webGLNodeRadius + webGLArrowHeadLength);
241
+
242
+ // Here is the proper position of the vertex
243
+ gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness + compensationVector, 1)).xy, 0, 1);
244
+
245
+ v_thickness = webGLThickness / u_zoomRatio;
246
+
247
+ v_normal = unitNormal;
248
+
249
+ v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;
250
+
251
+ #ifdef PICKING_MODE
252
+ // For picking mode, we use the ID as the color:
253
+ v_color = a_id;
254
+ #else
255
+ // For normal mode, we use the color:
256
+ v_color = a_color;
257
+ #endif
258
+
259
+ v_color.a *= bias;
260
+ }
261
+ `,er=WebGLRenderingContext,tr=er.UNSIGNED_BYTE,nr=er.FLOAT,rr=[`u_matrix`,`u_zoomRatio`,`u_sizeRatio`,`u_correctionRatio`,`u_pixelRatio`,`u_feather`,`u_minEdgeThickness`,`u_lengthToThicknessRatio`],ir={lengthToThicknessRatio:Xn.lengthToThicknessRatio};function ar(e){var t=J(J({},ir),e||{});return function(e){function n(){return zt(this,n),Kt(this,n,arguments)}return Jt(n,e),Vt(n,[{key:`getDefinition`,value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:$n,FRAGMENT_SHADER_SOURCE:Qn,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:rr,ATTRIBUTES:[{name:`a_positionStart`,size:2,type:nr},{name:`a_positionEnd`,size:2,type:nr},{name:`a_normal`,size:2,type:nr},{name:`a_color`,size:4,type:tr,normalized:!0},{name:`a_id`,size:4,type:tr,normalized:!0},{name:`a_radius`,size:1,type:nr}],CONSTANT_ATTRIBUTES:[{name:`a_positionCoef`,size:1,type:nr},{name:`a_normalCoef`,size:1,type:nr},{name:`a_radiusCoef`,size:1,type:nr}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:`processVisibleItem`,value:function(e,t,n,r,i){var a=i.size||1,o=n.x,s=n.y,c=r.x,l=r.y,u=fn(i.color),d=c-o,f=l-s,p=r.size||1,m=d*d+f*f,h=0,g=0;m&&(m=1/Math.sqrt(m),h=-f*m*a,g=d*m*a);var _=this.array;_[t++]=o,_[t++]=s,_[t++]=c,_[t++]=l,_[t++]=h,_[t++]=g,_[t++]=u,_[t++]=e,_[t++]=p}},{key:`setUniforms`,value:function(e,n){var r=n.gl,i=n.uniformLocations,a=i.u_matrix,o=i.u_zoomRatio,s=i.u_feather,c=i.u_pixelRatio,l=i.u_correctionRatio,u=i.u_sizeRatio,d=i.u_minEdgeThickness,f=i.u_lengthToThicknessRatio;r.uniformMatrix3fv(a,!1,e.matrix),r.uniform1f(o,e.zoomRatio),r.uniform1f(u,e.sizeRatio),r.uniform1f(l,e.correctionRatio),r.uniform1f(c,e.pixelRatio),r.uniform1f(s,e.antiAliasingFeather),r.uniform1f(d,e.minEdgeThickness),r.uniform1f(f,t.lengthToThicknessRatio)}}])}(Mn)}ar();function or(e){return Nn([ar(e),Zn(e)])}var sr=or(),cr=`
262
+ attribute vec4 a_id;
263
+ attribute vec4 a_color;
264
+ attribute vec2 a_normal;
265
+ attribute float a_normalCoef;
266
+ attribute vec2 a_positionStart;
267
+ attribute vec2 a_positionEnd;
268
+ attribute float a_positionCoef;
269
+
270
+ uniform mat3 u_matrix;
271
+ uniform float u_sizeRatio;
272
+ uniform float u_zoomRatio;
273
+ uniform float u_pixelRatio;
274
+ uniform float u_correctionRatio;
275
+ uniform float u_minEdgeThickness;
276
+ uniform float u_feather;
277
+
278
+ varying vec4 v_color;
279
+ varying vec2 v_normal;
280
+ varying float v_thickness;
281
+ varying float v_feather;
282
+
283
+ const float bias = 255.0 / 254.0;
284
+
285
+ void main() {
286
+ float minThickness = u_minEdgeThickness;
287
+
288
+ vec2 normal = a_normal * a_normalCoef;
289
+ vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef;
290
+
291
+ float normalLength = length(normal);
292
+ vec2 unitNormal = normal / normalLength;
293
+
294
+ // We require edges to be at least "minThickness" pixels thick *on screen*
295
+ // (so we need to compensate the size ratio):
296
+ float pixelsThickness = max(normalLength, minThickness * u_sizeRatio);
297
+
298
+ // Then, we need to retrieve the normalized thickness of the edge in the WebGL
299
+ // referential (in a ([0, 1], [0, 1]) space), using our "magic" correction
300
+ // ratio:
301
+ float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio;
302
+
303
+ // Here is the proper position of the vertex
304
+ gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness, 1)).xy, 0, 1);
305
+
306
+ // For the fragment shader though, we need a thickness that takes the "magic"
307
+ // correction ratio into account (as in webGLThickness), but so that the
308
+ // antialiasing effect does not depend on the zoom level. So here's yet
309
+ // another thickness version:
310
+ v_thickness = webGLThickness / u_zoomRatio;
311
+
312
+ v_normal = unitNormal;
313
+
314
+ v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0;
315
+
316
+ #ifdef PICKING_MODE
317
+ // For picking mode, we use the ID as the color:
318
+ v_color = a_id;
319
+ #else
320
+ // For normal mode, we use the color:
321
+ v_color = a_color;
322
+ #endif
323
+
324
+ v_color.a *= bias;
325
+ }
326
+ `,lr=WebGLRenderingContext,ur=lr.UNSIGNED_BYTE,dr=lr.FLOAT,fr=[`u_matrix`,`u_zoomRatio`,`u_sizeRatio`,`u_correctionRatio`,`u_pixelRatio`,`u_feather`,`u_minEdgeThickness`],pr=function(e){function t(){return zt(this,t),Kt(this,t,arguments)}return Jt(t,e),Vt(t,[{key:`getDefinition`,value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:cr,FRAGMENT_SHADER_SOURCE:Qn,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:fr,ATTRIBUTES:[{name:`a_positionStart`,size:2,type:dr},{name:`a_positionEnd`,size:2,type:dr},{name:`a_normal`,size:2,type:dr},{name:`a_color`,size:4,type:ur,normalized:!0},{name:`a_id`,size:4,type:ur,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:`a_positionCoef`,size:1,type:dr},{name:`a_normalCoef`,size:1,type:dr}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[1,1],[0,-1],[1,-1]]}}},{key:`processVisibleItem`,value:function(e,t,n,r,i){var a=i.size||1,o=n.x,s=n.y,c=r.x,l=r.y,u=fn(i.color),d=c-o,f=l-s,p=d*d+f*f,m=0,h=0;p&&(p=1/Math.sqrt(p),m=-f*p*a,h=d*p*a);var g=this.array;g[t++]=o,g[t++]=s,g[t++]=c,g[t++]=l,g[t++]=m,g[t++]=h,g[t++]=u,g[t++]=e}},{key:`setUniforms`,value:function(e,t){var n=t.gl,r=t.uniformLocations,i=r.u_matrix,a=r.u_zoomRatio,o=r.u_feather,s=r.u_pixelRatio,c=r.u_correctionRatio,l=r.u_sizeRatio,u=r.u_minEdgeThickness;n.uniformMatrix3fv(i,!1,e.matrix),n.uniform1f(a,e.zoomRatio),n.uniform1f(l,e.sizeRatio),n.uniform1f(c,e.correctionRatio),n.uniform1f(s,e.pixelRatio),n.uniform1f(o,e.antiAliasingFeather),n.uniform1f(u,e.minEdgeThickness)}}])}(Mn),mr=function(e){function t(){var e;return zt(this,t),e=Kt(this,t),e.rawEmitter=e,e}return Jt(t,e),Vt(t)}(P.EventEmitter),hr=o(((e,t)=>{t.exports=function(e){return typeof e==`object`&&!!e&&typeof e.addUndirectedEdgeWithKey==`function`&&typeof e.dropNode==`function`&&typeof e.multi==`boolean`}})),gr=c(hr()),_r={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},vr={easing:`quadraticInOut`,duration:150};function yr(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function br(e,t,n){return e[0]=t,e[4]=typeof n==`number`?n:t,e}function xr(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[3]=-n,e[4]=r,e}function Sr(e,t,n){return e[6]=t,e[7]=n,e}function Cr(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],d=t[0],f=t[1],p=t[2],m=t[3],h=t[4],g=t[5],_=t[6],v=t[7],y=t[8];return e[0]=d*n+f*a+p*c,e[1]=d*r+f*o+p*l,e[2]=d*i+f*s+p*u,e[3]=m*n+h*a+g*c,e[4]=m*r+h*o+g*l,e[5]=m*i+h*s+g*u,e[6]=_*n+v*a+y*c,e[7]=_*r+v*o+y*l,e[8]=_*i+v*s+y*u,e}function wr(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=e[0],i=e[1],a=e[3],o=e[4],s=e[6],c=e[7],l=t.x,u=t.y;return{x:l*r+u*a+s*n,y:l*i+u*o+c*n}}function Tr(e,t){var n=e.height/e.width,r=t.height/t.width;return n<1&&r>1||n>1&&r<1?1:Math.min(Math.max(r,1/r),Math.max(1/n,n))}function Er(e,t,n,r,i){var a=e.angle,o=e.ratio,s=e.x,c=e.y,l=t.width,u=t.height,d=yr(),f=Math.min(l,u)-2*r,p=Tr(t,n);return i?(Cr(d,Sr(yr(),s,c)),Cr(d,br(yr(),o)),Cr(d,xr(yr(),a)),Cr(d,br(yr(),l/f/2/p,u/f/2/p))):(Cr(d,br(yr(),f/l*2*p,f/u*2*p)),Cr(d,xr(yr(),-a)),Cr(d,br(yr(),1/o)),Cr(d,Sr(yr(),-s,-c))),d}function Dr(e,t,n){var r=wr(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),i=r.x,a=r.y;return 1/Math.sqrt(i**2+a**2)/n.width}function Or(e){if(!e.order)return{x:[0,1],y:[0,1]};var t=1/0,n=-1/0,r=1/0,i=-1/0;return e.forEachNode(function(e,a){var o=a.x,s=a.y;o<t&&(t=o),o>n&&(n=o),s<r&&(r=s),s>i&&(i=s)}),{x:[t,n],y:[r,i]}}function kr(e){if(!(0,gr.default)(e))throw Error(`Sigma: invalid graph instance.`);e.forEachNode(function(e,t){if(!Number.isFinite(t.x)||!Number.isFinite(t.y))throw Error(`Sigma: Coordinates of node ${e} are invalid. A node must have a numeric 'x' and 'y' attribute.`)})}function Ar(e,t,n){var r=document.createElement(e);if(t)for(var i in t)r.style[i]=t[i];if(n)for(var a in n)r.setAttribute(a,n[a]);return r}function jr(){return window.devicePixelRatio===void 0?1:window.devicePixelRatio}function Mr(e,t,n){return n.sort(function(e,n){var r=t(e)||0,i=t(n)||0;return r<i?-1:+(r>i)})}function Nr(e){var t=en(e.x,2),n=t[0],r=t[1],i=en(e.y,2),a=i[0],o=i[1],s=Math.max(r-n,o-a),c=(r+n)/2,l=(o+a)/2;(s===0||Math.abs(s)===1/0||isNaN(s))&&(s=1),isNaN(c)&&(c=0),isNaN(l)&&(l=0);var u=function(e){return{x:.5+(e.x-c)/s,y:.5+(e.y-l)/s}};return u.applyTo=function(e){e.x=.5+(e.x-c)/s,e.y=.5+(e.y-l)/s},u.inverse=function(e){return{x:c+s*(e.x-.5),y:l+s*(e.y-.5)}},u.ratio=s,u}function Pr(e){"@babel/helpers - typeof";return Pr=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Pr(e)}function Fr(e,t){var n=t.size;if(n!==0){var r=e.length;e.length+=n;var i=0;t.forEach(function(t){e[r+i]=t,i++})}}function Ir(e){e||={};for(var t=0,n=arguments.length<=1?0:arguments.length-1;t<n;t++){var r=t+1<1||arguments.length<=t+1?void 0:arguments[t+1];r&&Object.assign(e,r)}return e}var Lr={hideEdgesOnMove:!1,hideLabelsOnMove:!1,renderLabels:!0,renderEdgeLabels:!1,enableEdgeEvents:!1,defaultNodeColor:`#999`,defaultNodeType:`circle`,defaultEdgeColor:`#ccc`,defaultEdgeType:`line`,labelFont:`Arial`,labelSize:14,labelWeight:`normal`,labelColor:{color:`#000`},edgeLabelFont:`Arial`,edgeLabelSize:14,edgeLabelWeight:`normal`,edgeLabelColor:{attribute:`color`},stagePadding:30,defaultDrawEdgeLabel:Pn,defaultDrawNodeLabel:Fn,defaultDrawNodeHover:In,minEdgeThickness:1.7,antiAliasingFeather:1,dragTimeout:100,draggedEventsTolerance:3,inertiaDuration:200,inertiaRatio:3,zoomDuration:250,zoomingRatio:1.7,doubleClickTimeout:300,doubleClickZoomingRatio:2.2,doubleClickZoomingDuration:200,tapMoveTolerance:10,zoomToSizeRatioFunction:Math.sqrt,itemSizesReference:`screen`,autoRescale:!0,autoCenter:!0,labelDensity:1,labelGridCellSize:100,labelRenderedSizeThreshold:6,nodeReducer:null,edgeReducer:null,zIndex:!1,minCameraRatio:null,maxCameraRatio:null,enableCameraZooming:!0,enableCameraPanning:!0,enableCameraRotation:!0,cameraPanBoundaries:null,allowInvalidContainer:!1,nodeProgramClasses:{},nodeHoverProgramClasses:{},edgeProgramClasses:{}},Rr={circle:Un},zr={arrow:sr,line:pr};function Br(e){if(typeof e.labelDensity!=`number`||e.labelDensity<0)throw Error("Settings: invalid `labelDensity`. Expecting a positive number.");var t=e.minCameraRatio,n=e.maxCameraRatio;if(typeof t==`number`&&typeof n==`number`&&n<t)throw Error("Settings: invalid camera ratio boundaries. Expecting `maxCameraRatio` to be greater than `minCameraRatio`.")}function Vr(e){var t=Ir({},Lr,e);return t.nodeProgramClasses=Ir({},Rr,t.nodeProgramClasses),t.edgeProgramClasses=Ir({},zr,t.edgeProgramClasses),t}var Hr=1.5,Ur=function(e){function t(){var e;return zt(this,t),e=Kt(this,t),q(e,`x`,.5),q(e,`y`,.5),q(e,`angle`,0),q(e,`ratio`,1),q(e,`minRatio`,null),q(e,`maxRatio`,null),q(e,`enabledZooming`,!0),q(e,`enabledPanning`,!0),q(e,`enabledRotation`,!0),q(e,`clean`,null),q(e,`nextFrame`,null),q(e,`previousState`,null),q(e,`enabled`,!0),e.previousState=e.getState(),e}return Jt(t,e),Vt(t,[{key:`enable`,value:function(){return this.enabled=!0,this}},{key:`disable`,value:function(){return this.enabled=!1,this}},{key:`getState`,value:function(){return{x:this.x,y:this.y,angle:this.angle,ratio:this.ratio}}},{key:`hasState`,value:function(e){return this.x===e.x&&this.y===e.y&&this.ratio===e.ratio&&this.angle===e.angle}},{key:`getPreviousState`,value:function(){var e=this.previousState;return e?{x:e.x,y:e.y,angle:e.angle,ratio:e.ratio}:null}},{key:`getBoundedRatio`,value:function(e){var t=e;return typeof this.minRatio==`number`&&(t=Math.max(t,this.minRatio)),typeof this.maxRatio==`number`&&(t=Math.min(t,this.maxRatio)),t}},{key:`validateState`,value:function(e){var t={};return this.enabledPanning&&typeof e.x==`number`&&(t.x=e.x),this.enabledPanning&&typeof e.y==`number`&&(t.y=e.y),this.enabledZooming&&typeof e.ratio==`number`&&(t.ratio=this.getBoundedRatio(e.ratio)),this.enabledRotation&&typeof e.angle==`number`&&(t.angle=e.angle),this.clean?this.clean(J(J({},this.getState()),t)):t}},{key:`isAnimated`,value:function(){return!!this.nextFrame}},{key:`setState`,value:function(e){if(!this.enabled)return this;this.previousState=this.getState();var t=this.validateState(e);return typeof t.x==`number`&&(this.x=t.x),typeof t.y==`number`&&(this.y=t.y),typeof t.ratio==`number`&&(this.ratio=t.ratio),typeof t.angle==`number`&&(this.angle=t.angle),this.hasState(this.previousState)||this.emit(`updated`,this.getState()),this}},{key:`updateState`,value:function(e){return this.setState(e(this.getState())),this}},{key:`animate`,value:function(e){var t=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(!r)return new Promise(function(r){return t.animate(e,n,r)});if(this.enabled){var i=J(J({},vr),n),a=this.validateState(e),o=typeof i.easing==`function`?i.easing:_r[i.easing],s=Date.now(),c=this.getState(),l=function(){var e=(Date.now()-s)/i.duration;if(e>=1){t.nextFrame=null,t.setState(a),t.animationCallback&&=(t.animationCallback.call(null),void 0);return}var n=o(e),r={};typeof a.x==`number`&&(r.x=c.x+(a.x-c.x)*n),typeof a.y==`number`&&(r.y=c.y+(a.y-c.y)*n),t.enabledRotation&&typeof a.angle==`number`&&(r.angle=c.angle+(a.angle-c.angle)*n),typeof a.ratio==`number`&&(r.ratio=c.ratio+(a.ratio-c.ratio)*n),t.setState(r),t.nextFrame=requestAnimationFrame(l)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(l)):l(),this.animationCallback=r}}},{key:`animatedZoom`,value:function(e){return e?typeof e==`number`?this.animate({ratio:this.ratio/e}):this.animate({ratio:this.ratio/(e.factor||Hr)},e):this.animate({ratio:this.ratio/Hr})}},{key:`animatedUnzoom`,value:function(e){return e?typeof e==`number`?this.animate({ratio:this.ratio*e}):this.animate({ratio:this.ratio*(e.factor||Hr)},e):this.animate({ratio:this.ratio*Hr})}},{key:`animatedReset`,value:function(e){return this.animate({x:.5,y:.5,ratio:1,angle:0},e)}},{key:`copy`,value:function(){return t.from(this.getState())}}],[{key:`from`,value:function(e){return new t().setState(e)}}])}(mr);function Wr(e,t){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function Gr(e,t){var n=J(J({},Wr(e,t)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:e});return n}function Kr(e){var t=`x`in e?e:J(J({},e.touches[0]||e.previousTouches[0]),{},{original:e.original,sigmaDefaultPrevented:e.sigmaDefaultPrevented,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0,t.sigmaDefaultPrevented=!0}});return t}function qr(e,t){return J(J({},Gr(e,t)),{},{delta:Zr(e)})}var Jr=2;function Yr(e){for(var t=[],n=0,r=Math.min(e.length,Jr);n<r;n++)t.push(e[n]);return t}function Xr(e,t,n){var r={touches:Yr(e.touches).map(function(e){return Wr(e,n)}),previousTouches:t.map(function(e){return Wr(e,n)}),sigmaDefaultPrevented:!1,preventSigmaDefault:function(){r.sigmaDefaultPrevented=!0},original:e};return r}function Zr(e){if(e.deltaY!==void 0)return e.deltaY*-3/360;if(e.detail!==void 0)return e.detail/-9;throw Error(`Captor: could not extract delta from event.`)}var Qr=function(e){function t(e,n){var r;return zt(this,t),r=Kt(this,t),r.container=e,r.renderer=n,r}return Jt(t,e),Vt(t)}(mr),$r=[`doubleClickTimeout`,`doubleClickZoomingDuration`,`doubleClickZoomingRatio`,`dragTimeout`,`draggedEventsTolerance`,`inertiaDuration`,`inertiaRatio`,`zoomDuration`,`zoomingRatio`].reduce(function(e,t){return J(J({},e),{},q({},t,Lr[t]))},{}),ei=function(e){function t(e,n){var r;return zt(this,t),r=Kt(this,t,[e,n]),q(r,`enabled`,!0),q(r,`draggedEvents`,0),q(r,`downStartTime`,null),q(r,`lastMouseX`,null),q(r,`lastMouseY`,null),q(r,`isMouseDown`,!1),q(r,`isMoving`,!1),q(r,`movingTimeout`,null),q(r,`startCameraState`,null),q(r,`clicks`,0),q(r,`doubleClickTimeout`,null),q(r,`currentWheelDirection`,0),q(r,`settings`,$r),r.handleClick=r.handleClick.bind(r),r.handleRightClick=r.handleRightClick.bind(r),r.handleDown=r.handleDown.bind(r),r.handleUp=r.handleUp.bind(r),r.handleMove=r.handleMove.bind(r),r.handleWheel=r.handleWheel.bind(r),r.handleLeave=r.handleLeave.bind(r),r.handleEnter=r.handleEnter.bind(r),e.addEventListener(`click`,r.handleClick,{capture:!1}),e.addEventListener(`contextmenu`,r.handleRightClick,{capture:!1}),e.addEventListener(`mousedown`,r.handleDown,{capture:!1}),e.addEventListener(`wheel`,r.handleWheel,{capture:!1}),e.addEventListener(`mouseleave`,r.handleLeave,{capture:!1}),e.addEventListener(`mouseenter`,r.handleEnter,{capture:!1}),document.addEventListener(`mousemove`,r.handleMove,{capture:!1}),document.addEventListener(`mouseup`,r.handleUp,{capture:!1}),r}return Jt(t,e),Vt(t,[{key:`kill`,value:function(){var e=this.container;e.removeEventListener(`click`,this.handleClick),e.removeEventListener(`contextmenu`,this.handleRightClick),e.removeEventListener(`mousedown`,this.handleDown),e.removeEventListener(`wheel`,this.handleWheel),e.removeEventListener(`mouseleave`,this.handleLeave),e.removeEventListener(`mouseenter`,this.handleEnter),document.removeEventListener(`mousemove`,this.handleMove),document.removeEventListener(`mouseup`,this.handleUp)}},{key:`handleClick`,value:function(e){var t=this;if(this.enabled){if(this.clicks++,this.clicks===2)return this.clicks=0,typeof this.doubleClickTimeout==`number`&&(clearTimeout(this.doubleClickTimeout),this.doubleClickTimeout=null),this.handleDoubleClick(e);setTimeout(function(){t.clicks=0,t.doubleClickTimeout=null},this.settings.doubleClickTimeout),this.draggedEvents<this.settings.draggedEventsTolerance&&this.emit(`click`,Gr(e,this.container))}}},{key:`handleRightClick`,value:function(e){this.enabled&&this.emit(`rightClick`,Gr(e,this.container))}},{key:`handleDoubleClick`,value:function(e){if(this.enabled){e.preventDefault(),e.stopPropagation();var t=Gr(e,this.container);if(this.emit(`doubleClick`,t),!t.sigmaDefaultPrevented){var n=this.renderer.getCamera(),r=n.getBoundedRatio(n.getState().ratio/this.settings.doubleClickZoomingRatio);n.animate(this.renderer.getViewportZoomedState(Wr(e,this.container),r),{easing:`quadraticInOut`,duration:this.settings.doubleClickZoomingDuration})}}}},{key:`handleDown`,value:function(e){if(this.enabled){if(e.button===0){this.startCameraState=this.renderer.getCamera().getState();var t=Wr(e,this.container),n=t.x,r=t.y;this.lastMouseX=n,this.lastMouseY=r,this.draggedEvents=0,this.downStartTime=Date.now(),this.isMouseDown=!0}this.emit(`mousedown`,Gr(e,this.container))}}},{key:`handleUp`,value:function(e){var t=this;if(!(!this.enabled||!this.isMouseDown)){var n=this.renderer.getCamera();this.isMouseDown=!1,typeof this.movingTimeout==`number`&&(clearTimeout(this.movingTimeout),this.movingTimeout=null);var r=Wr(e,this.container),i=r.x,a=r.y,o=n.getState(),s=n.getPreviousState()||{x:0,y:0};this.isMoving?n.animate({x:o.x+this.settings.inertiaRatio*(o.x-s.x),y:o.y+this.settings.inertiaRatio*(o.y-s.y)},{duration:this.settings.inertiaDuration,easing:`quadraticOut`}):(this.lastMouseX!==i||this.lastMouseY!==a)&&n.setState({x:o.x,y:o.y}),this.isMoving=!1,setTimeout(function(){var e=t.draggedEvents>0;t.draggedEvents=0,e&&t.renderer.getSetting(`hideEdgesOnMove`)&&t.renderer.refresh()},0),this.emit(`mouseup`,Gr(e,this.container))}}},{key:`handleMove`,value:function(e){var t=this;if(this.enabled){var n=Gr(e,this.container);if(this.emit(`mousemovebody`,n),(e.target===this.container||e.composedPath()[0]===this.container)&&this.emit(`mousemove`,n),!n.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout==`number`&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){t.movingTimeout=null,t.isMoving=!1},this.settings.dragTimeout);var r=this.renderer.getCamera(),i=Wr(e,this.container),a=i.x,o=i.y,s=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),c=this.renderer.viewportToFramedGraph({x:a,y:o}),l=s.x-c.x,u=s.y-c.y,d=r.getState(),f=d.x+l,p=d.y+u;r.setState({x:f,y:p}),this.lastMouseX=a,this.lastMouseY=o,e.preventDefault(),e.stopPropagation()}}}},{key:`handleLeave`,value:function(e){this.emit(`mouseleave`,Gr(e,this.container))}},{key:`handleEnter`,value:function(e){this.emit(`mouseenter`,Gr(e,this.container))}},{key:`handleWheel`,value:function(e){var t=this,n=this.renderer.getCamera();if(!(!this.enabled||!n.enabledZooming)){var r=Zr(e);if(r){var i=qr(e,this.container);if(this.emit(`wheel`,i),i.sigmaDefaultPrevented){e.preventDefault(),e.stopPropagation();return}var a=n.getState().ratio,o=r>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,s=n.getBoundedRatio(a*o),c=r>0?1:-1,l=Date.now();a!==s&&(e.preventDefault(),e.stopPropagation(),!(this.currentWheelDirection===c&&this.lastWheelTriggerTime&&l-this.lastWheelTriggerTime<this.settings.zoomDuration/5)&&(n.animate(this.renderer.getViewportZoomedState(Wr(e,this.container),s),{easing:`quadraticOut`,duration:this.settings.zoomDuration},function(){t.currentWheelDirection=0}),this.currentWheelDirection=c,this.lastWheelTriggerTime=l))}}}},{key:`setSettings`,value:function(e){this.settings=e}}])}(Qr),ti=[`dragTimeout`,`inertiaDuration`,`inertiaRatio`,`doubleClickTimeout`,`doubleClickZoomingRatio`,`doubleClickZoomingDuration`,`tapMoveTolerance`].reduce(function(e,t){return J(J({},e),{},q({},t,Lr[t]))},{}),ni=function(e){function t(e,n){var r;return zt(this,t),r=Kt(this,t,[e,n]),q(r,`enabled`,!0),q(r,`isMoving`,!1),q(r,`hasMoved`,!1),q(r,`touchMode`,0),q(r,`startTouchesPositions`,[]),q(r,`lastTouches`,[]),q(r,`lastTap`,null),q(r,`settings`,ti),r.handleStart=r.handleStart.bind(r),r.handleLeave=r.handleLeave.bind(r),r.handleMove=r.handleMove.bind(r),e.addEventListener(`touchstart`,r.handleStart,{capture:!1}),e.addEventListener(`touchcancel`,r.handleLeave,{capture:!1}),document.addEventListener(`touchend`,r.handleLeave,{capture:!1,passive:!1}),document.addEventListener(`touchmove`,r.handleMove,{capture:!1,passive:!1}),r}return Jt(t,e),Vt(t,[{key:`kill`,value:function(){var e=this.container;e.removeEventListener(`touchstart`,this.handleStart),e.removeEventListener(`touchcancel`,this.handleLeave),document.removeEventListener(`touchend`,this.handleLeave),document.removeEventListener(`touchmove`,this.handleMove)}},{key:`getDimensions`,value:function(){return{width:this.container.offsetWidth,height:this.container.offsetHeight}}},{key:`handleStart`,value:function(e){var t=this;if(this.enabled){e.preventDefault();var n=Yr(e.touches);if(this.touchMode=n.length,this.startCameraState=this.renderer.getCamera().getState(),this.startTouchesPositions=n.map(function(e){return Wr(e,t.container)}),this.touchMode===2){var r=en(this.startTouchesPositions,2),i=r[0],a=i.x,o=i.y,s=r[1],c=s.x,l=s.y;this.startTouchesAngle=Math.atan2(l-o,c-a),this.startTouchesDistance=Math.sqrt((c-a)**2+(l-o)**2)}this.emit(`touchdown`,Xr(e,this.lastTouches,this.container)),this.lastTouches=n,this.lastTouchesPositions=this.startTouchesPositions}}},{key:`handleLeave`,value:function(e){if(!(!this.enabled||!this.startTouchesPositions.length)){switch(e.cancelable&&e.preventDefault(),this.movingTimeout&&(this.isMoving=!1,clearTimeout(this.movingTimeout)),this.touchMode){case 2:if(e.touches.length===1){this.handleStart(e),e.preventDefault();break}case 1:if(this.isMoving){var t=this.renderer.getCamera(),n=t.getState(),r=t.getPreviousState()||{x:0,y:0};t.animate({x:n.x+this.settings.inertiaRatio*(n.x-r.x),y:n.y+this.settings.inertiaRatio*(n.y-r.y)},{duration:this.settings.inertiaDuration,easing:`quadraticOut`})}this.hasMoved=!1,this.isMoving=!1,this.touchMode=0;break}if(this.emit(`touchup`,Xr(e,this.lastTouches,this.container)),!e.touches.length){var i=Wr(this.lastTouches[0],this.container),a=this.startTouchesPositions[0],o=(i.x-a.x)**2+(i.y-a.y)**2;if(!e.touches.length&&o<this.settings.tapMoveTolerance**2)if(this.lastTap&&Date.now()-this.lastTap.time<this.settings.doubleClickTimeout){var s=Xr(e,this.lastTouches,this.container);if(this.emit(`doubletap`,s),this.lastTap=null,!s.sigmaDefaultPrevented){var c=this.renderer.getCamera(),l=c.getBoundedRatio(c.getState().ratio/this.settings.doubleClickZoomingRatio);c.animate(this.renderer.getViewportZoomedState(i,l),{easing:`quadraticInOut`,duration:this.settings.doubleClickZoomingDuration})}}else{var u=Xr(e,this.lastTouches,this.container);this.emit(`tap`,u),this.lastTap={time:Date.now(),position:u.touches[0]||u.previousTouches[0]}}}this.lastTouches=Yr(e.touches),this.startTouchesPositions=[]}}},{key:`handleMove`,value:function(e){var t=this;if(!(!this.enabled||!this.startTouchesPositions.length)){e.preventDefault();var n=Yr(e.touches),r=n.map(function(e){return Wr(e,t.container)}),i=this.lastTouches;this.lastTouches=n,this.lastTouchesPositions=r;var a=Xr(e,i,this.container);if(this.emit(`touchmove`,a),!a.sigmaDefaultPrevented&&(this.hasMoved||=r.some(function(e,n){var r=t.startTouchesPositions[n];return r&&(e.x!==r.x||e.y!==r.y)}),this.hasMoved)){this.isMoving=!0,this.movingTimeout&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){t.isMoving=!1},this.settings.dragTimeout);var o=this.renderer.getCamera(),s=this.startCameraState,c=this.renderer.getSetting(`stagePadding`);switch(this.touchMode){case 1:var l=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0]),u=l.x,d=l.y,f=this.renderer.viewportToFramedGraph(r[0]),p=f.x,m=f.y;o.setState({x:s.x+u-p,y:s.y+d-m});break;case 2:var h={x:.5,y:.5,angle:0,ratio:1},g=r[0],_=g.x,v=g.y,y=r[1],b=y.x,x=y.y,S=Math.atan2(x-v,b-_)-this.startTouchesAngle,C=Math.hypot(x-v,b-_)/this.startTouchesDistance,w=o.getBoundedRatio(s.ratio/C);h.ratio=w,h.angle=s.angle+S;var T=this.getDimensions(),E=this.renderer.viewportToFramedGraph((this.startTouchesPositions||[])[0],{cameraState:s}),D=Math.min(T.width,T.height)-2*c,O=D/T.width,ee=D/T.height,te=w/D,k=_-D/2/O,A=v-D/2/ee,j=[k*Math.cos(-h.angle)-A*Math.sin(-h.angle),A*Math.cos(-h.angle)+k*Math.sin(-h.angle)];k=j[0],A=j[1],h.x=E.x-k*te,h.y=E.y+A*te,o.setState(h);break}}}}},{key:`setSettings`,value:function(e){this.settings=e}}])}(Qr);function ri(e){if(Array.isArray(e))return Zt(e)}function ii(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function ai(){throw TypeError(`Invalid attempt to spread non-iterable instance.
327
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oi(e){return ri(e)||ii(e)||Qt(e)||ai()}function si(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ci(e,t){if(e==null)return{};var n,r,i=si(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var li=function(){function e(t,n){zt(this,e),this.key=t,this.size=n}return Vt(e,null,[{key:`compare`,value:function(e,t){return e.size>t.size?-1:e.size<t.size||e.key>t.key?1:-1}}])}(),ui=function(){function e(){zt(this,e),q(this,`width`,0),q(this,`height`,0),q(this,`cellSize`,0),q(this,`columns`,0),q(this,`rows`,0),q(this,`cells`,{})}return Vt(e,[{key:`resizeAndClear`,value:function(e,t){this.width=e.width,this.height=e.height,this.cellSize=t,this.columns=Math.ceil(e.width/t),this.rows=Math.ceil(e.height/t),this.cells={}}},{key:`getIndex`,value:function(e){var t=Math.floor(e.x/this.cellSize);return Math.floor(e.y/this.cellSize)*this.columns+t}},{key:`add`,value:function(e,t,n){var r=new li(e,t),i=this.getIndex(n),a=this.cells[i];a||(a=[],this.cells[i]=a),a.push(r)}},{key:`organize`,value:function(){for(var e in this.cells)this.cells[e].sort(li.compare)}},{key:`getLabelsToDisplay`,value:function(e,t){var n=this.cellSize*this.cellSize,r=n/e/e*t/n,i=Math.ceil(r),a=[];for(var o in this.cells)for(var s=this.cells[o],c=0;c<Math.min(i,s.length);c++)a.push(s[c].key);return a}}])}();function di(e){var t=e.graph,n=e.hoveredNode,r=e.highlightedNodes,i=e.displayedNodeLabels,a=[];return t.forEachEdge(function(e,t,o,s){(o===n||s===n||r.has(o)||r.has(s)||i.has(o)&&i.has(s))&&a.push(e)}),a}var fi=150,pi=50,mi=Object.prototype.hasOwnProperty;function hi(e,t,n){if(!mi.call(n,`x`)||!mi.call(n,`y`))throw Error(`Sigma: could not find a valid position (x, y) for node "${t}". All your nodes must have a number "x" and "y". Maybe your forgot to apply a layout or your "nodeReducer" is not returning the correct data?`);return n.color||=e.defaultNodeColor,!n.label&&n.label!==``&&(n.label=null),n.label!==void 0&&n.label!==null?n.label=``+n.label:n.label=null,n.size||=2,mi.call(n,`hidden`)||(n.hidden=!1),mi.call(n,`highlighted`)||(n.highlighted=!1),mi.call(n,`forceLabel`)||(n.forceLabel=!1),(!n.type||n.type===``)&&(n.type=e.defaultNodeType),n.zIndex||=0,n}function gi(e,t,n){return n.color||=e.defaultEdgeColor,n.label||=``,n.size||=.5,mi.call(n,`hidden`)||(n.hidden=!1),mi.call(n,`forceLabel`)||(n.forceLabel=!1),(!n.type||n.type===``)&&(n.type=e.defaultEdgeType),n.zIndex||=0,n}var _i=function(e){function t(e,n){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(zt(this,t),r=Kt(this,t),q(r,`elements`,{}),q(r,`canvasContexts`,{}),q(r,`webGLContexts`,{}),q(r,`pickingLayers`,new Set),q(r,`textures`,{}),q(r,`frameBuffers`,{}),q(r,`activeListeners`,{}),q(r,`labelGrid`,new ui),q(r,`nodeDataCache`,{}),q(r,`edgeDataCache`,{}),q(r,`nodeProgramIndex`,{}),q(r,`edgeProgramIndex`,{}),q(r,`nodesWithForcedLabels`,new Set),q(r,`edgesWithForcedLabels`,new Set),q(r,`nodeExtent`,{x:[0,1],y:[0,1]}),q(r,`nodeZExtent`,[1/0,-1/0]),q(r,`edgeZExtent`,[1/0,-1/0]),q(r,`matrix`,yr()),q(r,`invMatrix`,yr()),q(r,`correctionRatio`,1),q(r,`customBBox`,null),q(r,`normalizationFunction`,Nr({x:[0,1],y:[0,1]})),q(r,`graphToViewportRatio`,1),q(r,`itemIDsIndex`,{}),q(r,`nodeIndices`,{}),q(r,`edgeIndices`,{}),q(r,`width`,0),q(r,`height`,0),q(r,`pixelRatio`,jr()),q(r,`pickingDownSizingRatio`,2*r.pixelRatio),q(r,`displayedNodeLabels`,new Set),q(r,`displayedEdgeLabels`,new Set),q(r,`highlightedNodes`,new Set),q(r,`hoveredNode`,null),q(r,`hoveredEdge`,null),q(r,`renderFrame`,null),q(r,`renderHighlightedNodesFrame`,null),q(r,`needToProcess`,!1),q(r,`checkEdgesEventsFrame`,null),q(r,`nodePrograms`,{}),q(r,`nodeHoverPrograms`,{}),q(r,`edgePrograms`,{}),r.settings=Vr(i),Br(r.settings),kr(e),!(n instanceof HTMLElement))throw Error(`Sigma: container should be an html element.`);for(var a in r.graph=e,r.container=n,r.createWebGLContext(`edges`,{picking:i.enableEdgeEvents}),r.createCanvasContext(`edgeLabels`),r.createWebGLContext(`nodes`,{picking:!0}),r.createCanvasContext(`labels`),r.createCanvasContext(`hovers`),r.createWebGLContext(`hoverNodes`),r.createCanvasContext(`mouse`,{style:{touchAction:`none`,userSelect:`none`}}),r.resize(),r.settings.nodeProgramClasses)r.registerNodeProgram(a,r.settings.nodeProgramClasses[a],r.settings.nodeHoverProgramClasses[a]);for(var o in r.settings.edgeProgramClasses)r.registerEdgeProgram(o,r.settings.edgeProgramClasses[o]);return r.camera=new Ur,r.bindCameraHandlers(),r.mouseCaptor=new ei(r.elements.mouse,r),r.mouseCaptor.setSettings(r.settings),r.touchCaptor=new ni(r.elements.mouse,r),r.touchCaptor.setSettings(r.settings),r.bindEventHandlers(),r.bindGraphHandlers(),r.handleSettingsUpdate(),r.refresh(),r}return Jt(t,e),Vt(t,[{key:`registerNodeProgram`,value:function(e,t,n){return this.nodePrograms[e]&&this.nodePrograms[e].kill(),this.nodeHoverPrograms[e]&&this.nodeHoverPrograms[e].kill(),this.nodePrograms[e]=new t(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[e]=new(n||t)(this.webGLContexts.hoverNodes,null,this),this}},{key:`registerEdgeProgram`,value:function(e,t){return this.edgePrograms[e]&&this.edgePrograms[e].kill(),this.edgePrograms[e]=new t(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:`unregisterNodeProgram`,value:function(e){if(this.nodePrograms[e]){var t=this.nodePrograms,n=t[e],r=ci(t,[e].map(Rt));n.kill(),this.nodePrograms=r}if(this.nodeHoverPrograms[e]){var i=this.nodeHoverPrograms,a=i[e],o=ci(i,[e].map(Rt));a.kill(),this.nodePrograms=o}return this}},{key:`unregisterEdgeProgram`,value:function(e){if(this.edgePrograms[e]){var t=this.edgePrograms,n=t[e],r=ci(t,[e].map(Rt));n.kill(),this.edgePrograms=r}return this}},{key:`resetWebGLTexture`,value:function(e){var t=this.webGLContexts[e],n=this.frameBuffers[e],r=this.textures[e];r&&t.deleteTexture(r);var i=t.createTexture();return t.bindFramebuffer(t.FRAMEBUFFER,n),t.bindTexture(t.TEXTURE_2D,i),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0),this.textures[e]=i,this}},{key:`bindCameraHandlers`,value:function(){var e=this;return this.activeListeners.camera=function(){e.scheduleRender()},this.camera.on(`updated`,this.activeListeners.camera),this}},{key:`unbindCameraHandlers`,value:function(){return this.camera.removeListener(`updated`,this.activeListeners.camera),this}},{key:`getNodeAtPosition`,value:function(e){var t=e.x,n=e.y,r=gn(this.webGLContexts.nodes,this.frameBuffers.nodes,t,n,this.pixelRatio,this.pickingDownSizingRatio),i=hn.apply(void 0,oi(r)),a=this.itemIDsIndex[i];return a&&a.type===`node`?a.id:null}},{key:`bindEventHandlers`,value:function(){var e=this;this.activeListeners.handleResize=function(){e.scheduleRefresh()},window.addEventListener(`resize`,this.activeListeners.handleResize),this.activeListeners.handleMove=function(t){var n=Kr(t),r={event:n,preventSigmaDefault:function(){n.preventSigmaDefault()}},i=e.getNodeAtPosition(n);if(i&&e.hoveredNode!==i&&!e.nodeDataCache[i].hidden){e.hoveredNode&&e.emit(`leaveNode`,J(J({},r),{},{node:e.hoveredNode})),e.hoveredNode=i,e.emit(`enterNode`,J(J({},r),{},{node:i})),e.scheduleHighlightedNodesRender();return}if(e.hoveredNode&&e.getNodeAtPosition(n)!==e.hoveredNode){var a=e.hoveredNode;e.hoveredNode=null,e.emit(`leaveNode`,J(J({},r),{},{node:a})),e.scheduleHighlightedNodesRender();return}if(e.settings.enableEdgeEvents){var o=e.hoveredNode?null:e.getEdgeAtPoint(r.event.x,r.event.y);o!==e.hoveredEdge&&(e.hoveredEdge&&e.emit(`leaveEdge`,J(J({},r),{},{edge:e.hoveredEdge})),o&&e.emit(`enterEdge`,J(J({},r),{},{edge:o})),e.hoveredEdge=o)}},this.activeListeners.handleMoveBody=function(t){var n=Kr(t);e.emit(`moveBody`,{event:n,preventSigmaDefault:function(){n.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(t){var n=Kr(t),r={event:n,preventSigmaDefault:function(){n.preventSigmaDefault()}};e.hoveredNode&&(e.emit(`leaveNode`,J(J({},r),{},{node:e.hoveredNode})),e.scheduleHighlightedNodesRender()),e.settings.enableEdgeEvents&&e.hoveredEdge&&(e.emit(`leaveEdge`,J(J({},r),{},{edge:e.hoveredEdge})),e.scheduleHighlightedNodesRender()),e.emit(`leaveStage`,J({},r))},this.activeListeners.handleEnter=function(t){var n=Kr(t),r={event:n,preventSigmaDefault:function(){n.preventSigmaDefault()}};e.emit(`enterStage`,J({},r))};var t=function(t){return function(n){var r=Kr(n),i={event:r,preventSigmaDefault:function(){r.preventSigmaDefault()}},a=e.getNodeAtPosition(r);if(a)return e.emit(`${t}Node`,J(J({},i),{},{node:a}));if(e.settings.enableEdgeEvents){var o=e.getEdgeAtPoint(r.x,r.y);if(o)return e.emit(`${t}Edge`,J(J({},i),{},{edge:o}))}return e.emit(`${t}Stage`,i)}};return this.activeListeners.handleClick=t(`click`),this.activeListeners.handleRightClick=t(`rightClick`),this.activeListeners.handleDoubleClick=t(`doubleClick`),this.activeListeners.handleWheel=t(`wheel`),this.activeListeners.handleDown=t(`down`),this.activeListeners.handleUp=t(`up`),this.mouseCaptor.on(`mousemove`,this.activeListeners.handleMove),this.mouseCaptor.on(`mousemovebody`,this.activeListeners.handleMoveBody),this.mouseCaptor.on(`click`,this.activeListeners.handleClick),this.mouseCaptor.on(`rightClick`,this.activeListeners.handleRightClick),this.mouseCaptor.on(`doubleClick`,this.activeListeners.handleDoubleClick),this.mouseCaptor.on(`wheel`,this.activeListeners.handleWheel),this.mouseCaptor.on(`mousedown`,this.activeListeners.handleDown),this.mouseCaptor.on(`mouseup`,this.activeListeners.handleUp),this.mouseCaptor.on(`mouseleave`,this.activeListeners.handleLeave),this.mouseCaptor.on(`mouseenter`,this.activeListeners.handleEnter),this.touchCaptor.on(`touchdown`,this.activeListeners.handleDown),this.touchCaptor.on(`touchdown`,this.activeListeners.handleMove),this.touchCaptor.on(`touchup`,this.activeListeners.handleUp),this.touchCaptor.on(`touchmove`,this.activeListeners.handleMove),this.touchCaptor.on(`tap`,this.activeListeners.handleClick),this.touchCaptor.on(`doubletap`,this.activeListeners.handleDoubleClick),this.touchCaptor.on(`touchmove`,this.activeListeners.handleMoveBody),this}},{key:`bindGraphHandlers`,value:function(){var e=this,t=this.graph,n=new Set([`x`,`y`,`zIndex`,`type`]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(r){var i=r.hints?.attributes;e.graph.forEachNode(function(t){return e.updateNode(t)});var a=!i||i.some(function(e){return n.has(e)});e.refresh({partialGraph:{nodes:t.nodes()},skipIndexation:!a,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(n){var r=n.hints?.attributes;e.graph.forEachEdge(function(t){return e.updateEdge(t)});var i=r&&[`zIndex`,`type`].some(function(e){return r?.includes(e)});e.refresh({partialGraph:{edges:t.edges()},skipIndexation:!i,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(t){var n=t.key;e.addNode(n),e.refresh({partialGraph:{nodes:[n]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(t){var n=t.key;e.refresh({partialGraph:{nodes:[n]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(t){var n=t.key;e.removeNode(n),e.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(t){var n=t.key;e.addEdge(n),e.refresh({partialGraph:{edges:[n]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(t){var n=t.key;e.refresh({partialGraph:{edges:[n]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(t){var n=t.key;e.removeEdge(n),e.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){e.clearEdgeState(),e.clearEdgeIndices(),e.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){e.clearEdgeState(),e.clearNodeState(),e.clearEdgeIndices(),e.clearNodeIndices(),e.refresh({schedule:!0})},t.on(`nodeAdded`,this.activeListeners.addNodeGraphUpdate),t.on(`nodeDropped`,this.activeListeners.dropNodeGraphUpdate),t.on(`nodeAttributesUpdated`,this.activeListeners.updateNodeGraphUpdate),t.on(`eachNodeAttributesUpdated`,this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),t.on(`edgeAdded`,this.activeListeners.addEdgeGraphUpdate),t.on(`edgeDropped`,this.activeListeners.dropEdgeGraphUpdate),t.on(`edgeAttributesUpdated`,this.activeListeners.updateEdgeGraphUpdate),t.on(`eachEdgeAttributesUpdated`,this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),t.on(`edgesCleared`,this.activeListeners.clearEdgesGraphUpdate),t.on(`cleared`,this.activeListeners.clearGraphUpdate),this}},{key:`unbindGraphHandlers`,value:function(){var e=this.graph;e.removeListener(`nodeAdded`,this.activeListeners.addNodeGraphUpdate),e.removeListener(`nodeDropped`,this.activeListeners.dropNodeGraphUpdate),e.removeListener(`nodeAttributesUpdated`,this.activeListeners.updateNodeGraphUpdate),e.removeListener(`eachNodeAttributesUpdated`,this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),e.removeListener(`edgeAdded`,this.activeListeners.addEdgeGraphUpdate),e.removeListener(`edgeDropped`,this.activeListeners.dropEdgeGraphUpdate),e.removeListener(`edgeAttributesUpdated`,this.activeListeners.updateEdgeGraphUpdate),e.removeListener(`eachEdgeAttributesUpdated`,this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),e.removeListener(`edgesCleared`,this.activeListeners.clearEdgesGraphUpdate),e.removeListener(`cleared`,this.activeListeners.clearGraphUpdate)}},{key:`getEdgeAtPoint`,value:function(e,t){var n=gn(this.webGLContexts.edges,this.frameBuffers.edges,e,t,this.pixelRatio,this.pickingDownSizingRatio),r=hn.apply(void 0,oi(n)),i=this.itemIDsIndex[r];return i&&i.type===`edge`?i.id:null}},{key:`process`,value:function(){var e=this;this.emit(`beforeProcess`);var t=this.graph,n=this.settings,r=this.getDimensions();if(this.nodeExtent=Or(this.graph),!this.settings.autoRescale){var i=r.width,a=r.height,o=this.nodeExtent,s=o.x,c=o.y;this.nodeExtent={x:[(s[0]+s[1])/2-i/2,(s[0]+s[1])/2+i/2],y:[(c[0]+c[1])/2-a/2,(c[0]+c[1])/2+a/2]}}this.normalizationFunction=Nr(this.customBBox||this.nodeExtent);var l=Er(new Ur().getState(),r,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(r,n.labelGridCellSize);for(var u={},d={},f={},p={},m=1,h=t.nodes(),g=0,_=h.length;g<_;g++){var v=h[g],y=this.nodeDataCache[v],b=t.getNodeAttributes(v);y.x=b.x,y.y=b.y,this.normalizationFunction.applyTo(y),typeof y.label==`string`&&!y.hidden&&this.labelGrid.add(v,y.size,this.framedGraphToViewport(y,{matrix:l})),u[y.type]=(u[y.type]||0)+1}for(var x in this.labelGrid.organize(),this.nodePrograms){if(!mi.call(this.nodePrograms,x))throw Error(`Sigma: could not find a suitable program for node type "${x}"!`);this.nodePrograms[x].reallocate(u[x]||0),u[x]=0}this.settings.zIndex&&this.nodeZExtent[0]!==this.nodeZExtent[1]&&(h=Mr(this.nodeZExtent,function(t){return e.nodeDataCache[t].zIndex},h));for(var S=0,C=h.length;S<C;S++){var w=h[S];d[w]=m,p[d[w]]={type:`node`,id:w},m++;var T=this.nodeDataCache[w];this.addNodeToProgram(w,d[w],u[T.type]++)}for(var E={},D=t.edges(),O=0,ee=D.length;O<ee;O++){var te=D[O],k=this.edgeDataCache[te];E[k.type]=(E[k.type]||0)+1}for(var A in this.settings.zIndex&&this.edgeZExtent[0]!==this.edgeZExtent[1]&&(D=Mr(this.edgeZExtent,function(t){return e.edgeDataCache[t].zIndex},D)),this.edgePrograms){if(!mi.call(this.edgePrograms,A))throw Error(`Sigma: could not find a suitable program for edge type "${A}"!`);this.edgePrograms[A].reallocate(E[A]||0),E[A]=0}for(var j=0,M=D.length;j<M;j++){var N=D[j];f[N]=m,p[f[N]]={type:`edge`,id:N},m++;var P=this.edgeDataCache[N];this.addEdgeToProgram(N,f[N],E[P.type]++)}return this.itemIDsIndex=p,this.nodeIndices=d,this.edgeIndices=f,this.emit(`afterProcess`),this}},{key:`handleSettingsUpdate`,value:function(e){var t=this,n=this.settings;if(this.camera.minRatio=n.minCameraRatio,this.camera.maxRatio=n.maxCameraRatio,this.camera.enabledZooming=n.enableCameraZooming,this.camera.enabledPanning=n.enableCameraPanning,this.camera.enabledRotation=n.enableCameraRotation,n.cameraPanBoundaries?this.camera.clean=function(e){return t.cleanCameraState(e,n.cameraPanBoundaries&&Pr(n.cameraPanBoundaries)===`object`?n.cameraPanBoundaries:{})}:this.camera.clean=null,this.camera.setState(this.camera.validateState(this.camera.getState())),e){if(e.edgeProgramClasses!==n.edgeProgramClasses){for(var r in n.edgeProgramClasses)n.edgeProgramClasses[r]!==e.edgeProgramClasses[r]&&this.registerEdgeProgram(r,n.edgeProgramClasses[r]);for(var i in e.edgeProgramClasses)n.edgeProgramClasses[i]||this.unregisterEdgeProgram(i)}if(e.nodeProgramClasses!==n.nodeProgramClasses||e.nodeHoverProgramClasses!==n.nodeHoverProgramClasses){for(var a in n.nodeProgramClasses)(n.nodeProgramClasses[a]!==e.nodeProgramClasses[a]||n.nodeHoverProgramClasses[a]!==e.nodeHoverProgramClasses[a])&&this.registerNodeProgram(a,n.nodeProgramClasses[a],n.nodeHoverProgramClasses[a]);for(var o in e.nodeProgramClasses)n.nodeProgramClasses[o]||this.unregisterNodeProgram(o)}}return this.mouseCaptor.setSettings(this.settings),this.touchCaptor.setSettings(this.settings),this}},{key:`cleanCameraState`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.tolerance,r=n===void 0?0:n,i=t.boundaries,a=J({},e),o=i||this.nodeExtent,s=en(o.x,2),c=s[0],l=s[1],u=en(o.y,2),d=u[0],f=u[1],p=[this.graphToViewport({x:c,y:d},{cameraState:e}),this.graphToViewport({x:l,y:d},{cameraState:e}),this.graphToViewport({x:c,y:f},{cameraState:e}),this.graphToViewport({x:l,y:f},{cameraState:e})],m=1/0,h=-1/0,g=1/0,_=-1/0;p.forEach(function(e){var t=e.x,n=e.y;m=Math.min(m,t),h=Math.max(h,t),g=Math.min(g,n),_=Math.max(_,n)});var v=h-m,y=_-g,b=this.getDimensions(),x=b.width,S=b.height,C=0,w=0;if(v>=x?h<x-r?C=h-(x-r):m>r&&(C=m-r):h>x+r?C=h-(x+r):m<-r&&(C=m+r),y>=S?_<S-r?w=_-(S-r):g>r&&(w=g-r):_>S+r?w=_-(S+r):g<-r&&(w=g+r),C||w){var T=this.viewportToFramedGraph({x:0,y:0},{cameraState:e}),E=this.viewportToFramedGraph({x:C,y:w},{cameraState:e});C=E.x-T.x,w=E.y-T.y,a.x+=C,a.y+=w}return a}},{key:`renderLabels`,value:function(){if(!this.settings.renderLabels)return this;var e=this.camera.getState(),t=this.labelGrid.getLabelsToDisplay(e.ratio,this.settings.labelDensity);Fr(t,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var n=this.canvasContexts.labels,r=0,i=t.length;r<i;r++){var a=t[r],o=this.nodeDataCache[a];if(!this.displayedNodeLabels.has(a)&&!o.hidden){var s=this.framedGraphToViewport(o),c=s.x,l=s.y,u=this.scaleSize(o.size);if(!(!o.forceLabel&&u<this.settings.labelRenderedSizeThreshold)&&!(c<-fi||c>this.width+fi||l<-pi||l>this.height+pi)){this.displayedNodeLabels.add(a);var d=this.settings.defaultDrawNodeLabel;(this.nodePrograms[o.type]?.drawLabel||d)(n,J(J({key:a},o),{},{size:u,x:c,y:l}),this.settings)}}}return this}},{key:`renderEdgeLabels`,value:function(){if(!this.settings.renderEdgeLabels)return this;var e=this.canvasContexts.edgeLabels;e.clearRect(0,0,this.width,this.height);var t=di({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});Fr(t,this.edgesWithForcedLabels);for(var n=new Set,r=0,i=t.length;r<i;r++){var a=t[r],o=this.graph.extremities(a),s=this.nodeDataCache[o[0]],c=this.nodeDataCache[o[1]],l=this.edgeDataCache[a];if(!n.has(a)&&!(l.hidden||s.hidden||c.hidden)){var u=this.settings.defaultDrawEdgeLabel;(this.edgePrograms[l.type]?.drawLabel||u)(e,J(J({key:a},l),{},{size:this.scaleSize(l.size)}),J(J(J({key:o[0]},s),this.framedGraphToViewport(s)),{},{size:this.scaleSize(s.size)}),J(J(J({key:o[1]},c),this.framedGraphToViewport(c)),{},{size:this.scaleSize(c.size)}),this.settings),n.add(a)}}return this.displayedEdgeLabels=n,this}},{key:`renderHighlightedNodes`,value:function(){var e=this,t=this.canvasContexts.hovers;t.clearRect(0,0,this.width,this.height);var n=function(n){var r=e.nodeDataCache[n],i=e.framedGraphToViewport(r),a=i.x,o=i.y,s=e.scaleSize(r.size),c=e.settings.defaultDrawNodeHover;(e.nodePrograms[r.type]?.drawHover||c)(t,J(J({key:n},r),{},{size:s,x:a,y:o}),e.settings)},r=[];this.hoveredNode&&!this.nodeDataCache[this.hoveredNode].hidden&&r.push(this.hoveredNode),this.highlightedNodes.forEach(function(t){t!==e.hoveredNode&&r.push(t)}),r.forEach(function(e){return n(e)});var i={};for(var a in r.forEach(function(t){var n=e.nodeDataCache[t].type;i[n]=(i[n]||0)+1}),this.nodeHoverPrograms)this.nodeHoverPrograms[a].reallocate(i[a]||0),i[a]=0;r.forEach(function(t){var n=e.nodeDataCache[t];e.nodeHoverPrograms[n.type].process(0,i[n.type]++,n)}),this.webGLContexts.hoverNodes.clear(this.webGLContexts.hoverNodes.COLOR_BUFFER_BIT);var o=this.getRenderParams();for(var s in this.nodeHoverPrograms)this.nodeHoverPrograms[s].render(o)}},{key:`scheduleHighlightedNodesRender`,value:function(){var e=this;this.renderHighlightedNodesFrame||this.renderFrame||(this.renderHighlightedNodesFrame=requestAnimationFrame(function(){e.renderHighlightedNodesFrame=null,e.renderHighlightedNodes(),e.renderEdgeLabels()}))}},{key:`render`,value:function(){var e=this;this.emit(`beforeRender`);var t=function(){return e.emit(`afterRender`),e};if(this.renderFrame&&=(cancelAnimationFrame(this.renderFrame),null),this.resize(),this.needToProcess&&this.process(),this.needToProcess=!1,this.clear(),this.pickingLayers.forEach(function(t){return e.resetWebGLTexture(t)}),!this.graph.order)return t();var n=this.mouseCaptor,r=this.camera.isAnimated()||n.isMoving||n.draggedEvents||n.currentWheelDirection,i=this.camera.getState(),a=this.getDimensions(),o=this.getGraphDimensions(),s=this.getStagePadding();this.matrix=Er(i,a,o,s),this.invMatrix=Er(i,a,o,s,!0),this.correctionRatio=Dr(this.matrix,i,a),this.graphToViewportRatio=this.getGraphToViewportRatio();var c=this.getRenderParams();for(var l in this.nodePrograms)this.nodePrograms[l].render(c);if(!this.settings.hideEdgesOnMove||!r)for(var u in this.edgePrograms)this.edgePrograms[u].render(c);return this.settings.hideLabelsOnMove&&r?t():(this.renderLabels(),this.renderEdgeLabels(),this.renderHighlightedNodes(),t())}},{key:`addNode`,value:function(e){var t=Object.assign({},this.graph.getNodeAttributes(e));this.settings.nodeReducer&&(t=this.settings.nodeReducer(e,t));var n=hi(this.settings,e,t);this.nodeDataCache[e]=n,this.nodesWithForcedLabels.delete(e),n.forceLabel&&!n.hidden&&this.nodesWithForcedLabels.add(e),this.highlightedNodes.delete(e),n.highlighted&&!n.hidden&&this.highlightedNodes.add(e),this.settings.zIndex&&(n.zIndex<this.nodeZExtent[0]&&(this.nodeZExtent[0]=n.zIndex),n.zIndex>this.nodeZExtent[1]&&(this.nodeZExtent[1]=n.zIndex))}},{key:`updateNode`,value:function(e){this.addNode(e);var t=this.nodeDataCache[e];this.normalizationFunction.applyTo(t)}},{key:`removeNode`,value:function(e){delete this.nodeDataCache[e],delete this.nodeProgramIndex[e],this.highlightedNodes.delete(e),this.hoveredNode===e&&(this.hoveredNode=null),this.nodesWithForcedLabels.delete(e)}},{key:`addEdge`,value:function(e){var t=Object.assign({},this.graph.getEdgeAttributes(e));this.settings.edgeReducer&&(t=this.settings.edgeReducer(e,t));var n=gi(this.settings,e,t);this.edgeDataCache[e]=n,this.edgesWithForcedLabels.delete(e),n.forceLabel&&!n.hidden&&this.edgesWithForcedLabels.add(e),this.settings.zIndex&&(n.zIndex<this.edgeZExtent[0]&&(this.edgeZExtent[0]=n.zIndex),n.zIndex>this.edgeZExtent[1]&&(this.edgeZExtent[1]=n.zIndex))}},{key:`updateEdge`,value:function(e){this.addEdge(e)}},{key:`removeEdge`,value:function(e){delete this.edgeDataCache[e],delete this.edgeProgramIndex[e],this.hoveredEdge===e&&(this.hoveredEdge=null),this.edgesWithForcedLabels.delete(e)}},{key:`clearNodeIndices`,value:function(){this.labelGrid=new ui,this.nodeExtent={x:[0,1],y:[0,1]},this.nodeDataCache={},this.edgeProgramIndex={},this.nodesWithForcedLabels=new Set,this.nodeZExtent=[1/0,-1/0],this.highlightedNodes=new Set}},{key:`clearEdgeIndices`,value:function(){this.edgeDataCache={},this.edgeProgramIndex={},this.edgesWithForcedLabels=new Set,this.edgeZExtent=[1/0,-1/0]}},{key:`clearIndices`,value:function(){this.clearEdgeIndices(),this.clearNodeIndices()}},{key:`clearNodeState`,value:function(){this.displayedNodeLabels=new Set,this.highlightedNodes=new Set,this.hoveredNode=null}},{key:`clearEdgeState`,value:function(){this.displayedEdgeLabels=new Set,this.highlightedNodes=new Set,this.hoveredEdge=null}},{key:`clearState`,value:function(){this.clearEdgeState(),this.clearNodeState()}},{key:`addNodeToProgram`,value:function(e,t,n){var r=this.nodeDataCache[e],i=this.nodePrograms[r.type];if(!i)throw Error(`Sigma: could not find a suitable program for node type "${r.type}"!`);i.process(t,n,r),this.nodeProgramIndex[e]=n}},{key:`addEdgeToProgram`,value:function(e,t,n){var r=this.edgeDataCache[e],i=this.edgePrograms[r.type];if(!i)throw Error(`Sigma: could not find a suitable program for edge type "${r.type}"!`);var a=this.graph.extremities(e),o=this.nodeDataCache[a[0]],s=this.nodeDataCache[a[1]];i.process(t,n,o,s,r),this.edgeProgramIndex[e]=n}},{key:`getRenderParams`,value:function(){return{matrix:this.matrix,invMatrix:this.invMatrix,width:this.width,height:this.height,pixelRatio:this.pixelRatio,zoomRatio:this.camera.ratio,cameraAngle:this.camera.angle,sizeRatio:1/this.scaleSize(),correctionRatio:this.correctionRatio,downSizingRatio:this.pickingDownSizingRatio,minEdgeThickness:this.settings.minEdgeThickness,antiAliasingFeather:this.settings.antiAliasingFeather}}},{key:`getStagePadding`,value:function(){var e=this.settings,t=e.stagePadding;return e.autoRescale&&t||0}},{key:`createLayer`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.elements[e])throw Error(`Sigma: a layer named "${e}" already exists`);var r=Ar(t,{position:`absolute`},{class:`sigma-${e}`});return n.style&&Object.assign(r.style,n.style),this.elements[e]=r,`beforeLayer`in n&&n.beforeLayer?this.elements[n.beforeLayer].before(r):`afterLayer`in n&&n.afterLayer?this.elements[n.afterLayer].after(r):this.container.appendChild(r),r}},{key:`createCanvas`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.createLayer(e,`canvas`,t)}},{key:`createCanvasContext`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.createCanvas(e,t),r={preserveDrawingBuffer:!1,antialias:!1};return this.canvasContexts[e]=n.getContext(`2d`,r),this}},{key:`createWebGLContext`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t?.canvas||this.createCanvas(e,t);t.hidden&&n.remove();var r=J({preserveDrawingBuffer:!1,antialias:!1},t),i=n.getContext(`webgl2`,r);i||=n.getContext(`webgl`,r),i||=n.getContext(`experimental-webgl`,r);var a=i;if(this.webGLContexts[e]=a,a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA),t.picking){this.pickingLayers.add(e);var o=a.createFramebuffer();if(!o)throw Error(`Sigma: cannot create a new frame buffer for layer ${e}`);this.frameBuffers[e]=o}return a}},{key:`killLayer`,value:function(e){var t=this.elements[e];if(!t)throw Error(`Sigma: cannot kill layer ${e}, which does not exist`);if(this.webGLContexts[e]){var n;(n=this.webGLContexts[e].getExtension(`WEBGL_lose_context`))==null||n.loseContext(),delete this.webGLContexts[e]}else this.canvasContexts[e]&&delete this.canvasContexts[e];return t.remove(),delete this.elements[e],this}},{key:`getCamera`,value:function(){return this.camera}},{key:`setCamera`,value:function(e){this.unbindCameraHandlers(),this.camera=e,this.bindCameraHandlers()}},{key:`getContainer`,value:function(){return this.container}},{key:`getGraph`,value:function(){return this.graph}},{key:`setGraph`,value:function(e){e!==this.graph&&(this.hoveredNode&&!e.hasNode(this.hoveredNode)&&(this.hoveredNode=null),this.hoveredEdge&&!e.hasEdge(this.hoveredEdge)&&(this.hoveredEdge=null),this.unbindGraphHandlers(),this.checkEdgesEventsFrame!==null&&(cancelAnimationFrame(this.checkEdgesEventsFrame),this.checkEdgesEventsFrame=null),this.graph=e,this.bindGraphHandlers(),this.refresh())}},{key:`getMouseCaptor`,value:function(){return this.mouseCaptor}},{key:`getTouchCaptor`,value:function(){return this.touchCaptor}},{key:`getDimensions`,value:function(){return{width:this.width,height:this.height}}},{key:`getGraphDimensions`,value:function(){var e=this.customBBox||this.nodeExtent;return{width:e.x[1]-e.x[0]||1,height:e.y[1]-e.y[0]||1}}},{key:`getNodeDisplayData`,value:function(e){var t=this.nodeDataCache[e];return t?Object.assign({},t):void 0}},{key:`getEdgeDisplayData`,value:function(e){var t=this.edgeDataCache[e];return t?Object.assign({},t):void 0}},{key:`getNodeDisplayedLabels`,value:function(){return new Set(this.displayedNodeLabels)}},{key:`getEdgeDisplayedLabels`,value:function(){return new Set(this.displayedEdgeLabels)}},{key:`getSettings`,value:function(){return J({},this.settings)}},{key:`getSetting`,value:function(e){return this.settings[e]}},{key:`setSetting`,value:function(e,t){var n=J({},this.settings);return this.settings[e]=t,Br(this.settings),this.handleSettingsUpdate(n),this.scheduleRefresh(),this}},{key:`updateSetting`,value:function(e,t){return this.setSetting(e,t(this.settings[e])),this}},{key:`setSettings`,value:function(e){var t=J({},this.settings);return this.settings=J(J({},this.settings),e),Br(this.settings),this.handleSettingsUpdate(t),this.scheduleRefresh(),this}},{key:`resize`,value:function(e){var t=this.width,n=this.height;if(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.pixelRatio=jr(),this.width===0)if(this.settings.allowInvalidContainer)this.width=1;else throw Error(`Sigma: Container has no width. You can set the allowInvalidContainer setting to true to stop seeing this error.`);if(this.height===0)if(this.settings.allowInvalidContainer)this.height=1;else throw Error(`Sigma: Container has no height. You can set the allowInvalidContainer setting to true to stop seeing this error.`);if(!e&&t===this.width&&n===this.height)return this;for(var r in this.elements){var i=this.elements[r];i.style.width=this.width+`px`,i.style.height=this.height+`px`}for(var a in this.canvasContexts)this.elements[a].setAttribute(`width`,this.width*this.pixelRatio+`px`),this.elements[a].setAttribute(`height`,this.height*this.pixelRatio+`px`),this.pixelRatio!==1&&this.canvasContexts[a].scale(this.pixelRatio,this.pixelRatio);for(var o in this.webGLContexts){this.elements[o].setAttribute(`width`,this.width*this.pixelRatio+`px`),this.elements[o].setAttribute(`height`,this.height*this.pixelRatio+`px`);var s=this.webGLContexts[o];if(s.viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio),this.pickingLayers.has(o)){var c=this.textures[o];c&&s.deleteTexture(c)}}return this.emit(`resize`),this}},{key:`clear`,value:function(){return this.emit(`beforeClear`),this.webGLContexts.nodes.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.nodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.edges.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.edges.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.hoverNodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.canvasContexts.labels.clearRect(0,0,this.width,this.height),this.canvasContexts.hovers.clearRect(0,0,this.width,this.height),this.canvasContexts.edgeLabels.clearRect(0,0,this.width,this.height),this.emit(`afterClear`),this}},{key:`refresh`,value:function(e){var t=this,n=e?.skipIndexation===void 0?!1:e?.skipIndexation,r=e?.schedule===void 0?!1:e.schedule,i=!e||!e.partialGraph;if(i)this.clearEdgeIndices(),this.clearNodeIndices(),this.graph.forEachNode(function(e){return t.addNode(e)}),this.graph.forEachEdge(function(e){return t.addEdge(e)});else{for(var a,o=e.partialGraph?.nodes||[],s=0,c=o?.length||0;s<c;s++){var l=o[s];if(this.updateNode(l),n){var u=this.nodeProgramIndex[l];if(u===void 0)throw Error(`Sigma: node "${l}" can't be repaint`);this.addNodeToProgram(l,this.nodeIndices[l],u)}}for(var d=(e==null||(a=e.partialGraph)==null?void 0:a.edges)||[],f=0,p=d.length;f<p;f++){var m=d[f];if(this.updateEdge(m),n){var h=this.edgeProgramIndex[m];if(h===void 0)throw Error(`Sigma: edge "${m}" can't be repaint`);this.addEdgeToProgram(m,this.edgeIndices[m],h)}}}return(i||!n)&&(this.needToProcess=!0),r?this.scheduleRender():this.render(),this}},{key:`scheduleRender`,value:function(){var e=this;return this.renderFrame||=requestAnimationFrame(function(){e.render()}),this}},{key:`scheduleRefresh`,value:function(e){return this.refresh(J(J({},e),{},{schedule:!0}))}},{key:`getViewportZoomedState`,value:function(e,t){var n=this.camera.getState(),r=n.ratio,i=n.angle,a=n.x,o=n.y,s=this.settings,c=s.minCameraRatio,l=s.maxCameraRatio;typeof l==`number`&&(t=Math.min(t,l)),typeof c==`number`&&(t=Math.max(t,c));var u=t/r,d={x:this.width/2,y:this.height/2},f=this.viewportToFramedGraph(e),p=this.viewportToFramedGraph(d);return{angle:i,x:(f.x-p.x)*(1-u)+a,y:(f.y-p.y)*(1-u)+o,ratio:t}}},{key:`viewRectangle`,value:function(){var e=this.viewportToFramedGraph({x:0,y:0}),t=this.viewportToFramedGraph({x:this.width,y:0}),n=this.viewportToFramedGraph({x:0,y:this.height});return{x1:e.x,y1:e.y,x2:t.x,y2:t.y,height:t.y-n.y}}},{key:`framedGraphToViewport`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=!!t.cameraState||!!t.viewportDimensions||!!t.graphDimensions,r=wr(t.matrix?t.matrix:n?Er(t.cameraState||this.camera.getState(),t.viewportDimensions||this.getDimensions(),t.graphDimensions||this.getGraphDimensions(),t.padding||this.getStagePadding()):this.matrix,e);return{x:(1+r.x)*this.width/2,y:(1-r.y)*this.height/2}}},{key:`viewportToFramedGraph`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=!!t.cameraState||!!t.viewportDimensions||!t.graphDimensions,r=wr(t.matrix?t.matrix:n?Er(t.cameraState||this.camera.getState(),t.viewportDimensions||this.getDimensions(),t.graphDimensions||this.getGraphDimensions(),t.padding||this.getStagePadding(),!0):this.invMatrix,{x:e.x/this.width*2-1,y:1-e.y/this.height*2});return isNaN(r.x)&&(r.x=0),isNaN(r.y)&&(r.y=0),r}},{key:`viewportToGraph`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.normalizationFunction.inverse(this.viewportToFramedGraph(e,t))}},{key:`graphToViewport`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.framedGraphToViewport(this.normalizationFunction(e),t)}},{key:`getGraphToViewportRatio`,value:function(){var e={x:0,y:0},t={x:1,y:1},n=Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2),r=this.graphToViewport(e),i=this.graphToViewport(t);return Math.sqrt((r.x-i.x)**2+(r.y-i.y)**2)/n}},{key:`getBBox`,value:function(){return this.nodeExtent}},{key:`getCustomBBox`,value:function(){return this.customBBox}},{key:`setCustomBBox`,value:function(e){return this.customBBox=e,this.scheduleRender(),this}},{key:`kill`,value:function(){this.emit(`kill`),this.removeAllListeners(),this.unbindCameraHandlers(),window.removeEventListener(`resize`,this.activeListeners.handleResize),this.mouseCaptor.kill(),this.touchCaptor.kill(),this.unbindGraphHandlers(),this.clearIndices(),this.clearState(),this.nodeDataCache={},this.edgeDataCache={},this.highlightedNodes.clear(),this.renderFrame&&=(cancelAnimationFrame(this.renderFrame),null),this.renderHighlightedNodesFrame&&=(cancelAnimationFrame(this.renderHighlightedNodesFrame),null);for(var e=this.container;e.firstChild;)e.removeChild(e.firstChild);for(var t in this.nodePrograms)this.nodePrograms[t].kill();for(var n in this.nodeHoverPrograms)this.nodeHoverPrograms[n].kill();for(var r in this.edgePrograms)this.edgePrograms[r].kill();for(var i in this.nodePrograms={},this.nodeHoverPrograms={},this.edgePrograms={},this.elements)this.killLayer(i);this.canvasContexts={},this.webGLContexts={},this.elements={}}},{key:`scaleSize`,value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.camera.ratio;return e/this.settings.zoomToSizeRatioFunction(t)*(this.getSetting(`itemSizesReference`)===`positions`?t*this.graphToViewportRatio:1)}},{key:`getCanvases`,value:function(){var e={};for(var t in this.elements)this.elements[t]instanceof HTMLCanvasElement&&(e[t]=this.elements[t]);return e}}])}(mr),vi=o((e=>{function t(e){return typeof e!=`number`||isNaN(e)?1:e}function n(e,t){var n={},r=function(e){return e===void 0?t:e};typeof t==`function`&&(r=t);var i=function(t){return r(t[e])},a=function(){return r(void 0)};return typeof e==`string`?(n.fromAttributes=i,n.fromGraph=function(e,t){return i(e.getNodeAttributes(t))},n.fromEntry=function(e,t){return i(t)}):typeof e==`function`?(n.fromAttributes=function(){throw Error(`graphology-utils/getters/createNodeValueGetter: irrelevant usage.`)},n.fromGraph=function(t,n){return r(e(n,t.getNodeAttributes(n)))},n.fromEntry=function(t,n){return r(e(t,n))}):(n.fromAttributes=a,n.fromGraph=a,n.fromEntry=a),n}function r(e,t){var n={},r=function(e){return e===void 0?t:e};typeof t==`function`&&(r=t);var i=function(t){return r(t[e])},a=function(){return r(void 0)};return typeof e==`string`?(n.fromAttributes=i,n.fromGraph=function(e,t){return i(e.getEdgeAttributes(t))},n.fromEntry=function(e,t){return i(t)},n.fromPartialEntry=n.fromEntry,n.fromMinimalEntry=n.fromEntry):typeof e==`function`?(n.fromAttributes=function(){throw Error(`graphology-utils/getters/createEdgeValueGetter: irrelevant usage.`)},n.fromGraph=function(t,n){var i=t.extremities(n);return r(e(n,t.getEdgeAttributes(n),i[0],i[1],t.getNodeAttributes(i[0]),t.getNodeAttributes(i[1]),t.isUndirected(n)))},n.fromEntry=function(t,n,i,a,o,s,c){return r(e(t,n,i,a,o,s,c))},n.fromPartialEntry=function(t,n,i,a){return r(e(t,n,i,a))},n.fromMinimalEntry=function(t,n){return r(e(t,n))}):(n.fromAttributes=a,n.fromGraph=a,n.fromEntry=a,n.fromMinimalEntry=a),n}e.createNodeValueGetter=n,e.createEdgeValueGetter=r,e.createEdgeWeightGetter=function(e){return r(e,t)}})),yi=o(((e,t)=>{var n=0,r=1,i=2,a=3,o=4,s=5,c=6,l=7,u=8,d=9,f=0,p=1,m=2,h=0,g=1,_=2,v=3,y=4,b=5,x=6,S=7,C=8,w=3,T=10,E=3,D=9,O=10;t.exports=function(e,t,ee){var te,k,A,j,M,N,P,F,I,ne,L=t.length,re=ee.length,R=e.adjustSizes,z=e.barnesHutTheta*e.barnesHutTheta,ie,B,V,H,ae,U,W,G=[];for(A=0;A<L;A+=T)t[A+o]=t[A+i],t[A+s]=t[A+a],t[A+i]=0,t[A+a]=0;if(e.outboundAttractionDistribution){for(ie=0,A=0;A<L;A+=T)ie+=t[A+c];ie/=L/T}if(e.barnesHutOptimize){var oe=1/0,se=-1/0,ce=1/0,le=-1/0,ue,de,fe;for(A=0;A<L;A+=T)oe=Math.min(oe,t[A+n]),se=Math.max(se,t[A+n]),ce=Math.min(ce,t[A+r]),le=Math.max(le,t[A+r]);var pe=se-oe,me=le-ce;for(pe>me?(ce-=(pe-me)/2,le=ce+pe):(oe-=(me-pe)/2,se=oe+me),G[0+h]=-1,G[0+g]=(oe+se)/2,G[0+_]=(ce+le)/2,G[0+v]=Math.max(se-oe,le-ce),G[0+y]=-1,G[0+b]=-1,G[0+x]=0,G[0+S]=0,G[0+C]=0,te=1,A=0;A<L;A+=T)for(k=0,fe=w;;)if(G[k+b]>=0){ue=t[A+n]<G[k+g]?t[A+r]<G[k+_]?G[k+b]:G[k+b]+D:t[A+r]<G[k+_]?G[k+b]+D*2:G[k+b]+D*3,G[k+S]=(G[k+S]*G[k+x]+t[A+n]*t[A+c])/(G[k+x]+t[A+c]),G[k+C]=(G[k+C]*G[k+x]+t[A+r]*t[A+c])/(G[k+x]+t[A+c]),G[k+x]+=t[A+c],k=ue;continue}else if(G[k+h]<0){G[k+h]=A;break}else{if(G[k+b]=te*D,F=G[k+v]/2,I=G[k+b],G[I+h]=-1,G[I+g]=G[k+g]-F,G[I+_]=G[k+_]-F,G[I+v]=F,G[I+y]=I+D,G[I+b]=-1,G[I+x]=0,G[I+S]=0,G[I+C]=0,I+=D,G[I+h]=-1,G[I+g]=G[k+g]-F,G[I+_]=G[k+_]+F,G[I+v]=F,G[I+y]=I+D,G[I+b]=-1,G[I+x]=0,G[I+S]=0,G[I+C]=0,I+=D,G[I+h]=-1,G[I+g]=G[k+g]+F,G[I+_]=G[k+_]-F,G[I+v]=F,G[I+y]=I+D,G[I+b]=-1,G[I+x]=0,G[I+S]=0,G[I+C]=0,I+=D,G[I+h]=-1,G[I+g]=G[k+g]+F,G[I+_]=G[k+_]+F,G[I+v]=F,G[I+y]=G[k+y],G[I+b]=-1,G[I+x]=0,G[I+S]=0,G[I+C]=0,te+=4,ue=t[G[k+h]+n]<G[k+g]?t[G[k+h]+r]<G[k+_]?G[k+b]:G[k+b]+D:t[G[k+h]+r]<G[k+_]?G[k+b]+D*2:G[k+b]+D*3,G[k+x]=t[G[k+h]+c],G[k+S]=t[G[k+h]+n],G[k+C]=t[G[k+h]+r],G[ue+h]=G[k+h],G[k+h]=-1,de=t[A+n]<G[k+g]?t[A+r]<G[k+_]?G[k+b]:G[k+b]+D:t[A+r]<G[k+_]?G[k+b]+D*2:G[k+b]+D*3,ue===de)if(fe--){k=ue;continue}else{fe=w;break}G[de+h]=A;break}}if(e.barnesHutOptimize)for(B=e.scalingRatio,A=0;A<L;A+=T)for(k=0;;)if(G[k+b]>=0)if(U=(t[A+n]-G[k+S])**2+(t[A+r]-G[k+C])**2,ne=G[k+v],4*ne*ne/U<z){if(V=t[A+n]-G[k+S],H=t[A+r]-G[k+C],R===!0?U>0?(W=B*t[A+c]*G[k+x]/U,t[A+i]+=V*W,t[A+a]+=H*W):U<0&&(W=-B*t[A+c]*G[k+x]/Math.sqrt(U),t[A+i]+=V*W,t[A+a]+=H*W):U>0&&(W=B*t[A+c]*G[k+x]/U,t[A+i]+=V*W,t[A+a]+=H*W),k=G[k+y],k<0)break;continue}else{k=G[k+b];continue}else{if(N=G[k+h],N>=0&&N!==A&&(V=t[A+n]-t[N+n],H=t[A+r]-t[N+r],U=V*V+H*H,R===!0?U>0?(W=B*t[A+c]*t[N+c]/U,t[A+i]+=V*W,t[A+a]+=H*W):U<0&&(W=-B*t[A+c]*t[N+c]/Math.sqrt(U),t[A+i]+=V*W,t[A+a]+=H*W):U>0&&(W=B*t[A+c]*t[N+c]/U,t[A+i]+=V*W,t[A+a]+=H*W)),k=G[k+y],k<0)break;continue}else for(B=e.scalingRatio,j=0;j<L;j+=T)for(M=0;M<j;M+=T)V=t[j+n]-t[M+n],H=t[j+r]-t[M+r],R===!0?(U=Math.sqrt(V*V+H*H)-t[j+u]-t[M+u],U>0?(W=B*t[j+c]*t[M+c]/U/U,t[j+i]+=V*W,t[j+a]+=H*W,t[M+i]-=V*W,t[M+a]-=H*W):U<0&&(W=100*B*t[j+c]*t[M+c],t[j+i]+=V*W,t[j+a]+=H*W,t[M+i]-=V*W,t[M+a]-=H*W)):(U=Math.sqrt(V*V+H*H),U>0&&(W=B*t[j+c]*t[M+c]/U/U,t[j+i]+=V*W,t[j+a]+=H*W,t[M+i]-=V*W,t[M+a]-=H*W));for(I=e.gravity/e.scalingRatio,B=e.scalingRatio,A=0;A<L;A+=T)W=0,V=t[A+n],H=t[A+r],U=Math.sqrt(V**2+H**2),e.strongGravityMode?U>0&&(W=B*t[A+c]*I):U>0&&(W=B*t[A+c]*I/U),t[A+i]-=V*W,t[A+a]-=H*W;for(B=1*(e.outboundAttractionDistribution?ie:1),P=0;P<re;P+=E)j=ee[P+f],M=ee[P+p],F=ee[P+m],ae=F**+e.edgeWeightInfluence,V=t[j+n]-t[M+n],H=t[j+r]-t[M+r],R===!0?(U=Math.sqrt(V*V+H*H)-t[j+u]-t[M+u],e.linLogMode?e.outboundAttractionDistribution?U>0&&(W=-B*ae*Math.log(1+U)/U/t[j+c]):U>0&&(W=-B*ae*Math.log(1+U)/U):e.outboundAttractionDistribution?U>0&&(W=-B*ae/t[j+c]):U>0&&(W=-B*ae)):(U=Math.sqrt(V**2+H**2),e.linLogMode?e.outboundAttractionDistribution?U>0&&(W=-B*ae*Math.log(1+U)/U/t[j+c]):U>0&&(W=-B*ae*Math.log(1+U)/U):e.outboundAttractionDistribution?(U=1,W=-B*ae/t[j+c]):(U=1,W=-B*ae)),U>0&&(t[j+i]+=V*W,t[j+a]+=H*W,t[M+i]-=V*W,t[M+a]-=H*W);var he,ge,_e,ve,ye,be;if(R===!0)for(A=0;A<L;A+=T)t[A+d]!==1&&(he=Math.sqrt(t[A+i]**2+t[A+a]**2),he>O&&(t[A+i]=t[A+i]*O/he,t[A+a]=t[A+a]*O/he),ge=t[A+c]*Math.sqrt((t[A+o]-t[A+i])*(t[A+o]-t[A+i])+(t[A+s]-t[A+a])*(t[A+s]-t[A+a])),_e=Math.sqrt((t[A+o]+t[A+i])*(t[A+o]+t[A+i])+(t[A+s]+t[A+a])*(t[A+s]+t[A+a]))/2,ve=.1*Math.log(1+_e)/(1+Math.sqrt(ge)),ye=t[A+n]+t[A+i]*(ve/e.slowDown),t[A+n]=ye,be=t[A+r]+t[A+a]*(ve/e.slowDown),t[A+r]=be);else for(A=0;A<L;A+=T)t[A+d]!==1&&(ge=t[A+c]*Math.sqrt((t[A+o]-t[A+i])*(t[A+o]-t[A+i])+(t[A+s]-t[A+a])*(t[A+s]-t[A+a])),_e=Math.sqrt((t[A+o]+t[A+i])*(t[A+o]+t[A+i])+(t[A+s]+t[A+a])*(t[A+s]+t[A+a]))/2,ve=t[A+l]*Math.log(1+_e)/(1+Math.sqrt(ge)),t[A+l]=Math.min(1,Math.sqrt(ve*(t[A+i]**2+t[A+a]**2)/(1+Math.sqrt(ge)))),ye=t[A+n]+t[A+i]*(ve/e.slowDown),t[A+n]=ye,be=t[A+r]+t[A+a]*(ve/e.slowDown),t[A+r]=be);return{}}})),bi=o((e=>{var t=10,n=3;e.assign=function(e){e||={};var t=Array.prototype.slice.call(arguments).slice(1),n,r,i;for(n=0,i=t.length;n<i;n++)if(t[n])for(r in t[n])e[r]=t[n][r];return e},e.validateSettings=function(e){return`linLogMode`in e&&typeof e.linLogMode!=`boolean`?{message:"the `linLogMode` setting should be a boolean."}:`outboundAttractionDistribution`in e&&typeof e.outboundAttractionDistribution!=`boolean`?{message:"the `outboundAttractionDistribution` setting should be a boolean."}:`adjustSizes`in e&&typeof e.adjustSizes!=`boolean`?{message:"the `adjustSizes` setting should be a boolean."}:`edgeWeightInfluence`in e&&typeof e.edgeWeightInfluence!=`number`?{message:"the `edgeWeightInfluence` setting should be a number."}:`scalingRatio`in e&&!(typeof e.scalingRatio==`number`&&e.scalingRatio>=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:`strongGravityMode`in e&&typeof e.strongGravityMode!=`boolean`?{message:"the `strongGravityMode` setting should be a boolean."}:`gravity`in e&&!(typeof e.gravity==`number`&&e.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:`slowDown`in e&&!(typeof e.slowDown==`number`||e.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:`barnesHutOptimize`in e&&typeof e.barnesHutOptimize!=`boolean`?{message:"the `barnesHutOptimize` setting should be a boolean."}:`barnesHutTheta`in e&&!(typeof e.barnesHutTheta==`number`&&e.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},e.graphToByteArrays=function(e,r){var i=e.order,a=e.size,o={},s,c=new Float32Array(i*t),l=new Float32Array(a*n);return s=0,e.forEachNode(function(e,n){o[e]=s,c[s]=n.x,c[s+1]=n.y,c[s+2]=0,c[s+3]=0,c[s+4]=0,c[s+5]=0,c[s+6]=1,c[s+7]=1,c[s+8]=n.size||1,c[s+9]=+!!n.fixed,s+=t}),s=0,e.forEachEdge(function(e,t,i,a,u,d,f){var p=o[i],m=o[a],h=r(e,t,i,a,u,d,f);c[p+6]+=h,c[m+6]+=h,l[s]=p,l[s+1]=m,l[s+2]=h,s+=n}),{nodes:c,edges:l}},e.assignLayoutChanges=function(e,n,r){var i=0;e.updateEachNodeAttributes(function(e,a){return a.x=n[i],a.y=n[i+1],i+=t,r?r(e,a):a})},e.readGraphPositions=function(e,n){var r=0;e.forEachNode(function(e,i){n[r]=i.x,n[r+1]=i.y,r+=t})},e.collectLayoutChanges=function(e,n,r){for(var i=e.nodes(),a={},o=0,s=0,c=n.length;o<c;o+=t){if(r){var l=Object.assign({},e.getNodeAttributes(i[s]));l.x=n[o],l.y=n[o+1],l=r(i[s],l),a[i[s]]={x:l.x,y:l.y}}else a[i[s]]={x:n[o],y:n[o+1]};s++}return a},e.createWorker=function(e){var t=window.URL||window.webkitURL,n=e.toString(),r=t.createObjectURL(new Blob([`(`+n+`).call(this);`],{type:`text/javascript`})),i=new Worker(r);return t.revokeObjectURL(r),i}})),xi=o(((e,t)=>{t.exports={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}})),Si=o(((e,t)=>{var n=hr(),r=vi().createEdgeWeightGetter,i=yi(),a=bi(),o=xi();function s(e,t,s){if(!n(t))throw Error(`graphology-layout-forceatlas2: the given graph is not a valid graphology instance.`);typeof s==`number`&&(s={iterations:s});var c=s.iterations;if(typeof c!=`number`)throw Error(`graphology-layout-forceatlas2: invalid number of iterations.`);if(c<=0)throw Error(`graphology-layout-forceatlas2: you should provide a positive number of iterations.`);var l=r(`getEdgeWeight`in s?s.getEdgeWeight:`weight`).fromEntry,u=typeof s.outputReducer==`function`?s.outputReducer:null,d=a.assign({},o,s.settings),f=a.validateSettings(d);if(f)throw Error(`graphology-layout-forceatlas2: `+f.message);var p=a.graphToByteArrays(t,l),m;for(m=0;m<c;m++)i(d,p.nodes,p.edges);if(e){a.assignLayoutChanges(t,p.nodes,u);return}return a.collectLayoutChanges(t,p.nodes)}function c(e){var t=typeof e==`number`?e:e.order;return{barnesHutOptimize:t>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(t)}}var l=s.bind(null,!1);l.assign=s.bind(null,!0),l.inferSettings=c,t.exports=l})),Ci=o(((e,t)=>{t.exports=function(){var e,t,n={};(function(){var e=0,t=1,r=2,i=3,a=4,o=5,s=6,c=7,l=8,u=9,d=0,f=1,p=2,m=0,h=1,g=2,_=3,v=4,y=5,b=6,x=7,S=8,C=3,w=10,T=3,E=9,D=10;n.exports=function(n,O,ee){var te,k,A,j,M,N,P,F,I,ne,L=O.length,re=ee.length,R=n.adjustSizes,z=n.barnesHutTheta*n.barnesHutTheta,ie,B,V,H,ae,U,W,G=[];for(A=0;A<L;A+=w)O[A+a]=O[A+r],O[A+o]=O[A+i],O[A+r]=0,O[A+i]=0;if(n.outboundAttractionDistribution){for(ie=0,A=0;A<L;A+=w)ie+=O[A+s];ie/=L/w}if(n.barnesHutOptimize){var oe=1/0,se=-1/0,ce=1/0,le=-1/0,ue,de,fe;for(A=0;A<L;A+=w)oe=Math.min(oe,O[A+e]),se=Math.max(se,O[A+e]),ce=Math.min(ce,O[A+t]),le=Math.max(le,O[A+t]);var pe=se-oe,me=le-ce;for(pe>me?(ce-=(pe-me)/2,le=ce+pe):(oe-=(me-pe)/2,se=oe+me),G[0+m]=-1,G[0+h]=(oe+se)/2,G[0+g]=(ce+le)/2,G[0+_]=Math.max(se-oe,le-ce),G[0+v]=-1,G[0+y]=-1,G[0+b]=0,G[0+x]=0,G[0+S]=0,te=1,A=0;A<L;A+=w)for(k=0,fe=C;;)if(G[k+y]>=0){ue=O[A+e]<G[k+h]?O[A+t]<G[k+g]?G[k+y]:G[k+y]+E:O[A+t]<G[k+g]?G[k+y]+E*2:G[k+y]+E*3,G[k+x]=(G[k+x]*G[k+b]+O[A+e]*O[A+s])/(G[k+b]+O[A+s]),G[k+S]=(G[k+S]*G[k+b]+O[A+t]*O[A+s])/(G[k+b]+O[A+s]),G[k+b]+=O[A+s],k=ue;continue}else if(G[k+m]<0){G[k+m]=A;break}else{if(G[k+y]=te*E,F=G[k+_]/2,I=G[k+y],G[I+m]=-1,G[I+h]=G[k+h]-F,G[I+g]=G[k+g]-F,G[I+_]=F,G[I+v]=I+E,G[I+y]=-1,G[I+b]=0,G[I+x]=0,G[I+S]=0,I+=E,G[I+m]=-1,G[I+h]=G[k+h]-F,G[I+g]=G[k+g]+F,G[I+_]=F,G[I+v]=I+E,G[I+y]=-1,G[I+b]=0,G[I+x]=0,G[I+S]=0,I+=E,G[I+m]=-1,G[I+h]=G[k+h]+F,G[I+g]=G[k+g]-F,G[I+_]=F,G[I+v]=I+E,G[I+y]=-1,G[I+b]=0,G[I+x]=0,G[I+S]=0,I+=E,G[I+m]=-1,G[I+h]=G[k+h]+F,G[I+g]=G[k+g]+F,G[I+_]=F,G[I+v]=G[k+v],G[I+y]=-1,G[I+b]=0,G[I+x]=0,G[I+S]=0,te+=4,ue=O[G[k+m]+e]<G[k+h]?O[G[k+m]+t]<G[k+g]?G[k+y]:G[k+y]+E:O[G[k+m]+t]<G[k+g]?G[k+y]+E*2:G[k+y]+E*3,G[k+b]=O[G[k+m]+s],G[k+x]=O[G[k+m]+e],G[k+S]=O[G[k+m]+t],G[ue+m]=G[k+m],G[k+m]=-1,de=O[A+e]<G[k+h]?O[A+t]<G[k+g]?G[k+y]:G[k+y]+E:O[A+t]<G[k+g]?G[k+y]+E*2:G[k+y]+E*3,ue===de)if(fe--){k=ue;continue}else{fe=C;break}G[de+m]=A;break}}if(n.barnesHutOptimize)for(B=n.scalingRatio,A=0;A<L;A+=w)for(k=0;;)if(G[k+y]>=0)if(U=(O[A+e]-G[k+x])**2+(O[A+t]-G[k+S])**2,ne=G[k+_],4*ne*ne/U<z){if(V=O[A+e]-G[k+x],H=O[A+t]-G[k+S],R===!0?U>0?(W=B*O[A+s]*G[k+b]/U,O[A+r]+=V*W,O[A+i]+=H*W):U<0&&(W=-B*O[A+s]*G[k+b]/Math.sqrt(U),O[A+r]+=V*W,O[A+i]+=H*W):U>0&&(W=B*O[A+s]*G[k+b]/U,O[A+r]+=V*W,O[A+i]+=H*W),k=G[k+v],k<0)break;continue}else{k=G[k+y];continue}else{if(N=G[k+m],N>=0&&N!==A&&(V=O[A+e]-O[N+e],H=O[A+t]-O[N+t],U=V*V+H*H,R===!0?U>0?(W=B*O[A+s]*O[N+s]/U,O[A+r]+=V*W,O[A+i]+=H*W):U<0&&(W=-B*O[A+s]*O[N+s]/Math.sqrt(U),O[A+r]+=V*W,O[A+i]+=H*W):U>0&&(W=B*O[A+s]*O[N+s]/U,O[A+r]+=V*W,O[A+i]+=H*W)),k=G[k+v],k<0)break;continue}else for(B=n.scalingRatio,j=0;j<L;j+=w)for(M=0;M<j;M+=w)V=O[j+e]-O[M+e],H=O[j+t]-O[M+t],R===!0?(U=Math.sqrt(V*V+H*H)-O[j+l]-O[M+l],U>0?(W=B*O[j+s]*O[M+s]/U/U,O[j+r]+=V*W,O[j+i]+=H*W,O[M+r]-=V*W,O[M+i]-=H*W):U<0&&(W=100*B*O[j+s]*O[M+s],O[j+r]+=V*W,O[j+i]+=H*W,O[M+r]-=V*W,O[M+i]-=H*W)):(U=Math.sqrt(V*V+H*H),U>0&&(W=B*O[j+s]*O[M+s]/U/U,O[j+r]+=V*W,O[j+i]+=H*W,O[M+r]-=V*W,O[M+i]-=H*W));for(I=n.gravity/n.scalingRatio,B=n.scalingRatio,A=0;A<L;A+=w)W=0,V=O[A+e],H=O[A+t],U=Math.sqrt(V**2+H**2),n.strongGravityMode?U>0&&(W=B*O[A+s]*I):U>0&&(W=B*O[A+s]*I/U),O[A+r]-=V*W,O[A+i]-=H*W;for(B=1*(n.outboundAttractionDistribution?ie:1),P=0;P<re;P+=T)j=ee[P+d],M=ee[P+f],F=ee[P+p],ae=F**+n.edgeWeightInfluence,V=O[j+e]-O[M+e],H=O[j+t]-O[M+t],R===!0?(U=Math.sqrt(V*V+H*H)-O[j+l]-O[M+l],n.linLogMode?n.outboundAttractionDistribution?U>0&&(W=-B*ae*Math.log(1+U)/U/O[j+s]):U>0&&(W=-B*ae*Math.log(1+U)/U):n.outboundAttractionDistribution?U>0&&(W=-B*ae/O[j+s]):U>0&&(W=-B*ae)):(U=Math.sqrt(V**2+H**2),n.linLogMode?n.outboundAttractionDistribution?U>0&&(W=-B*ae*Math.log(1+U)/U/O[j+s]):U>0&&(W=-B*ae*Math.log(1+U)/U):n.outboundAttractionDistribution?(U=1,W=-B*ae/O[j+s]):(U=1,W=-B*ae)),U>0&&(O[j+r]+=V*W,O[j+i]+=H*W,O[M+r]-=V*W,O[M+i]-=H*W);var he,ge,_e,ve,ye,be;if(R===!0)for(A=0;A<L;A+=w)O[A+u]!==1&&(he=Math.sqrt(O[A+r]**2+O[A+i]**2),he>D&&(O[A+r]=O[A+r]*D/he,O[A+i]=O[A+i]*D/he),ge=O[A+s]*Math.sqrt((O[A+a]-O[A+r])*(O[A+a]-O[A+r])+(O[A+o]-O[A+i])*(O[A+o]-O[A+i])),_e=Math.sqrt((O[A+a]+O[A+r])*(O[A+a]+O[A+r])+(O[A+o]+O[A+i])*(O[A+o]+O[A+i]))/2,ve=.1*Math.log(1+_e)/(1+Math.sqrt(ge)),ye=O[A+e]+O[A+r]*(ve/n.slowDown),O[A+e]=ye,be=O[A+t]+O[A+i]*(ve/n.slowDown),O[A+t]=be);else for(A=0;A<L;A+=w)O[A+u]!==1&&(ge=O[A+s]*Math.sqrt((O[A+a]-O[A+r])*(O[A+a]-O[A+r])+(O[A+o]-O[A+i])*(O[A+o]-O[A+i])),_e=Math.sqrt((O[A+a]+O[A+r])*(O[A+a]+O[A+r])+(O[A+o]+O[A+i])*(O[A+o]+O[A+i]))/2,ve=O[A+c]*Math.log(1+_e)/(1+Math.sqrt(ge)),O[A+c]=Math.min(1,Math.sqrt(ve*(O[A+r]**2+O[A+i]**2)/(1+Math.sqrt(ge)))),ye=O[A+e]+O[A+r]*(ve/n.slowDown),O[A+e]=ye,be=O[A+t]+O[A+i]*(ve/n.slowDown),O[A+t]=be);return{}}})();var r=n.exports;self.addEventListener(`message`,function(n){var i=n.data;e=new Float32Array(i.nodes),i.edges&&(t=new Float32Array(i.edges)),r(i.settings,e,t),self.postMessage({nodes:e.buffer},[e.buffer])})}})),wi=o(((e,t)=>{var n=Ci(),r=hr(),i=vi().createEdgeWeightGetter,a=bi(),o=xi();function s(e,t){if(t||={},!r(e))throw Error(`graphology-layout-forceatlas2/worker: the given graph is not a valid graphology instance.`);var n=i(`getEdgeWeight`in t?t.getEdgeWeight:`weight`).fromEntry,s=a.assign({},o,t.settings),c=a.validateSettings(s);if(c)throw Error(`graphology-layout-forceatlas2/worker: `+c.message);this.worker=null,this.graph=e,this.settings=s,this.getEdgeWeight=n,this.matrices=null,this.running=!1,this.killed=!1,this.outputReducer=typeof t.outputReducer==`function`?t.outputReducer:null,this.handleMessage=this.handleMessage.bind(this);var l=void 0,u=this;this.handleGraphUpdate=function(){u.worker&&u.worker.terminate(),l&&clearTimeout(l),l=setTimeout(function(){l=void 0,u.spawnWorker()},0)},e.on(`nodeAdded`,this.handleGraphUpdate),e.on(`edgeAdded`,this.handleGraphUpdate),e.on(`nodeDropped`,this.handleGraphUpdate),e.on(`edgeDropped`,this.handleGraphUpdate),this.spawnWorker()}s.prototype.isRunning=function(){return this.running},s.prototype.spawnWorker=function(){this.worker&&this.worker.terminate(),this.worker=a.createWorker(n),this.worker.addEventListener(`message`,this.handleMessage),this.running&&(this.running=!1,this.start())},s.prototype.handleMessage=function(e){if(this.running){var t=new Float32Array(e.data.nodes);a.assignLayoutChanges(this.graph,t,this.outputReducer),this.outputReducer&&a.readGraphPositions(this.graph,t),this.matrices.nodes=t,this.askForIterations()}},s.prototype.askForIterations=function(e){var t=this.matrices,n={settings:this.settings,nodes:t.nodes.buffer},r=[t.nodes.buffer];return e&&(n.edges=t.edges.buffer,r.push(t.edges.buffer)),this.worker.postMessage(n,r),this},s.prototype.start=function(){if(this.killed)throw Error(`graphology-layout-forceatlas2/worker.start: layout was killed.`);return this.running?this:(this.matrices=a.graphToByteArrays(this.graph,this.getEdgeWeight),this.running=!0,this.askForIterations(!0),this)},s.prototype.stop=function(){return this.running=!1,this},s.prototype.kill=function(){if(this.killed)return this;this.running=!1,this.killed=!0,this.matrices=null,this.worker.terminate(),this.graph.removeListener(`nodeAdded`,this.handleGraphUpdate),this.graph.removeListener(`edgeAdded`,this.handleGraphUpdate),this.graph.removeListener(`nodeDropped`,this.handleGraphUpdate),this.graph.removeListener(`edgeDropped`,this.handleGraphUpdate)},t.exports=s})),Y=c(Si(),1),Ti=c(wi(),1),Ei={function:`#22D3EE`,file:`#FB923C`,class:`#4ADE80`,interface:`#A78BFA`,enum:`#6366F1`,constant:`#FACC15`,type_alias:`#FB7185`,flow:`#14B8A6`,method:`#38BDF8`,constructor:`#06B6D4`,struct:`#86EFAC`,trait:`#C4B5FD`,variable:`#FDE68A`,property:`#FCA5A5`,namespace:`#818CF8`,module:`#E879F9`,route:`#F87171`,cluster:`#64748B`,directory:`#475569`},Di={contains:`#334155`,calls:`#38bdf8`,imports:`#64748b`,extends:`#4ade80`,implements:`#f97316`,has_member:`#facc15`,accesses:`#06b6d4`,overrides:`#ef4444`,belongs_to:`#475569`,step_of:`#fb923c`,handles:`#fb7185`},Oi={contains:.08,calls:.55,imports:.25,extends:.5,implements:.45,has_member:.18,accesses:.3,overrides:.45,belongs_to:.1,step_of:.35,handles:.4};function ki(e,t){return`${e}${Math.round(Math.max(0,Math.min(1,t))*255).toString(16).padStart(2,`0`)}`}function Ai(e,t){let n=new Set([e]);for(let r of t)r.source===e?n.add(r.target):r.target===e&&n.add(r.source);return n}function ji(e,t,n){let r=t.label;if(!r)return;let i=n.labelSize??11,a=n.labelFont??`Outfit, system-ui, sans-serif`;e.font=`${n.labelWeight??`600`} ${i}px ${a}`;let o=e.measureText(r).width,s=t.size??8,c=t.x,l=t.y-s-10,u=i+10,d=o+16;e.fillStyle=`#0a0a10`,e.shadowOffsetX=0,e.shadowOffsetY=2,e.shadowBlur=12,e.shadowColor=`rgba(0,0,0,0.9)`,e.beginPath(),e.roundRect(c-d/2,l-u/2,d,u,4),e.fill(),e.shadowBlur=0,e.strokeStyle=t.color??`#7c3aed`,e.lineWidth=1.5,e.stroke(),e.fillStyle=`#f5f5f7`,e.textAlign=`center`,e.textBaseline=`middle`,e.fillText(r,c,l),e.beginPath(),e.arc(t.x,t.y,s+4,0,Math.PI*2),e.strokeStyle=t.color??`#7c3aed`,e.lineWidth=2,e.globalAlpha=.5,e.stroke(),e.globalAlpha=1,e.shadowBlur=0}function Mi(e){let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:{r:100,g:100,b:100}}function Ni(e,t,n){return`#`+[e,t,n].map(e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,`0`)).join(``)}function Pi(e,t){let n=Mi(e),r={r:10,g:10,b:16};return Ni(r.r+(n.r-r.r)*t,r.g+(n.g-r.g)*t,r.b+(n.b-r.b)*t)}var Fi=e=>({gravity:e<500?.8:e<2e3?.5:.3,scalingRatio:e<500?15:e<2e3?30:60,slowDown:e<500?1:e<2e3?2:3,barnesHutOptimize:e>200,barnesHutTheta:e>=2e3?.8:.6,strongGravityMode:!1,outboundAttractionDistribution:!0,linLogMode:!1,adjustSizes:!0,edgeWeightInfluence:1}),Ii=e=>e>1e4?45e3:e>5e3?35e3:e>2e3?3e4:e>1e3?25e3:2e4;function Li(e,t){let n=new Map,r=new Map;for(let e of t)(e.kind===`contains`||e.kind===`has_member`||e.kind===`belongs_to`)&&(n.set(e.target,e.source),r.has(e.source)||r.set(e.source,[]),r.get(e.source).push(e.target));let i=e.length,a=new Set([`file`,`module`,`namespace`,`class`,`struct`,`cluster`,`directory`]),o=e.filter(e=>a.has(e.kind)),s=e.filter(e=>!a.has(e.kind)),c=Math.sqrt(i)*40,l=Math.sqrt(i)*3,u=Math.PI*(3-Math.sqrt(5)),d=new Map;o.forEach((e,t)=>{let n=t*u,r=c*Math.sqrt((t+1)/Math.max(o.length,1)),i=c*.15;d.set(e.id,{x:r*Math.cos(n)+(Math.random()-.5)*i,y:r*Math.sin(n)+(Math.random()-.5)*i})});let f=e=>{if(d.has(e))return;let t=d.get(n.get(e)??``);t?d.set(e,{x:t.x+(Math.random()-.5)*l,y:t.y+(Math.random()-.5)*l}):d.set(e,{x:(Math.random()-.5)*c*.5,y:(Math.random()-.5)*c*.5})},p=o.map(e=>e.id),m=new Set(p);for(;p.length>0;){let e=p.shift();for(let t of r.get(e)??[])m.has(t)||(m.add(t),f(t),p.push(t))}for(let e of s)f(e.id);for(let t of e)f(t.id);return d}function Ri(e){return{cluster:12,directory:10,module:10,namespace:10,file:7,class:8,struct:8,interface:7,trait:7,function:4,enum:5,route:5,method:3,constructor:3,type_alias:3,flow:3,constant:2,variable:2,property:2}[e]??3}function zi(e){return{cluster:50,directory:20,module:20,namespace:15,file:10,class:8,struct:8,interface:6,trait:6,function:2,method:2,enum:3,route:3,constructor:1,type_alias:1,constant:1,variable:1,property:1}[e]??1}function Bi(){let{state:e,dispatch:t}=E(),n=(0,b.useRef)(e);n.current=e;let r=(0,b.useRef)(t);r.current=t;let i=(0,b.useRef)(new K({multi:!1,type:`directed`})),a=(0,b.useRef)(null),o=(0,b.useRef)(null),s=(0,b.useRef)(null),c=(0,b.useRef)(null),l=(0,b.useRef)(null),[u,d]=(0,b.useState)({nodes:0,edges:0}),[f,p]=(0,b.useState)(!1),m=(0,b.useRef)({nodeCount:-1,edgeCount:-1}),h=()=>{c.current&&=(clearTimeout(c.current),null),l.current&&=(cancelAnimationFrame(l.current),null),s.current&&=(s.current.stop(),null),p(!1)},g=e=>{if(h(),e.order===0)return;let t=new Ti.default(e,{settings:{...Y.default.inferSettings(e),...Fi(e.order)}});s.current=t,t.start(),p(!0);let n=()=>{s.current&&(a.current?.refresh(),l.current=requestAnimationFrame(n))};l.current=requestAnimationFrame(n),c.current=setTimeout(()=>{t.stop(),s.current=null,l.current&&=(cancelAnimationFrame(l.current),null),p(!1),a.current?.refresh()},Ii(e.order))};return(0,b.useEffect)(()=>{if(e.nodes.length===0||m.current.nodeCount===e.nodes.length&&m.current.edgeCount===e.edges.length)return;m.current={nodeCount:e.nodes.length,edgeCount:e.edges.length};let t=i.current;h(),t.clear();let r=Li(e.nodes,e.edges);for(let n of e.nodes){let e=r.get(n.id)??{x:(Math.random()-.5)*500,y:(Math.random()-.5)*500};try{t.addNode(n.id,{label:n.name,baseLabel:n.name,x:e.x,y:e.y,size:Ri(n.kind),color:Ei[n.kind]??`#6b7280`,nodeKind:n.kind,mass:zi(n.kind)})}catch{}}for(let n of e.edges)if(!(!t.hasNode(n.source)||!t.hasNode(n.target)||n.source===n.target))try{let e=ki(Di[n.kind]??`#4b5563`,Oi[n.kind]??.25);t.addEdge(n.source,n.target,{color:e,baseColor:e,size:n.kind===`calls`?.8:n.kind===`imports`?.5:.4,type:`arrow`,edgeKind:n.kind})}catch{}let o=new Map;t.forEachNode(e=>o.set(e,t.degree(e)));let s=[...o.values()].sort((e,t)=>t-e);if(t._degreeMap=o,t._topNThreshold=s[Math.min(30,s.length-1)]??0,a.current){Vi(a.current,t,n.current,null,null),a.current.refresh(),a.current.getCamera().animatedReset({duration:500});let e=0,r=0;t.forEachNode((t,n)=>{n.hidden||e++}),t.forEachEdge((e,t)=>{t.hidden||r++}),d({nodes:e,edges:r})}g(t)},[e.nodes,e.edges]),(0,b.useEffect)(()=>{if(!o.current||a.current)return;let e=i.current,t=new _i(e,o.current,{allowInvalidContainer:!0,renderEdgeLabels:!1,defaultEdgeType:`arrow`,labelRenderedSizeThreshold:4,labelFont:`"Outfit", "Inter", system-ui, sans-serif`,labelColor:{color:`#e4e4ed`},labelSize:11,labelWeight:`600`,labelDensity:.15,labelGridCellSize:80,defaultDrawNodeHover:ji,hideEdgesOnMove:!0,zIndex:!0,minCameraRatio:.002,maxCameraRatio:50});a.current=t,Vi(t,e,n.current,null,null),t.refresh(),o.current&&(o.current.style.cursor=`grab`);let u=!1;t.on(`clickNode`,({node:e})=>{u=!0;let t=n.current.nodes.find(t=>t.id===e);t&&r.current({type:`SELECT_NODE`,node:t}),setTimeout(()=>{u=!1},50)}),t.on(`clickStage`,()=>{u||r.current({type:`SELECT_NODE`,node:null})}),t.on(`enterNode`,({node:e})=>{r.current({type:`HOVER_NODE`,nodeId:e}),o.current&&(o.current.style.cursor=`pointer`)}),t.on(`leaveNode`,()=>{r.current({type:`HOVER_NODE`,nodeId:null}),o.current&&(o.current.style.cursor=`grab`)});let d=e=>{let n=e.detail,r=t.getCamera();n===0?r.animatedReset():r.animate({ratio:r.getState().ratio*n},{duration:200})};return window.addEventListener(`graph-zoom`,d),()=>{window.removeEventListener(`graph-zoom`,d),c.current&&=(clearTimeout(c.current),null),l.current&&=(cancelAnimationFrame(l.current),null),s.current&&=(s.current.stop(),null),t.kill(),a.current=null}},[]),(0,b.useEffect)(()=>{let t=a.current;if(!t)return;Vi(t,i.current,e,e.hoveredNodeId,e.selectedNode?.id??null),t.refresh();let n=0,r=0;i.current.forEachNode((e,t)=>{t.hidden||n++}),i.current.forEachEdge((e,t)=>{t.hidden||r++}),d({nodes:n,edges:r})},[e.filters,e.hoveredNodeId,e.selectedNode]),(0,b.useEffect)(()=>{let t=a.current;if(!t||!e.selectedNode)return;let n=t.getNodeDisplayData(e.selectedNode.id);n&&t.getCamera().animate({x:n.x,y:n.y,ratio:Math.min(t.getCamera().getState().ratio,.5)},{duration:400,easing:`quadraticInOut`})},[e.selectedNode?.id]),(0,x.jsxs)(`div`,{className:`relative w-full h-full bg-void`,children:[(0,x.jsx)(`div`,{className:`pointer-events-none absolute inset-0`,style:{background:`radial-gradient(circle at 50% 50%, rgba(124,58,237,0.04) 0%, transparent 70%)`}}),(0,x.jsx)(`div`,{ref:o,className:`absolute inset-0`}),(0,x.jsxs)(`div`,{className:`absolute top-3 left-3 flex items-center gap-2 bg-deep/90 backdrop-blur border border-border-subtle rounded-lg px-3 py-1.5 text-[10px] text-text-muted font-mono pointer-events-none shadow-lg`,children:[(0,x.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-node-function animate-pulse`}),(0,x.jsx)(`span`,{className:`text-text-secondary`,children:u.nodes}),(0,x.jsx)(`span`,{className:`text-text-muted`,children:`nodes`}),(0,x.jsx)(`span`,{className:`text-border-default`,children:`·`}),(0,x.jsx)(`span`,{className:`text-text-secondary`,children:u.edges}),(0,x.jsx)(`span`,{className:`text-text-muted`,children:`edges`})]}),f&&(0,x.jsxs)(`div`,{className:`absolute bottom-14 left-1/2 -translate-x-1/2 z-10 flex items-center gap-2 bg-accent/20 border border-accent/30 rounded-full px-3 py-1.5 backdrop-blur-sm pointer-events-none animate-fade-in`,children:[(0,x.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-accent animate-ping`}),(0,x.jsx)(`span`,{className:`text-xs font-medium text-accent`,children:`Layout optimizing…`})]}),(0,x.jsx)(Ui,{}),(0,x.jsx)(Wi,{isLayoutRunning:f,onToggleLayout:()=>{f?h():g(i.current)}})]})}function Vi(e,t,n,r,i){let a=t._topNThreshold??0,o=t._degreeMap??new Map,s=r??i,c=s?Ai(s,n.edges):null,l=n.filters.hiddenNodeKinds,u=n.filters.hiddenEdgeKinds,d=null;i&&n.filters.focusDepth!==`all`&&typeof n.filters.focusDepth==`number`&&(d=Hi(i,n.edges,n.filters.focusDepth)),e.setSetting(`nodeReducer`,(e,t)=>{let n=t.nodeKind;if(l.has(n)||d&&!d.has(e))return{...t,hidden:!0};let r=Ei[n]??t.color,i=(o.get(e)??0)>=a?t.baseLabel??t.label:``;return c?c.has(e)?{...t,hidden:!1,color:r,label:t.baseLabel??t.label,zIndex:e===s?30:25,size:e===s?(t.size??5)*1.8:(t.size??5)*1.1,highlighted:e===s}:{...t,hidden:!1,color:Pi(r,.06),label:``,zIndex:0,size:1}:{...t,hidden:!1,color:r,label:i,zIndex:0}}),e.setSetting(`edgeReducer`,(n,r)=>{let i=r.edgeKind,a=e.getGraph().extremities(n),o=t.getNodeAttribute(a[0],`nodeKind`),s=t.getNodeAttribute(a[1],`nodeKind`);return u.has(i)||l.has(o)||l.has(s)||d&&(!d.has(a[0])||!d.has(a[1]))?{...r,hidden:!0}:c?c.has(a[0])&&c.has(a[1])?{...r,hidden:!1,color:ki(Di[i]??`#9ca3af`,1),size:2,zIndex:10}:{...r,hidden:!1,color:`#0e0e1820`,size:.25,zIndex:0}:{...r,hidden:!1,color:r.baseColor??r.color,zIndex:0}})}function Hi(e,t,n){let r=new Set([e]),i=new Map;for(let e of t)(i.get(e.source)??(i.set(e.source,[]),i.get(e.source))).push(e.target),(i.get(e.target)??(i.set(e.target,[]),i.get(e.target))).push(e.source);let a=[{id:e,depth:0}];for(;a.length>0;){let{id:e,depth:t}=a.shift();if(!(t>=n))for(let n of i.get(e)??[])r.has(n)||(r.add(n),a.push({id:n,depth:t+1}))}return r}function Ui(){let[e,t]=b.useState(!0);return(0,x.jsxs)(`div`,{className:`absolute bottom-3 right-14 bg-deep/90 backdrop-blur border border-border-subtle rounded-lg shadow-xl overflow-hidden`,children:[(0,x.jsxs)(`button`,{onClick:()=>t(e=>!e),className:`flex items-center gap-2 px-3 py-1.5 text-[10px] text-text-muted hover:text-text-secondary w-full transition`,children:[(0,x.jsx)(`span`,{children:`◉`}),(0,x.jsx)(`span`,{className:`font-medium`,children:`Legend`}),(0,x.jsx)(`span`,{className:`ml-auto`,children:e?`▸`:`▾`})]}),!e&&(0,x.jsxs)(`div`,{className:`px-3 pb-2.5 space-y-1`,children:[[`function`,`class`,`interface`,`file`,`method`,`enum`].map(e=>(0,x.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-text-muted`,children:[(0,x.jsx)(`span`,{className:`w-2 h-2 rounded-full flex-shrink-0`,style:{backgroundColor:Ei[e]}}),(0,x.jsx)(`span`,{className:`capitalize`,children:e})]},e)),(0,x.jsx)(`div`,{className:`border-t border-border-subtle mt-1 pt-1 space-y-1`,children:[`calls`,`imports`,`extends`].map(e=>(0,x.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-text-muted`,children:[(0,x.jsx)(`span`,{className:`w-4 h-px flex-shrink-0`,style:{backgroundColor:Di[e]}}),(0,x.jsx)(`span`,{children:e})]},e))})]})]})}function Wi({isLayoutRunning:e,onToggleLayout:t}){let n=e=>window.dispatchEvent(new CustomEvent(`graph-zoom`,{detail:e}));return(0,x.jsxs)(`div`,{className:`absolute bottom-3 right-3 flex flex-col gap-1 bg-deep/90 backdrop-blur border border-border-subtle rounded-lg p-1 shadow-lg`,children:[(0,x.jsx)(`button`,{className:`w-8 h-8 flex items-center justify-center text-text-secondary hover:bg-hover hover:text-text-primary rounded text-sm font-bold transition`,onClick:()=>n(.7),title:`Zoom in`,children:`+`}),(0,x.jsx)(`button`,{className:`w-8 h-8 flex items-center justify-center text-text-secondary hover:bg-hover hover:text-text-primary rounded text-sm font-bold transition`,onClick:()=>n(1.4),title:`Zoom out`,children:`−`}),(0,x.jsx)(`div`,{className:`h-px bg-border-subtle mx-1`}),(0,x.jsx)(`button`,{className:`w-8 h-8 flex items-center justify-center text-text-muted hover:bg-hover hover:text-text-primary rounded text-xs transition`,onClick:()=>n(0),title:`Fit to view`,children:`⌖`}),(0,x.jsx)(`div`,{className:`h-px bg-border-subtle mx-1`}),(0,x.jsx)(`button`,{className:`w-8 h-8 flex items-center justify-center rounded text-xs transition ${e?`text-accent bg-accent/10 border border-accent/40 animate-pulse`:`text-text-muted hover:bg-hover hover:text-text-primary border border-transparent`}`,onClick:t,title:e?`Stop layout`:`Restart layout`,children:e?`⏸`:`⏵`})]})}function Gi({node:e,onClose:t}){let{state:n,dispatch:r}=E(),[i,a]=(0,b.useState)(null),[o,s]=(0,b.useState)(null),[c,l]=(0,b.useState)(!1),[u,d]=(0,b.useState)(!1),[f,p]=(0,b.useState)(`overview`);(0,b.useEffect)(()=>{let t=!1;return a(null),s(null),l(!0),new D(n.serverUrl).inspectNode(e.id,n.repoName||void 0).then(e=>{t||a(e)}).catch(()=>void 0).finally(()=>{t||l(!1)}),()=>{t=!0}},[e.id,n.serverUrl]);let m=async()=>{if(!(o||u)){d(!0);try{s(await new D(n.serverUrl).blastRadius(e.id,`both`,3,n.repoName||void 0))}catch{}finally{d(!1)}}};(0,b.useEffect)(()=>{f===`impact`&&m()},[f]);let h=e=>{if(!e)return;let t=n.nodes.find(t=>t.id===e);t&&r({type:`SELECT_NODE`,node:t})},g=({kind:e,name:t,id:n,depth:r})=>(0,x.jsxs)(`button`,{onClick:()=>h(n),className:`inline-flex items-center gap-1.5 border rounded px-2 py-0.5 text-xs text-text-secondary max-w-full truncate hover:brightness-125 transition ${r===1?`border-red-700/50 bg-red-900/20`:r===2?`border-amber-700/50 bg-amber-900/20`:`border-border-default bg-elevated`}`,title:n,children:[e&&(0,x.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full flex-shrink-0`,style:{backgroundColor:Ei[e]??`#666`}}),(0,x.jsx)(`span`,{className:`truncate`,children:t??`(unknown)`}),r!=null&&(0,x.jsxs)(`span`,{className:`text-[9px] text-text-muted ml-0.5`,children:[`d`,r]})]}),_=[`overview`,`connections`,`impact`,`source`],v=i?i.callers.length+i.callees.length+i.imports.length:0,y=o?.affectedCount??0;return(0,x.jsxs)(`div`,{className:`h-72 bg-deep border-t border-border-subtle flex flex-col overflow-hidden shadow-2xl shrink-0`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 border-b border-border-subtle bg-surface`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,x.jsx)(`span`,{className:`w-3 h-3 rounded-full flex-shrink-0 ring-2 ring-offset-1 ring-offset-surface`,style:{backgroundColor:Ei[e.kind]??`#666`}}),(0,x.jsx)(`h3`,{className:`font-semibold text-text-primary truncate`,children:e.name}),(0,x.jsx)(`span`,{className:`text-[10px] uppercase bg-elevated text-text-muted px-1.5 py-0.5 rounded font-mono border border-border-subtle`,children:e.kind}),e.exported&&(0,x.jsx)(`span`,{className:`text-[10px] bg-node-function/10 text-node-function px-1.5 py-0.5 rounded border border-node-function/30`,children:`exported`}),i?.callers&&i.callers.length===0&&[`function`,`method`].includes(e.kind)&&(0,x.jsx)(`span`,{className:`text-[10px] bg-accent/10 text-accent px-1.5 py-0.5 rounded border border-accent/30`,children:`entry point`})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,x.jsx)(`span`,{className:`text-[10px] text-text-muted font-mono mr-2`,children:e.filePath?.split(`/`).slice(-2).join(`/`)}),(0,x.jsx)(`button`,{onClick:t,className:`text-text-muted hover:text-text-primary text-lg px-2 transition leading-none`,children:`×`})]})]}),(0,x.jsx)(`div`,{className:`flex border-b border-border-subtle px-2 bg-deep`,children:_.map(e=>(0,x.jsxs)(`button`,{onClick:()=>p(e),className:`px-3 py-1.5 text-xs capitalize font-medium transition relative ${f===e?`text-accent border-b-2 border-accent bg-accent/5`:`text-text-muted hover:text-text-secondary`}`,children:[e,e===`connections`&&v>0&&(0,x.jsx)(`span`,{className:`ml-1 text-[9px] text-text-muted bg-elevated px-1 rounded-full`,children:v}),e===`impact`&&y>0&&(0,x.jsx)(`span`,{className:`ml-1 text-[9px] px-1 rounded-full ${y>10?`text-red-300 bg-red-900/40`:`text-amber-300 bg-amber-900/30`}`,children:y})]},e))}),(0,x.jsxs)(`div`,{className:`flex-1 overflow-y-auto scrollbar-thin px-4 py-3 text-sm`,children:[f===`overview`&&(0,x.jsxs)(`div`,{className:`space-y-3`,children:[(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-2 text-xs`,children:[(0,x.jsx)(Ki,{label:`File`,value:e.filePath??`—`,mono:!0}),(0,x.jsx)(Ki,{label:`Lines`,value:e.startLine?`${e.startLine}${e.endLine?`–${e.endLine}`:``}`:`—`}),i?.cluster&&(0,x.jsx)(Ki,{label:`Cluster`,value:i.cluster}),(0,x.jsx)(Ki,{label:`ID`,value:e.id,mono:!0,tiny:!0})]}),i&&(0,x.jsxs)(`div`,{className:`flex gap-2 flex-wrap`,children:[[{label:`Callers`,count:i.callers.length,color:`text-red-400`,bg:`bg-red-900/20 border-red-800/40`},{label:`Callees`,count:i.callees.length,color:`text-accent`,bg:`bg-accent/10 border-accent/30`},{label:`Imports`,count:i.imports.length,color:`text-node-interface`,bg:`bg-node-interface/10 border-node-interface/30`},{label:`Members`,count:i.members.length,color:`text-node-function`,bg:`bg-node-function/10 border-node-function/30`}].filter(e=>e.count>0).map(e=>(0,x.jsxs)(`button`,{onClick:()=>p(`connections`),className:`flex items-center gap-1.5 text-[11px] border rounded px-2 py-1 ${e.bg} transition hover:brightness-125`,children:[(0,x.jsx)(`span`,{className:`font-bold ${e.color}`,children:e.count}),(0,x.jsx)(`span`,{className:`text-text-muted`,children:e.label})]},e.label)),(0,x.jsxs)(`button`,{onClick:()=>p(`impact`),className:`flex items-center gap-1.5 text-[11px] border rounded px-2 py-1 bg-amber-900/20 border-amber-800/40 transition hover:brightness-125`,children:[(0,x.jsx)(`span`,{className:`font-bold text-amber-400`,children:`⚡`}),(0,x.jsx)(`span`,{className:`text-text-muted`,children:`Impact`})]})]}),!!e.metadata?.signature&&(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`p`,{className:`text-text-muted text-[10px] uppercase mb-1`,children:`Signature`}),(0,x.jsx)(`pre`,{className:`text-xs text-accent bg-void rounded p-2 overflow-x-auto border border-border-subtle`,children:String(e.metadata?.signature)})]})]}),f===`connections`&&(0,x.jsxs)(`div`,{className:`space-y-3`,children:[c&&(0,x.jsx)(`p`,{className:`text-text-muted text-xs animate-pulse`,children:`Loading connections…`}),i&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(qi,{label:`Callers`,hint:`Functions that call this`,accent:`text-red-400`,items:i.callers.map(e=>({id:e.id,name:e.name,kind:`function`})),Pill:g}),(0,x.jsx)(qi,{label:`Callees`,hint:`Functions called by this`,accent:`text-accent`,items:i.callees.map(e=>({id:e.id,name:e.name,kind:`function`})),Pill:g}),(0,x.jsx)(qi,{label:`Imports`,items:i.imports.map(e=>({id:e.id,name:e.name,kind:`module`})),Pill:g}),(0,x.jsx)(qi,{label:`Imported By`,items:i.importedBy.map(e=>({id:e.id,name:e.name,kind:`module`})),Pill:g}),(0,x.jsx)(qi,{label:`Extends`,items:i.extends.map(e=>({id:e.id,name:e.name,kind:`class`})),Pill:g}),(0,x.jsx)(qi,{label:`Implements`,items:i.implementsEdges.map(e=>({id:e.id,name:e.name,kind:`interface`})),Pill:g}),(0,x.jsx)(qi,{label:`Members`,items:i.members.map(e=>({id:e.id,name:e.name,kind:e.kind})),Pill:g})]}),i&&v===0&&(0,x.jsx)(`p`,{className:`text-text-muted text-xs italic`,children:`No connections recorded.`})]}),f===`impact`&&(0,x.jsxs)(`div`,{className:`space-y-3`,children:[u&&(0,x.jsx)(`p`,{className:`text-text-muted text-xs animate-pulse`,children:`Calculating blast radius…`}),!u&&!o&&(0,x.jsx)(`p`,{className:`text-text-muted text-xs italic`,children:`No impact data.`}),o&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-3 mb-2`,children:[(0,x.jsx)(`div`,{className:`text-2xl font-bold font-mono ${o.affectedCount>10?`text-red-400`:o.affectedCount>5?`text-amber-400`:`text-node-function`}`,children:o.affectedCount}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`p`,{className:`text-xs text-text-secondary`,children:`affected symbols`}),(0,x.jsx)(`p`,{className:`text-[10px] text-text-muted`,children:o.affectedCount>10?`⚠ HIGH blast radius`:o.affectedCount>5?`⚡ MEDIUM blast radius`:`✓ LOW blast radius`})]})]}),[1,2,3].map(e=>{let t=o.affected.filter(t=>t.depth===e);return t.length===0?null:(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,x.jsxs)(`span`,{className:`text-[10px] font-bold uppercase tracking-wider ${e===1?`text-red-400`:e===2?`text-amber-400`:`text-text-muted`}`,children:[`d=`,e,` `,e===1?`· WILL BREAK`:e===2?`· LIKELY AFFECTED`:`· MAY NEED TESTING`]}),(0,x.jsx)(`span`,{className:`text-[10px] text-text-muted`,children:t.length})]}),(0,x.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[t.slice(0,20).map((t,n)=>(0,x.jsx)(g,{id:t.id,name:t.name,kind:t.kind,depth:e},`${t.id}-${n}`)),t.length>20&&(0,x.jsxs)(`span`,{className:`text-[10px] text-text-muted self-center`,children:[`+`,t.length-20]})]})]},e)})]})]}),f===`source`&&(0,x.jsx)(`div`,{children:e.content?(0,x.jsx)(`pre`,{className:`text-xs text-text-secondary bg-void rounded p-3 overflow-x-auto border border-border-subtle leading-relaxed`,children:(0,x.jsx)(`code`,{children:e.content})}):(0,x.jsx)(`p`,{className:`text-text-muted text-xs italic`,children:`No source preview available.`})})]})]})}function Ki({label:e,value:t,mono:n,tiny:r}){return(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`p`,{className:`text-text-muted text-[10px] uppercase mb-0.5`,children:e}),(0,x.jsx)(`p`,{className:`text-text-secondary truncate ${n?`font-mono`:``} ${r?`text-[10px]`:`text-xs`}`,title:t,children:t})]})}function qi({label:e,hint:t,accent:n=`text-text-muted`,items:r,Pill:i}){return r.length===0?null:(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`div`,{className:`flex items-baseline gap-2 mb-1.5`,children:[(0,x.jsx)(`h4`,{className:`text-[10px] font-bold uppercase tracking-wider ${n}`,children:e}),(0,x.jsx)(`span`,{className:`text-[10px] text-text-muted bg-elevated px-1 rounded-full`,children:r.length}),t&&(0,x.jsxs)(`span`,{className:`text-[10px] text-text-muted/50`,children:[`— `,t]})]}),(0,x.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[r.slice(0,50).map((e,t)=>(0,x.jsx)(i,{...e},`${e.id}-${t}`)),r.length>50&&(0,x.jsxs)(`span`,{className:`text-[10px] text-text-muted self-center`,children:[`+`,r.length-50,` more`]})]})]})}var Ji=`modulepreload`,Yi=function(e){return`/`+e},Xi={},Zi=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Yi(t,n),t in Xi)return;Xi[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Ji,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Qi=null;async function $i(){if(Qi)return Qi;try{return Qi=(await Zi(()=>import(`./es-DOPp2DTx.js`),[])).default,Qi}catch{return null}}var ea=`code-intel:source-panel-size`,ta=420;function na({file:e,startLine:t,endLine:n,repo:r,onClose:i}){let{state:a}=E(),[o,s]=(0,b.useState)(null),[c,l]=(0,b.useState)(!1),[u,d]=(0,b.useState)(null),[f,p]=(0,b.useState)(null),[m,h]=(0,b.useState)(!1),[g,_]=(0,b.useState)(()=>{try{let e=localStorage.getItem(ea);return e?parseInt(e,10):ta}catch{return ta}}),v=(0,b.useRef)(!1),y=(0,b.useRef)(0),S=(0,b.useRef)(0),C=e=>{v.current=!0,y.current=e.clientY,S.current=g,e.preventDefault()};(0,b.useEffect)(()=>{let e=e=>{if(!v.current)return;let t=y.current-e.clientY;_(Math.max(180,Math.min(800,S.current+t)))},t=()=>{if(v.current){v.current=!1;try{localStorage.setItem(ea,String(g))}catch{}}};return window.addEventListener(`mousemove`,e),window.addEventListener(`mouseup`,t),()=>{window.removeEventListener(`mousemove`,e),window.removeEventListener(`mouseup`,t)}},[g]),(0,b.useEffect)(()=>{let i=!1;return s(null),p(null),d(null),l(!0),new D(a.serverUrl).sourcePreview(e,t,n,r).then(async e=>{if(i)return;s(e);let t=await $i();if(!i&&t)try{let n=t.getLanguage(e.language)?e.language:`plaintext`;p(t.highlight(e.content,{language:n}).value)}catch{p(null)}}).catch(e=>{i||d(e instanceof Error?e.message:`Failed to load source`)}).finally(()=>{i||l(!1)}),()=>{i=!0}},[e,t,n,a.serverUrl]);let w=(0,b.useCallback)(async()=>{try{await navigator.clipboard.writeText(`${e}:${t}`),h(!0),setTimeout(()=>h(!1),2e3)}catch{}},[e,t]),T=e.split(`/`).slice(-3).join(`/`);return(0,x.jsxs)(`div`,{className:`bg-deep border-t border-border-subtle flex flex-col overflow-hidden shadow-2xl shrink-0`,style:{height:g},children:[(0,x.jsx)(`div`,{className:`h-1 cursor-row-resize bg-border-subtle hover:bg-accent/50 transition-colors flex-shrink-0`,onMouseDown:C,title:`Drag to resize`}),(0,x.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2 border-b border-border-subtle bg-surface flex-shrink-0`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,x.jsx)(`span`,{className:`text-[10px] font-bold tracking-wider text-accent/80 uppercase`,children:`Source`}),(0,x.jsx)(`span`,{className:`text-xs text-text-secondary font-mono truncate`,title:e,children:T}),(o||c)&&(0,x.jsxs)(`span`,{className:`text-[10px] text-text-muted font-mono`,children:[`:`,t,n===t?``:`–${n}`]})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-1 flex-shrink-0`,children:[(0,x.jsx)(`a`,{href:`vscode://file/${e}:${t}`,className:`text-[10px] text-text-muted hover:text-text-primary border border-border-subtle hover:border-border-default rounded px-2 py-0.5 transition font-mono`,title:`Open in VS Code`,children:`⎈ VS Code`}),(0,x.jsx)(`button`,{onClick:w,className:`text-[10px] border rounded px-2 py-0.5 transition font-mono ${m?`text-node-function border-node-function/30 bg-node-function/10`:`text-text-muted hover:text-text-primary border-border-subtle hover:border-border-default`}`,title:`Copy ${e}:${t} to clipboard`,children:m?`✓ copied`:`⎘ copy`}),(0,x.jsx)(`button`,{onClick:i,className:`text-text-muted hover:text-text-primary text-lg px-2 transition leading-none ml-1`,children:`×`})]})]}),(0,x.jsxs)(`div`,{className:`flex-1 overflow-auto scrollbar-thin`,children:[c&&(0,x.jsx)(ra,{}),u&&(0,x.jsx)(`div`,{className:`p-4`,children:(0,x.jsxs)(`div`,{className:`flex items-center gap-2 bg-red-900/20 border border-red-800/40 rounded-lg px-3 py-2`,children:[(0,x.jsx)(`span`,{className:`text-red-400 text-sm`,children:`⚠`}),(0,x.jsx)(`span`,{className:`text-red-300 text-xs`,children:u})]})}),o&&!c&&(0,x.jsx)(ia,{data:o,highlightedHtml:f,focusStartLine:t,focusEndLine:n})]})]})}function ra(){return(0,x.jsx)(`div`,{className:`p-4 space-y-1.5 animate-pulse`,children:Array.from({length:12}).map((e,t)=>(0,x.jsxs)(`div`,{className:`flex gap-4`,children:[(0,x.jsx)(`div`,{className:`w-8 h-3 bg-elevated rounded flex-shrink-0`}),(0,x.jsx)(`div`,{className:`h-3 bg-elevated rounded`,style:{width:`${40+Math.random()*50}%`}})]},t))})}function ia({data:e,highlightedHtml:t,focusStartLine:n,focusEndLine:r}){let i=e.content.split(`
328
+ `),a=t?t.split(`
329
+ `):null;return(0,x.jsxs)(`div`,{className:`relative`,children:[(0,x.jsx)(oa,{}),(0,x.jsx)(`table`,{className:`w-full text-xs font-mono border-collapse`,children:(0,x.jsx)(`tbody`,{children:i.map((t,i)=>{let o=e.startLine+i,s=o>=n&&o<=r,c=a?a[i]??``:null;return(0,x.jsxs)(`tr`,{className:s?`bg-accent/10`:`hover:bg-elevated/50`,children:[(0,x.jsx)(`td`,{className:`select-none w-10 text-right pr-3 pl-2 py-0.5 border-r text-[10px] align-top flex-shrink-0 ${s?`text-accent border-accent/30 bg-accent/15`:`text-text-muted/40 border-border-subtle`}`,style:{userSelect:`none`,minWidth:`2.5rem`},children:o}),(0,x.jsx)(`td`,{className:`pl-4 pr-4 py-0.5 whitespace-pre align-top leading-5`,style:{color:s&&!c?`#a78bfa`:void 0},children:c===null?(0,x.jsx)(`span`,{className:s?`text-node-interface`:`text-text-secondary`,children:t||` `}):(0,x.jsx)(`span`,{dangerouslySetInnerHTML:{__html:c||` `}})})]},o)})})})]})}var aa=!1;function oa(){return(0,b.useEffect)(()=>{if(aa)return;aa=!0;let e=document.createElement(`style`);e.textContent=`
330
+ .hljs { color: #e4e4ed; }
331
+ .hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-literal, .hljs-type { color: #a78bfa; }
332
+ .hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-meta-string { color: #4ade80; }
333
+ .hljs-comment, .hljs-quote { color: #5a5a70; font-style: italic; }
334
+ .hljs-number, .hljs-bullet, .hljs-link, .hljs-meta { color: #fbbf24; }
335
+ .hljs-title, .hljs-class .hljs-title, .hljs-function .hljs-title { color: #22d3ee; }
336
+ .hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-tag, .hljs-name,
337
+ .hljs-selector-id, .hljs-selector-class, .hljs-regexp, .hljs-deletion { color: #f87171; }
338
+ .hljs-params { color: #e4e4ed; }
339
+ .hljs-emphasis { font-style: italic; }
340
+ .hljs-strong { font-weight: bold; }
341
+ `,document.head.appendChild(e)},[]),null}function sa(e){let t=e.toLowerCase().trim();if(/(overview|architecture|describe.*(code|repo|project)|high.?level|summary of)/.test(t))return{kind:`overview`};let n=t.match(/(impact|blast.?radius|what.*depends.*on|breaks if|affected by)\s+(\w[\w./_-]*)/);if(n)return{kind:`impact`,target:n[2]};let r=t.match(/(who calls|callers of|invocations of)\s+(\w[\w./_-]*)/);if(r)return{kind:`callers`,target:r[2]};let i=t.match(/(callees of|what does\s+\w[\w./_-]*\s+call|methods called by)\s+(\w[\w./_-]*)/);if(i)return{kind:`callees`,target:i[2]};let a=t.match(/(explain|describe|inspect|tell me about)\s+(\w[\w./_-]*)/);if(a)return{kind:`inspect`,target:a[2]};let o=t.match(/^(grep|search text|find string)\s+(.+)$/);return o?{kind:`grep`,target:o[2]}:{kind:`find`}}function ca(e){return{filePath:e.filePath,startLine:e.startLine,endLine:e.endLine,nodeId:e.id}}function la(e){let t=e.startLine?`:${e.startLine}${e.endLine&&e.endLine!==e.startLine?`-${e.endLine}`:``}`:``;return`[[${e.filePath}${t}]]`}async function ua(e,t,n){let r=sa(e),i=[],a=async(e,n)=>{try{if((await t.vectorStatus()).ready){let r=await t.vectorSearch(e,n);if(r.results.length>0)return r.results}}catch{}return(await t.search(e,n)).results};if(r.kind===`overview`){let e={tool:`codebase_map`,input:{},status:`running`};n({type:`tool-start`,toolCall:e});let t=[`main`,`init`,`class`,`app`,`index`,`config`,`server`],r=new Map;for(let e of t)try{let t=await a(e,6);for(let e of t)r.has(e.nodeId)||r.set(e.nodeId,e)}catch{}let o=[...r.values()].slice(0,12);n({type:`tool-end`,toolCall:{...e,status:`done`,resultSummary:`${o.length} key symbols probed`}});let s=`## Codebase Overview
342
+
343
+ I sampled key entry points across the graph. Below are the most prominent symbols, grouped by kind:
344
+
345
+ `,c=new Map;for(let e of o){let t=c.get(e.kind)??[];t.push(e),c.set(e.kind,t)}for(let[e,t]of c){s+=`**${e.toUpperCase()}**\n`;for(let e of t){let t={filePath:e.filePath,nodeId:e.nodeId};i.push(t),s+=`- \`${e.name}\` ${la(t)}\n`}s+=`
346
+ `}s+=`
347
+ _Use **inspect <symbol>** to dive deeper, or **impact <symbol>** to see blast radius._`,n({type:`final`,text:s,citations:i});return}let o=r.target??e,s={tool:`find_code`,input:{query:o,limit:5},status:`running`};n({type:`tool-start`,toolCall:s});let c=await a(o,5);if(n({type:`tool-end`,toolCall:{...s,status:`done`,resultSummary:`${c.length} matches`}}),c.length===0){if(r.kind===`grep`){let e={tool:`grep_files`,input:{pattern:o},status:`running`};n({type:`tool-start`,toolCall:e});let{results:r}=await t.grep(o);n({type:`tool-end`,toolCall:{...e,status:`done`,resultSummary:`${r.length} hits`}});let a=`Grep for \`${o}\` returned ${r.length} hits.\n\n`;for(let e of r.slice(0,15)){let t={filePath:e.file,startLine:e.line};i.push(t),a+=`- ${la(t)} \`${e.text.slice(0,80)}\`\n`}n({type:`final`,text:a,citations:i});return}n({type:`final`,text:`No symbols matched \`${o}\` in the knowledge graph. Try a different name or use **grep <pattern>** for raw text search.`,citations:[]});return}let l=c[0];if(r.kind===`find`){let e=`Found ${c.length} candidate(s) for \`${o}\`:\n\n`;for(let t of c){let n={filePath:t.filePath,nodeId:t.nodeId};i.push(n),e+=`- **${t.name}** _(${t.kind})_ ${la(n)}\n`}e+=`\n_Click a citation to focus that node, or ask me to **inspect ${l.name}** for details._`,n({type:`final`,text:e,citations:i});return}let u={tool:`deep_dive`,input:{symbol_name:l.name},status:`running`};n({type:`tool-start`,toolCall:u});let d;try{d=await t.inspectNode(l.nodeId)}catch(e){n({type:`tool-end`,toolCall:{...u,status:`error`,resultSummary:String(e)}}),n({type:`final`,text:`Failed to inspect \`${l.name}\`.`,citations:i});return}n({type:`tool-end`,toolCall:{...u,status:`done`,resultSummary:`${d.callers.length} callers, ${d.callees.length} callees`}});let f=ca(d.node);if(i.push(f),r.kind===`callers`){let e=`### Callers of \`${d.node.name}\` ${la(f)}\n\n${d.callers.length} call site(s):\n\n`;for(let t of d.callers.slice(0,30))e+=`- \`${t.name??t.id}\`${t.weight?` _(weight ${t.weight})_`:``}\n`;n({type:`final`,text:e,citations:i});return}if(r.kind===`callees`){let e=`### \`${d.node.name}\` calls ${d.callees.length} symbol(s) ${la(f)}\n\n`;for(let t of d.callees.slice(0,30))e+=`- \`${t.name??t.id}\`\n`;n({type:`final`,text:e,citations:i});return}if(r.kind===`impact`){let e={tool:`check_impact`,input:{target:l.name},status:`running`};n({type:`tool-start`,toolCall:e});let r;try{r=await t.blastRadius(l.name,`callers`,4)}catch(t){n({type:`tool-end`,toolCall:{...e,status:`error`,resultSummary:String(t)}}),n({type:`final`,text:`Failed to compute blast radius.`,citations:i});return}n({type:`tool-end`,toolCall:{...e,status:`done`,resultSummary:`${r.affectedCount} affected symbols`}});let a=new Map;for(let e of r.affected){let t=a.get(e.depth)??[];t.push(e),a.set(e.depth,t)}let o=`### Blast radius of \`${r.target}\` ${la(f)}\n\n`;o+=`Changing this symbol may affect **${r.affectedCount}** symbol(s):\n\n`;for(let[e,t]of[...a.entries()].sort((e,t)=>e[0]-t[0]))if(e!==0){o+=`**Hop ${e}** _(${t.length})_\n`;for(let e of t.slice(0,12))o+=`- \`${e.name}\` _(${e.kind})_\n`;t.length>12&&(o+=`- _… and ${t.length-12} more_\n`),o+=`
348
+ `}n({type:`final`,text:o,citations:i});return}let p=`### \`${d.node.name}\` _(${d.node.kind})_ ${la(f)}\n\n`;if(d.cluster&&(p+=`**Cluster:** \`${d.cluster}\`\n\n`),p+=`**Connections:** ${d.callers.length} caller(s) · ${d.callees.length} callee(s) · ${d.imports.length} import(s)\n\n`,d.callers.length){p+=`**Callers:**
349
+ `;for(let e of d.callers.slice(0,8))p+=`- \`${e.name??e.id}\`\n`;p+=`
350
+ `}if(d.callees.length){p+=`**Calls:**
351
+ `;for(let e of d.callees.slice(0,8))p+=`- \`${e.name??e.id}\`\n`;p+=`
352
+ `}d.extends.length&&(p+=`**Extends:** ${d.extends.map(e=>`\`${e.name}\``).join(`, `)}\n\n`),d.implementsEdges.length&&(p+=`**Implements:** ${d.implementsEdges.map(e=>`\`${e.name}\``).join(`, `)}\n\n`),d.members.length&&(p+=`**Members:** ${d.members.length} (${[...new Set(d.members.map(e=>e.kind))].join(`, `)})\n`),n({type:`final`,text:p,citations:i})}var da=[{label:`Architecture`,items:[`Explain the project architecture`,`What are the main modules?`]},{label:`Search`,items:[`Find code about HTTP server`,`Who calls runPipeline`]},{label:`Inspect`,items:[`Inspect KnowledgeGraph`,`Impact of textSearch`]}];function fa(){let{state:e,dispatch:t}=E(),[n,r]=(0,b.useState)(``),i=(0,b.useRef)(null);(0,b.useEffect)(()=>{i.current?.scrollTo({top:i.current.scrollHeight,behavior:`smooth`})},[e.chat.messages]);let a=async n=>{let i=n.trim();if(!i||e.chat.loading)return;r(``),t({type:`ADD_CHAT_MESSAGE`,message:{role:`user`,content:i,timestamp:Date.now()}}),t({type:`SET_CHAT_LOADING`,loading:!0}),t({type:`ADD_CHAT_MESSAGE`,message:{role:`assistant`,content:``,timestamp:Date.now(),toolCalls:[],citations:[]}});let a=new D(e.serverUrl),o=[];try{await ua(i,a,e=>{if(e.type===`tool-start`&&e.toolCall)o.push(e.toolCall),t({type:`UPDATE_LAST_CHAT_MESSAGE`,message:{toolCalls:[...o]}});else if(e.type===`tool-end`&&e.toolCall){let n=o.findIndex(t=>t.tool===e.toolCall.tool&&t.status===`running`);n>=0?o[n]=e.toolCall:o.push(e.toolCall),t({type:`UPDATE_LAST_CHAT_MESSAGE`,message:{toolCalls:[...o]}})}else e.type===`final`&&t({type:`UPDATE_LAST_CHAT_MESSAGE`,message:{content:e.text??``,citations:e.citations??[]}})})}catch(e){t({type:`UPDATE_LAST_CHAT_MESSAGE`,message:{content:`Error: ${e instanceof Error?e.message:`unknown`}`}})}finally{t({type:`SET_CHAT_LOADING`,loading:!1})}},o=n=>{if(n.nodeId){let r=e.nodes.find(e=>e.id===n.nodeId);if(r){t({type:`SELECT_NODE`,node:r});return}}let r=e.nodes.find(e=>e.kind===`file`&&e.filePath===n.filePath);r&&t({type:`SELECT_NODE`,node:r})};return(0,x.jsxs)(`div`,{className:`flex flex-col h-full bg-deep`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2.5 border-b border-border-subtle bg-surface`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`text-accent`,children:`✦`}),(0,x.jsx)(`h3`,{className:`text-sm font-semibold text-text-primary`,children:`Code AI`}),(0,x.jsx)(`span`,{className:`text-[10px] bg-accent/20 text-accent px-1.5 py-0.5 rounded-full border border-accent/30`,children:`Grounded`})]}),(0,x.jsx)(`button`,{onClick:()=>t({type:`CLEAR_CHAT`}),className:`text-[10px] text-text-muted hover:text-text-secondary px-2 py-1 rounded hover:bg-hover transition`,children:`Clear`})]}),(0,x.jsxs)(`div`,{ref:i,className:`flex-1 overflow-y-auto scrollbar-thin p-3 space-y-3`,children:[e.chat.messages.length===0&&(0,x.jsxs)(`div`,{className:`mt-4 px-2`,children:[(0,x.jsx)(`p`,{className:`text-text-muted text-xs mb-3 leading-relaxed text-center`,children:`Ask grounded questions. Every answer cites source files.`}),(0,x.jsx)(`div`,{className:`space-y-3`,children:da.map(({label:e,items:t})=>(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`p`,{className:`text-[10px] font-bold tracking-wider text-text-muted uppercase mb-1 px-1`,children:e}),(0,x.jsx)(`div`,{className:`space-y-1`,children:t.map(e=>(0,x.jsx)(`button`,{onClick:()=>a(e),className:`block w-full text-left px-2.5 py-1.5 text-xs bg-elevated hover:bg-hover text-text-secondary hover:text-text-primary rounded-lg border border-border-subtle hover:border-border-default transition`,children:e},e))})]},e))})]}),e.chat.messages.map((e,t)=>(0,x.jsx)(pa,{message:e,onCitationClick:o},t)),e.chat.loading&&(0,x.jsxs)(`div`,{className:`flex items-center gap-2 text-text-muted text-xs`,children:[(0,x.jsx)(`div`,{className:`animate-spin w-3 h-3 border-2 border-border-default border-t-accent rounded-full`}),`Thinking…`]})]}),(0,x.jsx)(`div`,{className:`p-2 border-t border-border-subtle bg-surface`,children:(0,x.jsxs)(`div`,{className:`flex gap-2`,children:[(0,x.jsx)(`input`,{type:`text`,value:n,onChange:e=>r(e.target.value),onKeyDown:e=>e.key===`Enter`&&a(n),disabled:e.chat.loading,className:`flex-1 bg-elevated border border-border-subtle rounded-lg px-3 py-1.5 text-sm text-text-primary placeholder-text-muted focus:border-accent focus:ring-1 focus:ring-accent/20 focus:outline-none disabled:opacity-50 transition`,placeholder:`Ask about the codebase…`}),(0,x.jsx)(`button`,{onClick:()=>a(n),disabled:e.chat.loading||!n.trim(),className:`bg-gradient-to-r from-accent to-accent-dim hover:opacity-90 disabled:opacity-40 rounded-lg px-3 py-1.5 text-sm text-white transition`,children:`➤`})]})})]})}function pa({message:e,onCitationClick:t}){return e.role===`user`?(0,x.jsx)(`div`,{className:`flex justify-end`,children:(0,x.jsx)(`div`,{className:`max-w-[90%] bg-accent/15 border border-accent/30 text-text-primary rounded-lg px-3 py-1.5 text-sm`,children:e.content})}):(0,x.jsxs)(`div`,{className:`space-y-2`,children:[e.toolCalls&&e.toolCalls.length>0&&(0,x.jsx)(`div`,{className:`space-y-1`,children:e.toolCalls.map((e,t)=>(0,x.jsx)(ma,{tc:e},t))}),e.content&&(0,x.jsx)(`div`,{className:`bg-elevated/60 border border-border-subtle rounded-lg p-3 text-sm text-text-secondary`,children:(0,x.jsx)(ha,{text:e.content,onCitationClick:t})})]})}function ma({tc:e}){return(0,x.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1 rounded border bg-surface text-xs ${e.status===`done`?`border-node-function/40 text-node-function`:e.status===`error`?`border-red-700/40 text-red-400`:`border-border-default text-text-muted animate-pulse`}`,children:[(0,x.jsx)(`span`,{className:`font-mono`,children:`⚙`}),(0,x.jsx)(`span`,{className:`font-mono font-medium`,children:e.tool}),(0,x.jsx)(`span`,{className:`text-text-muted truncate flex-1`,children:e.resultSummary??Object.values(e.input).slice(0,1).join(` `)}),(0,x.jsx)(`span`,{className:`text-[10px]`,children:e.status===`running`?`…`:e.status===`done`?`✓`:`✗`})]})}function ha({text:e,onCitationClick:t}){return(0,x.jsx)(x.Fragment,{children:e.split(`
353
+ `).map((e,n)=>(0,x.jsx)(`div`,{className:`leading-relaxed`,children:ba(e,t)},n))})}var ga=/\[\[([^\]]+)\]\]/g,_a=/^(#{1,4})\s+(.*)$/,va=/\*\*([^*]+)\*\*/g,ya=/`([^`]+)`/g;function ba(e,t){let n=e.match(_a);if(n){let e=n[1].length,r=n[2];return(0,x.jsx)(`h${Math.min(4,e+1)}`,{className:e<=2?`text-base font-bold text-text-primary mt-2`:e===3?`text-sm font-semibold text-text-secondary mt-2`:`text-xs font-semibold text-text-muted mt-1`,children:xa(r,t)})}return e.startsWith(`- `)?(0,x.jsxs)(`div`,{className:`ml-3`,children:[`• `,xa(e.slice(2),t)]}):e.trim()===``?(0,x.jsx)(`div`,{className:`h-1`}):(0,x.jsx)(`span`,{children:xa(e,t)})}function xa(e,t){let n=[],r=0;ga.lastIndex=0;let i;for(;(i=ga.exec(e))!==null;){i.index>r&&n.push((0,x.jsx)(b.Fragment,{children:wa(e.slice(r,i.index))},`t-${r}`));let a=i[1],o=Sa(a);n.push((0,x.jsxs)(`button`,{onClick:()=>t(o),className:`inline-flex items-center gap-0.5 mx-0.5 px-1.5 py-0.5 text-[10px] font-mono bg-accent/20 hover:bg-accent/30 text-accent rounded border border-accent/30 align-baseline transition`,title:o.filePath,children:[Ca(o.filePath),o.startLine?`:${o.startLine}`:``]},`c-${i.index}`)),r=i.index+i[0].length}return r<e.length&&n.push((0,x.jsx)(b.Fragment,{children:wa(e.slice(r))},`t-${r}`)),n}function Sa(e){let t=e.lastIndexOf(`:`);if(t>0&&/^\d/.test(e.slice(t+1))){let n=e.slice(0,t),[r,i]=e.slice(t+1).split(`-`).map(e=>parseInt(e,10));return{filePath:n,startLine:r,endLine:i}}return{filePath:e}}function Ca(e){let t=e.split(`/`);return t.length<=2?e:`…/${t.slice(-2).join(`/`)}`}function wa(e){let t=[],n=0;for(;n<e.length;){va.lastIndex=n,ya.lastIndex=n;let r=va.exec(e),i=ya.exec(e),a=null;if(r&&i?a=r.index<i.index?{match:r,type:`b`}:{match:i,type:`c`}:r?a={match:r,type:`b`}:i&&(a={match:i,type:`c`}),!a){t.push(e.slice(n));break}a.match.index>n&&t.push(e.slice(n,a.match.index)),a.type===`b`?t.push((0,x.jsx)(`strong`,{className:`text-text-primary`,children:a.match[1]},`b-${a.match.index}`)):t.push((0,x.jsx)(`code`,{className:`px-1 py-0.5 rounded bg-void text-accent font-mono text-[11px]`,children:a.match[1]},`c-${a.match.index}`)),n=a.match.index+a.match[0].length}return(0,x.jsx)(x.Fragment,{children:t})}function Ta(e){let t={name:``,path:``,children:new Map,files:[]};for(let n of e){let e=n.split(`/`),r=t;for(let t=0;t<e.length-1;t++){let n=e[t];r.children.has(n)||r.children.set(n,{name:n,path:e.slice(0,t+1).join(`/`),children:new Map,files:[]}),r=r.children.get(n)}r.files.push(n)}return t}function Ea(e){let t=e.files.length;for(let n of e.children.values())t+=Ea(n);return t}function Da({node:e,depth:t,onFileClick:n,selectedPath:r}){let i=[...e.children.entries()].sort((e,t)=>e[0].localeCompare(t[0])),a=[...e.files].sort(),o=Ea(e),s=t*12,[c,l]=(0,b.useState)(t<=1||e.children.size===1);return t===0?(0,x.jsxs)(x.Fragment,{children:[i.map(([,e])=>(0,x.jsx)(Da,{node:e,depth:t+1,onFileClick:n,selectedPath:r},e.path)),a.map(e=>(0,x.jsx)(Oa,{fp:e,indent:s,selected:e===r,onClick:()=>n(e)},e))]}):(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1 py-0.5 pr-2 cursor-pointer hover:bg-hover rounded-sm group transition select-none`,style:{paddingLeft:`${s+6}px`},onClick:()=>l(e=>!e),children:[(0,x.jsx)(`span`,{className:`text-text-muted text-[10px] w-3 flex-shrink-0 text-center`,children:i.length>0||a.length>0?c?`▾`:`▸`:` `}),(0,x.jsx)(`span`,{className:`text-[13px] mr-1`,children:c?`📂`:`📁`}),(0,x.jsx)(`span`,{className:`text-xs text-text-secondary font-medium truncate flex-1 group-hover:text-text-primary`,children:e.name}),(0,x.jsx)(`span`,{className:`text-[10px] text-text-muted/50 font-mono ml-1 flex-shrink-0`,children:o})]}),c&&(0,x.jsxs)(`div`,{children:[i.map(([,e])=>(0,x.jsx)(Da,{node:e,depth:t+1,onFileClick:n,selectedPath:r},e.path)),a.map(e=>(0,x.jsx)(Oa,{fp:e,indent:s+16,selected:e===r,onClick:()=>n(e)},e))]})]})}function Oa({fp:e,indent:t,selected:n,onClick:r}){let i=e.split(`/`).pop(),a=ka[i.split(`.`).pop()??``]??`📄`;return(0,x.jsxs)(`div`,{className:`flex items-center gap-1 py-0.5 pr-2 cursor-pointer rounded-sm transition select-none ${n?`bg-accent/15 text-accent`:`hover:bg-hover text-text-muted hover:text-text-secondary`}`,style:{paddingLeft:`${t+6}px`},onClick:r,title:e,children:[(0,x.jsx)(`span`,{className:`text-[11px] mr-1 flex-shrink-0`,children:a}),(0,x.jsx)(`span`,{className:`text-xs truncate`,children:i})]})}var ka={ts:`🔷`,tsx:`⚛️`,js:`🟨`,jsx:`⚛️`,json:`📋`,md:`📝`,py:`🐍`,go:`🐹`,rs:`🦀`,java:`☕`,cs:`🔵`,css:`🎨`,html:`🌐`,yaml:`⚙️`,yml:`⚙️`,toml:`⚙️`,sh:`🐚`,txt:`📄`,gitignore:`🚫`};function Aa(){let{state:e,dispatch:t}=E(),[n,r]=(0,b.useState)(``),i=(0,b.useMemo)(()=>e.nodes.filter(e=>e.kind===`file`).map(e=>e.filePath).sort(),[e.nodes]),a=(0,b.useMemo)(()=>{if(!n.trim())return i;let e=n.toLowerCase();return i.filter(t=>t.toLowerCase().includes(e))},[i,n]),o=(0,b.useMemo)(()=>Ta(a),[a]),s=e.selectedNode?.kind===`file`?e.selectedNode.filePath:void 0;return(0,x.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,x.jsx)(`div`,{className:`p-2 border-b border-border-subtle`,children:(0,x.jsx)(`input`,{type:`text`,value:n,onChange:e=>r(e.target.value),placeholder:`Filter files…`,className:`w-full bg-elevated border border-border-subtle rounded-md px-2.5 py-1.5 text-xs text-text-primary placeholder-text-muted focus:border-accent focus:ring-1 focus:ring-accent/20 focus:outline-none transition`})}),(0,x.jsx)(`div`,{className:`flex-1 overflow-y-auto scrollbar-thin py-1 text-sm`,children:a.length===0?(0,x.jsx)(`p`,{className:`text-center text-text-muted text-xs mt-4`,children:`No files match`}):(0,x.jsx)(Da,{node:o,depth:0,onFileClick:n=>{let r=e.nodes.find(e=>e.filePath===n&&e.kind===`file`);r&&t({type:`SELECT_NODE`,node:r})},selectedPath:s})}),(0,x.jsxs)(`div`,{className:`px-3 py-1.5 border-t border-border-subtle text-[10px] text-text-muted font-mono`,children:[a.length,` file`,a.length===1?``:`s`]})]})}var ja={directory:`Folder`,file:`File`,class:`Class`,function:`Function`,method:`Method`,variable:`Variable`,interface:`Interface`,module:`Module`,struct:`Struct`,enum:`Enum`,trait:`Trait`,namespace:`Namespace`,type_alias:`Type Alias`,constant:`Constant`,property:`Property`,constructor:`Constructor`,route:`Route`,cluster:`Cluster`,flow:`Flow`},Ma={contains:`Contains`,calls:`Calls`,imports:`Imports`,extends:`Extends`,implements:`Implements`,has_member:`Has Member`,accesses:`Accesses`,overrides:`Overrides`,belongs_to:`Belongs To`,step_of:`Step Of`,handles:`Handles`},Na=[`all`,1,2,3,5];function Pa(){let{state:e,dispatch:t}=E(),{nodeKindCounts:n,edgeKindCounts:r}=(0,b.useMemo)(()=>{let t=new Map,n=new Map;for(let n of e.nodes)t.set(n.kind,(t.get(n.kind)??0)+1);for(let t of e.edges)n.set(t.kind,(n.get(t.kind)??0)+1);return{nodeKindCounts:t,edgeKindCounts:n}},[e.nodes,e.edges]),i=[...n.entries()].sort((e,t)=>t[1]-e[1]),a=[...r.entries()].sort((e,t)=>t[1]-e[1]);return(0,x.jsxs)(`div`,{className:`overflow-y-auto scrollbar-thin h-full text-sm`,children:[(0,x.jsx)(Fa,{title:`Node Types`,subtitle:`Toggle visibility in the graph`,children:(0,x.jsx)(`div`,{className:`space-y-0.5`,children:i.map(([n,r])=>{let i=e.filters.hiddenNodeKinds.has(n);return(0,x.jsxs)(`button`,{onClick:()=>t({type:`TOGGLE_NODE_KIND`,kind:n}),className:`w-full flex items-center gap-2 px-2 py-1 rounded hover:bg-hover text-left transition`,children:[(0,x.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-full flex-shrink-0 transition-opacity`,style:{backgroundColor:Ei[n]??`#6b7280`,opacity:i?.2:1}}),(0,x.jsx)(`span`,{className:`flex-1 text-xs ${i?`text-text-muted line-through`:`text-text-secondary`}`,children:ja[n]??n}),(0,x.jsx)(`span`,{className:`text-[10px] text-text-muted font-mono`,children:r}),(0,x.jsx)(`span`,{className:`w-4 h-4 rounded flex items-center justify-center text-[10px] ${i?`bg-elevated text-text-muted`:`bg-accent/20 text-accent`}`,children:i?`+`:`✓`})]},n)})})}),(0,x.jsx)(Fa,{title:`Edge Types`,subtitle:`Toggle visibility of relationships`,children:(0,x.jsx)(`div`,{className:`space-y-0.5`,children:a.map(([n,r])=>{let i=e.filters.hiddenEdgeKinds.has(n);return(0,x.jsxs)(`button`,{onClick:()=>t({type:`TOGGLE_EDGE_KIND`,kind:n}),className:`w-full flex items-center gap-2 px-2 py-1 rounded hover:bg-hover text-left transition`,children:[(0,x.jsx)(`span`,{className:`w-4 h-0.5 flex-shrink-0 transition-opacity`,style:{backgroundColor:Di[n]??`#6b7280`,opacity:i?.2:1}}),(0,x.jsx)(`span`,{className:`flex-1 text-xs ${i?`text-text-muted line-through`:`text-text-secondary`}`,children:Ma[n]??n}),(0,x.jsx)(`span`,{className:`text-[10px] text-text-muted font-mono`,children:r}),(0,x.jsx)(`span`,{className:`w-4 h-4 rounded flex items-center justify-center text-[10px] ${i?`bg-elevated text-text-muted`:`bg-accent/20 text-accent`}`,children:i?`+`:`✓`})]},n)})})}),(0,x.jsxs)(Fa,{title:`Focus Depth`,subtitle:`Show nodes within N hops of selection`,children:[(0,x.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:Na.map(n=>(0,x.jsx)(`button`,{onClick:()=>t({type:`SET_FOCUS_DEPTH`,depth:n}),className:`px-2.5 py-1 rounded text-xs font-medium transition ${e.filters.focusDepth===n?`bg-accent text-white shadow-glow`:`bg-elevated text-text-muted hover:bg-hover hover:text-text-secondary`}`,children:n===`all`?`All`:`${n} hop${n===1?``:`s`}`},String(n)))}),!e.selectedNode&&e.filters.focusDepth!==`all`&&(0,x.jsx)(`p`,{className:`text-[10px] text-amber-400 mt-2`,children:`Select a node to apply focus depth.`})]}),(0,x.jsx)(`div`,{className:`px-3 pb-4`,children:(0,x.jsx)(`button`,{onClick:()=>t({type:`RESET_FILTERS`}),className:`w-full px-2 py-1.5 text-xs bg-elevated hover:bg-hover text-text-secondary rounded transition`,children:`Reset filters`})})]})}function Fa({title:e,subtitle:t,children:n}){return(0,x.jsxs)(`div`,{className:`px-3 py-3 border-b border-border-subtle`,children:[(0,x.jsx)(`h3`,{className:`text-[10px] font-bold tracking-wider text-text-muted uppercase mb-0.5`,children:e}),t&&(0,x.jsx)(`p`,{className:`text-[10px] text-text-muted/60 mb-2`,children:t}),n]})}var Ia=`code-intel:query-history`,La=20,Ra=[`FIND function WHERE name CONTAINS "auth"`,`FIND * WHERE kind IN [function, method] LIMIT 20`,`TRAVERSE CALLS FROM "main" DEPTH 3`,`COUNT function GROUP BY cluster`,`FIND function WHERE exported = true LIMIT 30`],za=/\b(FIND|TRAVERSE|PATH|COUNT|WHERE|FROM|TO|DEPTH|LIMIT|OFFSET|GROUP|BY|AND|IN|CONTAINS|STARTS_WITH)\b/g;function Ba(){try{return JSON.parse(localStorage.getItem(Ia)??`[]`)}catch{return[]}}function Va(e){localStorage.setItem(Ia,JSON.stringify(e.slice(0,La)))}function Ha(e){let t=Ba().filter(t=>t!==e);t.unshift(e),Va(t)}function Ua(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function Wa(e){return Ua(e).replace(za,`<span style="color:#7c3aed;font-weight:600">$1</span>`)}function Ga({nodes:e,onSelectNode:t}){let[n,r]=(0,b.useState)({column:`name`,direction:`asc`}),i=e=>r(t=>t.column===e?{column:e,direction:t.direction===`asc`?`desc`:`asc`}:{column:e,direction:`asc`}),a=[...e].sort((e,t)=>{let r=String(e[n.column]??``),i=String(t[n.column]??``);return n.direction===`asc`?r.localeCompare(i):i.localeCompare(r)}),o=[{key:`name`,label:`Name`},{key:`kind`,label:`Kind`},{key:`filePath`,label:`File`}],s=e=>n.column===e?(0,x.jsx)(`span`,{className:`text-accent ml-1`,children:n.direction===`asc`?`↑`:`↓`}):(0,x.jsx)(`span`,{className:`text-text-muted ml-1`,children:`↕`});return(0,x.jsx)(`div`,{className:`overflow-auto max-h-64 rounded-md border border-border-subtle`,children:(0,x.jsxs)(`table`,{className:`w-full text-[11px] font-mono border-collapse`,children:[(0,x.jsx)(`thead`,{className:`sticky top-0 bg-deep z-10`,children:(0,x.jsx)(`tr`,{children:o.map(e=>(0,x.jsxs)(`th`,{onClick:()=>i(e.key),className:`px-2 py-1.5 text-left text-text-muted font-semibold cursor-pointer hover:text-text-secondary select-none border-b border-border-subtle whitespace-nowrap`,children:[e.label,s(e.key)]},e.key))})}),(0,x.jsx)(`tbody`,{children:a.map((e,n)=>(0,x.jsxs)(`tr`,{onClick:()=>t(e),className:`cursor-pointer hover:bg-accent/10 transition-colors`,children:[(0,x.jsx)(`td`,{className:`px-2 py-1 text-accent truncate max-w-[120px]`,title:e.name,children:e.name}),(0,x.jsx)(`td`,{className:`px-2 py-1 text-node-interface`,children:e.kind}),(0,x.jsx)(`td`,{className:`px-2 py-1 text-text-muted truncate max-w-[180px]`,title:e.filePath??``,children:e.filePath??`—`})]},e.id??n))})]})})}function Ka({groups:e}){let t=[...e].sort((e,t)=>t.count-e.count);return(0,x.jsx)(`div`,{className:`overflow-auto max-h-48 rounded-md border border-border-subtle`,children:(0,x.jsxs)(`table`,{className:`w-full text-[11px] font-mono border-collapse`,children:[(0,x.jsx)(`thead`,{className:`sticky top-0 bg-deep z-10`,children:(0,x.jsxs)(`tr`,{children:[(0,x.jsx)(`th`,{className:`px-2 py-1.5 text-left text-text-muted font-semibold border-b border-border-subtle`,children:`Group`}),(0,x.jsx)(`th`,{className:`px-2 py-1.5 text-left text-text-muted font-semibold border-b border-border-subtle`,children:`Count`})]})}),(0,x.jsx)(`tbody`,{children:t.map(({key:e,count:t})=>(0,x.jsxs)(`tr`,{className:`hover:bg-hover transition-colors`,children:[(0,x.jsx)(`td`,{className:`px-2 py-1 text-accent`,children:e}),(0,x.jsx)(`td`,{className:`px-2 py-1 text-text-primary font-bold`,children:t})]},e))})]})})}function qa(){let{state:e,dispatch:t}=E(),[n,r]=(0,b.useState)(``),[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)(null),[c,l]=(0,b.useState)(null),[u,d]=(0,b.useState)(()=>Ba()),f=(0,b.useRef)(null),p=(0,b.useRef)(null);(0,b.useEffect)(()=>{p.current&&(p.current.innerHTML=Wa(n)+`
354
+ `)},[n]);let m=(0,b.useCallback)(()=>{f.current&&p.current&&(p.current.scrollTop=f.current.scrollTop,p.current.scrollLeft=f.current.scrollLeft)},[]),h=(0,b.useCallback)(async()=>{let t=n.trim();if(!(!t||i)){a(!0),l(null),s(null);try{s(await new D(e.serverUrl).queryGQL(t)),Ha(t),d(Ba())}catch(e){l(e instanceof Error?e.message:String(e))}finally{a(!1)}}},[n,i,e.serverUrl]),g=(0,b.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&e.key===`Enter`&&(e.preventDefault(),h())},[h]),_=(0,b.useCallback)(e=>t({type:`SELECT_NODE`,node:e}),[t]),v=o&&o.nodes.length>0,y=o&&o.groups&&o.groups.length>0,S=`w-full bg-deep border border-border-subtle rounded text-[11px] text-text-secondary px-2 py-1 focus:outline-none focus:border-accent cursor-pointer`;return(0,x.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden text-sm`,children:[(0,x.jsx)(`div`,{className:`px-3 py-2 border-b border-border-subtle flex-shrink-0`,children:(0,x.jsx)(`h3`,{className:`text-[10px] font-bold tracking-wider text-accent/80 uppercase`,children:`GQL Query Console`})}),(0,x.jsxs)(`div`,{className:`flex-1 overflow-y-auto scrollbar-thin px-3 py-2 space-y-2`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`label`,{className:`block text-[10px] text-text-muted mb-1 font-semibold uppercase tracking-wider`,children:`Examples`}),(0,x.jsxs)(`select`,{onChange:e=>{e.target.value&&(r(e.target.value),e.target.value=``)},defaultValue:``,className:S,children:[(0,x.jsx)(`option`,{value:``,disabled:!0,children:`— pick an example —`}),Ra.map(e=>(0,x.jsx)(`option`,{value:e,children:e},e))]})]}),u.length>0&&(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`label`,{className:`block text-[10px] text-text-muted mb-1 font-semibold uppercase tracking-wider`,children:`History`}),(0,x.jsxs)(`select`,{onChange:e=>{e.target.value&&(r(e.target.value),e.target.value=``)},defaultValue:``,className:S,children:[(0,x.jsx)(`option`,{value:``,disabled:!0,children:`— recent queries —`}),u.map((e,t)=>(0,x.jsx)(`option`,{value:e,children:e.length>60?e.slice(0,57)+`…`:e},t))]})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`label`,{className:`block text-[10px] text-text-muted mb-1 font-semibold uppercase tracking-wider`,children:[`Query `,(0,x.jsx)(`span`,{className:`text-text-muted/50 normal-case font-normal`,children:`(Ctrl+Enter to run)`})]}),(0,x.jsxs)(`div`,{className:`relative`,style:{height:`100px`},children:[(0,x.jsx)(`div`,{ref:p,"aria-hidden":`true`,className:`absolute inset-0 overflow-hidden whitespace-pre-wrap break-words pointer-events-none rounded-md border border-transparent`,style:{fontFamily:`ui-monospace, "Cascadia Code", "Fira Code", monospace`,fontSize:`11px`,lineHeight:`1.5`,padding:`6px 8px`,color:`transparent`,background:`#0a0a10`,wordBreak:`break-word`,zIndex:0}}),(0,x.jsx)(`textarea`,{ref:f,value:n,onChange:e=>r(e.target.value),onKeyDown:g,onScroll:m,spellCheck:!1,placeholder:`FIND function WHERE name CONTAINS "auth"`,className:`absolute inset-0 w-full h-full resize-none rounded-md border border-border-subtle focus:outline-none focus:border-accent`,style:{fontFamily:`ui-monospace, "Cascadia Code", "Fira Code", monospace`,fontSize:`11px`,lineHeight:`1.5`,padding:`6px 8px`,background:`transparent`,color:`#e4e4ed`,caretColor:`#e4e4ed`,zIndex:1}})]})]}),(0,x.jsx)(`button`,{onClick:()=>void h(),disabled:i||!n.trim(),className:`w-full py-1.5 rounded-md text-xs font-semibold tracking-wide transition flex items-center justify-center gap-2 bg-accent hover:opacity-90 text-white disabled:opacity-40 disabled:cursor-not-allowed`,children:i?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`svg`,{className:`animate-spin h-3.5 w-3.5`,fill:`none`,viewBox:`0 0 24 24`,children:[(0,x.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,x.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8v8H4z`})]}),`Running…`]}):(0,x.jsx)(x.Fragment,{children:`▶ Run`})}),c&&(0,x.jsxs)(`div`,{className:`rounded-md border border-red-700/60 bg-red-900/20 px-3 py-2`,children:[(0,x.jsx)(`p`,{className:`text-[10px] font-bold text-red-400 uppercase tracking-wider mb-0.5`,children:`Error`}),(0,x.jsx)(`p`,{className:`text-[11px] text-red-300 font-mono break-words`,children:c})]}),o&&(0,x.jsxs)(`div`,{className:`space-y-2`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] text-text-muted`,children:[(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`span`,{className:`text-text-primary font-semibold`,children:o.totalCount}),` result`,o.totalCount===1?``:`s`]}),(0,x.jsxs)(`span`,{children:[(0,x.jsx)(`span`,{className:`text-text-primary font-semibold`,children:o.executionTimeMs}),` ms`]}),o.truncated&&(0,x.jsx)(`span`,{className:`text-amber-400 font-semibold`,children:`⚠ truncated`})]}),v&&(0,x.jsx)(Ga,{nodes:o.nodes,onSelectNode:_}),y&&o.groups&&(0,x.jsx)(Ka,{groups:o.groups}),o.edges&&o.edges.length>0&&(0,x.jsxs)(`p`,{className:`text-[10px] text-text-muted`,children:[`+ `,(0,x.jsx)(`span`,{className:`text-text-primary`,children:o.edges.length}),` edge`,o.edges.length===1?``:`s`,` in result`]}),!v&&!y&&(0,x.jsx)(`p`,{className:`text-[11px] text-text-muted italic`,children:`No results.`})]})]})]})}function Ja(e){return e>=.8?`#4ade80`:e>=.5?`#fbbf24`:`#f87171`}function Ya(e){return e>=.8?`border-node-class/60`:e>=.5?`border-amber-500/60`:`border-red-500/60`}function Xa({onClose:e,onCreated:t}){let{state:n}=E(),[r,i]=(0,b.useState)(``),[a,o]=(0,b.useState)(!1),[s,c]=(0,b.useState)(``),l=async()=>{if(r.trim()){o(!0),c(``);try{await new D(n.serverUrl).createGroup(r.trim()),t(r.trim())}catch(e){c(e instanceof Error?e.message:`Failed to create group`)}finally{o(!1)}}};return(0,x.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:e,children:(0,x.jsxs)(`div`,{className:`bg-surface border border-border-subtle rounded-xl shadow-2xl w-80 p-5`,onClick:e=>e.stopPropagation(),children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,x.jsx)(`h3`,{className:`text-sm font-semibold text-text-primary`,children:`Create Group`}),(0,x.jsx)(`button`,{onClick:e,className:`text-text-muted hover:text-text-secondary text-xs`,children:`✕`})]}),(0,x.jsx)(`input`,{autoFocus:!0,type:`text`,value:r,onChange:e=>i(e.target.value),onKeyDown:t=>{t.key===`Enter`&&l(),t.key===`Escape`&&e()},placeholder:`Group name…`,className:`w-full bg-elevated border border-border-subtle rounded-lg px-3 py-2 text-sm text-text-primary placeholder-text-muted focus:border-accent focus:ring-2 focus:ring-accent/20 focus:outline-none`}),s&&(0,x.jsx)(`p`,{className:`text-xs text-red-400 mt-2`,children:s}),(0,x.jsxs)(`div`,{className:`flex justify-end gap-2 mt-4`,children:[(0,x.jsx)(`button`,{onClick:e,className:`px-3 py-1.5 text-xs text-text-muted hover:text-text-secondary rounded-lg border border-border-subtle hover:bg-hover transition`,children:`Cancel`}),(0,x.jsx)(`button`,{onClick:l,disabled:a||!r.trim(),className:`px-3 py-1.5 text-xs bg-accent text-white rounded-lg hover:bg-accent/80 disabled:opacity-50 transition`,children:a?`Creating…`:`Create`})]})]})})}function Za({group:e,repos:t,onClose:n,onSaved:r,onDeleted:i}){let{state:a}=E(),[o,s]=(0,b.useState)(e.name),[c,l]=(0,b.useState)(!1),[u,d]=(0,b.useState)(``),[f,p]=(0,b.useState)(!1),[m,h]=(0,b.useState)(!1),[g,_]=(0,b.useState)(``),[v,y]=(0,b.useState)(``),[S,C]=(0,b.useState)(``),[w,T]=(0,b.useState)(!1),[O,ee]=(0,b.useState)(null),te=new D(a.serverUrl),k=async()=>{if(!(!o.trim()||o.trim()===e.name)){l(!0),d(``);try{await te.renameGroup(e.name,o.trim()),r({...e,name:o.trim()})}catch(e){d(e instanceof Error?e.message:`Rename failed`)}finally{l(!1)}}},A=async()=>{p(!0);try{await te.deleteGroup(e.name),i(e.name)}catch(e){p(!1),alert(e instanceof Error?e.message:`Delete failed`)}},j=async()=>{if(!(!g.trim()||!v)){T(!0),C(``);try{let t=await te.addGroupMember(e.name,g.trim(),v);r({...e,members:t.members}),_(``),y(``)}catch(e){C(e instanceof Error?e.message:`Failed to add member`)}finally{T(!1)}}},M=async t=>{ee(t);try{let n=await te.removeGroupMember(e.name,t);r({...e,members:n.members})}catch(e){alert(e instanceof Error?e.message:`Remove failed`)}finally{ee(null)}},N=t.filter(t=>!e.members.some(e=>e.registryName===t.name)).sort((e,t)=>e.name.localeCompare(t.name));return(0,x.jsxs)(`div`,{className:`border-t border-border-subtle bg-deep/60`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border-subtle/50`,children:[(0,x.jsxs)(`span`,{className:`text-[10px] font-bold tracking-wider text-accent/80 uppercase truncate`,children:[`Edit: `,e.name]}),(0,x.jsx)(`button`,{onClick:n,className:`text-[10px] text-text-muted hover:text-text-secondary shrink-0 ml-2`,children:`✕`})]}),(0,x.jsxs)(`div`,{className:`px-3 py-2 space-y-3`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`label`,{className:`text-[9px] font-bold tracking-wider text-text-muted uppercase block mb-1`,children:`Name`}),(0,x.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,x.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&k()},className:`flex-1 min-w-0 bg-elevated border border-border-subtle rounded px-2 py-1 text-xs text-text-primary focus:border-accent focus:outline-none`}),(0,x.jsx)(`button`,{onClick:k,disabled:c||!o.trim()||o.trim()===e.name,className:`px-2 py-1 text-[10px] bg-accent/20 text-accent border border-accent/30 rounded hover:bg-accent/30 disabled:opacity-40 transition shrink-0`,children:c?`…`:`Rename`})]}),u&&(0,x.jsx)(`p`,{className:`text-[9px] text-red-400 mt-1`,children:u})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`label`,{className:`text-[9px] font-bold tracking-wider text-text-muted uppercase block mb-1`,children:[`Members (`,e.members.length,`)`]}),e.members.length===0&&(0,x.jsx)(`p`,{className:`text-[10px] text-text-muted/50 italic`,children:`No members yet.`}),(0,x.jsx)(`div`,{className:`space-y-0.5 max-h-28 overflow-y-auto scrollbar-thin`,children:e.members.map(e=>(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5 py-0.5 pr-0.5`,children:[(0,x.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,x.jsx)(`span`,{className:`text-[10px] text-text-primary font-semibold truncate block`,children:e.registryName}),(0,x.jsx)(`span`,{className:`text-[9px] text-text-muted/50 font-mono truncate block`,children:e.groupPath})]}),(0,x.jsx)(`button`,{onClick:()=>M(e.groupPath),disabled:O===e.groupPath,className:`shrink-0 text-[9px] text-red-400/60 hover:text-red-400 border border-red-500/20 hover:border-red-500/50 rounded px-1 py-0.5 transition disabled:opacity-40`,title:`Remove member`,children:O===e.groupPath?`…`:`✕`})]},e.groupPath))})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`label`,{className:`text-[9px] font-bold tracking-wider text-text-muted uppercase block mb-1`,children:`Add Repo`}),N.length===0?(0,x.jsx)(`p`,{className:`text-[9px] text-text-muted/50 italic`,children:`All indexed repos are already members.`}):(0,x.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,x.jsxs)(`select`,{value:v,onChange:e=>y(e.target.value),className:`w-full bg-elevated border border-border-subtle rounded px-2 py-1 text-xs text-text-primary focus:border-accent focus:outline-none`,children:[(0,x.jsxs)(`option`,{value:``,children:[`Select repo… (`,N.length,`)`]}),N.map(e=>(0,x.jsx)(`option`,{value:e.name,children:e.name},e.name))]}),(0,x.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,x.jsx)(`input`,{type:`text`,value:g,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key===`Enter`&&j()},placeholder:`Path in group (e.g. services/api)`,className:`flex-1 min-w-0 bg-elevated border border-border-subtle rounded px-2 py-1 text-xs text-text-primary placeholder-text-muted/50 focus:border-accent focus:outline-none`}),(0,x.jsx)(`button`,{onClick:j,disabled:w||!g.trim()||!v,className:`px-2 py-1 text-[10px] bg-accent/20 text-accent border border-accent/30 rounded hover:bg-accent/30 disabled:opacity-40 transition shrink-0`,children:w?`…`:`Add`})]})]}),S&&(0,x.jsx)(`p`,{className:`text-[9px] text-red-400 mt-1`,children:S})]}),(0,x.jsx)(`div`,{className:`pt-1 border-t border-border-subtle/30`,children:m?(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsxs)(`span`,{className:`text-[10px] text-red-400 flex-1 truncate`,children:[`Delete "`,e.name,`"?`]}),(0,x.jsx)(`button`,{onClick:()=>h(!1),className:`text-[10px] text-text-muted hover:text-text-secondary border border-border-subtle rounded px-2 py-0.5 transition shrink-0`,children:`Cancel`}),(0,x.jsx)(`button`,{onClick:A,disabled:f,className:`text-[10px] text-white bg-red-600 hover:bg-red-500 rounded px-2 py-0.5 transition disabled:opacity-50 shrink-0`,children:f?`…`:`Delete`})]}):(0,x.jsx)(`button`,{onClick:()=>h(!0),className:`text-[10px] text-red-400/70 hover:text-red-400 border border-red-500/20 hover:border-red-500/50 rounded px-2 py-1 transition w-full`,children:`Delete group`})})]})]})}function Qa(){let{state:e}=E(),[t,n]=(0,b.useState)([]),[r,i]=(0,b.useState)(!1),[a,o]=(0,b.useState)(``),[s,c]=(0,b.useState)(null),[l,u]=(0,b.useState)(null),[d,f]=(0,b.useState)([]),[p,m]=(0,b.useState)(!1),[h,g]=(0,b.useState)(null),[_,v]=(0,b.useState)(!1),[y,S]=(0,b.useState)(null),[C,w]=(0,b.useState)(null),[T,O]=(0,b.useState)(null),[ee,te]=(0,b.useState)(``),k=new D(e.serverUrl),A=(0,b.useCallback)(()=>{i(!0),o(``),k.listGroups().then(n).catch(e=>o(e instanceof Error?e.message:`Failed to load groups`)).finally(()=>i(!1))},[e.serverUrl]);(0,b.useEffect)(()=>{A()},[A]),(0,b.useEffect)(()=>{k.listRepos().then(f).catch(()=>{})},[e.serverUrl]);let j=async e=>{try{u(await k.getGroup(e))}catch(e){alert(e instanceof Error?e.message:`Failed to load group`)}},M=async e=>{v(!0),S(e),g(null),w(null);try{g(await k.getGroupTopology(e))}catch{g({repos:[],edges:[]})}finally{v(!1)}},N=async e=>{O(e);try{await k.syncGroup(e),A()}catch(e){alert(e instanceof Error?e.message:`Sync failed`)}finally{O(null)}},P=e=>{m(!1),A(),j(e)},F=e=>{u(e),A()},I=e=>{u(null),n(t=>t.filter(t=>t.name!==e))},ne=t.filter(e=>e.name.toLowerCase().includes(ee.toLowerCase()));return r?(0,x.jsx)(`div`,{className:`p-4 text-sm text-text-muted animate-pulse`,children:`Loading groups…`}):a?(0,x.jsx)(`div`,{className:`p-4 text-sm text-red-400`,children:a}):(0,x.jsxs)(`div`,{className:`flex flex-col h-full text-sm overflow-hidden`,children:[(0,x.jsxs)(`div`,{className:`px-3 py-2 border-b border-border-subtle flex items-center justify-between shrink-0`,children:[(0,x.jsxs)(`h3`,{className:`text-[10px] font-bold tracking-wider text-accent/80 uppercase`,children:[`⬡ Groups (`,t.length,`)`]}),(0,x.jsx)(`button`,{onClick:()=>m(!0),className:`text-[10px] text-accent hover:text-accent/80 border border-accent/30 hover:border-accent/60 rounded px-1.5 py-0.5 transition flex items-center gap-1`,title:`Create new group`,children:`+ New`})]}),t.length>0&&(0,x.jsx)(`div`,{className:`px-2 py-1.5 border-b border-border-subtle/50 shrink-0`,children:(0,x.jsxs)(`div`,{className:`relative`,children:[(0,x.jsx)(`span`,{className:`absolute left-2 top-1/2 -translate-y-1/2 text-text-muted text-[10px] pointer-events-none`,children:`⌕`}),(0,x.jsx)(`input`,{type:`text`,value:ee,onChange:e=>te(e.target.value),placeholder:`Filter groups…`,className:`w-full bg-elevated border border-border-subtle rounded pl-6 pr-2 py-1 text-[10px] text-text-primary placeholder-text-muted/60 focus:border-accent focus:outline-none transition`}),ee&&(0,x.jsx)(`button`,{onClick:()=>te(``),className:`absolute right-1.5 top-1/2 -translate-y-1/2 text-text-muted/50 hover:text-text-muted text-[10px]`,children:`✕`})]})}),p&&(0,x.jsx)(Xa,{onClose:()=>m(!1),onCreated:P}),(0,x.jsxs)(`div`,{className:`flex-1 overflow-y-auto scrollbar-thin`,children:[t.length===0?(0,x.jsxs)(`div`,{className:`p-4 text-xs text-text-muted`,children:[(0,x.jsx)(`p`,{children:`No groups yet.`}),(0,x.jsxs)(`p`,{className:`mt-1`,children:[`Click `,(0,x.jsx)(`strong`,{children:`+ New`}),` to create one, or run:`]}),(0,x.jsx)(`code`,{className:`font-mono text-text-secondary text-[10px]`,children:`code-intel group create <name>`})]}):ne.length===0?(0,x.jsxs)(`div`,{className:`p-4 text-xs text-text-muted text-center`,children:[`No groups match "`,ee,`"`]}):(0,x.jsx)(`div`,{className:`space-y-0`,children:ne.map(e=>(0,x.jsxs)(`div`,{className:`border-b border-border-subtle/50`,children:[(0,x.jsxs)(`div`,{className:`px-3 py-2 flex items-center gap-1.5`,children:[(0,x.jsxs)(`button`,{className:`flex items-center gap-1 text-left flex-1 min-w-0`,onClick:()=>c(s===e.name?null:e.name),children:[(0,x.jsx)(`span`,{className:`text-[10px] text-text-muted shrink-0`,children:s===e.name?`▾`:`▸`}),(0,x.jsx)(`span`,{className:`text-xs font-semibold text-accent truncate`,children:e.name}),(0,x.jsxs)(`span`,{className:`text-[10px] text-text-muted shrink-0`,children:[`(`,e.memberCount,`)`]})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,x.jsx)(`button`,{onClick:()=>M(e.name),className:`text-[9px] text-text-muted hover:text-accent border border-border-subtle hover:border-accent/40 rounded px-1 py-0.5 transition`,title:`View topology`,children:`⬡`}),(0,x.jsx)(`button`,{onClick:()=>N(e.name),disabled:T===e.name,className:`text-[9px] text-text-muted hover:text-accent border border-border-subtle hover:border-accent/40 rounded px-1 py-0.5 transition disabled:opacity-40`,title:`Sync group`,children:T===e.name?`⟳`:`↻`}),(0,x.jsx)(`button`,{onClick:()=>l?.name===e.name?u(null):j(e.name),className:`text-[9px] border rounded px-1 py-0.5 transition ${l?.name===e.name?`text-accent border-accent/60 bg-accent/10`:`text-text-muted hover:text-accent border-border-subtle hover:border-accent/40`}`,title:`Edit group`,children:`✎`})]})]}),s===e.name&&e.lastSync&&(0,x.jsx)(`div`,{className:`px-6 pb-1.5`,children:(0,x.jsxs)(`p`,{className:`text-[9px] text-text-muted/50`,children:[`Last synced: `,new Date(e.lastSync).toLocaleString()]})}),l?.name===e.name&&(0,x.jsx)(Za,{group:l,repos:d,onClose:()=>u(null),onSaved:F,onDeleted:I})]},e.name))}),y&&(0,x.jsxs)(`div`,{className:`border-t border-border-subtle mt-2`,children:[(0,x.jsxs)(`div`,{className:`px-3 py-2 flex items-center justify-between`,children:[(0,x.jsxs)(`h3`,{className:`text-[10px] font-bold tracking-wider text-accent/80 uppercase`,children:[`Topology: `,y]}),(0,x.jsx)(`button`,{onClick:()=>{S(null),g(null),w(null)},className:`text-[10px] text-text-muted hover:text-text-secondary`,children:`✕`})]}),_&&(0,x.jsx)(`div`,{className:`px-3 py-2 text-[10px] text-text-muted animate-pulse`,children:`Loading topology…`}),h&&!_&&(0,x.jsxs)(`div`,{className:`px-3 pb-3`,children:[(0,x.jsx)(`div`,{className:`flex flex-wrap gap-2 mb-3`,children:h.repos.map(e=>{let t=h.edges.filter(t=>t.source===e.name||t.target===e.name),n=t.reduce((e,t)=>Math.max(e,t.confidence),0);return(0,x.jsxs)(`div`,{className:`border rounded-md px-2 py-1.5 bg-surface hover:bg-hover transition ${t.length>0?Ya(n):`border-border-default`}`,title:`${e.groupPath}\n${e.nodeCount} nodes · ${e.edgeCount} edges`,children:[(0,x.jsx)(`div`,{className:`text-[10px] font-semibold text-text-primary truncate max-w-[120px]`,children:e.name}),(0,x.jsxs)(`div`,{className:`text-[9px] text-text-muted font-mono`,children:[e.nodeCount,`n · `,e.edgeCount,`e`]})]},e.name)})}),h.edges.length>0&&(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`h4`,{className:`text-[9px] font-bold tracking-wider text-text-muted uppercase mb-1`,children:[`Cross-repo edges (`,h.edges.length,`)`]}),(0,x.jsx)(`div`,{className:`space-y-0.5 max-h-48 overflow-y-auto scrollbar-thin`,children:h.edges.map((e,t)=>(0,x.jsxs)(`button`,{className:`w-full text-left flex items-center gap-1.5 px-2 py-1 rounded hover:bg-hover transition`,onClick:()=>w(C===e?null:e),children:[(0,x.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full shrink-0`,style:{backgroundColor:Ja(e.confidence)}}),(0,x.jsx)(`span`,{className:`text-[10px] text-node-function font-mono truncate`,children:e.source}),(0,x.jsx)(`span`,{className:`text-[9px] text-text-muted`,children:`→`}),(0,x.jsx)(`span`,{className:`text-[10px] text-accent font-mono truncate`,children:e.target}),(0,x.jsxs)(`span`,{className:`text-[9px] text-text-muted ml-auto shrink-0`,children:[(e.confidence*100).toFixed(0),`%`]})]},t))})]}),h.edges.length===0&&(0,x.jsx)(`p`,{className:`text-[10px] text-text-muted/60`,children:`No cross-repo edges. Run sync (↻) first.`})]})]}),C&&(0,x.jsxs)(`div`,{className:`mx-3 mb-3 bg-surface border border-border-subtle rounded-md p-2`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,x.jsx)(`h4`,{className:`text-[9px] font-bold tracking-wider text-text-muted uppercase`,children:`Edge Detail`}),(0,x.jsx)(`button`,{onClick:()=>w(null),className:`text-[10px] text-text-muted hover:text-text-secondary`,children:`✕`})]}),(0,x.jsxs)(`div`,{className:`space-y-0.5 text-[10px]`,children:[(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{className:`text-text-muted`,children:`Contract:`}),` `,(0,x.jsx)(`span`,{className:`text-text-primary font-mono`,children:C.contractName})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{className:`text-text-muted`,children:`Provider:`}),` `,(0,x.jsx)(`span`,{className:`text-node-function font-mono`,children:C.source})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{className:`text-text-muted`,children:`Consumer:`}),` `,(0,x.jsx)(`span`,{className:`text-accent font-mono`,children:C.target})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{className:`text-text-muted`,children:`Confidence:`}),` `,(0,x.jsxs)(`span`,{style:{color:Ja(C.confidence)},className:`font-mono`,children:[(C.confidence*100).toFixed(1),`%`]})]}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`span`,{className:`text-text-muted`,children:`Kind:`}),` `,(0,x.jsx)(`span`,{className:`text-text-secondary`,children:C.kind})]})]})]})]})]})}function $a(){let{state:e}=E(),[t,n]=(0,b.useState)(`unknown`),[r,i]=(0,b.useState)(!1),a=(0,b.useRef)(null),[o,s]=(0,b.useState)(!1),[c,l]=(0,b.useState)(null),u=(0,b.useRef)(null),d=e=>{l(e),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>l(null),4e3)};(0,b.useEffect)(()=>()=>{u.current&&clearTimeout(u.current)},[]),(0,b.useEffect)(()=>{if(!e.connected||!e.currentUser)return;let t=e.serverUrl.replace(/^http/,`ws`)+`/ws`,n=null,r=null,i=!1;function a(){if(!i)try{n=new WebSocket(t),n.onopen=()=>s(!0),n.onclose=()=>{s(!1),i||(r=setTimeout(a,3e3+Math.random()*500))},n.onerror=()=>{},n.onmessage=e=>{try{let t=JSON.parse(e.data);if(t.type===`graph:updated`){let e=t.changedFiles?.length??0;d(`Graph updated — ${e} file${e===1?``:`s`} changed`)}}catch{}}}catch{}}return a(),()=>{i=!0,r&&clearTimeout(r),n?.close(),s(!1)}},[e.connected,e.currentUser,e.serverUrl]);let f=(0,b.useCallback)(async()=>{if(!e.connected)return;let t=new D(e.serverUrl);try{let e=await t.vectorStatus();if(e.ready){n(`ready`),i(!1),a.current&&clearTimeout(a.current);return}e.building?(n(`building`),i(!0)):(n(`unknown`),i(!1))}catch{n(`unknown`),i(!1)}a.current=setTimeout(()=>void f(),5e3)},[e.connected,e.serverUrl]);(0,b.useEffect)(()=>(a.current&&clearTimeout(a.current),n(`unknown`),i(!1),e.connected&&f(),()=>{a.current&&clearTimeout(a.current)}),[e.connected,e.serverUrl]);let p=e.connected?`bg-node-function`:`bg-text-muted`,m;m=t===`building`?(0,x.jsxs)(`span`,{className:`flex items-center gap-1 text-amber-400`,children:[(0,x.jsx)(`span`,{className:`inline-block`,style:{animation:r?`spin 1s linear infinite`:`none`},children:`⟳`}),(0,x.jsx)(`span`,{children:`vec building…`})]}):t===`ready`?(0,x.jsx)(`span`,{className:`text-node-function`,children:`⚡ vec ready`}):(0,x.jsx)(`span`,{className:`text-text-muted/50`,children:`vec –`});let h=e.selectedNode;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`style`,{children:`@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }`}),c&&(0,x.jsxs)(`div`,{className:`fixed bottom-10 left-1/2 -translate-x-1/2 z-50 bg-accent/90 border border-accent/50 text-white text-xs px-4 py-2 rounded-lg shadow-lg flex items-center gap-2 pointer-events-none animate-fade-in`,children:[(0,x.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-white/60 animate-pulse`}),c]}),(0,x.jsxs)(`footer`,{className:`h-7 bg-deep border-t border-border-subtle flex items-center px-3 text-xs text-text-muted shrink-0`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,x.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(`span`,{className:`w-2 h-2 rounded-full ${p}`}),(0,x.jsx)(`span`,{className:e.connected?`text-text-secondary`:`text-text-muted/60`,children:e.connected?e.serverUrl:`Disconnected`})]}),e.connected&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`span`,{className:`text-border-default`,children:`·`}),(0,x.jsxs)(`span`,{className:`flex items-center gap-1`,title:o?`Live updates active`:`Live updates disconnected`,children:[(0,x.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full ${o?`bg-node-function`:`bg-text-muted/40`}`}),(0,x.jsx)(`span`,{className:o?`text-node-function`:`text-text-muted/40`,children:`live`})]})]}),(0,x.jsx)(`span`,{className:`text-border-default`,children:`·`}),m,e.nodes.length>0&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`span`,{className:`text-border-default`,children:`·`}),(0,x.jsxs)(`span`,{children:[e.nodes.length.toLocaleString(),` nodes  / `,e.edges.length.toLocaleString(),` edges`]})]})]}),(0,x.jsx)(`div`,{className:`flex-1`}),h&&(0,x.jsx)(`span`,{className:`max-w-[30ch] truncate px-2 py-0.5 rounded-full bg-elevated text-text-secondary border border-border-subtle font-mono mr-3`,title:h.name,children:h.name}),(0,x.jsxs)(`span`,{className:`font-mono text-text-muted/50 text-[10px] select-none`,children:[`v`,`1.0.3`]})]})]})}var eo={admin:`text-red-400 border-red-700/50 bg-red-900/20`,analyst:`text-accent border-accent/30 bg-accent/10`,viewer:`text-text-muted border-border-default bg-elevated`,"repo-owner":`text-node-interface border-node-interface/30 bg-node-interface/10`};function to({onToggleAI:e,aiOpen:t}){let{state:n,dispatch:r}=E(),[i,a]=(0,b.useState)(``),[o,s]=(0,b.useState)(!1),[c,l]=(0,b.useState)(!1),[u,d]=(0,b.useState)(null),[f,p]=(0,b.useState)(!1),[m,h]=(0,b.useState)(!1),[g,_]=(0,b.useState)(!1),v=(0,b.useRef)(null),y=(0,b.useRef)(null);(0,b.useEffect)(()=>{if(!n.connected)return;let e=async()=>{try{let t=await new D(n.serverUrl).vectorStatus();d(t.ready),!t.ready&&t.building&&setTimeout(e,3e3)}catch{}};e()},[n.connected,n.serverUrl]),(0,b.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),v.current?.focus(),s(!0)),e.key===`Escape`&&(s(!1),h(!1))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,b.useEffect)(()=>{let e=e=>{y.current&&!y.current.contains(e.target)&&h(!1)};return m&&document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[m]);let S=async e=>{if(!e.trim()){s(!1);return}p(!0);try{let t=new D(n.serverUrl);if(c&&u){let{results:n,source:i}=await t.vectorSearch(e,12);r({type:`SET_SEARCH`,query:e,results:n}),console.log(`[search] vector source:`,i)}else{let{results:n}=await t.search(e,12);r({type:`SET_SEARCH`,query:e,results:n})}s(!0)}catch(e){console.error(e)}finally{p(!1)}},C=async()=>{_(!0);try{await new D(n.serverUrl).logout()}catch{}finally{r({type:`SET_CURRENT_USER`,user:null}),r({type:`SET_CONNECTED`,connected:!1}),r({type:`SET_GRAPH`,nodes:[],edges:[]}),r({type:`SET_VIEW`,view:`login`}),_(!1),h(!1)}},w=n.currentUser;return(0,x.jsxs)(`header`,{className:`flex items-center justify-between border-b border-border-subtle bg-deep px-4 py-0 h-12 gap-4 relative z-30 shrink-0`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2.5 shrink-0`,children:[(0,x.jsx)(`div`,{className:`flex h-7 w-7 items-center justify-center rounded-md bg-gradient-to-br from-accent to-accent-dim text-sm font-bold text-white shadow-glow`,children:`◈`}),(0,x.jsx)(`span`,{className:`text-[15px] font-semibold tracking-tight text-text-primary`,children:`Code Intel`}),n.repoName&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`span`,{className:`text-border-default`,children:`·`}),n.mode===`group`?(0,x.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(`span`,{className:`text-xs bg-accent/20 text-accent border border-accent/30 rounded px-1.5 py-0.5 font-mono`,children:`group`}),(0,x.jsx)(`span`,{className:`text-accent text-sm font-mono`,children:n.repoName})]}):(0,x.jsx)(`span`,{className:`text-accent text-sm font-mono`,children:n.repoName})]})]}),(0,x.jsxs)(`div`,{className:`flex-1 max-w-2xl mx-auto relative`,children:[(0,x.jsxs)(`div`,{className:`relative flex items-center`,children:[(0,x.jsx)(`span`,{className:`absolute left-3 top-1/2 -translate-y-1/2 text-text-muted text-sm z-10 pointer-events-none`,children:f?(0,x.jsx)(`span`,{className:`animate-spin inline-block`,children:`⟳`}):`⌕`}),(0,x.jsx)(`input`,{ref:v,type:`text`,value:i,onChange:e=>a(e.target.value),onFocus:()=>s(n.search.results.length>0||i.length>0),onBlur:()=>setTimeout(()=>s(!1),150),onKeyDown:e=>{e.key===`Enter`&&S(i),e.key===`Escape`&&(s(!1),v.current?.blur())},placeholder:c&&u?`Semantic search…`:`Search nodes…`,className:`w-full bg-surface border border-border-subtle rounded-lg pl-9 pr-28 py-1.5 text-sm text-text-primary placeholder-text-muted focus:border-accent focus:ring-2 focus:ring-accent/20 focus:outline-none transition`}),(0,x.jsx)(`button`,{onClick:()=>l(e=>!e),title:u?c?`Switch to keyword search`:`Switch to semantic search`:`Vector index building…`,className:`absolute right-14 top-1/2 -translate-y-1/2 text-[10px] px-1.5 py-0.5 rounded border font-mono transition-all ${u===null?`text-text-muted border-border-subtle`:u&&c?`text-accent border-accent/40 bg-accent/10`:u?`text-text-muted border-border-subtle hover:border-accent/40 hover:text-accent`:`text-amber-400 border-amber-700/50 animate-pulse`}`,children:u===null?`…`:u?c?`⚡ vec`:`vec`:`⟳ vec`}),(0,x.jsx)(`kbd`,{className:`absolute right-3 top-1/2 -translate-y-1/2 rounded border border-border-subtle bg-elevated px-1.5 py-0.5 font-mono text-[10px] text-text-muted`,children:`⌘K`})]}),o&&n.search.results.length>0&&(0,x.jsx)(`div`,{className:`absolute top-full left-0 right-0 mt-1 bg-surface border border-border-subtle rounded-xl shadow-xl max-h-96 overflow-y-auto scrollbar-thin z-50`,children:n.search.results.map(e=>(0,x.jsxs)(`div`,{className:`flex items-center gap-2.5 px-3 py-2 hover:bg-hover cursor-pointer border-b border-border-subtle/50 last:border-0 transition`,onMouseDown:t=>{t.preventDefault();let i=n.nodes.find(t=>t.id===e.nodeId);i&&(r({type:`SELECT_NODE`,node:i}),s(!1))},children:[(0,x.jsx)(`span`,{className:`w-2 h-2 rounded-full flex-shrink-0`,style:{backgroundColor:Ei[e.kind]??`#666`}}),(0,x.jsx)(`span`,{className:`text-sm text-text-primary font-medium truncate`,children:e.name}),(0,x.jsx)(`span`,{className:`text-xs text-text-muted ml-auto truncate max-w-xs font-mono`,children:e.filePath})]},e.nodeId))})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[n.nodes.length>0&&(0,x.jsxs)(`div`,{className:`hidden md:flex items-center gap-2 text-xs text-text-muted font-mono`,children:[(0,x.jsxs)(`span`,{children:[n.nodes.length.toLocaleString(),` nodes`]}),(0,x.jsx)(`span`,{className:`text-border-default`,children:`·`}),(0,x.jsxs)(`span`,{children:[n.edges.length.toLocaleString(),` edges`]})]}),(0,x.jsxs)(`button`,{onClick:e,className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition ${t?`bg-gradient-to-r from-accent to-accent-dim text-white shadow-glow`:`bg-surface hover:bg-hover text-text-secondary border border-border-subtle`}`,children:[(0,x.jsx)(`span`,{children:`✦`}),(0,x.jsx)(`span`,{children:`Code AI`})]}),w&&(0,x.jsxs)(`div`,{className:`relative`,ref:y,children:[(0,x.jsxs)(`button`,{onClick:()=>h(e=>!e),className:`flex items-center gap-2 px-2.5 py-1.5 rounded-lg hover:bg-hover border border-border-subtle transition`,children:[(0,x.jsx)(`div`,{className:`w-6 h-6 rounded-full bg-gradient-to-br from-accent to-accent-dim flex items-center justify-center text-white text-xs font-bold select-none`,children:w.username.charAt(0).toUpperCase()}),(0,x.jsx)(`span`,{className:`text-sm text-text-secondary max-w-[80px] truncate`,children:w.username}),(0,x.jsx)(`span`,{className:`text-[9px] px-1.5 py-0.5 rounded border font-mono ${eo[w.role]??eo.viewer}`,children:w.role}),(0,x.jsx)(`svg`,{className:`w-3 h-3 text-text-muted transition-transform ${m?`rotate-180`:``}`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,x.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19 9l-7 7-7-7`})})]}),m&&(0,x.jsxs)(`div`,{className:`absolute right-0 top-full mt-1 w-52 bg-surface border border-border-subtle rounded-xl shadow-2xl py-1 z-50 animate-slide-up`,children:[(0,x.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-border-subtle`,children:[(0,x.jsx)(`p`,{className:`text-sm text-text-primary font-semibold`,children:w.username}),(0,x.jsx)(`p`,{className:`text-xs text-text-muted mt-0.5 capitalize`,children:w.role})]}),(0,x.jsxs)(`button`,{onClick:()=>{h(!1),r({type:`SET_CONNECTED`,connected:!1}),r({type:`SET_VIEW`,view:`connect`})},className:`w-full text-left px-4 py-2 text-sm text-text-secondary hover:bg-hover hover:text-text-primary transition flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`text-text-muted`,children:`⬡`}),`Switch Repository`]}),(0,x.jsxs)(`button`,{onClick:C,disabled:g,className:`w-full text-left px-4 py-2 text-sm text-red-400 hover:bg-red-950/30 hover:text-red-300 transition flex items-center gap-2 disabled:opacity-50`,children:[g?(0,x.jsx)(`span`,{className:`animate-spin inline-block text-xs`,children:`⟳`}):(0,x.jsx)(`svg`,{className:`w-3.5 h-3.5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:2,children:(0,x.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1`})}),g?`Signing out…`:`Sign out`]})]})]})]})]})}var no=[{title:`Navigation`,shortcuts:[{keys:[`Esc`],description:`Close panel / Deselect node`},{keys:[`Tab`],description:`Cycle through NodeDetail tabs`},{keys:[`←`,`→`],description:`Navigate search results`}]},{title:`Search`,shortcuts:[{keys:[`⌘K`,`Ctrl+K`],description:`Focus search`},{keys:[`?`],description:`Toggle shortcuts panel`}]},{title:`Graph`,shortcuts:[{keys:[`F`],description:`Fit graph to view`},{keys:[`G`],description:`Jump to graph`}]}];function X({open:e,onClose:t}){let n=(0,b.useRef)(null);return(0,b.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),e?(0,x.jsx)(`div`,{ref:n,onClick:e=>{e.target===n.current&&t()},className:`fixed inset-0 z-50 flex items-center justify-center bg-void/70 backdrop-blur-sm`,children:(0,x.jsxs)(`div`,{className:`w-full max-w-sm bg-deep border border-border-subtle rounded-xl shadow-2xl overflow-hidden animate-fade-in`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-border-subtle`,children:[(0,x.jsx)(`h2`,{className:`text-sm font-semibold text-text-primary tracking-wide`,children:`Keyboard Shortcuts`}),(0,x.jsx)(`button`,{onClick:t,className:`text-text-muted hover:text-text-primary transition text-base leading-none`,"aria-label":`Close shortcuts panel`,children:`×`})]}),(0,x.jsx)(`div`,{className:`p-4 space-y-5`,children:no.map(e=>(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`p`,{className:`text-[10px] font-bold tracking-widest text-accent/70 uppercase mb-2`,children:e.title}),(0,x.jsx)(`div`,{className:`space-y-2`,children:e.shortcuts.map(e=>(0,x.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,x.jsx)(`div`,{className:`flex items-center gap-1 flex-shrink-0`,children:e.keys.map(e=>(0,x.jsx)(`span`,{className:`bg-elevated border border-border-default text-text-secondary font-mono text-xs rounded px-1.5 py-0.5`,children:e},e))}),(0,x.jsx)(`span`,{className:`text-text-muted text-xs text-right`,children:e.description})]},e.description))})]},e.title))})]})}):null}function ro(){let{state:e,dispatch:t}=E(),[n,r]=(0,b.useState)(`explorer`),[i,a]=(0,b.useState)(!0),[o,s]=(0,b.useState)(!1),[c,l]=(0,b.useState)(!1);(0,b.useEffect)(()=>{function e(e){let t=e.target,n=t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable;e.key===`?`&&!n&&s(e=>!e)}return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,b.useEffect)(()=>{e.selectedNode&&e.selectedNode.filePath&&e.selectedNode.startLine?l(!0):l(!1)},[e.selectedNode?.id]);let u=[`explorer`,`filters`,`files`,`query`,...e.mode===`group`?[`group`]:[],`groups`];return(0,x.jsxs)(`div`,{className:`flex flex-col h-screen bg-void text-text-primary`,children:[(0,x.jsx)(to,{onToggleAI:()=>a(e=>!e),aiOpen:i}),(0,x.jsx)(X,{open:o,onClose:()=>s(!1)}),(0,x.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[(0,x.jsxs)(`div`,{className:`w-72 bg-deep border-r border-border-subtle flex flex-col shrink-0`,children:[(0,x.jsx)(`div`,{className:`flex border-b border-border-subtle`,children:u.map(e=>(0,x.jsx)(`button`,{onClick:()=>r(e),title:e,className:`flex-1 min-w-0 px-1.5 py-2.5 text-xs font-semibold capitalize tracking-wide transition truncate text-center ${n===e?`text-accent border-b-2 border-accent bg-accent/5`:`text-text-muted hover:text-text-secondary hover:bg-hover`}`,children:e===`group`?`⬢`:e===`groups`?`⬡ Groups`:e},e))}),(0,x.jsxs)(`div`,{className:`flex-1 overflow-hidden`,children:[n===`explorer`&&(0,x.jsx)(io,{}),n===`filters`&&(0,x.jsx)(Pa,{}),n===`files`&&(0,x.jsx)(Aa,{}),n===`query`&&(0,x.jsx)(qa,{}),n===`group`&&e.mode===`group`&&(0,x.jsx)(ao,{}),n===`groups`&&(0,x.jsx)(Qa,{})]})]}),(0,x.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden`,children:[(0,x.jsx)(`div`,{className:`flex-1 relative`,children:(0,x.jsx)(Bi,{})}),e.selectedNode&&(0,x.jsx)(Gi,{node:e.selectedNode,onClose:()=>t({type:`SELECT_NODE`,node:null})}),c&&e.selectedNode?.filePath&&e.selectedNode?.startLine&&(0,x.jsx)(na,{file:e.selectedNode.filePath,startLine:e.selectedNode.startLine,endLine:e.selectedNode.endLine??e.selectedNode.startLine,repo:e.repoName||void 0,onClose:()=>l(!1)})]}),i&&(0,x.jsx)(`div`,{className:`w-96 border-l border-border-subtle flex flex-col shrink-0`,children:(0,x.jsx)(fa,{})})]}),(0,x.jsx)($a,{})]})}function io(){let{state:e,dispatch:t}=E(),n=new Map;for(let t of e.nodes)n.set(t.kind,(n.get(t.kind)??0)+1);let r=[...n.entries()].sort((e,t)=>t[1]-e[1]).slice(0,10),i=r[0]?.[1]??1;return(0,x.jsxs)(`div`,{className:`overflow-y-auto scrollbar-thin h-full text-sm`,children:[e.search.results.length>0&&(0,x.jsxs)(`div`,{className:`p-3 border-b border-border-subtle`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,x.jsx)(`h3`,{className:`text-[10px] font-bold tracking-wider text-accent/80 uppercase`,children:`Search Results`}),(0,x.jsx)(`span`,{className:`text-[10px] bg-accent/20 text-accent px-1.5 py-0.5 rounded-full font-mono`,children:e.search.results.length})]}),(0,x.jsxs)(`p`,{className:`text-[10px] text-text-muted mb-2 truncate`,children:[`"`,e.search.query,`"`]}),(0,x.jsx)(`div`,{className:`space-y-0.5`,children:e.search.results.map(n=>(0,x.jsxs)(`button`,{onClick:()=>{let r=e.nodes.find(e=>e.id===n.nodeId);r&&t({type:`SELECT_NODE`,node:r})},className:`w-full flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-hover text-left group transition`,children:[(0,x.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full flex-shrink-0`,style:{backgroundColor:Ei[n.kind]??`#6b7280`}}),(0,x.jsx)(`span`,{className:`text-xs text-text-secondary font-medium truncate flex-1 group-hover:text-text-primary`,children:n.name}),(0,x.jsx)(`span`,{className:`text-[10px] text-text-muted font-mono`,children:n.kind})]},n.nodeId))})]}),(0,x.jsxs)(`div`,{className:`p-3 border-b border-border-subtle`,children:[(0,x.jsx)(`h3`,{className:`text-[10px] font-bold tracking-wider text-text-muted uppercase mb-3`,children:`Graph Composition`}),(0,x.jsx)(`div`,{className:`space-y-2`,children:r.map(([e,t])=>{let n=Ei[e]??`#6b7280`,r=t/i*100;return(0,x.jsxs)(`div`,{children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] mb-0.5`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full flex-shrink-0`,style:{backgroundColor:n}}),(0,x.jsx)(`span`,{className:`text-text-secondary`,children:e})]}),(0,x.jsx)(`span`,{className:`text-text-muted font-mono tabular-nums`,children:t})]}),(0,x.jsx)(`div`,{className:`h-1 bg-elevated rounded-full overflow-hidden`,children:(0,x.jsx)(`div`,{className:`h-full rounded-full transition-all duration-500`,style:{width:`${r}%`,backgroundColor:n,opacity:.7}})})]},e)})})]}),(0,x.jsxs)(`div`,{className:`p-3 border-b border-border-subtle`,children:[(0,x.jsx)(`h3`,{className:`text-[10px] font-bold tracking-wider text-text-muted uppercase mb-2`,children:`Overview`}),(0,x.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:[{label:`Nodes`,value:e.nodes.length,color:`text-accent`},{label:`Edges`,value:e.edges.length,color:`text-node-interface`},{label:`Files`,value:n.get(`file`)??0,color:`text-node-file`},{label:`Functions`,value:n.get(`function`)??0,color:`text-node-function`}].map(({label:e,value:t,color:n})=>(0,x.jsxs)(`div`,{className:`bg-surface rounded-lg p-2 border border-border-subtle`,children:[(0,x.jsx)(`p`,{className:`text-base font-bold font-mono ${n}`,children:t}),(0,x.jsx)(`p`,{className:`text-[10px] text-text-muted`,children:e})]},e))})]}),(0,x.jsx)(`div`,{className:`p-3`,children:(0,x.jsxs)(`p`,{className:`text-[10px] text-text-muted leading-relaxed`,children:[(0,x.jsx)(`span`,{className:`text-text-secondary font-mono`,children:`⌘K`}),` to search. Click nodes to inspect. Use `,(0,x.jsx)(`span`,{className:`text-text-secondary`,children:`Filters`}),` to show/hide node types. Press `,(0,x.jsx)(`span`,{className:`text-text-secondary font-mono`,children:`?`}),` for shortcuts.`]})})]})}function ao(){let{state:e,dispatch:t}=E(),[n,r]=(0,b.useState)(!1),[i,a]=(0,b.useState)(``);return(0,x.jsxs)(`div`,{className:`overflow-y-auto scrollbar-thin h-full text-sm`,children:[(0,x.jsxs)(`div`,{className:`p-3 border-b border-border-subtle`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,x.jsxs)(`h3`,{className:`text-[10px] font-bold tracking-wider text-accent/80 uppercase`,children:[`⬢ `,e.groupName]}),(0,x.jsx)(`button`,{onClick:async()=>{r(!0),a(``);try{let n=await new D(e.serverUrl).syncGroup(e.groupName);t({type:`SET_GROUP_CONTRACTS`,contracts:n.contracts,links:n.links,syncedAt:n.syncedAt})}catch(e){a(e instanceof Error?e.message:`Sync failed`)}finally{r(!1)}},disabled:n,className:`text-[10px] text-accent hover:text-accent/80 border border-accent/30 hover:border-accent/60 rounded px-1.5 py-0.5 transition disabled:opacity-50`,children:n?`⟳ syncing…`:`↻ sync`})]}),i&&(0,x.jsx)(`p`,{className:`text-red-400 text-[10px] mt-1`,children:i}),e.groupSyncedAt&&(0,x.jsxs)(`p`,{className:`text-[10px] text-text-muted`,children:[`Last sync: `,new Date(e.groupSyncedAt).toLocaleString()]})]}),(0,x.jsxs)(`div`,{className:`p-3 border-b border-border-subtle`,children:[(0,x.jsxs)(`h3`,{className:`text-[10px] font-bold tracking-wider text-text-muted uppercase mb-2`,children:[`Members (`,e.groupMembers.length,`)`]}),(0,x.jsx)(`div`,{className:`space-y-1`,children:e.groupMembers.map(e=>(0,x.jsxs)(`div`,{className:`bg-surface rounded-md px-2 py-1.5 border border-border-subtle`,children:[(0,x.jsx)(`div`,{className:`text-[10px] text-text-muted font-mono truncate`,children:e.groupPath}),(0,x.jsx)(`div`,{className:`text-xs text-accent font-medium truncate`,children:e.registryName})]},e.groupPath))})]}),e.groupContracts.length>0&&(0,x.jsxs)(`div`,{className:`p-3 border-b border-border-subtle`,children:[(0,x.jsxs)(`h3`,{className:`text-[10px] font-bold tracking-wider text-text-muted uppercase mb-2`,children:[`Contracts (`,e.groupContracts.length,`)`]}),(0,x.jsx)(`div`,{className:`space-y-0.5 max-h-40 overflow-y-auto scrollbar-thin`,children:e.groupContracts.slice(0,30).map((e,t)=>(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5 py-0.5`,children:[(0,x.jsx)(`span`,{className:`text-[9px] px-1 rounded font-mono ${e.kind===`export`?`bg-accent/20 text-accent`:e.kind===`route`?`bg-node-function/20 text-node-function`:e.kind===`event`?`bg-node-interface/20 text-node-interface`:`bg-elevated text-text-muted`}`,children:e.kind}),(0,x.jsx)(`span`,{className:`text-[10px] text-text-secondary truncate`,children:e.name}),(0,x.jsx)(`span`,{className:`text-[10px] text-text-muted ml-auto shrink-0`,children:e.repoName})]},t))})]}),e.groupLinks.length>0&&(0,x.jsxs)(`div`,{className:`p-3`,children:[(0,x.jsxs)(`h3`,{className:`text-[10px] font-bold tracking-wider text-text-muted uppercase mb-2`,children:[`Cross-repo Links (`,e.groupLinks.length,`)`]}),(0,x.jsx)(`div`,{className:`space-y-1 max-h-48 overflow-y-auto scrollbar-thin`,children:e.groupLinks.filter(e=>e.confidence>=.7).slice(0,20).map((e,t)=>(0,x.jsxs)(`div`,{className:`bg-surface rounded-md px-2 py-1.5 border border-border-subtle text-[10px]`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1 mb-0.5`,children:[(0,x.jsx)(`span`,{className:`text-node-function font-mono`,children:e.providerRepo}),(0,x.jsx)(`span`,{className:`text-text-muted`,children:`∷`}),(0,x.jsx)(`span`,{className:`text-text-primary truncate`,children:e.providerContract})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,x.jsx)(`span`,{className:`text-text-muted pl-3`,children:`↔`}),(0,x.jsx)(`span`,{className:`text-accent font-mono`,children:e.consumerRepo}),(0,x.jsx)(`span`,{className:`text-text-muted`,children:`∷`}),(0,x.jsx)(`span`,{className:`text-text-primary truncate`,children:e.consumerContract}),(0,x.jsxs)(`span`,{className:`ml-auto text-text-muted`,children:[(e.confidence*100).toFixed(0),`%`]})]})]},t))})]}),e.groupContracts.length===0&&e.groupMembers.length>0&&(0,x.jsxs)(`div`,{className:`p-3 text-center`,children:[(0,x.jsx)(`p`,{className:`text-[10px] text-text-muted`,children:`No contract data yet.`}),(0,x.jsx)(`p`,{className:`text-[10px] text-text-muted mt-1`,children:`Click ↻ sync to extract contracts.`})]})]})}function oo(){let{state:e}=E();switch(e.view){case`login`:return(0,x.jsx)(O,{});case`connect`:return(0,x.jsx)(j,{});case`loading`:return(0,x.jsx)(N,{});case`exploring`:return(0,x.jsx)(ro,{})}}function so(){return(0,x.jsx)(T,{children:(0,x.jsx)(oo,{})})}y.createRoot(document.getElementById(`root`)).render((0,x.jsx)(b.StrictMode,{children:(0,x.jsx)(so,{})}));export{c as n,o as t};