agent-dag 1.25.0 → 1.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,64 @@
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 u of o)if(u.type==="childList")for(const l of u.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function i(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(o){if(o.ep)return;o.ep=!0;const u=i(o);fetch(o.href,u)}})();var Ta=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fc={exports:{}},Ws={},dc={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 T0;function OT(){if(T0)return qe;T0=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"),u=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.iterator;function y(A){return A===null||typeof A!="object"?null:(A=m&&A[m]||A["@@iterator"],typeof A=="function"?A:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,_={};function S(A,z,ae){this.props=A,this.context=z,this.refs=_,this.updater=ae||x}S.prototype.isReactComponent={},S.prototype.setState=function(A,z){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,z,"setState")},S.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function k(){}k.prototype=S.prototype;function b(A,z,ae){this.props=A,this.context=z,this.refs=_,this.updater=ae||x}var E=b.prototype=new k;E.constructor=b,C(E,S.prototype),E.isPureReactComponent=!0;var N=Array.isArray,j=Object.prototype.hasOwnProperty,I={current:null},P={key:!0,ref:!0,__self:!0,__source:!0};function B(A,z,ae){var D,V={},J=null,se=null;if(z!=null)for(D in z.ref!==void 0&&(se=z.ref),z.key!==void 0&&(J=""+z.key),z)j.call(z,D)&&!P.hasOwnProperty(D)&&(V[D]=z[D]);var ue=arguments.length-2;if(ue===1)V.children=ae;else if(1<ue){for(var he=Array(ue),me=0;me<ue;me++)he[me]=arguments[me+2];V.children=he}if(A&&A.defaultProps)for(D in ue=A.defaultProps,ue)V[D]===void 0&&(V[D]=ue[D]);return{$$typeof:e,type:A,key:J,ref:se,props:V,_owner:I.current}}function M(A,z){return{$$typeof:e,type:A.type,key:z,ref:A.ref,props:A.props,_owner:A._owner}}function F(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function O(A){var z={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(ae){return z[ae]})}var Q=/\/+/g;function X(A,z){return typeof A=="object"&&A!==null&&A.key!=null?O(""+A.key):z.toString(36)}function R(A,z,ae,D,V){var J=typeof A;(J==="undefined"||J==="boolean")&&(A=null);var se=!1;if(A===null)se=!0;else switch(J){case"string":case"number":se=!0;break;case"object":switch(A.$$typeof){case e:case n:se=!0}}if(se)return se=A,V=V(se),A=D===""?"."+X(se,0):D,N(V)?(ae="",A!=null&&(ae=A.replace(Q,"$&/")+"/"),R(V,z,ae,"",function(me){return me})):V!=null&&(F(V)&&(V=M(V,ae+(!V.key||se&&se.key===V.key?"":(""+V.key).replace(Q,"$&/")+"/")+A)),z.push(V)),1;if(se=0,D=D===""?".":D+":",N(A))for(var ue=0;ue<A.length;ue++){J=A[ue];var he=D+X(J,ue);se+=R(J,z,ae,he,V)}else if(he=y(A),typeof he=="function")for(A=he.call(A),ue=0;!(J=A.next()).done;)J=J.value,he=D+X(J,ue++),se+=R(J,z,ae,he,V);else if(J==="object")throw z=String(A),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.");return se}function K(A,z,ae){if(A==null)return A;var D=[],V=0;return R(A,D,"","",function(J){return z.call(ae,J,V++)}),D}function H(A){if(A._status===-1){var z=A._result;z=z(),z.then(function(ae){(A._status===0||A._status===-1)&&(A._status=1,A._result=ae)},function(ae){(A._status===0||A._status===-1)&&(A._status=2,A._result=ae)}),A._status===-1&&(A._status=0,A._result=z)}if(A._status===1)return A._result.default;throw A._result}var te={current:null},Y={transition:null},$={ReactCurrentDispatcher:te,ReactCurrentBatchConfig:Y,ReactCurrentOwner:I};function G(){throw Error("act(...) is not supported in production builds of React.")}return qe.Children={map:K,forEach:function(A,z,ae){K(A,function(){z.apply(this,arguments)},ae)},count:function(A){var z=0;return K(A,function(){z++}),z},toArray:function(A){return K(A,function(z){return z})||[]},only:function(A){if(!F(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},qe.Component=S,qe.Fragment=i,qe.Profiler=o,qe.PureComponent=b,qe.StrictMode=s,qe.Suspense=d,qe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$,qe.act=G,qe.cloneElement=function(A,z,ae){if(A==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+A+".");var D=C({},A.props),V=A.key,J=A.ref,se=A._owner;if(z!=null){if(z.ref!==void 0&&(J=z.ref,se=I.current),z.key!==void 0&&(V=""+z.key),A.type&&A.type.defaultProps)var ue=A.type.defaultProps;for(he in z)j.call(z,he)&&!P.hasOwnProperty(he)&&(D[he]=z[he]===void 0&&ue!==void 0?ue[he]:z[he])}var he=arguments.length-2;if(he===1)D.children=ae;else if(1<he){ue=Array(he);for(var me=0;me<he;me++)ue[me]=arguments[me+2];D.children=ue}return{$$typeof:e,type:A.type,key:V,ref:J,props:D,_owner:se}},qe.createContext=function(A){return A={$$typeof:l,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},A.Provider={$$typeof:u,_context:A},A.Consumer=A},qe.createElement=B,qe.createFactory=function(A){var z=B.bind(null,A);return z.type=A,z},qe.createRef=function(){return{current:null}},qe.forwardRef=function(A){return{$$typeof:c,render:A}},qe.isValidElement=F,qe.lazy=function(A){return{$$typeof:h,_payload:{_status:-1,_result:A},_init:H}},qe.memo=function(A,z){return{$$typeof:p,type:A,compare:z===void 0?null:z}},qe.startTransition=function(A){var z=Y.transition;Y.transition={};try{A()}finally{Y.transition=z}},qe.unstable_act=G,qe.useCallback=function(A,z){return te.current.useCallback(A,z)},qe.useContext=function(A){return te.current.useContext(A)},qe.useDebugValue=function(){},qe.useDeferredValue=function(A){return te.current.useDeferredValue(A)},qe.useEffect=function(A,z){return te.current.useEffect(A,z)},qe.useId=function(){return te.current.useId()},qe.useImperativeHandle=function(A,z,ae){return te.current.useImperativeHandle(A,z,ae)},qe.useInsertionEffect=function(A,z){return te.current.useInsertionEffect(A,z)},qe.useLayoutEffect=function(A,z){return te.current.useLayoutEffect(A,z)},qe.useMemo=function(A,z){return te.current.useMemo(A,z)},qe.useReducer=function(A,z,ae){return te.current.useReducer(A,z,ae)},qe.useRef=function(A){return te.current.useRef(A)},qe.useState=function(A){return te.current.useState(A)},qe.useSyncExternalStore=function(A,z,ae){return te.current.useSyncExternalStore(A,z,ae)},qe.useTransition=function(){return te.current.useTransition()},qe.version="18.3.1",qe}var R0;function po(){return R0||(R0=1,dc.exports=OT()),dc.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 j0;function LT(){if(j0)return Ws;j0=1;var e=po(),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,u={key:!0,ref:!0,__self:!0,__source:!0};function l(c,d,p){var h,m={},y=null,x=null;p!==void 0&&(y=""+p),d.key!==void 0&&(y=""+d.key),d.ref!==void 0&&(x=d.ref);for(h in d)s.call(d,h)&&!u.hasOwnProperty(h)&&(m[h]=d[h]);if(c&&c.defaultProps)for(h in d=c.defaultProps,d)m[h]===void 0&&(m[h]=d[h]);return{$$typeof:n,type:c,key:y,ref:x,props:m,_owner:o.current}}return Ws.Fragment=i,Ws.jsx=l,Ws.jsxs=l,Ws}var A0;function $T(){return A0||(A0=1,fc.exports=LT()),fc.exports}var v=$T(),Ra={},hc={exports:{}},Xt={},pc={exports:{}},mc={};/**
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 I0;function DT(){return I0||(I0=1,(function(e){function n(Y,$){var G=Y.length;Y.push($);e:for(;0<G;){var A=G-1>>>1,z=Y[A];if(0<o(z,$))Y[A]=$,Y[G]=z,G=A;else break e}}function i(Y){return Y.length===0?null:Y[0]}function s(Y){if(Y.length===0)return null;var $=Y[0],G=Y.pop();if(G!==$){Y[0]=G;e:for(var A=0,z=Y.length,ae=z>>>1;A<ae;){var D=2*(A+1)-1,V=Y[D],J=D+1,se=Y[J];if(0>o(V,G))J<z&&0>o(se,V)?(Y[A]=se,Y[J]=G,A=J):(Y[A]=V,Y[D]=G,A=D);else if(J<z&&0>o(se,G))Y[A]=se,Y[J]=G,A=J;else break e}}return $}function o(Y,$){var G=Y.sortIndex-$.sortIndex;return G!==0?G:Y.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var d=[],p=[],h=1,m=null,y=3,x=!1,C=!1,_=!1,S=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,b=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(Y){for(var $=i(p);$!==null;){if($.callback===null)s(p);else if($.startTime<=Y)s(p),$.sortIndex=$.expirationTime,n(d,$);else break;$=i(p)}}function N(Y){if(_=!1,E(Y),!C)if(i(d)!==null)C=!0,H(j);else{var $=i(p);$!==null&&te(N,$.startTime-Y)}}function j(Y,$){C=!1,_&&(_=!1,k(B),B=-1),x=!0;var G=y;try{for(E($),m=i(d);m!==null&&(!(m.expirationTime>$)||Y&&!O());){var A=m.callback;if(typeof A=="function"){m.callback=null,y=m.priorityLevel;var z=A(m.expirationTime<=$);$=e.unstable_now(),typeof z=="function"?m.callback=z:m===i(d)&&s(d),E($)}else s(d);m=i(d)}if(m!==null)var ae=!0;else{var D=i(p);D!==null&&te(N,D.startTime-$),ae=!1}return ae}finally{m=null,y=G,x=!1}}var I=!1,P=null,B=-1,M=5,F=-1;function O(){return!(e.unstable_now()-F<M)}function Q(){if(P!==null){var Y=e.unstable_now();F=Y;var $=!0;try{$=P(!0,Y)}finally{$?X():(I=!1,P=null)}}else I=!1}var X;if(typeof b=="function")X=function(){b(Q)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,K=R.port2;R.port1.onmessage=Q,X=function(){K.postMessage(null)}}else X=function(){S(Q,0)};function H(Y){P=Y,I||(I=!0,X())}function te(Y,$){B=S(function(){Y(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(Y){Y.callback=null},e.unstable_continueExecution=function(){C||x||(C=!0,H(j))},e.unstable_forceFrameRate=function(Y){0>Y||125<Y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<Y?Math.floor(1e3/Y):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return i(d)},e.unstable_next=function(Y){switch(y){case 1:case 2:case 3:var $=3;break;default:$=y}var G=y;y=$;try{return Y()}finally{y=G}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Y,$){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var G=y;y=Y;try{return $()}finally{y=G}},e.unstable_scheduleCallback=function(Y,$,G){var A=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?A+G:A):G=A,Y){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=G+z,Y={id:h++,callback:$,priorityLevel:Y,startTime:G,expirationTime:z,sortIndex:-1},G>A?(Y.sortIndex=G,n(p,Y),i(d)===null&&Y===i(p)&&(_?(k(B),B=-1):_=!0,te(N,G-A))):(Y.sortIndex=z,n(d,Y),C||x||(C=!0,H(j))),Y},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(Y){var $=y;return function(){var G=y;y=$;try{return Y.apply(this,arguments)}finally{y=G}}}})(mc)),mc}var M0;function FT(){return M0||(M0=1,pc.exports=DT()),pc.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 P0;function zT(){if(P0)return Xt;P0=1;var e=po(),n=FT();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 u(t,r){l(t,r),l(t+"Capture",r)}function l(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,p=/^[: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]*$/,h={},m={};function y(t){return d.call(m,t)?!0:d.call(h,t)?!1:p.test(t)?m[t]=!0:(h[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 C(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 k=/[\-:]([a-z])/g;function b(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(k,b);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(k,b);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(k,b);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")&&(C(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 N=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,j=Symbol.for("react.element"),I=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),O=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),te=Symbol.for("react.offscreen"),Y=Symbol.iterator;function $(t){return t===null||typeof t!="object"?null:(t=Y&&t[Y]||t["@@iterator"],typeof t=="function"?t:null)}var G=Object.assign,A;function z(t){if(A===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);A=r&&r[1]||""}return`
34
+ `+A+t}var ae=!1;function D(t,r){if(!t||ae)return"";ae=!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(re){var f=re}Reflect.construct(t,[],r)}else{try{r.call()}catch(re){f=re}t.call(r.prototype)}else{try{throw Error()}catch(re){f=re}t()}}catch(re){if(re&&f&&typeof re.stack=="string"){for(var g=re.stack.split(`
35
+ `),w=f.stack.split(`
36
+ `),T=g.length-1,L=w.length-1;1<=T&&0<=L&&g[T]!==w[L];)L--;for(;1<=T&&0<=L;T--,L--)if(g[T]!==w[L]){if(T!==1||L!==1)do if(T--,L--,0>L||g[T]!==w[L]){var U=`
37
+ `+g[T].replace(" at new "," at ");return t.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",t.displayName)),U}while(1<=T&&0<=L);break}}}finally{ae=!1,Error.prepareStackTrace=a}return(t=t?t.displayName||t.name:"")?z(t):""}function V(t){switch(t.tag){case 5:return z(t.type);case 16:return z("Lazy");case 13:return z("Suspense");case 19:return z("SuspenseList");case 0:case 2:case 15:return t=D(t.type,!1),t;case 11:return t=D(t.type.render,!1),t;case 1:return t=D(t.type,!0),t;default:return""}}function J(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 P:return"Fragment";case I:return"Portal";case M:return"Profiler";case B:return"StrictMode";case X:return"Suspense";case R:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case O:return(t.displayName||"Context")+".Consumer";case F:return(t._context.displayName||"Context")+".Provider";case Q:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case K:return r=t.displayName||null,r!==null?r:J(t.type)||"Memo";case H:r=t._payload,t=t._init;try{return J(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 J(r);case 8:return r===B?"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 ue(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function he(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function me(t){var r=he(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 je(t){t._valueTracker||(t._valueTracker=me(t))}function De(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var a=r.getValue(),f="";return t&&(f=he(t)?t.checked?"true":"false":t.value),t=f,t!==a?(r.setValue(t),!0):!1}function Me(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 Ie(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=ue(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 Ge(t,r){r=r.checked,r!=null&&E(t,"checked",r,!1)}function ye(t,r){Ge(t,r);var a=ue(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")?Ue(t,r.type,a):r.hasOwnProperty("defaultValue")&&Ue(t,r.type,ue(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(t.defaultChecked=!!r.defaultChecked)}function ge(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 Ue(t,r,a){(r!=="number"||Me(t.ownerDocument)!==t)&&(a==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+a&&(t.defaultValue=""+a))}var mt=Array.isArray;function wt(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=""+ue(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 st(t,r){if(r.dangerouslySetInnerHTML!=null)throw Error(i(91));return G({},r,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Ke(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(mt(a)){if(1<a.length)throw Error(i(93));a=a[0]}r=a}r==null&&(r=""),a=r}t._wrapperState={initialValue:ue(a)}}function Be(t,r){var a=ue(r.value),f=ue(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 Et(t){var r=t.textContent;r===t._wrapperState.initialValue&&r!==""&&r!==null&&(t.value=r)}function ft(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 Nt(t,r){return t==null||t==="http://www.w3.org/1999/xhtml"?ft(r):t==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var ot,Dt=(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(ot=ot||document.createElement("div"),ot.innerHTML="<svg>"+r.valueOf().toString()+"</svg>",r=ot.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;r.firstChild;)t.appendChild(r.firstChild)}});function xt(t,r){if(r){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=r;return}}t.textContent=r}var We={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},Ze=["Webkit","ms","Moz","O"];Object.keys(We).forEach(function(t){Ze.forEach(function(r){r=r+t.charAt(0).toUpperCase()+t.substring(1),We[r]=We[t]})});function at(t,r,a){return r==null||typeof r=="boolean"||r===""?"":a||typeof r!="number"||r===0||We.hasOwnProperty(t)&&We[t]?(""+r).trim():r+"px"}function dt(t,r){t=t.style;for(var a in r)if(r.hasOwnProperty(a)){var f=a.indexOf("--")===0,g=at(a,r[a],f);a==="float"&&(a="cssFloat"),f?t.setProperty(a,g):t[a]=g}}var un=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 Ft(t,r){if(r){if(un[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 gt(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 ln=null;function Gn(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var cn=null,nt=null,en=null;function jt(t){if(t=As(t)){if(typeof cn!="function")throw Error(i(280));var r=t.stateNode;r&&(r=Uo(r),cn(t.stateNode,t.type,r))}}function $n(t){nt?en?en.push(t):en=[t]:nt=t}function mr(){if(nt){var t=nt,r=en;if(en=nt=null,jt(t),r)for(t=0;t<r.length;t++)jt(r[t])}}function gr(t,r){return t(r)}function zt(){}var Vr=!1;function Wr(t,r,a){if(Vr)return t(r,a);Vr=!0;try{return gr(t,r,a)}finally{Vr=!1,(nt!==null||en!==null)&&(zt(),mr())}}function Kn(t,r){var a=t.stateNode;if(a===null)return null;var f=Uo(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 Gr=!1;if(c)try{var Dn={};Object.defineProperty(Dn,"passive",{get:function(){Gr=!0}}),window.addEventListener("test",Dn,Dn),window.removeEventListener("test",Dn,Dn)}catch{Gr=!1}function Yn(t,r,a,f,g,w,T,L,U){var re=Array.prototype.slice.call(arguments,3);try{r.apply(a,re)}catch(ce){this.onError(ce)}}var Xn=!1,ht=null,Qn=!1,Zn=null,Kr={onError:function(t){Xn=!0,ht=t}};function _i(t,r,a,f,g,w,T,L,U){Xn=!1,ht=null,Yn.apply(Kr,arguments)}function vr(t,r,a,f,g,w,T,L,U){if(_i.apply(this,arguments),Xn){if(Xn){var re=ht;Xn=!1,ht=null}else throw Error(i(198));Qn||(Qn=!0,Zn=re)}}function tn(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 Si(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 At(t){if(tn(t)!==t)throw Error(i(188))}function ne(t){var r=t.alternate;if(!r){if(r=tn(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 At(g),t;if(w===f)return At(g),r;w=w.sibling}throw Error(i(188))}if(a.return!==f.return)a=g,f=w;else{for(var T=!1,L=g.child;L;){if(L===a){T=!0,a=g,f=w;break}if(L===f){T=!0,f=g,a=w;break}L=L.sibling}if(!T){for(L=w.child;L;){if(L===a){T=!0,a=w,f=g;break}if(L===f){T=!0,f=w,a=g;break}L=L.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 ie(t){return t=ne(t),t!==null?pe(t):null}function pe(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var r=pe(t);if(r!==null)return r;t=t.sibling}return null}var we=n.unstable_scheduleCallback,Se=n.unstable_cancelCallback,Ne=n.unstable_shouldYield,Fe=n.unstable_requestPaint,Pe=n.unstable_now,fn=n.unstable_getCurrentPriorityLevel,ut=n.unstable_ImmediatePriority,Je=n.unstable_UserBlockingPriority,dn=n.unstable_NormalPriority,bi=n.unstable_LowPriority,ki=n.unstable_IdlePriority,yr=null,Ht=null;function ds(t){if(Ht&&typeof Ht.onCommitFiberRoot=="function")try{Ht.onCommitFiberRoot(yr,t,void 0,(t.current.flags&128)===128)}catch{}}var kn=Math.clz32?Math.clz32:eC,ZN=Math.log,JN=Math.LN2;function eC(t){return t>>>=0,t===0?32:31-(ZN(t)/JN|0)|0}var Eo=64,No=4194304;function hs(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 Co(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 L=T&~g;L!==0?f=hs(L):(w&=T,w!==0&&(f=hs(w)))}else T=a&~g,T!==0?f=hs(T):w!==0&&(f=hs(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-kn(r),g=1<<a,f|=t[a],r&=~g;return f}function tC(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 nC(t,r){for(var a=t.suspendedLanes,f=t.pingedLanes,g=t.expirationTimes,w=t.pendingLanes;0<w;){var T=31-kn(w),L=1<<T,U=g[T];U===-1?((L&a)===0||(L&f)!==0)&&(g[T]=tC(L,r)):U<=r&&(t.expiredLanes|=L),w&=~L}}function Iu(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function sv(){var t=Eo;return Eo<<=1,(Eo&4194240)===0&&(Eo=64),t}function Mu(t){for(var r=[],a=0;31>a;a++)r.push(t);return r}function ps(t,r,a){t.pendingLanes|=r,r!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,r=31-kn(r),t[r]=a}function rC(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-kn(a),w=1<<g;r[g]=0,f[g]=-1,t[g]=-1,a&=~w}}function Pu(t,r){var a=t.entangledLanes|=r;for(t=t.entanglements;a;){var f=31-kn(a),g=1<<f;g&r|t[f]&r&&(t[f]|=r),a&=~g}}var He=0;function ov(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var av,qu,uv,lv,cv,Ou=!1,To=[],wr=null,xr=null,_r=null,ms=new Map,gs=new Map,Sr=[],iC="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 fv(t,r){switch(t){case"focusin":case"focusout":wr=null;break;case"dragenter":case"dragleave":xr=null;break;case"mouseover":case"mouseout":_r=null;break;case"pointerover":case"pointerout":ms.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":gs.delete(r.pointerId)}}function vs(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=As(r),r!==null&&qu(r)),t):(t.eventSystemFlags|=f,r=t.targetContainers,g!==null&&r.indexOf(g)===-1&&r.push(g),t)}function sC(t,r,a,f,g){switch(r){case"focusin":return wr=vs(wr,t,r,a,f,g),!0;case"dragenter":return xr=vs(xr,t,r,a,f,g),!0;case"mouseover":return _r=vs(_r,t,r,a,f,g),!0;case"pointerover":var w=g.pointerId;return ms.set(w,vs(ms.get(w)||null,t,r,a,f,g)),!0;case"gotpointercapture":return w=g.pointerId,gs.set(w,vs(gs.get(w)||null,t,r,a,f,g)),!0}return!1}function dv(t){var r=Yr(t.target);if(r!==null){var a=tn(r);if(a!==null){if(r=a.tag,r===13){if(r=Si(a),r!==null){t.blockedOn=r,cv(t.priority,function(){uv(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 Ro(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var a=$u(t.domEventName,t.eventSystemFlags,r[0],t.nativeEvent);if(a===null){a=t.nativeEvent;var f=new a.constructor(a.type,a);ln=f,a.target.dispatchEvent(f),ln=null}else return r=As(a),r!==null&&qu(r),t.blockedOn=a,!1;r.shift()}return!0}function hv(t,r,a){Ro(t)&&a.delete(r)}function oC(){Ou=!1,wr!==null&&Ro(wr)&&(wr=null),xr!==null&&Ro(xr)&&(xr=null),_r!==null&&Ro(_r)&&(_r=null),ms.forEach(hv),gs.forEach(hv)}function ys(t,r){t.blockedOn===r&&(t.blockedOn=null,Ou||(Ou=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,oC)))}function ws(t){function r(g){return ys(g,t)}if(0<To.length){ys(To[0],t);for(var a=1;a<To.length;a++){var f=To[a];f.blockedOn===t&&(f.blockedOn=null)}}for(wr!==null&&ys(wr,t),xr!==null&&ys(xr,t),_r!==null&&ys(_r,t),ms.forEach(r),gs.forEach(r),a=0;a<Sr.length;a++)f=Sr[a],f.blockedOn===t&&(f.blockedOn=null);for(;0<Sr.length&&(a=Sr[0],a.blockedOn===null);)dv(a),a.blockedOn===null&&Sr.shift()}var Ei=N.ReactCurrentBatchConfig,jo=!0;function aC(t,r,a,f){var g=He,w=Ei.transition;Ei.transition=null;try{He=1,Lu(t,r,a,f)}finally{He=g,Ei.transition=w}}function uC(t,r,a,f){var g=He,w=Ei.transition;Ei.transition=null;try{He=4,Lu(t,r,a,f)}finally{He=g,Ei.transition=w}}function Lu(t,r,a,f){if(jo){var g=$u(t,r,a,f);if(g===null)tl(t,r,f,Ao,a),fv(t,f);else if(sC(g,t,r,a,f))f.stopPropagation();else if(fv(t,f),r&4&&-1<iC.indexOf(t)){for(;g!==null;){var w=As(g);if(w!==null&&av(w),w=$u(t,r,a,f),w===null&&tl(t,r,f,Ao,a),w===g)break;g=w}g!==null&&f.stopPropagation()}else tl(t,r,f,null,a)}}var Ao=null;function $u(t,r,a,f){if(Ao=null,t=Gn(f),t=Yr(t),t!==null)if(r=tn(t),r===null)t=null;else if(a=r.tag,a===13){if(t=Si(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 Ao=t,null}function pv(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(fn()){case ut:return 1;case Je:return 4;case dn:case bi:return 16;case ki:return 536870912;default:return 16}default:return 16}}var br=null,Du=null,Io=null;function mv(){if(Io)return Io;var t,r=Du,a=r.length,f,g="value"in br?br.value:br.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 Io=g.slice(t,1<f?1-f:void 0)}function Mo(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 Po(){return!0}function gv(){return!1}function nn(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 L in t)t.hasOwnProperty(L)&&(a=t[L],this[L]=a?a(w):w[L]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?Po:gv,this.isPropagationStopped=gv,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=Po)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Po)},persist:function(){},isPersistent:Po}),r}var Ni={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fu=nn(Ni),xs=G({},Ni,{view:0,detail:0}),lC=nn(xs),zu,Bu,_s,qo=G({},xs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hu,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!==_s&&(_s&&t.type==="mousemove"?(zu=t.screenX-_s.screenX,Bu=t.screenY-_s.screenY):Bu=zu=0,_s=t),zu)},movementY:function(t){return"movementY"in t?t.movementY:Bu}}),vv=nn(qo),cC=G({},qo,{dataTransfer:0}),fC=nn(cC),dC=G({},xs,{relatedTarget:0}),Uu=nn(dC),hC=G({},Ni,{animationName:0,elapsedTime:0,pseudoElement:0}),pC=nn(hC),mC=G({},Ni,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),gC=nn(mC),vC=G({},Ni,{data:0}),yv=nn(vC),yC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wC={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"},xC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _C(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=xC[t])?!!r[t]:!1}function Hu(){return _C}var SC=G({},xs,{key:function(t){if(t.key){var r=yC[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Mo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?wC[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hu,charCode:function(t){return t.type==="keypress"?Mo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Mo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),bC=nn(SC),kC=G({},qo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wv=nn(kC),EC=G({},xs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hu}),NC=nn(EC),CC=G({},Ni,{propertyName:0,elapsedTime:0,pseudoElement:0}),TC=nn(CC),RC=G({},qo,{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}),jC=nn(RC),AC=[9,13,27,32],Vu=c&&"CompositionEvent"in window,Ss=null;c&&"documentMode"in document&&(Ss=document.documentMode);var IC=c&&"TextEvent"in window&&!Ss,xv=c&&(!Vu||Ss&&8<Ss&&11>=Ss),_v=" ",Sv=!1;function bv(t,r){switch(t){case"keyup":return AC.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kv(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ci=!1;function MC(t,r){switch(t){case"compositionend":return kv(r);case"keypress":return r.which!==32?null:(Sv=!0,_v);case"textInput":return t=r.data,t===_v&&Sv?null:t;default:return null}}function PC(t,r){if(Ci)return t==="compositionend"||!Vu&&bv(t,r)?(t=mv(),Io=Du=br=null,Ci=!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 xv&&r.locale!=="ko"?null:r.data;default:return null}}var qC={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 Ev(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!qC[t.type]:r==="textarea"}function Nv(t,r,a,f){$n(f),r=Fo(r,"onChange"),0<r.length&&(a=new Fu("onChange","change",null,a,f),t.push({event:a,listeners:r}))}var bs=null,ks=null;function OC(t){Hv(t,0)}function Oo(t){var r=Ii(t);if(De(r))return t}function LC(t,r){if(t==="change")return r}var Cv=!1;if(c){var Wu;if(c){var Gu="oninput"in document;if(!Gu){var Tv=document.createElement("div");Tv.setAttribute("oninput","return;"),Gu=typeof Tv.oninput=="function"}Wu=Gu}else Wu=!1;Cv=Wu&&(!document.documentMode||9<document.documentMode)}function Rv(){bs&&(bs.detachEvent("onpropertychange",jv),ks=bs=null)}function jv(t){if(t.propertyName==="value"&&Oo(ks)){var r=[];Nv(r,ks,t,Gn(t)),Wr(OC,r)}}function $C(t,r,a){t==="focusin"?(Rv(),bs=r,ks=a,bs.attachEvent("onpropertychange",jv)):t==="focusout"&&Rv()}function DC(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Oo(ks)}function FC(t,r){if(t==="click")return Oo(r)}function zC(t,r){if(t==="input"||t==="change")return Oo(r)}function BC(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var En=typeof Object.is=="function"?Object.is:BC;function Es(t,r){if(En(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)||!En(t[g],r[g]))return!1}return!0}function Av(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Iv(t,r){var a=Av(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=Av(a)}}function Mv(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?Mv(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Pv(){for(var t=window,r=Me();r instanceof t.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)t=r.contentWindow;else break;r=Me(t.document)}return r}function Ku(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 UC(t){var r=Pv(),a=t.focusedElem,f=t.selectionRange;if(r!==a&&a&&a.ownerDocument&&Mv(a.ownerDocument.documentElement,a)){if(f!==null&&Ku(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=Iv(a,w);var T=Iv(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 HC=c&&"documentMode"in document&&11>=document.documentMode,Ti=null,Yu=null,Ns=null,Xu=!1;function qv(t,r,a){var f=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Xu||Ti==null||Ti!==Me(f)||(f=Ti,"selectionStart"in f&&Ku(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}),Ns&&Es(Ns,f)||(Ns=f,f=Fo(Yu,"onSelect"),0<f.length&&(r=new Fu("onSelect","select",null,r,a),t.push({event:r,listeners:f}),r.target=Ti)))}function Lo(t,r){var a={};return a[t.toLowerCase()]=r.toLowerCase(),a["Webkit"+t]="webkit"+r,a["Moz"+t]="moz"+r,a}var Ri={animationend:Lo("Animation","AnimationEnd"),animationiteration:Lo("Animation","AnimationIteration"),animationstart:Lo("Animation","AnimationStart"),transitionend:Lo("Transition","TransitionEnd")},Qu={},Ov={};c&&(Ov=document.createElement("div").style,"AnimationEvent"in window||(delete Ri.animationend.animation,delete Ri.animationiteration.animation,delete Ri.animationstart.animation),"TransitionEvent"in window||delete Ri.transitionend.transition);function $o(t){if(Qu[t])return Qu[t];if(!Ri[t])return t;var r=Ri[t],a;for(a in r)if(r.hasOwnProperty(a)&&a in Ov)return Qu[t]=r[a];return t}var Lv=$o("animationend"),$v=$o("animationiteration"),Dv=$o("animationstart"),Fv=$o("transitionend"),zv=new Map,Bv="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 kr(t,r){zv.set(t,r),u(r,[t])}for(var Zu=0;Zu<Bv.length;Zu++){var Ju=Bv[Zu],VC=Ju.toLowerCase(),WC=Ju[0].toUpperCase()+Ju.slice(1);kr(VC,"on"+WC)}kr(Lv,"onAnimationEnd"),kr($v,"onAnimationIteration"),kr(Dv,"onAnimationStart"),kr("dblclick","onDoubleClick"),kr("focusin","onFocus"),kr("focusout","onBlur"),kr(Fv,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Cs="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(" "),GC=new Set("cancel close invalid load scroll toggle".split(" ").concat(Cs));function Uv(t,r,a){var f=t.type||"unknown-event";t.currentTarget=a,vr(f,r,void 0,t),t.currentTarget=null}function Hv(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 L=f[T],U=L.instance,re=L.currentTarget;if(L=L.listener,U!==w&&g.isPropagationStopped())break e;Uv(g,L,re),w=U}else for(T=0;T<f.length;T++){if(L=f[T],U=L.instance,re=L.currentTarget,L=L.listener,U!==w&&g.isPropagationStopped())break e;Uv(g,L,re),w=U}}}if(Qn)throw t=Zn,Qn=!1,Zn=null,t}function Xe(t,r){var a=r[al];a===void 0&&(a=r[al]=new Set);var f=t+"__bubble";a.has(f)||(Vv(r,t,2,!1),a.add(f))}function el(t,r,a){var f=0;r&&(f|=4),Vv(a,t,f,r)}var Do="_reactListening"+Math.random().toString(36).slice(2);function Ts(t){if(!t[Do]){t[Do]=!0,s.forEach(function(a){a!=="selectionchange"&&(GC.has(a)||el(a,!1,t),el(a,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[Do]||(r[Do]=!0,el("selectionchange",!1,r))}}function Vv(t,r,a,f){switch(pv(r)){case 1:var g=aC;break;case 4:g=uC;break;default:g=Lu}a=g.bind(null,r,a,t),g=void 0,!Gr||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 tl(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 L=f.stateNode.containerInfo;if(L===g||L.nodeType===8&&L.parentNode===g)break;if(T===4)for(T=f.return;T!==null;){var U=T.tag;if((U===3||U===4)&&(U=T.stateNode.containerInfo,U===g||U.nodeType===8&&U.parentNode===g))return;T=T.return}for(;L!==null;){if(T=Yr(L),T===null)return;if(U=T.tag,U===5||U===6){f=w=T;continue e}L=L.parentNode}}f=f.return}Wr(function(){var re=w,ce=Gn(a),fe=[];e:{var le=zv.get(t);if(le!==void 0){var ve=Fu,_e=t;switch(t){case"keypress":if(Mo(a)===0)break e;case"keydown":case"keyup":ve=bC;break;case"focusin":_e="focus",ve=Uu;break;case"focusout":_e="blur",ve=Uu;break;case"beforeblur":case"afterblur":ve=Uu;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":ve=vv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ve=fC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ve=NC;break;case Lv:case $v:case Dv:ve=pC;break;case Fv:ve=TC;break;case"scroll":ve=lC;break;case"wheel":ve=jC;break;case"copy":case"cut":case"paste":ve=gC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ve=wv}var be=(r&4)!==0,pt=!be&&t==="scroll",Z=be?le!==null?le+"Capture":null:le;be=[];for(var W=re,ee;W!==null;){ee=W;var de=ee.stateNode;if(ee.tag===5&&de!==null&&(ee=de,Z!==null&&(de=Kn(W,Z),de!=null&&be.push(Rs(W,de,ee)))),pt)break;W=W.return}0<be.length&&(le=new ve(le,_e,null,a,ce),fe.push({event:le,listeners:be}))}}if((r&7)===0){e:{if(le=t==="mouseover"||t==="pointerover",ve=t==="mouseout"||t==="pointerout",le&&a!==ln&&(_e=a.relatedTarget||a.fromElement)&&(Yr(_e)||_e[Jn]))break e;if((ve||le)&&(le=ce.window===ce?ce:(le=ce.ownerDocument)?le.defaultView||le.parentWindow:window,ve?(_e=a.relatedTarget||a.toElement,ve=re,_e=_e?Yr(_e):null,_e!==null&&(pt=tn(_e),_e!==pt||_e.tag!==5&&_e.tag!==6)&&(_e=null)):(ve=null,_e=re),ve!==_e)){if(be=vv,de="onMouseLeave",Z="onMouseEnter",W="mouse",(t==="pointerout"||t==="pointerover")&&(be=wv,de="onPointerLeave",Z="onPointerEnter",W="pointer"),pt=ve==null?le:Ii(ve),ee=_e==null?le:Ii(_e),le=new be(de,W+"leave",ve,a,ce),le.target=pt,le.relatedTarget=ee,de=null,Yr(ce)===re&&(be=new be(Z,W+"enter",_e,a,ce),be.target=ee,be.relatedTarget=pt,de=be),pt=de,ve&&_e)t:{for(be=ve,Z=_e,W=0,ee=be;ee;ee=ji(ee))W++;for(ee=0,de=Z;de;de=ji(de))ee++;for(;0<W-ee;)be=ji(be),W--;for(;0<ee-W;)Z=ji(Z),ee--;for(;W--;){if(be===Z||Z!==null&&be===Z.alternate)break t;be=ji(be),Z=ji(Z)}be=null}else be=null;ve!==null&&Wv(fe,le,ve,be,!1),_e!==null&&pt!==null&&Wv(fe,pt,_e,be,!0)}}e:{if(le=re?Ii(re):window,ve=le.nodeName&&le.nodeName.toLowerCase(),ve==="select"||ve==="input"&&le.type==="file")var Ee=LC;else if(Ev(le))if(Cv)Ee=zC;else{Ee=DC;var Te=$C}else(ve=le.nodeName)&&ve.toLowerCase()==="input"&&(le.type==="checkbox"||le.type==="radio")&&(Ee=FC);if(Ee&&(Ee=Ee(t,re))){Nv(fe,Ee,a,ce);break e}Te&&Te(t,le,re),t==="focusout"&&(Te=le._wrapperState)&&Te.controlled&&le.type==="number"&&Ue(le,"number",le.value)}switch(Te=re?Ii(re):window,t){case"focusin":(Ev(Te)||Te.contentEditable==="true")&&(Ti=Te,Yu=re,Ns=null);break;case"focusout":Ns=Yu=Ti=null;break;case"mousedown":Xu=!0;break;case"contextmenu":case"mouseup":case"dragend":Xu=!1,qv(fe,a,ce);break;case"selectionchange":if(HC)break;case"keydown":case"keyup":qv(fe,a,ce)}var Re;if(Vu)e:{switch(t){case"compositionstart":var Ae="onCompositionStart";break e;case"compositionend":Ae="onCompositionEnd";break e;case"compositionupdate":Ae="onCompositionUpdate";break e}Ae=void 0}else Ci?bv(t,a)&&(Ae="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(Ae="onCompositionStart");Ae&&(xv&&a.locale!=="ko"&&(Ci||Ae!=="onCompositionStart"?Ae==="onCompositionEnd"&&Ci&&(Re=mv()):(br=ce,Du="value"in br?br.value:br.textContent,Ci=!0)),Te=Fo(re,Ae),0<Te.length&&(Ae=new yv(Ae,t,null,a,ce),fe.push({event:Ae,listeners:Te}),Re?Ae.data=Re:(Re=kv(a),Re!==null&&(Ae.data=Re)))),(Re=IC?MC(t,a):PC(t,a))&&(re=Fo(re,"onBeforeInput"),0<re.length&&(ce=new yv("onBeforeInput","beforeinput",null,a,ce),fe.push({event:ce,listeners:re}),ce.data=Re))}Hv(fe,r)})}function Rs(t,r,a){return{instance:t,listener:r,currentTarget:a}}function Fo(t,r){for(var a=r+"Capture",f=[];t!==null;){var g=t,w=g.stateNode;g.tag===5&&w!==null&&(g=w,w=Kn(t,a),w!=null&&f.unshift(Rs(t,w,g)),w=Kn(t,r),w!=null&&f.push(Rs(t,w,g))),t=t.return}return f}function ji(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Wv(t,r,a,f,g){for(var w=r._reactName,T=[];a!==null&&a!==f;){var L=a,U=L.alternate,re=L.stateNode;if(U!==null&&U===f)break;L.tag===5&&re!==null&&(L=re,g?(U=Kn(a,w),U!=null&&T.unshift(Rs(a,U,L))):g||(U=Kn(a,w),U!=null&&T.push(Rs(a,U,L)))),a=a.return}T.length!==0&&t.push({event:r,listeners:T})}var KC=/\r\n?/g,YC=/\u0000|\uFFFD/g;function Gv(t){return(typeof t=="string"?t:""+t).replace(KC,`
38
+ `).replace(YC,"")}function zo(t,r,a){if(r=Gv(r),Gv(t)!==r&&a)throw Error(i(425))}function Bo(){}var nl=null,rl=null;function il(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 sl=typeof setTimeout=="function"?setTimeout:void 0,XC=typeof clearTimeout=="function"?clearTimeout:void 0,Kv=typeof Promise=="function"?Promise:void 0,QC=typeof queueMicrotask=="function"?queueMicrotask:typeof Kv<"u"?function(t){return Kv.resolve(null).then(t).catch(ZC)}:sl;function ZC(t){setTimeout(function(){throw t})}function ol(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),ws(r);return}f--}else a!=="$"&&a!=="$?"&&a!=="$!"||f++;a=g}while(a);ws(r)}function Er(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 Yv(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 Ai=Math.random().toString(36).slice(2),Fn="__reactFiber$"+Ai,js="__reactProps$"+Ai,Jn="__reactContainer$"+Ai,al="__reactEvents$"+Ai,JC="__reactListeners$"+Ai,eT="__reactHandles$"+Ai;function Yr(t){var r=t[Fn];if(r)return r;for(var a=t.parentNode;a;){if(r=a[Jn]||a[Fn]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(t=Yv(t);t!==null;){if(a=t[Fn])return a;t=Yv(t)}return r}t=a,a=t.parentNode}return null}function As(t){return t=t[Fn]||t[Jn],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Ii(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(i(33))}function Uo(t){return t[js]||null}var ul=[],Mi=-1;function Nr(t){return{current:t}}function Qe(t){0>Mi||(t.current=ul[Mi],ul[Mi]=null,Mi--)}function Ye(t,r){Mi++,ul[Mi]=t.current,t.current=r}var Cr={},qt=Nr(Cr),Vt=Nr(!1),Xr=Cr;function Pi(t,r){var a=t.type.contextTypes;if(!a)return Cr;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 Wt(t){return t=t.childContextTypes,t!=null}function Ho(){Qe(Vt),Qe(qt)}function Xv(t,r,a){if(qt.current!==Cr)throw Error(i(168));Ye(qt,r),Ye(Vt,a)}function Qv(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 Vo(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Cr,Xr=qt.current,Ye(qt,t),Ye(Vt,Vt.current),!0}function Zv(t,r,a){var f=t.stateNode;if(!f)throw Error(i(169));a?(t=Qv(t,r,Xr),f.__reactInternalMemoizedMergedChildContext=t,Qe(Vt),Qe(qt),Ye(qt,t)):Qe(Vt),Ye(Vt,a)}var er=null,Wo=!1,ll=!1;function Jv(t){er===null?er=[t]:er.push(t)}function tT(t){Wo=!0,Jv(t)}function Tr(){if(!ll&&er!==null){ll=!0;var t=0,r=He;try{var a=er;for(He=1;t<a.length;t++){var f=a[t];do f=f(!0);while(f!==null)}er=null,Wo=!1}catch(g){throw er!==null&&(er=er.slice(t+1)),we(ut,Tr),g}finally{He=r,ll=!1}}return null}var qi=[],Oi=0,Go=null,Ko=0,hn=[],pn=0,Qr=null,tr=1,nr="";function Zr(t,r){qi[Oi++]=Ko,qi[Oi++]=Go,Go=t,Ko=r}function ey(t,r,a){hn[pn++]=tr,hn[pn++]=nr,hn[pn++]=Qr,Qr=t;var f=tr;t=nr;var g=32-kn(f)-1;f&=~(1<<g),a+=1;var w=32-kn(r)+g;if(30<w){var T=g-g%5;w=(f&(1<<T)-1).toString(32),f>>=T,g-=T,tr=1<<32-kn(r)+g|a<<g|f,nr=w+t}else tr=1<<w|a<<g|f,nr=t}function cl(t){t.return!==null&&(Zr(t,1),ey(t,1,0))}function fl(t){for(;t===Go;)Go=qi[--Oi],qi[Oi]=null,Ko=qi[--Oi],qi[Oi]=null;for(;t===Qr;)Qr=hn[--pn],hn[pn]=null,nr=hn[--pn],hn[pn]=null,tr=hn[--pn],hn[pn]=null}var rn=null,sn=null,et=!1,Nn=null;function ty(t,r){var a=yn(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 ny(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,rn=t,sn=Er(r.firstChild),!0):!1;case 6:return r=t.pendingProps===""||r.nodeType!==3?null:r,r!==null?(t.stateNode=r,rn=t,sn=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(a=Qr!==null?{id:tr,overflow:nr}:null,t.memoizedState={dehydrated:r,treeContext:a,retryLane:1073741824},a=yn(18,null,null,0),a.stateNode=r,a.return=t,t.child=a,rn=t,sn=null,!0):!1;default:return!1}}function dl(t){return(t.mode&1)!==0&&(t.flags&128)===0}function hl(t){if(et){var r=sn;if(r){var a=r;if(!ny(t,r)){if(dl(t))throw Error(i(418));r=Er(a.nextSibling);var f=rn;r&&ny(t,r)?ty(f,a):(t.flags=t.flags&-4097|2,et=!1,rn=t)}}else{if(dl(t))throw Error(i(418));t.flags=t.flags&-4097|2,et=!1,rn=t}}}function ry(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;rn=t}function Yo(t){if(t!==rn)return!1;if(!et)return ry(t),et=!0,!1;var r;if((r=t.tag!==3)&&!(r=t.tag!==5)&&(r=t.type,r=r!=="head"&&r!=="body"&&!il(t.type,t.memoizedProps)),r&&(r=sn)){if(dl(t))throw iy(),Error(i(418));for(;r;)ty(t,r),r=Er(r.nextSibling)}if(ry(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){sn=Er(t.nextSibling);break e}r--}else a!=="$"&&a!=="$!"&&a!=="$?"||r++}t=t.nextSibling}sn=null}}else sn=rn?Er(t.stateNode.nextSibling):null;return!0}function iy(){for(var t=sn;t;)t=Er(t.nextSibling)}function Li(){sn=rn=null,et=!1}function pl(t){Nn===null?Nn=[t]:Nn.push(t)}var nT=N.ReactCurrentBatchConfig;function Is(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 L=g.refs;T===null?delete L[w]:L[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 Xo(t,r){throw t=Object.prototype.toString.call(r),Error(i(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t))}function sy(t){var r=t._init;return r(t._payload)}function oy(t){function r(Z,W){if(t){var ee=Z.deletions;ee===null?(Z.deletions=[W],Z.flags|=16):ee.push(W)}}function a(Z,W){if(!t)return null;for(;W!==null;)r(Z,W),W=W.sibling;return null}function f(Z,W){for(Z=new Map;W!==null;)W.key!==null?Z.set(W.key,W):Z.set(W.index,W),W=W.sibling;return Z}function g(Z,W){return Z=Or(Z,W),Z.index=0,Z.sibling=null,Z}function w(Z,W,ee){return Z.index=ee,t?(ee=Z.alternate,ee!==null?(ee=ee.index,ee<W?(Z.flags|=2,W):ee):(Z.flags|=2,W)):(Z.flags|=1048576,W)}function T(Z){return t&&Z.alternate===null&&(Z.flags|=2),Z}function L(Z,W,ee,de){return W===null||W.tag!==6?(W=sc(ee,Z.mode,de),W.return=Z,W):(W=g(W,ee),W.return=Z,W)}function U(Z,W,ee,de){var Ee=ee.type;return Ee===P?ce(Z,W,ee.props.children,de,ee.key):W!==null&&(W.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===H&&sy(Ee)===W.type)?(de=g(W,ee.props),de.ref=Is(Z,W,ee),de.return=Z,de):(de=xa(ee.type,ee.key,ee.props,null,Z.mode,de),de.ref=Is(Z,W,ee),de.return=Z,de)}function re(Z,W,ee,de){return W===null||W.tag!==4||W.stateNode.containerInfo!==ee.containerInfo||W.stateNode.implementation!==ee.implementation?(W=oc(ee,Z.mode,de),W.return=Z,W):(W=g(W,ee.children||[]),W.return=Z,W)}function ce(Z,W,ee,de,Ee){return W===null||W.tag!==7?(W=oi(ee,Z.mode,de,Ee),W.return=Z,W):(W=g(W,ee),W.return=Z,W)}function fe(Z,W,ee){if(typeof W=="string"&&W!==""||typeof W=="number")return W=sc(""+W,Z.mode,ee),W.return=Z,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case j:return ee=xa(W.type,W.key,W.props,null,Z.mode,ee),ee.ref=Is(Z,null,W),ee.return=Z,ee;case I:return W=oc(W,Z.mode,ee),W.return=Z,W;case H:var de=W._init;return fe(Z,de(W._payload),ee)}if(mt(W)||$(W))return W=oi(W,Z.mode,ee,null),W.return=Z,W;Xo(Z,W)}return null}function le(Z,W,ee,de){var Ee=W!==null?W.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number")return Ee!==null?null:L(Z,W,""+ee,de);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case j:return ee.key===Ee?U(Z,W,ee,de):null;case I:return ee.key===Ee?re(Z,W,ee,de):null;case H:return Ee=ee._init,le(Z,W,Ee(ee._payload),de)}if(mt(ee)||$(ee))return Ee!==null?null:ce(Z,W,ee,de,null);Xo(Z,ee)}return null}function ve(Z,W,ee,de,Ee){if(typeof de=="string"&&de!==""||typeof de=="number")return Z=Z.get(ee)||null,L(W,Z,""+de,Ee);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case j:return Z=Z.get(de.key===null?ee:de.key)||null,U(W,Z,de,Ee);case I:return Z=Z.get(de.key===null?ee:de.key)||null,re(W,Z,de,Ee);case H:var Te=de._init;return ve(Z,W,ee,Te(de._payload),Ee)}if(mt(de)||$(de))return Z=Z.get(ee)||null,ce(W,Z,de,Ee,null);Xo(W,de)}return null}function _e(Z,W,ee,de){for(var Ee=null,Te=null,Re=W,Ae=W=0,Rt=null;Re!==null&&Ae<ee.length;Ae++){Re.index>Ae?(Rt=Re,Re=null):Rt=Re.sibling;var ze=le(Z,Re,ee[Ae],de);if(ze===null){Re===null&&(Re=Rt);break}t&&Re&&ze.alternate===null&&r(Z,Re),W=w(ze,W,Ae),Te===null?Ee=ze:Te.sibling=ze,Te=ze,Re=Rt}if(Ae===ee.length)return a(Z,Re),et&&Zr(Z,Ae),Ee;if(Re===null){for(;Ae<ee.length;Ae++)Re=fe(Z,ee[Ae],de),Re!==null&&(W=w(Re,W,Ae),Te===null?Ee=Re:Te.sibling=Re,Te=Re);return et&&Zr(Z,Ae),Ee}for(Re=f(Z,Re);Ae<ee.length;Ae++)Rt=ve(Re,Z,Ae,ee[Ae],de),Rt!==null&&(t&&Rt.alternate!==null&&Re.delete(Rt.key===null?Ae:Rt.key),W=w(Rt,W,Ae),Te===null?Ee=Rt:Te.sibling=Rt,Te=Rt);return t&&Re.forEach(function(Lr){return r(Z,Lr)}),et&&Zr(Z,Ae),Ee}function be(Z,W,ee,de){var Ee=$(ee);if(typeof Ee!="function")throw Error(i(150));if(ee=Ee.call(ee),ee==null)throw Error(i(151));for(var Te=Ee=null,Re=W,Ae=W=0,Rt=null,ze=ee.next();Re!==null&&!ze.done;Ae++,ze=ee.next()){Re.index>Ae?(Rt=Re,Re=null):Rt=Re.sibling;var Lr=le(Z,Re,ze.value,de);if(Lr===null){Re===null&&(Re=Rt);break}t&&Re&&Lr.alternate===null&&r(Z,Re),W=w(Lr,W,Ae),Te===null?Ee=Lr:Te.sibling=Lr,Te=Lr,Re=Rt}if(ze.done)return a(Z,Re),et&&Zr(Z,Ae),Ee;if(Re===null){for(;!ze.done;Ae++,ze=ee.next())ze=fe(Z,ze.value,de),ze!==null&&(W=w(ze,W,Ae),Te===null?Ee=ze:Te.sibling=ze,Te=ze);return et&&Zr(Z,Ae),Ee}for(Re=f(Z,Re);!ze.done;Ae++,ze=ee.next())ze=ve(Re,Z,Ae,ze.value,de),ze!==null&&(t&&ze.alternate!==null&&Re.delete(ze.key===null?Ae:ze.key),W=w(ze,W,Ae),Te===null?Ee=ze:Te.sibling=ze,Te=ze);return t&&Re.forEach(function(qT){return r(Z,qT)}),et&&Zr(Z,Ae),Ee}function pt(Z,W,ee,de){if(typeof ee=="object"&&ee!==null&&ee.type===P&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case j:e:{for(var Ee=ee.key,Te=W;Te!==null;){if(Te.key===Ee){if(Ee=ee.type,Ee===P){if(Te.tag===7){a(Z,Te.sibling),W=g(Te,ee.props.children),W.return=Z,Z=W;break e}}else if(Te.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===H&&sy(Ee)===Te.type){a(Z,Te.sibling),W=g(Te,ee.props),W.ref=Is(Z,Te,ee),W.return=Z,Z=W;break e}a(Z,Te);break}else r(Z,Te);Te=Te.sibling}ee.type===P?(W=oi(ee.props.children,Z.mode,de,ee.key),W.return=Z,Z=W):(de=xa(ee.type,ee.key,ee.props,null,Z.mode,de),de.ref=Is(Z,W,ee),de.return=Z,Z=de)}return T(Z);case I:e:{for(Te=ee.key;W!==null;){if(W.key===Te)if(W.tag===4&&W.stateNode.containerInfo===ee.containerInfo&&W.stateNode.implementation===ee.implementation){a(Z,W.sibling),W=g(W,ee.children||[]),W.return=Z,Z=W;break e}else{a(Z,W);break}else r(Z,W);W=W.sibling}W=oc(ee,Z.mode,de),W.return=Z,Z=W}return T(Z);case H:return Te=ee._init,pt(Z,W,Te(ee._payload),de)}if(mt(ee))return _e(Z,W,ee,de);if($(ee))return be(Z,W,ee,de);Xo(Z,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"?(ee=""+ee,W!==null&&W.tag===6?(a(Z,W.sibling),W=g(W,ee),W.return=Z,Z=W):(a(Z,W),W=sc(ee,Z.mode,de),W.return=Z,Z=W),T(Z)):a(Z,W)}return pt}var $i=oy(!0),ay=oy(!1),Qo=Nr(null),Zo=null,Di=null,ml=null;function gl(){ml=Di=Zo=null}function vl(t){var r=Qo.current;Qe(Qo),t._currentValue=r}function yl(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 Fi(t,r){Zo=t,ml=Di=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&r)!==0&&(Gt=!0),t.firstContext=null)}function mn(t){var r=t._currentValue;if(ml!==t)if(t={context:t,memoizedValue:r,next:null},Di===null){if(Zo===null)throw Error(i(308));Di=t,Zo.dependencies={lanes:0,firstContext:t}}else Di=Di.next=t;return r}var Jr=null;function wl(t){Jr===null?Jr=[t]:Jr.push(t)}function uy(t,r,a,f){var g=r.interleaved;return g===null?(a.next=a,wl(r)):(a.next=g.next,g.next=a),r.interleaved=a,rr(t,f)}function rr(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 Rr=!1;function xl(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ly(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 ir(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,(Le&2)!==0){var g=f.pending;return g===null?r.next=r:(r.next=g.next,g.next=r),f.pending=r,rr(t,a)}return g=f.interleaved,g===null?(r.next=r,wl(f)):(r.next=g.next,g.next=r),f.interleaved=r,rr(t,a)}function Jo(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,Pu(t,a)}}function cy(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 ea(t,r,a,f){var g=t.updateQueue;Rr=!1;var w=g.firstBaseUpdate,T=g.lastBaseUpdate,L=g.shared.pending;if(L!==null){g.shared.pending=null;var U=L,re=U.next;U.next=null,T===null?w=re:T.next=re,T=U;var ce=t.alternate;ce!==null&&(ce=ce.updateQueue,L=ce.lastBaseUpdate,L!==T&&(L===null?ce.firstBaseUpdate=re:L.next=re,ce.lastBaseUpdate=U))}if(w!==null){var fe=g.baseState;T=0,ce=re=U=null,L=w;do{var le=L.lane,ve=L.eventTime;if((f&le)===le){ce!==null&&(ce=ce.next={eventTime:ve,lane:0,tag:L.tag,payload:L.payload,callback:L.callback,next:null});e:{var _e=t,be=L;switch(le=r,ve=a,be.tag){case 1:if(_e=be.payload,typeof _e=="function"){fe=_e.call(ve,fe,le);break e}fe=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=be.payload,le=typeof _e=="function"?_e.call(ve,fe,le):_e,le==null)break e;fe=G({},fe,le);break e;case 2:Rr=!0}}L.callback!==null&&L.lane!==0&&(t.flags|=64,le=g.effects,le===null?g.effects=[L]:le.push(L))}else ve={eventTime:ve,lane:le,tag:L.tag,payload:L.payload,callback:L.callback,next:null},ce===null?(re=ce=ve,U=fe):ce=ce.next=ve,T|=le;if(L=L.next,L===null){if(L=g.shared.pending,L===null)break;le=L,L=le.next,le.next=null,g.lastBaseUpdate=le,g.shared.pending=null}}while(!0);if(ce===null&&(U=fe),g.baseState=U,g.firstBaseUpdate=re,g.lastBaseUpdate=ce,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);ni|=T,t.lanes=T,t.memoizedState=fe}}function fy(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 Ms={},zn=Nr(Ms),Ps=Nr(Ms),qs=Nr(Ms);function ei(t){if(t===Ms)throw Error(i(174));return t}function _l(t,r){switch(Ye(qs,r),Ye(Ps,t),Ye(zn,Ms),t=r.nodeType,t){case 9:case 11:r=(r=r.documentElement)?r.namespaceURI:Nt(null,"");break;default:t=t===8?r.parentNode:r,r=t.namespaceURI||null,t=t.tagName,r=Nt(r,t)}Qe(zn),Ye(zn,r)}function zi(){Qe(zn),Qe(Ps),Qe(qs)}function dy(t){ei(qs.current);var r=ei(zn.current),a=Nt(r,t.type);r!==a&&(Ye(Ps,t),Ye(zn,a))}function Sl(t){Ps.current===t&&(Qe(zn),Qe(Ps))}var rt=Nr(0);function ta(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 bl=[];function kl(){for(var t=0;t<bl.length;t++)bl[t]._workInProgressVersionPrimary=null;bl.length=0}var na=N.ReactCurrentDispatcher,El=N.ReactCurrentBatchConfig,ti=0,it=null,_t=null,Ct=null,ra=!1,Os=!1,Ls=0,rT=0;function Ot(){throw Error(i(321))}function Nl(t,r){if(r===null)return!1;for(var a=0;a<r.length&&a<t.length;a++)if(!En(t[a],r[a]))return!1;return!0}function Cl(t,r,a,f,g,w){if(ti=w,it=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,na.current=t===null||t.memoizedState===null?aT:uT,t=a(f,g),Os){w=0;do{if(Os=!1,Ls=0,25<=w)throw Error(i(301));w+=1,Ct=_t=null,r.updateQueue=null,na.current=lT,t=a(f,g)}while(Os)}if(na.current=oa,r=_t!==null&&_t.next!==null,ti=0,Ct=_t=it=null,ra=!1,r)throw Error(i(300));return t}function Tl(){var t=Ls!==0;return Ls=0,t}function Bn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ct===null?it.memoizedState=Ct=t:Ct=Ct.next=t,Ct}function gn(){if(_t===null){var t=it.alternate;t=t!==null?t.memoizedState:null}else t=_t.next;var r=Ct===null?it.memoizedState:Ct.next;if(r!==null)Ct=r,_t=t;else{if(t===null)throw Error(i(310));_t=t,t={memoizedState:_t.memoizedState,baseState:_t.baseState,baseQueue:_t.baseQueue,queue:_t.queue,next:null},Ct===null?it.memoizedState=Ct=t:Ct=Ct.next=t}return Ct}function $s(t,r){return typeof r=="function"?r(t):r}function Rl(t){var r=gn(),a=r.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=t;var f=_t,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 L=T=null,U=null,re=w;do{var ce=re.lane;if((ti&ce)===ce)U!==null&&(U=U.next={lane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),f=re.hasEagerState?re.eagerState:t(f,re.action);else{var fe={lane:ce,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null};U===null?(L=U=fe,T=f):U=U.next=fe,it.lanes|=ce,ni|=ce}re=re.next}while(re!==null&&re!==w);U===null?T=f:U.next=L,En(f,r.memoizedState)||(Gt=!0),r.memoizedState=f,r.baseState=T,r.baseQueue=U,a.lastRenderedState=f}if(t=a.interleaved,t!==null){g=t;do w=g.lane,it.lanes|=w,ni|=w,g=g.next;while(g!==t)}else g===null&&(a.lanes=0);return[r.memoizedState,a.dispatch]}function jl(t){var r=gn(),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);En(w,r.memoizedState)||(Gt=!0),r.memoizedState=w,r.baseQueue===null&&(r.baseState=w),a.lastRenderedState=w}return[w,f]}function hy(){}function py(t,r){var a=it,f=gn(),g=r(),w=!En(f.memoizedState,g);if(w&&(f.memoizedState=g,Gt=!0),f=f.queue,Al(vy.bind(null,a,f,t),[t]),f.getSnapshot!==r||w||Ct!==null&&Ct.memoizedState.tag&1){if(a.flags|=2048,Ds(9,gy.bind(null,a,f,g,r),void 0,null),Tt===null)throw Error(i(349));(ti&30)!==0||my(a,r,g)}return g}function my(t,r,a){t.flags|=16384,t={getSnapshot:r,value:a},r=it.updateQueue,r===null?(r={lastEffect:null,stores:null},it.updateQueue=r,r.stores=[t]):(a=r.stores,a===null?r.stores=[t]:a.push(t))}function gy(t,r,a,f){r.value=a,r.getSnapshot=f,yy(r)&&wy(t)}function vy(t,r,a){return a(function(){yy(r)&&wy(t)})}function yy(t){var r=t.getSnapshot;t=t.value;try{var a=r();return!En(t,a)}catch{return!0}}function wy(t){var r=rr(t,1);r!==null&&jn(r,t,1,-1)}function xy(t){var r=Bn();return typeof t=="function"&&(t=t()),r.memoizedState=r.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:$s,lastRenderedState:t},r.queue=t,t=t.dispatch=oT.bind(null,it,t),[r.memoizedState,t]}function Ds(t,r,a,f){return t={tag:t,create:r,destroy:a,deps:f,next:null},r=it.updateQueue,r===null?(r={lastEffect:null,stores:null},it.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 _y(){return gn().memoizedState}function ia(t,r,a,f){var g=Bn();it.flags|=t,g.memoizedState=Ds(1|r,a,void 0,f===void 0?null:f)}function sa(t,r,a,f){var g=gn();f=f===void 0?null:f;var w=void 0;if(_t!==null){var T=_t.memoizedState;if(w=T.destroy,f!==null&&Nl(f,T.deps)){g.memoizedState=Ds(r,a,w,f);return}}it.flags|=t,g.memoizedState=Ds(1|r,a,w,f)}function Sy(t,r){return ia(8390656,8,t,r)}function Al(t,r){return sa(2048,8,t,r)}function by(t,r){return sa(4,2,t,r)}function ky(t,r){return sa(4,4,t,r)}function Ey(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 Ny(t,r,a){return a=a!=null?a.concat([t]):null,sa(4,4,Ey.bind(null,r,t),a)}function Il(){}function Cy(t,r){var a=gn();r=r===void 0?null:r;var f=a.memoizedState;return f!==null&&r!==null&&Nl(r,f[1])?f[0]:(a.memoizedState=[t,r],t)}function Ty(t,r){var a=gn();r=r===void 0?null:r;var f=a.memoizedState;return f!==null&&r!==null&&Nl(r,f[1])?f[0]:(t=t(),a.memoizedState=[t,r],t)}function Ry(t,r,a){return(ti&21)===0?(t.baseState&&(t.baseState=!1,Gt=!0),t.memoizedState=a):(En(a,r)||(a=sv(),it.lanes|=a,ni|=a,t.baseState=!0),r)}function iT(t,r){var a=He;He=a!==0&&4>a?a:4,t(!0);var f=El.transition;El.transition={};try{t(!1),r()}finally{He=a,El.transition=f}}function jy(){return gn().memoizedState}function sT(t,r,a){var f=Pr(t);if(a={lane:f,action:a,hasEagerState:!1,eagerState:null,next:null},Ay(t))Iy(r,a);else if(a=uy(t,r,a,f),a!==null){var g=Ut();jn(a,t,f,g),My(a,r,f)}}function oT(t,r,a){var f=Pr(t),g={lane:f,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ay(t))Iy(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,L=w(T,a);if(g.hasEagerState=!0,g.eagerState=L,En(L,T)){var U=r.interleaved;U===null?(g.next=g,wl(r)):(g.next=U.next,U.next=g),r.interleaved=g;return}}catch{}finally{}a=uy(t,r,g,f),a!==null&&(g=Ut(),jn(a,t,f,g),My(a,r,f))}}function Ay(t){var r=t.alternate;return t===it||r!==null&&r===it}function Iy(t,r){Os=ra=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function My(t,r,a){if((a&4194240)!==0){var f=r.lanes;f&=t.pendingLanes,a|=f,r.lanes=a,Pu(t,a)}}var oa={readContext:mn,useCallback:Ot,useContext:Ot,useEffect:Ot,useImperativeHandle:Ot,useInsertionEffect:Ot,useLayoutEffect:Ot,useMemo:Ot,useReducer:Ot,useRef:Ot,useState:Ot,useDebugValue:Ot,useDeferredValue:Ot,useTransition:Ot,useMutableSource:Ot,useSyncExternalStore:Ot,useId:Ot,unstable_isNewReconciler:!1},aT={readContext:mn,useCallback:function(t,r){return Bn().memoizedState=[t,r===void 0?null:r],t},useContext:mn,useEffect:Sy,useImperativeHandle:function(t,r,a){return a=a!=null?a.concat([t]):null,ia(4194308,4,Ey.bind(null,r,t),a)},useLayoutEffect:function(t,r){return ia(4194308,4,t,r)},useInsertionEffect:function(t,r){return ia(4,2,t,r)},useMemo:function(t,r){var a=Bn();return r=r===void 0?null:r,t=t(),a.memoizedState=[t,r],t},useReducer:function(t,r,a){var f=Bn();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=sT.bind(null,it,t),[f.memoizedState,t]},useRef:function(t){var r=Bn();return t={current:t},r.memoizedState=t},useState:xy,useDebugValue:Il,useDeferredValue:function(t){return Bn().memoizedState=t},useTransition:function(){var t=xy(!1),r=t[0];return t=iT.bind(null,t[1]),Bn().memoizedState=t,[r,t]},useMutableSource:function(){},useSyncExternalStore:function(t,r,a){var f=it,g=Bn();if(et){if(a===void 0)throw Error(i(407));a=a()}else{if(a=r(),Tt===null)throw Error(i(349));(ti&30)!==0||my(f,r,a)}g.memoizedState=a;var w={value:a,getSnapshot:r};return g.queue=w,Sy(vy.bind(null,f,w,t),[t]),f.flags|=2048,Ds(9,gy.bind(null,f,w,a,r),void 0,null),a},useId:function(){var t=Bn(),r=Tt.identifierPrefix;if(et){var a=nr,f=tr;a=(f&~(1<<32-kn(f)-1)).toString(32)+a,r=":"+r+"R"+a,a=Ls++,0<a&&(r+="H"+a.toString(32)),r+=":"}else a=rT++,r=":"+r+"r"+a.toString(32)+":";return t.memoizedState=r},unstable_isNewReconciler:!1},uT={readContext:mn,useCallback:Cy,useContext:mn,useEffect:Al,useImperativeHandle:Ny,useInsertionEffect:by,useLayoutEffect:ky,useMemo:Ty,useReducer:Rl,useRef:_y,useState:function(){return Rl($s)},useDebugValue:Il,useDeferredValue:function(t){var r=gn();return Ry(r,_t.memoizedState,t)},useTransition:function(){var t=Rl($s)[0],r=gn().memoizedState;return[t,r]},useMutableSource:hy,useSyncExternalStore:py,useId:jy,unstable_isNewReconciler:!1},lT={readContext:mn,useCallback:Cy,useContext:mn,useEffect:Al,useImperativeHandle:Ny,useInsertionEffect:by,useLayoutEffect:ky,useMemo:Ty,useReducer:jl,useRef:_y,useState:function(){return jl($s)},useDebugValue:Il,useDeferredValue:function(t){var r=gn();return _t===null?r.memoizedState=t:Ry(r,_t.memoizedState,t)},useTransition:function(){var t=jl($s)[0],r=gn().memoizedState;return[t,r]},useMutableSource:hy,useSyncExternalStore:py,useId:jy,unstable_isNewReconciler:!1};function Cn(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 Ml(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 aa={isMounted:function(t){return(t=t._reactInternals)?tn(t)===t:!1},enqueueSetState:function(t,r,a){t=t._reactInternals;var f=Ut(),g=Pr(t),w=ir(f,g);w.payload=r,a!=null&&(w.callback=a),r=jr(t,w,g),r!==null&&(jn(r,t,g,f),Jo(r,t,g))},enqueueReplaceState:function(t,r,a){t=t._reactInternals;var f=Ut(),g=Pr(t),w=ir(f,g);w.tag=1,w.payload=r,a!=null&&(w.callback=a),r=jr(t,w,g),r!==null&&(jn(r,t,g,f),Jo(r,t,g))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var a=Ut(),f=Pr(t),g=ir(a,f);g.tag=2,r!=null&&(g.callback=r),r=jr(t,g,f),r!==null&&(jn(r,t,f,a),Jo(r,t,f))}};function Py(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?!Es(a,f)||!Es(g,w):!0}function qy(t,r,a){var f=!1,g=Cr,w=r.contextType;return typeof w=="object"&&w!==null?w=mn(w):(g=Wt(r)?Xr:qt.current,f=r.contextTypes,w=(f=f!=null)?Pi(t,g):Cr),r=new r(a,w),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=aa,t.stateNode=r,r._reactInternals=t,f&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=g,t.__reactInternalMemoizedMaskedChildContext=w),r}function Oy(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&&aa.enqueueReplaceState(r,r.state,null)}function Pl(t,r,a,f){var g=t.stateNode;g.props=a,g.state=t.memoizedState,g.refs={},xl(t);var w=r.contextType;typeof w=="object"&&w!==null?g.context=mn(w):(w=Wt(r)?Xr:qt.current,g.context=Pi(t,w)),g.state=t.memoizedState,w=r.getDerivedStateFromProps,typeof w=="function"&&(Ml(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&&aa.enqueueReplaceState(g,g.state,null),ea(t,a,g,f),g.state=t.memoizedState),typeof g.componentDidMount=="function"&&(t.flags|=4194308)}function Bi(t,r){try{var a="",f=r;do a+=V(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 ql(t,r,a){return{value:t,source:null,stack:a??null,digest:r??null}}function Ol(t,r){try{console.error(r.value)}catch(a){setTimeout(function(){throw a})}}var cT=typeof WeakMap=="function"?WeakMap:Map;function Ly(t,r,a){a=ir(-1,a),a.tag=3,a.payload={element:null};var f=r.value;return a.callback=function(){pa||(pa=!0,Ql=f),Ol(t,r)},a}function $y(t,r,a){a=ir(-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(){Ol(t,r)}}var w=t.stateNode;return w!==null&&typeof w.componentDidCatch=="function"&&(a.callback=function(){Ol(t,r),typeof f!="function"&&(Ir===null?Ir=new Set([this]):Ir.add(this));var T=r.stack;this.componentDidCatch(r.value,{componentStack:T!==null?T:""})}),a}function Dy(t,r,a){var f=t.pingCache;if(f===null){f=t.pingCache=new cT;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=kT.bind(null,t,r,a),r.then(t,t))}function Fy(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 zy(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=ir(-1,1),r.tag=2,jr(a,r,1))),a.lanes|=1),t):(t.flags|=65536,t.lanes=g,t)}var fT=N.ReactCurrentOwner,Gt=!1;function Bt(t,r,a,f){r.child=t===null?ay(r,null,a,f):$i(r,t.child,a,f)}function By(t,r,a,f,g){a=a.render;var w=r.ref;return Fi(r,g),f=Cl(t,r,a,f,w,g),a=Tl(),t!==null&&!Gt?(r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~g,sr(t,r,g)):(et&&a&&cl(r),r.flags|=1,Bt(t,r,f,g),r.child)}function Uy(t,r,a,f,g){if(t===null){var w=a.type;return typeof w=="function"&&!ic(w)&&w.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(r.tag=15,r.type=w,Hy(t,r,w,f,g)):(t=xa(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:Es,a(T,f)&&t.ref===r.ref)return sr(t,r,g)}return r.flags|=1,t=Or(w,f),t.ref=r.ref,t.return=r,r.child=t}function Hy(t,r,a,f,g){if(t!==null){var w=t.memoizedProps;if(Es(w,f)&&t.ref===r.ref)if(Gt=!1,r.pendingProps=f=w,(t.lanes&g)!==0)(t.flags&131072)!==0&&(Gt=!0);else return r.lanes=t.lanes,sr(t,r,g)}return Ll(t,r,a,f,g)}function Vy(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},Ye(Hi,on),on|=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,Ye(Hi,on),on|=t,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},f=w!==null?w.baseLanes:a,Ye(Hi,on),on|=f}else w!==null?(f=w.baseLanes|a,r.memoizedState=null):f=a,Ye(Hi,on),on|=f;return Bt(t,r,g,a),r.child}function Wy(t,r){var a=r.ref;(t===null&&a!==null||t!==null&&t.ref!==a)&&(r.flags|=512,r.flags|=2097152)}function Ll(t,r,a,f,g){var w=Wt(a)?Xr:qt.current;return w=Pi(r,w),Fi(r,g),a=Cl(t,r,a,f,w,g),f=Tl(),t!==null&&!Gt?(r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~g,sr(t,r,g)):(et&&f&&cl(r),r.flags|=1,Bt(t,r,a,g),r.child)}function Gy(t,r,a,f,g){if(Wt(a)){var w=!0;Vo(r)}else w=!1;if(Fi(r,g),r.stateNode===null)la(t,r),qy(r,a,f),Pl(r,a,f,g),f=!0;else if(t===null){var T=r.stateNode,L=r.memoizedProps;T.props=L;var U=T.context,re=a.contextType;typeof re=="object"&&re!==null?re=mn(re):(re=Wt(a)?Xr:qt.current,re=Pi(r,re));var ce=a.getDerivedStateFromProps,fe=typeof ce=="function"||typeof T.getSnapshotBeforeUpdate=="function";fe||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(L!==f||U!==re)&&Oy(r,T,f,re),Rr=!1;var le=r.memoizedState;T.state=le,ea(r,f,T,g),U=r.memoizedState,L!==f||le!==U||Vt.current||Rr?(typeof ce=="function"&&(Ml(r,a,ce,f),U=r.memoizedState),(L=Rr||Py(r,a,L,f,le,U,re))?(fe||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=U),T.props=f,T.state=U,T.context=re,f=L):(typeof T.componentDidMount=="function"&&(r.flags|=4194308),f=!1)}else{T=r.stateNode,ly(t,r),L=r.memoizedProps,re=r.type===r.elementType?L:Cn(r.type,L),T.props=re,fe=r.pendingProps,le=T.context,U=a.contextType,typeof U=="object"&&U!==null?U=mn(U):(U=Wt(a)?Xr:qt.current,U=Pi(r,U));var ve=a.getDerivedStateFromProps;(ce=typeof ve=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(L!==fe||le!==U)&&Oy(r,T,f,U),Rr=!1,le=r.memoizedState,T.state=le,ea(r,f,T,g);var _e=r.memoizedState;L!==fe||le!==_e||Vt.current||Rr?(typeof ve=="function"&&(Ml(r,a,ve,f),_e=r.memoizedState),(re=Rr||Py(r,a,re,f,le,_e,U)||!1)?(ce||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(f,_e,U),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(f,_e,U)),typeof T.componentDidUpdate=="function"&&(r.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof T.componentDidUpdate!="function"||L===t.memoizedProps&&le===t.memoizedState||(r.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||L===t.memoizedProps&&le===t.memoizedState||(r.flags|=1024),r.memoizedProps=f,r.memoizedState=_e),T.props=f,T.state=_e,T.context=U,f=re):(typeof T.componentDidUpdate!="function"||L===t.memoizedProps&&le===t.memoizedState||(r.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||L===t.memoizedProps&&le===t.memoizedState||(r.flags|=1024),f=!1)}return $l(t,r,a,f,w,g)}function $l(t,r,a,f,g,w){Wy(t,r);var T=(r.flags&128)!==0;if(!f&&!T)return g&&Zv(r,a,!1),sr(t,r,w);f=r.stateNode,fT.current=r;var L=T&&typeof a.getDerivedStateFromError!="function"?null:f.render();return r.flags|=1,t!==null&&T?(r.child=$i(r,t.child,null,w),r.child=$i(r,null,L,w)):Bt(t,r,L,w),r.memoizedState=f.state,g&&Zv(r,a,!0),r.child}function Ky(t){var r=t.stateNode;r.pendingContext?Xv(t,r.pendingContext,r.pendingContext!==r.context):r.context&&Xv(t,r.context,!1),_l(t,r.containerInfo)}function Yy(t,r,a,f,g){return Li(),pl(g),r.flags|=256,Bt(t,r,a,f),r.child}var Dl={dehydrated:null,treeContext:null,retryLane:0};function Fl(t){return{baseLanes:t,cachePool:null,transitions:null}}function Xy(t,r,a){var f=r.pendingProps,g=rt.current,w=!1,T=(r.flags&128)!==0,L;if((L=T)||(L=t!==null&&t.memoizedState===null?!1:(g&2)!==0),L?(w=!0,r.flags&=-129):(t===null||t.memoizedState!==null)&&(g|=1),Ye(rt,g&1),t===null)return hl(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=_a(T,f,0,null),t=oi(t,f,a,null),w.return=r,t.return=r,w.sibling=t,r.child=w,r.child.memoizedState=Fl(a),r.memoizedState=Dl,t):zl(r,T));if(g=t.memoizedState,g!==null&&(L=g.dehydrated,L!==null))return dT(t,r,T,f,L,g,a);if(w){w=f.fallback,T=r.mode,g=t.child,L=g.sibling;var U={mode:"hidden",children:f.children};return(T&1)===0&&r.child!==g?(f=r.child,f.childLanes=0,f.pendingProps=U,r.deletions=null):(f=Or(g,U),f.subtreeFlags=g.subtreeFlags&14680064),L!==null?w=Or(L,w):(w=oi(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?Fl(a):{baseLanes:T.baseLanes|a,cachePool:null,transitions:T.transitions},w.memoizedState=T,w.childLanes=t.childLanes&~a,r.memoizedState=Dl,f}return w=t.child,t=w.sibling,f=Or(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 zl(t,r){return r=_a({mode:"visible",children:r},t.mode,0,null),r.return=t,t.child=r}function ua(t,r,a,f){return f!==null&&pl(f),$i(r,t.child,null,a),t=zl(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function dT(t,r,a,f,g,w,T){if(a)return r.flags&256?(r.flags&=-257,f=ql(Error(i(422))),ua(t,r,T,f)):r.memoizedState!==null?(r.child=t.child,r.flags|=128,null):(w=f.fallback,g=r.mode,f=_a({mode:"visible",children:f.children},g,0,null),w=oi(w,g,T,null),w.flags|=2,f.return=r,w.return=r,f.sibling=w,r.child=f,(r.mode&1)!==0&&$i(r,t.child,null,T),r.child.memoizedState=Fl(T),r.memoizedState=Dl,w);if((r.mode&1)===0)return ua(t,r,T,null);if(g.data==="$!"){if(f=g.nextSibling&&g.nextSibling.dataset,f)var L=f.dgst;return f=L,w=Error(i(419)),f=ql(w,f,void 0),ua(t,r,T,f)}if(L=(T&t.childLanes)!==0,Gt||L){if(f=Tt,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,rr(t,g),jn(f,t,g,-1))}return rc(),f=ql(Error(i(421))),ua(t,r,T,f)}return g.data==="$?"?(r.flags|=128,r.child=t.child,r=ET.bind(null,t),g._reactRetry=r,null):(t=w.treeContext,sn=Er(g.nextSibling),rn=r,et=!0,Nn=null,t!==null&&(hn[pn++]=tr,hn[pn++]=nr,hn[pn++]=Qr,tr=t.id,nr=t.overflow,Qr=r),r=zl(r,f.children),r.flags|=4096,r)}function Qy(t,r,a){t.lanes|=r;var f=t.alternate;f!==null&&(f.lanes|=r),yl(t.return,r,a)}function Bl(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 Zy(t,r,a){var f=r.pendingProps,g=f.revealOrder,w=f.tail;if(Bt(t,r,f.children,a),f=rt.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&&Qy(t,a,r);else if(t.tag===19)Qy(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(Ye(rt,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&&ta(t)===null&&(g=a),a=a.sibling;a=g,a===null?(g=r.child,r.child=null):(g=a.sibling,a.sibling=null),Bl(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&&ta(t)===null){r.child=g;break}t=g.sibling,g.sibling=a,a=g,g=t}Bl(r,!0,a,null,w);break;case"together":Bl(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function la(t,r){(r.mode&1)===0&&t!==null&&(t.alternate=null,r.alternate=null,r.flags|=2)}function sr(t,r,a){if(t!==null&&(r.dependencies=t.dependencies),ni|=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=Or(t,t.pendingProps),r.child=a,a.return=r;t.sibling!==null;)t=t.sibling,a=a.sibling=Or(t,t.pendingProps),a.return=r;a.sibling=null}return r.child}function hT(t,r,a){switch(r.tag){case 3:Ky(r),Li();break;case 5:dy(r);break;case 1:Wt(r.type)&&Vo(r);break;case 4:_l(r,r.stateNode.containerInfo);break;case 10:var f=r.type._context,g=r.memoizedProps.value;Ye(Qo,f._currentValue),f._currentValue=g;break;case 13:if(f=r.memoizedState,f!==null)return f.dehydrated!==null?(Ye(rt,rt.current&1),r.flags|=128,null):(a&r.child.childLanes)!==0?Xy(t,r,a):(Ye(rt,rt.current&1),t=sr(t,r,a),t!==null?t.sibling:null);Ye(rt,rt.current&1);break;case 19:if(f=(a&r.childLanes)!==0,(t.flags&128)!==0){if(f)return Zy(t,r,a);r.flags|=128}if(g=r.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),Ye(rt,rt.current),f)break;return null;case 22:case 23:return r.lanes=0,Vy(t,r,a)}return sr(t,r,a)}var Jy,Ul,e0,t0;Jy=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}},Ul=function(){},e0=function(t,r,a,f){var g=t.memoizedProps;if(g!==f){t=r.stateNode,ei(zn.current);var w=null;switch(a){case"input":g=Ie(t,g),f=Ie(t,f),w=[];break;case"select":g=G({},g,{value:void 0}),f=G({},f,{value:void 0}),w=[];break;case"textarea":g=st(t,g),f=st(t,f),w=[];break;default:typeof g.onClick!="function"&&typeof f.onClick=="function"&&(t.onclick=Bo)}Ft(a,f);var T;a=null;for(re in g)if(!f.hasOwnProperty(re)&&g.hasOwnProperty(re)&&g[re]!=null)if(re==="style"){var L=g[re];for(T in L)L.hasOwnProperty(T)&&(a||(a={}),a[T]="")}else re!=="dangerouslySetInnerHTML"&&re!=="children"&&re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&re!=="autoFocus"&&(o.hasOwnProperty(re)?w||(w=[]):(w=w||[]).push(re,null));for(re in f){var U=f[re];if(L=g!=null?g[re]:void 0,f.hasOwnProperty(re)&&U!==L&&(U!=null||L!=null))if(re==="style")if(L){for(T in L)!L.hasOwnProperty(T)||U&&U.hasOwnProperty(T)||(a||(a={}),a[T]="");for(T in U)U.hasOwnProperty(T)&&L[T]!==U[T]&&(a||(a={}),a[T]=U[T])}else a||(w||(w=[]),w.push(re,a)),a=U;else re==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,L=L?L.__html:void 0,U!=null&&L!==U&&(w=w||[]).push(re,U)):re==="children"?typeof U!="string"&&typeof U!="number"||(w=w||[]).push(re,""+U):re!=="suppressContentEditableWarning"&&re!=="suppressHydrationWarning"&&(o.hasOwnProperty(re)?(U!=null&&re==="onScroll"&&Xe("scroll",t),w||L===U||(w=[])):(w=w||[]).push(re,U))}a&&(w=w||[]).push("style",a);var re=w;(r.updateQueue=re)&&(r.flags|=4)}},t0=function(t,r,a,f){a!==f&&(r.flags|=4)};function Fs(t,r){if(!et)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 Lt(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 pT(t,r,a){var f=r.pendingProps;switch(fl(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lt(r),null;case 1:return Wt(r.type)&&Ho(),Lt(r),null;case 3:return f=r.stateNode,zi(),Qe(Vt),Qe(qt),kl(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(t===null||t.child===null)&&(Yo(r)?r.flags|=4:t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Nn!==null&&(ec(Nn),Nn=null))),Ul(t,r),Lt(r),null;case 5:Sl(r);var g=ei(qs.current);if(a=r.type,t!==null&&r.stateNode!=null)e0(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 Lt(r),null}if(t=ei(zn.current),Yo(r)){f=r.stateNode,a=r.type;var w=r.memoizedProps;switch(f[Fn]=r,f[js]=w,t=(r.mode&1)!==0,a){case"dialog":Xe("cancel",f),Xe("close",f);break;case"iframe":case"object":case"embed":Xe("load",f);break;case"video":case"audio":for(g=0;g<Cs.length;g++)Xe(Cs[g],f);break;case"source":Xe("error",f);break;case"img":case"image":case"link":Xe("error",f),Xe("load",f);break;case"details":Xe("toggle",f);break;case"input":ke(f,w),Xe("invalid",f);break;case"select":f._wrapperState={wasMultiple:!!w.multiple},Xe("invalid",f);break;case"textarea":Ke(f,w),Xe("invalid",f)}Ft(a,w),g=null;for(var T in w)if(w.hasOwnProperty(T)){var L=w[T];T==="children"?typeof L=="string"?f.textContent!==L&&(w.suppressHydrationWarning!==!0&&zo(f.textContent,L,t),g=["children",L]):typeof L=="number"&&f.textContent!==""+L&&(w.suppressHydrationWarning!==!0&&zo(f.textContent,L,t),g=["children",""+L]):o.hasOwnProperty(T)&&L!=null&&T==="onScroll"&&Xe("scroll",f)}switch(a){case"input":je(f),ge(f,w,!0);break;case"textarea":je(f),Et(f);break;case"select":case"option":break;default:typeof w.onClick=="function"&&(f.onclick=Bo)}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=ft(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[Fn]=r,t[js]=f,Jy(t,r,!1,!1),r.stateNode=t;e:{switch(T=gt(a,f),a){case"dialog":Xe("cancel",t),Xe("close",t),g=f;break;case"iframe":case"object":case"embed":Xe("load",t),g=f;break;case"video":case"audio":for(g=0;g<Cs.length;g++)Xe(Cs[g],t);g=f;break;case"source":Xe("error",t),g=f;break;case"img":case"image":case"link":Xe("error",t),Xe("load",t),g=f;break;case"details":Xe("toggle",t),g=f;break;case"input":ke(t,f),g=Ie(t,f),Xe("invalid",t);break;case"option":g=f;break;case"select":t._wrapperState={wasMultiple:!!f.multiple},g=G({},f,{value:void 0}),Xe("invalid",t);break;case"textarea":Ke(t,f),g=st(t,f),Xe("invalid",t);break;default:g=f}Ft(a,g),L=g;for(w in L)if(L.hasOwnProperty(w)){var U=L[w];w==="style"?dt(t,U):w==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,U!=null&&Dt(t,U)):w==="children"?typeof U=="string"?(a!=="textarea"||U!=="")&&xt(t,U):typeof U=="number"&&xt(t,""+U):w!=="suppressContentEditableWarning"&&w!=="suppressHydrationWarning"&&w!=="autoFocus"&&(o.hasOwnProperty(w)?U!=null&&w==="onScroll"&&Xe("scroll",t):U!=null&&E(t,w,U,T))}switch(a){case"input":je(t),ge(t,f,!1);break;case"textarea":je(t),Et(t);break;case"option":f.value!=null&&t.setAttribute("value",""+ue(f.value));break;case"select":t.multiple=!!f.multiple,w=f.value,w!=null?wt(t,!!f.multiple,w,!1):f.defaultValue!=null&&wt(t,!!f.multiple,f.defaultValue,!0);break;default:typeof g.onClick=="function"&&(t.onclick=Bo)}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 Lt(r),null;case 6:if(t&&r.stateNode!=null)t0(t,r,t.memoizedProps,f);else{if(typeof f!="string"&&r.stateNode===null)throw Error(i(166));if(a=ei(qs.current),ei(zn.current),Yo(r)){if(f=r.stateNode,a=r.memoizedProps,f[Fn]=r,(w=f.nodeValue!==a)&&(t=rn,t!==null))switch(t.tag){case 3:zo(f.nodeValue,a,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&zo(f.nodeValue,a,(t.mode&1)!==0)}w&&(r.flags|=4)}else f=(a.nodeType===9?a:a.ownerDocument).createTextNode(f),f[Fn]=r,r.stateNode=f}return Lt(r),null;case 13:if(Qe(rt),f=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(et&&sn!==null&&(r.mode&1)!==0&&(r.flags&128)===0)iy(),Li(),r.flags|=98560,w=!1;else if(w=Yo(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[Fn]=r}else Li(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Lt(r),w=!1}else Nn!==null&&(ec(Nn),Nn=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||(rt.current&1)!==0?St===0&&(St=3):rc())),r.updateQueue!==null&&(r.flags|=4),Lt(r),null);case 4:return zi(),Ul(t,r),t===null&&Ts(r.stateNode.containerInfo),Lt(r),null;case 10:return vl(r.type._context),Lt(r),null;case 17:return Wt(r.type)&&Ho(),Lt(r),null;case 19:if(Qe(rt),w=r.memoizedState,w===null)return Lt(r),null;if(f=(r.flags&128)!==0,T=w.rendering,T===null)if(f)Fs(w,!1);else{if(St!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(T=ta(t),T!==null){for(r.flags|=128,Fs(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 Ye(rt,rt.current&1|2),r.child}t=t.sibling}w.tail!==null&&Pe()>Vi&&(r.flags|=128,f=!0,Fs(w,!1),r.lanes=4194304)}else{if(!f)if(t=ta(T),t!==null){if(r.flags|=128,f=!0,a=t.updateQueue,a!==null&&(r.updateQueue=a,r.flags|=4),Fs(w,!0),w.tail===null&&w.tailMode==="hidden"&&!T.alternate&&!et)return Lt(r),null}else 2*Pe()-w.renderingStartTime>Vi&&a!==1073741824&&(r.flags|=128,f=!0,Fs(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=Pe(),r.sibling=null,a=rt.current,Ye(rt,f?a&1|2:a&1),r):(Lt(r),null);case 22:case 23:return nc(),f=r.memoizedState!==null,t!==null&&t.memoizedState!==null!==f&&(r.flags|=8192),f&&(r.mode&1)!==0?(on&1073741824)!==0&&(Lt(r),r.subtreeFlags&6&&(r.flags|=8192)):Lt(r),null;case 24:return null;case 25:return null}throw Error(i(156,r.tag))}function mT(t,r){switch(fl(r),r.tag){case 1:return Wt(r.type)&&Ho(),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return zi(),Qe(Vt),Qe(qt),kl(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 5:return Sl(r),null;case 13:if(Qe(rt),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(i(340));Li()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return Qe(rt),null;case 4:return zi(),null;case 10:return vl(r.type._context),null;case 22:case 23:return nc(),null;case 24:return null;default:return null}}var ca=!1,$t=!1,gT=typeof WeakSet=="function"?WeakSet:Set,xe=null;function Ui(t,r){var a=t.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(f){lt(t,r,f)}else a.current=null}function Hl(t,r,a){try{a()}catch(f){lt(t,r,f)}}var n0=!1;function vT(t,r){if(nl=jo,t=Pv(),Ku(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,L=-1,U=-1,re=0,ce=0,fe=t,le=null;t:for(;;){for(var ve;fe!==a||g!==0&&fe.nodeType!==3||(L=T+g),fe!==w||f!==0&&fe.nodeType!==3||(U=T+f),fe.nodeType===3&&(T+=fe.nodeValue.length),(ve=fe.firstChild)!==null;)le=fe,fe=ve;for(;;){if(fe===t)break t;if(le===a&&++re===g&&(L=T),le===w&&++ce===f&&(U=T),(ve=fe.nextSibling)!==null)break;fe=le,le=fe.parentNode}fe=ve}a=L===-1||U===-1?null:{start:L,end:U}}else a=null}a=a||{start:0,end:0}}else a=null;for(rl={focusedElem:t,selectionRange:a},jo=!1,xe=r;xe!==null;)if(r=xe,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,xe=t;else for(;xe!==null;){r=xe;try{var _e=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(_e!==null){var be=_e.memoizedProps,pt=_e.memoizedState,Z=r.stateNode,W=Z.getSnapshotBeforeUpdate(r.elementType===r.type?be:Cn(r.type,be),pt);Z.__reactInternalSnapshotBeforeUpdate=W}break;case 3:var ee=r.stateNode.containerInfo;ee.nodeType===1?ee.textContent="":ee.nodeType===9&&ee.documentElement&&ee.removeChild(ee.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(de){lt(r,r.return,de)}if(t=r.sibling,t!==null){t.return=r.return,xe=t;break}xe=r.return}return _e=n0,n0=!1,_e}function zs(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&&Hl(r,a,w)}g=g.next}while(g!==f)}}function fa(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 Vl(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 r0(t){var r=t.alternate;r!==null&&(t.alternate=null,r0(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&(delete r[Fn],delete r[js],delete r[al],delete r[JC],delete r[eT])),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 i0(t){return t.tag===5||t.tag===3||t.tag===4}function s0(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||i0(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 Wl(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=Bo));else if(f!==4&&(t=t.child,t!==null))for(Wl(t,r,a),t=t.sibling;t!==null;)Wl(t,r,a),t=t.sibling}function Gl(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(Gl(t,r,a),t=t.sibling;t!==null;)Gl(t,r,a),t=t.sibling}var It=null,Tn=!1;function Ar(t,r,a){for(a=a.child;a!==null;)o0(t,r,a),a=a.sibling}function o0(t,r,a){if(Ht&&typeof Ht.onCommitFiberUnmount=="function")try{Ht.onCommitFiberUnmount(yr,a)}catch{}switch(a.tag){case 5:$t||Ui(a,r);case 6:var f=It,g=Tn;It=null,Ar(t,r,a),It=f,Tn=g,It!==null&&(Tn?(t=It,a=a.stateNode,t.nodeType===8?t.parentNode.removeChild(a):t.removeChild(a)):It.removeChild(a.stateNode));break;case 18:It!==null&&(Tn?(t=It,a=a.stateNode,t.nodeType===8?ol(t.parentNode,a):t.nodeType===1&&ol(t,a),ws(t)):ol(It,a.stateNode));break;case 4:f=It,g=Tn,It=a.stateNode.containerInfo,Tn=!0,Ar(t,r,a),It=f,Tn=g;break;case 0:case 11:case 14:case 15:if(!$t&&(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)&&Hl(a,r,T),g=g.next}while(g!==f)}Ar(t,r,a);break;case 1:if(!$t&&(Ui(a,r),f=a.stateNode,typeof f.componentWillUnmount=="function"))try{f.props=a.memoizedProps,f.state=a.memoizedState,f.componentWillUnmount()}catch(L){lt(a,r,L)}Ar(t,r,a);break;case 21:Ar(t,r,a);break;case 22:a.mode&1?($t=(f=$t)||a.memoizedState!==null,Ar(t,r,a),$t=f):Ar(t,r,a);break;default:Ar(t,r,a)}}function a0(t){var r=t.updateQueue;if(r!==null){t.updateQueue=null;var a=t.stateNode;a===null&&(a=t.stateNode=new gT),r.forEach(function(f){var g=NT.bind(null,t,f);a.has(f)||(a.add(f),f.then(g,g))})}}function Rn(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,L=T;e:for(;L!==null;){switch(L.tag){case 5:It=L.stateNode,Tn=!1;break e;case 3:It=L.stateNode.containerInfo,Tn=!0;break e;case 4:It=L.stateNode.containerInfo,Tn=!0;break e}L=L.return}if(It===null)throw Error(i(160));o0(w,T,g),It=null,Tn=!1;var U=g.alternate;U!==null&&(U.return=null),g.return=null}catch(re){lt(g,r,re)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)u0(r,t),r=r.sibling}function u0(t,r){var a=t.alternate,f=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Rn(r,t),Un(t),f&4){try{zs(3,t,t.return),fa(3,t)}catch(be){lt(t,t.return,be)}try{zs(5,t,t.return)}catch(be){lt(t,t.return,be)}}break;case 1:Rn(r,t),Un(t),f&512&&a!==null&&Ui(a,a.return);break;case 5:if(Rn(r,t),Un(t),f&512&&a!==null&&Ui(a,a.return),t.flags&32){var g=t.stateNode;try{xt(g,"")}catch(be){lt(t,t.return,be)}}if(f&4&&(g=t.stateNode,g!=null)){var w=t.memoizedProps,T=a!==null?a.memoizedProps:w,L=t.type,U=t.updateQueue;if(t.updateQueue=null,U!==null)try{L==="input"&&w.type==="radio"&&w.name!=null&&Ge(g,w),gt(L,T);var re=gt(L,w);for(T=0;T<U.length;T+=2){var ce=U[T],fe=U[T+1];ce==="style"?dt(g,fe):ce==="dangerouslySetInnerHTML"?Dt(g,fe):ce==="children"?xt(g,fe):E(g,ce,fe,re)}switch(L){case"input":ye(g,w);break;case"textarea":Be(g,w);break;case"select":var le=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!w.multiple;var ve=w.value;ve!=null?wt(g,!!w.multiple,ve,!1):le!==!!w.multiple&&(w.defaultValue!=null?wt(g,!!w.multiple,w.defaultValue,!0):wt(g,!!w.multiple,w.multiple?[]:"",!1))}g[js]=w}catch(be){lt(t,t.return,be)}}break;case 6:if(Rn(r,t),Un(t),f&4){if(t.stateNode===null)throw Error(i(162));g=t.stateNode,w=t.memoizedProps;try{g.nodeValue=w}catch(be){lt(t,t.return,be)}}break;case 3:if(Rn(r,t),Un(t),f&4&&a!==null&&a.memoizedState.isDehydrated)try{ws(r.containerInfo)}catch(be){lt(t,t.return,be)}break;case 4:Rn(r,t),Un(t);break;case 13:Rn(r,t),Un(t),g=t.child,g.flags&8192&&(w=g.memoizedState!==null,g.stateNode.isHidden=w,!w||g.alternate!==null&&g.alternate.memoizedState!==null||(Xl=Pe())),f&4&&a0(t);break;case 22:if(ce=a!==null&&a.memoizedState!==null,t.mode&1?($t=(re=$t)||ce,Rn(r,t),$t=re):Rn(r,t),Un(t),f&8192){if(re=t.memoizedState!==null,(t.stateNode.isHidden=re)&&!ce&&(t.mode&1)!==0)for(xe=t,ce=t.child;ce!==null;){for(fe=xe=ce;xe!==null;){switch(le=xe,ve=le.child,le.tag){case 0:case 11:case 14:case 15:zs(4,le,le.return);break;case 1:Ui(le,le.return);var _e=le.stateNode;if(typeof _e.componentWillUnmount=="function"){f=le,a=le.return;try{r=f,_e.props=r.memoizedProps,_e.state=r.memoizedState,_e.componentWillUnmount()}catch(be){lt(f,a,be)}}break;case 5:Ui(le,le.return);break;case 22:if(le.memoizedState!==null){f0(fe);continue}}ve!==null?(ve.return=le,xe=ve):f0(fe)}ce=ce.sibling}e:for(ce=null,fe=t;;){if(fe.tag===5){if(ce===null){ce=fe;try{g=fe.stateNode,re?(w=g.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none"):(L=fe.stateNode,U=fe.memoizedProps.style,T=U!=null&&U.hasOwnProperty("display")?U.display:null,L.style.display=at("display",T))}catch(be){lt(t,t.return,be)}}}else if(fe.tag===6){if(ce===null)try{fe.stateNode.nodeValue=re?"":fe.memoizedProps}catch(be){lt(t,t.return,be)}}else if((fe.tag!==22&&fe.tag!==23||fe.memoizedState===null||fe===t)&&fe.child!==null){fe.child.return=fe,fe=fe.child;continue}if(fe===t)break e;for(;fe.sibling===null;){if(fe.return===null||fe.return===t)break e;ce===fe&&(ce=null),fe=fe.return}ce===fe&&(ce=null),fe.sibling.return=fe.return,fe=fe.sibling}}break;case 19:Rn(r,t),Un(t),f&4&&a0(t);break;case 21:break;default:Rn(r,t),Un(t)}}function Un(t){var r=t.flags;if(r&2){try{e:{for(var a=t.return;a!==null;){if(i0(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&&(xt(g,""),f.flags&=-33);var w=s0(t);Gl(t,w,g);break;case 3:case 4:var T=f.stateNode.containerInfo,L=s0(t);Wl(t,L,T);break;default:throw Error(i(161))}}catch(U){lt(t,t.return,U)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function yT(t,r,a){xe=t,l0(t)}function l0(t,r,a){for(var f=(t.mode&1)!==0;xe!==null;){var g=xe,w=g.child;if(g.tag===22&&f){var T=g.memoizedState!==null||ca;if(!T){var L=g.alternate,U=L!==null&&L.memoizedState!==null||$t;L=ca;var re=$t;if(ca=T,($t=U)&&!re)for(xe=g;xe!==null;)T=xe,U=T.child,T.tag===22&&T.memoizedState!==null?d0(g):U!==null?(U.return=T,xe=U):d0(g);for(;w!==null;)xe=w,l0(w),w=w.sibling;xe=g,ca=L,$t=re}c0(t)}else(g.subtreeFlags&8772)!==0&&w!==null?(w.return=g,xe=w):c0(t)}}function c0(t){for(;xe!==null;){var r=xe;if((r.flags&8772)!==0){var a=r.alternate;try{if((r.flags&8772)!==0)switch(r.tag){case 0:case 11:case 15:$t||fa(5,r);break;case 1:var f=r.stateNode;if(r.flags&4&&!$t)if(a===null)f.componentDidMount();else{var g=r.elementType===r.type?a.memoizedProps:Cn(r.type,a.memoizedProps);f.componentDidUpdate(g,a.memoizedState,f.__reactInternalSnapshotBeforeUpdate)}var w=r.updateQueue;w!==null&&fy(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}fy(r,T,a)}break;case 5:var L=r.stateNode;if(a===null&&r.flags&4){a=L;var U=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":U.autoFocus&&a.focus();break;case"img":U.src&&(a.src=U.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var re=r.alternate;if(re!==null){var ce=re.memoizedState;if(ce!==null){var fe=ce.dehydrated;fe!==null&&ws(fe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}$t||r.flags&512&&Vl(r)}catch(le){lt(r,r.return,le)}}if(r===t){xe=null;break}if(a=r.sibling,a!==null){a.return=r.return,xe=a;break}xe=r.return}}function f0(t){for(;xe!==null;){var r=xe;if(r===t){xe=null;break}var a=r.sibling;if(a!==null){a.return=r.return,xe=a;break}xe=r.return}}function d0(t){for(;xe!==null;){var r=xe;try{switch(r.tag){case 0:case 11:case 15:var a=r.return;try{fa(4,r)}catch(U){lt(r,a,U)}break;case 1:var f=r.stateNode;if(typeof f.componentDidMount=="function"){var g=r.return;try{f.componentDidMount()}catch(U){lt(r,g,U)}}var w=r.return;try{Vl(r)}catch(U){lt(r,w,U)}break;case 5:var T=r.return;try{Vl(r)}catch(U){lt(r,T,U)}}}catch(U){lt(r,r.return,U)}if(r===t){xe=null;break}var L=r.sibling;if(L!==null){L.return=r.return,xe=L;break}xe=r.return}}var wT=Math.ceil,da=N.ReactCurrentDispatcher,Kl=N.ReactCurrentOwner,vn=N.ReactCurrentBatchConfig,Le=0,Tt=null,vt=null,Mt=0,on=0,Hi=Nr(0),St=0,Bs=null,ni=0,ha=0,Yl=0,Us=null,Kt=null,Xl=0,Vi=1/0,or=null,pa=!1,Ql=null,Ir=null,ma=!1,Mr=null,ga=0,Hs=0,Zl=null,va=-1,ya=0;function Ut(){return(Le&6)!==0?Pe():va!==-1?va:va=Pe()}function Pr(t){return(t.mode&1)===0?1:(Le&2)!==0&&Mt!==0?Mt&-Mt:nT.transition!==null?(ya===0&&(ya=sv()),ya):(t=He,t!==0||(t=window.event,t=t===void 0?16:pv(t.type)),t)}function jn(t,r,a,f){if(50<Hs)throw Hs=0,Zl=null,Error(i(185));ps(t,a,f),((Le&2)===0||t!==Tt)&&(t===Tt&&((Le&2)===0&&(ha|=a),St===4&&qr(t,Mt)),Yt(t,f),a===1&&Le===0&&(r.mode&1)===0&&(Vi=Pe()+500,Wo&&Tr()))}function Yt(t,r){var a=t.callbackNode;nC(t,r);var f=Co(t,t===Tt?Mt:0);if(f===0)a!==null&&Se(a),t.callbackNode=null,t.callbackPriority=0;else if(r=f&-f,t.callbackPriority!==r){if(a!=null&&Se(a),r===1)t.tag===0?tT(p0.bind(null,t)):Jv(p0.bind(null,t)),QC(function(){(Le&6)===0&&Tr()}),a=null;else{switch(ov(f)){case 1:a=ut;break;case 4:a=Je;break;case 16:a=dn;break;case 536870912:a=ki;break;default:a=dn}a=S0(a,h0.bind(null,t))}t.callbackPriority=r,t.callbackNode=a}}function h0(t,r){if(va=-1,ya=0,(Le&6)!==0)throw Error(i(327));var a=t.callbackNode;if(Wi()&&t.callbackNode!==a)return null;var f=Co(t,t===Tt?Mt:0);if(f===0)return null;if((f&30)!==0||(f&t.expiredLanes)!==0||r)r=wa(t,f);else{r=f;var g=Le;Le|=2;var w=g0();(Tt!==t||Mt!==r)&&(or=null,Vi=Pe()+500,ii(t,r));do try{ST();break}catch(L){m0(t,L)}while(!0);gl(),da.current=w,Le=g,vt!==null?r=0:(Tt=null,Mt=0,r=St)}if(r!==0){if(r===2&&(g=Iu(t),g!==0&&(f=g,r=Jl(t,g))),r===1)throw a=Bs,ii(t,0),qr(t,f),Yt(t,Pe()),a;if(r===6)qr(t,f);else{if(g=t.current.alternate,(f&30)===0&&!xT(g)&&(r=wa(t,f),r===2&&(w=Iu(t),w!==0&&(f=w,r=Jl(t,w))),r===1))throw a=Bs,ii(t,0),qr(t,f),Yt(t,Pe()),a;switch(t.finishedWork=g,t.finishedLanes=f,r){case 0:case 1:throw Error(i(345));case 2:si(t,Kt,or);break;case 3:if(qr(t,f),(f&130023424)===f&&(r=Xl+500-Pe(),10<r)){if(Co(t,0)!==0)break;if(g=t.suspendedLanes,(g&f)!==f){Ut(),t.pingedLanes|=t.suspendedLanes&g;break}t.timeoutHandle=sl(si.bind(null,t,Kt,or),r);break}si(t,Kt,or);break;case 4:if(qr(t,f),(f&4194240)===f)break;for(r=t.eventTimes,g=-1;0<f;){var T=31-kn(f);w=1<<T,T=r[T],T>g&&(g=T),f&=~w}if(f=g,f=Pe()-f,f=(120>f?120:480>f?480:1080>f?1080:1920>f?1920:3e3>f?3e3:4320>f?4320:1960*wT(f/1960))-f,10<f){t.timeoutHandle=sl(si.bind(null,t,Kt,or),f);break}si(t,Kt,or);break;case 5:si(t,Kt,or);break;default:throw Error(i(329))}}}return Yt(t,Pe()),t.callbackNode===a?h0.bind(null,t):null}function Jl(t,r){var a=Us;return t.current.memoizedState.isDehydrated&&(ii(t,r).flags|=256),t=wa(t,r),t!==2&&(r=Kt,Kt=a,r!==null&&ec(r)),t}function ec(t){Kt===null?Kt=t:Kt.push.apply(Kt,t)}function xT(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(!En(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 qr(t,r){for(r&=~Yl,r&=~ha,t.suspendedLanes|=r,t.pingedLanes&=~r,t=t.expirationTimes;0<r;){var a=31-kn(r),f=1<<a;t[a]=-1,r&=~f}}function p0(t){if((Le&6)!==0)throw Error(i(327));Wi();var r=Co(t,0);if((r&1)===0)return Yt(t,Pe()),null;var a=wa(t,r);if(t.tag!==0&&a===2){var f=Iu(t);f!==0&&(r=f,a=Jl(t,f))}if(a===1)throw a=Bs,ii(t,0),qr(t,r),Yt(t,Pe()),a;if(a===6)throw Error(i(345));return t.finishedWork=t.current.alternate,t.finishedLanes=r,si(t,Kt,or),Yt(t,Pe()),null}function tc(t,r){var a=Le;Le|=1;try{return t(r)}finally{Le=a,Le===0&&(Vi=Pe()+500,Wo&&Tr())}}function ri(t){Mr!==null&&Mr.tag===0&&(Le&6)===0&&Wi();var r=Le;Le|=1;var a=vn.transition,f=He;try{if(vn.transition=null,He=1,t)return t()}finally{He=f,vn.transition=a,Le=r,(Le&6)===0&&Tr()}}function nc(){on=Hi.current,Qe(Hi)}function ii(t,r){t.finishedWork=null,t.finishedLanes=0;var a=t.timeoutHandle;if(a!==-1&&(t.timeoutHandle=-1,XC(a)),vt!==null)for(a=vt.return;a!==null;){var f=a;switch(fl(f),f.tag){case 1:f=f.type.childContextTypes,f!=null&&Ho();break;case 3:zi(),Qe(Vt),Qe(qt),kl();break;case 5:Sl(f);break;case 4:zi();break;case 13:Qe(rt);break;case 19:Qe(rt);break;case 10:vl(f.type._context);break;case 22:case 23:nc()}a=a.return}if(Tt=t,vt=t=Or(t.current,null),Mt=on=r,St=0,Bs=null,Yl=ha=ni=0,Kt=Us=null,Jr!==null){for(r=0;r<Jr.length;r++)if(a=Jr[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}Jr=null}return t}function m0(t,r){do{var a=vt;try{if(gl(),na.current=oa,ra){for(var f=it.memoizedState;f!==null;){var g=f.queue;g!==null&&(g.pending=null),f=f.next}ra=!1}if(ti=0,Ct=_t=it=null,Os=!1,Ls=0,Kl.current=null,a===null||a.return===null){St=1,Bs=r,vt=null;break}e:{var w=t,T=a.return,L=a,U=r;if(r=Mt,L.flags|=32768,U!==null&&typeof U=="object"&&typeof U.then=="function"){var re=U,ce=L,fe=ce.tag;if((ce.mode&1)===0&&(fe===0||fe===11||fe===15)){var le=ce.alternate;le?(ce.updateQueue=le.updateQueue,ce.memoizedState=le.memoizedState,ce.lanes=le.lanes):(ce.updateQueue=null,ce.memoizedState=null)}var ve=Fy(T);if(ve!==null){ve.flags&=-257,zy(ve,T,L,w,r),ve.mode&1&&Dy(w,re,r),r=ve,U=re;var _e=r.updateQueue;if(_e===null){var be=new Set;be.add(U),r.updateQueue=be}else _e.add(U);break e}else{if((r&1)===0){Dy(w,re,r),rc();break e}U=Error(i(426))}}else if(et&&L.mode&1){var pt=Fy(T);if(pt!==null){(pt.flags&65536)===0&&(pt.flags|=256),zy(pt,T,L,w,r),pl(Bi(U,L));break e}}w=U=Bi(U,L),St!==4&&(St=2),Us===null?Us=[w]:Us.push(w),w=T;do{switch(w.tag){case 3:w.flags|=65536,r&=-r,w.lanes|=r;var Z=Ly(w,U,r);cy(w,Z);break e;case 1:L=U;var W=w.type,ee=w.stateNode;if((w.flags&128)===0&&(typeof W.getDerivedStateFromError=="function"||ee!==null&&typeof ee.componentDidCatch=="function"&&(Ir===null||!Ir.has(ee)))){w.flags|=65536,r&=-r,w.lanes|=r;var de=$y(w,L,r);cy(w,de);break e}}w=w.return}while(w!==null)}y0(a)}catch(Ee){r=Ee,vt===a&&a!==null&&(vt=a=a.return);continue}break}while(!0)}function g0(){var t=da.current;return da.current=oa,t===null?oa:t}function rc(){(St===0||St===3||St===2)&&(St=4),Tt===null||(ni&268435455)===0&&(ha&268435455)===0||qr(Tt,Mt)}function wa(t,r){var a=Le;Le|=2;var f=g0();(Tt!==t||Mt!==r)&&(or=null,ii(t,r));do try{_T();break}catch(g){m0(t,g)}while(!0);if(gl(),Le=a,da.current=f,vt!==null)throw Error(i(261));return Tt=null,Mt=0,St}function _T(){for(;vt!==null;)v0(vt)}function ST(){for(;vt!==null&&!Ne();)v0(vt)}function v0(t){var r=_0(t.alternate,t,on);t.memoizedProps=t.pendingProps,r===null?y0(t):vt=r,Kl.current=null}function y0(t){var r=t;do{var a=r.alternate;if(t=r.return,(r.flags&32768)===0){if(a=pT(a,r,on),a!==null){vt=a;return}}else{if(a=mT(a,r),a!==null){a.flags&=32767,vt=a;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{St=6,vt=null;return}}if(r=r.sibling,r!==null){vt=r;return}vt=r=t}while(r!==null);St===0&&(St=5)}function si(t,r,a){var f=He,g=vn.transition;try{vn.transition=null,He=1,bT(t,r,a,f)}finally{vn.transition=g,He=f}return null}function bT(t,r,a,f){do Wi();while(Mr!==null);if((Le&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(rC(t,w),t===Tt&&(vt=Tt=null,Mt=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||ma||(ma=!0,S0(dn,function(){return Wi(),null})),w=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||w){w=vn.transition,vn.transition=null;var T=He;He=1;var L=Le;Le|=4,Kl.current=null,vT(t,a),u0(a,t),UC(rl),jo=!!nl,rl=nl=null,t.current=a,yT(a),Fe(),Le=L,He=T,vn.transition=w}else t.current=a;if(ma&&(ma=!1,Mr=t,ga=g),w=t.pendingLanes,w===0&&(Ir=null),ds(a.stateNode),Yt(t,Pe()),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(pa)throw pa=!1,t=Ql,Ql=null,t;return(ga&1)!==0&&t.tag!==0&&Wi(),w=t.pendingLanes,(w&1)!==0?t===Zl?Hs++:(Hs=0,Zl=t):Hs=0,Tr(),null}function Wi(){if(Mr!==null){var t=ov(ga),r=vn.transition,a=He;try{if(vn.transition=null,He=16>t?16:t,Mr===null)var f=!1;else{if(t=Mr,Mr=null,ga=0,(Le&6)!==0)throw Error(i(331));var g=Le;for(Le|=4,xe=t.current;xe!==null;){var w=xe,T=w.child;if((xe.flags&16)!==0){var L=w.deletions;if(L!==null){for(var U=0;U<L.length;U++){var re=L[U];for(xe=re;xe!==null;){var ce=xe;switch(ce.tag){case 0:case 11:case 15:zs(8,ce,w)}var fe=ce.child;if(fe!==null)fe.return=ce,xe=fe;else for(;xe!==null;){ce=xe;var le=ce.sibling,ve=ce.return;if(r0(ce),ce===re){xe=null;break}if(le!==null){le.return=ve,xe=le;break}xe=ve}}}var _e=w.alternate;if(_e!==null){var be=_e.child;if(be!==null){_e.child=null;do{var pt=be.sibling;be.sibling=null,be=pt}while(be!==null)}}xe=w}}if((w.subtreeFlags&2064)!==0&&T!==null)T.return=w,xe=T;else e:for(;xe!==null;){if(w=xe,(w.flags&2048)!==0)switch(w.tag){case 0:case 11:case 15:zs(9,w,w.return)}var Z=w.sibling;if(Z!==null){Z.return=w.return,xe=Z;break e}xe=w.return}}var W=t.current;for(xe=W;xe!==null;){T=xe;var ee=T.child;if((T.subtreeFlags&2064)!==0&&ee!==null)ee.return=T,xe=ee;else e:for(T=W;xe!==null;){if(L=xe,(L.flags&2048)!==0)try{switch(L.tag){case 0:case 11:case 15:fa(9,L)}}catch(Ee){lt(L,L.return,Ee)}if(L===T){xe=null;break e}var de=L.sibling;if(de!==null){de.return=L.return,xe=de;break e}xe=L.return}}if(Le=g,Tr(),Ht&&typeof Ht.onPostCommitFiberRoot=="function")try{Ht.onPostCommitFiberRoot(yr,t)}catch{}f=!0}return f}finally{He=a,vn.transition=r}}return!1}function w0(t,r,a){r=Bi(a,r),r=Ly(t,r,1),t=jr(t,r,1),r=Ut(),t!==null&&(ps(t,1,r),Yt(t,r))}function lt(t,r,a){if(t.tag===3)w0(t,t,a);else for(;r!==null;){if(r.tag===3){w0(r,t,a);break}else if(r.tag===1){var f=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Ir===null||!Ir.has(f))){t=Bi(a,t),t=$y(r,t,1),r=jr(r,t,1),t=Ut(),r!==null&&(ps(r,1,t),Yt(r,t));break}}r=r.return}}function kT(t,r,a){var f=t.pingCache;f!==null&&f.delete(r),r=Ut(),t.pingedLanes|=t.suspendedLanes&a,Tt===t&&(Mt&a)===a&&(St===4||St===3&&(Mt&130023424)===Mt&&500>Pe()-Xl?ii(t,0):Yl|=a),Yt(t,r)}function x0(t,r){r===0&&((t.mode&1)===0?r=1:(r=No,No<<=1,(No&130023424)===0&&(No=4194304)));var a=Ut();t=rr(t,r),t!==null&&(ps(t,r,a),Yt(t,a))}function ET(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),x0(t,a)}function NT(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),x0(t,a)}var _0;_0=function(t,r,a){if(t!==null)if(t.memoizedProps!==r.pendingProps||Vt.current)Gt=!0;else{if((t.lanes&a)===0&&(r.flags&128)===0)return Gt=!1,hT(t,r,a);Gt=(t.flags&131072)!==0}else Gt=!1,et&&(r.flags&1048576)!==0&&ey(r,Ko,r.index);switch(r.lanes=0,r.tag){case 2:var f=r.type;la(t,r),t=r.pendingProps;var g=Pi(r,qt.current);Fi(r,a),g=Cl(null,r,f,t,g,a);var w=Tl();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,Wt(f)?(w=!0,Vo(r)):w=!1,r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,xl(r),g.updater=aa,r.stateNode=g,g._reactInternals=r,Pl(r,f,t,a),r=$l(null,r,f,!0,w,a)):(r.tag=0,et&&w&&cl(r),Bt(null,r,g,a),r=r.child),r;case 16:f=r.elementType;e:{switch(la(t,r),t=r.pendingProps,g=f._init,f=g(f._payload),r.type=f,g=r.tag=TT(f),t=Cn(f,t),g){case 0:r=Ll(null,r,f,t,a);break e;case 1:r=Gy(null,r,f,t,a);break e;case 11:r=By(null,r,f,t,a);break e;case 14:r=Uy(null,r,f,Cn(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:Cn(f,g),Ll(t,r,f,g,a);case 1:return f=r.type,g=r.pendingProps,g=r.elementType===f?g:Cn(f,g),Gy(t,r,f,g,a);case 3:e:{if(Ky(r),t===null)throw Error(i(387));f=r.pendingProps,w=r.memoizedState,g=w.element,ly(t,r),ea(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=Bi(Error(i(423)),r),r=Yy(t,r,f,a,g);break e}else if(f!==g){g=Bi(Error(i(424)),r),r=Yy(t,r,f,a,g);break e}else for(sn=Er(r.stateNode.containerInfo.firstChild),rn=r,et=!0,Nn=null,a=ay(r,null,f,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Li(),f===g){r=sr(t,r,a);break e}Bt(t,r,f,a)}r=r.child}return r;case 5:return dy(r),t===null&&hl(r),f=r.type,g=r.pendingProps,w=t!==null?t.memoizedProps:null,T=g.children,il(f,g)?T=null:w!==null&&il(f,w)&&(r.flags|=32),Wy(t,r),Bt(t,r,T,a),r.child;case 6:return t===null&&hl(r),null;case 13:return Xy(t,r,a);case 4:return _l(r,r.stateNode.containerInfo),f=r.pendingProps,t===null?r.child=$i(r,null,f,a):Bt(t,r,f,a),r.child;case 11:return f=r.type,g=r.pendingProps,g=r.elementType===f?g:Cn(f,g),By(t,r,f,g,a);case 7:return Bt(t,r,r.pendingProps,a),r.child;case 8:return Bt(t,r,r.pendingProps.children,a),r.child;case 12:return Bt(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,Ye(Qo,f._currentValue),f._currentValue=T,w!==null)if(En(w.value,T)){if(w.children===g.children&&!Vt.current){r=sr(t,r,a);break e}}else for(w=r.child,w!==null&&(w.return=r);w!==null;){var L=w.dependencies;if(L!==null){T=w.child;for(var U=L.firstContext;U!==null;){if(U.context===f){if(w.tag===1){U=ir(-1,a&-a),U.tag=2;var re=w.updateQueue;if(re!==null){re=re.shared;var ce=re.pending;ce===null?U.next=U:(U.next=ce.next,ce.next=U),re.pending=U}}w.lanes|=a,U=w.alternate,U!==null&&(U.lanes|=a),yl(w.return,a,r),L.lanes|=a;break}U=U.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,L=T.alternate,L!==null&&(L.lanes|=a),yl(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}Bt(t,r,g.children,a),r=r.child}return r;case 9:return g=r.type,f=r.pendingProps.children,Fi(r,a),g=mn(g),f=f(g),r.flags|=1,Bt(t,r,f,a),r.child;case 14:return f=r.type,g=Cn(f,r.pendingProps),g=Cn(f.type,g),Uy(t,r,f,g,a);case 15:return Hy(t,r,r.type,r.pendingProps,a);case 17:return f=r.type,g=r.pendingProps,g=r.elementType===f?g:Cn(f,g),la(t,r),r.tag=1,Wt(f)?(t=!0,Vo(r)):t=!1,Fi(r,a),qy(r,f,g),Pl(r,f,g,a),$l(null,r,f,!0,t,a);case 19:return Zy(t,r,a);case 22:return Vy(t,r,a)}throw Error(i(156,r.tag))};function S0(t,r){return we(t,r)}function CT(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 yn(t,r,a,f){return new CT(t,r,a,f)}function ic(t){return t=t.prototype,!(!t||!t.isReactComponent)}function TT(t){if(typeof t=="function")return ic(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Q)return 11;if(t===K)return 14}return 2}function Or(t,r){var a=t.alternate;return a===null?(a=yn(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 xa(t,r,a,f,g,w){var T=2;if(f=t,typeof t=="function")ic(t)&&(T=1);else if(typeof t=="string")T=5;else e:switch(t){case P:return oi(a.children,g,w,r);case B:T=8,g|=8;break;case M:return t=yn(12,a,r,g|2),t.elementType=M,t.lanes=w,t;case X:return t=yn(13,a,r,g),t.elementType=X,t.lanes=w,t;case R:return t=yn(19,a,r,g),t.elementType=R,t.lanes=w,t;case te:return _a(a,g,w,r);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case F:T=10;break e;case O:T=9;break e;case Q:T=11;break e;case K:T=14;break e;case H:T=16,f=null;break e}throw Error(i(130,t==null?t:typeof t,""))}return r=yn(T,a,r,g),r.elementType=t,r.type=f,r.lanes=w,r}function oi(t,r,a,f){return t=yn(7,t,f,r),t.lanes=a,t}function _a(t,r,a,f){return t=yn(22,t,f,r),t.elementType=te,t.lanes=a,t.stateNode={isHidden:!1},t}function sc(t,r,a){return t=yn(6,t,null,r),t.lanes=a,t}function oc(t,r,a){return r=yn(4,t.children!==null?t.children:[],t.key,r),r.lanes=a,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}function RT(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=Mu(0),this.expirationTimes=Mu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mu(0),this.identifierPrefix=f,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function ac(t,r,a,f,g,w,T,L,U){return t=new RT(t,r,a,L,U),r===1?(r=1,w===!0&&(r|=8)):r=0,w=yn(3,null,null,r),t.current=w,w.stateNode=t,w.memoizedState={element:f,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},xl(w),t}function jT(t,r,a){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:I,key:f==null?null:""+f,children:t,containerInfo:r,implementation:a}}function b0(t){if(!t)return Cr;t=t._reactInternals;e:{if(tn(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(Wt(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(Wt(a))return Qv(t,a,r)}return r}function k0(t,r,a,f,g,w,T,L,U){return t=ac(a,f,!0,t,g,w,T,L,U),t.context=b0(null),a=t.current,f=Ut(),g=Pr(a),w=ir(f,g),w.callback=r??null,jr(a,w,g),t.current.lanes=g,ps(t,g,f),Yt(t,f),t}function Sa(t,r,a,f){var g=r.current,w=Ut(),T=Pr(g);return a=b0(a),r.context===null?r.context=a:r.pendingContext=a,r=ir(w,T),r.payload={element:t},f=f===void 0?null:f,f!==null&&(r.callback=f),t=jr(g,r,T),t!==null&&(jn(t,g,T,w),Jo(t,g,T)),T}function ba(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 E0(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<r?a:r}}function uc(t,r){E0(t,r),(t=t.alternate)&&E0(t,r)}function AT(){return null}var N0=typeof reportError=="function"?reportError:function(t){console.error(t)};function lc(t){this._internalRoot=t}ka.prototype.render=lc.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(i(409));Sa(t,r,null,null)},ka.prototype.unmount=lc.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;ri(function(){Sa(null,t,null,null)}),r[Jn]=null}};function ka(t){this._internalRoot=t}ka.prototype.unstable_scheduleHydration=function(t){if(t){var r=lv();t={blockedOn:null,target:t,priority:r};for(var a=0;a<Sr.length&&r!==0&&r<Sr[a].priority;a++);Sr.splice(a,0,t),a===0&&dv(t)}};function cc(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Ea(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function C0(){}function IT(t,r,a,f,g){if(g){if(typeof f=="function"){var w=f;f=function(){var re=ba(T);w.call(re)}}var T=k0(r,f,t,0,null,!1,!1,"",C0);return t._reactRootContainer=T,t[Jn]=T.current,Ts(t.nodeType===8?t.parentNode:t),ri(),T}for(;g=t.lastChild;)t.removeChild(g);if(typeof f=="function"){var L=f;f=function(){var re=ba(U);L.call(re)}}var U=ac(t,0,!1,null,null,!1,!1,"",C0);return t._reactRootContainer=U,t[Jn]=U.current,Ts(t.nodeType===8?t.parentNode:t),ri(function(){Sa(r,U,a,f)}),U}function Na(t,r,a,f,g){var w=a._reactRootContainer;if(w){var T=w;if(typeof g=="function"){var L=g;g=function(){var U=ba(T);L.call(U)}}Sa(r,T,t,g)}else T=IT(a,r,t,g,f);return ba(T)}av=function(t){switch(t.tag){case 3:var r=t.stateNode;if(r.current.memoizedState.isDehydrated){var a=hs(r.pendingLanes);a!==0&&(Pu(r,a|1),Yt(r,Pe()),(Le&6)===0&&(Vi=Pe()+500,Tr()))}break;case 13:ri(function(){var f=rr(t,1);if(f!==null){var g=Ut();jn(f,t,1,g)}}),uc(t,1)}},qu=function(t){if(t.tag===13){var r=rr(t,134217728);if(r!==null){var a=Ut();jn(r,t,134217728,a)}uc(t,134217728)}},uv=function(t){if(t.tag===13){var r=Pr(t),a=rr(t,r);if(a!==null){var f=Ut();jn(a,t,r,f)}uc(t,r)}},lv=function(){return He},cv=function(t,r){var a=He;try{return He=t,r()}finally{He=a}},cn=function(t,r,a){switch(r){case"input":if(ye(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=Uo(f);if(!g)throw Error(i(90));De(f),ye(f,g)}}}break;case"textarea":Be(t,a);break;case"select":r=a.value,r!=null&&wt(t,!!a.multiple,r,!1)}},gr=tc,zt=ri;var MT={usingClientEntryPoint:!1,Events:[As,Ii,Uo,$n,mr,tc]},Vs={findFiberByHostInstance:Yr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},PT={bundleType:Vs.bundleType,version:Vs.version,rendererPackageName:Vs.rendererPackageName,rendererConfig:Vs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:N.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=ie(t),t===null?null:t.stateNode},findFiberByHostInstance:Vs.findFiberByHostInstance||AT,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 Ca=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ca.isDisabled&&Ca.supportsFiber)try{yr=Ca.inject(PT),Ht=Ca}catch{}}return Xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=MT,Xt.createPortal=function(t,r){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!cc(r))throw Error(i(200));return jT(t,r,null,a)},Xt.createRoot=function(t,r){if(!cc(t))throw Error(i(299));var a=!1,f="",g=N0;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(f=r.identifierPrefix),r.onRecoverableError!==void 0&&(g=r.onRecoverableError)),r=ac(t,1,!1,null,null,a,!1,f,g),t[Jn]=r.current,Ts(t.nodeType===8?t.parentNode:t),new lc(r)},Xt.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=ie(r),t=t===null?null:t.stateNode,t},Xt.flushSync=function(t){return ri(t)},Xt.hydrate=function(t,r,a){if(!Ea(r))throw Error(i(200));return Na(null,t,r,!0,a)},Xt.hydrateRoot=function(t,r,a){if(!cc(t))throw Error(i(405));var f=a!=null&&a.hydratedSources||null,g=!1,w="",T=N0;if(a!=null&&(a.unstable_strictMode===!0&&(g=!0),a.identifierPrefix!==void 0&&(w=a.identifierPrefix),a.onRecoverableError!==void 0&&(T=a.onRecoverableError)),r=k0(r,null,t,1,a??null,g,!1,w,T),t[Jn]=r.current,Ts(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 ka(r)},Xt.render=function(t,r,a){if(!Ea(r))throw Error(i(200));return Na(null,t,r,!1,a)},Xt.unmountComponentAtNode=function(t){if(!Ea(t))throw Error(i(40));return t._reactRootContainer?(ri(function(){Na(null,null,t,!1,function(){t._reactRootContainer=null,t[Jn]=null})}),!0):!1},Xt.unstable_batchedUpdates=tc,Xt.unstable_renderSubtreeIntoContainer=function(t,r,a,f){if(!Ea(a))throw Error(i(200));if(t==null||t._reactInternals===void 0)throw Error(i(38));return Na(t,r,a,!1,f)},Xt.version="18.3.1-next-f1338f8080-20240426",Xt}var q0;function hk(){if(q0)return hc.exports;q0=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(),hc.exports=zT(),hc.exports}var O0;function BT(){if(O0)return Ra;O0=1;var e=hk();return Ra.createRoot=e.createRoot,Ra.hydrateRoot=e.hydrateRoot,Ra}var UT=BT(),q=po();const oe=yg(q);function Pt(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=Pt(e[i]))!==""&&(n+=(n&&" ")+s);else for(let i in e)e[i]&&(n+=(n&&" ")+i);return n}var gc={exports:{}},vc={},yc={exports:{}},wc={};/**
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 L0;function HT(){if(L0)return wc;L0=1;var e=po();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,u=e.useLayoutEffect,l=e.useDebugValue;function c(m,y){var x=y(),C=s({inst:{value:x,getSnapshot:y}}),_=C[0].inst,S=C[1];return u(function(){_.value=x,_.getSnapshot=y,d(_)&&S({inst:_})},[m,x,y]),o(function(){return d(_)&&S({inst:_}),m(function(){d(_)&&S({inst:_})})},[m]),l(x),x}function d(m){var y=m.getSnapshot;m=m.value;try{var x=y();return!i(m,x)}catch{return!0}}function p(m,y){return y()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:c;return wc.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,wc}var $0;function VT(){return $0||($0=1,yc.exports=HT()),yc.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 D0;function WT(){if(D0)return vc;D0=1;var e=po(),n=VT();function i(p,h){return p===h&&(p!==0||1/p===1/h)||p!==p&&h!==h}var s=typeof Object.is=="function"?Object.is:i,o=n.useSyncExternalStore,u=e.useRef,l=e.useEffect,c=e.useMemo,d=e.useDebugValue;return vc.useSyncExternalStoreWithSelector=function(p,h,m,y,x){var C=u(null);if(C.current===null){var _={hasValue:!1,value:null};C.current=_}else _=C.current;C=c(function(){function k(I){if(!b){if(b=!0,E=I,I=y(I),x!==void 0&&_.hasValue){var P=_.value;if(x(P,I))return N=P}return N=I}if(P=N,s(E,I))return P;var B=y(I);return x!==void 0&&x(P,B)?(E=I,P):(E=I,N=B)}var b=!1,E,N,j=m===void 0?null:m;return[function(){return k(h())},j===null?void 0:function(){return k(j())}]},[h,m,y,x]);var S=o(p,C[0],C[1]);return l(function(){_.hasValue=!0,_.value=S},[S]),d(S),S},vc}var F0;function GT(){return F0||(F0=1,gc.exports=WT()),gc.exports}var KT=GT();const YT=yg(KT),XT={},z0=e=>{let n;const i=new Set,s=(h,m)=>{const y=typeof h=="function"?h(n):h;if(!Object.is(y,n)){const x=n;n=m??(typeof y!="object"||y===null)?y:Object.assign({},n,y),i.forEach(C=>C(n,x))}},o=()=>n,d={setState:s,getState:o,getInitialState:()=>p,subscribe:h=>(i.add(h),()=>i.delete(h)),destroy:()=>{(XT?"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()}},p=n=e(s,o,d);return d},QT=e=>e?z0(e):z0,{useDebugValue:ZT}=oe,{useSyncExternalStoreWithSelector:JT}=YT,eR=e=>e;function pk(e,n=eR,i){const s=JT(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,i);return ZT(s),s}const B0=(e,n)=>{const i=QT(e),s=(o,u=n)=>pk(i,o,u);return Object.assign(s,i),s},tR=(e,n)=>e?B0(e,n):B0;function bt(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 nR={value:()=>{}};function uu(){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 Ha(i)}function Ha(e){this._=e}function rR(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}})}Ha.prototype=uu.prototype={constructor:Ha,on:function(e,n){var i=this._,s=rR(e+"",i),o,u=-1,l=s.length;if(arguments.length<2){for(;++u<l;)if((o=(e=s[u]).type)&&(o=iR(i[o],e.name)))return o;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++u<l;)if(o=(e=s[u]).type)i[o]=U0(i[o],e.name,n);else if(n==null)for(o in i)i[o]=U0(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 Ha(e)},call:function(e,n){if((o=arguments.length-2)>0)for(var i=new Array(o),s=0,o,u;s<o;++s)i[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(u=this._[e],s=0,o=u.length;s<o;++s)u[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,u=s.length;o<u;++o)s[o].value.apply(n,i)}};function iR(e,n){for(var i=0,s=e.length,o;i<s;++i)if((o=e[i]).name===n)return o.value}function U0(e,n,i){for(var s=0,o=e.length;s<o;++s)if(e[s].name===n){e[s]=nR,e=e.slice(0,s).concat(e.slice(s+1));break}return i!=null&&e.push({name:n,value:i}),e}var Xm="http://www.w3.org/1999/xhtml";const H0={svg:"http://www.w3.org/2000/svg",xhtml:Xm,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function lu(e){var n=e+="",i=n.indexOf(":");return i>=0&&(n=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),H0.hasOwnProperty(n)?{space:H0[n],local:e}:e}function sR(e){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===Xm&&n.documentElement.namespaceURI===Xm?n.createElement(e):n.createElementNS(i,e)}}function oR(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mk(e){var n=lu(e);return(n.local?oR:sR)(n)}function aR(){}function wg(e){return e==null?aR:function(){return this.querySelector(e)}}function uR(e){typeof e!="function"&&(e=wg(e));for(var n=this._groups,i=n.length,s=new Array(i),o=0;o<i;++o)for(var u=n[o],l=u.length,c=s[o]=new Array(l),d,p,h=0;h<l;++h)(d=u[h])&&(p=e.call(d,d.__data__,h,u))&&("__data__"in d&&(p.__data__=d.__data__),c[h]=p);return new an(s,this._parents)}function lR(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function cR(){return[]}function gk(e){return e==null?cR:function(){return this.querySelectorAll(e)}}function fR(e){return function(){return lR(e.apply(this,arguments))}}function dR(e){typeof e=="function"?e=fR(e):e=gk(e);for(var n=this._groups,i=n.length,s=[],o=[],u=0;u<i;++u)for(var l=n[u],c=l.length,d,p=0;p<c;++p)(d=l[p])&&(s.push(e.call(d,d.__data__,p,l)),o.push(d));return new an(s,o)}function vk(e){return function(){return this.matches(e)}}function yk(e){return function(n){return n.matches(e)}}var hR=Array.prototype.find;function pR(e){return function(){return hR.call(this.children,e)}}function mR(){return this.firstElementChild}function gR(e){return this.select(e==null?mR:pR(typeof e=="function"?e:yk(e)))}var vR=Array.prototype.filter;function yR(){return Array.from(this.children)}function wR(e){return function(){return vR.call(this.children,e)}}function xR(e){return this.selectAll(e==null?yR:wR(typeof e=="function"?e:yk(e)))}function _R(e){typeof e!="function"&&(e=vk(e));for(var n=this._groups,i=n.length,s=new Array(i),o=0;o<i;++o)for(var u=n[o],l=u.length,c=s[o]=[],d,p=0;p<l;++p)(d=u[p])&&e.call(d,d.__data__,p,u)&&c.push(d);return new an(s,this._parents)}function wk(e){return new Array(e.length)}function SR(){return new an(this._enter||this._groups.map(wk),this._parents)}function Xa(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Xa.prototype={constructor:Xa,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 bR(e){return function(){return e}}function kR(e,n,i,s,o,u){for(var l=0,c,d=n.length,p=u.length;l<p;++l)(c=n[l])?(c.__data__=u[l],s[l]=c):i[l]=new Xa(e,u[l]);for(;l<d;++l)(c=n[l])&&(o[l]=c)}function ER(e,n,i,s,o,u,l){var c,d,p=new Map,h=n.length,m=u.length,y=new Array(h),x;for(c=0;c<h;++c)(d=n[c])&&(y[c]=x=l.call(d,d.__data__,c,n)+"",p.has(x)?o[c]=d:p.set(x,d));for(c=0;c<m;++c)x=l.call(e,u[c],c,u)+"",(d=p.get(x))?(s[c]=d,d.__data__=u[c],p.delete(x)):i[c]=new Xa(e,u[c]);for(c=0;c<h;++c)(d=n[c])&&p.get(y[c])===d&&(o[c]=d)}function NR(e){return e.__data__}function CR(e,n){if(!arguments.length)return Array.from(this,NR);var i=n?ER:kR,s=this._parents,o=this._groups;typeof e!="function"&&(e=bR(e));for(var u=o.length,l=new Array(u),c=new Array(u),d=new Array(u),p=0;p<u;++p){var h=s[p],m=o[p],y=m.length,x=TR(e.call(h,h&&h.__data__,p,s)),C=x.length,_=c[p]=new Array(C),S=l[p]=new Array(C),k=d[p]=new Array(y);i(h,m,_,S,k,x,n);for(var b=0,E=0,N,j;b<C;++b)if(N=_[b]){for(b>=E&&(E=b+1);!(j=S[E])&&++E<C;);N._next=j||null}}return l=new an(l,s),l._enter=c,l._exit=d,l}function TR(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function RR(){return new an(this._exit||this._groups.map(wk),this._parents)}function jR(e,n,i){var s=this.enter(),o=this,u=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?u.remove():i(u),s&&o?s.merge(o).order():o}function AR(e){for(var n=e.selection?e.selection():e,i=this._groups,s=n._groups,o=i.length,u=s.length,l=Math.min(o,u),c=new Array(o),d=0;d<l;++d)for(var p=i[d],h=s[d],m=p.length,y=c[d]=new Array(m),x,C=0;C<m;++C)(x=p[C]||h[C])&&(y[C]=x);for(;d<o;++d)c[d]=i[d];return new an(c,this._parents)}function IR(){for(var e=this._groups,n=-1,i=e.length;++n<i;)for(var s=e[n],o=s.length-1,u=s[o],l;--o>=0;)(l=s[o])&&(u&&l.compareDocumentPosition(u)^4&&u.parentNode.insertBefore(l,u),u=l);return this}function MR(e){e||(e=PR);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),u=0;u<s;++u){for(var l=i[u],c=l.length,d=o[u]=new Array(c),p,h=0;h<c;++h)(p=l[h])&&(d[h]=p);d.sort(n)}return new an(o,this._parents).order()}function PR(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function qR(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function OR(){return Array.from(this)}function LR(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var s=e[n],o=0,u=s.length;o<u;++o){var l=s[o];if(l)return l}return null}function $R(){let e=0;for(const n of this)++e;return e}function DR(){return!this.node()}function FR(e){for(var n=this._groups,i=0,s=n.length;i<s;++i)for(var o=n[i],u=0,l=o.length,c;u<l;++u)(c=o[u])&&e.call(c,c.__data__,u,o);return this}function zR(e){return function(){this.removeAttribute(e)}}function BR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function UR(e,n){return function(){this.setAttribute(e,n)}}function HR(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function VR(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function WR(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 GR(e,n){var i=lu(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?BR:zR:typeof n=="function"?i.local?WR:VR:i.local?HR:UR)(i,n))}function xk(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function KR(e){return function(){this.style.removeProperty(e)}}function YR(e,n,i){return function(){this.style.setProperty(e,n,i)}}function XR(e,n,i){return function(){var s=n.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,i)}}function QR(e,n,i){return arguments.length>1?this.each((n==null?KR:typeof n=="function"?XR:YR)(e,n,i??"")):rs(this.node(),e)}function rs(e,n){return e.style.getPropertyValue(n)||xk(e).getComputedStyle(e,null).getPropertyValue(n)}function ZR(e){return function(){delete this[e]}}function JR(e,n){return function(){this[e]=n}}function e2(e,n){return function(){var i=n.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function t2(e,n){return arguments.length>1?this.each((n==null?ZR:typeof n=="function"?e2:JR)(e,n)):this.node()[e]}function _k(e){return e.trim().split(/^|\s+/)}function xg(e){return e.classList||new Sk(e)}function Sk(e){this._node=e,this._names=_k(e.getAttribute("class")||"")}Sk.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=xg(e),s=-1,o=n.length;++s<o;)i.add(n[s])}function kk(e,n){for(var i=xg(e),s=-1,o=n.length;++s<o;)i.remove(n[s])}function n2(e){return function(){bk(this,e)}}function r2(e){return function(){kk(this,e)}}function i2(e,n){return function(){(n.apply(this,arguments)?bk:kk)(this,e)}}function s2(e,n){var i=_k(e+"");if(arguments.length<2){for(var s=xg(this.node()),o=-1,u=i.length;++o<u;)if(!s.contains(i[o]))return!1;return!0}return this.each((typeof n=="function"?i2:n?n2:r2)(i,n))}function o2(){this.textContent=""}function a2(e){return function(){this.textContent=e}}function u2(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function l2(e){return arguments.length?this.each(e==null?o2:(typeof e=="function"?u2:a2)(e)):this.node().textContent}function c2(){this.innerHTML=""}function f2(e){return function(){this.innerHTML=e}}function d2(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function h2(e){return arguments.length?this.each(e==null?c2:(typeof e=="function"?d2:f2)(e)):this.node().innerHTML}function p2(){this.nextSibling&&this.parentNode.appendChild(this)}function m2(){return this.each(p2)}function g2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function v2(){return this.each(g2)}function y2(e){var n=typeof e=="function"?e:mk(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function w2(){return null}function x2(e,n){var i=typeof e=="function"?e:mk(e),s=n==null?w2:typeof n=="function"?n:wg(n);return this.select(function(){return this.insertBefore(i.apply(this,arguments),s.apply(this,arguments)||null)})}function _2(){var e=this.parentNode;e&&e.removeChild(this)}function S2(){return this.each(_2)}function b2(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function k2(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function E2(e){return this.select(e?k2:b2)}function N2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function C2(e){return function(n){e.call(this,n,this.__data__)}}function T2(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 R2(e){return function(){var n=this.__on;if(n){for(var i=0,s=-1,o=n.length,u;i<o;++i)u=n[i],(!e.type||u.type===e.type)&&u.name===e.name?this.removeEventListener(u.type,u.listener,u.options):n[++s]=u;++s?n.length=s:delete this.__on}}}function j2(e,n,i){return function(){var s=this.__on,o,u=C2(n);if(s){for(var l=0,c=s.length;l<c;++l)if((o=s[l]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=u,o.options=i),o.value=n;return}}this.addEventListener(e.type,u,i),o={type:e.type,name:e.name,value:n,listener:u,options:i},s?s.push(o):this.__on=[o]}}function A2(e,n,i){var s=T2(e+""),o,u=s.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var d=0,p=c.length,h;d<p;++d)for(o=0,h=c[d];o<u;++o)if((l=s[o]).type===h.type&&l.name===h.name)return h.value}return}for(c=n?j2:R2,o=0;o<u;++o)this.each(c(s[o],n,i));return this}function Ek(e,n,i){var s=xk(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 I2(e,n){return function(){return Ek(this,e,n)}}function M2(e,n){return function(){return Ek(this,e,n.apply(this,arguments))}}function P2(e,n){return this.each((typeof n=="function"?M2:I2)(e,n))}function*q2(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var s=e[n],o=0,u=s.length,l;o<u;++o)(l=s[o])&&(yield l)}var Nk=[null];function an(e,n){this._groups=e,this._parents=n}function mo(){return new an([[document.documentElement]],Nk)}function O2(){return this}an.prototype=mo.prototype={constructor:an,select:uR,selectAll:dR,selectChild:gR,selectChildren:xR,filter:_R,data:CR,enter:SR,exit:RR,join:jR,merge:AR,selection:O2,order:IR,sort:MR,call:qR,nodes:OR,node:LR,size:$R,empty:DR,each:FR,attr:GR,style:QR,property:t2,classed:s2,text:l2,html:h2,raise:m2,lower:v2,append:y2,insert:x2,remove:S2,clone:E2,datum:N2,on:A2,dispatch:P2,[Symbol.iterator]:q2};function xn(e){return typeof e=="string"?new an([[document.querySelector(e)]],[document.documentElement]):new an([[e]],Nk)}function L2(e){let n;for(;n=e.sourceEvent;)e=n;return e}function In(e,n){if(e=L2(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 $2={passive:!1},so={capture:!0,passive:!1};function xc(e){e.stopImmediatePropagation()}function es(e){e.preventDefault(),e.stopImmediatePropagation()}function Ck(e){var n=e.document.documentElement,i=xn(e).on("dragstart.drag",es,so);"onselectstart"in n?i.on("selectstart.drag",es,so):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Tk(e,n){var i=e.document.documentElement,s=xn(e).on("dragstart.drag",null);n&&(s.on("click.drag",es,so),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 ja=e=>()=>e;function Qm(e,{sourceEvent:n,subject:i,target:s,identifier:o,active:u,x:l,y:c,dx:d,dy:p,dispatch:h}){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:u,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:p,enumerable:!0,configurable:!0},_:{value:h}})}Qm.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function D2(e){return!e.ctrlKey&&!e.button}function F2(){return this.parentNode}function z2(e,n){return n??{x:e.x,y:e.y}}function B2(){return navigator.maxTouchPoints||"ontouchstart"in this}function U2(){var e=D2,n=F2,i=z2,s=B2,o={},u=uu("start","drag","end"),l=0,c,d,p,h,m=0;function y(N){N.on("mousedown.drag",x).filter(s).on("touchstart.drag",S).on("touchmove.drag",k,$2).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(N,j){if(!(h||!e.call(this,N,j))){var I=E(this,n.call(this,N,j),N,j,"mouse");I&&(xn(N.view).on("mousemove.drag",C,so).on("mouseup.drag",_,so),Ck(N.view),xc(N),p=!1,c=N.clientX,d=N.clientY,I("start",N))}}function C(N){if(es(N),!p){var j=N.clientX-c,I=N.clientY-d;p=j*j+I*I>m}o.mouse("drag",N)}function _(N){xn(N.view).on("mousemove.drag mouseup.drag",null),Tk(N.view,p),es(N),o.mouse("end",N)}function S(N,j){if(e.call(this,N,j)){var I=N.changedTouches,P=n.call(this,N,j),B=I.length,M,F;for(M=0;M<B;++M)(F=E(this,P,N,j,I[M].identifier,I[M]))&&(xc(N),F("start",N,I[M]))}}function k(N){var j=N.changedTouches,I=j.length,P,B;for(P=0;P<I;++P)(B=o[j[P].identifier])&&(es(N),B("drag",N,j[P]))}function b(N){var j=N.changedTouches,I=j.length,P,B;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),P=0;P<I;++P)(B=o[j[P].identifier])&&(xc(N),B("end",N,j[P]))}function E(N,j,I,P,B,M){var F=u.copy(),O=In(M||I,j),Q,X,R;if((R=i.call(N,new Qm("beforestart",{sourceEvent:I,target:y,identifier:B,active:l,x:O[0],y:O[1],dx:0,dy:0,dispatch:F}),P))!=null)return Q=R.x-O[0]||0,X=R.y-O[1]||0,function K(H,te,Y){var $=O,G;switch(H){case"start":o[B]=K,G=l++;break;case"end":delete o[B],--l;case"drag":O=In(Y||te,j),G=l;break}F.call(H,N,new Qm(H,{sourceEvent:te,subject:R,target:y,identifier:B,active:G,x:O[0]+Q,y:O[1]+X,dx:O[0]-$[0],dy:O[1]-$[1],dispatch:F}),P)}}return y.filter=function(N){return arguments.length?(e=typeof N=="function"?N:ja(!!N),y):e},y.container=function(N){return arguments.length?(n=typeof N=="function"?N:ja(N),y):n},y.subject=function(N){return arguments.length?(i=typeof N=="function"?N:ja(N),y):i},y.touchable=function(N){return arguments.length?(s=typeof N=="function"?N:ja(!!N),y):s},y.on=function(){var N=u.on.apply(u,arguments);return N===u?y:N},y.clickDistance=function(N){return arguments.length?(m=(N=+N)*N,y):Math.sqrt(m)},y}function _g(e,n,i){e.prototype=n.prototype=i,i.constructor=e}function Rk(e,n){var i=Object.create(e.prototype);for(var s in n)i[s]=n[s];return i}function go(){}var oo=.7,Qa=1/oo,ts="\\s*([+-]?\\d+)\\s*",ao="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Hn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",H2=/^#([0-9a-f]{3,8})$/,V2=new RegExp(`^rgb\\(${ts},${ts},${ts}\\)$`),W2=new RegExp(`^rgb\\(${Hn},${Hn},${Hn}\\)$`),G2=new RegExp(`^rgba\\(${ts},${ts},${ts},${ao}\\)$`),K2=new RegExp(`^rgba\\(${Hn},${Hn},${Hn},${ao}\\)$`),Y2=new RegExp(`^hsl\\(${ao},${Hn},${Hn}\\)$`),X2=new RegExp(`^hsla\\(${ao},${Hn},${Hn},${ao}\\)$`),V0={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};_g(go,uo,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:W0,formatHex:W0,formatHex8:Q2,formatHsl:Z2,formatRgb:G0,toString:G0});function W0(){return this.rgb().formatHex()}function Q2(){return this.rgb().formatHex8()}function Z2(){return jk(this).formatHsl()}function G0(){return this.rgb().formatRgb()}function uo(e){var n,i;return e=(e+"").trim().toLowerCase(),(n=H2.exec(e))?(i=n[1].length,n=parseInt(n[1],16),i===6?K0(n):i===3?new Qt(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):i===8?Aa(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):i===4?Aa(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=V2.exec(e))?new Qt(n[1],n[2],n[3],1):(n=W2.exec(e))?new Qt(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=G2.exec(e))?Aa(n[1],n[2],n[3],n[4]):(n=K2.exec(e))?Aa(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=Y2.exec(e))?Q0(n[1],n[2]/100,n[3]/100,1):(n=X2.exec(e))?Q0(n[1],n[2]/100,n[3]/100,n[4]):V0.hasOwnProperty(e)?K0(V0[e]):e==="transparent"?new Qt(NaN,NaN,NaN,0):null}function K0(e){return new Qt(e>>16&255,e>>8&255,e&255,1)}function Aa(e,n,i,s){return s<=0&&(e=n=i=NaN),new Qt(e,n,i,s)}function J2(e){return e instanceof go||(e=uo(e)),e?(e=e.rgb(),new Qt(e.r,e.g,e.b,e.opacity)):new Qt}function Zm(e,n,i,s){return arguments.length===1?J2(e):new Qt(e,n,i,s??1)}function Qt(e,n,i,s){this.r=+e,this.g=+n,this.b=+i,this.opacity=+s}_g(Qt,Zm,Rk(go,{brighter(e){return e=e==null?Qa:Math.pow(Qa,e),new Qt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?oo:Math.pow(oo,e),new Qt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Qt(hi(this.r),hi(this.g),hi(this.b),Za(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:Y0,formatHex:Y0,formatHex8:ej,formatRgb:X0,toString:X0}));function Y0(){return`#${fi(this.r)}${fi(this.g)}${fi(this.b)}`}function ej(){return`#${fi(this.r)}${fi(this.g)}${fi(this.b)}${fi((isNaN(this.opacity)?1:this.opacity)*255)}`}function X0(){const e=Za(this.opacity);return`${e===1?"rgb(":"rgba("}${hi(this.r)}, ${hi(this.g)}, ${hi(this.b)}${e===1?")":`, ${e})`}`}function Za(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 fi(e){return e=hi(e),(e<16?"0":"")+e.toString(16)}function Q0(e,n,i,s){return s<=0?e=n=i=NaN:i<=0||i>=1?e=n=NaN:n<=0&&(e=NaN),new Mn(e,n,i,s)}function jk(e){if(e instanceof Mn)return new Mn(e.h,e.s,e.l,e.opacity);if(e instanceof go||(e=uo(e)),!e)return new Mn;if(e instanceof Mn)return e;e=e.rgb();var n=e.r/255,i=e.g/255,s=e.b/255,o=Math.min(n,i,s),u=Math.max(n,i,s),l=NaN,c=u-o,d=(u+o)/2;return c?(n===u?l=(i-s)/c+(i<s)*6:i===u?l=(s-n)/c+2:l=(n-i)/c+4,c/=d<.5?u+o:2-u-o,l*=60):c=d>0&&d<1?0:l,new Mn(l,c,d,e.opacity)}function tj(e,n,i,s){return arguments.length===1?jk(e):new Mn(e,n,i,s??1)}function Mn(e,n,i,s){this.h=+e,this.s=+n,this.l=+i,this.opacity=+s}_g(Mn,tj,Rk(go,{brighter(e){return e=e==null?Qa:Math.pow(Qa,e),new Mn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?oo:Math.pow(oo,e),new Mn(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 Qt(_c(e>=240?e-240:e+120,o,s),_c(e,o,s),_c(e<120?e+240:e-120,o,s),this.opacity)},clamp(){return new Mn(Z0(this.h),Ia(this.s),Ia(this.l),Za(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=Za(this.opacity);return`${e===1?"hsl(":"hsla("}${Z0(this.h)}, ${Ia(this.s)*100}%, ${Ia(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Z0(e){return e=(e||0)%360,e<0?e+360:e}function Ia(e){return Math.max(0,Math.min(1,e||0))}function _c(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 Ak=e=>()=>e;function nj(e,n){return function(i){return e+i*n}}function rj(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 ij(e){return(e=+e)==1?Ik:function(n,i){return i-n?rj(n,i,e):Ak(isNaN(n)?i:n)}}function Ik(e,n){var i=n-e;return i?nj(e,i):Ak(isNaN(e)?n:e)}const J0=(function e(n){var i=ij(n);function s(o,u){var l=i((o=Zm(o)).r,(u=Zm(u)).r),c=i(o.g,u.g),d=i(o.b,u.b),p=Ik(o.opacity,u.opacity);return function(h){return o.r=l(h),o.g=c(h),o.b=d(h),o.opacity=p(h),o+""}}return s.gamma=e,s})(1);function Dr(e,n){return e=+e,n=+n,function(i){return e*(1-i)+n*i}}var Jm=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Sc=new RegExp(Jm.source,"g");function sj(e){return function(){return e}}function oj(e){return function(n){return e(n)+""}}function aj(e,n){var i=Jm.lastIndex=Sc.lastIndex=0,s,o,u,l=-1,c=[],d=[];for(e=e+"",n=n+"";(s=Jm.exec(e))&&(o=Sc.exec(n));)(u=o.index)>i&&(u=n.slice(i,u),c[l]?c[l]+=u:c[++l]=u),(s=s[0])===(o=o[0])?c[l]?c[l]+=o:c[++l]=o:(c[++l]=null,d.push({i:l,x:Dr(s,o)})),i=Sc.lastIndex;return i<n.length&&(u=n.slice(i),c[l]?c[l]+=u:c[++l]=u),c.length<2?d[0]?oj(d[0].x):sj(n):(n=d.length,function(p){for(var h=0,m;h<n;++h)c[(m=d[h]).i]=m.x(p);return c.join("")})}var ew=180/Math.PI,eg={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Mk(e,n,i,s,o,u){var l,c,d;return(l=Math.sqrt(e*e+n*n))&&(e/=l,n/=l),(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,l=-l),{translateX:o,translateY:u,rotate:Math.atan2(n,e)*ew,skewX:Math.atan(d)*ew,scaleX:l,scaleY:c}}var Ma;function uj(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?eg:Mk(n.a,n.b,n.c,n.d,n.e,n.f)}function lj(e){return e==null||(Ma||(Ma=document.createElementNS("http://www.w3.org/2000/svg","g")),Ma.setAttribute("transform",e),!(e=Ma.transform.baseVal.consolidate()))?eg:(e=e.matrix,Mk(e.a,e.b,e.c,e.d,e.e,e.f))}function Pk(e,n,i,s){function o(p){return p.length?p.pop()+" ":""}function u(p,h,m,y,x,C){if(p!==m||h!==y){var _=x.push("translate(",null,n,null,i);C.push({i:_-4,x:Dr(p,m)},{i:_-2,x:Dr(h,y)})}else(m||y)&&x.push("translate("+m+n+y+i)}function l(p,h,m,y){p!==h?(p-h>180?h+=360:h-p>180&&(p+=360),y.push({i:m.push(o(m)+"rotate(",null,s)-2,x:Dr(p,h)})):h&&m.push(o(m)+"rotate("+h+s)}function c(p,h,m,y){p!==h?y.push({i:m.push(o(m)+"skewX(",null,s)-2,x:Dr(p,h)}):h&&m.push(o(m)+"skewX("+h+s)}function d(p,h,m,y,x,C){if(p!==m||h!==y){var _=x.push(o(x)+"scale(",null,",",null,")");C.push({i:_-4,x:Dr(p,m)},{i:_-2,x:Dr(h,y)})}else(m!==1||y!==1)&&x.push(o(x)+"scale("+m+","+y+")")}return function(p,h){var m=[],y=[];return p=e(p),h=e(h),u(p.translateX,p.translateY,h.translateX,h.translateY,m,y),l(p.rotate,h.rotate,m,y),c(p.skewX,h.skewX,m,y),d(p.scaleX,p.scaleY,h.scaleX,h.scaleY,m,y),p=h=null,function(x){for(var C=-1,_=y.length,S;++C<_;)m[(S=y[C]).i]=S.x(x);return m.join("")}}}var cj=Pk(uj,"px, ","px)","deg)"),fj=Pk(lj,", ",")",")"),dj=1e-12;function tw(e){return((e=Math.exp(e))+1/e)/2}function hj(e){return((e=Math.exp(e))-1/e)/2}function pj(e){return((e=Math.exp(2*e))-1)/(e+1)}const mj=(function e(n,i,s){function o(u,l){var c=u[0],d=u[1],p=u[2],h=l[0],m=l[1],y=l[2],x=h-c,C=m-d,_=x*x+C*C,S,k;if(_<dj)k=Math.log(y/p)/n,S=function(P){return[c+P*x,d+P*C,p*Math.exp(n*P*k)]};else{var b=Math.sqrt(_),E=(y*y-p*p+s*_)/(2*p*i*b),N=(y*y-p*p-s*_)/(2*y*i*b),j=Math.log(Math.sqrt(E*E+1)-E),I=Math.log(Math.sqrt(N*N+1)-N);k=(I-j)/n,S=function(P){var B=P*k,M=tw(j),F=p/(i*b)*(M*pj(n*B+j)-hj(j));return[c+F*x,d+F*C,p*M/tw(n*B+j)]}}return S.duration=k*1e3*n/Math.SQRT2,S}return o.rho=function(u){var l=Math.max(.001,+u),c=l*l,d=c*c;return e(l,c,d)},o})(Math.SQRT2,2,4);var is=0,Zs=0,Gs=0,qk=1e3,Ja,Js,eu=0,mi=0,cu=0,lo=typeof performance=="object"&&performance.now?performance:Date,Ok=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Sg(){return mi||(Ok(gj),mi=lo.now()+cu)}function gj(){mi=0}function tu(){this._call=this._time=this._next=null}tu.prototype=Lk.prototype={constructor:tu,restart:function(e,n,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?Sg():+i)+(n==null?0:+n),!this._next&&Js!==this&&(Js?Js._next=this:Ja=this,Js=this),this._call=e,this._time=i,tg()},stop:function(){this._call&&(this._call=null,this._time=1/0,tg())}};function Lk(e,n,i){var s=new tu;return s.restart(e,n,i),s}function vj(){Sg(),++is;for(var e=Ja,n;e;)(n=mi-e._time)>=0&&e._call.call(void 0,n),e=e._next;--is}function nw(){mi=(eu=lo.now())+cu,is=Zs=0;try{vj()}finally{is=0,wj(),mi=0}}function yj(){var e=lo.now(),n=e-eu;n>qk&&(cu-=n,eu=e)}function wj(){for(var e,n=Ja,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:Ja=i);Js=e,tg(s)}function tg(e){if(!is){Zs&&(Zs=clearTimeout(Zs));var n=e-mi;n>24?(e<1/0&&(Zs=setTimeout(nw,e-lo.now()-cu)),Gs&&(Gs=clearInterval(Gs))):(Gs||(eu=lo.now(),Gs=setInterval(yj,qk)),is=1,Ok(nw))}}function rw(e,n,i){var s=new tu;return n=n==null?0:+n,s.restart(o=>{s.stop(),e(o+n)},n,i),s}var xj=uu("start","end","cancel","interrupt"),_j=[],$k=0,iw=1,ng=2,Va=3,sw=4,rg=5,Wa=6;function fu(e,n,i,s,o,u){var l=e.__transition;if(!l)e.__transition={};else if(i in l)return;Sj(e,i,{name:n,index:s,group:o,on:xj,tween:_j,time:u.time,delay:u.delay,duration:u.duration,ease:u.ease,timer:null,state:$k})}function bg(e,n){var i=On(e,n);if(i.state>$k)throw new Error("too late; already scheduled");return i}function Vn(e,n){var i=On(e,n);if(i.state>Va)throw new Error("too late; already running");return i}function On(e,n){var i=e.__transition;if(!i||!(i=i[n]))throw new Error("transition not found");return i}function Sj(e,n,i){var s=e.__transition,o;s[n]=i,i.timer=Lk(u,0,i.time);function u(p){i.state=iw,i.timer.restart(l,i.delay,i.time),i.delay<=p&&l(p-i.delay)}function l(p){var h,m,y,x;if(i.state!==iw)return d();for(h in s)if(x=s[h],x.name===i.name){if(x.state===Va)return rw(l);x.state===sw?(x.state=Wa,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete s[h]):+h<n&&(x.state=Wa,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete s[h])}if(rw(function(){i.state===Va&&(i.state=sw,i.timer.restart(c,i.delay,i.time),c(p))}),i.state=ng,i.on.call("start",e,e.__data__,i.index,i.group),i.state===ng){for(i.state=Va,o=new Array(y=i.tween.length),h=0,m=-1;h<y;++h)(x=i.tween[h].value.call(e,e.__data__,i.index,i.group))&&(o[++m]=x);o.length=m+1}}function c(p){for(var h=p<i.duration?i.ease.call(null,p/i.duration):(i.timer.restart(d),i.state=rg,1),m=-1,y=o.length;++m<y;)o[m].call(e,h);i.state===rg&&(i.on.call("end",e,e.__data__,i.index,i.group),d())}function d(){i.state=Wa,i.timer.stop(),delete s[n];for(var p in s)return;delete e.__transition}}function Ga(e,n){var i=e.__transition,s,o,u=!0,l;if(i){n=n==null?null:n+"";for(l in i){if((s=i[l]).name!==n){u=!1;continue}o=s.state>ng&&s.state<rg,s.state=Wa,s.timer.stop(),s.on.call(o?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete i[l]}u&&delete e.__transition}}function bj(e){return this.each(function(){Ga(this,e)})}function kj(e,n){var i,s;return function(){var o=Vn(this,e),u=o.tween;if(u!==i){s=i=u;for(var l=0,c=s.length;l<c;++l)if(s[l].name===n){s=s.slice(),s.splice(l,1);break}}o.tween=s}}function Ej(e,n,i){var s,o;if(typeof i!="function")throw new Error;return function(){var u=Vn(this,e),l=u.tween;if(l!==s){o=(s=l).slice();for(var c={name:n,value:i},d=0,p=o.length;d<p;++d)if(o[d].name===n){o[d]=c;break}d===p&&o.push(c)}u.tween=o}}function Nj(e,n){var i=this._id;if(e+="",arguments.length<2){for(var s=On(this.node(),i).tween,o=0,u=s.length,l;o<u;++o)if((l=s[o]).name===e)return l.value;return null}return this.each((n==null?kj:Ej)(i,e,n))}function kg(e,n,i){var s=e._id;return e.each(function(){var o=Vn(this,s);(o.value||(o.value={}))[n]=i.apply(this,arguments)}),function(o){return On(o,s).value[n]}}function Dk(e,n){var i;return(typeof n=="number"?Dr:n instanceof uo?J0:(i=uo(n))?(n=i,J0):aj)(e,n)}function Cj(e){return function(){this.removeAttribute(e)}}function Tj(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Rj(e,n,i){var s,o=i+"",u;return function(){var l=this.getAttribute(e);return l===o?null:l===s?u:u=n(s=l,i)}}function jj(e,n,i){var s,o=i+"",u;return function(){var l=this.getAttributeNS(e.space,e.local);return l===o?null:l===s?u:u=n(s=l,i)}}function Aj(e,n,i){var s,o,u;return function(){var l,c=i(this),d;return c==null?void this.removeAttribute(e):(l=this.getAttribute(e),d=c+"",l===d?null:l===s&&d===o?u:(o=d,u=n(s=l,c)))}}function Ij(e,n,i){var s,o,u;return function(){var l,c=i(this),d;return c==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),d=c+"",l===d?null:l===s&&d===o?u:(o=d,u=n(s=l,c)))}}function Mj(e,n){var i=lu(e),s=i==="transform"?fj:Dk;return this.attrTween(e,typeof n=="function"?(i.local?Ij:Aj)(i,s,kg(this,"attr."+e,n)):n==null?(i.local?Tj:Cj)(i):(i.local?jj:Rj)(i,s,n))}function Pj(e,n){return function(i){this.setAttribute(e,n.call(this,i))}}function qj(e,n){return function(i){this.setAttributeNS(e.space,e.local,n.call(this,i))}}function Oj(e,n){var i,s;function o(){var u=n.apply(this,arguments);return u!==s&&(i=(s=u)&&qj(e,u)),i}return o._value=n,o}function Lj(e,n){var i,s;function o(){var u=n.apply(this,arguments);return u!==s&&(i=(s=u)&&Pj(e,u)),i}return o._value=n,o}function $j(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=lu(e);return this.tween(i,(s.local?Oj:Lj)(s,n))}function Dj(e,n){return function(){bg(this,e).delay=+n.apply(this,arguments)}}function Fj(e,n){return n=+n,function(){bg(this,e).delay=n}}function zj(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?Dj:Fj)(n,e)):On(this.node(),n).delay}function Bj(e,n){return function(){Vn(this,e).duration=+n.apply(this,arguments)}}function Uj(e,n){return n=+n,function(){Vn(this,e).duration=n}}function Hj(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?Bj:Uj)(n,e)):On(this.node(),n).duration}function Vj(e,n){if(typeof n!="function")throw new Error;return function(){Vn(this,e).ease=n}}function Wj(e){var n=this._id;return arguments.length?this.each(Vj(n,e)):On(this.node(),n).ease}function Gj(e,n){return function(){var i=n.apply(this,arguments);if(typeof i!="function")throw new Error;Vn(this,e).ease=i}}function Kj(e){if(typeof e!="function")throw new Error;return this.each(Gj(this._id,e))}function Yj(e){typeof e!="function"&&(e=vk(e));for(var n=this._groups,i=n.length,s=new Array(i),o=0;o<i;++o)for(var u=n[o],l=u.length,c=s[o]=[],d,p=0;p<l;++p)(d=u[p])&&e.call(d,d.__data__,p,u)&&c.push(d);return new fr(s,this._parents,this._name,this._id)}function Xj(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,i=e._groups,s=n.length,o=i.length,u=Math.min(s,o),l=new Array(s),c=0;c<u;++c)for(var d=n[c],p=i[c],h=d.length,m=l[c]=new Array(h),y,x=0;x<h;++x)(y=d[x]||p[x])&&(m[x]=y);for(;c<s;++c)l[c]=n[c];return new fr(l,this._parents,this._name,this._id)}function Qj(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 Zj(e,n,i){var s,o,u=Qj(n)?bg:Vn;return function(){var l=u(this,e),c=l.on;c!==s&&(o=(s=c).copy()).on(n,i),l.on=o}}function Jj(e,n){var i=this._id;return arguments.length<2?On(this.node(),i).on.on(e):this.each(Zj(i,e,n))}function eA(e){return function(){var n=this.parentNode;for(var i in this.__transition)if(+i!==e)return;n&&n.removeChild(this)}}function tA(){return this.on("end.remove",eA(this._id))}function nA(e){var n=this._name,i=this._id;typeof e!="function"&&(e=wg(e));for(var s=this._groups,o=s.length,u=new Array(o),l=0;l<o;++l)for(var c=s[l],d=c.length,p=u[l]=new Array(d),h,m,y=0;y<d;++y)(h=c[y])&&(m=e.call(h,h.__data__,y,c))&&("__data__"in h&&(m.__data__=h.__data__),p[y]=m,fu(p[y],n,i,y,p,On(h,i)));return new fr(u,this._parents,n,i)}function rA(e){var n=this._name,i=this._id;typeof e!="function"&&(e=gk(e));for(var s=this._groups,o=s.length,u=[],l=[],c=0;c<o;++c)for(var d=s[c],p=d.length,h,m=0;m<p;++m)if(h=d[m]){for(var y=e.call(h,h.__data__,m,d),x,C=On(h,i),_=0,S=y.length;_<S;++_)(x=y[_])&&fu(x,n,i,_,y,C);u.push(y),l.push(h)}return new fr(u,l,n,i)}var iA=mo.prototype.constructor;function sA(){return new iA(this._groups,this._parents)}function oA(e,n){var i,s,o;return function(){var u=rs(this,e),l=(this.style.removeProperty(e),rs(this,e));return u===l?null:u===i&&l===s?o:o=n(i=u,s=l)}}function Fk(e){return function(){this.style.removeProperty(e)}}function aA(e,n,i){var s,o=i+"",u;return function(){var l=rs(this,e);return l===o?null:l===s?u:u=n(s=l,i)}}function uA(e,n,i){var s,o,u;return function(){var l=rs(this,e),c=i(this),d=c+"";return c==null&&(d=c=(this.style.removeProperty(e),rs(this,e))),l===d?null:l===s&&d===o?u:(o=d,u=n(s=l,c))}}function lA(e,n){var i,s,o,u="style."+n,l="end."+u,c;return function(){var d=Vn(this,e),p=d.on,h=d.value[u]==null?c||(c=Fk(n)):void 0;(p!==i||o!==h)&&(s=(i=p).copy()).on(l,o=h),d.on=s}}function cA(e,n,i){var s=(e+="")=="transform"?cj:Dk;return n==null?this.styleTween(e,oA(e,s)).on("end.style."+e,Fk(e)):typeof n=="function"?this.styleTween(e,uA(e,s,kg(this,"style."+e,n))).each(lA(this._id,e)):this.styleTween(e,aA(e,s,n),i).on("end.style."+e,null)}function fA(e,n,i){return function(s){this.style.setProperty(e,n.call(this,s),i)}}function dA(e,n,i){var s,o;function u(){var l=n.apply(this,arguments);return l!==o&&(s=(o=l)&&fA(e,l,i)),s}return u._value=n,u}function hA(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,dA(e,n,i??""))}function pA(e){return function(){this.textContent=e}}function mA(e){return function(){var n=e(this);this.textContent=n??""}}function gA(e){return this.tween("text",typeof e=="function"?mA(kg(this,"text",e)):pA(e==null?"":e+""))}function vA(e){return function(n){this.textContent=e.call(this,n)}}function yA(e){var n,i;function s(){var o=e.apply(this,arguments);return o!==i&&(n=(i=o)&&vA(o)),n}return s._value=e,s}function wA(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,yA(e))}function xA(){for(var e=this._name,n=this._id,i=zk(),s=this._groups,o=s.length,u=0;u<o;++u)for(var l=s[u],c=l.length,d,p=0;p<c;++p)if(d=l[p]){var h=On(d,n);fu(d,e,i,p,l,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new fr(s,this._parents,e,i)}function _A(){var e,n,i=this,s=i._id,o=i.size();return new Promise(function(u,l){var c={value:l},d={value:function(){--o===0&&u()}};i.each(function(){var p=Vn(this,s),h=p.on;h!==e&&(n=(e=h).copy(),n._.cancel.push(c),n._.interrupt.push(c),n._.end.push(d)),p.on=n}),o===0&&u()})}var SA=0;function fr(e,n,i,s){this._groups=e,this._parents=n,this._name=i,this._id=s}function zk(){return++SA}var ar=mo.prototype;fr.prototype={constructor:fr,select:nA,selectAll:rA,selectChild:ar.selectChild,selectChildren:ar.selectChildren,filter:Yj,merge:Xj,selection:sA,transition:xA,call:ar.call,nodes:ar.nodes,node:ar.node,size:ar.size,empty:ar.empty,each:ar.each,on:Jj,attr:Mj,attrTween:$j,style:cA,styleTween:hA,text:gA,textTween:wA,remove:tA,tween:Nj,delay:zj,duration:Hj,ease:Wj,easeVarying:Kj,end:_A,[Symbol.iterator]:ar[Symbol.iterator]};function bA(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var kA={time:null,delay:0,duration:250,ease:bA};function EA(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 NA(e){var n,i;e instanceof fr?(n=e._id,e=e._name):(n=zk(),(i=kA).time=Sg(),e=e==null?null:e+"");for(var s=this._groups,o=s.length,u=0;u<o;++u)for(var l=s[u],c=l.length,d,p=0;p<c;++p)(d=l[p])&&fu(d,e,n,p,l,i||EA(d,n));return new fr(s,this._parents,e,n)}mo.prototype.interrupt=bj;mo.prototype.transition=NA;const Pa=e=>()=>e;function CA(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 lr(e,n,i){this.k=e,this.x=n,this.y=i}lr.prototype={constructor:lr,scale:function(e){return e===1?this:new lr(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new lr(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 cr=new lr(1,0,0);lr.prototype;function bc(e){e.stopImmediatePropagation()}function Ks(e){e.preventDefault(),e.stopImmediatePropagation()}function TA(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function RA(){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 ow(){return this.__zoom||cr}function jA(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function AA(){return navigator.maxTouchPoints||"ontouchstart"in this}function IA(e,n,i){var s=e.invertX(n[0][0])-i[0][0],o=e.invertX(n[1][0])-i[1][0],u=e.invertY(n[0][1])-i[0][1],l=e.invertY(n[1][1])-i[1][1];return e.translate(o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o),l>u?(u+l)/2:Math.min(0,u)||Math.max(0,l))}function Bk(){var e=TA,n=RA,i=IA,s=jA,o=AA,u=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,d=mj,p=uu("start","zoom","end"),h,m,y,x=500,C=150,_=0,S=10;function k(R){R.property("__zoom",ow).on("wheel.zoom",B,{passive:!1}).on("mousedown.zoom",M).on("dblclick.zoom",F).filter(o).on("touchstart.zoom",O).on("touchmove.zoom",Q).on("touchend.zoom touchcancel.zoom",X).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(R,K,H,te){var Y=R.selection?R.selection():R;Y.property("__zoom",ow),R!==Y?j(R,K,H,te):Y.interrupt().each(function(){I(this,arguments).event(te).start().zoom(null,typeof K=="function"?K.apply(this,arguments):K).end()})},k.scaleBy=function(R,K,H,te){k.scaleTo(R,function(){var Y=this.__zoom.k,$=typeof K=="function"?K.apply(this,arguments):K;return Y*$},H,te)},k.scaleTo=function(R,K,H,te){k.transform(R,function(){var Y=n.apply(this,arguments),$=this.__zoom,G=H==null?N(Y):typeof H=="function"?H.apply(this,arguments):H,A=$.invert(G),z=typeof K=="function"?K.apply(this,arguments):K;return i(E(b($,z),G,A),Y,l)},H,te)},k.translateBy=function(R,K,H,te){k.transform(R,function(){return i(this.__zoom.translate(typeof K=="function"?K.apply(this,arguments):K,typeof H=="function"?H.apply(this,arguments):H),n.apply(this,arguments),l)},null,te)},k.translateTo=function(R,K,H,te,Y){k.transform(R,function(){var $=n.apply(this,arguments),G=this.__zoom,A=te==null?N($):typeof te=="function"?te.apply(this,arguments):te;return i(cr.translate(A[0],A[1]).scale(G.k).translate(typeof K=="function"?-K.apply(this,arguments):-K,typeof H=="function"?-H.apply(this,arguments):-H),$,l)},te,Y)};function b(R,K){return K=Math.max(u[0],Math.min(u[1],K)),K===R.k?R:new lr(K,R.x,R.y)}function E(R,K,H){var te=K[0]-H[0]*R.k,Y=K[1]-H[1]*R.k;return te===R.x&&Y===R.y?R:new lr(R.k,te,Y)}function N(R){return[(+R[0][0]+ +R[1][0])/2,(+R[0][1]+ +R[1][1])/2]}function j(R,K,H,te){R.on("start.zoom",function(){I(this,arguments).event(te).start()}).on("interrupt.zoom end.zoom",function(){I(this,arguments).event(te).end()}).tween("zoom",function(){var Y=this,$=arguments,G=I(Y,$).event(te),A=n.apply(Y,$),z=H==null?N(A):typeof H=="function"?H.apply(Y,$):H,ae=Math.max(A[1][0]-A[0][0],A[1][1]-A[0][1]),D=Y.__zoom,V=typeof K=="function"?K.apply(Y,$):K,J=d(D.invert(z).concat(ae/D.k),V.invert(z).concat(ae/V.k));return function(se){if(se===1)se=V;else{var ue=J(se),he=ae/ue[2];se=new lr(he,z[0]-ue[0]*he,z[1]-ue[1]*he)}G.zoom(null,se)}})}function I(R,K,H){return!H&&R.__zooming||new P(R,K)}function P(R,K){this.that=R,this.args=K,this.active=0,this.sourceEvent=null,this.extent=n.apply(R,K),this.taps=0}P.prototype={event:function(R){return R&&(this.sourceEvent=R),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(R,K){return this.mouse&&R!=="mouse"&&(this.mouse[1]=K.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=K.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=K.invert(this.touch1[0])),this.that.__zoom=K,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var K=xn(this.that).datum();p.call(R,this.that,new CA(R,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:p}),K)}};function B(R,...K){if(!e.apply(this,arguments))return;var H=I(this,K).event(R),te=this.__zoom,Y=Math.max(u[0],Math.min(u[1],te.k*Math.pow(2,s.apply(this,arguments)))),$=In(R);if(H.wheel)(H.mouse[0][0]!==$[0]||H.mouse[0][1]!==$[1])&&(H.mouse[1]=te.invert(H.mouse[0]=$)),clearTimeout(H.wheel);else{if(te.k===Y)return;H.mouse=[$,te.invert($)],Ga(this),H.start()}Ks(R),H.wheel=setTimeout(G,C),H.zoom("mouse",i(E(b(te,Y),H.mouse[0],H.mouse[1]),H.extent,l));function G(){H.wheel=null,H.end()}}function M(R,...K){if(y||!e.apply(this,arguments))return;var H=R.currentTarget,te=I(this,K,!0).event(R),Y=xn(R.view).on("mousemove.zoom",z,!0).on("mouseup.zoom",ae,!0),$=In(R,H),G=R.clientX,A=R.clientY;Ck(R.view),bc(R),te.mouse=[$,this.__zoom.invert($)],Ga(this),te.start();function z(D){if(Ks(D),!te.moved){var V=D.clientX-G,J=D.clientY-A;te.moved=V*V+J*J>_}te.event(D).zoom("mouse",i(E(te.that.__zoom,te.mouse[0]=In(D,H),te.mouse[1]),te.extent,l))}function ae(D){Y.on("mousemove.zoom mouseup.zoom",null),Tk(D.view,te.moved),Ks(D),te.event(D).end()}}function F(R,...K){if(e.apply(this,arguments)){var H=this.__zoom,te=In(R.changedTouches?R.changedTouches[0]:R,this),Y=H.invert(te),$=H.k*(R.shiftKey?.5:2),G=i(E(b(H,$),te,Y),n.apply(this,K),l);Ks(R),c>0?xn(this).transition().duration(c).call(j,G,te,R):xn(this).call(k.transform,G,te,R)}}function O(R,...K){if(e.apply(this,arguments)){var H=R.touches,te=H.length,Y=I(this,K,R.changedTouches.length===te).event(R),$,G,A,z;for(bc(R),G=0;G<te;++G)A=H[G],z=In(A,this),z=[z,this.__zoom.invert(z),A.identifier],Y.touch0?!Y.touch1&&Y.touch0[2]!==z[2]&&(Y.touch1=z,Y.taps=0):(Y.touch0=z,$=!0,Y.taps=1+!!h);h&&(h=clearTimeout(h)),$&&(Y.taps<2&&(m=z[0],h=setTimeout(function(){h=null},x)),Ga(this),Y.start())}}function Q(R,...K){if(this.__zooming){var H=I(this,K).event(R),te=R.changedTouches,Y=te.length,$,G,A,z;for(Ks(R),$=0;$<Y;++$)G=te[$],A=In(G,this),H.touch0&&H.touch0[2]===G.identifier?H.touch0[0]=A:H.touch1&&H.touch1[2]===G.identifier&&(H.touch1[0]=A);if(G=H.that.__zoom,H.touch1){var ae=H.touch0[0],D=H.touch0[1],V=H.touch1[0],J=H.touch1[1],se=(se=V[0]-ae[0])*se+(se=V[1]-ae[1])*se,ue=(ue=J[0]-D[0])*ue+(ue=J[1]-D[1])*ue;G=b(G,Math.sqrt(se/ue)),A=[(ae[0]+V[0])/2,(ae[1]+V[1])/2],z=[(D[0]+J[0])/2,(D[1]+J[1])/2]}else if(H.touch0)A=H.touch0[0],z=H.touch0[1];else return;H.zoom("touch",i(E(G,A,z),H.extent,l))}}function X(R,...K){if(this.__zooming){var H=I(this,K).event(R),te=R.changedTouches,Y=te.length,$,G;for(bc(R),y&&clearTimeout(y),y=setTimeout(function(){y=null},x),$=0;$<Y;++$)G=te[$],H.touch0&&H.touch0[2]===G.identifier?delete H.touch0:H.touch1&&H.touch1[2]===G.identifier&&delete H.touch1;if(H.touch1&&!H.touch0&&(H.touch0=H.touch1,delete H.touch1),H.touch0)H.touch0[1]=this.__zoom.invert(H.touch0[0]);else if(H.end(),H.taps===2&&(G=In(G,this),Math.hypot(m[0]-G[0],m[1]-G[1])<S)){var A=xn(this).on("dblclick.zoom");A&&A.apply(this,arguments)}}}return k.wheelDelta=function(R){return arguments.length?(s=typeof R=="function"?R:Pa(+R),k):s},k.filter=function(R){return arguments.length?(e=typeof R=="function"?R:Pa(!!R),k):e},k.touchable=function(R){return arguments.length?(o=typeof R=="function"?R:Pa(!!R),k):o},k.extent=function(R){return arguments.length?(n=typeof R=="function"?R:Pa([[+R[0][0],+R[0][1]],[+R[1][0],+R[1][1]]]),k):n},k.scaleExtent=function(R){return arguments.length?(u[0]=+R[0],u[1]=+R[1],k):[u[0],u[1]]},k.translateExtent=function(R){return arguments.length?(l[0][0]=+R[0][0],l[1][0]=+R[1][0],l[0][1]=+R[0][1],l[1][1]=+R[1][1],k):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},k.constrain=function(R){return arguments.length?(i=R,k):i},k.duration=function(R){return arguments.length?(c=+R,k):c},k.interpolate=function(R){return arguments.length?(d=R,k):d},k.on=function(){var R=p.on.apply(p,arguments);return R===p?k:R},k.clickDistance=function(R){return arguments.length?(_=(R=+R)*R,k):Math.sqrt(_)},k.tapDistance=function(R){return arguments.length?(S=+R,k):S},k}hk();const du=q.createContext(null),MA=du.Provider,dr={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.`},Uk=dr.error001();function Ve(e,n){const i=q.useContext(du);if(i===null)throw new Error(Uk);return pk(i,e,n)}const kt=()=>{const e=q.useContext(du);if(e===null)throw new Error(Uk);return q.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},PA=e=>e.userSelectionActive?"none":"all";function Eg({position:e,children:n,className:i,style:s,...o}){const u=Ve(PA),l=`${e}`.split("-");return oe.createElement("div",{className:Pt(["react-flow__panel",i,...l]),style:{...s,pointerEvents:u},...o},n)}function qA({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:oe.createElement(Eg,{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"},oe.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const OA=({x:e,y:n,label:i,labelStyle:s={},labelShowBg:o=!0,labelBgStyle:u={},labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:d,className:p,...h})=>{const m=q.useRef(null),[y,x]=q.useState({x:0,y:0,width:0,height:0}),C=Pt(["react-flow__edge-textwrapper",p]);return q.useEffect(()=>{if(m.current){const _=m.current.getBBox();x({x:_.x,y:_.y,width:_.width,height:_.height})}},[i]),typeof i>"u"||!i?null:oe.createElement("g",{transform:`translate(${e-y.width/2} ${n-y.height/2})`,className:C,visibility:y.width?"visible":"hidden",...h},o&&oe.createElement("rect",{width:y.width+2*l[0],x:-l[0],y:-l[1],height:y.height+2*l[1],className:"react-flow__edge-textbg",style:u,rx:c,ry:c}),oe.createElement("text",{className:"react-flow__edge-text",y:y.height/2,dy:"0.3em",ref:m,style:s},i),d)};var LA=q.memo(OA);const Ng=e=>({width:e.offsetWidth,height:e.offsetHeight}),ss=(e,n=0,i=1)=>Math.min(Math.max(e,n),i),Cg=(e={x:0,y:0},n)=>({x:ss(e.x,n[0][0],n[1][0]),y:ss(e.y,n[0][1],n[1][1])}),aw=(e,n,i)=>e<n?ss(Math.abs(e-n),1,50)/50:e>i?-ss(Math.abs(e-i),1,50)/50:0,Hk=(e,n)=>{const i=aw(e.x,35,n.width-35)*20,s=aw(e.y,35,n.height-35)*20;return[i,s]},Vk=e=>{var n;return((n=e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},Wk=(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)}),co=({x:e,y:n,width:i,height:s})=>({x:e,y:n,x2:e+i,y2:n+s}),Gk=({x:e,y:n,x2:i,y2:s})=>({x:e,y:n,width:i-e,height:s-n}),uw=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),$A=(e,n)=>Gk(Wk(co(e),co(n))),ig=(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)},DA=e=>_n(e.width)&&_n(e.height)&&_n(e.x)&&_n(e.y),_n=e=>!isNaN(e)&&isFinite(e),ct=Symbol.for("internals"),Kk=["Enter"," ","Escape"],FA=(e,n)=>{},zA=e=>"nativeEvent"in e;function sg(e){var o,u;const n=zA(e)?e.nativeEvent:e,i=((u=(o=n.composedPath)==null?void 0:o.call(n))==null?void 0:u[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 Yk=e=>"clientX"in e,Br=(e,n)=>{var u,l;const i=Yk(e),s=i?e.clientX:(u=e.touches)==null?void 0:u[0].clientX,o=i?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:s-((n==null?void 0:n.left)??0),y:o-((n==null?void 0:n.top)??0)}},nu=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},vo=({id:e,path:n,labelX:i,labelY:s,label:o,labelStyle:u,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:y,interactionWidth:x=20})=>oe.createElement(oe.Fragment,null,oe.createElement("path",{id:e,style:h,d:n,fill:"none",className:"react-flow__edge-path",markerEnd:m,markerStart:y}),x&&oe.createElement("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:x,className:"react-flow__edge-interaction"}),o&&_n(i)&&_n(s)?oe.createElement(LA,{x:i,y:s,label:o,labelStyle:u,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:p}):null);vo.displayName="BaseEdge";function Ys(e,n,i){return i===void 0?i:s=>{const o=n().edges.find(u=>u.id===e);o&&i(s,{...o})}}function Xk({sourceX:e,sourceY:n,targetX:i,targetY:s}){const o=Math.abs(i-e)/2,u=i<e?i+o:i-o,l=Math.abs(s-n)/2,c=s<n?s+l:s-l;return[u,c,o,l]}function Qk({sourceX:e,sourceY:n,targetX:i,targetY:s,sourceControlX:o,sourceControlY:u,targetControlX:l,targetControlY:c}){const d=e*.125+o*.375+l*.375+i*.125,p=n*.125+u*.375+c*.375+s*.125,h=Math.abs(d-e),m=Math.abs(p-n);return[d,p,h,m]}var gi;(function(e){e.Strict="strict",e.Loose="loose"})(gi||(gi={}));var di;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(di||(di={}));var fo;(function(e){e.Partial="partial",e.Full="full"})(fo||(fo={}));var zr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(zr||(zr={}));var ru;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ru||(ru={}));var Ce;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ce||(Ce={}));function lw({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 Zk({sourceX:e,sourceY:n,sourcePosition:i=Ce.Bottom,targetX:s,targetY:o,targetPosition:u=Ce.Top}){const[l,c]=lw({pos:i,x1:e,y1:n,x2:s,y2:o}),[d,p]=lw({pos:u,x1:s,y1:o,x2:e,y2:n}),[h,m,y,x]=Qk({sourceX:e,sourceY:n,targetX:s,targetY:o,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:p});return[`M${e},${n} C${l},${c} ${d},${p} ${s},${o}`,h,m,y,x]}const Tg=q.memo(({sourceX:e,sourceY:n,targetX:i,targetY:s,sourcePosition:o=Ce.Bottom,targetPosition:u=Ce.Top,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:p,labelBgPadding:h,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:C,interactionWidth:_})=>{const[S,k,b]=Zk({sourceX:e,sourceY:n,sourcePosition:o,targetX:i,targetY:s,targetPosition:u});return oe.createElement(vo,{path:S,labelX:k,labelY:b,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:p,labelBgPadding:h,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:C,interactionWidth:_})});Tg.displayName="SimpleBezierEdge";const cw={[Ce.Left]:{x:-1,y:0},[Ce.Right]:{x:1,y:0},[Ce.Top]:{x:0,y:-1},[Ce.Bottom]:{x:0,y:1}},BA=({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},fw=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function UA({source:e,sourcePosition:n=Ce.Bottom,target:i,targetPosition:s=Ce.Top,center:o,offset:u}){const l=cw[n],c=cw[s],d={x:e.x+l.x*u,y:e.y+l.y*u},p={x:i.x+c.x*u,y:i.y+c.y*u},h=BA({source:d,sourcePosition:n,target:p}),m=h.x!==0?"x":"y",y=h[m];let x=[],C,_;const S={x:0,y:0},k={x:0,y:0},[b,E,N,j]=Xk({sourceX:e.x,sourceY:e.y,targetX:i.x,targetY:i.y});if(l[m]*c[m]===-1){C=o.x??b,_=o.y??E;const P=[{x:C,y:d.y},{x:C,y:p.y}],B=[{x:d.x,y:_},{x:p.x,y:_}];l[m]===y?x=m==="x"?P:B:x=m==="x"?B:P}else{const P=[{x:d.x,y:p.y}],B=[{x:p.x,y:d.y}];if(m==="x"?x=l.x===y?B:P:x=l.y===y?P:B,n===s){const X=Math.abs(e[m]-i[m]);if(X<=u){const R=Math.min(u-1,u-X);l[m]===y?S[m]=(d[m]>e[m]?-1:1)*R:k[m]=(p[m]>i[m]?-1:1)*R}}if(n!==s){const X=m==="x"?"y":"x",R=l[m]===c[X],K=d[X]>p[X],H=d[X]<p[X];(l[m]===1&&(!R&&K||R&&H)||l[m]!==1&&(!R&&H||R&&K))&&(x=m==="x"?P:B)}const M={x:d.x+S.x,y:d.y+S.y},F={x:p.x+k.x,y:p.y+k.y},O=Math.max(Math.abs(M.x-x[0].x),Math.abs(F.x-x[0].x)),Q=Math.max(Math.abs(M.y-x[0].y),Math.abs(F.y-x[0].y));O>=Q?(C=(M.x+F.x)/2,_=x[0].y):(C=x[0].x,_=(M.y+F.y)/2)}return[[e,{x:d.x+S.x,y:d.y+S.y},...x,{x:p.x+k.x,y:p.y+k.y},i],C,_,N,j]}function HA(e,n,i,s){const o=Math.min(fw(e,n)/2,fw(n,i)/2,s),{x:u,y:l}=n;if(e.x===u&&u===i.x||e.y===l&&l===i.y)return`L${u} ${l}`;if(e.y===l){const p=e.x<i.x?-1:1,h=e.y<i.y?1:-1;return`L ${u+o*p},${l}Q ${u},${l} ${u},${l+o*h}`}const c=e.x<i.x?1:-1,d=e.y<i.y?-1:1;return`L ${u},${l+o*d}Q ${u},${l} ${u+o*c},${l}`}function og({sourceX:e,sourceY:n,sourcePosition:i=Ce.Bottom,targetX:s,targetY:o,targetPosition:u=Ce.Top,borderRadius:l=5,centerX:c,centerY:d,offset:p=20}){const[h,m,y,x,C]=UA({source:{x:e,y:n},sourcePosition:i,target:{x:s,y:o},targetPosition:u,center:{x:c,y:d},offset:p});return[h.reduce((S,k,b)=>{let E="";return b>0&&b<h.length-1?E=HA(h[b-1],k,h[b+1],l):E=`${b===0?"M":"L"}${k.x} ${k.y}`,S+=E,S},""),m,y,x,C]}const hu=q.memo(({sourceX:e,sourceY:n,targetX:i,targetY:s,label:o,labelStyle:u,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:p,style:h,sourcePosition:m=Ce.Bottom,targetPosition:y=Ce.Top,markerEnd:x,markerStart:C,pathOptions:_,interactionWidth:S})=>{const[k,b,E]=og({sourceX:e,sourceY:n,sourcePosition:m,targetX:i,targetY:s,targetPosition:y,borderRadius:_==null?void 0:_.borderRadius,offset:_==null?void 0:_.offset});return oe.createElement(vo,{path:k,labelX:b,labelY:E,label:o,labelStyle:u,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:p,style:h,markerEnd:x,markerStart:C,interactionWidth:S})});hu.displayName="SmoothStepEdge";const Rg=q.memo(e=>{var n;return oe.createElement(hu,{...e,pathOptions:q.useMemo(()=>{var i;return{borderRadius:0,offset:(i=e.pathOptions)==null?void 0:i.offset}},[(n=e.pathOptions)==null?void 0:n.offset])})});Rg.displayName="StepEdge";function VA({sourceX:e,sourceY:n,targetX:i,targetY:s}){const[o,u,l,c]=Xk({sourceX:e,sourceY:n,targetX:i,targetY:s});return[`M ${e},${n}L ${i},${s}`,o,u,l,c]}const jg=q.memo(({sourceX:e,sourceY:n,targetX:i,targetY:s,label:o,labelStyle:u,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:y,interactionWidth:x})=>{const[C,_,S]=VA({sourceX:e,sourceY:n,targetX:i,targetY:s});return oe.createElement(vo,{path:C,labelX:_,labelY:S,label:o,labelStyle:u,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:p,style:h,markerEnd:m,markerStart:y,interactionWidth:x})});jg.displayName="StraightEdge";function qa(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function dw({pos:e,x1:n,y1:i,x2:s,y2:o,c:u}){switch(e){case Ce.Left:return[n-qa(n-s,u),i];case Ce.Right:return[n+qa(s-n,u),i];case Ce.Top:return[n,i-qa(i-o,u)];case Ce.Bottom:return[n,i+qa(o-i,u)]}}function Jk({sourceX:e,sourceY:n,sourcePosition:i=Ce.Bottom,targetX:s,targetY:o,targetPosition:u=Ce.Top,curvature:l=.25}){const[c,d]=dw({pos:i,x1:e,y1:n,x2:s,y2:o,c:l}),[p,h]=dw({pos:u,x1:s,y1:o,x2:e,y2:n,c:l}),[m,y,x,C]=Qk({sourceX:e,sourceY:n,targetX:s,targetY:o,sourceControlX:c,sourceControlY:d,targetControlX:p,targetControlY:h});return[`M${e},${n} C${c},${d} ${p},${h} ${s},${o}`,m,y,x,C]}const iu=q.memo(({sourceX:e,sourceY:n,targetX:i,targetY:s,sourcePosition:o=Ce.Bottom,targetPosition:u=Ce.Top,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:p,labelBgPadding:h,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:C,pathOptions:_,interactionWidth:S})=>{const[k,b,E]=Jk({sourceX:e,sourceY:n,sourcePosition:o,targetX:i,targetY:s,targetPosition:u,curvature:_==null?void 0:_.curvature});return oe.createElement(vo,{path:k,labelX:b,labelY:E,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:p,labelBgPadding:h,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:C,interactionWidth:S})});iu.displayName="BezierEdge";const Ag=q.createContext(null),WA=Ag.Provider;Ag.Consumer;const GA=()=>q.useContext(Ag),KA=e=>"id"in e&&"source"in e&&"target"in e,YA=({source:e,sourceHandle:n,target:i,targetHandle:s})=>`reactflow__edge-${e}${n||""}-${i}${s||""}`,ag=(e,n)=>typeof e>"u"?"":typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`,XA=(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)),QA=(e,n)=>{if(!e.source||!e.target)return n;let i;return KA(e)?i={...e}:i={...e,id:YA(e)},XA(i,n)?n:n.concat(i)},ug=({x:e,y:n},[i,s,o],u,[l,c])=>{const d={x:(e-i)/o,y:(n-s)/o};return u?{x:l*Math.round(d.x/l),y:c*Math.round(d.y/c)}:d},eE=({x:e,y:n},[i,s,o])=>({x:e*o+i,y:n*o+s}),pi=(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}},pu=(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:u,y:l}=pi(o,n).positionAbsolute;return Wk(s,co({x:u,y:l,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Gk(i)},tE=(e,n,[i,s,o]=[0,0,1],u=!1,l=!1,c=[0,0])=>{const d={x:(n.x-i)/o,y:(n.y-s)/o,width:n.width/o,height:n.height/o},p=[];return e.forEach(h=>{const{width:m,height:y,selectable:x=!0,hidden:C=!1}=h;if(l&&!x||C)return!1;const{positionAbsolute:_}=pi(h,c),S={x:_.x,y:_.y,width:m||0,height:y||0},k=ig(d,S),b=typeof m>"u"||typeof y>"u"||m===null||y===null,E=u&&k>0,N=(m||0)*(y||0);(b||E||k>=N||h.dragging)&&p.push(h)}),p},nE=(e,n)=>{const i=e.map(s=>s.id);return n.filter(s=>i.includes(s.source)||i.includes(s.target))},rE=(e,n,i,s,o,u=.1)=>{const l=n/(e.width*(1+u)),c=i/(e.height*(1+u)),d=Math.min(l,c),p=ss(d,s,o),h=e.x+e.width/2,m=e.y+e.height/2,y=n/2-h*p,x=i/2-m*p;return{x:y,y:x,zoom:p}},ci=(e,n=0)=>e.transition().duration(n);function hw(e,n,i,s){return(n[i]||[]).reduce((o,u)=>{var l,c;return`${e.id}-${u.id}-${i}`!==s&&o.push({id:u.id||null,type:i,nodeId:e.id,x:(((l=e.positionAbsolute)==null?void 0:l.x)??0)+u.x+u.width/2,y:(((c=e.positionAbsolute)==null?void 0:c.y)??0)+u.y+u.height/2}),o},[])}function ZA(e,n,i,s,o,u){const{x:l,y:c}=Br(e),p=n.elementsFromPoint(l,c).find(C=>C.classList.contains("react-flow__handle"));if(p){const C=p.getAttribute("data-nodeid");if(C){const _=Ig(void 0,p),S=p.getAttribute("data-handleid"),k=u({nodeId:C,id:S,type:_});if(k){const b=o.find(E=>E.nodeId===C&&E.type===_&&E.id===S);return{handle:{id:S,type:_,nodeId:C,x:(b==null?void 0:b.x)||i.x,y:(b==null?void 0:b.y)||i.y},validHandleResult:k}}}}let h=[],m=1/0;if(o.forEach(C=>{const _=Math.sqrt((C.x-i.x)**2+(C.y-i.y)**2);if(_<=s){const S=u(C);_<=m&&(_<m?h=[{handle:C,validHandleResult:S}]:_===m&&h.push({handle:C,validHandleResult:S}),m=_)}}),!h.length)return{handle:null,validHandleResult:iE()};if(h.length===1)return h[0];const y=h.some(({validHandleResult:C})=>C.isValid),x=h.some(({handle:C})=>C.type==="target");return h.find(({handle:C,validHandleResult:_})=>x?C.type==="target":y?_.isValid:!0)||h[0]}const JA={source:null,target:null,sourceHandle:null,targetHandle:null},iE=()=>({handleDomNode:null,isValid:!1,connection:JA,endHandle:null});function sE(e,n,i,s,o,u,l){const c=o==="target",d=l.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),p={...iE(),handleDomNode:d};if(d){const h=Ig(void 0,d),m=d.getAttribute("data-nodeid"),y=d.getAttribute("data-handleid"),x=d.classList.contains("connectable"),C=d.classList.contains("connectableend"),_={source:c?m:i,sourceHandle:c?y:s,target:c?i:m,targetHandle:c?s:y};p.connection=_,x&&C&&(n===gi.Strict?c&&h==="source"||!c&&h==="target":m!==i||y!==s)&&(p.endHandle={nodeId:m,handleId:y,type:h},p.isValid=u(_))}return p}function eI({nodes:e,nodeId:n,handleId:i,handleType:s}){return e.reduce((o,u)=>{if(u[ct]){const{handleBounds:l}=u[ct];let c=[],d=[];l&&(c=hw(u,l,"source",`${n}-${i}-${s}`),d=hw(u,l,"target",`${n}-${i}-${s}`)),o.push(...c,...d)}return o},[])}function Ig(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function kc(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function tI(e,n){let i=null;return n?i="valid":e&&!n&&(i="invalid"),i}function oE({event:e,handleId:n,nodeId:i,onConnect:s,isTarget:o,getState:u,setState:l,isValidConnection:c,edgeUpdaterType:d,onReconnectEnd:p}){const h=Vk(e.target),{connectionMode:m,domNode:y,autoPanOnConnect:x,connectionRadius:C,onConnectStart:_,panBy:S,getNodes:k,cancelConnection:b}=u();let E=0,N;const{x:j,y:I}=Br(e),P=h==null?void 0:h.elementFromPoint(j,I),B=Ig(d,P),M=y==null?void 0:y.getBoundingClientRect();if(!M||!B)return;let F,O=Br(e,M),Q=!1,X=null,R=!1,K=null;const H=eI({nodes:k(),nodeId:i,handleId:n,handleType:B}),te=()=>{if(!x)return;const[G,A]=Hk(O,M);S({x:G,y:A}),E=requestAnimationFrame(te)};l({connectionPosition:O,connectionStatus:null,connectionNodeId:i,connectionHandleId:n,connectionHandleType:B,connectionStartHandle:{nodeId:i,handleId:n,type:B},connectionEndHandle:null}),_==null||_(e,{nodeId:i,handleId:n,handleType:B});function Y(G){const{transform:A}=u();O=Br(G,M);const{handle:z,validHandleResult:ae}=ZA(G,h,ug(O,A,!1,[1,1]),C,H,D=>sE(D,m,i,n,o?"target":"source",c,h));if(N=z,Q||(te(),Q=!0),K=ae.handleDomNode,X=ae.connection,R=ae.isValid,l({connectionPosition:N&&R?eE({x:N.x,y:N.y},A):O,connectionStatus:tI(!!N,R),connectionEndHandle:ae.endHandle}),!N&&!R&&!K)return kc(F);X.source!==X.target&&K&&(kc(F),F=K,K.classList.add("connecting","react-flow__handle-connecting"),K.classList.toggle("valid",R),K.classList.toggle("react-flow__handle-valid",R))}function $(G){var A,z;(N||K)&&X&&R&&(s==null||s(X)),(z=(A=u()).onConnectEnd)==null||z.call(A,G),d&&(p==null||p(G)),kc(F),b(),cancelAnimationFrame(E),Q=!1,R=!1,X=null,K=null,h.removeEventListener("mousemove",Y),h.removeEventListener("mouseup",$),h.removeEventListener("touchmove",Y),h.removeEventListener("touchend",$)}h.addEventListener("mousemove",Y),h.addEventListener("mouseup",$),h.addEventListener("touchmove",Y),h.addEventListener("touchend",$)}const pw=()=>!0,nI=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),rI=(e,n,i)=>s=>{const{connectionStartHandle:o,connectionEndHandle:u,connectionClickStartHandle:l}=s;return{connecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===n&&(o==null?void 0:o.type)===i||(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.handleId)===n&&(u==null?void 0:u.type)===i,clickConnecting:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.handleId)===n&&(l==null?void 0:l.type)===i}},aE=q.forwardRef(({type:e="source",position:n=Ce.Top,isValidConnection:i,isConnectable:s=!0,isConnectableStart:o=!0,isConnectableEnd:u=!0,id:l,onConnect:c,children:d,className:p,onMouseDown:h,onTouchStart:m,...y},x)=>{var M,F;const C=l||null,_=e==="target",S=kt(),k=GA(),{connectOnClick:b,noPanClassName:E}=Ve(nI,bt),{connecting:N,clickConnecting:j}=Ve(rI(k,C,e),bt);k||(F=(M=S.getState()).onError)==null||F.call(M,"010",dr.error010());const I=O=>{const{defaultEdgeOptions:Q,onConnect:X,hasDefaultEdges:R}=S.getState(),K={...Q,...O};if(R){const{edges:H,setEdges:te}=S.getState();te(QA(K,H))}X==null||X(K),c==null||c(K)},P=O=>{if(!k)return;const Q=Yk(O);o&&(Q&&O.button===0||!Q)&&oE({event:O,handleId:C,nodeId:k,onConnect:I,isTarget:_,getState:S.getState,setState:S.setState,isValidConnection:i||S.getState().isValidConnection||pw}),Q?h==null||h(O):m==null||m(O)},B=O=>{const{onClickConnectStart:Q,onClickConnectEnd:X,connectionClickStartHandle:R,connectionMode:K,isValidConnection:H}=S.getState();if(!k||!R&&!o)return;if(!R){Q==null||Q(O,{nodeId:k,handleId:C,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:k,type:e,handleId:C}});return}const te=Vk(O.target),Y=i||H||pw,{connection:$,isValid:G}=sE({nodeId:k,id:C,type:e},K,R.nodeId,R.handleId||null,R.type,Y,te);G&&I($),X==null||X(O),S.setState({connectionClickStartHandle:null})};return oe.createElement("div",{"data-handleid":C,"data-nodeid":k,"data-handlepos":n,"data-id":`${k}-${C}-${e}`,className:Pt(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",E,p,{source:!_,target:_,connectable:s,connectablestart:o,connectableend:u,connecting:j,connectionindicator:s&&(o&&!N||u&&N)}]),onMouseDown:P,onTouchStart:P,onClick:b?B:void 0,ref:x,...y},d)});aE.displayName="Handle";var os=q.memo(aE);const uE=({data:e,isConnectable:n,targetPosition:i=Ce.Top,sourcePosition:s=Ce.Bottom})=>oe.createElement(oe.Fragment,null,oe.createElement(os,{type:"target",position:i,isConnectable:n}),e==null?void 0:e.label,oe.createElement(os,{type:"source",position:s,isConnectable:n}));uE.displayName="DefaultNode";var lg=q.memo(uE);const lE=({data:e,isConnectable:n,sourcePosition:i=Ce.Bottom})=>oe.createElement(oe.Fragment,null,e==null?void 0:e.label,oe.createElement(os,{type:"source",position:i,isConnectable:n}));lE.displayName="InputNode";var cE=q.memo(lE);const fE=({data:e,isConnectable:n,targetPosition:i=Ce.Top})=>oe.createElement(oe.Fragment,null,oe.createElement(os,{type:"target",position:i,isConnectable:n}),e==null?void 0:e.label);fE.displayName="OutputNode";var dE=q.memo(fE);const Mg=()=>null;Mg.displayName="GroupNode";const iI=e=>({selectedNodes:e.getNodes().filter(n=>n.selected),selectedEdges:e.edges.filter(n=>n.selected).map(n=>({...n}))}),Oa=e=>e.id;function sI(e,n){return bt(e.selectedNodes.map(Oa),n.selectedNodes.map(Oa))&&bt(e.selectedEdges.map(Oa),n.selectedEdges.map(Oa))}const hE=q.memo(({onSelectionChange:e})=>{const n=kt(),{selectedNodes:i,selectedEdges:s}=Ve(iI,sI);return q.useEffect(()=>{const o={nodes:i,edges:s};e==null||e(o),n.getState().onSelectionChange.forEach(u=>u(o))},[i,s,e]),null});hE.displayName="SelectionListener";const oI=e=>!!e.onSelectionChange;function aI({onSelectionChange:e}){const n=Ve(oI);return e||n?oe.createElement(hE,{onSelectionChange:e}):null}const uI=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 Gi(e,n){q.useEffect(()=>{typeof e<"u"&&n(e)},[e])}function Oe(e,n,i){q.useEffect(()=>{typeof n<"u"&&i({[e]:n})},[n])}const lI=({nodes:e,edges:n,defaultNodes:i,defaultEdges:s,onConnect:o,onConnectStart:u,onConnectEnd:l,onClickConnectStart:c,onClickConnectEnd:d,nodesDraggable:p,nodesConnectable:h,nodesFocusable:m,edgesFocusable:y,edgesUpdatable:x,elevateNodesOnSelect:C,minZoom:_,maxZoom:S,nodeExtent:k,onNodesChange:b,onEdgesChange:E,elementsSelectable:N,connectionMode:j,snapGrid:I,snapToGrid:P,translateExtent:B,connectOnClick:M,defaultEdgeOptions:F,fitView:O,fitViewOptions:Q,onNodesDelete:X,onEdgesDelete:R,onNodeDrag:K,onNodeDragStart:H,onNodeDragStop:te,onSelectionDrag:Y,onSelectionDragStart:$,onSelectionDragStop:G,noPanClassName:A,nodeOrigin:z,rfId:ae,autoPanOnConnect:D,autoPanOnNodeDrag:V,onError:J,connectionRadius:se,isValidConnection:ue,nodeDragThreshold:he})=>{const{setNodes:me,setEdges:je,setDefaultNodesAndEdges:De,setMinZoom:Me,setMaxZoom:Ie,setTranslateExtent:ke,setNodeExtent:Ge,reset:ye}=Ve(uI,bt),ge=kt();return q.useEffect(()=>{const Ue=s==null?void 0:s.map(mt=>({...mt,...F}));return De(i,Ue),()=>{ye()}},[]),Oe("defaultEdgeOptions",F,ge.setState),Oe("connectionMode",j,ge.setState),Oe("onConnect",o,ge.setState),Oe("onConnectStart",u,ge.setState),Oe("onConnectEnd",l,ge.setState),Oe("onClickConnectStart",c,ge.setState),Oe("onClickConnectEnd",d,ge.setState),Oe("nodesDraggable",p,ge.setState),Oe("nodesConnectable",h,ge.setState),Oe("nodesFocusable",m,ge.setState),Oe("edgesFocusable",y,ge.setState),Oe("edgesUpdatable",x,ge.setState),Oe("elementsSelectable",N,ge.setState),Oe("elevateNodesOnSelect",C,ge.setState),Oe("snapToGrid",P,ge.setState),Oe("snapGrid",I,ge.setState),Oe("onNodesChange",b,ge.setState),Oe("onEdgesChange",E,ge.setState),Oe("connectOnClick",M,ge.setState),Oe("fitViewOnInit",O,ge.setState),Oe("fitViewOnInitOptions",Q,ge.setState),Oe("onNodesDelete",X,ge.setState),Oe("onEdgesDelete",R,ge.setState),Oe("onNodeDrag",K,ge.setState),Oe("onNodeDragStart",H,ge.setState),Oe("onNodeDragStop",te,ge.setState),Oe("onSelectionDrag",Y,ge.setState),Oe("onSelectionDragStart",$,ge.setState),Oe("onSelectionDragStop",G,ge.setState),Oe("noPanClassName",A,ge.setState),Oe("nodeOrigin",z,ge.setState),Oe("rfId",ae,ge.setState),Oe("autoPanOnConnect",D,ge.setState),Oe("autoPanOnNodeDrag",V,ge.setState),Oe("onError",J,ge.setState),Oe("connectionRadius",se,ge.setState),Oe("isValidConnection",ue,ge.setState),Oe("nodeDragThreshold",he,ge.setState),Gi(e,me),Gi(n,je),Gi(_,Me),Gi(S,Ie),Gi(B,ke),Gi(k,Ge),null},mw={display:"none"},cI={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},pE="react-flow__node-desc",mE="react-flow__edge-desc",fI="react-flow__aria-live",dI=e=>e.ariaLiveMessage;function hI({rfId:e}){const n=Ve(dI);return oe.createElement("div",{id:`${fI}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:cI},n)}function pI({rfId:e,disableKeyboardA11y:n}){return oe.createElement(oe.Fragment,null,oe.createElement("div",{id:`${pE}-${e}`,style:mw},"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."," "),oe.createElement("div",{id:`${mE}-${e}`,style:mw},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!n&&oe.createElement(hI,{rfId:e}))}var ho=(e=null,n={actInsideInputWithModifier:!0})=>{const[i,s]=q.useState(!1),o=q.useRef(!1),u=q.useRef(new Set([])),[l,c]=q.useMemo(()=>{if(e!==null){const p=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.split("+")),h=p.reduce((m,y)=>m.concat(...y),[]);return[p,h]}return[[],[]]},[e]);return q.useEffect(()=>{const d=typeof document<"u"?document:null,p=(n==null?void 0:n.target)||d;if(e!==null){const h=x=>{if(o.current=x.ctrlKey||x.metaKey||x.shiftKey,(!o.current||o.current&&!n.actInsideInputWithModifier)&&sg(x))return!1;const _=vw(x.code,c);u.current.add(x[_]),gw(l,u.current,!1)&&(x.preventDefault(),s(!0))},m=x=>{if((!o.current||o.current&&!n.actInsideInputWithModifier)&&sg(x))return!1;const _=vw(x.code,c);gw(l,u.current,!0)?(s(!1),u.current.clear()):u.current.delete(x[_]),x.key==="Meta"&&u.current.clear(),o.current=!1},y=()=>{u.current.clear(),s(!1)};return p==null||p.addEventListener("keydown",h),p==null||p.addEventListener("keyup",m),window.addEventListener("blur",y),()=>{p==null||p.removeEventListener("keydown",h),p==null||p.removeEventListener("keyup",m),window.removeEventListener("blur",y)}}},[e,s]),i};function gw(e,n,i){return e.filter(s=>i||s.length===n.size).some(s=>s.every(o=>n.has(o)))}function vw(e,n){return n.includes(e)?"code":"key"}function gE(e,n,i,s){var c,d;const o=e.parentNode||e.parentId;if(!o)return i;const u=n.get(o),l=pi(u,s);return gE(u,n,{x:(i.x??0)+l.x,y:(i.y??0)+l.y,z:(((c=u[ct])==null?void 0:c.z)??0)>(i.z??0)?((d=u[ct])==null?void 0:d.z)??0:i.z??0},s)}function vE(e,n,i){e.forEach(s=>{var u;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:l,y:c,z:d}=gE(s,e,{...s.position,z:((u=s[ct])==null?void 0:u.z)??0},n);s.positionAbsolute={x:l,y:c},s[ct].z=d,i!=null&&i[s.id]&&(s[ct].isParent=!0)}})}function Ec(e,n,i,s){const o=new Map,u={},l=s?1e3:0;return e.forEach(c=>{var x;const d=(_n(c.zIndex)?c.zIndex:0)+(c.selected?l:0),p=n.get(c.id),h={...c,positionAbsolute:{x:c.position.x,y:c.position.y}},m=c.parentNode||c.parentId;m&&(u[m]=!0);const y=(p==null?void 0:p.type)&&(p==null?void 0:p.type)!==c.type;Object.defineProperty(h,ct,{enumerable:!1,value:{handleBounds:y||(x=p==null?void 0:p[ct])==null?void 0:x.handleBounds,z:d}}),o.set(c.id,h)}),vE(o,i,u),o}function yE(e,n={}){const{getNodes:i,width:s,height:o,minZoom:u,maxZoom:l,d3Zoom:c,d3Selection:d,fitViewOnInitDone:p,fitViewOnInit:h,nodeOrigin:m}=e(),y=n.initial&&!p&&h;if(c&&d&&(y||!n.initial)){const C=i().filter(S=>{var b;const k=n.includeHiddenNodes?S.width&&S.height:!S.hidden;return(b=n.nodes)!=null&&b.length?k&&n.nodes.some(E=>E.id===S.id):k}),_=C.every(S=>S.width&&S.height);if(C.length>0&&_){const S=pu(C,m),{x:k,y:b,zoom:E}=rE(S,s,o,n.minZoom??u,n.maxZoom??l,n.padding??.1),N=cr.translate(k,b).scale(E);return typeof n.duration=="number"&&n.duration>0?c.transform(ci(d,n.duration),N):c.transform(d,N),!0}}return!1}function mI(e,n){return e.forEach(i=>{const s=n.get(i.id);s&&n.set(s.id,{...s,[ct]:s[ct],selected:i.selected})}),new Map(n)}function gI(e,n){return n.map(i=>{const s=e.find(o=>o.id===i.id);return s&&(i.selected=s.selected),i})}function La({changedNodes:e,changedEdges:n,get:i,set:s}){const{nodeInternals:o,edges:u,onNodesChange:l,onEdgesChange:c,hasDefaultNodes:d,hasDefaultEdges:p}=i();e!=null&&e.length&&(d&&s({nodeInternals:mI(e,o)}),l==null||l(e)),n!=null&&n.length&&(p&&s({edges:gI(n,u)}),c==null||c(n))}const Ki=()=>{},vI={zoomIn:Ki,zoomOut:Ki,zoomTo:Ki,getZoom:()=>1,setViewport:Ki,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Ki,fitBounds:Ki,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},yI=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),wI=()=>{const e=kt(),{d3Zoom:n,d3Selection:i}=Ve(yI,bt);return q.useMemo(()=>i&&n?{zoomIn:o=>n.scaleBy(ci(i,o==null?void 0:o.duration),1.2),zoomOut:o=>n.scaleBy(ci(i,o==null?void 0:o.duration),1/1.2),zoomTo:(o,u)=>n.scaleTo(ci(i,u==null?void 0:u.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,u)=>{const[l,c,d]=e.getState().transform,p=cr.translate(o.x??l,o.y??c).scale(o.zoom??d);n.transform(ci(i,u==null?void 0:u.duration),p)},getViewport:()=>{const[o,u,l]=e.getState().transform;return{x:o,y:u,zoom:l}},fitView:o=>yE(e.getState,o),setCenter:(o,u,l)=>{const{width:c,height:d,maxZoom:p}=e.getState(),h=typeof(l==null?void 0:l.zoom)<"u"?l.zoom:p,m=c/2-o*h,y=d/2-u*h,x=cr.translate(m,y).scale(h);n.transform(ci(i,l==null?void 0:l.duration),x)},fitBounds:(o,u)=>{const{width:l,height:c,minZoom:d,maxZoom:p}=e.getState(),{x:h,y:m,zoom:y}=rE(o,l,c,d,p,(u==null?void 0:u.padding)??.1),x=cr.translate(h,m).scale(y);n.transform(ci(i,u==null?void 0:u.duration),x)},project:o=>{const{transform:u,snapToGrid:l,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"),ug(o,u,l,c)},screenToFlowPosition:o=>{const{transform:u,snapToGrid:l,snapGrid:c,domNode:d}=e.getState();if(!d)return o;const{x:p,y:h}=d.getBoundingClientRect(),m={x:o.x-p,y:o.y-h};return ug(m,u,l,c)},flowToScreenPosition:o=>{const{transform:u,domNode:l}=e.getState();if(!l)return o;const{x:c,y:d}=l.getBoundingClientRect(),p=eE(o,u);return{x:p.x+c,y:p.y+d}},viewportInitialized:!0}:vI,[n,i])};function yo(){const e=wI(),n=kt(),i=q.useCallback(()=>n.getState().getNodes().map(_=>({..._})),[]),s=q.useCallback(_=>n.getState().nodeInternals.get(_),[]),o=q.useCallback(()=>{const{edges:_=[]}=n.getState();return _.map(S=>({...S}))},[]),u=q.useCallback(_=>{const{edges:S=[]}=n.getState();return S.find(k=>k.id===_)},[]),l=q.useCallback(_=>{const{getNodes:S,setNodes:k,hasDefaultNodes:b,onNodesChange:E}=n.getState(),N=S(),j=typeof _=="function"?_(N):_;if(b)k(j);else if(E){const I=j.length===0?N.map(P=>({type:"remove",id:P.id})):j.map(P=>({item:P,type:"reset"}));E(I)}},[]),c=q.useCallback(_=>{const{edges:S=[],setEdges:k,hasDefaultEdges:b,onEdgesChange:E}=n.getState(),N=typeof _=="function"?_(S):_;if(b)k(N);else if(E){const j=N.length===0?S.map(I=>({type:"remove",id:I.id})):N.map(I=>({item:I,type:"reset"}));E(j)}},[]),d=q.useCallback(_=>{const S=Array.isArray(_)?_:[_],{getNodes:k,setNodes:b,hasDefaultNodes:E,onNodesChange:N}=n.getState();if(E){const I=[...k(),...S];b(I)}else if(N){const j=S.map(I=>({item:I,type:"add"}));N(j)}},[]),p=q.useCallback(_=>{const S=Array.isArray(_)?_:[_],{edges:k=[],setEdges:b,hasDefaultEdges:E,onEdgesChange:N}=n.getState();if(E)b([...k,...S]);else if(N){const j=S.map(I=>({item:I,type:"add"}));N(j)}},[]),h=q.useCallback(()=>{const{getNodes:_,edges:S=[],transform:k}=n.getState(),[b,E,N]=k;return{nodes:_().map(j=>({...j})),edges:S.map(j=>({...j})),viewport:{x:b,y:E,zoom:N}}},[]),m=q.useCallback(({nodes:_,edges:S})=>{const{nodeInternals:k,getNodes:b,edges:E,hasDefaultNodes:N,hasDefaultEdges:j,onNodesDelete:I,onEdgesDelete:P,onNodesChange:B,onEdgesChange:M}=n.getState(),F=(_||[]).map(K=>K.id),O=(S||[]).map(K=>K.id),Q=b().reduce((K,H)=>{const te=H.parentNode||H.parentId,Y=!F.includes(H.id)&&te&&K.find(G=>G.id===te);return(typeof H.deletable=="boolean"?H.deletable:!0)&&(F.includes(H.id)||Y)&&K.push(H),K},[]),X=E.filter(K=>typeof K.deletable=="boolean"?K.deletable:!0),R=X.filter(K=>O.includes(K.id));if(Q||R){const K=nE(Q,X),H=[...R,...K],te=H.reduce((Y,$)=>(Y.includes($.id)||Y.push($.id),Y),[]);if((j||N)&&(j&&n.setState({edges:E.filter(Y=>!te.includes(Y.id))}),N&&(Q.forEach(Y=>{k.delete(Y.id)}),n.setState({nodeInternals:new Map(k)}))),te.length>0&&(P==null||P(H),M&&M(te.map(Y=>({id:Y,type:"remove"})))),Q.length>0&&(I==null||I(Q),B)){const Y=Q.map($=>({id:$.id,type:"remove"}));B(Y)}}},[]),y=q.useCallback(_=>{const S=DA(_),k=S?null:n.getState().nodeInternals.get(_.id);return!S&&!k?[null,null,S]:[S?_:uw(k),k,S]},[]),x=q.useCallback((_,S=!0,k)=>{const[b,E,N]=y(_);return b?(k||n.getState().getNodes()).filter(j=>{if(!N&&(j.id===E.id||!j.positionAbsolute))return!1;const I=uw(j),P=ig(I,b);return S&&P>0||P>=b.width*b.height}):[]},[]),C=q.useCallback((_,S,k=!0)=>{const[b]=y(_);if(!b)return!1;const E=ig(b,S);return k&&E>0||E>=b.width*b.height},[]);return q.useMemo(()=>({...e,getNodes:i,getNode:s,getEdges:o,getEdge:u,setNodes:l,setEdges:c,addNodes:d,addEdges:p,toObject:h,deleteElements:m,getIntersectingNodes:x,isNodeIntersecting:C}),[e,i,s,o,u,l,c,d,p,h,m,x,C])}const xI={actInsideInputWithModifier:!1};var _I=({deleteKeyCode:e,multiSelectionKeyCode:n})=>{const i=kt(),{deleteElements:s}=yo(),o=ho(e,xI),u=ho(n);q.useEffect(()=>{if(o){const{edges:l,getNodes:c}=i.getState(),d=c().filter(h=>h.selected),p=l.filter(h=>h.selected);s({nodes:d,edges:p}),i.setState({nodesSelectionActive:!1})}},[o]),q.useEffect(()=>{i.setState({multiSelectionActive:u})},[u])};function SI(e){const n=kt();q.useEffect(()=>{let i;const s=()=>{var u,l;if(!e.current)return;const o=Ng(e.current);(o.height===0||o.width===0)&&((l=(u=n.getState()).onError)==null||l.call(u,"004",dr.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 Pg={position:"absolute",width:"100%",height:"100%",top:0,left:0},bI=(e,n)=>e.x!==n.x||e.y!==n.y||e.zoom!==n.k,$a=e=>({x:e.x,y:e.y,zoom:e.k}),Yi=(e,n)=>e.target.closest(`.${n}`),yw=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),ww=e=>{const n=e.ctrlKey&&nu()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n},kI=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),EI=({onMove:e,onMoveStart:n,onMoveEnd:i,onPaneContextMenu:s,zoomOnScroll:o=!0,zoomOnPinch:u=!0,panOnScroll:l=!1,panOnScrollSpeed:c=.5,panOnScrollMode:d=di.Free,zoomOnDoubleClick:p=!0,elementsSelectable:h,panOnDrag:m=!0,defaultViewport:y,translateExtent:x,minZoom:C,maxZoom:_,zoomActivationKeyCode:S,preventScrolling:k=!0,children:b,noWheelClassName:E,noPanClassName:N})=>{const j=q.useRef(),I=kt(),P=q.useRef(!1),B=q.useRef(!1),M=q.useRef(null),F=q.useRef({x:0,y:0,zoom:0}),{d3Zoom:O,d3Selection:Q,d3ZoomHandler:X,userSelectionActive:R}=Ve(kI,bt),K=ho(S),H=q.useRef(0),te=q.useRef(!1),Y=q.useRef();return SI(M),q.useEffect(()=>{if(M.current){const $=M.current.getBoundingClientRect(),G=Bk().scaleExtent([C,_]).translateExtent(x),A=xn(M.current).call(G),z=cr.translate(y.x,y.y).scale(ss(y.zoom,C,_)),ae=[[0,0],[$.width,$.height]],D=G.constrain()(z,ae,x);G.transform(A,D),G.wheelDelta(ww),I.setState({d3Zoom:G,d3Selection:A,d3ZoomHandler:A.on("wheel.zoom"),transform:[D.x,D.y,D.k],domNode:M.current.closest(".react-flow")})}},[]),q.useEffect(()=>{Q&&O&&(l&&!K&&!R?Q.on("wheel.zoom",$=>{if(Yi($,E))return!1;$.preventDefault(),$.stopImmediatePropagation();const G=Q.property("__zoom").k||1;if($.ctrlKey&&u){const ue=In($),he=ww($),me=G*Math.pow(2,he);O.scaleTo(Q,me,ue,$);return}const A=$.deltaMode===1?20:1;let z=d===di.Vertical?0:$.deltaX*A,ae=d===di.Horizontal?0:$.deltaY*A;!nu()&&$.shiftKey&&d!==di.Vertical&&(z=$.deltaY*A,ae=0),O.translateBy(Q,-(z/G)*c,-(ae/G)*c,{internal:!0});const D=$a(Q.property("__zoom")),{onViewportChangeStart:V,onViewportChange:J,onViewportChangeEnd:se}=I.getState();clearTimeout(Y.current),te.current||(te.current=!0,n==null||n($,D),V==null||V(D)),te.current&&(e==null||e($,D),J==null||J(D),Y.current=setTimeout(()=>{i==null||i($,D),se==null||se(D),te.current=!1},150))},{passive:!1}):typeof X<"u"&&Q.on("wheel.zoom",function($,G){if(!k&&$.type==="wheel"&&!$.ctrlKey||Yi($,E))return null;$.preventDefault(),X.call(this,$,G)},{passive:!1}))},[R,l,d,Q,O,X,K,u,k,E,n,e,i]),q.useEffect(()=>{O&&O.on("start",$=>{var z,ae;if(!$.sourceEvent||$.sourceEvent.internal)return null;H.current=(z=$.sourceEvent)==null?void 0:z.button;const{onViewportChangeStart:G}=I.getState(),A=$a($.transform);P.current=!0,F.current=A,((ae=$.sourceEvent)==null?void 0:ae.type)==="mousedown"&&I.setState({paneDragging:!0}),G==null||G(A),n==null||n($.sourceEvent,A)})},[O,n]),q.useEffect(()=>{O&&(R&&!P.current?O.on("zoom",null):R||O.on("zoom",$=>{var A;const{onViewportChange:G}=I.getState();if(I.setState({transform:[$.transform.x,$.transform.y,$.transform.k]}),B.current=!!(s&&yw(m,H.current??0)),(e||G)&&!((A=$.sourceEvent)!=null&&A.internal)){const z=$a($.transform);G==null||G(z),e==null||e($.sourceEvent,z)}}))},[R,O,e,m,s]),q.useEffect(()=>{O&&O.on("end",$=>{if(!$.sourceEvent||$.sourceEvent.internal)return null;const{onViewportChangeEnd:G}=I.getState();if(P.current=!1,I.setState({paneDragging:!1}),s&&yw(m,H.current??0)&&!B.current&&s($.sourceEvent),B.current=!1,(i||G)&&bI(F.current,$.transform)){const A=$a($.transform);F.current=A,clearTimeout(j.current),j.current=setTimeout(()=>{G==null||G(A),i==null||i($.sourceEvent,A)},l?150:0)}})},[O,l,m,i,s]),q.useEffect(()=>{O&&O.filter($=>{const G=K||o,A=u&&$.ctrlKey;if((m===!0||Array.isArray(m)&&m.includes(1))&&$.button===1&&$.type==="mousedown"&&(Yi($,"react-flow__node")||Yi($,"react-flow__edge")))return!0;if(!m&&!G&&!l&&!p&&!u||R||!p&&$.type==="dblclick"||Yi($,E)&&$.type==="wheel"||Yi($,N)&&($.type!=="wheel"||l&&$.type==="wheel"&&!K)||!u&&$.ctrlKey&&$.type==="wheel"||!G&&!l&&!A&&$.type==="wheel"||!m&&($.type==="mousedown"||$.type==="touchstart")||Array.isArray(m)&&!m.includes($.button)&&$.type==="mousedown")return!1;const z=Array.isArray(m)&&m.includes($.button)||!$.button||$.button<=1;return(!$.ctrlKey||$.type==="wheel")&&z})},[R,O,o,u,l,p,m,h,K]),oe.createElement("div",{className:"react-flow__renderer",ref:M,style:Pg},b)},NI=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function CI(){const{userSelectionActive:e,userSelectionRect:n}=Ve(NI,bt);return e&&n?oe.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 xw(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,u=n.position.y+n.height-s.height;if(o>0||u>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),u>0&&(s.style.height+=u),n.position.x<0){const l=Math.abs(n.position.x);s.position.x=s.position.x-l,s.style.width+=l,n.position.x=0}if(n.position.y<0){const l=Math.abs(n.position.y);s.position.y=s.position.y-l,s.style.height+=l,n.position.y=0}s.width=s.style.width,s.height=s.style.height}}}function TI(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 u=e.filter(c=>c.id===o.id);if(u.length===0)return s.push(o),s;const l={...o};for(const c of u)if(c)switch(c.type){case"select":{l.selected=c.selected;break}case"position":{typeof c.position<"u"&&(l.position=c.position),typeof c.positionAbsolute<"u"&&(l.positionAbsolute=c.positionAbsolute),typeof c.dragging<"u"&&(l.dragging=c.dragging),l.expandParent&&xw(s,l);break}case"dimensions":{typeof c.dimensions<"u"&&(l.width=c.dimensions.width,l.height=c.dimensions.height),typeof c.updateStyle<"u"&&(l.style={...l.style||{},...c.dimensions}),typeof c.resizing=="boolean"&&(l.resizing=c.resizing),l.expandParent&&xw(s,l);break}case"remove":return s}return s.push(l),s},i)}function RI(e,n){return TI(e,n)}const Fr=(e,n)=>({id:e,type:"select",selected:n});function Zi(e,n){return e.reduce((i,s)=>{const o=n.includes(s.id);return!s.selected&&o?(s.selected=!0,i.push(Fr(s.id,!0))):s.selected&&!o&&(s.selected=!1,i.push(Fr(s.id,!1))),i},[])}const Nc=(e,n)=>i=>{i.target===n.current&&(e==null||e(i))},jI=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),wE=q.memo(({isSelecting:e,selectionMode:n=fo.Full,panOnDrag:i,onSelectionStart:s,onSelectionEnd:o,onPaneClick:u,onPaneContextMenu:l,onPaneScroll:c,onPaneMouseEnter:d,onPaneMouseMove:p,onPaneMouseLeave:h,children:m})=>{const y=q.useRef(null),x=kt(),C=q.useRef(0),_=q.useRef(0),S=q.useRef(),{userSelectionActive:k,elementsSelectable:b,dragging:E}=Ve(jI,bt),N=()=>{x.setState({userSelectionActive:!1,userSelectionRect:null}),C.current=0,_.current=0},j=X=>{u==null||u(X),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},I=X=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){X.preventDefault();return}l==null||l(X)},P=c?X=>c(X):void 0,B=X=>{const{resetSelectedElements:R,domNode:K}=x.getState();if(S.current=K==null?void 0:K.getBoundingClientRect(),!b||!e||X.button!==0||X.target!==y.current||!S.current)return;const{x:H,y:te}=Br(X,S.current);R(),x.setState({userSelectionRect:{width:0,height:0,startX:H,startY:te,x:H,y:te}}),s==null||s(X)},M=X=>{const{userSelectionRect:R,nodeInternals:K,edges:H,transform:te,onNodesChange:Y,onEdgesChange:$,nodeOrigin:G,getNodes:A}=x.getState();if(!e||!S.current||!R)return;x.setState({userSelectionActive:!0,nodesSelectionActive:!1});const z=Br(X,S.current),ae=R.startX??0,D=R.startY??0,V={...R,x:z.x<ae?z.x:ae,y:z.y<D?z.y:D,width:Math.abs(z.x-ae),height:Math.abs(z.y-D)},J=A(),se=tE(K,V,te,n===fo.Partial,!0,G),ue=nE(se,H).map(me=>me.id),he=se.map(me=>me.id);if(C.current!==he.length){C.current=he.length;const me=Zi(J,he);me.length&&(Y==null||Y(me))}if(_.current!==ue.length){_.current=ue.length;const me=Zi(H,ue);me.length&&($==null||$(me))}x.setState({userSelectionRect:V})},F=X=>{if(X.button!==0)return;const{userSelectionRect:R}=x.getState();!k&&R&&X.target===y.current&&(j==null||j(X)),x.setState({nodesSelectionActive:C.current>0}),N(),o==null||o(X)},O=X=>{k&&(x.setState({nodesSelectionActive:C.current>0}),o==null||o(X)),N()},Q=b&&(e||k);return oe.createElement("div",{className:Pt(["react-flow__pane",{dragging:E,selection:e}]),onClick:Q?void 0:Nc(j,y),onContextMenu:Nc(I,y),onWheel:Nc(P,y),onMouseEnter:Q?void 0:d,onMouseDown:Q?B:void 0,onMouseMove:Q?M:p,onMouseUp:Q?F:void 0,onMouseLeave:Q?O:h,ref:y,style:Pg},m,oe.createElement(CI,null))});wE.displayName="Pane";function xE(e,n){const i=e.parentNode||e.parentId;if(!i)return!1;const s=n.get(i);return s?s.selected?!0:xE(s,n):!1}function _w(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 AI(e,n,i,s){return Array.from(e.values()).filter(o=>(o.selected||o.id===s)&&(!o.parentNode||o.parentId||!xE(o,e))&&(o.draggable||n&&typeof o.draggable>"u")).map(o=>{var u,l;return{id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:i.x-(((u=o.positionAbsolute)==null?void 0:u.x)??0),y:i.y-(((l=o.positionAbsolute)==null?void 0:l.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 II(e,n){return!n||n==="parent"?n:[n[0],[n[1][0]-(e.width||0),n[1][1]-(e.height||0)]]}function _E(e,n,i,s,o=[0,0],u){const l=II(e,e.extent||s);let c=l;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}=pi(m,o).positionAbsolute;c=m&&_n(y)&&_n(x)&&_n(m.width)&&_n(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 u==null||u("005",dr.error005()),c=l;else if(e.extent&&d&&e.extent!=="parent"){const m=i.get(d),{x:y,y:x}=pi(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 p={x:0,y:0};if(d){const m=i.get(d);p=pi(m,o).positionAbsolute}const h=c&&c!=="parent"?Cg(n,c):n;return{position:{x:h.x-p.x,y:h.y-p.y},positionAbsolute:h}}function Cc({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 Sw=(e,n,i,s)=>{const o=n.querySelectorAll(e);if(!o||!o.length)return null;const u=Array.from(o),l=n.getBoundingClientRect(),c={x:l.width*s[0],y:l.height*s[1]};return u.map(d=>{const p=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),position:d.getAttribute("data-handlepos"),x:(p.left-l.left-c.x)/i,y:(p.top-l.top-c.y)/i,...Ng(d)}})};function Xs(e,n,i){return i===void 0?i:s=>{const o=n().nodeInternals.get(e);o&&i(s,{...o})}}function cg({id:e,store:n,unselect:i=!1,nodeRef:s}){const{addSelectedNodes:o,unselectNodesAndEdges:u,multiSelectionActive:l,nodeInternals:c,onError:d}=n.getState(),p=c.get(e);if(!p){d==null||d("012",dr.error012(e));return}n.setState({nodesSelectionActive:!1}),p.selected?(i||p.selected&&l)&&(u({nodes:[p],edges:[]}),requestAnimationFrame(()=>{var h;return(h=s==null?void 0:s.current)==null?void 0:h.blur()})):o([e])}function MI(){const e=kt();return q.useCallback(({sourceEvent:i})=>{const{transform:s,snapGrid:o,snapToGrid:u}=e.getState(),l=i.touches?i.touches[0].clientX:i.clientX,c=i.touches?i.touches[0].clientY:i.clientY,d={x:(l-s[0])/s[2],y:(c-s[1])/s[2]};return{xSnapped:u?o[0]*Math.round(d.x/o[0]):d.x,ySnapped:u?o[1]*Math.round(d.y/o[1]):d.y,...d}},[])}function Tc(e){return(n,i,s)=>e==null?void 0:e(n,s)}function SE({nodeRef:e,disabled:n=!1,noDragClassName:i,handleSelector:s,nodeId:o,isSelectable:u,selectNodesOnDrag:l}){const c=kt(),[d,p]=q.useState(!1),h=q.useRef([]),m=q.useRef({x:null,y:null}),y=q.useRef(0),x=q.useRef(null),C=q.useRef({x:0,y:0}),_=q.useRef(null),S=q.useRef(!1),k=q.useRef(!1),b=q.useRef(!1),E=MI();return q.useEffect(()=>{if(e!=null&&e.current){const N=xn(e.current),j=({x:B,y:M})=>{const{nodeInternals:F,onNodeDrag:O,onSelectionDrag:Q,updateNodePositions:X,nodeExtent:R,snapGrid:K,snapToGrid:H,nodeOrigin:te,onError:Y}=c.getState();m.current={x:B,y:M};let $=!1,G={x:0,y:0,x2:0,y2:0};if(h.current.length>1&&R){const z=pu(h.current,te);G=co(z)}if(h.current=h.current.map(z=>{const ae={x:B-z.distance.x,y:M-z.distance.y};H&&(ae.x=K[0]*Math.round(ae.x/K[0]),ae.y=K[1]*Math.round(ae.y/K[1]));const D=[[R[0][0],R[0][1]],[R[1][0],R[1][1]]];h.current.length>1&&R&&!z.extent&&(D[0][0]=z.positionAbsolute.x-G.x+R[0][0],D[1][0]=z.positionAbsolute.x+(z.width??0)-G.x2+R[1][0],D[0][1]=z.positionAbsolute.y-G.y+R[0][1],D[1][1]=z.positionAbsolute.y+(z.height??0)-G.y2+R[1][1]);const V=_E(z,ae,F,D,te,Y);return $=$||z.position.x!==V.position.x||z.position.y!==V.position.y,z.position=V.position,z.positionAbsolute=V.positionAbsolute,z}),!$)return;X(h.current,!0,!0),p(!0);const A=o?O:Tc(Q);if(A&&_.current){const[z,ae]=Cc({nodeId:o,dragItems:h.current,nodeInternals:F});A(_.current,z,ae)}},I=()=>{if(!x.current)return;const[B,M]=Hk(C.current,x.current);if(B!==0||M!==0){const{transform:F,panBy:O}=c.getState();m.current.x=(m.current.x??0)-B/F[2],m.current.y=(m.current.y??0)-M/F[2],O({x:B,y:M})&&j(m.current)}y.current=requestAnimationFrame(I)},P=B=>{var te;const{nodeInternals:M,multiSelectionActive:F,nodesDraggable:O,unselectNodesAndEdges:Q,onNodeDragStart:X,onSelectionDragStart:R}=c.getState();k.current=!0;const K=o?X:Tc(R);(!l||!u)&&!F&&o&&((te=M.get(o))!=null&&te.selected||Q()),o&&u&&l&&cg({id:o,store:c,nodeRef:e});const H=E(B);if(m.current=H,h.current=AI(M,O,H,o),K&&h.current){const[Y,$]=Cc({nodeId:o,dragItems:h.current,nodeInternals:M});K(B.sourceEvent,Y,$)}};if(n)N.on(".drag",null);else{const B=U2().on("start",M=>{const{domNode:F,nodeDragThreshold:O}=c.getState();O===0&&P(M),b.current=!1;const Q=E(M);m.current=Q,x.current=(F==null?void 0:F.getBoundingClientRect())||null,C.current=Br(M.sourceEvent,x.current)}).on("drag",M=>{var X,R;const F=E(M),{autoPanOnNodeDrag:O,nodeDragThreshold:Q}=c.getState();if(M.sourceEvent.type==="touchmove"&&M.sourceEvent.touches.length>1&&(b.current=!0),!b.current){if(!S.current&&k.current&&O&&(S.current=!0,I()),!k.current){const K=F.xSnapped-(((X=m==null?void 0:m.current)==null?void 0:X.x)??0),H=F.ySnapped-(((R=m==null?void 0:m.current)==null?void 0:R.y)??0);Math.sqrt(K*K+H*H)>Q&&P(M)}(m.current.x!==F.xSnapped||m.current.y!==F.ySnapped)&&h.current&&k.current&&(_.current=M.sourceEvent,C.current=Br(M.sourceEvent,x.current),j(F))}}).on("end",M=>{if(!(!k.current||b.current)&&(p(!1),S.current=!1,k.current=!1,cancelAnimationFrame(y.current),h.current)){const{updateNodePositions:F,nodeInternals:O,onNodeDragStop:Q,onSelectionDragStop:X}=c.getState(),R=o?Q:Tc(X);if(F(h.current,!1,!1),R){const[K,H]=Cc({nodeId:o,dragItems:h.current,nodeInternals:O});R(M.sourceEvent,K,H)}}}).filter(M=>{const F=M.target;return!M.button&&(!i||!_w(F,`.${i}`,e))&&(!s||_w(F,s,e))});return N.call(B),()=>{N.on(".drag",null)}}}},[e,n,i,s,u,c,o,l,E]),d}function bE(){const e=kt();return q.useCallback(i=>{const{nodeInternals:s,nodeExtent:o,updateNodePositions:u,getNodes:l,snapToGrid:c,snapGrid:d,onError:p,nodesDraggable:h}=e.getState(),m=l().filter(b=>b.selected&&(b.draggable||h&&typeof b.draggable>"u")),y=c?d[0]:5,x=c?d[1]:5,C=i.isShiftPressed?4:1,_=i.x*y*C,S=i.y*x*C,k=m.map(b=>{if(b.positionAbsolute){const E={x:b.positionAbsolute.x+_,y:b.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:N,position:j}=_E(b,E,s,o,void 0,p);b.position=j,b.positionAbsolute=N}return b});u(k,!0,!1)},[])}const ns={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Qs=e=>{const n=({id:i,type:s,data:o,xPos:u,yPos:l,xPosOrigin:c,yPosOrigin:d,selected:p,onClick:h,onMouseEnter:m,onMouseMove:y,onMouseLeave:x,onContextMenu:C,onDoubleClick:_,style:S,className:k,isDraggable:b,isSelectable:E,isConnectable:N,isFocusable:j,selectNodesOnDrag:I,sourcePosition:P,targetPosition:B,hidden:M,resizeObserver:F,dragHandle:O,zIndex:Q,isParent:X,noDragClassName:R,noPanClassName:K,initialized:H,disableKeyboardA11y:te,ariaLabel:Y,rfId:$,hasHandleBounds:G})=>{const A=kt(),z=q.useRef(null),ae=q.useRef(null),D=q.useRef(P),V=q.useRef(B),J=q.useRef(s),se=E||b||h||m||y||x,ue=bE(),he=Xs(i,A.getState,m),me=Xs(i,A.getState,y),je=Xs(i,A.getState,x),De=Xs(i,A.getState,C),Me=Xs(i,A.getState,_),Ie=ye=>{const{nodeDragThreshold:ge}=A.getState();if(E&&(!I||!b||ge>0)&&cg({id:i,store:A,nodeRef:z}),h){const Ue=A.getState().nodeInternals.get(i);Ue&&h(ye,{...Ue})}},ke=ye=>{if(!sg(ye)&&!te)if(Kk.includes(ye.key)&&E){const ge=ye.key==="Escape";cg({id:i,store:A,unselect:ge,nodeRef:z})}else b&&p&&Object.prototype.hasOwnProperty.call(ns,ye.key)&&(A.setState({ariaLiveMessage:`Moved selected node ${ye.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~u}, y: ${~~l}`}),ue({x:ns[ye.key].x,y:ns[ye.key].y,isShiftPressed:ye.shiftKey}))};q.useEffect(()=>()=>{ae.current&&(F==null||F.unobserve(ae.current),ae.current=null)},[]),q.useEffect(()=>{if(z.current&&!M){const ye=z.current;(!H||!G||ae.current!==ye)&&(ae.current&&(F==null||F.unobserve(ae.current)),F==null||F.observe(ye),ae.current=ye)}},[M,H,G]),q.useEffect(()=>{const ye=J.current!==s,ge=D.current!==P,Ue=V.current!==B;z.current&&(ye||ge||Ue)&&(ye&&(J.current=s),ge&&(D.current=P),Ue&&(V.current=B),A.getState().updateNodeDimensions([{id:i,nodeElement:z.current,forceUpdate:!0}]))},[i,s,P,B]);const Ge=SE({nodeRef:z,disabled:M||!b,noDragClassName:R,handleSelector:O,nodeId:i,isSelectable:E,selectNodesOnDrag:I});return M?null:oe.createElement("div",{className:Pt(["react-flow__node",`react-flow__node-${s}`,{[K]:b},k,{selected:p,selectable:E,parent:X,dragging:Ge}]),ref:z,style:{zIndex:Q,transform:`translate(${c}px,${d}px)`,pointerEvents:se?"all":"none",visibility:H?"visible":"hidden",...S},"data-id":i,"data-testid":`rf__node-${i}`,onMouseEnter:he,onMouseMove:me,onMouseLeave:je,onContextMenu:De,onClick:Ie,onDoubleClick:Me,onKeyDown:j?ke:void 0,tabIndex:j?0:void 0,role:j?"button":void 0,"aria-describedby":te?void 0:`${pE}-${$}`,"aria-label":Y},oe.createElement(WA,{value:i},oe.createElement(e,{id:i,data:o,type:s,xPos:u,yPos:l,selected:p,isConnectable:N,sourcePosition:P,targetPosition:B,dragging:Ge,dragHandle:O,zIndex:Q})))};return n.displayName="NodeWrapper",q.memo(n)};const PI=e=>{const n=e.getNodes().filter(i=>i.selected);return{...pu(n,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function qI({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:i}){const s=kt(),{width:o,height:u,x:l,y:c,transformString:d,userSelectionActive:p}=Ve(PI,bt),h=bE(),m=q.useRef(null);if(q.useEffect(()=>{var C;i||(C=m.current)==null||C.focus({preventScroll:!0})},[i]),SE({nodeRef:m}),p||!o||!u)return null;const y=e?C=>{const _=s.getState().getNodes().filter(S=>S.selected);e(C,_)}:void 0,x=C=>{Object.prototype.hasOwnProperty.call(ns,C.key)&&h({x:ns[C.key].x,y:ns[C.key].y,isShiftPressed:C.shiftKey})};return oe.createElement("div",{className:Pt(["react-flow__nodesselection","react-flow__container",n]),style:{transform:d}},oe.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:u,top:c,left:l}}))}var OI=q.memo(qI);const LI=e=>e.nodesSelectionActive,kE=({children:e,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:u,onPaneScroll:l,deleteKeyCode:c,onMove:d,onMoveStart:p,onMoveEnd:h,selectionKeyCode:m,selectionOnDrag:y,selectionMode:x,onSelectionStart:C,onSelectionEnd:_,multiSelectionKeyCode:S,panActivationKeyCode:k,zoomActivationKeyCode:b,elementsSelectable:E,zoomOnScroll:N,zoomOnPinch:j,panOnScroll:I,panOnScrollSpeed:P,panOnScrollMode:B,zoomOnDoubleClick:M,panOnDrag:F,defaultViewport:O,translateExtent:Q,minZoom:X,maxZoom:R,preventScrolling:K,onSelectionContextMenu:H,noWheelClassName:te,noPanClassName:Y,disableKeyboardA11y:$})=>{const G=Ve(LI),A=ho(m),z=ho(k),ae=z||F,D=z||I,V=A||y&&ae!==!0;return _I({deleteKeyCode:c,multiSelectionKeyCode:S}),oe.createElement(EI,{onMove:d,onMoveStart:p,onMoveEnd:h,onPaneContextMenu:u,elementsSelectable:E,zoomOnScroll:N,zoomOnPinch:j,panOnScroll:D,panOnScrollSpeed:P,panOnScrollMode:B,zoomOnDoubleClick:M,panOnDrag:!A&&ae,defaultViewport:O,translateExtent:Q,minZoom:X,maxZoom:R,zoomActivationKeyCode:b,preventScrolling:K,noWheelClassName:te,noPanClassName:Y},oe.createElement(wE,{onSelectionStart:C,onSelectionEnd:_,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:u,onPaneScroll:l,panOnDrag:ae,isSelecting:!!V,selectionMode:x},e,G&&oe.createElement(OI,{onSelectionContextMenu:H,noPanClassName:Y,disableKeyboardA11y:$})))};kE.displayName="FlowRenderer";var $I=q.memo(kE);function DI(e){return Ve(q.useCallback(i=>e?tE(i.nodeInternals,{x:0,y:0,width:i.width,height:i.height},i.transform,!0):i.getNodes(),[e]))}function FI(e){const n={input:Qs(e.input||cE),default:Qs(e.default||lg),output:Qs(e.output||dE),group:Qs(e.group||Mg)},i={},s=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,u)=>(o[u]=Qs(e[u]||lg),o),i);return{...n,...s}}const zI=({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]},BI=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),EE=e=>{const{nodesDraggable:n,nodesConnectable:i,nodesFocusable:s,elementsSelectable:o,updateNodeDimensions:u,onError:l}=Ve(BI,bt),c=DI(e.onlyRenderVisibleElements),d=q.useRef(),p=q.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const h=new ResizeObserver(m=>{const y=m.map(x=>({id:x.target.getAttribute("data-id"),nodeElement:x.target,forceUpdate:!0}));u(y)});return d.current=h,h},[]);return q.useEffect(()=>()=>{var h;(h=d==null?void 0:d.current)==null||h.disconnect()},[]),oe.createElement("div",{className:"react-flow__nodes",style:Pg},c.map(h=>{var j,I,P;let m=h.type||"default";e.nodeTypes[m]||(l==null||l("003",dr.error003(m)),m="default");const y=e.nodeTypes[m]||e.nodeTypes.default,x=!!(h.draggable||n&&typeof h.draggable>"u"),C=!!(h.selectable||o&&typeof h.selectable>"u"),_=!!(h.connectable||i&&typeof h.connectable>"u"),S=!!(h.focusable||s&&typeof h.focusable>"u"),k=e.nodeExtent?Cg(h.positionAbsolute,e.nodeExtent):h.positionAbsolute,b=(k==null?void 0:k.x)??0,E=(k==null?void 0:k.y)??0,N=zI({x:b,y:E,width:h.width??0,height:h.height??0,origin:e.nodeOrigin});return oe.createElement(y,{key:h.id,id:h.id,className:h.className,style:h.style,type:m,data:h.data,sourcePosition:h.sourcePosition||Ce.Bottom,targetPosition:h.targetPosition||Ce.Top,hidden:h.hidden,xPos:b,yPos:E,xPosOrigin:N.x,yPosOrigin:N.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!h.selected,isDraggable:x,isSelectable:C,isConnectable:_,isFocusable:S,resizeObserver:p,dragHandle:h.dragHandle,zIndex:((j=h[ct])==null?void 0:j.z)??0,isParent:!!((I=h[ct])!=null&&I.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!h.width&&!!h.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:h.ariaLabel,hasHandleBounds:!!((P=h[ct])!=null&&P.handleBounds)})}))};EE.displayName="NodeRenderer";var UI=q.memo(EE);const HI=(e,n,i)=>i===Ce.Left?e-n:i===Ce.Right?e+n:e,VI=(e,n,i)=>i===Ce.Top?e-n:i===Ce.Bottom?e+n:e,bw="react-flow__edgeupdater",kw=({position:e,centerX:n,centerY:i,radius:s=10,onMouseDown:o,onMouseEnter:u,onMouseOut:l,type:c})=>oe.createElement("circle",{onMouseDown:o,onMouseEnter:u,onMouseOut:l,className:Pt([bw,`${bw}-${c}`]),cx:HI(n,s,e),cy:VI(i,s,e),r:s,stroke:"transparent",fill:"transparent"}),WI=()=>!0;var Xi=e=>{const n=({id:i,className:s,type:o,data:u,onClick:l,onEdgeDoubleClick:c,selected:d,animated:p,label:h,labelStyle:m,labelShowBg:y,labelBgStyle:x,labelBgPadding:C,labelBgBorderRadius:_,style:S,source:k,target:b,sourceX:E,sourceY:N,targetX:j,targetY:I,sourcePosition:P,targetPosition:B,elementsSelectable:M,hidden:F,sourceHandleId:O,targetHandleId:Q,onContextMenu:X,onMouseEnter:R,onMouseMove:K,onMouseLeave:H,reconnectRadius:te,onReconnect:Y,onReconnectStart:$,onReconnectEnd:G,markerEnd:A,markerStart:z,rfId:ae,ariaLabel:D,isFocusable:V,isReconnectable:J,pathOptions:se,interactionWidth:ue,disableKeyboardA11y:he})=>{const me=q.useRef(null),[je,De]=q.useState(!1),[Me,Ie]=q.useState(!1),ke=kt(),Ge=q.useMemo(()=>`url('#${ag(z,ae)}')`,[z,ae]),ye=q.useMemo(()=>`url('#${ag(A,ae)}')`,[A,ae]);if(F)return null;const ge=We=>{var gt;const{edges:Ze,addSelectedEdges:at,unselectNodesAndEdges:dt,multiSelectionActive:un}=ke.getState(),Ft=Ze.find(ln=>ln.id===i);Ft&&(M&&(ke.setState({nodesSelectionActive:!1}),Ft.selected&&un?(dt({nodes:[],edges:[Ft]}),(gt=me.current)==null||gt.blur()):at([i])),l&&l(We,Ft))},Ue=Ys(i,ke.getState,c),mt=Ys(i,ke.getState,X),wt=Ys(i,ke.getState,R),st=Ys(i,ke.getState,K),Ke=Ys(i,ke.getState,H),Be=(We,Ze)=>{if(We.button!==0)return;const{edges:at,isValidConnection:dt}=ke.getState(),un=Ze?b:k,Ft=(Ze?Q:O)||null,gt=Ze?"target":"source",ln=dt||WI,Gn=Ze,cn=at.find(jt=>jt.id===i);Ie(!0),$==null||$(We,cn,gt);const nt=jt=>{Ie(!1),G==null||G(jt,cn,gt)};oE({event:We,handleId:Ft,nodeId:un,onConnect:jt=>Y==null?void 0:Y(cn,jt),isTarget:Gn,getState:ke.getState,setState:ke.setState,isValidConnection:ln,edgeUpdaterType:gt,onReconnectEnd:nt})},Et=We=>Be(We,!0),ft=We=>Be(We,!1),Nt=()=>De(!0),ot=()=>De(!1),Dt=!M&&!l,xt=We=>{var Ze;if(!he&&Kk.includes(We.key)&&M){const{unselectNodesAndEdges:at,addSelectedEdges:dt,edges:un}=ke.getState();We.key==="Escape"?((Ze=me.current)==null||Ze.blur(),at({edges:[un.find(gt=>gt.id===i)]})):dt([i])}};return oe.createElement("g",{className:Pt(["react-flow__edge",`react-flow__edge-${o}`,s,{selected:d,animated:p,inactive:Dt,updating:je}]),onClick:ge,onDoubleClick:Ue,onContextMenu:mt,onMouseEnter:wt,onMouseMove:st,onMouseLeave:Ke,onKeyDown:V?xt:void 0,tabIndex:V?0:void 0,role:V?"button":"img","data-testid":`rf__edge-${i}`,"aria-label":D===null?void 0:D||`Edge from ${k} to ${b}`,"aria-describedby":V?`${mE}-${ae}`:void 0,ref:me},!Me&&oe.createElement(e,{id:i,source:k,target:b,selected:d,animated:p,label:h,labelStyle:m,labelShowBg:y,labelBgStyle:x,labelBgPadding:C,labelBgBorderRadius:_,data:u,style:S,sourceX:E,sourceY:N,targetX:j,targetY:I,sourcePosition:P,targetPosition:B,sourceHandleId:O,targetHandleId:Q,markerStart:Ge,markerEnd:ye,pathOptions:se,interactionWidth:ue}),J&&oe.createElement(oe.Fragment,null,(J==="source"||J===!0)&&oe.createElement(kw,{position:P,centerX:E,centerY:N,radius:te,onMouseDown:Et,onMouseEnter:Nt,onMouseOut:ot,type:"source"}),(J==="target"||J===!0)&&oe.createElement(kw,{position:B,centerX:j,centerY:I,radius:te,onMouseDown:ft,onMouseEnter:Nt,onMouseOut:ot,type:"target"})))};return n.displayName="EdgeWrapper",q.memo(n)};function GI(e){const n={default:Xi(e.default||iu),straight:Xi(e.bezier||jg),step:Xi(e.step||Rg),smoothstep:Xi(e.step||hu),simplebezier:Xi(e.simplebezier||Tg)},i={},s=Object.keys(e).filter(o=>!["default","bezier"].includes(o)).reduce((o,u)=>(o[u]=Xi(e[u]||iu),o),i);return{...n,...s}}function Ew(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,u=(i==null?void 0:i.width)||n.width,l=(i==null?void 0:i.height)||n.height;switch(e){case Ce.Top:return{x:s+u/2,y:o};case Ce.Right:return{x:s+u,y:o+l/2};case Ce.Bottom:return{x:s+u/2,y:o+l};case Ce.Left:return{x:s,y:o+l/2}}}function Nw(e,n){return e?e.length===1||!n?e[0]:n&&e.find(i=>i.id===n)||null:null}const KI=(e,n,i,s,o,u)=>{const l=Ew(i,e,n),c=Ew(u,s,o);return{sourceX:l.x,sourceY:l.y,targetX:c.x,targetY:c.y}};function YI({sourcePos:e,targetPos:n,sourceWidth:i,sourceHeight:s,targetWidth:o,targetHeight:u,width:l,height:c,transform:d}){const p={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+u)};p.x===p.x2&&(p.x2+=1),p.y===p.y2&&(p.y2+=1);const h=co({x:(0-d[0])/d[2],y:(0-d[1])/d[2],width:l/d[2],height:c/d[2]}),m=Math.max(0,Math.min(h.x2,p.x2)-Math.max(h.x,p.x)),y=Math.max(0,Math.min(h.y2,p.y2)-Math.max(h.y,p.y));return Math.ceil(m*y)>0}function Cw(e){var s,o,u,l,c;const n=((s=e==null?void 0:e[ct])==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((u=e==null?void 0:e.positionAbsolute)==null?void 0:u.y)<"u";return[{x:((l=e==null?void 0:e.positionAbsolute)==null?void 0:l.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 XI=[{level:0,isMaxLevel:!0,edges:[]}];function QI(e,n,i=!1){let s=-1;const o=e.reduce((l,c)=>{var h,m;const d=_n(c.zIndex);let p=d?c.zIndex:0;if(i){const y=n.get(c.target),x=n.get(c.source),C=c.selected||(y==null?void 0:y.selected)||(x==null?void 0:x.selected),_=Math.max(((h=x==null?void 0:x[ct])==null?void 0:h.z)||0,((m=y==null?void 0:y[ct])==null?void 0:m.z)||0,1e3);p=(d?c.zIndex:0)+(C?_:0)}return l[p]?l[p].push(c):l[p]=[c],s=p>s?p:s,l},{}),u=Object.entries(o).map(([l,c])=>{const d=+l;return{edges:c,level:d,isMaxLevel:d===s}});return u.length===0?XI:u}function ZI(e,n,i){const s=Ve(q.useCallback(o=>e?o.edges.filter(u=>{const l=n.get(u.source),c=n.get(u.target);return(l==null?void 0:l.width)&&(l==null?void 0:l.height)&&(c==null?void 0:c.width)&&(c==null?void 0:c.height)&&YI({sourcePos:l.positionAbsolute||{x:0,y:0},targetPos:c.positionAbsolute||{x:0,y:0},sourceWidth:l.width,sourceHeight:l.height,targetWidth:c.width,targetHeight:c.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[e,n]));return QI(s,n,i)}const JI=({color:e="none",strokeWidth:n=1})=>oe.createElement("polyline",{style:{stroke:e,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),eM=({color:e="none",strokeWidth:n=1})=>oe.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Tw={[ru.Arrow]:JI,[ru.ArrowClosed]:eM};function tM(e){const n=kt();return q.useMemo(()=>{var o,u;return Object.prototype.hasOwnProperty.call(Tw,e)?Tw[e]:((u=(o=n.getState()).onError)==null||u.call(o,"009",dr.error009(e)),null)},[e])}const nM=({id:e,type:n,color:i,width:s=12.5,height:o=12.5,markerUnits:u="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const d=tM(n);return d?oe.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:u,orient:c,refX:"0",refY:"0"},oe.createElement(d,{color:i,strokeWidth:l})):null},rM=({defaultColor:e,rfId:n})=>i=>{const s=[];return i.edges.reduce((o,u)=>([u.markerStart,u.markerEnd].forEach(l=>{if(l&&typeof l=="object"){const c=ag(l,n);s.includes(c)||(o.push({id:c,color:l.color||e,...l}),s.push(c))}}),o),[]).sort((o,u)=>o.id.localeCompare(u.id))},NE=({defaultColor:e,rfId:n})=>{const i=Ve(q.useCallback(rM({defaultColor:e,rfId:n}),[e,n]),(s,o)=>!(s.length!==o.length||s.some((u,l)=>u.id!==o[l].id)));return oe.createElement("defs",null,i.map(s=>oe.createElement(nM,{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})))};NE.displayName="MarkerDefinitions";var iM=q.memo(NE);const sM=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}),CE=({defaultMarkerColor:e,onlyRenderVisibleElements:n,elevateEdgesOnSelect:i,rfId:s,edgeTypes:o,noPanClassName:u,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:d,onEdgeMouseLeave:p,onEdgeClick:h,onEdgeDoubleClick:m,onReconnect:y,onReconnectStart:x,onReconnectEnd:C,reconnectRadius:_,children:S,disableKeyboardA11y:k})=>{const{edgesFocusable:b,edgesUpdatable:E,elementsSelectable:N,width:j,height:I,connectionMode:P,nodeInternals:B,onError:M}=Ve(sM,bt),F=ZI(n,B,i);return j?oe.createElement(oe.Fragment,null,F.map(({level:O,edges:Q,isMaxLevel:X})=>oe.createElement("svg",{key:O,style:{zIndex:O},width:j,height:I,className:"react-flow__edges react-flow__container"},X&&oe.createElement(iM,{defaultColor:e,rfId:s}),oe.createElement("g",null,Q.map(R=>{const[K,H,te]=Cw(B.get(R.source)),[Y,$,G]=Cw(B.get(R.target));if(!te||!G)return null;let A=R.type||"default";o[A]||(M==null||M("011",dr.error011(A)),A="default");const z=o[A]||o.default,ae=P===gi.Strict?$.target:($.target??[]).concat($.source??[]),D=Nw(H.source,R.sourceHandle),V=Nw(ae,R.targetHandle),J=(D==null?void 0:D.position)||Ce.Bottom,se=(V==null?void 0:V.position)||Ce.Top,ue=!!(R.focusable||b&&typeof R.focusable>"u"),he=R.reconnectable||R.updatable,me=typeof y<"u"&&(he||E&&typeof he>"u");if(!D||!V)return M==null||M("008",dr.error008(D,R)),null;const{sourceX:je,sourceY:De,targetX:Me,targetY:Ie}=KI(K,D,J,Y,V,se);return oe.createElement(z,{key:R.id,id:R.id,className:Pt([R.className,u]),type:A,data:R.data,selected:!!R.selected,animated:!!R.animated,hidden:!!R.hidden,label:R.label,labelStyle:R.labelStyle,labelShowBg:R.labelShowBg,labelBgStyle:R.labelBgStyle,labelBgPadding:R.labelBgPadding,labelBgBorderRadius:R.labelBgBorderRadius,style:R.style,source:R.source,target:R.target,sourceHandleId:R.sourceHandle,targetHandleId:R.targetHandle,markerEnd:R.markerEnd,markerStart:R.markerStart,sourceX:je,sourceY:De,targetX:Me,targetY:Ie,sourcePosition:J,targetPosition:se,elementsSelectable:N,onContextMenu:l,onMouseEnter:c,onMouseMove:d,onMouseLeave:p,onClick:h,onEdgeDoubleClick:m,onReconnect:y,onReconnectStart:x,onReconnectEnd:C,reconnectRadius:_,rfId:s,ariaLabel:R.ariaLabel,isFocusable:ue,isReconnectable:me,pathOptions:"pathOptions"in R?R.pathOptions:void 0,interactionWidth:R.interactionWidth,disableKeyboardA11y:k})})))),S):null};CE.displayName="EdgeRenderer";var oM=q.memo(CE);const aM=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function uM({children:e}){const n=Ve(aM);return oe.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:n}},e)}function lM(e){const n=yo(),i=q.useRef(!1);q.useEffect(()=>{!i.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),i.current=!0)},[e,n.viewportInitialized])}const cM={[Ce.Left]:Ce.Right,[Ce.Right]:Ce.Left,[Ce.Top]:Ce.Bottom,[Ce.Bottom]:Ce.Top},TE=({nodeId:e,handleType:n,style:i,type:s=zr.Bezier,CustomComponent:o,connectionStatus:u})=>{var I,P,B;const{fromNode:l,handleId:c,toX:d,toY:p,connectionMode:h}=Ve(q.useCallback(M=>({fromNode:M.nodeInternals.get(e),handleId:M.connectionHandleId,toX:(M.connectionPosition.x-M.transform[0])/M.transform[2],toY:(M.connectionPosition.y-M.transform[1])/M.transform[2],connectionMode:M.connectionMode}),[e]),bt),m=(I=l==null?void 0:l[ct])==null?void 0:I.handleBounds;let y=m==null?void 0:m[n];if(h===gi.Loose&&(y=y||(m==null?void 0:m[n==="source"?"target":"source"])),!l||!y)return null;const x=c?y.find(M=>M.id===c):y[0],C=x?x.x+x.width/2:(l.width??0)/2,_=x?x.y+x.height/2:l.height??0,S=(((P=l.positionAbsolute)==null?void 0:P.x)??0)+C,k=(((B=l.positionAbsolute)==null?void 0:B.y)??0)+_,b=x==null?void 0:x.position,E=b?cM[b]:null;if(!b||!E)return null;if(o)return oe.createElement(o,{connectionLineType:s,connectionLineStyle:i,fromNode:l,fromHandle:x,fromX:S,fromY:k,toX:d,toY:p,fromPosition:b,toPosition:E,connectionStatus:u});let N="";const j={sourceX:S,sourceY:k,sourcePosition:b,targetX:d,targetY:p,targetPosition:E};return s===zr.Bezier?[N]=Jk(j):s===zr.Step?[N]=og({...j,borderRadius:0}):s===zr.SmoothStep?[N]=og(j):s===zr.SimpleBezier?[N]=Zk(j):N=`M${S},${k} ${d},${p}`,oe.createElement("path",{d:N,fill:"none",className:"react-flow__connection-path",style:i})};TE.displayName="ConnectionLine";const fM=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function dM({containerStyle:e,style:n,type:i,component:s}){const{nodeId:o,handleType:u,nodesConnectable:l,width:c,height:d,connectionStatus:p}=Ve(fM,bt);return!(o&&u&&c&&l)?null:oe.createElement("svg",{style:e,width:c,height:d,className:"react-flow__edges react-flow__connectionline react-flow__container"},oe.createElement("g",{className:Pt(["react-flow__connection",p])},oe.createElement(TE,{nodeId:o,handleType:u,style:n,type:i,CustomComponent:s,connectionStatus:p})))}function Rw(e,n){return q.useRef(null),kt(),q.useMemo(()=>n(e),[e])}const RE=({nodeTypes:e,edgeTypes:n,onMove:i,onMoveStart:s,onMoveEnd:o,onInit:u,onNodeClick:l,onEdgeClick:c,onNodeDoubleClick:d,onEdgeDoubleClick:p,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:y,onNodeContextMenu:x,onSelectionContextMenu:C,onSelectionStart:_,onSelectionEnd:S,connectionLineType:k,connectionLineStyle:b,connectionLineComponent:E,connectionLineContainerStyle:N,selectionKeyCode:j,selectionOnDrag:I,selectionMode:P,multiSelectionKeyCode:B,panActivationKeyCode:M,zoomActivationKeyCode:F,deleteKeyCode:O,onlyRenderVisibleElements:Q,elementsSelectable:X,selectNodesOnDrag:R,defaultViewport:K,translateExtent:H,minZoom:te,maxZoom:Y,preventScrolling:$,defaultMarkerColor:G,zoomOnScroll:A,zoomOnPinch:z,panOnScroll:ae,panOnScrollSpeed:D,panOnScrollMode:V,zoomOnDoubleClick:J,panOnDrag:se,onPaneClick:ue,onPaneMouseEnter:he,onPaneMouseMove:me,onPaneMouseLeave:je,onPaneScroll:De,onPaneContextMenu:Me,onEdgeContextMenu:Ie,onEdgeMouseEnter:ke,onEdgeMouseMove:Ge,onEdgeMouseLeave:ye,onReconnect:ge,onReconnectStart:Ue,onReconnectEnd:mt,reconnectRadius:wt,noDragClassName:st,noWheelClassName:Ke,noPanClassName:Be,elevateEdgesOnSelect:Et,disableKeyboardA11y:ft,nodeOrigin:Nt,nodeExtent:ot,rfId:Dt})=>{const xt=Rw(e,FI),We=Rw(n,GI);return lM(u),oe.createElement($I,{onPaneClick:ue,onPaneMouseEnter:he,onPaneMouseMove:me,onPaneMouseLeave:je,onPaneContextMenu:Me,onPaneScroll:De,deleteKeyCode:O,selectionKeyCode:j,selectionOnDrag:I,selectionMode:P,onSelectionStart:_,onSelectionEnd:S,multiSelectionKeyCode:B,panActivationKeyCode:M,zoomActivationKeyCode:F,elementsSelectable:X,onMove:i,onMoveStart:s,onMoveEnd:o,zoomOnScroll:A,zoomOnPinch:z,zoomOnDoubleClick:J,panOnScroll:ae,panOnScrollSpeed:D,panOnScrollMode:V,panOnDrag:se,defaultViewport:K,translateExtent:H,minZoom:te,maxZoom:Y,onSelectionContextMenu:C,preventScrolling:$,noDragClassName:st,noWheelClassName:Ke,noPanClassName:Be,disableKeyboardA11y:ft},oe.createElement(uM,null,oe.createElement(oM,{edgeTypes:We,onEdgeClick:c,onEdgeDoubleClick:p,onlyRenderVisibleElements:Q,onEdgeContextMenu:Ie,onEdgeMouseEnter:ke,onEdgeMouseMove:Ge,onEdgeMouseLeave:ye,onReconnect:ge,onReconnectStart:Ue,onReconnectEnd:mt,reconnectRadius:wt,defaultMarkerColor:G,noPanClassName:Be,elevateEdgesOnSelect:!!Et,disableKeyboardA11y:ft,rfId:Dt},oe.createElement(dM,{style:b,type:k,component:E,containerStyle:N})),oe.createElement("div",{className:"react-flow__edgelabel-renderer"}),oe.createElement(UI,{nodeTypes:xt,onNodeClick:l,onNodeDoubleClick:d,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:y,onNodeContextMenu:x,selectNodesOnDrag:R,onlyRenderVisibleElements:Q,noPanClassName:Be,noDragClassName:st,disableKeyboardA11y:ft,nodeOrigin:Nt,nodeExtent:ot,rfId:Dt})))};RE.displayName="GraphView";var hM=q.memo(RE);const fg=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],$r={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:fg,nodeExtent:fg,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:gi.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:FA,isValidConnection:void 0},pM=()=>tR((e,n)=>({...$r,setNodes:i=>{const{nodeInternals:s,nodeOrigin:o,elevateNodesOnSelect:u}=n();e({nodeInternals:Ec(i,s,o,u)})},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",u=typeof s<"u",l=o?Ec(i,new Map,n().nodeOrigin,n().elevateNodesOnSelect):new Map;e({nodeInternals:l,edges:u?s:[],hasDefaultNodes:o,hasDefaultEdges:u})},updateNodeDimensions:i=>{const{onNodesChange:s,nodeInternals:o,fitViewOnInit:u,fitViewOnInitDone:l,fitViewOnInitOptions:c,domNode:d,nodeOrigin:p}=n(),h=d==null?void 0:d.querySelector(".react-flow__viewport");if(!h)return;const m=window.getComputedStyle(h),{m22:y}=new window.DOMMatrixReadOnly(m.transform),x=i.reduce((_,S)=>{const k=o.get(S.id);if(k!=null&&k.hidden)o.set(k.id,{...k,[ct]:{...k[ct],handleBounds:void 0}});else if(k){const b=Ng(S.nodeElement);!!(b.width&&b.height&&(k.width!==b.width||k.height!==b.height||S.forceUpdate))&&(o.set(k.id,{...k,[ct]:{...k[ct],handleBounds:{source:Sw(".source",S.nodeElement,y,p),target:Sw(".target",S.nodeElement,y,p)}},...b}),_.push({id:k.id,type:"dimensions",dimensions:b}))}return _},[]);vE(o,p);const C=l||u&&!l&&yE(n,{initial:!0,...c});e({nodeInternals:new Map(o),fitViewOnInitDone:C}),(x==null?void 0:x.length)>0&&(s==null||s(x))},updateNodePositions:(i,s=!0,o=!1)=>{const{triggerNodeChanges:u}=n(),l=i.map(c=>{const d={id:c.id,type:"position",dragging:o};return s&&(d.positionAbsolute=c.positionAbsolute,d.position=c.position),d});u(l)},triggerNodeChanges:i=>{const{onNodesChange:s,nodeInternals:o,hasDefaultNodes:u,nodeOrigin:l,getNodes:c,elevateNodesOnSelect:d}=n();if(i!=null&&i.length){if(u){const p=RI(i,c()),h=Ec(p,o,l,d);e({nodeInternals:h})}s==null||s(i)}},addSelectedNodes:i=>{const{multiSelectionActive:s,edges:o,getNodes:u}=n();let l,c=null;s?l=i.map(d=>Fr(d,!0)):(l=Zi(u(),i),c=Zi(o,[])),La({changedNodes:l,changedEdges:c,get:n,set:e})},addSelectedEdges:i=>{const{multiSelectionActive:s,edges:o,getNodes:u}=n();let l,c=null;s?l=i.map(d=>Fr(d,!0)):(l=Zi(o,i),c=Zi(u(),[])),La({changedNodes:c,changedEdges:l,get:n,set:e})},unselectNodesAndEdges:({nodes:i,edges:s}={})=>{const{edges:o,getNodes:u}=n(),l=i||u(),c=s||o,d=l.map(h=>(h.selected=!1,Fr(h.id,!1))),p=c.map(h=>Fr(h.id,!1));La({changedNodes:d,changedEdges:p,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(),u=s().filter(c=>c.selected).map(c=>Fr(c.id,!1)),l=i.filter(c=>c.selected).map(c=>Fr(c.id,!1));La({changedNodes:u,changedEdges:l,get:n,set:e})},setNodeExtent:i=>{const{nodeInternals:s}=n();s.forEach(o=>{o.positionAbsolute=Cg(o.position,i)}),e({nodeExtent:i,nodeInternals:new Map(s)})},panBy:i=>{const{transform:s,width:o,height:u,d3Zoom:l,d3Selection:c,translateExtent:d}=n();if(!l||!c||!i.x&&!i.y)return!1;const p=cr.translate(s[0]+i.x,s[1]+i.y).scale(s[2]),h=[[0,0],[o,u]],m=l==null?void 0:l.constrain()(p,h,d);return l.transform(c,m),s[0]!==m.x||s[1]!==m.y||s[2]!==m.k},cancelConnection:()=>e({connectionNodeId:$r.connectionNodeId,connectionHandleId:$r.connectionHandleId,connectionHandleType:$r.connectionHandleType,connectionStatus:$r.connectionStatus,connectionStartHandle:$r.connectionStartHandle,connectionEndHandle:$r.connectionEndHandle}),reset:()=>e({...$r})}),Object.is),qg=({children:e})=>{const n=q.useRef(null);return n.current||(n.current=pM()),oe.createElement(MA,{value:n.current},e)};qg.displayName="ReactFlowProvider";const jE=({children:e})=>q.useContext(du)?oe.createElement(oe.Fragment,null,e):oe.createElement(qg,null,e);jE.displayName="ReactFlowWrapper";const mM={input:cE,default:lg,output:dE,group:Mg},gM={default:iu,straight:jg,step:Rg,smoothstep:hu,simplebezier:Tg},vM=[0,0],yM=[15,15],wM={x:0,y:0,zoom:1},xM={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},AE=q.forwardRef(({nodes:e,edges:n,defaultNodes:i,defaultEdges:s,className:o,nodeTypes:u=mM,edgeTypes:l=gM,onNodeClick:c,onEdgeClick:d,onInit:p,onMove:h,onMoveStart:m,onMoveEnd:y,onConnect:x,onConnectStart:C,onConnectEnd:_,onClickConnectStart:S,onClickConnectEnd:k,onNodeMouseEnter:b,onNodeMouseMove:E,onNodeMouseLeave:N,onNodeContextMenu:j,onNodeDoubleClick:I,onNodeDragStart:P,onNodeDrag:B,onNodeDragStop:M,onNodesDelete:F,onEdgesDelete:O,onSelectionChange:Q,onSelectionDragStart:X,onSelectionDrag:R,onSelectionDragStop:K,onSelectionContextMenu:H,onSelectionStart:te,onSelectionEnd:Y,connectionMode:$=gi.Strict,connectionLineType:G=zr.Bezier,connectionLineStyle:A,connectionLineComponent:z,connectionLineContainerStyle:ae,deleteKeyCode:D="Backspace",selectionKeyCode:V="Shift",selectionOnDrag:J=!1,selectionMode:se=fo.Full,panActivationKeyCode:ue="Space",multiSelectionKeyCode:he=nu()?"Meta":"Control",zoomActivationKeyCode:me=nu()?"Meta":"Control",snapToGrid:je=!1,snapGrid:De=yM,onlyRenderVisibleElements:Me=!1,selectNodesOnDrag:Ie=!0,nodesDraggable:ke,nodesConnectable:Ge,nodesFocusable:ye,nodeOrigin:ge=vM,edgesFocusable:Ue,edgesUpdatable:mt,elementsSelectable:wt,defaultViewport:st=wM,minZoom:Ke=.5,maxZoom:Be=2,translateExtent:Et=fg,preventScrolling:ft=!0,nodeExtent:Nt,defaultMarkerColor:ot="#b1b1b7",zoomOnScroll:Dt=!0,zoomOnPinch:xt=!0,panOnScroll:We=!1,panOnScrollSpeed:Ze=.5,panOnScrollMode:at=di.Free,zoomOnDoubleClick:dt=!0,panOnDrag:un=!0,onPaneClick:Ft,onPaneMouseEnter:gt,onPaneMouseMove:ln,onPaneMouseLeave:Gn,onPaneScroll:cn,onPaneContextMenu:nt,children:en,onEdgeContextMenu:jt,onEdgeDoubleClick:$n,onEdgeMouseEnter:mr,onEdgeMouseMove:gr,onEdgeMouseLeave:zt,onEdgeUpdate:Vr,onEdgeUpdateStart:Wr,onEdgeUpdateEnd:Kn,onReconnect:Gr,onReconnectStart:Dn,onReconnectEnd:Yn,reconnectRadius:Xn=10,edgeUpdaterRadius:ht=10,onNodesChange:Qn,onEdgesChange:Zn,noDragClassName:Kr="nodrag",noWheelClassName:_i="nowheel",noPanClassName:vr="nopan",fitView:tn=!1,fitViewOptions:Si,connectOnClick:At=!0,attributionPosition:ne,proOptions:ie,defaultEdgeOptions:pe,elevateNodesOnSelect:we=!0,elevateEdgesOnSelect:Se=!1,disableKeyboardA11y:Ne=!1,autoPanOnConnect:Fe=!0,autoPanOnNodeDrag:Pe=!0,connectionRadius:fn=20,isValidConnection:ut,onError:Je,style:dn,id:bi,nodeDragThreshold:ki,...yr},Ht)=>{const ds=bi||"1";return oe.createElement("div",{...yr,style:{...dn,...xM},ref:Ht,className:Pt(["react-flow",o]),"data-testid":"rf__wrapper",id:bi},oe.createElement(jE,null,oe.createElement(hM,{onInit:p,onMove:h,onMoveStart:m,onMoveEnd:y,onNodeClick:c,onEdgeClick:d,onNodeMouseEnter:b,onNodeMouseMove:E,onNodeMouseLeave:N,onNodeContextMenu:j,onNodeDoubleClick:I,nodeTypes:u,edgeTypes:l,connectionLineType:G,connectionLineStyle:A,connectionLineComponent:z,connectionLineContainerStyle:ae,selectionKeyCode:V,selectionOnDrag:J,selectionMode:se,deleteKeyCode:D,multiSelectionKeyCode:he,panActivationKeyCode:ue,zoomActivationKeyCode:me,onlyRenderVisibleElements:Me,selectNodesOnDrag:Ie,defaultViewport:st,translateExtent:Et,minZoom:Ke,maxZoom:Be,preventScrolling:ft,zoomOnScroll:Dt,zoomOnPinch:xt,zoomOnDoubleClick:dt,panOnScroll:We,panOnScrollSpeed:Ze,panOnScrollMode:at,panOnDrag:un,onPaneClick:Ft,onPaneMouseEnter:gt,onPaneMouseMove:ln,onPaneMouseLeave:Gn,onPaneScroll:cn,onPaneContextMenu:nt,onSelectionContextMenu:H,onSelectionStart:te,onSelectionEnd:Y,onEdgeContextMenu:jt,onEdgeDoubleClick:$n,onEdgeMouseEnter:mr,onEdgeMouseMove:gr,onEdgeMouseLeave:zt,onReconnect:Gr??Vr,onReconnectStart:Dn??Wr,onReconnectEnd:Yn??Kn,reconnectRadius:Xn??ht,defaultMarkerColor:ot,noDragClassName:Kr,noWheelClassName:_i,noPanClassName:vr,elevateEdgesOnSelect:Se,rfId:ds,disableKeyboardA11y:Ne,nodeOrigin:ge,nodeExtent:Nt}),oe.createElement(lI,{nodes:e,edges:n,defaultNodes:i,defaultEdges:s,onConnect:x,onConnectStart:C,onConnectEnd:_,onClickConnectStart:S,onClickConnectEnd:k,nodesDraggable:ke,nodesConnectable:Ge,nodesFocusable:ye,edgesFocusable:Ue,edgesUpdatable:mt,elementsSelectable:wt,elevateNodesOnSelect:we,minZoom:Ke,maxZoom:Be,nodeExtent:Nt,onNodesChange:Qn,onEdgesChange:Zn,snapToGrid:je,snapGrid:De,connectionMode:$,translateExtent:Et,connectOnClick:At,defaultEdgeOptions:pe,fitView:tn,fitViewOptions:Si,onNodesDelete:F,onEdgesDelete:O,onNodeDragStart:P,onNodeDrag:B,onNodeDragStop:M,onSelectionDrag:R,onSelectionDragStart:X,onSelectionDragStop:K,noPanClassName:vr,nodeOrigin:ge,rfId:ds,autoPanOnConnect:Fe,autoPanOnNodeDrag:Pe,onError:Je,connectionRadius:fn,isValidConnection:ut,nodeDragThreshold:ki}),oe.createElement(aI,{onSelectionChange:Q}),en,oe.createElement(qA,{proOptions:ie,position:ne}),oe.createElement(pI,{rfId:ds,disableKeyboardA11y:Ne})))});AE.displayName="ReactFlow";const _M=e=>({x:e.transform[0],y:e.transform[1],zoom:e.transform[2]});function IE(){return Ve(_M,bt)}const ME=({id:e,x:n,y:i,width:s,height:o,style:u,color:l,strokeColor:c,strokeWidth:d,className:p,borderRadius:h,shapeRendering:m,onClick:y,selected:x})=>{const{background:C,backgroundColor:_}=u||{},S=l||C||_;return oe.createElement("rect",{className:Pt(["react-flow__minimap-node",{selected:x},p]),x:n,y:i,rx:h,ry:h,width:s,height:o,fill:S,stroke:c,strokeWidth:d,shapeRendering:m,onClick:y?k=>y(k,e):void 0})};ME.displayName="MiniMapNode";var SM=q.memo(ME);const bM=e=>e.nodeOrigin,kM=e=>e.getNodes().filter(n=>!n.hidden&&n.width&&n.height),Rc=e=>e instanceof Function?e:()=>e;function EM({nodeStrokeColor:e="transparent",nodeColor:n="#e2e2e2",nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:o=2,nodeComponent:u=SM,onClick:l}){const c=Ve(kM,bt),d=Ve(bM),p=Rc(n),h=Rc(e),m=Rc(i),y=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return oe.createElement(oe.Fragment,null,c.map(x=>{const{x:C,y:_}=pi(x,d).positionAbsolute;return oe.createElement(u,{key:x.id,x:C,y:_,width:x.width,height:x.height,style:x.style,selected:x.selected,className:m(x),color:p(x),borderRadius:s,strokeColor:h(x),strokeWidth:o,shapeRendering:y,onClick:l,id:x.id})}))}var NM=q.memo(EM);const CM=200,TM=150,RM=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?$A(pu(n,e.nodeOrigin),i):i,rfId:e.rfId}},jM="react-flow__minimap-desc";function PE({style:e,className:n,nodeStrokeColor:i="transparent",nodeColor:s="#e2e2e2",nodeClassName:o="",nodeBorderRadius:u=5,nodeStrokeWidth:l=2,nodeComponent:c,maskColor:d="rgb(240, 240, 240, 0.6)",maskStrokeColor:p="none",maskStrokeWidth:h=1,position:m="bottom-right",onClick:y,onNodeClick:x,pannable:C=!1,zoomable:_=!1,ariaLabel:S="React Flow mini map",inversePan:k=!1,zoomStep:b=10,offsetScale:E=5}){const N=kt(),j=q.useRef(null),{boundingRect:I,viewBB:P,rfId:B}=Ve(RM,bt),M=(e==null?void 0:e.width)??CM,F=(e==null?void 0:e.height)??TM,O=I.width/M,Q=I.height/F,X=Math.max(O,Q),R=X*M,K=X*F,H=E*X,te=I.x-(R-I.width)/2-H,Y=I.y-(K-I.height)/2-H,$=R+H*2,G=K+H*2,A=`${jM}-${B}`,z=q.useRef(0);z.current=X,q.useEffect(()=>{if(j.current){const V=xn(j.current),J=he=>{const{transform:me,d3Selection:je,d3Zoom:De}=N.getState();if(he.sourceEvent.type!=="wheel"||!je||!De)return;const Me=-he.sourceEvent.deltaY*(he.sourceEvent.deltaMode===1?.05:he.sourceEvent.deltaMode?1:.002)*b,Ie=me[2]*Math.pow(2,Me);De.scaleTo(je,Ie)},se=he=>{const{transform:me,d3Selection:je,d3Zoom:De,translateExtent:Me,width:Ie,height:ke}=N.getState();if(he.sourceEvent.type!=="mousemove"||!je||!De)return;const Ge=z.current*Math.max(1,me[2])*(k?-1:1),ye={x:me[0]-he.sourceEvent.movementX*Ge,y:me[1]-he.sourceEvent.movementY*Ge},ge=[[0,0],[Ie,ke]],Ue=cr.translate(ye.x,ye.y).scale(me[2]),mt=De.constrain()(Ue,ge,Me);De.transform(je,mt)},ue=Bk().on("zoom",C?se:null).on("zoom.wheel",_?J:null);return V.call(ue),()=>{V.on("zoom",null)}}},[C,_,k,b]);const ae=y?V=>{const J=In(V);y(V,{x:J[0],y:J[1]})}:void 0,D=x?(V,J)=>{const se=N.getState().nodeInternals.get(J);x(V,se)}:void 0;return oe.createElement(Eg,{position:m,style:e,className:Pt(["react-flow__minimap",n]),"data-testid":"rf__minimap"},oe.createElement("svg",{width:M,height:F,viewBox:`${te} ${Y} ${$} ${G}`,role:"img","aria-labelledby":A,ref:j,onClick:ae},S&&oe.createElement("title",{id:A},S),oe.createElement(NM,{onClick:D,nodeColor:s,nodeStrokeColor:i,nodeBorderRadius:u,nodeClassName:o,nodeStrokeWidth:l,nodeComponent:c}),oe.createElement("path",{className:"react-flow__minimap-mask",d:`M${te-H},${Y-H}h${$+H*2}v${G+H*2}h${-$-H*2}z
57
+ M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fill:d,fillRule:"evenodd",stroke:p,strokeWidth:h,pointerEvents:"none"})))}PE.displayName="MiniMap";var AM=q.memo(PE);function IM(){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},oe.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function MM(){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},oe.createElement("path",{d:"M0 0h32v4.2H0z"}))}function PM(){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},oe.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 qM(){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},oe.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 OM(){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},oe.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 Ji=({children:e,className:n,...i})=>oe.createElement("button",{type:"button",className:Pt(["react-flow__controls-button",n]),...i},e);Ji.displayName="ControlButton";const LM=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),qE=({style:e,showZoom:n=!0,showFitView:i=!0,showInteractive:s=!0,fitViewOptions:o,onZoomIn:u,onZoomOut:l,onFitView:c,onInteractiveChange:d,className:p,children:h,position:m="bottom-left"})=>{const y=kt(),[x,C]=q.useState(!1),{isInteractive:_,minZoomReached:S,maxZoomReached:k}=Ve(LM,bt),{zoomIn:b,zoomOut:E,fitView:N}=yo();if(q.useEffect(()=>{C(!0)},[]),!x)return null;const j=()=>{b(),u==null||u()},I=()=>{E(),l==null||l()},P=()=>{N(o),c==null||c()},B=()=>{y.setState({nodesDraggable:!_,nodesConnectable:!_,elementsSelectable:!_}),d==null||d(!_)};return oe.createElement(Eg,{className:Pt(["react-flow__controls",p]),position:m,style:e,"data-testid":"rf__controls"},n&&oe.createElement(oe.Fragment,null,oe.createElement(Ji,{onClick:j,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:k},oe.createElement(IM,null)),oe.createElement(Ji,{onClick:I,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S},oe.createElement(MM,null))),i&&oe.createElement(Ji,{className:"react-flow__controls-fitview",onClick:P,title:"fit view","aria-label":"fit view"},oe.createElement(PM,null)),s&&oe.createElement(Ji,{className:"react-flow__controls-interactive",onClick:B,title:"toggle interactivity","aria-label":"toggle interactivity"},_?oe.createElement(OM,null):oe.createElement(qM,null)),h)};qE.displayName="Controls";var $M=q.memo(qE),Pn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Pn||(Pn={}));function DM({color:e,dimensions:n,lineWidth:i}){return oe.createElement("path",{stroke:e,strokeWidth:i,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`})}function FM({color:e,radius:n}){return oe.createElement("circle",{cx:n,cy:n,r:n,fill:e})}const zM={[Pn.Dots]:"#91919a",[Pn.Lines]:"#eee",[Pn.Cross]:"#e2e2e2"},BM={[Pn.Dots]:1,[Pn.Lines]:1,[Pn.Cross]:6},UM=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function OE({id:e,variant:n=Pn.Dots,gap:i=20,size:s,lineWidth:o=1,offset:u=2,color:l,style:c,className:d}){const p=q.useRef(null),{transform:h,patternId:m}=Ve(UM,bt),y=l||zM[n],x=s||BM[n],C=n===Pn.Dots,_=n===Pn.Cross,S=Array.isArray(i)?i:[i,i],k=[S[0]*h[2]||1,S[1]*h[2]||1],b=x*h[2],E=_?[b,b]:k,N=C?[b/u,b/u]:[E[0]/u,E[1]/u];return oe.createElement("svg",{className:Pt(["react-flow__background",d]),style:{...c,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:p,"data-testid":"rf__background"},oe.createElement("pattern",{id:m+e,x:h[0]%k[0],y:h[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`},C?oe.createElement(FM,{color:y,radius:b/u}):oe.createElement(DM,{dimensions:E,color:y,lineWidth:o})),oe.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${m+e})`}))}OE.displayName="Background";var HM=q.memo(OE);function LE(){return{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreateTokens:0}}function $E(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=$E(s,n+1);if(o)return o}return null}function VM(e,n){e.inputTokens+=n.inputTokens,e.outputTokens+=n.outputTokens,e.cacheReadTokens+=n.cacheReadTokens,e.cacheCreateTokens+=n.cacheCreateTokens}const WM=/^(?:claude[-_]|gpt[-_]|o\d|codex[-_])/i;function DE(e,n=0){if(!e||typeof e!="object"||n>6)return null;const i=e;if(typeof i.model=="string"&&WM.test(i.model))return i.model;for(const s of Object.values(i)){const o=DE(s,n+1);if(o)return o}return null}function dg(){return{agents:new Map,toolIndex:new Map,toolOwner:new Map,activeSubagentStack:new Map,lastSeq:0,totalEvents:0}}function Ur(e){if(!e)return;const n=e.replace(/\\/g,"/").split("/").filter(Boolean);return n[n.length-1]}function Og(e,n){return`${e}::${n}`}function su(e){return e.agent_type??e.subagent_type??"subagent"}function hg(e){return e.agent_id?e.agent_id:e.parent_tool_use_id?e.parent_tool_use_id:null}function io(e,n,i,s){const o=n;let u=e.agents.get(o);return u||(u={id:o,sessionId:n,label:"session",kind:"root",state:"active",startedAt:i,tools:[],prompts:[],toolCount:0,childCount:0,synthetic:s,inFlightTool:null,usage:LE()},e.agents.set(o,u),u)}function FE(e,n,i,s){const o=Og(n,i),u=e.agents.get(o);if(!u)return null;!u.cwd&&s.cwd&&(u.cwd=s.cwd,u.cwdBasename=Ur(s.cwd));const l=su(s);return l&&(u.label==="subagent"||!u.label)&&(u.label=l),u}function jw(e,n,i){const s=n.session_id??"unknown",o=hg(n);if(o){const d=FE(e,s,o,n);if(d)return d}const u=e.activeSubagentStack.get(s),l=u&&u.length>0?u[u.length-1]:null;if(l){const d=e.agents.get(Og(s,l));if(d)return!d.cwd&&n.cwd&&(d.cwd=n.cwd,d.cwdBasename=Ur(n.cwd)),d}const c=io(e,s,i,!1);return c.synthetic&&(c.synthetic=!1,c.startedAt=i),!c.cwd&&n.cwd&&(c.cwd=n.cwd,c.cwdBasename=Ur(n.cwd)),c.label==="session"&&n.cwd&&(c.label=Ur(n.cwd)??"session"),c}function GM(e,n,i,s,o){const u=Og(n,i),l=io(e,n,o,!0);let c=e.agents.get(u);if(c){!c.cwd&&s.cwd&&(c.cwd=s.cwd,c.cwdBasename=Ur(s.cwd));const d=su(s);return d&&(c.label==="subagent"||!c.label)&&(c.label=d),c}return c={id:u,sessionId:n,label:su(s),kind:"subagent",parentId:l.id,state:"active",startedAt:o,tools:[],prompts:[],cwd:s.cwd,cwdBasename:Ur(s.cwd),toolCount:0,childCount:0,inFlightTool:null,usage:LE()},e.agents.set(u,c),l.childCount+=1,c}function KM(e,n,i){const s=e.activeSubagentStack.get(n)??[];s.push(i),e.activeSubagentStack.set(n,s)}function YM(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 jc(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 eo(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 XM(e,n,i,s){if(e.agents.size<=i)return!1;const o=[];for(const[l,c]of e.agents)c.state==="done"&&c.endedAt!=null&&n-c.endedAt>s&&o.push({id:l,endedAt:c.endedAt});if(o.length===0)return!1;o.sort((l,c)=>l.endedAt-c.endedAt);let u=0;for(const l of o){if(e.agents.size<=i)break;e.agents.delete(l.id),u++}return u>0}function QM(e,n,i,s){const o=new Map;for(const[p,h]of e.agents){let m=o.get(h.sessionId);m||(m={ids:[],endedAt:0,live:!1},o.set(h.sessionId,m)),m.ids.push(p),h.state==="done"&&h.endedAt!=null?m.endedAt=Math.max(m.endedAt,h.endedAt):m.live=!0}const u=[...o.values()].filter(p=>!p.live&&p.endedAt>0&&n-p.endedAt>s).sort((p,h)=>p.endedAt-h.endedAt);let c=[...o.values()].filter(p=>!p.live).length-i;if(c<=0)return!1;let d=!1;for(const p of u){if(c<=0)break;for(const h of p.ids)e.agents.delete(h);c--,d=!0}return d}function ZM(e,n,i){let s=!1;for(const o of e.agents.values()){let u=!1;for(const l of o.tools)l.endedAt==null&&n-l.startedAt>i&&(l.endedAt=l.startedAt+i,l.ok=!1,l.errorPreview="stale (no PostToolUse received)",e.toolIndex.delete(l.id),e.toolOwner.delete(l.id),u=!0,s=!0);u&&eo(o)}return s}function Aw(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{...dg(),lastSeq:n.seq};e.totalEvents+=1,e.lastSeq=n.seq;const u=i.session_id??"unknown";if(o==="ModelObserved"){const d=typeof i.model=="string"?i.model:null;if(d){const h=e.agents.get(u);h&&(h.model=d)}const p=i.subagentModels;if(p&&typeof p=="object")for(const[h,m]of Object.entries(p)){if(typeof m!="string")continue;const y=`${u}::${h}`,x=e.agents.get(y);x&&(x.model=m)}return e}if(o==="ContextObserved"){const d=i.context??null;if(d){const p=e.agents.get(u);p&&(p.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 p=e.agents.get(u);p&&(p.usage.inputTokens=Number(d.input_tokens??0),p.usage.outputTokens=Number(d.output_tokens??0),p.usage.cacheReadTokens=Number(d.cache_read_input_tokens??d.cached_input_tokens??0),p.usage.cacheCreateTokens=Number(d.cache_creation_input_tokens??0),typeof d.reasoning_output_tokens=="number"&&(p.usage.reasoningOutputTokens=Number(d.reasoning_output_tokens)))}return e}const l=jw(e,i,s);l.provider||(l.provider=i.provider==="codex"?"codex":"claude"),typeof i.model_context_window=="number"&&i.model_context_window>0&&(l.contextWindow=i.model_context_window);const c=DE(i);switch(c&&(l.model=c),o){case"SessionStart":{const d=io(e,u,s,!1);d.synthetic=!1,d.state="active",d.startedAt=d.startedAt||s,!d.cwd&&i.cwd&&(d.cwd=i.cwd,d.cwdBasename=Ur(i.cwd)),d.label==="session"&&i.cwd&&(d.label=Ur(i.cwd)??"session");break}case"UserPromptSubmit":{for(const m of e.agents.values())m.sessionId===u&&m.kind==="subagent"&&m.state==="done"&&m.exitAt==null&&m.endedAt!=null&&m.endedAt<s&&(m.exitAt=s);const d=io(e,u,s,!1);d.state="active",d.endedAt=void 0,d.exitAt=void 0;const p=jw(e,i,s);p.state="active",p.exitAt=void 0,p.endedAt=void 0;const h=(typeof i.prompt=="string"?i.prompt:typeof i.message=="string"?i.message:"")??"";h&&(p.prompts.push({at:s,text:h}),p.firstPrompt||(p.firstPrompt=jc(h,120)));break}case"PreToolUse":{const d=i.tool_use_id??`${l.id}:${l.toolCount}`,p={id:d,name:i.tool_name??"?",input:i.tool_input,inputPreview:jc(i.tool_input),agentId:l.id,startedAt:s};l.tools.push(p),l.toolCount+=1,l.state="active",e.toolIndex.set(d,p),e.toolOwner.set(d,l.id),eo(l);break}case"PostToolUse":case"PostToolUseFailure":{const d=i.tool_use_id;if(!d)break;let p=e.toolIndex.get(d),h=!1;if(!p)for(const x of e.agents.values()){const C=x.tools.find(_=>_.id===d);if(C){p=C,h=!0;break}}if(!p)break;p.endedAt=s,p.ok=o==="PostToolUse",p.response=i.tool_response,o==="PostToolUseFailure"?p.errorPreview=jc(i.tool_response):h&&(p.errorPreview=void 0);const m=$E(i.tool_response);m&&(p.usage=m),e.toolIndex.delete(d);const y=e.toolOwner.get(d)??p.agentId;if(e.toolOwner.delete(d),y){const x=e.agents.get(y);x&&(m&&VM(x.usage,m),eo(x))}break}case"SubagentStart":{const d=hg(i);if(!d)break;const p=GM(e,u,d,i,s);p.state="active",p.startedAt=p.startedAt||s,p.exitAt=void 0,p.endedAt=void 0;const h=su(i);h&&(p.label=h),KM(e,u,d);break}case"SubagentStop":{const d=hg(i);if(!d)break;const p=FE(e,u,d,i);if(!p)break;p.state="done",p.endedAt=s,eo(p),YM(e,u,d);break}case"Stop":case"SessionEnd":{const d=io(e,u,s,!1);d.state="done",d.endedAt=s,eo(d);break}}return e}function Lg(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 JM=Date.UTC(2026,8,1);function eP(){return Date.now()<JM?{input:2,output:10,cacheRead:.2,cacheWrite:2.5}:{input:3,output:15,cacheRead:.3,cacheWrite:3.75}}const tP=[{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:eP()},{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 nP(e){return e?/^(?:gpt[-_]|codex[-_]|o\d)/i.test(e):!1}function $g(e){if(!e)return null;for(const n of tP)if(n.match.test(e))return n.rates;return null}const rP=272e3,iP=/^gpt[-_]5[-_.](?:6(?![-_]cyber)|5|4)/i;function sP(e,n){return!e||n<=rP?{input:1,output:1}:iP.test(e)?{input:2,output:1.5}:{input:1,output:1}}function Zt(e,n){const i=$g(n);if(!i)return{input:0,output:0,cacheRead:0,cacheWrite:0,total:0};const s=nP(n),o=s?Math.max(0,e.inputTokens-e.cacheReadTokens):e.inputTokens,u=s?sP(n,e.inputTokens):{input:1,output:1},l=o*i.input*u.input/1e6,c=e.outputTokens*i.output*u.output/1e6,d=e.cacheReadTokens*i.cacheRead*u.input/1e6,p=e.cacheCreateTokens*i.cacheWrite*u.input/1e6;return{input:l,output:c,cacheRead:d,cacheWrite:p,total:l+c+d+p}}const Iw=2e5,oP=1e6,aP=[/\[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],uP=[{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 zE(e){if(!e)return Iw;for(const n of aP)if(n.test(e))return oP;for(const n of uP)if(n.match.test(e))return n.window;return Iw}function $e(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 ou(e,n){if(e<=0||n<10)return null;const i=e/n,s=i*60;return s>=.01?`${$e(s)}/min`:`${$e(i*3600)}/hr`}function wn(e){return e.toLocaleString()}function lP(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function cP({agent:e,onClose:n}){var p;const i=e.context,s=e.usage,o=(i==null?void 0:i.currentContextTokens)??0,u=zE(e.model),l=Math.min(100,o/u*100),c=Zt(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:h=>h.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(l),children:v.jsx("div",{className:"ctx-window-fill",style:{width:`${l}%`}})}),v.jsxs("div",{className:"ctx-window-meta",children:[v.jsxs("span",{className:"ctx-window-pct",children:[l.toFixed(1),"%"]}),v.jsxs("span",{className:"ctx-window-num",children:[wn(o)," / ",wn(u)," tok (current turn)"]})]})]}),v.jsx("h3",{className:"ctx-section-title",children:"Cumulative usage · whole session"}),v.jsxs("div",{className:"ctx-grid",children:[v.jsx(An,{label:"input tokens",val:wn(s.inputTokens)}),v.jsx(An,{label:"output tokens",val:wn(s.outputTokens)}),v.jsx(An,{label:"cache reads",val:wn(s.cacheReadTokens)}),v.jsx(An,{label:"cache writes",val:wn(s.cacheCreateTokens)}),v.jsx(An,{label:"cumulative total",val:wn(d)}),v.jsx(An,{label:"estimated cost",val:$e(c.total),accent:!0})]}),v.jsx("h3",{className:"ctx-section-title",children:"Transcript composition"}),v.jsxs("div",{className:"ctx-grid",children:[v.jsx(An,{label:"user messages",val:wn((i==null?void 0:i.msgsUser)??0)}),v.jsx(An,{label:"assistant messages",val:wn((i==null?void 0:i.msgsAssistant)??0)}),v.jsx(An,{label:"tool uses",val:wn((i==null?void 0:i.toolUses)??0)}),v.jsx(An,{label:"tool results",val:wn((i==null?void 0:i.toolResults)??0)}),v.jsx(An,{label:"system-reminders",val:wn((i==null?void 0:i.systemReminders)??0)})]}),v.jsx("h3",{className:"ctx-section-title",children:"CLAUDE.md files in scope"}),(((p=i==null?void 0:i.claudeMdFiles)==null?void 0:p.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(h=>v.jsxs("li",{children:[v.jsx("span",{className:"ctx-md-path",title:h.path,children:h.path}),v.jsx("span",{className:"ctx-md-size",children:lP(h.bytes)})]},h.path))})]})})}function An({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 fP({currentContextTokens:e,modelId:n,size:i=26,onClick:s,title:o}){const u=zE(n),l=Math.min(1,e/u),c=i/2-3,d=i/2,p=2*Math.PI*c,h=p*l,m=l>.9?"var(--err)":l>.7?"var(--inflight)":"var(--accent)";return v.jsx("button",{type:"button",className:"ctx-donut",onClick:s,title:o??`context: ${e.toLocaleString()} / ${u.toLocaleString()} (${(l*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:`${h} ${p-h}`,strokeDashoffset:p/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(l*100)})]})})}function dP(e,n){const i=$g(n);if(!i)return"no rates for this model";const s=l=>l.toLocaleString(),o=l=>`$${l}/MTok`,u=Zt(e,n);return[`model: ${n}`,`input ${s(e.inputTokens).padStart(14)} × ${o(i.input).padEnd(11)} = ${$e(u.input)}`,`output ${s(e.outputTokens).padStart(14)} × ${o(i.output).padEnd(11)} = ${$e(u.output)}`,`cache r ${s(e.cacheReadTokens).padStart(14)} × ${o(i.cacheRead).padEnd(11)} = ${$e(u.cacheRead)}`,`cache w ${s(e.cacheCreateTokens).padStart(14)} × ${o(i.cacheWrite).padEnd(11)} = ${$e(u.cacheWrite)}`,"─────────────────────────────────────────",`total = ${$e(u.total)}`].join(`
58
+ `)}function hP(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 u=Math.floor(o/60),l=o%60;return`${u}m ${String(l).padStart(2,"0")}s`}function pP({data:e,selected:n}){var p;const i=e.now??Date.now(),s=["agent-node",`state-${e.state}`,e.synthetic?"synthetic":"",n?"selected":""].filter(Boolean).join(" "),o=e.tools.filter(h=>!h.endedAt).length,l=`hsl(${Lg(e.sessionId)} 70% 60%)`,c=((p=e.context)==null?void 0:p.currentContextTokens)??0,d=e.kind==="root"&&c>0;return v.jsxs("div",{className:s,style:{"--accent":l},children:[v.jsx("span",{className:"accent-stripe"}),v.jsx(os,{type:"target",position:Ce.Left,style:{background:"transparent",border:"none"}}),v.jsxs("div",{className:"head",children:[v.jsxs("div",{className:"title",children:[v.jsx(mP,{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(fP,{currentContextTokens:c,modelId:e.model,onClick:()=>e.onOpenContext(e.sessionId)}),v.jsx("div",{className:"time",title:`Started ${new Date(e.startedAt).toLocaleTimeString()}`,children:hP(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:wo(e.model)})]}),e.tools.length>0&&v.jsx(vP,{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:gP(e.usage.inputTokens+e.usage.outputTokens)})," tok"]}),e.model&&$g(e.model)&&(()=>{const h=Zt(e.usage,e.model);if(h.total<=0)return null;const m=Math.max(0,((e.endedAt??i)-e.startedAt)/1e3),y=e.state==="active"?ou(h.total,m):null,x=dP(e.usage,e.model)+(y?`
59
+ burn: ${y}`:"");return v.jsxs("span",{className:"cost-meta",title:x,children:[v.jsx("b",{children:$e(h.total)}),y&&v.jsx("span",{className:"cost-rate",children:y})]})})()]}),v.jsx(os,{type:"source",position:Ce.Right,style:{background:"transparent",border:"none"}})]})}function mP({state:e}){const n=e==="active"?"live":e==="done"?"done":"err";return v.jsx("span",{className:`state-pill state-${e}`,children:n})}function gP(e){return e<1e3?`${e}`:e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(2)}M`}function vP({tools:e,now:n}){const u=new Array(24).fill(0);let l=0;for(const y of e){const x=n-y.startedAt;if(x<0||x>=6e4)continue;const C=23-Math.floor(x/2500);C>=0&&C<24&&(u[C]+=1,l+=1)}const c=Math.max(1,...u),d=132,p=14,h=d/24,m=c/(2500/1e3);return v.jsxs("div",{className:"tool-spark-row",title:`${l} tool calls in last 60s · peak ${m.toFixed(1)}/s`,children:[v.jsx("svg",{className:"tool-spark",width:d,height:p,viewBox:`0 0 ${d} ${p}`,"aria-hidden":!0,children:u.map((y,x)=>{const C=y===0?1.5:Math.max(1.5,y/c*p),_=x===23&&y>0,k=`tool-spark-bar${y>0?" active":""}${_?" latest":""}`;return v.jsx("rect",{x:x*h+.4,y:p-C,width:Math.max(.5,h-1),height:C,rx:.8,className:k},x)})}),v.jsx("span",{className:"tool-spark-label",children:"60s"})]})}function wo(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(),u=n[2].replace(/[-_]/g,".");return`${o} ${u}`}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 Mw(e){if(e==null)return"(none)";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function yP(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 wP({tool:e,onClose:n}){q.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:yP(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:Mw(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…)":Mw(e.response??e.errorPreview)})]})]})]})})}const Da=18,Pw=26,xP=12;function _P(e){const n=new Map;for(const o of e.nodeInternals.values()){const u=o.data;if(!(u!=null&&u.sessionId)||u.exitAt!=null||o.width==null||o.height==null)continue;const l=o.position.x,c=o.position.y,d=l+o.width,p=c+o.height,h=n.get(u.sessionId);h?(h.minX=Math.min(h.minX,l),h.minY=Math.min(h.minY,c),h.maxX=Math.max(h.maxX,d),h.maxY=Math.max(h.maxY,p),u.kind==="root"&&(h.label=qw(u)??h.label)):n.set(u.sessionId,{minX:l,minY:c,maxX:d,maxY:p,label:qw(u)??u.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,u]of n){const c=(i.get(u.label)??0)>1?`${u.label} · ${SP(o)}`:u.label;s.push({sessionId:o,label:c,x:u.minX-Da,y:u.minY-Da-Pw,w:u.maxX-u.minX+Da*2,h:u.maxY-u.minY+Da*2+Pw})}return s}function SP(e){const n=e.match(/[a-zA-Z0-9]{4}/);return n?n[0]:e.slice(0,4)}function qw(e){if(e.kind==="root")return e.label}function bP(){const{x:e,y:n,zoom:i}=IE(),s=yo(),o=Ve(_P,kP);if(o.length<=1)return null;const u=l=>{try{const c=s.getNodes().filter(d=>{const p=d.data;return(p==null?void 0:p.sessionId)===l});if(c.length===0)return;s.fitView({padding:.3,duration:500,nodes:c})}catch{}};return v.jsx("div",{className:"session-clusters",children:o.map(l=>{const c=Lg(l.sessionId),d={position:"absolute",left:l.x*i+e,top:l.y*i+n,width:l.w*i,height:l.h*i,borderColor:`hsl(${c} 65% 55% / 0.32)`,background:`hsl(${c} 70% 50% / 0.04)`},p={position:"absolute",left:l.x*i+e+16*i,top:(l.y-xP)*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(oe.Fragment,{children:[v.jsx("div",{className:"cluster-card",style:d,"aria-hidden":!0}),v.jsx("button",{type:"button",className:"cluster-label",style:p,title:`Fit view to ${l.label} · drag the wrapper to move the whole session`,onClick:()=>u(l.sessionId),children:l.label})]},l.sessionId)})})}function kP(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 EP({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 BE=600,NP=36,pg=16,CP=60,TP=6,Ow=220,Lw=96,RP=28,jP={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 AP(e){return e.startsWith("mcp__")?"mcp":jP[e]??"other"}const IP={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 $w(e){return e.startsWith("mcp__")?"🔌":IP[e]??"✨"}const MP={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 UE(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 UE(i[1]);for(;;){const u=n.match(/^([A-Z_][A-Z0-9_]*=\S*)\s+/);if(!u)break;n=n.slice(u[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 PP(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 qP=new Set(["Bash","PowerShell","shell","exec_command","shell_command","write_stdin","wait"]),OP=new Set(["shell","exec_command","shell_command","write_stdin","wait","apply_patch","update_plan"]);function LP(e,n){return OP.has(e)?Math.max(Lw,34+n.length*7.5):Lw}function $P(e,n){if(!qP.has(e))return null;const i=PP(n);if(!i)return null;const s=UE(i);return s?{emoji:MP[s]??"⚙️",label:s,category:"shell",detail:i}:null}const DP=new Set(["Read","Write","Edit","MultiEdit","NotebookEdit","LS","Glob","apply_patch"]),Dw={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:"🗄️"},Fw={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 FP(e){const i=e.replace(/\\/g,"/").replace(/\/+$/,""),s=i.lastIndexOf("/");return s>=0?i.slice(s+1):i}function zP(e){const n=e.toLowerCase();if(Fw[n])return Fw[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(Dw[s])return Dw[s]}return"📄"}function BP(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 UP(e,n){if(!DP.has(e))return null;const i=BP(e,n);if(!i)return null;const s=FP(i);return s?{emoji:e==="LS"?"📂":zP(s),label:s,category:"file",detail:i}:null}const HE={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 VE(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 HP(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 VP(e,n){const i=VE(e);if(!i)return null;const{server:s,method:o}=i;if(!o)return null;const u=HE[s.toLowerCase()];return{emoji:(u==null?void 0:u.emoji)??"🔌",label:o,category:"mcp",detail:u?`${u.name} · ${o}`:`${s} · ${o}`}}function WP(e,n){return $P(e,n)??UP(e,n)??VP(e)}const GP={shell:"Shell",exec_command:"Shell",shell_command:"Shell",write_stdin:"stdin",wait:"wait",apply_patch:"Edit",update_plan:"Plan"};function KP(e){const n=VE(e);if(n){const s=HE[n.server.toLowerCase()];return s?{emoji:s.emoji,label:s.name}:{emoji:"🔌",label:n.server,hue:HP(n.server)}}const i=GP[e];return i?{emoji:$w(e),label:i}:{emoji:$w(e),label:e}}function YP(e){return e.endedAt==null?"inflight":e.ok===!1?"err":"done"}function XP(e,n,i){if(i==null)return 1;const s=n-i;return s<0?1:Math.max(0,1-s/BE)}function QP(e,n,i,s,o,u){const l=[];for(const c of e.values()){if(!n.has(c.id)||c.exitAt!=null&&u-c.exitAt>BE)continue;const d=s.get(c.id)??i.get(c.id);if(!d)continue;const p=c.tools.slice(-4);if(p.length===0)continue;const h=c.exitAt??null,m=o.get(c.id),y=Math.max((m==null?void 0:m.width)??Ow,Ow),x=(m==null?void 0:m.height)??130,C=d.x,_=d.y,S=C+y,k=_+x/2;p.forEach((b,E)=>{const N=E*NP,j=C+y+CP,I=_+TP+N,P=XP(b,u,h),B=b.inputPreview??"",M=YP(b),F=P<.999,O=KP(b.name);l.push({id:b.id,toolId:b.id,agentId:c.id,toolName:b.name,name:O.label,emoji:O.emoji,status:M,category:AP(b.name),mcpHue:O.hue,inputPreview:B,fade:P,fading:F,worldX:j,worldY:I,anchorX:S,anchorY:k,spawnDx:S-j,spawnDy:k-(I+pg)});const Q=WP(b.name,b.input);if(Q){const X=LP(b.name,O.label),R=j+X+RP,K=I,H=j+X,te=I+pg;l.push({id:`sub:${b.id}`,toolId:b.id,agentId:c.id,toolName:b.name,name:Q.label,emoji:Q.emoji,isSub:!0,status:M,category:Q.category,inputPreview:Q.detail??B,fade:P,fading:F,worldX:R,worldY:K,anchorX:H,anchorY:te,spawnDx:H-R,spawnDy:0})}})}return l}function ZP({agents:e,visibleAgentIds:n,positions:i,pinned:s,measured:o,dimUnmatched:u,spotlight:l,hiddenCategories:c,now:d,onOpenTool:p}){const{x:h,y:m,zoom:y}=IE(),x=QP(e,n,i,s,o,d),C=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:C.map(_=>{const S=_.anchorX*y+h,k=_.anchorY*y+m,b=(_.worldX+6)*y+h,E=(_.worldY+pg)*y+m,N=S+(b-S)*.55,j=u!=null&&!u.has(_.agentId),I=l!=null&&!l.has(_.agentId),P=_.fade*(j||I?.14:1);return v.jsx("path",{d:`M ${S} ${k} Q ${N} ${k}, ${b} ${E}`,className:`tool-conn status-${_.status}${_.fading?" fading":""}`,opacity:P},`l:${_.id}`)})}),C.map(_=>{const S=_.worldX*y+h,k=_.worldY*y+m,b={left:`${S}px`,top:`${k}px`,transform:`scale(${y})`,transformOrigin:"left top","--spawn-dx":`${_.spawnDx}px`,"--spawn-dy":`${_.spawnDy}px`},E=_.isSub?`${_.toolName} · ${_.name}`:_.toolName,N=_.inputPreview?`${E} · ${_.inputPreview}`:E,j=p!=null,I=_.mcpHue!=null?{"--cat-accent":`hsl(${_.mcpHue} 65% 65%)`}:{},P=u!=null&&!u.has(_.agentId),B=l!=null&&!l.has(_.agentId),M=P||B?" dim":"";return v.jsx("div",{className:"tool-burst-wrap",style:b,children:v.jsxs("div",{className:`tool-burst cat-${_.category} status-${_.status}${_.fading?" fading":""}${j?" clickable":""}${_.isSub?" sub":""}${M}`,style:I,title:N,role:j?"button":void 0,tabIndex:j?0:void 0,"aria-label":j?`Open ${_.toolName} ${_.status==="inflight"?"in flight":_.status} — click for details`:void 0,onClick:j?()=>p(_.toolId):void 0,onKeyDown:j?F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),p(_.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 JP({state:e,sessionId:n,onClose:i}){const s=q.useMemo(()=>t3(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:$e(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:wo(o)},o))})]}),v.jsx("div",{className:"ss-hero-right",children:s.cost.total>0&&v.jsxs(v.Fragment,{children:[v.jsx(e3,{cost:s.cost}),v.jsxs("div",{className:"ss-cost-legend",children:[v.jsxs("span",{className:"ssl ssl-in",children:["input ",v.jsx("b",{children:$e(s.cost.input)})]}),v.jsxs("span",{className:"ssl ssl-out",children:["output ",v.jsx("b",{children:$e(s.cost.output)})]}),v.jsxs("span",{className:"ssl ssl-cr",children:["cache r ",v.jsx("b",{children:$e(s.cost.cacheRead)})]}),v.jsxs("span",{className:"ssl ssl-cw",children:["cache w ",v.jsx("b",{children:$e(s.cost.cacheWrite)})]})]})]})})]}),v.jsxs("section",{className:"ss-stats",children:[v.jsx(Qi,{label:"agents",value:s.agentCount}),v.jsx(Qi,{label:"subagents",value:s.subagentCount}),v.jsx(Qi,{label:"tool calls",value:s.toolCount}),v.jsx(Qi,{label:"prompts",value:s.promptCount}),v.jsx(Qi,{label:"tokens",value:s.tokensSum.toLocaleString()}),s.errCount>0&&v.jsx(Qi,{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,u])=>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:`${u/s.topTools[0][1]*100}%`}})}),v.jsx("span",{className:"ss-tt-count",children:u})]},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 Qi({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 e3({cost:e}){const n=e.total;if(n<=0)return null;const i=(s,o,u)=>{if(s<=0)return null;const l=s/n*100;return v.jsx("span",{className:`cb-seg ${o}`,style:{width:`${l}%`},title:`${u}: ${$e(s)} (${l.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 t3(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},u=new Set,l=new Map;let c=0,d=0,p=0,h=0,m=0,y,x=1/0,C=0;for(const E of s){const N=Zt(E.usage,E.model);o.input+=N.input,o.output+=N.output,o.cacheRead+=N.cacheRead,o.cacheWrite+=N.cacheWrite,o.total+=N.total,E.model&&u.add(E.model),E.kind==="subagent"&&m++,d+=E.prompts.length,!y&&E.prompts.length>0&&(y=E.prompts[0].text),p+=E.usage.inputTokens+E.usage.outputTokens,c+=E.tools.length,x=Math.min(x,E.startedAt),C=Math.max(C,E.endedAt??Date.now());for(const j of E.tools)l.set(j.name,(l.get(j.name)??0)+1),j.ok===!1&&h++}const _=Math.max(0,C-x),S=Math.floor(_/1e3),k=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`,b=Array.from(l.entries()).sort((E,N)=>N[1]-E[1]).slice(0,5);return{sessionId:n,label:i.label||i.cwdBasename||"session",cwd:i.cwd,durationLabel:k,cost:o,modelChips:Array.from(u),agentCount:s.length,subagentCount:m,toolCount:c,promptCount:d,tokensSum:p,errCount:h,topTools:b,firstPrompt:y}}function n3(e,n){const i=[];for(const s of e.agents.values()){if(s.kind!=="root")continue;let o=s.tools.length,u=Zt(s.usage,s.model).total,l=s.endedAt??s.startedAt;for(const c of e.agents.values()){if(c.sessionId!==s.sessionId||c.kind==="root")continue;o+=c.tools.length,u+=Zt(c.usage,c.model).total;const d=c.endedAt??c.startedAt;d>l&&(l=d)}i.push({sessionId:s.sessionId,label:s.label||s.cwdBasename||"session",cwdBasename:s.cwdBasename,state:s.state,modelId:s.model,toolCount:o,cost:u,startedAt:s.startedAt,lastActivity:l})}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 r3(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 u=Math.floor(o/60);return u<60?`${u}m`:`${Math.floor(u/60)}h ${u%60}m`}function i3({state:e,now:n,selectedIds:i,onSelect:s,onClose:o}){const u=q.useMemo(()=>n3(e),[e,e.lastSeq,n]),l=u.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:u.length})]}),l>0&&v.jsxs("span",{className:"sl-live-count",children:[l," 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:[u.length===0&&v.jsx("div",{className:"sl-empty",children:"No sessions yet."}),u.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:wo(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:$e(c.cost)})}),v.jsx("span",{className:"sl-elapsed",title:`Started ${new Date(c.startedAt).toLocaleString()}`,children:r3(c.startedAt,c.state==="active"?void 0:c.lastActivity,n)})]})]})]},c.sessionId)})]})]})}function ur(e){return e<1e3?`${e}`:e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(2)}M`}function s3({cost:e}){const n=e.total;if(n<=0)return null;const i=(s,o,u)=>{if(s<=0)return null;const l=s/n*100;return v.jsx("span",{className:`cb-seg ${o}`,style:{width:`${l}%`},title:`${u}: ${$e(s)} (${l.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 o3(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 u=Math.floor(i/86400),l=Math.floor(i%86400/3600);return`${u}d ${l}h`}return s>0?`${s}h ${o}m`:`${o}m`}function a3(e,n,i,s){const o=Math.max(0,n-s),u=Math.max(0,i-o);if(u<120)return null;const l=Math.min(100,u/i*100),c=e-l;if(Math.abs(c)<3)return{label:"on pace",color:"var(--ok)",expectedPct:l,isDeficit:!1};if(c>0){const d=100-e,p=u>0?e/u:0,h=p>0?d/p:1/0,m={label:`${Math.round(c)}% ahead`,color:"var(--warn)",expectedPct:l,isDeficit:!0};if(h<o&&h<86400){const y=Math.floor(h/3600),x=Math.floor(h%3600/60);m.runsOutIn=y>0?`${y}h ${x}m`:`${x}m`}return m}return{label:`${Math.round(-c)}% reserve`,color:"var(--ok)",expectedPct:l,isDeficit:!1}}function ai({pct:e,label:n,reset:i,resetAt:s,windowSec:o,limitReached:u,nowSec:l}){const c=Math.min(100,Math.max(0,e)),p=u||c>=90?"var(--err)":c>=70?"var(--warn)":"var(--accent)",h=c===0?"< 1%":`${c}%`,m=c===0?2:c,y=s?o3(s,l):null,x=s&&o?a3(c,s,o,l):null;return v.jsxs("div",{className:"qb-row",children:[v.jsxs("div",{className:"qb-meta",children:[v.jsxs("span",{className:"qb-label",children:[n,u&&v.jsx("span",{className:"qb-limit-badge",title:"Rate limit reached",children:"⛔"})]}),v.jsx("span",{className:"qb-pct",style:{color:p},children:h})]}),v.jsxs("div",{className:"qb-track",children:[v.jsx("div",{className:"qb-fill",style:{width:`${m}%`,background:p,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 u3=6e4;function l3(){const[e,n]=q.useState(null),[i,s]=q.useState(!1),o=q.useRef(null),u=async(c=!1)=>{c&&s(!0);try{const p=await fetch(c?"/api/quota?refresh=1":"/api/quota");p.ok&&n(await p.json())}catch{}finally{c&&s(!1)}};return q.useEffect(()=>(u(!0),o.current=window.setInterval(()=>u(!1),u3),()=>{o.current!=null&&window.clearInterval(o.current)}),[]),{quota:e,loading:i,refresh:()=>u(!0)}}function c3(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 WE=6e4;function f3(){const[e,n]=q.useState(null),[i,s]=q.useState(!1),o=q.useRef(null),u=async(c=!1)=>{c&&s(!0);try{const p=await fetch(c?"/api/codex-quota?refresh=1":"/api/codex-quota");p.ok&&n(await p.json())}catch{}finally{c&&s(!1)}};return q.useEffect(()=>(u(!0),o.current=window.setInterval(()=>u(!1),WE),()=>{o.current!=null&&window.clearInterval(o.current)}),[]),{data:e,loading:i,refresh:()=>u(!0)}}function d3(){const[e,n]=q.useState(null),i=q.useRef(null),s=async()=>{try{const o=await fetch("/api/codex-usage");o.ok&&n(await o.json())}catch{}};return q.useEffect(()=>(s(),i.current=window.setInterval(s,WE),()=>{i.current!=null&&window.clearInterval(i.current)}),[]),{data:e}}function h3({state:e,now:n,onClose:i}){var P,B;const{quota:s,loading:o,refresh:u}=l3(),{data:l,loading:c,refresh:d}=f3(),{data:p}=d3(),[h,m]=q.useState(()=>Math.floor(Date.now()/1e3));q.useEffect(()=>{const M=window.setInterval(()=>m(Math.floor(Date.now()/1e3)),3e4);return()=>window.clearInterval(M)},[]);const{byModel:y,totalCost:x,totalTokens:C,burnRate:_}=q.useMemo(()=>{const M=new Map,F={total:0,input:0,output:0,cacheRead:0,cacheWrite:0};let O=0,Q=0,X=0,R=0;for(const $ of e.agents.values()){const G=$.model??"__unknown__",A=Zt($.usage,$.model),z=M.get(G);z?(z.inputTokens+=$.usage.inputTokens,z.outputTokens+=$.usage.outputTokens,z.cacheReadTokens+=$.usage.cacheReadTokens,z.cacheCreateTokens+=$.usage.cacheCreateTokens,z.cost.total+=A.total,z.cost.input+=A.input,z.cost.output+=A.output,z.cost.cacheRead+=A.cacheRead,z.cost.cacheWrite+=A.cacheWrite,z.agentCount++):M.set(G,{model:G,inputTokens:$.usage.inputTokens,outputTokens:$.usage.outputTokens,cacheReadTokens:$.usage.cacheReadTokens,cacheCreateTokens:$.usage.cacheCreateTokens,cost:{...A},agentCount:1}),F.total+=A.total,F.input+=A.input,F.output+=A.output,F.cacheRead+=A.cacheRead,F.cacheWrite+=A.cacheWrite,O+=$.usage.inputTokens,Q+=$.usage.outputTokens,X+=$.usage.cacheReadTokens,R+=$.usage.cacheCreateTokens}const K=Array.from(M.values()).sort(($,G)=>G.cost.total-$.cost.total);let H=0,te=0;for(const $ of e.agents.values()){if($.state!=="active")continue;const G=Zt($.usage,$.model);H+=G.total,te=Math.max(te,(($.endedAt??n)-$.startedAt)/1e3)}const Y=te>0?ou(H,te):null;return{byModel:K,totalCost:F,totalTokens:{in:O,out:Q,cacheR:X,cacheC:R},burnRate:Y}},[e,e.lastSeq,n]),S=q.useMemo(()=>{const M=[];for(const F of e.agents.values()){if(F.kind!=="root")continue;let O=Zt(F.usage,F.model).total,Q=F.usage.inputTokens,X=F.usage.outputTokens;for(const R of e.agents.values())R.sessionId!==F.sessionId||R.kind==="root"||(O+=Zt(R.usage,R.model).total,Q+=R.usage.inputTokens,X+=R.usage.outputTokens);M.push({sessionId:F.sessionId,label:F.label||F.cwdBasename||"session",state:F.state,cost:O,inputTokens:Q,outputTokens:X})}return M.sort((F,O)=>O.cost-F.cost).slice(0,12)},[e,e.lastSeq]),k=x.total>0,b=C.in+C.out,E=o||c,N=Math.max((s==null?void 0:s.fetchedAt)??0,(l==null?void 0:l.fetchedAt)??0),j=N>0?(()=>{const M=h-Math.floor(N/1e3);return M<10?"just now":M<60?`${M}s ago`:M<3600?`${Math.floor(M/60)}m ago`:`${Math.floor(M/3600)}h ago`})():null,I=()=>{u(),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:[j&&!E&&v.jsx("span",{className:"up-last-updated",children:j}),v.jsx("button",{type:"button",className:"btn up-refresh-btn",onClick:I,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.jsx("h4",{className:"up-section-title",children:"Claude quota"}),s!=null&&s.ok?v.jsxs("div",{className:"up-quota-bars",children:[s.session5hPct!=null&&v.jsx(ai,{label:"5-hour window",pct:s.session5hPct,reset:s.session5hReset,resetAt:s.session5hResetAt,windowSec:s.session5hWindowSec,nowSec:h}),s.week7dPct!=null&&v.jsx(ai,{label:"7-day window",pct:s.week7dPct,reset:s.week7dReset,resetAt:s.week7dResetAt,windowSec:s.week7dWindowSec,nowSec:h}),s.weekSonnetPct!=null&&v.jsx(ai,{label:"Sonnet (7d)",pct:s.weekSonnetPct,nowSec:h}),s.weekOpusPct!=null&&v.jsx(ai,{label:"Opus (7d)",pct:s.weekOpusPct,nowSec:h})]}):(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",(l==null?void 0:l.ok)&&l.planLabel&&v.jsx("span",{className:"up-plan-badge",children:l.planLabel})]}),l!=null&&l.ok?v.jsxs("div",{className:"up-quota-bars",children:[(P=l.windows)==null?void 0:P.map(M=>v.jsx(ai,{label:M.label,pct:M.pct,reset:M.reset??void 0,resetAt:M.resetAt??void 0,windowSec:M.windowSec??void 0,limitReached:l.limitReached&&M.pct>=100,nowSec:h},M.id)),(B=l.extraWindows)==null?void 0:B.map(M=>v.jsx(ai,{label:M.label,pct:M.pct,reset:M.reset??void 0,resetAt:M.resetAt??void 0,windowSec:M.windowSec??void 0,nowSec:h},M.id)),l.creditLimit&&v.jsx(ai,{label:`spend cap · $${Math.round(l.creditLimit.used)} of $${Math.round(l.creditLimit.limit)}`,pct:l.creditLimit.usedPct,reset:l.creditLimit.reset??void 0,resetAt:l.creditLimit.resetAt??void 0,limitReached:l.spendControlReached,nowSec:h}),(p==null?void 0:p.ok)&&p.window7d&&p.window7d.sessionCount>0&&v.jsxs("div",{className:"up-quota-sub",children:[ur(p.window7d.totalTokens)," tokens · ",p.window7d.sessionCount," session",p.window7d.sessionCount!==1?"s":""," (7d)"]}),l.creditsBalance&&!l.creditsUnlimited&&v.jsxs("div",{className:"up-quota-sub up-credits",children:["credits: $",l.creditsBalance,l.overageReached&&" · overage limit reached"]}),l.creditsUnlimited&&v.jsx("div",{className:"up-quota-sub up-credits",children:"credits: unlimited"}),l.resetCredits&&l.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:[l.resetCredits.availableCount," rate-limit reset",l.resetCredits.availableCount!==1?"s":""," available",l.resetCredits.nextExpiryAt&&` · expires ${new Date(l.resetCredits.nextExpiryAt).toLocaleDateString("en-US",{month:"short",day:"numeric"})}`]}),l.promo&&v.jsx("div",{className:"up-quota-sub",children:l.promo}),l.partial&&v.jsx("div",{className:"up-quota-sub up-quota-hint",children:"Partial data — OpenAI returned limits this build doesn't recognise."})]}):(l==null?void 0:l.ok)===!1?v.jsxs("div",{className:"up-quota-na",children:[v.jsx("span",{children:"Quota unavailable."}),v.jsx("span",{className:"up-quota-hint",children:c3(l.reason)})]}):v.jsx("div",{className:"up-quota-na up-quota-loading",children:"Checking…"})]}),k?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"up-total",children:[v.jsx("span",{className:"up-total-value",children:$e(x.total)}),v.jsx("span",{className:"up-total-label",children:"total spend"})]}),v.jsx(s3,{cost:x}),b>0&&v.jsxs("div",{className:"up-tokens-row",children:[v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"in"}),ur(C.in)]}),v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"out"}),ur(C.out)]}),C.cacheR>0&&v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"cache r"}),ur(C.cacheR)]}),C.cacheC>0&&v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"cache c"}),ur(C.cacheC)]})]}),y.filter(M=>M.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(M=>M.cost.total>0).map(M=>v.jsxs("tr",{children:[v.jsx("td",{className:"up-model-name",title:M.model,children:wo(M.model)}),v.jsx("td",{className:"up-num",children:ur(M.inputTokens+M.outputTokens)}),v.jsx("td",{className:"up-num up-cost-val",children:$e(M.cost.total)})]},M.model))})]})]}),S.filter(M=>M.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(M=>M.cost>0).map(M=>v.jsxs("div",{className:"up-session-row",children:[v.jsx("span",{className:`sl-dot state-${M.state}`,"aria-hidden":!0}),v.jsx("span",{className:"up-session-label",children:M.label}),v.jsx("span",{className:"up-session-tokens",children:ur(M.inputTokens+M.outputTokens)}),v.jsx("span",{className:"up-session-cost",children:$e(M.cost)})]},M.sessionId))})]})]}):b>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"}),ur(C.in)]}),v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"out"}),ur(C.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 p3=15e3,m3=[70,80,85,90,95];function g3(e,n){const i=e-n;if(i<=0)return null;const s=Math.floor(i/86400),o=Math.floor(i%86400/3600),u=Math.floor(i%3600/60);return s>0?`${s}d ${o}h`:o>0?`${o}h ${u}m`:`${u}m`}function zw(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 v3(e){if(e.event==="switch")return`would switch — ${e.detail??"another account"}`;const i={"below-threshold":"under threshold","no-qualifying-candidate":"no better account","all-exhausted":"every account spent",cooldown:"cooling down","external-engine":"handled elsewhere"}[e.reason??""]??e.reason??"nothing to do";return e.detail?`stays put · ${i}, ${e.detail}`:`stays put · ${i}`}function y3(e){return e==="http-429"?"rate limited":e==="http-401"?"re-login needed":e==="timeout"?"timed out":e==="network"?"unreachable":e}function w3({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?g3(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 x3({onClose:e}){var P,B,M,F;const[n,i]=q.useState(null),[s,o]=q.useState(null),[u,l]=q.useState(null),[c,d]=q.useState(null),[p,h]=q.useState(null),[m,y]=q.useState(null),[x,C]=q.useState(()=>Math.floor(Date.now()/1e3)),_=q.useRef(null),S=q.useCallback(async(O=!1)=>{try{const[Q,X]=await Promise.all([fetch(`/api/claude-accounts${O?"?refresh=1":""}`),fetch("/api/cswap-auto")]);Q.ok&&i(await Q.json()),X.ok&&o(await X.json())}catch{}},[]),k=q.useCallback(async(O,Q)=>{d(Q),y(null);try{const R=await(await fetch("/api/cswap-auto",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})).json().catch(()=>null);return R!=null&&R.ok||y((R==null?void 0:R.detail)||(R==null?void 0:R.reason)||"command failed"),R}catch{return y("server unreachable"),null}finally{d(null)}},[]);q.useEffect(()=>(S(!0),_.current=window.setInterval(()=>S(!1),p3),()=>{_.current!=null&&window.clearInterval(_.current)}),[S]),q.useEffect(()=>{const O=window.setInterval(()=>C(Math.floor(Date.now()/1e3)),3e4);return()=>window.clearInterval(O)},[]);const b=((P=s==null?void 0:s.settings["autoswitch.threshold"])==null?void 0:P.value)??"90",E=(B=n==null?void 0:n.accounts)==null?void 0:B.find(O=>O.active),N=E!=null&&E.lanes.length?Math.max(...E.lanes.map(O=>O.pct)):null,j=N!=null&&N>=Number(b)-15,I=async O=>{h(O),y(null);try{const X=await(await fetch("/api/claude-accounts/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({account:O})})).json().catch(()=>null);X!=null&&X.ok||y((X==null?void 0:X.output)||(X==null?void 0:X.reason)||"switch failed"),await S(!0)}catch{y("server unreachable")}finally{h(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:()=>S(!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:[(M=n.accounts)==null?void 0:M.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:p!=null||O.disabled,onClick:()=>I(O.num),title:O.disabled?"Held out of rotation":`Switch to ${O.alias??O.email}`,children:p===O.num?"…":"switch"})]}),O.lanes.length>0?O.lanes.map(Q=>v.jsx(w3,{lane:Q,nowSec:x},Q.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:y3(O.error)}),O.fetchedAt?v.jsx("span",{className:O.stale?"ap-stale":void 0,children:zw(O.fetchedAt,x)}):v.jsx("span",{className:"ap-stale",children:"never fetched"}),((s==null?void 0:s.enabled)||(s==null?void 0:s.external))&&!O.active&&v.jsx("button",{type:"button",className:"ap-rotate",disabled:c!=null,onClick:()=>k({action:"account",account:O.num,enabled:O.disabled},`rot-${O.num}`).then(()=>S(!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.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"}),s.external?v.jsxs("span",{className:"ap-auto-state live",title:"A cswap auto loop is running in your terminal. Stop it there to control auto-switching from here.",children:[v.jsx("i",{className:"ap-pulse","aria-hidden":!0})," live"]}):v.jsxs("button",{type:"button",className:`ap-auto-state toggle${s.enabled?" live":""}`,role:"switch","aria-checked":s.enabled,disabled:c!=null,onClick:()=>k({action:"enable",enabled:!s.enabled},"enable").then(()=>S(!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?"live":"off"]})]}),s.external&&v.jsx("p",{className:"ap-auto-note",children:"Started from your terminal — stop it there to control it here."}),v.jsxs("div",{className:"ap-auto-row",children:[v.jsx("span",{className:"ap-auto-key",children:"switch when"}),N!=null&&v.jsxs("span",{className:`ap-auto-now${j?" near":""}`,children:["now ",Math.round(N),"%"]}),v.jsx("span",{className:"ap-field",children:v.jsx("select",{"aria-label":"Switch threshold",value:b,disabled:c!=null,onChange:O=>k({action:"setting",key:"autoswitch.threshold",value:O.target.value},"threshold").then(()=>S(!0)),children:m3.map(O=>v.jsxs("option",{value:O,children:[O,"%"]},O))})})]}),v.jsxs("div",{className:"ap-auto-row",children:[v.jsx("span",{className:"ap-auto-key",children:"switch to"}),v.jsx("span",{className:"ap-field",children:v.jsxs("select",{"aria-label":"Target account strategy",value:((F=s.settings["autoswitch.strategy"])==null?void 0:F.value)??"best",disabled:c!=null,onChange:O=>k({action:"setting",key:"autoswitch.strategy",value:O.target.value},"strategy").then(()=>S(!0)),children:[v.jsx("option",{value:"best",children:"most quota left"}),v.jsx("option",{value:"consume-first",children:"soonest reset"})]})})]}),v.jsxs("div",{className:"ap-auto-foot",children:[v.jsx("button",{type:"button",className:"ap-auto-dry",disabled:c!=null,onClick:async()=>l(await k({action:"preview"},"preview")),title:"Evaluate a switch without performing one",children:c==="preview"?"checking…":"dry run"}),u!=null&&u.ok?v.jsx("span",{className:`ap-auto-result${u.event==="switch"?" would":""}`,children:v3(u)}):s.lastTick?v.jsxs("span",{className:"ap-auto-result",children:["checked ",zw(s.lastTick.at,x)]}):null]})]}),m&&v.jsx("div",{className:"ap-failure",children:m}),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 reads what claude-swap already collected.",children:"Read from claude-swap, not polled."})]}):v.jsxs("div",{className:"ap-empty",children:[v.jsx("span",{children:"No accounts found."}),v.jsx("span",{className:"ap-hint",children:n.reason==="no_store"?"This panel reads claude-swap's store. Install it with uv tool install claude-swap, then run cswap add.":"claude-swap's store could not be read."})]})]})}function ui(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 Bw(e){return e.replace(/^anthropic\./,"").replace(/^claude-/,"").replace(/-\d{8}$/,"")}function Fa(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 _3(e){return new Date(Date.now()-(e-1)*864e5).toISOString().slice(0,10).replace(/-/g,"")}const S3=[7,14,30,90];function b3(e){const[n,i]=q.useState(null),[s,o]=q.useState(!1),u=(l=!1)=>{o(!0);const d=`/api/ccusage?since=${_3(e)}${l?"&refresh=1":""}`;fetch(d).then(p=>p.json()).then(i).catch(()=>i({ok:!1,error:"request failed"})).finally(()=>o(!1))};return q.useEffect(()=>{u(!1)},[e]),{data:n,loading:s,reload:()=>u(!0)}}function k3({onClose:e}){var k,b;const[n,i]=q.useState(30),[s,o]=q.useState(null),{data:u,loading:l,reload:c}=b3(n);q.useEffect(()=>{const E=N=>{N.key==="Escape"&&e()};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[e]);const d=u!=null&&u.ok?u.days??[]:[],p=q.useMemo(()=>d.reduce((E,N)=>Math.max(E,N.totalCost),0),[d]),{totalCost:h,totalTok:m,inOut:y,cacheRead:x,modelCosts:C}=q.useMemo(()=>{let E=0,N=0,j=0,I=0;const P=new Map;for(const B of d){E+=B.totalCost,N+=B.totalTokens,j+=B.inputTokens+B.outputTokens,I+=B.cacheReadTokens;for(const M of B.modelBreakdowns)P.set(M.modelName,(P.get(M.modelName)??0)+M.cost)}return{totalCost:E,totalTok:N,inOut:j,cacheRead:I,modelCosts:P}},[d]),_=q.useMemo(()=>Array.from(C.entries()).sort((E,N)=>N[1]-E[1]),[C]),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:S3.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:"×"})]}),l&&d.length===0?v.jsx("div",{className:"uh-status",children:"running ccusage… (first run downloads the package)"}):u&&!u.ok?v.jsxs("div",{className:"uh-status uh-err",children:["ccusage failed: ",u.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(za,{label:"total cost",val:$e(h),accent:!0}),v.jsx(za,{label:"tokens",val:ui(m)}),v.jsx(za,{label:"input+output",val:ui(y)}),v.jsx(za,{label:"cache reads",val:ui(x)})]}),v.jsx("div",{className:"uh-chart",role:"img","aria-label":"Daily cost by model",children:d.map(E=>{const N=p>0?E.totalCost/p*100:0,j=E.period===s;return v.jsxs("button",{className:`uh-bar-col${j?" sel":""}`,onClick:()=>o(j?null:E.period),title:`${E.period} · ${$e(E.totalCost)}`,style:{flexBasis:`${100/d.length}%`},children:[v.jsx("div",{className:"uh-bar",style:{height:`${Math.max(N,E.totalCost>0?2:0)}%`},children:E.modelBreakdowns.slice().sort((I,P)=>P.cost-I.cost).map(I=>{const P=E.totalCost>0?I.cost/E.totalCost*100:0;return v.jsx("div",{className:"uh-bar-seg",style:{height:`${P}%`,background:Fa(I.modelName)}},I.modelName)})}),v.jsx("span",{className:"uh-bar-label",children:E.period.slice(5)})]},E.period)})}),v.jsx("div",{className:"uh-legend",children:_.map(([E,N])=>v.jsxs("span",{className:"uh-legend-item",children:[v.jsx("span",{className:"uh-legend-dot",style:{background:Fa(E)}}),Bw(E)," ",v.jsx("span",{className:"uh-legend-cost",children:$e(N)})]},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:$e(S.totalCost)}),(b=(k=S.metadata)==null?void 0:k.agents)!=null&&b.length?v.jsx("span",{className:"uh-detail-agents",children:S.metadata.agents.join(" · ")}):null]}),v.jsxs("div",{className:"uh-detail-mini",children:[v.jsx(Ba,{label:"input",val:ui(S.inputTokens)}),v.jsx(Ba,{label:"output",val:ui(S.outputTokens)}),v.jsx(Ba,{label:"cache write",val:ui(S.cacheCreationTokens)}),v.jsx(Ba,{label:"cache read",val:ui(S.cacheReadTokens)})]}),v.jsx("div",{className:"uh-detail-models",children:S.modelBreakdowns.slice().sort((E,N)=>N.cost-E.cost).map(E=>{const N=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:Fa(E.modelName)}}),Bw(E.modelName)]}),v.jsx("span",{className:"uh-model-bar",children:v.jsx("span",{className:"uh-model-bar-fill",style:{width:`${N}%`,background:Fa(E.modelName)}})}),v.jsx("span",{className:"uh-model-cost",children:$e(E.cost)})]},E.modelName)})})]})]})]})})}function za({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 Ba({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 Dg(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 Ac,Uw;function E3(){if(Uw)return Ac;Uw=1;function e(){this.__data__=[],this.size=0}return Ac=e,Ac}var Ic,Hw;function as(){if(Hw)return Ic;Hw=1;function e(n,i){return n===i||n!==n&&i!==i}return Ic=e,Ic}var Mc,Vw;function mu(){if(Vw)return Mc;Vw=1;var e=as();function n(i,s){for(var o=i.length;o--;)if(e(i[o][0],s))return o;return-1}return Mc=n,Mc}var Pc,Ww;function N3(){if(Ww)return Pc;Ww=1;var e=mu(),n=Array.prototype,i=n.splice;function s(o){var u=this.__data__,l=e(u,o);if(l<0)return!1;var c=u.length-1;return l==c?u.pop():i.call(u,l,1),--this.size,!0}return Pc=s,Pc}var qc,Gw;function C3(){if(Gw)return qc;Gw=1;var e=mu();function n(i){var s=this.__data__,o=e(s,i);return o<0?void 0:s[o][1]}return qc=n,qc}var Oc,Kw;function T3(){if(Kw)return Oc;Kw=1;var e=mu();function n(i){return e(this.__data__,i)>-1}return Oc=n,Oc}var Lc,Yw;function R3(){if(Yw)return Lc;Yw=1;var e=mu();function n(i,s){var o=this.__data__,u=e(o,i);return u<0?(++this.size,o.push([i,s])):o[u][1]=s,this}return Lc=n,Lc}var $c,Xw;function gu(){if(Xw)return $c;Xw=1;var e=E3(),n=N3(),i=C3(),s=T3(),o=R3();function u(l){var c=-1,d=l==null?0:l.length;for(this.clear();++c<d;){var p=l[c];this.set(p[0],p[1])}}return u.prototype.clear=e,u.prototype.delete=n,u.prototype.get=i,u.prototype.has=s,u.prototype.set=o,$c=u,$c}var Dc,Qw;function j3(){if(Qw)return Dc;Qw=1;var e=gu();function n(){this.__data__=new e,this.size=0}return Dc=n,Dc}var Fc,Zw;function A3(){if(Zw)return Fc;Zw=1;function e(n){var i=this.__data__,s=i.delete(n);return this.size=i.size,s}return Fc=e,Fc}var zc,Jw;function I3(){if(Jw)return zc;Jw=1;function e(n){return this.__data__.get(n)}return zc=e,zc}var Bc,ex;function M3(){if(ex)return Bc;ex=1;function e(n){return this.__data__.has(n)}return Bc=e,Bc}var Uc,tx;function GE(){if(tx)return Uc;tx=1;var e=typeof Ta=="object"&&Ta&&Ta.Object===Object&&Ta;return Uc=e,Uc}var Hc,nx;function Ln(){if(nx)return Hc;nx=1;var e=GE(),n=typeof self=="object"&&self&&self.Object===Object&&self,i=e||n||Function("return this")();return Hc=i,Hc}var Vc,rx;function us(){if(rx)return Vc;rx=1;var e=Ln(),n=e.Symbol;return Vc=n,Vc}var Wc,ix;function P3(){if(ix)return Wc;ix=1;var e=us(),n=Object.prototype,i=n.hasOwnProperty,s=n.toString,o=e?e.toStringTag:void 0;function u(l){var c=i.call(l,o),d=l[o];try{l[o]=void 0;var p=!0}catch{}var h=s.call(l);return p&&(c?l[o]=d:delete l[o]),h}return Wc=u,Wc}var Gc,sx;function q3(){if(sx)return Gc;sx=1;var e=Object.prototype,n=e.toString;function i(s){return n.call(s)}return Gc=i,Gc}var Kc,ox;function vi(){if(ox)return Kc;ox=1;var e=us(),n=P3(),i=q3(),s="[object Null]",o="[object Undefined]",u=e?e.toStringTag:void 0;function l(c){return c==null?c===void 0?o:s:u&&u in Object(c)?n(c):i(c)}return Kc=l,Kc}var Yc,ax;function Sn(){if(ax)return Yc;ax=1;function e(n){var i=typeof n;return n!=null&&(i=="object"||i=="function")}return Yc=e,Yc}var Xc,ux;function xo(){if(ux)return Xc;ux=1;var e=vi(),n=Sn(),i="[object AsyncFunction]",s="[object Function]",o="[object GeneratorFunction]",u="[object Proxy]";function l(c){if(!n(c))return!1;var d=e(c);return d==s||d==o||d==i||d==u}return Xc=l,Xc}var Qc,lx;function O3(){if(lx)return Qc;lx=1;var e=Ln(),n=e["__core-js_shared__"];return Qc=n,Qc}var Zc,cx;function L3(){if(cx)return Zc;cx=1;var e=O3(),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 Zc=i,Zc}var Jc,fx;function KE(){if(fx)return Jc;fx=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 Jc=i,Jc}var ef,dx;function $3(){if(dx)return ef;dx=1;var e=xo(),n=L3(),i=Sn(),s=KE(),o=/[\\^$.*+?()[\]{}|]/g,u=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,d=l.toString,p=c.hasOwnProperty,h=RegExp("^"+d.call(p).replace(o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function m(y){if(!i(y)||n(y))return!1;var x=e(y)?h:u;return x.test(s(y))}return ef=m,ef}var tf,hx;function D3(){if(hx)return tf;hx=1;function e(n,i){return n==null?void 0:n[i]}return tf=e,tf}var nf,px;function yi(){if(px)return nf;px=1;var e=$3(),n=D3();function i(s,o){var u=n(s,o);return e(u)?u:void 0}return nf=i,nf}var rf,mx;function Fg(){if(mx)return rf;mx=1;var e=yi(),n=Ln(),i=e(n,"Map");return rf=i,rf}var sf,gx;function vu(){if(gx)return sf;gx=1;var e=yi(),n=e(Object,"create");return sf=n,sf}var of,vx;function F3(){if(vx)return of;vx=1;var e=vu();function n(){this.__data__=e?e(null):{},this.size=0}return of=n,of}var af,yx;function z3(){if(yx)return af;yx=1;function e(n){var i=this.has(n)&&delete this.__data__[n];return this.size-=i?1:0,i}return af=e,af}var uf,wx;function B3(){if(wx)return uf;wx=1;var e=vu(),n="__lodash_hash_undefined__",i=Object.prototype,s=i.hasOwnProperty;function o(u){var l=this.__data__;if(e){var c=l[u];return c===n?void 0:c}return s.call(l,u)?l[u]:void 0}return uf=o,uf}var lf,xx;function U3(){if(xx)return lf;xx=1;var e=vu(),n=Object.prototype,i=n.hasOwnProperty;function s(o){var u=this.__data__;return e?u[o]!==void 0:i.call(u,o)}return lf=s,lf}var cf,_x;function H3(){if(_x)return cf;_x=1;var e=vu(),n="__lodash_hash_undefined__";function i(s,o){var u=this.__data__;return this.size+=this.has(s)?0:1,u[s]=e&&o===void 0?n:o,this}return cf=i,cf}var ff,Sx;function V3(){if(Sx)return ff;Sx=1;var e=F3(),n=z3(),i=B3(),s=U3(),o=H3();function u(l){var c=-1,d=l==null?0:l.length;for(this.clear();++c<d;){var p=l[c];this.set(p[0],p[1])}}return u.prototype.clear=e,u.prototype.delete=n,u.prototype.get=i,u.prototype.has=s,u.prototype.set=o,ff=u,ff}var df,bx;function W3(){if(bx)return df;bx=1;var e=V3(),n=gu(),i=Fg();function s(){this.size=0,this.__data__={hash:new e,map:new(i||n),string:new e}}return df=s,df}var hf,kx;function G3(){if(kx)return hf;kx=1;function e(n){var i=typeof n;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?n!=="__proto__":n===null}return hf=e,hf}var pf,Ex;function yu(){if(Ex)return pf;Ex=1;var e=G3();function n(i,s){var o=i.__data__;return e(s)?o[typeof s=="string"?"string":"hash"]:o.map}return pf=n,pf}var mf,Nx;function K3(){if(Nx)return mf;Nx=1;var e=yu();function n(i){var s=e(this,i).delete(i);return this.size-=s?1:0,s}return mf=n,mf}var gf,Cx;function Y3(){if(Cx)return gf;Cx=1;var e=yu();function n(i){return e(this,i).get(i)}return gf=n,gf}var vf,Tx;function X3(){if(Tx)return vf;Tx=1;var e=yu();function n(i){return e(this,i).has(i)}return vf=n,vf}var yf,Rx;function Q3(){if(Rx)return yf;Rx=1;var e=yu();function n(i,s){var o=e(this,i),u=o.size;return o.set(i,s),this.size+=o.size==u?0:1,this}return yf=n,yf}var wf,jx;function zg(){if(jx)return wf;jx=1;var e=W3(),n=K3(),i=Y3(),s=X3(),o=Q3();function u(l){var c=-1,d=l==null?0:l.length;for(this.clear();++c<d;){var p=l[c];this.set(p[0],p[1])}}return u.prototype.clear=e,u.prototype.delete=n,u.prototype.get=i,u.prototype.has=s,u.prototype.set=o,wf=u,wf}var xf,Ax;function Z3(){if(Ax)return xf;Ax=1;var e=gu(),n=Fg(),i=zg(),s=200;function o(u,l){var c=this.__data__;if(c instanceof e){var d=c.__data__;if(!n||d.length<s-1)return d.push([u,l]),this.size=++c.size,this;c=this.__data__=new i(d)}return c.set(u,l),this.size=c.size,this}return xf=o,xf}var _f,Ix;function wu(){if(Ix)return _f;Ix=1;var e=gu(),n=j3(),i=A3(),s=I3(),o=M3(),u=Z3();function l(c){var d=this.__data__=new e(c);this.size=d.size}return l.prototype.clear=n,l.prototype.delete=i,l.prototype.get=s,l.prototype.has=o,l.prototype.set=u,_f=l,_f}var Sf,Mx;function Bg(){if(Mx)return Sf;Mx=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 Sf=e,Sf}var bf,Px;function YE(){if(Px)return bf;Px=1;var e=yi(),n=(function(){try{var i=e(Object,"defineProperty");return i({},"",{}),i}catch{}})();return bf=n,bf}var kf,qx;function xu(){if(qx)return kf;qx=1;var e=YE();function n(i,s,o){s=="__proto__"&&e?e(i,s,{configurable:!0,enumerable:!0,value:o,writable:!0}):i[s]=o}return kf=n,kf}var Ef,Ox;function _u(){if(Ox)return Ef;Ox=1;var e=xu(),n=as(),i=Object.prototype,s=i.hasOwnProperty;function o(u,l,c){var d=u[l];(!(s.call(u,l)&&n(d,c))||c===void 0&&!(l in u))&&e(u,l,c)}return Ef=o,Ef}var Nf,Lx;function _o(){if(Lx)return Nf;Lx=1;var e=_u(),n=xu();function i(s,o,u,l){var c=!u;u||(u={});for(var d=-1,p=o.length;++d<p;){var h=o[d],m=l?l(u[h],s[h],h,u,s):void 0;m===void 0&&(m=s[h]),c?n(u,h,m):e(u,h,m)}return u}return Nf=i,Nf}var Cf,$x;function J3(){if($x)return Cf;$x=1;function e(n,i){for(var s=-1,o=Array(n);++s<n;)o[s]=i(s);return o}return Cf=e,Cf}var Tf,Dx;function Wn(){if(Dx)return Tf;Dx=1;function e(n){return n!=null&&typeof n=="object"}return Tf=e,Tf}var Rf,Fx;function eq(){if(Fx)return Rf;Fx=1;var e=vi(),n=Wn(),i="[object Arguments]";function s(o){return n(o)&&e(o)==i}return Rf=s,Rf}var jf,zx;function So(){if(zx)return jf;zx=1;var e=eq(),n=Wn(),i=Object.prototype,s=i.hasOwnProperty,o=i.propertyIsEnumerable,u=e((function(){return arguments})())?e:function(l){return n(l)&&s.call(l,"callee")&&!o.call(l,"callee")};return jf=u,jf}var Af,Bx;function yt(){if(Bx)return Af;Bx=1;var e=Array.isArray;return Af=e,Af}var to={exports:{}},If,Ux;function tq(){if(Ux)return If;Ux=1;function e(){return!1}return If=e,If}to.exports;var Hx;function ls(){return Hx||(Hx=1,(function(e,n){var i=Ln(),s=tq(),o=n&&!n.nodeType&&n,u=o&&!0&&e&&!e.nodeType&&e,l=u&&u.exports===o,c=l?i.Buffer:void 0,d=c?c.isBuffer:void 0,p=d||s;e.exports=p})(to,to.exports)),to.exports}var Mf,Vx;function Su(){if(Vx)return Mf;Vx=1;var e=9007199254740991,n=/^(?:0|[1-9]\d*)$/;function i(s,o){var u=typeof s;return o=o??e,!!o&&(u=="number"||u!="symbol"&&n.test(s))&&s>-1&&s%1==0&&s<o}return Mf=i,Mf}var Pf,Wx;function Ug(){if(Wx)return Pf;Wx=1;var e=9007199254740991;function n(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=e}return Pf=n,Pf}var qf,Gx;function nq(){if(Gx)return qf;Gx=1;var e=vi(),n=Ug(),i=Wn(),s="[object Arguments]",o="[object Array]",u="[object Boolean]",l="[object Date]",c="[object Error]",d="[object Function]",p="[object Map]",h="[object Number]",m="[object Object]",y="[object RegExp]",x="[object Set]",C="[object String]",_="[object WeakMap]",S="[object ArrayBuffer]",k="[object DataView]",b="[object Float32Array]",E="[object Float64Array]",N="[object Int8Array]",j="[object Int16Array]",I="[object Int32Array]",P="[object Uint8Array]",B="[object Uint8ClampedArray]",M="[object Uint16Array]",F="[object Uint32Array]",O={};O[b]=O[E]=O[N]=O[j]=O[I]=O[P]=O[B]=O[M]=O[F]=!0,O[s]=O[o]=O[S]=O[u]=O[k]=O[l]=O[c]=O[d]=O[p]=O[h]=O[m]=O[y]=O[x]=O[C]=O[_]=!1;function Q(X){return i(X)&&n(X.length)&&!!O[e(X)]}return qf=Q,qf}var Of,Kx;function bu(){if(Kx)return Of;Kx=1;function e(n){return function(i){return n(i)}}return Of=e,Of}var no={exports:{}};no.exports;var Yx;function Hg(){return Yx||(Yx=1,(function(e,n){var i=GE(),s=n&&!n.nodeType&&n,o=s&&!0&&e&&!e.nodeType&&e,u=o&&o.exports===s,l=u&&i.process,c=(function(){try{var d=o&&o.require&&o.require("util").types;return d||l&&l.binding&&l.binding("util")}catch{}})();e.exports=c})(no,no.exports)),no.exports}var Lf,Xx;function bo(){if(Xx)return Lf;Xx=1;var e=nq(),n=bu(),i=Hg(),s=i&&i.isTypedArray,o=s?n(s):e;return Lf=o,Lf}var $f,Qx;function XE(){if(Qx)return $f;Qx=1;var e=J3(),n=So(),i=yt(),s=ls(),o=Su(),u=bo(),l=Object.prototype,c=l.hasOwnProperty;function d(p,h){var m=i(p),y=!m&&n(p),x=!m&&!y&&s(p),C=!m&&!y&&!x&&u(p),_=m||y||x||C,S=_?e(p.length,String):[],k=S.length;for(var b in p)(h||c.call(p,b))&&!(_&&(b=="length"||x&&(b=="offset"||b=="parent")||C&&(b=="buffer"||b=="byteLength"||b=="byteOffset")||o(b,k)))&&S.push(b);return S}return $f=d,$f}var Df,Zx;function ku(){if(Zx)return Df;Zx=1;var e=Object.prototype;function n(i){var s=i&&i.constructor,o=typeof s=="function"&&s.prototype||e;return i===o}return Df=n,Df}var Ff,Jx;function QE(){if(Jx)return Ff;Jx=1;function e(n,i){return function(s){return n(i(s))}}return Ff=e,Ff}var zf,e1;function rq(){if(e1)return zf;e1=1;var e=QE(),n=e(Object.keys,Object);return zf=n,zf}var Bf,t1;function Vg(){if(t1)return Bf;t1=1;var e=ku(),n=rq(),i=Object.prototype,s=i.hasOwnProperty;function o(u){if(!e(u))return n(u);var l=[];for(var c in Object(u))s.call(u,c)&&c!="constructor"&&l.push(c);return l}return Bf=o,Bf}var Uf,n1;function hr(){if(n1)return Uf;n1=1;var e=xo(),n=Ug();function i(s){return s!=null&&n(s.length)&&!e(s)}return Uf=i,Uf}var Hf,r1;function Hr(){if(r1)return Hf;r1=1;var e=XE(),n=Vg(),i=hr();function s(o){return i(o)?e(o):n(o)}return Hf=s,Hf}var Vf,i1;function iq(){if(i1)return Vf;i1=1;var e=_o(),n=Hr();function i(s,o){return s&&e(o,n(o),s)}return Vf=i,Vf}var Wf,s1;function sq(){if(s1)return Wf;s1=1;function e(n){var i=[];if(n!=null)for(var s in Object(n))i.push(s);return i}return Wf=e,Wf}var Gf,o1;function oq(){if(o1)return Gf;o1=1;var e=Sn(),n=ku(),i=sq(),s=Object.prototype,o=s.hasOwnProperty;function u(l){if(!e(l))return i(l);var c=n(l),d=[];for(var p in l)p=="constructor"&&(c||!o.call(l,p))||d.push(p);return d}return Gf=u,Gf}var Kf,a1;function wi(){if(a1)return Kf;a1=1;var e=XE(),n=oq(),i=hr();function s(o){return i(o)?e(o,!0):n(o)}return Kf=s,Kf}var Yf,u1;function aq(){if(u1)return Yf;u1=1;var e=_o(),n=wi();function i(s,o){return s&&e(o,n(o),s)}return Yf=i,Yf}var ro={exports:{}};ro.exports;var l1;function ZE(){return l1||(l1=1,(function(e,n){var i=Ln(),s=n&&!n.nodeType&&n,o=s&&!0&&e&&!e.nodeType&&e,u=o&&o.exports===s,l=u?i.Buffer:void 0,c=l?l.allocUnsafe:void 0;function d(p,h){if(h)return p.slice();var m=p.length,y=c?c(m):new p.constructor(m);return p.copy(y),y}e.exports=d})(ro,ro.exports)),ro.exports}var Xf,c1;function JE(){if(c1)return Xf;c1=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 Xf=e,Xf}var Qf,f1;function eN(){if(f1)return Qf;f1=1;function e(n,i){for(var s=-1,o=n==null?0:n.length,u=0,l=[];++s<o;){var c=n[s];i(c,s,n)&&(l[u++]=c)}return l}return Qf=e,Qf}var Zf,d1;function tN(){if(d1)return Zf;d1=1;function e(){return[]}return Zf=e,Zf}var Jf,h1;function Wg(){if(h1)return Jf;h1=1;var e=eN(),n=tN(),i=Object.prototype,s=i.propertyIsEnumerable,o=Object.getOwnPropertySymbols,u=o?function(l){return l==null?[]:(l=Object(l),e(o(l),function(c){return s.call(l,c)}))}:n;return Jf=u,Jf}var ed,p1;function uq(){if(p1)return ed;p1=1;var e=_o(),n=Wg();function i(s,o){return e(s,n(s),o)}return ed=i,ed}var td,m1;function Gg(){if(m1)return td;m1=1;function e(n,i){for(var s=-1,o=i.length,u=n.length;++s<o;)n[u+s]=i[s];return n}return td=e,td}var nd,g1;function Eu(){if(g1)return nd;g1=1;var e=QE(),n=e(Object.getPrototypeOf,Object);return nd=n,nd}var rd,v1;function nN(){if(v1)return rd;v1=1;var e=Gg(),n=Eu(),i=Wg(),s=tN(),o=Object.getOwnPropertySymbols,u=o?function(l){for(var c=[];l;)e(c,i(l)),l=n(l);return c}:s;return rd=u,rd}var id,y1;function lq(){if(y1)return id;y1=1;var e=_o(),n=nN();function i(s,o){return e(s,n(s),o)}return id=i,id}var sd,w1;function rN(){if(w1)return sd;w1=1;var e=Gg(),n=yt();function i(s,o,u){var l=o(s);return n(s)?l:e(l,u(s))}return sd=i,sd}var od,x1;function iN(){if(x1)return od;x1=1;var e=rN(),n=Wg(),i=Hr();function s(o){return e(o,i,n)}return od=s,od}var ad,_1;function cq(){if(_1)return ad;_1=1;var e=rN(),n=nN(),i=wi();function s(o){return e(o,i,n)}return ad=s,ad}var ud,S1;function fq(){if(S1)return ud;S1=1;var e=yi(),n=Ln(),i=e(n,"DataView");return ud=i,ud}var ld,b1;function dq(){if(b1)return ld;b1=1;var e=yi(),n=Ln(),i=e(n,"Promise");return ld=i,ld}var cd,k1;function sN(){if(k1)return cd;k1=1;var e=yi(),n=Ln(),i=e(n,"Set");return cd=i,cd}var fd,E1;function hq(){if(E1)return fd;E1=1;var e=yi(),n=Ln(),i=e(n,"WeakMap");return fd=i,fd}var dd,N1;function cs(){if(N1)return dd;N1=1;var e=fq(),n=Fg(),i=dq(),s=sN(),o=hq(),u=vi(),l=KE(),c="[object Map]",d="[object Object]",p="[object Promise]",h="[object Set]",m="[object WeakMap]",y="[object DataView]",x=l(e),C=l(n),_=l(i),S=l(s),k=l(o),b=u;return(e&&b(new e(new ArrayBuffer(1)))!=y||n&&b(new n)!=c||i&&b(i.resolve())!=p||s&&b(new s)!=h||o&&b(new o)!=m)&&(b=function(E){var N=u(E),j=N==d?E.constructor:void 0,I=j?l(j):"";if(I)switch(I){case x:return y;case C:return c;case _:return p;case S:return h;case k:return m}return N}),dd=b,dd}var hd,C1;function pq(){if(C1)return hd;C1=1;var e=Object.prototype,n=e.hasOwnProperty;function i(s){var o=s.length,u=new s.constructor(o);return o&&typeof s[0]=="string"&&n.call(s,"index")&&(u.index=s.index,u.input=s.input),u}return hd=i,hd}var pd,T1;function oN(){if(T1)return pd;T1=1;var e=Ln(),n=e.Uint8Array;return pd=n,pd}var md,R1;function Kg(){if(R1)return md;R1=1;var e=oN();function n(i){var s=new i.constructor(i.byteLength);return new e(s).set(new e(i)),s}return md=n,md}var gd,j1;function mq(){if(j1)return gd;j1=1;var e=Kg();function n(i,s){var o=s?e(i.buffer):i.buffer;return new i.constructor(o,i.byteOffset,i.byteLength)}return gd=n,gd}var vd,A1;function gq(){if(A1)return vd;A1=1;var e=/\w*$/;function n(i){var s=new i.constructor(i.source,e.exec(i));return s.lastIndex=i.lastIndex,s}return vd=n,vd}var yd,I1;function vq(){if(I1)return yd;I1=1;var e=us(),n=e?e.prototype:void 0,i=n?n.valueOf:void 0;function s(o){return i?Object(i.call(o)):{}}return yd=s,yd}var wd,M1;function aN(){if(M1)return wd;M1=1;var e=Kg();function n(i,s){var o=s?e(i.buffer):i.buffer;return new i.constructor(o,i.byteOffset,i.length)}return wd=n,wd}var xd,P1;function yq(){if(P1)return xd;P1=1;var e=Kg(),n=mq(),i=gq(),s=vq(),o=aN(),u="[object Boolean]",l="[object Date]",c="[object Map]",d="[object Number]",p="[object RegExp]",h="[object Set]",m="[object String]",y="[object Symbol]",x="[object ArrayBuffer]",C="[object DataView]",_="[object Float32Array]",S="[object Float64Array]",k="[object Int8Array]",b="[object Int16Array]",E="[object Int32Array]",N="[object Uint8Array]",j="[object Uint8ClampedArray]",I="[object Uint16Array]",P="[object Uint32Array]";function B(M,F,O){var Q=M.constructor;switch(F){case x:return e(M);case u:case l:return new Q(+M);case C:return n(M,O);case _:case S:case k:case b:case E:case N:case j:case I:case P:return o(M,O);case c:return new Q;case d:case m:return new Q(M);case p:return i(M);case h:return new Q;case y:return s(M)}}return xd=B,xd}var _d,q1;function uN(){if(q1)return _d;q1=1;var e=Sn(),n=Object.create,i=(function(){function s(){}return function(o){if(!e(o))return{};if(n)return n(o);s.prototype=o;var u=new s;return s.prototype=void 0,u}})();return _d=i,_d}var Sd,O1;function lN(){if(O1)return Sd;O1=1;var e=uN(),n=Eu(),i=ku();function s(o){return typeof o.constructor=="function"&&!i(o)?e(n(o)):{}}return Sd=s,Sd}var bd,L1;function wq(){if(L1)return bd;L1=1;var e=cs(),n=Wn(),i="[object Map]";function s(o){return n(o)&&e(o)==i}return bd=s,bd}var kd,$1;function xq(){if($1)return kd;$1=1;var e=wq(),n=bu(),i=Hg(),s=i&&i.isMap,o=s?n(s):e;return kd=o,kd}var Ed,D1;function _q(){if(D1)return Ed;D1=1;var e=cs(),n=Wn(),i="[object Set]";function s(o){return n(o)&&e(o)==i}return Ed=s,Ed}var Nd,F1;function Sq(){if(F1)return Nd;F1=1;var e=_q(),n=bu(),i=Hg(),s=i&&i.isSet,o=s?n(s):e;return Nd=o,Nd}var Cd,z1;function cN(){if(z1)return Cd;z1=1;var e=wu(),n=Bg(),i=_u(),s=iq(),o=aq(),u=ZE(),l=JE(),c=uq(),d=lq(),p=iN(),h=cq(),m=cs(),y=pq(),x=yq(),C=lN(),_=yt(),S=ls(),k=xq(),b=Sn(),E=Sq(),N=Hr(),j=wi(),I=1,P=2,B=4,M="[object Arguments]",F="[object Array]",O="[object Boolean]",Q="[object Date]",X="[object Error]",R="[object Function]",K="[object GeneratorFunction]",H="[object Map]",te="[object Number]",Y="[object Object]",$="[object RegExp]",G="[object Set]",A="[object String]",z="[object Symbol]",ae="[object WeakMap]",D="[object ArrayBuffer]",V="[object DataView]",J="[object Float32Array]",se="[object Float64Array]",ue="[object Int8Array]",he="[object Int16Array]",me="[object Int32Array]",je="[object Uint8Array]",De="[object Uint8ClampedArray]",Me="[object Uint16Array]",Ie="[object Uint32Array]",ke={};ke[M]=ke[F]=ke[D]=ke[V]=ke[O]=ke[Q]=ke[J]=ke[se]=ke[ue]=ke[he]=ke[me]=ke[H]=ke[te]=ke[Y]=ke[$]=ke[G]=ke[A]=ke[z]=ke[je]=ke[De]=ke[Me]=ke[Ie]=!0,ke[X]=ke[R]=ke[ae]=!1;function Ge(ye,ge,Ue,mt,wt,st){var Ke,Be=ge&I,Et=ge&P,ft=ge&B;if(Ue&&(Ke=wt?Ue(ye,mt,wt,st):Ue(ye)),Ke!==void 0)return Ke;if(!b(ye))return ye;var Nt=_(ye);if(Nt){if(Ke=y(ye),!Be)return l(ye,Ke)}else{var ot=m(ye),Dt=ot==R||ot==K;if(S(ye))return u(ye,Be);if(ot==Y||ot==M||Dt&&!wt){if(Ke=Et||Dt?{}:C(ye),!Be)return Et?d(ye,o(Ke,ye)):c(ye,s(Ke,ye))}else{if(!ke[ot])return wt?ye:{};Ke=x(ye,ot,Be)}}st||(st=new e);var xt=st.get(ye);if(xt)return xt;st.set(ye,Ke),E(ye)?ye.forEach(function(at){Ke.add(Ge(at,ge,Ue,at,ye,st))}):k(ye)&&ye.forEach(function(at,dt){Ke.set(dt,Ge(at,ge,Ue,dt,ye,st))});var We=ft?Et?h:p:Et?j:N,Ze=Nt?void 0:We(ye);return n(Ze||ye,function(at,dt){Ze&&(dt=at,at=ye[dt]),i(Ke,dt,Ge(at,ge,Ue,dt,ye,st))}),Ke}return Cd=Ge,Cd}var Td,B1;function bq(){if(B1)return Td;B1=1;var e=cN(),n=4;function i(s){return e(s,n)}return Td=i,Td}var Rd,U1;function Yg(){if(U1)return Rd;U1=1;function e(n){return function(){return n}}return Rd=e,Rd}var jd,H1;function kq(){if(H1)return jd;H1=1;function e(n){return function(i,s,o){for(var u=-1,l=Object(i),c=o(i),d=c.length;d--;){var p=c[n?d:++u];if(s(l[p],p,l)===!1)break}return i}}return jd=e,jd}var Ad,V1;function Xg(){if(V1)return Ad;V1=1;var e=kq(),n=e();return Ad=n,Ad}var Id,W1;function Qg(){if(W1)return Id;W1=1;var e=Xg(),n=Hr();function i(s,o){return s&&e(s,o,n)}return Id=i,Id}var Md,G1;function Eq(){if(G1)return Md;G1=1;var e=hr();function n(i,s){return function(o,u){if(o==null)return o;if(!e(o))return i(o,u);for(var l=o.length,c=s?l:-1,d=Object(o);(s?c--:++c<l)&&u(d[c],c,d)!==!1;);return o}}return Md=n,Md}var Pd,K1;function Nu(){if(K1)return Pd;K1=1;var e=Qg(),n=Eq(),i=n(e);return Pd=i,Pd}var qd,Y1;function xi(){if(Y1)return qd;Y1=1;function e(n){return n}return qd=e,qd}var Od,X1;function fN(){if(X1)return Od;X1=1;var e=xi();function n(i){return typeof i=="function"?i:e}return Od=n,Od}var Ld,Q1;function dN(){if(Q1)return Ld;Q1=1;var e=Bg(),n=Nu(),i=fN(),s=yt();function o(u,l){var c=s(u)?e:n;return c(u,i(l))}return Ld=o,Ld}var $d,Z1;function hN(){return Z1||(Z1=1,$d=dN()),$d}var Dd,J1;function Nq(){if(J1)return Dd;J1=1;var e=Nu();function n(i,s){var o=[];return e(i,function(u,l,c){s(u,l,c)&&o.push(u)}),o}return Dd=n,Dd}var Fd,e_;function Cq(){if(e_)return Fd;e_=1;var e="__lodash_hash_undefined__";function n(i){return this.__data__.set(i,e),this}return Fd=n,Fd}var zd,t_;function Tq(){if(t_)return zd;t_=1;function e(n){return this.__data__.has(n)}return zd=e,zd}var Bd,n_;function pN(){if(n_)return Bd;n_=1;var e=zg(),n=Cq(),i=Tq();function s(o){var u=-1,l=o==null?0:o.length;for(this.__data__=new e;++u<l;)this.add(o[u])}return s.prototype.add=s.prototype.push=n,s.prototype.has=i,Bd=s,Bd}var Ud,r_;function Rq(){if(r_)return Ud;r_=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 Ud=e,Ud}var Hd,i_;function mN(){if(i_)return Hd;i_=1;function e(n,i){return n.has(i)}return Hd=e,Hd}var Vd,s_;function gN(){if(s_)return Vd;s_=1;var e=pN(),n=Rq(),i=mN(),s=1,o=2;function u(l,c,d,p,h,m){var y=d&s,x=l.length,C=c.length;if(x!=C&&!(y&&C>x))return!1;var _=m.get(l),S=m.get(c);if(_&&S)return _==c&&S==l;var k=-1,b=!0,E=d&o?new e:void 0;for(m.set(l,c),m.set(c,l);++k<x;){var N=l[k],j=c[k];if(p)var I=y?p(j,N,k,c,l,m):p(N,j,k,l,c,m);if(I!==void 0){if(I)continue;b=!1;break}if(E){if(!n(c,function(P,B){if(!i(E,B)&&(N===P||h(N,P,d,p,m)))return E.push(B)})){b=!1;break}}else if(!(N===j||h(N,j,d,p,m))){b=!1;break}}return m.delete(l),m.delete(c),b}return Vd=u,Vd}var Wd,o_;function jq(){if(o_)return Wd;o_=1;function e(n){var i=-1,s=Array(n.size);return n.forEach(function(o,u){s[++i]=[u,o]}),s}return Wd=e,Wd}var Gd,a_;function Zg(){if(a_)return Gd;a_=1;function e(n){var i=-1,s=Array(n.size);return n.forEach(function(o){s[++i]=o}),s}return Gd=e,Gd}var Kd,u_;function Aq(){if(u_)return Kd;u_=1;var e=us(),n=oN(),i=as(),s=gN(),o=jq(),u=Zg(),l=1,c=2,d="[object Boolean]",p="[object Date]",h="[object Error]",m="[object Map]",y="[object Number]",x="[object RegExp]",C="[object Set]",_="[object String]",S="[object Symbol]",k="[object ArrayBuffer]",b="[object DataView]",E=e?e.prototype:void 0,N=E?E.valueOf:void 0;function j(I,P,B,M,F,O,Q){switch(B){case b:if(I.byteLength!=P.byteLength||I.byteOffset!=P.byteOffset)return!1;I=I.buffer,P=P.buffer;case k:return!(I.byteLength!=P.byteLength||!O(new n(I),new n(P)));case d:case p:case y:return i(+I,+P);case h:return I.name==P.name&&I.message==P.message;case x:case _:return I==P+"";case m:var X=o;case C:var R=M&l;if(X||(X=u),I.size!=P.size&&!R)return!1;var K=Q.get(I);if(K)return K==P;M|=c,Q.set(I,P);var H=s(X(I),X(P),M,F,O,Q);return Q.delete(I),H;case S:if(N)return N.call(I)==N.call(P)}return!1}return Kd=j,Kd}var Yd,l_;function Iq(){if(l_)return Yd;l_=1;var e=iN(),n=1,i=Object.prototype,s=i.hasOwnProperty;function o(u,l,c,d,p,h){var m=c&n,y=e(u),x=y.length,C=e(l),_=C.length;if(x!=_&&!m)return!1;for(var S=x;S--;){var k=y[S];if(!(m?k in l:s.call(l,k)))return!1}var b=h.get(u),E=h.get(l);if(b&&E)return b==l&&E==u;var N=!0;h.set(u,l),h.set(l,u);for(var j=m;++S<x;){k=y[S];var I=u[k],P=l[k];if(d)var B=m?d(P,I,k,l,u,h):d(I,P,k,u,l,h);if(!(B===void 0?I===P||p(I,P,c,d,h):B)){N=!1;break}j||(j=k=="constructor")}if(N&&!j){var M=u.constructor,F=l.constructor;M!=F&&"constructor"in u&&"constructor"in l&&!(typeof M=="function"&&M instanceof M&&typeof F=="function"&&F instanceof F)&&(N=!1)}return h.delete(u),h.delete(l),N}return Yd=o,Yd}var Xd,c_;function Mq(){if(c_)return Xd;c_=1;var e=wu(),n=gN(),i=Aq(),s=Iq(),o=cs(),u=yt(),l=ls(),c=bo(),d=1,p="[object Arguments]",h="[object Array]",m="[object Object]",y=Object.prototype,x=y.hasOwnProperty;function C(_,S,k,b,E,N){var j=u(_),I=u(S),P=j?h:o(_),B=I?h:o(S);P=P==p?m:P,B=B==p?m:B;var M=P==m,F=B==m,O=P==B;if(O&&l(_)){if(!l(S))return!1;j=!0,M=!1}if(O&&!M)return N||(N=new e),j||c(_)?n(_,S,k,b,E,N):i(_,S,P,k,b,E,N);if(!(k&d)){var Q=M&&x.call(_,"__wrapped__"),X=F&&x.call(S,"__wrapped__");if(Q||X){var R=Q?_.value():_,K=X?S.value():S;return N||(N=new e),E(R,K,k,b,N)}}return O?(N||(N=new e),s(_,S,k,b,E,N)):!1}return Xd=C,Xd}var Qd,f_;function vN(){if(f_)return Qd;f_=1;var e=Mq(),n=Wn();function i(s,o,u,l,c){return s===o?!0:s==null||o==null||!n(s)&&!n(o)?s!==s&&o!==o:e(s,o,u,l,i,c)}return Qd=i,Qd}var Zd,d_;function Pq(){if(d_)return Zd;d_=1;var e=wu(),n=vN(),i=1,s=2;function o(u,l,c,d){var p=c.length,h=p,m=!d;if(u==null)return!h;for(u=Object(u);p--;){var y=c[p];if(m&&y[2]?y[1]!==u[y[0]]:!(y[0]in u))return!1}for(;++p<h;){y=c[p];var x=y[0],C=u[x],_=y[1];if(m&&y[2]){if(C===void 0&&!(x in u))return!1}else{var S=new e;if(d)var k=d(C,_,x,u,l,S);if(!(k===void 0?n(_,C,i|s,d,S):k))return!1}}return!0}return Zd=o,Zd}var Jd,h_;function yN(){if(h_)return Jd;h_=1;var e=Sn();function n(i){return i===i&&!e(i)}return Jd=n,Jd}var eh,p_;function qq(){if(p_)return eh;p_=1;var e=yN(),n=Hr();function i(s){for(var o=n(s),u=o.length;u--;){var l=o[u],c=s[l];o[u]=[l,c,e(c)]}return o}return eh=i,eh}var th,m_;function wN(){if(m_)return th;m_=1;function e(n,i){return function(s){return s==null?!1:s[n]===i&&(i!==void 0||n in Object(s))}}return th=e,th}var nh,g_;function Oq(){if(g_)return nh;g_=1;var e=Pq(),n=qq(),i=wN();function s(o){var u=n(o);return u.length==1&&u[0][2]?i(u[0][0],u[0][1]):function(l){return l===o||e(l,o,u)}}return nh=s,nh}var rh,v_;function fs(){if(v_)return rh;v_=1;var e=vi(),n=Wn(),i="[object Symbol]";function s(o){return typeof o=="symbol"||n(o)&&e(o)==i}return rh=s,rh}var ih,y_;function Jg(){if(y_)return ih;y_=1;var e=yt(),n=fs(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;function o(u,l){if(e(u))return!1;var c=typeof u;return c=="number"||c=="symbol"||c=="boolean"||u==null||n(u)?!0:s.test(u)||!i.test(u)||l!=null&&u in Object(l)}return ih=o,ih}var sh,w_;function Lq(){if(w_)return sh;w_=1;var e=zg(),n="Expected a function";function i(s,o){if(typeof s!="function"||o!=null&&typeof o!="function")throw new TypeError(n);var u=function(){var l=arguments,c=o?o.apply(this,l):l[0],d=u.cache;if(d.has(c))return d.get(c);var p=s.apply(this,l);return u.cache=d.set(c,p)||d,p};return u.cache=new(i.Cache||e),u}return i.Cache=e,sh=i,sh}var oh,x_;function $q(){if(x_)return oh;x_=1;var e=Lq(),n=500;function i(s){var o=e(s,function(l){return u.size===n&&u.clear(),l}),u=o.cache;return o}return oh=i,oh}var ah,__;function Dq(){if(__)return ah;__=1;var e=$q(),n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,s=e(function(o){var u=[];return o.charCodeAt(0)===46&&u.push(""),o.replace(n,function(l,c,d,p){u.push(d?p.replace(i,"$1"):c||l)}),u});return ah=s,ah}var uh,S_;function Cu(){if(S_)return uh;S_=1;function e(n,i){for(var s=-1,o=n==null?0:n.length,u=Array(o);++s<o;)u[s]=i(n[s],s,n);return u}return uh=e,uh}var lh,b_;function Fq(){if(b_)return lh;b_=1;var e=us(),n=Cu(),i=yt(),s=fs(),o=e?e.prototype:void 0,u=o?o.toString:void 0;function l(c){if(typeof c=="string")return c;if(i(c))return n(c,l)+"";if(s(c))return u?u.call(c):"";var d=c+"";return d=="0"&&1/c==-1/0?"-0":d}return lh=l,lh}var ch,k_;function xN(){if(k_)return ch;k_=1;var e=Fq();function n(i){return i==null?"":e(i)}return ch=n,ch}var fh,E_;function Tu(){if(E_)return fh;E_=1;var e=yt(),n=Jg(),i=Dq(),s=xN();function o(u,l){return e(u)?u:n(u,l)?[u]:i(s(u))}return fh=o,fh}var dh,N_;function ko(){if(N_)return dh;N_=1;var e=fs();function n(i){if(typeof i=="string"||e(i))return i;var s=i+"";return s=="0"&&1/i==-1/0?"-0":s}return dh=n,dh}var hh,C_;function Ru(){if(C_)return hh;C_=1;var e=Tu(),n=ko();function i(s,o){o=e(o,s);for(var u=0,l=o.length;s!=null&&u<l;)s=s[n(o[u++])];return u&&u==l?s:void 0}return hh=i,hh}var ph,T_;function zq(){if(T_)return ph;T_=1;var e=Ru();function n(i,s,o){var u=i==null?void 0:e(i,s);return u===void 0?o:u}return ph=n,ph}var mh,R_;function Bq(){if(R_)return mh;R_=1;function e(n,i){return n!=null&&i in Object(n)}return mh=e,mh}var gh,j_;function _N(){if(j_)return gh;j_=1;var e=Tu(),n=So(),i=yt(),s=Su(),o=Ug(),u=ko();function l(c,d,p){d=e(d,c);for(var h=-1,m=d.length,y=!1;++h<m;){var x=u(d[h]);if(!(y=c!=null&&p(c,x)))break;c=c[x]}return y||++h!=m?y:(m=c==null?0:c.length,!!m&&o(m)&&s(x,m)&&(i(c)||n(c)))}return gh=l,gh}var vh,A_;function SN(){if(A_)return vh;A_=1;var e=Bq(),n=_N();function i(s,o){return s!=null&&n(s,o,e)}return vh=i,vh}var yh,I_;function Uq(){if(I_)return yh;I_=1;var e=vN(),n=zq(),i=SN(),s=Jg(),o=yN(),u=wN(),l=ko(),c=1,d=2;function p(h,m){return s(h)&&o(m)?u(l(h),m):function(y){var x=n(y,h);return x===void 0&&x===m?i(y,h):e(m,x,c|d)}}return yh=p,yh}var wh,M_;function bN(){if(M_)return wh;M_=1;function e(n){return function(i){return i==null?void 0:i[n]}}return wh=e,wh}var xh,P_;function Hq(){if(P_)return xh;P_=1;var e=Ru();function n(i){return function(s){return e(s,i)}}return xh=n,xh}var _h,q_;function Vq(){if(q_)return _h;q_=1;var e=bN(),n=Hq(),i=Jg(),s=ko();function o(u){return i(u)?e(s(u)):n(u)}return _h=o,_h}var Sh,O_;function pr(){if(O_)return Sh;O_=1;var e=Oq(),n=Uq(),i=xi(),s=yt(),o=Vq();function u(l){return typeof l=="function"?l:l==null?i:typeof l=="object"?s(l)?n(l[0],l[1]):e(l):o(l)}return Sh=u,Sh}var bh,L_;function kN(){if(L_)return bh;L_=1;var e=eN(),n=Nq(),i=pr(),s=yt();function o(u,l){var c=s(u)?e:n;return c(u,i(l,3))}return bh=o,bh}var kh,$_;function Wq(){if($_)return kh;$_=1;var e=Object.prototype,n=e.hasOwnProperty;function i(s,o){return s!=null&&n.call(s,o)}return kh=i,kh}var Eh,D_;function EN(){if(D_)return Eh;D_=1;var e=Wq(),n=_N();function i(s,o){return s!=null&&n(s,o,e)}return Eh=i,Eh}var Nh,F_;function Gq(){if(F_)return Nh;F_=1;var e=Vg(),n=cs(),i=So(),s=yt(),o=hr(),u=ls(),l=ku(),c=bo(),d="[object Map]",p="[object Set]",h=Object.prototype,m=h.hasOwnProperty;function y(x){if(x==null)return!0;if(o(x)&&(s(x)||typeof x=="string"||typeof x.splice=="function"||u(x)||c(x)||i(x)))return!x.length;var C=n(x);if(C==d||C==p)return!x.size;if(l(x))return!e(x).length;for(var _ in x)if(m.call(x,_))return!1;return!0}return Nh=y,Nh}var Ch,z_;function NN(){if(z_)return Ch;z_=1;function e(n){return n===void 0}return Ch=e,Ch}var Th,B_;function CN(){if(B_)return Th;B_=1;var e=Nu(),n=hr();function i(s,o){var u=-1,l=n(s)?Array(s.length):[];return e(s,function(c,d,p){l[++u]=o(c,d,p)}),l}return Th=i,Th}var Rh,U_;function TN(){if(U_)return Rh;U_=1;var e=Cu(),n=pr(),i=CN(),s=yt();function o(u,l){var c=s(u)?e:i;return c(u,n(l,3))}return Rh=o,Rh}var jh,H_;function Kq(){if(H_)return jh;H_=1;function e(n,i,s,o){var u=-1,l=n==null?0:n.length;for(o&&l&&(s=n[++u]);++u<l;)s=i(s,n[u],u,n);return s}return jh=e,jh}var Ah,V_;function Yq(){if(V_)return Ah;V_=1;function e(n,i,s,o,u){return u(n,function(l,c,d){s=o?(o=!1,l):i(s,l,c,d)}),s}return Ah=e,Ah}var Ih,W_;function RN(){if(W_)return Ih;W_=1;var e=Kq(),n=Nu(),i=pr(),s=Yq(),o=yt();function u(l,c,d){var p=o(l)?e:s,h=arguments.length<3;return p(l,i(c,4),d,h,n)}return Ih=u,Ih}var Mh,G_;function Xq(){if(G_)return Mh;G_=1;var e=vi(),n=yt(),i=Wn(),s="[object String]";function o(u){return typeof u=="string"||!n(u)&&i(u)&&e(u)==s}return Mh=o,Mh}var Ph,K_;function Qq(){if(K_)return Ph;K_=1;var e=bN(),n=e("length");return Ph=n,Ph}var qh,Y_;function Zq(){if(Y_)return qh;Y_=1;var e="\\ud800-\\udfff",n="\\u0300-\\u036f",i="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",o=n+i+s,u="\\ufe0e\\ufe0f",l="\\u200d",c=RegExp("["+l+e+o+u+"]");function d(p){return c.test(p)}return qh=d,qh}var Oh,X_;function Jq(){if(X_)return Oh;X_=1;var e="\\ud800-\\udfff",n="\\u0300-\\u036f",i="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",o=n+i+s,u="\\ufe0e\\ufe0f",l="["+e+"]",c="["+o+"]",d="\\ud83c[\\udffb-\\udfff]",p="(?:"+c+"|"+d+")",h="[^"+e+"]",m="(?:\\ud83c[\\udde6-\\uddff]){2}",y="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",C=p+"?",_="["+u+"]?",S="(?:"+x+"(?:"+[h,m,y].join("|")+")"+_+C+")*",k=_+C+S,b="(?:"+[h+c+"?",c,m,y,l].join("|")+")",E=RegExp(d+"(?="+d+")|"+b+k,"g");function N(j){for(var I=E.lastIndex=0;E.test(j);)++I;return I}return Oh=N,Oh}var Lh,Q_;function eO(){if(Q_)return Lh;Q_=1;var e=Qq(),n=Zq(),i=Jq();function s(o){return n(o)?i(o):e(o)}return Lh=s,Lh}var $h,Z_;function tO(){if(Z_)return $h;Z_=1;var e=Vg(),n=cs(),i=hr(),s=Xq(),o=eO(),u="[object Map]",l="[object Set]";function c(d){if(d==null)return 0;if(i(d))return s(d)?o(d):d.length;var p=n(d);return p==u||p==l?d.size:e(d).length}return $h=c,$h}var Dh,J_;function nO(){if(J_)return Dh;J_=1;var e=Bg(),n=uN(),i=Qg(),s=pr(),o=Eu(),u=yt(),l=ls(),c=xo(),d=Sn(),p=bo();function h(m,y,x){var C=u(m),_=C||l(m)||p(m);if(y=s(y,4),x==null){var S=m&&m.constructor;_?x=C?new S:[]:d(m)?x=c(S)?n(o(m)):{}:x={}}return(_?e:i)(m,function(k,b,E){return y(x,k,b,E)}),x}return Dh=h,Dh}var Fh,eS;function rO(){if(eS)return Fh;eS=1;var e=us(),n=So(),i=yt(),s=e?e.isConcatSpreadable:void 0;function o(u){return i(u)||n(u)||!!(s&&u&&u[s])}return Fh=o,Fh}var zh,tS;function ev(){if(tS)return zh;tS=1;var e=Gg(),n=rO();function i(s,o,u,l,c){var d=-1,p=s.length;for(u||(u=n),c||(c=[]);++d<p;){var h=s[d];o>0&&u(h)?o>1?i(h,o-1,u,l,c):e(c,h):l||(c[c.length]=h)}return c}return zh=i,zh}var Bh,nS;function iO(){if(nS)return Bh;nS=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 Bh=e,Bh}var Uh,rS;function jN(){if(rS)return Uh;rS=1;var e=iO(),n=Math.max;function i(s,o,u){return o=n(o===void 0?s.length-1:o,0),function(){for(var l=arguments,c=-1,d=n(l.length-o,0),p=Array(d);++c<d;)p[c]=l[o+c];c=-1;for(var h=Array(o+1);++c<o;)h[c]=l[c];return h[o]=u(p),e(s,this,h)}}return Uh=i,Uh}var Hh,iS;function sO(){if(iS)return Hh;iS=1;var e=Yg(),n=YE(),i=xi(),s=n?function(o,u){return n(o,"toString",{configurable:!0,enumerable:!1,value:e(u),writable:!0})}:i;return Hh=s,Hh}var Vh,sS;function oO(){if(sS)return Vh;sS=1;var e=800,n=16,i=Date.now;function s(o){var u=0,l=0;return function(){var c=i(),d=n-(c-l);if(l=c,d>0){if(++u>=e)return arguments[0]}else u=0;return o.apply(void 0,arguments)}}return Vh=s,Vh}var Wh,oS;function AN(){if(oS)return Wh;oS=1;var e=sO(),n=oO(),i=n(e);return Wh=i,Wh}var Gh,aS;function ju(){if(aS)return Gh;aS=1;var e=xi(),n=jN(),i=AN();function s(o,u){return i(n(o,u,e),o+"")}return Gh=s,Gh}var Kh,uS;function IN(){if(uS)return Kh;uS=1;function e(n,i,s,o){for(var u=n.length,l=s+(o?1:-1);o?l--:++l<u;)if(i(n[l],l,n))return l;return-1}return Kh=e,Kh}var Yh,lS;function aO(){if(lS)return Yh;lS=1;function e(n){return n!==n}return Yh=e,Yh}var Xh,cS;function uO(){if(cS)return Xh;cS=1;function e(n,i,s){for(var o=s-1,u=n.length;++o<u;)if(n[o]===i)return o;return-1}return Xh=e,Xh}var Qh,fS;function lO(){if(fS)return Qh;fS=1;var e=IN(),n=aO(),i=uO();function s(o,u,l){return u===u?i(o,u,l):e(o,n,l)}return Qh=s,Qh}var Zh,dS;function cO(){if(dS)return Zh;dS=1;var e=lO();function n(i,s){var o=i==null?0:i.length;return!!o&&e(i,s,0)>-1}return Zh=n,Zh}var Jh,hS;function fO(){if(hS)return Jh;hS=1;function e(n,i,s){for(var o=-1,u=n==null?0:n.length;++o<u;)if(s(i,n[o]))return!0;return!1}return Jh=e,Jh}var ep,pS;function dO(){if(pS)return ep;pS=1;function e(){}return ep=e,ep}var tp,mS;function hO(){if(mS)return tp;mS=1;var e=sN(),n=dO(),i=Zg(),s=1/0,o=e&&1/i(new e([,-0]))[1]==s?function(u){return new e(u)}:n;return tp=o,tp}var np,gS;function pO(){if(gS)return np;gS=1;var e=pN(),n=cO(),i=fO(),s=mN(),o=hO(),u=Zg(),l=200;function c(d,p,h){var m=-1,y=n,x=d.length,C=!0,_=[],S=_;if(h)C=!1,y=i;else if(x>=l){var k=p?null:o(d);if(k)return u(k);C=!1,y=s,S=new e}else S=p?[]:_;e:for(;++m<x;){var b=d[m],E=p?p(b):b;if(b=h||b!==0?b:0,C&&E===E){for(var N=S.length;N--;)if(S[N]===E)continue e;p&&S.push(E),_.push(b)}else y(S,E,h)||(S!==_&&S.push(E),_.push(b))}return _}return np=c,np}var rp,vS;function MN(){if(vS)return rp;vS=1;var e=hr(),n=Wn();function i(s){return n(s)&&e(s)}return rp=i,rp}var ip,yS;function mO(){if(yS)return ip;yS=1;var e=ev(),n=ju(),i=pO(),s=MN(),o=n(function(u){return i(e(u,1,s,!0))});return ip=o,ip}var sp,wS;function gO(){if(wS)return sp;wS=1;var e=Cu();function n(i,s){return e(s,function(o){return i[o]})}return sp=n,sp}var op,xS;function PN(){if(xS)return op;xS=1;var e=gO(),n=Hr();function i(s){return s==null?[]:e(s,n(s))}return op=i,op}var ap,_S;function bn(){if(_S)return ap;_S=1;var e;if(typeof Dg=="function")try{e={clone:bq(),constant:Yg(),each:hN(),filter:kN(),has:EN(),isArray:yt(),isEmpty:Gq(),isFunction:xo(),isUndefined:NN(),keys:Hr(),map:TN(),reduce:RN(),size:tO(),transform:nO(),union:mO(),values:PN()}}catch{}return e||(e=window._),ap=e,ap}var up,SS;function tv(){if(SS)return up;SS=1;var e=bn();up=o;var n="\0",i="\0",s="";function o(h){this._isDirected=e.has(h,"directed")?h.directed:!0,this._isMultigraph=e.has(h,"multigraph")?h.multigraph:!1,this._isCompound=e.has(h,"compound")?h.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(h){return this._label=h,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(h){return e.isFunction(h)||(h=e.constant(h)),this._defaultNodeLabelFn=h,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return e.keys(this._nodes)},o.prototype.sources=function(){var h=this;return e.filter(this.nodes(),function(m){return e.isEmpty(h._in[m])})},o.prototype.sinks=function(){var h=this;return e.filter(this.nodes(),function(m){return e.isEmpty(h._out[m])})},o.prototype.setNodes=function(h,m){var y=arguments,x=this;return e.each(h,function(C){y.length>1?x.setNode(C,m):x.setNode(C)}),this},o.prototype.setNode=function(h,m){return e.has(this._nodes,h)?(arguments.length>1&&(this._nodes[h]=m),this):(this._nodes[h]=arguments.length>1?m:this._defaultNodeLabelFn(h),this._isCompound&&(this._parent[h]=i,this._children[h]={},this._children[i][h]=!0),this._in[h]={},this._preds[h]={},this._out[h]={},this._sucs[h]={},++this._nodeCount,this)},o.prototype.node=function(h){return this._nodes[h]},o.prototype.hasNode=function(h){return e.has(this._nodes,h)},o.prototype.removeNode=function(h){var m=this;if(e.has(this._nodes,h)){var y=function(x){m.removeEdge(m._edgeObjs[x])};delete this._nodes[h],this._isCompound&&(this._removeFromParentsChildList(h),delete this._parent[h],e.each(this.children(h),function(x){m.setParent(x)}),delete this._children[h]),e.each(e.keys(this._in[h]),y),delete this._in[h],delete this._preds[h],e.each(e.keys(this._out[h]),y),delete this._out[h],delete this._sucs[h],--this._nodeCount}return this},o.prototype.setParent=function(h,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===h)throw new Error("Setting "+m+" as parent of "+h+" would create a cycle");this.setNode(m)}return this.setNode(h),this._removeFromParentsChildList(h),this._parent[h]=m,this._children[m][h]=!0,this},o.prototype._removeFromParentsChildList=function(h){delete this._children[this._parent[h]][h]},o.prototype.parent=function(h){if(this._isCompound){var m=this._parent[h];if(m!==i)return m}},o.prototype.children=function(h){if(e.isUndefined(h)&&(h=i),this._isCompound){var m=this._children[h];if(m)return e.keys(m)}else{if(h===i)return this.nodes();if(this.hasNode(h))return[]}},o.prototype.predecessors=function(h){var m=this._preds[h];if(m)return e.keys(m)},o.prototype.successors=function(h){var m=this._sucs[h];if(m)return e.keys(m)},o.prototype.neighbors=function(h){var m=this.predecessors(h);if(m)return e.union(m,this.successors(h))},o.prototype.isLeaf=function(h){var m;return this.isDirected()?m=this.successors(h):m=this.neighbors(h),m.length===0},o.prototype.filterNodes=function(h){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){h(S)&&m.setNode(S,_)}),e.each(this._edgeObjs,function(_){m.hasNode(_.v)&&m.hasNode(_.w)&&m.setEdge(_,y.edge(_))});var x={};function C(_){var S=y.parent(_);return S===void 0||m.hasNode(S)?(x[_]=S,S):S in x?x[S]:C(S)}return this._isCompound&&e.each(m.nodes(),function(_){m.setParent(_,C(_))}),m},o.prototype.setDefaultEdgeLabel=function(h){return e.isFunction(h)||(h=e.constant(h)),this._defaultEdgeLabelFn=h,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return e.values(this._edgeObjs)},o.prototype.setPath=function(h,m){var y=this,x=arguments;return e.reduce(h,function(C,_){return x.length>1?y.setEdge(C,_,m):y.setEdge(C,_),_}),this},o.prototype.setEdge=function(){var h,m,y,x,C=!1,_=arguments[0];typeof _=="object"&&_!==null&&"v"in _?(h=_.v,m=_.w,y=_.name,arguments.length===2&&(x=arguments[1],C=!0)):(h=_,m=arguments[1],y=arguments[3],arguments.length>2&&(x=arguments[2],C=!0)),h=""+h,m=""+m,e.isUndefined(y)||(y=""+y);var S=c(this._isDirected,h,m,y);if(e.has(this._edgeLabels,S))return C&&(this._edgeLabels[S]=x),this;if(!e.isUndefined(y)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(h),this.setNode(m),this._edgeLabels[S]=C?x:this._defaultEdgeLabelFn(h,m,y);var k=d(this._isDirected,h,m,y);return h=k.v,m=k.w,Object.freeze(k),this._edgeObjs[S]=k,u(this._preds[m],h),u(this._sucs[h],m),this._in[m][S]=k,this._out[h][S]=k,this._edgeCount++,this},o.prototype.edge=function(h,m,y){var x=arguments.length===1?p(this._isDirected,arguments[0]):c(this._isDirected,h,m,y);return this._edgeLabels[x]},o.prototype.hasEdge=function(h,m,y){var x=arguments.length===1?p(this._isDirected,arguments[0]):c(this._isDirected,h,m,y);return e.has(this._edgeLabels,x)},o.prototype.removeEdge=function(h,m,y){var x=arguments.length===1?p(this._isDirected,arguments[0]):c(this._isDirected,h,m,y),C=this._edgeObjs[x];return C&&(h=C.v,m=C.w,delete this._edgeLabels[x],delete this._edgeObjs[x],l(this._preds[m],h),l(this._sucs[h],m),delete this._in[m][x],delete this._out[h][x],this._edgeCount--),this},o.prototype.inEdges=function(h,m){var y=this._in[h];if(y){var x=e.values(y);return m?e.filter(x,function(C){return C.v===m}):x}},o.prototype.outEdges=function(h,m){var y=this._out[h];if(y){var x=e.values(y);return m?e.filter(x,function(C){return C.w===m}):x}},o.prototype.nodeEdges=function(h,m){var y=this.inEdges(h,m);if(y)return y.concat(this.outEdges(h,m))};function u(h,m){h[m]?h[m]++:h[m]=1}function l(h,m){--h[m]||delete h[m]}function c(h,m,y,x){var C=""+m,_=""+y;if(!h&&C>_){var S=C;C=_,_=S}return C+s+_+s+(e.isUndefined(x)?n:x)}function d(h,m,y,x){var C=""+m,_=""+y;if(!h&&C>_){var S=C;C=_,_=S}var k={v:C,w:_};return x&&(k.name=x),k}function p(h,m){return c(h,m.v,m.w,m.name)}return up}var lp,bS;function vO(){return bS||(bS=1,lp="2.1.8"),lp}var cp,kS;function yO(){return kS||(kS=1,cp={Graph:tv(),version:vO()}),cp}var fp,ES;function wO(){if(ES)return fp;ES=1;var e=bn(),n=tv();fp={write:i,read:u};function i(l){var c={options:{directed:l.isDirected(),multigraph:l.isMultigraph(),compound:l.isCompound()},nodes:s(l),edges:o(l)};return e.isUndefined(l.graph())||(c.value=e.clone(l.graph())),c}function s(l){return e.map(l.nodes(),function(c){var d=l.node(c),p=l.parent(c),h={v:c};return e.isUndefined(d)||(h.value=d),e.isUndefined(p)||(h.parent=p),h})}function o(l){return e.map(l.edges(),function(c){var d=l.edge(c),p={v:c.v,w:c.w};return e.isUndefined(c.name)||(p.name=c.name),e.isUndefined(d)||(p.value=d),p})}function u(l){var c=new n(l.options).setGraph(l.value);return e.each(l.nodes,function(d){c.setNode(d.v,d.value),d.parent&&c.setParent(d.v,d.parent)}),e.each(l.edges,function(d){c.setEdge({v:d.v,w:d.w,name:d.name},d.value)}),c}return fp}var dp,NS;function xO(){if(NS)return dp;NS=1;var e=bn();dp=n;function n(i){var s={},o=[],u;function l(c){e.has(s,c)||(s[c]=!0,u.push(c),e.each(i.successors(c),l),e.each(i.predecessors(c),l))}return e.each(i.nodes(),function(c){u=[],l(c),u.length&&o.push(u)}),o}return dp}var hp,CS;function qN(){if(CS)return hp;CS=1;var e=bn();hp=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 u=this._arr,l=u.length;return o[i]=l,u.push({key:i,priority:s}),this._decrease(l),!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,u=o+1,l=i;o<s.length&&(l=s[o].priority<s[l].priority?o:l,u<s.length&&(l=s[u].priority<s[l].priority?u:l),l!==i&&(this._swap(i,l),this._heapify(l)))},n.prototype._decrease=function(i){for(var s=this._arr,o=s[i].priority,u;i!==0&&(u=i>>1,!(s[u].priority<o));)this._swap(i,u),i=u},n.prototype._swap=function(i,s){var o=this._arr,u=this._keyIndices,l=o[i],c=o[s];o[i]=c,o[s]=l,u[c.key]=i,u[l.key]=s},hp}var pp,TS;function ON(){if(TS)return pp;TS=1;var e=bn(),n=qN();pp=s;var i=e.constant(1);function s(u,l,c,d){return o(u,String(l),c||i,d||function(p){return u.outEdges(p)})}function o(u,l,c,d){var p={},h=new n,m,y,x=function(C){var _=C.v!==m?C.v:C.w,S=p[_],k=c(C),b=y.distance+k;if(k<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+C+" Weight: "+k);b<S.distance&&(S.distance=b,S.predecessor=m,h.decrease(_,b))};for(u.nodes().forEach(function(C){var _=C===l?0:Number.POSITIVE_INFINITY;p[C]={distance:_},h.add(C,_)});h.size()>0&&(m=h.removeMin(),y=p[m],y.distance!==Number.POSITIVE_INFINITY);)d(m).forEach(x);return p}return pp}var mp,RS;function _O(){if(RS)return mp;RS=1;var e=ON(),n=bn();mp=i;function i(s,o,u){return n.transform(s.nodes(),function(l,c){l[c]=e(s,c,o,u)},{})}return mp}var gp,jS;function LN(){if(jS)return gp;jS=1;var e=bn();gp=n;function n(i){var s=0,o=[],u={},l=[];function c(d){var p=u[d]={onStack:!0,lowlink:s,index:s++};if(o.push(d),i.successors(d).forEach(function(y){e.has(u,y)?u[y].onStack&&(p.lowlink=Math.min(p.lowlink,u[y].index)):(c(y),p.lowlink=Math.min(p.lowlink,u[y].lowlink))}),p.lowlink===p.index){var h=[],m;do m=o.pop(),u[m].onStack=!1,h.push(m);while(d!==m);l.push(h)}}return i.nodes().forEach(function(d){e.has(u,d)||c(d)}),l}return gp}var vp,AS;function SO(){if(AS)return vp;AS=1;var e=bn(),n=LN();vp=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 vp}var yp,IS;function bO(){if(IS)return yp;IS=1;var e=bn();yp=i;var n=e.constant(1);function i(o,u,l){return s(o,u||n,l||function(c){return o.outEdges(c)})}function s(o,u,l){var c={},d=o.nodes();return d.forEach(function(p){c[p]={},c[p][p]={distance:0},d.forEach(function(h){p!==h&&(c[p][h]={distance:Number.POSITIVE_INFINITY})}),l(p).forEach(function(h){var m=h.v===p?h.w:h.v,y=u(h);c[p][m]={distance:y,predecessor:p}})}),d.forEach(function(p){var h=c[p];d.forEach(function(m){var y=c[m];d.forEach(function(x){var C=y[p],_=h[x],S=y[x],k=C.distance+_.distance;k<S.distance&&(S.distance=k,S.predecessor=_.predecessor)})})}),c}return yp}var wp,MS;function $N(){if(MS)return wp;MS=1;var e=bn();wp=n,n.CycleException=i;function n(s){var o={},u={},l=[];function c(d){if(e.has(u,d))throw new i;e.has(o,d)||(u[d]=!0,o[d]=!0,e.each(s.predecessors(d),c),delete u[d],l.push(d))}if(e.each(s.sinks(),c),e.size(o)!==s.nodeCount())throw new i;return l}function i(){}return i.prototype=new Error,wp}var xp,PS;function kO(){if(PS)return xp;PS=1;var e=$N();xp=n;function n(i){try{e(i)}catch(s){if(s instanceof e.CycleException)return!1;throw s}return!0}return xp}var _p,qS;function DN(){if(qS)return _p;qS=1;var e=bn();_p=n;function n(s,o,u){e.isArray(o)||(o=[o]);var l=(s.isDirected()?s.successors:s.neighbors).bind(s),c=[],d={};return e.each(o,function(p){if(!s.hasNode(p))throw new Error("Graph does not have node: "+p);i(s,p,u==="post",d,l,c)}),c}function i(s,o,u,l,c,d){e.has(l,o)||(l[o]=!0,u||d.push(o),e.each(c(o),function(p){i(s,p,u,l,c,d)}),u&&d.push(o))}return _p}var Sp,OS;function EO(){if(OS)return Sp;OS=1;var e=DN();Sp=n;function n(i,s){return e(i,s,"post")}return Sp}var bp,LS;function NO(){if(LS)return bp;LS=1;var e=DN();bp=n;function n(i,s){return e(i,s,"pre")}return bp}var kp,$S;function CO(){if($S)return kp;$S=1;var e=bn(),n=tv(),i=qN();kp=s;function s(o,u){var l=new n,c={},d=new i,p;function h(y){var x=y.v===p?y.w:y.v,C=d.priority(x);if(C!==void 0){var _=u(y);_<C&&(c[x]=p,d.decrease(x,_))}}if(o.nodeCount()===0)return l;e.each(o.nodes(),function(y){d.add(y,Number.POSITIVE_INFINITY),l.setNode(y)}),d.decrease(o.nodes()[0],0);for(var m=!1;d.size()>0;){if(p=d.removeMin(),e.has(c,p))l.setEdge(p,c[p]);else{if(m)throw new Error("Input graph is not connected: "+o);m=!0}o.nodeEdges(p).forEach(h)}return l}return kp}var Ep,DS;function TO(){return DS||(DS=1,Ep={components:xO(),dijkstra:ON(),dijkstraAll:_O(),findCycles:SO(),floydWarshall:bO(),isAcyclic:kO(),postorder:EO(),preorder:NO(),prim:CO(),tarjan:LN(),topsort:$N()}),Ep}var Np,FS;function RO(){if(FS)return Np;FS=1;var e=yO();return Np={Graph:e.Graph,json:wO(),alg:TO(),version:e.version},Np}var Cp,zS;function qn(){if(zS)return Cp;zS=1;var e;if(typeof Dg=="function")try{e=RO()}catch{}return e||(e=window.graphlib),Cp=e,Cp}var Tp,BS;function jO(){if(BS)return Tp;BS=1;var e=cN(),n=1,i=4;function s(o){return e(o,n|i)}return Tp=s,Tp}var Rp,US;function Au(){if(US)return Rp;US=1;var e=as(),n=hr(),i=Su(),s=Sn();function o(u,l,c){if(!s(c))return!1;var d=typeof l;return(d=="number"?n(c)&&i(l,c.length):d=="string"&&l in c)?e(c[l],u):!1}return Rp=o,Rp}var jp,HS;function AO(){if(HS)return jp;HS=1;var e=ju(),n=as(),i=Au(),s=wi(),o=Object.prototype,u=o.hasOwnProperty,l=e(function(c,d){c=Object(c);var p=-1,h=d.length,m=h>2?d[2]:void 0;for(m&&i(d[0],d[1],m)&&(h=1);++p<h;)for(var y=d[p],x=s(y),C=-1,_=x.length;++C<_;){var S=x[C],k=c[S];(k===void 0||n(k,o[S])&&!u.call(c,S))&&(c[S]=y[S])}return c});return jp=l,jp}var Ap,VS;function IO(){if(VS)return Ap;VS=1;var e=pr(),n=hr(),i=Hr();function s(o){return function(u,l,c){var d=Object(u);if(!n(u)){var p=e(l,3);u=i(u),l=function(m){return p(d[m],m,d)}}var h=o(u,l,c);return h>-1?d[p?u[h]:h]:void 0}}return Ap=s,Ap}var Ip,WS;function MO(){if(WS)return Ip;WS=1;var e=/\s/;function n(i){for(var s=i.length;s--&&e.test(i.charAt(s)););return s}return Ip=n,Ip}var Mp,GS;function PO(){if(GS)return Mp;GS=1;var e=MO(),n=/^\s+/;function i(s){return s&&s.slice(0,e(s)+1).replace(n,"")}return Mp=i,Mp}var Pp,KS;function qO(){if(KS)return Pp;KS=1;var e=PO(),n=Sn(),i=fs(),s=NaN,o=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;function d(p){if(typeof p=="number")return p;if(i(p))return s;if(n(p)){var h=typeof p.valueOf=="function"?p.valueOf():p;p=n(h)?h+"":h}if(typeof p!="string")return p===0?p:+p;p=e(p);var m=u.test(p);return m||l.test(p)?c(p.slice(2),m?2:8):o.test(p)?s:+p}return Pp=d,Pp}var qp,YS;function FN(){if(YS)return qp;YS=1;var e=qO(),n=1/0,i=17976931348623157e292;function s(o){if(!o)return o===0?o:0;if(o=e(o),o===n||o===-n){var u=o<0?-1:1;return u*i}return o===o?o:0}return qp=s,qp}var Op,XS;function OO(){if(XS)return Op;XS=1;var e=FN();function n(i){var s=e(i),o=s%1;return s===s?o?s-o:s:0}return Op=n,Op}var Lp,QS;function LO(){if(QS)return Lp;QS=1;var e=IN(),n=pr(),i=OO(),s=Math.max;function o(u,l,c){var d=u==null?0:u.length;if(!d)return-1;var p=c==null?0:i(c);return p<0&&(p=s(d+p,0)),e(u,n(l,3),p)}return Lp=o,Lp}var $p,ZS;function $O(){if(ZS)return $p;ZS=1;var e=IO(),n=LO(),i=e(n);return $p=i,$p}var Dp,JS;function zN(){if(JS)return Dp;JS=1;var e=ev();function n(i){var s=i==null?0:i.length;return s?e(i,1):[]}return Dp=n,Dp}var Fp,eb;function DO(){if(eb)return Fp;eb=1;var e=Xg(),n=fN(),i=wi();function s(o,u){return o==null?o:e(o,n(u),i)}return Fp=s,Fp}var zp,tb;function FO(){if(tb)return zp;tb=1;function e(n){var i=n==null?0:n.length;return i?n[i-1]:void 0}return zp=e,zp}var Bp,nb;function zO(){if(nb)return Bp;nb=1;var e=xu(),n=Qg(),i=pr();function s(o,u){var l={};return u=i(u,3),n(o,function(c,d,p){e(l,d,u(c,d,p))}),l}return Bp=s,Bp}var Up,rb;function nv(){if(rb)return Up;rb=1;var e=fs();function n(i,s,o){for(var u=-1,l=i.length;++u<l;){var c=i[u],d=s(c);if(d!=null&&(p===void 0?d===d&&!e(d):o(d,p)))var p=d,h=c}return h}return Up=n,Up}var Hp,ib;function BO(){if(ib)return Hp;ib=1;function e(n,i){return n>i}return Hp=e,Hp}var Vp,sb;function UO(){if(sb)return Vp;sb=1;var e=nv(),n=BO(),i=xi();function s(o){return o&&o.length?e(o,i,n):void 0}return Vp=s,Vp}var Wp,ob;function BN(){if(ob)return Wp;ob=1;var e=xu(),n=as();function i(s,o,u){(u!==void 0&&!n(s[o],u)||u===void 0&&!(o in s))&&e(s,o,u)}return Wp=i,Wp}var Gp,ab;function HO(){if(ab)return Gp;ab=1;var e=vi(),n=Eu(),i=Wn(),s="[object Object]",o=Function.prototype,u=Object.prototype,l=o.toString,c=u.hasOwnProperty,d=l.call(Object);function p(h){if(!i(h)||e(h)!=s)return!1;var m=n(h);if(m===null)return!0;var y=c.call(m,"constructor")&&m.constructor;return typeof y=="function"&&y instanceof y&&l.call(y)==d}return Gp=p,Gp}var Kp,ub;function UN(){if(ub)return Kp;ub=1;function e(n,i){if(!(i==="constructor"&&typeof n[i]=="function")&&i!="__proto__")return n[i]}return Kp=e,Kp}var Yp,lb;function VO(){if(lb)return Yp;lb=1;var e=_o(),n=wi();function i(s){return e(s,n(s))}return Yp=i,Yp}var Xp,cb;function WO(){if(cb)return Xp;cb=1;var e=BN(),n=ZE(),i=aN(),s=JE(),o=lN(),u=So(),l=yt(),c=MN(),d=ls(),p=xo(),h=Sn(),m=HO(),y=bo(),x=UN(),C=VO();function _(S,k,b,E,N,j,I){var P=x(S,b),B=x(k,b),M=I.get(B);if(M){e(S,b,M);return}var F=j?j(P,B,b+"",S,k,I):void 0,O=F===void 0;if(O){var Q=l(B),X=!Q&&d(B),R=!Q&&!X&&y(B);F=B,Q||X||R?l(P)?F=P:c(P)?F=s(P):X?(O=!1,F=n(B,!0)):R?(O=!1,F=i(B,!0)):F=[]:m(B)||u(B)?(F=P,u(P)?F=C(P):(!h(P)||p(P))&&(F=o(B))):O=!1}O&&(I.set(B,F),N(F,B,E,j,I),I.delete(B)),e(S,b,F)}return Xp=_,Xp}var Qp,fb;function GO(){if(fb)return Qp;fb=1;var e=wu(),n=BN(),i=Xg(),s=WO(),o=Sn(),u=wi(),l=UN();function c(d,p,h,m,y){d!==p&&i(p,function(x,C){if(y||(y=new e),o(x))s(d,p,C,h,c,m,y);else{var _=m?m(l(d,C),x,C+"",d,p,y):void 0;_===void 0&&(_=x),n(d,C,_)}},u)}return Qp=c,Qp}var Zp,db;function KO(){if(db)return Zp;db=1;var e=ju(),n=Au();function i(s){return e(function(o,u){var l=-1,c=u.length,d=c>1?u[c-1]:void 0,p=c>2?u[2]:void 0;for(d=s.length>3&&typeof d=="function"?(c--,d):void 0,p&&n(u[0],u[1],p)&&(d=c<3?void 0:d,c=1),o=Object(o);++l<c;){var h=u[l];h&&s(o,h,l,d)}return o})}return Zp=i,Zp}var Jp,hb;function YO(){if(hb)return Jp;hb=1;var e=GO(),n=KO(),i=n(function(s,o,u){e(s,o,u)});return Jp=i,Jp}var em,pb;function HN(){if(pb)return em;pb=1;function e(n,i){return n<i}return em=e,em}var tm,mb;function XO(){if(mb)return tm;mb=1;var e=nv(),n=HN(),i=xi();function s(o){return o&&o.length?e(o,i,n):void 0}return tm=s,tm}var nm,gb;function QO(){if(gb)return nm;gb=1;var e=nv(),n=pr(),i=HN();function s(o,u){return o&&o.length?e(o,n(u,2),i):void 0}return nm=s,nm}var rm,vb;function ZO(){if(vb)return rm;vb=1;var e=Ln(),n=function(){return e.Date.now()};return rm=n,rm}var im,yb;function JO(){if(yb)return im;yb=1;var e=_u(),n=Tu(),i=Su(),s=Sn(),o=ko();function u(l,c,d,p){if(!s(l))return l;c=n(c,l);for(var h=-1,m=c.length,y=m-1,x=l;x!=null&&++h<m;){var C=o(c[h]),_=d;if(C==="__proto__"||C==="constructor"||C==="prototype")return l;if(h!=y){var S=x[C];_=p?p(S,C,x):void 0,_===void 0&&(_=s(S)?S:i(c[h+1])?[]:{})}e(x,C,_),x=x[C]}return l}return im=u,im}var sm,wb;function eL(){if(wb)return sm;wb=1;var e=Ru(),n=JO(),i=Tu();function s(o,u,l){for(var c=-1,d=u.length,p={};++c<d;){var h=u[c],m=e(o,h);l(m,h)&&n(p,i(h,o),m)}return p}return sm=s,sm}var om,xb;function tL(){if(xb)return om;xb=1;var e=eL(),n=SN();function i(s,o){return e(s,o,function(u,l){return n(s,l)})}return om=i,om}var am,_b;function nL(){if(_b)return am;_b=1;var e=zN(),n=jN(),i=AN();function s(o){return i(n(o,void 0,e),o+"")}return am=s,am}var um,Sb;function rL(){if(Sb)return um;Sb=1;var e=tL(),n=nL(),i=n(function(s,o){return s==null?{}:e(s,o)});return um=i,um}var lm,bb;function iL(){if(bb)return lm;bb=1;var e=Math.ceil,n=Math.max;function i(s,o,u,l){for(var c=-1,d=n(e((o-s)/(u||1)),0),p=Array(d);d--;)p[l?d:++c]=s,s+=u;return p}return lm=i,lm}var cm,kb;function sL(){if(kb)return cm;kb=1;var e=iL(),n=Au(),i=FN();function s(o){return function(u,l,c){return c&&typeof c!="number"&&n(u,l,c)&&(l=c=void 0),u=i(u),l===void 0?(l=u,u=0):l=i(l),c=c===void 0?u<l?1:-1:i(c),e(u,l,c,o)}}return cm=s,cm}var fm,Eb;function oL(){if(Eb)return fm;Eb=1;var e=sL(),n=e();return fm=n,fm}var dm,Nb;function aL(){if(Nb)return dm;Nb=1;function e(n,i){var s=n.length;for(n.sort(i);s--;)n[s]=n[s].value;return n}return dm=e,dm}var hm,Cb;function uL(){if(Cb)return hm;Cb=1;var e=fs();function n(i,s){if(i!==s){var o=i!==void 0,u=i===null,l=i===i,c=e(i),d=s!==void 0,p=s===null,h=s===s,m=e(s);if(!p&&!m&&!c&&i>s||c&&d&&h&&!p&&!m||u&&d&&h||!o&&h||!l)return 1;if(!u&&!c&&!m&&i<s||m&&o&&l&&!u&&!c||p&&o&&l||!d&&l||!h)return-1}return 0}return hm=n,hm}var pm,Tb;function lL(){if(Tb)return pm;Tb=1;var e=uL();function n(i,s,o){for(var u=-1,l=i.criteria,c=s.criteria,d=l.length,p=o.length;++u<d;){var h=e(l[u],c[u]);if(h){if(u>=p)return h;var m=o[u];return h*(m=="desc"?-1:1)}}return i.index-s.index}return pm=n,pm}var mm,Rb;function cL(){if(Rb)return mm;Rb=1;var e=Cu(),n=Ru(),i=pr(),s=CN(),o=aL(),u=bu(),l=lL(),c=xi(),d=yt();function p(h,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,u(i));var C=s(h,function(_,S,k){var b=e(m,function(E){return E(_)});return{criteria:b,index:++x,value:_}});return o(C,function(_,S){return l(_,S,y)})}return mm=p,mm}var gm,jb;function fL(){if(jb)return gm;jb=1;var e=ev(),n=cL(),i=ju(),s=Au(),o=i(function(u,l){if(u==null)return[];var c=l.length;return c>1&&s(u,l[0],l[1])?l=[]:c>2&&s(l[0],l[1],l[2])&&(l=[l[0]]),n(u,e(l,1),[])});return gm=o,gm}var vm,Ab;function dL(){if(Ab)return vm;Ab=1;var e=xN(),n=0;function i(s){var o=++n;return e(s)+o}return vm=i,vm}var ym,Ib;function hL(){if(Ib)return ym;Ib=1;function e(n,i,s){for(var o=-1,u=n.length,l=i.length,c={};++o<u;){var d=o<l?i[o]:void 0;s(c,n[o],d)}return c}return ym=e,ym}var wm,Mb;function pL(){if(Mb)return wm;Mb=1;var e=_u(),n=hL();function i(s,o){return n(s||[],o||[],e)}return wm=i,wm}var xm,Pb;function tt(){if(Pb)return xm;Pb=1;var e;if(typeof Dg=="function")try{e={cloneDeep:jO(),constant:Yg(),defaults:AO(),each:hN(),filter:kN(),find:$O(),flatten:zN(),forEach:dN(),forIn:DO(),has:EN(),isUndefined:NN(),last:FO(),map:TN(),mapValues:zO(),max:UO(),merge:YO(),min:XO(),minBy:QO(),now:ZO(),pick:rL(),range:oL(),reduce:RN(),sortBy:fL(),uniqueId:dL(),values:PN(),zipObject:pL()}}catch{}return e||(e=window._),xm=e,xm}var _m,qb;function mL(){if(qb)return _m;qb=1,_m=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,u=o._prev;u!==o;)s.push(JSON.stringify(u,i)),u=u._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 _m}var Sm,Ob;function gL(){if(Ob)return Sm;Ob=1;var e=tt(),n=qn().Graph,i=mL();Sm=o;var s=e.constant(1);function o(p,h){if(p.nodeCount()<=1)return[];var m=c(p,h||s),y=u(m.graph,m.buckets,m.zeroIdx);return e.flatten(e.map(y,function(x){return p.outEdges(x.v,x.w)}),!0)}function u(p,h,m){for(var y=[],x=h[h.length-1],C=h[0],_;p.nodeCount();){for(;_=C.dequeue();)l(p,h,m,_);for(;_=x.dequeue();)l(p,h,m,_);if(p.nodeCount()){for(var S=h.length-2;S>0;--S)if(_=h[S].dequeue(),_){y=y.concat(l(p,h,m,_,!0));break}}}return y}function l(p,h,m,y,x){var C=x?[]:void 0;return e.forEach(p.inEdges(y.v),function(_){var S=p.edge(_),k=p.node(_.v);x&&C.push({v:_.v,w:_.w}),k.out-=S,d(h,m,k)}),e.forEach(p.outEdges(y.v),function(_){var S=p.edge(_),k=_.w,b=p.node(k);b.in-=S,d(h,m,b)}),p.removeNode(y.v),C}function c(p,h){var m=new n,y=0,x=0;e.forEach(p.nodes(),function(S){m.setNode(S,{v:S,in:0,out:0})}),e.forEach(p.edges(),function(S){var k=m.edge(S.v,S.w)||0,b=h(S),E=k+b;m.setEdge(S.v,S.w,E),x=Math.max(x,m.node(S.v).out+=b),y=Math.max(y,m.node(S.w).in+=b)});var C=e.range(x+y+3).map(function(){return new i}),_=y+1;return e.forEach(m.nodes(),function(S){d(C,_,m.node(S))}),{graph:m,buckets:C,zeroIdx:_}}function d(p,h,m){m.out?m.in?p[m.out-m.in+h].enqueue(m):p[p.length-1].enqueue(m):p[0].enqueue(m)}return Sm}var bm,Lb;function vL(){if(Lb)return bm;Lb=1;var e=tt(),n=gL();bm={run:i,undo:o};function i(u){var l=u.graph().acyclicer==="greedy"?n(u,c(u)):s(u);e.forEach(l,function(d){var p=u.edge(d);u.removeEdge(d),p.forwardName=d.name,p.reversed=!0,u.setEdge(d.w,d.v,p,e.uniqueId("rev"))});function c(d){return function(p){return d.edge(p).weight}}}function s(u){var l=[],c={},d={};function p(h){e.has(d,h)||(d[h]=!0,c[h]=!0,e.forEach(u.outEdges(h),function(m){e.has(c,m.w)?l.push(m):p(m.w)}),delete c[h])}return e.forEach(u.nodes(),p),l}function o(u){e.forEach(u.edges(),function(l){var c=u.edge(l);if(c.reversed){u.removeEdge(l);var d=c.forwardName;delete c.reversed,delete c.forwardName,u.setEdge(l.w,l.v,c,d)}})}return bm}var km,$b;function Jt(){if($b)return km;$b=1;var e=tt(),n=qn().Graph;km={addDummyNode:i,simplify:s,asNonCompoundGraph:o,successorWeights:u,predecessorWeights:l,intersectRect:c,buildLayerMatrix:d,normalizeRanks:p,removeEmptyRanks:h,addBorderNode:m,maxRank:y,partition:x,time:C,notime:_};function i(S,k,b,E){var N;do N=e.uniqueId(E);while(S.hasNode(N));return b.dummy=k,S.setNode(N,b),N}function s(S){var k=new n().setGraph(S.graph());return e.forEach(S.nodes(),function(b){k.setNode(b,S.node(b))}),e.forEach(S.edges(),function(b){var E=k.edge(b.v,b.w)||{weight:0,minlen:1},N=S.edge(b);k.setEdge(b.v,b.w,{weight:E.weight+N.weight,minlen:Math.max(E.minlen,N.minlen)})}),k}function o(S){var k=new n({multigraph:S.isMultigraph()}).setGraph(S.graph());return e.forEach(S.nodes(),function(b){S.children(b).length||k.setNode(b,S.node(b))}),e.forEach(S.edges(),function(b){k.setEdge(b,S.edge(b))}),k}function u(S){var k=e.map(S.nodes(),function(b){var E={};return e.forEach(S.outEdges(b),function(N){E[N.w]=(E[N.w]||0)+S.edge(N).weight}),E});return e.zipObject(S.nodes(),k)}function l(S){var k=e.map(S.nodes(),function(b){var E={};return e.forEach(S.inEdges(b),function(N){E[N.v]=(E[N.v]||0)+S.edge(N).weight}),E});return e.zipObject(S.nodes(),k)}function c(S,k){var b=S.x,E=S.y,N=k.x-b,j=k.y-E,I=S.width/2,P=S.height/2;if(!N&&!j)throw new Error("Not possible to find intersection inside of the rectangle");var B,M;return Math.abs(j)*I>Math.abs(N)*P?(j<0&&(P=-P),B=P*N/j,M=P):(N<0&&(I=-I),B=I,M=I*j/N),{x:b+B,y:E+M}}function d(S){var k=e.map(e.range(y(S)+1),function(){return[]});return e.forEach(S.nodes(),function(b){var E=S.node(b),N=E.rank;e.isUndefined(N)||(k[N][E.order]=b)}),k}function p(S){var k=e.min(e.map(S.nodes(),function(b){return S.node(b).rank}));e.forEach(S.nodes(),function(b){var E=S.node(b);e.has(E,"rank")&&(E.rank-=k)})}function h(S){var k=e.min(e.map(S.nodes(),function(j){return S.node(j).rank})),b=[];e.forEach(S.nodes(),function(j){var I=S.node(j).rank-k;b[I]||(b[I]=[]),b[I].push(j)});var E=0,N=S.graph().nodeRankFactor;e.forEach(b,function(j,I){e.isUndefined(j)&&I%N!==0?--E:E&&e.forEach(j,function(P){S.node(P).rank+=E})})}function m(S,k,b,E){var N={width:0,height:0};return arguments.length>=4&&(N.rank=b,N.order=E),i(S,"border",N,k)}function y(S){return e.max(e.map(S.nodes(),function(k){var b=S.node(k).rank;if(!e.isUndefined(b))return b}))}function x(S,k){var b={lhs:[],rhs:[]};return e.forEach(S,function(E){k(E)?b.lhs.push(E):b.rhs.push(E)}),b}function C(S,k){var b=e.now();try{return k()}finally{console.log(S+" time: "+(e.now()-b)+"ms")}}function _(S,k){return k()}return km}var Em,Db;function yL(){if(Db)return Em;Db=1;var e=tt(),n=Jt();Em={run:i,undo:o};function i(u){u.graph().dummyChains=[],e.forEach(u.edges(),function(l){s(u,l)})}function s(u,l){var c=l.v,d=u.node(c).rank,p=l.w,h=u.node(p).rank,m=l.name,y=u.edge(l),x=y.labelRank;if(h!==d+1){u.removeEdge(l);var C,_,S;for(S=0,++d;d<h;++S,++d)y.points=[],_={width:0,height:0,edgeLabel:y,edgeObj:l,rank:d},C=n.addDummyNode(u,"edge",_,"_d"),d===x&&(_.width=y.width,_.height=y.height,_.dummy="edge-label",_.labelpos=y.labelpos),u.setEdge(c,C,{weight:y.weight},m),S===0&&u.graph().dummyChains.push(C),c=C;u.setEdge(c,p,{weight:y.weight},m)}}function o(u){e.forEach(u.graph().dummyChains,function(l){var c=u.node(l),d=c.edgeLabel,p;for(u.setEdge(c.edgeObj,d);c.dummy;)p=u.successors(l)[0],u.removeNode(l),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),l=p,c=u.node(l)})}return Em}var Nm,Fb;function au(){if(Fb)return Nm;Fb=1;var e=tt();Nm={longestPath:n,slack:i};function n(s){var o={};function u(l){var c=s.node(l);if(e.has(o,l))return c.rank;o[l]=!0;var d=e.min(e.map(s.outEdges(l),function(p){return u(p.w)-s.edge(p).minlen}));return(d===Number.POSITIVE_INFINITY||d===void 0||d===null)&&(d=0),c.rank=d}e.forEach(s.sources(),u)}function i(s,o){return s.node(o.w).rank-s.node(o.v).rank-s.edge(o).minlen}return Nm}var Cm,zb;function VN(){if(zb)return Cm;zb=1;var e=tt(),n=qn().Graph,i=au().slack;Cm=s;function s(c){var d=new n({directed:!1}),p=c.nodes()[0],h=c.nodeCount();d.setNode(p,{});for(var m,y;o(d,c)<h;)m=u(d,c),y=d.hasNode(m.v)?i(c,m):-i(c,m),l(d,c,y);return d}function o(c,d){function p(h){e.forEach(d.nodeEdges(h),function(m){var y=m.v,x=h===y?m.w:y;!c.hasNode(x)&&!i(d,m)&&(c.setNode(x,{}),c.setEdge(h,x,{}),p(x))})}return e.forEach(c.nodes(),p),c.nodeCount()}function u(c,d){return e.minBy(d.edges(),function(p){if(c.hasNode(p.v)!==c.hasNode(p.w))return i(d,p)})}function l(c,d,p){e.forEach(c.nodes(),function(h){d.node(h).rank+=p})}return Cm}var Tm,Bb;function wL(){if(Bb)return Tm;Bb=1;var e=tt(),n=VN(),i=au().slack,s=au().longestPath,o=qn().alg.preorder,u=qn().alg.postorder,l=Jt().simplify;Tm=c,c.initLowLimValues=m,c.initCutValues=d,c.calcCutValue=h,c.leaveEdge=x,c.enterEdge=C,c.exchangeEdges=_;function c(E){E=l(E),s(E);var N=n(E);m(N),d(N,E);for(var j,I;j=x(N);)I=C(N,E,j),_(N,E,j,I)}function d(E,N){var j=u(E,E.nodes());j=j.slice(0,j.length-1),e.forEach(j,function(I){p(E,N,I)})}function p(E,N,j){var I=E.node(j),P=I.parent;E.edge(j,P).cutvalue=h(E,N,j)}function h(E,N,j){var I=E.node(j),P=I.parent,B=!0,M=N.edge(j,P),F=0;return M||(B=!1,M=N.edge(P,j)),F=M.weight,e.forEach(N.nodeEdges(j),function(O){var Q=O.v===j,X=Q?O.w:O.v;if(X!==P){var R=Q===B,K=N.edge(O).weight;if(F+=R?K:-K,k(E,j,X)){var H=E.edge(j,X).cutvalue;F+=R?-H:H}}}),F}function m(E,N){arguments.length<2&&(N=E.nodes()[0]),y(E,{},1,N)}function y(E,N,j,I,P){var B=j,M=E.node(I);return N[I]=!0,e.forEach(E.neighbors(I),function(F){e.has(N,F)||(j=y(E,N,j,F,I))}),M.low=B,M.lim=j++,P?M.parent=P:delete M.parent,j}function x(E){return e.find(E.edges(),function(N){return E.edge(N).cutvalue<0})}function C(E,N,j){var I=j.v,P=j.w;N.hasEdge(I,P)||(I=j.w,P=j.v);var B=E.node(I),M=E.node(P),F=B,O=!1;B.lim>M.lim&&(F=M,O=!0);var Q=e.filter(N.edges(),function(X){return O===b(E,E.node(X.v),F)&&O!==b(E,E.node(X.w),F)});return e.minBy(Q,function(X){return i(N,X)})}function _(E,N,j,I){var P=j.v,B=j.w;E.removeEdge(P,B),E.setEdge(I.v,I.w,{}),m(E),d(E,N),S(E,N)}function S(E,N){var j=e.find(E.nodes(),function(P){return!N.node(P).parent}),I=o(E,j);I=I.slice(1),e.forEach(I,function(P){var B=E.node(P).parent,M=N.edge(P,B),F=!1;M||(M=N.edge(B,P),F=!0),N.node(P).rank=N.node(B).rank+(F?M.minlen:-M.minlen)})}function k(E,N,j){return E.hasEdge(N,j)}function b(E,N,j){return j.low<=N.lim&&N.lim<=j.lim}return Tm}var Rm,Ub;function xL(){if(Ub)return Rm;Ub=1;var e=au(),n=e.longestPath,i=VN(),s=wL();Rm=o;function o(d){switch(d.graph().ranker){case"network-simplex":c(d);break;case"tight-tree":l(d);break;case"longest-path":u(d);break;default:c(d)}}var u=n;function l(d){n(d),i(d)}function c(d){s(d)}return Rm}var jm,Hb;function _L(){if(Hb)return jm;Hb=1;var e=tt();jm=n;function n(o){var u=s(o);e.forEach(o.graph().dummyChains,function(l){for(var c=o.node(l),d=c.edgeObj,p=i(o,u,d.v,d.w),h=p.path,m=p.lca,y=0,x=h[y],C=!0;l!==d.w;){if(c=o.node(l),C){for(;(x=h[y])!==m&&o.node(x).maxRank<c.rank;)y++;x===m&&(C=!1)}if(!C){for(;y<h.length-1&&o.node(x=h[y+1]).minRank<=c.rank;)y++;x=h[y]}o.setParent(l,x),l=o.successors(l)[0]}})}function i(o,u,l,c){var d=[],p=[],h=Math.min(u[l].low,u[c].low),m=Math.max(u[l].lim,u[c].lim),y,x;y=l;do y=o.parent(y),d.push(y);while(y&&(u[y].low>h||m>u[y].lim));for(x=y,y=c;(y=o.parent(y))!==x;)p.push(y);return{path:d.concat(p.reverse()),lca:x}}function s(o){var u={},l=0;function c(d){var p=l;e.forEach(o.children(d),c),u[d]={low:p,lim:l++}}return e.forEach(o.children(),c),u}return jm}var Am,Vb;function SL(){if(Vb)return Am;Vb=1;var e=tt(),n=Jt();Am={run:i,cleanup:l};function i(c){var d=n.addDummyNode(c,"root",{},"_root"),p=o(c),h=e.max(e.values(p))-1,m=2*h+1;c.graph().nestingRoot=d,e.forEach(c.edges(),function(x){c.edge(x).minlen*=m});var y=u(c)+1;e.forEach(c.children(),function(x){s(c,d,m,y,h,p,x)}),c.graph().nodeRankFactor=m}function s(c,d,p,h,m,y,x){var C=c.children(x);if(!C.length){x!==d&&c.setEdge(d,x,{weight:0,minlen:p});return}var _=n.addBorderNode(c,"_bt"),S=n.addBorderNode(c,"_bb"),k=c.node(x);c.setParent(_,x),k.borderTop=_,c.setParent(S,x),k.borderBottom=S,e.forEach(C,function(b){s(c,d,p,h,m,y,b);var E=c.node(b),N=E.borderTop?E.borderTop:b,j=E.borderBottom?E.borderBottom:b,I=E.borderTop?h:2*h,P=N!==j?1:m-y[x]+1;c.setEdge(_,N,{weight:I,minlen:P,nestingEdge:!0}),c.setEdge(j,S,{weight:I,minlen:P,nestingEdge:!0})}),c.parent(x)||c.setEdge(d,_,{weight:0,minlen:m+y[x]})}function o(c){var d={};function p(h,m){var y=c.children(h);y&&y.length&&e.forEach(y,function(x){p(x,m+1)}),d[h]=m}return e.forEach(c.children(),function(h){p(h,1)}),d}function u(c){return e.reduce(c.edges(),function(d,p){return d+c.edge(p).weight},0)}function l(c){var d=c.graph();c.removeNode(d.nestingRoot),delete d.nestingRoot,e.forEach(c.edges(),function(p){var h=c.edge(p);h.nestingEdge&&c.removeEdge(p)})}return Am}var Im,Wb;function bL(){if(Wb)return Im;Wb=1;var e=tt(),n=Jt();Im=i;function i(o){function u(l){var c=o.children(l),d=o.node(l);if(c.length&&e.forEach(c,u),e.has(d,"minRank")){d.borderLeft=[],d.borderRight=[];for(var p=d.minRank,h=d.maxRank+1;p<h;++p)s(o,"borderLeft","_bl",l,d,p),s(o,"borderRight","_br",l,d,p)}}e.forEach(o.children(),u)}function s(o,u,l,c,d,p){var h={width:0,height:0,rank:p,borderType:u},m=d[u][p-1],y=n.addDummyNode(o,"border",h,l);d[u][p]=y,o.setParent(y,c),m&&o.setEdge(m,y,{weight:1})}return Im}var Mm,Gb;function kL(){if(Gb)return Mm;Gb=1;var e=tt();Mm={adjust:n,undo:i};function n(p){var h=p.graph().rankdir.toLowerCase();(h==="lr"||h==="rl")&&s(p)}function i(p){var h=p.graph().rankdir.toLowerCase();(h==="bt"||h==="rl")&&u(p),(h==="lr"||h==="rl")&&(c(p),s(p))}function s(p){e.forEach(p.nodes(),function(h){o(p.node(h))}),e.forEach(p.edges(),function(h){o(p.edge(h))})}function o(p){var h=p.width;p.width=p.height,p.height=h}function u(p){e.forEach(p.nodes(),function(h){l(p.node(h))}),e.forEach(p.edges(),function(h){var m=p.edge(h);e.forEach(m.points,l),e.has(m,"y")&&l(m)})}function l(p){p.y=-p.y}function c(p){e.forEach(p.nodes(),function(h){d(p.node(h))}),e.forEach(p.edges(),function(h){var m=p.edge(h);e.forEach(m.points,d),e.has(m,"x")&&d(m)})}function d(p){var h=p.x;p.x=p.y,p.y=h}return Mm}var Pm,Kb;function EL(){if(Kb)return Pm;Kb=1;var e=tt();Pm=n;function n(i){var s={},o=e.filter(i.nodes(),function(p){return!i.children(p).length}),u=e.max(e.map(o,function(p){return i.node(p).rank})),l=e.map(e.range(u+1),function(){return[]});function c(p){if(!e.has(s,p)){s[p]=!0;var h=i.node(p);l[h.rank].push(p),e.forEach(i.successors(p),c)}}var d=e.sortBy(o,function(p){return i.node(p).rank});return e.forEach(d,c),l}return Pm}var qm,Yb;function NL(){if(Yb)return qm;Yb=1;var e=tt();qm=n;function n(s,o){for(var u=0,l=1;l<o.length;++l)u+=i(s,o[l-1],o[l]);return u}function i(s,o,u){for(var l=e.zipObject(u,e.map(u,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:l[x.w],weight:s.edge(x).weight}}),"pos")}),!0),d=1;d<u.length;)d<<=1;var p=2*d-1;d-=1;var h=e.map(new Array(p),function(){return 0}),m=0;return e.forEach(c.forEach(function(y){var x=y.pos+d;h[x]+=y.weight;for(var C=0;x>0;)x%2&&(C+=h[x+1]),x=x-1>>1,h[x]+=y.weight;m+=y.weight*C})),m}return qm}var Om,Xb;function CL(){if(Xb)return Om;Xb=1;var e=tt();Om=n;function n(i,s){return e.map(s,function(o){var u=i.inEdges(o);if(u.length){var l=e.reduce(u,function(c,d){var p=i.edge(d),h=i.node(d.v);return{sum:c.sum+p.weight*h.order,weight:c.weight+p.weight}},{sum:0,weight:0});return{v:o,barycenter:l.sum/l.weight,weight:l.weight}}else return{v:o}})}return Om}var Lm,Qb;function TL(){if(Qb)return Lm;Qb=1;var e=tt();Lm=n;function n(o,u){var l={};e.forEach(o,function(d,p){var h=l[d.v]={indegree:0,in:[],out:[],vs:[d.v],i:p};e.isUndefined(d.barycenter)||(h.barycenter=d.barycenter,h.weight=d.weight)}),e.forEach(u.edges(),function(d){var p=l[d.v],h=l[d.w];!e.isUndefined(p)&&!e.isUndefined(h)&&(h.indegree++,p.out.push(l[d.w]))});var c=e.filter(l,function(d){return!d.indegree});return i(c)}function i(o){var u=[];function l(p){return function(h){h.merged||(e.isUndefined(h.barycenter)||e.isUndefined(p.barycenter)||h.barycenter>=p.barycenter)&&s(p,h)}}function c(p){return function(h){h.in.push(p),--h.indegree===0&&o.push(h)}}for(;o.length;){var d=o.pop();u.push(d),e.forEach(d.in.reverse(),l(d)),e.forEach(d.out,c(d))}return e.map(e.filter(u,function(p){return!p.merged}),function(p){return e.pick(p,["vs","i","barycenter","weight"])})}function s(o,u){var l=0,c=0;o.weight&&(l+=o.barycenter*o.weight,c+=o.weight),u.weight&&(l+=u.barycenter*u.weight,c+=u.weight),o.vs=u.vs.concat(o.vs),o.barycenter=l/c,o.weight=c,o.i=Math.min(u.i,o.i),u.merged=!0}return Lm}var $m,Zb;function RL(){if(Zb)return $m;Zb=1;var e=tt(),n=Jt();$m=i;function i(u,l){var c=n.partition(u,function(_){return e.has(_,"barycenter")}),d=c.lhs,p=e.sortBy(c.rhs,function(_){return-_.i}),h=[],m=0,y=0,x=0;d.sort(o(!!l)),x=s(h,p,x),e.forEach(d,function(_){x+=_.vs.length,h.push(_.vs),m+=_.barycenter*_.weight,y+=_.weight,x=s(h,p,x)});var C={vs:e.flatten(h,!0)};return y&&(C.barycenter=m/y,C.weight=y),C}function s(u,l,c){for(var d;l.length&&(d=e.last(l)).i<=c;)l.pop(),u.push(d.vs),c++;return c}function o(u){return function(l,c){return l.barycenter<c.barycenter?-1:l.barycenter>c.barycenter?1:u?c.i-l.i:l.i-c.i}}return $m}var Dm,Jb;function jL(){if(Jb)return Dm;Jb=1;var e=tt(),n=CL(),i=TL(),s=RL();Dm=o;function o(c,d,p,h){var m=c.children(d),y=c.node(d),x=y?y.borderLeft:void 0,C=y?y.borderRight:void 0,_={};x&&(m=e.filter(m,function(j){return j!==x&&j!==C}));var S=n(c,m);e.forEach(S,function(j){if(c.children(j.v).length){var I=o(c,j.v,p,h);_[j.v]=I,e.has(I,"barycenter")&&l(j,I)}});var k=i(S,p);u(k,_);var b=s(k,h);if(x&&(b.vs=e.flatten([x,b.vs,C],!0),c.predecessors(x).length)){var E=c.node(c.predecessors(x)[0]),N=c.node(c.predecessors(C)[0]);e.has(b,"barycenter")||(b.barycenter=0,b.weight=0),b.barycenter=(b.barycenter*b.weight+E.order+N.order)/(b.weight+2),b.weight+=2}return b}function u(c,d){e.forEach(c,function(p){p.vs=e.flatten(p.vs.map(function(h){return d[h]?d[h].vs:h}),!0)})}function l(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 Dm}var Fm,ek;function AL(){if(ek)return Fm;ek=1;var e=tt(),n=qn().Graph;Fm=i;function i(o,u,l){var c=s(o),d=new n({compound:!0}).setGraph({root:c}).setDefaultNodeLabel(function(p){return o.node(p)});return e.forEach(o.nodes(),function(p){var h=o.node(p),m=o.parent(p);(h.rank===u||h.minRank<=u&&u<=h.maxRank)&&(d.setNode(p),d.setParent(p,m||c),e.forEach(o[l](p),function(y){var x=y.v===p?y.w:y.v,C=d.edge(x,p),_=e.isUndefined(C)?0:C.weight;d.setEdge(x,p,{weight:o.edge(y).weight+_})}),e.has(h,"minRank")&&d.setNode(p,{borderLeft:h.borderLeft[u],borderRight:h.borderRight[u]}))}),d}function s(o){for(var u;o.hasNode(u=e.uniqueId("_root")););return u}return Fm}var zm,tk;function IL(){if(tk)return zm;tk=1;var e=tt();zm=n;function n(i,s,o){var u={},l;e.forEach(o,function(c){for(var d=i.parent(c),p,h;d;){if(p=i.parent(d),p?(h=u[p],u[p]=d):(h=l,l=d),h&&h!==d){s.setEdge(h,d);return}d=p}})}return zm}var Bm,nk;function ML(){if(nk)return Bm;nk=1;var e=tt(),n=EL(),i=NL(),s=jL(),o=AL(),u=IL(),l=qn().Graph,c=Jt();Bm=d;function d(y){var x=c.maxRank(y),C=p(y,e.range(1,x+1),"inEdges"),_=p(y,e.range(x-1,-1,-1),"outEdges"),S=n(y);m(y,S);for(var k=Number.POSITIVE_INFINITY,b,E=0,N=0;N<4;++E,++N){h(E%2?C:_,E%4>=2),S=c.buildLayerMatrix(y);var j=i(y,S);j<k&&(N=0,b=e.cloneDeep(S),k=j)}m(y,b)}function p(y,x,C){return e.map(x,function(_){return o(y,_,C)})}function h(y,x){var C=new l;e.forEach(y,function(_){var S=_.graph().root,k=s(_,S,C,x);e.forEach(k.vs,function(b,E){_.node(b).order=E}),u(_,C,k.vs)})}function m(y,x){e.forEach(x,function(C){e.forEach(C,function(_,S){y.node(_).order=S})})}return Bm}var Um,rk;function PL(){if(rk)return Um;rk=1;var e=tt(),n=qn().Graph,i=Jt();Um={positionX:C,findType1Conflicts:s,findType2Conflicts:o,addConflict:l,hasConflict:c,verticalAlignment:d,horizontalCompaction:p,alignCoordinates:y,findSmallestWidthAlignment:m,balance:x};function s(k,b){var E={};function N(j,I){var P=0,B=0,M=j.length,F=e.last(I);return e.forEach(I,function(O,Q){var X=u(k,O),R=X?k.node(X).order:M;(X||O===F)&&(e.forEach(I.slice(B,Q+1),function(K){e.forEach(k.predecessors(K),function(H){var te=k.node(H),Y=te.order;(Y<P||R<Y)&&!(te.dummy&&k.node(K).dummy)&&l(E,H,K)})}),B=Q+1,P=R)}),I}return e.reduce(b,N),E}function o(k,b){var E={};function N(I,P,B,M,F){var O;e.forEach(e.range(P,B),function(Q){O=I[Q],k.node(O).dummy&&e.forEach(k.predecessors(O),function(X){var R=k.node(X);R.dummy&&(R.order<M||R.order>F)&&l(E,X,O)})})}function j(I,P){var B=-1,M,F=0;return e.forEach(P,function(O,Q){if(k.node(O).dummy==="border"){var X=k.predecessors(O);X.length&&(M=k.node(X[0]).order,N(P,F,Q,B,M),F=Q,B=M)}N(P,F,P.length,M,I.length)}),P}return e.reduce(b,j),E}function u(k,b){if(k.node(b).dummy)return e.find(k.predecessors(b),function(E){return k.node(E).dummy})}function l(k,b,E){if(b>E){var N=b;b=E,E=N}var j=k[b];j||(k[b]=j={}),j[E]=!0}function c(k,b,E){if(b>E){var N=b;b=E,E=N}return e.has(k[b],E)}function d(k,b,E,N){var j={},I={},P={};return e.forEach(b,function(B){e.forEach(B,function(M,F){j[M]=M,I[M]=M,P[M]=F})}),e.forEach(b,function(B){var M=-1;e.forEach(B,function(F){var O=N(F);if(O.length){O=e.sortBy(O,function(H){return P[H]});for(var Q=(O.length-1)/2,X=Math.floor(Q),R=Math.ceil(Q);X<=R;++X){var K=O[X];I[F]===F&&M<P[K]&&!c(E,F,K)&&(I[K]=F,I[F]=j[F]=j[K],M=P[K])}}})}),{root:j,align:I}}function p(k,b,E,N,j){var I={},P=h(k,b,E,j),B=j?"borderLeft":"borderRight";function M(Q,X){for(var R=P.nodes(),K=R.pop(),H={};K;)H[K]?Q(K):(H[K]=!0,R.push(K),R=R.concat(X(K))),K=R.pop()}function F(Q){I[Q]=P.inEdges(Q).reduce(function(X,R){return Math.max(X,I[R.v]+P.edge(R))},0)}function O(Q){var X=P.outEdges(Q).reduce(function(K,H){return Math.min(K,I[H.w]-P.edge(H))},Number.POSITIVE_INFINITY),R=k.node(Q);X!==Number.POSITIVE_INFINITY&&R.borderType!==B&&(I[Q]=Math.max(I[Q],X))}return M(F,P.predecessors.bind(P)),M(O,P.successors.bind(P)),e.forEach(N,function(Q){I[Q]=I[E[Q]]}),I}function h(k,b,E,N){var j=new n,I=k.graph(),P=_(I.nodesep,I.edgesep,N);return e.forEach(b,function(B){var M;e.forEach(B,function(F){var O=E[F];if(j.setNode(O),M){var Q=E[M],X=j.edge(Q,O);j.setEdge(Q,O,Math.max(P(k,F,M),X||0))}M=F})}),j}function m(k,b){return e.minBy(e.values(b),function(E){var N=Number.NEGATIVE_INFINITY,j=Number.POSITIVE_INFINITY;return e.forIn(E,function(I,P){var B=S(k,P)/2;N=Math.max(I+B,N),j=Math.min(I-B,j)}),N-j})}function y(k,b){var E=e.values(b),N=e.min(E),j=e.max(E);e.forEach(["u","d"],function(I){e.forEach(["l","r"],function(P){var B=I+P,M=k[B],F;if(M!==b){var O=e.values(M);F=P==="l"?N-e.min(O):j-e.max(O),F&&(k[B]=e.mapValues(M,function(Q){return Q+F}))}})})}function x(k,b){return e.mapValues(k.ul,function(E,N){if(b)return k[b.toLowerCase()][N];var j=e.sortBy(e.map(k,N));return(j[1]+j[2])/2})}function C(k){var b=i.buildLayerMatrix(k),E=e.merge(s(k,b),o(k,b)),N={},j;e.forEach(["u","d"],function(P){j=P==="u"?b:e.values(b).reverse(),e.forEach(["l","r"],function(B){B==="r"&&(j=e.map(j,function(Q){return e.values(Q).reverse()}));var M=(P==="u"?k.predecessors:k.successors).bind(k),F=d(k,j,E,M),O=p(k,j,F.root,F.align,B==="r");B==="r"&&(O=e.mapValues(O,function(Q){return-Q})),N[P+B]=O})});var I=m(k,N);return y(N,I),x(N,k.graph().align)}function _(k,b,E){return function(N,j,I){var P=N.node(j),B=N.node(I),M=0,F;if(M+=P.width/2,e.has(P,"labelpos"))switch(P.labelpos.toLowerCase()){case"l":F=-P.width/2;break;case"r":F=P.width/2;break}if(F&&(M+=E?F:-F),F=0,M+=(P.dummy?b:k)/2,M+=(B.dummy?b:k)/2,M+=B.width/2,e.has(B,"labelpos"))switch(B.labelpos.toLowerCase()){case"l":F=B.width/2;break;case"r":F=-B.width/2;break}return F&&(M+=E?F:-F),F=0,M}}function S(k,b){return k.node(b).width}return Um}var Hm,ik;function qL(){if(ik)return Hm;ik=1;var e=tt(),n=Jt(),i=PL().positionX;Hm=s;function s(u){u=n.asNonCompoundGraph(u),o(u),e.forEach(i(u),function(l,c){u.node(c).x=l})}function o(u){var l=n.buildLayerMatrix(u),c=u.graph().ranksep,d=0;e.forEach(l,function(p){var h=e.max(e.map(p,function(m){return u.node(m).height}));e.forEach(p,function(m){u.node(m).y=d+h/2}),d+=h+c})}return Hm}var Vm,sk;function OL(){if(sk)return Vm;sk=1;var e=tt(),n=vL(),i=yL(),s=xL(),o=Jt().normalizeRanks,u=_L(),l=Jt().removeEmptyRanks,c=SL(),d=bL(),p=kL(),h=ML(),m=qL(),y=Jt(),x=qn().Graph;Vm=C;function C(D,V){var J=V&&V.debugTiming?y.time:y.notime;J("layout",function(){var se=J(" buildLayoutGraph",function(){return M(D)});J(" runLayout",function(){_(se,J)}),J(" updateInputGraph",function(){S(D,se)})})}function _(D,V){V(" makeSpaceForEdgeLabels",function(){F(D)}),V(" removeSelfEdges",function(){$(D)}),V(" acyclic",function(){n.run(D)}),V(" nestingGraph.run",function(){c.run(D)}),V(" rank",function(){s(y.asNonCompoundGraph(D))}),V(" injectEdgeLabelProxies",function(){O(D)}),V(" removeEmptyRanks",function(){l(D)}),V(" nestingGraph.cleanup",function(){c.cleanup(D)}),V(" normalizeRanks",function(){o(D)}),V(" assignRankMinMax",function(){Q(D)}),V(" removeEdgeLabelProxies",function(){X(D)}),V(" normalize.run",function(){i.run(D)}),V(" parentDummyChains",function(){u(D)}),V(" addBorderSegments",function(){d(D)}),V(" order",function(){h(D)}),V(" insertSelfEdges",function(){G(D)}),V(" adjustCoordinateSystem",function(){p.adjust(D)}),V(" position",function(){m(D)}),V(" positionSelfEdges",function(){A(D)}),V(" removeBorderNodes",function(){Y(D)}),V(" normalize.undo",function(){i.undo(D)}),V(" fixupEdgeLabelCoords",function(){H(D)}),V(" undoCoordinateSystem",function(){p.undo(D)}),V(" translateGraph",function(){R(D)}),V(" assignNodeIntersects",function(){K(D)}),V(" reversePoints",function(){te(D)}),V(" acyclic.undo",function(){n.undo(D)})}function S(D,V){e.forEach(D.nodes(),function(J){var se=D.node(J),ue=V.node(J);se&&(se.x=ue.x,se.y=ue.y,V.children(J).length&&(se.width=ue.width,se.height=ue.height))}),e.forEach(D.edges(),function(J){var se=D.edge(J),ue=V.edge(J);se.points=ue.points,e.has(ue,"x")&&(se.x=ue.x,se.y=ue.y)}),D.graph().width=V.graph().width,D.graph().height=V.graph().height}var k=["nodesep","edgesep","ranksep","marginx","marginy"],b={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},E=["acyclicer","ranker","rankdir","align"],N=["width","height"],j={width:0,height:0},I=["minlen","weight","width","height","labeloffset"],P={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},B=["labelpos"];function M(D){var V=new x({multigraph:!0,compound:!0}),J=ae(D.graph());return V.setGraph(e.merge({},b,z(J,k),e.pick(J,E))),e.forEach(D.nodes(),function(se){var ue=ae(D.node(se));V.setNode(se,e.defaults(z(ue,N),j)),V.setParent(se,D.parent(se))}),e.forEach(D.edges(),function(se){var ue=ae(D.edge(se));V.setEdge(se,e.merge({},P,z(ue,I),e.pick(ue,B)))}),V}function F(D){var V=D.graph();V.ranksep/=2,e.forEach(D.edges(),function(J){var se=D.edge(J);se.minlen*=2,se.labelpos.toLowerCase()!=="c"&&(V.rankdir==="TB"||V.rankdir==="BT"?se.width+=se.labeloffset:se.height+=se.labeloffset)})}function O(D){e.forEach(D.edges(),function(V){var J=D.edge(V);if(J.width&&J.height){var se=D.node(V.v),ue=D.node(V.w),he={rank:(ue.rank-se.rank)/2+se.rank,e:V};y.addDummyNode(D,"edge-proxy",he,"_ep")}})}function Q(D){var V=0;e.forEach(D.nodes(),function(J){var se=D.node(J);se.borderTop&&(se.minRank=D.node(se.borderTop).rank,se.maxRank=D.node(se.borderBottom).rank,V=e.max(V,se.maxRank))}),D.graph().maxRank=V}function X(D){e.forEach(D.nodes(),function(V){var J=D.node(V);J.dummy==="edge-proxy"&&(D.edge(J.e).labelRank=J.rank,D.removeNode(V))})}function R(D){var V=Number.POSITIVE_INFINITY,J=0,se=Number.POSITIVE_INFINITY,ue=0,he=D.graph(),me=he.marginx||0,je=he.marginy||0;function De(Me){var Ie=Me.x,ke=Me.y,Ge=Me.width,ye=Me.height;V=Math.min(V,Ie-Ge/2),J=Math.max(J,Ie+Ge/2),se=Math.min(se,ke-ye/2),ue=Math.max(ue,ke+ye/2)}e.forEach(D.nodes(),function(Me){De(D.node(Me))}),e.forEach(D.edges(),function(Me){var Ie=D.edge(Me);e.has(Ie,"x")&&De(Ie)}),V-=me,se-=je,e.forEach(D.nodes(),function(Me){var Ie=D.node(Me);Ie.x-=V,Ie.y-=se}),e.forEach(D.edges(),function(Me){var Ie=D.edge(Me);e.forEach(Ie.points,function(ke){ke.x-=V,ke.y-=se}),e.has(Ie,"x")&&(Ie.x-=V),e.has(Ie,"y")&&(Ie.y-=se)}),he.width=J-V+me,he.height=ue-se+je}function K(D){e.forEach(D.edges(),function(V){var J=D.edge(V),se=D.node(V.v),ue=D.node(V.w),he,me;J.points?(he=J.points[0],me=J.points[J.points.length-1]):(J.points=[],he=ue,me=se),J.points.unshift(y.intersectRect(se,he)),J.points.push(y.intersectRect(ue,me))})}function H(D){e.forEach(D.edges(),function(V){var J=D.edge(V);if(e.has(J,"x"))switch((J.labelpos==="l"||J.labelpos==="r")&&(J.width-=J.labeloffset),J.labelpos){case"l":J.x-=J.width/2+J.labeloffset;break;case"r":J.x+=J.width/2+J.labeloffset;break}})}function te(D){e.forEach(D.edges(),function(V){var J=D.edge(V);J.reversed&&J.points.reverse()})}function Y(D){e.forEach(D.nodes(),function(V){if(D.children(V).length){var J=D.node(V),se=D.node(J.borderTop),ue=D.node(J.borderBottom),he=D.node(e.last(J.borderLeft)),me=D.node(e.last(J.borderRight));J.width=Math.abs(me.x-he.x),J.height=Math.abs(ue.y-se.y),J.x=he.x+J.width/2,J.y=se.y+J.height/2}}),e.forEach(D.nodes(),function(V){D.node(V).dummy==="border"&&D.removeNode(V)})}function $(D){e.forEach(D.edges(),function(V){if(V.v===V.w){var J=D.node(V.v);J.selfEdges||(J.selfEdges=[]),J.selfEdges.push({e:V,label:D.edge(V)}),D.removeEdge(V)}})}function G(D){var V=y.buildLayerMatrix(D);e.forEach(V,function(J){var se=0;e.forEach(J,function(ue,he){var me=D.node(ue);me.order=he+se,e.forEach(me.selfEdges,function(je){y.addDummyNode(D,"selfedge",{width:je.label.width,height:je.label.height,rank:me.rank,order:he+ ++se,e:je.e,label:je.label},"_se")}),delete me.selfEdges})})}function A(D){e.forEach(D.nodes(),function(V){var J=D.node(V);if(J.dummy==="selfedge"){var se=D.node(J.e.v),ue=se.x+se.width/2,he=se.y,me=J.x-ue,je=se.height/2;D.setEdge(J.e,J.label),D.removeNode(V),J.label.points=[{x:ue+2*me/3,y:he-je},{x:ue+5*me/6,y:he-je},{x:ue+me,y:he},{x:ue+5*me/6,y:he+je},{x:ue+2*me/3,y:he+je}],J.label.x=J.x,J.label.y=J.y}})}function z(D,V){return e.mapValues(e.pick(D,V),Number)}function ae(D){var V={};return e.forEach(D,function(J,se){V[se.toLowerCase()]=J}),V}return Vm}var Wm,ok;function LL(){if(ok)return Wm;ok=1;var e=tt(),n=Jt(),i=qn().Graph;Wm={debugOrdering:s};function s(o){var u=n.buildLayerMatrix(o),l=new i({compound:!0,multigraph:!0}).setGraph({});return e.forEach(o.nodes(),function(c){l.setNode(c,{label:c}),l.setParent(c,"layer"+o.node(c).rank)}),e.forEach(o.edges(),function(c){l.setEdge(c.v,c.w,{},c.name)}),e.forEach(u,function(c,d){var p="layer"+d;l.setNode(p,{rank:"same"}),e.reduce(c,function(h,m){return l.setEdge(h,m,{style:"invis"}),m})}),l}return Wm}var Gm,ak;function $L(){return ak||(ak=1,Gm="0.8.5"),Gm}var Km,uk;function DL(){return uk||(uk=1,Km={graphlib:qn(),layout:OL(),debug:LL(),util:{time:Jt().time,notime:Jt().notime},version:$L()}),Km}var FL=DL();const lk=yg(FL),Ka=240,Ya=130,zL=74,BL=zL+36;function UL(e){var i;return((i=e.data)==null?void 0:i.sessionId)??"_default"}function HL(e,n,i,s,o){const u=new lk.graphlib.Graph;u.setDefaultEdgeLabel(()=>({})),u.setGraph({rankdir:i,marginx:0,marginy:0,nodesep:70,ranksep:160,edgesep:30});const l=e.filter(_=>!o.has(_)),c=new Set(l);for(const _ of l){const S=s.get(_);u.setNode(_,{width:(S==null?void 0:S.width)??Ka,height:(S==null?void 0:S.height)??Ya})}for(const _ of n)c.has(_.source)&&c.has(_.target)&&u.setEdge(_.source,_.target);lk.layout(u);const d=new Map;let p=1/0,h=1/0,m=-1/0,y=-1/0;for(const _ of l){const S=u.node(_);if(!S)continue;const k=s.get(_),b=(k==null?void 0:k.width)??Ka,E=(k==null?void 0:k.height)??Ya,N=S.x-b/2,j=S.y-E/2;d.set(_,{x:N,y:j}),N<p&&(p=N),j<h&&(h=j),N+b>m&&(m=N+b),j+E>y&&(y=j+E)}if(Number.isFinite(p)&&Number.isFinite(h))for(const[_,S]of d)d.set(_,{x:S.x-p,y:S.y-h});let x=Number.isFinite(m)?m-p:0,C=Number.isFinite(y)?y-h:0;for(const _ of e){const S=o.get(_);if(!S)continue;const k=s.get(_);x=Math.max(x,S.x+((k==null?void 0:k.width)??Ka)),C=Math.max(C,S.y+((k==null?void 0:k.height)??Ya))}return{positions:d,width:x,height:C}}function VL(e,n,i={}){const s=i.direction??"LR",o=i.pinned??new Map,u=i.measured??new Map,l=new Map;for(const h of e){const m=UL(h),y=l.get(m);y?y.push(h.id):l.set(m,[h.id])}const c=Array.from(l.keys()).sort(),d=new Map;let p=0;for(const h of c){const m=l.get(h),{positions:y,height:x}=HL(m,n,s,u,o);for(const[C,_]of y)d.set(C,{x:_.x,y:_.y+p});p+=x+BL}return e.map(h=>{const m=o.get(h.id);if(m)return{...h,position:m};const y=d.get(h.id);return y?{...h,position:y}:h})}function WL(e,n,i,s){const u=p=>{const h=s.get(p);return{w:(h==null?void 0:h.width)??Ka,h:(h==null?void 0:h.height)??Ya}},l=[],c=e.map(p=>({id:p.id,pos:i.get(p.id)??n.get(p.id)})).filter(p=>p.pos!=null).sort((p,h)=>p.pos.y-h.pos.y||p.pos.x-h.pos.x||p.id.localeCompare(h.id)),d=[];for(const{id:p,pos:h}of c){const{w:m,h:y}=u(p);if(i.has(p)){l.push({x:h.x,y:h.y,w:m,h:y});continue}let x=h.y;for(let C=0;C<l.length+1;C++){const _=l.find(S=>h.x<S.x+S.w+24&&S.x<h.x+m+24&&x<S.y+S.h+24&&S.y<x+y+24);if(!_)break;x=_.y+_.h+24}x!==h.y&&(n.set(p,{x:h.x,y:x}),d.push(p)),l.push({x:h.x,y:x,w:m,h:y})}return d}const GL=600;function mg(e,n){return!(e.exitAt!=null&&n-e.exitAt>GL||e.kind==="root"&&e.state==="done"&&e.tools.length===0&&e.endedAt!=null&&e.endedAt-e.startedAt<3e3)}function KL(e,n){const i=new Set;for(const s of e.agents.values())mg(s,n)&&i.add(s.id);return i}function li(e){return typeof window>"u"?"":getComputedStyle(document.documentElement).getPropertyValue(e).trim()||""}function YL(e){return e<1e3?`${e}`:e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(2)}M`}const XL={agent:pP,sessionGroup:EP},Ua=18,QL=9e4,ZL=200,JL=5*6e4,e$=6,t$=2*6e4,rv="agent-dag.layout",iv="agent-dag.viewport",WN="agent-dag.summariesDismissed",GN="agent-dag.sessionListOpen",KN="agent-dag.detailOpen",YN="agent-dag.usagePanelOpen",ck="agent-dag.accountsPanelOpen";function n$(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(GN)==="1"}catch{return!1}}function r$(e){if(!(typeof window>"u"))try{window.localStorage.setItem(GN,e?"1":"0")}catch{}}function i$(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(KN)==="1"}catch{return!1}}function s$(e){if(!(typeof window>"u"))try{window.localStorage.setItem(KN,e?"1":"0")}catch{}}function o$(){if(typeof window>"u")return!0;const e=window.localStorage.getItem(YN);try{return e===null?!0:e==="1"}catch{return!0}}function a$(e){if(!(typeof window>"u"))try{window.localStorage.setItem(YN,e?"1":"0")}catch{}}function u$(){if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(WN);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 fk(e){if(!(typeof window>"u"))try{const n=Array.from(e),i=n.length>200?n.slice(-200):n;window.localStorage.setItem(WN,JSON.stringify(i))}catch{}}function l$(){const e={positions:[],pins:[]};if(typeof window>"u")return e;try{const n=window.localStorage.getItem(rv);if(!n)return e;const i=JSON.parse(n);if(!("v"in i)){const o=Object.entries(i).filter(([,u])=>u&&typeof u.x=="number"&&typeof u.y=="number");return{positions:o,pins:o.map(([u])=>u)}}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 Ym(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(rv,JSON.stringify({v:2,positions:i,pins:Array.from(n.keys())}))}catch{}}function c$(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(iv);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 f$(e){if(!(typeof window>"u"))try{window.localStorage.setItem(iv,JSON.stringify(e))}catch{}}function dk(){if(!(typeof window>"u")){try{window.localStorage.removeItem(rv)}catch{}try{window.localStorage.removeItem(iv)}catch{}}}function d$(e,n){const i=e.agents.get(n);if(!i)return;const s=[];for(const h of e.agents.values())h.sessionId===n&&s.push(h);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(h=>({id:h.id,kind:h.kind,label:h.label,parentId:h.parentId,state:h.state,startedAt:h.startedAt,endedAt:h.endedAt,model:h.model,cwd:h.cwd,usage:h.usage,prompts:h.prompts,tools:h.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}))}))},u=JSON.stringify(o,null,2),l=new Blob([u],{type:"application/json"}),c=URL.createObjectURL(l),d=document.createElement("a"),p=(i.label||"session").replace(/[^a-z0-9._-]/gi,"_");d.href=c,d.download=`agents-deck-${p}-${n.slice(0,8)}.json`,document.body.appendChild(d),d.click(),document.body.removeChild(d),setTimeout(()=>URL.revokeObjectURL(c),1e3)}const gg={file:"📁",shell:"⚡",web:"🌐",agent:"🤖",task:"📋",plan:"🧭",mcp:"🔌",other:"✨"},vg={file:"file",shell:"shell",web:"web",agent:"agent",task:"task",plan:"plan",mcp:"mcp",other:"other"},h$={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 XN(e){return e.startsWith("mcp__")?"mcp":h$[e]??"other"}function QN(e,n){var s,o,u;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)||(u=e.firstPrompt)!=null&&u.toLowerCase().includes(i))return!0;for(const l of e.tools)if(l.name.toLowerCase().includes(i))return!0;return!1}function p$(e,n){if(!n)return null;const i=new Set([n]);let s=n;for(;s;){const u=e.agents.get(s);if(!(u!=null&&u.parentId)||i.has(u.parentId))break;i.add(u.parentId),s=u.parentId}let o=!0;for(;o;){o=!1;for(const u of e.agents.values())u.parentId&&i.has(u.parentId)&&!i.has(u.id)&&(i.add(u.id),o=!0)}return i}function m$(e,n,i,s,o,u,l,c,d,p,h,m){const y=[],x=[],C=new Set;if(s)for(const b of e.agents.values())QN(b,s)&&C.add(b.id);for(const b of e.agents.values()){if(!h.has(b.id))continue;const E=s?!C.has(b.id):!1,N=b.exitAt!=null,j=p!=null&&!p.has(b.id),I=[E?"rf-dim":"",N?"rf-exiting":"",j?"rf-spotlit-out":""].filter(Boolean).join(" ")||void 0,P=o.get(b.id);if(y.push({id:b.id,type:"agent",position:{x:0,y:0},data:{...b,now:n,dim:E,onOpenContext:m},className:I,...P?{width:P.width,height:P.height}:null}),b.parentId&&h.has(b.parentId)){const B=Lg(b.sessionId),M=b.state==="active"?`hsl(${B} 80% 72%)`:`hsl(${B} 50% 55%)`,F=s&&!C.has(b.id)&&!C.has(b.parentId),O=N,Q=d.size>0&&(d.has(b.id)||d.has(b.parentId)),X=p!=null&&!p.has(b.id)&&!p.has(b.parentId),R=b.state==="active"?2:1.5,K=Q?R+1.5:R,H=F||O?.2:X?.12:1,te=[O?"rf-edge-exiting":"",Q?"rf-edge-selected":""].filter(Boolean).join(" ")||void 0;x.push({id:`e:${b.parentId}->${b.id}`,source:b.parentId,target:b.id,animated:(b.state==="active"||Q)&&!F&&!O,type:"smoothstep",style:{stroke:M,strokeWidth:K,opacity:H,transition:"opacity 500ms ease, stroke-width 200ms ease"},className:te})}}const _=y.filter(b=>!i.has(b.id)&&!u.has(b.id));if(_.length>0||l!==c.current){if(_.length>0){const b=VL(y,x,{direction:"LR",pinned:i,measured:o});for(const E of b)u.has(E.id)||u.set(E.id,E.position)}WL(y,u,i,o),c.current=l}for(const b of Array.from(u.keys()))e.agents.has(b)||u.delete(b);if(e.agents.size>0)for(const b of Array.from(i.keys()))e.agents.has(b)||i.delete(b);const S=[];let k=!1;for(const b of y){let E=i.get(b.id)??u.get(b.id);E||(E={x:0,y:0},u.set(b.id,E),k=!0),S.push({...b,position:E})}return k&&(c.current=""),{nodes:S,edges:x}}function g$(){return v.jsx(qg,{children:v.jsx(v$,{})})}function v$(){const e=yo(),n=q.useRef(dg()),[,i]=q.useState(0),s=q.useCallback(()=>i(ne=>ne+1),[]),[o,u]=q.useState(()=>new Set),[l,c]=q.useState(null),[d,p]=q.useState(null),h=q.useCallback((ne,ie)=>{u(pe=>{if(!ie)return new Set([ne]);const we=new Set(pe);return we.has(ne)?we.delete(ne):we.add(ne),we}),c(pe=>ie&&pe===ne?pe:ne)},[]),m=q.useCallback(()=>{u(new Set),c(null)},[]),[y,x]=q.useState(null),[C,_]=q.useState(null),S=q.useCallback(ne=>_(ne),[]),k=q.useRef(u$()),[b,E]=q.useState(n$);q.useEffect(()=>{r$(b)},[b]);const[N,j]=q.useState(i$);q.useEffect(()=>{s$(N)},[N]);const[I,P]=q.useState(o$);q.useEffect(()=>{a$(I)},[I]);const[B,M]=q.useState(()=>{try{const ne=window.localStorage.getItem(ck);return ne===null?!0:ne==="1"}catch{return!0}});q.useEffect(()=>{try{window.localStorage.setItem(ck,B?"1":"0")}catch{}},[B]);const[F,O]=q.useState(null),[Q,X]=q.useState(!1),[R,K]=q.useState(0);q.useEffect(()=>{fetch("/api/sound-hook").then(ne=>ne.ok?ne.json():null).then(ne=>{ne!=null&&ne.ok&&(O(ne.enabled===!0),K((ne.foreign??[]).filter(ie=>ie.worksHere).length))}).catch(()=>{})},[]);const H=q.useCallback(async()=>{X(!0);try{const ie=await(await fetch("/api/sound-hook",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:!F})})).json().catch(()=>null);ie!=null&&ie.ok&&O(ie.enabled===!0)}catch{}finally{X(!1)}},[F]),te=q.useCallback(()=>{E(ne=>(ne||M(!1),!ne))},[]),Y=q.useCallback(()=>{M(ne=>(ne||E(!1),!ne))},[]),[$,G]=q.useState(!1),[A,z]=q.useState(0),[ae,D]=q.useState(!1),[V,J]=q.useState(!1),se=q.useRef([]),[ue,he]=q.useState(Date.now()),me=q.useRef(l$()).current;q.useRef(!1);const je=q.useRef(new Map(me.positions.filter(([ne])=>me.pins.includes(ne)))),De=q.useRef(null),Me=q.useState(()=>c$())[0],[Ie,ke]=q.useState(""),[Ge,ye]=q.useState(()=>new Set),[ge,Ue]=q.useState(()=>typeof window>"u"?"dark":window.localStorage.getItem("agent-dag.theme")??"dark"),[mt,wt]=q.useState(!1),st=q.useRef(null);q.useEffect(()=>{document.documentElement.dataset.theme=ge;try{window.localStorage.setItem("agent-dag.theme",ge)}catch{}},[ge]),q.useEffect(()=>{if(!Me)return;const ne=window.setTimeout(()=>{try{e.setViewport(Me,{duration:0})}catch{}},60);return()=>window.clearTimeout(ne)},[e,Me]);const Ke=q.useRef(!0),Be=q.useRef(null);q.useEffect(()=>{const ne=new EventSource("/events");return ne.addEventListener("open",()=>{D(!0),wt(!0)}),ne.addEventListener("error",()=>D(!1)),ne.addEventListener("replay-end",()=>{Ke.current=!1,Be.current!=null&&(window.clearTimeout(Be.current),Be.current=null),s()}),ne.addEventListener("hook",ie=>{try{const pe=JSON.parse(ie.data);if(V){se.current.push(pe);return}n.current=Aw(n.current,pe),pe.replay===!0||Ke.current||Date.now()-pe.receivedAt>3e4?(Be.current!=null&&window.clearTimeout(Be.current),Be.current=window.setTimeout(()=>{Be.current=null,s()},120)):(Be.current!=null&&(window.clearTimeout(Be.current),Be.current=null),s())}catch{}}),()=>{ne.close(),Be.current!=null&&(window.clearTimeout(Be.current),Be.current=null)}},[V,s]),q.useEffect(()=>{if(!V&&se.current.length!==0){for(const ne of se.current)n.current=Aw(n.current,ne);se.current.length=0,s()}},[V,s]),q.useEffect(()=>{const ne=setInterval(()=>{const ie=Date.now();he(ie);let pe=ZM(n.current,ie,QL);XM(n.current,ie,ZL,JL)&&(pe=!0),QM(n.current,ie,e$,t$)&&(pe=!0),pe&&s()},250);return()=>clearInterval(ne)},[s]);const Et=q.useRef(null),ft=q.useRef(0),Nt=q.useRef(""),ot=q.useRef(null),Dt=q.useRef(0),xt=q.useCallback(()=>{Dt.current=Date.now()},[]),We="agent-dag.autoFitDisabled",Ze=q.useRef((()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(We)==="1"}catch{return!1}})()),[at,dt]=q.useState(Ze.current),un=q.useCallback(()=>{if(!Ze.current){Ze.current=!0,dt(!0);try{window.localStorage.setItem(We,"1")}catch{}}},[]),Ft=q.useCallback(()=>{Ze.current=!1,dt(!1);try{window.localStorage.removeItem(We)}catch{}try{e.fitView({padding:.25,duration:400})}catch{}},[e]);q.useEffect(()=>{const ne=setInterval(()=>{if(Ze.current||Date.now()-Dt.current<800)return;const ie=n.current,pe=Date.now(),we=[];for(const ut of ie.agents.values())mg(ut,pe)&&we.push({id:ut.id});if(we.length===0)return;const Se=e.getViewport(),Ne=window.innerWidth-360,Fe=window.innerHeight-52;let Pe=!1,fn=!1;for(const{id:ut}of we){const Je=gt.current.get(ut),dn=je.current.get(ut)??nt.current.get(ut);if(!Je||!dn)continue;fn=!0;const bi=dn.x*Se.zoom+Se.x,ki=dn.y*Se.zoom+Se.y,yr=(dn.x+Je.width)*Se.zoom+Se.x,Ht=(dn.y+Je.height)*Se.zoom+Se.y;if(yr>0&&bi<Ne&&Ht>0&&ki<Fe){Pe=!0;break}}if(fn&&!Pe)try{e.fitView({padding:.25,duration:600})}catch{}},1500);return()=>clearInterval(ne)},[e]);const gt=q.useRef(new Map),ln=q.useRef(0),Gn=q.useCallback(ne=>{const ie=gt.current;let pe=!1;for(const we of ne.nodeInternals.values()){const Se=we.width,Ne=we.height;if(Se==null||Ne==null)continue;const Fe=ie.get(we.id);Fe?(Math.abs(Fe.height-Ne)>4||Math.abs(Fe.width-Se)>4)&&(ie.set(we.id,{width:Se,height:Ne}),pe=!0):(ie.set(we.id,{width:Se,height:Ne}),pe=!0)}return pe&&(ln.current+=1),ln.current},[]),cn=Ve(Gn),nt=q.useRef(new Map(me.positions)),en=q.useRef(""),jt=q.useMemo(()=>{const ne=[];for(const ie of n.current.agents.values())mg(ie,ue)&&ne.push(ie.id+(ie.parentId?`>${ie.parentId}`:""));return ne.sort(),`${ne.join("|")}#sv${cn}`},[n.current,n.current.lastSeq,ue,cn]),$n=q.useRef(null);q.useEffect(()=>($n.current!=null&&window.clearTimeout($n.current),$n.current=window.setTimeout(()=>{Ym(nt.current,je.current)},1500),()=>{$n.current!=null&&window.clearTimeout($n.current)}),[jt]),q.useEffect(()=>{if(Nt.current===jt)return;const ne=Nt.current;if(Nt.current=jt,!ne||Ze.current)return;const ie=Date.now();if(ie-ft.current>1200){try{e.fitView({padding:.25,duration:400})}catch{}ft.current=ie}Et.current&&window.clearTimeout(Et.current),Et.current=window.setTimeout(()=>{if(!Ze.current){try{e.fitView({padding:.25,duration:500})}catch{}ft.current=Date.now()}},280)},[jt,e]);const mr=q.useMemo(()=>{if(o.size===0)return null;const ne=new Set;for(const ie of o){const pe=p$(n.current,ie);if(pe)for(const we of pe)ne.add(we)}return ne.size>0?ne:null},[n.current,n.current.lastSeq,o]),gr=q.useMemo(()=>KL(n.current,ue),[n.current,n.current.lastSeq,ue]),{nodes:zt,edges:Vr}=q.useMemo(()=>m$(n.current,ue,je.current,Ie,gt.current,nt.current,jt,en,o,mr,gr,S),[n.current,n.current.lastSeq,ue,Ie,jt,o,mr,gr,S,A]),Wr=q.useMemo(()=>{const ne=new Map;for(const pe of zt){const we=pe.data;if(!(we!=null&&we.sessionId)||we.exitAt!=null)continue;const Se=pe.width,Ne=pe.height;if(Se==null||Ne==null)continue;const Fe=pe.position.x,Pe=pe.position.y,fn=Fe+Se,ut=Pe+Ne,Je=ne.get(we.sessionId);Je?(Je.minX=Math.min(Je.minX,Fe),Je.minY=Math.min(Je.minY,Pe),Je.maxX=Math.max(Je.maxX,fn),Je.maxY=Math.max(Je.maxY,ut)):ne.set(we.sessionId,{minX:Fe,minY:Pe,maxX:fn,maxY:ut})}const ie=[];for(const[pe,we]of ne){const Se=we.maxX-we.minX+Ua*2,Ne=we.maxY-we.minY+Ua*2;ie.push({id:`group:${pe}`,type:"sessionGroup",position:{x:we.minX-Ua,y:we.minY-Ua},data:{sessionId:pe,w:Se,h:Ne},width:Se,height:Ne,style:{width:Se,height:Ne},zIndex:-1,draggable:!0,selectable:!1,focusable:!1,deletable:!1,connectable:!1})}return ie},[zt,ue]),Kn=q.useMemo(()=>[...Wr,...zt],[Wr,zt]),Gr=q.useMemo(()=>{if(!Ie)return null;const ne=new Set;for(const ie of n.current.agents.values())QN(ie,Ie)&&ne.add(ie.id);return ne},[n.current,n.current.lastSeq,Ie]),Dn=q.useMemo(()=>{const ne=new Set;for(const ie of n.current.agents.values())for(const pe of ie.tools)ne.add(XN(pe.name));return Object.keys(gg).filter(ie=>ne.has(ie))},[n.current,n.current.lastSeq]),Yn=q.useMemo(()=>{const ne=new Map;for(const pe of n.current.agents.values())for(const we of pe.tools){if(!we.name.startsWith("mcp__"))continue;const Se=we.name.slice(5),Ne=Se.indexOf("__"),Fe=Ne>0?Se.slice(0,Ne):Se;ne.set(Fe,(ne.get(Fe)??0)+1)}const ie=[];for(const[pe,we]of ne){let Se=5381;for(let Ne=0;Ne<pe.length;Ne++)Se=(Se<<5)+Se^pe.charCodeAt(Ne);ie.push({server:pe,count:we,hue:Math.abs(Se)%360})}return ie.sort((pe,we)=>we.count-pe.count),ie},[n.current,n.current.lastSeq]),Xn=q.useCallback(ne=>{ye(ie=>{const pe=new Set(ie);return pe.has(ne)?pe.delete(ne):pe.add(ne),pe})},[]),ht=l?n.current.agents.get(l):null,Qn=d?Array.from(n.current.agents.values()).flatMap(ne=>ne.tools).find(ne=>ne.id===d)??null:null,Zn=q.useCallback(async()=>{try{await fetch("/api/clear",{method:"POST"})}catch{}n.current=dg(),je.current.clear(),gt.current.clear(),nt.current.clear(),en.current="",dk(),m(),s()},[s,m]),Kr=q.useCallback(()=>{je.current.clear(),nt.current.clear(),en.current="",dk(),s(),window.setTimeout(()=>{try{e.fitView({padding:.25,duration:500})}catch{}ft.current=Date.now()},80)},[s,e]),_i=q.useCallback(()=>{try{e.fitView({padding:.25,duration:500})}catch{}ft.current=Date.now()},[e]),vr=q.useCallback(ne=>{if(zt.length===0)return;const ie=zt.slice().sort((Ne,Fe)=>Ne.position.y-Fe.position.y||Ne.position.x-Fe.position.x),pe=l?ie.findIndex(Ne=>Ne.id===l):-1;let we;pe===-1?we=ne===1?0:ie.length-1:we=(pe+ne+ie.length)%ie.length;const Se=ie[we];Se&&(h(Se.id,!1),window.setTimeout(()=>{try{e.fitView({padding:.35,duration:350,nodes:[Se]})}catch{}ft.current=Date.now()},30))},[zt,l,h,e]);q.useEffect(()=>{const ne=ie=>{var we,Se;const pe=((we=ie.target)==null?void 0:we.tagName)==="INPUT";if(ie.key==="Escape"){pe?ie.target.blur():m();return}if(!pe){if(ie.key==="/"){ie.preventDefault(),(Se=st.current)==null||Se.focus();return}ie.key===" "&&(ie.preventDefault(),J(Ne=>!Ne)),(ie.key==="c"||ie.key==="C")&&Zn(),(ie.key==="r"||ie.key==="R")&&Kr(),(ie.key==="f"||ie.key==="F")&&_i(),(ie.key==="l"||ie.key==="L")&&te(),(ie.key==="h"||ie.key==="H")&&G(Ne=>!Ne),(ie.key==="u"||ie.key==="U")&&P(Ne=>!Ne),(ie.key==="a"||ie.key==="A")&&Y(),(ie.key==="j"||ie.key==="J")&&vr(1),(ie.key==="k"||ie.key==="K")&&vr(-1),(ie.key==="t"||ie.key==="T")&&Ue(Ne=>Ne==="dark"?"light":"dark")}};return window.addEventListener("keydown",ne),()=>window.removeEventListener("keydown",ne)},[Zn,Kr,_i,m,vr]);const tn=n.current.agents.size,Si=new Set(Array.from(n.current.agents.values()).map(ne=>ne.sessionId)).size,At=q.useMemo(()=>{let ne=0,ie=0,pe=0,we=0,Se=0,Ne=0,Fe=0,Pe=0,fn=0;for(const ut of n.current.agents.values()){ne+=ut.usage.inputTokens,ie+=ut.usage.outputTokens,pe+=ut.usage.cacheReadTokens,we+=ut.usage.cacheCreateTokens;const Je=Zt(ut.usage,ut.model);Se+=Je.total,Ne+=Je.input,Fe+=Je.output,Pe+=Je.cacheRead,fn+=Je.cacheWrite}return{inT:ne,outT:ie,cacheR:pe,cacheC:we,sum:ne+ie,cost:{total:Se,input:Ne,output:Fe,cacheRead:Pe,cacheWrite:fn}}},[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 ",v.jsxs("span",{className:"v",children:["v","1.26.0"]})]}),ht&&(()=>{const ne=Zt(ht.usage,ht.model),ie=Math.max(0,((ht.endedAt??ue)-ht.startedAt)/1e3),pe=ht.state==="active"?ou(ne.total,ie):null,we=o.size-1;return v.jsxs("button",{type:"button",className:"selected-ribbon",title:`Fit view to ${ht.label}`,onClick:()=>{try{const Se=zt.find(Ne=>Ne.id===ht.id);Se&&e.fitView({padding:.35,duration:500,nodes:[Se]}),ft.current=Date.now()}catch{}},children:[v.jsx("span",{className:`state-pill state-${ht.state}`,children:ht.state==="active"?"live":ht.state}),v.jsx("span",{className:"selected-label",children:ht.label}),ne.total>0&&v.jsxs("span",{className:"selected-cost",children:[$e(ne.total),pe?v.jsxs("span",{className:"selected-rate",children:[" · ",pe]}):null]}),we>0&&v.jsxs("span",{className:"selected-extra",children:["+",we]}),v.jsx("span",{role:"button","aria-label":"Deselect",className:"selected-close",onClick:Se=>{Se.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:st,type:"text",placeholder:"Search agents, cwd, tools…",value:Ie,onChange:ne=>ke(ne.target.value),spellCheck:!1,"aria-label":"Filter the graph"}),Ie?v.jsx("button",{className:"search-clear","aria-label":"Clear search",onClick:()=>ke(""),children:"×"}):v.jsx("kbd",{className:"search-kbd","aria-hidden":!0,children:"/"})]}),v.jsxs("span",{className:"status",role:"status",children:[v.jsx("span",{className:`pill ${ae?"live":"dead"}`,title:ae?"Receiving events":"SSE disconnected",children:ae?"live":"offline"}),v.jsxs("span",{className:"stat",title:"Distinct CC sessions",children:[v.jsx("span",{className:"count",children:Si}),v.jsx("span",{className:"lbl",children:"sessions"})]}),v.jsxs("span",{className:"stat",title:"Total agents (root + subagents)",children:[v.jsx("span",{className:"count",children:tn}),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"})]}),At.sum>0&&v.jsxs("span",{className:"stat",title:`in:${At.inT.toLocaleString()} out:${At.outT.toLocaleString()} cache-r:${At.cacheR.toLocaleString()} cache-c:${At.cacheC.toLocaleString()}`,children:[v.jsx("span",{className:"count",children:YL(At.sum)}),v.jsx("span",{className:"lbl",children:"tokens"})]}),Yn.length>0&&v.jsxs("span",{className:"stat mcp-legend",title:`MCP servers seen this session:
60
+ ${Yn.map(ne=>` ${ne.server}: ${ne.count} call${ne.count===1?"":"s"}`).join(`
61
+ `)}`,children:[Yn.slice(0,6).map(ne=>v.jsx("span",{className:"mcp-dot",style:{background:`hsl(${ne.hue} 65% 65%)`}},ne.server)),Yn.length>6&&v.jsxs("span",{className:"mcp-more",children:["+",Yn.length-6]}),v.jsx("span",{className:"lbl",children:"mcp"})]}),At.cost.total>0&&(()=>{let ne=0,ie=0;for(const Se of n.current.agents.values()){if(Se.state!=="active")continue;const Ne=Zt(Se.usage,Se.model);ne+=Ne.total,ie=Math.max(ie,((Se.endedAt??ue)-Se.startedAt)/1e3)}const pe=ie>0?ou(ne,ie):null,we=`input ${$e(At.cost.input)} + output ${$e(At.cost.output)} + cache r ${$e(At.cost.cacheRead)} + cache w ${$e(At.cost.cacheWrite)}${pe?`
62
+ active burn: ${pe}`:""}`;return v.jsxs("span",{className:"stat",title:we,children:[v.jsx("span",{className:"count",children:$e(At.cost.total)}),v.jsxs("span",{className:"lbl",children:["cost",pe?` · ${pe}`:""]})]})})()]}),v.jsx("button",{className:`btn ${V?"warn":""}`,onClick:()=>J(ne=>!ne),title:"Pause/resume live updates (Space)",children:V?`Resume${se.current.length?` · ${se.current.length}`:""}`:"Pause"}),v.jsx("button",{className:`btn icon-btn ${I?"primary":""}`,onClick:()=>P(ne=>!ne),title:`${I?"Hide":"Show"} usage panel (U)`,"aria-label":"Toggle usage panel",children:"$"}),F!==null&&v.jsx("button",{className:`btn icon-btn ${F?"primary":""}`,onClick:H,disabled:Q,title:(F?"Sound on turn finish: on — click to remove the hook":"Sound on turn finish: off — click to add a Stop hook")+(R>0?`
63
+
64
+ You already have ${R} sound hook${R>1?"s":""} in settings.json that run${R>1?"":"s"} on this machine — turning this on will play two sounds per turn.`:""),"aria-label":"Toggle finish sound","aria-pressed":F,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"}),F?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 ${B?"primary":""}`,onClick:Y,title:`${B?"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 ${b?"primary":""}`,onClick:te,title:`${b?"Hide":"Show"} session list (L)`,"aria-label":"Toggle session list",children:"☰"}),v.jsx("button",{className:`btn icon-btn ${$?"primary":""}`,onClick:()=>G(ne=>!ne),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:Kr,title:"Auto-arrange — clear pins (R)",children:"Re-layout"}),v.jsx("button",{className:"btn",onClick:Zn,title:"Clear canvas (C)",children:"Clear"}),v.jsx("button",{className:"btn icon-btn",onClick:()=>Ue(ne=>ne==="dark"?"light":"dark"),title:`Switch to ${ge==="dark"?"light":"dark"} mode (T)`,"aria-label":"Toggle theme",children:ge==="dark"?"☀":"☾"})]})]}),mt&&!ae&&v.jsxs("div",{className:"conn-banner",role:"alert",children:[v.jsx("span",{className:"conn-dot"}),"Lost connection to agents-deck server. Reconnecting…"]}),I&&v.jsx(h3,{state:n.current,now:ue,onClose:()=>P(!1)}),B&&v.jsx(x3,{onClose:()=>M(!1)}),b&&v.jsx(i3,{state:n.current,now:ue,selectedIds:o,onSelect:ne=>{h(ne,!1),window.setTimeout(()=>{try{const ie=zt.find(pe=>pe.id===ne);ie&&e.fitView({padding:.3,duration:500,nodes:[ie]}),ft.current=Date.now()}catch{}},60)},onClose:()=>E(!1)}),v.jsxs("div",{className:"canvas-wrap",children:[tn===0&&v.jsx(y$,{live:ae,everConnected:mt}),Dn.length>1&&v.jsx("div",{className:"cat-filter-bar",role:"toolbar","aria-label":"Filter tools by category",children:Dn.map(ne=>{const ie=Ge.has(ne);return v.jsxs("button",{type:"button",className:`cat-filter${ie?" off":""}`,onClick:()=>Xn(ne),title:`${ie?"Show":"Hide"} ${vg[ne]} tools`,children:[v.jsx("span",{className:"cat-emoji",children:gg[ne]}),v.jsx("span",{className:"cat-name",children:vg[ne]})]},ne)})}),v.jsxs(AE,{nodes:Kn,edges:Vr,nodeTypes:XL,fitView:!Me,fitViewOptions:{padding:.25,duration:400},minZoom:.2,maxZoom:1.6,panOnScroll:!0,nodesDraggable:!0,nodesConnectable:!1,selectionOnDrag:!1,onNodeClick:(ne,ie)=>{if(ie.type==="sessionGroup"){m();return}h(ie.id,ne.shiftKey)},onPaneClick:()=>m(),onMoveStart:()=>{un()},onMove:(ne,ie)=>{xt(),ot.current&&window.clearTimeout(ot.current),ot.current=window.setTimeout(()=>f$(ie),250)},onNodeDragStart:(ne,ie)=>{var pe;if(xt(),un(),ie.type==="sessionGroup"){const we=(pe=ie.data)==null?void 0:pe.sessionId,Se=new Map;if(we)for(const Ne of zt){const Fe=Ne.data;(Fe==null?void 0:Fe.sessionId)===we&&Se.set(Ne.id,{x:Ne.position.x,y:Ne.position.y})}De.current={start:{x:ie.position.x,y:ie.position.y},members:Se};return}je.current.set(ie.id,{x:ie.position.x,y:ie.position.y})},onNodeDrag:(ne,ie)=>{if(xt(),ie.type==="sessionGroup"){const pe=De.current;if(!pe)return;const we=ie.position.x-pe.start.x,Se=ie.position.y-pe.start.y;for(const[Ne,Fe]of pe.members){const Pe={x:Fe.x+we,y:Fe.y+Se};je.current.set(Ne,Pe),nt.current.set(Ne,Pe)}z(Ne=>Ne+1);return}je.current.set(ie.id,{x:ie.position.x,y:ie.position.y}),nt.current.set(ie.id,{x:ie.position.x,y:ie.position.y})},onNodeDragStop:(ne,ie)=>{if(xt(),ie.type==="sessionGroup"){const pe=De.current;if(pe){const we=ie.position.x-pe.start.x,Se=ie.position.y-pe.start.y;for(const[Ne,Fe]of pe.members){const Pe={x:Fe.x+we,y:Fe.y+Se};je.current.set(Ne,Pe),nt.current.set(Ne,Pe)}}De.current=null,Ym(nt.current,je.current),z(we=>we+1);return}je.current.set(ie.id,{x:ie.position.x,y:ie.position.y}),nt.current.set(ie.id,{x:ie.position.x,y:ie.position.y}),Ym(nt.current,je.current)},children:[v.jsx(HM,{gap:28,size:1,color:li("--grid-line")}),v.jsx(bP,{}),v.jsx(ZP,{agents:n.current.agents,visibleAgentIds:gr,positions:nt.current,pinned:je.current,measured:gt.current,dimUnmatched:Gr,spotlight:mr,hiddenCategories:Ge,now:ue,onOpenTool:p}),v.jsx($M,{showInteractive:!1,children:v.jsx(Ji,{onClick:Ft,title:at?"Recenter view + re-enable autofit":"Recenter view (autofit already on)","aria-label":"Recenter view",style:at?{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(AM,{zoomable:!0,pannable:!0,nodeColor:ne=>{const ie=ne.data;return ie.state==="err"?li("--err"):ie.state==="active"?li("--inflight"):li("--ok")},nodeStrokeWidth:2,maskColor:li("--minimap-mask"),style:{background:li("--panel"),border:`1px solid ${li("--line")}`,borderRadius:8}})]})]}),N?v.jsxs("aside",{className:"detail",children:[v.jsx("button",{type:"button",className:"detail-close",title:"Close panel","aria-label":"Close detail panel",onClick:()=>j(!1),children:"×"}),ht?v.jsx(_$,{agent:ht,now:ue,onOpenTool:p,onShowSummary:ne=>{k.current.has(ne)&&(k.current.delete(ne),fk(k.current)),x(ne)},onExportSession:ne=>d$(n.current,ne)}):v.jsx(x$,{count:tn})]}):v.jsx("button",{type:"button",className:"detail-reopen",title:"Show detail panel","aria-label":"Show detail panel",onClick:()=>j(!0),children:"‹"}),Qn&&v.jsx(wP,{tool:Qn,onClose:()=>p(null)}),$&&v.jsx(k3,{onClose:()=>G(!1)}),C&&(()=>{const ne=n.current.agents.get(C);return ne?v.jsx(cP,{agent:ne,onClose:()=>_(null)}):null})(),y&&v.jsx(JP,{state:n.current,sessionId:y,onClose:()=>{k.current.add(y),fk(k.current),x(null)}})]})}function y$({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."]})]}):w$()]})}function w$(){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 x$({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 _$({agent:e,now:n,onOpenTool:i,onShowSummary:s,onExportSession:o}){const u=(e.endedAt??n)-e.startedAt,l=Math.max(0,Math.floor(u/1e3)),c=l<60?`${l}s`:`${Math.floor(l/60)}m ${String(l%60).padStart(2,"0")}s`,d=Zt(e.usage,e.model),p=d.total>0,h=e.usage.inputTokens+e.usage.outputTokens,m=new Map;for(const _ of e.tools){const S=XN(_.name);m.set(S,(m.get(S)??0)+1)}const y=e.tools.filter(_=>_.ok===!1).length,x=e.tools.filter(_=>!_.endedAt).length,C=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:wo(e.model)})]})]}),p&&v.jsxs("div",{className:"hero-cost",children:[v.jsxs("div",{className:"hero-cost-headline",children:[v.jsx("span",{className:"hero-cost-value",children:$e(d.total)}),v.jsx("span",{className:"hero-cost-label",children:"spend"})]}),v.jsx(S$,{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:C.map(([_,S])=>v.jsxs("span",{className:`cat-chip cat-${_}`,title:`${S} ${vg[_]} call${S===1?"":"s"}`,children:[v.jsx("span",{className:"cat-emoji",children:gg[_]}),v.jsx("span",{className:"cat-count",children:S})]},_))})]})]}),h>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(b$,{t:_,now:n,onClick:()=>i(_.id)},_.id))})]})]})}function S$({cost:e}){const n=e.total;if(n<=0)return null;const i=(s,o,u)=>{if(s<=0)return null;const l=s/n*100;return v.jsx("span",{className:`cb-seg ${o}`,style:{width:`${l}%`},title:`${u}: ${$e(s)} (${l.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 b$({t:e,now:n,onClick:i}){const s=e.endedAt==null?"inflight":e.ok===!1?"err":"done",o=(e.endedAt??n)-e.startedAt,u=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:u})]})}const k$=UT.createRoot(document.getElementById("root"));k$.render(v.jsx(g$,{}));