agent-dag 1.32.0 → 1.32.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function i(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(o){if(o.ep)return;o.ep=!0;const l=i(o);fetch(o.href,l)}})();var al=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Hg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lc={exports:{}},jo={},$c={exports:{}},qe={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var B0;function HR(){if(B0)return qe;B0=1;var e=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.iterator;function y(j){return j===null||typeof j!="object"?null:(j=m&&j[m]||j["@@iterator"],typeof j=="function"?j:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,_={};function S(j,U,le){this.props=j,this.context=U,this.refs=_,this.updater=le||x}S.prototype.isReactComponent={},S.prototype.setState=function(j,U){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,U,"setState")},S.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function b(){}b.prototype=S.prototype;function k(j,U,le){this.props=j,this.context=U,this.refs=_,this.updater=le||x}var E=k.prototype=new b;E.constructor=k,N(E,S.prototype),E.isPureReactComponent=!0;var C=Array.isArray,I=Object.prototype.hasOwnProperty,P={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};function O(j,U,le){var z,K={},ee=null,se=null;if(U!=null)for(z in U.ref!==void 0&&(se=U.ref),U.key!==void 0&&(ee=""+U.key),U)I.call(U,z)&&!L.hasOwnProperty(z)&&(K[z]=U[z]);var oe=arguments.length-2;if(oe===1)K.children=le;else if(1<oe){for(var pe=Array(oe),ge=0;ge<oe;ge++)pe[ge]=arguments[ge+2];K.children=pe}if(j&&j.defaultProps)for(z in oe=j.defaultProps,oe)K[z]===void 0&&(K[z]=oe[z]);return{$$typeof:e,type:j,key:ee,ref:se,props:K,_owner:P.current}}function R(j,U){return{$$typeof:e,type:j.type,key:U,ref:j.ref,props:j.props,_owner:j._owner}}function q(j){return typeof j=="object"&&j!==null&&j.$$typeof===e}function F(j){var U={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(le){return U[le]})}var J=/\/+/g;function Q(j,U){return typeof j=="object"&&j!==null&&j.key!=null?F(""+j.key):U.toString(36)}function A(j,U,le,z,K){var ee=typeof j;(ee==="undefined"||ee==="boolean")&&(j=null);var se=!1;if(j===null)se=!0;else switch(ee){case"string":case"number":se=!0;break;case"object":switch(j.$$typeof){case e:case n:se=!0}}if(se)return se=j,K=K(se),j=z===""?"."+Q(se,0):z,C(K)?(le="",j!=null&&(le=j.replace(J,"$&/")+"/"),A(K,U,le,"",function(ge){return ge})):K!=null&&(q(K)&&(K=R(K,le+(!K.key||se&&se.key===K.key?"":(""+K.key).replace(J,"$&/")+"/")+j)),U.push(K)),1;if(se=0,z=z===""?".":z+":",C(j))for(var oe=0;oe<j.length;oe++){ee=j[oe];var pe=z+Q(ee,oe);se+=A(ee,U,le,pe,K)}else if(pe=y(j),typeof pe=="function")for(j=pe.call(j),oe=0;!(ee=j.next()).done;)ee=ee.value,pe=z+Q(ee,oe++),se+=A(ee,U,le,pe,K);else if(ee==="object")throw U=String(j),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.");return se}function V(j,U,le){if(j==null)return j;var z=[],K=0;return A(j,z,"","",function(ee){return U.call(le,ee,K++)}),z}function B(j){if(j._status===-1){var U=j._result;U=U(),U.then(function(le){(j._status===0||j._status===-1)&&(j._status=1,j._result=le)},function(le){(j._status===0||j._status===-1)&&(j._status=2,j._result=le)}),j._status===-1&&(j._status=0,j._result=U)}if(j._status===1)return j._result.default;throw j._result}var ne={current:null},X={transition:null},$={ReactCurrentDispatcher:ne,ReactCurrentBatchConfig:X,ReactCurrentOwner:P};function G(){throw Error("act(...) is not supported in production builds of React.")}return qe.Children={map:V,forEach:function(j,U,le){V(j,function(){U.apply(this,arguments)},le)},count:function(j){var U=0;return V(j,function(){U++}),U},toArray:function(j){return V(j,function(U){return U})||[]},only:function(j){if(!q(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},qe.Component=S,qe.Fragment=i,qe.Profiler=o,qe.PureComponent=k,qe.StrictMode=s,qe.Suspense=d,qe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$,qe.act=G,qe.cloneElement=function(j,U,le){if(j==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+j+".");var z=N({},j.props),K=j.key,ee=j.ref,se=j._owner;if(U!=null){if(U.ref!==void 0&&(ee=U.ref,se=P.current),U.key!==void 0&&(K=""+U.key),j.type&&j.type.defaultProps)var oe=j.type.defaultProps;for(pe in U)I.call(U,pe)&&!L.hasOwnProperty(pe)&&(z[pe]=U[pe]===void 0&&oe!==void 0?oe[pe]:U[pe])}var pe=arguments.length-2;if(pe===1)z.children=le;else if(1<pe){oe=Array(pe);for(var ge=0;ge<pe;ge++)oe[ge]=arguments[ge+2];z.children=oe}return{$$typeof:e,type:j.type,key:K,ref:ee,props:z,_owner:se}},qe.createContext=function(j){return j={$$typeof:u,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},j.Provider={$$typeof:l,_context:j},j.Consumer=j},qe.createElement=O,qe.createFactory=function(j){var U=O.bind(null,j);return U.type=j,U},qe.createRef=function(){return{current:null}},qe.forwardRef=function(j){return{$$typeof:c,render:j}},qe.isValidElement=q,qe.lazy=function(j){return{$$typeof:p,_payload:{_status:-1,_result:j},_init:B}},qe.memo=function(j,U){return{$$typeof:h,type:j,compare:U===void 0?null:U}},qe.startTransition=function(j){var U=X.transition;X.transition={};try{j()}finally{X.transition=U}},qe.unstable_act=G,qe.useCallback=function(j,U){return ne.current.useCallback(j,U)},qe.useContext=function(j){return ne.current.useContext(j)},qe.useDebugValue=function(){},qe.useDeferredValue=function(j){return ne.current.useDeferredValue(j)},qe.useEffect=function(j,U){return ne.current.useEffect(j,U)},qe.useId=function(){return ne.current.useId()},qe.useImperativeHandle=function(j,U,le){return ne.current.useImperativeHandle(j,U,le)},qe.useInsertionEffect=function(j,U){return ne.current.useInsertionEffect(j,U)},qe.useLayoutEffect=function(j,U){return ne.current.useLayoutEffect(j,U)},qe.useMemo=function(j,U){return ne.current.useMemo(j,U)},qe.useReducer=function(j,U,le){return ne.current.useReducer(j,U,le)},qe.useRef=function(j){return ne.current.useRef(j)},qe.useState=function(j){return ne.current.useState(j)},qe.useSyncExternalStore=function(j,U,le){return ne.current.useSyncExternalStore(j,U,le)},qe.useTransition=function(){return ne.current.useTransition()},qe.version="18.3.1",qe}var U0;function Qo(){return U0||(U0=1,$c.exports=HR()),$c.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var H0;function VR(){if(H0)return jo;H0=1;var e=Qo(),n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function u(c,d,h){var p,m={},y=null,x=null;h!==void 0&&(y=""+h),d.key!==void 0&&(y=""+d.key),d.ref!==void 0&&(x=d.ref);for(p in d)s.call(d,p)&&!l.hasOwnProperty(p)&&(m[p]=d[p]);if(c&&c.defaultProps)for(p in d=c.defaultProps,d)m[p]===void 0&&(m[p]=d[p]);return{$$typeof:n,type:c,key:y,ref:x,props:m,_owner:o.current}}return jo.Fragment=i,jo.jsx=u,jo.jsxs=u,jo}var V0;function WR(){return V0||(V0=1,Lc.exports=VR()),Lc.exports}var v=WR(),ll={},Dc={exports:{}},cn={},Fc={exports:{}},zc={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var W0;function GR(){return W0||(W0=1,(function(e){function n(X,$){var G=X.length;X.push($);e:for(;0<G;){var j=G-1>>>1,U=X[j];if(0<o(U,$))X[j]=$,X[G]=U,G=j;else break e}}function i(X){return X.length===0?null:X[0]}function s(X){if(X.length===0)return null;var $=X[0],G=X.pop();if(G!==$){X[0]=G;e:for(var j=0,U=X.length,le=U>>>1;j<le;){var z=2*(j+1)-1,K=X[z],ee=z+1,se=X[ee];if(0>o(K,G))ee<U&&0>o(se,K)?(X[j]=se,X[ee]=G,j=ee):(X[j]=K,X[z]=G,j=z);else if(ee<U&&0>o(se,G))X[j]=se,X[ee]=G,j=ee;else break e}}return $}function o(X,$){var G=X.sortIndex-$.sortIndex;return G!==0?G:X.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,c=u.now();e.unstable_now=function(){return u.now()-c}}var d=[],h=[],p=1,m=null,y=3,x=!1,N=!1,_=!1,S=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(X){for(var $=i(h);$!==null;){if($.callback===null)s(h);else if($.startTime<=X)s(h),$.sortIndex=$.expirationTime,n(d,$);else break;$=i(h)}}function C(X){if(_=!1,E(X),!N)if(i(d)!==null)N=!0,B(I);else{var $=i(h);$!==null&&ne(C,$.startTime-X)}}function I(X,$){N=!1,_&&(_=!1,b(O),O=-1),x=!0;var G=y;try{for(E($),m=i(d);m!==null&&(!(m.expirationTime>$)||X&&!F());){var j=m.callback;if(typeof j=="function"){m.callback=null,y=m.priorityLevel;var U=j(m.expirationTime<=$);$=e.unstable_now(),typeof U=="function"?m.callback=U:m===i(d)&&s(d),E($)}else s(d);m=i(d)}if(m!==null)var le=!0;else{var z=i(h);z!==null&&ne(C,z.startTime-$),le=!1}return le}finally{m=null,y=G,x=!1}}var P=!1,L=null,O=-1,R=5,q=-1;function F(){return!(e.unstable_now()-q<R)}function J(){if(L!==null){var X=e.unstable_now();q=X;var $=!0;try{$=L(!0,X)}finally{$?Q():(P=!1,L=null)}}else P=!1}var Q;if(typeof k=="function")Q=function(){k(J)};else if(typeof MessageChannel<"u"){var A=new MessageChannel,V=A.port2;A.port1.onmessage=J,Q=function(){V.postMessage(null)}}else Q=function(){S(J,0)};function B(X){L=X,P||(P=!0,Q())}function ne(X,$){O=S(function(){X(e.unstable_now())},$)}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(X){X.callback=null},e.unstable_continueExecution=function(){N||x||(N=!0,B(I))},e.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<X?Math.floor(1e3/X):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return i(d)},e.unstable_next=function(X){switch(y){case 1:case 2:case 3:var $=3;break;default:$=y}var G=y;y=$;try{return X()}finally{y=G}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(X,$){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var G=y;y=X;try{return $()}finally{y=G}},e.unstable_scheduleCallback=function(X,$,G){var j=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?j+G:j):G=j,X){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=G+U,X={id:p++,callback:$,priorityLevel:X,startTime:G,expirationTime:U,sortIndex:-1},G>j?(X.sortIndex=G,n(h,X),i(d)===null&&X===i(h)&&(_?(b(O),O=-1):_=!0,ne(C,G-j))):(X.sortIndex=U,n(d,X),N||x||(N=!0,B(I))),X},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(X){var $=y;return function(){var G=y;y=$;try{return X.apply(this,arguments)}finally{y=G}}}})(zc)),zc}var G0;function YR(){return G0||(G0=1,Fc.exports=GR()),Fc.exports}/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Y0;function KR(){if(Y0)return cn;Y0=1;var e=Qo(),n=YR();function i(t){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+t,a=1;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,o={};function l(t,r){u(t,r),u(t+"Capture",r)}function u(t,r){for(o[t]=r,t=0;t<r.length;t++)s.add(r[t])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,h=/^[: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]*$/,p={},m={};function y(t){return d.call(m,t)?!0:d.call(p,t)?!1:h.test(t)?m[t]=!0:(p[t]=!0,!1)}function x(t,r,a,f){if(a!==null&&a.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return f?!1:a!==null?!a.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function N(t,r,a,f){if(r===null||typeof r>"u"||x(t,r,a,f))return!0;if(f)return!1;if(a!==null)switch(a.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function _(t,r,a,f,g,w,T){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=f,this.attributeNamespace=g,this.mustUseProperty=a,this.propertyName=t,this.type=r,this.sanitizeURL=w,this.removeEmptyString=T}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){S[t]=new _(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var r=t[0];S[r]=new _(r,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){S[t]=new _(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){S[t]=new _(t,2,!1,t,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){S[t]=new _(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){S[t]=new _(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){S[t]=new _(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){S[t]=new _(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){S[t]=new _(t,5,!1,t.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function k(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var r=t.replace(b,k);S[r]=new _(r,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var r=t.replace(b,k);S[r]=new _(r,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var r=t.replace(b,k);S[r]=new _(r,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){S[t]=new _(t,1,!1,t.toLowerCase(),null,!1,!1)}),S.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){S[t]=new _(t,1,!1,t.toLowerCase(),null,!0,!0)});function E(t,r,a,f){var g=S.hasOwnProperty(r)?S[r]:null;(g!==null?g.type!==0:f||!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(N(r,a,g,f)&&(a=null),f||g===null?y(r)&&(a===null?t.removeAttribute(r):t.setAttribute(r,""+a)):g.mustUseProperty?t[g.propertyName]=a===null?g.type===3?!1:"":a:(r=g.attributeName,f=g.attributeNamespace,a===null?t.removeAttribute(r):(g=g.type,a=g===3||g===4&&a===!0?"":""+a,f?t.setAttributeNS(f,r,a):t.setAttribute(r,a))))}var C=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,I=Symbol.for("react.element"),P=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),q=Symbol.for("react.provider"),F=Symbol.for("react.context"),J=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),ne=Symbol.for("react.offscreen"),X=Symbol.iterator;function $(t){return t===null||typeof t!="object"?null:(t=X&&t[X]||t["@@iterator"],typeof t=="function"?t:null)}var G=Object.assign,j;function U(t){if(j===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);j=r&&r[1]||""}return`
|
|
34
|
+
`+j+t}var le=!1;function z(t,r){if(!t||le)return"";le=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(r)if(r=function(){throw Error()},Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(r,[])}catch(ie){var f=ie}Reflect.construct(t,[],r)}else{try{r.call()}catch(ie){f=ie}t.call(r.prototype)}else{try{throw Error()}catch(ie){f=ie}t()}}catch(ie){if(ie&&f&&typeof ie.stack=="string"){for(var g=ie.stack.split(`
|
|
35
|
+
`),w=f.stack.split(`
|
|
36
|
+
`),T=g.length-1,D=w.length-1;1<=T&&0<=D&&g[T]!==w[D];)D--;for(;1<=T&&0<=D;T--,D--)if(g[T]!==w[D]){if(T!==1||D!==1)do if(T--,D--,0>D||g[T]!==w[D]){var H=`
|
|
37
|
+
`+g[T].replace(" at new "," at ");return t.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",t.displayName)),H}while(1<=T&&0<=D);break}}}finally{le=!1,Error.prepareStackTrace=a}return(t=t?t.displayName||t.name:"")?U(t):""}function K(t){switch(t.tag){case 5:return U(t.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return t=z(t.type,!1),t;case 11:return t=z(t.type.render,!1),t;case 1:return t=z(t.type,!0),t;default:return""}}function ee(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case L:return"Fragment";case P:return"Portal";case R:return"Profiler";case O:return"StrictMode";case Q:return"Suspense";case A:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case F:return(t.displayName||"Context")+".Consumer";case q:return(t._context.displayName||"Context")+".Provider";case J:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case V:return r=t.displayName||null,r!==null?r:ee(t.type)||"Memo";case B:r=t._payload,t=t._init;try{return ee(t(r))}catch{}}return null}function se(t){var r=t.type;switch(t.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=r.render,t=t.displayName||t.name||"",r.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ee(r);case 8:return r===O?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function oe(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function pe(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function ge(t){var r=pe(t)?"checked":"value",a=Object.getOwnPropertyDescriptor(t.constructor.prototype,r),f=""+t[r];if(!t.hasOwnProperty(r)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var g=a.get,w=a.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return g.call(this)},set:function(T){f=""+T,w.call(this,T)}}),Object.defineProperty(t,r,{enumerable:a.enumerable}),{getValue:function(){return f},setValue:function(T){f=""+T},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function Ae(t){t._valueTracker||(t._valueTracker=ge(t))}function Oe(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var a=r.getValue(),f="";return t&&(f=pe(t)?t.checked?"true":"false":t.value),t=f,t!==a?(r.setValue(t),!0):!1}function Ie(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Me(t,r){var a=r.checked;return G({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??t._wrapperState.initialChecked})}function ke(t,r){var a=r.defaultValue==null?"":r.defaultValue,f=r.checked!=null?r.checked:r.defaultChecked;a=oe(r.value!=null?r.value:a),t._wrapperState={initialChecked:f,initialValue:a,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function He(t,r){r=r.checked,r!=null&&E(t,"checked",r,!1)}function ve(t,r){He(t,r);var a=oe(r.value),f=r.type;if(a!=null)f==="number"?(a===0&&t.value===""||t.value!=a)&&(t.value=""+a):t.value!==""+a&&(t.value=""+a);else if(f==="submit"||f==="reset"){t.removeAttribute("value");return}r.hasOwnProperty("value")?Ve(t,r.type,a):r.hasOwnProperty("defaultValue")&&Ve(t,r.type,oe(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(t.defaultChecked=!!r.defaultChecked)}function ye(t,r,a){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var f=r.type;if(!(f!=="submit"&&f!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+t._wrapperState.initialValue,a||r===t.value||(t.value=r),t.defaultValue=r}a=t.name,a!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,a!==""&&(t.name=a)}function Ve(t,r,a){(r!=="number"||Ie(t.ownerDocument)!==t)&&(a==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+a&&(t.defaultValue=""+a))}var dt=Array.isArray;function Qe(t,r,a,f){if(t=t.options,r){r={};for(var g=0;g<a.length;g++)r["$"+a[g]]=!0;for(a=0;a<t.length;a++)g=r.hasOwnProperty("$"+t[a].value),t[a].selected!==g&&(t[a].selected=g),g&&f&&(t[a].defaultSelected=!0)}else{for(a=""+oe(a),r=null,g=0;g<t.length;g++){if(t[g].value===a){t[g].selected=!0,f&&(t[g].defaultSelected=!0);return}r!==null||t[g].disabled||(r=t[g])}r!==null&&(r.selected=!0)}}function We(t,r){if(r.dangerouslySetInnerHTML!=null)throw Error(i(91));return G({},r,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function $e(t,r){var a=r.value;if(a==null){if(a=r.children,r=r.defaultValue,a!=null){if(r!=null)throw Error(i(92));if(dt(a)){if(1<a.length)throw Error(i(93));a=a[0]}r=a}r==null&&(r=""),a=r}t._wrapperState={initialValue:oe(a)}}function Ke(t,r){var a=oe(r.value),f=oe(r.defaultValue);a!=null&&(a=""+a,a!==t.value&&(t.value=a),r.defaultValue==null&&t.defaultValue!==a&&(t.defaultValue=a)),f!=null&&(t.defaultValue=""+f)}function yt(t){var r=t.textContent;r===t._wrapperState.initialValue&&r!==""&&r!==null&&(t.value=r)}function et(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ge(t,r){return t==null||t==="http://www.w3.org/1999/xhtml"?et(r):t==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var wt,Tt=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(r,a,f,g){MSApp.execUnsafeLocalFunction(function(){return t(r,a,f,g)})}:t})(function(t,r){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=r;else{for(wt=wt||document.createElement("div"),wt.innerHTML="<svg>"+r.valueOf().toString()+"</svg>",r=wt.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;r.firstChild;)t.appendChild(r.firstChild)}});function Ft(t,r){if(r){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=r;return}}t.textContent=r}var tt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},xt=["Webkit","ms","Moz","O"];Object.keys(tt).forEach(function(t){xt.forEach(function(r){r=r+t.charAt(0).toUpperCase()+t.substring(1),tt[r]=tt[t]})});function lt(t,r,a){return r==null||typeof r=="boolean"||r===""?"":a||typeof r!="number"||r===0||tt.hasOwnProperty(t)&&tt[t]?(""+r).trim():r+"px"}function mt(t,r){t=t.style;for(var a in r)if(r.hasOwnProperty(a)){var f=a.indexOf("--")===0,g=lt(a,r[a],f);a==="float"&&(a="cssFloat"),f?t.setProperty(a,g):t[a]=g}}var wn=G({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function bt(t,r){if(r){if(wn[t]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(i(137,t));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(i(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(i(61))}if(r.style!=null&&typeof r.style!="object")throw Error(i(62))}}function jt(t,r){if(t.indexOf("-")===-1)return typeof r.is=="string";switch(t){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 xn=null;function Ln(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ut=null,Yt=null,Qt=null;function At(t){if(t=mo(t)){if(typeof ut!="function")throw Error(i(280));var r=t.stateNode;r&&(r=Sa(r),ut(t.stateNode,t.type,r))}}function mi(t){Yt?Qt?Qt.push(t):Qt=[t]:Yt=t}function gi(){if(Yt){var t=Yt,r=Qt;if(Qt=Yt=null,At(t),r)for(t=0;t<r.length;t++)At(r[t])}}function Ji(t,r){return t(r)}function tr(){}var Pr=!1;function vi(t,r,a){if(Pr)return t(r,a);Pr=!0;try{return Ji(t,r,a)}finally{Pr=!1,(Yt!==null||Qt!==null)&&(tr(),gi())}}function dr(t,r){var a=t.stateNode;if(a===null)return null;var f=Sa(a);if(f===null)return null;a=f[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(t=t.type,f=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!f;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(i(231,r,typeof a));return a}var Or=!1;if(c)try{var nr={};Object.defineProperty(nr,"passive",{get:function(){Or=!0}}),window.addEventListener("test",nr,nr),window.removeEventListener("test",nr,nr)}catch{Or=!1}function qt(t,r,a,f,g,w,T,D,H){var ie=Array.prototype.slice.call(arguments,3);try{r.apply(a,ie)}catch(fe){this.onError(fe)}}var $n=!1,pn=null,qr=!1,zt=null,yi={onError:function(t){$n=!0,pn=t}};function wi(t,r,a,f,g,w,T,D,H){$n=!1,pn=null,qt.apply(yi,arguments)}function xi(t,r,a,f,g,w,T,D,H){if(wi.apply(this,arguments),$n){if($n){var ie=pn;$n=!1,pn=null}else throw Error(i(198));qr||(qr=!0,zt=ie)}}function Zt(t){var r=t,a=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(a=r.return),t=r.return;while(t)}return r.tag===3?a:null}function Lr(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function _n(t){if(Zt(t)!==t)throw Error(i(188))}function es(t){var r=t.alternate;if(!r){if(r=Zt(t),r===null)throw Error(i(188));return r!==t?null:t}for(var a=t,f=r;;){var g=a.return;if(g===null)break;var w=g.alternate;if(w===null){if(f=g.return,f!==null){a=f;continue}break}if(g.child===w.child){for(w=g.child;w;){if(w===a)return _n(g),t;if(w===f)return _n(g),r;w=w.sibling}throw Error(i(188))}if(a.return!==f.return)a=g,f=w;else{for(var T=!1,D=g.child;D;){if(D===a){T=!0,a=g,f=w;break}if(D===f){T=!0,f=g,a=w;break}D=D.sibling}if(!T){for(D=w.child;D;){if(D===a){T=!0,a=w,f=g;break}if(D===f){T=!0,f=w,a=g;break}D=D.sibling}if(!T)throw Error(i(189))}}if(a.alternate!==f)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?t:r}function _i(t){return t=es(t),t!==null?Si(t):null}function Si(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var r=Si(t);if(r!==null)return r;t=t.sibling}return null}var ts=n.unstable_scheduleCallback,$r=n.unstable_cancelCallback,Dn=n.unstable_shouldYield,ns=n.unstable_requestPaint,rt=n.unstable_now,rs=n.unstable_getCurrentPriorityLevel,Dr=n.unstable_ImmediatePriority,is=n.unstable_UserBlockingPriority,kt=n.unstable_NormalPriority,Fr=n.unstable_LowPriority,Fn=n.unstable_IdlePriority,Sn=null,Bt=null;function hr(t){if(Bt&&typeof Bt.onCommitFiberRoot=="function")try{Bt.onCommitFiberRoot(Sn,t,void 0,(t.current.flags&128)===128)}catch{}}var Jt=Math.clz32?Math.clz32:fu,ss=Math.log,la=Math.LN2;function fu(t){return t>>>=0,t===0?32:31-(ss(t)/la|0)|0}var bi=64,os=4194304;function ki(t){switch(t&-t){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: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&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function zr(t,r){var a=t.pendingLanes;if(a===0)return 0;var f=0,g=t.suspendedLanes,w=t.pingedLanes,T=a&268435455;if(T!==0){var D=T&~g;D!==0?f=ki(D):(w&=T,w!==0&&(f=ki(w)))}else T=a&~g,T!==0?f=ki(T):w!==0&&(f=ki(w));if(f===0)return 0;if(r!==0&&r!==f&&(r&g)===0&&(g=f&-f,w=r&-r,g>=w||g===16&&(w&4194240)!==0))return r;if((f&4)!==0&&(f|=a&16),r=t.entangledLanes,r!==0)for(t=t.entanglements,r&=f;0<r;)a=31-Jt(r),g=1<<a,f|=t[a],r&=~g;return f}function rr(t,r){switch(t){case 1:case 2:case 4:return r+250;case 8:case 16:case 32:case 64: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 r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ks(t,r){for(var a=t.suspendedLanes,f=t.pingedLanes,g=t.expirationTimes,w=t.pendingLanes;0<w;){var T=31-Jt(w),D=1<<T,H=g[T];H===-1?((D&a)===0||(D&f)!==0)&&(g[T]=rr(D,r)):H<=r&&(t.expiredLanes|=D),w&=~D}}function as(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function ua(){var t=bi;return bi<<=1,(bi&4194240)===0&&(bi=64),t}function Xs(t){for(var r=[],a=0;31>a;a++)r.push(t);return r}function Br(t,r,a){t.pendingLanes|=r,r!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,r=31-Jt(r),t[r]=a}function ca(t,r){var a=t.pendingLanes&~r;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=r,t.mutableReadLanes&=r,t.entangledLanes&=r,r=t.entanglements;var f=t.eventTimes;for(t=t.expirationTimes;0<a;){var g=31-Jt(a),w=1<<g;r[g]=0,f[g]=-1,t[g]=-1,a&=~w}}function en(t,r){var a=t.entangledLanes|=r;for(t=t.entanglements;a;){var f=31-Jt(a),g=1<<f;g&r|t[f]&r&&(t[f]|=r),a&=~g}}var Ue=0;function Qs(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var fa,Zs,Js,Ur,da,It=!1,Ei=[],bn=null,kn=null,zn=null,pr=new Map,mr=new Map,ir=[],tn="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 submit".split(" ");function eo(t,r){switch(t){case"focusin":case"focusout":bn=null;break;case"dragenter":case"dragleave":kn=null;break;case"mouseover":case"mouseout":zn=null;break;case"pointerover":case"pointerout":pr.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":mr.delete(r.pointerId)}}function Hr(t,r,a,f,g,w){return t===null||t.nativeEvent!==w?(t={blockedOn:r,domEventName:a,eventSystemFlags:f,nativeEvent:w,targetContainers:[g]},r!==null&&(r=mo(r),r!==null&&Zs(r)),t):(t.eventSystemFlags|=f,r=t.targetContainers,g!==null&&r.indexOf(g)===-1&&r.push(g),t)}function ha(t,r,a,f,g){switch(r){case"focusin":return bn=Hr(bn,t,r,a,f,g),!0;case"dragenter":return kn=Hr(kn,t,r,a,f,g),!0;case"mouseover":return zn=Hr(zn,t,r,a,f,g),!0;case"pointerover":var w=g.pointerId;return pr.set(w,Hr(pr.get(w)||null,t,r,a,f,g)),!0;case"gotpointercapture":return w=g.pointerId,mr.set(w,Hr(mr.get(w)||null,t,r,a,f,g)),!0}return!1}function to(t){var r=Ni(t.target);if(r!==null){var a=Zt(r);if(a!==null){if(r=a.tag,r===13){if(r=Lr(a),r!==null){t.blockedOn=r,da(t.priority,function(){Js(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function W(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var a=nn(t.domEventName,t.eventSystemFlags,r[0],t.nativeEvent);if(a===null){a=t.nativeEvent;var f=new a.constructor(a.type,a);xn=f,a.target.dispatchEvent(f),xn=null}else return r=mo(a),r!==null&&Zs(r),t.blockedOn=a,!1;r.shift()}return!0}function Z(t,r,a){W(t)&&a.delete(r)}function ue(){It=!1,bn!==null&&W(bn)&&(bn=null),kn!==null&&W(kn)&&(kn=null),zn!==null&&W(zn)&&(zn=null),pr.forEach(Z),mr.forEach(Z)}function de(t,r){t.blockedOn===r&&(t.blockedOn=null,It||(It=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,ue)))}function we(t){function r(g){return de(g,t)}if(0<Ei.length){de(Ei[0],t);for(var a=1;a<Ei.length;a++){var f=Ei[a];f.blockedOn===t&&(f.blockedOn=null)}}for(bn!==null&&de(bn,t),kn!==null&&de(kn,t),zn!==null&&de(zn,t),pr.forEach(r),mr.forEach(r),a=0;a<ir.length;a++)f=ir[a],f.blockedOn===t&&(f.blockedOn=null);for(;0<ir.length&&(a=ir[0],a.blockedOn===null);)to(a),a.blockedOn===null&&ir.shift()}var xe=C.ReactCurrentBatchConfig,Pe=!0;function ze(t,r,a,f){var g=Ue,w=xe.transition;xe.transition=null;try{Ue=1,Ye(t,r,a,f)}finally{Ue=g,xe.transition=w}}function Ze(t,r,a,f){var g=Ue,w=xe.transition;xe.transition=null;try{Ue=4,Ye(t,r,a,f)}finally{Ue=g,xe.transition=w}}function Ye(t,r,a,f){if(Pe){var g=nn(t,r,a,f);if(g===null)Cu(t,r,f,Je,a),eo(t,f);else if(ha(g,t,r,a,f))f.stopPropagation();else if(eo(t,f),r&4&&-1<tn.indexOf(t)){for(;g!==null;){var w=mo(g);if(w!==null&&fa(w),w=nn(t,r,a,f),w===null&&Cu(t,r,f,Je,a),w===g)break;g=w}g!==null&&f.stopPropagation()}else Cu(t,r,f,null,a)}}var Je=null;function nn(t,r,a,f){if(Je=null,t=Ln(f),t=Ni(t),t!==null)if(r=Zt(t),r===null)t=null;else if(a=r.tag,a===13){if(t=Lr(r),t!==null)return t;t=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null);return Je=t,null}function Vr(t){switch(t){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(rs()){case Dr:return 1;case is:return 4;case kt:case Fr:return 16;case Fn:return 536870912;default:return 16}default:return 16}}var En=null,gr=null,Wr=null;function no(){if(Wr)return Wr;var t,r=gr,a=r.length,f,g="value"in En?En.value:En.textContent,w=g.length;for(t=0;t<a&&r[t]===g[t];t++);var T=a-t;for(f=1;f<=T&&r[a-f]===g[w-f];f++);return Wr=g.slice(t,1<f?1-f:void 0)}function vr(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function rn(){return!0}function gt(){return!1}function Ut(t){function r(a,f,g,w,T){this._reactName=a,this._targetInst=g,this.type=f,this.nativeEvent=w,this.target=T,this.currentTarget=null;for(var D in t)t.hasOwnProperty(D)&&(a=t[D],this[D]=a?a(w):w[D]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?rn:gt,this.isPropagationStopped=gt,this}return G(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=rn)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=rn)},persist:function(){},isPersistent:rn}),r}var ls={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},du=Ut(ls),ro=G({},ls,{view:0,detail:0}),vC=Ut(ro),hu,pu,io,pa=G({},ro,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gu,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==io&&(io&&t.type==="mousemove"?(hu=t.screenX-io.screenX,pu=t.screenY-io.screenY):pu=hu=0,io=t),hu)},movementY:function(t){return"movementY"in t?t.movementY:pu}}),Av=Ut(pa),yC=G({},pa,{dataTransfer:0}),wC=Ut(yC),xC=G({},ro,{relatedTarget:0}),mu=Ut(xC),_C=G({},ls,{animationName:0,elapsedTime:0,pseudoElement:0}),SC=Ut(_C),bC=G({},ls,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),kC=Ut(bC),EC=G({},ls,{data:0}),Iv=Ut(EC),NC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},CC={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"},RC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function TC(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=RC[t])?!!r[t]:!1}function gu(){return TC}var jC=G({},ro,{key:function(t){if(t.key){var r=NC[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=vr(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?CC[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gu,charCode:function(t){return t.type==="keypress"?vr(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?vr(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),AC=Ut(jC),IC=G({},pa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mv=Ut(IC),MC=G({},ro,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gu}),PC=Ut(MC),OC=G({},ls,{propertyName:0,elapsedTime:0,pseudoElement:0}),qC=Ut(OC),LC=G({},pa,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),$C=Ut(LC),DC=[9,13,27,32],vu=c&&"CompositionEvent"in window,so=null;c&&"documentMode"in document&&(so=document.documentMode);var FC=c&&"TextEvent"in window&&!so,Pv=c&&(!vu||so&&8<so&&11>=so),Ov=" ",qv=!1;function Lv(t,r){switch(t){case"keyup":return DC.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $v(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var us=!1;function zC(t,r){switch(t){case"compositionend":return $v(r);case"keypress":return r.which!==32?null:(qv=!0,Ov);case"textInput":return t=r.data,t===Ov&&qv?null:t;default:return null}}function BC(t,r){if(us)return t==="compositionend"||!vu&&Lv(t,r)?(t=no(),Wr=gr=En=null,us=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Pv&&r.locale!=="ko"?null:r.data;default:return null}}var UC={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 Dv(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!UC[t.type]:r==="textarea"}function Fv(t,r,a,f){mi(f),r=wa(r,"onChange"),0<r.length&&(a=new du("onChange","change",null,a,f),t.push({event:a,listeners:r}))}var oo=null,ao=null;function HC(t){iy(t,0)}function ma(t){var r=ps(t);if(Oe(r))return t}function VC(t,r){if(t==="change")return r}var zv=!1;if(c){var yu;if(c){var wu="oninput"in document;if(!wu){var Bv=document.createElement("div");Bv.setAttribute("oninput","return;"),wu=typeof Bv.oninput=="function"}yu=wu}else yu=!1;zv=yu&&(!document.documentMode||9<document.documentMode)}function Uv(){oo&&(oo.detachEvent("onpropertychange",Hv),ao=oo=null)}function Hv(t){if(t.propertyName==="value"&&ma(ao)){var r=[];Fv(r,ao,t,Ln(t)),vi(HC,r)}}function WC(t,r,a){t==="focusin"?(Uv(),oo=r,ao=a,oo.attachEvent("onpropertychange",Hv)):t==="focusout"&&Uv()}function GC(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return ma(ao)}function YC(t,r){if(t==="click")return ma(r)}function KC(t,r){if(t==="input"||t==="change")return ma(r)}function XC(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var Bn=typeof Object.is=="function"?Object.is:XC;function lo(t,r){if(Bn(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var a=Object.keys(t),f=Object.keys(r);if(a.length!==f.length)return!1;for(f=0;f<a.length;f++){var g=a[f];if(!d.call(r,g)||!Bn(t[g],r[g]))return!1}return!0}function Vv(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Wv(t,r){var a=Vv(t);t=0;for(var f;a;){if(a.nodeType===3){if(f=t+a.textContent.length,t<=r&&f>=r)return{node:a,offset:r-t};t=f}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Vv(a)}}function Gv(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?Gv(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Yv(){for(var t=window,r=Ie();r instanceof t.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)t=r.contentWindow;else break;r=Ie(t.document)}return r}function xu(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}function QC(t){var r=Yv(),a=t.focusedElem,f=t.selectionRange;if(r!==a&&a&&a.ownerDocument&&Gv(a.ownerDocument.documentElement,a)){if(f!==null&&xu(a)){if(r=f.start,t=f.end,t===void 0&&(t=r),"selectionStart"in a)a.selectionStart=r,a.selectionEnd=Math.min(t,a.value.length);else if(t=(r=a.ownerDocument||document)&&r.defaultView||window,t.getSelection){t=t.getSelection();var g=a.textContent.length,w=Math.min(f.start,g);f=f.end===void 0?w:Math.min(f.end,g),!t.extend&&w>f&&(g=f,f=w,w=g),g=Wv(a,w);var T=Wv(a,f);g&&T&&(t.rangeCount!==1||t.anchorNode!==g.node||t.anchorOffset!==g.offset||t.focusNode!==T.node||t.focusOffset!==T.offset)&&(r=r.createRange(),r.setStart(g.node,g.offset),t.removeAllRanges(),w>f?(t.addRange(r),t.extend(T.node,T.offset)):(r.setEnd(T.node,T.offset),t.addRange(r)))}}for(r=[],t=a;t=t.parentNode;)t.nodeType===1&&r.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<r.length;a++)t=r[a],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var ZC=c&&"documentMode"in document&&11>=document.documentMode,cs=null,_u=null,uo=null,Su=!1;function Kv(t,r,a){var f=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Su||cs==null||cs!==Ie(f)||(f=cs,"selectionStart"in f&&xu(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),uo&&lo(uo,f)||(uo=f,f=wa(_u,"onSelect"),0<f.length&&(r=new du("onSelect","select",null,r,a),t.push({event:r,listeners:f}),r.target=cs)))}function ga(t,r){var a={};return a[t.toLowerCase()]=r.toLowerCase(),a["Webkit"+t]="webkit"+r,a["Moz"+t]="moz"+r,a}var fs={animationend:ga("Animation","AnimationEnd"),animationiteration:ga("Animation","AnimationIteration"),animationstart:ga("Animation","AnimationStart"),transitionend:ga("Transition","TransitionEnd")},bu={},Xv={};c&&(Xv=document.createElement("div").style,"AnimationEvent"in window||(delete fs.animationend.animation,delete fs.animationiteration.animation,delete fs.animationstart.animation),"TransitionEvent"in window||delete fs.transitionend.transition);function va(t){if(bu[t])return bu[t];if(!fs[t])return t;var r=fs[t],a;for(a in r)if(r.hasOwnProperty(a)&&a in Xv)return bu[t]=r[a];return t}var Qv=va("animationend"),Zv=va("animationiteration"),Jv=va("animationstart"),ey=va("transitionend"),ty=new Map,ny="abort auxClick 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(" ");function Gr(t,r){ty.set(t,r),l(r,[t])}for(var ku=0;ku<ny.length;ku++){var Eu=ny[ku],JC=Eu.toLowerCase(),eR=Eu[0].toUpperCase()+Eu.slice(1);Gr(JC,"on"+eR)}Gr(Qv,"onAnimationEnd"),Gr(Zv,"onAnimationIteration"),Gr(Jv,"onAnimationStart"),Gr("dblclick","onDoubleClick"),Gr("focusin","onFocus"),Gr("focusout","onBlur"),Gr(ey,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),l("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),l("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),l("onBeforeInput",["compositionend","keypress","textInput","paste"]),l("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),l("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var co="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(" "),tR=new Set("cancel close invalid load scroll toggle".split(" ").concat(co));function ry(t,r,a){var f=t.type||"unknown-event";t.currentTarget=a,xi(f,r,void 0,t),t.currentTarget=null}function iy(t,r){r=(r&4)!==0;for(var a=0;a<t.length;a++){var f=t[a],g=f.event;f=f.listeners;e:{var w=void 0;if(r)for(var T=f.length-1;0<=T;T--){var D=f[T],H=D.instance,ie=D.currentTarget;if(D=D.listener,H!==w&&g.isPropagationStopped())break e;ry(g,D,ie),w=H}else for(T=0;T<f.length;T++){if(D=f[T],H=D.instance,ie=D.currentTarget,D=D.listener,H!==w&&g.isPropagationStopped())break e;ry(g,D,ie),w=H}}}if(qr)throw t=zt,qr=!1,zt=null,t}function it(t,r){var a=r[Mu];a===void 0&&(a=r[Mu]=new Set);var f=t+"__bubble";a.has(f)||(sy(r,t,2,!1),a.add(f))}function Nu(t,r,a){var f=0;r&&(f|=4),sy(a,t,f,r)}var ya="_reactListening"+Math.random().toString(36).slice(2);function fo(t){if(!t[ya]){t[ya]=!0,s.forEach(function(a){a!=="selectionchange"&&(tR.has(a)||Nu(a,!1,t),Nu(a,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[ya]||(r[ya]=!0,Nu("selectionchange",!1,r))}}function sy(t,r,a,f){switch(Vr(r)){case 1:var g=ze;break;case 4:g=Ze;break;default:g=Ye}a=g.bind(null,r,a,t),g=void 0,!Or||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(g=!0),f?g!==void 0?t.addEventListener(r,a,{capture:!0,passive:g}):t.addEventListener(r,a,!0):g!==void 0?t.addEventListener(r,a,{passive:g}):t.addEventListener(r,a,!1)}function Cu(t,r,a,f,g){var w=f;if((r&1)===0&&(r&2)===0&&f!==null)e:for(;;){if(f===null)return;var T=f.tag;if(T===3||T===4){var D=f.stateNode.containerInfo;if(D===g||D.nodeType===8&&D.parentNode===g)break;if(T===4)for(T=f.return;T!==null;){var H=T.tag;if((H===3||H===4)&&(H=T.stateNode.containerInfo,H===g||H.nodeType===8&&H.parentNode===g))return;T=T.return}for(;D!==null;){if(T=Ni(D),T===null)return;if(H=T.tag,H===5||H===6){f=w=T;continue e}D=D.parentNode}}f=f.return}vi(function(){var ie=w,fe=Ln(a),he=[];e:{var ce=ty.get(t);if(ce!==void 0){var _e=du,be=t;switch(t){case"keypress":if(vr(a)===0)break e;case"keydown":case"keyup":_e=AC;break;case"focusin":be="focus",_e=mu;break;case"focusout":be="blur",_e=mu;break;case"beforeblur":case"afterblur":_e=mu;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":_e=Av;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_e=wC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_e=PC;break;case Qv:case Zv:case Jv:_e=SC;break;case ey:_e=qC;break;case"scroll":_e=vC;break;case"wheel":_e=$C;break;case"copy":case"cut":case"paste":_e=kC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_e=Mv}var Ee=(r&4)!==0,vt=!Ee&&t==="scroll",te=Ee?ce!==null?ce+"Capture":null:ce;Ee=[];for(var Y=ie,re;Y!==null;){re=Y;var me=re.stateNode;if(re.tag===5&&me!==null&&(re=me,te!==null&&(me=dr(Y,te),me!=null&&Ee.push(ho(Y,me,re)))),vt)break;Y=Y.return}0<Ee.length&&(ce=new _e(ce,be,null,a,fe),he.push({event:ce,listeners:Ee}))}}if((r&7)===0){e:{if(ce=t==="mouseover"||t==="pointerover",_e=t==="mouseout"||t==="pointerout",ce&&a!==xn&&(be=a.relatedTarget||a.fromElement)&&(Ni(be)||be[yr]))break e;if((_e||ce)&&(ce=fe.window===fe?fe:(ce=fe.ownerDocument)?ce.defaultView||ce.parentWindow:window,_e?(be=a.relatedTarget||a.toElement,_e=ie,be=be?Ni(be):null,be!==null&&(vt=Zt(be),be!==vt||be.tag!==5&&be.tag!==6)&&(be=null)):(_e=null,be=ie),_e!==be)){if(Ee=Av,me="onMouseLeave",te="onMouseEnter",Y="mouse",(t==="pointerout"||t==="pointerover")&&(Ee=Mv,me="onPointerLeave",te="onPointerEnter",Y="pointer"),vt=_e==null?ce:ps(_e),re=be==null?ce:ps(be),ce=new Ee(me,Y+"leave",_e,a,fe),ce.target=vt,ce.relatedTarget=re,me=null,Ni(fe)===ie&&(Ee=new Ee(te,Y+"enter",be,a,fe),Ee.target=re,Ee.relatedTarget=vt,me=Ee),vt=me,_e&&be)t:{for(Ee=_e,te=be,Y=0,re=Ee;re;re=ds(re))Y++;for(re=0,me=te;me;me=ds(me))re++;for(;0<Y-re;)Ee=ds(Ee),Y--;for(;0<re-Y;)te=ds(te),re--;for(;Y--;){if(Ee===te||te!==null&&Ee===te.alternate)break t;Ee=ds(Ee),te=ds(te)}Ee=null}else Ee=null;_e!==null&&oy(he,ce,_e,Ee,!1),be!==null&&vt!==null&&oy(he,vt,be,Ee,!0)}}e:{if(ce=ie?ps(ie):window,_e=ce.nodeName&&ce.nodeName.toLowerCase(),_e==="select"||_e==="input"&&ce.type==="file")var Ne=VC;else if(Dv(ce))if(zv)Ne=KC;else{Ne=GC;var Re=WC}else(_e=ce.nodeName)&&_e.toLowerCase()==="input"&&(ce.type==="checkbox"||ce.type==="radio")&&(Ne=YC);if(Ne&&(Ne=Ne(t,ie))){Fv(he,Ne,a,fe);break e}Re&&Re(t,ce,ie),t==="focusout"&&(Re=ce._wrapperState)&&Re.controlled&&ce.type==="number"&&Ve(ce,"number",ce.value)}switch(Re=ie?ps(ie):window,t){case"focusin":(Dv(Re)||Re.contentEditable==="true")&&(cs=Re,_u=ie,uo=null);break;case"focusout":uo=_u=cs=null;break;case"mousedown":Su=!0;break;case"contextmenu":case"mouseup":case"dragend":Su=!1,Kv(he,a,fe);break;case"selectionchange":if(ZC)break;case"keydown":case"keyup":Kv(he,a,fe)}var Te;if(vu)e:{switch(t){case"compositionstart":var je="onCompositionStart";break e;case"compositionend":je="onCompositionEnd";break e;case"compositionupdate":je="onCompositionUpdate";break e}je=void 0}else us?Lv(t,a)&&(je="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(je="onCompositionStart");je&&(Pv&&a.locale!=="ko"&&(us||je!=="onCompositionStart"?je==="onCompositionEnd"&&us&&(Te=no()):(En=fe,gr="value"in En?En.value:En.textContent,us=!0)),Re=wa(ie,je),0<Re.length&&(je=new Iv(je,t,null,a,fe),he.push({event:je,listeners:Re}),Te?je.data=Te:(Te=$v(a),Te!==null&&(je.data=Te)))),(Te=FC?zC(t,a):BC(t,a))&&(ie=wa(ie,"onBeforeInput"),0<ie.length&&(fe=new Iv("onBeforeInput","beforeinput",null,a,fe),he.push({event:fe,listeners:ie}),fe.data=Te))}iy(he,r)})}function ho(t,r,a){return{instance:t,listener:r,currentTarget:a}}function wa(t,r){for(var a=r+"Capture",f=[];t!==null;){var g=t,w=g.stateNode;g.tag===5&&w!==null&&(g=w,w=dr(t,a),w!=null&&f.unshift(ho(t,w,g)),w=dr(t,r),w!=null&&f.push(ho(t,w,g))),t=t.return}return f}function ds(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function oy(t,r,a,f,g){for(var w=r._reactName,T=[];a!==null&&a!==f;){var D=a,H=D.alternate,ie=D.stateNode;if(H!==null&&H===f)break;D.tag===5&&ie!==null&&(D=ie,g?(H=dr(a,w),H!=null&&T.unshift(ho(a,H,D))):g||(H=dr(a,w),H!=null&&T.push(ho(a,H,D)))),a=a.return}T.length!==0&&t.push({event:r,listeners:T})}var nR=/\r\n?/g,rR=/\u0000|\uFFFD/g;function ay(t){return(typeof t=="string"?t:""+t).replace(nR,`
|
|
38
|
+
`).replace(rR,"")}function xa(t,r,a){if(r=ay(r),ay(t)!==r&&a)throw Error(i(425))}function _a(){}var Ru=null,Tu=null;function ju(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Au=typeof setTimeout=="function"?setTimeout:void 0,iR=typeof clearTimeout=="function"?clearTimeout:void 0,ly=typeof Promise=="function"?Promise:void 0,sR=typeof queueMicrotask=="function"?queueMicrotask:typeof ly<"u"?function(t){return ly.resolve(null).then(t).catch(oR)}:Au;function oR(t){setTimeout(function(){throw t})}function Iu(t,r){var a=r,f=0;do{var g=a.nextSibling;if(t.removeChild(a),g&&g.nodeType===8)if(a=g.data,a==="/$"){if(f===0){t.removeChild(g),we(r);return}f--}else a!=="$"&&a!=="$?"&&a!=="$!"||f++;a=g}while(a);we(r)}function Yr(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?")break;if(r==="/$")return null}}return t}function uy(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"){if(r===0)return t;r--}else a==="/$"&&r++}t=t.previousSibling}return null}var hs=Math.random().toString(36).slice(2),sr="__reactFiber$"+hs,po="__reactProps$"+hs,yr="__reactContainer$"+hs,Mu="__reactEvents$"+hs,aR="__reactListeners$"+hs,lR="__reactHandles$"+hs;function Ni(t){var r=t[sr];if(r)return r;for(var a=t.parentNode;a;){if(r=a[yr]||a[sr]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(t=uy(t);t!==null;){if(a=t[sr])return a;t=uy(t)}return r}t=a,a=t.parentNode}return null}function mo(t){return t=t[sr]||t[yr],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function ps(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(i(33))}function Sa(t){return t[po]||null}var Pu=[],ms=-1;function Kr(t){return{current:t}}function st(t){0>ms||(t.current=Pu[ms],Pu[ms]=null,ms--)}function nt(t,r){ms++,Pu[ms]=t.current,t.current=r}var Xr={},Ht=Kr(Xr),sn=Kr(!1),Ci=Xr;function gs(t,r){var a=t.type.contextTypes;if(!a)return Xr;var f=t.stateNode;if(f&&f.__reactInternalMemoizedUnmaskedChildContext===r)return f.__reactInternalMemoizedMaskedChildContext;var g={},w;for(w in a)g[w]=r[w];return f&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=g),g}function on(t){return t=t.childContextTypes,t!=null}function ba(){st(sn),st(Ht)}function cy(t,r,a){if(Ht.current!==Xr)throw Error(i(168));nt(Ht,r),nt(sn,a)}function fy(t,r,a){var f=t.stateNode;if(r=r.childContextTypes,typeof f.getChildContext!="function")return a;f=f.getChildContext();for(var g in f)if(!(g in r))throw Error(i(108,se(t)||"Unknown",g));return G({},a,f)}function ka(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Xr,Ci=Ht.current,nt(Ht,t),nt(sn,sn.current),!0}function dy(t,r,a){var f=t.stateNode;if(!f)throw Error(i(169));a?(t=fy(t,r,Ci),f.__reactInternalMemoizedMergedChildContext=t,st(sn),st(Ht),nt(Ht,t)):st(sn),nt(sn,a)}var wr=null,Ea=!1,Ou=!1;function hy(t){wr===null?wr=[t]:wr.push(t)}function uR(t){Ea=!0,hy(t)}function Qr(){if(!Ou&&wr!==null){Ou=!0;var t=0,r=Ue;try{var a=wr;for(Ue=1;t<a.length;t++){var f=a[t];do f=f(!0);while(f!==null)}wr=null,Ea=!1}catch(g){throw wr!==null&&(wr=wr.slice(t+1)),ts(Dr,Qr),g}finally{Ue=r,Ou=!1}}return null}var vs=[],ys=0,Na=null,Ca=0,Nn=[],Cn=0,Ri=null,xr=1,_r="";function Ti(t,r){vs[ys++]=Ca,vs[ys++]=Na,Na=t,Ca=r}function py(t,r,a){Nn[Cn++]=xr,Nn[Cn++]=_r,Nn[Cn++]=Ri,Ri=t;var f=xr;t=_r;var g=32-Jt(f)-1;f&=~(1<<g),a+=1;var w=32-Jt(r)+g;if(30<w){var T=g-g%5;w=(f&(1<<T)-1).toString(32),f>>=T,g-=T,xr=1<<32-Jt(r)+g|a<<g|f,_r=w+t}else xr=1<<w|a<<g|f,_r=t}function qu(t){t.return!==null&&(Ti(t,1),py(t,1,0))}function Lu(t){for(;t===Na;)Na=vs[--ys],vs[ys]=null,Ca=vs[--ys],vs[ys]=null;for(;t===Ri;)Ri=Nn[--Cn],Nn[Cn]=null,_r=Nn[--Cn],Nn[Cn]=null,xr=Nn[--Cn],Nn[Cn]=null}var mn=null,gn=null,ot=!1,Un=null;function my(t,r){var a=An(5,null,null,0);a.elementType="DELETED",a.stateNode=r,a.return=t,r=t.deletions,r===null?(t.deletions=[a],t.flags|=16):r.push(a)}function gy(t,r){switch(t.tag){case 5:var a=t.type;return r=r.nodeType!==1||a.toLowerCase()!==r.nodeName.toLowerCase()?null:r,r!==null?(t.stateNode=r,mn=t,gn=Yr(r.firstChild),!0):!1;case 6:return r=t.pendingProps===""||r.nodeType!==3?null:r,r!==null?(t.stateNode=r,mn=t,gn=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(a=Ri!==null?{id:xr,overflow:_r}:null,t.memoizedState={dehydrated:r,treeContext:a,retryLane:1073741824},a=An(18,null,null,0),a.stateNode=r,a.return=t,t.child=a,mn=t,gn=null,!0):!1;default:return!1}}function $u(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Du(t){if(ot){var r=gn;if(r){var a=r;if(!gy(t,r)){if($u(t))throw Error(i(418));r=Yr(a.nextSibling);var f=mn;r&&gy(t,r)?my(f,a):(t.flags=t.flags&-4097|2,ot=!1,mn=t)}}else{if($u(t))throw Error(i(418));t.flags=t.flags&-4097|2,ot=!1,mn=t}}}function vy(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;mn=t}function Ra(t){if(t!==mn)return!1;if(!ot)return vy(t),ot=!0,!1;var r;if((r=t.tag!==3)&&!(r=t.tag!==5)&&(r=t.type,r=r!=="head"&&r!=="body"&&!ju(t.type,t.memoizedProps)),r&&(r=gn)){if($u(t))throw yy(),Error(i(418));for(;r;)my(t,r),r=Yr(r.nextSibling)}if(vy(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(i(317));e:{for(t=t.nextSibling,r=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"){if(r===0){gn=Yr(t.nextSibling);break e}r--}else a!=="$"&&a!=="$!"&&a!=="$?"||r++}t=t.nextSibling}gn=null}}else gn=mn?Yr(t.stateNode.nextSibling):null;return!0}function yy(){for(var t=gn;t;)t=Yr(t.nextSibling)}function ws(){gn=mn=null,ot=!1}function Fu(t){Un===null?Un=[t]:Un.push(t)}var cR=C.ReactCurrentBatchConfig;function go(t,r,a){if(t=a.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(i(309));var f=a.stateNode}if(!f)throw Error(i(147,t));var g=f,w=""+t;return r!==null&&r.ref!==null&&typeof r.ref=="function"&&r.ref._stringRef===w?r.ref:(r=function(T){var D=g.refs;T===null?delete D[w]:D[w]=T},r._stringRef=w,r)}if(typeof t!="string")throw Error(i(284));if(!a._owner)throw Error(i(290,t))}return t}function Ta(t,r){throw t=Object.prototype.toString.call(r),Error(i(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t))}function wy(t){var r=t._init;return r(t._payload)}function xy(t){function r(te,Y){if(t){var re=te.deletions;re===null?(te.deletions=[Y],te.flags|=16):re.push(Y)}}function a(te,Y){if(!t)return null;for(;Y!==null;)r(te,Y),Y=Y.sibling;return null}function f(te,Y){for(te=new Map;Y!==null;)Y.key!==null?te.set(Y.key,Y):te.set(Y.index,Y),Y=Y.sibling;return te}function g(te,Y){return te=si(te,Y),te.index=0,te.sibling=null,te}function w(te,Y,re){return te.index=re,t?(re=te.alternate,re!==null?(re=re.index,re<Y?(te.flags|=2,Y):re):(te.flags|=2,Y)):(te.flags|=1048576,Y)}function T(te){return t&&te.alternate===null&&(te.flags|=2),te}function D(te,Y,re,me){return Y===null||Y.tag!==6?(Y=Ac(re,te.mode,me),Y.return=te,Y):(Y=g(Y,re),Y.return=te,Y)}function H(te,Y,re,me){var Ne=re.type;return Ne===L?fe(te,Y,re.props.children,me,re.key):Y!==null&&(Y.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===B&&wy(Ne)===Y.type)?(me=g(Y,re.props),me.ref=go(te,Y,re),me.return=te,me):(me=Ja(re.type,re.key,re.props,null,te.mode,me),me.ref=go(te,Y,re),me.return=te,me)}function ie(te,Y,re,me){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==re.containerInfo||Y.stateNode.implementation!==re.implementation?(Y=Ic(re,te.mode,me),Y.return=te,Y):(Y=g(Y,re.children||[]),Y.return=te,Y)}function fe(te,Y,re,me,Ne){return Y===null||Y.tag!==7?(Y=Li(re,te.mode,me,Ne),Y.return=te,Y):(Y=g(Y,re),Y.return=te,Y)}function he(te,Y,re){if(typeof Y=="string"&&Y!==""||typeof Y=="number")return Y=Ac(""+Y,te.mode,re),Y.return=te,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case I:return re=Ja(Y.type,Y.key,Y.props,null,te.mode,re),re.ref=go(te,null,Y),re.return=te,re;case P:return Y=Ic(Y,te.mode,re),Y.return=te,Y;case B:var me=Y._init;return he(te,me(Y._payload),re)}if(dt(Y)||$(Y))return Y=Li(Y,te.mode,re,null),Y.return=te,Y;Ta(te,Y)}return null}function ce(te,Y,re,me){var Ne=Y!==null?Y.key:null;if(typeof re=="string"&&re!==""||typeof re=="number")return Ne!==null?null:D(te,Y,""+re,me);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case I:return re.key===Ne?H(te,Y,re,me):null;case P:return re.key===Ne?ie(te,Y,re,me):null;case B:return Ne=re._init,ce(te,Y,Ne(re._payload),me)}if(dt(re)||$(re))return Ne!==null?null:fe(te,Y,re,me,null);Ta(te,re)}return null}function _e(te,Y,re,me,Ne){if(typeof me=="string"&&me!==""||typeof me=="number")return te=te.get(re)||null,D(Y,te,""+me,Ne);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case I:return te=te.get(me.key===null?re:me.key)||null,H(Y,te,me,Ne);case P:return te=te.get(me.key===null?re:me.key)||null,ie(Y,te,me,Ne);case B:var Re=me._init;return _e(te,Y,re,Re(me._payload),Ne)}if(dt(me)||$(me))return te=te.get(re)||null,fe(Y,te,me,Ne,null);Ta(Y,me)}return null}function be(te,Y,re,me){for(var Ne=null,Re=null,Te=Y,je=Y=0,Ot=null;Te!==null&&je<re.length;je++){Te.index>je?(Ot=Te,Te=null):Ot=Te.sibling;var Be=ce(te,Te,re[je],me);if(Be===null){Te===null&&(Te=Ot);break}t&&Te&&Be.alternate===null&&r(te,Te),Y=w(Be,Y,je),Re===null?Ne=Be:Re.sibling=Be,Re=Be,Te=Ot}if(je===re.length)return a(te,Te),ot&&Ti(te,je),Ne;if(Te===null){for(;je<re.length;je++)Te=he(te,re[je],me),Te!==null&&(Y=w(Te,Y,je),Re===null?Ne=Te:Re.sibling=Te,Re=Te);return ot&&Ti(te,je),Ne}for(Te=f(te,Te);je<re.length;je++)Ot=_e(Te,te,je,re[je],me),Ot!==null&&(t&&Ot.alternate!==null&&Te.delete(Ot.key===null?je:Ot.key),Y=w(Ot,Y,je),Re===null?Ne=Ot:Re.sibling=Ot,Re=Ot);return t&&Te.forEach(function(oi){return r(te,oi)}),ot&&Ti(te,je),Ne}function Ee(te,Y,re,me){var Ne=$(re);if(typeof Ne!="function")throw Error(i(150));if(re=Ne.call(re),re==null)throw Error(i(151));for(var Re=Ne=null,Te=Y,je=Y=0,Ot=null,Be=re.next();Te!==null&&!Be.done;je++,Be=re.next()){Te.index>je?(Ot=Te,Te=null):Ot=Te.sibling;var oi=ce(te,Te,Be.value,me);if(oi===null){Te===null&&(Te=Ot);break}t&&Te&&oi.alternate===null&&r(te,Te),Y=w(oi,Y,je),Re===null?Ne=oi:Re.sibling=oi,Re=oi,Te=Ot}if(Be.done)return a(te,Te),ot&&Ti(te,je),Ne;if(Te===null){for(;!Be.done;je++,Be=re.next())Be=he(te,Be.value,me),Be!==null&&(Y=w(Be,Y,je),Re===null?Ne=Be:Re.sibling=Be,Re=Be);return ot&&Ti(te,je),Ne}for(Te=f(te,Te);!Be.done;je++,Be=re.next())Be=_e(Te,te,je,Be.value,me),Be!==null&&(t&&Be.alternate!==null&&Te.delete(Be.key===null?je:Be.key),Y=w(Be,Y,je),Re===null?Ne=Be:Re.sibling=Be,Re=Be);return t&&Te.forEach(function(UR){return r(te,UR)}),ot&&Ti(te,je),Ne}function vt(te,Y,re,me){if(typeof re=="object"&&re!==null&&re.type===L&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case I:e:{for(var Ne=re.key,Re=Y;Re!==null;){if(Re.key===Ne){if(Ne=re.type,Ne===L){if(Re.tag===7){a(te,Re.sibling),Y=g(Re,re.props.children),Y.return=te,te=Y;break e}}else if(Re.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===B&&wy(Ne)===Re.type){a(te,Re.sibling),Y=g(Re,re.props),Y.ref=go(te,Re,re),Y.return=te,te=Y;break e}a(te,Re);break}else r(te,Re);Re=Re.sibling}re.type===L?(Y=Li(re.props.children,te.mode,me,re.key),Y.return=te,te=Y):(me=Ja(re.type,re.key,re.props,null,te.mode,me),me.ref=go(te,Y,re),me.return=te,te=me)}return T(te);case P:e:{for(Re=re.key;Y!==null;){if(Y.key===Re)if(Y.tag===4&&Y.stateNode.containerInfo===re.containerInfo&&Y.stateNode.implementation===re.implementation){a(te,Y.sibling),Y=g(Y,re.children||[]),Y.return=te,te=Y;break e}else{a(te,Y);break}else r(te,Y);Y=Y.sibling}Y=Ic(re,te.mode,me),Y.return=te,te=Y}return T(te);case B:return Re=re._init,vt(te,Y,Re(re._payload),me)}if(dt(re))return be(te,Y,re,me);if($(re))return Ee(te,Y,re,me);Ta(te,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,Y!==null&&Y.tag===6?(a(te,Y.sibling),Y=g(Y,re),Y.return=te,te=Y):(a(te,Y),Y=Ac(re,te.mode,me),Y.return=te,te=Y),T(te)):a(te,Y)}return vt}var xs=xy(!0),_y=xy(!1),ja=Kr(null),Aa=null,_s=null,zu=null;function Bu(){zu=_s=Aa=null}function Uu(t){var r=ja.current;st(ja),t._currentValue=r}function Hu(t,r,a){for(;t!==null;){var f=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,f!==null&&(f.childLanes|=r)):f!==null&&(f.childLanes&r)!==r&&(f.childLanes|=r),t===a)break;t=t.return}}function Ss(t,r){Aa=t,zu=_s=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&r)!==0&&(an=!0),t.firstContext=null)}function Rn(t){var r=t._currentValue;if(zu!==t)if(t={context:t,memoizedValue:r,next:null},_s===null){if(Aa===null)throw Error(i(308));_s=t,Aa.dependencies={lanes:0,firstContext:t}}else _s=_s.next=t;return r}var ji=null;function Vu(t){ji===null?ji=[t]:ji.push(t)}function Sy(t,r,a,f){var g=r.interleaved;return g===null?(a.next=a,Vu(r)):(a.next=g.next,g.next=a),r.interleaved=a,Sr(t,f)}function Sr(t,r){t.lanes|=r;var a=t.alternate;for(a!==null&&(a.lanes|=r),a=t,t=t.return;t!==null;)t.childLanes|=r,a=t.alternate,a!==null&&(a.childLanes|=r),a=t,t=t.return;return a.tag===3?a.stateNode:null}var Zr=!1;function Wu(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function by(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function br(t,r){return{eventTime:t,lane:r,tag:0,payload:null,callback:null,next:null}}function Jr(t,r,a){var f=t.updateQueue;if(f===null)return null;if(f=f.shared,(De&2)!==0){var g=f.pending;return g===null?r.next=r:(r.next=g.next,g.next=r),f.pending=r,Sr(t,a)}return g=f.interleaved,g===null?(r.next=r,Vu(f)):(r.next=g.next,g.next=r),f.interleaved=r,Sr(t,a)}function Ia(t,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194240)!==0)){var f=r.lanes;f&=t.pendingLanes,a|=f,r.lanes=a,en(t,a)}}function ky(t,r){var a=t.updateQueue,f=t.alternate;if(f!==null&&(f=f.updateQueue,a===f)){var g=null,w=null;if(a=a.firstBaseUpdate,a!==null){do{var T={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};w===null?g=w=T:w=w.next=T,a=a.next}while(a!==null);w===null?g=w=r:w=w.next=r}else g=w=r;a={baseState:f.baseState,firstBaseUpdate:g,lastBaseUpdate:w,shared:f.shared,effects:f.effects},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=r:t.next=r,a.lastBaseUpdate=r}function Ma(t,r,a,f){var g=t.updateQueue;Zr=!1;var w=g.firstBaseUpdate,T=g.lastBaseUpdate,D=g.shared.pending;if(D!==null){g.shared.pending=null;var H=D,ie=H.next;H.next=null,T===null?w=ie:T.next=ie,T=H;var fe=t.alternate;fe!==null&&(fe=fe.updateQueue,D=fe.lastBaseUpdate,D!==T&&(D===null?fe.firstBaseUpdate=ie:D.next=ie,fe.lastBaseUpdate=H))}if(w!==null){var he=g.baseState;T=0,fe=ie=H=null,D=w;do{var ce=D.lane,_e=D.eventTime;if((f&ce)===ce){fe!==null&&(fe=fe.next={eventTime:_e,lane:0,tag:D.tag,payload:D.payload,callback:D.callback,next:null});e:{var be=t,Ee=D;switch(ce=r,_e=a,Ee.tag){case 1:if(be=Ee.payload,typeof be=="function"){he=be.call(_e,he,ce);break e}he=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=Ee.payload,ce=typeof be=="function"?be.call(_e,he,ce):be,ce==null)break e;he=G({},he,ce);break e;case 2:Zr=!0}}D.callback!==null&&D.lane!==0&&(t.flags|=64,ce=g.effects,ce===null?g.effects=[D]:ce.push(D))}else _e={eventTime:_e,lane:ce,tag:D.tag,payload:D.payload,callback:D.callback,next:null},fe===null?(ie=fe=_e,H=he):fe=fe.next=_e,T|=ce;if(D=D.next,D===null){if(D=g.shared.pending,D===null)break;ce=D,D=ce.next,ce.next=null,g.lastBaseUpdate=ce,g.shared.pending=null}}while(!0);if(fe===null&&(H=he),g.baseState=H,g.firstBaseUpdate=ie,g.lastBaseUpdate=fe,r=g.shared.interleaved,r!==null){g=r;do T|=g.lane,g=g.next;while(g!==r)}else w===null&&(g.shared.lanes=0);Mi|=T,t.lanes=T,t.memoizedState=he}}function Ey(t,r,a){if(t=r.effects,r.effects=null,t!==null)for(r=0;r<t.length;r++){var f=t[r],g=f.callback;if(g!==null){if(f.callback=null,f=a,typeof g!="function")throw Error(i(191,g));g.call(f)}}}var vo={},or=Kr(vo),yo=Kr(vo),wo=Kr(vo);function Ai(t){if(t===vo)throw Error(i(174));return t}function Gu(t,r){switch(nt(wo,r),nt(yo,t),nt(or,vo),t=r.nodeType,t){case 9:case 11:r=(r=r.documentElement)?r.namespaceURI:Ge(null,"");break;default:t=t===8?r.parentNode:r,r=t.namespaceURI||null,t=t.tagName,r=Ge(r,t)}st(or),nt(or,r)}function bs(){st(or),st(yo),st(wo)}function Ny(t){Ai(wo.current);var r=Ai(or.current),a=Ge(r,t.type);r!==a&&(nt(yo,t),nt(or,a))}function Yu(t){yo.current===t&&(st(or),st(yo))}var ct=Kr(0);function Pa(t){for(var r=t;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Ku=[];function Xu(){for(var t=0;t<Ku.length;t++)Ku[t]._workInProgressVersionPrimary=null;Ku.length=0}var Oa=C.ReactCurrentDispatcher,Qu=C.ReactCurrentBatchConfig,Ii=0,ft=null,Et=null,Mt=null,qa=!1,xo=!1,_o=0,fR=0;function Vt(){throw Error(i(321))}function Zu(t,r){if(r===null)return!1;for(var a=0;a<r.length&&a<t.length;a++)if(!Bn(t[a],r[a]))return!1;return!0}function Ju(t,r,a,f,g,w){if(Ii=w,ft=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,Oa.current=t===null||t.memoizedState===null?mR:gR,t=a(f,g),xo){w=0;do{if(xo=!1,_o=0,25<=w)throw Error(i(301));w+=1,Mt=Et=null,r.updateQueue=null,Oa.current=vR,t=a(f,g)}while(xo)}if(Oa.current=Da,r=Et!==null&&Et.next!==null,Ii=0,Mt=Et=ft=null,qa=!1,r)throw Error(i(300));return t}function ec(){var t=_o!==0;return _o=0,t}function ar(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?ft.memoizedState=Mt=t:Mt=Mt.next=t,Mt}function Tn(){if(Et===null){var t=ft.alternate;t=t!==null?t.memoizedState:null}else t=Et.next;var r=Mt===null?ft.memoizedState:Mt.next;if(r!==null)Mt=r,Et=t;else{if(t===null)throw Error(i(310));Et=t,t={memoizedState:Et.memoizedState,baseState:Et.baseState,baseQueue:Et.baseQueue,queue:Et.queue,next:null},Mt===null?ft.memoizedState=Mt=t:Mt=Mt.next=t}return Mt}function So(t,r){return typeof r=="function"?r(t):r}function tc(t){var r=Tn(),a=r.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=t;var f=Et,g=f.baseQueue,w=a.pending;if(w!==null){if(g!==null){var T=g.next;g.next=w.next,w.next=T}f.baseQueue=g=w,a.pending=null}if(g!==null){w=g.next,f=f.baseState;var D=T=null,H=null,ie=w;do{var fe=ie.lane;if((Ii&fe)===fe)H!==null&&(H=H.next={lane:0,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),f=ie.hasEagerState?ie.eagerState:t(f,ie.action);else{var he={lane:fe,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null};H===null?(D=H=he,T=f):H=H.next=he,ft.lanes|=fe,Mi|=fe}ie=ie.next}while(ie!==null&&ie!==w);H===null?T=f:H.next=D,Bn(f,r.memoizedState)||(an=!0),r.memoizedState=f,r.baseState=T,r.baseQueue=H,a.lastRenderedState=f}if(t=a.interleaved,t!==null){g=t;do w=g.lane,ft.lanes|=w,Mi|=w,g=g.next;while(g!==t)}else g===null&&(a.lanes=0);return[r.memoizedState,a.dispatch]}function nc(t){var r=Tn(),a=r.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=t;var f=a.dispatch,g=a.pending,w=r.memoizedState;if(g!==null){a.pending=null;var T=g=g.next;do w=t(w,T.action),T=T.next;while(T!==g);Bn(w,r.memoizedState)||(an=!0),r.memoizedState=w,r.baseQueue===null&&(r.baseState=w),a.lastRenderedState=w}return[w,f]}function Cy(){}function Ry(t,r){var a=ft,f=Tn(),g=r(),w=!Bn(f.memoizedState,g);if(w&&(f.memoizedState=g,an=!0),f=f.queue,rc(Ay.bind(null,a,f,t),[t]),f.getSnapshot!==r||w||Mt!==null&&Mt.memoizedState.tag&1){if(a.flags|=2048,bo(9,jy.bind(null,a,f,g,r),void 0,null),Pt===null)throw Error(i(349));(Ii&30)!==0||Ty(a,r,g)}return g}function Ty(t,r,a){t.flags|=16384,t={getSnapshot:r,value:a},r=ft.updateQueue,r===null?(r={lastEffect:null,stores:null},ft.updateQueue=r,r.stores=[t]):(a=r.stores,a===null?r.stores=[t]:a.push(t))}function jy(t,r,a,f){r.value=a,r.getSnapshot=f,Iy(r)&&My(t)}function Ay(t,r,a){return a(function(){Iy(r)&&My(t)})}function Iy(t){var r=t.getSnapshot;t=t.value;try{var a=r();return!Bn(t,a)}catch{return!0}}function My(t){var r=Sr(t,1);r!==null&&Gn(r,t,1,-1)}function Py(t){var r=ar();return typeof t=="function"&&(t=t()),r.memoizedState=r.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:So,lastRenderedState:t},r.queue=t,t=t.dispatch=pR.bind(null,ft,t),[r.memoizedState,t]}function bo(t,r,a,f){return t={tag:t,create:r,destroy:a,deps:f,next:null},r=ft.updateQueue,r===null?(r={lastEffect:null,stores:null},ft.updateQueue=r,r.lastEffect=t.next=t):(a=r.lastEffect,a===null?r.lastEffect=t.next=t:(f=a.next,a.next=t,t.next=f,r.lastEffect=t)),t}function Oy(){return Tn().memoizedState}function La(t,r,a,f){var g=ar();ft.flags|=t,g.memoizedState=bo(1|r,a,void 0,f===void 0?null:f)}function $a(t,r,a,f){var g=Tn();f=f===void 0?null:f;var w=void 0;if(Et!==null){var T=Et.memoizedState;if(w=T.destroy,f!==null&&Zu(f,T.deps)){g.memoizedState=bo(r,a,w,f);return}}ft.flags|=t,g.memoizedState=bo(1|r,a,w,f)}function qy(t,r){return La(8390656,8,t,r)}function rc(t,r){return $a(2048,8,t,r)}function Ly(t,r){return $a(4,2,t,r)}function $y(t,r){return $a(4,4,t,r)}function Dy(t,r){if(typeof r=="function")return t=t(),r(t),function(){r(null)};if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function Fy(t,r,a){return a=a!=null?a.concat([t]):null,$a(4,4,Dy.bind(null,r,t),a)}function ic(){}function zy(t,r){var a=Tn();r=r===void 0?null:r;var f=a.memoizedState;return f!==null&&r!==null&&Zu(r,f[1])?f[0]:(a.memoizedState=[t,r],t)}function By(t,r){var a=Tn();r=r===void 0?null:r;var f=a.memoizedState;return f!==null&&r!==null&&Zu(r,f[1])?f[0]:(t=t(),a.memoizedState=[t,r],t)}function Uy(t,r,a){return(Ii&21)===0?(t.baseState&&(t.baseState=!1,an=!0),t.memoizedState=a):(Bn(a,r)||(a=ua(),ft.lanes|=a,Mi|=a,t.baseState=!0),r)}function dR(t,r){var a=Ue;Ue=a!==0&&4>a?a:4,t(!0);var f=Qu.transition;Qu.transition={};try{t(!1),r()}finally{Ue=a,Qu.transition=f}}function Hy(){return Tn().memoizedState}function hR(t,r,a){var f=ri(t);if(a={lane:f,action:a,hasEagerState:!1,eagerState:null,next:null},Vy(t))Wy(r,a);else if(a=Sy(t,r,a,f),a!==null){var g=Xt();Gn(a,t,f,g),Gy(a,r,f)}}function pR(t,r,a){var f=ri(t),g={lane:f,action:a,hasEagerState:!1,eagerState:null,next:null};if(Vy(t))Wy(r,g);else{var w=t.alternate;if(t.lanes===0&&(w===null||w.lanes===0)&&(w=r.lastRenderedReducer,w!==null))try{var T=r.lastRenderedState,D=w(T,a);if(g.hasEagerState=!0,g.eagerState=D,Bn(D,T)){var H=r.interleaved;H===null?(g.next=g,Vu(r)):(g.next=H.next,H.next=g),r.interleaved=g;return}}catch{}finally{}a=Sy(t,r,g,f),a!==null&&(g=Xt(),Gn(a,t,f,g),Gy(a,r,f))}}function Vy(t){var r=t.alternate;return t===ft||r!==null&&r===ft}function Wy(t,r){xo=qa=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function Gy(t,r,a){if((a&4194240)!==0){var f=r.lanes;f&=t.pendingLanes,a|=f,r.lanes=a,en(t,a)}}var Da={readContext:Rn,useCallback:Vt,useContext:Vt,useEffect:Vt,useImperativeHandle:Vt,useInsertionEffect:Vt,useLayoutEffect:Vt,useMemo:Vt,useReducer:Vt,useRef:Vt,useState:Vt,useDebugValue:Vt,useDeferredValue:Vt,useTransition:Vt,useMutableSource:Vt,useSyncExternalStore:Vt,useId:Vt,unstable_isNewReconciler:!1},mR={readContext:Rn,useCallback:function(t,r){return ar().memoizedState=[t,r===void 0?null:r],t},useContext:Rn,useEffect:qy,useImperativeHandle:function(t,r,a){return a=a!=null?a.concat([t]):null,La(4194308,4,Dy.bind(null,r,t),a)},useLayoutEffect:function(t,r){return La(4194308,4,t,r)},useInsertionEffect:function(t,r){return La(4,2,t,r)},useMemo:function(t,r){var a=ar();return r=r===void 0?null:r,t=t(),a.memoizedState=[t,r],t},useReducer:function(t,r,a){var f=ar();return r=a!==void 0?a(r):r,f.memoizedState=f.baseState=r,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},f.queue=t,t=t.dispatch=hR.bind(null,ft,t),[f.memoizedState,t]},useRef:function(t){var r=ar();return t={current:t},r.memoizedState=t},useState:Py,useDebugValue:ic,useDeferredValue:function(t){return ar().memoizedState=t},useTransition:function(){var t=Py(!1),r=t[0];return t=dR.bind(null,t[1]),ar().memoizedState=t,[r,t]},useMutableSource:function(){},useSyncExternalStore:function(t,r,a){var f=ft,g=ar();if(ot){if(a===void 0)throw Error(i(407));a=a()}else{if(a=r(),Pt===null)throw Error(i(349));(Ii&30)!==0||Ty(f,r,a)}g.memoizedState=a;var w={value:a,getSnapshot:r};return g.queue=w,qy(Ay.bind(null,f,w,t),[t]),f.flags|=2048,bo(9,jy.bind(null,f,w,a,r),void 0,null),a},useId:function(){var t=ar(),r=Pt.identifierPrefix;if(ot){var a=_r,f=xr;a=(f&~(1<<32-Jt(f)-1)).toString(32)+a,r=":"+r+"R"+a,a=_o++,0<a&&(r+="H"+a.toString(32)),r+=":"}else a=fR++,r=":"+r+"r"+a.toString(32)+":";return t.memoizedState=r},unstable_isNewReconciler:!1},gR={readContext:Rn,useCallback:zy,useContext:Rn,useEffect:rc,useImperativeHandle:Fy,useInsertionEffect:Ly,useLayoutEffect:$y,useMemo:By,useReducer:tc,useRef:Oy,useState:function(){return tc(So)},useDebugValue:ic,useDeferredValue:function(t){var r=Tn();return Uy(r,Et.memoizedState,t)},useTransition:function(){var t=tc(So)[0],r=Tn().memoizedState;return[t,r]},useMutableSource:Cy,useSyncExternalStore:Ry,useId:Hy,unstable_isNewReconciler:!1},vR={readContext:Rn,useCallback:zy,useContext:Rn,useEffect:rc,useImperativeHandle:Fy,useInsertionEffect:Ly,useLayoutEffect:$y,useMemo:By,useReducer:nc,useRef:Oy,useState:function(){return nc(So)},useDebugValue:ic,useDeferredValue:function(t){var r=Tn();return Et===null?r.memoizedState=t:Uy(r,Et.memoizedState,t)},useTransition:function(){var t=nc(So)[0],r=Tn().memoizedState;return[t,r]},useMutableSource:Cy,useSyncExternalStore:Ry,useId:Hy,unstable_isNewReconciler:!1};function Hn(t,r){if(t&&t.defaultProps){r=G({},r),t=t.defaultProps;for(var a in t)r[a]===void 0&&(r[a]=t[a]);return r}return r}function sc(t,r,a,f){r=t.memoizedState,a=a(f,r),a=a==null?r:G({},r,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var Fa={isMounted:function(t){return(t=t._reactInternals)?Zt(t)===t:!1},enqueueSetState:function(t,r,a){t=t._reactInternals;var f=Xt(),g=ri(t),w=br(f,g);w.payload=r,a!=null&&(w.callback=a),r=Jr(t,w,g),r!==null&&(Gn(r,t,g,f),Ia(r,t,g))},enqueueReplaceState:function(t,r,a){t=t._reactInternals;var f=Xt(),g=ri(t),w=br(f,g);w.tag=1,w.payload=r,a!=null&&(w.callback=a),r=Jr(t,w,g),r!==null&&(Gn(r,t,g,f),Ia(r,t,g))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var a=Xt(),f=ri(t),g=br(a,f);g.tag=2,r!=null&&(g.callback=r),r=Jr(t,g,f),r!==null&&(Gn(r,t,f,a),Ia(r,t,f))}};function Yy(t,r,a,f,g,w,T){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(f,w,T):r.prototype&&r.prototype.isPureReactComponent?!lo(a,f)||!lo(g,w):!0}function Ky(t,r,a){var f=!1,g=Xr,w=r.contextType;return typeof w=="object"&&w!==null?w=Rn(w):(g=on(r)?Ci:Ht.current,f=r.contextTypes,w=(f=f!=null)?gs(t,g):Xr),r=new r(a,w),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Fa,t.stateNode=r,r._reactInternals=t,f&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=g,t.__reactInternalMemoizedMaskedChildContext=w),r}function Xy(t,r,a,f){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,f),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,f),r.state!==t&&Fa.enqueueReplaceState(r,r.state,null)}function oc(t,r,a,f){var g=t.stateNode;g.props=a,g.state=t.memoizedState,g.refs={},Wu(t);var w=r.contextType;typeof w=="object"&&w!==null?g.context=Rn(w):(w=on(r)?Ci:Ht.current,g.context=gs(t,w)),g.state=t.memoizedState,w=r.getDerivedStateFromProps,typeof w=="function"&&(sc(t,r,w,a),g.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(r=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),r!==g.state&&Fa.enqueueReplaceState(g,g.state,null),Ma(t,a,g,f),g.state=t.memoizedState),typeof g.componentDidMount=="function"&&(t.flags|=4194308)}function ks(t,r){try{var a="",f=r;do a+=K(f),f=f.return;while(f);var g=a}catch(w){g=`
|
|
39
|
+
Error generating stack: `+w.message+`
|
|
40
|
+
`+w.stack}return{value:t,source:r,stack:g,digest:null}}function ac(t,r,a){return{value:t,source:null,stack:a??null,digest:r??null}}function lc(t,r){try{console.error(r.value)}catch(a){setTimeout(function(){throw a})}}var yR=typeof WeakMap=="function"?WeakMap:Map;function Qy(t,r,a){a=br(-1,a),a.tag=3,a.payload={element:null};var f=r.value;return a.callback=function(){Ga||(Ga=!0,bc=f),lc(t,r)},a}function Zy(t,r,a){a=br(-1,a),a.tag=3;var f=t.type.getDerivedStateFromError;if(typeof f=="function"){var g=r.value;a.payload=function(){return f(g)},a.callback=function(){lc(t,r)}}var w=t.stateNode;return w!==null&&typeof w.componentDidCatch=="function"&&(a.callback=function(){lc(t,r),typeof f!="function"&&(ti===null?ti=new Set([this]):ti.add(this));var T=r.stack;this.componentDidCatch(r.value,{componentStack:T!==null?T:""})}),a}function Jy(t,r,a){var f=t.pingCache;if(f===null){f=t.pingCache=new yR;var g=new Set;f.set(r,g)}else g=f.get(r),g===void 0&&(g=new Set,f.set(r,g));g.has(a)||(g.add(a),t=IR.bind(null,t,r,a),r.then(t,t))}function e0(t){do{var r;if((r=t.tag===13)&&(r=t.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return t;t=t.return}while(t!==null);return null}function t0(t,r,a,f,g){return(t.mode&1)===0?(t===r?t.flags|=65536:(t.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(r=br(-1,1),r.tag=2,Jr(a,r,1))),a.lanes|=1),t):(t.flags|=65536,t.lanes=g,t)}var wR=C.ReactCurrentOwner,an=!1;function Kt(t,r,a,f){r.child=t===null?_y(r,null,a,f):xs(r,t.child,a,f)}function n0(t,r,a,f,g){a=a.render;var w=r.ref;return Ss(r,g),f=Ju(t,r,a,f,w,g),a=ec(),t!==null&&!an?(r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~g,kr(t,r,g)):(ot&&a&&qu(r),r.flags|=1,Kt(t,r,f,g),r.child)}function r0(t,r,a,f,g){if(t===null){var w=a.type;return typeof w=="function"&&!jc(w)&&w.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(r.tag=15,r.type=w,i0(t,r,w,f,g)):(t=Ja(a.type,null,f,r,r.mode,g),t.ref=r.ref,t.return=r,r.child=t)}if(w=t.child,(t.lanes&g)===0){var T=w.memoizedProps;if(a=a.compare,a=a!==null?a:lo,a(T,f)&&t.ref===r.ref)return kr(t,r,g)}return r.flags|=1,t=si(w,f),t.ref=r.ref,t.return=r,r.child=t}function i0(t,r,a,f,g){if(t!==null){var w=t.memoizedProps;if(lo(w,f)&&t.ref===r.ref)if(an=!1,r.pendingProps=f=w,(t.lanes&g)!==0)(t.flags&131072)!==0&&(an=!0);else return r.lanes=t.lanes,kr(t,r,g)}return uc(t,r,a,f,g)}function s0(t,r,a){var f=r.pendingProps,g=f.children,w=t!==null?t.memoizedState:null;if(f.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},nt(Ns,vn),vn|=a;else{if((a&1073741824)===0)return t=w!==null?w.baseLanes|a:a,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:t,cachePool:null,transitions:null},r.updateQueue=null,nt(Ns,vn),vn|=t,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},f=w!==null?w.baseLanes:a,nt(Ns,vn),vn|=f}else w!==null?(f=w.baseLanes|a,r.memoizedState=null):f=a,nt(Ns,vn),vn|=f;return Kt(t,r,g,a),r.child}function o0(t,r){var a=r.ref;(t===null&&a!==null||t!==null&&t.ref!==a)&&(r.flags|=512,r.flags|=2097152)}function uc(t,r,a,f,g){var w=on(a)?Ci:Ht.current;return w=gs(r,w),Ss(r,g),a=Ju(t,r,a,f,w,g),f=ec(),t!==null&&!an?(r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~g,kr(t,r,g)):(ot&&f&&qu(r),r.flags|=1,Kt(t,r,a,g),r.child)}function a0(t,r,a,f,g){if(on(a)){var w=!0;ka(r)}else w=!1;if(Ss(r,g),r.stateNode===null)Ba(t,r),Ky(r,a,f),oc(r,a,f,g),f=!0;else if(t===null){var T=r.stateNode,D=r.memoizedProps;T.props=D;var H=T.context,ie=a.contextType;typeof ie=="object"&&ie!==null?ie=Rn(ie):(ie=on(a)?Ci:Ht.current,ie=gs(r,ie));var fe=a.getDerivedStateFromProps,he=typeof fe=="function"||typeof T.getSnapshotBeforeUpdate=="function";he||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(D!==f||H!==ie)&&Xy(r,T,f,ie),Zr=!1;var ce=r.memoizedState;T.state=ce,Ma(r,f,T,g),H=r.memoizedState,D!==f||ce!==H||sn.current||Zr?(typeof fe=="function"&&(sc(r,a,fe,f),H=r.memoizedState),(D=Zr||Yy(r,a,D,f,ce,H,ie))?(he||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(r.flags|=4194308)):(typeof T.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=f,r.memoizedState=H),T.props=f,T.state=H,T.context=ie,f=D):(typeof T.componentDidMount=="function"&&(r.flags|=4194308),f=!1)}else{T=r.stateNode,by(t,r),D=r.memoizedProps,ie=r.type===r.elementType?D:Hn(r.type,D),T.props=ie,he=r.pendingProps,ce=T.context,H=a.contextType,typeof H=="object"&&H!==null?H=Rn(H):(H=on(a)?Ci:Ht.current,H=gs(r,H));var _e=a.getDerivedStateFromProps;(fe=typeof _e=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(D!==he||ce!==H)&&Xy(r,T,f,H),Zr=!1,ce=r.memoizedState,T.state=ce,Ma(r,f,T,g);var be=r.memoizedState;D!==he||ce!==be||sn.current||Zr?(typeof _e=="function"&&(sc(r,a,_e,f),be=r.memoizedState),(ie=Zr||Yy(r,a,ie,f,ce,be,H)||!1)?(fe||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(f,be,H),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(f,be,H)),typeof T.componentDidUpdate=="function"&&(r.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof T.componentDidUpdate!="function"||D===t.memoizedProps&&ce===t.memoizedState||(r.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||D===t.memoizedProps&&ce===t.memoizedState||(r.flags|=1024),r.memoizedProps=f,r.memoizedState=be),T.props=f,T.state=be,T.context=H,f=ie):(typeof T.componentDidUpdate!="function"||D===t.memoizedProps&&ce===t.memoizedState||(r.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||D===t.memoizedProps&&ce===t.memoizedState||(r.flags|=1024),f=!1)}return cc(t,r,a,f,w,g)}function cc(t,r,a,f,g,w){o0(t,r);var T=(r.flags&128)!==0;if(!f&&!T)return g&&dy(r,a,!1),kr(t,r,w);f=r.stateNode,wR.current=r;var D=T&&typeof a.getDerivedStateFromError!="function"?null:f.render();return r.flags|=1,t!==null&&T?(r.child=xs(r,t.child,null,w),r.child=xs(r,null,D,w)):Kt(t,r,D,w),r.memoizedState=f.state,g&&dy(r,a,!0),r.child}function l0(t){var r=t.stateNode;r.pendingContext?cy(t,r.pendingContext,r.pendingContext!==r.context):r.context&&cy(t,r.context,!1),Gu(t,r.containerInfo)}function u0(t,r,a,f,g){return ws(),Fu(g),r.flags|=256,Kt(t,r,a,f),r.child}var fc={dehydrated:null,treeContext:null,retryLane:0};function dc(t){return{baseLanes:t,cachePool:null,transitions:null}}function c0(t,r,a){var f=r.pendingProps,g=ct.current,w=!1,T=(r.flags&128)!==0,D;if((D=T)||(D=t!==null&&t.memoizedState===null?!1:(g&2)!==0),D?(w=!0,r.flags&=-129):(t===null||t.memoizedState!==null)&&(g|=1),nt(ct,g&1),t===null)return Du(r),t=r.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((r.mode&1)===0?r.lanes=1:t.data==="$!"?r.lanes=8:r.lanes=1073741824,null):(T=f.children,t=f.fallback,w?(f=r.mode,w=r.child,T={mode:"hidden",children:T},(f&1)===0&&w!==null?(w.childLanes=0,w.pendingProps=T):w=el(T,f,0,null),t=Li(t,f,a,null),w.return=r,t.return=r,w.sibling=t,r.child=w,r.child.memoizedState=dc(a),r.memoizedState=fc,t):hc(r,T));if(g=t.memoizedState,g!==null&&(D=g.dehydrated,D!==null))return xR(t,r,T,f,D,g,a);if(w){w=f.fallback,T=r.mode,g=t.child,D=g.sibling;var H={mode:"hidden",children:f.children};return(T&1)===0&&r.child!==g?(f=r.child,f.childLanes=0,f.pendingProps=H,r.deletions=null):(f=si(g,H),f.subtreeFlags=g.subtreeFlags&14680064),D!==null?w=si(D,w):(w=Li(w,T,a,null),w.flags|=2),w.return=r,f.return=r,f.sibling=w,r.child=f,f=w,w=r.child,T=t.child.memoizedState,T=T===null?dc(a):{baseLanes:T.baseLanes|a,cachePool:null,transitions:T.transitions},w.memoizedState=T,w.childLanes=t.childLanes&~a,r.memoizedState=fc,f}return w=t.child,t=w.sibling,f=si(w,{mode:"visible",children:f.children}),(r.mode&1)===0&&(f.lanes=a),f.return=r,f.sibling=null,t!==null&&(a=r.deletions,a===null?(r.deletions=[t],r.flags|=16):a.push(t)),r.child=f,r.memoizedState=null,f}function hc(t,r){return r=el({mode:"visible",children:r},t.mode,0,null),r.return=t,t.child=r}function za(t,r,a,f){return f!==null&&Fu(f),xs(r,t.child,null,a),t=hc(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function xR(t,r,a,f,g,w,T){if(a)return r.flags&256?(r.flags&=-257,f=ac(Error(i(422))),za(t,r,T,f)):r.memoizedState!==null?(r.child=t.child,r.flags|=128,null):(w=f.fallback,g=r.mode,f=el({mode:"visible",children:f.children},g,0,null),w=Li(w,g,T,null),w.flags|=2,f.return=r,w.return=r,f.sibling=w,r.child=f,(r.mode&1)!==0&&xs(r,t.child,null,T),r.child.memoizedState=dc(T),r.memoizedState=fc,w);if((r.mode&1)===0)return za(t,r,T,null);if(g.data==="$!"){if(f=g.nextSibling&&g.nextSibling.dataset,f)var D=f.dgst;return f=D,w=Error(i(419)),f=ac(w,f,void 0),za(t,r,T,f)}if(D=(T&t.childLanes)!==0,an||D){if(f=Pt,f!==null){switch(T&-T){case 4:g=2;break;case 16:g=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(f.suspendedLanes|T))!==0?0:g,g!==0&&g!==w.retryLane&&(w.retryLane=g,Sr(t,g),Gn(f,t,g,-1))}return Tc(),f=ac(Error(i(421))),za(t,r,T,f)}return g.data==="$?"?(r.flags|=128,r.child=t.child,r=MR.bind(null,t),g._reactRetry=r,null):(t=w.treeContext,gn=Yr(g.nextSibling),mn=r,ot=!0,Un=null,t!==null&&(Nn[Cn++]=xr,Nn[Cn++]=_r,Nn[Cn++]=Ri,xr=t.id,_r=t.overflow,Ri=r),r=hc(r,f.children),r.flags|=4096,r)}function f0(t,r,a){t.lanes|=r;var f=t.alternate;f!==null&&(f.lanes|=r),Hu(t.return,r,a)}function pc(t,r,a,f,g){var w=t.memoizedState;w===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:f,tail:a,tailMode:g}:(w.isBackwards=r,w.rendering=null,w.renderingStartTime=0,w.last=f,w.tail=a,w.tailMode=g)}function d0(t,r,a){var f=r.pendingProps,g=f.revealOrder,w=f.tail;if(Kt(t,r,f.children,a),f=ct.current,(f&2)!==0)f=f&1|2,r.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&f0(t,a,r);else if(t.tag===19)f0(t,a,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}f&=1}if(nt(ct,f),(r.mode&1)===0)r.memoizedState=null;else switch(g){case"forwards":for(a=r.child,g=null;a!==null;)t=a.alternate,t!==null&&Pa(t)===null&&(g=a),a=a.sibling;a=g,a===null?(g=r.child,r.child=null):(g=a.sibling,a.sibling=null),pc(r,!1,g,a,w);break;case"backwards":for(a=null,g=r.child,r.child=null;g!==null;){if(t=g.alternate,t!==null&&Pa(t)===null){r.child=g;break}t=g.sibling,g.sibling=a,a=g,g=t}pc(r,!0,a,null,w);break;case"together":pc(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function Ba(t,r){(r.mode&1)===0&&t!==null&&(t.alternate=null,r.alternate=null,r.flags|=2)}function kr(t,r,a){if(t!==null&&(r.dependencies=t.dependencies),Mi|=r.lanes,(a&r.childLanes)===0)return null;if(t!==null&&r.child!==t.child)throw Error(i(153));if(r.child!==null){for(t=r.child,a=si(t,t.pendingProps),r.child=a,a.return=r;t.sibling!==null;)t=t.sibling,a=a.sibling=si(t,t.pendingProps),a.return=r;a.sibling=null}return r.child}function _R(t,r,a){switch(r.tag){case 3:l0(r),ws();break;case 5:Ny(r);break;case 1:on(r.type)&&ka(r);break;case 4:Gu(r,r.stateNode.containerInfo);break;case 10:var f=r.type._context,g=r.memoizedProps.value;nt(ja,f._currentValue),f._currentValue=g;break;case 13:if(f=r.memoizedState,f!==null)return f.dehydrated!==null?(nt(ct,ct.current&1),r.flags|=128,null):(a&r.child.childLanes)!==0?c0(t,r,a):(nt(ct,ct.current&1),t=kr(t,r,a),t!==null?t.sibling:null);nt(ct,ct.current&1);break;case 19:if(f=(a&r.childLanes)!==0,(t.flags&128)!==0){if(f)return d0(t,r,a);r.flags|=128}if(g=r.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),nt(ct,ct.current),f)break;return null;case 22:case 23:return r.lanes=0,s0(t,r,a)}return kr(t,r,a)}var h0,mc,p0,m0;h0=function(t,r){for(var a=r.child;a!==null;){if(a.tag===5||a.tag===6)t.appendChild(a.stateNode);else if(a.tag!==4&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return;a=a.return}a.sibling.return=a.return,a=a.sibling}},mc=function(){},p0=function(t,r,a,f){var g=t.memoizedProps;if(g!==f){t=r.stateNode,Ai(or.current);var w=null;switch(a){case"input":g=Me(t,g),f=Me(t,f),w=[];break;case"select":g=G({},g,{value:void 0}),f=G({},f,{value:void 0}),w=[];break;case"textarea":g=We(t,g),f=We(t,f),w=[];break;default:typeof g.onClick!="function"&&typeof f.onClick=="function"&&(t.onclick=_a)}bt(a,f);var T;a=null;for(ie in g)if(!f.hasOwnProperty(ie)&&g.hasOwnProperty(ie)&&g[ie]!=null)if(ie==="style"){var D=g[ie];for(T in D)D.hasOwnProperty(T)&&(a||(a={}),a[T]="")}else ie!=="dangerouslySetInnerHTML"&&ie!=="children"&&ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&ie!=="autoFocus"&&(o.hasOwnProperty(ie)?w||(w=[]):(w=w||[]).push(ie,null));for(ie in f){var H=f[ie];if(D=g!=null?g[ie]:void 0,f.hasOwnProperty(ie)&&H!==D&&(H!=null||D!=null))if(ie==="style")if(D){for(T in D)!D.hasOwnProperty(T)||H&&H.hasOwnProperty(T)||(a||(a={}),a[T]="");for(T in H)H.hasOwnProperty(T)&&D[T]!==H[T]&&(a||(a={}),a[T]=H[T])}else a||(w||(w=[]),w.push(ie,a)),a=H;else ie==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,D=D?D.__html:void 0,H!=null&&D!==H&&(w=w||[]).push(ie,H)):ie==="children"?typeof H!="string"&&typeof H!="number"||(w=w||[]).push(ie,""+H):ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&(o.hasOwnProperty(ie)?(H!=null&&ie==="onScroll"&&it("scroll",t),w||D===H||(w=[])):(w=w||[]).push(ie,H))}a&&(w=w||[]).push("style",a);var ie=w;(r.updateQueue=ie)&&(r.flags|=4)}},m0=function(t,r,a,f){a!==f&&(r.flags|=4)};function ko(t,r){if(!ot)switch(t.tailMode){case"hidden":r=t.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var f=null;a!==null;)a.alternate!==null&&(f=a),a=a.sibling;f===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:f.sibling=null}}function Wt(t){var r=t.alternate!==null&&t.alternate.child===t.child,a=0,f=0;if(r)for(var g=t.child;g!==null;)a|=g.lanes|g.childLanes,f|=g.subtreeFlags&14680064,f|=g.flags&14680064,g.return=t,g=g.sibling;else for(g=t.child;g!==null;)a|=g.lanes|g.childLanes,f|=g.subtreeFlags,f|=g.flags,g.return=t,g=g.sibling;return t.subtreeFlags|=f,t.childLanes=a,r}function SR(t,r,a){var f=r.pendingProps;switch(Lu(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wt(r),null;case 1:return on(r.type)&&ba(),Wt(r),null;case 3:return f=r.stateNode,bs(),st(sn),st(Ht),Xu(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(t===null||t.child===null)&&(Ra(r)?r.flags|=4:t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Un!==null&&(Nc(Un),Un=null))),mc(t,r),Wt(r),null;case 5:Yu(r);var g=Ai(wo.current);if(a=r.type,t!==null&&r.stateNode!=null)p0(t,r,a,f,g),t.ref!==r.ref&&(r.flags|=512,r.flags|=2097152);else{if(!f){if(r.stateNode===null)throw Error(i(166));return Wt(r),null}if(t=Ai(or.current),Ra(r)){f=r.stateNode,a=r.type;var w=r.memoizedProps;switch(f[sr]=r,f[po]=w,t=(r.mode&1)!==0,a){case"dialog":it("cancel",f),it("close",f);break;case"iframe":case"object":case"embed":it("load",f);break;case"video":case"audio":for(g=0;g<co.length;g++)it(co[g],f);break;case"source":it("error",f);break;case"img":case"image":case"link":it("error",f),it("load",f);break;case"details":it("toggle",f);break;case"input":ke(f,w),it("invalid",f);break;case"select":f._wrapperState={wasMultiple:!!w.multiple},it("invalid",f);break;case"textarea":$e(f,w),it("invalid",f)}bt(a,w),g=null;for(var T in w)if(w.hasOwnProperty(T)){var D=w[T];T==="children"?typeof D=="string"?f.textContent!==D&&(w.suppressHydrationWarning!==!0&&xa(f.textContent,D,t),g=["children",D]):typeof D=="number"&&f.textContent!==""+D&&(w.suppressHydrationWarning!==!0&&xa(f.textContent,D,t),g=["children",""+D]):o.hasOwnProperty(T)&&D!=null&&T==="onScroll"&&it("scroll",f)}switch(a){case"input":Ae(f),ye(f,w,!0);break;case"textarea":Ae(f),yt(f);break;case"select":case"option":break;default:typeof w.onClick=="function"&&(f.onclick=_a)}f=g,r.updateQueue=f,f!==null&&(r.flags|=4)}else{T=g.nodeType===9?g:g.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=et(a)),t==="http://www.w3.org/1999/xhtml"?a==="script"?(t=T.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof f.is=="string"?t=T.createElement(a,{is:f.is}):(t=T.createElement(a),a==="select"&&(T=t,f.multiple?T.multiple=!0:f.size&&(T.size=f.size))):t=T.createElementNS(t,a),t[sr]=r,t[po]=f,h0(t,r,!1,!1),r.stateNode=t;e:{switch(T=jt(a,f),a){case"dialog":it("cancel",t),it("close",t),g=f;break;case"iframe":case"object":case"embed":it("load",t),g=f;break;case"video":case"audio":for(g=0;g<co.length;g++)it(co[g],t);g=f;break;case"source":it("error",t),g=f;break;case"img":case"image":case"link":it("error",t),it("load",t),g=f;break;case"details":it("toggle",t),g=f;break;case"input":ke(t,f),g=Me(t,f),it("invalid",t);break;case"option":g=f;break;case"select":t._wrapperState={wasMultiple:!!f.multiple},g=G({},f,{value:void 0}),it("invalid",t);break;case"textarea":$e(t,f),g=We(t,f),it("invalid",t);break;default:g=f}bt(a,g),D=g;for(w in D)if(D.hasOwnProperty(w)){var H=D[w];w==="style"?mt(t,H):w==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,H!=null&&Tt(t,H)):w==="children"?typeof H=="string"?(a!=="textarea"||H!=="")&&Ft(t,H):typeof H=="number"&&Ft(t,""+H):w!=="suppressContentEditableWarning"&&w!=="suppressHydrationWarning"&&w!=="autoFocus"&&(o.hasOwnProperty(w)?H!=null&&w==="onScroll"&&it("scroll",t):H!=null&&E(t,w,H,T))}switch(a){case"input":Ae(t),ye(t,f,!1);break;case"textarea":Ae(t),yt(t);break;case"option":f.value!=null&&t.setAttribute("value",""+oe(f.value));break;case"select":t.multiple=!!f.multiple,w=f.value,w!=null?Qe(t,!!f.multiple,w,!1):f.defaultValue!=null&&Qe(t,!!f.multiple,f.defaultValue,!0);break;default:typeof g.onClick=="function"&&(t.onclick=_a)}switch(a){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}}f&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return Wt(r),null;case 6:if(t&&r.stateNode!=null)m0(t,r,t.memoizedProps,f);else{if(typeof f!="string"&&r.stateNode===null)throw Error(i(166));if(a=Ai(wo.current),Ai(or.current),Ra(r)){if(f=r.stateNode,a=r.memoizedProps,f[sr]=r,(w=f.nodeValue!==a)&&(t=mn,t!==null))switch(t.tag){case 3:xa(f.nodeValue,a,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&xa(f.nodeValue,a,(t.mode&1)!==0)}w&&(r.flags|=4)}else f=(a.nodeType===9?a:a.ownerDocument).createTextNode(f),f[sr]=r,r.stateNode=f}return Wt(r),null;case 13:if(st(ct),f=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(ot&&gn!==null&&(r.mode&1)!==0&&(r.flags&128)===0)yy(),ws(),r.flags|=98560,w=!1;else if(w=Ra(r),f!==null&&f.dehydrated!==null){if(t===null){if(!w)throw Error(i(318));if(w=r.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(i(317));w[sr]=r}else ws(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Wt(r),w=!1}else Un!==null&&(Nc(Un),Un=null),w=!0;if(!w)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=a,r):(f=f!==null,f!==(t!==null&&t.memoizedState!==null)&&f&&(r.child.flags|=8192,(r.mode&1)!==0&&(t===null||(ct.current&1)!==0?Nt===0&&(Nt=3):Tc())),r.updateQueue!==null&&(r.flags|=4),Wt(r),null);case 4:return bs(),mc(t,r),t===null&&fo(r.stateNode.containerInfo),Wt(r),null;case 10:return Uu(r.type._context),Wt(r),null;case 17:return on(r.type)&&ba(),Wt(r),null;case 19:if(st(ct),w=r.memoizedState,w===null)return Wt(r),null;if(f=(r.flags&128)!==0,T=w.rendering,T===null)if(f)ko(w,!1);else{if(Nt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(T=Pa(t),T!==null){for(r.flags|=128,ko(w,!1),f=T.updateQueue,f!==null&&(r.updateQueue=f,r.flags|=4),r.subtreeFlags=0,f=a,a=r.child;a!==null;)w=a,t=f,w.flags&=14680066,T=w.alternate,T===null?(w.childLanes=0,w.lanes=t,w.child=null,w.subtreeFlags=0,w.memoizedProps=null,w.memoizedState=null,w.updateQueue=null,w.dependencies=null,w.stateNode=null):(w.childLanes=T.childLanes,w.lanes=T.lanes,w.child=T.child,w.subtreeFlags=0,w.deletions=null,w.memoizedProps=T.memoizedProps,w.memoizedState=T.memoizedState,w.updateQueue=T.updateQueue,w.type=T.type,t=T.dependencies,w.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),a=a.sibling;return nt(ct,ct.current&1|2),r.child}t=t.sibling}w.tail!==null&&rt()>Cs&&(r.flags|=128,f=!0,ko(w,!1),r.lanes=4194304)}else{if(!f)if(t=Pa(T),t!==null){if(r.flags|=128,f=!0,a=t.updateQueue,a!==null&&(r.updateQueue=a,r.flags|=4),ko(w,!0),w.tail===null&&w.tailMode==="hidden"&&!T.alternate&&!ot)return Wt(r),null}else 2*rt()-w.renderingStartTime>Cs&&a!==1073741824&&(r.flags|=128,f=!0,ko(w,!1),r.lanes=4194304);w.isBackwards?(T.sibling=r.child,r.child=T):(a=w.last,a!==null?a.sibling=T:r.child=T,w.last=T)}return w.tail!==null?(r=w.tail,w.rendering=r,w.tail=r.sibling,w.renderingStartTime=rt(),r.sibling=null,a=ct.current,nt(ct,f?a&1|2:a&1),r):(Wt(r),null);case 22:case 23:return Rc(),f=r.memoizedState!==null,t!==null&&t.memoizedState!==null!==f&&(r.flags|=8192),f&&(r.mode&1)!==0?(vn&1073741824)!==0&&(Wt(r),r.subtreeFlags&6&&(r.flags|=8192)):Wt(r),null;case 24:return null;case 25:return null}throw Error(i(156,r.tag))}function bR(t,r){switch(Lu(r),r.tag){case 1:return on(r.type)&&ba(),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return bs(),st(sn),st(Ht),Xu(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 5:return Yu(r),null;case 13:if(st(ct),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(i(340));ws()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return st(ct),null;case 4:return bs(),null;case 10:return Uu(r.type._context),null;case 22:case 23:return Rc(),null;case 24:return null;default:return null}}var Ua=!1,Gt=!1,kR=typeof WeakSet=="function"?WeakSet:Set,Se=null;function Es(t,r){var a=t.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(f){ht(t,r,f)}else a.current=null}function gc(t,r,a){try{a()}catch(f){ht(t,r,f)}}var g0=!1;function ER(t,r){if(Ru=Pe,t=Yv(),xu(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var f=a.getSelection&&a.getSelection();if(f&&f.rangeCount!==0){a=f.anchorNode;var g=f.anchorOffset,w=f.focusNode;f=f.focusOffset;try{a.nodeType,w.nodeType}catch{a=null;break e}var T=0,D=-1,H=-1,ie=0,fe=0,he=t,ce=null;t:for(;;){for(var _e;he!==a||g!==0&&he.nodeType!==3||(D=T+g),he!==w||f!==0&&he.nodeType!==3||(H=T+f),he.nodeType===3&&(T+=he.nodeValue.length),(_e=he.firstChild)!==null;)ce=he,he=_e;for(;;){if(he===t)break t;if(ce===a&&++ie===g&&(D=T),ce===w&&++fe===f&&(H=T),(_e=he.nextSibling)!==null)break;he=ce,ce=he.parentNode}he=_e}a=D===-1||H===-1?null:{start:D,end:H}}else a=null}a=a||{start:0,end:0}}else a=null;for(Tu={focusedElem:t,selectionRange:a},Pe=!1,Se=r;Se!==null;)if(r=Se,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Se=t;else for(;Se!==null;){r=Se;try{var be=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(be!==null){var Ee=be.memoizedProps,vt=be.memoizedState,te=r.stateNode,Y=te.getSnapshotBeforeUpdate(r.elementType===r.type?Ee:Hn(r.type,Ee),vt);te.__reactInternalSnapshotBeforeUpdate=Y}break;case 3:var re=r.stateNode.containerInfo;re.nodeType===1?re.textContent="":re.nodeType===9&&re.documentElement&&re.removeChild(re.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(me){ht(r,r.return,me)}if(t=r.sibling,t!==null){t.return=r.return,Se=t;break}Se=r.return}return be=g0,g0=!1,be}function Eo(t,r,a){var f=r.updateQueue;if(f=f!==null?f.lastEffect:null,f!==null){var g=f=f.next;do{if((g.tag&t)===t){var w=g.destroy;g.destroy=void 0,w!==void 0&&gc(r,a,w)}g=g.next}while(g!==f)}}function Ha(t,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&t)===t){var f=a.create;a.destroy=f()}a=a.next}while(a!==r)}}function vc(t){var r=t.ref;if(r!==null){var a=t.stateNode;switch(t.tag){case 5:t=a;break;default:t=a}typeof r=="function"?r(t):r.current=t}}function v0(t){var r=t.alternate;r!==null&&(t.alternate=null,v0(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&(delete r[sr],delete r[po],delete r[Mu],delete r[aR],delete r[lR])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function y0(t){return t.tag===5||t.tag===3||t.tag===4}function w0(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||y0(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function yc(t,r,a){var f=t.tag;if(f===5||f===6)t=t.stateNode,r?a.nodeType===8?a.parentNode.insertBefore(t,r):a.insertBefore(t,r):(a.nodeType===8?(r=a.parentNode,r.insertBefore(t,a)):(r=a,r.appendChild(t)),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=_a));else if(f!==4&&(t=t.child,t!==null))for(yc(t,r,a),t=t.sibling;t!==null;)yc(t,r,a),t=t.sibling}function wc(t,r,a){var f=t.tag;if(f===5||f===6)t=t.stateNode,r?a.insertBefore(t,r):a.appendChild(t);else if(f!==4&&(t=t.child,t!==null))for(wc(t,r,a),t=t.sibling;t!==null;)wc(t,r,a),t=t.sibling}var Lt=null,Vn=!1;function ei(t,r,a){for(a=a.child;a!==null;)x0(t,r,a),a=a.sibling}function x0(t,r,a){if(Bt&&typeof Bt.onCommitFiberUnmount=="function")try{Bt.onCommitFiberUnmount(Sn,a)}catch{}switch(a.tag){case 5:Gt||Es(a,r);case 6:var f=Lt,g=Vn;Lt=null,ei(t,r,a),Lt=f,Vn=g,Lt!==null&&(Vn?(t=Lt,a=a.stateNode,t.nodeType===8?t.parentNode.removeChild(a):t.removeChild(a)):Lt.removeChild(a.stateNode));break;case 18:Lt!==null&&(Vn?(t=Lt,a=a.stateNode,t.nodeType===8?Iu(t.parentNode,a):t.nodeType===1&&Iu(t,a),we(t)):Iu(Lt,a.stateNode));break;case 4:f=Lt,g=Vn,Lt=a.stateNode.containerInfo,Vn=!0,ei(t,r,a),Lt=f,Vn=g;break;case 0:case 11:case 14:case 15:if(!Gt&&(f=a.updateQueue,f!==null&&(f=f.lastEffect,f!==null))){g=f=f.next;do{var w=g,T=w.destroy;w=w.tag,T!==void 0&&((w&2)!==0||(w&4)!==0)&&gc(a,r,T),g=g.next}while(g!==f)}ei(t,r,a);break;case 1:if(!Gt&&(Es(a,r),f=a.stateNode,typeof f.componentWillUnmount=="function"))try{f.props=a.memoizedProps,f.state=a.memoizedState,f.componentWillUnmount()}catch(D){ht(a,r,D)}ei(t,r,a);break;case 21:ei(t,r,a);break;case 22:a.mode&1?(Gt=(f=Gt)||a.memoizedState!==null,ei(t,r,a),Gt=f):ei(t,r,a);break;default:ei(t,r,a)}}function _0(t){var r=t.updateQueue;if(r!==null){t.updateQueue=null;var a=t.stateNode;a===null&&(a=t.stateNode=new kR),r.forEach(function(f){var g=PR.bind(null,t,f);a.has(f)||(a.add(f),f.then(g,g))})}}function Wn(t,r){var a=r.deletions;if(a!==null)for(var f=0;f<a.length;f++){var g=a[f];try{var w=t,T=r,D=T;e:for(;D!==null;){switch(D.tag){case 5:Lt=D.stateNode,Vn=!1;break e;case 3:Lt=D.stateNode.containerInfo,Vn=!0;break e;case 4:Lt=D.stateNode.containerInfo,Vn=!0;break e}D=D.return}if(Lt===null)throw Error(i(160));x0(w,T,g),Lt=null,Vn=!1;var H=g.alternate;H!==null&&(H.return=null),g.return=null}catch(ie){ht(g,r,ie)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)S0(r,t),r=r.sibling}function S0(t,r){var a=t.alternate,f=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Wn(r,t),lr(t),f&4){try{Eo(3,t,t.return),Ha(3,t)}catch(Ee){ht(t,t.return,Ee)}try{Eo(5,t,t.return)}catch(Ee){ht(t,t.return,Ee)}}break;case 1:Wn(r,t),lr(t),f&512&&a!==null&&Es(a,a.return);break;case 5:if(Wn(r,t),lr(t),f&512&&a!==null&&Es(a,a.return),t.flags&32){var g=t.stateNode;try{Ft(g,"")}catch(Ee){ht(t,t.return,Ee)}}if(f&4&&(g=t.stateNode,g!=null)){var w=t.memoizedProps,T=a!==null?a.memoizedProps:w,D=t.type,H=t.updateQueue;if(t.updateQueue=null,H!==null)try{D==="input"&&w.type==="radio"&&w.name!=null&&He(g,w),jt(D,T);var ie=jt(D,w);for(T=0;T<H.length;T+=2){var fe=H[T],he=H[T+1];fe==="style"?mt(g,he):fe==="dangerouslySetInnerHTML"?Tt(g,he):fe==="children"?Ft(g,he):E(g,fe,he,ie)}switch(D){case"input":ve(g,w);break;case"textarea":Ke(g,w);break;case"select":var ce=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!w.multiple;var _e=w.value;_e!=null?Qe(g,!!w.multiple,_e,!1):ce!==!!w.multiple&&(w.defaultValue!=null?Qe(g,!!w.multiple,w.defaultValue,!0):Qe(g,!!w.multiple,w.multiple?[]:"",!1))}g[po]=w}catch(Ee){ht(t,t.return,Ee)}}break;case 6:if(Wn(r,t),lr(t),f&4){if(t.stateNode===null)throw Error(i(162));g=t.stateNode,w=t.memoizedProps;try{g.nodeValue=w}catch(Ee){ht(t,t.return,Ee)}}break;case 3:if(Wn(r,t),lr(t),f&4&&a!==null&&a.memoizedState.isDehydrated)try{we(r.containerInfo)}catch(Ee){ht(t,t.return,Ee)}break;case 4:Wn(r,t),lr(t);break;case 13:Wn(r,t),lr(t),g=t.child,g.flags&8192&&(w=g.memoizedState!==null,g.stateNode.isHidden=w,!w||g.alternate!==null&&g.alternate.memoizedState!==null||(Sc=rt())),f&4&&_0(t);break;case 22:if(fe=a!==null&&a.memoizedState!==null,t.mode&1?(Gt=(ie=Gt)||fe,Wn(r,t),Gt=ie):Wn(r,t),lr(t),f&8192){if(ie=t.memoizedState!==null,(t.stateNode.isHidden=ie)&&!fe&&(t.mode&1)!==0)for(Se=t,fe=t.child;fe!==null;){for(he=Se=fe;Se!==null;){switch(ce=Se,_e=ce.child,ce.tag){case 0:case 11:case 14:case 15:Eo(4,ce,ce.return);break;case 1:Es(ce,ce.return);var be=ce.stateNode;if(typeof be.componentWillUnmount=="function"){f=ce,a=ce.return;try{r=f,be.props=r.memoizedProps,be.state=r.memoizedState,be.componentWillUnmount()}catch(Ee){ht(f,a,Ee)}}break;case 5:Es(ce,ce.return);break;case 22:if(ce.memoizedState!==null){E0(he);continue}}_e!==null?(_e.return=ce,Se=_e):E0(he)}fe=fe.sibling}e:for(fe=null,he=t;;){if(he.tag===5){if(fe===null){fe=he;try{g=he.stateNode,ie?(w=g.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none"):(D=he.stateNode,H=he.memoizedProps.style,T=H!=null&&H.hasOwnProperty("display")?H.display:null,D.style.display=lt("display",T))}catch(Ee){ht(t,t.return,Ee)}}}else if(he.tag===6){if(fe===null)try{he.stateNode.nodeValue=ie?"":he.memoizedProps}catch(Ee){ht(t,t.return,Ee)}}else if((he.tag!==22&&he.tag!==23||he.memoizedState===null||he===t)&&he.child!==null){he.child.return=he,he=he.child;continue}if(he===t)break e;for(;he.sibling===null;){if(he.return===null||he.return===t)break e;fe===he&&(fe=null),he=he.return}fe===he&&(fe=null),he.sibling.return=he.return,he=he.sibling}}break;case 19:Wn(r,t),lr(t),f&4&&_0(t);break;case 21:break;default:Wn(r,t),lr(t)}}function lr(t){var r=t.flags;if(r&2){try{e:{for(var a=t.return;a!==null;){if(y0(a)){var f=a;break e}a=a.return}throw Error(i(160))}switch(f.tag){case 5:var g=f.stateNode;f.flags&32&&(Ft(g,""),f.flags&=-33);var w=w0(t);wc(t,w,g);break;case 3:case 4:var T=f.stateNode.containerInfo,D=w0(t);yc(t,D,T);break;default:throw Error(i(161))}}catch(H){ht(t,t.return,H)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function NR(t,r,a){Se=t,b0(t)}function b0(t,r,a){for(var f=(t.mode&1)!==0;Se!==null;){var g=Se,w=g.child;if(g.tag===22&&f){var T=g.memoizedState!==null||Ua;if(!T){var D=g.alternate,H=D!==null&&D.memoizedState!==null||Gt;D=Ua;var ie=Gt;if(Ua=T,(Gt=H)&&!ie)for(Se=g;Se!==null;)T=Se,H=T.child,T.tag===22&&T.memoizedState!==null?N0(g):H!==null?(H.return=T,Se=H):N0(g);for(;w!==null;)Se=w,b0(w),w=w.sibling;Se=g,Ua=D,Gt=ie}k0(t)}else(g.subtreeFlags&8772)!==0&&w!==null?(w.return=g,Se=w):k0(t)}}function k0(t){for(;Se!==null;){var r=Se;if((r.flags&8772)!==0){var a=r.alternate;try{if((r.flags&8772)!==0)switch(r.tag){case 0:case 11:case 15:Gt||Ha(5,r);break;case 1:var f=r.stateNode;if(r.flags&4&&!Gt)if(a===null)f.componentDidMount();else{var g=r.elementType===r.type?a.memoizedProps:Hn(r.type,a.memoizedProps);f.componentDidUpdate(g,a.memoizedState,f.__reactInternalSnapshotBeforeUpdate)}var w=r.updateQueue;w!==null&&Ey(r,w,f);break;case 3:var T=r.updateQueue;if(T!==null){if(a=null,r.child!==null)switch(r.child.tag){case 5:a=r.child.stateNode;break;case 1:a=r.child.stateNode}Ey(r,T,a)}break;case 5:var D=r.stateNode;if(a===null&&r.flags&4){a=D;var H=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":H.autoFocus&&a.focus();break;case"img":H.src&&(a.src=H.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var ie=r.alternate;if(ie!==null){var fe=ie.memoizedState;if(fe!==null){var he=fe.dehydrated;he!==null&&we(he)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}Gt||r.flags&512&&vc(r)}catch(ce){ht(r,r.return,ce)}}if(r===t){Se=null;break}if(a=r.sibling,a!==null){a.return=r.return,Se=a;break}Se=r.return}}function E0(t){for(;Se!==null;){var r=Se;if(r===t){Se=null;break}var a=r.sibling;if(a!==null){a.return=r.return,Se=a;break}Se=r.return}}function N0(t){for(;Se!==null;){var r=Se;try{switch(r.tag){case 0:case 11:case 15:var a=r.return;try{Ha(4,r)}catch(H){ht(r,a,H)}break;case 1:var f=r.stateNode;if(typeof f.componentDidMount=="function"){var g=r.return;try{f.componentDidMount()}catch(H){ht(r,g,H)}}var w=r.return;try{vc(r)}catch(H){ht(r,w,H)}break;case 5:var T=r.return;try{vc(r)}catch(H){ht(r,T,H)}}}catch(H){ht(r,r.return,H)}if(r===t){Se=null;break}var D=r.sibling;if(D!==null){D.return=r.return,Se=D;break}Se=r.return}}var CR=Math.ceil,Va=C.ReactCurrentDispatcher,xc=C.ReactCurrentOwner,jn=C.ReactCurrentBatchConfig,De=0,Pt=null,_t=null,$t=0,vn=0,Ns=Kr(0),Nt=0,No=null,Mi=0,Wa=0,_c=0,Co=null,ln=null,Sc=0,Cs=1/0,Er=null,Ga=!1,bc=null,ti=null,Ya=!1,ni=null,Ka=0,Ro=0,kc=null,Xa=-1,Qa=0;function Xt(){return(De&6)!==0?rt():Xa!==-1?Xa:Xa=rt()}function ri(t){return(t.mode&1)===0?1:(De&2)!==0&&$t!==0?$t&-$t:cR.transition!==null?(Qa===0&&(Qa=ua()),Qa):(t=Ue,t!==0||(t=window.event,t=t===void 0?16:Vr(t.type)),t)}function Gn(t,r,a,f){if(50<Ro)throw Ro=0,kc=null,Error(i(185));Br(t,a,f),((De&2)===0||t!==Pt)&&(t===Pt&&((De&2)===0&&(Wa|=a),Nt===4&&ii(t,$t)),un(t,f),a===1&&De===0&&(r.mode&1)===0&&(Cs=rt()+500,Ea&&Qr()))}function un(t,r){var a=t.callbackNode;Ks(t,r);var f=zr(t,t===Pt?$t:0);if(f===0)a!==null&&$r(a),t.callbackNode=null,t.callbackPriority=0;else if(r=f&-f,t.callbackPriority!==r){if(a!=null&&$r(a),r===1)t.tag===0?uR(R0.bind(null,t)):hy(R0.bind(null,t)),sR(function(){(De&6)===0&&Qr()}),a=null;else{switch(Qs(f)){case 1:a=Dr;break;case 4:a=is;break;case 16:a=kt;break;case 536870912:a=Fn;break;default:a=kt}a=q0(a,C0.bind(null,t))}t.callbackPriority=r,t.callbackNode=a}}function C0(t,r){if(Xa=-1,Qa=0,(De&6)!==0)throw Error(i(327));var a=t.callbackNode;if(Rs()&&t.callbackNode!==a)return null;var f=zr(t,t===Pt?$t:0);if(f===0)return null;if((f&30)!==0||(f&t.expiredLanes)!==0||r)r=Za(t,f);else{r=f;var g=De;De|=2;var w=j0();(Pt!==t||$t!==r)&&(Er=null,Cs=rt()+500,Oi(t,r));do try{jR();break}catch(D){T0(t,D)}while(!0);Bu(),Va.current=w,De=g,_t!==null?r=0:(Pt=null,$t=0,r=Nt)}if(r!==0){if(r===2&&(g=as(t),g!==0&&(f=g,r=Ec(t,g))),r===1)throw a=No,Oi(t,0),ii(t,f),un(t,rt()),a;if(r===6)ii(t,f);else{if(g=t.current.alternate,(f&30)===0&&!RR(g)&&(r=Za(t,f),r===2&&(w=as(t),w!==0&&(f=w,r=Ec(t,w))),r===1))throw a=No,Oi(t,0),ii(t,f),un(t,rt()),a;switch(t.finishedWork=g,t.finishedLanes=f,r){case 0:case 1:throw Error(i(345));case 2:qi(t,ln,Er);break;case 3:if(ii(t,f),(f&130023424)===f&&(r=Sc+500-rt(),10<r)){if(zr(t,0)!==0)break;if(g=t.suspendedLanes,(g&f)!==f){Xt(),t.pingedLanes|=t.suspendedLanes&g;break}t.timeoutHandle=Au(qi.bind(null,t,ln,Er),r);break}qi(t,ln,Er);break;case 4:if(ii(t,f),(f&4194240)===f)break;for(r=t.eventTimes,g=-1;0<f;){var T=31-Jt(f);w=1<<T,T=r[T],T>g&&(g=T),f&=~w}if(f=g,f=rt()-f,f=(120>f?120:480>f?480:1080>f?1080:1920>f?1920:3e3>f?3e3:4320>f?4320:1960*CR(f/1960))-f,10<f){t.timeoutHandle=Au(qi.bind(null,t,ln,Er),f);break}qi(t,ln,Er);break;case 5:qi(t,ln,Er);break;default:throw Error(i(329))}}}return un(t,rt()),t.callbackNode===a?C0.bind(null,t):null}function Ec(t,r){var a=Co;return t.current.memoizedState.isDehydrated&&(Oi(t,r).flags|=256),t=Za(t,r),t!==2&&(r=ln,ln=a,r!==null&&Nc(r)),t}function Nc(t){ln===null?ln=t:ln.push.apply(ln,t)}function RR(t){for(var r=t;;){if(r.flags&16384){var a=r.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var f=0;f<a.length;f++){var g=a[f],w=g.getSnapshot;g=g.value;try{if(!Bn(w(),g))return!1}catch{return!1}}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function ii(t,r){for(r&=~_c,r&=~Wa,t.suspendedLanes|=r,t.pingedLanes&=~r,t=t.expirationTimes;0<r;){var a=31-Jt(r),f=1<<a;t[a]=-1,r&=~f}}function R0(t){if((De&6)!==0)throw Error(i(327));Rs();var r=zr(t,0);if((r&1)===0)return un(t,rt()),null;var a=Za(t,r);if(t.tag!==0&&a===2){var f=as(t);f!==0&&(r=f,a=Ec(t,f))}if(a===1)throw a=No,Oi(t,0),ii(t,r),un(t,rt()),a;if(a===6)throw Error(i(345));return t.finishedWork=t.current.alternate,t.finishedLanes=r,qi(t,ln,Er),un(t,rt()),null}function Cc(t,r){var a=De;De|=1;try{return t(r)}finally{De=a,De===0&&(Cs=rt()+500,Ea&&Qr())}}function Pi(t){ni!==null&&ni.tag===0&&(De&6)===0&&Rs();var r=De;De|=1;var a=jn.transition,f=Ue;try{if(jn.transition=null,Ue=1,t)return t()}finally{Ue=f,jn.transition=a,De=r,(De&6)===0&&Qr()}}function Rc(){vn=Ns.current,st(Ns)}function Oi(t,r){t.finishedWork=null,t.finishedLanes=0;var a=t.timeoutHandle;if(a!==-1&&(t.timeoutHandle=-1,iR(a)),_t!==null)for(a=_t.return;a!==null;){var f=a;switch(Lu(f),f.tag){case 1:f=f.type.childContextTypes,f!=null&&ba();break;case 3:bs(),st(sn),st(Ht),Xu();break;case 5:Yu(f);break;case 4:bs();break;case 13:st(ct);break;case 19:st(ct);break;case 10:Uu(f.type._context);break;case 22:case 23:Rc()}a=a.return}if(Pt=t,_t=t=si(t.current,null),$t=vn=r,Nt=0,No=null,_c=Wa=Mi=0,ln=Co=null,ji!==null){for(r=0;r<ji.length;r++)if(a=ji[r],f=a.interleaved,f!==null){a.interleaved=null;var g=f.next,w=a.pending;if(w!==null){var T=w.next;w.next=g,f.next=T}a.pending=f}ji=null}return t}function T0(t,r){do{var a=_t;try{if(Bu(),Oa.current=Da,qa){for(var f=ft.memoizedState;f!==null;){var g=f.queue;g!==null&&(g.pending=null),f=f.next}qa=!1}if(Ii=0,Mt=Et=ft=null,xo=!1,_o=0,xc.current=null,a===null||a.return===null){Nt=1,No=r,_t=null;break}e:{var w=t,T=a.return,D=a,H=r;if(r=$t,D.flags|=32768,H!==null&&typeof H=="object"&&typeof H.then=="function"){var ie=H,fe=D,he=fe.tag;if((fe.mode&1)===0&&(he===0||he===11||he===15)){var ce=fe.alternate;ce?(fe.updateQueue=ce.updateQueue,fe.memoizedState=ce.memoizedState,fe.lanes=ce.lanes):(fe.updateQueue=null,fe.memoizedState=null)}var _e=e0(T);if(_e!==null){_e.flags&=-257,t0(_e,T,D,w,r),_e.mode&1&&Jy(w,ie,r),r=_e,H=ie;var be=r.updateQueue;if(be===null){var Ee=new Set;Ee.add(H),r.updateQueue=Ee}else be.add(H);break e}else{if((r&1)===0){Jy(w,ie,r),Tc();break e}H=Error(i(426))}}else if(ot&&D.mode&1){var vt=e0(T);if(vt!==null){(vt.flags&65536)===0&&(vt.flags|=256),t0(vt,T,D,w,r),Fu(ks(H,D));break e}}w=H=ks(H,D),Nt!==4&&(Nt=2),Co===null?Co=[w]:Co.push(w),w=T;do{switch(w.tag){case 3:w.flags|=65536,r&=-r,w.lanes|=r;var te=Qy(w,H,r);ky(w,te);break e;case 1:D=H;var Y=w.type,re=w.stateNode;if((w.flags&128)===0&&(typeof Y.getDerivedStateFromError=="function"||re!==null&&typeof re.componentDidCatch=="function"&&(ti===null||!ti.has(re)))){w.flags|=65536,r&=-r,w.lanes|=r;var me=Zy(w,D,r);ky(w,me);break e}}w=w.return}while(w!==null)}I0(a)}catch(Ne){r=Ne,_t===a&&a!==null&&(_t=a=a.return);continue}break}while(!0)}function j0(){var t=Va.current;return Va.current=Da,t===null?Da:t}function Tc(){(Nt===0||Nt===3||Nt===2)&&(Nt=4),Pt===null||(Mi&268435455)===0&&(Wa&268435455)===0||ii(Pt,$t)}function Za(t,r){var a=De;De|=2;var f=j0();(Pt!==t||$t!==r)&&(Er=null,Oi(t,r));do try{TR();break}catch(g){T0(t,g)}while(!0);if(Bu(),De=a,Va.current=f,_t!==null)throw Error(i(261));return Pt=null,$t=0,Nt}function TR(){for(;_t!==null;)A0(_t)}function jR(){for(;_t!==null&&!Dn();)A0(_t)}function A0(t){var r=O0(t.alternate,t,vn);t.memoizedProps=t.pendingProps,r===null?I0(t):_t=r,xc.current=null}function I0(t){var r=t;do{var a=r.alternate;if(t=r.return,(r.flags&32768)===0){if(a=SR(a,r,vn),a!==null){_t=a;return}}else{if(a=bR(a,r),a!==null){a.flags&=32767,_t=a;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Nt=6,_t=null;return}}if(r=r.sibling,r!==null){_t=r;return}_t=r=t}while(r!==null);Nt===0&&(Nt=5)}function qi(t,r,a){var f=Ue,g=jn.transition;try{jn.transition=null,Ue=1,AR(t,r,a,f)}finally{jn.transition=g,Ue=f}return null}function AR(t,r,a,f){do Rs();while(ni!==null);if((De&6)!==0)throw Error(i(327));a=t.finishedWork;var g=t.finishedLanes;if(a===null)return null;if(t.finishedWork=null,t.finishedLanes=0,a===t.current)throw Error(i(177));t.callbackNode=null,t.callbackPriority=0;var w=a.lanes|a.childLanes;if(ca(t,w),t===Pt&&(_t=Pt=null,$t=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||Ya||(Ya=!0,q0(kt,function(){return Rs(),null})),w=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||w){w=jn.transition,jn.transition=null;var T=Ue;Ue=1;var D=De;De|=4,xc.current=null,ER(t,a),S0(a,t),QC(Tu),Pe=!!Ru,Tu=Ru=null,t.current=a,NR(a),ns(),De=D,Ue=T,jn.transition=w}else t.current=a;if(Ya&&(Ya=!1,ni=t,Ka=g),w=t.pendingLanes,w===0&&(ti=null),hr(a.stateNode),un(t,rt()),r!==null)for(f=t.onRecoverableError,a=0;a<r.length;a++)g=r[a],f(g.value,{componentStack:g.stack,digest:g.digest});if(Ga)throw Ga=!1,t=bc,bc=null,t;return(Ka&1)!==0&&t.tag!==0&&Rs(),w=t.pendingLanes,(w&1)!==0?t===kc?Ro++:(Ro=0,kc=t):Ro=0,Qr(),null}function Rs(){if(ni!==null){var t=Qs(Ka),r=jn.transition,a=Ue;try{if(jn.transition=null,Ue=16>t?16:t,ni===null)var f=!1;else{if(t=ni,ni=null,Ka=0,(De&6)!==0)throw Error(i(331));var g=De;for(De|=4,Se=t.current;Se!==null;){var w=Se,T=w.child;if((Se.flags&16)!==0){var D=w.deletions;if(D!==null){for(var H=0;H<D.length;H++){var ie=D[H];for(Se=ie;Se!==null;){var fe=Se;switch(fe.tag){case 0:case 11:case 15:Eo(8,fe,w)}var he=fe.child;if(he!==null)he.return=fe,Se=he;else for(;Se!==null;){fe=Se;var ce=fe.sibling,_e=fe.return;if(v0(fe),fe===ie){Se=null;break}if(ce!==null){ce.return=_e,Se=ce;break}Se=_e}}}var be=w.alternate;if(be!==null){var Ee=be.child;if(Ee!==null){be.child=null;do{var vt=Ee.sibling;Ee.sibling=null,Ee=vt}while(Ee!==null)}}Se=w}}if((w.subtreeFlags&2064)!==0&&T!==null)T.return=w,Se=T;else e:for(;Se!==null;){if(w=Se,(w.flags&2048)!==0)switch(w.tag){case 0:case 11:case 15:Eo(9,w,w.return)}var te=w.sibling;if(te!==null){te.return=w.return,Se=te;break e}Se=w.return}}var Y=t.current;for(Se=Y;Se!==null;){T=Se;var re=T.child;if((T.subtreeFlags&2064)!==0&&re!==null)re.return=T,Se=re;else e:for(T=Y;Se!==null;){if(D=Se,(D.flags&2048)!==0)try{switch(D.tag){case 0:case 11:case 15:Ha(9,D)}}catch(Ne){ht(D,D.return,Ne)}if(D===T){Se=null;break e}var me=D.sibling;if(me!==null){me.return=D.return,Se=me;break e}Se=D.return}}if(De=g,Qr(),Bt&&typeof Bt.onPostCommitFiberRoot=="function")try{Bt.onPostCommitFiberRoot(Sn,t)}catch{}f=!0}return f}finally{Ue=a,jn.transition=r}}return!1}function M0(t,r,a){r=ks(a,r),r=Qy(t,r,1),t=Jr(t,r,1),r=Xt(),t!==null&&(Br(t,1,r),un(t,r))}function ht(t,r,a){if(t.tag===3)M0(t,t,a);else for(;r!==null;){if(r.tag===3){M0(r,t,a);break}else if(r.tag===1){var f=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(ti===null||!ti.has(f))){t=ks(a,t),t=Zy(r,t,1),r=Jr(r,t,1),t=Xt(),r!==null&&(Br(r,1,t),un(r,t));break}}r=r.return}}function IR(t,r,a){var f=t.pingCache;f!==null&&f.delete(r),r=Xt(),t.pingedLanes|=t.suspendedLanes&a,Pt===t&&($t&a)===a&&(Nt===4||Nt===3&&($t&130023424)===$t&&500>rt()-Sc?Oi(t,0):_c|=a),un(t,r)}function P0(t,r){r===0&&((t.mode&1)===0?r=1:(r=os,os<<=1,(os&130023424)===0&&(os=4194304)));var a=Xt();t=Sr(t,r),t!==null&&(Br(t,r,a),un(t,a))}function MR(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),P0(t,a)}function PR(t,r){var a=0;switch(t.tag){case 13:var f=t.stateNode,g=t.memoizedState;g!==null&&(a=g.retryLane);break;case 19:f=t.stateNode;break;default:throw Error(i(314))}f!==null&&f.delete(r),P0(t,a)}var O0;O0=function(t,r,a){if(t!==null)if(t.memoizedProps!==r.pendingProps||sn.current)an=!0;else{if((t.lanes&a)===0&&(r.flags&128)===0)return an=!1,_R(t,r,a);an=(t.flags&131072)!==0}else an=!1,ot&&(r.flags&1048576)!==0&&py(r,Ca,r.index);switch(r.lanes=0,r.tag){case 2:var f=r.type;Ba(t,r),t=r.pendingProps;var g=gs(r,Ht.current);Ss(r,a),g=Ju(null,r,f,t,g,a);var w=ec();return r.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,on(f)?(w=!0,ka(r)):w=!1,r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Wu(r),g.updater=Fa,r.stateNode=g,g._reactInternals=r,oc(r,f,t,a),r=cc(null,r,f,!0,w,a)):(r.tag=0,ot&&w&&qu(r),Kt(null,r,g,a),r=r.child),r;case 16:f=r.elementType;e:{switch(Ba(t,r),t=r.pendingProps,g=f._init,f=g(f._payload),r.type=f,g=r.tag=qR(f),t=Hn(f,t),g){case 0:r=uc(null,r,f,t,a);break e;case 1:r=a0(null,r,f,t,a);break e;case 11:r=n0(null,r,f,t,a);break e;case 14:r=r0(null,r,f,Hn(f.type,t),a);break e}throw Error(i(306,f,""))}return r;case 0:return f=r.type,g=r.pendingProps,g=r.elementType===f?g:Hn(f,g),uc(t,r,f,g,a);case 1:return f=r.type,g=r.pendingProps,g=r.elementType===f?g:Hn(f,g),a0(t,r,f,g,a);case 3:e:{if(l0(r),t===null)throw Error(i(387));f=r.pendingProps,w=r.memoizedState,g=w.element,by(t,r),Ma(r,f,null,a);var T=r.memoizedState;if(f=T.element,w.isDehydrated)if(w={element:f,isDehydrated:!1,cache:T.cache,pendingSuspenseBoundaries:T.pendingSuspenseBoundaries,transitions:T.transitions},r.updateQueue.baseState=w,r.memoizedState=w,r.flags&256){g=ks(Error(i(423)),r),r=u0(t,r,f,a,g);break e}else if(f!==g){g=ks(Error(i(424)),r),r=u0(t,r,f,a,g);break e}else for(gn=Yr(r.stateNode.containerInfo.firstChild),mn=r,ot=!0,Un=null,a=_y(r,null,f,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(ws(),f===g){r=kr(t,r,a);break e}Kt(t,r,f,a)}r=r.child}return r;case 5:return Ny(r),t===null&&Du(r),f=r.type,g=r.pendingProps,w=t!==null?t.memoizedProps:null,T=g.children,ju(f,g)?T=null:w!==null&&ju(f,w)&&(r.flags|=32),o0(t,r),Kt(t,r,T,a),r.child;case 6:return t===null&&Du(r),null;case 13:return c0(t,r,a);case 4:return Gu(r,r.stateNode.containerInfo),f=r.pendingProps,t===null?r.child=xs(r,null,f,a):Kt(t,r,f,a),r.child;case 11:return f=r.type,g=r.pendingProps,g=r.elementType===f?g:Hn(f,g),n0(t,r,f,g,a);case 7:return Kt(t,r,r.pendingProps,a),r.child;case 8:return Kt(t,r,r.pendingProps.children,a),r.child;case 12:return Kt(t,r,r.pendingProps.children,a),r.child;case 10:e:{if(f=r.type._context,g=r.pendingProps,w=r.memoizedProps,T=g.value,nt(ja,f._currentValue),f._currentValue=T,w!==null)if(Bn(w.value,T)){if(w.children===g.children&&!sn.current){r=kr(t,r,a);break e}}else for(w=r.child,w!==null&&(w.return=r);w!==null;){var D=w.dependencies;if(D!==null){T=w.child;for(var H=D.firstContext;H!==null;){if(H.context===f){if(w.tag===1){H=br(-1,a&-a),H.tag=2;var ie=w.updateQueue;if(ie!==null){ie=ie.shared;var fe=ie.pending;fe===null?H.next=H:(H.next=fe.next,fe.next=H),ie.pending=H}}w.lanes|=a,H=w.alternate,H!==null&&(H.lanes|=a),Hu(w.return,a,r),D.lanes|=a;break}H=H.next}}else if(w.tag===10)T=w.type===r.type?null:w.child;else if(w.tag===18){if(T=w.return,T===null)throw Error(i(341));T.lanes|=a,D=T.alternate,D!==null&&(D.lanes|=a),Hu(T,a,r),T=w.sibling}else T=w.child;if(T!==null)T.return=w;else for(T=w;T!==null;){if(T===r){T=null;break}if(w=T.sibling,w!==null){w.return=T.return,T=w;break}T=T.return}w=T}Kt(t,r,g.children,a),r=r.child}return r;case 9:return g=r.type,f=r.pendingProps.children,Ss(r,a),g=Rn(g),f=f(g),r.flags|=1,Kt(t,r,f,a),r.child;case 14:return f=r.type,g=Hn(f,r.pendingProps),g=Hn(f.type,g),r0(t,r,f,g,a);case 15:return i0(t,r,r.type,r.pendingProps,a);case 17:return f=r.type,g=r.pendingProps,g=r.elementType===f?g:Hn(f,g),Ba(t,r),r.tag=1,on(f)?(t=!0,ka(r)):t=!1,Ss(r,a),Ky(r,f,g),oc(r,f,g,a),cc(null,r,f,!0,t,a);case 19:return d0(t,r,a);case 22:return s0(t,r,a)}throw Error(i(156,r.tag))};function q0(t,r){return ts(t,r)}function OR(t,r,a,f){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function An(t,r,a,f){return new OR(t,r,a,f)}function jc(t){return t=t.prototype,!(!t||!t.isReactComponent)}function qR(t){if(typeof t=="function")return jc(t)?1:0;if(t!=null){if(t=t.$$typeof,t===J)return 11;if(t===V)return 14}return 2}function si(t,r){var a=t.alternate;return a===null?(a=An(t.tag,r,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=r,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&14680064,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,r=t.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a}function Ja(t,r,a,f,g,w){var T=2;if(f=t,typeof t=="function")jc(t)&&(T=1);else if(typeof t=="string")T=5;else e:switch(t){case L:return Li(a.children,g,w,r);case O:T=8,g|=8;break;case R:return t=An(12,a,r,g|2),t.elementType=R,t.lanes=w,t;case Q:return t=An(13,a,r,g),t.elementType=Q,t.lanes=w,t;case A:return t=An(19,a,r,g),t.elementType=A,t.lanes=w,t;case ne:return el(a,g,w,r);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case q:T=10;break e;case F:T=9;break e;case J:T=11;break e;case V:T=14;break e;case B:T=16,f=null;break e}throw Error(i(130,t==null?t:typeof t,""))}return r=An(T,a,r,g),r.elementType=t,r.type=f,r.lanes=w,r}function Li(t,r,a,f){return t=An(7,t,f,r),t.lanes=a,t}function el(t,r,a,f){return t=An(22,t,f,r),t.elementType=ne,t.lanes=a,t.stateNode={isHidden:!1},t}function Ac(t,r,a){return t=An(6,t,null,r),t.lanes=a,t}function Ic(t,r,a){return r=An(4,t.children!==null?t.children:[],t.key,r),r.lanes=a,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}function LR(t,r,a,f,g){this.tag=r,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Xs(0),this.expirationTimes=Xs(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xs(0),this.identifierPrefix=f,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Mc(t,r,a,f,g,w,T,D,H){return t=new LR(t,r,a,D,H),r===1?(r=1,w===!0&&(r|=8)):r=0,w=An(3,null,null,r),t.current=w,w.stateNode=t,w.memoizedState={element:f,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wu(w),t}function $R(t,r,a){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:P,key:f==null?null:""+f,children:t,containerInfo:r,implementation:a}}function L0(t){if(!t)return Xr;t=t._reactInternals;e:{if(Zt(t)!==t||t.tag!==1)throw Error(i(170));var r=t;do{switch(r.tag){case 3:r=r.stateNode.context;break e;case 1:if(on(r.type)){r=r.stateNode.__reactInternalMemoizedMergedChildContext;break e}}r=r.return}while(r!==null);throw Error(i(171))}if(t.tag===1){var a=t.type;if(on(a))return fy(t,a,r)}return r}function $0(t,r,a,f,g,w,T,D,H){return t=Mc(a,f,!0,t,g,w,T,D,H),t.context=L0(null),a=t.current,f=Xt(),g=ri(a),w=br(f,g),w.callback=r??null,Jr(a,w,g),t.current.lanes=g,Br(t,g,f),un(t,f),t}function tl(t,r,a,f){var g=r.current,w=Xt(),T=ri(g);return a=L0(a),r.context===null?r.context=a:r.pendingContext=a,r=br(w,T),r.payload={element:t},f=f===void 0?null:f,f!==null&&(r.callback=f),t=Jr(g,r,T),t!==null&&(Gn(t,g,T,w),Ia(t,g,T)),T}function nl(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function D0(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<r?a:r}}function Pc(t,r){D0(t,r),(t=t.alternate)&&D0(t,r)}function DR(){return null}var F0=typeof reportError=="function"?reportError:function(t){console.error(t)};function Oc(t){this._internalRoot=t}rl.prototype.render=Oc.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(i(409));tl(t,r,null,null)},rl.prototype.unmount=Oc.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;Pi(function(){tl(null,t,null,null)}),r[yr]=null}};function rl(t){this._internalRoot=t}rl.prototype.unstable_scheduleHydration=function(t){if(t){var r=Ur();t={blockedOn:null,target:t,priority:r};for(var a=0;a<ir.length&&r!==0&&r<ir[a].priority;a++);ir.splice(a,0,t),a===0&&to(t)}};function qc(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function il(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function z0(){}function FR(t,r,a,f,g){if(g){if(typeof f=="function"){var w=f;f=function(){var ie=nl(T);w.call(ie)}}var T=$0(r,f,t,0,null,!1,!1,"",z0);return t._reactRootContainer=T,t[yr]=T.current,fo(t.nodeType===8?t.parentNode:t),Pi(),T}for(;g=t.lastChild;)t.removeChild(g);if(typeof f=="function"){var D=f;f=function(){var ie=nl(H);D.call(ie)}}var H=Mc(t,0,!1,null,null,!1,!1,"",z0);return t._reactRootContainer=H,t[yr]=H.current,fo(t.nodeType===8?t.parentNode:t),Pi(function(){tl(r,H,a,f)}),H}function sl(t,r,a,f,g){var w=a._reactRootContainer;if(w){var T=w;if(typeof g=="function"){var D=g;g=function(){var H=nl(T);D.call(H)}}tl(r,T,t,g)}else T=FR(a,r,t,g,f);return nl(T)}fa=function(t){switch(t.tag){case 3:var r=t.stateNode;if(r.current.memoizedState.isDehydrated){var a=ki(r.pendingLanes);a!==0&&(en(r,a|1),un(r,rt()),(De&6)===0&&(Cs=rt()+500,Qr()))}break;case 13:Pi(function(){var f=Sr(t,1);if(f!==null){var g=Xt();Gn(f,t,1,g)}}),Pc(t,1)}},Zs=function(t){if(t.tag===13){var r=Sr(t,134217728);if(r!==null){var a=Xt();Gn(r,t,134217728,a)}Pc(t,134217728)}},Js=function(t){if(t.tag===13){var r=ri(t),a=Sr(t,r);if(a!==null){var f=Xt();Gn(a,t,r,f)}Pc(t,r)}},Ur=function(){return Ue},da=function(t,r){var a=Ue;try{return Ue=t,r()}finally{Ue=a}},ut=function(t,r,a){switch(r){case"input":if(ve(t,a),r=a.name,a.type==="radio"&&r!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<a.length;r++){var f=a[r];if(f!==t&&f.form===t.form){var g=Sa(f);if(!g)throw Error(i(90));Oe(f),ve(f,g)}}}break;case"textarea":Ke(t,a);break;case"select":r=a.value,r!=null&&Qe(t,!!a.multiple,r,!1)}},Ji=Cc,tr=Pi;var zR={usingClientEntryPoint:!1,Events:[mo,ps,Sa,mi,gi,Cc]},To={findFiberByHostInstance:Ni,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},BR={bundleType:To.bundleType,version:To.version,rendererPackageName:To.rendererPackageName,rendererConfig:To.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=_i(t),t===null?null:t.stateNode},findFiberByHostInstance:To.findFiberByHostInstance||DR,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ol=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ol.isDisabled&&ol.supportsFiber)try{Sn=ol.inject(BR),Bt=ol}catch{}}return cn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=zR,cn.createPortal=function(t,r){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!qc(r))throw Error(i(200));return $R(t,r,null,a)},cn.createRoot=function(t,r){if(!qc(t))throw Error(i(299));var a=!1,f="",g=F0;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(f=r.identifierPrefix),r.onRecoverableError!==void 0&&(g=r.onRecoverableError)),r=Mc(t,1,!1,null,null,a,!1,f,g),t[yr]=r.current,fo(t.nodeType===8?t.parentNode:t),new Oc(r)},cn.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(i(188)):(t=Object.keys(t).join(","),Error(i(268,t)));return t=_i(r),t=t===null?null:t.stateNode,t},cn.flushSync=function(t){return Pi(t)},cn.hydrate=function(t,r,a){if(!il(r))throw Error(i(200));return sl(null,t,r,!0,a)},cn.hydrateRoot=function(t,r,a){if(!qc(t))throw Error(i(405));var f=a!=null&&a.hydratedSources||null,g=!1,w="",T=F0;if(a!=null&&(a.unstable_strictMode===!0&&(g=!0),a.identifierPrefix!==void 0&&(w=a.identifierPrefix),a.onRecoverableError!==void 0&&(T=a.onRecoverableError)),r=$0(r,null,t,1,a??null,g,!1,w,T),t[yr]=r.current,fo(t),f)for(t=0;t<f.length;t++)a=f[t],g=a._getVersion,g=g(a._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[a,g]:r.mutableSourceEagerHydrationData.push(a,g);return new rl(r)},cn.render=function(t,r,a){if(!il(r))throw Error(i(200));return sl(null,t,r,!1,a)},cn.unmountComponentAtNode=function(t){if(!il(t))throw Error(i(40));return t._reactRootContainer?(Pi(function(){sl(null,null,t,!1,function(){t._reactRootContainer=null,t[yr]=null})}),!0):!1},cn.unstable_batchedUpdates=Cc,cn.unstable_renderSubtreeIntoContainer=function(t,r,a,f){if(!il(a))throw Error(i(200));if(t==null||t._reactInternals===void 0)throw Error(i(38));return sl(t,r,a,!1,f)},cn.version="18.3.1-next-f1338f8080-20240426",cn}var K0;function Ik(){if(K0)return Dc.exports;K0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Dc.exports=KR(),Dc.exports}var X0;function XR(){if(X0)return ll;X0=1;var e=Ik();return ll.createRoot=e.createRoot,ll.hydrateRoot=e.hydrateRoot,ll}var QR=XR(),M=Qo();const ae=Hg(M);function Dt(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let i=0,s;i<e.length;i++)(s=Dt(e[i]))!==""&&(n+=(n&&" ")+s);else for(let i in e)e[i]&&(n+=(n&&" ")+i);return n}var Bc={exports:{}},Uc={},Hc={exports:{}},Vc={};/**
|
|
41
|
+
* @license React
|
|
42
|
+
* use-sync-external-store-shim.production.js
|
|
43
|
+
*
|
|
44
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
45
|
+
*
|
|
46
|
+
* This source code is licensed under the MIT license found in the
|
|
47
|
+
* LICENSE file in the root directory of this source tree.
|
|
48
|
+
*/var Q0;function ZR(){if(Q0)return Vc;Q0=1;var e=Qo();function n(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var i=typeof Object.is=="function"?Object.is:n,s=e.useState,o=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function c(m,y){var x=y(),N=s({inst:{value:x,getSnapshot:y}}),_=N[0].inst,S=N[1];return l(function(){_.value=x,_.getSnapshot=y,d(_)&&S({inst:_})},[m,x,y]),o(function(){return d(_)&&S({inst:_}),m(function(){d(_)&&S({inst:_})})},[m]),u(x),x}function d(m){var y=m.getSnapshot;m=m.value;try{var x=y();return!i(m,x)}catch{return!0}}function h(m,y){return y()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return Vc.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Vc}var Z0;function JR(){return Z0||(Z0=1,Hc.exports=ZR()),Hc.exports}/**
|
|
49
|
+
* @license React
|
|
50
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/var J0;function eT(){if(J0)return Uc;J0=1;var e=Qo(),n=JR();function i(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var s=typeof Object.is=="function"?Object.is:i,o=n.useSyncExternalStore,l=e.useRef,u=e.useEffect,c=e.useMemo,d=e.useDebugValue;return Uc.useSyncExternalStoreWithSelector=function(h,p,m,y,x){var N=l(null);if(N.current===null){var _={hasValue:!1,value:null};N.current=_}else _=N.current;N=c(function(){function b(P){if(!k){if(k=!0,E=P,P=y(P),x!==void 0&&_.hasValue){var L=_.value;if(x(L,P))return C=L}return C=P}if(L=C,s(E,P))return L;var O=y(P);return x!==void 0&&x(L,O)?(E=P,L):(E=P,C=O)}var k=!1,E,C,I=m===void 0?null:m;return[function(){return b(p())},I===null?void 0:function(){return b(I())}]},[p,m,y,x]);var S=o(h,N[0],N[1]);return u(function(){_.hasValue=!0,_.value=S},[S]),d(S),S},Uc}var ew;function tT(){return ew||(ew=1,Bc.exports=eT()),Bc.exports}var nT=tT();const rT=Hg(nT),iT={},tw=e=>{let n;const i=new Set,s=(p,m)=>{const y=typeof p=="function"?p(n):p;if(!Object.is(y,n)){const x=n;n=m??(typeof y!="object"||y===null)?y:Object.assign({},n,y),i.forEach(N=>N(n,x))}},o=()=>n,d={setState:s,getState:o,getInitialState:()=>h,subscribe:p=>(i.add(p),()=>i.delete(p)),destroy:()=>{(iT?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),i.clear()}},h=n=e(s,o,d);return d},sT=e=>e?tw(e):tw,{useDebugValue:oT}=ae,{useSyncExternalStoreWithSelector:aT}=rT,lT=e=>e;function Mk(e,n=lT,i){const s=aT(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,i);return oT(s),s}const nw=(e,n)=>{const i=sT(e),s=(o,l=n)=>Mk(i,o,l);return Object.assign(s,i),s},uT=(e,n)=>e?nw(e,n):nw;function Ct(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[s,o]of e)if(!Object.is(o,n.get(s)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const s of e)if(!n.has(s))return!1;return!0}const i=Object.keys(e);if(i.length!==Object.keys(n).length)return!1;for(const s of i)if(!Object.prototype.hasOwnProperty.call(n,s)||!Object.is(e[s],n[s]))return!1;return!0}var cT={value:()=>{}};function Dl(){for(var e=0,n=arguments.length,i={},s;e<n;++e){if(!(s=arguments[e]+"")||s in i||/[\s.]/.test(s))throw new Error("illegal type: "+s);i[s]=[]}return new bl(i)}function bl(e){this._=e}function fT(e,n){return e.trim().split(/^|\s+/).map(function(i){var s="",o=i.indexOf(".");if(o>=0&&(s=i.slice(o+1),i=i.slice(0,o)),i&&!n.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:s}})}bl.prototype=Dl.prototype={constructor:bl,on:function(e,n){var i=this._,s=fT(e+"",i),o,l=-1,u=s.length;if(arguments.length<2){for(;++l<u;)if((o=(e=s[l]).type)&&(o=dT(i[o],e.name)))return o;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++l<u;)if(o=(e=s[l]).type)i[o]=rw(i[o],e.name,n);else if(n==null)for(o in i)i[o]=rw(i[o],e.name,null);return this},copy:function(){var e={},n=this._;for(var i in n)e[i]=n[i].slice();return new bl(e)},call:function(e,n){if((o=arguments.length-2)>0)for(var i=new Array(o),s=0,o,l;s<o;++s)i[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],s=0,o=l.length;s<o;++s)l[s].value.apply(n,i)},apply:function(e,n,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],o=0,l=s.length;o<l;++o)s[o].value.apply(n,i)}};function dT(e,n){for(var i=0,s=e.length,o;i<s;++i)if((o=e[i]).name===n)return o.value}function rw(e,n,i){for(var s=0,o=e.length;s<o;++s)if(e[s].name===n){e[s]=cT,e=e.slice(0,s).concat(e.slice(s+1));break}return i!=null&&e.push({name:n,value:i}),e}var Sg="http://www.w3.org/1999/xhtml";const iw={svg:"http://www.w3.org/2000/svg",xhtml:Sg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Fl(e){var n=e+="",i=n.indexOf(":");return i>=0&&(n=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),iw.hasOwnProperty(n)?{space:iw[n],local:e}:e}function hT(e){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===Sg&&n.documentElement.namespaceURI===Sg?n.createElement(e):n.createElementNS(i,e)}}function pT(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Pk(e){var n=Fl(e);return(n.local?pT:hT)(n)}function mT(){}function Vg(e){return e==null?mT:function(){return this.querySelector(e)}}function gT(e){typeof e!="function"&&(e=Vg(e));for(var n=this._groups,i=n.length,s=new Array(i),o=0;o<i;++o)for(var l=n[o],u=l.length,c=s[o]=new Array(u),d,h,p=0;p<u;++p)(d=l[p])&&(h=e.call(d,d.__data__,p,l))&&("__data__"in d&&(h.__data__=d.__data__),c[p]=h);return new yn(s,this._parents)}function vT(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function yT(){return[]}function Ok(e){return e==null?yT:function(){return this.querySelectorAll(e)}}function wT(e){return function(){return vT(e.apply(this,arguments))}}function xT(e){typeof e=="function"?e=wT(e):e=Ok(e);for(var n=this._groups,i=n.length,s=[],o=[],l=0;l<i;++l)for(var u=n[l],c=u.length,d,h=0;h<c;++h)(d=u[h])&&(s.push(e.call(d,d.__data__,h,u)),o.push(d));return new yn(s,o)}function qk(e){return function(){return this.matches(e)}}function Lk(e){return function(n){return n.matches(e)}}var _T=Array.prototype.find;function ST(e){return function(){return _T.call(this.children,e)}}function bT(){return this.firstElementChild}function kT(e){return this.select(e==null?bT:ST(typeof e=="function"?e:Lk(e)))}var ET=Array.prototype.filter;function NT(){return Array.from(this.children)}function CT(e){return function(){return ET.call(this.children,e)}}function RT(e){return this.selectAll(e==null?NT:CT(typeof e=="function"?e:Lk(e)))}function TT(e){typeof e!="function"&&(e=qk(e));for(var n=this._groups,i=n.length,s=new Array(i),o=0;o<i;++o)for(var l=n[o],u=l.length,c=s[o]=[],d,h=0;h<u;++h)(d=l[h])&&e.call(d,d.__data__,h,l)&&c.push(d);return new yn(s,this._parents)}function $k(e){return new Array(e.length)}function jT(){return new yn(this._enter||this._groups.map($k),this._parents)}function Cl(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Cl.prototype={constructor:Cl,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function AT(e){return function(){return e}}function IT(e,n,i,s,o,l){for(var u=0,c,d=n.length,h=l.length;u<h;++u)(c=n[u])?(c.__data__=l[u],s[u]=c):i[u]=new Cl(e,l[u]);for(;u<d;++u)(c=n[u])&&(o[u]=c)}function MT(e,n,i,s,o,l,u){var c,d,h=new Map,p=n.length,m=l.length,y=new Array(p),x;for(c=0;c<p;++c)(d=n[c])&&(y[c]=x=u.call(d,d.__data__,c,n)+"",h.has(x)?o[c]=d:h.set(x,d));for(c=0;c<m;++c)x=u.call(e,l[c],c,l)+"",(d=h.get(x))?(s[c]=d,d.__data__=l[c],h.delete(x)):i[c]=new Cl(e,l[c]);for(c=0;c<p;++c)(d=n[c])&&h.get(y[c])===d&&(o[c]=d)}function PT(e){return e.__data__}function OT(e,n){if(!arguments.length)return Array.from(this,PT);var i=n?MT:IT,s=this._parents,o=this._groups;typeof e!="function"&&(e=AT(e));for(var l=o.length,u=new Array(l),c=new Array(l),d=new Array(l),h=0;h<l;++h){var p=s[h],m=o[h],y=m.length,x=qT(e.call(p,p&&p.__data__,h,s)),N=x.length,_=c[h]=new Array(N),S=u[h]=new Array(N),b=d[h]=new Array(y);i(p,m,_,S,b,x,n);for(var k=0,E=0,C,I;k<N;++k)if(C=_[k]){for(k>=E&&(E=k+1);!(I=S[E])&&++E<N;);C._next=I||null}}return u=new yn(u,s),u._enter=c,u._exit=d,u}function qT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function LT(){return new yn(this._exit||this._groups.map($k),this._parents)}function $T(e,n,i){var s=this.enter(),o=this,l=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),n!=null&&(o=n(o),o&&(o=o.selection())),i==null?l.remove():i(l),s&&o?s.merge(o).order():o}function DT(e){for(var n=e.selection?e.selection():e,i=this._groups,s=n._groups,o=i.length,l=s.length,u=Math.min(o,l),c=new Array(o),d=0;d<u;++d)for(var h=i[d],p=s[d],m=h.length,y=c[d]=new Array(m),x,N=0;N<m;++N)(x=h[N]||p[N])&&(y[N]=x);for(;d<o;++d)c[d]=i[d];return new yn(c,this._parents)}function FT(){for(var e=this._groups,n=-1,i=e.length;++n<i;)for(var s=e[n],o=s.length-1,l=s[o],u;--o>=0;)(u=s[o])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function zT(e){e||(e=BT);function n(m,y){return m&&y?e(m.__data__,y.__data__):!m-!y}for(var i=this._groups,s=i.length,o=new Array(s),l=0;l<s;++l){for(var u=i[l],c=u.length,d=o[l]=new Array(c),h,p=0;p<c;++p)(h=u[p])&&(d[p]=h);d.sort(n)}return new yn(o,this._parents).order()}function BT(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function UT(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function HT(){return Array.from(this)}function VT(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var s=e[n],o=0,l=s.length;o<l;++o){var u=s[o];if(u)return u}return null}function WT(){let e=0;for(const n of this)++e;return e}function GT(){return!this.node()}function YT(e){for(var n=this._groups,i=0,s=n.length;i<s;++i)for(var o=n[i],l=0,u=o.length,c;l<u;++l)(c=o[l])&&e.call(c,c.__data__,l,o);return this}function KT(e){return function(){this.removeAttribute(e)}}function XT(e){return function(){this.removeAttributeNS(e.space,e.local)}}function QT(e,n){return function(){this.setAttribute(e,n)}}function ZT(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function JT(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function e2(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function t2(e,n){var i=Fl(e);if(arguments.length<2){var s=this.node();return i.local?s.getAttributeNS(i.space,i.local):s.getAttribute(i)}return this.each((n==null?i.local?XT:KT:typeof n=="function"?i.local?e2:JT:i.local?ZT:QT)(i,n))}function Dk(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function n2(e){return function(){this.style.removeProperty(e)}}function r2(e,n,i){return function(){this.style.setProperty(e,n,i)}}function i2(e,n,i){return function(){var s=n.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,i)}}function s2(e,n,i){return arguments.length>1?this.each((n==null?n2:typeof n=="function"?i2:r2)(e,n,i??"")):Fs(this.node(),e)}function Fs(e,n){return e.style.getPropertyValue(n)||Dk(e).getComputedStyle(e,null).getPropertyValue(n)}function o2(e){return function(){delete this[e]}}function a2(e,n){return function(){this[e]=n}}function l2(e,n){return function(){var i=n.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function u2(e,n){return arguments.length>1?this.each((n==null?o2:typeof n=="function"?l2:a2)(e,n)):this.node()[e]}function Fk(e){return e.trim().split(/^|\s+/)}function Wg(e){return e.classList||new zk(e)}function zk(e){this._node=e,this._names=Fk(e.getAttribute("class")||"")}zk.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Bk(e,n){for(var i=Wg(e),s=-1,o=n.length;++s<o;)i.add(n[s])}function Uk(e,n){for(var i=Wg(e),s=-1,o=n.length;++s<o;)i.remove(n[s])}function c2(e){return function(){Bk(this,e)}}function f2(e){return function(){Uk(this,e)}}function d2(e,n){return function(){(n.apply(this,arguments)?Bk:Uk)(this,e)}}function h2(e,n){var i=Fk(e+"");if(arguments.length<2){for(var s=Wg(this.node()),o=-1,l=i.length;++o<l;)if(!s.contains(i[o]))return!1;return!0}return this.each((typeof n=="function"?d2:n?c2:f2)(i,n))}function p2(){this.textContent=""}function m2(e){return function(){this.textContent=e}}function g2(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function v2(e){return arguments.length?this.each(e==null?p2:(typeof e=="function"?g2:m2)(e)):this.node().textContent}function y2(){this.innerHTML=""}function w2(e){return function(){this.innerHTML=e}}function x2(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function _2(e){return arguments.length?this.each(e==null?y2:(typeof e=="function"?x2:w2)(e)):this.node().innerHTML}function S2(){this.nextSibling&&this.parentNode.appendChild(this)}function b2(){return this.each(S2)}function k2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function E2(){return this.each(k2)}function N2(e){var n=typeof e=="function"?e:Pk(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function C2(){return null}function R2(e,n){var i=typeof e=="function"?e:Pk(e),s=n==null?C2:typeof n=="function"?n:Vg(n);return this.select(function(){return this.insertBefore(i.apply(this,arguments),s.apply(this,arguments)||null)})}function T2(){var e=this.parentNode;e&&e.removeChild(this)}function j2(){return this.each(T2)}function A2(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function I2(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function M2(e){return this.select(e?I2:A2)}function P2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function O2(e){return function(n){e.call(this,n,this.__data__)}}function q2(e){return e.trim().split(/^|\s+/).map(function(n){var i="",s=n.indexOf(".");return s>=0&&(i=n.slice(s+1),n=n.slice(0,s)),{type:n,name:i}})}function L2(e){return function(){var n=this.__on;if(n){for(var i=0,s=-1,o=n.length,l;i<o;++i)l=n[i],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):n[++s]=l;++s?n.length=s:delete this.__on}}}function $2(e,n,i){return function(){var s=this.__on,o,l=O2(n);if(s){for(var u=0,c=s.length;u<c;++u)if((o=s[u]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=l,o.options=i),o.value=n;return}}this.addEventListener(e.type,l,i),o={type:e.type,name:e.name,value:n,listener:l,options:i},s?s.push(o):this.__on=[o]}}function D2(e,n,i){var s=q2(e+""),o,l=s.length,u;if(arguments.length<2){var c=this.node().__on;if(c){for(var d=0,h=c.length,p;d<h;++d)for(o=0,p=c[d];o<l;++o)if((u=s[o]).type===p.type&&u.name===p.name)return p.value}return}for(c=n?$2:L2,o=0;o<l;++o)this.each(c(s[o],n,i));return this}function Hk(e,n,i){var s=Dk(e),o=s.CustomEvent;typeof o=="function"?o=new o(n,i):(o=s.document.createEvent("Event"),i?(o.initEvent(n,i.bubbles,i.cancelable),o.detail=i.detail):o.initEvent(n,!1,!1)),e.dispatchEvent(o)}function F2(e,n){return function(){return Hk(this,e,n)}}function z2(e,n){return function(){return Hk(this,e,n.apply(this,arguments))}}function B2(e,n){return this.each((typeof n=="function"?z2:F2)(e,n))}function*U2(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var s=e[n],o=0,l=s.length,u;o<l;++o)(u=s[o])&&(yield u)}var Vk=[null];function yn(e,n){this._groups=e,this._parents=n}function Zo(){return new yn([[document.documentElement]],Vk)}function H2(){return this}yn.prototype=Zo.prototype={constructor:yn,select:gT,selectAll:xT,selectChild:kT,selectChildren:RT,filter:TT,data:OT,enter:jT,exit:LT,join:$T,merge:DT,selection:H2,order:FT,sort:zT,call:UT,nodes:HT,node:VT,size:WT,empty:GT,each:YT,attr:t2,style:s2,property:u2,classed:h2,text:v2,html:_2,raise:b2,lower:E2,append:N2,insert:R2,remove:j2,clone:M2,datum:P2,on:D2,dispatch:B2,[Symbol.iterator]:U2};function Mn(e){return typeof e=="string"?new yn([[document.querySelector(e)]],[document.documentElement]):new yn([[e]],Vk)}function V2(e){let n;for(;n=e.sourceEvent;)e=n;return e}function Kn(e,n){if(e=V2(e),n===void 0&&(n=e.currentTarget),n){var i=n.ownerSVGElement||n;if(i.createSVGPoint){var s=i.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(n.getScreenCTM().inverse()),[s.x,s.y]}if(n.getBoundingClientRect){var o=n.getBoundingClientRect();return[e.clientX-o.left-n.clientLeft,e.clientY-o.top-n.clientTop]}}return[e.pageX,e.pageY]}const W2={passive:!1},Uo={capture:!0,passive:!1};function Wc(e){e.stopImmediatePropagation()}function qs(e){e.preventDefault(),e.stopImmediatePropagation()}function Wk(e){var n=e.document.documentElement,i=Mn(e).on("dragstart.drag",qs,Uo);"onselectstart"in n?i.on("selectstart.drag",qs,Uo):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Gk(e,n){var i=e.document.documentElement,s=Mn(e).on("dragstart.drag",null);n&&(s.on("click.drag",qs,Uo),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in i?s.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const ul=e=>()=>e;function bg(e,{sourceEvent:n,subject:i,target:s,identifier:o,active:l,x:u,y:c,dx:d,dy:h,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:p}})}bg.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function G2(e){return!e.ctrlKey&&!e.button}function Y2(){return this.parentNode}function K2(e,n){return n??{x:e.x,y:e.y}}function X2(){return navigator.maxTouchPoints||"ontouchstart"in this}function Q2(){var e=G2,n=Y2,i=K2,s=X2,o={},l=Dl("start","drag","end"),u=0,c,d,h,p,m=0;function y(C){C.on("mousedown.drag",x).filter(s).on("touchstart.drag",S).on("touchmove.drag",b,W2).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(C,I){if(!(p||!e.call(this,C,I))){var P=E(this,n.call(this,C,I),C,I,"mouse");P&&(Mn(C.view).on("mousemove.drag",N,Uo).on("mouseup.drag",_,Uo),Wk(C.view),Wc(C),h=!1,c=C.clientX,d=C.clientY,P("start",C))}}function N(C){if(qs(C),!h){var I=C.clientX-c,P=C.clientY-d;h=I*I+P*P>m}o.mouse("drag",C)}function _(C){Mn(C.view).on("mousemove.drag mouseup.drag",null),Gk(C.view,h),qs(C),o.mouse("end",C)}function S(C,I){if(e.call(this,C,I)){var P=C.changedTouches,L=n.call(this,C,I),O=P.length,R,q;for(R=0;R<O;++R)(q=E(this,L,C,I,P[R].identifier,P[R]))&&(Wc(C),q("start",C,P[R]))}}function b(C){var I=C.changedTouches,P=I.length,L,O;for(L=0;L<P;++L)(O=o[I[L].identifier])&&(qs(C),O("drag",C,I[L]))}function k(C){var I=C.changedTouches,P=I.length,L,O;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),L=0;L<P;++L)(O=o[I[L].identifier])&&(Wc(C),O("end",C,I[L]))}function E(C,I,P,L,O,R){var q=l.copy(),F=Kn(R||P,I),J,Q,A;if((A=i.call(C,new bg("beforestart",{sourceEvent:P,target:y,identifier:O,active:u,x:F[0],y:F[1],dx:0,dy:0,dispatch:q}),L))!=null)return J=A.x-F[0]||0,Q=A.y-F[1]||0,function V(B,ne,X){var $=F,G;switch(B){case"start":o[O]=V,G=u++;break;case"end":delete o[O],--u;case"drag":F=Kn(X||ne,I),G=u;break}q.call(B,C,new bg(B,{sourceEvent:ne,subject:A,target:y,identifier:O,active:G,x:F[0]+J,y:F[1]+Q,dx:F[0]-$[0],dy:F[1]-$[1],dispatch:q}),L)}}return y.filter=function(C){return arguments.length?(e=typeof C=="function"?C:ul(!!C),y):e},y.container=function(C){return arguments.length?(n=typeof C=="function"?C:ul(C),y):n},y.subject=function(C){return arguments.length?(i=typeof C=="function"?C:ul(C),y):i},y.touchable=function(C){return arguments.length?(s=typeof C=="function"?C:ul(!!C),y):s},y.on=function(){var C=l.on.apply(l,arguments);return C===l?y:C},y.clickDistance=function(C){return arguments.length?(m=(C=+C)*C,y):Math.sqrt(m)},y}function Gg(e,n,i){e.prototype=n.prototype=i,i.constructor=e}function Yk(e,n){var i=Object.create(e.prototype);for(var s in n)i[s]=n[s];return i}function Jo(){}var Ho=.7,Rl=1/Ho,Ls="\\s*([+-]?\\d+)\\s*",Vo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ur="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Z2=/^#([0-9a-f]{3,8})$/,J2=new RegExp(`^rgb\\(${Ls},${Ls},${Ls}\\)$`),ej=new RegExp(`^rgb\\(${ur},${ur},${ur}\\)$`),tj=new RegExp(`^rgba\\(${Ls},${Ls},${Ls},${Vo}\\)$`),nj=new RegExp(`^rgba\\(${ur},${ur},${ur},${Vo}\\)$`),rj=new RegExp(`^hsl\\(${Vo},${ur},${ur}\\)$`),ij=new RegExp(`^hsla\\(${Vo},${ur},${ur},${Vo}\\)$`),sw={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Gg(Jo,Wo,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ow,formatHex:ow,formatHex8:sj,formatHsl:oj,formatRgb:aw,toString:aw});function ow(){return this.rgb().formatHex()}function sj(){return this.rgb().formatHex8()}function oj(){return Kk(this).formatHsl()}function aw(){return this.rgb().formatRgb()}function Wo(e){var n,i;return e=(e+"").trim().toLowerCase(),(n=Z2.exec(e))?(i=n[1].length,n=parseInt(n[1],16),i===6?lw(n):i===3?new fn(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):i===8?cl(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):i===4?cl(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=J2.exec(e))?new fn(n[1],n[2],n[3],1):(n=ej.exec(e))?new fn(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=tj.exec(e))?cl(n[1],n[2],n[3],n[4]):(n=nj.exec(e))?cl(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=rj.exec(e))?fw(n[1],n[2]/100,n[3]/100,1):(n=ij.exec(e))?fw(n[1],n[2]/100,n[3]/100,n[4]):sw.hasOwnProperty(e)?lw(sw[e]):e==="transparent"?new fn(NaN,NaN,NaN,0):null}function lw(e){return new fn(e>>16&255,e>>8&255,e&255,1)}function cl(e,n,i,s){return s<=0&&(e=n=i=NaN),new fn(e,n,i,s)}function aj(e){return e instanceof Jo||(e=Wo(e)),e?(e=e.rgb(),new fn(e.r,e.g,e.b,e.opacity)):new fn}function kg(e,n,i,s){return arguments.length===1?aj(e):new fn(e,n,i,s??1)}function fn(e,n,i,s){this.r=+e,this.g=+n,this.b=+i,this.opacity=+s}Gg(fn,kg,Yk(Jo,{brighter(e){return e=e==null?Rl:Math.pow(Rl,e),new fn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ho:Math.pow(Ho,e),new fn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fn(Hi(this.r),Hi(this.g),Hi(this.b),Tl(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:uw,formatHex:uw,formatHex8:lj,formatRgb:cw,toString:cw}));function uw(){return`#${Bi(this.r)}${Bi(this.g)}${Bi(this.b)}`}function lj(){return`#${Bi(this.r)}${Bi(this.g)}${Bi(this.b)}${Bi((isNaN(this.opacity)?1:this.opacity)*255)}`}function cw(){const e=Tl(this.opacity);return`${e===1?"rgb(":"rgba("}${Hi(this.r)}, ${Hi(this.g)}, ${Hi(this.b)}${e===1?")":`, ${e})`}`}function Tl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Hi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Bi(e){return e=Hi(e),(e<16?"0":"")+e.toString(16)}function fw(e,n,i,s){return s<=0?e=n=i=NaN:i<=0||i>=1?e=n=NaN:n<=0&&(e=NaN),new Xn(e,n,i,s)}function Kk(e){if(e instanceof Xn)return new Xn(e.h,e.s,e.l,e.opacity);if(e instanceof Jo||(e=Wo(e)),!e)return new Xn;if(e instanceof Xn)return e;e=e.rgb();var n=e.r/255,i=e.g/255,s=e.b/255,o=Math.min(n,i,s),l=Math.max(n,i,s),u=NaN,c=l-o,d=(l+o)/2;return c?(n===l?u=(i-s)/c+(i<s)*6:i===l?u=(s-n)/c+2:u=(n-i)/c+4,c/=d<.5?l+o:2-l-o,u*=60):c=d>0&&d<1?0:u,new Xn(u,c,d,e.opacity)}function uj(e,n,i,s){return arguments.length===1?Kk(e):new Xn(e,n,i,s??1)}function Xn(e,n,i,s){this.h=+e,this.s=+n,this.l=+i,this.opacity=+s}Gg(Xn,uj,Yk(Jo,{brighter(e){return e=e==null?Rl:Math.pow(Rl,e),new Xn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ho:Math.pow(Ho,e),new Xn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,s=i+(i<.5?i:1-i)*n,o=2*i-s;return new fn(Gc(e>=240?e-240:e+120,o,s),Gc(e,o,s),Gc(e<120?e+240:e-120,o,s),this.opacity)},clamp(){return new Xn(dw(this.h),fl(this.s),fl(this.l),Tl(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Tl(this.opacity);return`${e===1?"hsl(":"hsla("}${dw(this.h)}, ${fl(this.s)*100}%, ${fl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function dw(e){return e=(e||0)%360,e<0?e+360:e}function fl(e){return Math.max(0,Math.min(1,e||0))}function Gc(e,n,i){return(e<60?n+(i-n)*e/60:e<180?i:e<240?n+(i-n)*(240-e)/60:n)*255}const Xk=e=>()=>e;function cj(e,n){return function(i){return e+i*n}}function fj(e,n,i){return e=Math.pow(e,i),n=Math.pow(n,i)-e,i=1/i,function(s){return Math.pow(e+s*n,i)}}function dj(e){return(e=+e)==1?Qk:function(n,i){return i-n?fj(n,i,e):Xk(isNaN(n)?i:n)}}function Qk(e,n){var i=n-e;return i?cj(e,i):Xk(isNaN(e)?n:e)}const hw=(function e(n){var i=dj(n);function s(o,l){var u=i((o=kg(o)).r,(l=kg(l)).r),c=i(o.g,l.g),d=i(o.b,l.b),h=Qk(o.opacity,l.opacity);return function(p){return o.r=u(p),o.g=c(p),o.b=d(p),o.opacity=h(p),o+""}}return s.gamma=e,s})(1);function li(e,n){return e=+e,n=+n,function(i){return e*(1-i)+n*i}}var Eg=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Yc=new RegExp(Eg.source,"g");function hj(e){return function(){return e}}function pj(e){return function(n){return e(n)+""}}function mj(e,n){var i=Eg.lastIndex=Yc.lastIndex=0,s,o,l,u=-1,c=[],d=[];for(e=e+"",n=n+"";(s=Eg.exec(e))&&(o=Yc.exec(n));)(l=o.index)>i&&(l=n.slice(i,l),c[u]?c[u]+=l:c[++u]=l),(s=s[0])===(o=o[0])?c[u]?c[u]+=o:c[++u]=o:(c[++u]=null,d.push({i:u,x:li(s,o)})),i=Yc.lastIndex;return i<n.length&&(l=n.slice(i),c[u]?c[u]+=l:c[++u]=l),c.length<2?d[0]?pj(d[0].x):hj(n):(n=d.length,function(h){for(var p=0,m;p<n;++p)c[(m=d[p]).i]=m.x(h);return c.join("")})}var pw=180/Math.PI,Ng={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Zk(e,n,i,s,o,l){var u,c,d;return(u=Math.sqrt(e*e+n*n))&&(e/=u,n/=u),(d=e*i+n*s)&&(i-=e*d,s-=n*d),(c=Math.sqrt(i*i+s*s))&&(i/=c,s/=c,d/=c),e*s<n*i&&(e=-e,n=-n,d=-d,u=-u),{translateX:o,translateY:l,rotate:Math.atan2(n,e)*pw,skewX:Math.atan(d)*pw,scaleX:u,scaleY:c}}var dl;function gj(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Ng:Zk(n.a,n.b,n.c,n.d,n.e,n.f)}function vj(e){return e==null||(dl||(dl=document.createElementNS("http://www.w3.org/2000/svg","g")),dl.setAttribute("transform",e),!(e=dl.transform.baseVal.consolidate()))?Ng:(e=e.matrix,Zk(e.a,e.b,e.c,e.d,e.e,e.f))}function Jk(e,n,i,s){function o(h){return h.length?h.pop()+" ":""}function l(h,p,m,y,x,N){if(h!==m||p!==y){var _=x.push("translate(",null,n,null,i);N.push({i:_-4,x:li(h,m)},{i:_-2,x:li(p,y)})}else(m||y)&&x.push("translate("+m+n+y+i)}function u(h,p,m,y){h!==p?(h-p>180?p+=360:p-h>180&&(h+=360),y.push({i:m.push(o(m)+"rotate(",null,s)-2,x:li(h,p)})):p&&m.push(o(m)+"rotate("+p+s)}function c(h,p,m,y){h!==p?y.push({i:m.push(o(m)+"skewX(",null,s)-2,x:li(h,p)}):p&&m.push(o(m)+"skewX("+p+s)}function d(h,p,m,y,x,N){if(h!==m||p!==y){var _=x.push(o(x)+"scale(",null,",",null,")");N.push({i:_-4,x:li(h,m)},{i:_-2,x:li(p,y)})}else(m!==1||y!==1)&&x.push(o(x)+"scale("+m+","+y+")")}return function(h,p){var m=[],y=[];return h=e(h),p=e(p),l(h.translateX,h.translateY,p.translateX,p.translateY,m,y),u(h.rotate,p.rotate,m,y),c(h.skewX,p.skewX,m,y),d(h.scaleX,h.scaleY,p.scaleX,p.scaleY,m,y),h=p=null,function(x){for(var N=-1,_=y.length,S;++N<_;)m[(S=y[N]).i]=S.x(x);return m.join("")}}}var yj=Jk(gj,"px, ","px)","deg)"),wj=Jk(vj,", ",")",")"),xj=1e-12;function mw(e){return((e=Math.exp(e))+1/e)/2}function _j(e){return((e=Math.exp(e))-1/e)/2}function Sj(e){return((e=Math.exp(2*e))-1)/(e+1)}const bj=(function e(n,i,s){function o(l,u){var c=l[0],d=l[1],h=l[2],p=u[0],m=u[1],y=u[2],x=p-c,N=m-d,_=x*x+N*N,S,b;if(_<xj)b=Math.log(y/h)/n,S=function(L){return[c+L*x,d+L*N,h*Math.exp(n*L*b)]};else{var k=Math.sqrt(_),E=(y*y-h*h+s*_)/(2*h*i*k),C=(y*y-h*h-s*_)/(2*y*i*k),I=Math.log(Math.sqrt(E*E+1)-E),P=Math.log(Math.sqrt(C*C+1)-C);b=(P-I)/n,S=function(L){var O=L*b,R=mw(I),q=h/(i*k)*(R*Sj(n*O+I)-_j(I));return[c+q*x,d+q*N,h*R/mw(n*O+I)]}}return S.duration=b*1e3*n/Math.SQRT2,S}return o.rho=function(l){var u=Math.max(.001,+l),c=u*u,d=c*c;return e(u,c,d)},o})(Math.SQRT2,2,4);var zs=0,qo=0,Ao=0,eE=1e3,jl,Lo,Al=0,Gi=0,zl=0,Go=typeof performance=="object"&&performance.now?performance:Date,tE=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Yg(){return Gi||(tE(kj),Gi=Go.now()+zl)}function kj(){Gi=0}function Il(){this._call=this._time=this._next=null}Il.prototype=nE.prototype={constructor:Il,restart:function(e,n,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?Yg():+i)+(n==null?0:+n),!this._next&&Lo!==this&&(Lo?Lo._next=this:jl=this,Lo=this),this._call=e,this._time=i,Cg()},stop:function(){this._call&&(this._call=null,this._time=1/0,Cg())}};function nE(e,n,i){var s=new Il;return s.restart(e,n,i),s}function Ej(){Yg(),++zs;for(var e=jl,n;e;)(n=Gi-e._time)>=0&&e._call.call(void 0,n),e=e._next;--zs}function gw(){Gi=(Al=Go.now())+zl,zs=qo=0;try{Ej()}finally{zs=0,Cj(),Gi=0}}function Nj(){var e=Go.now(),n=e-Al;n>eE&&(zl-=n,Al=e)}function Cj(){for(var e,n=jl,i,s=1/0;n;)n._call?(s>n._time&&(s=n._time),e=n,n=n._next):(i=n._next,n._next=null,n=e?e._next=i:jl=i);Lo=e,Cg(s)}function Cg(e){if(!zs){qo&&(qo=clearTimeout(qo));var n=e-Gi;n>24?(e<1/0&&(qo=setTimeout(gw,e-Go.now()-zl)),Ao&&(Ao=clearInterval(Ao))):(Ao||(Al=Go.now(),Ao=setInterval(Nj,eE)),zs=1,tE(gw))}}function vw(e,n,i){var s=new Il;return n=n==null?0:+n,s.restart(o=>{s.stop(),e(o+n)},n,i),s}var Rj=Dl("start","end","cancel","interrupt"),Tj=[],rE=0,yw=1,Rg=2,kl=3,ww=4,Tg=5,El=6;function Bl(e,n,i,s,o,l){var u=e.__transition;if(!u)e.__transition={};else if(i in u)return;jj(e,i,{name:n,index:s,group:o,on:Rj,tween:Tj,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:rE})}function Kg(e,n){var i=Jn(e,n);if(i.state>rE)throw new Error("too late; already scheduled");return i}function cr(e,n){var i=Jn(e,n);if(i.state>kl)throw new Error("too late; already running");return i}function Jn(e,n){var i=e.__transition;if(!i||!(i=i[n]))throw new Error("transition not found");return i}function jj(e,n,i){var s=e.__transition,o;s[n]=i,i.timer=nE(l,0,i.time);function l(h){i.state=yw,i.timer.restart(u,i.delay,i.time),i.delay<=h&&u(h-i.delay)}function u(h){var p,m,y,x;if(i.state!==yw)return d();for(p in s)if(x=s[p],x.name===i.name){if(x.state===kl)return vw(u);x.state===ww?(x.state=El,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete s[p]):+p<n&&(x.state=El,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete s[p])}if(vw(function(){i.state===kl&&(i.state=ww,i.timer.restart(c,i.delay,i.time),c(h))}),i.state=Rg,i.on.call("start",e,e.__data__,i.index,i.group),i.state===Rg){for(i.state=kl,o=new Array(y=i.tween.length),p=0,m=-1;p<y;++p)(x=i.tween[p].value.call(e,e.__data__,i.index,i.group))&&(o[++m]=x);o.length=m+1}}function c(h){for(var p=h<i.duration?i.ease.call(null,h/i.duration):(i.timer.restart(d),i.state=Tg,1),m=-1,y=o.length;++m<y;)o[m].call(e,p);i.state===Tg&&(i.on.call("end",e,e.__data__,i.index,i.group),d())}function d(){i.state=El,i.timer.stop(),delete s[n];for(var h in s)return;delete e.__transition}}function Nl(e,n){var i=e.__transition,s,o,l=!0,u;if(i){n=n==null?null:n+"";for(u in i){if((s=i[u]).name!==n){l=!1;continue}o=s.state>Rg&&s.state<Tg,s.state=El,s.timer.stop(),s.on.call(o?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete i[u]}l&&delete e.__transition}}function Aj(e){return this.each(function(){Nl(this,e)})}function Ij(e,n){var i,s;return function(){var o=cr(this,e),l=o.tween;if(l!==i){s=i=l;for(var u=0,c=s.length;u<c;++u)if(s[u].name===n){s=s.slice(),s.splice(u,1);break}}o.tween=s}}function Mj(e,n,i){var s,o;if(typeof i!="function")throw new Error;return function(){var l=cr(this,e),u=l.tween;if(u!==s){o=(s=u).slice();for(var c={name:n,value:i},d=0,h=o.length;d<h;++d)if(o[d].name===n){o[d]=c;break}d===h&&o.push(c)}l.tween=o}}function Pj(e,n){var i=this._id;if(e+="",arguments.length<2){for(var s=Jn(this.node(),i).tween,o=0,l=s.length,u;o<l;++o)if((u=s[o]).name===e)return u.value;return null}return this.each((n==null?Ij:Mj)(i,e,n))}function Xg(e,n,i){var s=e._id;return e.each(function(){var o=cr(this,s);(o.value||(o.value={}))[n]=i.apply(this,arguments)}),function(o){return Jn(o,s).value[n]}}function iE(e,n){var i;return(typeof n=="number"?li:n instanceof Wo?hw:(i=Wo(n))?(n=i,hw):mj)(e,n)}function Oj(e){return function(){this.removeAttribute(e)}}function qj(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Lj(e,n,i){var s,o=i+"",l;return function(){var u=this.getAttribute(e);return u===o?null:u===s?l:l=n(s=u,i)}}function $j(e,n,i){var s,o=i+"",l;return function(){var u=this.getAttributeNS(e.space,e.local);return u===o?null:u===s?l:l=n(s=u,i)}}function Dj(e,n,i){var s,o,l;return function(){var u,c=i(this),d;return c==null?void this.removeAttribute(e):(u=this.getAttribute(e),d=c+"",u===d?null:u===s&&d===o?l:(o=d,l=n(s=u,c)))}}function Fj(e,n,i){var s,o,l;return function(){var u,c=i(this),d;return c==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),d=c+"",u===d?null:u===s&&d===o?l:(o=d,l=n(s=u,c)))}}function zj(e,n){var i=Fl(e),s=i==="transform"?wj:iE;return this.attrTween(e,typeof n=="function"?(i.local?Fj:Dj)(i,s,Xg(this,"attr."+e,n)):n==null?(i.local?qj:Oj)(i):(i.local?$j:Lj)(i,s,n))}function Bj(e,n){return function(i){this.setAttribute(e,n.call(this,i))}}function Uj(e,n){return function(i){this.setAttributeNS(e.space,e.local,n.call(this,i))}}function Hj(e,n){var i,s;function o(){var l=n.apply(this,arguments);return l!==s&&(i=(s=l)&&Uj(e,l)),i}return o._value=n,o}function Vj(e,n){var i,s;function o(){var l=n.apply(this,arguments);return l!==s&&(i=(s=l)&&Bj(e,l)),i}return o._value=n,o}function Wj(e,n){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;var s=Fl(e);return this.tween(i,(s.local?Hj:Vj)(s,n))}function Gj(e,n){return function(){Kg(this,e).delay=+n.apply(this,arguments)}}function Yj(e,n){return n=+n,function(){Kg(this,e).delay=n}}function Kj(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?Gj:Yj)(n,e)):Jn(this.node(),n).delay}function Xj(e,n){return function(){cr(this,e).duration=+n.apply(this,arguments)}}function Qj(e,n){return n=+n,function(){cr(this,e).duration=n}}function Zj(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?Xj:Qj)(n,e)):Jn(this.node(),n).duration}function Jj(e,n){if(typeof n!="function")throw new Error;return function(){cr(this,e).ease=n}}function eA(e){var n=this._id;return arguments.length?this.each(Jj(n,e)):Jn(this.node(),n).ease}function tA(e,n){return function(){var i=n.apply(this,arguments);if(typeof i!="function")throw new Error;cr(this,e).ease=i}}function nA(e){if(typeof e!="function")throw new Error;return this.each(tA(this._id,e))}function rA(e){typeof e!="function"&&(e=qk(e));for(var n=this._groups,i=n.length,s=new Array(i),o=0;o<i;++o)for(var l=n[o],u=l.length,c=s[o]=[],d,h=0;h<u;++h)(d=l[h])&&e.call(d,d.__data__,h,l)&&c.push(d);return new jr(s,this._parents,this._name,this._id)}function iA(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,i=e._groups,s=n.length,o=i.length,l=Math.min(s,o),u=new Array(s),c=0;c<l;++c)for(var d=n[c],h=i[c],p=d.length,m=u[c]=new Array(p),y,x=0;x<p;++x)(y=d[x]||h[x])&&(m[x]=y);for(;c<s;++c)u[c]=n[c];return new jr(u,this._parents,this._name,this._id)}function sA(e){return(e+"").trim().split(/^|\s+/).every(function(n){var i=n.indexOf(".");return i>=0&&(n=n.slice(0,i)),!n||n==="start"})}function oA(e,n,i){var s,o,l=sA(n)?Kg:cr;return function(){var u=l(this,e),c=u.on;c!==s&&(o=(s=c).copy()).on(n,i),u.on=o}}function aA(e,n){var i=this._id;return arguments.length<2?Jn(this.node(),i).on.on(e):this.each(oA(i,e,n))}function lA(e){return function(){var n=this.parentNode;for(var i in this.__transition)if(+i!==e)return;n&&n.removeChild(this)}}function uA(){return this.on("end.remove",lA(this._id))}function cA(e){var n=this._name,i=this._id;typeof e!="function"&&(e=Vg(e));for(var s=this._groups,o=s.length,l=new Array(o),u=0;u<o;++u)for(var c=s[u],d=c.length,h=l[u]=new Array(d),p,m,y=0;y<d;++y)(p=c[y])&&(m=e.call(p,p.__data__,y,c))&&("__data__"in p&&(m.__data__=p.__data__),h[y]=m,Bl(h[y],n,i,y,h,Jn(p,i)));return new jr(l,this._parents,n,i)}function fA(e){var n=this._name,i=this._id;typeof e!="function"&&(e=Ok(e));for(var s=this._groups,o=s.length,l=[],u=[],c=0;c<o;++c)for(var d=s[c],h=d.length,p,m=0;m<h;++m)if(p=d[m]){for(var y=e.call(p,p.__data__,m,d),x,N=Jn(p,i),_=0,S=y.length;_<S;++_)(x=y[_])&&Bl(x,n,i,_,y,N);l.push(y),u.push(p)}return new jr(l,u,n,i)}var dA=Zo.prototype.constructor;function hA(){return new dA(this._groups,this._parents)}function pA(e,n){var i,s,o;return function(){var l=Fs(this,e),u=(this.style.removeProperty(e),Fs(this,e));return l===u?null:l===i&&u===s?o:o=n(i=l,s=u)}}function sE(e){return function(){this.style.removeProperty(e)}}function mA(e,n,i){var s,o=i+"",l;return function(){var u=Fs(this,e);return u===o?null:u===s?l:l=n(s=u,i)}}function gA(e,n,i){var s,o,l;return function(){var u=Fs(this,e),c=i(this),d=c+"";return c==null&&(d=c=(this.style.removeProperty(e),Fs(this,e))),u===d?null:u===s&&d===o?l:(o=d,l=n(s=u,c))}}function vA(e,n){var i,s,o,l="style."+n,u="end."+l,c;return function(){var d=cr(this,e),h=d.on,p=d.value[l]==null?c||(c=sE(n)):void 0;(h!==i||o!==p)&&(s=(i=h).copy()).on(u,o=p),d.on=s}}function yA(e,n,i){var s=(e+="")=="transform"?yj:iE;return n==null?this.styleTween(e,pA(e,s)).on("end.style."+e,sE(e)):typeof n=="function"?this.styleTween(e,gA(e,s,Xg(this,"style."+e,n))).each(vA(this._id,e)):this.styleTween(e,mA(e,s,n),i).on("end.style."+e,null)}function wA(e,n,i){return function(s){this.style.setProperty(e,n.call(this,s),i)}}function xA(e,n,i){var s,o;function l(){var u=n.apply(this,arguments);return u!==o&&(s=(o=u)&&wA(e,u,i)),s}return l._value=n,l}function _A(e,n,i){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(n==null)return this.tween(s,null);if(typeof n!="function")throw new Error;return this.tween(s,xA(e,n,i??""))}function SA(e){return function(){this.textContent=e}}function bA(e){return function(){var n=e(this);this.textContent=n??""}}function kA(e){return this.tween("text",typeof e=="function"?bA(Xg(this,"text",e)):SA(e==null?"":e+""))}function EA(e){return function(n){this.textContent=e.call(this,n)}}function NA(e){var n,i;function s(){var o=e.apply(this,arguments);return o!==i&&(n=(i=o)&&EA(o)),n}return s._value=e,s}function CA(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,NA(e))}function RA(){for(var e=this._name,n=this._id,i=oE(),s=this._groups,o=s.length,l=0;l<o;++l)for(var u=s[l],c=u.length,d,h=0;h<c;++h)if(d=u[h]){var p=Jn(d,n);Bl(d,e,i,h,u,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new jr(s,this._parents,e,i)}function TA(){var e,n,i=this,s=i._id,o=i.size();return new Promise(function(l,u){var c={value:u},d={value:function(){--o===0&&l()}};i.each(function(){var h=cr(this,s),p=h.on;p!==e&&(n=(e=p).copy(),n._.cancel.push(c),n._.interrupt.push(c),n._.end.push(d)),h.on=n}),o===0&&l()})}var jA=0;function jr(e,n,i,s){this._groups=e,this._parents=n,this._name=i,this._id=s}function oE(){return++jA}var Nr=Zo.prototype;jr.prototype={constructor:jr,select:cA,selectAll:fA,selectChild:Nr.selectChild,selectChildren:Nr.selectChildren,filter:rA,merge:iA,selection:hA,transition:RA,call:Nr.call,nodes:Nr.nodes,node:Nr.node,size:Nr.size,empty:Nr.empty,each:Nr.each,on:aA,attr:zj,attrTween:Wj,style:yA,styleTween:_A,text:kA,textTween:CA,remove:uA,tween:Pj,delay:Kj,duration:Zj,ease:eA,easeVarying:nA,end:TA,[Symbol.iterator]:Nr[Symbol.iterator]};function AA(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var IA={time:null,delay:0,duration:250,ease:AA};function MA(e,n){for(var i;!(i=e.__transition)||!(i=i[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return i}function PA(e){var n,i;e instanceof jr?(n=e._id,e=e._name):(n=oE(),(i=IA).time=Yg(),e=e==null?null:e+"");for(var s=this._groups,o=s.length,l=0;l<o;++l)for(var u=s[l],c=u.length,d,h=0;h<c;++h)(d=u[h])&&Bl(d,e,n,h,u,i||MA(d,n));return new jr(s,this._parents,e,n)}Zo.prototype.interrupt=Aj;Zo.prototype.transition=PA;const hl=e=>()=>e;function OA(e,{sourceEvent:n,target:i,transform:s,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:o}})}function Rr(e,n,i){this.k=e,this.x=n,this.y=i}Rr.prototype={constructor:Rr,scale:function(e){return e===1?this:new Rr(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Rr(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Tr=new Rr(1,0,0);Rr.prototype;function Kc(e){e.stopImmediatePropagation()}function Io(e){e.preventDefault(),e.stopImmediatePropagation()}function qA(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function LA(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function xw(){return this.__zoom||Tr}function $A(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function DA(){return navigator.maxTouchPoints||"ontouchstart"in this}function FA(e,n,i){var s=e.invertX(n[0][0])-i[0][0],o=e.invertX(n[1][0])-i[1][0],l=e.invertY(n[0][1])-i[0][1],u=e.invertY(n[1][1])-i[1][1];return e.translate(o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function aE(){var e=qA,n=LA,i=FA,s=$A,o=DA,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,d=bj,h=Dl("start","zoom","end"),p,m,y,x=500,N=150,_=0,S=10;function b(A){A.property("__zoom",xw).on("wheel.zoom",O,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",q).filter(o).on("touchstart.zoom",F).on("touchmove.zoom",J).on("touchend.zoom touchcancel.zoom",Q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(A,V,B,ne){var X=A.selection?A.selection():A;X.property("__zoom",xw),A!==X?I(A,V,B,ne):X.interrupt().each(function(){P(this,arguments).event(ne).start().zoom(null,typeof V=="function"?V.apply(this,arguments):V).end()})},b.scaleBy=function(A,V,B,ne){b.scaleTo(A,function(){var X=this.__zoom.k,$=typeof V=="function"?V.apply(this,arguments):V;return X*$},B,ne)},b.scaleTo=function(A,V,B,ne){b.transform(A,function(){var X=n.apply(this,arguments),$=this.__zoom,G=B==null?C(X):typeof B=="function"?B.apply(this,arguments):B,j=$.invert(G),U=typeof V=="function"?V.apply(this,arguments):V;return i(E(k($,U),G,j),X,u)},B,ne)},b.translateBy=function(A,V,B,ne){b.transform(A,function(){return i(this.__zoom.translate(typeof V=="function"?V.apply(this,arguments):V,typeof B=="function"?B.apply(this,arguments):B),n.apply(this,arguments),u)},null,ne)},b.translateTo=function(A,V,B,ne,X){b.transform(A,function(){var $=n.apply(this,arguments),G=this.__zoom,j=ne==null?C($):typeof ne=="function"?ne.apply(this,arguments):ne;return i(Tr.translate(j[0],j[1]).scale(G.k).translate(typeof V=="function"?-V.apply(this,arguments):-V,typeof B=="function"?-B.apply(this,arguments):-B),$,u)},ne,X)};function k(A,V){return V=Math.max(l[0],Math.min(l[1],V)),V===A.k?A:new Rr(V,A.x,A.y)}function E(A,V,B){var ne=V[0]-B[0]*A.k,X=V[1]-B[1]*A.k;return ne===A.x&&X===A.y?A:new Rr(A.k,ne,X)}function C(A){return[(+A[0][0]+ +A[1][0])/2,(+A[0][1]+ +A[1][1])/2]}function I(A,V,B,ne){A.on("start.zoom",function(){P(this,arguments).event(ne).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).event(ne).end()}).tween("zoom",function(){var X=this,$=arguments,G=P(X,$).event(ne),j=n.apply(X,$),U=B==null?C(j):typeof B=="function"?B.apply(X,$):B,le=Math.max(j[1][0]-j[0][0],j[1][1]-j[0][1]),z=X.__zoom,K=typeof V=="function"?V.apply(X,$):V,ee=d(z.invert(U).concat(le/z.k),K.invert(U).concat(le/K.k));return function(se){if(se===1)se=K;else{var oe=ee(se),pe=le/oe[2];se=new Rr(pe,U[0]-oe[0]*pe,U[1]-oe[1]*pe)}G.zoom(null,se)}})}function P(A,V,B){return!B&&A.__zooming||new L(A,V)}function L(A,V){this.that=A,this.args=V,this.active=0,this.sourceEvent=null,this.extent=n.apply(A,V),this.taps=0}L.prototype={event:function(A){return A&&(this.sourceEvent=A),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(A,V){return this.mouse&&A!=="mouse"&&(this.mouse[1]=V.invert(this.mouse[0])),this.touch0&&A!=="touch"&&(this.touch0[1]=V.invert(this.touch0[0])),this.touch1&&A!=="touch"&&(this.touch1[1]=V.invert(this.touch1[0])),this.that.__zoom=V,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(A){var V=Mn(this.that).datum();h.call(A,this.that,new OA(A,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:h}),V)}};function O(A,...V){if(!e.apply(this,arguments))return;var B=P(this,V).event(A),ne=this.__zoom,X=Math.max(l[0],Math.min(l[1],ne.k*Math.pow(2,s.apply(this,arguments)))),$=Kn(A);if(B.wheel)(B.mouse[0][0]!==$[0]||B.mouse[0][1]!==$[1])&&(B.mouse[1]=ne.invert(B.mouse[0]=$)),clearTimeout(B.wheel);else{if(ne.k===X)return;B.mouse=[$,ne.invert($)],Nl(this),B.start()}Io(A),B.wheel=setTimeout(G,N),B.zoom("mouse",i(E(k(ne,X),B.mouse[0],B.mouse[1]),B.extent,u));function G(){B.wheel=null,B.end()}}function R(A,...V){if(y||!e.apply(this,arguments))return;var B=A.currentTarget,ne=P(this,V,!0).event(A),X=Mn(A.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",le,!0),$=Kn(A,B),G=A.clientX,j=A.clientY;Wk(A.view),Kc(A),ne.mouse=[$,this.__zoom.invert($)],Nl(this),ne.start();function U(z){if(Io(z),!ne.moved){var K=z.clientX-G,ee=z.clientY-j;ne.moved=K*K+ee*ee>_}ne.event(z).zoom("mouse",i(E(ne.that.__zoom,ne.mouse[0]=Kn(z,B),ne.mouse[1]),ne.extent,u))}function le(z){X.on("mousemove.zoom mouseup.zoom",null),Gk(z.view,ne.moved),Io(z),ne.event(z).end()}}function q(A,...V){if(e.apply(this,arguments)){var B=this.__zoom,ne=Kn(A.changedTouches?A.changedTouches[0]:A,this),X=B.invert(ne),$=B.k*(A.shiftKey?.5:2),G=i(E(k(B,$),ne,X),n.apply(this,V),u);Io(A),c>0?Mn(this).transition().duration(c).call(I,G,ne,A):Mn(this).call(b.transform,G,ne,A)}}function F(A,...V){if(e.apply(this,arguments)){var B=A.touches,ne=B.length,X=P(this,V,A.changedTouches.length===ne).event(A),$,G,j,U;for(Kc(A),G=0;G<ne;++G)j=B[G],U=Kn(j,this),U=[U,this.__zoom.invert(U),j.identifier],X.touch0?!X.touch1&&X.touch0[2]!==U[2]&&(X.touch1=U,X.taps=0):(X.touch0=U,$=!0,X.taps=1+!!p);p&&(p=clearTimeout(p)),$&&(X.taps<2&&(m=U[0],p=setTimeout(function(){p=null},x)),Nl(this),X.start())}}function J(A,...V){if(this.__zooming){var B=P(this,V).event(A),ne=A.changedTouches,X=ne.length,$,G,j,U;for(Io(A),$=0;$<X;++$)G=ne[$],j=Kn(G,this),B.touch0&&B.touch0[2]===G.identifier?B.touch0[0]=j:B.touch1&&B.touch1[2]===G.identifier&&(B.touch1[0]=j);if(G=B.that.__zoom,B.touch1){var le=B.touch0[0],z=B.touch0[1],K=B.touch1[0],ee=B.touch1[1],se=(se=K[0]-le[0])*se+(se=K[1]-le[1])*se,oe=(oe=ee[0]-z[0])*oe+(oe=ee[1]-z[1])*oe;G=k(G,Math.sqrt(se/oe)),j=[(le[0]+K[0])/2,(le[1]+K[1])/2],U=[(z[0]+ee[0])/2,(z[1]+ee[1])/2]}else if(B.touch0)j=B.touch0[0],U=B.touch0[1];else return;B.zoom("touch",i(E(G,j,U),B.extent,u))}}function Q(A,...V){if(this.__zooming){var B=P(this,V).event(A),ne=A.changedTouches,X=ne.length,$,G;for(Kc(A),y&&clearTimeout(y),y=setTimeout(function(){y=null},x),$=0;$<X;++$)G=ne[$],B.touch0&&B.touch0[2]===G.identifier?delete B.touch0:B.touch1&&B.touch1[2]===G.identifier&&delete B.touch1;if(B.touch1&&!B.touch0&&(B.touch0=B.touch1,delete B.touch1),B.touch0)B.touch0[1]=this.__zoom.invert(B.touch0[0]);else if(B.end(),B.taps===2&&(G=Kn(G,this),Math.hypot(m[0]-G[0],m[1]-G[1])<S)){var j=Mn(this).on("dblclick.zoom");j&&j.apply(this,arguments)}}}return b.wheelDelta=function(A){return arguments.length?(s=typeof A=="function"?A:hl(+A),b):s},b.filter=function(A){return arguments.length?(e=typeof A=="function"?A:hl(!!A),b):e},b.touchable=function(A){return arguments.length?(o=typeof A=="function"?A:hl(!!A),b):o},b.extent=function(A){return arguments.length?(n=typeof A=="function"?A:hl([[+A[0][0],+A[0][1]],[+A[1][0],+A[1][1]]]),b):n},b.scaleExtent=function(A){return arguments.length?(l[0]=+A[0],l[1]=+A[1],b):[l[0],l[1]]},b.translateExtent=function(A){return arguments.length?(u[0][0]=+A[0][0],u[1][0]=+A[1][0],u[0][1]=+A[0][1],u[1][1]=+A[1][1],b):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},b.constrain=function(A){return arguments.length?(i=A,b):i},b.duration=function(A){return arguments.length?(c=+A,b):c},b.interpolate=function(A){return arguments.length?(d=A,b):d},b.on=function(){var A=h.on.apply(h,arguments);return A===h?b:A},b.clickDistance=function(A){return arguments.length?(_=(A=+A)*A,b):Math.sqrt(_)},b.tapDistance=function(A){return arguments.length?(S=+A,b):S},b}Ik();const Ul=M.createContext(null),zA=Ul.Provider,Ar={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,n)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?n.targetHandle:n.sourceHandle}", edge id: ${n.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},lE=Ar.error001();function Xe(e,n){const i=M.useContext(Ul);if(i===null)throw new Error(lE);return Mk(i,e,n)}const Rt=()=>{const e=M.useContext(Ul);if(e===null)throw new Error(lE);return M.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},BA=e=>e.userSelectionActive?"none":"all";function Qg({position:e,children:n,className:i,style:s,...o}){const l=Xe(BA),u=`${e}`.split("-");return ae.createElement("div",{className:Dt(["react-flow__panel",i,...u]),style:{...s,pointerEvents:l},...o},n)}function UA({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:ae.createElement(Qg,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},ae.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const HA=({x:e,y:n,label:i,labelStyle:s={},labelShowBg:o=!0,labelBgStyle:l={},labelBgPadding:u=[2,4],labelBgBorderRadius:c=2,children:d,className:h,...p})=>{const m=M.useRef(null),[y,x]=M.useState({x:0,y:0,width:0,height:0}),N=Dt(["react-flow__edge-textwrapper",h]);return M.useEffect(()=>{if(m.current){const _=m.current.getBBox();x({x:_.x,y:_.y,width:_.width,height:_.height})}},[i]),typeof i>"u"||!i?null:ae.createElement("g",{transform:`translate(${e-y.width/2} ${n-y.height/2})`,className:N,visibility:y.width?"visible":"hidden",...p},o&&ae.createElement("rect",{width:y.width+2*u[0],x:-u[0],y:-u[1],height:y.height+2*u[1],className:"react-flow__edge-textbg",style:l,rx:c,ry:c}),ae.createElement("text",{className:"react-flow__edge-text",y:y.height/2,dy:"0.3em",ref:m,style:s},i),d)};var VA=M.memo(HA);const Zg=e=>({width:e.offsetWidth,height:e.offsetHeight}),Bs=(e,n=0,i=1)=>Math.min(Math.max(e,n),i),Jg=(e={x:0,y:0},n)=>({x:Bs(e.x,n[0][0],n[1][0]),y:Bs(e.y,n[0][1],n[1][1])}),_w=(e,n,i)=>e<n?Bs(Math.abs(e-n),1,50)/50:e>i?-Bs(Math.abs(e-i),1,50)/50:0,uE=(e,n)=>{const i=_w(e.x,35,n.width-35)*20,s=_w(e.y,35,n.height-35)*20;return[i,s]},cE=e=>{var n;return((n=e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},fE=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),Yo=({x:e,y:n,width:i,height:s})=>({x:e,y:n,x2:e+i,y2:n+s}),dE=({x:e,y:n,x2:i,y2:s})=>({x:e,y:n,width:i-e,height:s-n}),Sw=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),WA=(e,n)=>dE(fE(Yo(e),Yo(n))),jg=(e,n)=>{const i=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),s=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(i*s)},GA=e=>Pn(e.width)&&Pn(e.height)&&Pn(e.x)&&Pn(e.y),Pn=e=>!isNaN(e)&&isFinite(e),pt=Symbol.for("internals"),hE=["Enter"," ","Escape"],YA=(e,n)=>{},KA=e=>"nativeEvent"in e;function Ag(e){var o,l;const n=KA(e)?e.nativeEvent:e,i=((l=(o=n.composedPath)==null?void 0:o.call(n))==null?void 0:l[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(i==null?void 0:i.nodeName)||(i==null?void 0:i.hasAttribute("contenteditable"))||!!(i!=null&&i.closest(".nokey"))}const pE=e=>"clientX"in e,fi=(e,n)=>{var l,u;const i=pE(e),s=i?e.clientX:(l=e.touches)==null?void 0:l[0].clientX,o=i?e.clientY:(u=e.touches)==null?void 0:u[0].clientY;return{x:s-((n==null?void 0:n.left)??0),y:o-((n==null?void 0:n.top)??0)}},Ml=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},ea=({id:e,path:n,labelX:i,labelY:s,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:y,interactionWidth:x=20})=>ae.createElement(ae.Fragment,null,ae.createElement("path",{id:e,style:p,d:n,fill:"none",className:"react-flow__edge-path",markerEnd:m,markerStart:y}),x&&ae.createElement("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:x,className:"react-flow__edge-interaction"}),o&&Pn(i)&&Pn(s)?ae.createElement(VA,{x:i,y:s,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h}):null);ea.displayName="BaseEdge";function Mo(e,n,i){return i===void 0?i:s=>{const o=n().edges.find(l=>l.id===e);o&&i(s,{...o})}}function mE({sourceX:e,sourceY:n,targetX:i,targetY:s}){const o=Math.abs(i-e)/2,l=i<e?i+o:i-o,u=Math.abs(s-n)/2,c=s<n?s+u:s-u;return[l,c,o,u]}function gE({sourceX:e,sourceY:n,targetX:i,targetY:s,sourceControlX:o,sourceControlY:l,targetControlX:u,targetControlY:c}){const d=e*.125+o*.375+u*.375+i*.125,h=n*.125+l*.375+c*.375+s*.125,p=Math.abs(d-e),m=Math.abs(h-n);return[d,h,p,m]}var Yi;(function(e){e.Strict="strict",e.Loose="loose"})(Yi||(Yi={}));var Ui;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ui||(Ui={}));var Ko;(function(e){e.Partial="partial",e.Full="full"})(Ko||(Ko={}));var ci;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ci||(ci={}));var Pl;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Pl||(Pl={}));var Ce;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ce||(Ce={}));function bw({pos:e,x1:n,y1:i,x2:s,y2:o}){return e===Ce.Left||e===Ce.Right?[.5*(n+s),i]:[n,.5*(i+o)]}function vE({sourceX:e,sourceY:n,sourcePosition:i=Ce.Bottom,targetX:s,targetY:o,targetPosition:l=Ce.Top}){const[u,c]=bw({pos:i,x1:e,y1:n,x2:s,y2:o}),[d,h]=bw({pos:l,x1:s,y1:o,x2:e,y2:n}),[p,m,y,x]=gE({sourceX:e,sourceY:n,targetX:s,targetY:o,sourceControlX:u,sourceControlY:c,targetControlX:d,targetControlY:h});return[`M${e},${n} C${u},${c} ${d},${h} ${s},${o}`,p,m,y,x]}const ev=M.memo(({sourceX:e,sourceY:n,targetX:i,targetY:s,sourcePosition:o=Ce.Bottom,targetPosition:l=Ce.Top,label:u,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:N,interactionWidth:_})=>{const[S,b,k]=vE({sourceX:e,sourceY:n,sourcePosition:o,targetX:i,targetY:s,targetPosition:l});return ae.createElement(ea,{path:S,labelX:b,labelY:k,label:u,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:N,interactionWidth:_})});ev.displayName="SimpleBezierEdge";const kw={[Ce.Left]:{x:-1,y:0},[Ce.Right]:{x:1,y:0},[Ce.Top]:{x:0,y:-1},[Ce.Bottom]:{x:0,y:1}},XA=({source:e,sourcePosition:n=Ce.Bottom,target:i})=>n===Ce.Left||n===Ce.Right?e.x<i.x?{x:1,y:0}:{x:-1,y:0}:e.y<i.y?{x:0,y:1}:{x:0,y:-1},Ew=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function QA({source:e,sourcePosition:n=Ce.Bottom,target:i,targetPosition:s=Ce.Top,center:o,offset:l}){const u=kw[n],c=kw[s],d={x:e.x+u.x*l,y:e.y+u.y*l},h={x:i.x+c.x*l,y:i.y+c.y*l},p=XA({source:d,sourcePosition:n,target:h}),m=p.x!==0?"x":"y",y=p[m];let x=[],N,_;const S={x:0,y:0},b={x:0,y:0},[k,E,C,I]=mE({sourceX:e.x,sourceY:e.y,targetX:i.x,targetY:i.y});if(u[m]*c[m]===-1){N=o.x??k,_=o.y??E;const L=[{x:N,y:d.y},{x:N,y:h.y}],O=[{x:d.x,y:_},{x:h.x,y:_}];u[m]===y?x=m==="x"?L:O:x=m==="x"?O:L}else{const L=[{x:d.x,y:h.y}],O=[{x:h.x,y:d.y}];if(m==="x"?x=u.x===y?O:L:x=u.y===y?L:O,n===s){const Q=Math.abs(e[m]-i[m]);if(Q<=l){const A=Math.min(l-1,l-Q);u[m]===y?S[m]=(d[m]>e[m]?-1:1)*A:b[m]=(h[m]>i[m]?-1:1)*A}}if(n!==s){const Q=m==="x"?"y":"x",A=u[m]===c[Q],V=d[Q]>h[Q],B=d[Q]<h[Q];(u[m]===1&&(!A&&V||A&&B)||u[m]!==1&&(!A&&B||A&&V))&&(x=m==="x"?L:O)}const R={x:d.x+S.x,y:d.y+S.y},q={x:h.x+b.x,y:h.y+b.y},F=Math.max(Math.abs(R.x-x[0].x),Math.abs(q.x-x[0].x)),J=Math.max(Math.abs(R.y-x[0].y),Math.abs(q.y-x[0].y));F>=J?(N=(R.x+q.x)/2,_=x[0].y):(N=x[0].x,_=(R.y+q.y)/2)}return[[e,{x:d.x+S.x,y:d.y+S.y},...x,{x:h.x+b.x,y:h.y+b.y},i],N,_,C,I]}function ZA(e,n,i,s){const o=Math.min(Ew(e,n)/2,Ew(n,i)/2,s),{x:l,y:u}=n;if(e.x===l&&l===i.x||e.y===u&&u===i.y)return`L${l} ${u}`;if(e.y===u){const h=e.x<i.x?-1:1,p=e.y<i.y?1:-1;return`L ${l+o*h},${u}Q ${l},${u} ${l},${u+o*p}`}const c=e.x<i.x?1:-1,d=e.y<i.y?-1:1;return`L ${l},${u+o*d}Q ${l},${u} ${l+o*c},${u}`}function Ig({sourceX:e,sourceY:n,sourcePosition:i=Ce.Bottom,targetX:s,targetY:o,targetPosition:l=Ce.Top,borderRadius:u=5,centerX:c,centerY:d,offset:h=20}){const[p,m,y,x,N]=QA({source:{x:e,y:n},sourcePosition:i,target:{x:s,y:o},targetPosition:l,center:{x:c,y:d},offset:h});return[p.reduce((S,b,k)=>{let E="";return k>0&&k<p.length-1?E=ZA(p[k-1],b,p[k+1],u):E=`${k===0?"M":"L"}${b.x} ${b.y}`,S+=E,S},""),m,y,x,N]}const Hl=M.memo(({sourceX:e,sourceY:n,targetX:i,targetY:s,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:p,sourcePosition:m=Ce.Bottom,targetPosition:y=Ce.Top,markerEnd:x,markerStart:N,pathOptions:_,interactionWidth:S})=>{const[b,k,E]=Ig({sourceX:e,sourceY:n,sourcePosition:m,targetX:i,targetY:s,targetPosition:y,borderRadius:_==null?void 0:_.borderRadius,offset:_==null?void 0:_.offset});return ae.createElement(ea,{path:b,labelX:k,labelY:E,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:x,markerStart:N,interactionWidth:S})});Hl.displayName="SmoothStepEdge";const tv=M.memo(e=>{var n;return ae.createElement(Hl,{...e,pathOptions:M.useMemo(()=>{var i;return{borderRadius:0,offset:(i=e.pathOptions)==null?void 0:i.offset}},[(n=e.pathOptions)==null?void 0:n.offset])})});tv.displayName="StepEdge";function JA({sourceX:e,sourceY:n,targetX:i,targetY:s}){const[o,l,u,c]=mE({sourceX:e,sourceY:n,targetX:i,targetY:s});return[`M ${e},${n}L ${i},${s}`,o,l,u,c]}const nv=M.memo(({sourceX:e,sourceY:n,targetX:i,targetY:s,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:y,interactionWidth:x})=>{const[N,_,S]=JA({sourceX:e,sourceY:n,targetX:i,targetY:s});return ae.createElement(ea,{path:N,labelX:_,labelY:S,label:o,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:y,interactionWidth:x})});nv.displayName="StraightEdge";function pl(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function Nw({pos:e,x1:n,y1:i,x2:s,y2:o,c:l}){switch(e){case Ce.Left:return[n-pl(n-s,l),i];case Ce.Right:return[n+pl(s-n,l),i];case Ce.Top:return[n,i-pl(i-o,l)];case Ce.Bottom:return[n,i+pl(o-i,l)]}}function yE({sourceX:e,sourceY:n,sourcePosition:i=Ce.Bottom,targetX:s,targetY:o,targetPosition:l=Ce.Top,curvature:u=.25}){const[c,d]=Nw({pos:i,x1:e,y1:n,x2:s,y2:o,c:u}),[h,p]=Nw({pos:l,x1:s,y1:o,x2:e,y2:n,c:u}),[m,y,x,N]=gE({sourceX:e,sourceY:n,targetX:s,targetY:o,sourceControlX:c,sourceControlY:d,targetControlX:h,targetControlY:p});return[`M${e},${n} C${c},${d} ${h},${p} ${s},${o}`,m,y,x,N]}const Ol=M.memo(({sourceX:e,sourceY:n,targetX:i,targetY:s,sourcePosition:o=Ce.Bottom,targetPosition:l=Ce.Top,label:u,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:N,pathOptions:_,interactionWidth:S})=>{const[b,k,E]=yE({sourceX:e,sourceY:n,sourcePosition:o,targetX:i,targetY:s,targetPosition:l,curvature:_==null?void 0:_.curvature});return ae.createElement(ea,{path:b,labelX:k,labelY:E,label:u,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:N,interactionWidth:S})});Ol.displayName="BezierEdge";const rv=M.createContext(null),eI=rv.Provider;rv.Consumer;const tI=()=>M.useContext(rv),nI=e=>"id"in e&&"source"in e&&"target"in e,rI=({source:e,sourceHandle:n,target:i,targetHandle:s})=>`reactflow__edge-${e}${n||""}-${i}${s||""}`,Mg=(e,n)=>typeof e>"u"?"":typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`,iI=(e,n)=>n.some(i=>i.source===e.source&&i.target===e.target&&(i.sourceHandle===e.sourceHandle||!i.sourceHandle&&!e.sourceHandle)&&(i.targetHandle===e.targetHandle||!i.targetHandle&&!e.targetHandle)),sI=(e,n)=>{if(!e.source||!e.target)return n;let i;return nI(e)?i={...e}:i={...e,id:rI(e)},iI(i,n)?n:n.concat(i)},Pg=({x:e,y:n},[i,s,o],l,[u,c])=>{const d={x:(e-i)/o,y:(n-s)/o};return l?{x:u*Math.round(d.x/u),y:c*Math.round(d.y/c)}:d},wE=({x:e,y:n},[i,s,o])=>({x:e*o+i,y:n*o+s}),Vi=(e,n=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const i=(e.width??0)*n[0],s=(e.height??0)*n[1],o={x:e.position.x-i,y:e.position.y-s};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-i,y:e.positionAbsolute.y-s}:o}},Vl=(e,n=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const i=e.reduce((s,o)=>{const{x:l,y:u}=Vi(o,n).positionAbsolute;return fE(s,Yo({x:l,y:u,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return dE(i)},xE=(e,n,[i,s,o]=[0,0,1],l=!1,u=!1,c=[0,0])=>{const d={x:(n.x-i)/o,y:(n.y-s)/o,width:n.width/o,height:n.height/o},h=[];return e.forEach(p=>{const{width:m,height:y,selectable:x=!0,hidden:N=!1}=p;if(u&&!x||N)return!1;const{positionAbsolute:_}=Vi(p,c),S={x:_.x,y:_.y,width:m||0,height:y||0},b=jg(d,S),k=typeof m>"u"||typeof y>"u"||m===null||y===null,E=l&&b>0,C=(m||0)*(y||0);(k||E||b>=C||p.dragging)&&h.push(p)}),h},_E=(e,n)=>{const i=e.map(s=>s.id);return n.filter(s=>i.includes(s.source)||i.includes(s.target))},SE=(e,n,i,s,o,l=.1)=>{const u=n/(e.width*(1+l)),c=i/(e.height*(1+l)),d=Math.min(u,c),h=Bs(d,s,o),p=e.x+e.width/2,m=e.y+e.height/2,y=n/2-p*h,x=i/2-m*h;return{x:y,y:x,zoom:h}},zi=(e,n=0)=>e.transition().duration(n);function Cw(e,n,i,s){return(n[i]||[]).reduce((o,l)=>{var u,c;return`${e.id}-${l.id}-${i}`!==s&&o.push({id:l.id||null,type:i,nodeId:e.id,x:(((u=e.positionAbsolute)==null?void 0:u.x)??0)+l.x+l.width/2,y:(((c=e.positionAbsolute)==null?void 0:c.y)??0)+l.y+l.height/2}),o},[])}function oI(e,n,i,s,o,l){const{x:u,y:c}=fi(e),h=n.elementsFromPoint(u,c).find(N=>N.classList.contains("react-flow__handle"));if(h){const N=h.getAttribute("data-nodeid");if(N){const _=iv(void 0,h),S=h.getAttribute("data-handleid"),b=l({nodeId:N,id:S,type:_});if(b){const k=o.find(E=>E.nodeId===N&&E.type===_&&E.id===S);return{handle:{id:S,type:_,nodeId:N,x:(k==null?void 0:k.x)||i.x,y:(k==null?void 0:k.y)||i.y},validHandleResult:b}}}}let p=[],m=1/0;if(o.forEach(N=>{const _=Math.sqrt((N.x-i.x)**2+(N.y-i.y)**2);if(_<=s){const S=l(N);_<=m&&(_<m?p=[{handle:N,validHandleResult:S}]:_===m&&p.push({handle:N,validHandleResult:S}),m=_)}}),!p.length)return{handle:null,validHandleResult:bE()};if(p.length===1)return p[0];const y=p.some(({validHandleResult:N})=>N.isValid),x=p.some(({handle:N})=>N.type==="target");return p.find(({handle:N,validHandleResult:_})=>x?N.type==="target":y?_.isValid:!0)||p[0]}const aI={source:null,target:null,sourceHandle:null,targetHandle:null},bE=()=>({handleDomNode:null,isValid:!1,connection:aI,endHandle:null});function kE(e,n,i,s,o,l,u){const c=o==="target",d=u.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),h={...bE(),handleDomNode:d};if(d){const p=iv(void 0,d),m=d.getAttribute("data-nodeid"),y=d.getAttribute("data-handleid"),x=d.classList.contains("connectable"),N=d.classList.contains("connectableend"),_={source:c?m:i,sourceHandle:c?y:s,target:c?i:m,targetHandle:c?s:y};h.connection=_,x&&N&&(n===Yi.Strict?c&&p==="source"||!c&&p==="target":m!==i||y!==s)&&(h.endHandle={nodeId:m,handleId:y,type:p},h.isValid=l(_))}return h}function lI({nodes:e,nodeId:n,handleId:i,handleType:s}){return e.reduce((o,l)=>{if(l[pt]){const{handleBounds:u}=l[pt];let c=[],d=[];u&&(c=Cw(l,u,"source",`${n}-${i}-${s}`),d=Cw(l,u,"target",`${n}-${i}-${s}`)),o.push(...c,...d)}return o},[])}function iv(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function Xc(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function uI(e,n){let i=null;return n?i="valid":e&&!n&&(i="invalid"),i}function EE({event:e,handleId:n,nodeId:i,onConnect:s,isTarget:o,getState:l,setState:u,isValidConnection:c,edgeUpdaterType:d,onReconnectEnd:h}){const p=cE(e.target),{connectionMode:m,domNode:y,autoPanOnConnect:x,connectionRadius:N,onConnectStart:_,panBy:S,getNodes:b,cancelConnection:k}=l();let E=0,C;const{x:I,y:P}=fi(e),L=p==null?void 0:p.elementFromPoint(I,P),O=iv(d,L),R=y==null?void 0:y.getBoundingClientRect();if(!R||!O)return;let q,F=fi(e,R),J=!1,Q=null,A=!1,V=null;const B=lI({nodes:b(),nodeId:i,handleId:n,handleType:O}),ne=()=>{if(!x)return;const[G,j]=uE(F,R);S({x:G,y:j}),E=requestAnimationFrame(ne)};u({connectionPosition:F,connectionStatus:null,connectionNodeId:i,connectionHandleId:n,connectionHandleType:O,connectionStartHandle:{nodeId:i,handleId:n,type:O},connectionEndHandle:null}),_==null||_(e,{nodeId:i,handleId:n,handleType:O});function X(G){const{transform:j}=l();F=fi(G,R);const{handle:U,validHandleResult:le}=oI(G,p,Pg(F,j,!1,[1,1]),N,B,z=>kE(z,m,i,n,o?"target":"source",c,p));if(C=U,J||(ne(),J=!0),V=le.handleDomNode,Q=le.connection,A=le.isValid,u({connectionPosition:C&&A?wE({x:C.x,y:C.y},j):F,connectionStatus:uI(!!C,A),connectionEndHandle:le.endHandle}),!C&&!A&&!V)return Xc(q);Q.source!==Q.target&&V&&(Xc(q),q=V,V.classList.add("connecting","react-flow__handle-connecting"),V.classList.toggle("valid",A),V.classList.toggle("react-flow__handle-valid",A))}function $(G){var j,U;(C||V)&&Q&&A&&(s==null||s(Q)),(U=(j=l()).onConnectEnd)==null||U.call(j,G),d&&(h==null||h(G)),Xc(q),k(),cancelAnimationFrame(E),J=!1,A=!1,Q=null,V=null,p.removeEventListener("mousemove",X),p.removeEventListener("mouseup",$),p.removeEventListener("touchmove",X),p.removeEventListener("touchend",$)}p.addEventListener("mousemove",X),p.addEventListener("mouseup",$),p.addEventListener("touchmove",X),p.addEventListener("touchend",$)}const Rw=()=>!0,cI=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),fI=(e,n,i)=>s=>{const{connectionStartHandle:o,connectionEndHandle:l,connectionClickStartHandle:u}=s;return{connecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===n&&(o==null?void 0:o.type)===i||(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.handleId)===n&&(l==null?void 0:l.type)===i,clickConnecting:(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.handleId)===n&&(u==null?void 0:u.type)===i}},NE=M.forwardRef(({type:e="source",position:n=Ce.Top,isValidConnection:i,isConnectable:s=!0,isConnectableStart:o=!0,isConnectableEnd:l=!0,id:u,onConnect:c,children:d,className:h,onMouseDown:p,onTouchStart:m,...y},x)=>{var R,q;const N=u||null,_=e==="target",S=Rt(),b=tI(),{connectOnClick:k,noPanClassName:E}=Xe(cI,Ct),{connecting:C,clickConnecting:I}=Xe(fI(b,N,e),Ct);b||(q=(R=S.getState()).onError)==null||q.call(R,"010",Ar.error010());const P=F=>{const{defaultEdgeOptions:J,onConnect:Q,hasDefaultEdges:A}=S.getState(),V={...J,...F};if(A){const{edges:B,setEdges:ne}=S.getState();ne(sI(V,B))}Q==null||Q(V),c==null||c(V)},L=F=>{if(!b)return;const J=pE(F);o&&(J&&F.button===0||!J)&&EE({event:F,handleId:N,nodeId:b,onConnect:P,isTarget:_,getState:S.getState,setState:S.setState,isValidConnection:i||S.getState().isValidConnection||Rw}),J?p==null||p(F):m==null||m(F)},O=F=>{const{onClickConnectStart:J,onClickConnectEnd:Q,connectionClickStartHandle:A,connectionMode:V,isValidConnection:B}=S.getState();if(!b||!A&&!o)return;if(!A){J==null||J(F,{nodeId:b,handleId:N,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:b,type:e,handleId:N}});return}const ne=cE(F.target),X=i||B||Rw,{connection:$,isValid:G}=kE({nodeId:b,id:N,type:e},V,A.nodeId,A.handleId||null,A.type,X,ne);G&&P($),Q==null||Q(F),S.setState({connectionClickStartHandle:null})};return ae.createElement("div",{"data-handleid":N,"data-nodeid":b,"data-handlepos":n,"data-id":`${b}-${N}-${e}`,className:Dt(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",E,h,{source:!_,target:_,connectable:s,connectablestart:o,connectableend:l,connecting:I,connectionindicator:s&&(o&&!C||l&&C)}]),onMouseDown:L,onTouchStart:L,onClick:k?O:void 0,ref:x,...y},d)});NE.displayName="Handle";var Us=M.memo(NE);const CE=({data:e,isConnectable:n,targetPosition:i=Ce.Top,sourcePosition:s=Ce.Bottom})=>ae.createElement(ae.Fragment,null,ae.createElement(Us,{type:"target",position:i,isConnectable:n}),e==null?void 0:e.label,ae.createElement(Us,{type:"source",position:s,isConnectable:n}));CE.displayName="DefaultNode";var Og=M.memo(CE);const RE=({data:e,isConnectable:n,sourcePosition:i=Ce.Bottom})=>ae.createElement(ae.Fragment,null,e==null?void 0:e.label,ae.createElement(Us,{type:"source",position:i,isConnectable:n}));RE.displayName="InputNode";var TE=M.memo(RE);const jE=({data:e,isConnectable:n,targetPosition:i=Ce.Top})=>ae.createElement(ae.Fragment,null,ae.createElement(Us,{type:"target",position:i,isConnectable:n}),e==null?void 0:e.label);jE.displayName="OutputNode";var AE=M.memo(jE);const sv=()=>null;sv.displayName="GroupNode";const dI=e=>({selectedNodes:e.getNodes().filter(n=>n.selected),selectedEdges:e.edges.filter(n=>n.selected).map(n=>({...n}))}),ml=e=>e.id;function hI(e,n){return Ct(e.selectedNodes.map(ml),n.selectedNodes.map(ml))&&Ct(e.selectedEdges.map(ml),n.selectedEdges.map(ml))}const IE=M.memo(({onSelectionChange:e})=>{const n=Rt(),{selectedNodes:i,selectedEdges:s}=Xe(dI,hI);return M.useEffect(()=>{const o={nodes:i,edges:s};e==null||e(o),n.getState().onSelectionChange.forEach(l=>l(o))},[i,s,e]),null});IE.displayName="SelectionListener";const pI=e=>!!e.onSelectionChange;function mI({onSelectionChange:e}){const n=Xe(pI);return e||n?ae.createElement(IE,{onSelectionChange:e}):null}const gI=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function Ts(e,n){M.useEffect(()=>{typeof e<"u"&&n(e)},[e])}function Le(e,n,i){M.useEffect(()=>{typeof n<"u"&&i({[e]:n})},[n])}const vI=({nodes:e,edges:n,defaultNodes:i,defaultEdges:s,onConnect:o,onConnectStart:l,onConnectEnd:u,onClickConnectStart:c,onClickConnectEnd:d,nodesDraggable:h,nodesConnectable:p,nodesFocusable:m,edgesFocusable:y,edgesUpdatable:x,elevateNodesOnSelect:N,minZoom:_,maxZoom:S,nodeExtent:b,onNodesChange:k,onEdgesChange:E,elementsSelectable:C,connectionMode:I,snapGrid:P,snapToGrid:L,translateExtent:O,connectOnClick:R,defaultEdgeOptions:q,fitView:F,fitViewOptions:J,onNodesDelete:Q,onEdgesDelete:A,onNodeDrag:V,onNodeDragStart:B,onNodeDragStop:ne,onSelectionDrag:X,onSelectionDragStart:$,onSelectionDragStop:G,noPanClassName:j,nodeOrigin:U,rfId:le,autoPanOnConnect:z,autoPanOnNodeDrag:K,onError:ee,connectionRadius:se,isValidConnection:oe,nodeDragThreshold:pe})=>{const{setNodes:ge,setEdges:Ae,setDefaultNodesAndEdges:Oe,setMinZoom:Ie,setMaxZoom:Me,setTranslateExtent:ke,setNodeExtent:He,reset:ve}=Xe(gI,Ct),ye=Rt();return M.useEffect(()=>{const Ve=s==null?void 0:s.map(dt=>({...dt,...q}));return Oe(i,Ve),()=>{ve()}},[]),Le("defaultEdgeOptions",q,ye.setState),Le("connectionMode",I,ye.setState),Le("onConnect",o,ye.setState),Le("onConnectStart",l,ye.setState),Le("onConnectEnd",u,ye.setState),Le("onClickConnectStart",c,ye.setState),Le("onClickConnectEnd",d,ye.setState),Le("nodesDraggable",h,ye.setState),Le("nodesConnectable",p,ye.setState),Le("nodesFocusable",m,ye.setState),Le("edgesFocusable",y,ye.setState),Le("edgesUpdatable",x,ye.setState),Le("elementsSelectable",C,ye.setState),Le("elevateNodesOnSelect",N,ye.setState),Le("snapToGrid",L,ye.setState),Le("snapGrid",P,ye.setState),Le("onNodesChange",k,ye.setState),Le("onEdgesChange",E,ye.setState),Le("connectOnClick",R,ye.setState),Le("fitViewOnInit",F,ye.setState),Le("fitViewOnInitOptions",J,ye.setState),Le("onNodesDelete",Q,ye.setState),Le("onEdgesDelete",A,ye.setState),Le("onNodeDrag",V,ye.setState),Le("onNodeDragStart",B,ye.setState),Le("onNodeDragStop",ne,ye.setState),Le("onSelectionDrag",X,ye.setState),Le("onSelectionDragStart",$,ye.setState),Le("onSelectionDragStop",G,ye.setState),Le("noPanClassName",j,ye.setState),Le("nodeOrigin",U,ye.setState),Le("rfId",le,ye.setState),Le("autoPanOnConnect",z,ye.setState),Le("autoPanOnNodeDrag",K,ye.setState),Le("onError",ee,ye.setState),Le("connectionRadius",se,ye.setState),Le("isValidConnection",oe,ye.setState),Le("nodeDragThreshold",pe,ye.setState),Ts(e,ge),Ts(n,Ae),Ts(_,Ie),Ts(S,Me),Ts(O,ke),Ts(b,He),null},Tw={display:"none"},yI={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ME="react-flow__node-desc",PE="react-flow__edge-desc",wI="react-flow__aria-live",xI=e=>e.ariaLiveMessage;function _I({rfId:e}){const n=Xe(xI);return ae.createElement("div",{id:`${wI}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:yI},n)}function SI({rfId:e,disableKeyboardA11y:n}){return ae.createElement(ae.Fragment,null,ae.createElement("div",{id:`${ME}-${e}`,style:Tw},"Press enter or space to select a node.",!n&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),ae.createElement("div",{id:`${PE}-${e}`,style:Tw},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!n&&ae.createElement(_I,{rfId:e}))}var Xo=(e=null,n={actInsideInputWithModifier:!0})=>{const[i,s]=M.useState(!1),o=M.useRef(!1),l=M.useRef(new Set([])),[u,c]=M.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.split("+")),p=h.reduce((m,y)=>m.concat(...y),[]);return[h,p]}return[[],[]]},[e]);return M.useEffect(()=>{const d=typeof document<"u"?document:null,h=(n==null?void 0:n.target)||d;if(e!==null){const p=x=>{if(o.current=x.ctrlKey||x.metaKey||x.shiftKey,(!o.current||o.current&&!n.actInsideInputWithModifier)&&Ag(x))return!1;const _=Aw(x.code,c);l.current.add(x[_]),jw(u,l.current,!1)&&(x.preventDefault(),s(!0))},m=x=>{if((!o.current||o.current&&!n.actInsideInputWithModifier)&&Ag(x))return!1;const _=Aw(x.code,c);jw(u,l.current,!0)?(s(!1),l.current.clear()):l.current.delete(x[_]),x.key==="Meta"&&l.current.clear(),o.current=!1},y=()=>{l.current.clear(),s(!1)};return h==null||h.addEventListener("keydown",p),h==null||h.addEventListener("keyup",m),window.addEventListener("blur",y),()=>{h==null||h.removeEventListener("keydown",p),h==null||h.removeEventListener("keyup",m),window.removeEventListener("blur",y)}}},[e,s]),i};function jw(e,n,i){return e.filter(s=>i||s.length===n.size).some(s=>s.every(o=>n.has(o)))}function Aw(e,n){return n.includes(e)?"code":"key"}function OE(e,n,i,s){var c,d;const o=e.parentNode||e.parentId;if(!o)return i;const l=n.get(o),u=Vi(l,s);return OE(l,n,{x:(i.x??0)+u.x,y:(i.y??0)+u.y,z:(((c=l[pt])==null?void 0:c.z)??0)>(i.z??0)?((d=l[pt])==null?void 0:d.z)??0:i.z??0},s)}function qE(e,n,i){e.forEach(s=>{var l;const o=s.parentNode||s.parentId;if(o&&!e.has(o))throw new Error(`Parent node ${o} not found`);if(o||i!=null&&i[s.id]){const{x:u,y:c,z:d}=OE(s,e,{...s.position,z:((l=s[pt])==null?void 0:l.z)??0},n);s.positionAbsolute={x:u,y:c},s[pt].z=d,i!=null&&i[s.id]&&(s[pt].isParent=!0)}})}function Qc(e,n,i,s){const o=new Map,l={},u=s?1e3:0;return e.forEach(c=>{var x;const d=(Pn(c.zIndex)?c.zIndex:0)+(c.selected?u:0),h=n.get(c.id),p={...c,positionAbsolute:{x:c.position.x,y:c.position.y}},m=c.parentNode||c.parentId;m&&(l[m]=!0);const y=(h==null?void 0:h.type)&&(h==null?void 0:h.type)!==c.type;Object.defineProperty(p,pt,{enumerable:!1,value:{handleBounds:y||(x=h==null?void 0:h[pt])==null?void 0:x.handleBounds,z:d}}),o.set(c.id,p)}),qE(o,i,l),o}function LE(e,n={}){const{getNodes:i,width:s,height:o,minZoom:l,maxZoom:u,d3Zoom:c,d3Selection:d,fitViewOnInitDone:h,fitViewOnInit:p,nodeOrigin:m}=e(),y=n.initial&&!h&&p;if(c&&d&&(y||!n.initial)){const N=i().filter(S=>{var k;const b=n.includeHiddenNodes?S.width&&S.height:!S.hidden;return(k=n.nodes)!=null&&k.length?b&&n.nodes.some(E=>E.id===S.id):b}),_=N.every(S=>S.width&&S.height);if(N.length>0&&_){const S=Vl(N,m),{x:b,y:k,zoom:E}=SE(S,s,o,n.minZoom??l,n.maxZoom??u,n.padding??.1),C=Tr.translate(b,k).scale(E);return typeof n.duration=="number"&&n.duration>0?c.transform(zi(d,n.duration),C):c.transform(d,C),!0}}return!1}function bI(e,n){return e.forEach(i=>{const s=n.get(i.id);s&&n.set(s.id,{...s,[pt]:s[pt],selected:i.selected})}),new Map(n)}function kI(e,n){return n.map(i=>{const s=e.find(o=>o.id===i.id);return s&&(i.selected=s.selected),i})}function gl({changedNodes:e,changedEdges:n,get:i,set:s}){const{nodeInternals:o,edges:l,onNodesChange:u,onEdgesChange:c,hasDefaultNodes:d,hasDefaultEdges:h}=i();e!=null&&e.length&&(d&&s({nodeInternals:bI(e,o)}),u==null||u(e)),n!=null&&n.length&&(h&&s({edges:kI(n,l)}),c==null||c(n))}const js=()=>{},EI={zoomIn:js,zoomOut:js,zoomTo:js,getZoom:()=>1,setViewport:js,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:js,fitBounds:js,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},NI=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),CI=()=>{const e=Rt(),{d3Zoom:n,d3Selection:i}=Xe(NI,Ct);return M.useMemo(()=>i&&n?{zoomIn:o=>n.scaleBy(zi(i,o==null?void 0:o.duration),1.2),zoomOut:o=>n.scaleBy(zi(i,o==null?void 0:o.duration),1/1.2),zoomTo:(o,l)=>n.scaleTo(zi(i,l==null?void 0:l.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,l)=>{const[u,c,d]=e.getState().transform,h=Tr.translate(o.x??u,o.y??c).scale(o.zoom??d);n.transform(zi(i,l==null?void 0:l.duration),h)},getViewport:()=>{const[o,l,u]=e.getState().transform;return{x:o,y:l,zoom:u}},fitView:o=>LE(e.getState,o),setCenter:(o,l,u)=>{const{width:c,height:d,maxZoom:h}=e.getState(),p=typeof(u==null?void 0:u.zoom)<"u"?u.zoom:h,m=c/2-o*p,y=d/2-l*p,x=Tr.translate(m,y).scale(p);n.transform(zi(i,u==null?void 0:u.duration),x)},fitBounds:(o,l)=>{const{width:u,height:c,minZoom:d,maxZoom:h}=e.getState(),{x:p,y:m,zoom:y}=SE(o,u,c,d,h,(l==null?void 0:l.padding)??.1),x=Tr.translate(p,m).scale(y);n.transform(zi(i,l==null?void 0:l.duration),x)},project:o=>{const{transform:l,snapToGrid:u,snapGrid:c}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Pg(o,l,u,c)},screenToFlowPosition:o=>{const{transform:l,snapToGrid:u,snapGrid:c,domNode:d}=e.getState();if(!d)return o;const{x:h,y:p}=d.getBoundingClientRect(),m={x:o.x-h,y:o.y-p};return Pg(m,l,u,c)},flowToScreenPosition:o=>{const{transform:l,domNode:u}=e.getState();if(!u)return o;const{x:c,y:d}=u.getBoundingClientRect(),h=wE(o,l);return{x:h.x+c,y:h.y+d}},viewportInitialized:!0}:EI,[n,i])};function ta(){const e=CI(),n=Rt(),i=M.useCallback(()=>n.getState().getNodes().map(_=>({..._})),[]),s=M.useCallback(_=>n.getState().nodeInternals.get(_),[]),o=M.useCallback(()=>{const{edges:_=[]}=n.getState();return _.map(S=>({...S}))},[]),l=M.useCallback(_=>{const{edges:S=[]}=n.getState();return S.find(b=>b.id===_)},[]),u=M.useCallback(_=>{const{getNodes:S,setNodes:b,hasDefaultNodes:k,onNodesChange:E}=n.getState(),C=S(),I=typeof _=="function"?_(C):_;if(k)b(I);else if(E){const P=I.length===0?C.map(L=>({type:"remove",id:L.id})):I.map(L=>({item:L,type:"reset"}));E(P)}},[]),c=M.useCallback(_=>{const{edges:S=[],setEdges:b,hasDefaultEdges:k,onEdgesChange:E}=n.getState(),C=typeof _=="function"?_(S):_;if(k)b(C);else if(E){const I=C.length===0?S.map(P=>({type:"remove",id:P.id})):C.map(P=>({item:P,type:"reset"}));E(I)}},[]),d=M.useCallback(_=>{const S=Array.isArray(_)?_:[_],{getNodes:b,setNodes:k,hasDefaultNodes:E,onNodesChange:C}=n.getState();if(E){const P=[...b(),...S];k(P)}else if(C){const I=S.map(P=>({item:P,type:"add"}));C(I)}},[]),h=M.useCallback(_=>{const S=Array.isArray(_)?_:[_],{edges:b=[],setEdges:k,hasDefaultEdges:E,onEdgesChange:C}=n.getState();if(E)k([...b,...S]);else if(C){const I=S.map(P=>({item:P,type:"add"}));C(I)}},[]),p=M.useCallback(()=>{const{getNodes:_,edges:S=[],transform:b}=n.getState(),[k,E,C]=b;return{nodes:_().map(I=>({...I})),edges:S.map(I=>({...I})),viewport:{x:k,y:E,zoom:C}}},[]),m=M.useCallback(({nodes:_,edges:S})=>{const{nodeInternals:b,getNodes:k,edges:E,hasDefaultNodes:C,hasDefaultEdges:I,onNodesDelete:P,onEdgesDelete:L,onNodesChange:O,onEdgesChange:R}=n.getState(),q=(_||[]).map(V=>V.id),F=(S||[]).map(V=>V.id),J=k().reduce((V,B)=>{const ne=B.parentNode||B.parentId,X=!q.includes(B.id)&&ne&&V.find(G=>G.id===ne);return(typeof B.deletable=="boolean"?B.deletable:!0)&&(q.includes(B.id)||X)&&V.push(B),V},[]),Q=E.filter(V=>typeof V.deletable=="boolean"?V.deletable:!0),A=Q.filter(V=>F.includes(V.id));if(J||A){const V=_E(J,Q),B=[...A,...V],ne=B.reduce((X,$)=>(X.includes($.id)||X.push($.id),X),[]);if((I||C)&&(I&&n.setState({edges:E.filter(X=>!ne.includes(X.id))}),C&&(J.forEach(X=>{b.delete(X.id)}),n.setState({nodeInternals:new Map(b)}))),ne.length>0&&(L==null||L(B),R&&R(ne.map(X=>({id:X,type:"remove"})))),J.length>0&&(P==null||P(J),O)){const X=J.map($=>({id:$.id,type:"remove"}));O(X)}}},[]),y=M.useCallback(_=>{const S=GA(_),b=S?null:n.getState().nodeInternals.get(_.id);return!S&&!b?[null,null,S]:[S?_:Sw(b),b,S]},[]),x=M.useCallback((_,S=!0,b)=>{const[k,E,C]=y(_);return k?(b||n.getState().getNodes()).filter(I=>{if(!C&&(I.id===E.id||!I.positionAbsolute))return!1;const P=Sw(I),L=jg(P,k);return S&&L>0||L>=k.width*k.height}):[]},[]),N=M.useCallback((_,S,b=!0)=>{const[k]=y(_);if(!k)return!1;const E=jg(k,S);return b&&E>0||E>=k.width*k.height},[]);return M.useMemo(()=>({...e,getNodes:i,getNode:s,getEdges:o,getEdge:l,setNodes:u,setEdges:c,addNodes:d,addEdges:h,toObject:p,deleteElements:m,getIntersectingNodes:x,isNodeIntersecting:N}),[e,i,s,o,l,u,c,d,h,p,m,x,N])}const RI={actInsideInputWithModifier:!1};var TI=({deleteKeyCode:e,multiSelectionKeyCode:n})=>{const i=Rt(),{deleteElements:s}=ta(),o=Xo(e,RI),l=Xo(n);M.useEffect(()=>{if(o){const{edges:u,getNodes:c}=i.getState(),d=c().filter(p=>p.selected),h=u.filter(p=>p.selected);s({nodes:d,edges:h}),i.setState({nodesSelectionActive:!1})}},[o]),M.useEffect(()=>{i.setState({multiSelectionActive:l})},[l])};function jI(e){const n=Rt();M.useEffect(()=>{let i;const s=()=>{var l,u;if(!e.current)return;const o=Zg(e.current);(o.height===0||o.width===0)&&((u=(l=n.getState()).onError)==null||u.call(l,"004",Ar.error004())),n.setState({width:o.width||500,height:o.height||500})};return s(),window.addEventListener("resize",s),e.current&&(i=new ResizeObserver(()=>s()),i.observe(e.current)),()=>{window.removeEventListener("resize",s),i&&e.current&&i.unobserve(e.current)}},[])}const ov={position:"absolute",width:"100%",height:"100%",top:0,left:0},AI=(e,n)=>e.x!==n.x||e.y!==n.y||e.zoom!==n.k,vl=e=>({x:e.x,y:e.y,zoom:e.k}),As=(e,n)=>e.target.closest(`.${n}`),Iw=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),Mw=e=>{const n=e.ctrlKey&&Ml()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n},II=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),MI=({onMove:e,onMoveStart:n,onMoveEnd:i,onPaneContextMenu:s,zoomOnScroll:o=!0,zoomOnPinch:l=!0,panOnScroll:u=!1,panOnScrollSpeed:c=.5,panOnScrollMode:d=Ui.Free,zoomOnDoubleClick:h=!0,elementsSelectable:p,panOnDrag:m=!0,defaultViewport:y,translateExtent:x,minZoom:N,maxZoom:_,zoomActivationKeyCode:S,preventScrolling:b=!0,children:k,noWheelClassName:E,noPanClassName:C})=>{const I=M.useRef(),P=Rt(),L=M.useRef(!1),O=M.useRef(!1),R=M.useRef(null),q=M.useRef({x:0,y:0,zoom:0}),{d3Zoom:F,d3Selection:J,d3ZoomHandler:Q,userSelectionActive:A}=Xe(II,Ct),V=Xo(S),B=M.useRef(0),ne=M.useRef(!1),X=M.useRef();return jI(R),M.useEffect(()=>{if(R.current){const $=R.current.getBoundingClientRect(),G=aE().scaleExtent([N,_]).translateExtent(x),j=Mn(R.current).call(G),U=Tr.translate(y.x,y.y).scale(Bs(y.zoom,N,_)),le=[[0,0],[$.width,$.height]],z=G.constrain()(U,le,x);G.transform(j,z),G.wheelDelta(Mw),P.setState({d3Zoom:G,d3Selection:j,d3ZoomHandler:j.on("wheel.zoom"),transform:[z.x,z.y,z.k],domNode:R.current.closest(".react-flow")})}},[]),M.useEffect(()=>{J&&F&&(u&&!V&&!A?J.on("wheel.zoom",$=>{if(As($,E))return!1;$.preventDefault(),$.stopImmediatePropagation();const G=J.property("__zoom").k||1;if($.ctrlKey&&l){const oe=Kn($),pe=Mw($),ge=G*Math.pow(2,pe);F.scaleTo(J,ge,oe,$);return}const j=$.deltaMode===1?20:1;let U=d===Ui.Vertical?0:$.deltaX*j,le=d===Ui.Horizontal?0:$.deltaY*j;!Ml()&&$.shiftKey&&d!==Ui.Vertical&&(U=$.deltaY*j,le=0),F.translateBy(J,-(U/G)*c,-(le/G)*c,{internal:!0});const z=vl(J.property("__zoom")),{onViewportChangeStart:K,onViewportChange:ee,onViewportChangeEnd:se}=P.getState();clearTimeout(X.current),ne.current||(ne.current=!0,n==null||n($,z),K==null||K(z)),ne.current&&(e==null||e($,z),ee==null||ee(z),X.current=setTimeout(()=>{i==null||i($,z),se==null||se(z),ne.current=!1},150))},{passive:!1}):typeof Q<"u"&&J.on("wheel.zoom",function($,G){if(!b&&$.type==="wheel"&&!$.ctrlKey||As($,E))return null;$.preventDefault(),Q.call(this,$,G)},{passive:!1}))},[A,u,d,J,F,Q,V,l,b,E,n,e,i]),M.useEffect(()=>{F&&F.on("start",$=>{var U,le;if(!$.sourceEvent||$.sourceEvent.internal)return null;B.current=(U=$.sourceEvent)==null?void 0:U.button;const{onViewportChangeStart:G}=P.getState(),j=vl($.transform);L.current=!0,q.current=j,((le=$.sourceEvent)==null?void 0:le.type)==="mousedown"&&P.setState({paneDragging:!0}),G==null||G(j),n==null||n($.sourceEvent,j)})},[F,n]),M.useEffect(()=>{F&&(A&&!L.current?F.on("zoom",null):A||F.on("zoom",$=>{var j;const{onViewportChange:G}=P.getState();if(P.setState({transform:[$.transform.x,$.transform.y,$.transform.k]}),O.current=!!(s&&Iw(m,B.current??0)),(e||G)&&!((j=$.sourceEvent)!=null&&j.internal)){const U=vl($.transform);G==null||G(U),e==null||e($.sourceEvent,U)}}))},[A,F,e,m,s]),M.useEffect(()=>{F&&F.on("end",$=>{if(!$.sourceEvent||$.sourceEvent.internal)return null;const{onViewportChangeEnd:G}=P.getState();if(L.current=!1,P.setState({paneDragging:!1}),s&&Iw(m,B.current??0)&&!O.current&&s($.sourceEvent),O.current=!1,(i||G)&&AI(q.current,$.transform)){const j=vl($.transform);q.current=j,clearTimeout(I.current),I.current=setTimeout(()=>{G==null||G(j),i==null||i($.sourceEvent,j)},u?150:0)}})},[F,u,m,i,s]),M.useEffect(()=>{F&&F.filter($=>{const G=V||o,j=l&&$.ctrlKey;if((m===!0||Array.isArray(m)&&m.includes(1))&&$.button===1&&$.type==="mousedown"&&(As($,"react-flow__node")||As($,"react-flow__edge")))return!0;if(!m&&!G&&!u&&!h&&!l||A||!h&&$.type==="dblclick"||As($,E)&&$.type==="wheel"||As($,C)&&($.type!=="wheel"||u&&$.type==="wheel"&&!V)||!l&&$.ctrlKey&&$.type==="wheel"||!G&&!u&&!j&&$.type==="wheel"||!m&&($.type==="mousedown"||$.type==="touchstart")||Array.isArray(m)&&!m.includes($.button)&&$.type==="mousedown")return!1;const U=Array.isArray(m)&&m.includes($.button)||!$.button||$.button<=1;return(!$.ctrlKey||$.type==="wheel")&&U})},[A,F,o,l,u,h,m,p,V]),ae.createElement("div",{className:"react-flow__renderer",ref:R,style:ov},k)},PI=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function OI(){const{userSelectionActive:e,userSelectionRect:n}=Xe(PI,Ct);return e&&n?ae.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}function Pw(e,n){const i=n.parentNode||n.parentId,s=e.find(o=>o.id===i);if(s){const o=n.position.x+n.width-s.width,l=n.position.y+n.height-s.height;if(o>0||l>0||n.position.x<0||n.position.y<0){if(s.style={...s.style},s.style.width=s.style.width??s.width,s.style.height=s.style.height??s.height,o>0&&(s.style.width+=o),l>0&&(s.style.height+=l),n.position.x<0){const u=Math.abs(n.position.x);s.position.x=s.position.x-u,s.style.width+=u,n.position.x=0}if(n.position.y<0){const u=Math.abs(n.position.y);s.position.y=s.position.y-u,s.style.height+=u,n.position.y=0}s.width=s.style.width,s.height=s.style.height}}}function qI(e,n){if(e.some(s=>s.type==="reset"))return e.filter(s=>s.type==="reset").map(s=>s.item);const i=e.filter(s=>s.type==="add").map(s=>s.item);return n.reduce((s,o)=>{const l=e.filter(c=>c.id===o.id);if(l.length===0)return s.push(o),s;const u={...o};for(const c of l)if(c)switch(c.type){case"select":{u.selected=c.selected;break}case"position":{typeof c.position<"u"&&(u.position=c.position),typeof c.positionAbsolute<"u"&&(u.positionAbsolute=c.positionAbsolute),typeof c.dragging<"u"&&(u.dragging=c.dragging),u.expandParent&&Pw(s,u);break}case"dimensions":{typeof c.dimensions<"u"&&(u.width=c.dimensions.width,u.height=c.dimensions.height),typeof c.updateStyle<"u"&&(u.style={...u.style||{},...c.dimensions}),typeof c.resizing=="boolean"&&(u.resizing=c.resizing),u.expandParent&&Pw(s,u);break}case"remove":return s}return s.push(u),s},i)}function LI(e,n){return qI(e,n)}const ui=(e,n)=>({id:e,type:"select",selected:n});function Ps(e,n){return e.reduce((i,s)=>{const o=n.includes(s.id);return!s.selected&&o?(s.selected=!0,i.push(ui(s.id,!0))):s.selected&&!o&&(s.selected=!1,i.push(ui(s.id,!1))),i},[])}const Zc=(e,n)=>i=>{i.target===n.current&&(e==null||e(i))},$I=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),$E=M.memo(({isSelecting:e,selectionMode:n=Ko.Full,panOnDrag:i,onSelectionStart:s,onSelectionEnd:o,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:c,onPaneMouseEnter:d,onPaneMouseMove:h,onPaneMouseLeave:p,children:m})=>{const y=M.useRef(null),x=Rt(),N=M.useRef(0),_=M.useRef(0),S=M.useRef(),{userSelectionActive:b,elementsSelectable:k,dragging:E}=Xe($I,Ct),C=()=>{x.setState({userSelectionActive:!1,userSelectionRect:null}),N.current=0,_.current=0},I=Q=>{l==null||l(Q),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},P=Q=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){Q.preventDefault();return}u==null||u(Q)},L=c?Q=>c(Q):void 0,O=Q=>{const{resetSelectedElements:A,domNode:V}=x.getState();if(S.current=V==null?void 0:V.getBoundingClientRect(),!k||!e||Q.button!==0||Q.target!==y.current||!S.current)return;const{x:B,y:ne}=fi(Q,S.current);A(),x.setState({userSelectionRect:{width:0,height:0,startX:B,startY:ne,x:B,y:ne}}),s==null||s(Q)},R=Q=>{const{userSelectionRect:A,nodeInternals:V,edges:B,transform:ne,onNodesChange:X,onEdgesChange:$,nodeOrigin:G,getNodes:j}=x.getState();if(!e||!S.current||!A)return;x.setState({userSelectionActive:!0,nodesSelectionActive:!1});const U=fi(Q,S.current),le=A.startX??0,z=A.startY??0,K={...A,x:U.x<le?U.x:le,y:U.y<z?U.y:z,width:Math.abs(U.x-le),height:Math.abs(U.y-z)},ee=j(),se=xE(V,K,ne,n===Ko.Partial,!0,G),oe=_E(se,B).map(ge=>ge.id),pe=se.map(ge=>ge.id);if(N.current!==pe.length){N.current=pe.length;const ge=Ps(ee,pe);ge.length&&(X==null||X(ge))}if(_.current!==oe.length){_.current=oe.length;const ge=Ps(B,oe);ge.length&&($==null||$(ge))}x.setState({userSelectionRect:K})},q=Q=>{if(Q.button!==0)return;const{userSelectionRect:A}=x.getState();!b&&A&&Q.target===y.current&&(I==null||I(Q)),x.setState({nodesSelectionActive:N.current>0}),C(),o==null||o(Q)},F=Q=>{b&&(x.setState({nodesSelectionActive:N.current>0}),o==null||o(Q)),C()},J=k&&(e||b);return ae.createElement("div",{className:Dt(["react-flow__pane",{dragging:E,selection:e}]),onClick:J?void 0:Zc(I,y),onContextMenu:Zc(P,y),onWheel:Zc(L,y),onMouseEnter:J?void 0:d,onMouseDown:J?O:void 0,onMouseMove:J?R:h,onMouseUp:J?q:void 0,onMouseLeave:J?F:p,ref:y,style:ov},m,ae.createElement(OI,null))});$E.displayName="Pane";function DE(e,n){const i=e.parentNode||e.parentId;if(!i)return!1;const s=n.get(i);return s?s.selected?!0:DE(s,n):!1}function Ow(e,n,i){let s=e;do{if(s!=null&&s.matches(n))return!0;if(s===i.current)return!1;s=s.parentElement}while(s);return!1}function DI(e,n,i,s){return Array.from(e.values()).filter(o=>(o.selected||o.id===s)&&(!o.parentNode||o.parentId||!DE(o,e))&&(o.draggable||n&&typeof o.draggable>"u")).map(o=>{var l,u;return{id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:i.x-(((l=o.positionAbsolute)==null?void 0:l.x)??0),y:i.y-(((u=o.positionAbsolute)==null?void 0:u.y)??0)},delta:{x:0,y:0},extent:o.extent,parentNode:o.parentNode||o.parentId,parentId:o.parentNode||o.parentId,width:o.width,height:o.height,expandParent:o.expandParent}})}function FI(e,n){return!n||n==="parent"?n:[n[0],[n[1][0]-(e.width||0),n[1][1]-(e.height||0)]]}function FE(e,n,i,s,o=[0,0],l){const u=FI(e,e.extent||s);let c=u;const d=e.parentNode||e.parentId;if(e.extent==="parent"&&!e.expandParent)if(d&&e.width&&e.height){const m=i.get(d),{x:y,y:x}=Vi(m,o).positionAbsolute;c=m&&Pn(y)&&Pn(x)&&Pn(m.width)&&Pn(m.height)?[[y+e.width*o[0],x+e.height*o[1]],[y+m.width-e.width+e.width*o[0],x+m.height-e.height+e.height*o[1]]]:c}else l==null||l("005",Ar.error005()),c=u;else if(e.extent&&d&&e.extent!=="parent"){const m=i.get(d),{x:y,y:x}=Vi(m,o).positionAbsolute;c=[[e.extent[0][0]+y,e.extent[0][1]+x],[e.extent[1][0]+y,e.extent[1][1]+x]]}let h={x:0,y:0};if(d){const m=i.get(d);h=Vi(m,o).positionAbsolute}const p=c&&c!=="parent"?Jg(n,c):n;return{position:{x:p.x-h.x,y:p.y-h.y},positionAbsolute:p}}function Jc({nodeId:e,dragItems:n,nodeInternals:i}){const s=n.map(o=>({...i.get(o.id),position:o.position,positionAbsolute:o.positionAbsolute}));return[e?s.find(o=>o.id===e):s[0],s]}const qw=(e,n,i,s)=>{const o=n.querySelectorAll(e);if(!o||!o.length)return null;const l=Array.from(o),u=n.getBoundingClientRect(),c={x:u.width*s[0],y:u.height*s[1]};return l.map(d=>{const h=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),position:d.getAttribute("data-handlepos"),x:(h.left-u.left-c.x)/i,y:(h.top-u.top-c.y)/i,...Zg(d)}})};function Po(e,n,i){return i===void 0?i:s=>{const o=n().nodeInternals.get(e);o&&i(s,{...o})}}function qg({id:e,store:n,unselect:i=!1,nodeRef:s}){const{addSelectedNodes:o,unselectNodesAndEdges:l,multiSelectionActive:u,nodeInternals:c,onError:d}=n.getState(),h=c.get(e);if(!h){d==null||d("012",Ar.error012(e));return}n.setState({nodesSelectionActive:!1}),h.selected?(i||h.selected&&u)&&(l({nodes:[h],edges:[]}),requestAnimationFrame(()=>{var p;return(p=s==null?void 0:s.current)==null?void 0:p.blur()})):o([e])}function zI(){const e=Rt();return M.useCallback(({sourceEvent:i})=>{const{transform:s,snapGrid:o,snapToGrid:l}=e.getState(),u=i.touches?i.touches[0].clientX:i.clientX,c=i.touches?i.touches[0].clientY:i.clientY,d={x:(u-s[0])/s[2],y:(c-s[1])/s[2]};return{xSnapped:l?o[0]*Math.round(d.x/o[0]):d.x,ySnapped:l?o[1]*Math.round(d.y/o[1]):d.y,...d}},[])}function ef(e){return(n,i,s)=>e==null?void 0:e(n,s)}function zE({nodeRef:e,disabled:n=!1,noDragClassName:i,handleSelector:s,nodeId:o,isSelectable:l,selectNodesOnDrag:u}){const c=Rt(),[d,h]=M.useState(!1),p=M.useRef([]),m=M.useRef({x:null,y:null}),y=M.useRef(0),x=M.useRef(null),N=M.useRef({x:0,y:0}),_=M.useRef(null),S=M.useRef(!1),b=M.useRef(!1),k=M.useRef(!1),E=zI();return M.useEffect(()=>{if(e!=null&&e.current){const C=Mn(e.current),I=({x:O,y:R})=>{const{nodeInternals:q,onNodeDrag:F,onSelectionDrag:J,updateNodePositions:Q,nodeExtent:A,snapGrid:V,snapToGrid:B,nodeOrigin:ne,onError:X}=c.getState();m.current={x:O,y:R};let $=!1,G={x:0,y:0,x2:0,y2:0};if(p.current.length>1&&A){const U=Vl(p.current,ne);G=Yo(U)}if(p.current=p.current.map(U=>{const le={x:O-U.distance.x,y:R-U.distance.y};B&&(le.x=V[0]*Math.round(le.x/V[0]),le.y=V[1]*Math.round(le.y/V[1]));const z=[[A[0][0],A[0][1]],[A[1][0],A[1][1]]];p.current.length>1&&A&&!U.extent&&(z[0][0]=U.positionAbsolute.x-G.x+A[0][0],z[1][0]=U.positionAbsolute.x+(U.width??0)-G.x2+A[1][0],z[0][1]=U.positionAbsolute.y-G.y+A[0][1],z[1][1]=U.positionAbsolute.y+(U.height??0)-G.y2+A[1][1]);const K=FE(U,le,q,z,ne,X);return $=$||U.position.x!==K.position.x||U.position.y!==K.position.y,U.position=K.position,U.positionAbsolute=K.positionAbsolute,U}),!$)return;Q(p.current,!0,!0),h(!0);const j=o?F:ef(J);if(j&&_.current){const[U,le]=Jc({nodeId:o,dragItems:p.current,nodeInternals:q});j(_.current,U,le)}},P=()=>{if(!x.current)return;const[O,R]=uE(N.current,x.current);if(O!==0||R!==0){const{transform:q,panBy:F}=c.getState();m.current.x=(m.current.x??0)-O/q[2],m.current.y=(m.current.y??0)-R/q[2],F({x:O,y:R})&&I(m.current)}y.current=requestAnimationFrame(P)},L=O=>{var ne;const{nodeInternals:R,multiSelectionActive:q,nodesDraggable:F,unselectNodesAndEdges:J,onNodeDragStart:Q,onSelectionDragStart:A}=c.getState();b.current=!0;const V=o?Q:ef(A);(!u||!l)&&!q&&o&&((ne=R.get(o))!=null&&ne.selected||J()),o&&l&&u&&qg({id:o,store:c,nodeRef:e});const B=E(O);if(m.current=B,p.current=DI(R,F,B,o),V&&p.current){const[X,$]=Jc({nodeId:o,dragItems:p.current,nodeInternals:R});V(O.sourceEvent,X,$)}};if(n)C.on(".drag",null);else{const O=Q2().on("start",R=>{const{domNode:q,nodeDragThreshold:F}=c.getState();F===0&&L(R),k.current=!1;const J=E(R);m.current=J,x.current=(q==null?void 0:q.getBoundingClientRect())||null,N.current=fi(R.sourceEvent,x.current)}).on("drag",R=>{var Q,A;const q=E(R),{autoPanOnNodeDrag:F,nodeDragThreshold:J}=c.getState();if(R.sourceEvent.type==="touchmove"&&R.sourceEvent.touches.length>1&&(k.current=!0),!k.current){if(!S.current&&b.current&&F&&(S.current=!0,P()),!b.current){const V=q.xSnapped-(((Q=m==null?void 0:m.current)==null?void 0:Q.x)??0),B=q.ySnapped-(((A=m==null?void 0:m.current)==null?void 0:A.y)??0);Math.sqrt(V*V+B*B)>J&&L(R)}(m.current.x!==q.xSnapped||m.current.y!==q.ySnapped)&&p.current&&b.current&&(_.current=R.sourceEvent,N.current=fi(R.sourceEvent,x.current),I(q))}}).on("end",R=>{if(!(!b.current||k.current)&&(h(!1),S.current=!1,b.current=!1,cancelAnimationFrame(y.current),p.current)){const{updateNodePositions:q,nodeInternals:F,onNodeDragStop:J,onSelectionDragStop:Q}=c.getState(),A=o?J:ef(Q);if(q(p.current,!1,!1),A){const[V,B]=Jc({nodeId:o,dragItems:p.current,nodeInternals:F});A(R.sourceEvent,V,B)}}}).filter(R=>{const q=R.target;return!R.button&&(!i||!Ow(q,`.${i}`,e))&&(!s||Ow(q,s,e))});return C.call(O),()=>{C.on(".drag",null)}}}},[e,n,i,s,l,c,o,u,E]),d}function BE(){const e=Rt();return M.useCallback(i=>{const{nodeInternals:s,nodeExtent:o,updateNodePositions:l,getNodes:u,snapToGrid:c,snapGrid:d,onError:h,nodesDraggable:p}=e.getState(),m=u().filter(k=>k.selected&&(k.draggable||p&&typeof k.draggable>"u")),y=c?d[0]:5,x=c?d[1]:5,N=i.isShiftPressed?4:1,_=i.x*y*N,S=i.y*x*N,b=m.map(k=>{if(k.positionAbsolute){const E={x:k.positionAbsolute.x+_,y:k.positionAbsolute.y+S};c&&(E.x=d[0]*Math.round(E.x/d[0]),E.y=d[1]*Math.round(E.y/d[1]));const{positionAbsolute:C,position:I}=FE(k,E,s,o,void 0,h);k.position=I,k.positionAbsolute=C}return k});l(b,!0,!1)},[])}const $s={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Oo=e=>{const n=({id:i,type:s,data:o,xPos:l,yPos:u,xPosOrigin:c,yPosOrigin:d,selected:h,onClick:p,onMouseEnter:m,onMouseMove:y,onMouseLeave:x,onContextMenu:N,onDoubleClick:_,style:S,className:b,isDraggable:k,isSelectable:E,isConnectable:C,isFocusable:I,selectNodesOnDrag:P,sourcePosition:L,targetPosition:O,hidden:R,resizeObserver:q,dragHandle:F,zIndex:J,isParent:Q,noDragClassName:A,noPanClassName:V,initialized:B,disableKeyboardA11y:ne,ariaLabel:X,rfId:$,hasHandleBounds:G})=>{const j=Rt(),U=M.useRef(null),le=M.useRef(null),z=M.useRef(L),K=M.useRef(O),ee=M.useRef(s),se=E||k||p||m||y||x,oe=BE(),pe=Po(i,j.getState,m),ge=Po(i,j.getState,y),Ae=Po(i,j.getState,x),Oe=Po(i,j.getState,N),Ie=Po(i,j.getState,_),Me=ve=>{const{nodeDragThreshold:ye}=j.getState();if(E&&(!P||!k||ye>0)&&qg({id:i,store:j,nodeRef:U}),p){const Ve=j.getState().nodeInternals.get(i);Ve&&p(ve,{...Ve})}},ke=ve=>{if(!Ag(ve)&&!ne)if(hE.includes(ve.key)&&E){const ye=ve.key==="Escape";qg({id:i,store:j,unselect:ye,nodeRef:U})}else k&&h&&Object.prototype.hasOwnProperty.call($s,ve.key)&&(j.setState({ariaLiveMessage:`Moved selected node ${ve.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~l}, y: ${~~u}`}),oe({x:$s[ve.key].x,y:$s[ve.key].y,isShiftPressed:ve.shiftKey}))};M.useEffect(()=>()=>{le.current&&(q==null||q.unobserve(le.current),le.current=null)},[]),M.useEffect(()=>{if(U.current&&!R){const ve=U.current;(!B||!G||le.current!==ve)&&(le.current&&(q==null||q.unobserve(le.current)),q==null||q.observe(ve),le.current=ve)}},[R,B,G]),M.useEffect(()=>{const ve=ee.current!==s,ye=z.current!==L,Ve=K.current!==O;U.current&&(ve||ye||Ve)&&(ve&&(ee.current=s),ye&&(z.current=L),Ve&&(K.current=O),j.getState().updateNodeDimensions([{id:i,nodeElement:U.current,forceUpdate:!0}]))},[i,s,L,O]);const He=zE({nodeRef:U,disabled:R||!k,noDragClassName:A,handleSelector:F,nodeId:i,isSelectable:E,selectNodesOnDrag:P});return R?null:ae.createElement("div",{className:Dt(["react-flow__node",`react-flow__node-${s}`,{[V]:k},b,{selected:h,selectable:E,parent:Q,dragging:He}]),ref:U,style:{zIndex:J,transform:`translate(${c}px,${d}px)`,pointerEvents:se?"all":"none",visibility:B?"visible":"hidden",...S},"data-id":i,"data-testid":`rf__node-${i}`,onMouseEnter:pe,onMouseMove:ge,onMouseLeave:Ae,onContextMenu:Oe,onClick:Me,onDoubleClick:Ie,onKeyDown:I?ke:void 0,tabIndex:I?0:void 0,role:I?"button":void 0,"aria-describedby":ne?void 0:`${ME}-${$}`,"aria-label":X},ae.createElement(eI,{value:i},ae.createElement(e,{id:i,data:o,type:s,xPos:l,yPos:u,selected:h,isConnectable:C,sourcePosition:L,targetPosition:O,dragging:He,dragHandle:F,zIndex:J})))};return n.displayName="NodeWrapper",M.memo(n)};const BI=e=>{const n=e.getNodes().filter(i=>i.selected);return{...Vl(n,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function UI({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:i}){const s=Rt(),{width:o,height:l,x:u,y:c,transformString:d,userSelectionActive:h}=Xe(BI,Ct),p=BE(),m=M.useRef(null);if(M.useEffect(()=>{var N;i||(N=m.current)==null||N.focus({preventScroll:!0})},[i]),zE({nodeRef:m}),h||!o||!l)return null;const y=e?N=>{const _=s.getState().getNodes().filter(S=>S.selected);e(N,_)}:void 0,x=N=>{Object.prototype.hasOwnProperty.call($s,N.key)&&p({x:$s[N.key].x,y:$s[N.key].y,isShiftPressed:N.shiftKey})};return ae.createElement("div",{className:Dt(["react-flow__nodesselection","react-flow__container",n]),style:{transform:d}},ae.createElement("div",{ref:m,className:"react-flow__nodesselection-rect",onContextMenu:y,tabIndex:i?void 0:-1,onKeyDown:i?void 0:x,style:{width:o,height:l,top:c,left:u}}))}var HI=M.memo(UI);const VI=e=>e.nodesSelectionActive,UE=({children:e,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:l,onPaneScroll:u,deleteKeyCode:c,onMove:d,onMoveStart:h,onMoveEnd:p,selectionKeyCode:m,selectionOnDrag:y,selectionMode:x,onSelectionStart:N,onSelectionEnd:_,multiSelectionKeyCode:S,panActivationKeyCode:b,zoomActivationKeyCode:k,elementsSelectable:E,zoomOnScroll:C,zoomOnPinch:I,panOnScroll:P,panOnScrollSpeed:L,panOnScrollMode:O,zoomOnDoubleClick:R,panOnDrag:q,defaultViewport:F,translateExtent:J,minZoom:Q,maxZoom:A,preventScrolling:V,onSelectionContextMenu:B,noWheelClassName:ne,noPanClassName:X,disableKeyboardA11y:$})=>{const G=Xe(VI),j=Xo(m),U=Xo(b),le=U||q,z=U||P,K=j||y&&le!==!0;return TI({deleteKeyCode:c,multiSelectionKeyCode:S}),ae.createElement(MI,{onMove:d,onMoveStart:h,onMoveEnd:p,onPaneContextMenu:l,elementsSelectable:E,zoomOnScroll:C,zoomOnPinch:I,panOnScroll:z,panOnScrollSpeed:L,panOnScrollMode:O,zoomOnDoubleClick:R,panOnDrag:!j&&le,defaultViewport:F,translateExtent:J,minZoom:Q,maxZoom:A,zoomActivationKeyCode:k,preventScrolling:V,noWheelClassName:ne,noPanClassName:X},ae.createElement($E,{onSelectionStart:N,onSelectionEnd:_,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:l,onPaneScroll:u,panOnDrag:le,isSelecting:!!K,selectionMode:x},e,G&&ae.createElement(HI,{onSelectionContextMenu:B,noPanClassName:X,disableKeyboardA11y:$})))};UE.displayName="FlowRenderer";var WI=M.memo(UE);function GI(e){return Xe(M.useCallback(i=>e?xE(i.nodeInternals,{x:0,y:0,width:i.width,height:i.height},i.transform,!0):i.getNodes(),[e]))}function YI(e){const n={input:Oo(e.input||TE),default:Oo(e.default||Og),output:Oo(e.output||AE),group:Oo(e.group||sv)},i={},s=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,l)=>(o[l]=Oo(e[l]||Og),o),i);return{...n,...s}}const KI=({x:e,y:n,width:i,height:s,origin:o})=>!i||!s?{x:e,y:n}:o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:n}:{x:e-i*o[0],y:n-s*o[1]},XI=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),HE=e=>{const{nodesDraggable:n,nodesConnectable:i,nodesFocusable:s,elementsSelectable:o,updateNodeDimensions:l,onError:u}=Xe(XI,Ct),c=GI(e.onlyRenderVisibleElements),d=M.useRef(),h=M.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const p=new ResizeObserver(m=>{const y=m.map(x=>({id:x.target.getAttribute("data-id"),nodeElement:x.target,forceUpdate:!0}));l(y)});return d.current=p,p},[]);return M.useEffect(()=>()=>{var p;(p=d==null?void 0:d.current)==null||p.disconnect()},[]),ae.createElement("div",{className:"react-flow__nodes",style:ov},c.map(p=>{var I,P,L;let m=p.type||"default";e.nodeTypes[m]||(u==null||u("003",Ar.error003(m)),m="default");const y=e.nodeTypes[m]||e.nodeTypes.default,x=!!(p.draggable||n&&typeof p.draggable>"u"),N=!!(p.selectable||o&&typeof p.selectable>"u"),_=!!(p.connectable||i&&typeof p.connectable>"u"),S=!!(p.focusable||s&&typeof p.focusable>"u"),b=e.nodeExtent?Jg(p.positionAbsolute,e.nodeExtent):p.positionAbsolute,k=(b==null?void 0:b.x)??0,E=(b==null?void 0:b.y)??0,C=KI({x:k,y:E,width:p.width??0,height:p.height??0,origin:e.nodeOrigin});return ae.createElement(y,{key:p.id,id:p.id,className:p.className,style:p.style,type:m,data:p.data,sourcePosition:p.sourcePosition||Ce.Bottom,targetPosition:p.targetPosition||Ce.Top,hidden:p.hidden,xPos:k,yPos:E,xPosOrigin:C.x,yPosOrigin:C.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!p.selected,isDraggable:x,isSelectable:N,isConnectable:_,isFocusable:S,resizeObserver:h,dragHandle:p.dragHandle,zIndex:((I=p[pt])==null?void 0:I.z)??0,isParent:!!((P=p[pt])!=null&&P.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!p.width&&!!p.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:p.ariaLabel,hasHandleBounds:!!((L=p[pt])!=null&&L.handleBounds)})}))};HE.displayName="NodeRenderer";var QI=M.memo(HE);const ZI=(e,n,i)=>i===Ce.Left?e-n:i===Ce.Right?e+n:e,JI=(e,n,i)=>i===Ce.Top?e-n:i===Ce.Bottom?e+n:e,Lw="react-flow__edgeupdater",$w=({position:e,centerX:n,centerY:i,radius:s=10,onMouseDown:o,onMouseEnter:l,onMouseOut:u,type:c})=>ae.createElement("circle",{onMouseDown:o,onMouseEnter:l,onMouseOut:u,className:Dt([Lw,`${Lw}-${c}`]),cx:ZI(n,s,e),cy:JI(i,s,e),r:s,stroke:"transparent",fill:"transparent"}),eM=()=>!0;var Is=e=>{const n=({id:i,className:s,type:o,data:l,onClick:u,onEdgeDoubleClick:c,selected:d,animated:h,label:p,labelStyle:m,labelShowBg:y,labelBgStyle:x,labelBgPadding:N,labelBgBorderRadius:_,style:S,source:b,target:k,sourceX:E,sourceY:C,targetX:I,targetY:P,sourcePosition:L,targetPosition:O,elementsSelectable:R,hidden:q,sourceHandleId:F,targetHandleId:J,onContextMenu:Q,onMouseEnter:A,onMouseMove:V,onMouseLeave:B,reconnectRadius:ne,onReconnect:X,onReconnectStart:$,onReconnectEnd:G,markerEnd:j,markerStart:U,rfId:le,ariaLabel:z,isFocusable:K,isReconnectable:ee,pathOptions:se,interactionWidth:oe,disableKeyboardA11y:pe})=>{const ge=M.useRef(null),[Ae,Oe]=M.useState(!1),[Ie,Me]=M.useState(!1),ke=Rt(),He=M.useMemo(()=>`url('#${Mg(U,le)}')`,[U,le]),ve=M.useMemo(()=>`url('#${Mg(j,le)}')`,[j,le]);if(q)return null;const ye=tt=>{var jt;const{edges:xt,addSelectedEdges:lt,unselectNodesAndEdges:mt,multiSelectionActive:wn}=ke.getState(),bt=xt.find(xn=>xn.id===i);bt&&(R&&(ke.setState({nodesSelectionActive:!1}),bt.selected&&wn?(mt({nodes:[],edges:[bt]}),(jt=ge.current)==null||jt.blur()):lt([i])),u&&u(tt,bt))},Ve=Mo(i,ke.getState,c),dt=Mo(i,ke.getState,Q),Qe=Mo(i,ke.getState,A),We=Mo(i,ke.getState,V),$e=Mo(i,ke.getState,B),Ke=(tt,xt)=>{if(tt.button!==0)return;const{edges:lt,isValidConnection:mt}=ke.getState(),wn=xt?k:b,bt=(xt?J:F)||null,jt=xt?"target":"source",xn=mt||eM,Ln=xt,ut=lt.find(At=>At.id===i);Me(!0),$==null||$(tt,ut,jt);const Yt=At=>{Me(!1),G==null||G(At,ut,jt)};EE({event:tt,handleId:bt,nodeId:wn,onConnect:At=>X==null?void 0:X(ut,At),isTarget:Ln,getState:ke.getState,setState:ke.setState,isValidConnection:xn,edgeUpdaterType:jt,onReconnectEnd:Yt})},yt=tt=>Ke(tt,!0),et=tt=>Ke(tt,!1),Ge=()=>Oe(!0),wt=()=>Oe(!1),Tt=!R&&!u,Ft=tt=>{var xt;if(!pe&&hE.includes(tt.key)&&R){const{unselectNodesAndEdges:lt,addSelectedEdges:mt,edges:wn}=ke.getState();tt.key==="Escape"?((xt=ge.current)==null||xt.blur(),lt({edges:[wn.find(jt=>jt.id===i)]})):mt([i])}};return ae.createElement("g",{className:Dt(["react-flow__edge",`react-flow__edge-${o}`,s,{selected:d,animated:h,inactive:Tt,updating:Ae}]),onClick:ye,onDoubleClick:Ve,onContextMenu:dt,onMouseEnter:Qe,onMouseMove:We,onMouseLeave:$e,onKeyDown:K?Ft:void 0,tabIndex:K?0:void 0,role:K?"button":"img","data-testid":`rf__edge-${i}`,"aria-label":z===null?void 0:z||`Edge from ${b} to ${k}`,"aria-describedby":K?`${PE}-${le}`:void 0,ref:ge},!Ie&&ae.createElement(e,{id:i,source:b,target:k,selected:d,animated:h,label:p,labelStyle:m,labelShowBg:y,labelBgStyle:x,labelBgPadding:N,labelBgBorderRadius:_,data:l,style:S,sourceX:E,sourceY:C,targetX:I,targetY:P,sourcePosition:L,targetPosition:O,sourceHandleId:F,targetHandleId:J,markerStart:He,markerEnd:ve,pathOptions:se,interactionWidth:oe}),ee&&ae.createElement(ae.Fragment,null,(ee==="source"||ee===!0)&&ae.createElement($w,{position:L,centerX:E,centerY:C,radius:ne,onMouseDown:yt,onMouseEnter:Ge,onMouseOut:wt,type:"source"}),(ee==="target"||ee===!0)&&ae.createElement($w,{position:O,centerX:I,centerY:P,radius:ne,onMouseDown:et,onMouseEnter:Ge,onMouseOut:wt,type:"target"})))};return n.displayName="EdgeWrapper",M.memo(n)};function tM(e){const n={default:Is(e.default||Ol),straight:Is(e.bezier||nv),step:Is(e.step||tv),smoothstep:Is(e.step||Hl),simplebezier:Is(e.simplebezier||ev)},i={},s=Object.keys(e).filter(o=>!["default","bezier"].includes(o)).reduce((o,l)=>(o[l]=Is(e[l]||Ol),o),i);return{...n,...s}}function Dw(e,n,i=null){const s=((i==null?void 0:i.x)||0)+n.x,o=((i==null?void 0:i.y)||0)+n.y,l=(i==null?void 0:i.width)||n.width,u=(i==null?void 0:i.height)||n.height;switch(e){case Ce.Top:return{x:s+l/2,y:o};case Ce.Right:return{x:s+l,y:o+u/2};case Ce.Bottom:return{x:s+l/2,y:o+u};case Ce.Left:return{x:s,y:o+u/2}}}function Fw(e,n){return e?e.length===1||!n?e[0]:n&&e.find(i=>i.id===n)||null:null}const nM=(e,n,i,s,o,l)=>{const u=Dw(i,e,n),c=Dw(l,s,o);return{sourceX:u.x,sourceY:u.y,targetX:c.x,targetY:c.y}};function rM({sourcePos:e,targetPos:n,sourceWidth:i,sourceHeight:s,targetWidth:o,targetHeight:l,width:u,height:c,transform:d}){const h={x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x+i,n.x+o),y2:Math.max(e.y+s,n.y+l)};h.x===h.x2&&(h.x2+=1),h.y===h.y2&&(h.y2+=1);const p=Yo({x:(0-d[0])/d[2],y:(0-d[1])/d[2],width:u/d[2],height:c/d[2]}),m=Math.max(0,Math.min(p.x2,h.x2)-Math.max(p.x,h.x)),y=Math.max(0,Math.min(p.y2,h.y2)-Math.max(p.y,h.y));return Math.ceil(m*y)>0}function zw(e){var s,o,l,u,c;const n=((s=e==null?void 0:e[pt])==null?void 0:s.handleBounds)||null,i=n&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.x)<"u"&&typeof((l=e==null?void 0:e.positionAbsolute)==null?void 0:l.y)<"u";return[{x:((u=e==null?void 0:e.positionAbsolute)==null?void 0:u.x)||0,y:((c=e==null?void 0:e.positionAbsolute)==null?void 0:c.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},n,!!i]}const iM=[{level:0,isMaxLevel:!0,edges:[]}];function sM(e,n,i=!1){let s=-1;const o=e.reduce((u,c)=>{var p,m;const d=Pn(c.zIndex);let h=d?c.zIndex:0;if(i){const y=n.get(c.target),x=n.get(c.source),N=c.selected||(y==null?void 0:y.selected)||(x==null?void 0:x.selected),_=Math.max(((p=x==null?void 0:x[pt])==null?void 0:p.z)||0,((m=y==null?void 0:y[pt])==null?void 0:m.z)||0,1e3);h=(d?c.zIndex:0)+(N?_:0)}return u[h]?u[h].push(c):u[h]=[c],s=h>s?h:s,u},{}),l=Object.entries(o).map(([u,c])=>{const d=+u;return{edges:c,level:d,isMaxLevel:d===s}});return l.length===0?iM:l}function oM(e,n,i){const s=Xe(M.useCallback(o=>e?o.edges.filter(l=>{const u=n.get(l.source),c=n.get(l.target);return(u==null?void 0:u.width)&&(u==null?void 0:u.height)&&(c==null?void 0:c.width)&&(c==null?void 0:c.height)&&rM({sourcePos:u.positionAbsolute||{x:0,y:0},targetPos:c.positionAbsolute||{x:0,y:0},sourceWidth:u.width,sourceHeight:u.height,targetWidth:c.width,targetHeight:c.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[e,n]));return sM(s,n,i)}const aM=({color:e="none",strokeWidth:n=1})=>ae.createElement("polyline",{style:{stroke:e,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),lM=({color:e="none",strokeWidth:n=1})=>ae.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Bw={[Pl.Arrow]:aM,[Pl.ArrowClosed]:lM};function uM(e){const n=Rt();return M.useMemo(()=>{var o,l;return Object.prototype.hasOwnProperty.call(Bw,e)?Bw[e]:((l=(o=n.getState()).onError)==null||l.call(o,"009",Ar.error009(e)),null)},[e])}const cM=({id:e,type:n,color:i,width:s=12.5,height:o=12.5,markerUnits:l="strokeWidth",strokeWidth:u,orient:c="auto-start-reverse"})=>{const d=uM(n);return d?ae.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:c,refX:"0",refY:"0"},ae.createElement(d,{color:i,strokeWidth:u})):null},fM=({defaultColor:e,rfId:n})=>i=>{const s=[];return i.edges.reduce((o,l)=>([l.markerStart,l.markerEnd].forEach(u=>{if(u&&typeof u=="object"){const c=Mg(u,n);s.includes(c)||(o.push({id:c,color:u.color||e,...u}),s.push(c))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))},VE=({defaultColor:e,rfId:n})=>{const i=Xe(M.useCallback(fM({defaultColor:e,rfId:n}),[e,n]),(s,o)=>!(s.length!==o.length||s.some((l,u)=>l.id!==o[u].id)));return ae.createElement("defs",null,i.map(s=>ae.createElement(cM,{id:s.id,key:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient})))};VE.displayName="MarkerDefinitions";var dM=M.memo(VE);const hM=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),WE=({defaultMarkerColor:e,onlyRenderVisibleElements:n,elevateEdgesOnSelect:i,rfId:s,edgeTypes:o,noPanClassName:l,onEdgeContextMenu:u,onEdgeMouseEnter:c,onEdgeMouseMove:d,onEdgeMouseLeave:h,onEdgeClick:p,onEdgeDoubleClick:m,onReconnect:y,onReconnectStart:x,onReconnectEnd:N,reconnectRadius:_,children:S,disableKeyboardA11y:b})=>{const{edgesFocusable:k,edgesUpdatable:E,elementsSelectable:C,width:I,height:P,connectionMode:L,nodeInternals:O,onError:R}=Xe(hM,Ct),q=oM(n,O,i);return I?ae.createElement(ae.Fragment,null,q.map(({level:F,edges:J,isMaxLevel:Q})=>ae.createElement("svg",{key:F,style:{zIndex:F},width:I,height:P,className:"react-flow__edges react-flow__container"},Q&&ae.createElement(dM,{defaultColor:e,rfId:s}),ae.createElement("g",null,J.map(A=>{const[V,B,ne]=zw(O.get(A.source)),[X,$,G]=zw(O.get(A.target));if(!ne||!G)return null;let j=A.type||"default";o[j]||(R==null||R("011",Ar.error011(j)),j="default");const U=o[j]||o.default,le=L===Yi.Strict?$.target:($.target??[]).concat($.source??[]),z=Fw(B.source,A.sourceHandle),K=Fw(le,A.targetHandle),ee=(z==null?void 0:z.position)||Ce.Bottom,se=(K==null?void 0:K.position)||Ce.Top,oe=!!(A.focusable||k&&typeof A.focusable>"u"),pe=A.reconnectable||A.updatable,ge=typeof y<"u"&&(pe||E&&typeof pe>"u");if(!z||!K)return R==null||R("008",Ar.error008(z,A)),null;const{sourceX:Ae,sourceY:Oe,targetX:Ie,targetY:Me}=nM(V,z,ee,X,K,se);return ae.createElement(U,{key:A.id,id:A.id,className:Dt([A.className,l]),type:j,data:A.data,selected:!!A.selected,animated:!!A.animated,hidden:!!A.hidden,label:A.label,labelStyle:A.labelStyle,labelShowBg:A.labelShowBg,labelBgStyle:A.labelBgStyle,labelBgPadding:A.labelBgPadding,labelBgBorderRadius:A.labelBgBorderRadius,style:A.style,source:A.source,target:A.target,sourceHandleId:A.sourceHandle,targetHandleId:A.targetHandle,markerEnd:A.markerEnd,markerStart:A.markerStart,sourceX:Ae,sourceY:Oe,targetX:Ie,targetY:Me,sourcePosition:ee,targetPosition:se,elementsSelectable:C,onContextMenu:u,onMouseEnter:c,onMouseMove:d,onMouseLeave:h,onClick:p,onEdgeDoubleClick:m,onReconnect:y,onReconnectStart:x,onReconnectEnd:N,reconnectRadius:_,rfId:s,ariaLabel:A.ariaLabel,isFocusable:oe,isReconnectable:ge,pathOptions:"pathOptions"in A?A.pathOptions:void 0,interactionWidth:A.interactionWidth,disableKeyboardA11y:b})})))),S):null};WE.displayName="EdgeRenderer";var pM=M.memo(WE);const mM=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function gM({children:e}){const n=Xe(mM);return ae.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:n}},e)}function vM(e){const n=ta(),i=M.useRef(!1);M.useEffect(()=>{!i.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),i.current=!0)},[e,n.viewportInitialized])}const yM={[Ce.Left]:Ce.Right,[Ce.Right]:Ce.Left,[Ce.Top]:Ce.Bottom,[Ce.Bottom]:Ce.Top},GE=({nodeId:e,handleType:n,style:i,type:s=ci.Bezier,CustomComponent:o,connectionStatus:l})=>{var P,L,O;const{fromNode:u,handleId:c,toX:d,toY:h,connectionMode:p}=Xe(M.useCallback(R=>({fromNode:R.nodeInternals.get(e),handleId:R.connectionHandleId,toX:(R.connectionPosition.x-R.transform[0])/R.transform[2],toY:(R.connectionPosition.y-R.transform[1])/R.transform[2],connectionMode:R.connectionMode}),[e]),Ct),m=(P=u==null?void 0:u[pt])==null?void 0:P.handleBounds;let y=m==null?void 0:m[n];if(p===Yi.Loose&&(y=y||(m==null?void 0:m[n==="source"?"target":"source"])),!u||!y)return null;const x=c?y.find(R=>R.id===c):y[0],N=x?x.x+x.width/2:(u.width??0)/2,_=x?x.y+x.height/2:u.height??0,S=(((L=u.positionAbsolute)==null?void 0:L.x)??0)+N,b=(((O=u.positionAbsolute)==null?void 0:O.y)??0)+_,k=x==null?void 0:x.position,E=k?yM[k]:null;if(!k||!E)return null;if(o)return ae.createElement(o,{connectionLineType:s,connectionLineStyle:i,fromNode:u,fromHandle:x,fromX:S,fromY:b,toX:d,toY:h,fromPosition:k,toPosition:E,connectionStatus:l});let C="";const I={sourceX:S,sourceY:b,sourcePosition:k,targetX:d,targetY:h,targetPosition:E};return s===ci.Bezier?[C]=yE(I):s===ci.Step?[C]=Ig({...I,borderRadius:0}):s===ci.SmoothStep?[C]=Ig(I):s===ci.SimpleBezier?[C]=vE(I):C=`M${S},${b} ${d},${h}`,ae.createElement("path",{d:C,fill:"none",className:"react-flow__connection-path",style:i})};GE.displayName="ConnectionLine";const wM=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function xM({containerStyle:e,style:n,type:i,component:s}){const{nodeId:o,handleType:l,nodesConnectable:u,width:c,height:d,connectionStatus:h}=Xe(wM,Ct);return!(o&&l&&c&&u)?null:ae.createElement("svg",{style:e,width:c,height:d,className:"react-flow__edges react-flow__connectionline react-flow__container"},ae.createElement("g",{className:Dt(["react-flow__connection",h])},ae.createElement(GE,{nodeId:o,handleType:l,style:n,type:i,CustomComponent:s,connectionStatus:h})))}function Uw(e,n){return M.useRef(null),Rt(),M.useMemo(()=>n(e),[e])}const YE=({nodeTypes:e,edgeTypes:n,onMove:i,onMoveStart:s,onMoveEnd:o,onInit:l,onNodeClick:u,onEdgeClick:c,onNodeDoubleClick:d,onEdgeDoubleClick:h,onNodeMouseEnter:p,onNodeMouseMove:m,onNodeMouseLeave:y,onNodeContextMenu:x,onSelectionContextMenu:N,onSelectionStart:_,onSelectionEnd:S,connectionLineType:b,connectionLineStyle:k,connectionLineComponent:E,connectionLineContainerStyle:C,selectionKeyCode:I,selectionOnDrag:P,selectionMode:L,multiSelectionKeyCode:O,panActivationKeyCode:R,zoomActivationKeyCode:q,deleteKeyCode:F,onlyRenderVisibleElements:J,elementsSelectable:Q,selectNodesOnDrag:A,defaultViewport:V,translateExtent:B,minZoom:ne,maxZoom:X,preventScrolling:$,defaultMarkerColor:G,zoomOnScroll:j,zoomOnPinch:U,panOnScroll:le,panOnScrollSpeed:z,panOnScrollMode:K,zoomOnDoubleClick:ee,panOnDrag:se,onPaneClick:oe,onPaneMouseEnter:pe,onPaneMouseMove:ge,onPaneMouseLeave:Ae,onPaneScroll:Oe,onPaneContextMenu:Ie,onEdgeContextMenu:Me,onEdgeMouseEnter:ke,onEdgeMouseMove:He,onEdgeMouseLeave:ve,onReconnect:ye,onReconnectStart:Ve,onReconnectEnd:dt,reconnectRadius:Qe,noDragClassName:We,noWheelClassName:$e,noPanClassName:Ke,elevateEdgesOnSelect:yt,disableKeyboardA11y:et,nodeOrigin:Ge,nodeExtent:wt,rfId:Tt})=>{const Ft=Uw(e,YI),tt=Uw(n,tM);return vM(l),ae.createElement(WI,{onPaneClick:oe,onPaneMouseEnter:pe,onPaneMouseMove:ge,onPaneMouseLeave:Ae,onPaneContextMenu:Ie,onPaneScroll:Oe,deleteKeyCode:F,selectionKeyCode:I,selectionOnDrag:P,selectionMode:L,onSelectionStart:_,onSelectionEnd:S,multiSelectionKeyCode:O,panActivationKeyCode:R,zoomActivationKeyCode:q,elementsSelectable:Q,onMove:i,onMoveStart:s,onMoveEnd:o,zoomOnScroll:j,zoomOnPinch:U,zoomOnDoubleClick:ee,panOnScroll:le,panOnScrollSpeed:z,panOnScrollMode:K,panOnDrag:se,defaultViewport:V,translateExtent:B,minZoom:ne,maxZoom:X,onSelectionContextMenu:N,preventScrolling:$,noDragClassName:We,noWheelClassName:$e,noPanClassName:Ke,disableKeyboardA11y:et},ae.createElement(gM,null,ae.createElement(pM,{edgeTypes:tt,onEdgeClick:c,onEdgeDoubleClick:h,onlyRenderVisibleElements:J,onEdgeContextMenu:Me,onEdgeMouseEnter:ke,onEdgeMouseMove:He,onEdgeMouseLeave:ve,onReconnect:ye,onReconnectStart:Ve,onReconnectEnd:dt,reconnectRadius:Qe,defaultMarkerColor:G,noPanClassName:Ke,elevateEdgesOnSelect:!!yt,disableKeyboardA11y:et,rfId:Tt},ae.createElement(xM,{style:k,type:b,component:E,containerStyle:C})),ae.createElement("div",{className:"react-flow__edgelabel-renderer"}),ae.createElement(QI,{nodeTypes:Ft,onNodeClick:u,onNodeDoubleClick:d,onNodeMouseEnter:p,onNodeMouseMove:m,onNodeMouseLeave:y,onNodeContextMenu:x,selectNodesOnDrag:A,onlyRenderVisibleElements:J,noPanClassName:Ke,noDragClassName:We,disableKeyboardA11y:et,nodeOrigin:Ge,nodeExtent:wt,rfId:Tt})))};YE.displayName="GraphView";var _M=M.memo(YE);const Lg=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],ai={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:Lg,nodeExtent:Lg,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Yi.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:YA,isValidConnection:void 0},SM=()=>uT((e,n)=>({...ai,setNodes:i=>{const{nodeInternals:s,nodeOrigin:o,elevateNodesOnSelect:l}=n();e({nodeInternals:Qc(i,s,o,l)})},getNodes:()=>Array.from(n().nodeInternals.values()),setEdges:i=>{const{defaultEdgeOptions:s={}}=n();e({edges:i.map(o=>({...s,...o}))})},setDefaultNodesAndEdges:(i,s)=>{const o=typeof i<"u",l=typeof s<"u",u=o?Qc(i,new Map,n().nodeOrigin,n().elevateNodesOnSelect):new Map;e({nodeInternals:u,edges:l?s:[],hasDefaultNodes:o,hasDefaultEdges:l})},updateNodeDimensions:i=>{const{onNodesChange:s,nodeInternals:o,fitViewOnInit:l,fitViewOnInitDone:u,fitViewOnInitOptions:c,domNode:d,nodeOrigin:h}=n(),p=d==null?void 0:d.querySelector(".react-flow__viewport");if(!p)return;const m=window.getComputedStyle(p),{m22:y}=new window.DOMMatrixReadOnly(m.transform),x=i.reduce((_,S)=>{const b=o.get(S.id);if(b!=null&&b.hidden)o.set(b.id,{...b,[pt]:{...b[pt],handleBounds:void 0}});else if(b){const k=Zg(S.nodeElement);!!(k.width&&k.height&&(b.width!==k.width||b.height!==k.height||S.forceUpdate))&&(o.set(b.id,{...b,[pt]:{...b[pt],handleBounds:{source:qw(".source",S.nodeElement,y,h),target:qw(".target",S.nodeElement,y,h)}},...k}),_.push({id:b.id,type:"dimensions",dimensions:k}))}return _},[]);qE(o,h);const N=u||l&&!u&&LE(n,{initial:!0,...c});e({nodeInternals:new Map(o),fitViewOnInitDone:N}),(x==null?void 0:x.length)>0&&(s==null||s(x))},updateNodePositions:(i,s=!0,o=!1)=>{const{triggerNodeChanges:l}=n(),u=i.map(c=>{const d={id:c.id,type:"position",dragging:o};return s&&(d.positionAbsolute=c.positionAbsolute,d.position=c.position),d});l(u)},triggerNodeChanges:i=>{const{onNodesChange:s,nodeInternals:o,hasDefaultNodes:l,nodeOrigin:u,getNodes:c,elevateNodesOnSelect:d}=n();if(i!=null&&i.length){if(l){const h=LI(i,c()),p=Qc(h,o,u,d);e({nodeInternals:p})}s==null||s(i)}},addSelectedNodes:i=>{const{multiSelectionActive:s,edges:o,getNodes:l}=n();let u,c=null;s?u=i.map(d=>ui(d,!0)):(u=Ps(l(),i),c=Ps(o,[])),gl({changedNodes:u,changedEdges:c,get:n,set:e})},addSelectedEdges:i=>{const{multiSelectionActive:s,edges:o,getNodes:l}=n();let u,c=null;s?u=i.map(d=>ui(d,!0)):(u=Ps(o,i),c=Ps(l(),[])),gl({changedNodes:c,changedEdges:u,get:n,set:e})},unselectNodesAndEdges:({nodes:i,edges:s}={})=>{const{edges:o,getNodes:l}=n(),u=i||l(),c=s||o,d=u.map(p=>(p.selected=!1,ui(p.id,!1))),h=c.map(p=>ui(p.id,!1));gl({changedNodes:d,changedEdges:h,get:n,set:e})},setMinZoom:i=>{const{d3Zoom:s,maxZoom:o}=n();s==null||s.scaleExtent([i,o]),e({minZoom:i})},setMaxZoom:i=>{const{d3Zoom:s,minZoom:o}=n();s==null||s.scaleExtent([o,i]),e({maxZoom:i})},setTranslateExtent:i=>{var s;(s=n().d3Zoom)==null||s.translateExtent(i),e({translateExtent:i})},resetSelectedElements:()=>{const{edges:i,getNodes:s}=n(),l=s().filter(c=>c.selected).map(c=>ui(c.id,!1)),u=i.filter(c=>c.selected).map(c=>ui(c.id,!1));gl({changedNodes:l,changedEdges:u,get:n,set:e})},setNodeExtent:i=>{const{nodeInternals:s}=n();s.forEach(o=>{o.positionAbsolute=Jg(o.position,i)}),e({nodeExtent:i,nodeInternals:new Map(s)})},panBy:i=>{const{transform:s,width:o,height:l,d3Zoom:u,d3Selection:c,translateExtent:d}=n();if(!u||!c||!i.x&&!i.y)return!1;const h=Tr.translate(s[0]+i.x,s[1]+i.y).scale(s[2]),p=[[0,0],[o,l]],m=u==null?void 0:u.constrain()(h,p,d);return u.transform(c,m),s[0]!==m.x||s[1]!==m.y||s[2]!==m.k},cancelConnection:()=>e({connectionNodeId:ai.connectionNodeId,connectionHandleId:ai.connectionHandleId,connectionHandleType:ai.connectionHandleType,connectionStatus:ai.connectionStatus,connectionStartHandle:ai.connectionStartHandle,connectionEndHandle:ai.connectionEndHandle}),reset:()=>e({...ai})}),Object.is),av=({children:e})=>{const n=M.useRef(null);return n.current||(n.current=SM()),ae.createElement(zA,{value:n.current},e)};av.displayName="ReactFlowProvider";const KE=({children:e})=>M.useContext(Ul)?ae.createElement(ae.Fragment,null,e):ae.createElement(av,null,e);KE.displayName="ReactFlowWrapper";const bM={input:TE,default:Og,output:AE,group:sv},kM={default:Ol,straight:nv,step:tv,smoothstep:Hl,simplebezier:ev},EM=[0,0],NM=[15,15],CM={x:0,y:0,zoom:1},RM={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},XE=M.forwardRef(({nodes:e,edges:n,defaultNodes:i,defaultEdges:s,className:o,nodeTypes:l=bM,edgeTypes:u=kM,onNodeClick:c,onEdgeClick:d,onInit:h,onMove:p,onMoveStart:m,onMoveEnd:y,onConnect:x,onConnectStart:N,onConnectEnd:_,onClickConnectStart:S,onClickConnectEnd:b,onNodeMouseEnter:k,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:I,onNodeDoubleClick:P,onNodeDragStart:L,onNodeDrag:O,onNodeDragStop:R,onNodesDelete:q,onEdgesDelete:F,onSelectionChange:J,onSelectionDragStart:Q,onSelectionDrag:A,onSelectionDragStop:V,onSelectionContextMenu:B,onSelectionStart:ne,onSelectionEnd:X,connectionMode:$=Yi.Strict,connectionLineType:G=ci.Bezier,connectionLineStyle:j,connectionLineComponent:U,connectionLineContainerStyle:le,deleteKeyCode:z="Backspace",selectionKeyCode:K="Shift",selectionOnDrag:ee=!1,selectionMode:se=Ko.Full,panActivationKeyCode:oe="Space",multiSelectionKeyCode:pe=Ml()?"Meta":"Control",zoomActivationKeyCode:ge=Ml()?"Meta":"Control",snapToGrid:Ae=!1,snapGrid:Oe=NM,onlyRenderVisibleElements:Ie=!1,selectNodesOnDrag:Me=!0,nodesDraggable:ke,nodesConnectable:He,nodesFocusable:ve,nodeOrigin:ye=EM,edgesFocusable:Ve,edgesUpdatable:dt,elementsSelectable:Qe,defaultViewport:We=CM,minZoom:$e=.5,maxZoom:Ke=2,translateExtent:yt=Lg,preventScrolling:et=!0,nodeExtent:Ge,defaultMarkerColor:wt="#b1b1b7",zoomOnScroll:Tt=!0,zoomOnPinch:Ft=!0,panOnScroll:tt=!1,panOnScrollSpeed:xt=.5,panOnScrollMode:lt=Ui.Free,zoomOnDoubleClick:mt=!0,panOnDrag:wn=!0,onPaneClick:bt,onPaneMouseEnter:jt,onPaneMouseMove:xn,onPaneMouseLeave:Ln,onPaneScroll:ut,onPaneContextMenu:Yt,children:Qt,onEdgeContextMenu:At,onEdgeDoubleClick:mi,onEdgeMouseEnter:gi,onEdgeMouseMove:Ji,onEdgeMouseLeave:tr,onEdgeUpdate:Pr,onEdgeUpdateStart:vi,onEdgeUpdateEnd:dr,onReconnect:Or,onReconnectStart:nr,onReconnectEnd:qt,reconnectRadius:$n=10,edgeUpdaterRadius:pn=10,onNodesChange:qr,onEdgesChange:zt,noDragClassName:yi="nodrag",noWheelClassName:wi="nowheel",noPanClassName:xi="nopan",fitView:Zt=!1,fitViewOptions:Lr,connectOnClick:_n=!0,attributionPosition:es,proOptions:_i,defaultEdgeOptions:Si,elevateNodesOnSelect:ts=!0,elevateEdgesOnSelect:$r=!1,disableKeyboardA11y:Dn=!1,autoPanOnConnect:ns=!0,autoPanOnNodeDrag:rt=!0,connectionRadius:rs=20,isValidConnection:Dr,onError:is,style:kt,id:Fr,nodeDragThreshold:Fn,...Sn},Bt)=>{const hr=Fr||"1";return ae.createElement("div",{...Sn,style:{...kt,...RM},ref:Bt,className:Dt(["react-flow",o]),"data-testid":"rf__wrapper",id:Fr},ae.createElement(KE,null,ae.createElement(_M,{onInit:h,onMove:p,onMoveStart:m,onMoveEnd:y,onNodeClick:c,onEdgeClick:d,onNodeMouseEnter:k,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:I,onNodeDoubleClick:P,nodeTypes:l,edgeTypes:u,connectionLineType:G,connectionLineStyle:j,connectionLineComponent:U,connectionLineContainerStyle:le,selectionKeyCode:K,selectionOnDrag:ee,selectionMode:se,deleteKeyCode:z,multiSelectionKeyCode:pe,panActivationKeyCode:oe,zoomActivationKeyCode:ge,onlyRenderVisibleElements:Ie,selectNodesOnDrag:Me,defaultViewport:We,translateExtent:yt,minZoom:$e,maxZoom:Ke,preventScrolling:et,zoomOnScroll:Tt,zoomOnPinch:Ft,zoomOnDoubleClick:mt,panOnScroll:tt,panOnScrollSpeed:xt,panOnScrollMode:lt,panOnDrag:wn,onPaneClick:bt,onPaneMouseEnter:jt,onPaneMouseMove:xn,onPaneMouseLeave:Ln,onPaneScroll:ut,onPaneContextMenu:Yt,onSelectionContextMenu:B,onSelectionStart:ne,onSelectionEnd:X,onEdgeContextMenu:At,onEdgeDoubleClick:mi,onEdgeMouseEnter:gi,onEdgeMouseMove:Ji,onEdgeMouseLeave:tr,onReconnect:Or??Pr,onReconnectStart:nr??vi,onReconnectEnd:qt??dr,reconnectRadius:$n??pn,defaultMarkerColor:wt,noDragClassName:yi,noWheelClassName:wi,noPanClassName:xi,elevateEdgesOnSelect:$r,rfId:hr,disableKeyboardA11y:Dn,nodeOrigin:ye,nodeExtent:Ge}),ae.createElement(vI,{nodes:e,edges:n,defaultNodes:i,defaultEdges:s,onConnect:x,onConnectStart:N,onConnectEnd:_,onClickConnectStart:S,onClickConnectEnd:b,nodesDraggable:ke,nodesConnectable:He,nodesFocusable:ve,edgesFocusable:Ve,edgesUpdatable:dt,elementsSelectable:Qe,elevateNodesOnSelect:ts,minZoom:$e,maxZoom:Ke,nodeExtent:Ge,onNodesChange:qr,onEdgesChange:zt,snapToGrid:Ae,snapGrid:Oe,connectionMode:$,translateExtent:yt,connectOnClick:_n,defaultEdgeOptions:Si,fitView:Zt,fitViewOptions:Lr,onNodesDelete:q,onEdgesDelete:F,onNodeDragStart:L,onNodeDrag:O,onNodeDragStop:R,onSelectionDrag:A,onSelectionDragStart:Q,onSelectionDragStop:V,noPanClassName:xi,nodeOrigin:ye,rfId:hr,autoPanOnConnect:ns,autoPanOnNodeDrag:rt,onError:is,connectionRadius:rs,isValidConnection:Dr,nodeDragThreshold:Fn}),ae.createElement(mI,{onSelectionChange:J}),Qt,ae.createElement(UA,{proOptions:_i,position:es}),ae.createElement(SI,{rfId:hr,disableKeyboardA11y:Dn})))});XE.displayName="ReactFlow";const TM=e=>({x:e.transform[0],y:e.transform[1],zoom:e.transform[2]});function QE(){return Xe(TM,Ct)}const ZE=({id:e,x:n,y:i,width:s,height:o,style:l,color:u,strokeColor:c,strokeWidth:d,className:h,borderRadius:p,shapeRendering:m,onClick:y,selected:x})=>{const{background:N,backgroundColor:_}=l||{},S=u||N||_;return ae.createElement("rect",{className:Dt(["react-flow__minimap-node",{selected:x},h]),x:n,y:i,rx:p,ry:p,width:s,height:o,fill:S,stroke:c,strokeWidth:d,shapeRendering:m,onClick:y?b=>y(b,e):void 0})};ZE.displayName="MiniMapNode";var jM=M.memo(ZE);const AM=e=>e.nodeOrigin,IM=e=>e.getNodes().filter(n=>!n.hidden&&n.width&&n.height),tf=e=>e instanceof Function?e:()=>e;function MM({nodeStrokeColor:e="transparent",nodeColor:n="#e2e2e2",nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:o=2,nodeComponent:l=jM,onClick:u}){const c=Xe(IM,Ct),d=Xe(AM),h=tf(n),p=tf(e),m=tf(i),y=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return ae.createElement(ae.Fragment,null,c.map(x=>{const{x:N,y:_}=Vi(x,d).positionAbsolute;return ae.createElement(l,{key:x.id,x:N,y:_,width:x.width,height:x.height,style:x.style,selected:x.selected,className:m(x),color:h(x),borderRadius:s,strokeColor:p(x),strokeWidth:o,shapeRendering:y,onClick:u,id:x.id})}))}var PM=M.memo(MM);const OM=200,qM=150,LM=e=>{const n=e.getNodes(),i={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:i,boundingRect:n.length>0?WA(Vl(n,e.nodeOrigin),i):i,rfId:e.rfId}},$M="react-flow__minimap-desc";function JE({style:e,className:n,nodeStrokeColor:i="transparent",nodeColor:s="#e2e2e2",nodeClassName:o="",nodeBorderRadius:l=5,nodeStrokeWidth:u=2,nodeComponent:c,maskColor:d="rgb(240, 240, 240, 0.6)",maskStrokeColor:h="none",maskStrokeWidth:p=1,position:m="bottom-right",onClick:y,onNodeClick:x,pannable:N=!1,zoomable:_=!1,ariaLabel:S="React Flow mini map",inversePan:b=!1,zoomStep:k=10,offsetScale:E=5}){const C=Rt(),I=M.useRef(null),{boundingRect:P,viewBB:L,rfId:O}=Xe(LM,Ct),R=(e==null?void 0:e.width)??OM,q=(e==null?void 0:e.height)??qM,F=P.width/R,J=P.height/q,Q=Math.max(F,J),A=Q*R,V=Q*q,B=E*Q,ne=P.x-(A-P.width)/2-B,X=P.y-(V-P.height)/2-B,$=A+B*2,G=V+B*2,j=`${$M}-${O}`,U=M.useRef(0);U.current=Q,M.useEffect(()=>{if(I.current){const K=Mn(I.current),ee=pe=>{const{transform:ge,d3Selection:Ae,d3Zoom:Oe}=C.getState();if(pe.sourceEvent.type!=="wheel"||!Ae||!Oe)return;const Ie=-pe.sourceEvent.deltaY*(pe.sourceEvent.deltaMode===1?.05:pe.sourceEvent.deltaMode?1:.002)*k,Me=ge[2]*Math.pow(2,Ie);Oe.scaleTo(Ae,Me)},se=pe=>{const{transform:ge,d3Selection:Ae,d3Zoom:Oe,translateExtent:Ie,width:Me,height:ke}=C.getState();if(pe.sourceEvent.type!=="mousemove"||!Ae||!Oe)return;const He=U.current*Math.max(1,ge[2])*(b?-1:1),ve={x:ge[0]-pe.sourceEvent.movementX*He,y:ge[1]-pe.sourceEvent.movementY*He},ye=[[0,0],[Me,ke]],Ve=Tr.translate(ve.x,ve.y).scale(ge[2]),dt=Oe.constrain()(Ve,ye,Ie);Oe.transform(Ae,dt)},oe=aE().on("zoom",N?se:null).on("zoom.wheel",_?ee:null);return K.call(oe),()=>{K.on("zoom",null)}}},[N,_,b,k]);const le=y?K=>{const ee=Kn(K);y(K,{x:ee[0],y:ee[1]})}:void 0,z=x?(K,ee)=>{const se=C.getState().nodeInternals.get(ee);x(K,se)}:void 0;return ae.createElement(Qg,{position:m,style:e,className:Dt(["react-flow__minimap",n]),"data-testid":"rf__minimap"},ae.createElement("svg",{width:R,height:q,viewBox:`${ne} ${X} ${$} ${G}`,role:"img","aria-labelledby":j,ref:I,onClick:le},S&&ae.createElement("title",{id:j},S),ae.createElement(PM,{onClick:z,nodeColor:s,nodeStrokeColor:i,nodeBorderRadius:l,nodeClassName:o,nodeStrokeWidth:u,nodeComponent:c}),ae.createElement("path",{className:"react-flow__minimap-mask",d:`M${ne-B},${X-B}h${$+B*2}v${G+B*2}h${-$-B*2}z
|
|
57
|
+
M${L.x},${L.y}h${L.width}v${L.height}h${-L.width}z`,fill:d,fillRule:"evenodd",stroke:h,strokeWidth:p,pointerEvents:"none"})))}JE.displayName="MiniMap";var DM=M.memo(JE);function FM(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},ae.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function zM(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},ae.createElement("path",{d:"M0 0h32v4.2H0z"}))}function BM(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},ae.createElement("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"}))}function UM(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ae.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"}))}function HM(){return ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},ae.createElement("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"}))}const Os=({children:e,className:n,...i})=>ae.createElement("button",{type:"button",className:Dt(["react-flow__controls-button",n]),...i},e);Os.displayName="ControlButton";const VM=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),eN=({style:e,showZoom:n=!0,showFitView:i=!0,showInteractive:s=!0,fitViewOptions:o,onZoomIn:l,onZoomOut:u,onFitView:c,onInteractiveChange:d,className:h,children:p,position:m="bottom-left"})=>{const y=Rt(),[x,N]=M.useState(!1),{isInteractive:_,minZoomReached:S,maxZoomReached:b}=Xe(VM,Ct),{zoomIn:k,zoomOut:E,fitView:C}=ta();if(M.useEffect(()=>{N(!0)},[]),!x)return null;const I=()=>{k(),l==null||l()},P=()=>{E(),u==null||u()},L=()=>{C(o),c==null||c()},O=()=>{y.setState({nodesDraggable:!_,nodesConnectable:!_,elementsSelectable:!_}),d==null||d(!_)};return ae.createElement(Qg,{className:Dt(["react-flow__controls",h]),position:m,style:e,"data-testid":"rf__controls"},n&&ae.createElement(ae.Fragment,null,ae.createElement(Os,{onClick:I,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:b},ae.createElement(FM,null)),ae.createElement(Os,{onClick:P,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S},ae.createElement(zM,null))),i&&ae.createElement(Os,{className:"react-flow__controls-fitview",onClick:L,title:"fit view","aria-label":"fit view"},ae.createElement(BM,null)),s&&ae.createElement(Os,{className:"react-flow__controls-interactive",onClick:O,title:"toggle interactivity","aria-label":"toggle interactivity"},_?ae.createElement(HM,null):ae.createElement(UM,null)),p)};eN.displayName="Controls";var WM=M.memo(eN),Qn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Qn||(Qn={}));function GM({color:e,dimensions:n,lineWidth:i}){return ae.createElement("path",{stroke:e,strokeWidth:i,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`})}function YM({color:e,radius:n}){return ae.createElement("circle",{cx:n,cy:n,r:n,fill:e})}const KM={[Qn.Dots]:"#91919a",[Qn.Lines]:"#eee",[Qn.Cross]:"#e2e2e2"},XM={[Qn.Dots]:1,[Qn.Lines]:1,[Qn.Cross]:6},QM=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function tN({id:e,variant:n=Qn.Dots,gap:i=20,size:s,lineWidth:o=1,offset:l=2,color:u,style:c,className:d}){const h=M.useRef(null),{transform:p,patternId:m}=Xe(QM,Ct),y=u||KM[n],x=s||XM[n],N=n===Qn.Dots,_=n===Qn.Cross,S=Array.isArray(i)?i:[i,i],b=[S[0]*p[2]||1,S[1]*p[2]||1],k=x*p[2],E=_?[k,k]:b,C=N?[k/l,k/l]:[E[0]/l,E[1]/l];return ae.createElement("svg",{className:Dt(["react-flow__background",d]),style:{...c,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:h,"data-testid":"rf__background"},ae.createElement("pattern",{id:m+e,x:p[0]%b[0],y:p[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`},N?ae.createElement(YM,{color:y,radius:k/l}):ae.createElement(GM,{dimensions:E,color:y,lineWidth:o})),ae.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${m+e})`}))}tN.displayName="Background";var ZM=M.memo(tN);function nN(){return{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreateTokens:0}}function rN(e,n=0){if(!e||typeof e!="object"||n>6)return null;const i=e;if(typeof i.input_tokens=="number"||typeof i.output_tokens=="number"||typeof i.cache_read_input_tokens=="number"||typeof i.cache_creation_input_tokens=="number")return{inputTokens:Number(i.input_tokens??0),outputTokens:Number(i.output_tokens??0),cacheReadTokens:Number(i.cache_read_input_tokens??0),cacheCreateTokens:Number(i.cache_creation_input_tokens??0)};for(const s of Object.values(i)){const o=rN(s,n+1);if(o)return o}return null}function JM(e,n){e.inputTokens+=n.inputTokens,e.outputTokens+=n.outputTokens,e.cacheReadTokens+=n.cacheReadTokens,e.cacheCreateTokens+=n.cacheCreateTokens}const eP=/^(?:claude[-_]|gpt[-_]|o\d|codex[-_])/i;function iN(e,n=0){if(!e||typeof e!="object"||n>6)return null;const i=e;if(typeof i.model=="string"&&eP.test(i.model))return i.model;for(const s of Object.values(i)){const o=iN(s,n+1);if(o)return o}return null}function $g(){return{agents:new Map,toolIndex:new Map,toolOwner:new Map,activeSubagentStack:new Map,lastSeq:0,totalEvents:0}}function di(e){if(!e)return;const n=e.replace(/\\/g,"/").split("/").filter(Boolean);return n[n.length-1]}function lv(e,n){return`${e}::${n}`}function ql(e){return e.agent_type??e.subagent_type??"subagent"}function Dg(e){return e.agent_id?e.agent_id:e.parent_tool_use_id?e.parent_tool_use_id:null}function Bo(e,n,i,s){const o=n;let l=e.agents.get(o);return l||(l={id:o,sessionId:n,label:"session",kind:"root",state:"active",startedAt:i,tools:[],prompts:[],toolCount:0,childCount:0,synthetic:s,inFlightTool:null,usage:nN()},e.agents.set(o,l),l)}function sN(e,n,i,s){const o=lv(n,i),l=e.agents.get(o);if(!l)return null;!l.cwd&&s.cwd&&(l.cwd=s.cwd,l.cwdBasename=di(s.cwd));const u=ql(s);return u&&(l.label==="subagent"||!l.label)&&(l.label=u),l}function Hw(e,n,i){const s=n.session_id??"unknown",o=Dg(n);if(o){const d=sN(e,s,o,n);if(d)return d}const l=e.activeSubagentStack.get(s),u=l&&l.length>0?l[l.length-1]:null;if(u){const d=e.agents.get(lv(s,u));if(d)return!d.cwd&&n.cwd&&(d.cwd=n.cwd,d.cwdBasename=di(n.cwd)),d}const c=Bo(e,s,i,!1);return c.synthetic&&(c.synthetic=!1,c.startedAt=i),!c.cwd&&n.cwd&&(c.cwd=n.cwd,c.cwdBasename=di(n.cwd)),c.label==="session"&&n.cwd&&(c.label=di(n.cwd)??"session"),c}function tP(e,n,i,s,o){const l=lv(n,i),u=Bo(e,n,o,!0);let c=e.agents.get(l);if(c){!c.cwd&&s.cwd&&(c.cwd=s.cwd,c.cwdBasename=di(s.cwd));const d=ql(s);return d&&(c.label==="subagent"||!c.label)&&(c.label=d),c}return c={id:l,sessionId:n,label:ql(s),kind:"subagent",parentId:u.id,state:"active",startedAt:o,tools:[],prompts:[],cwd:s.cwd,cwdBasename:di(s.cwd),toolCount:0,childCount:0,inFlightTool:null,usage:nN()},e.agents.set(l,c),u.childCount+=1,c}function nP(e,n,i){const s=e.activeSubagentStack.get(n)??[];s.push(i),e.activeSubagentStack.set(n,s)}function rP(e,n,i){const s=e.activeSubagentStack.get(n);if(s){for(let o=s.length-1;o>=0;o--)if(s[o]===i){s.splice(o,1);break}s.length===0&&e.activeSubagentStack.delete(n)}}function nf(e,n=80){if(e==null)return"";if(typeof e=="string")return e.length>n?e.slice(0,n-1)+"…":e;try{const i=JSON.stringify(e);return i.length>n?i.slice(0,n-1)+"…":i}catch{return String(e)}}function $o(e){let n=null;for(let i=e.tools.length-1;i>=0;i--){const s=e.tools[i];if(s.endedAt==null){n=s;break}}e.inFlightTool=n}function iP(e,n,i,s){if(e.agents.size<=i)return!1;const o=[];for(const[u,c]of e.agents)c.state==="done"&&c.endedAt!=null&&n-c.endedAt>s&&o.push({id:u,endedAt:c.endedAt});if(o.length===0)return!1;o.sort((u,c)=>u.endedAt-c.endedAt);let l=0;for(const u of o){if(e.agents.size<=i)break;e.agents.delete(u.id),l++}return l>0}function sP(e,n,i,s){const o=new Map;for(const[h,p]of e.agents){let m=o.get(p.sessionId);m||(m={ids:[],endedAt:0,live:!1},o.set(p.sessionId,m)),m.ids.push(h),p.state==="done"&&p.endedAt!=null?m.endedAt=Math.max(m.endedAt,p.endedAt):m.live=!0}const l=[...o.values()].filter(h=>!h.live&&h.endedAt>0&&n-h.endedAt>s).sort((h,p)=>h.endedAt-p.endedAt);let c=[...o.values()].filter(h=>!h.live).length-i;if(c<=0)return!1;let d=!1;for(const h of l){if(c<=0)break;for(const p of h.ids)e.agents.delete(p);c--,d=!0}return d}function oP(e,n,i){let s=!1;for(const o of e.agents.values()){let l=!1;for(const u of o.tools)u.endedAt==null&&n-u.startedAt>i&&(u.endedAt=u.startedAt+i,u.ok=!1,u.errorPreview="stale (no PostToolUse received)",e.toolIndex.delete(u.id),e.toolOwner.delete(u.id),l=!0,s=!0);l&&$o(o)}return s}function Vw(e,n){if(n.seq<=e.lastSeq)return e;const i=n.payload??{},s=n.receivedAt,o=i.hook_event_name??"Unknown";if(o==="__clear")return{...$g(),lastSeq:n.seq};e.totalEvents+=1,e.lastSeq=n.seq;const l=i.session_id??"unknown";if(o==="ModelObserved"){const d=typeof i.model=="string"?i.model:null;if(d){const p=e.agents.get(l);p&&(p.model=d)}const h=i.subagentModels;if(h&&typeof h=="object")for(const[p,m]of Object.entries(h)){if(typeof m!="string")continue;const y=`${l}::${p}`,x=e.agents.get(y);x&&(x.model=m)}return e}if(o==="ContextObserved"){const d=i.context??null;if(d){const h=e.agents.get(l);h&&(h.context={msgsUser:Number(d.msgsUser??0),msgsAssistant:Number(d.msgsAssistant??0),toolUses:Number(d.toolUses??0),toolResults:Number(d.toolResults??0),systemReminders:Number(d.systemReminders??0),currentContextTokens:Number(d.currentContextTokens??0),claudeMdFiles:Array.isArray(d.claudeMdFiles)?d.claudeMdFiles:[]})}return e}if(o==="UsageObserved"){const d=i.usage??null;if(d){const h=e.agents.get(l);h&&(h.usage.inputTokens=Number(d.input_tokens??0),h.usage.outputTokens=Number(d.output_tokens??0),h.usage.cacheReadTokens=Number(d.cache_read_input_tokens??d.cached_input_tokens??0),h.usage.cacheCreateTokens=Number(d.cache_creation_input_tokens??0),typeof d.reasoning_output_tokens=="number"&&(h.usage.reasoningOutputTokens=Number(d.reasoning_output_tokens)))}return e}const u=Hw(e,i,s);u.provider||(u.provider=i.provider==="codex"?"codex":"claude"),typeof i.model_context_window=="number"&&i.model_context_window>0&&(u.contextWindow=i.model_context_window);const c=iN(i);switch(c&&(u.model=c),o){case"SessionStart":{const d=Bo(e,l,s,!1);d.synthetic=!1,d.state="active",d.startedAt=d.startedAt||s,!d.cwd&&i.cwd&&(d.cwd=i.cwd,d.cwdBasename=di(i.cwd)),d.label==="session"&&i.cwd&&(d.label=di(i.cwd)??"session");break}case"UserPromptSubmit":{for(const m of e.agents.values())m.sessionId===l&&m.kind==="subagent"&&m.state==="done"&&m.exitAt==null&&m.endedAt!=null&&m.endedAt<s&&(m.exitAt=s);const d=Bo(e,l,s,!1);d.state="active",d.endedAt=void 0,d.exitAt=void 0;const h=Hw(e,i,s);h.state="active",h.exitAt=void 0,h.endedAt=void 0;const p=(typeof i.prompt=="string"?i.prompt:typeof i.message=="string"?i.message:"")??"";p&&(h.prompts.push({at:s,text:p}),h.firstPrompt||(h.firstPrompt=nf(p,120)));break}case"PreToolUse":{const d=i.tool_use_id??`${u.id}:${u.toolCount}`,h={id:d,name:i.tool_name??"?",input:i.tool_input,inputPreview:nf(i.tool_input),agentId:u.id,startedAt:s};u.tools.push(h),u.toolCount+=1,u.state="active",e.toolIndex.set(d,h),e.toolOwner.set(d,u.id),$o(u);break}case"PostToolUse":case"PostToolUseFailure":{const d=i.tool_use_id;if(!d)break;let h=e.toolIndex.get(d),p=!1;if(!h)for(const x of e.agents.values()){const N=x.tools.find(_=>_.id===d);if(N){h=N,p=!0;break}}if(!h)break;h.endedAt=s,h.ok=o==="PostToolUse",h.response=i.tool_response,o==="PostToolUseFailure"?h.errorPreview=nf(i.tool_response):p&&(h.errorPreview=void 0);const m=rN(i.tool_response);m&&(h.usage=m),e.toolIndex.delete(d);const y=e.toolOwner.get(d)??h.agentId;if(e.toolOwner.delete(d),y){const x=e.agents.get(y);x&&(m&&JM(x.usage,m),$o(x))}break}case"SubagentStart":{const d=Dg(i);if(!d)break;const h=tP(e,l,d,i,s);h.state="active",h.startedAt=h.startedAt||s,h.exitAt=void 0,h.endedAt=void 0;const p=ql(i);p&&(h.label=p),nP(e,l,d);break}case"SubagentStop":{const d=Dg(i);if(!d)break;const h=sN(e,l,d,i);if(!h)break;h.state="done",h.endedAt=s,$o(h),rP(e,l,d);break}case"Stop":case"SessionEnd":{const d=Bo(e,l,s,!1);d.state="done",d.endedAt=s,$o(d);break}}return e}function uv(e){let n=5381;for(let i=0;i<e.length;i++)n=(n<<5)+n^e.charCodeAt(i);return Math.abs(n)%360}const aP=Date.UTC(2026,8,1);function lP(){return Date.now()<aP?{input:2,output:10,cacheRead:.2,cacheWrite:2.5}:{input:3,output:15,cacheRead:.3,cacheWrite:3.75}}const uP=[{match:/^claude[-_](fable|mythos)[-_]5\b/i,rates:{input:10,output:50,cacheRead:1,cacheWrite:12.5}},{match:/^claude[-_]opus[-_]5\b/i,rates:{input:5,output:25,cacheRead:.5,cacheWrite:6.25}},{match:/^claude[-_]sonnet[-_]5\b/i,rates:lP()},{match:/^claude[-_]opus[-_]4[-_.](?:5|6|7|8)\b/i,rates:{input:5,output:25,cacheRead:.5,cacheWrite:6.25}},{match:/^claude[-_]opus[-_]4(?:[-_.]1)?\b/i,rates:{input:15,output:75,cacheRead:1.5,cacheWrite:18.75}},{match:/^claude[-_]sonnet[-_]4[-_.](?:5|6)\b/i,rates:{input:3,output:15,cacheRead:.3,cacheWrite:3.75}},{match:/^claude[-_]sonnet[-_]4\b/i,rates:{input:3,output:15,cacheRead:.3,cacheWrite:3.75}},{match:/^claude[-_]haiku[-_]4[-_.]5\b/i,rates:{input:1,output:5,cacheRead:.1,cacheWrite:1.25}},{match:/^claude[-_]haiku[-_]3[-_.]5\b/i,rates:{input:.8,output:4,cacheRead:.08,cacheWrite:1}},{match:/^gpt[-_]5[-_.]6[-_]cyber/i,rates:{input:12.5,output:75,cacheRead:1.25,cacheWrite:0}},{match:/^gpt[-_]5[-_.]6[-_]luna/i,rates:{input:.2,output:1.2,cacheRead:.02,cacheWrite:.25}},{match:/^gpt[-_]5[-_.]6[-_]terra/i,rates:{input:2,output:12,cacheRead:.2,cacheWrite:2.5}},{match:/^gpt[-_]5[-_.]6(?:[-_]sol)?\b/i,rates:{input:5,output:30,cacheRead:.5,cacheWrite:6.25}},{match:/^gpt[-_]5[-_.]5[-_]pro/i,rates:{input:30,output:180,cacheRead:30,cacheWrite:0}},{match:/^gpt[-_]5[-_.]5\b/i,rates:{input:5,output:30,cacheRead:.5,cacheWrite:0}},{match:/^gpt[-_]5[-_.]4[-_]pro/i,rates:{input:30,output:180,cacheRead:3,cacheWrite:0}},{match:/^gpt[-_]5[-_.]4[-_]mini/i,rates:{input:.75,output:4.5,cacheRead:.075,cacheWrite:0}},{match:/^gpt[-_]5[-_.]4[-_]nano/i,rates:{input:.2,output:1.25,cacheRead:.02,cacheWrite:0}},{match:/^gpt[-_]5[-_.]4\b/i,rates:{input:2.5,output:15,cacheRead:.25,cacheWrite:0}},{match:/^gpt[-_]5[-_.]3[-_]codex/i,rates:{input:1.75,output:14,cacheRead:.175,cacheWrite:0}},{match:/^gpt[-_]5[-_.]2[-_]pro/i,rates:{input:21,output:168,cacheRead:21,cacheWrite:0}},{match:/^gpt[-_]5[-_.]2\b/i,rates:{input:1.75,output:14,cacheRead:.175,cacheWrite:0}},{match:/^codex[-_]mini/i,rates:{input:1.5,output:6,cacheRead:.375,cacheWrite:0}},{match:/^o1[-_]pro/i,rates:{input:150,output:600,cacheRead:150,cacheWrite:0}},{match:/^o1\b/i,rates:{input:15,output:60,cacheRead:7.5,cacheWrite:0}},{match:/^o3[-_]mini/i,rates:{input:1.1,output:4.4,cacheRead:.55,cacheWrite:0}},{match:/^o3[-_]pro/i,rates:{input:20,output:80,cacheRead:20,cacheWrite:0}},{match:/^o4[-_]mini/i,rates:{input:1.1,output:4.4,cacheRead:.275,cacheWrite:0}},{match:/^o3\b/i,rates:{input:2,output:8,cacheRead:.5,cacheWrite:0}}];function cP(e){return e?/^(?:gpt[-_]|codex[-_]|o\d)/i.test(e):!1}function cv(e){if(!e)return null;for(const n of uP)if(n.match.test(e))return n.rates;return null}const fP=272e3,dP=/^gpt[-_]5[-_.](?:6(?![-_]cyber)|5|4)/i;function hP(e,n){return!e||n<=fP?{input:1,output:1}:dP.test(e)?{input:2,output:1.5}:{input:1,output:1}}function dn(e,n){const i=cv(n);if(!i)return{input:0,output:0,cacheRead:0,cacheWrite:0,total:0};const s=cP(n),o=s?Math.max(0,e.inputTokens-e.cacheReadTokens):e.inputTokens,l=s?hP(n,e.inputTokens):{input:1,output:1},u=o*i.input*l.input/1e6,c=e.outputTokens*i.output*l.output/1e6,d=e.cacheReadTokens*i.cacheRead*l.input/1e6,h=e.cacheCreateTokens*i.cacheWrite*l.input/1e6;return{input:u,output:c,cacheRead:d,cacheWrite:h,total:u+c+d+h}}const Ww=2e5,pP=1e6,mP=[/\[1m\]/i,/^claude[-_]opus[-_]5\b/i,/^claude[-_]sonnet[-_]5\b/i,/^claude[-_]opus[-_]4[-_.](?:5|6|7|8)\b/i,/^claude[-_]sonnet[-_]4[-_.]6\b/i,/^claude[-_](fable|mythos)[-_]5\b/i],gP=[{match:/^gpt[-_]5[-_.]6[-_]cyber/i,window:4e5},{match:/^gpt[-_]5[-_.]6/i,window:105e4},{match:/^gpt[-_]5[-_.]5/i,window:105e4},{match:/^gpt[-_]5[-_.]4[-_](?:mini|nano)/i,window:4e5},{match:/^gpt[-_]5[-_.]4/i,window:105e4},{match:/^gpt[-_]5[-_.]3[-_]codex[-_]spark/i,window:128e3},{match:/^gpt[-_]5[-_.]3[-_]codex/i,window:4e5},{match:/^gpt[-_]5[-_.]2/i,window:4e5},{match:/^gpt[-_]5/i,window:4e5},{match:/^codex[-_]mini/i,window:2e5},{match:/^o\d/i,window:2e5}];function oN(e){if(!e)return Ww;for(const n of mP)if(n.test(e))return pP;for(const n of gP)if(n.match.test(e))return n.window;return Ww}function Fe(e){return e<=0?"—":e<.005?"<1¢":e<1?`${(e*100).toFixed(e<.1?1:0)}¢`:e<100?`$${e.toFixed(2)}`:e<1e4?`$${e.toFixed(0)}`:`$${(e/1e3).toFixed(1)}k`}function Ll(e,n){if(e<=0||n<10)return null;const i=e/n,s=i*60;return s>=.01?`${Fe(s)}/min`:`${Fe(i*3600)}/hr`}function In(e){return e.toLocaleString()}function vP(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function yP({agent:e,onClose:n}){var h;const i=e.context,s=e.usage,o=(i==null?void 0:i.currentContextTokens)??0,l=oN(e.model),u=Math.min(100,o/l*100),c=dn(s,e.model),d=s.inputTokens+s.cacheReadTokens+s.cacheCreateTokens;return v.jsx("div",{className:"ctx-modal-backdrop",onClick:n,role:"presentation",children:v.jsxs("div",{className:"ctx-modal",onClick:p=>p.stopPropagation(),role:"dialog","aria-label":"Context breakdown",children:[v.jsxs("header",{className:"ctx-modal-head",children:[v.jsxs("div",{children:[v.jsxs("div",{className:"ctx-modal-title",children:["Context · ",e.label]}),v.jsx("div",{className:"ctx-modal-sub",children:"approximation — CC's /context isn't hook-exposed"})]}),v.jsx("button",{className:"ctx-modal-close",onClick:n,"aria-label":"Close",children:"×"})]}),v.jsxs("section",{className:"ctx-window-row",children:[v.jsx("div",{className:"ctx-window-bar",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(u),children:v.jsx("div",{className:"ctx-window-fill",style:{width:`${u}%`}})}),v.jsxs("div",{className:"ctx-window-meta",children:[v.jsxs("span",{className:"ctx-window-pct",children:[u.toFixed(1),"%"]}),v.jsxs("span",{className:"ctx-window-num",children:[In(o)," / ",In(l)," tok (current turn)"]})]})]}),v.jsx("h3",{className:"ctx-section-title",children:"Cumulative usage · whole session"}),v.jsxs("div",{className:"ctx-grid",children:[v.jsx(Yn,{label:"input tokens",val:In(s.inputTokens)}),v.jsx(Yn,{label:"output tokens",val:In(s.outputTokens)}),v.jsx(Yn,{label:"cache reads",val:In(s.cacheReadTokens)}),v.jsx(Yn,{label:"cache writes",val:In(s.cacheCreateTokens)}),v.jsx(Yn,{label:"cumulative total",val:In(d)}),v.jsx(Yn,{label:"estimated cost",val:Fe(c.total),accent:!0})]}),v.jsx("h3",{className:"ctx-section-title",children:"Transcript composition"}),v.jsxs("div",{className:"ctx-grid",children:[v.jsx(Yn,{label:"user messages",val:In((i==null?void 0:i.msgsUser)??0)}),v.jsx(Yn,{label:"assistant messages",val:In((i==null?void 0:i.msgsAssistant)??0)}),v.jsx(Yn,{label:"tool uses",val:In((i==null?void 0:i.toolUses)??0)}),v.jsx(Yn,{label:"tool results",val:In((i==null?void 0:i.toolResults)??0)}),v.jsx(Yn,{label:"system-reminders",val:In((i==null?void 0:i.systemReminders)??0)})]}),v.jsx("h3",{className:"ctx-section-title",children:"CLAUDE.md files in scope"}),(((h=i==null?void 0:i.claudeMdFiles)==null?void 0:h.length)??0)===0?v.jsx("div",{className:"ctx-empty",children:"No CLAUDE.md files found on the path from cwd to ~/.claude."}):v.jsx("ul",{className:"ctx-md-list",children:i.claudeMdFiles.map(p=>v.jsxs("li",{children:[v.jsx("span",{className:"ctx-md-path",title:p.path,children:p.path}),v.jsx("span",{className:"ctx-md-size",children:vP(p.bytes)})]},p.path))})]})})}function Yn({label:e,val:n,accent:i}){return v.jsxs("div",{className:`ctx-row${i?" accent":""}`,children:[v.jsx("span",{className:"ctx-row-label",children:e}),v.jsx("span",{className:"ctx-row-val",children:n})]})}function wP({currentContextTokens:e,modelId:n,size:i=26,onClick:s,title:o}){const l=oN(n),u=Math.min(1,e/l),c=i/2-3,d=i/2,h=2*Math.PI*c,p=h*u,m=u>.9?"var(--err)":u>.7?"var(--inflight)":"var(--accent)";return v.jsx("button",{type:"button",className:"ctx-donut",onClick:s,title:o??`context: ${e.toLocaleString()} / ${l.toLocaleString()} (${(u*100).toFixed(1)}%)`,"aria-label":"Show context breakdown",children:v.jsxs("svg",{width:i,height:i,viewBox:`0 0 ${i} ${i}`,children:[v.jsx("circle",{cx:d,cy:d,r:c,stroke:"var(--line)",strokeWidth:"2.5",fill:"none"}),v.jsx("circle",{cx:d,cy:d,r:c,stroke:m,strokeWidth:"2.5",fill:"none",strokeDasharray:`${p} ${h-p}`,strokeDashoffset:h/4,strokeLinecap:"round",style:{transition:"stroke-dasharray 400ms ease"}}),v.jsx("text",{x:d,y:d+3,textAnchor:"middle",fontSize:"8",fill:"var(--text)",fontWeight:"600",children:Math.round(u*100)})]})})}function xP(e,n){const i=cv(n);if(!i)return"no rates for this model";const s=u=>u.toLocaleString(),o=u=>`$${u}/MTok`,l=dn(e,n);return[`model: ${n}`,`input ${s(e.inputTokens).padStart(14)} × ${o(i.input).padEnd(11)} = ${Fe(l.input)}`,`output ${s(e.outputTokens).padStart(14)} × ${o(i.output).padEnd(11)} = ${Fe(l.output)}`,`cache r ${s(e.cacheReadTokens).padStart(14)} × ${o(i.cacheRead).padEnd(11)} = ${Fe(l.cacheRead)}`,`cache w ${s(e.cacheCreateTokens).padStart(14)} × ${o(i.cacheWrite).padEnd(11)} = ${Fe(l.cacheWrite)}`,"─────────────────────────────────────────",`total = ${Fe(l.total)}`].join(`
|
|
58
|
+
`)}function _P(e,n,i){const s=(n??i)-e;if(s<1e3)return`${Math.max(0,s)}ms`;const o=Math.floor(s/1e3);if(o<60)return`${o}s`;const l=Math.floor(o/60),u=o%60;return`${l}m ${String(u).padStart(2,"0")}s`}function SP({data:e,selected:n}){var h;const i=e.now??Date.now(),s=["agent-node",`state-${e.state}`,e.synthetic?"synthetic":"",n?"selected":""].filter(Boolean).join(" "),o=e.tools.filter(p=>!p.endedAt).length,u=`hsl(${uv(e.sessionId)} 70% 60%)`,c=((h=e.context)==null?void 0:h.currentContextTokens)??0,d=e.kind==="root"&&c>0;return v.jsxs("div",{className:s,style:{"--accent":u},children:[v.jsx("span",{className:"accent-stripe"}),v.jsx(Us,{type:"target",position:Ce.Left,style:{background:"transparent",border:"none"}}),v.jsxs("div",{className:"head",children:[v.jsxs("div",{className:"title",children:[v.jsx(bP,{state:e.state}),v.jsx("span",{className:"label",title:e.cwd,children:e.label}),e.synthetic&&v.jsx("span",{className:"synth-tag",title:"No SessionStart captured — synthesised",children:"?"})]}),v.jsxs("div",{className:"head-right",children:[d&&e.onOpenContext&&v.jsx(wP,{currentContextTokens:c,modelId:e.model,onClick:()=>e.onOpenContext(e.sessionId)}),v.jsx("div",{className:"time",title:`Started ${new Date(e.startedAt).toLocaleTimeString()}`,children:_P(e.startedAt,e.endedAt,i)})]})]}),v.jsxs("div",{className:"sub",children:[e.kind==="root"?"session":"subagent",e.childCount>0&&v.jsxs("span",{className:"spawn-badge",title:`${e.childCount} subagents spawned`,children:["→ ",e.childCount]}),e.cwdBasename&&e.kind==="subagent"?` · ${e.cwdBasename}`:"",e.model&&v.jsx("span",{className:"model-chip",title:e.model,children:na(e.model)})]}),e.tools.length>0&&v.jsx(EP,{tools:e.tools,now:i}),v.jsxs("div",{className:"meta",children:[v.jsxs("span",{children:[v.jsx("b",{children:e.toolCount})," tools"]}),o>0&&v.jsxs("span",{className:"inflight-meta",children:[v.jsx("b",{children:o})," in-flight"]}),e.usage.inputTokens+e.usage.outputTokens>0&&v.jsxs("span",{className:"tokens-meta",title:`in:${e.usage.inputTokens} out:${e.usage.outputTokens} cache-r:${e.usage.cacheReadTokens} cache-c:${e.usage.cacheCreateTokens}${(e.usage.reasoningOutputTokens??0)>0?` reasoning:${e.usage.reasoningOutputTokens}`:""}`,children:[v.jsx("b",{children:kP(e.usage.inputTokens+e.usage.outputTokens)})," tok"]}),e.model&&cv(e.model)&&(()=>{const p=dn(e.usage,e.model);if(p.total<=0)return null;const m=Math.max(0,((e.endedAt??i)-e.startedAt)/1e3),y=e.state==="active"?Ll(p.total,m):null,x=xP(e.usage,e.model)+(y?`
|
|
59
|
+
burn: ${y}`:"");return v.jsxs("span",{className:"cost-meta",title:x,children:[v.jsx("b",{children:Fe(p.total)}),y&&v.jsx("span",{className:"cost-rate",children:y})]})})()]}),v.jsx(Us,{type:"source",position:Ce.Right,style:{background:"transparent",border:"none"}})]})}function bP({state:e}){const n=e==="active"?"live":e==="done"?"done":"err";return v.jsx("span",{className:`state-pill state-${e}`,children:n})}function kP(e){return e<1e3?`${e}`:e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(2)}M`}function EP({tools:e,now:n}){const l=new Array(24).fill(0);let u=0;for(const y of e){const x=n-y.startedAt;if(x<0||x>=6e4)continue;const N=23-Math.floor(x/2500);N>=0&&N<24&&(l[N]+=1,u+=1)}const c=Math.max(1,...l),d=132,h=14,p=d/24,m=c/(2500/1e3);return v.jsxs("div",{className:"tool-spark-row",title:`${u} tool calls in last 60s · peak ${m.toFixed(1)}/s`,children:[v.jsx("svg",{className:"tool-spark",width:d,height:h,viewBox:`0 0 ${d} ${h}`,"aria-hidden":!0,children:l.map((y,x)=>{const N=y===0?1.5:Math.max(1.5,y/c*h),_=x===23&&y>0,b=`tool-spark-bar${y>0?" active":""}${_?" latest":""}`;return v.jsx("rect",{x:x*p+.4,y:h-N,width:Math.max(.5,p-1),height:N,rx:.8,className:b},x)})}),v.jsx("span",{className:"tool-spark-label",children:"60s"})]})}function na(e){const n=e.match(/^claude[-_](opus|sonnet|haiku|fable|mythos)[-_](\d+(?:[-_.]\d+)*)/i);if(n){const o=n[1][0].toUpperCase()+n[1].slice(1).toLowerCase(),l=n[2].replace(/[-_]/g,".");return`${o} ${l}`}const i=e.match(/^gpt[-_](\d+(?:[-_.]\d+)*)[-_]codex\b/i);if(i)return`GPT-${i[1].replace(/[-_]/g,".")} Codex`;const s=e.match(/^gpt[-_](\d+(?:[-_.]\d+)*)/i);return s?`GPT-${s[1].replace(/[-_]/g,".")}`:e}function Gw(e){if(e==null)return"(none)";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function NP(e){if(e.endedAt==null)return"in-flight…";const n=e.endedAt-e.startedAt;return n<1e3?`${n}ms`:`${(n/1e3).toFixed(2)}s`}function CP({tool:e,onClose:n}){M.useEffect(()=>{const s=o=>{o.key==="Escape"&&n()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[n]);const i=e.endedAt==null?"inflight":e.ok===!1?"err":"done";return v.jsx("div",{className:"modal-backdrop",onClick:n,role:"dialog","aria-modal":"true",children:v.jsxs("div",{className:"modal",onClick:s=>s.stopPropagation(),children:[v.jsxs("header",{className:"modal-head",children:[v.jsxs("div",{className:"modal-title",children:[v.jsx("span",{className:`status-dot ${i}`}),v.jsx("span",{className:"modal-tool-name",children:e.name}),v.jsxs("span",{className:"modal-tool-id",title:e.id,children:[e.id.slice(0,12),"…"]})]}),v.jsxs("div",{className:"modal-actions",children:[v.jsx("span",{className:"modal-dur",children:NP(e)}),v.jsx("button",{className:"btn icon-btn",onClick:n,"aria-label":"Close (Esc)",title:"Close (Esc)",children:"×"})]})]}),v.jsxs("section",{className:"modal-body",children:[v.jsxs("div",{className:"modal-section",children:[v.jsx("h4",{children:"Input"}),v.jsx("pre",{children:Gw(e.input??e.inputPreview)})]}),v.jsxs("div",{className:"modal-section",children:[v.jsxs("h4",{children:["Response ",i==="err"&&v.jsx("span",{className:"err-tag",children:"error"})]}),v.jsx("pre",{children:e.endedAt==null?"(waiting…)":Gw(e.response??e.errorPreview)})]})]})]})})}const yl=18,Yw=26,RP=12;function TP(e){const n=new Map;for(const o of e.nodeInternals.values()){const l=o.data;if(!(l!=null&&l.sessionId)||l.exitAt!=null||o.width==null||o.height==null)continue;const u=o.position.x,c=o.position.y,d=u+o.width,h=c+o.height,p=n.get(l.sessionId);p?(p.minX=Math.min(p.minX,u),p.minY=Math.min(p.minY,c),p.maxX=Math.max(p.maxX,d),p.maxY=Math.max(p.maxY,h),l.kind==="root"&&(p.label=Kw(l)??p.label)):n.set(l.sessionId,{minX:u,minY:c,maxX:d,maxY:h,label:Kw(l)??l.sessionId})}const i=new Map;for(const o of n.values())i.set(o.label,(i.get(o.label)??0)+1);const s=[];for(const[o,l]of n){const c=(i.get(l.label)??0)>1?`${l.label} · ${jP(o)}`:l.label;s.push({sessionId:o,label:c,x:l.minX-yl,y:l.minY-yl-Yw,w:l.maxX-l.minX+yl*2,h:l.maxY-l.minY+yl*2+Yw})}return s}function jP(e){const n=e.match(/[a-zA-Z0-9]{4}/);return n?n[0]:e.slice(0,4)}function Kw(e){if(e.kind==="root")return e.label}function AP(){const{x:e,y:n,zoom:i}=QE(),s=ta(),o=Xe(TP,IP);if(o.length<=1)return null;const l=u=>{try{const c=s.getNodes().filter(d=>{const h=d.data;return(h==null?void 0:h.sessionId)===u});if(c.length===0)return;s.fitView({padding:.3,duration:500,nodes:c})}catch{}};return v.jsx("div",{className:"session-clusters",children:o.map(u=>{const c=uv(u.sessionId),d={position:"absolute",left:u.x*i+e,top:u.y*i+n,width:u.w*i,height:u.h*i,borderColor:`hsl(${c} 65% 55% / 0.32)`,background:`hsl(${c} 70% 50% / 0.04)`},h={position:"absolute",left:u.x*i+e+16*i,top:(u.y-RP)*i+n,color:`hsl(${c} 70% 78%)`,borderColor:`hsl(${c} 65% 55% / 0.5)`,transform:`scale(${Math.min(1,i)})`,transformOrigin:"left top"};return v.jsxs(ae.Fragment,{children:[v.jsx("div",{className:"cluster-card",style:d,"aria-hidden":!0}),v.jsx("button",{type:"button",className:"cluster-label",style:h,title:`Fit view to ${u.label} · drag the wrapper to move the whole session`,onClick:()=>l(u.sessionId),children:u.label})]},u.sessionId)})})}function IP(e,n){if(e.length!==n.length)return!1;for(let i=0;i<e.length;i++){const s=e[i],o=n[i];if(s.sessionId!==o.sessionId||s.label!==o.label||s.x!==o.x||s.y!==o.y||s.w!==o.w||s.h!==o.h)return!1}return!0}function MP({data:e}){return v.jsx("div",{className:"session-group-handle",style:{width:(e==null?void 0:e.w)??0,height:(e==null?void 0:e.h)??0}})}const aN=600,PP=36,Fg=16,OP=60,qP=6,Xw=220,Qw=96,LP=28,$P={Read:"file",Write:"file",Edit:"file",MultiEdit:"file",Glob:"file",Grep:"file",LS:"file",NotebookEdit:"file",Bash:"shell",PowerShell:"shell",shell:"shell",exec_command:"shell",shell_command:"shell",write_stdin:"shell",wait:"shell",apply_patch:"file",update_plan:"task",WebFetch:"web",WebSearch:"web",Task:"agent",Agent:"agent",TodoWrite:"task",TaskCreate:"task",TaskUpdate:"task",TaskList:"task",TaskGet:"task",TaskOutput:"task",TaskStop:"task",EnterPlanMode:"plan",ExitPlanMode:"plan",AskUserQuestion:"plan",Skill:"plan",Workflow:"plan",ScheduleWakeup:"other",CronCreate:"other",CronList:"other",CronDelete:"other",Monitor:"other",PushNotification:"other",RemoteTrigger:"other",ToolSearch:"other"};function DP(e){return e.startsWith("mcp__")?"mcp":$P[e]??"other"}const FP={Read:"📖",Write:"💾",Edit:"✏️",MultiEdit:"🔧",Glob:"🗺️",Grep:"🔎",Bash:"⚡",PowerShell:"💻",shell:"⚡",exec_command:"⚡",shell_command:"⚡",write_stdin:"💻",wait:"⏳",apply_patch:"🩹",update_plan:"📋",LS:"📂",Task:"🤖",Agent:"🤖",TodoWrite:"📋",TaskCreate:"📋",TaskUpdate:"📝",TaskList:"🗂️",TaskGet:"🗂️",TaskOutput:"📤",TaskStop:"🛑",WebFetch:"🌐",WebSearch:"🔭",ToolSearch:"🧰",NotebookEdit:"📓",EnterPlanMode:"🧭",ExitPlanMode:"🏁",AskUserQuestion:"❓",ScheduleWakeup:"⏰",CronCreate:"⏰",CronList:"📅",CronDelete:"🗑️",Skill:"🎯",Workflow:"🎬",Monitor:"📡",PushNotification:"🔔",RemoteTrigger:"📡"};function Zw(e){return e.startsWith("mcp__")?"🔌":FP[e]??"✨"}const zP={git:"🐙",gh:"🐙",glab:"🐙",npm:"📦",pnpm:"📦",yarn:"📦",bun:"📦",brew:"🍺",node:"🟢",deno:"🟢",python:"🐍",python3:"🐍",py:"🐍",pip:"🐍",pip3:"🐍",uv:"🐍",ruby:"💎",bundle:"💎",gem:"💎",cargo:"🦀",rustc:"🦀",rustup:"🦀",go:"🐹",docker:"🐳","docker-compose":"🐳",podman:"🐳",kubectl:"☸️",helm:"☸️",k9s:"☸️",grep:"🔎",rg:"🔎",ag:"🔎",ack:"🔎",find:"🔍",fd:"🔍",locate:"🔍",which:"🔍",ls:"📂",dir:"📂",tree:"📂",cat:"📄",head:"📄",tail:"📄",less:"📄",more:"📄",bat:"📄",cp:"📋",mv:"✂️",rm:"🗑️",rmdir:"🗑️",mkdir:"📁",touch:"📁",sed:"✏️",awk:"✏️",tr:"✏️",curl:"🌐",wget:"🌐",http:"🌐",httpie:"🌐",ssh:"🔐",scp:"🔐",rsync:"🔐",ping:"📡",make:"🔨",cmake:"🔨",ninja:"🔨",bazel:"🔨",just:"🔨",terraform:"🏗️",ansible:"📕",pulumi:"🏗️",ps:"📊",top:"📊",htop:"📊",btm:"📊",kill:"💀",pkill:"💀",systemctl:"⚙️",service:"⚙️",tar:"🗜️",zip:"🗜️",unzip:"🗜️",gzip:"🗜️","7z":"🗜️",vim:"📝",nvim:"📝",nano:"📝",emacs:"📝",code:"📝",jq:"🪺",yq:"🪺",echo:"💬",printf:"💬",ffmpeg:"🎞️",ffprobe:"🎞️",imagemagick:"🖼️",convert:"🖼️","Get-ChildItem":"📂","Get-Content":"📄","Set-Content":"💾","Out-File":"💾","Add-Content":"💾","Set-Location":"📍","Get-Location":"📍","Get-Process":"📊","Start-Process":"▶️","Stop-Process":"💀","Invoke-WebRequest":"🌐","Invoke-RestMethod":"🌐","New-Item":"📁","Remove-Item":"🗑️","Copy-Item":"📋","Move-Item":"✂️","Test-Path":"🔍","Where-Object":"🔎","ForEach-Object":"🔁","Select-Object":"🎯","Measure-Object":"📊","Get-Service":"⚙️","Restart-Service":"⚙️","ConvertTo-Json":"🪺","ConvertFrom-Json":"🪺"};function lN(e){if(!e)return null;let n=e.trim();if(!n)return null;const i=n.match(/^(?:bash|sh|zsh|fish|powershell|pwsh)(?:\.exe)?\s+(?:-c|-Command|-NoProfile|-NonInteractive|\s)+["']([^"']+)["']/i);if(i)return lN(i[1]);for(;;){const l=n.match(/^([A-Z_][A-Z0-9_]*=\S*)\s+/);if(!l)break;n=n.slice(l[0].length)}n=n.replace(/^sudo(?:\s+-\S+)*\s+/,""),n=n.replace(/^(?:time|nohup|xargs)\s+/,"");const s=n.match(/^([^\s|;&<>(]+)/);if(!s)return null;let o=s[1];return o=o.replace(/^.*[/\\]/,""),o=o.replace(/\.(exe|cmd|bat|ps1)$/i,""),o||null}function BP(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;const n=e;if(typeof n.cmd=="string")return n.cmd;if(typeof n.command=="string")return n.command;if(Array.isArray(n.command)&&n.command.every(i=>typeof i=="string")){const i=n.command;if(/powershell|cmd|bash|sh(\.exe)?$/i.test(i[0]??"")){const s=i.findIndex(o=>/^(-Command|-c)$/i.test(o));if(s>=0&&s+1<i.length)return i[s+1]}return i.join(" ")}return typeof n.script=="string"?n.script:null}const UP=new Set(["Bash","PowerShell","shell","exec_command","shell_command","write_stdin","wait"]),HP=new Set(["shell","exec_command","shell_command","write_stdin","wait","apply_patch","update_plan"]);function VP(e,n){return HP.has(e)?Math.max(Qw,34+n.length*7.5):Qw}function WP(e,n){if(!UP.has(e))return null;const i=BP(n);if(!i)return null;const s=lN(i);return s?{emoji:zP[s]??"⚙️",label:s,category:"shell",detail:i}:null}const GP=new Set(["Read","Write","Edit","MultiEdit","NotebookEdit","LS","Glob","apply_patch"]),Jw={ts:"🟦",tsx:"🟦",d:"🟦",js:"🟨",jsx:"🟨",mjs:"🟨",cjs:"🟨",py:"🐍",pyi:"🐍",ipynb:"📓",rs:"🦀",go:"🐹",rb:"💎",erb:"💎",java:"☕",kt:"☕",scala:"☕",gradle:"☕",cs:"🔷",fs:"🔷",php:"🐘",swift:"🦅",c:"🇨",cpp:"🇨",cc:"🇨",h:"🇨",hpp:"🇨",md:"📝",mdx:"📝",rst:"📝",json:"🪺",json5:"🪺",jsonl:"🪺",yaml:"⚙️",yml:"⚙️",toml:"⚙️",ini:"⚙️",conf:"⚙️",cfg:"⚙️",xml:"📰",html:"🌐",htm:"🌐",vue:"🌐",svelte:"🌐",css:"🎨",scss:"🎨",sass:"🎨",less:"🎨",sh:"⚡",bash:"⚡",zsh:"⚡",fish:"⚡",ps1:"⚡",txt:"📄",log:"📄",out:"📄",csv:"📊",tsv:"📊",xlsx:"📊",xls:"📊",pdf:"📕",png:"🖼️",jpg:"🖼️",jpeg:"🖼️",gif:"🖼️",webp:"🖼️",svg:"🖼️",ico:"🖼️",mp4:"🎬",mov:"🎬",avi:"🎬",mkv:"🎬",webm:"🎬",mp3:"🎵",wav:"🎵",ogg:"🎵",flac:"🎵",zip:"🗜️",tar:"🗜️",gz:"🗜️",bz2:"🗜️","7z":"🗜️",xz:"🗜️",rar:"🗜️",env:"🔐",lock:"🔐",pem:"🔐",key:"🔐",crt:"🔐",sql:"🗄️",db:"🗄️",sqlite:"🗄️",parquet:"🗄️"},ex={dockerfile:"🐳",makefile:"🔨",rakefile:"💎","package.json":"📦","pnpm-lock.yaml":"📦","yarn.lock":"📦","cargo.toml":"🦀","cargo.lock":"🦀","go.mod":"🐹","go.sum":"🐹","pyproject.toml":"🐍","requirements.txt":"🐍","readme.md":"📖",readme:"📖",license:"📜",".gitignore":"🐙",".gitattributes":"🐙",".env":"🔐",".dockerignore":"🐳"};function YP(e){const i=e.replace(/\\/g,"/").replace(/\/+$/,""),s=i.lastIndexOf("/");return s>=0?i.slice(s+1):i}function KP(e){const n=e.toLowerCase();if(ex[n])return ex[n];if(n.startsWith("dockerfile."))return"🐳";if(/\.(test|spec)\.[a-z]+$/.test(n))return"🧪";const i=n.lastIndexOf(".");if(i>0&&i<n.length-1){const s=n.slice(i+1);if(Jw[s])return Jw[s]}return"📄"}function XP(e,n){if(!n||typeof n!="object")return null;const i=n;if(e==="apply_patch"&&typeof i.patch=="string"){const s=i.patch.match(/^\*\*\* (?:Update|Add|Delete) File: (.+)$/m);return s?s[1].trim():null}return typeof i.file_path=="string"?i.file_path:typeof i.notebook_path=="string"?i.notebook_path:typeof i.path=="string"?i.path:e==="Glob"&&typeof i.pattern=="string"?i.pattern:null}function QP(e,n){if(!GP.has(e))return null;const i=XP(e,n);if(!i)return null;const s=YP(i);return s?{emoji:e==="LS"?"📂":KP(s),label:s,category:"file",detail:i}:null}const uN={github:{emoji:"🐙",name:"GitHub"},git:{emoji:"🐙",name:"Git"},gitlab:{emoji:"🦊",name:"GitLab"},slack:{emoji:"💬",name:"Slack"},discord:{emoji:"💬",name:"Discord"},linear:{emoji:"📐",name:"Linear"},jira:{emoji:"🅹",name:"Jira"},atlassian:{emoji:"🅰️",name:"Atlassian"},notion:{emoji:"📓",name:"Notion"},asana:{emoji:"📋",name:"Asana"},intercom:{emoji:"💬",name:"Intercom"},figma:{emoji:"🎨",name:"Figma"},gmail:{emoji:"📧",name:"Gmail"},calendar:{emoji:"📅",name:"Calendar"},drive:{emoji:"☁️",name:"Drive"},zoom:{emoji:"📹",name:"Zoom"},spotify:{emoji:"🎵",name:"Spotify"},youtube:{emoji:"📺",name:"YouTube"},ccd_session:{emoji:"📡",name:"Session"},ccd_directory:{emoji:"📂",name:"Directory"},ccd_session_mgmt:{emoji:"📡",name:"Sessions"},mcp_registry:{emoji:"🧰",name:"Registry"},"computer-use":{emoji:"🖱️",name:"Computer"},"claude-in-chrome":{emoji:"🌐",name:"Chrome"},"claude-preview":{emoji:"👀",name:"Preview"},"scheduled-tasks":{emoji:"⏰",name:"Scheduler"},visualize:{emoji:"🎨",name:"Visualize"},"plugin-design-asana":{emoji:"📋",name:"Asana"},"plugin-design-atlassian":{emoji:"🅰️",name:"Atlassian"},"plugin-design-figma":{emoji:"🎨",name:"Figma"},"plugin-design-intercom":{emoji:"💬",name:"Intercom"},"plugin-design-linear":{emoji:"📐",name:"Linear"},"plugin-design-notion":{emoji:"📓",name:"Notion"},"plugin-design-slack":{emoji:"💬",name:"Slack"}};function cN(e){if(!e.startsWith("mcp__"))return null;const n=e.slice(5),i=n.indexOf("__");return i<=0?{server:n,method:""}:{server:n.slice(0,i),method:n.slice(i+2)}}function ZP(e){let n=5381;for(let i=0;i<e.length;i++)n=(n<<5)+n^e.charCodeAt(i);return Math.abs(n)%360}function JP(e,n){const i=cN(e);if(!i)return null;const{server:s,method:o}=i;if(!o)return null;const l=uN[s.toLowerCase()];return{emoji:(l==null?void 0:l.emoji)??"🔌",label:o,category:"mcp",detail:l?`${l.name} · ${o}`:`${s} · ${o}`}}function e3(e,n){return WP(e,n)??QP(e,n)??JP(e)}const t3={shell:"Shell",exec_command:"Shell",shell_command:"Shell",write_stdin:"stdin",wait:"wait",apply_patch:"Edit",update_plan:"Plan"};function n3(e){const n=cN(e);if(n){const s=uN[n.server.toLowerCase()];return s?{emoji:s.emoji,label:s.name}:{emoji:"🔌",label:n.server,hue:ZP(n.server)}}const i=t3[e];return i?{emoji:Zw(e),label:i}:{emoji:Zw(e),label:e}}function r3(e){return e.endedAt==null?"inflight":e.ok===!1?"err":"done"}function i3(e,n,i){if(i==null)return 1;const s=n-i;return s<0?1:Math.max(0,1-s/aN)}function s3(e,n,i,s,o,l){const u=[];for(const c of e.values()){if(!n.has(c.id)||c.exitAt!=null&&l-c.exitAt>aN)continue;const d=s.get(c.id)??i.get(c.id);if(!d)continue;const h=c.tools.slice(-4);if(h.length===0)continue;const p=c.exitAt??null,m=o.get(c.id),y=Math.max((m==null?void 0:m.width)??Xw,Xw),x=(m==null?void 0:m.height)??130,N=d.x,_=d.y,S=N+y,b=_+x/2;h.forEach((k,E)=>{const C=E*PP,I=N+y+OP,P=_+qP+C,L=i3(k,l,p),O=k.inputPreview??"",R=r3(k),q=L<.999,F=n3(k.name);u.push({id:k.id,toolId:k.id,agentId:c.id,toolName:k.name,name:F.label,emoji:F.emoji,status:R,category:DP(k.name),mcpHue:F.hue,inputPreview:O,fade:L,fading:q,worldX:I,worldY:P,anchorX:S,anchorY:b,spawnDx:S-I,spawnDy:b-(P+Fg)});const J=e3(k.name,k.input);if(J){const Q=VP(k.name,F.label),A=I+Q+LP,V=P,B=I+Q,ne=P+Fg;u.push({id:`sub:${k.id}`,toolId:k.id,agentId:c.id,toolName:k.name,name:J.label,emoji:J.emoji,isSub:!0,status:R,category:J.category,inputPreview:J.detail??O,fade:L,fading:q,worldX:A,worldY:V,anchorX:B,anchorY:ne,spawnDx:B-A,spawnDy:0})}})}return u}function o3({agents:e,visibleAgentIds:n,positions:i,pinned:s,measured:o,dimUnmatched:l,spotlight:u,hiddenCategories:c,now:d,onOpenTool:h}){const{x:p,y:m,zoom:y}=QE(),x=s3(e,n,i,s,o,d),N=c&&c.size>0?x.filter(_=>!c.has(_.category)):x;return v.jsxs("div",{className:"tool-bursts-layer","aria-hidden":!0,children:[v.jsx("svg",{className:"tool-bursts-svg",children:N.map(_=>{const S=_.anchorX*y+p,b=_.anchorY*y+m,k=(_.worldX+6)*y+p,E=(_.worldY+Fg)*y+m,C=S+(k-S)*.55,I=l!=null&&!l.has(_.agentId),P=u!=null&&!u.has(_.agentId),L=_.fade*(I||P?.14:1);return v.jsx("path",{d:`M ${S} ${b} Q ${C} ${b}, ${k} ${E}`,className:`tool-conn status-${_.status}${_.fading?" fading":""}`,opacity:L},`l:${_.id}`)})}),N.map(_=>{const S=_.worldX*y+p,b=_.worldY*y+m,k={left:`${S}px`,top:`${b}px`,transform:`scale(${y})`,transformOrigin:"left top","--spawn-dx":`${_.spawnDx}px`,"--spawn-dy":`${_.spawnDy}px`},E=_.isSub?`${_.toolName} · ${_.name}`:_.toolName,C=_.inputPreview?`${E} · ${_.inputPreview}`:E,I=h!=null,P=_.mcpHue!=null?{"--cat-accent":`hsl(${_.mcpHue} 65% 65%)`}:{},L=l!=null&&!l.has(_.agentId),O=u!=null&&!u.has(_.agentId),R=L||O?" dim":"";return v.jsx("div",{className:"tool-burst-wrap",style:k,children:v.jsxs("div",{className:`tool-burst cat-${_.category} status-${_.status}${_.fading?" fading":""}${I?" clickable":""}${_.isSub?" sub":""}${R}`,style:P,title:C,role:I?"button":void 0,tabIndex:I?0:void 0,"aria-label":I?`Open ${_.toolName} ${_.status==="inflight"?"in flight":_.status} — click for details`:void 0,onClick:I?()=>h(_.toolId):void 0,onKeyDown:I?q=>{(q.key==="Enter"||q.key===" ")&&(q.preventDefault(),h(_.toolId))}:void 0,children:[v.jsx("span",{className:"tb-emoji",children:_.emoji}),v.jsx("span",{className:"tb-name",children:_.name}),_.status==="inflight"&&v.jsx("span",{className:"tb-spin"}),_.status==="done"&&v.jsx("span",{className:"tb-mark done",children:"✓"}),_.status==="err"&&v.jsx("span",{className:"tb-mark err",children:"×"})]})},_.id)})]})}function a3({state:e,sessionId:n,onClose:i}){const s=M.useMemo(()=>u3(e,n),[e,n]);return s?v.jsx("div",{className:"modal-backdrop",onClick:i,role:"presentation",children:v.jsxs("div",{className:"modal session-summary",onClick:o=>o.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"ss-title",children:[v.jsxs("div",{className:"modal-head",children:[v.jsxs("div",{className:"modal-title",children:[v.jsx("span",{className:"state-pill state-done","aria-hidden":!0,children:"done"}),v.jsx("span",{id:"ss-title",className:"modal-tool-name",title:s.cwd??s.sessionId,children:s.label}),v.jsxs("span",{className:"modal-tool-id",children:["· ",s.sessionId.slice(0,8)]})]}),v.jsxs("div",{className:"modal-actions",children:[v.jsx("span",{className:"modal-dur",title:"Total wall time",children:s.durationLabel}),v.jsx("button",{className:"btn",onClick:i,"aria-label":"Close",children:"×"})]})]}),v.jsxs("div",{className:"modal-body",children:[v.jsxs("section",{className:"ss-hero",children:[v.jsxs("div",{className:"ss-hero-left",children:[v.jsx("div",{className:"ss-cost-label",children:"total spend"}),v.jsx("div",{className:"ss-cost",children:Fe(s.cost.total)}),s.modelChips.length>0&&v.jsx("div",{className:"ss-models",children:s.modelChips.map(o=>v.jsx("span",{className:"model-chip",title:o,children:na(o)},o))})]}),v.jsx("div",{className:"ss-hero-right",children:s.cost.total>0&&v.jsxs(v.Fragment,{children:[v.jsx(l3,{cost:s.cost}),v.jsxs("div",{className:"ss-cost-legend",children:[v.jsxs("span",{className:"ssl ssl-in",children:["input ",v.jsx("b",{children:Fe(s.cost.input)})]}),v.jsxs("span",{className:"ssl ssl-out",children:["output ",v.jsx("b",{children:Fe(s.cost.output)})]}),v.jsxs("span",{className:"ssl ssl-cr",children:["cache r ",v.jsx("b",{children:Fe(s.cost.cacheRead)})]}),v.jsxs("span",{className:"ssl ssl-cw",children:["cache w ",v.jsx("b",{children:Fe(s.cost.cacheWrite)})]})]})]})})]}),v.jsxs("section",{className:"ss-stats",children:[v.jsx(Ms,{label:"agents",value:s.agentCount}),v.jsx(Ms,{label:"subagents",value:s.subagentCount}),v.jsx(Ms,{label:"tool calls",value:s.toolCount}),v.jsx(Ms,{label:"prompts",value:s.promptCount}),v.jsx(Ms,{label:"tokens",value:s.tokensSum.toLocaleString()}),s.errCount>0&&v.jsx(Ms,{label:"errors",value:s.errCount,tone:"err"})]}),s.topTools.length>0&&v.jsxs("section",{className:"modal-section",children:[v.jsx("h4",{children:"Most-used tools"}),v.jsx("div",{className:"ss-top-tools",children:s.topTools.map(([o,l])=>v.jsxs("div",{className:"ss-tt",children:[v.jsx("span",{className:"ss-tt-name",children:o}),v.jsx("span",{className:"ss-tt-bar",children:v.jsx("span",{className:"ss-tt-bar-fill",style:{width:`${l/s.topTools[0][1]*100}%`}})}),v.jsx("span",{className:"ss-tt-count",children:l})]},o))})]}),s.firstPrompt&&v.jsxs("section",{className:"modal-section",children:[v.jsx("h4",{children:"Opening prompt"}),v.jsx("div",{className:"ss-prompt",children:s.firstPrompt})]})]})]})}):null}function Ms({label:e,value:n,tone:i}){return v.jsxs("div",{className:`ss-stat${i?` tone-${i}`:""}`,children:[v.jsx("div",{className:"ss-stat-value",children:n}),v.jsx("div",{className:"ss-stat-label",children:e})]})}function l3({cost:e}){const n=e.total;if(n<=0)return null;const i=(s,o,l)=>{if(s<=0)return null;const u=s/n*100;return v.jsx("span",{className:`cb-seg ${o}`,style:{width:`${u}%`},title:`${l}: ${Fe(s)} (${u.toFixed(0)}%)`},o)};return v.jsxs("div",{className:"cost-bar cost-bar-lg","aria-label":"Cost breakdown",children:[i(e.input,"cb-input","input"),i(e.output,"cb-output","output"),i(e.cacheRead,"cb-cache-r","cache read"),i(e.cacheWrite,"cb-cache-w","cache write")]})}function u3(e,n){const i=e.agents.get(n);if(!i)return null;const s=[];for(const E of e.agents.values())E.sessionId===n&&s.push(E);if(s.length===0)return null;const o={input:0,output:0,cacheRead:0,cacheWrite:0,total:0},l=new Set,u=new Map;let c=0,d=0,h=0,p=0,m=0,y,x=1/0,N=0;for(const E of s){const C=dn(E.usage,E.model);o.input+=C.input,o.output+=C.output,o.cacheRead+=C.cacheRead,o.cacheWrite+=C.cacheWrite,o.total+=C.total,E.model&&l.add(E.model),E.kind==="subagent"&&m++,d+=E.prompts.length,!y&&E.prompts.length>0&&(y=E.prompts[0].text),h+=E.usage.inputTokens+E.usage.outputTokens,c+=E.tools.length,x=Math.min(x,E.startedAt),N=Math.max(N,E.endedAt??Date.now());for(const I of E.tools)u.set(I.name,(u.get(I.name)??0)+1),I.ok===!1&&p++}const _=Math.max(0,N-x),S=Math.floor(_/1e3),b=S<60?`${S}s`:S<3600?`${Math.floor(S/60)}m ${String(S%60).padStart(2,"0")}s`:`${Math.floor(S/3600)}h ${Math.floor(S%3600/60)}m`,k=Array.from(u.entries()).sort((E,C)=>C[1]-E[1]).slice(0,5);return{sessionId:n,label:i.label||i.cwdBasename||"session",cwd:i.cwd,durationLabel:b,cost:o,modelChips:Array.from(l),agentCount:s.length,subagentCount:m,toolCount:c,promptCount:d,tokensSum:h,errCount:p,topTools:k,firstPrompt:y}}function c3(e,n){const i=[];for(const s of e.agents.values()){if(s.kind!=="root")continue;let o=s.tools.length,l=dn(s.usage,s.model).total,u=s.endedAt??s.startedAt;for(const c of e.agents.values()){if(c.sessionId!==s.sessionId||c.kind==="root")continue;o+=c.tools.length,l+=dn(c.usage,c.model).total;const d=c.endedAt??c.startedAt;d>u&&(u=d)}i.push({sessionId:s.sessionId,label:s.label||s.cwdBasename||"session",cwdBasename:s.cwdBasename,state:s.state,modelId:s.model,toolCount:o,cost:l,startedAt:s.startedAt,lastActivity:u})}return i.sort((s,o)=>{if(s.state!==o.state){if(s.state==="active")return-1;if(o.state==="active")return 1}return o.lastActivity-s.lastActivity}),i}function f3(e,n,i){const s=(n??i)-e;if(s<1e3)return"<1s";const o=Math.floor(s/1e3);if(o<60)return`${o}s`;const l=Math.floor(o/60);return l<60?`${l}m`:`${Math.floor(l/60)}h ${l%60}m`}function d3({state:e,now:n,selectedIds:i,onSelect:s,onClose:o}){const l=M.useMemo(()=>c3(e),[e,e.lastSeq,n]),u=l.filter(c=>c.state==="active").length;return v.jsxs("aside",{className:"session-list","aria-label":"Sessions",children:[v.jsxs("div",{className:"sl-header",children:[v.jsxs("h3",{children:["Sessions ",v.jsx("span",{className:"sl-count",children:l.length})]}),u>0&&v.jsxs("span",{className:"sl-live-count",children:[u," live"]}),v.jsx("button",{className:"btn icon-btn sl-close",onClick:o,title:"Hide sidebar (L)","aria-label":"Hide session list",children:"‹"})]}),v.jsxs("div",{className:"sl-rows",children:[l.length===0&&v.jsx("div",{className:"sl-empty",children:"No sessions yet."}),l.map(c=>{const d=i.has(c.sessionId);return v.jsxs("button",{type:"button",className:`sl-row state-${c.state}${d?" selected":""}`,onClick:()=>s(c.sessionId),title:`Focus ${c.label}`,children:[v.jsx("span",{className:`sl-dot state-${c.state}`,"aria-hidden":!0}),v.jsxs("div",{className:"sl-row-body",children:[v.jsxs("div",{className:"sl-row-head",children:[v.jsx("span",{className:"sl-label",children:c.label}),c.modelId&&v.jsx("span",{className:"model-chip",title:c.modelId,children:na(c.modelId)})]}),v.jsxs("div",{className:"sl-row-meta",children:[v.jsxs("span",{title:"tool calls",children:[v.jsx("b",{children:c.toolCount})," tools"]}),c.cost>0&&v.jsx("span",{className:"sl-cost",title:"total spend",children:v.jsx("b",{children:Fe(c.cost)})}),v.jsx("span",{className:"sl-elapsed",title:`Started ${new Date(c.startedAt).toLocaleString()}`,children:f3(c.startedAt,c.state==="active"?void 0:c.lastActivity,n)})]})]})]},c.sessionId)})]})]})}function tx(e,n){if(!e)return null;const i=n-Math.floor(e/1e3);return i<10?"just now":i<60?`${i}s ago`:i<3600?`${Math.floor(i/60)}m ago`:`${Math.floor(i/3600)}h ago`}function h3(e){return e==="claude-swap"?"Read from claude-swap's last collection — costs no request against your usage-endpoint budget":e==="api"?"Fetched from Anthropic's usage endpoint, at most once every 5 minutes":e==="cli"?"Parsed from `claude /usage`, at most once every 5 minutes":"Last update"}function Cr(e){return e<1e3?`${e}`:e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(2)}M`}function p3({cost:e}){const n=e.total;if(n<=0)return null;const i=(s,o,l)=>{if(s<=0)return null;const u=s/n*100;return v.jsx("span",{className:`cb-seg ${o}`,style:{width:`${u}%`},title:`${l}: ${Fe(s)} (${u.toFixed(0)}%)`},o)};return v.jsxs("div",{className:"cost-bar","aria-label":"Cost breakdown",children:[i(e.input,"cb-input","input"),i(e.output,"cb-output","output"),i(e.cacheRead,"cb-cache-r","cache read"),i(e.cacheWrite,"cb-cache-w","cache write")]})}function m3(e,n){const i=e-n;if(i<=0)return null;const s=Math.floor(i/3600),o=Math.floor(i%3600/60);if(s>23){const l=Math.floor(i/86400),u=Math.floor(i%86400/3600);return`${l}d ${u}h`}return s>0?`${s}h ${o}m`:`${o}m`}function g3(e,n,i,s){const o=Math.max(0,n-s),l=Math.max(0,i-o);if(l<120)return null;const u=Math.min(100,l/i*100),c=e-u;if(Math.abs(c)<3)return{label:"on pace",color:"var(--ok)",expectedPct:u,isDeficit:!1};if(c>0){const d=100-e,h=l>0?e/l:0,p=h>0?d/h:1/0,m={label:`${Math.round(c)}% ahead`,color:"var(--warn)",expectedPct:u,isDeficit:!0};if(p<o&&p<86400){const y=Math.floor(p/3600),x=Math.floor(p%3600/60);m.runsOutIn=y>0?`${y}h ${x}m`:`${x}m`}return m}return{label:`${Math.round(-c)}% reserve`,color:"var(--ok)",expectedPct:u,isDeficit:!1}}function $i({pct:e,label:n,reset:i,resetAt:s,windowSec:o,limitReached:l,nowSec:u}){const c=Math.min(100,Math.max(0,e)),h=l||c>=90?"var(--err)":c>=70?"var(--warn)":"var(--accent)",p=c===0?"< 1%":`${c}%`,m=c===0?2:c,y=s?m3(s,u):null,x=s&&o?g3(c,s,o,u):null;return v.jsxs("div",{className:"qb-row",children:[v.jsxs("div",{className:"qb-meta",children:[v.jsxs("span",{className:"qb-label",children:[n,l&&v.jsx("span",{className:"qb-limit-badge",title:"Rate limit reached",children:"⛔"})]}),v.jsx("span",{className:"qb-pct",style:{color:h},children:p})]}),v.jsxs("div",{className:"qb-track",children:[v.jsx("div",{className:"qb-fill",style:{width:`${m}%`,background:h,opacity:c===0?.4:1}}),x&&v.jsx("div",{className:"qb-pace-marker",style:{left:`${x.expectedPct}%`,background:x.isDeficit?"var(--err)":"var(--ok)"},title:`To last until reset, stay near ${Math.round(x.expectedPct)}% by now`})]}),v.jsxs("div",{className:"qb-reset-row",children:[y?v.jsxs("span",{className:"qb-reset",children:["resets in ",y]}):i?v.jsxs("span",{className:"qb-reset",children:["resets ",i]}):null,x&&v.jsx("span",{className:"qb-pace",style:{color:x.color},children:x.runsOutIn?`runs out in ${x.runsOutIn}`:x.label})]})]})}const v3=6e4;function y3(){const[e,n]=M.useState(null),[i,s]=M.useState(!1),o=M.useRef(null),l=async(c=!1)=>{c&&s(!0);try{const h=await fetch(c?"/api/quota?refresh=1":"/api/quota");h.ok&&n(await h.json())}catch{}finally{c&&s(!1)}};return M.useEffect(()=>(l(!0),o.current=window.setInterval(()=>l(!1),v3),()=>{o.current!=null&&window.clearInterval(o.current)}),[]),{quota:e,loading:i,refresh:()=>l(!0)}}function w3(e){switch(e){case"no_token":return"Run codex login to authenticate.";case"api_key_mode":return"API-key login — ChatGPT quota is only available for codex login.";case"refresh_rejected":return"Codex session expired — run codex login.";case"refresh_failed":return"Couldn't refresh the Codex token — click ↻ to retry.";default:return"ChatGPT API unreachable — click ↻ to retry."}}const fN=6e4;function x3(){const[e,n]=M.useState(null),[i,s]=M.useState(!1),o=M.useRef(null),l=async(c=!1)=>{c&&s(!0);try{const h=await fetch(c?"/api/codex-quota?refresh=1":"/api/codex-quota");h.ok&&n(await h.json())}catch{}finally{c&&s(!1)}};return M.useEffect(()=>(l(!0),o.current=window.setInterval(()=>l(!1),fN),()=>{o.current!=null&&window.clearInterval(o.current)}),[]),{data:e,loading:i,refresh:()=>l(!0)}}function _3(){const[e,n]=M.useState(null),i=M.useRef(null),s=async()=>{try{const o=await fetch("/api/codex-usage");o.ok&&n(await o.json())}catch{}};return M.useEffect(()=>(s(),i.current=window.setInterval(s,fN),()=>{i.current!=null&&window.clearInterval(i.current)}),[]),{data:e}}function S3({state:e,now:n,onClose:i}){var L,O;const{quota:s,loading:o,refresh:l}=y3(),{data:u,loading:c,refresh:d}=x3(),{data:h}=_3(),[p,m]=M.useState(()=>Math.floor(Date.now()/1e3));M.useEffect(()=>{const R=window.setInterval(()=>m(Math.floor(Date.now()/1e3)),3e4);return()=>window.clearInterval(R)},[]);const{byModel:y,totalCost:x,totalTokens:N,burnRate:_}=M.useMemo(()=>{const R=new Map,q={total:0,input:0,output:0,cacheRead:0,cacheWrite:0};let F=0,J=0,Q=0,A=0;for(const $ of e.agents.values()){const G=$.model??"__unknown__",j=dn($.usage,$.model),U=R.get(G);U?(U.inputTokens+=$.usage.inputTokens,U.outputTokens+=$.usage.outputTokens,U.cacheReadTokens+=$.usage.cacheReadTokens,U.cacheCreateTokens+=$.usage.cacheCreateTokens,U.cost.total+=j.total,U.cost.input+=j.input,U.cost.output+=j.output,U.cost.cacheRead+=j.cacheRead,U.cost.cacheWrite+=j.cacheWrite,U.agentCount++):R.set(G,{model:G,inputTokens:$.usage.inputTokens,outputTokens:$.usage.outputTokens,cacheReadTokens:$.usage.cacheReadTokens,cacheCreateTokens:$.usage.cacheCreateTokens,cost:{...j},agentCount:1}),q.total+=j.total,q.input+=j.input,q.output+=j.output,q.cacheRead+=j.cacheRead,q.cacheWrite+=j.cacheWrite,F+=$.usage.inputTokens,J+=$.usage.outputTokens,Q+=$.usage.cacheReadTokens,A+=$.usage.cacheCreateTokens}const V=Array.from(R.values()).sort(($,G)=>G.cost.total-$.cost.total);let B=0,ne=0;for(const $ of e.agents.values()){if($.state!=="active")continue;const G=dn($.usage,$.model);B+=G.total,ne=Math.max(ne,(($.endedAt??n)-$.startedAt)/1e3)}const X=ne>0?Ll(B,ne):null;return{byModel:V,totalCost:q,totalTokens:{in:F,out:J,cacheR:Q,cacheC:A},burnRate:X}},[e,e.lastSeq,n]),S=M.useMemo(()=>{const R=[];for(const q of e.agents.values()){if(q.kind!=="root")continue;let F=dn(q.usage,q.model).total,J=q.usage.inputTokens,Q=q.usage.outputTokens;for(const A of e.agents.values())A.sessionId!==q.sessionId||A.kind==="root"||(F+=dn(A.usage,A.model).total,J+=A.usage.inputTokens,Q+=A.usage.outputTokens);R.push({sessionId:q.sessionId,label:q.label||q.cwdBasename||"session",state:q.state,cost:F,inputTokens:J,outputTokens:Q})}return R.sort((q,F)=>F.cost-q.cost).slice(0,12)},[e,e.lastSeq]),b=x.total>0,k=N.in+N.out,E=o||c,C=tx(s==null?void 0:s.fetchedAt,p),I=tx(u==null?void 0:u.fetchedAt,p),P=()=>{l(),d()};return v.jsxs("div",{className:"usage-panel","aria-label":"Usage",children:[v.jsxs("div",{className:"up-header",children:[v.jsx("h3",{children:"Usage"}),_&&v.jsx("span",{className:"up-rate",children:_}),v.jsxs("div",{className:"up-header-right",children:[v.jsx("button",{type:"button",className:"btn up-refresh-btn",onClick:P,disabled:E,title:"Refresh Claude + Codex quota",children:E?"…":"↻"}),v.jsx("button",{type:"button",className:"btn icon-btn up-close",onClick:i,"aria-label":"Close usage panel",title:"Close (U)",children:"×"})]})]}),v.jsxs("section",{className:"up-section up-quota-section",children:[v.jsxs("h4",{className:"up-section-title",children:["Claude quota",C&&!o&&v.jsx("span",{className:"up-section-age",title:h3(s==null?void 0:s.source),children:C})]}),s!=null&&s.ok?v.jsxs("div",{className:"up-quota-bars",children:[s.session5hPct!=null&&v.jsx($i,{label:"5-hour window",pct:s.session5hPct,reset:s.session5hReset,resetAt:s.session5hResetAt,windowSec:s.session5hWindowSec,nowSec:p}),s.week7dPct!=null&&v.jsx($i,{label:"7-day window",pct:s.week7dPct,reset:s.week7dReset,resetAt:s.week7dResetAt,windowSec:s.week7dWindowSec,nowSec:p}),s.weekSonnetPct!=null&&v.jsx($i,{label:"Sonnet (7d)",pct:s.weekSonnetPct,nowSec:p}),s.weekOpusPct!=null&&v.jsx($i,{label:"Opus (7d)",pct:s.weekOpusPct,nowSec:p})]}):(s==null?void 0:s.ok)===!1?v.jsxs("div",{className:"up-quota-na",children:[v.jsx("span",{children:"Quota unavailable."}),v.jsxs("span",{className:"up-quota-hint",children:["Run ",v.jsx("code",{children:"/usage"})," in a claude session, then click ↻"]})]}):v.jsx("div",{className:"up-quota-na up-quota-loading",children:"Checking…"})]}),v.jsxs("section",{className:"up-section up-quota-section",children:[v.jsxs("h4",{className:"up-section-title",children:["Codex quota",(u==null?void 0:u.ok)&&u.planLabel&&v.jsx("span",{className:"up-plan-badge",children:u.planLabel}),I&&!c&&v.jsx("span",{className:"up-section-age",title:"Fetched from the Codex usage endpoint",children:I})]}),u!=null&&u.ok?v.jsxs("div",{className:"up-quota-bars",children:[(L=u.windows)==null?void 0:L.map(R=>v.jsx($i,{label:R.label,pct:R.pct,reset:R.reset??void 0,resetAt:R.resetAt??void 0,windowSec:R.windowSec??void 0,limitReached:u.limitReached&&R.pct>=100,nowSec:p},R.id)),(O=u.extraWindows)==null?void 0:O.map(R=>v.jsx($i,{label:R.label,pct:R.pct,reset:R.reset??void 0,resetAt:R.resetAt??void 0,windowSec:R.windowSec??void 0,nowSec:p},R.id)),u.creditLimit&&v.jsx($i,{label:`spend cap · $${Math.round(u.creditLimit.used)} of $${Math.round(u.creditLimit.limit)}`,pct:u.creditLimit.usedPct,reset:u.creditLimit.reset??void 0,resetAt:u.creditLimit.resetAt??void 0,limitReached:u.spendControlReached,nowSec:p}),(h==null?void 0:h.ok)&&h.window7d&&h.window7d.sessionCount>0&&v.jsxs("div",{className:"up-quota-sub",children:[Cr(h.window7d.totalTokens)," tokens · ",h.window7d.sessionCount," session",h.window7d.sessionCount!==1?"s":""," (7d)"]}),u.creditsBalance&&!u.creditsUnlimited&&v.jsxs("div",{className:"up-quota-sub up-credits",children:["credits: $",u.creditsBalance,u.overageReached&&" · overage limit reached"]}),u.creditsUnlimited&&v.jsx("div",{className:"up-quota-sub up-credits",children:"credits: unlimited"}),u.resetCredits&&u.resetCredits.availableCount>0&&v.jsxs("div",{className:"up-quota-sub up-reset-credits",title:"Redeem in the Codex CLI or ChatGPT — agents-deck only reports them",children:[u.resetCredits.availableCount," rate-limit reset",u.resetCredits.availableCount!==1?"s":""," available",u.resetCredits.nextExpiryAt&&` · expires ${new Date(u.resetCredits.nextExpiryAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})}`]}),u.promo&&v.jsx("div",{className:"up-quota-sub",children:u.promo}),u.partial&&v.jsx("div",{className:"up-quota-sub up-quota-hint",children:"Partial data — OpenAI returned limits this build doesn't recognise."})]}):(u==null?void 0:u.ok)===!1?v.jsxs("div",{className:"up-quota-na",children:[v.jsx("span",{children:"Quota unavailable."}),v.jsx("span",{className:"up-quota-hint",children:w3(u.reason)})]}):v.jsx("div",{className:"up-quota-na up-quota-loading",children:"Checking…"})]}),b?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"up-total",children:[v.jsx("span",{className:"up-total-value",children:Fe(x.total)}),v.jsx("span",{className:"up-total-label",children:"total spend"})]}),v.jsx(p3,{cost:x}),k>0&&v.jsxs("div",{className:"up-tokens-row",children:[v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"in"}),Cr(N.in)]}),v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"out"}),Cr(N.out)]}),N.cacheR>0&&v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"cache r"}),Cr(N.cacheR)]}),N.cacheC>0&&v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"cache c"}),Cr(N.cacheC)]})]}),y.filter(R=>R.cost.total>0).length>0&&v.jsxs("section",{className:"up-section",children:[v.jsx("h4",{className:"up-section-title",children:"By model"}),v.jsxs("table",{className:"up-table",children:[v.jsx("thead",{children:v.jsxs("tr",{children:[v.jsx("th",{children:"Model"}),v.jsx("th",{children:"Tokens"}),v.jsx("th",{children:"Cost"})]})}),v.jsx("tbody",{children:y.filter(R=>R.cost.total>0).map(R=>v.jsxs("tr",{children:[v.jsx("td",{className:"up-model-name",title:R.model,children:na(R.model)}),v.jsx("td",{className:"up-num",children:Cr(R.inputTokens+R.outputTokens)}),v.jsx("td",{className:"up-num up-cost-val",children:Fe(R.cost.total)})]},R.model))})]})]}),S.filter(R=>R.cost>0).length>0&&v.jsxs("section",{className:"up-section",children:[v.jsx("h4",{className:"up-section-title",children:"By session"}),v.jsx("div",{className:"up-sessions",children:S.filter(R=>R.cost>0).map(R=>v.jsxs("div",{className:"up-session-row",children:[v.jsx("span",{className:`sl-dot state-${R.state}`,"aria-hidden":!0}),v.jsx("span",{className:"up-session-label",children:R.label}),v.jsx("span",{className:"up-session-tokens",children:Cr(R.inputTokens+R.outputTokens)}),v.jsx("span",{className:"up-session-cost",children:Fe(R.cost)})]},R.sessionId))})]})]}):k>0?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"up-tokens-row",children:[v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"in"}),Cr(N.in)]}),v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"out"}),Cr(N.out)]})]}),v.jsx("div",{className:"up-hint",children:"Cost appears once a known model is detected."})]}):v.jsxs("div",{className:"up-empty",children:["No usage data yet.",v.jsx("br",{}),"Start a Claude Code or Codex session."]})]})}const b3=15e3,k3=[70,80,85,90,95];function E3(e,n){const i=e-n;if(i<=0)return null;const s=Math.floor(i/86400),o=Math.floor(i%86400/3600),l=Math.floor(i%3600/60);return s>0?`${s}d ${o}h`:o>0?`${o}h ${l}m`:`${l}m`}function nx(e,n){const i=n-Math.floor(e/1e3);return i<60?"just now":i<3600?`${Math.floor(i/60)}m ago`:i<86400?`${Math.floor(i/3600)}h ago`:`${Math.floor(i/86400)}d ago`}function N3(e,n){if(!e)return"";const i=Math.floor(e/1e3)-n;return i<=0?" · due":i<60?` · next in ${i}s`:` · next in ${Math.round(i/60)}m`}function C3(e){return e==="http-429"?"rate limited":e==="http-401"?"re-login needed":e==="timeout"?"timed out":e==="network"?"unreachable":e}function R3({lane:e,nowSec:n}){const i=Math.min(100,Math.max(0,e.pct)),s=i>=90?"var(--err)":i>=70?"var(--warn)":"var(--accent)",o=e.resetAt?E3(e.resetAt,n):null;return v.jsxs("div",{className:"ap-lane",children:[v.jsx("span",{className:"ap-lane-label",children:e.label}),v.jsx("div",{className:"ap-lane-track",children:v.jsx("div",{className:"ap-lane-fill",style:{width:`${i===0?1.5:i}%`,background:s,opacity:i===0?.4:1}})}),v.jsxs("span",{className:"ap-lane-pct",style:{color:s},children:[i,"%"]}),v.jsx("span",{className:"ap-lane-reset",children:o?`resets ${o}`:""})]})}function T3({onClose:e}){var I,P,L;const[n,i]=M.useState(null),[s,o]=M.useState(null),[l,u]=M.useState(null),[c,d]=M.useState(null),[h,p]=M.useState(null),[m,y]=M.useState(()=>Math.floor(Date.now()/1e3)),x=M.useRef(null),N=M.useCallback(async(O=!1)=>{try{const[R,q]=await Promise.all([fetch(`/api/claude-accounts${O?"?refresh=1":""}`),fetch("/api/cswap-auto")]);R.ok&&i(await R.json()),q.ok&&o(await q.json())}catch{}},[]),_=M.useCallback(async(O,R)=>{u(R),p(null);try{const F=await(await fetch("/api/cswap-auto",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})).json().catch(()=>null);return F!=null&&F.ok||p((F==null?void 0:F.detail)||(F==null?void 0:F.reason)||"command failed"),F}catch{return p("server unreachable"),null}finally{u(null)}},[]);M.useEffect(()=>(N(!0),x.current=window.setInterval(()=>N(!1),b3),()=>{x.current!=null&&window.clearInterval(x.current)}),[N]),M.useEffect(()=>{const O=window.setInterval(()=>y(Math.floor(Date.now()/1e3)),3e4);return()=>window.clearInterval(O)},[]);const S=((I=s==null?void 0:s.settings["autoswitch.threshold"])==null?void 0:I.value)??"90",b=(P=n==null?void 0:n.accounts)==null?void 0:P.find(O=>O.active),k=b!=null&&b.lanes.length?Math.max(...b.lanes.map(O=>O.pct)):null,E=k!=null&&k>=Number(S)-15,C=async O=>{d(O),p(null);try{const q=await(await fetch("/api/claude-accounts/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({account:O})})).json().catch(()=>null);q!=null&&q.ok||p((q==null?void 0:q.output)||(q==null?void 0:q.reason)||"switch failed"),await N(!0)}catch{p("server unreachable")}finally{d(null)}};return v.jsxs("div",{className:"accounts-panel","aria-label":"Claude accounts",children:[v.jsxs("div",{className:"ap-header",children:[v.jsx("h3",{children:"Accounts"}),v.jsxs("div",{className:"ap-header-right",children:[v.jsx("button",{type:"button",className:"btn ap-refresh",onClick:()=>N(!0),title:"Reload from claude-swap",children:"↻"}),v.jsx("button",{type:"button",className:"btn icon-btn",onClick:e,"aria-label":"Close accounts panel",title:"Close (A)",children:"×"})]})]}),n==null?v.jsx("div",{className:"ap-empty",children:"Checking…"}):n.ok?v.jsxs(v.Fragment,{children:[(L=n.accounts)==null?void 0:L.map(O=>v.jsxs("div",{className:`ap-account${O.active?" active":""}${O.disabled?" disabled":""}`,children:[v.jsxs("div",{className:"ap-account-head",children:[v.jsx("span",{className:"ap-num",children:O.num}),O.alias&&v.jsx("span",{className:"ap-alias",children:O.alias}),v.jsx("span",{className:"ap-email",title:O.org??void 0,children:O.email}),O.active?v.jsx("span",{className:"ap-badge-active",children:"● active"}):v.jsx("button",{type:"button",className:"btn ap-switch",disabled:c!=null||O.disabled,onClick:()=>C(O.num),title:O.disabled?"Held out of rotation":`Switch to ${O.alias??O.email}`,children:c===O.num?"…":"switch"})]}),O.lanes.length>0?O.lanes.map(R=>v.jsx(R3,{lane:R,nowSec:m},R.id)):v.jsx("div",{className:"ap-hint",children:"No usage recorded yet."}),v.jsxs("div",{className:"ap-meta",children:[O.error&&v.jsx("span",{className:"ap-err",children:C3(O.error)}),((s==null?void 0:s.enabled)||(s==null?void 0:s.external))&&!O.active&&v.jsx("button",{type:"button",className:"ap-rotate",disabled:l!=null,onClick:()=>_({action:"account",account:O.num,enabled:O.disabled},`rot-${O.num}`).then(()=>N(!0)),title:O.disabled?"Return this account to auto-rotation":"Hold this account out of auto-rotation",children:O.disabled?"held out":"in rotation"}),O.fetchedAt?v.jsxs("span",{className:`ap-age${O.stale?" ap-stale":""}`,title:"When claude-swap last read this account's usage, and when it plans to read it again. It sets that interval itself — 3 minutes at the fastest, wider while an account is recovering from a rate limit — and every surface, including `cswap watch`, follows the same plan.",children:["collected ",nx(O.fetchedAt,m),N3(O.nextAt,m)]}):v.jsx("span",{className:"ap-age ap-stale",title:"claude-swap has not read this account yet",children:"never collected"})]})]},O.num)),(s==null?void 0:s.ok)&&v.jsxs("div",{className:"ap-auto",children:[v.jsxs("div",{className:"ap-auto-head",children:[v.jsx("span",{className:"ap-auto-title",children:"Auto-switch"}),v.jsxs("span",{className:"ap-auto-ctl",children:[k!=null&&v.jsxs("span",{className:`ap-auto-now${E?" near":""}`,children:[Math.round(k),"%"]}),v.jsx("span",{className:"ap-field",title:"Switch once the active account passes this much of its limit",children:v.jsx("select",{"aria-label":"Switch threshold",value:S,disabled:l!=null,onChange:O=>_({action:"setting",key:"autoswitch.threshold",value:O.target.value},"threshold").then(()=>N(!0)),children:k3.map(O=>v.jsxs("option",{value:O,children:[O,"%"]},O))})}),v.jsxs("button",{type:"button",className:`ap-auto-state toggle${s.enabled?" live":""}`,role:"switch","aria-checked":s.enabled,disabled:l!=null,onClick:()=>_({action:"enable",enabled:!s.enabled},"enable").then(()=>N(!0)),title:s.enabled?"Stop switching accounts automatically":"Switch accounts automatically when the active one nears its limit",children:[v.jsx("i",{className:s.enabled?"ap-pulse":"ap-dot","aria-hidden":!0}),s.enabled?"on":"off"]})]})]}),s.external&&v.jsxs("p",{className:"ap-auto-note",children:[v.jsx("i",{className:"ap-pulse","aria-hidden":!0})," A ",v.jsx("code",{children:"cswap auto"})," loop in your terminal is doing the switching. The deck stands down while it runs",s.enabled?" — this toggle takes over when you stop it.":"."]}),s.lastTick&&v.jsx("div",{className:"ap-auto-foot",children:v.jsxs("span",{className:"ap-auto-result",children:["checked ",nx(s.lastTick.at,m)]})})]}),h&&v.jsx("div",{className:"ap-failure",children:h}),v.jsx("p",{className:"ap-footnote",title:"Anthropic's usage endpoint allows roughly 28–30 requests per hour per account, shared by every tool on this machine — polling it from here would rate-limit your account. So the deck never fetches: it asks claude-swap to collect while this panel is open, at most once every three minutes, and claude-swap decides whether that touches the network at all.",children:"Collected by claude-swap while this panel is open."})]}):v.jsx("div",{className:"ap-empty",children:n.reason==="no_cswap"?v.jsxs(v.Fragment,{children:[v.jsx("span",{children:"claude-swap isn't installed."}),v.jsx("span",{className:"ap-hint",children:"This panel reads the account store claude-swap keeps — without it there is nothing to show. It is a separate tool, published on PyPI, so it does not come with this package."}),n.hint&&v.jsx("code",{className:"ap-cmd",children:n.hint}),v.jsxs("span",{className:"ap-hint",children:["Then add your accounts with ",v.jsx("code",{children:"cswap add"})," and reload."]})]}):n.reason==="no_accounts"?v.jsxs(v.Fragment,{children:[v.jsx("span",{children:"No accounts added yet."}),v.jsx("span",{className:"ap-hint",children:"claude-swap is installed but has nothing in its store."}),v.jsx("code",{className:"ap-cmd",children:"cswap add"})]}):v.jsxs(v.Fragment,{children:[v.jsx("span",{children:"Couldn't read the account store."}),v.jsxs("span",{className:"ap-hint",children:["claude-swap is installed, but its store could not be read",n.reason?` (${n.reason})`:"","."]})]})})]})}const j3=3e4;function A3({bundle:e,running:n,lastTried:i}){return!n||e===n?!1:i!==n}function I3(e){const n=e.thresholdMs??j3;return!e.enabled||e.kind!=="restart"||!e.canRestart?{idleSince:null,restart:!1}:e.busy?{idleSince:null,restart:!1}:e.idleSince==null?{idleSince:e.now,restart:!1}:e.now<e.idleSince?{idleSince:e.now,restart:!1}:{idleSince:e.idleSince,restart:e.now-e.idleSince>=n}}function Di(e){return e<1e3?`${e}`:e<1e6?`${(e/1e3).toFixed(1)}k`:e<1e9?`${(e/1e6).toFixed(2)}M`:`${(e/1e9).toFixed(2)}B`}function rx(e){return e.replace(/^anthropic\./,"").replace(/^claude-/,"").replace(/-\d{8}$/,"")}function wl(e){const n=e.toLowerCase();return n.includes("opus")?"#c4b5fd":n.includes("sonnet")?"#7dd3fc":n.includes("haiku")?"#86efac":n.includes("gpt-5")||n.includes("gpt5")?"#fcd34d":n.includes("gpt")?"#fca5a5":n.includes("gemini")?"#a5b4fc":n.includes("codex")?"#fdba74":"#94a3b8"}function M3(e){return new Date(Date.now()-(e-1)*864e5).toISOString().slice(0,10).replace(/-/g,"")}const P3=[7,14,30,90];function O3(e){const[n,i]=M.useState(null),[s,o]=M.useState(!1),l=(u=!1)=>{o(!0);const d=`/api/ccusage?since=${M3(e)}${u?"&refresh=1":""}`;fetch(d).then(h=>h.json()).then(i).catch(()=>i({ok:!1,error:"request failed"})).finally(()=>o(!1))};return M.useEffect(()=>{l(!1)},[e]),{data:n,loading:s,reload:()=>l(!0)}}function q3({onClose:e}){var b,k;const[n,i]=M.useState(30),[s,o]=M.useState(null),{data:l,loading:u,reload:c}=O3(n);M.useEffect(()=>{const E=C=>{C.key==="Escape"&&e()};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[e]);const d=l!=null&&l.ok?l.days??[]:[],h=M.useMemo(()=>d.reduce((E,C)=>Math.max(E,C.totalCost),0),[d]),{totalCost:p,totalTok:m,inOut:y,cacheRead:x,modelCosts:N}=M.useMemo(()=>{let E=0,C=0,I=0,P=0;const L=new Map;for(const O of d){E+=O.totalCost,C+=O.totalTokens,I+=O.inputTokens+O.outputTokens,P+=O.cacheReadTokens;for(const R of O.modelBreakdowns)L.set(R.modelName,(L.get(R.modelName)??0)+R.cost)}return{totalCost:E,totalTok:C,inOut:I,cacheRead:P,modelCosts:L}},[d]),_=M.useMemo(()=>Array.from(N.entries()).sort((E,C)=>C[1]-E[1]),[N]),S=s?d.find(E=>E.period===s)??null:null;return v.jsx("div",{className:"uh-backdrop",onClick:e,role:"presentation",children:v.jsxs("div",{className:"uh-modal",onClick:E=>E.stopPropagation(),role:"dialog","aria-label":"Usage history",children:[v.jsxs("header",{className:"uh-head",children:[v.jsxs("div",{className:"uh-titlewrap",children:[v.jsx("div",{className:"uh-title",children:"Usage history"}),v.jsx("div",{className:"uh-sub",children:"via ccusage · local Claude / Codex logs"})]}),v.jsx("div",{className:"uh-range",role:"tablist","aria-label":"Range",children:P3.map(E=>v.jsxs("button",{role:"tab","aria-selected":n===E,className:`uh-range-btn${n===E?" on":""}`,onClick:()=>{i(E),o(null)},children:[E,"d"]},E))}),v.jsx("button",{className:"btn icon-btn uh-reload",onClick:c,title:"Re-run ccusage","aria-label":"Reload",children:"↻"}),v.jsx("button",{className:"uh-close",onClick:e,"aria-label":"Close",children:"×"})]}),u&&d.length===0?v.jsx("div",{className:"uh-status",children:"running ccusage… (first run downloads the package)"}):l&&!l.ok?v.jsxs("div",{className:"uh-status uh-err",children:["ccusage failed: ",l.error]}):d.length===0?v.jsx("div",{className:"uh-status",children:"no usage in this range"}):v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"uh-totals",children:[v.jsx(xl,{label:"total cost",val:Fe(p),accent:!0}),v.jsx(xl,{label:"tokens",val:Di(m)}),v.jsx(xl,{label:"input+output",val:Di(y)}),v.jsx(xl,{label:"cache reads",val:Di(x)})]}),v.jsx("div",{className:"uh-chart",role:"img","aria-label":"Daily cost by model",children:d.map(E=>{const C=h>0?E.totalCost/h*100:0,I=E.period===s;return v.jsxs("button",{className:`uh-bar-col${I?" sel":""}`,onClick:()=>o(I?null:E.period),title:`${E.period} · ${Fe(E.totalCost)}`,style:{flexBasis:`${100/d.length}%`},children:[v.jsx("div",{className:"uh-bar",style:{height:`${Math.max(C,E.totalCost>0?2:0)}%`},children:E.modelBreakdowns.slice().sort((P,L)=>L.cost-P.cost).map(P=>{const L=E.totalCost>0?P.cost/E.totalCost*100:0;return v.jsx("div",{className:"uh-bar-seg",style:{height:`${L}%`,background:wl(P.modelName)}},P.modelName)})}),v.jsx("span",{className:"uh-bar-label",children:E.period.slice(5)})]},E.period)})}),v.jsx("div",{className:"uh-legend",children:_.map(([E,C])=>v.jsxs("span",{className:"uh-legend-item",children:[v.jsx("span",{className:"uh-legend-dot",style:{background:wl(E)}}),rx(E)," ",v.jsx("span",{className:"uh-legend-cost",children:Fe(C)})]},E))}),S&&v.jsxs("div",{className:"uh-detail",children:[v.jsxs("div",{className:"uh-detail-head",children:[v.jsx("span",{className:"uh-detail-date",children:S.period}),v.jsx("span",{className:"uh-detail-cost",children:Fe(S.totalCost)}),(k=(b=S.metadata)==null?void 0:b.agents)!=null&&k.length?v.jsx("span",{className:"uh-detail-agents",children:S.metadata.agents.join(" · ")}):null]}),v.jsxs("div",{className:"uh-detail-mini",children:[v.jsx(_l,{label:"input",val:Di(S.inputTokens)}),v.jsx(_l,{label:"output",val:Di(S.outputTokens)}),v.jsx(_l,{label:"cache write",val:Di(S.cacheCreationTokens)}),v.jsx(_l,{label:"cache read",val:Di(S.cacheReadTokens)})]}),v.jsx("div",{className:"uh-detail-models",children:S.modelBreakdowns.slice().sort((E,C)=>C.cost-E.cost).map(E=>{const C=S.totalCost>0?E.cost/S.totalCost*100:0;return v.jsxs("div",{className:"uh-model-row",children:[v.jsxs("span",{className:"uh-model-name",children:[v.jsx("span",{className:"uh-legend-dot",style:{background:wl(E.modelName)}}),rx(E.modelName)]}),v.jsx("span",{className:"uh-model-bar",children:v.jsx("span",{className:"uh-model-bar-fill",style:{width:`${C}%`,background:wl(E.modelName)}})}),v.jsx("span",{className:"uh-model-cost",children:Fe(E.cost)})]},E.modelName)})})]})]})]})})}function xl({label:e,val:n,accent:i}){return v.jsxs("div",{className:"uh-stat",children:[v.jsx("span",{className:`uh-stat-val${i?" accent":""}`,children:n}),v.jsx("span",{className:"uh-stat-label",children:e})]})}function _l({label:e,val:n}){return v.jsxs("div",{className:"uh-ministat",children:[v.jsx("span",{className:"uh-ministat-val",children:n}),v.jsx("span",{className:"uh-ministat-label",children:e})]})}function fv(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var rf,ix;function L3(){if(ix)return rf;ix=1;function e(){this.__data__=[],this.size=0}return rf=e,rf}var sf,sx;function Hs(){if(sx)return sf;sx=1;function e(n,i){return n===i||n!==n&&i!==i}return sf=e,sf}var of,ox;function Wl(){if(ox)return of;ox=1;var e=Hs();function n(i,s){for(var o=i.length;o--;)if(e(i[o][0],s))return o;return-1}return of=n,of}var af,ax;function $3(){if(ax)return af;ax=1;var e=Wl(),n=Array.prototype,i=n.splice;function s(o){var l=this.__data__,u=e(l,o);if(u<0)return!1;var c=l.length-1;return u==c?l.pop():i.call(l,u,1),--this.size,!0}return af=s,af}var lf,lx;function D3(){if(lx)return lf;lx=1;var e=Wl();function n(i){var s=this.__data__,o=e(s,i);return o<0?void 0:s[o][1]}return lf=n,lf}var uf,ux;function F3(){if(ux)return uf;ux=1;var e=Wl();function n(i){return e(this.__data__,i)>-1}return uf=n,uf}var cf,cx;function z3(){if(cx)return cf;cx=1;var e=Wl();function n(i,s){var o=this.__data__,l=e(o,i);return l<0?(++this.size,o.push([i,s])):o[l][1]=s,this}return cf=n,cf}var ff,fx;function Gl(){if(fx)return ff;fx=1;var e=L3(),n=$3(),i=D3(),s=F3(),o=z3();function l(u){var c=-1,d=u==null?0:u.length;for(this.clear();++c<d;){var h=u[c];this.set(h[0],h[1])}}return l.prototype.clear=e,l.prototype.delete=n,l.prototype.get=i,l.prototype.has=s,l.prototype.set=o,ff=l,ff}var df,dx;function B3(){if(dx)return df;dx=1;var e=Gl();function n(){this.__data__=new e,this.size=0}return df=n,df}var hf,hx;function U3(){if(hx)return hf;hx=1;function e(n){var i=this.__data__,s=i.delete(n);return this.size=i.size,s}return hf=e,hf}var pf,px;function H3(){if(px)return pf;px=1;function e(n){return this.__data__.get(n)}return pf=e,pf}var mf,mx;function V3(){if(mx)return mf;mx=1;function e(n){return this.__data__.has(n)}return mf=e,mf}var gf,gx;function dN(){if(gx)return gf;gx=1;var e=typeof al=="object"&&al&&al.Object===Object&&al;return gf=e,gf}var vf,vx;function er(){if(vx)return vf;vx=1;var e=dN(),n=typeof self=="object"&&self&&self.Object===Object&&self,i=e||n||Function("return this")();return vf=i,vf}var yf,yx;function Vs(){if(yx)return yf;yx=1;var e=er(),n=e.Symbol;return yf=n,yf}var wf,wx;function W3(){if(wx)return wf;wx=1;var e=Vs(),n=Object.prototype,i=n.hasOwnProperty,s=n.toString,o=e?e.toStringTag:void 0;function l(u){var c=i.call(u,o),d=u[o];try{u[o]=void 0;var h=!0}catch{}var p=s.call(u);return h&&(c?u[o]=d:delete u[o]),p}return wf=l,wf}var xf,xx;function G3(){if(xx)return xf;xx=1;var e=Object.prototype,n=e.toString;function i(s){return n.call(s)}return xf=i,xf}var _f,_x;function Ki(){if(_x)return _f;_x=1;var e=Vs(),n=W3(),i=G3(),s="[object Null]",o="[object Undefined]",l=e?e.toStringTag:void 0;function u(c){return c==null?c===void 0?o:s:l&&l in Object(c)?n(c):i(c)}return _f=u,_f}var Sf,Sx;function On(){if(Sx)return Sf;Sx=1;function e(n){var i=typeof n;return n!=null&&(i=="object"||i=="function")}return Sf=e,Sf}var bf,bx;function ra(){if(bx)return bf;bx=1;var e=Ki(),n=On(),i="[object AsyncFunction]",s="[object Function]",o="[object GeneratorFunction]",l="[object Proxy]";function u(c){if(!n(c))return!1;var d=e(c);return d==s||d==o||d==i||d==l}return bf=u,bf}var kf,kx;function Y3(){if(kx)return kf;kx=1;var e=er(),n=e["__core-js_shared__"];return kf=n,kf}var Ef,Ex;function K3(){if(Ex)return Ef;Ex=1;var e=Y3(),n=(function(){var s=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""})();function i(s){return!!n&&n in s}return Ef=i,Ef}var Nf,Nx;function hN(){if(Nx)return Nf;Nx=1;var e=Function.prototype,n=e.toString;function i(s){if(s!=null){try{return n.call(s)}catch{}try{return s+""}catch{}}return""}return Nf=i,Nf}var Cf,Cx;function X3(){if(Cx)return Cf;Cx=1;var e=ra(),n=K3(),i=On(),s=hN(),o=/[\\^$.*+?()[\]{}|]/g,l=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,d=u.toString,h=c.hasOwnProperty,p=RegExp("^"+d.call(h).replace(o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function m(y){if(!i(y)||n(y))return!1;var x=e(y)?p:l;return x.test(s(y))}return Cf=m,Cf}var Rf,Rx;function Q3(){if(Rx)return Rf;Rx=1;function e(n,i){return n==null?void 0:n[i]}return Rf=e,Rf}var Tf,Tx;function Xi(){if(Tx)return Tf;Tx=1;var e=X3(),n=Q3();function i(s,o){var l=n(s,o);return e(l)?l:void 0}return Tf=i,Tf}var jf,jx;function dv(){if(jx)return jf;jx=1;var e=Xi(),n=er(),i=e(n,"Map");return jf=i,jf}var Af,Ax;function Yl(){if(Ax)return Af;Ax=1;var e=Xi(),n=e(Object,"create");return Af=n,Af}var If,Ix;function Z3(){if(Ix)return If;Ix=1;var e=Yl();function n(){this.__data__=e?e(null):{},this.size=0}return If=n,If}var Mf,Mx;function J3(){if(Mx)return Mf;Mx=1;function e(n){var i=this.has(n)&&delete this.__data__[n];return this.size-=i?1:0,i}return Mf=e,Mf}var Pf,Px;function eO(){if(Px)return Pf;Px=1;var e=Yl(),n="__lodash_hash_undefined__",i=Object.prototype,s=i.hasOwnProperty;function o(l){var u=this.__data__;if(e){var c=u[l];return c===n?void 0:c}return s.call(u,l)?u[l]:void 0}return Pf=o,Pf}var Of,Ox;function tO(){if(Ox)return Of;Ox=1;var e=Yl(),n=Object.prototype,i=n.hasOwnProperty;function s(o){var l=this.__data__;return e?l[o]!==void 0:i.call(l,o)}return Of=s,Of}var qf,qx;function nO(){if(qx)return qf;qx=1;var e=Yl(),n="__lodash_hash_undefined__";function i(s,o){var l=this.__data__;return this.size+=this.has(s)?0:1,l[s]=e&&o===void 0?n:o,this}return qf=i,qf}var Lf,Lx;function rO(){if(Lx)return Lf;Lx=1;var e=Z3(),n=J3(),i=eO(),s=tO(),o=nO();function l(u){var c=-1,d=u==null?0:u.length;for(this.clear();++c<d;){var h=u[c];this.set(h[0],h[1])}}return l.prototype.clear=e,l.prototype.delete=n,l.prototype.get=i,l.prototype.has=s,l.prototype.set=o,Lf=l,Lf}var $f,$x;function iO(){if($x)return $f;$x=1;var e=rO(),n=Gl(),i=dv();function s(){this.size=0,this.__data__={hash:new e,map:new(i||n),string:new e}}return $f=s,$f}var Df,Dx;function sO(){if(Dx)return Df;Dx=1;function e(n){var i=typeof n;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?n!=="__proto__":n===null}return Df=e,Df}var Ff,Fx;function Kl(){if(Fx)return Ff;Fx=1;var e=sO();function n(i,s){var o=i.__data__;return e(s)?o[typeof s=="string"?"string":"hash"]:o.map}return Ff=n,Ff}var zf,zx;function oO(){if(zx)return zf;zx=1;var e=Kl();function n(i){var s=e(this,i).delete(i);return this.size-=s?1:0,s}return zf=n,zf}var Bf,Bx;function aO(){if(Bx)return Bf;Bx=1;var e=Kl();function n(i){return e(this,i).get(i)}return Bf=n,Bf}var Uf,Ux;function lO(){if(Ux)return Uf;Ux=1;var e=Kl();function n(i){return e(this,i).has(i)}return Uf=n,Uf}var Hf,Hx;function uO(){if(Hx)return Hf;Hx=1;var e=Kl();function n(i,s){var o=e(this,i),l=o.size;return o.set(i,s),this.size+=o.size==l?0:1,this}return Hf=n,Hf}var Vf,Vx;function hv(){if(Vx)return Vf;Vx=1;var e=iO(),n=oO(),i=aO(),s=lO(),o=uO();function l(u){var c=-1,d=u==null?0:u.length;for(this.clear();++c<d;){var h=u[c];this.set(h[0],h[1])}}return l.prototype.clear=e,l.prototype.delete=n,l.prototype.get=i,l.prototype.has=s,l.prototype.set=o,Vf=l,Vf}var Wf,Wx;function cO(){if(Wx)return Wf;Wx=1;var e=Gl(),n=dv(),i=hv(),s=200;function o(l,u){var c=this.__data__;if(c instanceof e){var d=c.__data__;if(!n||d.length<s-1)return d.push([l,u]),this.size=++c.size,this;c=this.__data__=new i(d)}return c.set(l,u),this.size=c.size,this}return Wf=o,Wf}var Gf,Gx;function Xl(){if(Gx)return Gf;Gx=1;var e=Gl(),n=B3(),i=U3(),s=H3(),o=V3(),l=cO();function u(c){var d=this.__data__=new e(c);this.size=d.size}return u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=s,u.prototype.has=o,u.prototype.set=l,Gf=u,Gf}var Yf,Yx;function pv(){if(Yx)return Yf;Yx=1;function e(n,i){for(var s=-1,o=n==null?0:n.length;++s<o&&i(n[s],s,n)!==!1;);return n}return Yf=e,Yf}var Kf,Kx;function pN(){if(Kx)return Kf;Kx=1;var e=Xi(),n=(function(){try{var i=e(Object,"defineProperty");return i({},"",{}),i}catch{}})();return Kf=n,Kf}var Xf,Xx;function Ql(){if(Xx)return Xf;Xx=1;var e=pN();function n(i,s,o){s=="__proto__"&&e?e(i,s,{configurable:!0,enumerable:!0,value:o,writable:!0}):i[s]=o}return Xf=n,Xf}var Qf,Qx;function Zl(){if(Qx)return Qf;Qx=1;var e=Ql(),n=Hs(),i=Object.prototype,s=i.hasOwnProperty;function o(l,u,c){var d=l[u];(!(s.call(l,u)&&n(d,c))||c===void 0&&!(u in l))&&e(l,u,c)}return Qf=o,Qf}var Zf,Zx;function ia(){if(Zx)return Zf;Zx=1;var e=Zl(),n=Ql();function i(s,o,l,u){var c=!l;l||(l={});for(var d=-1,h=o.length;++d<h;){var p=o[d],m=u?u(l[p],s[p],p,l,s):void 0;m===void 0&&(m=s[p]),c?n(l,p,m):e(l,p,m)}return l}return Zf=i,Zf}var Jf,Jx;function fO(){if(Jx)return Jf;Jx=1;function e(n,i){for(var s=-1,o=Array(n);++s<n;)o[s]=i(s);return o}return Jf=e,Jf}var ed,e1;function fr(){if(e1)return ed;e1=1;function e(n){return n!=null&&typeof n=="object"}return ed=e,ed}var td,t1;function dO(){if(t1)return td;t1=1;var e=Ki(),n=fr(),i="[object Arguments]";function s(o){return n(o)&&e(o)==i}return td=s,td}var nd,n1;function sa(){if(n1)return nd;n1=1;var e=dO(),n=fr(),i=Object.prototype,s=i.hasOwnProperty,o=i.propertyIsEnumerable,l=e((function(){return arguments})())?e:function(u){return n(u)&&s.call(u,"callee")&&!o.call(u,"callee")};return nd=l,nd}var rd,r1;function St(){if(r1)return rd;r1=1;var e=Array.isArray;return rd=e,rd}var Do={exports:{}},id,i1;function hO(){if(i1)return id;i1=1;function e(){return!1}return id=e,id}Do.exports;var s1;function Ws(){return s1||(s1=1,(function(e,n){var i=er(),s=hO(),o=n&&!n.nodeType&&n,l=o&&!0&&e&&!e.nodeType&&e,u=l&&l.exports===o,c=u?i.Buffer:void 0,d=c?c.isBuffer:void 0,h=d||s;e.exports=h})(Do,Do.exports)),Do.exports}var sd,o1;function Jl(){if(o1)return sd;o1=1;var e=9007199254740991,n=/^(?:0|[1-9]\d*)$/;function i(s,o){var l=typeof s;return o=o??e,!!o&&(l=="number"||l!="symbol"&&n.test(s))&&s>-1&&s%1==0&&s<o}return sd=i,sd}var od,a1;function mv(){if(a1)return od;a1=1;var e=9007199254740991;function n(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=e}return od=n,od}var ad,l1;function pO(){if(l1)return ad;l1=1;var e=Ki(),n=mv(),i=fr(),s="[object Arguments]",o="[object Array]",l="[object Boolean]",u="[object Date]",c="[object Error]",d="[object Function]",h="[object Map]",p="[object Number]",m="[object Object]",y="[object RegExp]",x="[object Set]",N="[object String]",_="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",k="[object Float32Array]",E="[object Float64Array]",C="[object Int8Array]",I="[object Int16Array]",P="[object Int32Array]",L="[object Uint8Array]",O="[object Uint8ClampedArray]",R="[object Uint16Array]",q="[object Uint32Array]",F={};F[k]=F[E]=F[C]=F[I]=F[P]=F[L]=F[O]=F[R]=F[q]=!0,F[s]=F[o]=F[S]=F[l]=F[b]=F[u]=F[c]=F[d]=F[h]=F[p]=F[m]=F[y]=F[x]=F[N]=F[_]=!1;function J(Q){return i(Q)&&n(Q.length)&&!!F[e(Q)]}return ad=J,ad}var ld,u1;function eu(){if(u1)return ld;u1=1;function e(n){return function(i){return n(i)}}return ld=e,ld}var Fo={exports:{}};Fo.exports;var c1;function gv(){return c1||(c1=1,(function(e,n){var i=dN(),s=n&&!n.nodeType&&n,o=s&&!0&&e&&!e.nodeType&&e,l=o&&o.exports===s,u=l&&i.process,c=(function(){try{var d=o&&o.require&&o.require("util").types;return d||u&&u.binding&&u.binding("util")}catch{}})();e.exports=c})(Fo,Fo.exports)),Fo.exports}var ud,f1;function oa(){if(f1)return ud;f1=1;var e=pO(),n=eu(),i=gv(),s=i&&i.isTypedArray,o=s?n(s):e;return ud=o,ud}var cd,d1;function mN(){if(d1)return cd;d1=1;var e=fO(),n=sa(),i=St(),s=Ws(),o=Jl(),l=oa(),u=Object.prototype,c=u.hasOwnProperty;function d(h,p){var m=i(h),y=!m&&n(h),x=!m&&!y&&s(h),N=!m&&!y&&!x&&l(h),_=m||y||x||N,S=_?e(h.length,String):[],b=S.length;for(var k in h)(p||c.call(h,k))&&!(_&&(k=="length"||x&&(k=="offset"||k=="parent")||N&&(k=="buffer"||k=="byteLength"||k=="byteOffset")||o(k,b)))&&S.push(k);return S}return cd=d,cd}var fd,h1;function tu(){if(h1)return fd;h1=1;var e=Object.prototype;function n(i){var s=i&&i.constructor,o=typeof s=="function"&&s.prototype||e;return i===o}return fd=n,fd}var dd,p1;function gN(){if(p1)return dd;p1=1;function e(n,i){return function(s){return n(i(s))}}return dd=e,dd}var hd,m1;function mO(){if(m1)return hd;m1=1;var e=gN(),n=e(Object.keys,Object);return hd=n,hd}var pd,g1;function vv(){if(g1)return pd;g1=1;var e=tu(),n=mO(),i=Object.prototype,s=i.hasOwnProperty;function o(l){if(!e(l))return n(l);var u=[];for(var c in Object(l))s.call(l,c)&&c!="constructor"&&u.push(c);return u}return pd=o,pd}var md,v1;function Ir(){if(v1)return md;v1=1;var e=ra(),n=mv();function i(s){return s!=null&&n(s.length)&&!e(s)}return md=i,md}var gd,y1;function pi(){if(y1)return gd;y1=1;var e=mN(),n=vv(),i=Ir();function s(o){return i(o)?e(o):n(o)}return gd=s,gd}var vd,w1;function gO(){if(w1)return vd;w1=1;var e=ia(),n=pi();function i(s,o){return s&&e(o,n(o),s)}return vd=i,vd}var yd,x1;function vO(){if(x1)return yd;x1=1;function e(n){var i=[];if(n!=null)for(var s in Object(n))i.push(s);return i}return yd=e,yd}var wd,_1;function yO(){if(_1)return wd;_1=1;var e=On(),n=tu(),i=vO(),s=Object.prototype,o=s.hasOwnProperty;function l(u){if(!e(u))return i(u);var c=n(u),d=[];for(var h in u)h=="constructor"&&(c||!o.call(u,h))||d.push(h);return d}return wd=l,wd}var xd,S1;function Qi(){if(S1)return xd;S1=1;var e=mN(),n=yO(),i=Ir();function s(o){return i(o)?e(o,!0):n(o)}return xd=s,xd}var _d,b1;function wO(){if(b1)return _d;b1=1;var e=ia(),n=Qi();function i(s,o){return s&&e(o,n(o),s)}return _d=i,_d}var zo={exports:{}};zo.exports;var k1;function vN(){return k1||(k1=1,(function(e,n){var i=er(),s=n&&!n.nodeType&&n,o=s&&!0&&e&&!e.nodeType&&e,l=o&&o.exports===s,u=l?i.Buffer:void 0,c=u?u.allocUnsafe:void 0;function d(h,p){if(p)return h.slice();var m=h.length,y=c?c(m):new h.constructor(m);return h.copy(y),y}e.exports=d})(zo,zo.exports)),zo.exports}var Sd,E1;function yN(){if(E1)return Sd;E1=1;function e(n,i){var s=-1,o=n.length;for(i||(i=Array(o));++s<o;)i[s]=n[s];return i}return Sd=e,Sd}var bd,N1;function wN(){if(N1)return bd;N1=1;function e(n,i){for(var s=-1,o=n==null?0:n.length,l=0,u=[];++s<o;){var c=n[s];i(c,s,n)&&(u[l++]=c)}return u}return bd=e,bd}var kd,C1;function xN(){if(C1)return kd;C1=1;function e(){return[]}return kd=e,kd}var Ed,R1;function yv(){if(R1)return Ed;R1=1;var e=wN(),n=xN(),i=Object.prototype,s=i.propertyIsEnumerable,o=Object.getOwnPropertySymbols,l=o?function(u){return u==null?[]:(u=Object(u),e(o(u),function(c){return s.call(u,c)}))}:n;return Ed=l,Ed}var Nd,T1;function xO(){if(T1)return Nd;T1=1;var e=ia(),n=yv();function i(s,o){return e(s,n(s),o)}return Nd=i,Nd}var Cd,j1;function wv(){if(j1)return Cd;j1=1;function e(n,i){for(var s=-1,o=i.length,l=n.length;++s<o;)n[l+s]=i[s];return n}return Cd=e,Cd}var Rd,A1;function nu(){if(A1)return Rd;A1=1;var e=gN(),n=e(Object.getPrototypeOf,Object);return Rd=n,Rd}var Td,I1;function _N(){if(I1)return Td;I1=1;var e=wv(),n=nu(),i=yv(),s=xN(),o=Object.getOwnPropertySymbols,l=o?function(u){for(var c=[];u;)e(c,i(u)),u=n(u);return c}:s;return Td=l,Td}var jd,M1;function _O(){if(M1)return jd;M1=1;var e=ia(),n=_N();function i(s,o){return e(s,n(s),o)}return jd=i,jd}var Ad,P1;function SN(){if(P1)return Ad;P1=1;var e=wv(),n=St();function i(s,o,l){var u=o(s);return n(s)?u:e(u,l(s))}return Ad=i,Ad}var Id,O1;function bN(){if(O1)return Id;O1=1;var e=SN(),n=yv(),i=pi();function s(o){return e(o,i,n)}return Id=s,Id}var Md,q1;function SO(){if(q1)return Md;q1=1;var e=SN(),n=_N(),i=Qi();function s(o){return e(o,i,n)}return Md=s,Md}var Pd,L1;function bO(){if(L1)return Pd;L1=1;var e=Xi(),n=er(),i=e(n,"DataView");return Pd=i,Pd}var Od,$1;function kO(){if($1)return Od;$1=1;var e=Xi(),n=er(),i=e(n,"Promise");return Od=i,Od}var qd,D1;function kN(){if(D1)return qd;D1=1;var e=Xi(),n=er(),i=e(n,"Set");return qd=i,qd}var Ld,F1;function EO(){if(F1)return Ld;F1=1;var e=Xi(),n=er(),i=e(n,"WeakMap");return Ld=i,Ld}var $d,z1;function Gs(){if(z1)return $d;z1=1;var e=bO(),n=dv(),i=kO(),s=kN(),o=EO(),l=Ki(),u=hN(),c="[object Map]",d="[object Object]",h="[object Promise]",p="[object Set]",m="[object WeakMap]",y="[object DataView]",x=u(e),N=u(n),_=u(i),S=u(s),b=u(o),k=l;return(e&&k(new e(new ArrayBuffer(1)))!=y||n&&k(new n)!=c||i&&k(i.resolve())!=h||s&&k(new s)!=p||o&&k(new o)!=m)&&(k=function(E){var C=l(E),I=C==d?E.constructor:void 0,P=I?u(I):"";if(P)switch(P){case x:return y;case N:return c;case _:return h;case S:return p;case b:return m}return C}),$d=k,$d}var Dd,B1;function NO(){if(B1)return Dd;B1=1;var e=Object.prototype,n=e.hasOwnProperty;function i(s){var o=s.length,l=new s.constructor(o);return o&&typeof s[0]=="string"&&n.call(s,"index")&&(l.index=s.index,l.input=s.input),l}return Dd=i,Dd}var Fd,U1;function EN(){if(U1)return Fd;U1=1;var e=er(),n=e.Uint8Array;return Fd=n,Fd}var zd,H1;function xv(){if(H1)return zd;H1=1;var e=EN();function n(i){var s=new i.constructor(i.byteLength);return new e(s).set(new e(i)),s}return zd=n,zd}var Bd,V1;function CO(){if(V1)return Bd;V1=1;var e=xv();function n(i,s){var o=s?e(i.buffer):i.buffer;return new i.constructor(o,i.byteOffset,i.byteLength)}return Bd=n,Bd}var Ud,W1;function RO(){if(W1)return Ud;W1=1;var e=/\w*$/;function n(i){var s=new i.constructor(i.source,e.exec(i));return s.lastIndex=i.lastIndex,s}return Ud=n,Ud}var Hd,G1;function TO(){if(G1)return Hd;G1=1;var e=Vs(),n=e?e.prototype:void 0,i=n?n.valueOf:void 0;function s(o){return i?Object(i.call(o)):{}}return Hd=s,Hd}var Vd,Y1;function NN(){if(Y1)return Vd;Y1=1;var e=xv();function n(i,s){var o=s?e(i.buffer):i.buffer;return new i.constructor(o,i.byteOffset,i.length)}return Vd=n,Vd}var Wd,K1;function jO(){if(K1)return Wd;K1=1;var e=xv(),n=CO(),i=RO(),s=TO(),o=NN(),l="[object Boolean]",u="[object Date]",c="[object Map]",d="[object Number]",h="[object RegExp]",p="[object Set]",m="[object String]",y="[object Symbol]",x="[object ArrayBuffer]",N="[object DataView]",_="[object Float32Array]",S="[object Float64Array]",b="[object Int8Array]",k="[object Int16Array]",E="[object Int32Array]",C="[object Uint8Array]",I="[object Uint8ClampedArray]",P="[object Uint16Array]",L="[object Uint32Array]";function O(R,q,F){var J=R.constructor;switch(q){case x:return e(R);case l:case u:return new J(+R);case N:return n(R,F);case _:case S:case b:case k:case E:case C:case I:case P:case L:return o(R,F);case c:return new J;case d:case m:return new J(R);case h:return i(R);case p:return new J;case y:return s(R)}}return Wd=O,Wd}var Gd,X1;function CN(){if(X1)return Gd;X1=1;var e=On(),n=Object.create,i=(function(){function s(){}return function(o){if(!e(o))return{};if(n)return n(o);s.prototype=o;var l=new s;return s.prototype=void 0,l}})();return Gd=i,Gd}var Yd,Q1;function RN(){if(Q1)return Yd;Q1=1;var e=CN(),n=nu(),i=tu();function s(o){return typeof o.constructor=="function"&&!i(o)?e(n(o)):{}}return Yd=s,Yd}var Kd,Z1;function AO(){if(Z1)return Kd;Z1=1;var e=Gs(),n=fr(),i="[object Map]";function s(o){return n(o)&&e(o)==i}return Kd=s,Kd}var Xd,J1;function IO(){if(J1)return Xd;J1=1;var e=AO(),n=eu(),i=gv(),s=i&&i.isMap,o=s?n(s):e;return Xd=o,Xd}var Qd,e_;function MO(){if(e_)return Qd;e_=1;var e=Gs(),n=fr(),i="[object Set]";function s(o){return n(o)&&e(o)==i}return Qd=s,Qd}var Zd,t_;function PO(){if(t_)return Zd;t_=1;var e=MO(),n=eu(),i=gv(),s=i&&i.isSet,o=s?n(s):e;return Zd=o,Zd}var Jd,n_;function TN(){if(n_)return Jd;n_=1;var e=Xl(),n=pv(),i=Zl(),s=gO(),o=wO(),l=vN(),u=yN(),c=xO(),d=_O(),h=bN(),p=SO(),m=Gs(),y=NO(),x=jO(),N=RN(),_=St(),S=Ws(),b=IO(),k=On(),E=PO(),C=pi(),I=Qi(),P=1,L=2,O=4,R="[object Arguments]",q="[object Array]",F="[object Boolean]",J="[object Date]",Q="[object Error]",A="[object Function]",V="[object GeneratorFunction]",B="[object Map]",ne="[object Number]",X="[object Object]",$="[object RegExp]",G="[object Set]",j="[object String]",U="[object Symbol]",le="[object WeakMap]",z="[object ArrayBuffer]",K="[object DataView]",ee="[object Float32Array]",se="[object Float64Array]",oe="[object Int8Array]",pe="[object Int16Array]",ge="[object Int32Array]",Ae="[object Uint8Array]",Oe="[object Uint8ClampedArray]",Ie="[object Uint16Array]",Me="[object Uint32Array]",ke={};ke[R]=ke[q]=ke[z]=ke[K]=ke[F]=ke[J]=ke[ee]=ke[se]=ke[oe]=ke[pe]=ke[ge]=ke[B]=ke[ne]=ke[X]=ke[$]=ke[G]=ke[j]=ke[U]=ke[Ae]=ke[Oe]=ke[Ie]=ke[Me]=!0,ke[Q]=ke[A]=ke[le]=!1;function He(ve,ye,Ve,dt,Qe,We){var $e,Ke=ye&P,yt=ye&L,et=ye&O;if(Ve&&($e=Qe?Ve(ve,dt,Qe,We):Ve(ve)),$e!==void 0)return $e;if(!k(ve))return ve;var Ge=_(ve);if(Ge){if($e=y(ve),!Ke)return u(ve,$e)}else{var wt=m(ve),Tt=wt==A||wt==V;if(S(ve))return l(ve,Ke);if(wt==X||wt==R||Tt&&!Qe){if($e=yt||Tt?{}:N(ve),!Ke)return yt?d(ve,o($e,ve)):c(ve,s($e,ve))}else{if(!ke[wt])return Qe?ve:{};$e=x(ve,wt,Ke)}}We||(We=new e);var Ft=We.get(ve);if(Ft)return Ft;We.set(ve,$e),E(ve)?ve.forEach(function(lt){$e.add(He(lt,ye,Ve,lt,ve,We))}):b(ve)&&ve.forEach(function(lt,mt){$e.set(mt,He(lt,ye,Ve,mt,ve,We))});var tt=et?yt?p:h:yt?I:C,xt=Ge?void 0:tt(ve);return n(xt||ve,function(lt,mt){xt&&(mt=lt,lt=ve[mt]),i($e,mt,He(lt,ye,Ve,mt,ve,We))}),$e}return Jd=He,Jd}var eh,r_;function OO(){if(r_)return eh;r_=1;var e=TN(),n=4;function i(s){return e(s,n)}return eh=i,eh}var th,i_;function _v(){if(i_)return th;i_=1;function e(n){return function(){return n}}return th=e,th}var nh,s_;function qO(){if(s_)return nh;s_=1;function e(n){return function(i,s,o){for(var l=-1,u=Object(i),c=o(i),d=c.length;d--;){var h=c[n?d:++l];if(s(u[h],h,u)===!1)break}return i}}return nh=e,nh}var rh,o_;function Sv(){if(o_)return rh;o_=1;var e=qO(),n=e();return rh=n,rh}var ih,a_;function bv(){if(a_)return ih;a_=1;var e=Sv(),n=pi();function i(s,o){return s&&e(s,o,n)}return ih=i,ih}var sh,l_;function LO(){if(l_)return sh;l_=1;var e=Ir();function n(i,s){return function(o,l){if(o==null)return o;if(!e(o))return i(o,l);for(var u=o.length,c=s?u:-1,d=Object(o);(s?c--:++c<u)&&l(d[c],c,d)!==!1;);return o}}return sh=n,sh}var oh,u_;function ru(){if(u_)return oh;u_=1;var e=bv(),n=LO(),i=n(e);return oh=i,oh}var ah,c_;function Zi(){if(c_)return ah;c_=1;function e(n){return n}return ah=e,ah}var lh,f_;function jN(){if(f_)return lh;f_=1;var e=Zi();function n(i){return typeof i=="function"?i:e}return lh=n,lh}var uh,d_;function AN(){if(d_)return uh;d_=1;var e=pv(),n=ru(),i=jN(),s=St();function o(l,u){var c=s(l)?e:n;return c(l,i(u))}return uh=o,uh}var ch,h_;function IN(){return h_||(h_=1,ch=AN()),ch}var fh,p_;function $O(){if(p_)return fh;p_=1;var e=ru();function n(i,s){var o=[];return e(i,function(l,u,c){s(l,u,c)&&o.push(l)}),o}return fh=n,fh}var dh,m_;function DO(){if(m_)return dh;m_=1;var e="__lodash_hash_undefined__";function n(i){return this.__data__.set(i,e),this}return dh=n,dh}var hh,g_;function FO(){if(g_)return hh;g_=1;function e(n){return this.__data__.has(n)}return hh=e,hh}var ph,v_;function MN(){if(v_)return ph;v_=1;var e=hv(),n=DO(),i=FO();function s(o){var l=-1,u=o==null?0:o.length;for(this.__data__=new e;++l<u;)this.add(o[l])}return s.prototype.add=s.prototype.push=n,s.prototype.has=i,ph=s,ph}var mh,y_;function zO(){if(y_)return mh;y_=1;function e(n,i){for(var s=-1,o=n==null?0:n.length;++s<o;)if(i(n[s],s,n))return!0;return!1}return mh=e,mh}var gh,w_;function PN(){if(w_)return gh;w_=1;function e(n,i){return n.has(i)}return gh=e,gh}var vh,x_;function ON(){if(x_)return vh;x_=1;var e=MN(),n=zO(),i=PN(),s=1,o=2;function l(u,c,d,h,p,m){var y=d&s,x=u.length,N=c.length;if(x!=N&&!(y&&N>x))return!1;var _=m.get(u),S=m.get(c);if(_&&S)return _==c&&S==u;var b=-1,k=!0,E=d&o?new e:void 0;for(m.set(u,c),m.set(c,u);++b<x;){var C=u[b],I=c[b];if(h)var P=y?h(I,C,b,c,u,m):h(C,I,b,u,c,m);if(P!==void 0){if(P)continue;k=!1;break}if(E){if(!n(c,function(L,O){if(!i(E,O)&&(C===L||p(C,L,d,h,m)))return E.push(O)})){k=!1;break}}else if(!(C===I||p(C,I,d,h,m))){k=!1;break}}return m.delete(u),m.delete(c),k}return vh=l,vh}var yh,__;function BO(){if(__)return yh;__=1;function e(n){var i=-1,s=Array(n.size);return n.forEach(function(o,l){s[++i]=[l,o]}),s}return yh=e,yh}var wh,S_;function kv(){if(S_)return wh;S_=1;function e(n){var i=-1,s=Array(n.size);return n.forEach(function(o){s[++i]=o}),s}return wh=e,wh}var xh,b_;function UO(){if(b_)return xh;b_=1;var e=Vs(),n=EN(),i=Hs(),s=ON(),o=BO(),l=kv(),u=1,c=2,d="[object Boolean]",h="[object Date]",p="[object Error]",m="[object Map]",y="[object Number]",x="[object RegExp]",N="[object Set]",_="[object String]",S="[object Symbol]",b="[object ArrayBuffer]",k="[object DataView]",E=e?e.prototype:void 0,C=E?E.valueOf:void 0;function I(P,L,O,R,q,F,J){switch(O){case k:if(P.byteLength!=L.byteLength||P.byteOffset!=L.byteOffset)return!1;P=P.buffer,L=L.buffer;case b:return!(P.byteLength!=L.byteLength||!F(new n(P),new n(L)));case d:case h:case y:return i(+P,+L);case p:return P.name==L.name&&P.message==L.message;case x:case _:return P==L+"";case m:var Q=o;case N:var A=R&u;if(Q||(Q=l),P.size!=L.size&&!A)return!1;var V=J.get(P);if(V)return V==L;R|=c,J.set(P,L);var B=s(Q(P),Q(L),R,q,F,J);return J.delete(P),B;case S:if(C)return C.call(P)==C.call(L)}return!1}return xh=I,xh}var _h,k_;function HO(){if(k_)return _h;k_=1;var e=bN(),n=1,i=Object.prototype,s=i.hasOwnProperty;function o(l,u,c,d,h,p){var m=c&n,y=e(l),x=y.length,N=e(u),_=N.length;if(x!=_&&!m)return!1;for(var S=x;S--;){var b=y[S];if(!(m?b in u:s.call(u,b)))return!1}var k=p.get(l),E=p.get(u);if(k&&E)return k==u&&E==l;var C=!0;p.set(l,u),p.set(u,l);for(var I=m;++S<x;){b=y[S];var P=l[b],L=u[b];if(d)var O=m?d(L,P,b,u,l,p):d(P,L,b,l,u,p);if(!(O===void 0?P===L||h(P,L,c,d,p):O)){C=!1;break}I||(I=b=="constructor")}if(C&&!I){var R=l.constructor,q=u.constructor;R!=q&&"constructor"in l&&"constructor"in u&&!(typeof R=="function"&&R instanceof R&&typeof q=="function"&&q instanceof q)&&(C=!1)}return p.delete(l),p.delete(u),C}return _h=o,_h}var Sh,E_;function VO(){if(E_)return Sh;E_=1;var e=Xl(),n=ON(),i=UO(),s=HO(),o=Gs(),l=St(),u=Ws(),c=oa(),d=1,h="[object Arguments]",p="[object Array]",m="[object Object]",y=Object.prototype,x=y.hasOwnProperty;function N(_,S,b,k,E,C){var I=l(_),P=l(S),L=I?p:o(_),O=P?p:o(S);L=L==h?m:L,O=O==h?m:O;var R=L==m,q=O==m,F=L==O;if(F&&u(_)){if(!u(S))return!1;I=!0,R=!1}if(F&&!R)return C||(C=new e),I||c(_)?n(_,S,b,k,E,C):i(_,S,L,b,k,E,C);if(!(b&d)){var J=R&&x.call(_,"__wrapped__"),Q=q&&x.call(S,"__wrapped__");if(J||Q){var A=J?_.value():_,V=Q?S.value():S;return C||(C=new e),E(A,V,b,k,C)}}return F?(C||(C=new e),s(_,S,b,k,E,C)):!1}return Sh=N,Sh}var bh,N_;function qN(){if(N_)return bh;N_=1;var e=VO(),n=fr();function i(s,o,l,u,c){return s===o?!0:s==null||o==null||!n(s)&&!n(o)?s!==s&&o!==o:e(s,o,l,u,i,c)}return bh=i,bh}var kh,C_;function WO(){if(C_)return kh;C_=1;var e=Xl(),n=qN(),i=1,s=2;function o(l,u,c,d){var h=c.length,p=h,m=!d;if(l==null)return!p;for(l=Object(l);h--;){var y=c[h];if(m&&y[2]?y[1]!==l[y[0]]:!(y[0]in l))return!1}for(;++h<p;){y=c[h];var x=y[0],N=l[x],_=y[1];if(m&&y[2]){if(N===void 0&&!(x in l))return!1}else{var S=new e;if(d)var b=d(N,_,x,l,u,S);if(!(b===void 0?n(_,N,i|s,d,S):b))return!1}}return!0}return kh=o,kh}var Eh,R_;function LN(){if(R_)return Eh;R_=1;var e=On();function n(i){return i===i&&!e(i)}return Eh=n,Eh}var Nh,T_;function GO(){if(T_)return Nh;T_=1;var e=LN(),n=pi();function i(s){for(var o=n(s),l=o.length;l--;){var u=o[l],c=s[u];o[l]=[u,c,e(c)]}return o}return Nh=i,Nh}var Ch,j_;function $N(){if(j_)return Ch;j_=1;function e(n,i){return function(s){return s==null?!1:s[n]===i&&(i!==void 0||n in Object(s))}}return Ch=e,Ch}var Rh,A_;function YO(){if(A_)return Rh;A_=1;var e=WO(),n=GO(),i=$N();function s(o){var l=n(o);return l.length==1&&l[0][2]?i(l[0][0],l[0][1]):function(u){return u===o||e(u,o,l)}}return Rh=s,Rh}var Th,I_;function Ys(){if(I_)return Th;I_=1;var e=Ki(),n=fr(),i="[object Symbol]";function s(o){return typeof o=="symbol"||n(o)&&e(o)==i}return Th=s,Th}var jh,M_;function Ev(){if(M_)return jh;M_=1;var e=St(),n=Ys(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;function o(l,u){if(e(l))return!1;var c=typeof l;return c=="number"||c=="symbol"||c=="boolean"||l==null||n(l)?!0:s.test(l)||!i.test(l)||u!=null&&l in Object(u)}return jh=o,jh}var Ah,P_;function KO(){if(P_)return Ah;P_=1;var e=hv(),n="Expected a function";function i(s,o){if(typeof s!="function"||o!=null&&typeof o!="function")throw new TypeError(n);var l=function(){var u=arguments,c=o?o.apply(this,u):u[0],d=l.cache;if(d.has(c))return d.get(c);var h=s.apply(this,u);return l.cache=d.set(c,h)||d,h};return l.cache=new(i.Cache||e),l}return i.Cache=e,Ah=i,Ah}var Ih,O_;function XO(){if(O_)return Ih;O_=1;var e=KO(),n=500;function i(s){var o=e(s,function(u){return l.size===n&&l.clear(),u}),l=o.cache;return o}return Ih=i,Ih}var Mh,q_;function QO(){if(q_)return Mh;q_=1;var e=XO(),n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,s=e(function(o){var l=[];return o.charCodeAt(0)===46&&l.push(""),o.replace(n,function(u,c,d,h){l.push(d?h.replace(i,"$1"):c||u)}),l});return Mh=s,Mh}var Ph,L_;function iu(){if(L_)return Ph;L_=1;function e(n,i){for(var s=-1,o=n==null?0:n.length,l=Array(o);++s<o;)l[s]=i(n[s],s,n);return l}return Ph=e,Ph}var Oh,$_;function ZO(){if($_)return Oh;$_=1;var e=Vs(),n=iu(),i=St(),s=Ys(),o=e?e.prototype:void 0,l=o?o.toString:void 0;function u(c){if(typeof c=="string")return c;if(i(c))return n(c,u)+"";if(s(c))return l?l.call(c):"";var d=c+"";return d=="0"&&1/c==-1/0?"-0":d}return Oh=u,Oh}var qh,D_;function DN(){if(D_)return qh;D_=1;var e=ZO();function n(i){return i==null?"":e(i)}return qh=n,qh}var Lh,F_;function su(){if(F_)return Lh;F_=1;var e=St(),n=Ev(),i=QO(),s=DN();function o(l,u){return e(l)?l:n(l,u)?[l]:i(s(l))}return Lh=o,Lh}var $h,z_;function aa(){if(z_)return $h;z_=1;var e=Ys();function n(i){if(typeof i=="string"||e(i))return i;var s=i+"";return s=="0"&&1/i==-1/0?"-0":s}return $h=n,$h}var Dh,B_;function ou(){if(B_)return Dh;B_=1;var e=su(),n=aa();function i(s,o){o=e(o,s);for(var l=0,u=o.length;s!=null&&l<u;)s=s[n(o[l++])];return l&&l==u?s:void 0}return Dh=i,Dh}var Fh,U_;function JO(){if(U_)return Fh;U_=1;var e=ou();function n(i,s,o){var l=i==null?void 0:e(i,s);return l===void 0?o:l}return Fh=n,Fh}var zh,H_;function eq(){if(H_)return zh;H_=1;function e(n,i){return n!=null&&i in Object(n)}return zh=e,zh}var Bh,V_;function FN(){if(V_)return Bh;V_=1;var e=su(),n=sa(),i=St(),s=Jl(),o=mv(),l=aa();function u(c,d,h){d=e(d,c);for(var p=-1,m=d.length,y=!1;++p<m;){var x=l(d[p]);if(!(y=c!=null&&h(c,x)))break;c=c[x]}return y||++p!=m?y:(m=c==null?0:c.length,!!m&&o(m)&&s(x,m)&&(i(c)||n(c)))}return Bh=u,Bh}var Uh,W_;function zN(){if(W_)return Uh;W_=1;var e=eq(),n=FN();function i(s,o){return s!=null&&n(s,o,e)}return Uh=i,Uh}var Hh,G_;function tq(){if(G_)return Hh;G_=1;var e=qN(),n=JO(),i=zN(),s=Ev(),o=LN(),l=$N(),u=aa(),c=1,d=2;function h(p,m){return s(p)&&o(m)?l(u(p),m):function(y){var x=n(y,p);return x===void 0&&x===m?i(y,p):e(m,x,c|d)}}return Hh=h,Hh}var Vh,Y_;function BN(){if(Y_)return Vh;Y_=1;function e(n){return function(i){return i==null?void 0:i[n]}}return Vh=e,Vh}var Wh,K_;function nq(){if(K_)return Wh;K_=1;var e=ou();function n(i){return function(s){return e(s,i)}}return Wh=n,Wh}var Gh,X_;function rq(){if(X_)return Gh;X_=1;var e=BN(),n=nq(),i=Ev(),s=aa();function o(l){return i(l)?e(s(l)):n(l)}return Gh=o,Gh}var Yh,Q_;function Mr(){if(Q_)return Yh;Q_=1;var e=YO(),n=tq(),i=Zi(),s=St(),o=rq();function l(u){return typeof u=="function"?u:u==null?i:typeof u=="object"?s(u)?n(u[0],u[1]):e(u):o(u)}return Yh=l,Yh}var Kh,Z_;function UN(){if(Z_)return Kh;Z_=1;var e=wN(),n=$O(),i=Mr(),s=St();function o(l,u){var c=s(l)?e:n;return c(l,i(u,3))}return Kh=o,Kh}var Xh,J_;function iq(){if(J_)return Xh;J_=1;var e=Object.prototype,n=e.hasOwnProperty;function i(s,o){return s!=null&&n.call(s,o)}return Xh=i,Xh}var Qh,eS;function HN(){if(eS)return Qh;eS=1;var e=iq(),n=FN();function i(s,o){return s!=null&&n(s,o,e)}return Qh=i,Qh}var Zh,tS;function sq(){if(tS)return Zh;tS=1;var e=vv(),n=Gs(),i=sa(),s=St(),o=Ir(),l=Ws(),u=tu(),c=oa(),d="[object Map]",h="[object Set]",p=Object.prototype,m=p.hasOwnProperty;function y(x){if(x==null)return!0;if(o(x)&&(s(x)||typeof x=="string"||typeof x.splice=="function"||l(x)||c(x)||i(x)))return!x.length;var N=n(x);if(N==d||N==h)return!x.size;if(u(x))return!e(x).length;for(var _ in x)if(m.call(x,_))return!1;return!0}return Zh=y,Zh}var Jh,nS;function VN(){if(nS)return Jh;nS=1;function e(n){return n===void 0}return Jh=e,Jh}var ep,rS;function WN(){if(rS)return ep;rS=1;var e=ru(),n=Ir();function i(s,o){var l=-1,u=n(s)?Array(s.length):[];return e(s,function(c,d,h){u[++l]=o(c,d,h)}),u}return ep=i,ep}var tp,iS;function GN(){if(iS)return tp;iS=1;var e=iu(),n=Mr(),i=WN(),s=St();function o(l,u){var c=s(l)?e:i;return c(l,n(u,3))}return tp=o,tp}var np,sS;function oq(){if(sS)return np;sS=1;function e(n,i,s,o){var l=-1,u=n==null?0:n.length;for(o&&u&&(s=n[++l]);++l<u;)s=i(s,n[l],l,n);return s}return np=e,np}var rp,oS;function aq(){if(oS)return rp;oS=1;function e(n,i,s,o,l){return l(n,function(u,c,d){s=o?(o=!1,u):i(s,u,c,d)}),s}return rp=e,rp}var ip,aS;function YN(){if(aS)return ip;aS=1;var e=oq(),n=ru(),i=Mr(),s=aq(),o=St();function l(u,c,d){var h=o(u)?e:s,p=arguments.length<3;return h(u,i(c,4),d,p,n)}return ip=l,ip}var sp,lS;function lq(){if(lS)return sp;lS=1;var e=Ki(),n=St(),i=fr(),s="[object String]";function o(l){return typeof l=="string"||!n(l)&&i(l)&&e(l)==s}return sp=o,sp}var op,uS;function uq(){if(uS)return op;uS=1;var e=BN(),n=e("length");return op=n,op}var ap,cS;function cq(){if(cS)return ap;cS=1;var e="\\ud800-\\udfff",n="\\u0300-\\u036f",i="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",o=n+i+s,l="\\ufe0e\\ufe0f",u="\\u200d",c=RegExp("["+u+e+o+l+"]");function d(h){return c.test(h)}return ap=d,ap}var lp,fS;function fq(){if(fS)return lp;fS=1;var e="\\ud800-\\udfff",n="\\u0300-\\u036f",i="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",o=n+i+s,l="\\ufe0e\\ufe0f",u="["+e+"]",c="["+o+"]",d="\\ud83c[\\udffb-\\udfff]",h="(?:"+c+"|"+d+")",p="[^"+e+"]",m="(?:\\ud83c[\\udde6-\\uddff]){2}",y="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",N=h+"?",_="["+l+"]?",S="(?:"+x+"(?:"+[p,m,y].join("|")+")"+_+N+")*",b=_+N+S,k="(?:"+[p+c+"?",c,m,y,u].join("|")+")",E=RegExp(d+"(?="+d+")|"+k+b,"g");function C(I){for(var P=E.lastIndex=0;E.test(I);)++P;return P}return lp=C,lp}var up,dS;function dq(){if(dS)return up;dS=1;var e=uq(),n=cq(),i=fq();function s(o){return n(o)?i(o):e(o)}return up=s,up}var cp,hS;function hq(){if(hS)return cp;hS=1;var e=vv(),n=Gs(),i=Ir(),s=lq(),o=dq(),l="[object Map]",u="[object Set]";function c(d){if(d==null)return 0;if(i(d))return s(d)?o(d):d.length;var h=n(d);return h==l||h==u?d.size:e(d).length}return cp=c,cp}var fp,pS;function pq(){if(pS)return fp;pS=1;var e=pv(),n=CN(),i=bv(),s=Mr(),o=nu(),l=St(),u=Ws(),c=ra(),d=On(),h=oa();function p(m,y,x){var N=l(m),_=N||u(m)||h(m);if(y=s(y,4),x==null){var S=m&&m.constructor;_?x=N?new S:[]:d(m)?x=c(S)?n(o(m)):{}:x={}}return(_?e:i)(m,function(b,k,E){return y(x,b,k,E)}),x}return fp=p,fp}var dp,mS;function mq(){if(mS)return dp;mS=1;var e=Vs(),n=sa(),i=St(),s=e?e.isConcatSpreadable:void 0;function o(l){return i(l)||n(l)||!!(s&&l&&l[s])}return dp=o,dp}var hp,gS;function Nv(){if(gS)return hp;gS=1;var e=wv(),n=mq();function i(s,o,l,u,c){var d=-1,h=s.length;for(l||(l=n),c||(c=[]);++d<h;){var p=s[d];o>0&&l(p)?o>1?i(p,o-1,l,u,c):e(c,p):u||(c[c.length]=p)}return c}return hp=i,hp}var pp,vS;function gq(){if(vS)return pp;vS=1;function e(n,i,s){switch(s.length){case 0:return n.call(i);case 1:return n.call(i,s[0]);case 2:return n.call(i,s[0],s[1]);case 3:return n.call(i,s[0],s[1],s[2])}return n.apply(i,s)}return pp=e,pp}var mp,yS;function KN(){if(yS)return mp;yS=1;var e=gq(),n=Math.max;function i(s,o,l){return o=n(o===void 0?s.length-1:o,0),function(){for(var u=arguments,c=-1,d=n(u.length-o,0),h=Array(d);++c<d;)h[c]=u[o+c];c=-1;for(var p=Array(o+1);++c<o;)p[c]=u[c];return p[o]=l(h),e(s,this,p)}}return mp=i,mp}var gp,wS;function vq(){if(wS)return gp;wS=1;var e=_v(),n=pN(),i=Zi(),s=n?function(o,l){return n(o,"toString",{configurable:!0,enumerable:!1,value:e(l),writable:!0})}:i;return gp=s,gp}var vp,xS;function yq(){if(xS)return vp;xS=1;var e=800,n=16,i=Date.now;function s(o){var l=0,u=0;return function(){var c=i(),d=n-(c-u);if(u=c,d>0){if(++l>=e)return arguments[0]}else l=0;return o.apply(void 0,arguments)}}return vp=s,vp}var yp,_S;function XN(){if(_S)return yp;_S=1;var e=vq(),n=yq(),i=n(e);return yp=i,yp}var wp,SS;function au(){if(SS)return wp;SS=1;var e=Zi(),n=KN(),i=XN();function s(o,l){return i(n(o,l,e),o+"")}return wp=s,wp}var xp,bS;function QN(){if(bS)return xp;bS=1;function e(n,i,s,o){for(var l=n.length,u=s+(o?1:-1);o?u--:++u<l;)if(i(n[u],u,n))return u;return-1}return xp=e,xp}var _p,kS;function wq(){if(kS)return _p;kS=1;function e(n){return n!==n}return _p=e,_p}var Sp,ES;function xq(){if(ES)return Sp;ES=1;function e(n,i,s){for(var o=s-1,l=n.length;++o<l;)if(n[o]===i)return o;return-1}return Sp=e,Sp}var bp,NS;function _q(){if(NS)return bp;NS=1;var e=QN(),n=wq(),i=xq();function s(o,l,u){return l===l?i(o,l,u):e(o,n,u)}return bp=s,bp}var kp,CS;function Sq(){if(CS)return kp;CS=1;var e=_q();function n(i,s){var o=i==null?0:i.length;return!!o&&e(i,s,0)>-1}return kp=n,kp}var Ep,RS;function bq(){if(RS)return Ep;RS=1;function e(n,i,s){for(var o=-1,l=n==null?0:n.length;++o<l;)if(s(i,n[o]))return!0;return!1}return Ep=e,Ep}var Np,TS;function kq(){if(TS)return Np;TS=1;function e(){}return Np=e,Np}var Cp,jS;function Eq(){if(jS)return Cp;jS=1;var e=kN(),n=kq(),i=kv(),s=1/0,o=e&&1/i(new e([,-0]))[1]==s?function(l){return new e(l)}:n;return Cp=o,Cp}var Rp,AS;function Nq(){if(AS)return Rp;AS=1;var e=MN(),n=Sq(),i=bq(),s=PN(),o=Eq(),l=kv(),u=200;function c(d,h,p){var m=-1,y=n,x=d.length,N=!0,_=[],S=_;if(p)N=!1,y=i;else if(x>=u){var b=h?null:o(d);if(b)return l(b);N=!1,y=s,S=new e}else S=h?[]:_;e:for(;++m<x;){var k=d[m],E=h?h(k):k;if(k=p||k!==0?k:0,N&&E===E){for(var C=S.length;C--;)if(S[C]===E)continue e;h&&S.push(E),_.push(k)}else y(S,E,p)||(S!==_&&S.push(E),_.push(k))}return _}return Rp=c,Rp}var Tp,IS;function ZN(){if(IS)return Tp;IS=1;var e=Ir(),n=fr();function i(s){return n(s)&&e(s)}return Tp=i,Tp}var jp,MS;function Cq(){if(MS)return jp;MS=1;var e=Nv(),n=au(),i=Nq(),s=ZN(),o=n(function(l){return i(e(l,1,s,!0))});return jp=o,jp}var Ap,PS;function Rq(){if(PS)return Ap;PS=1;var e=iu();function n(i,s){return e(s,function(o){return i[o]})}return Ap=n,Ap}var Ip,OS;function JN(){if(OS)return Ip;OS=1;var e=Rq(),n=pi();function i(s){return s==null?[]:e(s,n(s))}return Ip=i,Ip}var Mp,qS;function qn(){if(qS)return Mp;qS=1;var e;if(typeof fv=="function")try{e={clone:OO(),constant:_v(),each:IN(),filter:UN(),has:HN(),isArray:St(),isEmpty:sq(),isFunction:ra(),isUndefined:VN(),keys:pi(),map:GN(),reduce:YN(),size:hq(),transform:pq(),union:Cq(),values:JN()}}catch{}return e||(e=window._),Mp=e,Mp}var Pp,LS;function Cv(){if(LS)return Pp;LS=1;var e=qn();Pp=o;var n="\0",i="\0",s="";function o(p){this._isDirected=e.has(p,"directed")?p.directed:!0,this._isMultigraph=e.has(p,"multigraph")?p.multigraph:!1,this._isCompound=e.has(p,"compound")?p.compound:!1,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[i]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}o.prototype._nodeCount=0,o.prototype._edgeCount=0,o.prototype.isDirected=function(){return this._isDirected},o.prototype.isMultigraph=function(){return this._isMultigraph},o.prototype.isCompound=function(){return this._isCompound},o.prototype.setGraph=function(p){return this._label=p,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(p){return e.isFunction(p)||(p=e.constant(p)),this._defaultNodeLabelFn=p,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return e.keys(this._nodes)},o.prototype.sources=function(){var p=this;return e.filter(this.nodes(),function(m){return e.isEmpty(p._in[m])})},o.prototype.sinks=function(){var p=this;return e.filter(this.nodes(),function(m){return e.isEmpty(p._out[m])})},o.prototype.setNodes=function(p,m){var y=arguments,x=this;return e.each(p,function(N){y.length>1?x.setNode(N,m):x.setNode(N)}),this},o.prototype.setNode=function(p,m){return e.has(this._nodes,p)?(arguments.length>1&&(this._nodes[p]=m),this):(this._nodes[p]=arguments.length>1?m:this._defaultNodeLabelFn(p),this._isCompound&&(this._parent[p]=i,this._children[p]={},this._children[i][p]=!0),this._in[p]={},this._preds[p]={},this._out[p]={},this._sucs[p]={},++this._nodeCount,this)},o.prototype.node=function(p){return this._nodes[p]},o.prototype.hasNode=function(p){return e.has(this._nodes,p)},o.prototype.removeNode=function(p){var m=this;if(e.has(this._nodes,p)){var y=function(x){m.removeEdge(m._edgeObjs[x])};delete this._nodes[p],this._isCompound&&(this._removeFromParentsChildList(p),delete this._parent[p],e.each(this.children(p),function(x){m.setParent(x)}),delete this._children[p]),e.each(e.keys(this._in[p]),y),delete this._in[p],delete this._preds[p],e.each(e.keys(this._out[p]),y),delete this._out[p],delete this._sucs[p],--this._nodeCount}return this},o.prototype.setParent=function(p,m){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(m))m=i;else{m+="";for(var y=m;!e.isUndefined(y);y=this.parent(y))if(y===p)throw new Error("Setting "+m+" as parent of "+p+" would create a cycle");this.setNode(m)}return this.setNode(p),this._removeFromParentsChildList(p),this._parent[p]=m,this._children[m][p]=!0,this},o.prototype._removeFromParentsChildList=function(p){delete this._children[this._parent[p]][p]},o.prototype.parent=function(p){if(this._isCompound){var m=this._parent[p];if(m!==i)return m}},o.prototype.children=function(p){if(e.isUndefined(p)&&(p=i),this._isCompound){var m=this._children[p];if(m)return e.keys(m)}else{if(p===i)return this.nodes();if(this.hasNode(p))return[]}},o.prototype.predecessors=function(p){var m=this._preds[p];if(m)return e.keys(m)},o.prototype.successors=function(p){var m=this._sucs[p];if(m)return e.keys(m)},o.prototype.neighbors=function(p){var m=this.predecessors(p);if(m)return e.union(m,this.successors(p))},o.prototype.isLeaf=function(p){var m;return this.isDirected()?m=this.successors(p):m=this.neighbors(p),m.length===0},o.prototype.filterNodes=function(p){var m=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});m.setGraph(this.graph());var y=this;e.each(this._nodes,function(_,S){p(S)&&m.setNode(S,_)}),e.each(this._edgeObjs,function(_){m.hasNode(_.v)&&m.hasNode(_.w)&&m.setEdge(_,y.edge(_))});var x={};function N(_){var S=y.parent(_);return S===void 0||m.hasNode(S)?(x[_]=S,S):S in x?x[S]:N(S)}return this._isCompound&&e.each(m.nodes(),function(_){m.setParent(_,N(_))}),m},o.prototype.setDefaultEdgeLabel=function(p){return e.isFunction(p)||(p=e.constant(p)),this._defaultEdgeLabelFn=p,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return e.values(this._edgeObjs)},o.prototype.setPath=function(p,m){var y=this,x=arguments;return e.reduce(p,function(N,_){return x.length>1?y.setEdge(N,_,m):y.setEdge(N,_),_}),this},o.prototype.setEdge=function(){var p,m,y,x,N=!1,_=arguments[0];typeof _=="object"&&_!==null&&"v"in _?(p=_.v,m=_.w,y=_.name,arguments.length===2&&(x=arguments[1],N=!0)):(p=_,m=arguments[1],y=arguments[3],arguments.length>2&&(x=arguments[2],N=!0)),p=""+p,m=""+m,e.isUndefined(y)||(y=""+y);var S=c(this._isDirected,p,m,y);if(e.has(this._edgeLabels,S))return N&&(this._edgeLabels[S]=x),this;if(!e.isUndefined(y)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(p),this.setNode(m),this._edgeLabels[S]=N?x:this._defaultEdgeLabelFn(p,m,y);var b=d(this._isDirected,p,m,y);return p=b.v,m=b.w,Object.freeze(b),this._edgeObjs[S]=b,l(this._preds[m],p),l(this._sucs[p],m),this._in[m][S]=b,this._out[p][S]=b,this._edgeCount++,this},o.prototype.edge=function(p,m,y){var x=arguments.length===1?h(this._isDirected,arguments[0]):c(this._isDirected,p,m,y);return this._edgeLabels[x]},o.prototype.hasEdge=function(p,m,y){var x=arguments.length===1?h(this._isDirected,arguments[0]):c(this._isDirected,p,m,y);return e.has(this._edgeLabels,x)},o.prototype.removeEdge=function(p,m,y){var x=arguments.length===1?h(this._isDirected,arguments[0]):c(this._isDirected,p,m,y),N=this._edgeObjs[x];return N&&(p=N.v,m=N.w,delete this._edgeLabels[x],delete this._edgeObjs[x],u(this._preds[m],p),u(this._sucs[p],m),delete this._in[m][x],delete this._out[p][x],this._edgeCount--),this},o.prototype.inEdges=function(p,m){var y=this._in[p];if(y){var x=e.values(y);return m?e.filter(x,function(N){return N.v===m}):x}},o.prototype.outEdges=function(p,m){var y=this._out[p];if(y){var x=e.values(y);return m?e.filter(x,function(N){return N.w===m}):x}},o.prototype.nodeEdges=function(p,m){var y=this.inEdges(p,m);if(y)return y.concat(this.outEdges(p,m))};function l(p,m){p[m]?p[m]++:p[m]=1}function u(p,m){--p[m]||delete p[m]}function c(p,m,y,x){var N=""+m,_=""+y;if(!p&&N>_){var S=N;N=_,_=S}return N+s+_+s+(e.isUndefined(x)?n:x)}function d(p,m,y,x){var N=""+m,_=""+y;if(!p&&N>_){var S=N;N=_,_=S}var b={v:N,w:_};return x&&(b.name=x),b}function h(p,m){return c(p,m.v,m.w,m.name)}return Pp}var Op,$S;function Tq(){return $S||($S=1,Op="2.1.8"),Op}var qp,DS;function jq(){return DS||(DS=1,qp={Graph:Cv(),version:Tq()}),qp}var Lp,FS;function Aq(){if(FS)return Lp;FS=1;var e=qn(),n=Cv();Lp={write:i,read:l};function i(u){var c={options:{directed:u.isDirected(),multigraph:u.isMultigraph(),compound:u.isCompound()},nodes:s(u),edges:o(u)};return e.isUndefined(u.graph())||(c.value=e.clone(u.graph())),c}function s(u){return e.map(u.nodes(),function(c){var d=u.node(c),h=u.parent(c),p={v:c};return e.isUndefined(d)||(p.value=d),e.isUndefined(h)||(p.parent=h),p})}function o(u){return e.map(u.edges(),function(c){var d=u.edge(c),h={v:c.v,w:c.w};return e.isUndefined(c.name)||(h.name=c.name),e.isUndefined(d)||(h.value=d),h})}function l(u){var c=new n(u.options).setGraph(u.value);return e.each(u.nodes,function(d){c.setNode(d.v,d.value),d.parent&&c.setParent(d.v,d.parent)}),e.each(u.edges,function(d){c.setEdge({v:d.v,w:d.w,name:d.name},d.value)}),c}return Lp}var $p,zS;function Iq(){if(zS)return $p;zS=1;var e=qn();$p=n;function n(i){var s={},o=[],l;function u(c){e.has(s,c)||(s[c]=!0,l.push(c),e.each(i.successors(c),u),e.each(i.predecessors(c),u))}return e.each(i.nodes(),function(c){l=[],u(c),l.length&&o.push(l)}),o}return $p}var Dp,BS;function eC(){if(BS)return Dp;BS=1;var e=qn();Dp=n;function n(){this._arr=[],this._keyIndices={}}return n.prototype.size=function(){return this._arr.length},n.prototype.keys=function(){return this._arr.map(function(i){return i.key})},n.prototype.has=function(i){return e.has(this._keyIndices,i)},n.prototype.priority=function(i){var s=this._keyIndices[i];if(s!==void 0)return this._arr[s].priority},n.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},n.prototype.add=function(i,s){var o=this._keyIndices;if(i=String(i),!e.has(o,i)){var l=this._arr,u=l.length;return o[i]=u,l.push({key:i,priority:s}),this._decrease(u),!0}return!1},n.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var i=this._arr.pop();return delete this._keyIndices[i.key],this._heapify(0),i.key},n.prototype.decrease=function(i,s){var o=this._keyIndices[i];if(s>this._arr[o].priority)throw new Error("New priority is greater than current priority. Key: "+i+" Old: "+this._arr[o].priority+" New: "+s);this._arr[o].priority=s,this._decrease(o)},n.prototype._heapify=function(i){var s=this._arr,o=2*i,l=o+1,u=i;o<s.length&&(u=s[o].priority<s[u].priority?o:u,l<s.length&&(u=s[l].priority<s[u].priority?l:u),u!==i&&(this._swap(i,u),this._heapify(u)))},n.prototype._decrease=function(i){for(var s=this._arr,o=s[i].priority,l;i!==0&&(l=i>>1,!(s[l].priority<o));)this._swap(i,l),i=l},n.prototype._swap=function(i,s){var o=this._arr,l=this._keyIndices,u=o[i],c=o[s];o[i]=c,o[s]=u,l[c.key]=i,l[u.key]=s},Dp}var Fp,US;function tC(){if(US)return Fp;US=1;var e=qn(),n=eC();Fp=s;var i=e.constant(1);function s(l,u,c,d){return o(l,String(u),c||i,d||function(h){return l.outEdges(h)})}function o(l,u,c,d){var h={},p=new n,m,y,x=function(N){var _=N.v!==m?N.v:N.w,S=h[_],b=c(N),k=y.distance+b;if(b<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+N+" Weight: "+b);k<S.distance&&(S.distance=k,S.predecessor=m,p.decrease(_,k))};for(l.nodes().forEach(function(N){var _=N===u?0:Number.POSITIVE_INFINITY;h[N]={distance:_},p.add(N,_)});p.size()>0&&(m=p.removeMin(),y=h[m],y.distance!==Number.POSITIVE_INFINITY);)d(m).forEach(x);return h}return Fp}var zp,HS;function Mq(){if(HS)return zp;HS=1;var e=tC(),n=qn();zp=i;function i(s,o,l){return n.transform(s.nodes(),function(u,c){u[c]=e(s,c,o,l)},{})}return zp}var Bp,VS;function nC(){if(VS)return Bp;VS=1;var e=qn();Bp=n;function n(i){var s=0,o=[],l={},u=[];function c(d){var h=l[d]={onStack:!0,lowlink:s,index:s++};if(o.push(d),i.successors(d).forEach(function(y){e.has(l,y)?l[y].onStack&&(h.lowlink=Math.min(h.lowlink,l[y].index)):(c(y),h.lowlink=Math.min(h.lowlink,l[y].lowlink))}),h.lowlink===h.index){var p=[],m;do m=o.pop(),l[m].onStack=!1,p.push(m);while(d!==m);u.push(p)}}return i.nodes().forEach(function(d){e.has(l,d)||c(d)}),u}return Bp}var Up,WS;function Pq(){if(WS)return Up;WS=1;var e=qn(),n=nC();Up=i;function i(s){return e.filter(n(s),function(o){return o.length>1||o.length===1&&s.hasEdge(o[0],o[0])})}return Up}var Hp,GS;function Oq(){if(GS)return Hp;GS=1;var e=qn();Hp=i;var n=e.constant(1);function i(o,l,u){return s(o,l||n,u||function(c){return o.outEdges(c)})}function s(o,l,u){var c={},d=o.nodes();return d.forEach(function(h){c[h]={},c[h][h]={distance:0},d.forEach(function(p){h!==p&&(c[h][p]={distance:Number.POSITIVE_INFINITY})}),u(h).forEach(function(p){var m=p.v===h?p.w:p.v,y=l(p);c[h][m]={distance:y,predecessor:h}})}),d.forEach(function(h){var p=c[h];d.forEach(function(m){var y=c[m];d.forEach(function(x){var N=y[h],_=p[x],S=y[x],b=N.distance+_.distance;b<S.distance&&(S.distance=b,S.predecessor=_.predecessor)})})}),c}return Hp}var Vp,YS;function rC(){if(YS)return Vp;YS=1;var e=qn();Vp=n,n.CycleException=i;function n(s){var o={},l={},u=[];function c(d){if(e.has(l,d))throw new i;e.has(o,d)||(l[d]=!0,o[d]=!0,e.each(s.predecessors(d),c),delete l[d],u.push(d))}if(e.each(s.sinks(),c),e.size(o)!==s.nodeCount())throw new i;return u}function i(){}return i.prototype=new Error,Vp}var Wp,KS;function qq(){if(KS)return Wp;KS=1;var e=rC();Wp=n;function n(i){try{e(i)}catch(s){if(s instanceof e.CycleException)return!1;throw s}return!0}return Wp}var Gp,XS;function iC(){if(XS)return Gp;XS=1;var e=qn();Gp=n;function n(s,o,l){e.isArray(o)||(o=[o]);var u=(s.isDirected()?s.successors:s.neighbors).bind(s),c=[],d={};return e.each(o,function(h){if(!s.hasNode(h))throw new Error("Graph does not have node: "+h);i(s,h,l==="post",d,u,c)}),c}function i(s,o,l,u,c,d){e.has(u,o)||(u[o]=!0,l||d.push(o),e.each(c(o),function(h){i(s,h,l,u,c,d)}),l&&d.push(o))}return Gp}var Yp,QS;function Lq(){if(QS)return Yp;QS=1;var e=iC();Yp=n;function n(i,s){return e(i,s,"post")}return Yp}var Kp,ZS;function $q(){if(ZS)return Kp;ZS=1;var e=iC();Kp=n;function n(i,s){return e(i,s,"pre")}return Kp}var Xp,JS;function Dq(){if(JS)return Xp;JS=1;var e=qn(),n=Cv(),i=eC();Xp=s;function s(o,l){var u=new n,c={},d=new i,h;function p(y){var x=y.v===h?y.w:y.v,N=d.priority(x);if(N!==void 0){var _=l(y);_<N&&(c[x]=h,d.decrease(x,_))}}if(o.nodeCount()===0)return u;e.each(o.nodes(),function(y){d.add(y,Number.POSITIVE_INFINITY),u.setNode(y)}),d.decrease(o.nodes()[0],0);for(var m=!1;d.size()>0;){if(h=d.removeMin(),e.has(c,h))u.setEdge(h,c[h]);else{if(m)throw new Error("Input graph is not connected: "+o);m=!0}o.nodeEdges(h).forEach(p)}return u}return Xp}var Qp,eb;function Fq(){return eb||(eb=1,Qp={components:Iq(),dijkstra:tC(),dijkstraAll:Mq(),findCycles:Pq(),floydWarshall:Oq(),isAcyclic:qq(),postorder:Lq(),preorder:$q(),prim:Dq(),tarjan:nC(),topsort:rC()}),Qp}var Zp,tb;function zq(){if(tb)return Zp;tb=1;var e=jq();return Zp={Graph:e.Graph,json:Aq(),alg:Fq(),version:e.version},Zp}var Jp,nb;function Zn(){if(nb)return Jp;nb=1;var e;if(typeof fv=="function")try{e=zq()}catch{}return e||(e=window.graphlib),Jp=e,Jp}var em,rb;function Bq(){if(rb)return em;rb=1;var e=TN(),n=1,i=4;function s(o){return e(o,n|i)}return em=s,em}var tm,ib;function lu(){if(ib)return tm;ib=1;var e=Hs(),n=Ir(),i=Jl(),s=On();function o(l,u,c){if(!s(c))return!1;var d=typeof u;return(d=="number"?n(c)&&i(u,c.length):d=="string"&&u in c)?e(c[u],l):!1}return tm=o,tm}var nm,sb;function Uq(){if(sb)return nm;sb=1;var e=au(),n=Hs(),i=lu(),s=Qi(),o=Object.prototype,l=o.hasOwnProperty,u=e(function(c,d){c=Object(c);var h=-1,p=d.length,m=p>2?d[2]:void 0;for(m&&i(d[0],d[1],m)&&(p=1);++h<p;)for(var y=d[h],x=s(y),N=-1,_=x.length;++N<_;){var S=x[N],b=c[S];(b===void 0||n(b,o[S])&&!l.call(c,S))&&(c[S]=y[S])}return c});return nm=u,nm}var rm,ob;function Hq(){if(ob)return rm;ob=1;var e=Mr(),n=Ir(),i=pi();function s(o){return function(l,u,c){var d=Object(l);if(!n(l)){var h=e(u,3);l=i(l),u=function(m){return h(d[m],m,d)}}var p=o(l,u,c);return p>-1?d[h?l[p]:p]:void 0}}return rm=s,rm}var im,ab;function Vq(){if(ab)return im;ab=1;var e=/\s/;function n(i){for(var s=i.length;s--&&e.test(i.charAt(s)););return s}return im=n,im}var sm,lb;function Wq(){if(lb)return sm;lb=1;var e=Vq(),n=/^\s+/;function i(s){return s&&s.slice(0,e(s)+1).replace(n,"")}return sm=i,sm}var om,ub;function Gq(){if(ub)return om;ub=1;var e=Wq(),n=On(),i=Ys(),s=NaN,o=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;function d(h){if(typeof h=="number")return h;if(i(h))return s;if(n(h)){var p=typeof h.valueOf=="function"?h.valueOf():h;h=n(p)?p+"":p}if(typeof h!="string")return h===0?h:+h;h=e(h);var m=l.test(h);return m||u.test(h)?c(h.slice(2),m?2:8):o.test(h)?s:+h}return om=d,om}var am,cb;function sC(){if(cb)return am;cb=1;var e=Gq(),n=1/0,i=17976931348623157e292;function s(o){if(!o)return o===0?o:0;if(o=e(o),o===n||o===-n){var l=o<0?-1:1;return l*i}return o===o?o:0}return am=s,am}var lm,fb;function Yq(){if(fb)return lm;fb=1;var e=sC();function n(i){var s=e(i),o=s%1;return s===s?o?s-o:s:0}return lm=n,lm}var um,db;function Kq(){if(db)return um;db=1;var e=QN(),n=Mr(),i=Yq(),s=Math.max;function o(l,u,c){var d=l==null?0:l.length;if(!d)return-1;var h=c==null?0:i(c);return h<0&&(h=s(d+h,0)),e(l,n(u,3),h)}return um=o,um}var cm,hb;function Xq(){if(hb)return cm;hb=1;var e=Hq(),n=Kq(),i=e(n);return cm=i,cm}var fm,pb;function oC(){if(pb)return fm;pb=1;var e=Nv();function n(i){var s=i==null?0:i.length;return s?e(i,1):[]}return fm=n,fm}var dm,mb;function Qq(){if(mb)return dm;mb=1;var e=Sv(),n=jN(),i=Qi();function s(o,l){return o==null?o:e(o,n(l),i)}return dm=s,dm}var hm,gb;function Zq(){if(gb)return hm;gb=1;function e(n){var i=n==null?0:n.length;return i?n[i-1]:void 0}return hm=e,hm}var pm,vb;function Jq(){if(vb)return pm;vb=1;var e=Ql(),n=bv(),i=Mr();function s(o,l){var u={};return l=i(l,3),n(o,function(c,d,h){e(u,d,l(c,d,h))}),u}return pm=s,pm}var mm,yb;function Rv(){if(yb)return mm;yb=1;var e=Ys();function n(i,s,o){for(var l=-1,u=i.length;++l<u;){var c=i[l],d=s(c);if(d!=null&&(h===void 0?d===d&&!e(d):o(d,h)))var h=d,p=c}return p}return mm=n,mm}var gm,wb;function eL(){if(wb)return gm;wb=1;function e(n,i){return n>i}return gm=e,gm}var vm,xb;function tL(){if(xb)return vm;xb=1;var e=Rv(),n=eL(),i=Zi();function s(o){return o&&o.length?e(o,i,n):void 0}return vm=s,vm}var ym,_b;function aC(){if(_b)return ym;_b=1;var e=Ql(),n=Hs();function i(s,o,l){(l!==void 0&&!n(s[o],l)||l===void 0&&!(o in s))&&e(s,o,l)}return ym=i,ym}var wm,Sb;function nL(){if(Sb)return wm;Sb=1;var e=Ki(),n=nu(),i=fr(),s="[object Object]",o=Function.prototype,l=Object.prototype,u=o.toString,c=l.hasOwnProperty,d=u.call(Object);function h(p){if(!i(p)||e(p)!=s)return!1;var m=n(p);if(m===null)return!0;var y=c.call(m,"constructor")&&m.constructor;return typeof y=="function"&&y instanceof y&&u.call(y)==d}return wm=h,wm}var xm,bb;function lC(){if(bb)return xm;bb=1;function e(n,i){if(!(i==="constructor"&&typeof n[i]=="function")&&i!="__proto__")return n[i]}return xm=e,xm}var _m,kb;function rL(){if(kb)return _m;kb=1;var e=ia(),n=Qi();function i(s){return e(s,n(s))}return _m=i,_m}var Sm,Eb;function iL(){if(Eb)return Sm;Eb=1;var e=aC(),n=vN(),i=NN(),s=yN(),o=RN(),l=sa(),u=St(),c=ZN(),d=Ws(),h=ra(),p=On(),m=nL(),y=oa(),x=lC(),N=rL();function _(S,b,k,E,C,I,P){var L=x(S,k),O=x(b,k),R=P.get(O);if(R){e(S,k,R);return}var q=I?I(L,O,k+"",S,b,P):void 0,F=q===void 0;if(F){var J=u(O),Q=!J&&d(O),A=!J&&!Q&&y(O);q=O,J||Q||A?u(L)?q=L:c(L)?q=s(L):Q?(F=!1,q=n(O,!0)):A?(F=!1,q=i(O,!0)):q=[]:m(O)||l(O)?(q=L,l(L)?q=N(L):(!p(L)||h(L))&&(q=o(O))):F=!1}F&&(P.set(O,q),C(q,O,E,I,P),P.delete(O)),e(S,k,q)}return Sm=_,Sm}var bm,Nb;function sL(){if(Nb)return bm;Nb=1;var e=Xl(),n=aC(),i=Sv(),s=iL(),o=On(),l=Qi(),u=lC();function c(d,h,p,m,y){d!==h&&i(h,function(x,N){if(y||(y=new e),o(x))s(d,h,N,p,c,m,y);else{var _=m?m(u(d,N),x,N+"",d,h,y):void 0;_===void 0&&(_=x),n(d,N,_)}},l)}return bm=c,bm}var km,Cb;function oL(){if(Cb)return km;Cb=1;var e=au(),n=lu();function i(s){return e(function(o,l){var u=-1,c=l.length,d=c>1?l[c-1]:void 0,h=c>2?l[2]:void 0;for(d=s.length>3&&typeof d=="function"?(c--,d):void 0,h&&n(l[0],l[1],h)&&(d=c<3?void 0:d,c=1),o=Object(o);++u<c;){var p=l[u];p&&s(o,p,u,d)}return o})}return km=i,km}var Em,Rb;function aL(){if(Rb)return Em;Rb=1;var e=sL(),n=oL(),i=n(function(s,o,l){e(s,o,l)});return Em=i,Em}var Nm,Tb;function uC(){if(Tb)return Nm;Tb=1;function e(n,i){return n<i}return Nm=e,Nm}var Cm,jb;function lL(){if(jb)return Cm;jb=1;var e=Rv(),n=uC(),i=Zi();function s(o){return o&&o.length?e(o,i,n):void 0}return Cm=s,Cm}var Rm,Ab;function uL(){if(Ab)return Rm;Ab=1;var e=Rv(),n=Mr(),i=uC();function s(o,l){return o&&o.length?e(o,n(l,2),i):void 0}return Rm=s,Rm}var Tm,Ib;function cL(){if(Ib)return Tm;Ib=1;var e=er(),n=function(){return e.Date.now()};return Tm=n,Tm}var jm,Mb;function fL(){if(Mb)return jm;Mb=1;var e=Zl(),n=su(),i=Jl(),s=On(),o=aa();function l(u,c,d,h){if(!s(u))return u;c=n(c,u);for(var p=-1,m=c.length,y=m-1,x=u;x!=null&&++p<m;){var N=o(c[p]),_=d;if(N==="__proto__"||N==="constructor"||N==="prototype")return u;if(p!=y){var S=x[N];_=h?h(S,N,x):void 0,_===void 0&&(_=s(S)?S:i(c[p+1])?[]:{})}e(x,N,_),x=x[N]}return u}return jm=l,jm}var Am,Pb;function dL(){if(Pb)return Am;Pb=1;var e=ou(),n=fL(),i=su();function s(o,l,u){for(var c=-1,d=l.length,h={};++c<d;){var p=l[c],m=e(o,p);u(m,p)&&n(h,i(p,o),m)}return h}return Am=s,Am}var Im,Ob;function hL(){if(Ob)return Im;Ob=1;var e=dL(),n=zN();function i(s,o){return e(s,o,function(l,u){return n(s,u)})}return Im=i,Im}var Mm,qb;function pL(){if(qb)return Mm;qb=1;var e=oC(),n=KN(),i=XN();function s(o){return i(n(o,void 0,e),o+"")}return Mm=s,Mm}var Pm,Lb;function mL(){if(Lb)return Pm;Lb=1;var e=hL(),n=pL(),i=n(function(s,o){return s==null?{}:e(s,o)});return Pm=i,Pm}var Om,$b;function gL(){if($b)return Om;$b=1;var e=Math.ceil,n=Math.max;function i(s,o,l,u){for(var c=-1,d=n(e((o-s)/(l||1)),0),h=Array(d);d--;)h[u?d:++c]=s,s+=l;return h}return Om=i,Om}var qm,Db;function vL(){if(Db)return qm;Db=1;var e=gL(),n=lu(),i=sC();function s(o){return function(l,u,c){return c&&typeof c!="number"&&n(l,u,c)&&(u=c=void 0),l=i(l),u===void 0?(u=l,l=0):u=i(u),c=c===void 0?l<u?1:-1:i(c),e(l,u,c,o)}}return qm=s,qm}var Lm,Fb;function yL(){if(Fb)return Lm;Fb=1;var e=vL(),n=e();return Lm=n,Lm}var $m,zb;function wL(){if(zb)return $m;zb=1;function e(n,i){var s=n.length;for(n.sort(i);s--;)n[s]=n[s].value;return n}return $m=e,$m}var Dm,Bb;function xL(){if(Bb)return Dm;Bb=1;var e=Ys();function n(i,s){if(i!==s){var o=i!==void 0,l=i===null,u=i===i,c=e(i),d=s!==void 0,h=s===null,p=s===s,m=e(s);if(!h&&!m&&!c&&i>s||c&&d&&p&&!h&&!m||l&&d&&p||!o&&p||!u)return 1;if(!l&&!c&&!m&&i<s||m&&o&&u&&!l&&!c||h&&o&&u||!d&&u||!p)return-1}return 0}return Dm=n,Dm}var Fm,Ub;function _L(){if(Ub)return Fm;Ub=1;var e=xL();function n(i,s,o){for(var l=-1,u=i.criteria,c=s.criteria,d=u.length,h=o.length;++l<d;){var p=e(u[l],c[l]);if(p){if(l>=h)return p;var m=o[l];return p*(m=="desc"?-1:1)}}return i.index-s.index}return Fm=n,Fm}var zm,Hb;function SL(){if(Hb)return zm;Hb=1;var e=iu(),n=ou(),i=Mr(),s=WN(),o=wL(),l=eu(),u=_L(),c=Zi(),d=St();function h(p,m,y){m.length?m=e(m,function(_){return d(_)?function(S){return n(S,_.length===1?_[0]:_)}:_}):m=[c];var x=-1;m=e(m,l(i));var N=s(p,function(_,S,b){var k=e(m,function(E){return E(_)});return{criteria:k,index:++x,value:_}});return o(N,function(_,S){return u(_,S,y)})}return zm=h,zm}var Bm,Vb;function bL(){if(Vb)return Bm;Vb=1;var e=Nv(),n=SL(),i=au(),s=lu(),o=i(function(l,u){if(l==null)return[];var c=u.length;return c>1&&s(l,u[0],u[1])?u=[]:c>2&&s(u[0],u[1],u[2])&&(u=[u[0]]),n(l,e(u,1),[])});return Bm=o,Bm}var Um,Wb;function kL(){if(Wb)return Um;Wb=1;var e=DN(),n=0;function i(s){var o=++n;return e(s)+o}return Um=i,Um}var Hm,Gb;function EL(){if(Gb)return Hm;Gb=1;function e(n,i,s){for(var o=-1,l=n.length,u=i.length,c={};++o<l;){var d=o<u?i[o]:void 0;s(c,n[o],d)}return c}return Hm=e,Hm}var Vm,Yb;function NL(){if(Yb)return Vm;Yb=1;var e=Zl(),n=EL();function i(s,o){return n(s||[],o||[],e)}return Vm=i,Vm}var Wm,Kb;function at(){if(Kb)return Wm;Kb=1;var e;if(typeof fv=="function")try{e={cloneDeep:Bq(),constant:_v(),defaults:Uq(),each:IN(),filter:UN(),find:Xq(),flatten:oC(),forEach:AN(),forIn:Qq(),has:HN(),isUndefined:VN(),last:Zq(),map:GN(),mapValues:Jq(),max:tL(),merge:aL(),min:lL(),minBy:uL(),now:cL(),pick:mL(),range:yL(),reduce:YN(),sortBy:bL(),uniqueId:kL(),values:JN(),zipObject:NL()}}catch{}return e||(e=window._),Wm=e,Wm}var Gm,Xb;function CL(){if(Xb)return Gm;Xb=1,Gm=e;function e(){var s={};s._next=s._prev=s,this._sentinel=s}e.prototype.dequeue=function(){var s=this._sentinel,o=s._prev;if(o!==s)return n(o),o},e.prototype.enqueue=function(s){var o=this._sentinel;s._prev&&s._next&&n(s),s._next=o._next,o._next._prev=s,o._next=s,s._prev=o},e.prototype.toString=function(){for(var s=[],o=this._sentinel,l=o._prev;l!==o;)s.push(JSON.stringify(l,i)),l=l._prev;return"["+s.join(", ")+"]"};function n(s){s._prev._next=s._next,s._next._prev=s._prev,delete s._next,delete s._prev}function i(s,o){if(s!=="_next"&&s!=="_prev")return o}return Gm}var Ym,Qb;function RL(){if(Qb)return Ym;Qb=1;var e=at(),n=Zn().Graph,i=CL();Ym=o;var s=e.constant(1);function o(h,p){if(h.nodeCount()<=1)return[];var m=c(h,p||s),y=l(m.graph,m.buckets,m.zeroIdx);return e.flatten(e.map(y,function(x){return h.outEdges(x.v,x.w)}),!0)}function l(h,p,m){for(var y=[],x=p[p.length-1],N=p[0],_;h.nodeCount();){for(;_=N.dequeue();)u(h,p,m,_);for(;_=x.dequeue();)u(h,p,m,_);if(h.nodeCount()){for(var S=p.length-2;S>0;--S)if(_=p[S].dequeue(),_){y=y.concat(u(h,p,m,_,!0));break}}}return y}function u(h,p,m,y,x){var N=x?[]:void 0;return e.forEach(h.inEdges(y.v),function(_){var S=h.edge(_),b=h.node(_.v);x&&N.push({v:_.v,w:_.w}),b.out-=S,d(p,m,b)}),e.forEach(h.outEdges(y.v),function(_){var S=h.edge(_),b=_.w,k=h.node(b);k.in-=S,d(p,m,k)}),h.removeNode(y.v),N}function c(h,p){var m=new n,y=0,x=0;e.forEach(h.nodes(),function(S){m.setNode(S,{v:S,in:0,out:0})}),e.forEach(h.edges(),function(S){var b=m.edge(S.v,S.w)||0,k=p(S),E=b+k;m.setEdge(S.v,S.w,E),x=Math.max(x,m.node(S.v).out+=k),y=Math.max(y,m.node(S.w).in+=k)});var N=e.range(x+y+3).map(function(){return new i}),_=y+1;return e.forEach(m.nodes(),function(S){d(N,_,m.node(S))}),{graph:m,buckets:N,zeroIdx:_}}function d(h,p,m){m.out?m.in?h[m.out-m.in+p].enqueue(m):h[h.length-1].enqueue(m):h[0].enqueue(m)}return Ym}var Km,Zb;function TL(){if(Zb)return Km;Zb=1;var e=at(),n=RL();Km={run:i,undo:o};function i(l){var u=l.graph().acyclicer==="greedy"?n(l,c(l)):s(l);e.forEach(u,function(d){var h=l.edge(d);l.removeEdge(d),h.forwardName=d.name,h.reversed=!0,l.setEdge(d.w,d.v,h,e.uniqueId("rev"))});function c(d){return function(h){return d.edge(h).weight}}}function s(l){var u=[],c={},d={};function h(p){e.has(d,p)||(d[p]=!0,c[p]=!0,e.forEach(l.outEdges(p),function(m){e.has(c,m.w)?u.push(m):h(m.w)}),delete c[p])}return e.forEach(l.nodes(),h),u}function o(l){e.forEach(l.edges(),function(u){var c=l.edge(u);if(c.reversed){l.removeEdge(u);var d=c.forwardName;delete c.reversed,delete c.forwardName,l.setEdge(u.w,u.v,c,d)}})}return Km}var Xm,Jb;function hn(){if(Jb)return Xm;Jb=1;var e=at(),n=Zn().Graph;Xm={addDummyNode:i,simplify:s,asNonCompoundGraph:o,successorWeights:l,predecessorWeights:u,intersectRect:c,buildLayerMatrix:d,normalizeRanks:h,removeEmptyRanks:p,addBorderNode:m,maxRank:y,partition:x,time:N,notime:_};function i(S,b,k,E){var C;do C=e.uniqueId(E);while(S.hasNode(C));return k.dummy=b,S.setNode(C,k),C}function s(S){var b=new n().setGraph(S.graph());return e.forEach(S.nodes(),function(k){b.setNode(k,S.node(k))}),e.forEach(S.edges(),function(k){var E=b.edge(k.v,k.w)||{weight:0,minlen:1},C=S.edge(k);b.setEdge(k.v,k.w,{weight:E.weight+C.weight,minlen:Math.max(E.minlen,C.minlen)})}),b}function o(S){var b=new n({multigraph:S.isMultigraph()}).setGraph(S.graph());return e.forEach(S.nodes(),function(k){S.children(k).length||b.setNode(k,S.node(k))}),e.forEach(S.edges(),function(k){b.setEdge(k,S.edge(k))}),b}function l(S){var b=e.map(S.nodes(),function(k){var E={};return e.forEach(S.outEdges(k),function(C){E[C.w]=(E[C.w]||0)+S.edge(C).weight}),E});return e.zipObject(S.nodes(),b)}function u(S){var b=e.map(S.nodes(),function(k){var E={};return e.forEach(S.inEdges(k),function(C){E[C.v]=(E[C.v]||0)+S.edge(C).weight}),E});return e.zipObject(S.nodes(),b)}function c(S,b){var k=S.x,E=S.y,C=b.x-k,I=b.y-E,P=S.width/2,L=S.height/2;if(!C&&!I)throw new Error("Not possible to find intersection inside of the rectangle");var O,R;return Math.abs(I)*P>Math.abs(C)*L?(I<0&&(L=-L),O=L*C/I,R=L):(C<0&&(P=-P),O=P,R=P*I/C),{x:k+O,y:E+R}}function d(S){var b=e.map(e.range(y(S)+1),function(){return[]});return e.forEach(S.nodes(),function(k){var E=S.node(k),C=E.rank;e.isUndefined(C)||(b[C][E.order]=k)}),b}function h(S){var b=e.min(e.map(S.nodes(),function(k){return S.node(k).rank}));e.forEach(S.nodes(),function(k){var E=S.node(k);e.has(E,"rank")&&(E.rank-=b)})}function p(S){var b=e.min(e.map(S.nodes(),function(I){return S.node(I).rank})),k=[];e.forEach(S.nodes(),function(I){var P=S.node(I).rank-b;k[P]||(k[P]=[]),k[P].push(I)});var E=0,C=S.graph().nodeRankFactor;e.forEach(k,function(I,P){e.isUndefined(I)&&P%C!==0?--E:E&&e.forEach(I,function(L){S.node(L).rank+=E})})}function m(S,b,k,E){var C={width:0,height:0};return arguments.length>=4&&(C.rank=k,C.order=E),i(S,"border",C,b)}function y(S){return e.max(e.map(S.nodes(),function(b){var k=S.node(b).rank;if(!e.isUndefined(k))return k}))}function x(S,b){var k={lhs:[],rhs:[]};return e.forEach(S,function(E){b(E)?k.lhs.push(E):k.rhs.push(E)}),k}function N(S,b){var k=e.now();try{return b()}finally{console.log(S+" time: "+(e.now()-k)+"ms")}}function _(S,b){return b()}return Xm}var Qm,ek;function jL(){if(ek)return Qm;ek=1;var e=at(),n=hn();Qm={run:i,undo:o};function i(l){l.graph().dummyChains=[],e.forEach(l.edges(),function(u){s(l,u)})}function s(l,u){var c=u.v,d=l.node(c).rank,h=u.w,p=l.node(h).rank,m=u.name,y=l.edge(u),x=y.labelRank;if(p!==d+1){l.removeEdge(u);var N,_,S;for(S=0,++d;d<p;++S,++d)y.points=[],_={width:0,height:0,edgeLabel:y,edgeObj:u,rank:d},N=n.addDummyNode(l,"edge",_,"_d"),d===x&&(_.width=y.width,_.height=y.height,_.dummy="edge-label",_.labelpos=y.labelpos),l.setEdge(c,N,{weight:y.weight},m),S===0&&l.graph().dummyChains.push(N),c=N;l.setEdge(c,h,{weight:y.weight},m)}}function o(l){e.forEach(l.graph().dummyChains,function(u){var c=l.node(u),d=c.edgeLabel,h;for(l.setEdge(c.edgeObj,d);c.dummy;)h=l.successors(u)[0],l.removeNode(u),d.points.push({x:c.x,y:c.y}),c.dummy==="edge-label"&&(d.x=c.x,d.y=c.y,d.width=c.width,d.height=c.height),u=h,c=l.node(u)})}return Qm}var Zm,tk;function $l(){if(tk)return Zm;tk=1;var e=at();Zm={longestPath:n,slack:i};function n(s){var o={};function l(u){var c=s.node(u);if(e.has(o,u))return c.rank;o[u]=!0;var d=e.min(e.map(s.outEdges(u),function(h){return l(h.w)-s.edge(h).minlen}));return(d===Number.POSITIVE_INFINITY||d===void 0||d===null)&&(d=0),c.rank=d}e.forEach(s.sources(),l)}function i(s,o){return s.node(o.w).rank-s.node(o.v).rank-s.edge(o).minlen}return Zm}var Jm,nk;function cC(){if(nk)return Jm;nk=1;var e=at(),n=Zn().Graph,i=$l().slack;Jm=s;function s(c){var d=new n({directed:!1}),h=c.nodes()[0],p=c.nodeCount();d.setNode(h,{});for(var m,y;o(d,c)<p;)m=l(d,c),y=d.hasNode(m.v)?i(c,m):-i(c,m),u(d,c,y);return d}function o(c,d){function h(p){e.forEach(d.nodeEdges(p),function(m){var y=m.v,x=p===y?m.w:y;!c.hasNode(x)&&!i(d,m)&&(c.setNode(x,{}),c.setEdge(p,x,{}),h(x))})}return e.forEach(c.nodes(),h),c.nodeCount()}function l(c,d){return e.minBy(d.edges(),function(h){if(c.hasNode(h.v)!==c.hasNode(h.w))return i(d,h)})}function u(c,d,h){e.forEach(c.nodes(),function(p){d.node(p).rank+=h})}return Jm}var eg,rk;function AL(){if(rk)return eg;rk=1;var e=at(),n=cC(),i=$l().slack,s=$l().longestPath,o=Zn().alg.preorder,l=Zn().alg.postorder,u=hn().simplify;eg=c,c.initLowLimValues=m,c.initCutValues=d,c.calcCutValue=p,c.leaveEdge=x,c.enterEdge=N,c.exchangeEdges=_;function c(E){E=u(E),s(E);var C=n(E);m(C),d(C,E);for(var I,P;I=x(C);)P=N(C,E,I),_(C,E,I,P)}function d(E,C){var I=l(E,E.nodes());I=I.slice(0,I.length-1),e.forEach(I,function(P){h(E,C,P)})}function h(E,C,I){var P=E.node(I),L=P.parent;E.edge(I,L).cutvalue=p(E,C,I)}function p(E,C,I){var P=E.node(I),L=P.parent,O=!0,R=C.edge(I,L),q=0;return R||(O=!1,R=C.edge(L,I)),q=R.weight,e.forEach(C.nodeEdges(I),function(F){var J=F.v===I,Q=J?F.w:F.v;if(Q!==L){var A=J===O,V=C.edge(F).weight;if(q+=A?V:-V,b(E,I,Q)){var B=E.edge(I,Q).cutvalue;q+=A?-B:B}}}),q}function m(E,C){arguments.length<2&&(C=E.nodes()[0]),y(E,{},1,C)}function y(E,C,I,P,L){var O=I,R=E.node(P);return C[P]=!0,e.forEach(E.neighbors(P),function(q){e.has(C,q)||(I=y(E,C,I,q,P))}),R.low=O,R.lim=I++,L?R.parent=L:delete R.parent,I}function x(E){return e.find(E.edges(),function(C){return E.edge(C).cutvalue<0})}function N(E,C,I){var P=I.v,L=I.w;C.hasEdge(P,L)||(P=I.w,L=I.v);var O=E.node(P),R=E.node(L),q=O,F=!1;O.lim>R.lim&&(q=R,F=!0);var J=e.filter(C.edges(),function(Q){return F===k(E,E.node(Q.v),q)&&F!==k(E,E.node(Q.w),q)});return e.minBy(J,function(Q){return i(C,Q)})}function _(E,C,I,P){var L=I.v,O=I.w;E.removeEdge(L,O),E.setEdge(P.v,P.w,{}),m(E),d(E,C),S(E,C)}function S(E,C){var I=e.find(E.nodes(),function(L){return!C.node(L).parent}),P=o(E,I);P=P.slice(1),e.forEach(P,function(L){var O=E.node(L).parent,R=C.edge(L,O),q=!1;R||(R=C.edge(O,L),q=!0),C.node(L).rank=C.node(O).rank+(q?R.minlen:-R.minlen)})}function b(E,C,I){return E.hasEdge(C,I)}function k(E,C,I){return I.low<=C.lim&&C.lim<=I.lim}return eg}var tg,ik;function IL(){if(ik)return tg;ik=1;var e=$l(),n=e.longestPath,i=cC(),s=AL();tg=o;function o(d){switch(d.graph().ranker){case"network-simplex":c(d);break;case"tight-tree":u(d);break;case"longest-path":l(d);break;default:c(d)}}var l=n;function u(d){n(d),i(d)}function c(d){s(d)}return tg}var ng,sk;function ML(){if(sk)return ng;sk=1;var e=at();ng=n;function n(o){var l=s(o);e.forEach(o.graph().dummyChains,function(u){for(var c=o.node(u),d=c.edgeObj,h=i(o,l,d.v,d.w),p=h.path,m=h.lca,y=0,x=p[y],N=!0;u!==d.w;){if(c=o.node(u),N){for(;(x=p[y])!==m&&o.node(x).maxRank<c.rank;)y++;x===m&&(N=!1)}if(!N){for(;y<p.length-1&&o.node(x=p[y+1]).minRank<=c.rank;)y++;x=p[y]}o.setParent(u,x),u=o.successors(u)[0]}})}function i(o,l,u,c){var d=[],h=[],p=Math.min(l[u].low,l[c].low),m=Math.max(l[u].lim,l[c].lim),y,x;y=u;do y=o.parent(y),d.push(y);while(y&&(l[y].low>p||m>l[y].lim));for(x=y,y=c;(y=o.parent(y))!==x;)h.push(y);return{path:d.concat(h.reverse()),lca:x}}function s(o){var l={},u=0;function c(d){var h=u;e.forEach(o.children(d),c),l[d]={low:h,lim:u++}}return e.forEach(o.children(),c),l}return ng}var rg,ok;function PL(){if(ok)return rg;ok=1;var e=at(),n=hn();rg={run:i,cleanup:u};function i(c){var d=n.addDummyNode(c,"root",{},"_root"),h=o(c),p=e.max(e.values(h))-1,m=2*p+1;c.graph().nestingRoot=d,e.forEach(c.edges(),function(x){c.edge(x).minlen*=m});var y=l(c)+1;e.forEach(c.children(),function(x){s(c,d,m,y,p,h,x)}),c.graph().nodeRankFactor=m}function s(c,d,h,p,m,y,x){var N=c.children(x);if(!N.length){x!==d&&c.setEdge(d,x,{weight:0,minlen:h});return}var _=n.addBorderNode(c,"_bt"),S=n.addBorderNode(c,"_bb"),b=c.node(x);c.setParent(_,x),b.borderTop=_,c.setParent(S,x),b.borderBottom=S,e.forEach(N,function(k){s(c,d,h,p,m,y,k);var E=c.node(k),C=E.borderTop?E.borderTop:k,I=E.borderBottom?E.borderBottom:k,P=E.borderTop?p:2*p,L=C!==I?1:m-y[x]+1;c.setEdge(_,C,{weight:P,minlen:L,nestingEdge:!0}),c.setEdge(I,S,{weight:P,minlen:L,nestingEdge:!0})}),c.parent(x)||c.setEdge(d,_,{weight:0,minlen:m+y[x]})}function o(c){var d={};function h(p,m){var y=c.children(p);y&&y.length&&e.forEach(y,function(x){h(x,m+1)}),d[p]=m}return e.forEach(c.children(),function(p){h(p,1)}),d}function l(c){return e.reduce(c.edges(),function(d,h){return d+c.edge(h).weight},0)}function u(c){var d=c.graph();c.removeNode(d.nestingRoot),delete d.nestingRoot,e.forEach(c.edges(),function(h){var p=c.edge(h);p.nestingEdge&&c.removeEdge(h)})}return rg}var ig,ak;function OL(){if(ak)return ig;ak=1;var e=at(),n=hn();ig=i;function i(o){function l(u){var c=o.children(u),d=o.node(u);if(c.length&&e.forEach(c,l),e.has(d,"minRank")){d.borderLeft=[],d.borderRight=[];for(var h=d.minRank,p=d.maxRank+1;h<p;++h)s(o,"borderLeft","_bl",u,d,h),s(o,"borderRight","_br",u,d,h)}}e.forEach(o.children(),l)}function s(o,l,u,c,d,h){var p={width:0,height:0,rank:h,borderType:l},m=d[l][h-1],y=n.addDummyNode(o,"border",p,u);d[l][h]=y,o.setParent(y,c),m&&o.setEdge(m,y,{weight:1})}return ig}var sg,lk;function qL(){if(lk)return sg;lk=1;var e=at();sg={adjust:n,undo:i};function n(h){var p=h.graph().rankdir.toLowerCase();(p==="lr"||p==="rl")&&s(h)}function i(h){var p=h.graph().rankdir.toLowerCase();(p==="bt"||p==="rl")&&l(h),(p==="lr"||p==="rl")&&(c(h),s(h))}function s(h){e.forEach(h.nodes(),function(p){o(h.node(p))}),e.forEach(h.edges(),function(p){o(h.edge(p))})}function o(h){var p=h.width;h.width=h.height,h.height=p}function l(h){e.forEach(h.nodes(),function(p){u(h.node(p))}),e.forEach(h.edges(),function(p){var m=h.edge(p);e.forEach(m.points,u),e.has(m,"y")&&u(m)})}function u(h){h.y=-h.y}function c(h){e.forEach(h.nodes(),function(p){d(h.node(p))}),e.forEach(h.edges(),function(p){var m=h.edge(p);e.forEach(m.points,d),e.has(m,"x")&&d(m)})}function d(h){var p=h.x;h.x=h.y,h.y=p}return sg}var og,uk;function LL(){if(uk)return og;uk=1;var e=at();og=n;function n(i){var s={},o=e.filter(i.nodes(),function(h){return!i.children(h).length}),l=e.max(e.map(o,function(h){return i.node(h).rank})),u=e.map(e.range(l+1),function(){return[]});function c(h){if(!e.has(s,h)){s[h]=!0;var p=i.node(h);u[p.rank].push(h),e.forEach(i.successors(h),c)}}var d=e.sortBy(o,function(h){return i.node(h).rank});return e.forEach(d,c),u}return og}var ag,ck;function $L(){if(ck)return ag;ck=1;var e=at();ag=n;function n(s,o){for(var l=0,u=1;u<o.length;++u)l+=i(s,o[u-1],o[u]);return l}function i(s,o,l){for(var u=e.zipObject(l,e.map(l,function(y,x){return x})),c=e.flatten(e.map(o,function(y){return e.sortBy(e.map(s.outEdges(y),function(x){return{pos:u[x.w],weight:s.edge(x).weight}}),"pos")}),!0),d=1;d<l.length;)d<<=1;var h=2*d-1;d-=1;var p=e.map(new Array(h),function(){return 0}),m=0;return e.forEach(c.forEach(function(y){var x=y.pos+d;p[x]+=y.weight;for(var N=0;x>0;)x%2&&(N+=p[x+1]),x=x-1>>1,p[x]+=y.weight;m+=y.weight*N})),m}return ag}var lg,fk;function DL(){if(fk)return lg;fk=1;var e=at();lg=n;function n(i,s){return e.map(s,function(o){var l=i.inEdges(o);if(l.length){var u=e.reduce(l,function(c,d){var h=i.edge(d),p=i.node(d.v);return{sum:c.sum+h.weight*p.order,weight:c.weight+h.weight}},{sum:0,weight:0});return{v:o,barycenter:u.sum/u.weight,weight:u.weight}}else return{v:o}})}return lg}var ug,dk;function FL(){if(dk)return ug;dk=1;var e=at();ug=n;function n(o,l){var u={};e.forEach(o,function(d,h){var p=u[d.v]={indegree:0,in:[],out:[],vs:[d.v],i:h};e.isUndefined(d.barycenter)||(p.barycenter=d.barycenter,p.weight=d.weight)}),e.forEach(l.edges(),function(d){var h=u[d.v],p=u[d.w];!e.isUndefined(h)&&!e.isUndefined(p)&&(p.indegree++,h.out.push(u[d.w]))});var c=e.filter(u,function(d){return!d.indegree});return i(c)}function i(o){var l=[];function u(h){return function(p){p.merged||(e.isUndefined(p.barycenter)||e.isUndefined(h.barycenter)||p.barycenter>=h.barycenter)&&s(h,p)}}function c(h){return function(p){p.in.push(h),--p.indegree===0&&o.push(p)}}for(;o.length;){var d=o.pop();l.push(d),e.forEach(d.in.reverse(),u(d)),e.forEach(d.out,c(d))}return e.map(e.filter(l,function(h){return!h.merged}),function(h){return e.pick(h,["vs","i","barycenter","weight"])})}function s(o,l){var u=0,c=0;o.weight&&(u+=o.barycenter*o.weight,c+=o.weight),l.weight&&(u+=l.barycenter*l.weight,c+=l.weight),o.vs=l.vs.concat(o.vs),o.barycenter=u/c,o.weight=c,o.i=Math.min(l.i,o.i),l.merged=!0}return ug}var cg,hk;function zL(){if(hk)return cg;hk=1;var e=at(),n=hn();cg=i;function i(l,u){var c=n.partition(l,function(_){return e.has(_,"barycenter")}),d=c.lhs,h=e.sortBy(c.rhs,function(_){return-_.i}),p=[],m=0,y=0,x=0;d.sort(o(!!u)),x=s(p,h,x),e.forEach(d,function(_){x+=_.vs.length,p.push(_.vs),m+=_.barycenter*_.weight,y+=_.weight,x=s(p,h,x)});var N={vs:e.flatten(p,!0)};return y&&(N.barycenter=m/y,N.weight=y),N}function s(l,u,c){for(var d;u.length&&(d=e.last(u)).i<=c;)u.pop(),l.push(d.vs),c++;return c}function o(l){return function(u,c){return u.barycenter<c.barycenter?-1:u.barycenter>c.barycenter?1:l?c.i-u.i:u.i-c.i}}return cg}var fg,pk;function BL(){if(pk)return fg;pk=1;var e=at(),n=DL(),i=FL(),s=zL();fg=o;function o(c,d,h,p){var m=c.children(d),y=c.node(d),x=y?y.borderLeft:void 0,N=y?y.borderRight:void 0,_={};x&&(m=e.filter(m,function(I){return I!==x&&I!==N}));var S=n(c,m);e.forEach(S,function(I){if(c.children(I.v).length){var P=o(c,I.v,h,p);_[I.v]=P,e.has(P,"barycenter")&&u(I,P)}});var b=i(S,h);l(b,_);var k=s(b,p);if(x&&(k.vs=e.flatten([x,k.vs,N],!0),c.predecessors(x).length)){var E=c.node(c.predecessors(x)[0]),C=c.node(c.predecessors(N)[0]);e.has(k,"barycenter")||(k.barycenter=0,k.weight=0),k.barycenter=(k.barycenter*k.weight+E.order+C.order)/(k.weight+2),k.weight+=2}return k}function l(c,d){e.forEach(c,function(h){h.vs=e.flatten(h.vs.map(function(p){return d[p]?d[p].vs:p}),!0)})}function u(c,d){e.isUndefined(c.barycenter)?(c.barycenter=d.barycenter,c.weight=d.weight):(c.barycenter=(c.barycenter*c.weight+d.barycenter*d.weight)/(c.weight+d.weight),c.weight+=d.weight)}return fg}var dg,mk;function UL(){if(mk)return dg;mk=1;var e=at(),n=Zn().Graph;dg=i;function i(o,l,u){var c=s(o),d=new n({compound:!0}).setGraph({root:c}).setDefaultNodeLabel(function(h){return o.node(h)});return e.forEach(o.nodes(),function(h){var p=o.node(h),m=o.parent(h);(p.rank===l||p.minRank<=l&&l<=p.maxRank)&&(d.setNode(h),d.setParent(h,m||c),e.forEach(o[u](h),function(y){var x=y.v===h?y.w:y.v,N=d.edge(x,h),_=e.isUndefined(N)?0:N.weight;d.setEdge(x,h,{weight:o.edge(y).weight+_})}),e.has(p,"minRank")&&d.setNode(h,{borderLeft:p.borderLeft[l],borderRight:p.borderRight[l]}))}),d}function s(o){for(var l;o.hasNode(l=e.uniqueId("_root")););return l}return dg}var hg,gk;function HL(){if(gk)return hg;gk=1;var e=at();hg=n;function n(i,s,o){var l={},u;e.forEach(o,function(c){for(var d=i.parent(c),h,p;d;){if(h=i.parent(d),h?(p=l[h],l[h]=d):(p=u,u=d),p&&p!==d){s.setEdge(p,d);return}d=h}})}return hg}var pg,vk;function VL(){if(vk)return pg;vk=1;var e=at(),n=LL(),i=$L(),s=BL(),o=UL(),l=HL(),u=Zn().Graph,c=hn();pg=d;function d(y){var x=c.maxRank(y),N=h(y,e.range(1,x+1),"inEdges"),_=h(y,e.range(x-1,-1,-1),"outEdges"),S=n(y);m(y,S);for(var b=Number.POSITIVE_INFINITY,k,E=0,C=0;C<4;++E,++C){p(E%2?N:_,E%4>=2),S=c.buildLayerMatrix(y);var I=i(y,S);I<b&&(C=0,k=e.cloneDeep(S),b=I)}m(y,k)}function h(y,x,N){return e.map(x,function(_){return o(y,_,N)})}function p(y,x){var N=new u;e.forEach(y,function(_){var S=_.graph().root,b=s(_,S,N,x);e.forEach(b.vs,function(k,E){_.node(k).order=E}),l(_,N,b.vs)})}function m(y,x){e.forEach(x,function(N){e.forEach(N,function(_,S){y.node(_).order=S})})}return pg}var mg,yk;function WL(){if(yk)return mg;yk=1;var e=at(),n=Zn().Graph,i=hn();mg={positionX:N,findType1Conflicts:s,findType2Conflicts:o,addConflict:u,hasConflict:c,verticalAlignment:d,horizontalCompaction:h,alignCoordinates:y,findSmallestWidthAlignment:m,balance:x};function s(b,k){var E={};function C(I,P){var L=0,O=0,R=I.length,q=e.last(P);return e.forEach(P,function(F,J){var Q=l(b,F),A=Q?b.node(Q).order:R;(Q||F===q)&&(e.forEach(P.slice(O,J+1),function(V){e.forEach(b.predecessors(V),function(B){var ne=b.node(B),X=ne.order;(X<L||A<X)&&!(ne.dummy&&b.node(V).dummy)&&u(E,B,V)})}),O=J+1,L=A)}),P}return e.reduce(k,C),E}function o(b,k){var E={};function C(P,L,O,R,q){var F;e.forEach(e.range(L,O),function(J){F=P[J],b.node(F).dummy&&e.forEach(b.predecessors(F),function(Q){var A=b.node(Q);A.dummy&&(A.order<R||A.order>q)&&u(E,Q,F)})})}function I(P,L){var O=-1,R,q=0;return e.forEach(L,function(F,J){if(b.node(F).dummy==="border"){var Q=b.predecessors(F);Q.length&&(R=b.node(Q[0]).order,C(L,q,J,O,R),q=J,O=R)}C(L,q,L.length,R,P.length)}),L}return e.reduce(k,I),E}function l(b,k){if(b.node(k).dummy)return e.find(b.predecessors(k),function(E){return b.node(E).dummy})}function u(b,k,E){if(k>E){var C=k;k=E,E=C}var I=b[k];I||(b[k]=I={}),I[E]=!0}function c(b,k,E){if(k>E){var C=k;k=E,E=C}return e.has(b[k],E)}function d(b,k,E,C){var I={},P={},L={};return e.forEach(k,function(O){e.forEach(O,function(R,q){I[R]=R,P[R]=R,L[R]=q})}),e.forEach(k,function(O){var R=-1;e.forEach(O,function(q){var F=C(q);if(F.length){F=e.sortBy(F,function(B){return L[B]});for(var J=(F.length-1)/2,Q=Math.floor(J),A=Math.ceil(J);Q<=A;++Q){var V=F[Q];P[q]===q&&R<L[V]&&!c(E,q,V)&&(P[V]=q,P[q]=I[q]=I[V],R=L[V])}}})}),{root:I,align:P}}function h(b,k,E,C,I){var P={},L=p(b,k,E,I),O=I?"borderLeft":"borderRight";function R(J,Q){for(var A=L.nodes(),V=A.pop(),B={};V;)B[V]?J(V):(B[V]=!0,A.push(V),A=A.concat(Q(V))),V=A.pop()}function q(J){P[J]=L.inEdges(J).reduce(function(Q,A){return Math.max(Q,P[A.v]+L.edge(A))},0)}function F(J){var Q=L.outEdges(J).reduce(function(V,B){return Math.min(V,P[B.w]-L.edge(B))},Number.POSITIVE_INFINITY),A=b.node(J);Q!==Number.POSITIVE_INFINITY&&A.borderType!==O&&(P[J]=Math.max(P[J],Q))}return R(q,L.predecessors.bind(L)),R(F,L.successors.bind(L)),e.forEach(C,function(J){P[J]=P[E[J]]}),P}function p(b,k,E,C){var I=new n,P=b.graph(),L=_(P.nodesep,P.edgesep,C);return e.forEach(k,function(O){var R;e.forEach(O,function(q){var F=E[q];if(I.setNode(F),R){var J=E[R],Q=I.edge(J,F);I.setEdge(J,F,Math.max(L(b,q,R),Q||0))}R=q})}),I}function m(b,k){return e.minBy(e.values(k),function(E){var C=Number.NEGATIVE_INFINITY,I=Number.POSITIVE_INFINITY;return e.forIn(E,function(P,L){var O=S(b,L)/2;C=Math.max(P+O,C),I=Math.min(P-O,I)}),C-I})}function y(b,k){var E=e.values(k),C=e.min(E),I=e.max(E);e.forEach(["u","d"],function(P){e.forEach(["l","r"],function(L){var O=P+L,R=b[O],q;if(R!==k){var F=e.values(R);q=L==="l"?C-e.min(F):I-e.max(F),q&&(b[O]=e.mapValues(R,function(J){return J+q}))}})})}function x(b,k){return e.mapValues(b.ul,function(E,C){if(k)return b[k.toLowerCase()][C];var I=e.sortBy(e.map(b,C));return(I[1]+I[2])/2})}function N(b){var k=i.buildLayerMatrix(b),E=e.merge(s(b,k),o(b,k)),C={},I;e.forEach(["u","d"],function(L){I=L==="u"?k:e.values(k).reverse(),e.forEach(["l","r"],function(O){O==="r"&&(I=e.map(I,function(J){return e.values(J).reverse()}));var R=(L==="u"?b.predecessors:b.successors).bind(b),q=d(b,I,E,R),F=h(b,I,q.root,q.align,O==="r");O==="r"&&(F=e.mapValues(F,function(J){return-J})),C[L+O]=F})});var P=m(b,C);return y(C,P),x(C,b.graph().align)}function _(b,k,E){return function(C,I,P){var L=C.node(I),O=C.node(P),R=0,q;if(R+=L.width/2,e.has(L,"labelpos"))switch(L.labelpos.toLowerCase()){case"l":q=-L.width/2;break;case"r":q=L.width/2;break}if(q&&(R+=E?q:-q),q=0,R+=(L.dummy?k:b)/2,R+=(O.dummy?k:b)/2,R+=O.width/2,e.has(O,"labelpos"))switch(O.labelpos.toLowerCase()){case"l":q=O.width/2;break;case"r":q=-O.width/2;break}return q&&(R+=E?q:-q),q=0,R}}function S(b,k){return b.node(k).width}return mg}var gg,wk;function GL(){if(wk)return gg;wk=1;var e=at(),n=hn(),i=WL().positionX;gg=s;function s(l){l=n.asNonCompoundGraph(l),o(l),e.forEach(i(l),function(u,c){l.node(c).x=u})}function o(l){var u=n.buildLayerMatrix(l),c=l.graph().ranksep,d=0;e.forEach(u,function(h){var p=e.max(e.map(h,function(m){return l.node(m).height}));e.forEach(h,function(m){l.node(m).y=d+p/2}),d+=p+c})}return gg}var vg,xk;function YL(){if(xk)return vg;xk=1;var e=at(),n=TL(),i=jL(),s=IL(),o=hn().normalizeRanks,l=ML(),u=hn().removeEmptyRanks,c=PL(),d=OL(),h=qL(),p=VL(),m=GL(),y=hn(),x=Zn().Graph;vg=N;function N(z,K){var ee=K&&K.debugTiming?y.time:y.notime;ee("layout",function(){var se=ee(" buildLayoutGraph",function(){return R(z)});ee(" runLayout",function(){_(se,ee)}),ee(" updateInputGraph",function(){S(z,se)})})}function _(z,K){K(" makeSpaceForEdgeLabels",function(){q(z)}),K(" removeSelfEdges",function(){$(z)}),K(" acyclic",function(){n.run(z)}),K(" nestingGraph.run",function(){c.run(z)}),K(" rank",function(){s(y.asNonCompoundGraph(z))}),K(" injectEdgeLabelProxies",function(){F(z)}),K(" removeEmptyRanks",function(){u(z)}),K(" nestingGraph.cleanup",function(){c.cleanup(z)}),K(" normalizeRanks",function(){o(z)}),K(" assignRankMinMax",function(){J(z)}),K(" removeEdgeLabelProxies",function(){Q(z)}),K(" normalize.run",function(){i.run(z)}),K(" parentDummyChains",function(){l(z)}),K(" addBorderSegments",function(){d(z)}),K(" order",function(){p(z)}),K(" insertSelfEdges",function(){G(z)}),K(" adjustCoordinateSystem",function(){h.adjust(z)}),K(" position",function(){m(z)}),K(" positionSelfEdges",function(){j(z)}),K(" removeBorderNodes",function(){X(z)}),K(" normalize.undo",function(){i.undo(z)}),K(" fixupEdgeLabelCoords",function(){B(z)}),K(" undoCoordinateSystem",function(){h.undo(z)}),K(" translateGraph",function(){A(z)}),K(" assignNodeIntersects",function(){V(z)}),K(" reversePoints",function(){ne(z)}),K(" acyclic.undo",function(){n.undo(z)})}function S(z,K){e.forEach(z.nodes(),function(ee){var se=z.node(ee),oe=K.node(ee);se&&(se.x=oe.x,se.y=oe.y,K.children(ee).length&&(se.width=oe.width,se.height=oe.height))}),e.forEach(z.edges(),function(ee){var se=z.edge(ee),oe=K.edge(ee);se.points=oe.points,e.has(oe,"x")&&(se.x=oe.x,se.y=oe.y)}),z.graph().width=K.graph().width,z.graph().height=K.graph().height}var b=["nodesep","edgesep","ranksep","marginx","marginy"],k={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},E=["acyclicer","ranker","rankdir","align"],C=["width","height"],I={width:0,height:0},P=["minlen","weight","width","height","labeloffset"],L={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},O=["labelpos"];function R(z){var K=new x({multigraph:!0,compound:!0}),ee=le(z.graph());return K.setGraph(e.merge({},k,U(ee,b),e.pick(ee,E))),e.forEach(z.nodes(),function(se){var oe=le(z.node(se));K.setNode(se,e.defaults(U(oe,C),I)),K.setParent(se,z.parent(se))}),e.forEach(z.edges(),function(se){var oe=le(z.edge(se));K.setEdge(se,e.merge({},L,U(oe,P),e.pick(oe,O)))}),K}function q(z){var K=z.graph();K.ranksep/=2,e.forEach(z.edges(),function(ee){var se=z.edge(ee);se.minlen*=2,se.labelpos.toLowerCase()!=="c"&&(K.rankdir==="TB"||K.rankdir==="BT"?se.width+=se.labeloffset:se.height+=se.labeloffset)})}function F(z){e.forEach(z.edges(),function(K){var ee=z.edge(K);if(ee.width&&ee.height){var se=z.node(K.v),oe=z.node(K.w),pe={rank:(oe.rank-se.rank)/2+se.rank,e:K};y.addDummyNode(z,"edge-proxy",pe,"_ep")}})}function J(z){var K=0;e.forEach(z.nodes(),function(ee){var se=z.node(ee);se.borderTop&&(se.minRank=z.node(se.borderTop).rank,se.maxRank=z.node(se.borderBottom).rank,K=e.max(K,se.maxRank))}),z.graph().maxRank=K}function Q(z){e.forEach(z.nodes(),function(K){var ee=z.node(K);ee.dummy==="edge-proxy"&&(z.edge(ee.e).labelRank=ee.rank,z.removeNode(K))})}function A(z){var K=Number.POSITIVE_INFINITY,ee=0,se=Number.POSITIVE_INFINITY,oe=0,pe=z.graph(),ge=pe.marginx||0,Ae=pe.marginy||0;function Oe(Ie){var Me=Ie.x,ke=Ie.y,He=Ie.width,ve=Ie.height;K=Math.min(K,Me-He/2),ee=Math.max(ee,Me+He/2),se=Math.min(se,ke-ve/2),oe=Math.max(oe,ke+ve/2)}e.forEach(z.nodes(),function(Ie){Oe(z.node(Ie))}),e.forEach(z.edges(),function(Ie){var Me=z.edge(Ie);e.has(Me,"x")&&Oe(Me)}),K-=ge,se-=Ae,e.forEach(z.nodes(),function(Ie){var Me=z.node(Ie);Me.x-=K,Me.y-=se}),e.forEach(z.edges(),function(Ie){var Me=z.edge(Ie);e.forEach(Me.points,function(ke){ke.x-=K,ke.y-=se}),e.has(Me,"x")&&(Me.x-=K),e.has(Me,"y")&&(Me.y-=se)}),pe.width=ee-K+ge,pe.height=oe-se+Ae}function V(z){e.forEach(z.edges(),function(K){var ee=z.edge(K),se=z.node(K.v),oe=z.node(K.w),pe,ge;ee.points?(pe=ee.points[0],ge=ee.points[ee.points.length-1]):(ee.points=[],pe=oe,ge=se),ee.points.unshift(y.intersectRect(se,pe)),ee.points.push(y.intersectRect(oe,ge))})}function B(z){e.forEach(z.edges(),function(K){var ee=z.edge(K);if(e.has(ee,"x"))switch((ee.labelpos==="l"||ee.labelpos==="r")&&(ee.width-=ee.labeloffset),ee.labelpos){case"l":ee.x-=ee.width/2+ee.labeloffset;break;case"r":ee.x+=ee.width/2+ee.labeloffset;break}})}function ne(z){e.forEach(z.edges(),function(K){var ee=z.edge(K);ee.reversed&&ee.points.reverse()})}function X(z){e.forEach(z.nodes(),function(K){if(z.children(K).length){var ee=z.node(K),se=z.node(ee.borderTop),oe=z.node(ee.borderBottom),pe=z.node(e.last(ee.borderLeft)),ge=z.node(e.last(ee.borderRight));ee.width=Math.abs(ge.x-pe.x),ee.height=Math.abs(oe.y-se.y),ee.x=pe.x+ee.width/2,ee.y=se.y+ee.height/2}}),e.forEach(z.nodes(),function(K){z.node(K).dummy==="border"&&z.removeNode(K)})}function $(z){e.forEach(z.edges(),function(K){if(K.v===K.w){var ee=z.node(K.v);ee.selfEdges||(ee.selfEdges=[]),ee.selfEdges.push({e:K,label:z.edge(K)}),z.removeEdge(K)}})}function G(z){var K=y.buildLayerMatrix(z);e.forEach(K,function(ee){var se=0;e.forEach(ee,function(oe,pe){var ge=z.node(oe);ge.order=pe+se,e.forEach(ge.selfEdges,function(Ae){y.addDummyNode(z,"selfedge",{width:Ae.label.width,height:Ae.label.height,rank:ge.rank,order:pe+ ++se,e:Ae.e,label:Ae.label},"_se")}),delete ge.selfEdges})})}function j(z){e.forEach(z.nodes(),function(K){var ee=z.node(K);if(ee.dummy==="selfedge"){var se=z.node(ee.e.v),oe=se.x+se.width/2,pe=se.y,ge=ee.x-oe,Ae=se.height/2;z.setEdge(ee.e,ee.label),z.removeNode(K),ee.label.points=[{x:oe+2*ge/3,y:pe-Ae},{x:oe+5*ge/6,y:pe-Ae},{x:oe+ge,y:pe},{x:oe+5*ge/6,y:pe+Ae},{x:oe+2*ge/3,y:pe+Ae}],ee.label.x=ee.x,ee.label.y=ee.y}})}function U(z,K){return e.mapValues(e.pick(z,K),Number)}function le(z){var K={};return e.forEach(z,function(ee,se){K[se.toLowerCase()]=ee}),K}return vg}var yg,_k;function KL(){if(_k)return yg;_k=1;var e=at(),n=hn(),i=Zn().Graph;yg={debugOrdering:s};function s(o){var l=n.buildLayerMatrix(o),u=new i({compound:!0,multigraph:!0}).setGraph({});return e.forEach(o.nodes(),function(c){u.setNode(c,{label:c}),u.setParent(c,"layer"+o.node(c).rank)}),e.forEach(o.edges(),function(c){u.setEdge(c.v,c.w,{},c.name)}),e.forEach(l,function(c,d){var h="layer"+d;u.setNode(h,{rank:"same"}),e.reduce(c,function(p,m){return u.setEdge(p,m,{style:"invis"}),m})}),u}return yg}var wg,Sk;function XL(){return Sk||(Sk=1,wg="0.8.5"),wg}var xg,bk;function QL(){return bk||(bk=1,xg={graphlib:Zn(),layout:YL(),debug:KL(),util:{time:hn().time,notime:hn().notime},version:XL()}),xg}var ZL=QL();const kk=Hg(ZL),hi=240,Wi=130,Ds=74,uu=72,Ek=Ds+uu;function JL(e){let n=hi;for(const i of e.values())n=Math.max(n,i.width);return n}const e$=420,t$=2;function cu(e){var i;return((i=e.data)==null?void 0:i.sessionId)??"_default"}function n$(e,n,i,s,o){const l=new kk.graphlib.Graph;l.setDefaultEdgeLabel(()=>({})),l.setGraph({rankdir:i,marginx:0,marginy:0,nodesep:70,ranksep:160,edgesep:30});const u=e.filter(_=>!o.has(_)),c=new Set(u);for(const _ of u){const S=s.get(_);l.setNode(_,{width:(S==null?void 0:S.width)??hi,height:(S==null?void 0:S.height)??Wi})}for(const _ of n)c.has(_.source)&&c.has(_.target)&&l.setEdge(_.source,_.target);kk.layout(l);const d=new Map;let h=1/0,p=1/0,m=-1/0,y=-1/0;for(const _ of u){const S=l.node(_);if(!S)continue;const b=s.get(_),k=(b==null?void 0:b.width)??hi,E=(b==null?void 0:b.height)??Wi,C=S.x-k/2,I=S.y-E/2;d.set(_,{x:C,y:I}),C<h&&(h=C),I<p&&(p=I),C+k>m&&(m=C+k),I+E>y&&(y=I+E)}if(Number.isFinite(h)&&Number.isFinite(p))for(const[_,S]of d)d.set(_,{x:S.x-h,y:S.y-p});let x=Number.isFinite(m)?m-h:0,N=Number.isFinite(y)?y-p:0;for(const _ of e){const S=o.get(_);if(!S)continue;const b=s.get(_);x=Math.max(x,S.x+((b==null?void 0:b.width)??hi)),N=Math.max(N,S.y+((b==null?void 0:b.height)??Wi))}return{positions:d,width:x,height:N}}function r$(e,n,i={}){const s=i.direction??"LR",o=i.pinned??new Map,l=i.measured??new Map,u=new Map;for(const S of e){const b=cu(S),k=u.get(b);k?k.push(S.id):u.set(b,[S.id])}const d=Array.from(u.keys()).sort().map(S=>({sid:S,...n$(u.get(S),n,s,l,o)})),h=JL(l),p=i.availableHeight&&i.availableHeight>0?i.availableHeight:Number.POSITIVE_INFINITY,m=S=>{const b=[[]];let k=0;for(const E of d)b.length<S&&k>0&&k+E.height>p&&(b.push([]),k=0),b[b.length-1].push(E),k+=E.height+Ek;return b},y=S=>S.reduce((b,k)=>Math.max(b,k.width),0)+e$;let x=m(i.availableWidth?t$:1);x.length>1&&x.reduce((b,k)=>b+y(k),0)+h*(x.length-1)>(i.availableWidth??0)&&(x=m(1));const N=new Map;let _=0;for(const S of x){let b=0;for(const{positions:k,height:E}of S){for(const[C,I]of k)N.set(C,{x:I.x+_,y:I.y+b});b+=E+Ek}_+=y(S)+h}return e.map(S=>{const b=o.get(S.id);if(b)return{...S,position:b};const k=N.get(S.id);return k?{...S,position:k}:S})}function i$(e,n,i,s){const l=Ds+uu,u=60,c=y=>{const x=s.get(y);return{w:(x==null?void 0:x.width)??hi,h:(x==null?void 0:x.height)??Wi}},d=new Map(e.map(y=>[y.id,cu(y)])),h=[],p=e.map(y=>({id:y.id,pos:i.get(y.id)??n.get(y.id)})).filter(y=>y.pos!=null).sort((y,x)=>y.pos.y-x.pos.y||y.pos.x-x.pos.x||y.id.localeCompare(x.id)),m=[];for(const{id:y,pos:x}of p){const{w:N,h:_}=c(y),S=d.get(y)??"_default";if(i.has(y)){h.push({x:x.x,y:x.y,w:N,h:_,sid:S});continue}let b=x.y;for(let k=0;k<h.length+1;k++){const E=h.find(C=>{const I=C.sid===S?24:u,P=C.sid===S?24:l;return x.x<C.x+C.w+I&&C.x<x.x+N+I&&b<C.y+C.h+P&&C.y<b+_+P});if(!E)break;b=E.y+E.h+(E.sid===S?24:l)}b!==x.y&&(n.set(y,{x:x.x,y:b}),m.push(y)),h.push({x:x.x,y:b,w:N,h:_,sid:S})}return m}function s$(e,n,i,s,o){const l=y=>{const x=s.get(y);return{w:(x==null?void 0:x.width)??hi,h:(x==null?void 0:x.height)??Wi}},u=y=>i.get(y)??n.get(y),c=new Map,d=[];for(const y of e){const x=u(y.id);if(!x)continue;const{w:N,h:_}=l(y.id);if(o.has(y.id)&&!i.has(y.id)){const S=cu(y);(c.get(S)??c.set(S,[]).get(S)).push(y)}else d.push({x:x.x,y:x.y,w:N,h:_})}if(c.size===0)return[];const h=Ds+uu,p=(y,x,N,_)=>d.some(S=>y<S.x+S.w+Ds&&S.x<y+N+Ds&&x<S.y+S.h+h&&S.y<x+_+h),m=[];for(const y of[...c.keys()].sort()){const x=c.get(y);let N=1/0,_=1/0,S=-1/0,b=-1/0;for(const O of x){const R=u(O.id),{w:q,h:F}=l(O.id);N=Math.min(N,R.x),_=Math.min(_,R.y),S=Math.max(S,R.x+q),b=Math.max(b,R.y+F)}const k=S-N,E=b-_,C=[...new Set(d.map(O=>Math.round(O.x)))].sort((O,R)=>O-R),I=C.length?C:[N],P=[0,...d.map(O=>O.y+O.h+h)].sort((O,R)=>O-R);let L=null;e:for(const O of I)for(const R of P){if(R>=_)break;if(!p(O,R,k,E)){L={x:O,y:R};break e}}if(L){const O=L.x-N,R=L.y-_;for(const q of x){const F=u(q.id);n.set(q.id,{x:F.x+O,y:F.y+R})}m.push(y)}for(const O of x){const R=u(O.id),{w:q,h:F}=l(O.id);d.push({x:R.x,y:R.y,w:q,h:F})}}return m}function o$(e,n,i,s,o,l=!1){const d=Ds+uu+1,h=8,p=1.75,m=200,y=.7,x=.01,N=R=>{const q=s.get(R);return{w:(q==null?void 0:q.width)??hi,h:(q==null?void 0:q.height)??Wi}},_=R=>i.get(R)??n.get(R),S=new Map;for(const R of e){if(!_(R.id))continue;const q=cu(R),F=S.get(q);F?F.push(R):S.set(q,[R])}const b=[],k=new Set,E=new Set,C=o.size===0;for(const R of[...S.keys()].sort()){const q=S.get(R);let F=1/0,J=1/0,Q=-1/0,A=-1/0,V=!1;for(const $ of q){const G=_($.id),{w:j,h:U}=N($.id);F=Math.min(F,G.x),J=Math.min(J,G.y),Q=Math.max(Q,G.x+j),A=Math.max(A,G.y+U),i.has($.id)&&(V=!0)}const B=Q-F,ne=A-J;E.add(R);const X=o.get(R);X&&(B>X.w+h||ne>X.h+h)&&k.add(R),o.set(R,{w:B,h:ne}),b.push({sid:R,members:q.map($=>$.id),x:F,y:J,w:B,h:ne,anchored:V,mass:1})}for(const R of[...o.keys()])E.has(R)||o.delete(R);if(l||C)return[];let I=!1;for(let R=0;R<b.length&&!I;R++)for(let q=R+1;q<b.length;q++){const F=b[R],J=b[q];if(!(F.anchored&&J.anchored)&&Math.abs(F.x+F.w/2-(J.x+J.w/2))<(F.w+J.w)/2+61&&Math.abs(F.y+F.h/2-(J.y+J.h/2))<(F.h+J.h)/2+d){I=!0;break}}if(k.size===0&&!I)return[];if(k.size>0)for(const R of b)k.has(R.sid)&&(R.mass=8);else for(const R of b)R.mass=Math.max(1,R.w*R.h/(hi*Wi));const P=new Map(b.map(R=>[R.sid,R.x])),L=new Map(b.map(R=>[R.sid,R.y]));for(let R=0;R<m;R++){const q=new Map,F=new Map;let J=0;for(let Q=0;Q<b.length;Q++)for(let A=Q+1;A<b.length;A++){const V=b[Q],B=b[A];if(V.anchored&&B.anchored)continue;const ne=V.x+V.w/2,X=V.y+V.h/2,$=B.x+B.w/2,G=B.y+B.h/2,j=(V.w+B.w)/2+61-Math.abs(ne-$),U=(V.h+B.h)/2+d-Math.abs(X-G);if(j<=0||U<=0)continue;const le=(We,$e)=>!We.anchored&&!($e<0&&We.x<=0),z=(We,$e)=>!We.anchored&&!($e<0&&We.y<=0),K=(We,$e,Ke)=>{const yt=We===$e,et=yt?V.sid<B.sid?-1:1:Math.sign(We-$e);return Ke(V,et)||Ke(B,-et)?et:yt&&(Ke(V,-et)||Ke(B,et))?-et:0},ee=K(ne,$,le),se=K(X,G,z),oe=ee!==0,pe=se!==0;if(!oe&&!pe)continue;const ge=oe&&(!pe||j*p<U),[Ae,Oe,Ie,Me]=ge?[ee,j,q,le]:[se,U,F,z],ke=Me(V,Ae),He=Me(B,-Ae),ve=V.mass,ye=B.mass,Ve=ke?He?ye/(ve+ye):1:0,dt=He?ke?ve/(ve+ye):1:0,Qe=Oe*y;Ie.set(V.sid,(Ie.get(V.sid)??0)+Ae*Qe*Ve),Ie.set(B.sid,(Ie.get(B.sid)??0)-Ae*Qe*dt),J+=Qe}for(const Q of b)Q.anchored||(Q.x=Math.max(0,Q.x+(q.get(Q.sid)??0)),Q.y=Math.max(0,Q.y+(F.get(Q.sid)??0)));if(J<x)break}const O=[];for(const R of b){const q=R.x-P.get(R.sid),F=R.y-L.get(R.sid);if(!(Math.abs(q)<1&&Math.abs(F)<1)){for(const J of R.members){if(i.has(J))continue;const Q=n.get(J);Q&&n.set(J,{x:Q.x+q,y:Q.y+F})}O.push(R.sid)}}return O}const a$=600;function zg(e,n){return!(e.exitAt!=null&&n-e.exitAt>a$||e.kind==="root"&&e.state==="done"&&e.tools.length===0&&e.endedAt!=null&&e.endedAt-e.startedAt<3e3)}function l$(e,n){const i=new Set;for(const s of e.agents.values())zg(s,n)&&i.add(s.id);return i}function Fi(e){return typeof window>"u"?"":getComputedStyle(document.documentElement).getPropertyValue(e).trim()||""}function u$(e){return e<1e3?`${e}`:e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(2)}M`}const c$={agent:SP,sessionGroup:MP},f$=420,Sl=18,d$=9e4,h$=200,p$=5*6e4,m$=6,g$=2*6e4,Tv="agent-dag.layout",jv="agent-dag.viewport",fC="agent-dag.summariesDismissed",dC="agent-dag.sessionListOpen",hC="agent-dag.detailOpen",pC="agent-dag.usagePanelOpen",Nk="agent-dag.accountsPanelOpen",Ck="agent-dag.versionNoticeDismissed",v$={git_checkout:"this deck runs from a git checkout — pull instead",npx:"npx runs from a cache that cannot be upgraded in place",not_writable:"the install directory is not writable by this user",opted_out:"installs are off (AGENTS_DECK_NO_INSTALL=1)"},Rk="agent-dag.autoRestart",Tk="agent-dag.bundleReloadedFor";function y$(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(dC)==="1"}catch{return!1}}function w$(e){if(!(typeof window>"u"))try{window.localStorage.setItem(dC,e?"1":"0")}catch{}}function x$(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(hC)==="1"}catch{return!1}}function _$(e){if(!(typeof window>"u"))try{window.localStorage.setItem(hC,e?"1":"0")}catch{}}function S$(){if(typeof window>"u")return!0;const e=window.localStorage.getItem(pC);try{return e===null?!0:e==="1"}catch{return!0}}function b$(e){if(!(typeof window>"u"))try{window.localStorage.setItem(pC,e?"1":"0")}catch{}}function k$(){if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(fC);if(!e)return new Set;const n=JSON.parse(e);return new Set(Array.isArray(n)?n.filter(i=>typeof i=="string"):[])}catch{return new Set}}function jk(e){if(!(typeof window>"u"))try{const n=Array.from(e),i=n.length>200?n.slice(-200):n;window.localStorage.setItem(fC,JSON.stringify(i))}catch{}}function E$(){const e={positions:[],pins:[]};if(typeof window>"u")return e;try{const n=window.localStorage.getItem(Tv);if(!n)return e;const i=JSON.parse(n);if(!("v"in i)){const o=Object.entries(i).filter(([,l])=>l&&typeof l.x=="number"&&typeof l.y=="number");return{positions:o,pins:o.map(([l])=>l)}}return{positions:Object.entries(i.positions??{}).filter(([,o])=>o&&typeof o.x=="number"&&typeof o.y=="number"),pins:Array.isArray(i.pins)?i.pins:[]}}catch{return e}}function _g(e,n){if(!(typeof window>"u"))try{const i={};for(const[s,o]of e)i[s]=o;for(const[s,o]of n)i[s]=o;window.localStorage.setItem(Tv,JSON.stringify({v:2,positions:i,pins:Array.from(n.keys())}))}catch{}}function N$(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(jv);if(!e)return null;const n=JSON.parse(e);return typeof(n==null?void 0:n.x)!="number"||typeof(n==null?void 0:n.y)!="number"||typeof(n==null?void 0:n.zoom)!="number"?null:n}catch{return null}}function C$(e){if(!(typeof window>"u"))try{window.localStorage.setItem(jv,JSON.stringify(e))}catch{}}function Ak(){if(!(typeof window>"u")){try{window.localStorage.removeItem(Tv)}catch{}try{window.localStorage.removeItem(jv)}catch{}}}function R$(e,n){const i=e.agents.get(n);if(!i)return;const s=[];for(const p of e.agents.values())p.sessionId===n&&s.push(p);const o={schemaVersion:1,exportedAt:new Date().toISOString(),sessionId:n,label:i.label,cwd:i.cwd,startedAt:i.startedAt,endedAt:i.endedAt,model:i.model,agents:s.map(p=>({id:p.id,kind:p.kind,label:p.label,parentId:p.parentId,state:p.state,startedAt:p.startedAt,endedAt:p.endedAt,model:p.model,cwd:p.cwd,usage:p.usage,prompts:p.prompts,tools:p.tools.map(m=>({id:m.id,name:m.name,inputPreview:m.inputPreview,startedAt:m.startedAt,endedAt:m.endedAt,ok:m.ok,errorPreview:m.errorPreview,usage:m.usage}))}))},l=JSON.stringify(o,null,2),u=new Blob([l],{type:"application/json"}),c=URL.createObjectURL(u),d=document.createElement("a"),h=(i.label||"session").replace(/[^a-z0-9._-]/gi,"_");d.href=c,d.download=`agents-deck-${h}-${n.slice(0,8)}.json`,document.body.appendChild(d),d.click(),document.body.removeChild(d),setTimeout(()=>URL.revokeObjectURL(c),1e3)}const Bg={file:"📁",shell:"⚡",web:"🌐",agent:"🤖",task:"📋",plan:"🧭",mcp:"🔌",other:"✨"},Ug={file:"file",shell:"shell",web:"web",agent:"agent",task:"task",plan:"plan",mcp:"mcp",other:"other"},T$={Read:"file",Write:"file",Edit:"file",MultiEdit:"file",Glob:"file",Grep:"file",LS:"file",NotebookEdit:"file",Bash:"shell",PowerShell:"shell",shell:"shell",exec_command:"shell",shell_command:"shell",write_stdin:"shell",wait:"shell",apply_patch:"file",update_plan:"task",WebFetch:"web",WebSearch:"web",Task:"agent",Agent:"agent",TodoWrite:"task",TaskCreate:"task",TaskUpdate:"task",TaskList:"task",TaskGet:"task",TaskOutput:"task",TaskStop:"task",EnterPlanMode:"plan",ExitPlanMode:"plan",AskUserQuestion:"plan",Skill:"plan",Workflow:"plan"};function mC(e){return e.startsWith("mcp__")?"mcp":T$[e]??"other"}function gC(e,n){var s,o,l;if(!n)return!0;const i=n.toLowerCase();if(e.label.toLowerCase().includes(i)||(s=e.cwd)!=null&&s.toLowerCase().includes(i)||(o=e.cwdBasename)!=null&&o.toLowerCase().includes(i)||e.sessionId.toLowerCase().includes(i)||(l=e.firstPrompt)!=null&&l.toLowerCase().includes(i))return!0;for(const u of e.tools)if(u.name.toLowerCase().includes(i))return!0;return!1}function j$(e,n){if(!n)return null;const i=new Set([n]);let s=n;for(;s;){const l=e.agents.get(s);if(!(l!=null&&l.parentId)||i.has(l.parentId))break;i.add(l.parentId),s=l.parentId}let o=!0;for(;o;){o=!1;for(const l of e.agents.values())l.parentId&&i.has(l.parentId)&&!i.has(l.id)&&(i.add(l.id),o=!0)}return i}function A$(e,n,i,s,o,l,u,c,d,h,p,m,y,x,N,_,S,b){const k=[],E=[],C=new Set;if(l)for(const R of e.agents.values())gC(R,l)&&C.add(R.id);for(const R of e.agents.values()){if(!S.has(R.id))continue;const q=l?!C.has(R.id):!1,F=R.exitAt!=null,J=_!=null&&!_.has(R.id),Q=[q?"rf-dim":"",F?"rf-exiting":"",J?"rf-spotlit-out":""].filter(Boolean).join(" ")||void 0,A=u.get(R.id);if(k.push({id:R.id,type:"agent",position:{x:0,y:0},data:{...R,now:n,dim:q,onOpenContext:b},className:Q,...A?{width:A.width,height:A.height}:null}),R.parentId&&S.has(R.parentId)){const V=uv(R.sessionId),B=R.state==="active"?`hsl(${V} 80% 72%)`:`hsl(${V} 50% 55%)`,ne=l&&!C.has(R.id)&&!C.has(R.parentId),X=F,$=N.size>0&&(N.has(R.id)||N.has(R.parentId)),G=_!=null&&!_.has(R.id)&&!_.has(R.parentId),j=R.state==="active"?2:1.5,U=$?j+1.5:j,le=ne||X?.2:G?.12:1,z=[X?"rf-edge-exiting":"",$?"rf-edge-selected":""].filter(Boolean).join(" ")||void 0;E.push({id:`e:${R.parentId}->${R.id}`,source:R.parentId,target:R.id,animated:(R.state==="active"||$)&&!ne&&!X,type:"smoothstep",style:{stroke:B,strokeWidth:U,opacity:le,transition:"opacity 500ms ease, stroke-width 200ms ease"},className:z})}}const I=k.filter(R=>!o.has(R.id)&&!m.has(R.id));if(I.length>0||y!==x.current){if(I.length>0){const R=r$(k,E,{direction:"LR",pinned:o,measured:u,availableWidth:i,availableHeight:s});for(const q of R)m.has(q.id)||m.set(q.id,q.position);s$(k,m,o,u,new Set(I.map(q=>q.id)))}i$(k,m,o,u),x.current=y}const P=o$(k,m,o,u,c,!h||p);P.length>0&&d(P);for(const R of Array.from(m.keys()))e.agents.has(R)||m.delete(R);if(e.agents.size>0)for(const R of Array.from(o.keys()))e.agents.has(R)||o.delete(R);const L=[];let O=!1;for(const R of k){let q=o.get(R.id)??m.get(R.id);q||(q={x:0,y:0},m.set(R.id,q),O=!0),L.push({...R,position:q})}return O&&(x.current=""),{nodes:L,edges:E}}function I$(){return v.jsx(av,{children:v.jsx(M$,{})})}function M$(){var eo,Hr,ha,to;const e=ta(),n=M.useRef($g()),[,i]=M.useState(0),s=M.useCallback(()=>i(W=>W+1),[]),[o,l]=M.useState(()=>new Set),[u,c]=M.useState(null),[d,h]=M.useState(null),p=M.useCallback((W,Z)=>{l(ue=>{if(!Z)return new Set([W]);const de=new Set(ue);return de.has(W)?de.delete(W):de.add(W),de}),c(ue=>Z&&ue===W?ue:W)},[]),m=M.useCallback(()=>{l(new Set),c(null)},[]),[y,x]=M.useState(null),[N,_]=M.useState(null),S=M.useCallback(W=>_(W),[]),b=M.useRef(k$()),[k,E]=M.useState(y$);M.useEffect(()=>{w$(k)},[k]);const[C,I]=M.useState(x$);M.useEffect(()=>{_$(C)},[C]);const[P,L]=M.useState(S$);M.useEffect(()=>{b$(P)},[P]);const[O,R]=M.useState(()=>{try{const W=window.localStorage.getItem(Nk);return W===null?!0:W==="1"}catch{return!0}});M.useEffect(()=>{try{window.localStorage.setItem(Nk,O?"1":"0")}catch{}},[O]);const[q,F]=M.useState(null),[J,Q]=M.useState(!1),[A,V]=M.useState(0),[B,ne]=M.useState(0);M.useEffect(()=>{fetch("/api/sound-hook").then(W=>W.ok?W.json():null).then(W=>{W!=null&&W.ok&&(F(W.enabled===!0),V((W.foreign??[]).filter(Z=>Z.worksHere).length),ne(typeof W.parked=="number"?W.parked:0))}).catch(()=>{})},[]);const X=M.useCallback(async()=>{Q(!0);try{const Z=await(await fetch("/api/sound-hook",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:!q})})).json().catch(()=>null);Z!=null&&Z.ok&&F(Z.enabled===!0),fetch("/api/sound-hook").then(ue=>ue.ok?ue.json():null).then(ue=>{ue!=null&&ue.ok&&(V((ue.foreign??[]).filter(de=>de.worksHere).length),ne(typeof ue.parked=="number"?ue.parked:0))}).catch(()=>{})}catch{}finally{Q(!1)}},[q]),[$,G]=M.useState(!1),[j,U]=M.useState(null),[le,z]=M.useState(()=>{if(typeof window>"u")return"";try{return window.localStorage.getItem(Ck)??""}catch{return""}}),[K,ee]=M.useState(!1),se=M.useCallback(()=>{fetch("/api/version").then(W=>W.ok?W.json():null).then(W=>{W&&U(W)}).catch(()=>{})},[]);M.useEffect(()=>{se();const W=window.setInterval(se,5*6e4),Z=()=>{document.visibilityState==="visible"&&se()};return document.addEventListener("visibilitychange",Z),()=>{window.clearInterval(W),document.removeEventListener("visibilitychange",Z)}},[se]),M.useEffect(()=>{$&&se()},[$,se]);const oe=(j==null?void 0:j.notice)??null,pe=oe?`${oe.kind}:${oe.to}`:"",ge=oe!=null&&le!==pe,Ae=M.useCallback(()=>{if(!oe)return;const W=le===pe?"":pe;z(W);try{window.localStorage.setItem(Ck,W)}catch{}},[oe,pe,le]),Oe=((eo=j==null?void 0:j.upgrade)==null?void 0:eo.state)??"idle",Ie=M.useCallback(async()=>{try{await fetch("/api/upgrade",{method:"POST"})}catch{}se()},[se]);M.useEffect(()=>{if(Oe!=="running")return;const W=window.setInterval(se,3e3);return()=>window.clearInterval(W)},[Oe,se]);const Me=M.useCallback(async()=>{var ue;const W=j==null?void 0:j.command;if(!W)return;let Z=!1;try{Z=await Promise.race([((ue=navigator.clipboard)==null?void 0:ue.writeText(W).then(()=>!0))??Promise.resolve(!1),new Promise(de=>window.setTimeout(()=>de(!1),500))])}catch{Z=!1}if(!Z)try{const de=document.createElement("textarea");de.value=W,de.setAttribute("readonly",""),de.style.cssText="position:fixed;top:0;left:0;opacity:0",document.body.appendChild(de),de.select(),Z=document.execCommand("copy"),de.remove()}catch{Z=!1}Z&&(ee(!0),window.setTimeout(()=>ee(!1),1600))},[j==null?void 0:j.command]),ke=M.useCallback(()=>{E(W=>(W||R(!1),!W))},[]),He=M.useCallback(()=>{R(W=>(W||E(!1),!W))},[]),[ve,ye]=M.useState(!1),[Ve,dt]=M.useState(0),Qe=M.useRef(null),[We,$e]=M.useState(0),[Ke,yt]=M.useState(!1),et=M.useRef([]),[Ge,wt]=M.useState(Date.now()),[Tt,Ft]=M.useState(()=>{if(typeof window>"u")return!0;try{return window.localStorage.getItem(Rk)!=="0"}catch{return!0}}),tt=M.useCallback(()=>{Ft(W=>{const Z=!W;try{window.localStorage.setItem(Rk,Z?"1":"0")}catch{}return Z})},[]),[xt,lt]=M.useState(!1),[mt,wn]=M.useState(null),bt=M.useRef(!1),jt=M.useCallback(async()=>{if(!bt.current){bt.current=!0,lt(!0);try{window.sessionStorage.setItem("agent-dag.restartPending",(oe==null?void 0:oe.to)??"")}catch{}try{await fetch("/api/restart",{method:"POST"})}catch{}window.setTimeout(()=>{if(bt.current){bt.current=!1,lt(!1);try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}}},3e4)}},[oe==null?void 0:oe.to]),xn=M.useRef(null);M.useEffect(()=>{let W=!1;for(const ue of n.current.agents.values())if(ue.state==="active"){W=!0;break}const Z=I3({enabled:Tt,kind:oe==null?void 0:oe.kind,canRestart:(j==null?void 0:j.canRestart)===!0,busy:W,idleSince:xn.current,now:Ge});xn.current=Z.idleSince,Z.restart&&jt()},[Tt,oe==null?void 0:oe.kind,j==null?void 0:j.canRestart,Ge,jt]),M.useEffect(()=>{let W=null;try{W=window.sessionStorage.getItem(Tk)}catch{return}if(A3({bundle:"1.32.2",running:j==null?void 0:j.running,lastTried:W})){try{window.sessionStorage.setItem(Tk,(j==null?void 0:j.running)??"")}catch{return}window.location.reload()}},[j==null?void 0:j.running]),M.useEffect(()=>{const W=j==null?void 0:j.running;if(!W)return;let Z=null;try{Z=window.sessionStorage.getItem("agent-dag.restartPending")}catch{return}if(Z==null||Z&&Z!==W)return;try{window.sessionStorage.removeItem("agent-dag.restartPending")}catch{}bt.current=!1,lt(!1),wn(W);const ue=window.setTimeout(()=>wn(null),6e3);return()=>window.clearTimeout(ue)},[j==null?void 0:j.running]);const Ln=M.useRef(E$()).current;M.useRef(!1);const ut=M.useRef(new Map(Ln.positions.filter(([W])=>Ln.pins.includes(W)))),Yt=M.useRef(null),Qt=M.useState(()=>N$())[0],[At,mi]=M.useState(""),[gi,Ji]=M.useState(()=>new Set),[tr,Pr]=M.useState(()=>typeof window>"u"?"dark":window.localStorage.getItem("agent-dag.theme")??"dark"),[vi,dr]=M.useState(!1),Or=M.useRef(null);M.useEffect(()=>{document.documentElement.dataset.theme=tr;try{window.localStorage.setItem("agent-dag.theme",tr)}catch{}},[tr]),M.useEffect(()=>{if(!Qt)return;const W=window.setTimeout(()=>{try{e.setViewport(Qt,{duration:0})}catch{}},60);return()=>window.clearTimeout(W)},[e,Qt]);const nr=M.useRef(!0),qt=M.useRef(null);M.useEffect(()=>{const W=new EventSource("/events");return W.addEventListener("open",()=>{G(!0),dr(!0)}),W.addEventListener("error",()=>G(!1)),W.addEventListener("replay-end",()=>{nr.current=!1,qt.current!=null&&(window.clearTimeout(qt.current),qt.current=null),s()}),W.addEventListener("hook",Z=>{try{const ue=JSON.parse(Z.data);if(Ke){et.current.push(ue);return}n.current=Vw(n.current,ue),ue.replay===!0||nr.current||Date.now()-ue.receivedAt>3e4?(qt.current!=null&&window.clearTimeout(qt.current),qt.current=window.setTimeout(()=>{qt.current=null,s()},120)):(qt.current!=null&&(window.clearTimeout(qt.current),qt.current=null),s())}catch{}}),()=>{W.close(),qt.current!=null&&(window.clearTimeout(qt.current),qt.current=null)}},[Ke,s]),M.useEffect(()=>{if(!Ke&&et.current.length!==0){for(const W of et.current)n.current=Vw(n.current,W);et.current.length=0,s()}},[Ke,s]),M.useEffect(()=>{const W=setInterval(()=>{const Z=Date.now();wt(Z);let ue=oP(n.current,Z,d$);iP(n.current,Z,h$,p$)&&(ue=!0),sP(n.current,Z,m$,g$)&&(ue=!0),ue&&s()},250);return()=>clearInterval(W)},[s]);const $n=M.useRef(null),pn=M.useRef(0),qr=420,zt=M.useCallback((W=500)=>{try{const xe=document.querySelector(".canvas-wrap"),Pe=Array.from(document.querySelectorAll(".react-flow__node")).filter(gt=>gt.offsetWidth>0);if(!xe||Pe.length===0)return;const ze=xe.getBoundingClientRect(),Ze=e.getViewport();if(!Number.isFinite(Ze.zoom)||Ze.zoom<=0)return;const Ye=gt=>(gt-ze.left-Ze.x)/Ze.zoom,Je=gt=>(gt-ze.top-Ze.y)/Ze.zoom,nn=Pe.map(gt=>gt.getBoundingClientRect()),Vr=Math.min(...nn.map(gt=>Ye(gt.left))),En=Math.max(...nn.map(gt=>Ye(gt.right))),gr=Math.min(...nn.map(gt=>Je(gt.top))),Wr=Math.max(...nn.map(gt=>Je(gt.bottom))),no=En-Vr,vr=Wr-gr;if(!(no>0&&vr>0))return;const rn=Math.max(.2,Math.min(1,(ze.width-160)/(no+qr)*.86,(ze.height-160)/vr*.86));e.setViewport({x:80-Vr*rn,y:Math.max(80,(ze.height-vr*rn)/2)-gr*rn,zoom:rn},{duration:W}),pn.current=Date.now(),window.setTimeout(()=>{try{const gt={x:80-Vr*rn,y:Math.max(80,(ze.height-vr*rn)/2)-gr*rn,zoom:rn},Ut=e.getViewport();(Math.abs(Ut.zoom-rn)>.01||Math.abs(Ut.x-gt.x)>2)&&e.setViewport(gt,{duration:0})}catch{}},W+60)}catch{}},[e]),yi=M.useRef(""),wi=M.useRef(null),xi=M.useRef(0),Zt=M.useCallback(()=>{xi.current=Date.now()},[]),Lr="agent-dag.autoFitDisabled",_n=M.useRef((()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(Lr)==="1"}catch{return!1}})()),[es,_i]=M.useState(_n.current),Si=M.useCallback(()=>{if(!_n.current){_n.current=!0,_i(!0);try{window.localStorage.setItem(Lr,"1")}catch{}}},[]),ts=M.useCallback(()=>{_n.current=!1,_i(!1);try{window.localStorage.removeItem(Lr)}catch{}zt(400)},[e,zt]);M.useEffect(()=>{const W=setInterval(()=>{if(_n.current||Date.now()-xi.current<800)return;const Z=n.current,ue=Date.now(),de=[];for(const Ye of Z.agents.values())zg(Ye,ue)&&de.push({id:Ye.id});if(de.length===0)return;const we=e.getViewport(),xe=window.innerWidth-360,Pe=window.innerHeight-52;let ze=!1,Ze=!1;for(const{id:Ye}of de){const Je=Dn.current.get(Ye),nn=ut.current.get(Ye)??kt.current.get(Ye);if(!Je||!nn)continue;Ze=!0;const Vr=nn.x*we.zoom+we.x,En=nn.y*we.zoom+we.y,gr=(nn.x+Je.width)*we.zoom+we.x,Wr=(nn.y+Je.height)*we.zoom+we.y;if(gr>0&&Vr<xe&&Wr>0&&En<Pe){ze=!0;break}}Ze&&!ze&&zt(600)},1500);return()=>clearInterval(W)},[e]);const $r=M.useRef(!1),Dn=M.useRef(new Map),ns=M.useRef(0),rt=M.useCallback(W=>{const Z=Dn.current;let ue=!1;for(const de of W.nodeInternals.values()){const we=de.width,xe=de.height;if(we==null||xe==null)continue;const Pe=Z.get(de.id);Pe?(Math.abs(Pe.height-xe)>4||Math.abs(Pe.width-we)>4)&&(Z.set(de.id,{width:we,height:xe}),ue=!0):(Z.set(de.id,{width:we,height:xe}),ue=!0)}return ue&&(ns.current+=1),ns.current},[]),rs=Xe(rt),[Dr,is]=M.useState(0);M.useEffect(()=>{let W=0;const Z=()=>{const de=Dn.current;let we=!1;for(const xe of document.querySelectorAll(".react-flow__node[data-id]")){const Pe=xe.getAttribute("data-id");if(!Pe)continue;const ze=xe.offsetWidth,Ze=xe.offsetHeight;if(!ze||!Ze)continue;const Ye=de.get(Pe);(!Ye||Math.abs(Ye.width-ze)>4||Math.abs(Ye.height-Ze)>4)&&(de.set(Pe,{width:ze,height:Ze}),we=!0)}we&&is(xe=>xe+1)};if($r.current)return;let ue=0;return document.visibilityState==="hidden"?ue=window.setTimeout(Z,32):W=requestAnimationFrame(Z),()=>{cancelAnimationFrame(W),window.clearTimeout(ue)}});const kt=M.useRef(new Map(Ln.positions)),Fr=M.useRef(""),Fn=M.useMemo(()=>{const W=[];for(const Z of n.current.agents.values())zg(Z,Ge)&&W.push(Z.id+(Z.parentId?`>${Z.parentId}`:""));return W.sort(),`${W.join("|")}#sv${rs}.${Dr}`},[n.current,n.current.lastSeq,Ge,rs,Dr]),Sn=M.useRef(null);M.useEffect(()=>(Sn.current!=null&&window.clearTimeout(Sn.current),Sn.current=window.setTimeout(()=>{_g(kt.current,ut.current)},1500),()=>{Sn.current!=null&&window.clearTimeout(Sn.current)}),[Fn]),M.useEffect(()=>{if(yi.current===Fn)return;const W=yi.current;if(yi.current=Fn,!W||_n.current)return;Date.now()-pn.current>1200&&zt(400),$n.current&&window.clearTimeout($n.current),$n.current=window.setTimeout(()=>{_n.current||zt(500)},280)},[Fn,e,zt]);const Bt=M.useMemo(()=>{if(o.size===0)return null;const W=new Set;for(const Z of o){const ue=j$(n.current,Z);if(ue)for(const de of ue)W.add(de)}return W.size>0?W:null},[n.current,n.current.lastSeq,o]),hr=M.useMemo(()=>l$(n.current,Ge),[n.current,n.current.lastSeq,Ge]),Jt=M.useRef(null),[ss,la]=M.useState({w:0,h:0});M.useEffect(()=>{const W=Jt.current;if(!W||typeof ResizeObserver>"u")return;const Z=new ResizeObserver(ue=>{var we;const de=(we=ue[0])==null?void 0:we.contentRect;de&&la(xe=>Math.abs(xe.w-de.width)>40||Math.abs(xe.h-de.height)>40?{w:de.width,h:de.height}:xe)});return Z.observe(W),la({w:W.clientWidth,h:W.clientHeight}),()=>Z.disconnect()},[]);const fu=M.useRef(new Map),[bi,os]=M.useState(!1);M.useEffect(()=>{const W=window.setTimeout(()=>os(!0),2500);return()=>window.clearTimeout(W)},[]);const[ki,zr]=M.useState(!1),rr=M.useRef(null),[Ks,as]=M.useState(!1),ua=M.useCallback(()=>{rr.current&&(window.clearTimeout(rr.current),rr.current=null),zr(!1)},[]),Xs=M.useCallback(W=>{W.length!==0&&queueMicrotask(()=>{zr(!0),rr.current&&window.clearTimeout(rr.current),rr.current=window.setTimeout(()=>zr(!1),f$+80)})},[]);M.useEffect(()=>()=>{rr.current&&window.clearTimeout(rr.current)},[]);const Br=ss.w>0?ss.w*.92:0,ca=ss.h>0?ss.h:0,{nodes:en,edges:Ue}=M.useMemo(()=>A$(n.current,Ge,Br,ca,ut.current,At,Dn.current,fu.current,Xs,bi,Ks,kt.current,Fn,Fr,o,Bt,hr,S),[n.current,n.current.lastSeq,Ge,Br,ca,bi,Ks,At,Fn,o,Bt,hr,S,Ve]),Qs=M.useMemo(()=>{const W=new Map;for(const ue of en){const de=ue.data;if(!(de!=null&&de.sessionId)||de.exitAt!=null)continue;const we=ue.width,xe=ue.height;if(we==null||xe==null)continue;const Pe=ue.position.x,ze=ue.position.y,Ze=Pe+we,Ye=ze+xe,Je=W.get(de.sessionId);Je?(Je.minX=Math.min(Je.minX,Pe),Je.minY=Math.min(Je.minY,ze),Je.maxX=Math.max(Je.maxX,Ze),Je.maxY=Math.max(Je.maxY,Ye)):W.set(de.sessionId,{minX:Pe,minY:ze,maxX:Ze,maxY:Ye})}const Z=[];for(const[ue,de]of W){const we=de.maxX-de.minX+Sl*2,xe=de.maxY-de.minY+Sl*2;Z.push({id:`group:${ue}`,type:"sessionGroup",position:{x:de.minX-Sl,y:de.minY-Sl},data:{sessionId:ue,w:we,h:xe},width:we,height:xe,style:{width:we,height:xe},zIndex:-1,draggable:!0,selectable:!1,focusable:!1,deletable:!1,connectable:!1})}return Z},[en,Ge]),fa=M.useMemo(()=>{const W=[...Qs,...en],Z=Qe.current;return!Z||Z.size===0?W:W.map(ue=>{const de=Z.get(ue.id);return de?{...ue,position:de}:ue})},[Qs,en,We]),Zs=M.useMemo(()=>{if(!At)return null;const W=new Set;for(const Z of n.current.agents.values())gC(Z,At)&&W.add(Z.id);return W},[n.current,n.current.lastSeq,At]),Js=M.useMemo(()=>{const W=new Set;for(const Z of n.current.agents.values())for(const ue of Z.tools)W.add(mC(ue.name));return Object.keys(Bg).filter(Z=>W.has(Z))},[n.current,n.current.lastSeq]),Ur=M.useMemo(()=>{const W=new Map;for(const ue of n.current.agents.values())for(const de of ue.tools){if(!de.name.startsWith("mcp__"))continue;const we=de.name.slice(5),xe=we.indexOf("__"),Pe=xe>0?we.slice(0,xe):we;W.set(Pe,(W.get(Pe)??0)+1)}const Z=[];for(const[ue,de]of W){let we=5381;for(let xe=0;xe<ue.length;xe++)we=(we<<5)+we^ue.charCodeAt(xe);Z.push({server:ue,count:de,hue:Math.abs(we)%360})}return Z.sort((ue,de)=>de.count-ue.count),Z},[n.current,n.current.lastSeq]),da=M.useCallback(W=>{Ji(Z=>{const ue=new Set(Z);return ue.has(W)?ue.delete(W):ue.add(W),ue})},[]),It=u?n.current.agents.get(u):null,Ei=d?Array.from(n.current.agents.values()).flatMap(W=>W.tools).find(W=>W.id===d)??null:null,bn=M.useCallback(async()=>{try{await fetch("/api/clear",{method:"POST"})}catch{}n.current=$g(),ut.current.clear(),Dn.current.clear(),kt.current.clear(),Fr.current="",Ak(),m(),s()},[s,m]),kn=M.useCallback(()=>{ut.current.clear(),kt.current.clear(),Fr.current="",Ak(),s(),window.setTimeout(()=>zt(500),80)},[s,e,zt]),zn=M.useCallback(()=>zt(500),[zt]),pr=M.useCallback(W=>{if(en.length===0)return;const Z=en.slice().sort((xe,Pe)=>xe.position.y-Pe.position.y||xe.position.x-Pe.position.x),ue=u?Z.findIndex(xe=>xe.id===u):-1;let de;ue===-1?de=W===1?0:Z.length-1:de=(ue+W+Z.length)%Z.length;const we=Z[de];we&&(p(we.id,!1),window.setTimeout(()=>{try{e.fitView({padding:.35,duration:350,nodes:[we]})}catch{}pn.current=Date.now()},30))},[en,u,p,e]);M.useEffect(()=>{const W=Z=>{var de,we;const ue=((de=Z.target)==null?void 0:de.tagName)==="INPUT";if(Z.key==="Escape"){ue?Z.target.blur():m();return}if(!ue){if(Z.key==="/"){Z.preventDefault(),(we=Or.current)==null||we.focus();return}Z.key===" "&&(Z.preventDefault(),yt(xe=>!xe)),(Z.key==="c"||Z.key==="C")&&bn(),(Z.key==="r"||Z.key==="R")&&kn(),(Z.key==="f"||Z.key==="F")&&zn(),(Z.key==="l"||Z.key==="L")&&ke(),(Z.key==="h"||Z.key==="H")&&ye(xe=>!xe),(Z.key==="u"||Z.key==="U")&&L(xe=>!xe),(Z.key==="a"||Z.key==="A")&&He(),(Z.key==="j"||Z.key==="J")&&pr(1),(Z.key==="k"||Z.key==="K")&&pr(-1),(Z.key==="t"||Z.key==="T")&&Pr(xe=>xe==="dark"?"light":"dark")}};return window.addEventListener("keydown",W),()=>window.removeEventListener("keydown",W)},[bn,kn,zn,m,pr]);const mr=n.current.agents.size,ir=new Set(Array.from(n.current.agents.values()).map(W=>W.sessionId)).size,tn=M.useMemo(()=>{let W=0,Z=0,ue=0,de=0,we=0,xe=0,Pe=0,ze=0,Ze=0;for(const Ye of n.current.agents.values()){W+=Ye.usage.inputTokens,Z+=Ye.usage.outputTokens,ue+=Ye.usage.cacheReadTokens,de+=Ye.usage.cacheCreateTokens;const Je=dn(Ye.usage,Ye.model);we+=Je.total,xe+=Je.input,Pe+=Je.output,ze+=Je.cacheRead,Ze+=Je.cacheWrite}return{inT:W,outT:Z,cacheR:ue,cacheC:de,sum:W+Z,cost:{total:we,input:xe,output:Pe,cacheRead:ze,cacheWrite:Ze}}},[n.current,n.current.lastSeq]);return v.jsxs("div",{className:"app",children:[v.jsxs("header",{className:"topbar",children:[v.jsxs("div",{className:"brand",children:[v.jsx("span",{className:"logo"}),"agents-deck",oe?v.jsxs("button",{type:"button",className:"v stale",onClick:Ae,title:oe.kind==="restart"?`Running v${oe.from}; v${oe.to} is installed on disk. Restart to pick it up.`:`Running v${oe.from}; v${oe.to} is on npm.`,children:["v",oe.from,v.jsx("span",{className:"v-dot","aria-hidden":!0})]}):v.jsxs("span",{className:"v",children:["v",(j==null?void 0:j.running)??"1.32.2"]})]}),It&&(()=>{const W=dn(It.usage,It.model),Z=Math.max(0,((It.endedAt??Ge)-It.startedAt)/1e3),ue=It.state==="active"?Ll(W.total,Z):null,de=o.size-1;return v.jsxs("button",{type:"button",className:"selected-ribbon",title:`Fit view to ${It.label}`,onClick:()=>{try{const we=en.find(xe=>xe.id===It.id);we&&e.fitView({padding:.35,duration:500,nodes:[we]}),pn.current=Date.now()}catch{}},children:[v.jsx("span",{className:`state-pill state-${It.state}`,children:It.state==="active"?"live":It.state}),v.jsx("span",{className:"selected-label",children:It.label}),W.total>0&&v.jsxs("span",{className:"selected-cost",children:[Fe(W.total),ue?v.jsxs("span",{className:"selected-rate",children:[" · ",ue]}):null]}),de>0&&v.jsxs("span",{className:"selected-extra",children:["+",de]}),v.jsx("span",{role:"button","aria-label":"Deselect",className:"selected-close",onClick:we=>{we.stopPropagation(),m()},children:"×"})]})})(),v.jsxs("div",{className:"actions",children:[v.jsxs("div",{className:"search",children:[v.jsx("span",{className:"search-icon","aria-hidden":!0,children:"⌕"}),v.jsx("input",{ref:Or,type:"text",placeholder:"Search agents, cwd, tools…",value:At,onChange:W=>mi(W.target.value),spellCheck:!1,"aria-label":"Filter the graph"}),At?v.jsx("button",{className:"search-clear","aria-label":"Clear search",onClick:()=>mi(""),children:"×"}):v.jsx("kbd",{className:"search-kbd","aria-hidden":!0,children:"/"})]}),v.jsxs("span",{className:"status",role:"status",children:[v.jsx("span",{className:`pill ${$?"live":"dead"}`,title:$?"Receiving events":"SSE disconnected",children:$?"live":"offline"}),v.jsxs("span",{className:"stat",title:"Distinct CC sessions",children:[v.jsx("span",{className:"count",children:ir}),v.jsx("span",{className:"lbl",children:"sessions"})]}),v.jsxs("span",{className:"stat",title:"Total agents (root + subagents)",children:[v.jsx("span",{className:"count",children:mr}),v.jsx("span",{className:"lbl",children:"agents"})]}),v.jsxs("span",{className:"stat",title:"Total hook events received",children:[v.jsx("span",{className:"count",children:n.current.totalEvents}),v.jsx("span",{className:"lbl",children:"events"})]}),tn.sum>0&&v.jsxs("span",{className:"stat",title:`in:${tn.inT.toLocaleString()} out:${tn.outT.toLocaleString()} cache-r:${tn.cacheR.toLocaleString()} cache-c:${tn.cacheC.toLocaleString()}`,children:[v.jsx("span",{className:"count",children:u$(tn.sum)}),v.jsx("span",{className:"lbl",children:"tokens"})]}),Ur.length>0&&v.jsxs("span",{className:"stat mcp-legend",title:`MCP servers seen this session:
|
|
60
|
+
${Ur.map(W=>` ${W.server}: ${W.count} call${W.count===1?"":"s"}`).join(`
|
|
61
|
+
`)}`,children:[Ur.slice(0,6).map(W=>v.jsx("span",{className:"mcp-dot",style:{background:`hsl(${W.hue} 65% 65%)`}},W.server)),Ur.length>6&&v.jsxs("span",{className:"mcp-more",children:["+",Ur.length-6]}),v.jsx("span",{className:"lbl",children:"mcp"})]}),tn.cost.total>0&&(()=>{let W=0,Z=0;for(const we of n.current.agents.values()){if(we.state!=="active")continue;const xe=dn(we.usage,we.model);W+=xe.total,Z=Math.max(Z,((we.endedAt??Ge)-we.startedAt)/1e3)}const ue=Z>0?Ll(W,Z):null,de=`input ${Fe(tn.cost.input)} + output ${Fe(tn.cost.output)} + cache r ${Fe(tn.cost.cacheRead)} + cache w ${Fe(tn.cost.cacheWrite)}${ue?`
|
|
62
|
+
active burn: ${ue}`:""}`;return v.jsxs("span",{className:"stat",title:de,children:[v.jsx("span",{className:"count",children:Fe(tn.cost.total)}),v.jsxs("span",{className:"lbl",children:["cost",ue?` · ${ue}`:""]})]})})()]}),v.jsx("button",{className:`btn ${Ke?"warn":""}`,onClick:()=>yt(W=>!W),title:"Pause/resume live updates (Space)",children:Ke?`Resume${et.current.length?` · ${et.current.length}`:""}`:"Pause"}),v.jsx("button",{className:`btn icon-btn ${P?"primary":""}`,onClick:()=>L(W=>!W),title:`${P?"Hide":"Show"} usage panel (U)`,"aria-label":"Toggle usage panel",children:"$"}),q!==null&&v.jsx("button",{className:`btn icon-btn ${q?"primary":""}`,onClick:W=>{if(W.shiftKey&&B>0){Q(!0),fetch("/api/sound-hook",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"restore"})}).then(()=>fetch("/api/sound-hook")).then(Z=>Z.ok?Z.json():null).then(Z=>{Z!=null&&Z.ok&&(F(Z.enabled===!0),ne(Z.parked??0))}).catch(()=>{}).finally(()=>Q(!1));return}X()},disabled:J,title:(q?"Sound on turn finish: on — click to remove the hook":"Sound on turn finish: off — click to add a Stop hook")+(A>0?`
|
|
63
|
+
|
|
64
|
+
${A} sound hook${A>1?"s":""} of your own in settings.json also run${A>1?"":"s"} here.`:"")+(B>0?`
|
|
65
|
+
|
|
66
|
+
${B} of your own sound hook${B>1?"s were":" was"} set aside so this switch actually controls the sound. Nothing was deleted — shift-click to put ${B>1?"them":"it"} back.`:""),"aria-label":"Toggle finish sound","aria-pressed":q,children:v.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[v.jsx("path",{d:"M3.2 5.2h2L7.8 3v8L5.2 8.8h-2z"}),q?v.jsxs(v.Fragment,{children:[v.jsx("path",{d:"M9.8 5.4a2.4 2.4 0 0 1 0 3.2"}),v.jsx("path",{d:"M11.3 3.9a4.6 4.6 0 0 1 0 6.2"})]}):v.jsxs(v.Fragment,{children:[v.jsx("path",{d:"M10 5.6l2.6 2.8"}),v.jsx("path",{d:"M12.6 5.6L10 8.4"})]})]})}),v.jsx("button",{className:`btn icon-btn ${O?"primary":""}`,onClick:He,title:`${O?"Hide":"Show"} accounts (A)`,"aria-label":"Toggle accounts panel",children:v.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[v.jsx("circle",{cx:"7",cy:"4.6",r:"2.4"}),v.jsx("path",{d:"M2.4 12c0-2.3 2.1-3.7 4.6-3.7s4.6 1.4 4.6 3.7"})]})}),v.jsx("button",{className:`btn icon-btn ${k?"primary":""}`,onClick:ke,title:`${k?"Hide":"Show"} session list (L)`,"aria-label":"Toggle session list",children:"☰"}),v.jsx("button",{className:`btn icon-btn ${ve?"primary":""}`,onClick:()=>ye(W=>!W),title:"Usage history — ccusage (H)","aria-label":"Open usage history",children:v.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":!0,children:[v.jsx("line",{x1:"3",y1:"11.5",x2:"3",y2:"7"}),v.jsx("line",{x1:"7",y1:"11.5",x2:"7",y2:"3"}),v.jsx("line",{x1:"11",y1:"11.5",x2:"11",y2:"8.5"})]})}),v.jsx("button",{className:"btn",onClick:kn,title:"Auto-arrange — clear pins (R)",children:"Re-layout"}),v.jsx("button",{className:"btn",onClick:bn,title:"Clear canvas (C)",children:"Clear"}),v.jsx("button",{className:"btn icon-btn",onClick:()=>Pr(W=>W==="dark"?"light":"dark"),title:`Switch to ${tr==="dark"?"light":"dark"} mode (T)`,"aria-label":"Toggle theme",children:tr==="dark"?"☀":"☾"})]})]}),mt?v.jsxs("div",{className:"ver-banner done",role:"status",children:[v.jsx("span",{className:"ver-dot"}),v.jsxs("strong",{children:["Restarted — now running v",mt,"."]}),v.jsx("span",{className:"ver-sub",children:"The canvas replayed from the event log."})]}):vi&&!$?v.jsxs("div",{className:"conn-banner",role:"alert",children:[v.jsx("span",{className:"conn-dot"}),xt?"Restarting agents-deck…":"Lost connection to agents-deck server. Reconnecting…"]}):ge&&oe&&v.jsxs("div",{className:`ver-banner ${oe.kind}`,role:"status",children:[v.jsx("span",{className:"ver-dot"}),oe.kind==="restart"?v.jsxs(v.Fragment,{children:[v.jsxs("strong",{children:["v",oe.to," is installed — this deck still runs v",oe.from,"."]}),j!=null&&j.canRestart?v.jsxs(v.Fragment,{children:[v.jsx("button",{type:"button",className:"ver-act",onClick:jt,disabled:xt,title:"Stop this process and bring it back on the same port. The canvas replays from the event log.",children:xt?"restarting…":"Restart now"}),v.jsxs("button",{type:"button",className:`ver-auto${Tt?" on":""}`,role:"switch","aria-checked":Tt,onClick:tt,title:Tt?"Restarts on its own once nothing has been running for 30 seconds. Click to require a click instead.":"Only restarts when you click. Click to let it restart itself while idle.",children:[v.jsx("i",{"aria-hidden":!0}),"auto when idle"]})]}):v.jsx("span",{className:"ver-sub",title:"Node loads every module once, at startup. An upgrade replaces the files on disk but not the code already in memory, so this process keeps running the old version until it is restarted.",children:"Restart it to pick up the new code."})]}):v.jsxs(v.Fragment,{children:[v.jsxs("strong",{children:["agents-deck v",oe.to," is out — you are on v",oe.from,"."]}),!(j!=null&&j.upgradeBlocked)&&Oe!=="failed"&&v.jsx("button",{type:"button",className:"ver-act",onClick:Ie,disabled:Oe==="running"||Oe==="done",title:`Runs ${((Hr=j==null?void 0:j.upgrade)==null?void 0:Hr.command)??"npm install -g agents-deck@latest"} here, then restarts once nothing is running.`,children:Oe==="running"?"installing…":Oe==="done"?"installed":"Update now"}),Oe==="failed"?v.jsxs("span",{className:"ver-sub fail",title:((ha=j==null?void 0:j.upgrade)==null?void 0:ha.error)??"",children:["install failed: ",((to=j==null?void 0:j.upgrade)==null?void 0:to.error)??"unknown error"," — run it yourself:"]}):j!=null&&j.upgradeBlocked?v.jsx("span",{className:"ver-sub",children:v$[j.upgradeBlocked]??"cannot install from here"}):null,v.jsxs("button",{type:"button",className:"ver-cmd",onClick:Me,title:"Copy to clipboard",children:[v.jsx("code",{children:j==null?void 0:j.command}),v.jsx("span",{className:"ver-cmd-hint",children:K?"copied":"copy"})]})]}),v.jsx("span",{role:"button",tabIndex:0,"aria-label":"Dismiss",className:"ver-close",onClick:Ae,onKeyDown:W=>{(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),Ae())},children:"×"})]}),P&&v.jsx(S3,{state:n.current,now:Ge,onClose:()=>L(!1)}),O&&v.jsx(T3,{onClose:()=>R(!1)}),k&&v.jsx(d3,{state:n.current,now:Ge,selectedIds:o,onSelect:W=>{p(W,!1),window.setTimeout(()=>{try{const Z=en.find(ue=>ue.id===W);Z&&e.fitView({padding:.3,duration:500,nodes:[Z]}),pn.current=Date.now()}catch{}},60)},onClose:()=>E(!1)}),v.jsxs("div",{className:`canvas-wrap${ki?" bubbling":""}${Ks?" dragging-any":""}`,ref:Jt,children:[mr===0&&v.jsx(P$,{live:$,everConnected:vi}),Js.length>1&&v.jsx("div",{className:"cat-filter-bar",role:"toolbar","aria-label":"Filter tools by category",children:Js.map(W=>{const Z=gi.has(W);return v.jsxs("button",{type:"button",className:`cat-filter${Z?" off":""}`,onClick:()=>da(W),title:`${Z?"Show":"Hide"} ${Ug[W]} tools`,children:[v.jsx("span",{className:"cat-emoji",children:Bg[W]}),v.jsx("span",{className:"cat-name",children:Ug[W]})]},W)})}),v.jsxs(XE,{nodes:fa,edges:Ue,nodeTypes:c$,fitView:!Qt,fitViewOptions:{padding:.25,duration:400},minZoom:.2,maxZoom:1.6,panOnScroll:!0,nodesDraggable:!0,nodesConnectable:!1,selectionOnDrag:!1,onNodeClick:(W,Z)=>{if(Z.type==="sessionGroup"){m();return}p(Z.id,W.shiftKey)},onPaneClick:()=>m(),onMoveStart:()=>{Date.now()-pn.current<1200||Si()},onMove:(W,Z)=>{Zt(),wi.current&&window.clearTimeout(wi.current),wi.current=window.setTimeout(()=>C$(Z),250)},onNodeDragStart:(W,Z)=>{var ue;if(ua(),$r.current=!0,Qe.current=new Map,as(!0),Zt(),Si(),Z.type==="sessionGroup"){const de=(ue=Z.data)==null?void 0:ue.sessionId,we=new Map;if(de)for(const xe of en){const Pe=xe.data;(Pe==null?void 0:Pe.sessionId)===de&&we.set(xe.id,{x:xe.position.x,y:xe.position.y})}Yt.current={start:{x:Z.position.x,y:Z.position.y},members:we};return}ut.current.set(Z.id,{x:Z.position.x,y:Z.position.y})},onNodeDrag:(W,Z)=>{var ue;if(Zt(),Z.type==="sessionGroup"){const de=Yt.current;if(!de)return;const we=Z.position.x-de.start.x,xe=Z.position.y-de.start.y;for(const[ze,Ze]of de.members){const Ye={x:Ze.x+we,y:Ze.y+xe};ut.current.set(ze,Ye),kt.current.set(ze,Ye)}const Pe=Qe.current;if(Pe){for(const[ze,Ze]of de.members)Pe.set(ze,{x:Ze.x+we,y:Ze.y+xe});Pe.set(Z.id,{x:Z.position.x,y:Z.position.y})}$e(ze=>ze+1);return}ut.current.set(Z.id,{x:Z.position.x,y:Z.position.y}),kt.current.set(Z.id,{x:Z.position.x,y:Z.position.y}),(ue=Qe.current)==null||ue.set(Z.id,{x:Z.position.x,y:Z.position.y}),$e(de=>de+1)},onNodeDragStop:(W,Z)=>{if(Zt(),$r.current=!1,Qe.current=null,as(!1),dt(ue=>ue+1),Z.type==="sessionGroup"){const ue=Yt.current;if(ue){const de=Z.position.x-ue.start.x,we=Z.position.y-ue.start.y;for(const[xe,Pe]of ue.members){const ze={x:Pe.x+de,y:Pe.y+we};ut.current.set(xe,ze),kt.current.set(xe,ze)}}Yt.current=null,_g(kt.current,ut.current),dt(de=>de+1);return}ut.current.set(Z.id,{x:Z.position.x,y:Z.position.y}),kt.current.set(Z.id,{x:Z.position.x,y:Z.position.y}),_g(kt.current,ut.current)},children:[v.jsx(ZM,{gap:28,size:1,color:Fi("--grid-line")}),v.jsx(AP,{}),v.jsx(o3,{agents:n.current.agents,visibleAgentIds:hr,positions:kt.current,pinned:ut.current,measured:Dn.current,dimUnmatched:Zs,spotlight:Bt,hiddenCategories:gi,now:Ge,onOpenTool:h}),v.jsx(WM,{showInteractive:!1,children:v.jsx(Os,{onClick:ts,title:es?"Recenter view + re-enable autofit":"Recenter view (autofit already on)","aria-label":"Recenter view",style:es?{color:"var(--accent)"}:void 0,children:v.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24","aria-hidden":!0,children:[v.jsx("circle",{cx:"12",cy:"12",r:"3.5",fill:"none",stroke:"currentColor",strokeWidth:"2"}),v.jsx("path",{d:"M12 2v4M12 18v4M2 12h4M18 12h4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",fill:"none"})]})})}),v.jsx(DM,{zoomable:!0,pannable:!0,nodeColor:W=>{const Z=W.data;return Z.state==="err"?Fi("--err"):Z.state==="active"?Fi("--inflight"):Fi("--ok")},nodeStrokeWidth:2,maskColor:Fi("--minimap-mask"),style:{background:Fi("--panel"),border:`1px solid ${Fi("--line")}`,borderRadius:8}})]})]}),C?v.jsxs("aside",{className:"detail",children:[v.jsx("button",{type:"button",className:"detail-close",title:"Close panel","aria-label":"Close detail panel",onClick:()=>I(!1),children:"×"}),It?v.jsx(L$,{agent:It,now:Ge,onOpenTool:h,onShowSummary:W=>{b.current.has(W)&&(b.current.delete(W),jk(b.current)),x(W)},onExportSession:W=>R$(n.current,W)}):v.jsx(q$,{count:mr})]}):v.jsx("button",{type:"button",className:"detail-reopen",title:"Show detail panel","aria-label":"Show detail panel",onClick:()=>I(!0),children:"‹"}),Ei&&v.jsx(CP,{tool:Ei,onClose:()=>h(null)}),ve&&v.jsx(q3,{onClose:()=>ye(!1)}),N&&(()=>{const W=n.current.agents.get(N);return W?v.jsx(yP,{agent:W,onClose:()=>_(null)}):null})(),y&&v.jsx(a3,{state:n.current,sessionId:y,onClose:()=>{b.current.add(y),jk(b.current),x(null)}})]})}function P$({live:e,everConnected:n}){const i=!e;return v.jsxs("div",{className:"empty-hero",children:[v.jsxs("div",{className:"orbit-stack","aria-hidden":!0,children:[v.jsx("div",{className:"core"}),v.jsxs("div",{className:"orbit r1",children:[v.jsx("span",{className:"dot"}),v.jsx("span",{className:"dot b"})]}),v.jsxs("div",{className:"orbit r2",children:[v.jsx("span",{className:"dot"}),v.jsx("span",{className:"dot b"})]}),v.jsxs("div",{className:"orbit r3",children:[v.jsx("span",{className:"dot"}),v.jsx("span",{className:"dot b"})]})]}),i?v.jsxs(v.Fragment,{children:[v.jsx("h2",{children:n?"Disconnected from server":"Server unreachable"}),v.jsxs("p",{children:["The browser cannot reach ",v.jsx("code",{children:"/events"}),". Check that",v.jsx("code",{children:"agents-deck"})," is still running in your terminal, then this page will resume automatically."]})]}):O$()]})}function O$(){return v.jsxs(v.Fragment,{children:[v.jsx("h2",{children:"Waiting for Claude Code or Codex"}),v.jsxs("p",{children:["Run ",v.jsx("code",{children:"claude"})," or ",v.jsx("code",{children:"codex"})," in any folder. As soon as a session sends an event, a node appears here and grows as subagents fork and tools are called."]}),v.jsxs("p",{className:"hint-row",children:["Not seeing anything? Make sure ",v.jsx("code",{children:"agents-deck"})," is running and that hooks are installed in ",v.jsx("code",{children:"~/.claude/settings.json"})," and"," ",v.jsx("code",{children:"~/.codex/hooks.json"}),". (Codex requires"," ",v.jsx("code",{children:"/hooks"})," trust on first run.)"]})]})}function q$({count:e}){return v.jsxs(v.Fragment,{children:[v.jsx("h3",{children:"Detail"}),e===0?v.jsxs("div",{className:"hint",children:["No data yet. Start a Claude Code or Codex session anywhere on this machine — agents-deck is in ",v.jsx("code",{children:"--all"})," mode and listens to every workspace."]}):v.jsx("div",{className:"empty",children:"Click an agent to see its tools."}),v.jsx("h3",{style:{marginTop:4},children:"Shortcuts"}),v.jsxs("div",{className:"shortcuts",children:[v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"drag"}),v.jsx("span",{children:"move a node"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"/"}),v.jsx("span",{children:"focus search"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"space"}),v.jsx("span",{children:"pause / resume"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"J"}),v.jsx("span",{children:"next agent"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"K"}),v.jsx("span",{children:"previous agent"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"R"}),v.jsx("span",{children:"re-arrange"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"F"}),v.jsx("span",{children:"fit view"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"L"}),v.jsx("span",{children:"session list"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"H"}),v.jsx("span",{children:"usage history"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"U"}),v.jsx("span",{children:"usage panel"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"C"}),v.jsx("span",{children:"clear canvas"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"T"}),v.jsx("span",{children:"toggle theme"})]}),v.jsxs("div",{className:"sc",children:[v.jsx("kbd",{children:"Esc"}),v.jsx("span",{children:"deselect"})]})]})]})}function L$({agent:e,now:n,onOpenTool:i,onShowSummary:s,onExportSession:o}){const l=(e.endedAt??n)-e.startedAt,u=Math.max(0,Math.floor(l/1e3)),c=u<60?`${u}s`:`${Math.floor(u/60)}m ${String(u%60).padStart(2,"0")}s`,d=dn(e.usage,e.model),h=d.total>0,p=e.usage.inputTokens+e.usage.outputTokens,m=new Map;for(const _ of e.tools){const S=mC(_.name);m.set(S,(m.get(S)??0)+1)}const y=e.tools.filter(_=>_.ok===!1).length,x=e.tools.filter(_=>!_.endedAt).length,N=Array.from(m.entries()).sort((_,S)=>S[1]-_[1]);return v.jsxs(v.Fragment,{children:[v.jsxs("header",{className:"detail-hero",children:[v.jsxs("div",{className:"hero-line",children:[v.jsx("span",{className:`state-pill state-${e.state}`,children:e.state==="active"?"live":e.state}),v.jsx("h2",{className:"hero-title",title:e.cwd??e.label,children:e.label})]}),v.jsxs("div",{className:"hero-meta",children:[v.jsx("span",{className:"hero-meta-item",children:e.kind}),v.jsx("span",{className:"hero-sep",children:"·"}),v.jsx("span",{className:"hero-meta-item",title:`started ${new Date(e.startedAt).toLocaleString()}`,children:c}),e.model&&v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"hero-sep",children:"·"}),v.jsx("span",{className:"model-chip",title:e.model,children:na(e.model)})]})]}),h&&v.jsxs("div",{className:"hero-cost",children:[v.jsxs("div",{className:"hero-cost-headline",children:[v.jsx("span",{className:"hero-cost-value",children:Fe(d.total)}),v.jsx("span",{className:"hero-cost-label",children:"spend"})]}),v.jsx($$,{cost:d})]}),v.jsxs("div",{className:"hero-actions",children:[e.kind==="root"&&e.state==="done"&&s&&v.jsx("button",{type:"button",className:"btn hero-action-btn",onClick:()=>s(e.sessionId),title:"Reopen the end-of-session recap modal",children:"Show recap"}),o&&v.jsx("button",{type:"button",className:"btn hero-action-btn",onClick:()=>o(e.sessionId),title:"Download this session as JSON",children:"Export JSON"})]})]}),e.tools.length>0&&v.jsxs("section",{className:"detail-section",children:[v.jsx("h3",{children:"Activity"}),v.jsxs("div",{className:"activity-row",children:[v.jsxs("div",{className:"activity-counters",children:[v.jsxs("span",{className:"ac-item",children:[v.jsx("b",{children:e.toolCount})," calls"]}),x>0&&v.jsxs("span",{className:"ac-item ac-live",children:[v.jsx("b",{children:x})," live"]}),y>0&&v.jsxs("span",{className:"ac-item ac-err",children:[v.jsx("b",{children:y})," err"]})]}),v.jsx("div",{className:"cat-strip",children:N.map(([_,S])=>v.jsxs("span",{className:`cat-chip cat-${_}`,title:`${S} ${Ug[_]} call${S===1?"":"s"}`,children:[v.jsx("span",{className:"cat-emoji",children:Bg[_]}),v.jsx("span",{className:"cat-count",children:S})]},_))})]})]}),p>0&&v.jsxs("section",{className:"detail-section",children:[v.jsx("h3",{children:"Tokens"}),v.jsxs("div",{className:"tokens-grid",children:[v.jsxs("div",{children:[v.jsx("span",{className:"k",children:"in"}),v.jsx("b",{children:e.usage.inputTokens.toLocaleString()})]}),v.jsxs("div",{children:[v.jsx("span",{className:"k",children:"out"}),v.jsx("b",{children:e.usage.outputTokens.toLocaleString()})]}),v.jsxs("div",{children:[v.jsx("span",{className:"k",children:"cache r"}),v.jsx("b",{children:e.usage.cacheReadTokens.toLocaleString()})]}),v.jsxs("div",{children:[v.jsx("span",{className:"k",children:"cache c"}),v.jsx("b",{children:e.usage.cacheCreateTokens.toLocaleString()})]})]})]}),v.jsxs("section",{className:"detail-section",children:[v.jsx("h3",{children:"Identity"}),v.jsxs("div",{children:[e.cwd&&v.jsxs("div",{className:"row",children:[v.jsx("span",{className:"k",children:"cwd"}),v.jsx("span",{className:"v",title:e.cwd,children:e.cwd})]}),v.jsxs("div",{className:"row",children:[v.jsx("span",{className:"k",children:"session"}),v.jsxs("span",{className:"v",children:[e.sessionId.slice(0,12),"…"]})]}),e.parentId&&v.jsxs("div",{className:"row",children:[v.jsx("span",{className:"k",children:"parent"}),v.jsxs("span",{className:"v",children:[e.parentId.slice(0,12),"…"]})]})]})]}),e.prompts.length>0&&v.jsxs("section",{className:"detail-section",children:[v.jsxs("h3",{children:["Prompts ",v.jsx("span",{className:"section-count",children:e.prompts.length})]}),v.jsx("div",{className:"prompts",children:e.prompts.slice().reverse().map((_,S)=>v.jsxs("div",{className:"prompt-entry",children:[v.jsx("div",{className:"prompt-time",children:new Date(_.at).toLocaleTimeString()}),v.jsx("div",{className:"prompt-text",children:_.text})]},S))})]}),v.jsxs("section",{className:"detail-section",children:[v.jsxs("h3",{children:["Tool calls ",v.jsx("span",{className:"section-count",children:e.tools.length})]}),e.tools.length===0&&v.jsx("div",{className:"empty",children:"No tool calls yet."}),v.jsx("div",{children:e.tools.slice().reverse().map(_=>v.jsx(D$,{t:_,now:n,onClick:()=>i(_.id)},_.id))})]})]})}function $$({cost:e}){const n=e.total;if(n<=0)return null;const i=(s,o,l)=>{if(s<=0)return null;const u=s/n*100;return v.jsx("span",{className:`cb-seg ${o}`,style:{width:`${u}%`},title:`${l}: ${Fe(s)} (${u.toFixed(0)}%)`},o)};return v.jsxs("div",{className:"cost-bar","aria-label":"Cost breakdown",children:[i(e.input,"cb-input","input"),i(e.output,"cb-output","output"),i(e.cacheRead,"cb-cache-r","cache read"),i(e.cacheWrite,"cb-cache-w","cache write")]})}function D$({t:e,now:n,onClick:i}){const s=e.endedAt==null?"inflight":e.ok===!1?"err":"done",o=(e.endedAt??n)-e.startedAt,l=e.endedAt==null?"…":o<1e3?`${o}ms`:`${(o/1e3).toFixed(1)}s`;return v.jsxs("button",{className:"tool clickable",title:e.inputPreview||e.name,onClick:i,children:[v.jsxs("span",{className:"name",children:[v.jsx("span",{className:`status-dot ${s}`}),e.name]}),v.jsx("span",{style:{color:"var(--muted)"},children:l})]})}const F$=QR.createRoot(document.getElementById("root"));F$.render(v.jsx(I$,{}));
|