agent-dag 1.30.2 → 1.30.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,66 @@
1
+ (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const 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 Ya=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Mg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Nc={exports:{}},go={},Cc={exports:{}},$e={};/**
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 L0;function zT(){if(L0)return $e;L0=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"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.iterator;function y(O){return O===null||typeof O!="object"?null:(O=m&&O[m]||O["@@iterator"],typeof O=="function"?O:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,_={};function S(O,B,ae){this.props=O,this.context=B,this.refs=_,this.updater=ae||x}S.prototype.isReactComponent={},S.prototype.setState=function(O,B){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,B,"setState")},S.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function b(){}b.prototype=S.prototype;function k(O,B,ae){this.props=O,this.context=B,this.refs=_,this.updater=ae||x}var E=k.prototype=new b;E.constructor=k,N(E,S.prototype),E.isPureReactComponent=!0;var C=Array.isArray,A=Object.prototype.hasOwnProperty,P={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function M(O,B,ae){var z,W={},J=null,se=null;if(B!=null)for(z in B.ref!==void 0&&(se=B.ref),B.key!==void 0&&(J=""+B.key),B)A.call(B,z)&&!I.hasOwnProperty(z)&&(W[z]=B[z]);var ue=arguments.length-2;if(ue===1)W.children=ae;else if(1<ue){for(var he=Array(ue),ge=0;ge<ue;ge++)he[ge]=arguments[ge+2];W.children=he}if(O&&O.defaultProps)for(z in ue=O.defaultProps,ue)W[z]===void 0&&(W[z]=ue[z]);return{$$typeof:e,type:O,key:J,ref:se,props:W,_owner:P.current}}function R(O,B){return{$$typeof:e,type:O.type,key:B,ref:O.ref,props:O.props,_owner:O._owner}}function L(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function F(O){var B={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(ae){return B[ae]})}var Q=/\/+/g;function X(O,B){return typeof O=="object"&&O!==null&&O.key!=null?F(""+O.key):B.toString(36)}function j(O,B,ae,z,W){var J=typeof O;(J==="undefined"||J==="boolean")&&(O=null);var se=!1;if(O===null)se=!0;else switch(J){case"string":case"number":se=!0;break;case"object":switch(O.$$typeof){case e:case n:se=!0}}if(se)return se=O,W=W(se),O=z===""?"."+X(se,0):z,C(W)?(ae="",O!=null&&(ae=O.replace(Q,"$&/")+"/"),j(W,B,ae,"",function(ge){return ge})):W!=null&&(L(W)&&(W=R(W,ae+(!W.key||se&&se.key===W.key?"":(""+W.key).replace(Q,"$&/")+"/")+O)),B.push(W)),1;if(se=0,z=z===""?".":z+":",C(O))for(var ue=0;ue<O.length;ue++){J=O[ue];var he=z+X(J,ue);se+=j(J,B,ae,he,W)}else if(he=y(O),typeof he=="function")for(O=he.call(O),ue=0;!(J=O.next()).done;)J=J.value,he=z+X(J,ue++),se+=j(J,B,ae,he,W);else if(J==="object")throw B=String(O),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.");return se}function G(O,B,ae){if(O==null)return O;var z=[],W=0;return j(O,z,"","",function(J){return B.call(ae,J,W++)}),z}function U(O){if(O._status===-1){var B=O._result;B=B(),B.then(function(ae){(O._status===0||O._status===-1)&&(O._status=1,O._result=ae)},function(ae){(O._status===0||O._status===-1)&&(O._status=2,O._result=ae)}),O._status===-1&&(O._status=0,O._result=B)}if(O._status===1)return O._result.default;throw O._result}var ne={current:null},K={transition:null},D={ReactCurrentDispatcher:ne,ReactCurrentBatchConfig:K,ReactCurrentOwner:P};function V(){throw Error("act(...) is not supported in production builds of React.")}return $e.Children={map:G,forEach:function(O,B,ae){G(O,function(){B.apply(this,arguments)},ae)},count:function(O){var B=0;return G(O,function(){B++}),B},toArray:function(O){return G(O,function(B){return B})||[]},only:function(O){if(!L(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},$e.Component=S,$e.Fragment=i,$e.Profiler=o,$e.PureComponent=k,$e.StrictMode=s,$e.Suspense=d,$e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D,$e.act=V,$e.cloneElement=function(O,B,ae){if(O==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+O+".");var z=N({},O.props),W=O.key,J=O.ref,se=O._owner;if(B!=null){if(B.ref!==void 0&&(J=B.ref,se=P.current),B.key!==void 0&&(W=""+B.key),O.type&&O.type.defaultProps)var ue=O.type.defaultProps;for(he in B)A.call(B,he)&&!I.hasOwnProperty(he)&&(z[he]=B[he]===void 0&&ue!==void 0?ue[he]:B[he])}var he=arguments.length-2;if(he===1)z.children=ae;else if(1<he){ue=Array(he);for(var ge=0;ge<he;ge++)ue[ge]=arguments[ge+2];z.children=ue}return{$$typeof:e,type:O.type,key:W,ref:J,props:z,_owner:se}},$e.createContext=function(O){return O={$$typeof:l,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},O.Provider={$$typeof:u,_context:O},O.Consumer=O},$e.createElement=M,$e.createFactory=function(O){var B=M.bind(null,O);return B.type=O,B},$e.createRef=function(){return{current:null}},$e.forwardRef=function(O){return{$$typeof:c,render:O}},$e.isValidElement=L,$e.lazy=function(O){return{$$typeof:p,_payload:{_status:-1,_result:O},_init:U}},$e.memo=function(O,B){return{$$typeof:h,type:O,compare:B===void 0?null:B}},$e.startTransition=function(O){var B=K.transition;K.transition={};try{O()}finally{K.transition=B}},$e.unstable_act=V,$e.useCallback=function(O,B){return ne.current.useCallback(O,B)},$e.useContext=function(O){return ne.current.useContext(O)},$e.useDebugValue=function(){},$e.useDeferredValue=function(O){return ne.current.useDeferredValue(O)},$e.useEffect=function(O,B){return ne.current.useEffect(O,B)},$e.useId=function(){return ne.current.useId()},$e.useImperativeHandle=function(O,B,ae){return ne.current.useImperativeHandle(O,B,ae)},$e.useInsertionEffect=function(O,B){return ne.current.useInsertionEffect(O,B)},$e.useLayoutEffect=function(O,B){return ne.current.useLayoutEffect(O,B)},$e.useMemo=function(O,B){return ne.current.useMemo(O,B)},$e.useReducer=function(O,B,ae){return ne.current.useReducer(O,B,ae)},$e.useRef=function(O){return ne.current.useRef(O)},$e.useState=function(O){return ne.current.useState(O)},$e.useSyncExternalStore=function(O,B,ae){return ne.current.useSyncExternalStore(O,B,ae)},$e.useTransition=function(){return ne.current.useTransition()},$e.version="18.3.1",$e}var $0;function Lo(){return $0||($0=1,Cc.exports=zT()),Cc.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 D0;function BT(){if(D0)return go;D0=1;var e=Lo(),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,h){var p,m={},y=null,x=null;h!==void 0&&(y=""+h),d.key!==void 0&&(y=""+d.key),d.ref!==void 0&&(x=d.ref);for(p in d)s.call(d,p)&&!u.hasOwnProperty(p)&&(m[p]=d[p]);if(c&&c.defaultProps)for(p in d=c.defaultProps,d)m[p]===void 0&&(m[p]=d[p]);return{$$typeof:n,type:c,key:y,ref:x,props:m,_owner:o.current}}return go.Fragment=i,go.jsx=l,go.jsxs=l,go}var F0;function UT(){return F0||(F0=1,Nc.exports=BT()),Nc.exports}var v=UT(),Ka={},Tc={exports:{}},tn={},Rc={exports:{}},jc={};/**
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 z0;function HT(){return z0||(z0=1,(function(e){function n(K,D){var V=K.length;K.push(D);e:for(;0<V;){var O=V-1>>>1,B=K[O];if(0<o(B,D))K[O]=D,K[V]=B,V=O;else break e}}function i(K){return K.length===0?null:K[0]}function s(K){if(K.length===0)return null;var D=K[0],V=K.pop();if(V!==D){K[0]=V;e:for(var O=0,B=K.length,ae=B>>>1;O<ae;){var z=2*(O+1)-1,W=K[z],J=z+1,se=K[J];if(0>o(W,V))J<B&&0>o(se,W)?(K[O]=se,K[J]=V,O=J):(K[O]=W,K[z]=V,O=z);else if(J<B&&0>o(se,V))K[O]=se,K[J]=V,O=J;else break e}}return D}function o(K,D){var V=K.sortIndex-D.sortIndex;return V!==0?V:K.id-D.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=[],h=[],p=1,m=null,y=3,x=!1,N=!1,_=!1,S=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(K){for(var D=i(h);D!==null;){if(D.callback===null)s(h);else if(D.startTime<=K)s(h),D.sortIndex=D.expirationTime,n(d,D);else break;D=i(h)}}function C(K){if(_=!1,E(K),!N)if(i(d)!==null)N=!0,U(A);else{var D=i(h);D!==null&&ne(C,D.startTime-K)}}function A(K,D){N=!1,_&&(_=!1,b(M),M=-1),x=!0;var V=y;try{for(E(D),m=i(d);m!==null&&(!(m.expirationTime>D)||K&&!F());){var O=m.callback;if(typeof O=="function"){m.callback=null,y=m.priorityLevel;var B=O(m.expirationTime<=D);D=e.unstable_now(),typeof B=="function"?m.callback=B:m===i(d)&&s(d),E(D)}else s(d);m=i(d)}if(m!==null)var ae=!0;else{var z=i(h);z!==null&&ne(C,z.startTime-D),ae=!1}return ae}finally{m=null,y=V,x=!1}}var P=!1,I=null,M=-1,R=5,L=-1;function F(){return!(e.unstable_now()-L<R)}function Q(){if(I!==null){var K=e.unstable_now();L=K;var D=!0;try{D=I(!0,K)}finally{D?X():(P=!1,I=null)}}else P=!1}var X;if(typeof k=="function")X=function(){k(Q)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,G=j.port2;j.port1.onmessage=Q,X=function(){G.postMessage(null)}}else X=function(){S(Q,0)};function U(K){I=K,P||(P=!0,X())}function ne(K,D){M=S(function(){K(e.unstable_now())},D)}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(K){K.callback=null},e.unstable_continueExecution=function(){N||x||(N=!0,U(A))},e.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<K?Math.floor(1e3/K):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return i(d)},e.unstable_next=function(K){switch(y){case 1:case 2:case 3:var D=3;break;default:D=y}var V=y;y=D;try{return K()}finally{y=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(K,D){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var V=y;y=K;try{return D()}finally{y=V}},e.unstable_scheduleCallback=function(K,D,V){var O=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?O+V:O):V=O,K){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=V+B,K={id:p++,callback:D,priorityLevel:K,startTime:V,expirationTime:B,sortIndex:-1},V>O?(K.sortIndex=V,n(h,K),i(d)===null&&K===i(h)&&(_?(b(M),M=-1):_=!0,ne(C,V-O))):(K.sortIndex=B,n(d,K),N||x||(N=!0,U(A))),K},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(K){var D=y;return function(){var V=y;y=D;try{return K.apply(this,arguments)}finally{y=V}}}})(jc)),jc}var B0;function VT(){return B0||(B0=1,Rc.exports=HT()),Rc.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 U0;function WT(){if(U0)return tn;U0=1;var e=Lo(),n=VT();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,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},m={};function y(t){return d.call(m,t)?!0:d.call(p,t)?!1:h.test(t)?m[t]=!0:(p[t]=!0,!1)}function x(t,r,a,f){if(a!==null&&a.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return f?!1:a!==null?!a.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function N(t,r,a,f){if(r===null||typeof r>"u"||x(t,r,a,f))return!0;if(f)return!1;if(a!==null)switch(a.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function _(t,r,a,f,g,w,T){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=f,this.attributeNamespace=g,this.mustUseProperty=a,this.propertyName=t,this.type=r,this.sanitizeURL=w,this.removeEmptyString=T}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){S[t]=new _(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var r=t[0];S[r]=new _(r,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){S[t]=new _(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){S[t]=new _(t,2,!1,t,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){S[t]=new _(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){S[t]=new _(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){S[t]=new _(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){S[t]=new _(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){S[t]=new _(t,5,!1,t.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function k(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var r=t.replace(b,k);S[r]=new _(r,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var r=t.replace(b,k);S[r]=new _(r,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var r=t.replace(b,k);S[r]=new _(r,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){S[t]=new _(t,1,!1,t.toLowerCase(),null,!1,!1)}),S.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){S[t]=new _(t,1,!1,t.toLowerCase(),null,!0,!0)});function E(t,r,a,f){var g=S.hasOwnProperty(r)?S[r]:null;(g!==null?g.type!==0:f||!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(N(r,a,g,f)&&(a=null),f||g===null?y(r)&&(a===null?t.removeAttribute(r):t.setAttribute(r,""+a)):g.mustUseProperty?t[g.propertyName]=a===null?g.type===3?!1:"":a:(r=g.attributeName,f=g.attributeNamespace,a===null?t.removeAttribute(r):(g=g.type,a=g===3||g===4&&a===!0?"":""+a,f?t.setAttributeNS(f,r,a):t.setAttribute(r,a))))}var C=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,A=Symbol.for("react.element"),P=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),L=Symbol.for("react.provider"),F=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),ne=Symbol.for("react.offscreen"),K=Symbol.iterator;function D(t){return t===null||typeof t!="object"?null:(t=K&&t[K]||t["@@iterator"],typeof t=="function"?t:null)}var V=Object.assign,O;function B(t){if(O===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);O=r&&r[1]||""}return`
34
+ `+O+t}var ae=!1;function z(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(ie){var f=ie}Reflect.construct(t,[],r)}else{try{r.call()}catch(ie){f=ie}t.call(r.prototype)}else{try{throw Error()}catch(ie){f=ie}t()}}catch(ie){if(ie&&f&&typeof ie.stack=="string"){for(var g=ie.stack.split(`
35
+ `),w=f.stack.split(`
36
+ `),T=g.length-1,$=w.length-1;1<=T&&0<=$&&g[T]!==w[$];)$--;for(;1<=T&&0<=$;T--,$--)if(g[T]!==w[$]){if(T!==1||$!==1)do if(T--,$--,0>$||g[T]!==w[$]){var H=`
37
+ `+g[T].replace(" at new "," at ");return t.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",t.displayName)),H}while(1<=T&&0<=$);break}}}finally{ae=!1,Error.prepareStackTrace=a}return(t=t?t.displayName||t.name:"")?B(t):""}function W(t){switch(t.tag){case 5:return B(t.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 2:case 15:return t=z(t.type,!1),t;case 11:return t=z(t.type.render,!1),t;case 1:return t=z(t.type,!0),t;default:return""}}function 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 I:return"Fragment";case P:return"Portal";case R:return"Profiler";case M:return"StrictMode";case X:return"Suspense";case j:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case F:return(t.displayName||"Context")+".Consumer";case L: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 G:return r=t.displayName||null,r!==null?r:J(t.type)||"Memo";case U: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===M?"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 ge(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 Me(t){t._valueTracker||(t._valueTracker=ge(t))}function Fe(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 Re(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 Pe(t,r){var a=r.checked;return V({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??t._wrapperState.initialChecked})}function be(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 Oe(t,r){r=r.checked,r!=null&&E(t,"checked",r,!1)}function ve(t,r){Oe(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")?qe(t,r.type,a):r.hasOwnProperty("defaultValue")&&qe(t,r.type,ue(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(t.defaultChecked=!!r.defaultChecked)}function ye(t,r,a){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var f=r.type;if(!(f!=="submit"&&f!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+t._wrapperState.initialValue,a||r===t.value||(t.value=r),t.defaultValue=r}a=t.name,a!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,a!==""&&(t.name=a)}function qe(t,r,a){(r!=="number"||Re(t.ownerDocument)!==t)&&(a==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+a&&(t.defaultValue=""+a))}var Ye=Array.isArray;function Qe(t,r,a,f){if(t=t.options,r){r={};for(var g=0;g<a.length;g++)r["$"+a[g]]=!0;for(a=0;a<t.length;a++)g=r.hasOwnProperty("$"+t[a].value),t[a].selected!==g&&(t[a].selected=g),g&&f&&(t[a].defaultSelected=!0)}else{for(a=""+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 et(t,r){if(r.dangerouslySetInnerHTML!=null)throw Error(i(91));return V({},r,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Be(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(Ye(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 Ze(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 At(t){var r=t.textContent;r===t._wrapperState.initialValue&&r!==""&&r!==null&&(t.value=r)}function Vt(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 It(t,r){return t==null||t==="http://www.w3.org/1999/xhtml"?Vt(r):t==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var pt,tt=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(r,a,f,g){MSApp.execUnsafeLocalFunction(function(){return t(r,a,f,g)})}:t})(function(t,r){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=r;else{for(pt=pt||document.createElement("div"),pt.innerHTML="<svg>"+r.valueOf().toString()+"</svg>",r=pt.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;r.firstChild;)t.appendChild(r.firstChild)}});function kt(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},Et=["Webkit","ms","Moz","O"];Object.keys(We).forEach(function(t){Et.forEach(function(r){r=r+t.charAt(0).toUpperCase()+t.substring(1),We[r]=We[t]})});function Ge(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 ft(t,r){t=t.style;for(var a in r)if(r.hasOwnProperty(a)){var f=a.indexOf("--")===0,g=Ge(a,r[a],f);a==="float"&&(a="cssFloat"),f?t.setProperty(a,g):t[a]=g}}var on=V({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 Lt(t,r){if(r){if(on[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 wt(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 an=null;function Bt(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var vn=null,un=null,yn=null;function wn(t){if(t=eo(t)){if(typeof vn!="function")throw Error(i(280));var r=t.stateNode;r&&(r=la(r),vn(t.stateNode,t.type,r))}}function _r(t){un?yn?yn.push(t):yn=[t]:un=t}function Mn(){if(un){var t=un,r=yn;if(yn=un=null,wn(t),r)for(t=0;t<r.length;t++)wn(r[t])}}function ti(t,r){return t(r)}function $i(){}var Sr=!1;function ni(t,r,a){if(Sr)return t(r,a);Sr=!0;try{return ti(t,r,a)}finally{Sr=!1,(un!==null||yn!==null)&&($i(),Mn())}}function ir(t,r){var a=t.stateNode;if(a===null)return null;var f=la(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 Nt=!1;if(c)try{var Pn={};Object.defineProperty(Pn,"passive",{get:function(){Nt=!0}}),window.addEventListener("test",Pn,Pn),window.removeEventListener("test",Pn,Pn)}catch{Nt=!1}function Yn(t,r,a,f,g,w,T,$,H){var ie=Array.prototype.slice.call(arguments,3);try{r.apply(a,ie)}catch(fe){this.onError(fe)}}var ln=!1,Kn=null,Xn=!1,br=null,kr={onError:function(t){ln=!0,Kn=t}};function Di(t,r,a,f,g,w,T,$,H){ln=!1,Kn=null,Yn.apply(kr,arguments)}function Fi(t,r,a,f,g,w,T,$,H){if(Di.apply(this,arguments),ln){if(ln){var ie=Kn;ln=!1,Kn=null}else throw Error(i(198));Xn||(Xn=!0,br=ie)}}function xn(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 zi(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 Bi(t){if(xn(t)!==t)throw Error(i(188))}function ri(t){var r=t.alternate;if(!r){if(r=xn(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 Bi(g),t;if(w===f)return Bi(g),r;w=w.sibling}throw Error(i(188))}if(a.return!==f.return)a=g,f=w;else{for(var T=!1,$=g.child;$;){if($===a){T=!0,a=g,f=w;break}if($===f){T=!0,f=g,a=w;break}$=$.sibling}if(!T){for($=w.child;$;){if($===a){T=!0,a=w,f=g;break}if($===f){T=!0,f=w,a=g;break}$=$.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 cn(t){return t=ri(t),t!==null?Er(t):null}function Er(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var r=Er(t);if(r!==null)return r;t=t.sibling}return null}var ii=n.unstable_scheduleCallback,Ui=n.unstable_cancelCallback,Hi=n.unstable_shouldYield,Vi=n.unstable_requestPaint,nt=n.unstable_now,Wt=n.unstable_getCurrentPriorityLevel,si=n.unstable_ImmediatePriority,oi=n.unstable_UserBlockingPriority,Nr=n.unstable_NormalPriority,Wi=n.unstable_LowPriority,ai=n.unstable_IdlePriority,_n=null,Gt=null;function gt(t){if(Gt&&typeof Gt.onCommitFiberRoot=="function")try{Gt.onCommitFiberRoot(_n,t,void 0,(t.current.flags&128)===128)}catch{}}var Yt=Math.clz32?Math.clz32:Yo,Ls=Math.log,$s=Math.LN2;function Yo(t){return t>>>=0,t===0?32:31-(Ls(t)/$s|0)|0}var Cr=64,Tr=4194304;function ui(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 Mt(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 $=T&~g;$!==0?f=ui($):(w&=T,w!==0&&(f=ui(w)))}else T=a&~g,T!==0?f=ui(T):w!==0&&(f=ui(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-Yt(r),g=1<<a,f|=t[a],r&=~g;return f}function Z(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 te(t,r){for(var a=t.suspendedLanes,f=t.pingedLanes,g=t.expirationTimes,w=t.pendingLanes;0<w;){var T=31-Yt(w),$=1<<T,H=g[T];H===-1?(($&a)===0||($&f)!==0)&&(g[T]=Z($,r)):H<=r&&(t.expiredLanes|=$),w&=~$}}function ce(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function me(){var t=Cr;return Cr<<=1,(Cr&4194240)===0&&(Cr=64),t}function _e(t){for(var r=[],a=0;31>a;a++)r.push(t);return r}function we(t,r,a){t.pendingLanes|=r,r!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,r=31-Yt(r),t[r]=a}function Le(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-Yt(a),w=1<<g;r[g]=0,f[g]=-1,t[g]=-1,a&=~w}}function ze(t,r){var a=t.entangledLanes|=r;for(t=t.entanglements;a;){var f=31-Yt(a),g=1<<f;g&r|t[f]&r&&(t[f]|=r),a&=~g}}var Te=0;function Ke(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var it,Kt,Rr,Gi,jr,li=!1,ci=[],fn=null,Ct=null,Je=null,Ar=new Map,Ds=new Map,Ir=[],lC="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 xv(t,r){switch(t){case"focusin":case"focusout":fn=null;break;case"dragenter":case"dragleave":Ct=null;break;case"mouseover":case"mouseout":Je=null;break;case"pointerover":case"pointerout":Ar.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ds.delete(r.pointerId)}}function Fs(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=eo(r),r!==null&&Kt(r)),t):(t.eventSystemFlags|=f,r=t.targetContainers,g!==null&&r.indexOf(g)===-1&&r.push(g),t)}function cC(t,r,a,f,g){switch(r){case"focusin":return fn=Fs(fn,t,r,a,f,g),!0;case"dragenter":return Ct=Fs(Ct,t,r,a,f,g),!0;case"mouseover":return Je=Fs(Je,t,r,a,f,g),!0;case"pointerover":var w=g.pointerId;return Ar.set(w,Fs(Ar.get(w)||null,t,r,a,f,g)),!0;case"gotpointercapture":return w=g.pointerId,Ds.set(w,Fs(Ds.get(w)||null,t,r,a,f,g)),!0}return!1}function _v(t){var r=fi(t.target);if(r!==null){var a=xn(r);if(a!==null){if(r=a.tag,r===13){if(r=zi(a),r!==null){t.blockedOn=r,jr(t.priority,function(){Rr(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 Ko(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var a=Ju(t.domEventName,t.eventSystemFlags,r[0],t.nativeEvent);if(a===null){a=t.nativeEvent;var f=new a.constructor(a.type,a);an=f,a.target.dispatchEvent(f),an=null}else return r=eo(a),r!==null&&Kt(r),t.blockedOn=a,!1;r.shift()}return!0}function Sv(t,r,a){Ko(t)&&a.delete(r)}function fC(){li=!1,fn!==null&&Ko(fn)&&(fn=null),Ct!==null&&Ko(Ct)&&(Ct=null),Je!==null&&Ko(Je)&&(Je=null),Ar.forEach(Sv),Ds.forEach(Sv)}function zs(t,r){t.blockedOn===r&&(t.blockedOn=null,li||(li=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,fC)))}function Bs(t){function r(g){return zs(g,t)}if(0<ci.length){zs(ci[0],t);for(var a=1;a<ci.length;a++){var f=ci[a];f.blockedOn===t&&(f.blockedOn=null)}}for(fn!==null&&zs(fn,t),Ct!==null&&zs(Ct,t),Je!==null&&zs(Je,t),Ar.forEach(r),Ds.forEach(r),a=0;a<Ir.length;a++)f=Ir[a],f.blockedOn===t&&(f.blockedOn=null);for(;0<Ir.length&&(a=Ir[0],a.blockedOn===null);)_v(a),a.blockedOn===null&&Ir.shift()}var Yi=C.ReactCurrentBatchConfig,Xo=!0;function dC(t,r,a,f){var g=Te,w=Yi.transition;Yi.transition=null;try{Te=1,Zu(t,r,a,f)}finally{Te=g,Yi.transition=w}}function hC(t,r,a,f){var g=Te,w=Yi.transition;Yi.transition=null;try{Te=4,Zu(t,r,a,f)}finally{Te=g,Yi.transition=w}}function Zu(t,r,a,f){if(Xo){var g=Ju(t,r,a,f);if(g===null)gl(t,r,f,Qo,a),xv(t,f);else if(cC(g,t,r,a,f))f.stopPropagation();else if(xv(t,f),r&4&&-1<lC.indexOf(t)){for(;g!==null;){var w=eo(g);if(w!==null&&it(w),w=Ju(t,r,a,f),w===null&&gl(t,r,f,Qo,a),w===g)break;g=w}g!==null&&f.stopPropagation()}else gl(t,r,f,null,a)}}var Qo=null;function Ju(t,r,a,f){if(Qo=null,t=Bt(f),t=fi(t),t!==null)if(r=xn(t),r===null)t=null;else if(a=r.tag,a===13){if(t=zi(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 Qo=t,null}function bv(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(Wt()){case si:return 1;case oi:return 4;case Nr:case Wi:return 16;case ai:return 536870912;default:return 16}default:return 16}}var Mr=null,el=null,Zo=null;function kv(){if(Zo)return Zo;var t,r=el,a=r.length,f,g="value"in Mr?Mr.value:Mr.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 Zo=g.slice(t,1<f?1-f:void 0)}function Jo(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 ea(){return!0}function Ev(){return!1}function dn(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 $ in t)t.hasOwnProperty($)&&(a=t[$],this[$]=a?a(w):w[$]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?ea:Ev,this.isPropagationStopped=Ev,this}return V(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=ea)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=ea)},persist:function(){},isPersistent:ea}),r}var Ki={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},tl=dn(Ki),Us=V({},Ki,{view:0,detail:0}),pC=dn(Us),nl,rl,Hs,ta=V({},Us,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sl,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!==Hs&&(Hs&&t.type==="mousemove"?(nl=t.screenX-Hs.screenX,rl=t.screenY-Hs.screenY):rl=nl=0,Hs=t),nl)},movementY:function(t){return"movementY"in t?t.movementY:rl}}),Nv=dn(ta),mC=V({},ta,{dataTransfer:0}),gC=dn(mC),vC=V({},Us,{relatedTarget:0}),il=dn(vC),yC=V({},Ki,{animationName:0,elapsedTime:0,pseudoElement:0}),wC=dn(yC),xC=V({},Ki,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),_C=dn(xC),SC=V({},Ki,{data:0}),Cv=dn(SC),bC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kC={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"},EC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function NC(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=EC[t])?!!r[t]:!1}function sl(){return NC}var CC=V({},Us,{key:function(t){if(t.key){var r=bC[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=Jo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?kC[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sl,charCode:function(t){return t.type==="keypress"?Jo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Jo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),TC=dn(CC),RC=V({},ta,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Tv=dn(RC),jC=V({},Us,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sl}),AC=dn(jC),IC=V({},Ki,{propertyName:0,elapsedTime:0,pseudoElement:0}),MC=dn(IC),PC=V({},ta,{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}),OC=dn(PC),qC=[9,13,27,32],ol=c&&"CompositionEvent"in window,Vs=null;c&&"documentMode"in document&&(Vs=document.documentMode);var LC=c&&"TextEvent"in window&&!Vs,Rv=c&&(!ol||Vs&&8<Vs&&11>=Vs),jv=" ",Av=!1;function Iv(t,r){switch(t){case"keyup":return qC.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mv(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Xi=!1;function $C(t,r){switch(t){case"compositionend":return Mv(r);case"keypress":return r.which!==32?null:(Av=!0,jv);case"textInput":return t=r.data,t===jv&&Av?null:t;default:return null}}function DC(t,r){if(Xi)return t==="compositionend"||!ol&&Iv(t,r)?(t=kv(),Zo=el=Mr=null,Xi=!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 Rv&&r.locale!=="ko"?null:r.data;default:return null}}var FC={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 Pv(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!FC[t.type]:r==="textarea"}function Ov(t,r,a,f){_r(f),r=oa(r,"onChange"),0<r.length&&(a=new tl("onChange","change",null,a,f),t.push({event:a,listeners:r}))}var Ws=null,Gs=null;function zC(t){Jv(t,0)}function na(t){var r=ts(t);if(Fe(r))return t}function BC(t,r){if(t==="change")return r}var qv=!1;if(c){var al;if(c){var ul="oninput"in document;if(!ul){var Lv=document.createElement("div");Lv.setAttribute("oninput","return;"),ul=typeof Lv.oninput=="function"}al=ul}else al=!1;qv=al&&(!document.documentMode||9<document.documentMode)}function $v(){Ws&&(Ws.detachEvent("onpropertychange",Dv),Gs=Ws=null)}function Dv(t){if(t.propertyName==="value"&&na(Gs)){var r=[];Ov(r,Gs,t,Bt(t)),ni(zC,r)}}function UC(t,r,a){t==="focusin"?($v(),Ws=r,Gs=a,Ws.attachEvent("onpropertychange",Dv)):t==="focusout"&&$v()}function HC(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return na(Gs)}function VC(t,r){if(t==="click")return na(r)}function WC(t,r){if(t==="input"||t==="change")return na(r)}function GC(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var On=typeof Object.is=="function"?Object.is:GC;function Ys(t,r){if(On(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)||!On(t[g],r[g]))return!1}return!0}function Fv(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function zv(t,r){var a=Fv(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=Fv(a)}}function Bv(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?Bv(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Uv(){for(var t=window,r=Re();r instanceof t.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)t=r.contentWindow;else break;r=Re(t.document)}return r}function ll(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 YC(t){var r=Uv(),a=t.focusedElem,f=t.selectionRange;if(r!==a&&a&&a.ownerDocument&&Bv(a.ownerDocument.documentElement,a)){if(f!==null&&ll(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=zv(a,w);var T=zv(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 KC=c&&"documentMode"in document&&11>=document.documentMode,Qi=null,cl=null,Ks=null,fl=!1;function Hv(t,r,a){var f=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;fl||Qi==null||Qi!==Re(f)||(f=Qi,"selectionStart"in f&&ll(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}),Ks&&Ys(Ks,f)||(Ks=f,f=oa(cl,"onSelect"),0<f.length&&(r=new tl("onSelect","select",null,r,a),t.push({event:r,listeners:f}),r.target=Qi)))}function ra(t,r){var a={};return a[t.toLowerCase()]=r.toLowerCase(),a["Webkit"+t]="webkit"+r,a["Moz"+t]="moz"+r,a}var Zi={animationend:ra("Animation","AnimationEnd"),animationiteration:ra("Animation","AnimationIteration"),animationstart:ra("Animation","AnimationStart"),transitionend:ra("Transition","TransitionEnd")},dl={},Vv={};c&&(Vv=document.createElement("div").style,"AnimationEvent"in window||(delete Zi.animationend.animation,delete Zi.animationiteration.animation,delete Zi.animationstart.animation),"TransitionEvent"in window||delete Zi.transitionend.transition);function ia(t){if(dl[t])return dl[t];if(!Zi[t])return t;var r=Zi[t],a;for(a in r)if(r.hasOwnProperty(a)&&a in Vv)return dl[t]=r[a];return t}var Wv=ia("animationend"),Gv=ia("animationiteration"),Yv=ia("animationstart"),Kv=ia("transitionend"),Xv=new Map,Qv="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 Pr(t,r){Xv.set(t,r),u(r,[t])}for(var hl=0;hl<Qv.length;hl++){var pl=Qv[hl],XC=pl.toLowerCase(),QC=pl[0].toUpperCase()+pl.slice(1);Pr(XC,"on"+QC)}Pr(Wv,"onAnimationEnd"),Pr(Gv,"onAnimationIteration"),Pr(Yv,"onAnimationStart"),Pr("dblclick","onDoubleClick"),Pr("focusin","onFocus"),Pr("focusout","onBlur"),Pr(Kv,"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 Xs="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(" "),ZC=new Set("cancel close invalid load scroll toggle".split(" ").concat(Xs));function Zv(t,r,a){var f=t.type||"unknown-event";t.currentTarget=a,Fi(f,r,void 0,t),t.currentTarget=null}function Jv(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 $=f[T],H=$.instance,ie=$.currentTarget;if($=$.listener,H!==w&&g.isPropagationStopped())break e;Zv(g,$,ie),w=H}else for(T=0;T<f.length;T++){if($=f[T],H=$.instance,ie=$.currentTarget,$=$.listener,H!==w&&g.isPropagationStopped())break e;Zv(g,$,ie),w=H}}}if(Xn)throw t=br,Xn=!1,br=null,t}function st(t,r){var a=r[Sl];a===void 0&&(a=r[Sl]=new Set);var f=t+"__bubble";a.has(f)||(ey(r,t,2,!1),a.add(f))}function ml(t,r,a){var f=0;r&&(f|=4),ey(a,t,f,r)}var sa="_reactListening"+Math.random().toString(36).slice(2);function Qs(t){if(!t[sa]){t[sa]=!0,s.forEach(function(a){a!=="selectionchange"&&(ZC.has(a)||ml(a,!1,t),ml(a,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[sa]||(r[sa]=!0,ml("selectionchange",!1,r))}}function ey(t,r,a,f){switch(bv(r)){case 1:var g=dC;break;case 4:g=hC;break;default:g=Zu}a=g.bind(null,r,a,t),g=void 0,!Nt||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 gl(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 $=f.stateNode.containerInfo;if($===g||$.nodeType===8&&$.parentNode===g)break;if(T===4)for(T=f.return;T!==null;){var H=T.tag;if((H===3||H===4)&&(H=T.stateNode.containerInfo,H===g||H.nodeType===8&&H.parentNode===g))return;T=T.return}for(;$!==null;){if(T=fi($),T===null)return;if(H=T.tag,H===5||H===6){f=w=T;continue e}$=$.parentNode}}f=f.return}ni(function(){var ie=w,fe=Bt(a),de=[];e:{var le=Xv.get(t);if(le!==void 0){var xe=tl,ke=t;switch(t){case"keypress":if(Jo(a)===0)break e;case"keydown":case"keyup":xe=TC;break;case"focusin":ke="focus",xe=il;break;case"focusout":ke="blur",xe=il;break;case"beforeblur":case"afterblur":xe=il;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":xe=Nv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":xe=gC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":xe=AC;break;case Wv:case Gv:case Yv:xe=wC;break;case Kv:xe=MC;break;case"scroll":xe=pC;break;case"wheel":xe=OC;break;case"copy":case"cut":case"paste":xe=_C;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":xe=Tv}var Ee=(r&4)!==0,mt=!Ee&&t==="scroll",ee=Ee?le!==null?le+"Capture":null:le;Ee=[];for(var Y=ie,re;Y!==null;){re=Y;var pe=re.stateNode;if(re.tag===5&&pe!==null&&(re=pe,ee!==null&&(pe=ir(Y,ee),pe!=null&&Ee.push(Zs(Y,pe,re)))),mt)break;Y=Y.return}0<Ee.length&&(le=new xe(le,ke,null,a,fe),de.push({event:le,listeners:Ee}))}}if((r&7)===0){e:{if(le=t==="mouseover"||t==="pointerover",xe=t==="mouseout"||t==="pointerout",le&&a!==an&&(ke=a.relatedTarget||a.fromElement)&&(fi(ke)||ke[sr]))break e;if((xe||le)&&(le=fe.window===fe?fe:(le=fe.ownerDocument)?le.defaultView||le.parentWindow:window,xe?(ke=a.relatedTarget||a.toElement,xe=ie,ke=ke?fi(ke):null,ke!==null&&(mt=xn(ke),ke!==mt||ke.tag!==5&&ke.tag!==6)&&(ke=null)):(xe=null,ke=ie),xe!==ke)){if(Ee=Nv,pe="onMouseLeave",ee="onMouseEnter",Y="mouse",(t==="pointerout"||t==="pointerover")&&(Ee=Tv,pe="onPointerLeave",ee="onPointerEnter",Y="pointer"),mt=xe==null?le:ts(xe),re=ke==null?le:ts(ke),le=new Ee(pe,Y+"leave",xe,a,fe),le.target=mt,le.relatedTarget=re,pe=null,fi(fe)===ie&&(Ee=new Ee(ee,Y+"enter",ke,a,fe),Ee.target=re,Ee.relatedTarget=mt,pe=Ee),mt=pe,xe&&ke)t:{for(Ee=xe,ee=ke,Y=0,re=Ee;re;re=Ji(re))Y++;for(re=0,pe=ee;pe;pe=Ji(pe))re++;for(;0<Y-re;)Ee=Ji(Ee),Y--;for(;0<re-Y;)ee=Ji(ee),re--;for(;Y--;){if(Ee===ee||ee!==null&&Ee===ee.alternate)break t;Ee=Ji(Ee),ee=Ji(ee)}Ee=null}else Ee=null;xe!==null&&ty(de,le,xe,Ee,!1),ke!==null&&mt!==null&&ty(de,mt,ke,Ee,!0)}}e:{if(le=ie?ts(ie):window,xe=le.nodeName&&le.nodeName.toLowerCase(),xe==="select"||xe==="input"&&le.type==="file")var Ne=BC;else if(Pv(le))if(qv)Ne=WC;else{Ne=HC;var je=UC}else(xe=le.nodeName)&&xe.toLowerCase()==="input"&&(le.type==="checkbox"||le.type==="radio")&&(Ne=VC);if(Ne&&(Ne=Ne(t,ie))){Ov(de,Ne,a,fe);break e}je&&je(t,le,ie),t==="focusout"&&(je=le._wrapperState)&&je.controlled&&le.type==="number"&&qe(le,"number",le.value)}switch(je=ie?ts(ie):window,t){case"focusin":(Pv(je)||je.contentEditable==="true")&&(Qi=je,cl=ie,Ks=null);break;case"focusout":Ks=cl=Qi=null;break;case"mousedown":fl=!0;break;case"contextmenu":case"mouseup":case"dragend":fl=!1,Hv(de,a,fe);break;case"selectionchange":if(KC)break;case"keydown":case"keyup":Hv(de,a,fe)}var Ae;if(ol)e:{switch(t){case"compositionstart":var Ie="onCompositionStart";break e;case"compositionend":Ie="onCompositionEnd";break e;case"compositionupdate":Ie="onCompositionUpdate";break e}Ie=void 0}else Xi?Iv(t,a)&&(Ie="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(Ie="onCompositionStart");Ie&&(Rv&&a.locale!=="ko"&&(Xi||Ie!=="onCompositionStart"?Ie==="onCompositionEnd"&&Xi&&(Ae=kv()):(Mr=fe,el="value"in Mr?Mr.value:Mr.textContent,Xi=!0)),je=oa(ie,Ie),0<je.length&&(Ie=new Cv(Ie,t,null,a,fe),de.push({event:Ie,listeners:je}),Ae?Ie.data=Ae:(Ae=Mv(a),Ae!==null&&(Ie.data=Ae)))),(Ae=LC?$C(t,a):DC(t,a))&&(ie=oa(ie,"onBeforeInput"),0<ie.length&&(fe=new Cv("onBeforeInput","beforeinput",null,a,fe),de.push({event:fe,listeners:ie}),fe.data=Ae))}Jv(de,r)})}function Zs(t,r,a){return{instance:t,listener:r,currentTarget:a}}function oa(t,r){for(var a=r+"Capture",f=[];t!==null;){var g=t,w=g.stateNode;g.tag===5&&w!==null&&(g=w,w=ir(t,a),w!=null&&f.unshift(Zs(t,w,g)),w=ir(t,r),w!=null&&f.push(Zs(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 ty(t,r,a,f,g){for(var w=r._reactName,T=[];a!==null&&a!==f;){var $=a,H=$.alternate,ie=$.stateNode;if(H!==null&&H===f)break;$.tag===5&&ie!==null&&($=ie,g?(H=ir(a,w),H!=null&&T.unshift(Zs(a,H,$))):g||(H=ir(a,w),H!=null&&T.push(Zs(a,H,$)))),a=a.return}T.length!==0&&t.push({event:r,listeners:T})}var JC=/\r\n?/g,eT=/\u0000|\uFFFD/g;function ny(t){return(typeof t=="string"?t:""+t).replace(JC,`
38
+ `).replace(eT,"")}function aa(t,r,a){if(r=ny(r),ny(t)!==r&&a)throw Error(i(425))}function ua(){}var vl=null,yl=null;function wl(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 xl=typeof setTimeout=="function"?setTimeout:void 0,tT=typeof clearTimeout=="function"?clearTimeout:void 0,ry=typeof Promise=="function"?Promise:void 0,nT=typeof queueMicrotask=="function"?queueMicrotask:typeof ry<"u"?function(t){return ry.resolve(null).then(t).catch(rT)}:xl;function rT(t){setTimeout(function(){throw t})}function _l(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),Bs(r);return}f--}else a!=="$"&&a!=="$?"&&a!=="$!"||f++;a=g}while(a);Bs(r)}function Or(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 iy(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 es=Math.random().toString(36).slice(2),Qn="__reactFiber$"+es,Js="__reactProps$"+es,sr="__reactContainer$"+es,Sl="__reactEvents$"+es,iT="__reactListeners$"+es,sT="__reactHandles$"+es;function fi(t){var r=t[Qn];if(r)return r;for(var a=t.parentNode;a;){if(r=a[sr]||a[Qn]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(t=iy(t);t!==null;){if(a=t[Qn])return a;t=iy(t)}return r}t=a,a=t.parentNode}return null}function eo(t){return t=t[Qn]||t[sr],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function ts(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(i(33))}function la(t){return t[Js]||null}var bl=[],ns=-1;function qr(t){return{current:t}}function ot(t){0>ns||(t.current=bl[ns],bl[ns]=null,ns--)}function rt(t,r){ns++,bl[ns]=t.current,t.current=r}var Lr={},$t=qr(Lr),Xt=qr(!1),di=Lr;function rs(t,r){var a=t.type.contextTypes;if(!a)return Lr;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 Qt(t){return t=t.childContextTypes,t!=null}function ca(){ot(Xt),ot($t)}function sy(t,r,a){if($t.current!==Lr)throw Error(i(168));rt($t,r),rt(Xt,a)}function oy(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 V({},a,f)}function fa(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Lr,di=$t.current,rt($t,t),rt(Xt,Xt.current),!0}function ay(t,r,a){var f=t.stateNode;if(!f)throw Error(i(169));a?(t=oy(t,r,di),f.__reactInternalMemoizedMergedChildContext=t,ot(Xt),ot($t),rt($t,t)):ot(Xt),rt(Xt,a)}var or=null,da=!1,kl=!1;function uy(t){or===null?or=[t]:or.push(t)}function oT(t){da=!0,uy(t)}function $r(){if(!kl&&or!==null){kl=!0;var t=0,r=Te;try{var a=or;for(Te=1;t<a.length;t++){var f=a[t];do f=f(!0);while(f!==null)}or=null,da=!1}catch(g){throw or!==null&&(or=or.slice(t+1)),ii(si,$r),g}finally{Te=r,kl=!1}}return null}var is=[],ss=0,ha=null,pa=0,Sn=[],bn=0,hi=null,ar=1,ur="";function pi(t,r){is[ss++]=pa,is[ss++]=ha,ha=t,pa=r}function ly(t,r,a){Sn[bn++]=ar,Sn[bn++]=ur,Sn[bn++]=hi,hi=t;var f=ar;t=ur;var g=32-Yt(f)-1;f&=~(1<<g),a+=1;var w=32-Yt(r)+g;if(30<w){var T=g-g%5;w=(f&(1<<T)-1).toString(32),f>>=T,g-=T,ar=1<<32-Yt(r)+g|a<<g|f,ur=w+t}else ar=1<<w|a<<g|f,ur=t}function El(t){t.return!==null&&(pi(t,1),ly(t,1,0))}function Nl(t){for(;t===ha;)ha=is[--ss],is[ss]=null,pa=is[--ss],is[ss]=null;for(;t===hi;)hi=Sn[--bn],Sn[bn]=null,ur=Sn[--bn],Sn[bn]=null,ar=Sn[--bn],Sn[bn]=null}var hn=null,pn=null,at=!1,qn=null;function cy(t,r){var a=Cn(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 fy(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,hn=t,pn=Or(r.firstChild),!0):!1;case 6:return r=t.pendingProps===""||r.nodeType!==3?null:r,r!==null?(t.stateNode=r,hn=t,pn=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(a=hi!==null?{id:ar,overflow:ur}:null,t.memoizedState={dehydrated:r,treeContext:a,retryLane:1073741824},a=Cn(18,null,null,0),a.stateNode=r,a.return=t,t.child=a,hn=t,pn=null,!0):!1;default:return!1}}function Cl(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Tl(t){if(at){var r=pn;if(r){var a=r;if(!fy(t,r)){if(Cl(t))throw Error(i(418));r=Or(a.nextSibling);var f=hn;r&&fy(t,r)?cy(f,a):(t.flags=t.flags&-4097|2,at=!1,hn=t)}}else{if(Cl(t))throw Error(i(418));t.flags=t.flags&-4097|2,at=!1,hn=t}}}function dy(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;hn=t}function ma(t){if(t!==hn)return!1;if(!at)return dy(t),at=!0,!1;var r;if((r=t.tag!==3)&&!(r=t.tag!==5)&&(r=t.type,r=r!=="head"&&r!=="body"&&!wl(t.type,t.memoizedProps)),r&&(r=pn)){if(Cl(t))throw hy(),Error(i(418));for(;r;)cy(t,r),r=Or(r.nextSibling)}if(dy(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){pn=Or(t.nextSibling);break e}r--}else a!=="$"&&a!=="$!"&&a!=="$?"||r++}t=t.nextSibling}pn=null}}else pn=hn?Or(t.stateNode.nextSibling):null;return!0}function hy(){for(var t=pn;t;)t=Or(t.nextSibling)}function os(){pn=hn=null,at=!1}function Rl(t){qn===null?qn=[t]:qn.push(t)}var aT=C.ReactCurrentBatchConfig;function to(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 $=g.refs;T===null?delete $[w]:$[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 ga(t,r){throw t=Object.prototype.toString.call(r),Error(i(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t))}function py(t){var r=t._init;return r(t._payload)}function my(t){function r(ee,Y){if(t){var re=ee.deletions;re===null?(ee.deletions=[Y],ee.flags|=16):re.push(Y)}}function a(ee,Y){if(!t)return null;for(;Y!==null;)r(ee,Y),Y=Y.sibling;return null}function f(ee,Y){for(ee=new Map;Y!==null;)Y.key!==null?ee.set(Y.key,Y):ee.set(Y.index,Y),Y=Y.sibling;return ee}function g(ee,Y){return ee=Wr(ee,Y),ee.index=0,ee.sibling=null,ee}function w(ee,Y,re){return ee.index=re,t?(re=ee.alternate,re!==null?(re=re.index,re<Y?(ee.flags|=2,Y):re):(ee.flags|=2,Y)):(ee.flags|=1048576,Y)}function T(ee){return t&&ee.alternate===null&&(ee.flags|=2),ee}function $(ee,Y,re,pe){return Y===null||Y.tag!==6?(Y=xc(re,ee.mode,pe),Y.return=ee,Y):(Y=g(Y,re),Y.return=ee,Y)}function H(ee,Y,re,pe){var Ne=re.type;return Ne===I?fe(ee,Y,re.props.children,pe,re.key):Y!==null&&(Y.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===U&&py(Ne)===Y.type)?(pe=g(Y,re.props),pe.ref=to(ee,Y,re),pe.return=ee,pe):(pe=Fa(re.type,re.key,re.props,null,ee.mode,pe),pe.ref=to(ee,Y,re),pe.return=ee,pe)}function ie(ee,Y,re,pe){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==re.containerInfo||Y.stateNode.implementation!==re.implementation?(Y=_c(re,ee.mode,pe),Y.return=ee,Y):(Y=g(Y,re.children||[]),Y.return=ee,Y)}function fe(ee,Y,re,pe,Ne){return Y===null||Y.tag!==7?(Y=Si(re,ee.mode,pe,Ne),Y.return=ee,Y):(Y=g(Y,re),Y.return=ee,Y)}function de(ee,Y,re){if(typeof Y=="string"&&Y!==""||typeof Y=="number")return Y=xc(""+Y,ee.mode,re),Y.return=ee,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case A:return re=Fa(Y.type,Y.key,Y.props,null,ee.mode,re),re.ref=to(ee,null,Y),re.return=ee,re;case P:return Y=_c(Y,ee.mode,re),Y.return=ee,Y;case U:var pe=Y._init;return de(ee,pe(Y._payload),re)}if(Ye(Y)||D(Y))return Y=Si(Y,ee.mode,re,null),Y.return=ee,Y;ga(ee,Y)}return null}function le(ee,Y,re,pe){var Ne=Y!==null?Y.key:null;if(typeof re=="string"&&re!==""||typeof re=="number")return Ne!==null?null:$(ee,Y,""+re,pe);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case A:return re.key===Ne?H(ee,Y,re,pe):null;case P:return re.key===Ne?ie(ee,Y,re,pe):null;case U:return Ne=re._init,le(ee,Y,Ne(re._payload),pe)}if(Ye(re)||D(re))return Ne!==null?null:fe(ee,Y,re,pe,null);ga(ee,re)}return null}function xe(ee,Y,re,pe,Ne){if(typeof pe=="string"&&pe!==""||typeof pe=="number")return ee=ee.get(re)||null,$(Y,ee,""+pe,Ne);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case A:return ee=ee.get(pe.key===null?re:pe.key)||null,H(Y,ee,pe,Ne);case P:return ee=ee.get(pe.key===null?re:pe.key)||null,ie(Y,ee,pe,Ne);case U:var je=pe._init;return xe(ee,Y,re,je(pe._payload),Ne)}if(Ye(pe)||D(pe))return ee=ee.get(re)||null,fe(Y,ee,pe,Ne,null);ga(Y,pe)}return null}function ke(ee,Y,re,pe){for(var Ne=null,je=null,Ae=Y,Ie=Y=0,jt=null;Ae!==null&&Ie<re.length;Ie++){Ae.index>Ie?(jt=Ae,Ae=null):jt=Ae.sibling;var Ve=le(ee,Ae,re[Ie],pe);if(Ve===null){Ae===null&&(Ae=jt);break}t&&Ae&&Ve.alternate===null&&r(ee,Ae),Y=w(Ve,Y,Ie),je===null?Ne=Ve:je.sibling=Ve,je=Ve,Ae=jt}if(Ie===re.length)return a(ee,Ae),at&&pi(ee,Ie),Ne;if(Ae===null){for(;Ie<re.length;Ie++)Ae=de(ee,re[Ie],pe),Ae!==null&&(Y=w(Ae,Y,Ie),je===null?Ne=Ae:je.sibling=Ae,je=Ae);return at&&pi(ee,Ie),Ne}for(Ae=f(ee,Ae);Ie<re.length;Ie++)jt=xe(Ae,ee,Ie,re[Ie],pe),jt!==null&&(t&&jt.alternate!==null&&Ae.delete(jt.key===null?Ie:jt.key),Y=w(jt,Y,Ie),je===null?Ne=jt:je.sibling=jt,je=jt);return t&&Ae.forEach(function(Gr){return r(ee,Gr)}),at&&pi(ee,Ie),Ne}function Ee(ee,Y,re,pe){var Ne=D(re);if(typeof Ne!="function")throw Error(i(150));if(re=Ne.call(re),re==null)throw Error(i(151));for(var je=Ne=null,Ae=Y,Ie=Y=0,jt=null,Ve=re.next();Ae!==null&&!Ve.done;Ie++,Ve=re.next()){Ae.index>Ie?(jt=Ae,Ae=null):jt=Ae.sibling;var Gr=le(ee,Ae,Ve.value,pe);if(Gr===null){Ae===null&&(Ae=jt);break}t&&Ae&&Gr.alternate===null&&r(ee,Ae),Y=w(Gr,Y,Ie),je===null?Ne=Gr:je.sibling=Gr,je=Gr,Ae=jt}if(Ve.done)return a(ee,Ae),at&&pi(ee,Ie),Ne;if(Ae===null){for(;!Ve.done;Ie++,Ve=re.next())Ve=de(ee,Ve.value,pe),Ve!==null&&(Y=w(Ve,Y,Ie),je===null?Ne=Ve:je.sibling=Ve,je=Ve);return at&&pi(ee,Ie),Ne}for(Ae=f(ee,Ae);!Ve.done;Ie++,Ve=re.next())Ve=xe(Ae,ee,Ie,Ve.value,pe),Ve!==null&&(t&&Ve.alternate!==null&&Ae.delete(Ve.key===null?Ie:Ve.key),Y=w(Ve,Y,Ie),je===null?Ne=Ve:je.sibling=Ve,je=Ve);return t&&Ae.forEach(function(FT){return r(ee,FT)}),at&&pi(ee,Ie),Ne}function mt(ee,Y,re,pe){if(typeof re=="object"&&re!==null&&re.type===I&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case A:e:{for(var Ne=re.key,je=Y;je!==null;){if(je.key===Ne){if(Ne=re.type,Ne===I){if(je.tag===7){a(ee,je.sibling),Y=g(je,re.props.children),Y.return=ee,ee=Y;break e}}else if(je.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===U&&py(Ne)===je.type){a(ee,je.sibling),Y=g(je,re.props),Y.ref=to(ee,je,re),Y.return=ee,ee=Y;break e}a(ee,je);break}else r(ee,je);je=je.sibling}re.type===I?(Y=Si(re.props.children,ee.mode,pe,re.key),Y.return=ee,ee=Y):(pe=Fa(re.type,re.key,re.props,null,ee.mode,pe),pe.ref=to(ee,Y,re),pe.return=ee,ee=pe)}return T(ee);case P:e:{for(je=re.key;Y!==null;){if(Y.key===je)if(Y.tag===4&&Y.stateNode.containerInfo===re.containerInfo&&Y.stateNode.implementation===re.implementation){a(ee,Y.sibling),Y=g(Y,re.children||[]),Y.return=ee,ee=Y;break e}else{a(ee,Y);break}else r(ee,Y);Y=Y.sibling}Y=_c(re,ee.mode,pe),Y.return=ee,ee=Y}return T(ee);case U:return je=re._init,mt(ee,Y,je(re._payload),pe)}if(Ye(re))return ke(ee,Y,re,pe);if(D(re))return Ee(ee,Y,re,pe);ga(ee,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,Y!==null&&Y.tag===6?(a(ee,Y.sibling),Y=g(Y,re),Y.return=ee,ee=Y):(a(ee,Y),Y=xc(re,ee.mode,pe),Y.return=ee,ee=Y),T(ee)):a(ee,Y)}return mt}var as=my(!0),gy=my(!1),va=qr(null),ya=null,us=null,jl=null;function Al(){jl=us=ya=null}function Il(t){var r=va.current;ot(va),t._currentValue=r}function Ml(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 ls(t,r){ya=t,jl=us=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&r)!==0&&(Zt=!0),t.firstContext=null)}function kn(t){var r=t._currentValue;if(jl!==t)if(t={context:t,memoizedValue:r,next:null},us===null){if(ya===null)throw Error(i(308));us=t,ya.dependencies={lanes:0,firstContext:t}}else us=us.next=t;return r}var mi=null;function Pl(t){mi===null?mi=[t]:mi.push(t)}function vy(t,r,a,f){var g=r.interleaved;return g===null?(a.next=a,Pl(r)):(a.next=g.next,g.next=a),r.interleaved=a,lr(t,f)}function lr(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 Dr=!1;function Ol(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function yy(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 cr(t,r){return{eventTime:t,lane:r,tag:0,payload:null,callback:null,next:null}}function Fr(t,r,a){var f=t.updateQueue;if(f===null)return null;if(f=f.shared,(Ue&2)!==0){var g=f.pending;return g===null?r.next=r:(r.next=g.next,g.next=r),f.pending=r,lr(t,a)}return g=f.interleaved,g===null?(r.next=r,Pl(f)):(r.next=g.next,g.next=r),f.interleaved=r,lr(t,a)}function wa(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,ze(t,a)}}function wy(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 xa(t,r,a,f){var g=t.updateQueue;Dr=!1;var w=g.firstBaseUpdate,T=g.lastBaseUpdate,$=g.shared.pending;if($!==null){g.shared.pending=null;var H=$,ie=H.next;H.next=null,T===null?w=ie:T.next=ie,T=H;var fe=t.alternate;fe!==null&&(fe=fe.updateQueue,$=fe.lastBaseUpdate,$!==T&&($===null?fe.firstBaseUpdate=ie:$.next=ie,fe.lastBaseUpdate=H))}if(w!==null){var de=g.baseState;T=0,fe=ie=H=null,$=w;do{var le=$.lane,xe=$.eventTime;if((f&le)===le){fe!==null&&(fe=fe.next={eventTime:xe,lane:0,tag:$.tag,payload:$.payload,callback:$.callback,next:null});e:{var ke=t,Ee=$;switch(le=r,xe=a,Ee.tag){case 1:if(ke=Ee.payload,typeof ke=="function"){de=ke.call(xe,de,le);break e}de=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Ee.payload,le=typeof ke=="function"?ke.call(xe,de,le):ke,le==null)break e;de=V({},de,le);break e;case 2:Dr=!0}}$.callback!==null&&$.lane!==0&&(t.flags|=64,le=g.effects,le===null?g.effects=[$]:le.push($))}else xe={eventTime:xe,lane:le,tag:$.tag,payload:$.payload,callback:$.callback,next:null},fe===null?(ie=fe=xe,H=de):fe=fe.next=xe,T|=le;if($=$.next,$===null){if($=g.shared.pending,$===null)break;le=$,$=le.next,le.next=null,g.lastBaseUpdate=le,g.shared.pending=null}}while(!0);if(fe===null&&(H=de),g.baseState=H,g.firstBaseUpdate=ie,g.lastBaseUpdate=fe,r=g.shared.interleaved,r!==null){g=r;do T|=g.lane,g=g.next;while(g!==r)}else w===null&&(g.shared.lanes=0);yi|=T,t.lanes=T,t.memoizedState=de}}function xy(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 no={},Zn=qr(no),ro=qr(no),io=qr(no);function gi(t){if(t===no)throw Error(i(174));return t}function ql(t,r){switch(rt(io,r),rt(ro,t),rt(Zn,no),t=r.nodeType,t){case 9:case 11:r=(r=r.documentElement)?r.namespaceURI:It(null,"");break;default:t=t===8?r.parentNode:r,r=t.namespaceURI||null,t=t.tagName,r=It(r,t)}ot(Zn),rt(Zn,r)}function cs(){ot(Zn),ot(ro),ot(io)}function _y(t){gi(io.current);var r=gi(Zn.current),a=It(r,t.type);r!==a&&(rt(ro,t),rt(Zn,a))}function Ll(t){ro.current===t&&(ot(Zn),ot(ro))}var lt=qr(0);function _a(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 $l=[];function Dl(){for(var t=0;t<$l.length;t++)$l[t]._workInProgressVersionPrimary=null;$l.length=0}var Sa=C.ReactCurrentDispatcher,Fl=C.ReactCurrentBatchConfig,vi=0,ct=null,xt=null,Tt=null,ba=!1,so=!1,oo=0,uT=0;function Dt(){throw Error(i(321))}function zl(t,r){if(r===null)return!1;for(var a=0;a<r.length&&a<t.length;a++)if(!On(t[a],r[a]))return!1;return!0}function Bl(t,r,a,f,g,w){if(vi=w,ct=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,Sa.current=t===null||t.memoizedState===null?dT:hT,t=a(f,g),so){w=0;do{if(so=!1,oo=0,25<=w)throw Error(i(301));w+=1,Tt=xt=null,r.updateQueue=null,Sa.current=pT,t=a(f,g)}while(so)}if(Sa.current=Na,r=xt!==null&&xt.next!==null,vi=0,Tt=xt=ct=null,ba=!1,r)throw Error(i(300));return t}function Ul(){var t=oo!==0;return oo=0,t}function Jn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?ct.memoizedState=Tt=t:Tt=Tt.next=t,Tt}function En(){if(xt===null){var t=ct.alternate;t=t!==null?t.memoizedState:null}else t=xt.next;var r=Tt===null?ct.memoizedState:Tt.next;if(r!==null)Tt=r,xt=t;else{if(t===null)throw Error(i(310));xt=t,t={memoizedState:xt.memoizedState,baseState:xt.baseState,baseQueue:xt.baseQueue,queue:xt.queue,next:null},Tt===null?ct.memoizedState=Tt=t:Tt=Tt.next=t}return Tt}function ao(t,r){return typeof r=="function"?r(t):r}function Hl(t){var r=En(),a=r.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=t;var f=xt,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 $=T=null,H=null,ie=w;do{var fe=ie.lane;if((vi&fe)===fe)H!==null&&(H=H.next={lane:0,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),f=ie.hasEagerState?ie.eagerState:t(f,ie.action);else{var de={lane:fe,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null};H===null?($=H=de,T=f):H=H.next=de,ct.lanes|=fe,yi|=fe}ie=ie.next}while(ie!==null&&ie!==w);H===null?T=f:H.next=$,On(f,r.memoizedState)||(Zt=!0),r.memoizedState=f,r.baseState=T,r.baseQueue=H,a.lastRenderedState=f}if(t=a.interleaved,t!==null){g=t;do w=g.lane,ct.lanes|=w,yi|=w,g=g.next;while(g!==t)}else g===null&&(a.lanes=0);return[r.memoizedState,a.dispatch]}function Vl(t){var r=En(),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);On(w,r.memoizedState)||(Zt=!0),r.memoizedState=w,r.baseQueue===null&&(r.baseState=w),a.lastRenderedState=w}return[w,f]}function Sy(){}function by(t,r){var a=ct,f=En(),g=r(),w=!On(f.memoizedState,g);if(w&&(f.memoizedState=g,Zt=!0),f=f.queue,Wl(Ny.bind(null,a,f,t),[t]),f.getSnapshot!==r||w||Tt!==null&&Tt.memoizedState.tag&1){if(a.flags|=2048,uo(9,Ey.bind(null,a,f,g,r),void 0,null),Rt===null)throw Error(i(349));(vi&30)!==0||ky(a,r,g)}return g}function ky(t,r,a){t.flags|=16384,t={getSnapshot:r,value:a},r=ct.updateQueue,r===null?(r={lastEffect:null,stores:null},ct.updateQueue=r,r.stores=[t]):(a=r.stores,a===null?r.stores=[t]:a.push(t))}function Ey(t,r,a,f){r.value=a,r.getSnapshot=f,Cy(r)&&Ty(t)}function Ny(t,r,a){return a(function(){Cy(r)&&Ty(t)})}function Cy(t){var r=t.getSnapshot;t=t.value;try{var a=r();return!On(t,a)}catch{return!0}}function Ty(t){var r=lr(t,1);r!==null&&Fn(r,t,1,-1)}function Ry(t){var r=Jn();return typeof t=="function"&&(t=t()),r.memoizedState=r.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ao,lastRenderedState:t},r.queue=t,t=t.dispatch=fT.bind(null,ct,t),[r.memoizedState,t]}function uo(t,r,a,f){return t={tag:t,create:r,destroy:a,deps:f,next:null},r=ct.updateQueue,r===null?(r={lastEffect:null,stores:null},ct.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 jy(){return En().memoizedState}function ka(t,r,a,f){var g=Jn();ct.flags|=t,g.memoizedState=uo(1|r,a,void 0,f===void 0?null:f)}function Ea(t,r,a,f){var g=En();f=f===void 0?null:f;var w=void 0;if(xt!==null){var T=xt.memoizedState;if(w=T.destroy,f!==null&&zl(f,T.deps)){g.memoizedState=uo(r,a,w,f);return}}ct.flags|=t,g.memoizedState=uo(1|r,a,w,f)}function Ay(t,r){return ka(8390656,8,t,r)}function Wl(t,r){return Ea(2048,8,t,r)}function Iy(t,r){return Ea(4,2,t,r)}function My(t,r){return Ea(4,4,t,r)}function Py(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 Oy(t,r,a){return a=a!=null?a.concat([t]):null,Ea(4,4,Py.bind(null,r,t),a)}function Gl(){}function qy(t,r){var a=En();r=r===void 0?null:r;var f=a.memoizedState;return f!==null&&r!==null&&zl(r,f[1])?f[0]:(a.memoizedState=[t,r],t)}function Ly(t,r){var a=En();r=r===void 0?null:r;var f=a.memoizedState;return f!==null&&r!==null&&zl(r,f[1])?f[0]:(t=t(),a.memoizedState=[t,r],t)}function $y(t,r,a){return(vi&21)===0?(t.baseState&&(t.baseState=!1,Zt=!0),t.memoizedState=a):(On(a,r)||(a=me(),ct.lanes|=a,yi|=a,t.baseState=!0),r)}function lT(t,r){var a=Te;Te=a!==0&&4>a?a:4,t(!0);var f=Fl.transition;Fl.transition={};try{t(!1),r()}finally{Te=a,Fl.transition=f}}function Dy(){return En().memoizedState}function cT(t,r,a){var f=Hr(t);if(a={lane:f,action:a,hasEagerState:!1,eagerState:null,next:null},Fy(t))zy(r,a);else if(a=vy(t,r,a,f),a!==null){var g=Ht();Fn(a,t,f,g),By(a,r,f)}}function fT(t,r,a){var f=Hr(t),g={lane:f,action:a,hasEagerState:!1,eagerState:null,next:null};if(Fy(t))zy(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,$=w(T,a);if(g.hasEagerState=!0,g.eagerState=$,On($,T)){var H=r.interleaved;H===null?(g.next=g,Pl(r)):(g.next=H.next,H.next=g),r.interleaved=g;return}}catch{}finally{}a=vy(t,r,g,f),a!==null&&(g=Ht(),Fn(a,t,f,g),By(a,r,f))}}function Fy(t){var r=t.alternate;return t===ct||r!==null&&r===ct}function zy(t,r){so=ba=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function By(t,r,a){if((a&4194240)!==0){var f=r.lanes;f&=t.pendingLanes,a|=f,r.lanes=a,ze(t,a)}}var Na={readContext:kn,useCallback:Dt,useContext:Dt,useEffect:Dt,useImperativeHandle:Dt,useInsertionEffect:Dt,useLayoutEffect:Dt,useMemo:Dt,useReducer:Dt,useRef:Dt,useState:Dt,useDebugValue:Dt,useDeferredValue:Dt,useTransition:Dt,useMutableSource:Dt,useSyncExternalStore:Dt,useId:Dt,unstable_isNewReconciler:!1},dT={readContext:kn,useCallback:function(t,r){return Jn().memoizedState=[t,r===void 0?null:r],t},useContext:kn,useEffect:Ay,useImperativeHandle:function(t,r,a){return a=a!=null?a.concat([t]):null,ka(4194308,4,Py.bind(null,r,t),a)},useLayoutEffect:function(t,r){return ka(4194308,4,t,r)},useInsertionEffect:function(t,r){return ka(4,2,t,r)},useMemo:function(t,r){var a=Jn();return r=r===void 0?null:r,t=t(),a.memoizedState=[t,r],t},useReducer:function(t,r,a){var f=Jn();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=cT.bind(null,ct,t),[f.memoizedState,t]},useRef:function(t){var r=Jn();return t={current:t},r.memoizedState=t},useState:Ry,useDebugValue:Gl,useDeferredValue:function(t){return Jn().memoizedState=t},useTransition:function(){var t=Ry(!1),r=t[0];return t=lT.bind(null,t[1]),Jn().memoizedState=t,[r,t]},useMutableSource:function(){},useSyncExternalStore:function(t,r,a){var f=ct,g=Jn();if(at){if(a===void 0)throw Error(i(407));a=a()}else{if(a=r(),Rt===null)throw Error(i(349));(vi&30)!==0||ky(f,r,a)}g.memoizedState=a;var w={value:a,getSnapshot:r};return g.queue=w,Ay(Ny.bind(null,f,w,t),[t]),f.flags|=2048,uo(9,Ey.bind(null,f,w,a,r),void 0,null),a},useId:function(){var t=Jn(),r=Rt.identifierPrefix;if(at){var a=ur,f=ar;a=(f&~(1<<32-Yt(f)-1)).toString(32)+a,r=":"+r+"R"+a,a=oo++,0<a&&(r+="H"+a.toString(32)),r+=":"}else a=uT++,r=":"+r+"r"+a.toString(32)+":";return t.memoizedState=r},unstable_isNewReconciler:!1},hT={readContext:kn,useCallback:qy,useContext:kn,useEffect:Wl,useImperativeHandle:Oy,useInsertionEffect:Iy,useLayoutEffect:My,useMemo:Ly,useReducer:Hl,useRef:jy,useState:function(){return Hl(ao)},useDebugValue:Gl,useDeferredValue:function(t){var r=En();return $y(r,xt.memoizedState,t)},useTransition:function(){var t=Hl(ao)[0],r=En().memoizedState;return[t,r]},useMutableSource:Sy,useSyncExternalStore:by,useId:Dy,unstable_isNewReconciler:!1},pT={readContext:kn,useCallback:qy,useContext:kn,useEffect:Wl,useImperativeHandle:Oy,useInsertionEffect:Iy,useLayoutEffect:My,useMemo:Ly,useReducer:Vl,useRef:jy,useState:function(){return Vl(ao)},useDebugValue:Gl,useDeferredValue:function(t){var r=En();return xt===null?r.memoizedState=t:$y(r,xt.memoizedState,t)},useTransition:function(){var t=Vl(ao)[0],r=En().memoizedState;return[t,r]},useMutableSource:Sy,useSyncExternalStore:by,useId:Dy,unstable_isNewReconciler:!1};function Ln(t,r){if(t&&t.defaultProps){r=V({},r),t=t.defaultProps;for(var a in t)r[a]===void 0&&(r[a]=t[a]);return r}return r}function Yl(t,r,a,f){r=t.memoizedState,a=a(f,r),a=a==null?r:V({},r,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var Ca={isMounted:function(t){return(t=t._reactInternals)?xn(t)===t:!1},enqueueSetState:function(t,r,a){t=t._reactInternals;var f=Ht(),g=Hr(t),w=cr(f,g);w.payload=r,a!=null&&(w.callback=a),r=Fr(t,w,g),r!==null&&(Fn(r,t,g,f),wa(r,t,g))},enqueueReplaceState:function(t,r,a){t=t._reactInternals;var f=Ht(),g=Hr(t),w=cr(f,g);w.tag=1,w.payload=r,a!=null&&(w.callback=a),r=Fr(t,w,g),r!==null&&(Fn(r,t,g,f),wa(r,t,g))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var a=Ht(),f=Hr(t),g=cr(a,f);g.tag=2,r!=null&&(g.callback=r),r=Fr(t,g,f),r!==null&&(Fn(r,t,f,a),wa(r,t,f))}};function Uy(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?!Ys(a,f)||!Ys(g,w):!0}function Hy(t,r,a){var f=!1,g=Lr,w=r.contextType;return typeof w=="object"&&w!==null?w=kn(w):(g=Qt(r)?di:$t.current,f=r.contextTypes,w=(f=f!=null)?rs(t,g):Lr),r=new r(a,w),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Ca,t.stateNode=r,r._reactInternals=t,f&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=g,t.__reactInternalMemoizedMaskedChildContext=w),r}function Vy(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&&Ca.enqueueReplaceState(r,r.state,null)}function Kl(t,r,a,f){var g=t.stateNode;g.props=a,g.state=t.memoizedState,g.refs={},Ol(t);var w=r.contextType;typeof w=="object"&&w!==null?g.context=kn(w):(w=Qt(r)?di:$t.current,g.context=rs(t,w)),g.state=t.memoizedState,w=r.getDerivedStateFromProps,typeof w=="function"&&(Yl(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&&Ca.enqueueReplaceState(g,g.state,null),xa(t,a,g,f),g.state=t.memoizedState),typeof g.componentDidMount=="function"&&(t.flags|=4194308)}function fs(t,r){try{var a="",f=r;do a+=W(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 Xl(t,r,a){return{value:t,source:null,stack:a??null,digest:r??null}}function Ql(t,r){try{console.error(r.value)}catch(a){setTimeout(function(){throw a})}}var mT=typeof WeakMap=="function"?WeakMap:Map;function Wy(t,r,a){a=cr(-1,a),a.tag=3,a.payload={element:null};var f=r.value;return a.callback=function(){Pa||(Pa=!0,dc=f),Ql(t,r)},a}function Gy(t,r,a){a=cr(-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(){Ql(t,r)}}var w=t.stateNode;return w!==null&&typeof w.componentDidCatch=="function"&&(a.callback=function(){Ql(t,r),typeof f!="function"&&(Br===null?Br=new Set([this]):Br.add(this));var T=r.stack;this.componentDidCatch(r.value,{componentStack:T!==null?T:""})}),a}function Yy(t,r,a){var f=t.pingCache;if(f===null){f=t.pingCache=new mT;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=RT.bind(null,t,r,a),r.then(t,t))}function Ky(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 Xy(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=cr(-1,1),r.tag=2,Fr(a,r,1))),a.lanes|=1),t):(t.flags|=65536,t.lanes=g,t)}var gT=C.ReactCurrentOwner,Zt=!1;function Ut(t,r,a,f){r.child=t===null?gy(r,null,a,f):as(r,t.child,a,f)}function Qy(t,r,a,f,g){a=a.render;var w=r.ref;return ls(r,g),f=Bl(t,r,a,f,w,g),a=Ul(),t!==null&&!Zt?(r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~g,fr(t,r,g)):(at&&a&&El(r),r.flags|=1,Ut(t,r,f,g),r.child)}function Zy(t,r,a,f,g){if(t===null){var w=a.type;return typeof w=="function"&&!wc(w)&&w.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(r.tag=15,r.type=w,Jy(t,r,w,f,g)):(t=Fa(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:Ys,a(T,f)&&t.ref===r.ref)return fr(t,r,g)}return r.flags|=1,t=Wr(w,f),t.ref=r.ref,t.return=r,r.child=t}function Jy(t,r,a,f,g){if(t!==null){var w=t.memoizedProps;if(Ys(w,f)&&t.ref===r.ref)if(Zt=!1,r.pendingProps=f=w,(t.lanes&g)!==0)(t.flags&131072)!==0&&(Zt=!0);else return r.lanes=t.lanes,fr(t,r,g)}return Zl(t,r,a,f,g)}function e0(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},rt(hs,mn),mn|=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,rt(hs,mn),mn|=t,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},f=w!==null?w.baseLanes:a,rt(hs,mn),mn|=f}else w!==null?(f=w.baseLanes|a,r.memoizedState=null):f=a,rt(hs,mn),mn|=f;return Ut(t,r,g,a),r.child}function t0(t,r){var a=r.ref;(t===null&&a!==null||t!==null&&t.ref!==a)&&(r.flags|=512,r.flags|=2097152)}function Zl(t,r,a,f,g){var w=Qt(a)?di:$t.current;return w=rs(r,w),ls(r,g),a=Bl(t,r,a,f,w,g),f=Ul(),t!==null&&!Zt?(r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~g,fr(t,r,g)):(at&&f&&El(r),r.flags|=1,Ut(t,r,a,g),r.child)}function n0(t,r,a,f,g){if(Qt(a)){var w=!0;fa(r)}else w=!1;if(ls(r,g),r.stateNode===null)Ra(t,r),Hy(r,a,f),Kl(r,a,f,g),f=!0;else if(t===null){var T=r.stateNode,$=r.memoizedProps;T.props=$;var H=T.context,ie=a.contextType;typeof ie=="object"&&ie!==null?ie=kn(ie):(ie=Qt(a)?di:$t.current,ie=rs(r,ie));var fe=a.getDerivedStateFromProps,de=typeof fe=="function"||typeof T.getSnapshotBeforeUpdate=="function";de||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||($!==f||H!==ie)&&Vy(r,T,f,ie),Dr=!1;var le=r.memoizedState;T.state=le,xa(r,f,T,g),H=r.memoizedState,$!==f||le!==H||Xt.current||Dr?(typeof fe=="function"&&(Yl(r,a,fe,f),H=r.memoizedState),($=Dr||Uy(r,a,$,f,le,H,ie))?(de||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(r.flags|=4194308)):(typeof T.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=f,r.memoizedState=H),T.props=f,T.state=H,T.context=ie,f=$):(typeof T.componentDidMount=="function"&&(r.flags|=4194308),f=!1)}else{T=r.stateNode,yy(t,r),$=r.memoizedProps,ie=r.type===r.elementType?$:Ln(r.type,$),T.props=ie,de=r.pendingProps,le=T.context,H=a.contextType,typeof H=="object"&&H!==null?H=kn(H):(H=Qt(a)?di:$t.current,H=rs(r,H));var xe=a.getDerivedStateFromProps;(fe=typeof xe=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||($!==de||le!==H)&&Vy(r,T,f,H),Dr=!1,le=r.memoizedState,T.state=le,xa(r,f,T,g);var ke=r.memoizedState;$!==de||le!==ke||Xt.current||Dr?(typeof xe=="function"&&(Yl(r,a,xe,f),ke=r.memoizedState),(ie=Dr||Uy(r,a,ie,f,le,ke,H)||!1)?(fe||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(f,ke,H),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(f,ke,H)),typeof T.componentDidUpdate=="function"&&(r.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof T.componentDidUpdate!="function"||$===t.memoizedProps&&le===t.memoizedState||(r.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||$===t.memoizedProps&&le===t.memoizedState||(r.flags|=1024),r.memoizedProps=f,r.memoizedState=ke),T.props=f,T.state=ke,T.context=H,f=ie):(typeof T.componentDidUpdate!="function"||$===t.memoizedProps&&le===t.memoizedState||(r.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||$===t.memoizedProps&&le===t.memoizedState||(r.flags|=1024),f=!1)}return Jl(t,r,a,f,w,g)}function Jl(t,r,a,f,g,w){t0(t,r);var T=(r.flags&128)!==0;if(!f&&!T)return g&&ay(r,a,!1),fr(t,r,w);f=r.stateNode,gT.current=r;var $=T&&typeof a.getDerivedStateFromError!="function"?null:f.render();return r.flags|=1,t!==null&&T?(r.child=as(r,t.child,null,w),r.child=as(r,null,$,w)):Ut(t,r,$,w),r.memoizedState=f.state,g&&ay(r,a,!0),r.child}function r0(t){var r=t.stateNode;r.pendingContext?sy(t,r.pendingContext,r.pendingContext!==r.context):r.context&&sy(t,r.context,!1),ql(t,r.containerInfo)}function i0(t,r,a,f,g){return os(),Rl(g),r.flags|=256,Ut(t,r,a,f),r.child}var ec={dehydrated:null,treeContext:null,retryLane:0};function tc(t){return{baseLanes:t,cachePool:null,transitions:null}}function s0(t,r,a){var f=r.pendingProps,g=lt.current,w=!1,T=(r.flags&128)!==0,$;if(($=T)||($=t!==null&&t.memoizedState===null?!1:(g&2)!==0),$?(w=!0,r.flags&=-129):(t===null||t.memoizedState!==null)&&(g|=1),rt(lt,g&1),t===null)return Tl(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=za(T,f,0,null),t=Si(t,f,a,null),w.return=r,t.return=r,w.sibling=t,r.child=w,r.child.memoizedState=tc(a),r.memoizedState=ec,t):nc(r,T));if(g=t.memoizedState,g!==null&&($=g.dehydrated,$!==null))return vT(t,r,T,f,$,g,a);if(w){w=f.fallback,T=r.mode,g=t.child,$=g.sibling;var H={mode:"hidden",children:f.children};return(T&1)===0&&r.child!==g?(f=r.child,f.childLanes=0,f.pendingProps=H,r.deletions=null):(f=Wr(g,H),f.subtreeFlags=g.subtreeFlags&14680064),$!==null?w=Wr($,w):(w=Si(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?tc(a):{baseLanes:T.baseLanes|a,cachePool:null,transitions:T.transitions},w.memoizedState=T,w.childLanes=t.childLanes&~a,r.memoizedState=ec,f}return w=t.child,t=w.sibling,f=Wr(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 nc(t,r){return r=za({mode:"visible",children:r},t.mode,0,null),r.return=t,t.child=r}function Ta(t,r,a,f){return f!==null&&Rl(f),as(r,t.child,null,a),t=nc(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function vT(t,r,a,f,g,w,T){if(a)return r.flags&256?(r.flags&=-257,f=Xl(Error(i(422))),Ta(t,r,T,f)):r.memoizedState!==null?(r.child=t.child,r.flags|=128,null):(w=f.fallback,g=r.mode,f=za({mode:"visible",children:f.children},g,0,null),w=Si(w,g,T,null),w.flags|=2,f.return=r,w.return=r,f.sibling=w,r.child=f,(r.mode&1)!==0&&as(r,t.child,null,T),r.child.memoizedState=tc(T),r.memoizedState=ec,w);if((r.mode&1)===0)return Ta(t,r,T,null);if(g.data==="$!"){if(f=g.nextSibling&&g.nextSibling.dataset,f)var $=f.dgst;return f=$,w=Error(i(419)),f=Xl(w,f,void 0),Ta(t,r,T,f)}if($=(T&t.childLanes)!==0,Zt||$){if(f=Rt,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,lr(t,g),Fn(f,t,g,-1))}return yc(),f=Xl(Error(i(421))),Ta(t,r,T,f)}return g.data==="$?"?(r.flags|=128,r.child=t.child,r=jT.bind(null,t),g._reactRetry=r,null):(t=w.treeContext,pn=Or(g.nextSibling),hn=r,at=!0,qn=null,t!==null&&(Sn[bn++]=ar,Sn[bn++]=ur,Sn[bn++]=hi,ar=t.id,ur=t.overflow,hi=r),r=nc(r,f.children),r.flags|=4096,r)}function o0(t,r,a){t.lanes|=r;var f=t.alternate;f!==null&&(f.lanes|=r),Ml(t.return,r,a)}function rc(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 a0(t,r,a){var f=r.pendingProps,g=f.revealOrder,w=f.tail;if(Ut(t,r,f.children,a),f=lt.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&&o0(t,a,r);else if(t.tag===19)o0(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(rt(lt,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&&_a(t)===null&&(g=a),a=a.sibling;a=g,a===null?(g=r.child,r.child=null):(g=a.sibling,a.sibling=null),rc(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&&_a(t)===null){r.child=g;break}t=g.sibling,g.sibling=a,a=g,g=t}rc(r,!0,a,null,w);break;case"together":rc(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function Ra(t,r){(r.mode&1)===0&&t!==null&&(t.alternate=null,r.alternate=null,r.flags|=2)}function fr(t,r,a){if(t!==null&&(r.dependencies=t.dependencies),yi|=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=Wr(t,t.pendingProps),r.child=a,a.return=r;t.sibling!==null;)t=t.sibling,a=a.sibling=Wr(t,t.pendingProps),a.return=r;a.sibling=null}return r.child}function yT(t,r,a){switch(r.tag){case 3:r0(r),os();break;case 5:_y(r);break;case 1:Qt(r.type)&&fa(r);break;case 4:ql(r,r.stateNode.containerInfo);break;case 10:var f=r.type._context,g=r.memoizedProps.value;rt(va,f._currentValue),f._currentValue=g;break;case 13:if(f=r.memoizedState,f!==null)return f.dehydrated!==null?(rt(lt,lt.current&1),r.flags|=128,null):(a&r.child.childLanes)!==0?s0(t,r,a):(rt(lt,lt.current&1),t=fr(t,r,a),t!==null?t.sibling:null);rt(lt,lt.current&1);break;case 19:if(f=(a&r.childLanes)!==0,(t.flags&128)!==0){if(f)return a0(t,r,a);r.flags|=128}if(g=r.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),rt(lt,lt.current),f)break;return null;case 22:case 23:return r.lanes=0,e0(t,r,a)}return fr(t,r,a)}var u0,ic,l0,c0;u0=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}},ic=function(){},l0=function(t,r,a,f){var g=t.memoizedProps;if(g!==f){t=r.stateNode,gi(Zn.current);var w=null;switch(a){case"input":g=Pe(t,g),f=Pe(t,f),w=[];break;case"select":g=V({},g,{value:void 0}),f=V({},f,{value:void 0}),w=[];break;case"textarea":g=et(t,g),f=et(t,f),w=[];break;default:typeof g.onClick!="function"&&typeof f.onClick=="function"&&(t.onclick=ua)}Lt(a,f);var T;a=null;for(ie in g)if(!f.hasOwnProperty(ie)&&g.hasOwnProperty(ie)&&g[ie]!=null)if(ie==="style"){var $=g[ie];for(T in $)$.hasOwnProperty(T)&&(a||(a={}),a[T]="")}else ie!=="dangerouslySetInnerHTML"&&ie!=="children"&&ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&ie!=="autoFocus"&&(o.hasOwnProperty(ie)?w||(w=[]):(w=w||[]).push(ie,null));for(ie in f){var H=f[ie];if($=g!=null?g[ie]:void 0,f.hasOwnProperty(ie)&&H!==$&&(H!=null||$!=null))if(ie==="style")if($){for(T in $)!$.hasOwnProperty(T)||H&&H.hasOwnProperty(T)||(a||(a={}),a[T]="");for(T in H)H.hasOwnProperty(T)&&$[T]!==H[T]&&(a||(a={}),a[T]=H[T])}else a||(w||(w=[]),w.push(ie,a)),a=H;else ie==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,$=$?$.__html:void 0,H!=null&&$!==H&&(w=w||[]).push(ie,H)):ie==="children"?typeof H!="string"&&typeof H!="number"||(w=w||[]).push(ie,""+H):ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&(o.hasOwnProperty(ie)?(H!=null&&ie==="onScroll"&&st("scroll",t),w||$===H||(w=[])):(w=w||[]).push(ie,H))}a&&(w=w||[]).push("style",a);var ie=w;(r.updateQueue=ie)&&(r.flags|=4)}},c0=function(t,r,a,f){a!==f&&(r.flags|=4)};function lo(t,r){if(!at)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 Ft(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 wT(t,r,a){var f=r.pendingProps;switch(Nl(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ft(r),null;case 1:return Qt(r.type)&&ca(),Ft(r),null;case 3:return f=r.stateNode,cs(),ot(Xt),ot($t),Dl(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(t===null||t.child===null)&&(ma(r)?r.flags|=4:t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,qn!==null&&(mc(qn),qn=null))),ic(t,r),Ft(r),null;case 5:Ll(r);var g=gi(io.current);if(a=r.type,t!==null&&r.stateNode!=null)l0(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 Ft(r),null}if(t=gi(Zn.current),ma(r)){f=r.stateNode,a=r.type;var w=r.memoizedProps;switch(f[Qn]=r,f[Js]=w,t=(r.mode&1)!==0,a){case"dialog":st("cancel",f),st("close",f);break;case"iframe":case"object":case"embed":st("load",f);break;case"video":case"audio":for(g=0;g<Xs.length;g++)st(Xs[g],f);break;case"source":st("error",f);break;case"img":case"image":case"link":st("error",f),st("load",f);break;case"details":st("toggle",f);break;case"input":be(f,w),st("invalid",f);break;case"select":f._wrapperState={wasMultiple:!!w.multiple},st("invalid",f);break;case"textarea":Be(f,w),st("invalid",f)}Lt(a,w),g=null;for(var T in w)if(w.hasOwnProperty(T)){var $=w[T];T==="children"?typeof $=="string"?f.textContent!==$&&(w.suppressHydrationWarning!==!0&&aa(f.textContent,$,t),g=["children",$]):typeof $=="number"&&f.textContent!==""+$&&(w.suppressHydrationWarning!==!0&&aa(f.textContent,$,t),g=["children",""+$]):o.hasOwnProperty(T)&&$!=null&&T==="onScroll"&&st("scroll",f)}switch(a){case"input":Me(f),ye(f,w,!0);break;case"textarea":Me(f),At(f);break;case"select":case"option":break;default:typeof w.onClick=="function"&&(f.onclick=ua)}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=Vt(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[Qn]=r,t[Js]=f,u0(t,r,!1,!1),r.stateNode=t;e:{switch(T=wt(a,f),a){case"dialog":st("cancel",t),st("close",t),g=f;break;case"iframe":case"object":case"embed":st("load",t),g=f;break;case"video":case"audio":for(g=0;g<Xs.length;g++)st(Xs[g],t);g=f;break;case"source":st("error",t),g=f;break;case"img":case"image":case"link":st("error",t),st("load",t),g=f;break;case"details":st("toggle",t),g=f;break;case"input":be(t,f),g=Pe(t,f),st("invalid",t);break;case"option":g=f;break;case"select":t._wrapperState={wasMultiple:!!f.multiple},g=V({},f,{value:void 0}),st("invalid",t);break;case"textarea":Be(t,f),g=et(t,f),st("invalid",t);break;default:g=f}Lt(a,g),$=g;for(w in $)if($.hasOwnProperty(w)){var H=$[w];w==="style"?ft(t,H):w==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,H!=null&&tt(t,H)):w==="children"?typeof H=="string"?(a!=="textarea"||H!=="")&&kt(t,H):typeof H=="number"&&kt(t,""+H):w!=="suppressContentEditableWarning"&&w!=="suppressHydrationWarning"&&w!=="autoFocus"&&(o.hasOwnProperty(w)?H!=null&&w==="onScroll"&&st("scroll",t):H!=null&&E(t,w,H,T))}switch(a){case"input":Me(t),ye(t,f,!1);break;case"textarea":Me(t),At(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?Qe(t,!!f.multiple,w,!1):f.defaultValue!=null&&Qe(t,!!f.multiple,f.defaultValue,!0);break;default:typeof g.onClick=="function"&&(t.onclick=ua)}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 Ft(r),null;case 6:if(t&&r.stateNode!=null)c0(t,r,t.memoizedProps,f);else{if(typeof f!="string"&&r.stateNode===null)throw Error(i(166));if(a=gi(io.current),gi(Zn.current),ma(r)){if(f=r.stateNode,a=r.memoizedProps,f[Qn]=r,(w=f.nodeValue!==a)&&(t=hn,t!==null))switch(t.tag){case 3:aa(f.nodeValue,a,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&aa(f.nodeValue,a,(t.mode&1)!==0)}w&&(r.flags|=4)}else f=(a.nodeType===9?a:a.ownerDocument).createTextNode(f),f[Qn]=r,r.stateNode=f}return Ft(r),null;case 13:if(ot(lt),f=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(at&&pn!==null&&(r.mode&1)!==0&&(r.flags&128)===0)hy(),os(),r.flags|=98560,w=!1;else if(w=ma(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[Qn]=r}else os(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Ft(r),w=!1}else qn!==null&&(mc(qn),qn=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||(lt.current&1)!==0?_t===0&&(_t=3):yc())),r.updateQueue!==null&&(r.flags|=4),Ft(r),null);case 4:return cs(),ic(t,r),t===null&&Qs(r.stateNode.containerInfo),Ft(r),null;case 10:return Il(r.type._context),Ft(r),null;case 17:return Qt(r.type)&&ca(),Ft(r),null;case 19:if(ot(lt),w=r.memoizedState,w===null)return Ft(r),null;if(f=(r.flags&128)!==0,T=w.rendering,T===null)if(f)lo(w,!1);else{if(_t!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(T=_a(t),T!==null){for(r.flags|=128,lo(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 rt(lt,lt.current&1|2),r.child}t=t.sibling}w.tail!==null&&nt()>ps&&(r.flags|=128,f=!0,lo(w,!1),r.lanes=4194304)}else{if(!f)if(t=_a(T),t!==null){if(r.flags|=128,f=!0,a=t.updateQueue,a!==null&&(r.updateQueue=a,r.flags|=4),lo(w,!0),w.tail===null&&w.tailMode==="hidden"&&!T.alternate&&!at)return Ft(r),null}else 2*nt()-w.renderingStartTime>ps&&a!==1073741824&&(r.flags|=128,f=!0,lo(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=nt(),r.sibling=null,a=lt.current,rt(lt,f?a&1|2:a&1),r):(Ft(r),null);case 22:case 23:return vc(),f=r.memoizedState!==null,t!==null&&t.memoizedState!==null!==f&&(r.flags|=8192),f&&(r.mode&1)!==0?(mn&1073741824)!==0&&(Ft(r),r.subtreeFlags&6&&(r.flags|=8192)):Ft(r),null;case 24:return null;case 25:return null}throw Error(i(156,r.tag))}function xT(t,r){switch(Nl(r),r.tag){case 1:return Qt(r.type)&&ca(),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return cs(),ot(Xt),ot($t),Dl(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 5:return Ll(r),null;case 13:if(ot(lt),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(i(340));os()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return ot(lt),null;case 4:return cs(),null;case 10:return Il(r.type._context),null;case 22:case 23:return vc(),null;case 24:return null;default:return null}}var ja=!1,zt=!1,_T=typeof WeakSet=="function"?WeakSet:Set,Se=null;function ds(t,r){var a=t.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(f){dt(t,r,f)}else a.current=null}function sc(t,r,a){try{a()}catch(f){dt(t,r,f)}}var f0=!1;function ST(t,r){if(vl=Xo,t=Uv(),ll(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,$=-1,H=-1,ie=0,fe=0,de=t,le=null;t:for(;;){for(var xe;de!==a||g!==0&&de.nodeType!==3||($=T+g),de!==w||f!==0&&de.nodeType!==3||(H=T+f),de.nodeType===3&&(T+=de.nodeValue.length),(xe=de.firstChild)!==null;)le=de,de=xe;for(;;){if(de===t)break t;if(le===a&&++ie===g&&($=T),le===w&&++fe===f&&(H=T),(xe=de.nextSibling)!==null)break;de=le,le=de.parentNode}de=xe}a=$===-1||H===-1?null:{start:$,end:H}}else a=null}a=a||{start:0,end:0}}else a=null;for(yl={focusedElem:t,selectionRange:a},Xo=!1,Se=r;Se!==null;)if(r=Se,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Se=t;else for(;Se!==null;){r=Se;try{var ke=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(ke!==null){var Ee=ke.memoizedProps,mt=ke.memoizedState,ee=r.stateNode,Y=ee.getSnapshotBeforeUpdate(r.elementType===r.type?Ee:Ln(r.type,Ee),mt);ee.__reactInternalSnapshotBeforeUpdate=Y}break;case 3:var re=r.stateNode.containerInfo;re.nodeType===1?re.textContent="":re.nodeType===9&&re.documentElement&&re.removeChild(re.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(pe){dt(r,r.return,pe)}if(t=r.sibling,t!==null){t.return=r.return,Se=t;break}Se=r.return}return ke=f0,f0=!1,ke}function co(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&&sc(r,a,w)}g=g.next}while(g!==f)}}function Aa(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 oc(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 d0(t){var r=t.alternate;r!==null&&(t.alternate=null,d0(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&(delete r[Qn],delete r[Js],delete r[Sl],delete r[iT],delete r[sT])),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 h0(t){return t.tag===5||t.tag===3||t.tag===4}function p0(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||h0(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 ac(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=ua));else if(f!==4&&(t=t.child,t!==null))for(ac(t,r,a),t=t.sibling;t!==null;)ac(t,r,a),t=t.sibling}function uc(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(uc(t,r,a),t=t.sibling;t!==null;)uc(t,r,a),t=t.sibling}var Pt=null,$n=!1;function zr(t,r,a){for(a=a.child;a!==null;)m0(t,r,a),a=a.sibling}function m0(t,r,a){if(Gt&&typeof Gt.onCommitFiberUnmount=="function")try{Gt.onCommitFiberUnmount(_n,a)}catch{}switch(a.tag){case 5:zt||ds(a,r);case 6:var f=Pt,g=$n;Pt=null,zr(t,r,a),Pt=f,$n=g,Pt!==null&&($n?(t=Pt,a=a.stateNode,t.nodeType===8?t.parentNode.removeChild(a):t.removeChild(a)):Pt.removeChild(a.stateNode));break;case 18:Pt!==null&&($n?(t=Pt,a=a.stateNode,t.nodeType===8?_l(t.parentNode,a):t.nodeType===1&&_l(t,a),Bs(t)):_l(Pt,a.stateNode));break;case 4:f=Pt,g=$n,Pt=a.stateNode.containerInfo,$n=!0,zr(t,r,a),Pt=f,$n=g;break;case 0:case 11:case 14:case 15:if(!zt&&(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)&&sc(a,r,T),g=g.next}while(g!==f)}zr(t,r,a);break;case 1:if(!zt&&(ds(a,r),f=a.stateNode,typeof f.componentWillUnmount=="function"))try{f.props=a.memoizedProps,f.state=a.memoizedState,f.componentWillUnmount()}catch($){dt(a,r,$)}zr(t,r,a);break;case 21:zr(t,r,a);break;case 22:a.mode&1?(zt=(f=zt)||a.memoizedState!==null,zr(t,r,a),zt=f):zr(t,r,a);break;default:zr(t,r,a)}}function g0(t){var r=t.updateQueue;if(r!==null){t.updateQueue=null;var a=t.stateNode;a===null&&(a=t.stateNode=new _T),r.forEach(function(f){var g=AT.bind(null,t,f);a.has(f)||(a.add(f),f.then(g,g))})}}function Dn(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,$=T;e:for(;$!==null;){switch($.tag){case 5:Pt=$.stateNode,$n=!1;break e;case 3:Pt=$.stateNode.containerInfo,$n=!0;break e;case 4:Pt=$.stateNode.containerInfo,$n=!0;break e}$=$.return}if(Pt===null)throw Error(i(160));m0(w,T,g),Pt=null,$n=!1;var H=g.alternate;H!==null&&(H.return=null),g.return=null}catch(ie){dt(g,r,ie)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)v0(r,t),r=r.sibling}function v0(t,r){var a=t.alternate,f=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Dn(r,t),er(t),f&4){try{co(3,t,t.return),Aa(3,t)}catch(Ee){dt(t,t.return,Ee)}try{co(5,t,t.return)}catch(Ee){dt(t,t.return,Ee)}}break;case 1:Dn(r,t),er(t),f&512&&a!==null&&ds(a,a.return);break;case 5:if(Dn(r,t),er(t),f&512&&a!==null&&ds(a,a.return),t.flags&32){var g=t.stateNode;try{kt(g,"")}catch(Ee){dt(t,t.return,Ee)}}if(f&4&&(g=t.stateNode,g!=null)){var w=t.memoizedProps,T=a!==null?a.memoizedProps:w,$=t.type,H=t.updateQueue;if(t.updateQueue=null,H!==null)try{$==="input"&&w.type==="radio"&&w.name!=null&&Oe(g,w),wt($,T);var ie=wt($,w);for(T=0;T<H.length;T+=2){var fe=H[T],de=H[T+1];fe==="style"?ft(g,de):fe==="dangerouslySetInnerHTML"?tt(g,de):fe==="children"?kt(g,de):E(g,fe,de,ie)}switch($){case"input":ve(g,w);break;case"textarea":Ze(g,w);break;case"select":var le=g._wrapperState.wasMultiple;g._wrapperState.wasMultiple=!!w.multiple;var xe=w.value;xe!=null?Qe(g,!!w.multiple,xe,!1):le!==!!w.multiple&&(w.defaultValue!=null?Qe(g,!!w.multiple,w.defaultValue,!0):Qe(g,!!w.multiple,w.multiple?[]:"",!1))}g[Js]=w}catch(Ee){dt(t,t.return,Ee)}}break;case 6:if(Dn(r,t),er(t),f&4){if(t.stateNode===null)throw Error(i(162));g=t.stateNode,w=t.memoizedProps;try{g.nodeValue=w}catch(Ee){dt(t,t.return,Ee)}}break;case 3:if(Dn(r,t),er(t),f&4&&a!==null&&a.memoizedState.isDehydrated)try{Bs(r.containerInfo)}catch(Ee){dt(t,t.return,Ee)}break;case 4:Dn(r,t),er(t);break;case 13:Dn(r,t),er(t),g=t.child,g.flags&8192&&(w=g.memoizedState!==null,g.stateNode.isHidden=w,!w||g.alternate!==null&&g.alternate.memoizedState!==null||(fc=nt())),f&4&&g0(t);break;case 22:if(fe=a!==null&&a.memoizedState!==null,t.mode&1?(zt=(ie=zt)||fe,Dn(r,t),zt=ie):Dn(r,t),er(t),f&8192){if(ie=t.memoizedState!==null,(t.stateNode.isHidden=ie)&&!fe&&(t.mode&1)!==0)for(Se=t,fe=t.child;fe!==null;){for(de=Se=fe;Se!==null;){switch(le=Se,xe=le.child,le.tag){case 0:case 11:case 14:case 15:co(4,le,le.return);break;case 1:ds(le,le.return);var ke=le.stateNode;if(typeof ke.componentWillUnmount=="function"){f=le,a=le.return;try{r=f,ke.props=r.memoizedProps,ke.state=r.memoizedState,ke.componentWillUnmount()}catch(Ee){dt(f,a,Ee)}}break;case 5:ds(le,le.return);break;case 22:if(le.memoizedState!==null){x0(de);continue}}xe!==null?(xe.return=le,Se=xe):x0(de)}fe=fe.sibling}e:for(fe=null,de=t;;){if(de.tag===5){if(fe===null){fe=de;try{g=de.stateNode,ie?(w=g.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none"):($=de.stateNode,H=de.memoizedProps.style,T=H!=null&&H.hasOwnProperty("display")?H.display:null,$.style.display=Ge("display",T))}catch(Ee){dt(t,t.return,Ee)}}}else if(de.tag===6){if(fe===null)try{de.stateNode.nodeValue=ie?"":de.memoizedProps}catch(Ee){dt(t,t.return,Ee)}}else if((de.tag!==22&&de.tag!==23||de.memoizedState===null||de===t)&&de.child!==null){de.child.return=de,de=de.child;continue}if(de===t)break e;for(;de.sibling===null;){if(de.return===null||de.return===t)break e;fe===de&&(fe=null),de=de.return}fe===de&&(fe=null),de.sibling.return=de.return,de=de.sibling}}break;case 19:Dn(r,t),er(t),f&4&&g0(t);break;case 21:break;default:Dn(r,t),er(t)}}function er(t){var r=t.flags;if(r&2){try{e:{for(var a=t.return;a!==null;){if(h0(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&&(kt(g,""),f.flags&=-33);var w=p0(t);uc(t,w,g);break;case 3:case 4:var T=f.stateNode.containerInfo,$=p0(t);ac(t,$,T);break;default:throw Error(i(161))}}catch(H){dt(t,t.return,H)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function bT(t,r,a){Se=t,y0(t)}function y0(t,r,a){for(var f=(t.mode&1)!==0;Se!==null;){var g=Se,w=g.child;if(g.tag===22&&f){var T=g.memoizedState!==null||ja;if(!T){var $=g.alternate,H=$!==null&&$.memoizedState!==null||zt;$=ja;var ie=zt;if(ja=T,(zt=H)&&!ie)for(Se=g;Se!==null;)T=Se,H=T.child,T.tag===22&&T.memoizedState!==null?_0(g):H!==null?(H.return=T,Se=H):_0(g);for(;w!==null;)Se=w,y0(w),w=w.sibling;Se=g,ja=$,zt=ie}w0(t)}else(g.subtreeFlags&8772)!==0&&w!==null?(w.return=g,Se=w):w0(t)}}function w0(t){for(;Se!==null;){var r=Se;if((r.flags&8772)!==0){var a=r.alternate;try{if((r.flags&8772)!==0)switch(r.tag){case 0:case 11:case 15:zt||Aa(5,r);break;case 1:var f=r.stateNode;if(r.flags&4&&!zt)if(a===null)f.componentDidMount();else{var g=r.elementType===r.type?a.memoizedProps:Ln(r.type,a.memoizedProps);f.componentDidUpdate(g,a.memoizedState,f.__reactInternalSnapshotBeforeUpdate)}var w=r.updateQueue;w!==null&&xy(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}xy(r,T,a)}break;case 5:var $=r.stateNode;if(a===null&&r.flags&4){a=$;var H=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":H.autoFocus&&a.focus();break;case"img":H.src&&(a.src=H.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var ie=r.alternate;if(ie!==null){var fe=ie.memoizedState;if(fe!==null){var de=fe.dehydrated;de!==null&&Bs(de)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}zt||r.flags&512&&oc(r)}catch(le){dt(r,r.return,le)}}if(r===t){Se=null;break}if(a=r.sibling,a!==null){a.return=r.return,Se=a;break}Se=r.return}}function x0(t){for(;Se!==null;){var r=Se;if(r===t){Se=null;break}var a=r.sibling;if(a!==null){a.return=r.return,Se=a;break}Se=r.return}}function _0(t){for(;Se!==null;){var r=Se;try{switch(r.tag){case 0:case 11:case 15:var a=r.return;try{Aa(4,r)}catch(H){dt(r,a,H)}break;case 1:var f=r.stateNode;if(typeof f.componentDidMount=="function"){var g=r.return;try{f.componentDidMount()}catch(H){dt(r,g,H)}}var w=r.return;try{oc(r)}catch(H){dt(r,w,H)}break;case 5:var T=r.return;try{oc(r)}catch(H){dt(r,T,H)}}}catch(H){dt(r,r.return,H)}if(r===t){Se=null;break}var $=r.sibling;if($!==null){$.return=r.return,Se=$;break}Se=r.return}}var kT=Math.ceil,Ia=C.ReactCurrentDispatcher,lc=C.ReactCurrentOwner,Nn=C.ReactCurrentBatchConfig,Ue=0,Rt=null,vt=null,Ot=0,mn=0,hs=qr(0),_t=0,fo=null,yi=0,Ma=0,cc=0,ho=null,Jt=null,fc=0,ps=1/0,dr=null,Pa=!1,dc=null,Br=null,Oa=!1,Ur=null,qa=0,po=0,hc=null,La=-1,$a=0;function Ht(){return(Ue&6)!==0?nt():La!==-1?La:La=nt()}function Hr(t){return(t.mode&1)===0?1:(Ue&2)!==0&&Ot!==0?Ot&-Ot:aT.transition!==null?($a===0&&($a=me()),$a):(t=Te,t!==0||(t=window.event,t=t===void 0?16:bv(t.type)),t)}function Fn(t,r,a,f){if(50<po)throw po=0,hc=null,Error(i(185));we(t,a,f),((Ue&2)===0||t!==Rt)&&(t===Rt&&((Ue&2)===0&&(Ma|=a),_t===4&&Vr(t,Ot)),en(t,f),a===1&&Ue===0&&(r.mode&1)===0&&(ps=nt()+500,da&&$r()))}function en(t,r){var a=t.callbackNode;te(t,r);var f=Mt(t,t===Rt?Ot:0);if(f===0)a!==null&&Ui(a),t.callbackNode=null,t.callbackPriority=0;else if(r=f&-f,t.callbackPriority!==r){if(a!=null&&Ui(a),r===1)t.tag===0?oT(b0.bind(null,t)):uy(b0.bind(null,t)),nT(function(){(Ue&6)===0&&$r()}),a=null;else{switch(Ke(f)){case 1:a=si;break;case 4:a=oi;break;case 16:a=Nr;break;case 536870912:a=ai;break;default:a=Nr}a=A0(a,S0.bind(null,t))}t.callbackPriority=r,t.callbackNode=a}}function S0(t,r){if(La=-1,$a=0,(Ue&6)!==0)throw Error(i(327));var a=t.callbackNode;if(ms()&&t.callbackNode!==a)return null;var f=Mt(t,t===Rt?Ot:0);if(f===0)return null;if((f&30)!==0||(f&t.expiredLanes)!==0||r)r=Da(t,f);else{r=f;var g=Ue;Ue|=2;var w=E0();(Rt!==t||Ot!==r)&&(dr=null,ps=nt()+500,xi(t,r));do try{CT();break}catch($){k0(t,$)}while(!0);Al(),Ia.current=w,Ue=g,vt!==null?r=0:(Rt=null,Ot=0,r=_t)}if(r!==0){if(r===2&&(g=ce(t),g!==0&&(f=g,r=pc(t,g))),r===1)throw a=fo,xi(t,0),Vr(t,f),en(t,nt()),a;if(r===6)Vr(t,f);else{if(g=t.current.alternate,(f&30)===0&&!ET(g)&&(r=Da(t,f),r===2&&(w=ce(t),w!==0&&(f=w,r=pc(t,w))),r===1))throw a=fo,xi(t,0),Vr(t,f),en(t,nt()),a;switch(t.finishedWork=g,t.finishedLanes=f,r){case 0:case 1:throw Error(i(345));case 2:_i(t,Jt,dr);break;case 3:if(Vr(t,f),(f&130023424)===f&&(r=fc+500-nt(),10<r)){if(Mt(t,0)!==0)break;if(g=t.suspendedLanes,(g&f)!==f){Ht(),t.pingedLanes|=t.suspendedLanes&g;break}t.timeoutHandle=xl(_i.bind(null,t,Jt,dr),r);break}_i(t,Jt,dr);break;case 4:if(Vr(t,f),(f&4194240)===f)break;for(r=t.eventTimes,g=-1;0<f;){var T=31-Yt(f);w=1<<T,T=r[T],T>g&&(g=T),f&=~w}if(f=g,f=nt()-f,f=(120>f?120:480>f?480:1080>f?1080:1920>f?1920:3e3>f?3e3:4320>f?4320:1960*kT(f/1960))-f,10<f){t.timeoutHandle=xl(_i.bind(null,t,Jt,dr),f);break}_i(t,Jt,dr);break;case 5:_i(t,Jt,dr);break;default:throw Error(i(329))}}}return en(t,nt()),t.callbackNode===a?S0.bind(null,t):null}function pc(t,r){var a=ho;return t.current.memoizedState.isDehydrated&&(xi(t,r).flags|=256),t=Da(t,r),t!==2&&(r=Jt,Jt=a,r!==null&&mc(r)),t}function mc(t){Jt===null?Jt=t:Jt.push.apply(Jt,t)}function ET(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(!On(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 Vr(t,r){for(r&=~cc,r&=~Ma,t.suspendedLanes|=r,t.pingedLanes&=~r,t=t.expirationTimes;0<r;){var a=31-Yt(r),f=1<<a;t[a]=-1,r&=~f}}function b0(t){if((Ue&6)!==0)throw Error(i(327));ms();var r=Mt(t,0);if((r&1)===0)return en(t,nt()),null;var a=Da(t,r);if(t.tag!==0&&a===2){var f=ce(t);f!==0&&(r=f,a=pc(t,f))}if(a===1)throw a=fo,xi(t,0),Vr(t,r),en(t,nt()),a;if(a===6)throw Error(i(345));return t.finishedWork=t.current.alternate,t.finishedLanes=r,_i(t,Jt,dr),en(t,nt()),null}function gc(t,r){var a=Ue;Ue|=1;try{return t(r)}finally{Ue=a,Ue===0&&(ps=nt()+500,da&&$r())}}function wi(t){Ur!==null&&Ur.tag===0&&(Ue&6)===0&&ms();var r=Ue;Ue|=1;var a=Nn.transition,f=Te;try{if(Nn.transition=null,Te=1,t)return t()}finally{Te=f,Nn.transition=a,Ue=r,(Ue&6)===0&&$r()}}function vc(){mn=hs.current,ot(hs)}function xi(t,r){t.finishedWork=null,t.finishedLanes=0;var a=t.timeoutHandle;if(a!==-1&&(t.timeoutHandle=-1,tT(a)),vt!==null)for(a=vt.return;a!==null;){var f=a;switch(Nl(f),f.tag){case 1:f=f.type.childContextTypes,f!=null&&ca();break;case 3:cs(),ot(Xt),ot($t),Dl();break;case 5:Ll(f);break;case 4:cs();break;case 13:ot(lt);break;case 19:ot(lt);break;case 10:Il(f.type._context);break;case 22:case 23:vc()}a=a.return}if(Rt=t,vt=t=Wr(t.current,null),Ot=mn=r,_t=0,fo=null,cc=Ma=yi=0,Jt=ho=null,mi!==null){for(r=0;r<mi.length;r++)if(a=mi[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}mi=null}return t}function k0(t,r){do{var a=vt;try{if(Al(),Sa.current=Na,ba){for(var f=ct.memoizedState;f!==null;){var g=f.queue;g!==null&&(g.pending=null),f=f.next}ba=!1}if(vi=0,Tt=xt=ct=null,so=!1,oo=0,lc.current=null,a===null||a.return===null){_t=1,fo=r,vt=null;break}e:{var w=t,T=a.return,$=a,H=r;if(r=Ot,$.flags|=32768,H!==null&&typeof H=="object"&&typeof H.then=="function"){var ie=H,fe=$,de=fe.tag;if((fe.mode&1)===0&&(de===0||de===11||de===15)){var le=fe.alternate;le?(fe.updateQueue=le.updateQueue,fe.memoizedState=le.memoizedState,fe.lanes=le.lanes):(fe.updateQueue=null,fe.memoizedState=null)}var xe=Ky(T);if(xe!==null){xe.flags&=-257,Xy(xe,T,$,w,r),xe.mode&1&&Yy(w,ie,r),r=xe,H=ie;var ke=r.updateQueue;if(ke===null){var Ee=new Set;Ee.add(H),r.updateQueue=Ee}else ke.add(H);break e}else{if((r&1)===0){Yy(w,ie,r),yc();break e}H=Error(i(426))}}else if(at&&$.mode&1){var mt=Ky(T);if(mt!==null){(mt.flags&65536)===0&&(mt.flags|=256),Xy(mt,T,$,w,r),Rl(fs(H,$));break e}}w=H=fs(H,$),_t!==4&&(_t=2),ho===null?ho=[w]:ho.push(w),w=T;do{switch(w.tag){case 3:w.flags|=65536,r&=-r,w.lanes|=r;var ee=Wy(w,H,r);wy(w,ee);break e;case 1:$=H;var Y=w.type,re=w.stateNode;if((w.flags&128)===0&&(typeof Y.getDerivedStateFromError=="function"||re!==null&&typeof re.componentDidCatch=="function"&&(Br===null||!Br.has(re)))){w.flags|=65536,r&=-r,w.lanes|=r;var pe=Gy(w,$,r);wy(w,pe);break e}}w=w.return}while(w!==null)}C0(a)}catch(Ne){r=Ne,vt===a&&a!==null&&(vt=a=a.return);continue}break}while(!0)}function E0(){var t=Ia.current;return Ia.current=Na,t===null?Na:t}function yc(){(_t===0||_t===3||_t===2)&&(_t=4),Rt===null||(yi&268435455)===0&&(Ma&268435455)===0||Vr(Rt,Ot)}function Da(t,r){var a=Ue;Ue|=2;var f=E0();(Rt!==t||Ot!==r)&&(dr=null,xi(t,r));do try{NT();break}catch(g){k0(t,g)}while(!0);if(Al(),Ue=a,Ia.current=f,vt!==null)throw Error(i(261));return Rt=null,Ot=0,_t}function NT(){for(;vt!==null;)N0(vt)}function CT(){for(;vt!==null&&!Hi();)N0(vt)}function N0(t){var r=j0(t.alternate,t,mn);t.memoizedProps=t.pendingProps,r===null?C0(t):vt=r,lc.current=null}function C0(t){var r=t;do{var a=r.alternate;if(t=r.return,(r.flags&32768)===0){if(a=wT(a,r,mn),a!==null){vt=a;return}}else{if(a=xT(a,r),a!==null){a.flags&=32767,vt=a;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{_t=6,vt=null;return}}if(r=r.sibling,r!==null){vt=r;return}vt=r=t}while(r!==null);_t===0&&(_t=5)}function _i(t,r,a){var f=Te,g=Nn.transition;try{Nn.transition=null,Te=1,TT(t,r,a,f)}finally{Nn.transition=g,Te=f}return null}function TT(t,r,a,f){do ms();while(Ur!==null);if((Ue&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(Le(t,w),t===Rt&&(vt=Rt=null,Ot=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||Oa||(Oa=!0,A0(Nr,function(){return ms(),null})),w=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||w){w=Nn.transition,Nn.transition=null;var T=Te;Te=1;var $=Ue;Ue|=4,lc.current=null,ST(t,a),v0(a,t),YC(yl),Xo=!!vl,yl=vl=null,t.current=a,bT(a),Vi(),Ue=$,Te=T,Nn.transition=w}else t.current=a;if(Oa&&(Oa=!1,Ur=t,qa=g),w=t.pendingLanes,w===0&&(Br=null),gt(a.stateNode),en(t,nt()),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=dc,dc=null,t;return(qa&1)!==0&&t.tag!==0&&ms(),w=t.pendingLanes,(w&1)!==0?t===hc?po++:(po=0,hc=t):po=0,$r(),null}function ms(){if(Ur!==null){var t=Ke(qa),r=Nn.transition,a=Te;try{if(Nn.transition=null,Te=16>t?16:t,Ur===null)var f=!1;else{if(t=Ur,Ur=null,qa=0,(Ue&6)!==0)throw Error(i(331));var g=Ue;for(Ue|=4,Se=t.current;Se!==null;){var w=Se,T=w.child;if((Se.flags&16)!==0){var $=w.deletions;if($!==null){for(var H=0;H<$.length;H++){var ie=$[H];for(Se=ie;Se!==null;){var fe=Se;switch(fe.tag){case 0:case 11:case 15:co(8,fe,w)}var de=fe.child;if(de!==null)de.return=fe,Se=de;else for(;Se!==null;){fe=Se;var le=fe.sibling,xe=fe.return;if(d0(fe),fe===ie){Se=null;break}if(le!==null){le.return=xe,Se=le;break}Se=xe}}}var ke=w.alternate;if(ke!==null){var Ee=ke.child;if(Ee!==null){ke.child=null;do{var mt=Ee.sibling;Ee.sibling=null,Ee=mt}while(Ee!==null)}}Se=w}}if((w.subtreeFlags&2064)!==0&&T!==null)T.return=w,Se=T;else e:for(;Se!==null;){if(w=Se,(w.flags&2048)!==0)switch(w.tag){case 0:case 11:case 15:co(9,w,w.return)}var ee=w.sibling;if(ee!==null){ee.return=w.return,Se=ee;break e}Se=w.return}}var Y=t.current;for(Se=Y;Se!==null;){T=Se;var re=T.child;if((T.subtreeFlags&2064)!==0&&re!==null)re.return=T,Se=re;else e:for(T=Y;Se!==null;){if($=Se,($.flags&2048)!==0)try{switch($.tag){case 0:case 11:case 15:Aa(9,$)}}catch(Ne){dt($,$.return,Ne)}if($===T){Se=null;break e}var pe=$.sibling;if(pe!==null){pe.return=$.return,Se=pe;break e}Se=$.return}}if(Ue=g,$r(),Gt&&typeof Gt.onPostCommitFiberRoot=="function")try{Gt.onPostCommitFiberRoot(_n,t)}catch{}f=!0}return f}finally{Te=a,Nn.transition=r}}return!1}function T0(t,r,a){r=fs(a,r),r=Wy(t,r,1),t=Fr(t,r,1),r=Ht(),t!==null&&(we(t,1,r),en(t,r))}function dt(t,r,a){if(t.tag===3)T0(t,t,a);else for(;r!==null;){if(r.tag===3){T0(r,t,a);break}else if(r.tag===1){var f=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Br===null||!Br.has(f))){t=fs(a,t),t=Gy(r,t,1),r=Fr(r,t,1),t=Ht(),r!==null&&(we(r,1,t),en(r,t));break}}r=r.return}}function RT(t,r,a){var f=t.pingCache;f!==null&&f.delete(r),r=Ht(),t.pingedLanes|=t.suspendedLanes&a,Rt===t&&(Ot&a)===a&&(_t===4||_t===3&&(Ot&130023424)===Ot&&500>nt()-fc?xi(t,0):cc|=a),en(t,r)}function R0(t,r){r===0&&((t.mode&1)===0?r=1:(r=Tr,Tr<<=1,(Tr&130023424)===0&&(Tr=4194304)));var a=Ht();t=lr(t,r),t!==null&&(we(t,r,a),en(t,a))}function jT(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),R0(t,a)}function AT(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),R0(t,a)}var j0;j0=function(t,r,a){if(t!==null)if(t.memoizedProps!==r.pendingProps||Xt.current)Zt=!0;else{if((t.lanes&a)===0&&(r.flags&128)===0)return Zt=!1,yT(t,r,a);Zt=(t.flags&131072)!==0}else Zt=!1,at&&(r.flags&1048576)!==0&&ly(r,pa,r.index);switch(r.lanes=0,r.tag){case 2:var f=r.type;Ra(t,r),t=r.pendingProps;var g=rs(r,$t.current);ls(r,a),g=Bl(null,r,f,t,g,a);var w=Ul();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,Qt(f)?(w=!0,fa(r)):w=!1,r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Ol(r),g.updater=Ca,r.stateNode=g,g._reactInternals=r,Kl(r,f,t,a),r=Jl(null,r,f,!0,w,a)):(r.tag=0,at&&w&&El(r),Ut(null,r,g,a),r=r.child),r;case 16:f=r.elementType;e:{switch(Ra(t,r),t=r.pendingProps,g=f._init,f=g(f._payload),r.type=f,g=r.tag=MT(f),t=Ln(f,t),g){case 0:r=Zl(null,r,f,t,a);break e;case 1:r=n0(null,r,f,t,a);break e;case 11:r=Qy(null,r,f,t,a);break e;case 14:r=Zy(null,r,f,Ln(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:Ln(f,g),Zl(t,r,f,g,a);case 1:return f=r.type,g=r.pendingProps,g=r.elementType===f?g:Ln(f,g),n0(t,r,f,g,a);case 3:e:{if(r0(r),t===null)throw Error(i(387));f=r.pendingProps,w=r.memoizedState,g=w.element,yy(t,r),xa(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=fs(Error(i(423)),r),r=i0(t,r,f,a,g);break e}else if(f!==g){g=fs(Error(i(424)),r),r=i0(t,r,f,a,g);break e}else for(pn=Or(r.stateNode.containerInfo.firstChild),hn=r,at=!0,qn=null,a=gy(r,null,f,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(os(),f===g){r=fr(t,r,a);break e}Ut(t,r,f,a)}r=r.child}return r;case 5:return _y(r),t===null&&Tl(r),f=r.type,g=r.pendingProps,w=t!==null?t.memoizedProps:null,T=g.children,wl(f,g)?T=null:w!==null&&wl(f,w)&&(r.flags|=32),t0(t,r),Ut(t,r,T,a),r.child;case 6:return t===null&&Tl(r),null;case 13:return s0(t,r,a);case 4:return ql(r,r.stateNode.containerInfo),f=r.pendingProps,t===null?r.child=as(r,null,f,a):Ut(t,r,f,a),r.child;case 11:return f=r.type,g=r.pendingProps,g=r.elementType===f?g:Ln(f,g),Qy(t,r,f,g,a);case 7:return Ut(t,r,r.pendingProps,a),r.child;case 8:return Ut(t,r,r.pendingProps.children,a),r.child;case 12:return Ut(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,rt(va,f._currentValue),f._currentValue=T,w!==null)if(On(w.value,T)){if(w.children===g.children&&!Xt.current){r=fr(t,r,a);break e}}else for(w=r.child,w!==null&&(w.return=r);w!==null;){var $=w.dependencies;if($!==null){T=w.child;for(var H=$.firstContext;H!==null;){if(H.context===f){if(w.tag===1){H=cr(-1,a&-a),H.tag=2;var ie=w.updateQueue;if(ie!==null){ie=ie.shared;var fe=ie.pending;fe===null?H.next=H:(H.next=fe.next,fe.next=H),ie.pending=H}}w.lanes|=a,H=w.alternate,H!==null&&(H.lanes|=a),Ml(w.return,a,r),$.lanes|=a;break}H=H.next}}else if(w.tag===10)T=w.type===r.type?null:w.child;else if(w.tag===18){if(T=w.return,T===null)throw Error(i(341));T.lanes|=a,$=T.alternate,$!==null&&($.lanes|=a),Ml(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}Ut(t,r,g.children,a),r=r.child}return r;case 9:return g=r.type,f=r.pendingProps.children,ls(r,a),g=kn(g),f=f(g),r.flags|=1,Ut(t,r,f,a),r.child;case 14:return f=r.type,g=Ln(f,r.pendingProps),g=Ln(f.type,g),Zy(t,r,f,g,a);case 15:return Jy(t,r,r.type,r.pendingProps,a);case 17:return f=r.type,g=r.pendingProps,g=r.elementType===f?g:Ln(f,g),Ra(t,r),r.tag=1,Qt(f)?(t=!0,fa(r)):t=!1,ls(r,a),Hy(r,f,g),Kl(r,f,g,a),Jl(null,r,f,!0,t,a);case 19:return a0(t,r,a);case 22:return e0(t,r,a)}throw Error(i(156,r.tag))};function A0(t,r){return ii(t,r)}function IT(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 Cn(t,r,a,f){return new IT(t,r,a,f)}function wc(t){return t=t.prototype,!(!t||!t.isReactComponent)}function MT(t){if(typeof t=="function")return wc(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Q)return 11;if(t===G)return 14}return 2}function Wr(t,r){var a=t.alternate;return a===null?(a=Cn(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 Fa(t,r,a,f,g,w){var T=2;if(f=t,typeof t=="function")wc(t)&&(T=1);else if(typeof t=="string")T=5;else e:switch(t){case I:return Si(a.children,g,w,r);case M:T=8,g|=8;break;case R:return t=Cn(12,a,r,g|2),t.elementType=R,t.lanes=w,t;case X:return t=Cn(13,a,r,g),t.elementType=X,t.lanes=w,t;case j:return t=Cn(19,a,r,g),t.elementType=j,t.lanes=w,t;case ne:return za(a,g,w,r);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case L:T=10;break e;case F:T=9;break e;case Q:T=11;break e;case G:T=14;break e;case U:T=16,f=null;break e}throw Error(i(130,t==null?t:typeof t,""))}return r=Cn(T,a,r,g),r.elementType=t,r.type=f,r.lanes=w,r}function Si(t,r,a,f){return t=Cn(7,t,f,r),t.lanes=a,t}function za(t,r,a,f){return t=Cn(22,t,f,r),t.elementType=ne,t.lanes=a,t.stateNode={isHidden:!1},t}function xc(t,r,a){return t=Cn(6,t,null,r),t.lanes=a,t}function _c(t,r,a){return r=Cn(4,t.children!==null?t.children:[],t.key,r),r.lanes=a,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}function PT(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=_e(0),this.expirationTimes=_e(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_e(0),this.identifierPrefix=f,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Sc(t,r,a,f,g,w,T,$,H){return t=new PT(t,r,a,$,H),r===1?(r=1,w===!0&&(r|=8)):r=0,w=Cn(3,null,null,r),t.current=w,w.stateNode=t,w.memoizedState={element:f,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ol(w),t}function OT(t,r,a){var f=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:P,key:f==null?null:""+f,children:t,containerInfo:r,implementation:a}}function I0(t){if(!t)return Lr;t=t._reactInternals;e:{if(xn(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(Qt(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(Qt(a))return oy(t,a,r)}return r}function M0(t,r,a,f,g,w,T,$,H){return t=Sc(a,f,!0,t,g,w,T,$,H),t.context=I0(null),a=t.current,f=Ht(),g=Hr(a),w=cr(f,g),w.callback=r??null,Fr(a,w,g),t.current.lanes=g,we(t,g,f),en(t,f),t}function Ba(t,r,a,f){var g=r.current,w=Ht(),T=Hr(g);return a=I0(a),r.context===null?r.context=a:r.pendingContext=a,r=cr(w,T),r.payload={element:t},f=f===void 0?null:f,f!==null&&(r.callback=f),t=Fr(g,r,T),t!==null&&(Fn(t,g,T,w),wa(t,g,T)),T}function Ua(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 P0(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<r?a:r}}function bc(t,r){P0(t,r),(t=t.alternate)&&P0(t,r)}function qT(){return null}var O0=typeof reportError=="function"?reportError:function(t){console.error(t)};function kc(t){this._internalRoot=t}Ha.prototype.render=kc.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(i(409));Ba(t,r,null,null)},Ha.prototype.unmount=kc.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;wi(function(){Ba(null,t,null,null)}),r[sr]=null}};function Ha(t){this._internalRoot=t}Ha.prototype.unstable_scheduleHydration=function(t){if(t){var r=Gi();t={blockedOn:null,target:t,priority:r};for(var a=0;a<Ir.length&&r!==0&&r<Ir[a].priority;a++);Ir.splice(a,0,t),a===0&&_v(t)}};function Ec(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Va(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function q0(){}function LT(t,r,a,f,g){if(g){if(typeof f=="function"){var w=f;f=function(){var ie=Ua(T);w.call(ie)}}var T=M0(r,f,t,0,null,!1,!1,"",q0);return t._reactRootContainer=T,t[sr]=T.current,Qs(t.nodeType===8?t.parentNode:t),wi(),T}for(;g=t.lastChild;)t.removeChild(g);if(typeof f=="function"){var $=f;f=function(){var ie=Ua(H);$.call(ie)}}var H=Sc(t,0,!1,null,null,!1,!1,"",q0);return t._reactRootContainer=H,t[sr]=H.current,Qs(t.nodeType===8?t.parentNode:t),wi(function(){Ba(r,H,a,f)}),H}function Wa(t,r,a,f,g){var w=a._reactRootContainer;if(w){var T=w;if(typeof g=="function"){var $=g;g=function(){var H=Ua(T);$.call(H)}}Ba(r,T,t,g)}else T=LT(a,r,t,g,f);return Ua(T)}it=function(t){switch(t.tag){case 3:var r=t.stateNode;if(r.current.memoizedState.isDehydrated){var a=ui(r.pendingLanes);a!==0&&(ze(r,a|1),en(r,nt()),(Ue&6)===0&&(ps=nt()+500,$r()))}break;case 13:wi(function(){var f=lr(t,1);if(f!==null){var g=Ht();Fn(f,t,1,g)}}),bc(t,1)}},Kt=function(t){if(t.tag===13){var r=lr(t,134217728);if(r!==null){var a=Ht();Fn(r,t,134217728,a)}bc(t,134217728)}},Rr=function(t){if(t.tag===13){var r=Hr(t),a=lr(t,r);if(a!==null){var f=Ht();Fn(a,t,r,f)}bc(t,r)}},Gi=function(){return Te},jr=function(t,r){var a=Te;try{return Te=t,r()}finally{Te=a}},vn=function(t,r,a){switch(r){case"input":if(ve(t,a),r=a.name,a.type==="radio"&&r!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<a.length;r++){var f=a[r];if(f!==t&&f.form===t.form){var g=la(f);if(!g)throw Error(i(90));Fe(f),ve(f,g)}}}break;case"textarea":Ze(t,a);break;case"select":r=a.value,r!=null&&Qe(t,!!a.multiple,r,!1)}},ti=gc,$i=wi;var $T={usingClientEntryPoint:!1,Events:[eo,ts,la,_r,Mn,gc]},mo={findFiberByHostInstance:fi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},DT={bundleType:mo.bundleType,version:mo.version,rendererPackageName:mo.rendererPackageName,rendererConfig:mo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=cn(t),t===null?null:t.stateNode},findFiberByHostInstance:mo.findFiberByHostInstance||qT,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 Ga=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ga.isDisabled&&Ga.supportsFiber)try{_n=Ga.inject(DT),Gt=Ga}catch{}}return tn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=$T,tn.createPortal=function(t,r){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ec(r))throw Error(i(200));return OT(t,r,null,a)},tn.createRoot=function(t,r){if(!Ec(t))throw Error(i(299));var a=!1,f="",g=O0;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(f=r.identifierPrefix),r.onRecoverableError!==void 0&&(g=r.onRecoverableError)),r=Sc(t,1,!1,null,null,a,!1,f,g),t[sr]=r.current,Qs(t.nodeType===8?t.parentNode:t),new kc(r)},tn.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=cn(r),t=t===null?null:t.stateNode,t},tn.flushSync=function(t){return wi(t)},tn.hydrate=function(t,r,a){if(!Va(r))throw Error(i(200));return Wa(null,t,r,!0,a)},tn.hydrateRoot=function(t,r,a){if(!Ec(t))throw Error(i(405));var f=a!=null&&a.hydratedSources||null,g=!1,w="",T=O0;if(a!=null&&(a.unstable_strictMode===!0&&(g=!0),a.identifierPrefix!==void 0&&(w=a.identifierPrefix),a.onRecoverableError!==void 0&&(T=a.onRecoverableError)),r=M0(r,null,t,1,a??null,g,!1,w,T),t[sr]=r.current,Qs(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 Ha(r)},tn.render=function(t,r,a){if(!Va(r))throw Error(i(200));return Wa(null,t,r,!1,a)},tn.unmountComponentAtNode=function(t){if(!Va(t))throw Error(i(40));return t._reactRootContainer?(wi(function(){Wa(null,null,t,!1,function(){t._reactRootContainer=null,t[sr]=null})}),!0):!1},tn.unstable_batchedUpdates=gc,tn.unstable_renderSubtreeIntoContainer=function(t,r,a,f){if(!Va(a))throw Error(i(200));if(t==null||t._reactInternals===void 0)throw Error(i(38));return Wa(t,r,a,!1,f)},tn.version="18.3.1-next-f1338f8080-20240426",tn}var H0;function kk(){if(H0)return Tc.exports;H0=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(),Tc.exports=WT(),Tc.exports}var V0;function GT(){if(V0)return Ka;V0=1;var e=kk();return Ka.createRoot=e.createRoot,Ka.hydrateRoot=e.hydrateRoot,Ka}var YT=GT(),q=Lo();const oe=Mg(q);function qt(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=qt(e[i]))!==""&&(n+=(n&&" ")+s);else for(let i in e)e[i]&&(n+=(n&&" ")+i);return n}var Ac={exports:{}},Ic={},Mc={exports:{}},Pc={};/**
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 W0;function KT(){if(W0)return Pc;W0=1;var e=Lo();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(),N=s({inst:{value:x,getSnapshot:y}}),_=N[0].inst,S=N[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 h(m,y){return y()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return Pc.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Pc}var G0;function XT(){return G0||(G0=1,Mc.exports=KT()),Mc.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 Y0;function QT(){if(Y0)return Ic;Y0=1;var e=Lo(),n=XT();function i(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var s=typeof Object.is=="function"?Object.is:i,o=n.useSyncExternalStore,u=e.useRef,l=e.useEffect,c=e.useMemo,d=e.useDebugValue;return Ic.useSyncExternalStoreWithSelector=function(h,p,m,y,x){var N=u(null);if(N.current===null){var _={hasValue:!1,value:null};N.current=_}else _=N.current;N=c(function(){function b(P){if(!k){if(k=!0,E=P,P=y(P),x!==void 0&&_.hasValue){var I=_.value;if(x(I,P))return C=I}return C=P}if(I=C,s(E,P))return I;var M=y(P);return x!==void 0&&x(I,M)?(E=P,I):(E=P,C=M)}var k=!1,E,C,A=m===void 0?null:m;return[function(){return b(p())},A===null?void 0:function(){return b(A())}]},[p,m,y,x]);var S=o(h,N[0],N[1]);return l(function(){_.hasValue=!0,_.value=S},[S]),d(S),S},Ic}var K0;function ZT(){return K0||(K0=1,Ac.exports=QT()),Ac.exports}var JT=ZT();const eR=Mg(JT),tR={},X0=e=>{let n;const i=new Set,s=(p,m)=>{const y=typeof p=="function"?p(n):p;if(!Object.is(y,n)){const x=n;n=m??(typeof y!="object"||y===null)?y:Object.assign({},n,y),i.forEach(N=>N(n,x))}},o=()=>n,d={setState:s,getState:o,getInitialState:()=>h,subscribe:p=>(i.add(p),()=>i.delete(p)),destroy:()=>{(tR?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),i.clear()}},h=n=e(s,o,d);return d},nR=e=>e?X0(e):X0,{useDebugValue:rR}=oe,{useSyncExternalStoreWithSelector:iR}=eR,sR=e=>e;function Ek(e,n=sR,i){const s=iR(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,i);return rR(s),s}const Q0=(e,n)=>{const i=nR(e),s=(o,u=n)=>Ek(i,o,u);return Object.assign(s,i),s},oR=(e,n)=>e?Q0(e,n):Q0;function St(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 aR={value:()=>{}};function Nu(){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 cu(i)}function cu(e){this._=e}function uR(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}})}cu.prototype=Nu.prototype={constructor:cu,on:function(e,n){var i=this._,s=uR(e+"",i),o,u=-1,l=s.length;if(arguments.length<2){for(;++u<l;)if((o=(e=s[u]).type)&&(o=lR(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]=Z0(i[o],e.name,n);else if(n==null)for(o in i)i[o]=Z0(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 cu(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 lR(e,n){for(var i=0,s=e.length,o;i<s;++i)if((o=e[i]).name===n)return o.value}function Z0(e,n,i){for(var s=0,o=e.length;s<o;++s)if(e[s].name===n){e[s]=aR,e=e.slice(0,s).concat(e.slice(s+1));break}return i!=null&&e.push({name:n,value:i}),e}var fg="http://www.w3.org/1999/xhtml";const J0={svg:"http://www.w3.org/2000/svg",xhtml:fg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Cu(e){var n=e+="",i=n.indexOf(":");return i>=0&&(n=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),J0.hasOwnProperty(n)?{space:J0[n],local:e}:e}function cR(e){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===fg&&n.documentElement.namespaceURI===fg?n.createElement(e):n.createElementNS(i,e)}}function fR(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Nk(e){var n=Cu(e);return(n.local?fR:cR)(n)}function dR(){}function Pg(e){return e==null?dR:function(){return this.querySelector(e)}}function hR(e){typeof e!="function"&&(e=Pg(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,h,p=0;p<l;++p)(d=u[p])&&(h=e.call(d,d.__data__,p,u))&&("__data__"in d&&(h.__data__=d.__data__),c[p]=h);return new gn(s,this._parents)}function pR(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function mR(){return[]}function Ck(e){return e==null?mR:function(){return this.querySelectorAll(e)}}function gR(e){return function(){return pR(e.apply(this,arguments))}}function vR(e){typeof e=="function"?e=gR(e):e=Ck(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,h=0;h<c;++h)(d=l[h])&&(s.push(e.call(d,d.__data__,h,l)),o.push(d));return new gn(s,o)}function Tk(e){return function(){return this.matches(e)}}function Rk(e){return function(n){return n.matches(e)}}var yR=Array.prototype.find;function wR(e){return function(){return yR.call(this.children,e)}}function xR(){return this.firstElementChild}function _R(e){return this.select(e==null?xR:wR(typeof e=="function"?e:Rk(e)))}var SR=Array.prototype.filter;function bR(){return Array.from(this.children)}function kR(e){return function(){return SR.call(this.children,e)}}function ER(e){return this.selectAll(e==null?bR:kR(typeof e=="function"?e:Rk(e)))}function NR(e){typeof e!="function"&&(e=Tk(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,h=0;h<l;++h)(d=u[h])&&e.call(d,d.__data__,h,u)&&c.push(d);return new gn(s,this._parents)}function jk(e){return new Array(e.length)}function CR(){return new gn(this._enter||this._groups.map(jk),this._parents)}function pu(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}pu.prototype={constructor:pu,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 TR(e){return function(){return e}}function RR(e,n,i,s,o,u){for(var l=0,c,d=n.length,h=u.length;l<h;++l)(c=n[l])?(c.__data__=u[l],s[l]=c):i[l]=new pu(e,u[l]);for(;l<d;++l)(c=n[l])&&(o[l]=c)}function jR(e,n,i,s,o,u,l){var c,d,h=new Map,p=n.length,m=u.length,y=new Array(p),x;for(c=0;c<p;++c)(d=n[c])&&(y[c]=x=l.call(d,d.__data__,c,n)+"",h.has(x)?o[c]=d:h.set(x,d));for(c=0;c<m;++c)x=l.call(e,u[c],c,u)+"",(d=h.get(x))?(s[c]=d,d.__data__=u[c],h.delete(x)):i[c]=new pu(e,u[c]);for(c=0;c<p;++c)(d=n[c])&&h.get(y[c])===d&&(o[c]=d)}function AR(e){return e.__data__}function IR(e,n){if(!arguments.length)return Array.from(this,AR);var i=n?jR:RR,s=this._parents,o=this._groups;typeof e!="function"&&(e=TR(e));for(var u=o.length,l=new Array(u),c=new Array(u),d=new Array(u),h=0;h<u;++h){var p=s[h],m=o[h],y=m.length,x=MR(e.call(p,p&&p.__data__,h,s)),N=x.length,_=c[h]=new Array(N),S=l[h]=new Array(N),b=d[h]=new Array(y);i(p,m,_,S,b,x,n);for(var k=0,E=0,C,A;k<N;++k)if(C=_[k]){for(k>=E&&(E=k+1);!(A=S[E])&&++E<N;);C._next=A||null}}return l=new gn(l,s),l._enter=c,l._exit=d,l}function MR(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function PR(){return new gn(this._exit||this._groups.map(jk),this._parents)}function OR(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 qR(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 h=i[d],p=s[d],m=h.length,y=c[d]=new Array(m),x,N=0;N<m;++N)(x=h[N]||p[N])&&(y[N]=x);for(;d<o;++d)c[d]=i[d];return new gn(c,this._parents)}function LR(){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 $R(e){e||(e=DR);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),h,p=0;p<c;++p)(h=l[p])&&(d[p]=h);d.sort(n)}return new gn(o,this._parents).order()}function DR(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function FR(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function zR(){return Array.from(this)}function BR(){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 UR(){let e=0;for(const n of this)++e;return e}function HR(){return!this.node()}function VR(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 WR(e){return function(){this.removeAttribute(e)}}function GR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function YR(e,n){return function(){this.setAttribute(e,n)}}function KR(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function XR(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function QR(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 ZR(e,n){var i=Cu(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?GR:WR:typeof n=="function"?i.local?QR:XR:i.local?KR:YR)(i,n))}function Ak(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function JR(e){return function(){this.style.removeProperty(e)}}function e2(e,n,i){return function(){this.style.setProperty(e,n,i)}}function t2(e,n,i){return function(){var s=n.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,i)}}function n2(e,n,i){return arguments.length>1?this.each((n==null?JR:typeof n=="function"?t2:e2)(e,n,i??"")):Ts(this.node(),e)}function Ts(e,n){return e.style.getPropertyValue(n)||Ak(e).getComputedStyle(e,null).getPropertyValue(n)}function r2(e){return function(){delete this[e]}}function i2(e,n){return function(){this[e]=n}}function s2(e,n){return function(){var i=n.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function o2(e,n){return arguments.length>1?this.each((n==null?r2:typeof n=="function"?s2:i2)(e,n)):this.node()[e]}function Ik(e){return e.trim().split(/^|\s+/)}function Og(e){return e.classList||new Mk(e)}function Mk(e){this._node=e,this._names=Ik(e.getAttribute("class")||"")}Mk.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 Pk(e,n){for(var i=Og(e),s=-1,o=n.length;++s<o;)i.add(n[s])}function Ok(e,n){for(var i=Og(e),s=-1,o=n.length;++s<o;)i.remove(n[s])}function a2(e){return function(){Pk(this,e)}}function u2(e){return function(){Ok(this,e)}}function l2(e,n){return function(){(n.apply(this,arguments)?Pk:Ok)(this,e)}}function c2(e,n){var i=Ik(e+"");if(arguments.length<2){for(var s=Og(this.node()),o=-1,u=i.length;++o<u;)if(!s.contains(i[o]))return!1;return!0}return this.each((typeof n=="function"?l2:n?a2:u2)(i,n))}function f2(){this.textContent=""}function d2(e){return function(){this.textContent=e}}function h2(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function p2(e){return arguments.length?this.each(e==null?f2:(typeof e=="function"?h2:d2)(e)):this.node().textContent}function m2(){this.innerHTML=""}function g2(e){return function(){this.innerHTML=e}}function v2(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function y2(e){return arguments.length?this.each(e==null?m2:(typeof e=="function"?v2:g2)(e)):this.node().innerHTML}function w2(){this.nextSibling&&this.parentNode.appendChild(this)}function x2(){return this.each(w2)}function _2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function S2(){return this.each(_2)}function b2(e){var n=typeof e=="function"?e:Nk(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function k2(){return null}function E2(e,n){var i=typeof e=="function"?e:Nk(e),s=n==null?k2:typeof n=="function"?n:Pg(n);return this.select(function(){return this.insertBefore(i.apply(this,arguments),s.apply(this,arguments)||null)})}function N2(){var e=this.parentNode;e&&e.removeChild(this)}function C2(){return this.each(N2)}function T2(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function R2(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function j2(e){return this.select(e?R2:T2)}function A2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function I2(e){return function(n){e.call(this,n,this.__data__)}}function M2(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 P2(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 O2(e,n,i){return function(){var s=this.__on,o,u=I2(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 q2(e,n,i){var s=M2(e+""),o,u=s.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var d=0,h=c.length,p;d<h;++d)for(o=0,p=c[d];o<u;++o)if((l=s[o]).type===p.type&&l.name===p.name)return p.value}return}for(c=n?O2:P2,o=0;o<u;++o)this.each(c(s[o],n,i));return this}function qk(e,n,i){var s=Ak(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 L2(e,n){return function(){return qk(this,e,n)}}function $2(e,n){return function(){return qk(this,e,n.apply(this,arguments))}}function D2(e,n){return this.each((typeof n=="function"?$2:L2)(e,n))}function*F2(){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 Lk=[null];function gn(e,n){this._groups=e,this._parents=n}function $o(){return new gn([[document.documentElement]],Lk)}function z2(){return this}gn.prototype=$o.prototype={constructor:gn,select:hR,selectAll:vR,selectChild:_R,selectChildren:ER,filter:NR,data:IR,enter:CR,exit:PR,join:OR,merge:qR,selection:z2,order:LR,sort:$R,call:FR,nodes:zR,node:BR,size:UR,empty:HR,each:VR,attr:ZR,style:n2,property:o2,classed:c2,text:p2,html:y2,raise:x2,lower:S2,append:b2,insert:E2,remove:C2,clone:j2,datum:A2,on:q2,dispatch:D2,[Symbol.iterator]:F2};function Rn(e){return typeof e=="string"?new gn([[document.querySelector(e)]],[document.documentElement]):new gn([[e]],Lk)}function B2(e){let n;for(;n=e.sourceEvent;)e=n;return e}function Bn(e,n){if(e=B2(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 U2={passive:!1},Ro={capture:!0,passive:!1};function Oc(e){e.stopImmediatePropagation()}function bs(e){e.preventDefault(),e.stopImmediatePropagation()}function $k(e){var n=e.document.documentElement,i=Rn(e).on("dragstart.drag",bs,Ro);"onselectstart"in n?i.on("selectstart.drag",bs,Ro):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Dk(e,n){var i=e.document.documentElement,s=Rn(e).on("dragstart.drag",null);n&&(s.on("click.drag",bs,Ro),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 Xa=e=>()=>e;function dg(e,{sourceEvent:n,subject:i,target:s,identifier:o,active:u,x:l,y:c,dx:d,dy:h,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value: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:h,enumerable:!0,configurable:!0},_:{value:p}})}dg.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function H2(e){return!e.ctrlKey&&!e.button}function V2(){return this.parentNode}function W2(e,n){return n??{x:e.x,y:e.y}}function G2(){return navigator.maxTouchPoints||"ontouchstart"in this}function Y2(){var e=H2,n=V2,i=W2,s=G2,o={},u=Nu("start","drag","end"),l=0,c,d,h,p,m=0;function y(C){C.on("mousedown.drag",x).filter(s).on("touchstart.drag",S).on("touchmove.drag",b,U2).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(C,A){if(!(p||!e.call(this,C,A))){var P=E(this,n.call(this,C,A),C,A,"mouse");P&&(Rn(C.view).on("mousemove.drag",N,Ro).on("mouseup.drag",_,Ro),$k(C.view),Oc(C),h=!1,c=C.clientX,d=C.clientY,P("start",C))}}function N(C){if(bs(C),!h){var A=C.clientX-c,P=C.clientY-d;h=A*A+P*P>m}o.mouse("drag",C)}function _(C){Rn(C.view).on("mousemove.drag mouseup.drag",null),Dk(C.view,h),bs(C),o.mouse("end",C)}function S(C,A){if(e.call(this,C,A)){var P=C.changedTouches,I=n.call(this,C,A),M=P.length,R,L;for(R=0;R<M;++R)(L=E(this,I,C,A,P[R].identifier,P[R]))&&(Oc(C),L("start",C,P[R]))}}function b(C){var A=C.changedTouches,P=A.length,I,M;for(I=0;I<P;++I)(M=o[A[I].identifier])&&(bs(C),M("drag",C,A[I]))}function k(C){var A=C.changedTouches,P=A.length,I,M;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),I=0;I<P;++I)(M=o[A[I].identifier])&&(Oc(C),M("end",C,A[I]))}function E(C,A,P,I,M,R){var L=u.copy(),F=Bn(R||P,A),Q,X,j;if((j=i.call(C,new dg("beforestart",{sourceEvent:P,target:y,identifier:M,active:l,x:F[0],y:F[1],dx:0,dy:0,dispatch:L}),I))!=null)return Q=j.x-F[0]||0,X=j.y-F[1]||0,function G(U,ne,K){var D=F,V;switch(U){case"start":o[M]=G,V=l++;break;case"end":delete o[M],--l;case"drag":F=Bn(K||ne,A),V=l;break}L.call(U,C,new dg(U,{sourceEvent:ne,subject:j,target:y,identifier:M,active:V,x:F[0]+Q,y:F[1]+X,dx:F[0]-D[0],dy:F[1]-D[1],dispatch:L}),I)}}return y.filter=function(C){return arguments.length?(e=typeof C=="function"?C:Xa(!!C),y):e},y.container=function(C){return arguments.length?(n=typeof C=="function"?C:Xa(C),y):n},y.subject=function(C){return arguments.length?(i=typeof C=="function"?C:Xa(C),y):i},y.touchable=function(C){return arguments.length?(s=typeof C=="function"?C:Xa(!!C),y):s},y.on=function(){var C=u.on.apply(u,arguments);return C===u?y:C},y.clickDistance=function(C){return arguments.length?(m=(C=+C)*C,y):Math.sqrt(m)},y}function qg(e,n,i){e.prototype=n.prototype=i,i.constructor=e}function Fk(e,n){var i=Object.create(e.prototype);for(var s in n)i[s]=n[s];return i}function Do(){}var jo=.7,mu=1/jo,ks="\\s*([+-]?\\d+)\\s*",Ao="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",tr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",K2=/^#([0-9a-f]{3,8})$/,X2=new RegExp(`^rgb\\(${ks},${ks},${ks}\\)$`),Q2=new RegExp(`^rgb\\(${tr},${tr},${tr}\\)$`),Z2=new RegExp(`^rgba\\(${ks},${ks},${ks},${Ao}\\)$`),J2=new RegExp(`^rgba\\(${tr},${tr},${tr},${Ao}\\)$`),ej=new RegExp(`^hsl\\(${Ao},${tr},${tr}\\)$`),tj=new RegExp(`^hsla\\(${Ao},${tr},${tr},${Ao}\\)$`),ew={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};qg(Do,Io,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:tw,formatHex:tw,formatHex8:nj,formatHsl:rj,formatRgb:nw,toString:nw});function tw(){return this.rgb().formatHex()}function nj(){return this.rgb().formatHex8()}function rj(){return zk(this).formatHsl()}function nw(){return this.rgb().formatRgb()}function Io(e){var n,i;return e=(e+"").trim().toLowerCase(),(n=K2.exec(e))?(i=n[1].length,n=parseInt(n[1],16),i===6?rw(n):i===3?new nn(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):i===8?Qa(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):i===4?Qa(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=X2.exec(e))?new nn(n[1],n[2],n[3],1):(n=Q2.exec(e))?new nn(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=Z2.exec(e))?Qa(n[1],n[2],n[3],n[4]):(n=J2.exec(e))?Qa(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=ej.exec(e))?ow(n[1],n[2]/100,n[3]/100,1):(n=tj.exec(e))?ow(n[1],n[2]/100,n[3]/100,n[4]):ew.hasOwnProperty(e)?rw(ew[e]):e==="transparent"?new nn(NaN,NaN,NaN,0):null}function rw(e){return new nn(e>>16&255,e>>8&255,e&255,1)}function Qa(e,n,i,s){return s<=0&&(e=n=i=NaN),new nn(e,n,i,s)}function ij(e){return e instanceof Do||(e=Io(e)),e?(e=e.rgb(),new nn(e.r,e.g,e.b,e.opacity)):new nn}function hg(e,n,i,s){return arguments.length===1?ij(e):new nn(e,n,i,s??1)}function nn(e,n,i,s){this.r=+e,this.g=+n,this.b=+i,this.opacity=+s}qg(nn,hg,Fk(Do,{brighter(e){return e=e==null?mu:Math.pow(mu,e),new nn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?jo:Math.pow(jo,e),new nn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new nn(Ri(this.r),Ri(this.g),Ri(this.b),gu(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:iw,formatHex:iw,formatHex8:sj,formatRgb:sw,toString:sw}));function iw(){return`#${Ci(this.r)}${Ci(this.g)}${Ci(this.b)}`}function sj(){return`#${Ci(this.r)}${Ci(this.g)}${Ci(this.b)}${Ci((isNaN(this.opacity)?1:this.opacity)*255)}`}function sw(){const e=gu(this.opacity);return`${e===1?"rgb(":"rgba("}${Ri(this.r)}, ${Ri(this.g)}, ${Ri(this.b)}${e===1?")":`, ${e})`}`}function gu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ri(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ci(e){return e=Ri(e),(e<16?"0":"")+e.toString(16)}function ow(e,n,i,s){return s<=0?e=n=i=NaN:i<=0||i>=1?e=n=NaN:n<=0&&(e=NaN),new Un(e,n,i,s)}function zk(e){if(e instanceof Un)return new Un(e.h,e.s,e.l,e.opacity);if(e instanceof Do||(e=Io(e)),!e)return new Un;if(e instanceof Un)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 Un(l,c,d,e.opacity)}function oj(e,n,i,s){return arguments.length===1?zk(e):new Un(e,n,i,s??1)}function Un(e,n,i,s){this.h=+e,this.s=+n,this.l=+i,this.opacity=+s}qg(Un,oj,Fk(Do,{brighter(e){return e=e==null?mu:Math.pow(mu,e),new Un(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?jo:Math.pow(jo,e),new Un(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 nn(qc(e>=240?e-240:e+120,o,s),qc(e,o,s),qc(e<120?e+240:e-120,o,s),this.opacity)},clamp(){return new Un(aw(this.h),Za(this.s),Za(this.l),gu(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=gu(this.opacity);return`${e===1?"hsl(":"hsla("}${aw(this.h)}, ${Za(this.s)*100}%, ${Za(this.l)*100}%${e===1?")":`, ${e})`}`}}));function aw(e){return e=(e||0)%360,e<0?e+360:e}function Za(e){return Math.max(0,Math.min(1,e||0))}function qc(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 Bk=e=>()=>e;function aj(e,n){return function(i){return e+i*n}}function uj(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 lj(e){return(e=+e)==1?Uk:function(n,i){return i-n?uj(n,i,e):Bk(isNaN(n)?i:n)}}function Uk(e,n){var i=n-e;return i?aj(e,i):Bk(isNaN(e)?n:e)}const uw=(function e(n){var i=lj(n);function s(o,u){var l=i((o=hg(o)).r,(u=hg(u)).r),c=i(o.g,u.g),d=i(o.b,u.b),h=Uk(o.opacity,u.opacity);return function(p){return o.r=l(p),o.g=c(p),o.b=d(p),o.opacity=h(p),o+""}}return s.gamma=e,s})(1);function Kr(e,n){return e=+e,n=+n,function(i){return e*(1-i)+n*i}}var pg=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Lc=new RegExp(pg.source,"g");function cj(e){return function(){return e}}function fj(e){return function(n){return e(n)+""}}function dj(e,n){var i=pg.lastIndex=Lc.lastIndex=0,s,o,u,l=-1,c=[],d=[];for(e=e+"",n=n+"";(s=pg.exec(e))&&(o=Lc.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:Kr(s,o)})),i=Lc.lastIndex;return i<n.length&&(u=n.slice(i),c[l]?c[l]+=u:c[++l]=u),c.length<2?d[0]?fj(d[0].x):cj(n):(n=d.length,function(h){for(var p=0,m;p<n;++p)c[(m=d[p]).i]=m.x(h);return c.join("")})}var lw=180/Math.PI,mg={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Hk(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)*lw,skewX:Math.atan(d)*lw,scaleX:l,scaleY:c}}var Ja;function hj(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?mg:Hk(n.a,n.b,n.c,n.d,n.e,n.f)}function pj(e){return e==null||(Ja||(Ja=document.createElementNS("http://www.w3.org/2000/svg","g")),Ja.setAttribute("transform",e),!(e=Ja.transform.baseVal.consolidate()))?mg:(e=e.matrix,Hk(e.a,e.b,e.c,e.d,e.e,e.f))}function Vk(e,n,i,s){function o(h){return h.length?h.pop()+" ":""}function u(h,p,m,y,x,N){if(h!==m||p!==y){var _=x.push("translate(",null,n,null,i);N.push({i:_-4,x:Kr(h,m)},{i:_-2,x:Kr(p,y)})}else(m||y)&&x.push("translate("+m+n+y+i)}function l(h,p,m,y){h!==p?(h-p>180?p+=360:p-h>180&&(h+=360),y.push({i:m.push(o(m)+"rotate(",null,s)-2,x:Kr(h,p)})):p&&m.push(o(m)+"rotate("+p+s)}function c(h,p,m,y){h!==p?y.push({i:m.push(o(m)+"skewX(",null,s)-2,x:Kr(h,p)}):p&&m.push(o(m)+"skewX("+p+s)}function d(h,p,m,y,x,N){if(h!==m||p!==y){var _=x.push(o(x)+"scale(",null,",",null,")");N.push({i:_-4,x:Kr(h,m)},{i:_-2,x:Kr(p,y)})}else(m!==1||y!==1)&&x.push(o(x)+"scale("+m+","+y+")")}return function(h,p){var m=[],y=[];return h=e(h),p=e(p),u(h.translateX,h.translateY,p.translateX,p.translateY,m,y),l(h.rotate,p.rotate,m,y),c(h.skewX,p.skewX,m,y),d(h.scaleX,h.scaleY,p.scaleX,p.scaleY,m,y),h=p=null,function(x){for(var N=-1,_=y.length,S;++N<_;)m[(S=y[N]).i]=S.x(x);return m.join("")}}}var mj=Vk(hj,"px, ","px)","deg)"),gj=Vk(pj,", ",")",")"),vj=1e-12;function cw(e){return((e=Math.exp(e))+1/e)/2}function yj(e){return((e=Math.exp(e))-1/e)/2}function wj(e){return((e=Math.exp(2*e))-1)/(e+1)}const xj=(function e(n,i,s){function o(u,l){var c=u[0],d=u[1],h=u[2],p=l[0],m=l[1],y=l[2],x=p-c,N=m-d,_=x*x+N*N,S,b;if(_<vj)b=Math.log(y/h)/n,S=function(I){return[c+I*x,d+I*N,h*Math.exp(n*I*b)]};else{var k=Math.sqrt(_),E=(y*y-h*h+s*_)/(2*h*i*k),C=(y*y-h*h-s*_)/(2*y*i*k),A=Math.log(Math.sqrt(E*E+1)-E),P=Math.log(Math.sqrt(C*C+1)-C);b=(P-A)/n,S=function(I){var M=I*b,R=cw(A),L=h/(i*k)*(R*wj(n*M+A)-yj(A));return[c+L*x,d+L*N,h*R/cw(n*M+A)]}}return S.duration=b*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 Rs=0,So=0,vo=0,Wk=1e3,vu,bo,yu=0,Ii=0,Tu=0,Mo=typeof performance=="object"&&performance.now?performance:Date,Gk=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Lg(){return Ii||(Gk(_j),Ii=Mo.now()+Tu)}function _j(){Ii=0}function wu(){this._call=this._time=this._next=null}wu.prototype=Yk.prototype={constructor:wu,restart:function(e,n,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?Lg():+i)+(n==null?0:+n),!this._next&&bo!==this&&(bo?bo._next=this:vu=this,bo=this),this._call=e,this._time=i,gg()},stop:function(){this._call&&(this._call=null,this._time=1/0,gg())}};function Yk(e,n,i){var s=new wu;return s.restart(e,n,i),s}function Sj(){Lg(),++Rs;for(var e=vu,n;e;)(n=Ii-e._time)>=0&&e._call.call(void 0,n),e=e._next;--Rs}function fw(){Ii=(yu=Mo.now())+Tu,Rs=So=0;try{Sj()}finally{Rs=0,kj(),Ii=0}}function bj(){var e=Mo.now(),n=e-yu;n>Wk&&(Tu-=n,yu=e)}function kj(){for(var e,n=vu,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:vu=i);bo=e,gg(s)}function gg(e){if(!Rs){So&&(So=clearTimeout(So));var n=e-Ii;n>24?(e<1/0&&(So=setTimeout(fw,e-Mo.now()-Tu)),vo&&(vo=clearInterval(vo))):(vo||(yu=Mo.now(),vo=setInterval(bj,Wk)),Rs=1,Gk(fw))}}function dw(e,n,i){var s=new wu;return n=n==null?0:+n,s.restart(o=>{s.stop(),e(o+n)},n,i),s}var Ej=Nu("start","end","cancel","interrupt"),Nj=[],Kk=0,hw=1,vg=2,fu=3,pw=4,yg=5,du=6;function Ru(e,n,i,s,o,u){var l=e.__transition;if(!l)e.__transition={};else if(i in l)return;Cj(e,i,{name:n,index:s,group:o,on:Ej,tween:Nj,time:u.time,delay:u.delay,duration:u.duration,ease:u.ease,timer:null,state:Kk})}function $g(e,n){var i=Wn(e,n);if(i.state>Kk)throw new Error("too late; already scheduled");return i}function nr(e,n){var i=Wn(e,n);if(i.state>fu)throw new Error("too late; already running");return i}function Wn(e,n){var i=e.__transition;if(!i||!(i=i[n]))throw new Error("transition not found");return i}function Cj(e,n,i){var s=e.__transition,o;s[n]=i,i.timer=Yk(u,0,i.time);function u(h){i.state=hw,i.timer.restart(l,i.delay,i.time),i.delay<=h&&l(h-i.delay)}function l(h){var p,m,y,x;if(i.state!==hw)return d();for(p in s)if(x=s[p],x.name===i.name){if(x.state===fu)return dw(l);x.state===pw?(x.state=du,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete s[p]):+p<n&&(x.state=du,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete s[p])}if(dw(function(){i.state===fu&&(i.state=pw,i.timer.restart(c,i.delay,i.time),c(h))}),i.state=vg,i.on.call("start",e,e.__data__,i.index,i.group),i.state===vg){for(i.state=fu,o=new Array(y=i.tween.length),p=0,m=-1;p<y;++p)(x=i.tween[p].value.call(e,e.__data__,i.index,i.group))&&(o[++m]=x);o.length=m+1}}function c(h){for(var p=h<i.duration?i.ease.call(null,h/i.duration):(i.timer.restart(d),i.state=yg,1),m=-1,y=o.length;++m<y;)o[m].call(e,p);i.state===yg&&(i.on.call("end",e,e.__data__,i.index,i.group),d())}function d(){i.state=du,i.timer.stop(),delete s[n];for(var h in s)return;delete e.__transition}}function hu(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>vg&&s.state<yg,s.state=du,s.timer.stop(),s.on.call(o?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete i[l]}u&&delete e.__transition}}function Tj(e){return this.each(function(){hu(this,e)})}function Rj(e,n){var i,s;return function(){var o=nr(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 jj(e,n,i){var s,o;if(typeof i!="function")throw new Error;return function(){var u=nr(this,e),l=u.tween;if(l!==s){o=(s=l).slice();for(var c={name:n,value:i},d=0,h=o.length;d<h;++d)if(o[d].name===n){o[d]=c;break}d===h&&o.push(c)}u.tween=o}}function Aj(e,n){var i=this._id;if(e+="",arguments.length<2){for(var s=Wn(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?Rj:jj)(i,e,n))}function Dg(e,n,i){var s=e._id;return e.each(function(){var o=nr(this,s);(o.value||(o.value={}))[n]=i.apply(this,arguments)}),function(o){return Wn(o,s).value[n]}}function Xk(e,n){var i;return(typeof n=="number"?Kr:n instanceof Io?uw:(i=Io(n))?(n=i,uw):dj)(e,n)}function Ij(e){return function(){this.removeAttribute(e)}}function Mj(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Pj(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 Oj(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 qj(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 Lj(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 $j(e,n){var i=Cu(e),s=i==="transform"?gj:Xk;return this.attrTween(e,typeof n=="function"?(i.local?Lj:qj)(i,s,Dg(this,"attr."+e,n)):n==null?(i.local?Mj:Ij)(i):(i.local?Oj:Pj)(i,s,n))}function Dj(e,n){return function(i){this.setAttribute(e,n.call(this,i))}}function Fj(e,n){return function(i){this.setAttributeNS(e.space,e.local,n.call(this,i))}}function zj(e,n){var i,s;function o(){var u=n.apply(this,arguments);return u!==s&&(i=(s=u)&&Fj(e,u)),i}return o._value=n,o}function Bj(e,n){var i,s;function o(){var u=n.apply(this,arguments);return u!==s&&(i=(s=u)&&Dj(e,u)),i}return o._value=n,o}function Uj(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=Cu(e);return this.tween(i,(s.local?zj:Bj)(s,n))}function Hj(e,n){return function(){$g(this,e).delay=+n.apply(this,arguments)}}function Vj(e,n){return n=+n,function(){$g(this,e).delay=n}}function Wj(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?Hj:Vj)(n,e)):Wn(this.node(),n).delay}function Gj(e,n){return function(){nr(this,e).duration=+n.apply(this,arguments)}}function Yj(e,n){return n=+n,function(){nr(this,e).duration=n}}function Kj(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?Gj:Yj)(n,e)):Wn(this.node(),n).duration}function Xj(e,n){if(typeof n!="function")throw new Error;return function(){nr(this,e).ease=n}}function Qj(e){var n=this._id;return arguments.length?this.each(Xj(n,e)):Wn(this.node(),n).ease}function Zj(e,n){return function(){var i=n.apply(this,arguments);if(typeof i!="function")throw new Error;nr(this,e).ease=i}}function Jj(e){if(typeof e!="function")throw new Error;return this.each(Zj(this._id,e))}function eA(e){typeof e!="function"&&(e=Tk(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,h=0;h<l;++h)(d=u[h])&&e.call(d,d.__data__,h,u)&&c.push(d);return new vr(s,this._parents,this._name,this._id)}function tA(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],h=i[c],p=d.length,m=l[c]=new Array(p),y,x=0;x<p;++x)(y=d[x]||h[x])&&(m[x]=y);for(;c<s;++c)l[c]=n[c];return new vr(l,this._parents,this._name,this._id)}function nA(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 rA(e,n,i){var s,o,u=nA(n)?$g:nr;return function(){var l=u(this,e),c=l.on;c!==s&&(o=(s=c).copy()).on(n,i),l.on=o}}function iA(e,n){var i=this._id;return arguments.length<2?Wn(this.node(),i).on.on(e):this.each(rA(i,e,n))}function sA(e){return function(){var n=this.parentNode;for(var i in this.__transition)if(+i!==e)return;n&&n.removeChild(this)}}function oA(){return this.on("end.remove",sA(this._id))}function aA(e){var n=this._name,i=this._id;typeof e!="function"&&(e=Pg(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,h=u[l]=new Array(d),p,m,y=0;y<d;++y)(p=c[y])&&(m=e.call(p,p.__data__,y,c))&&("__data__"in p&&(m.__data__=p.__data__),h[y]=m,Ru(h[y],n,i,y,h,Wn(p,i)));return new vr(u,this._parents,n,i)}function uA(e){var n=this._name,i=this._id;typeof e!="function"&&(e=Ck(e));for(var s=this._groups,o=s.length,u=[],l=[],c=0;c<o;++c)for(var d=s[c],h=d.length,p,m=0;m<h;++m)if(p=d[m]){for(var y=e.call(p,p.__data__,m,d),x,N=Wn(p,i),_=0,S=y.length;_<S;++_)(x=y[_])&&Ru(x,n,i,_,y,N);u.push(y),l.push(p)}return new vr(u,l,n,i)}var lA=$o.prototype.constructor;function cA(){return new lA(this._groups,this._parents)}function fA(e,n){var i,s,o;return function(){var u=Ts(this,e),l=(this.style.removeProperty(e),Ts(this,e));return u===l?null:u===i&&l===s?o:o=n(i=u,s=l)}}function Qk(e){return function(){this.style.removeProperty(e)}}function dA(e,n,i){var s,o=i+"",u;return function(){var l=Ts(this,e);return l===o?null:l===s?u:u=n(s=l,i)}}function hA(e,n,i){var s,o,u;return function(){var l=Ts(this,e),c=i(this),d=c+"";return c==null&&(d=c=(this.style.removeProperty(e),Ts(this,e))),l===d?null:l===s&&d===o?u:(o=d,u=n(s=l,c))}}function pA(e,n){var i,s,o,u="style."+n,l="end."+u,c;return function(){var d=nr(this,e),h=d.on,p=d.value[u]==null?c||(c=Qk(n)):void 0;(h!==i||o!==p)&&(s=(i=h).copy()).on(l,o=p),d.on=s}}function mA(e,n,i){var s=(e+="")=="transform"?mj:Xk;return n==null?this.styleTween(e,fA(e,s)).on("end.style."+e,Qk(e)):typeof n=="function"?this.styleTween(e,hA(e,s,Dg(this,"style."+e,n))).each(pA(this._id,e)):this.styleTween(e,dA(e,s,n),i).on("end.style."+e,null)}function gA(e,n,i){return function(s){this.style.setProperty(e,n.call(this,s),i)}}function vA(e,n,i){var s,o;function u(){var l=n.apply(this,arguments);return l!==o&&(s=(o=l)&&gA(e,l,i)),s}return u._value=n,u}function yA(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,vA(e,n,i??""))}function wA(e){return function(){this.textContent=e}}function xA(e){return function(){var n=e(this);this.textContent=n??""}}function _A(e){return this.tween("text",typeof e=="function"?xA(Dg(this,"text",e)):wA(e==null?"":e+""))}function SA(e){return function(n){this.textContent=e.call(this,n)}}function bA(e){var n,i;function s(){var o=e.apply(this,arguments);return o!==i&&(n=(i=o)&&SA(o)),n}return s._value=e,s}function kA(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,bA(e))}function EA(){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,h=0;h<c;++h)if(d=l[h]){var p=Wn(d,n);Ru(d,e,i,h,l,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new vr(s,this._parents,e,i)}function NA(){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 h=nr(this,s),p=h.on;p!==e&&(n=(e=p).copy(),n._.cancel.push(c),n._.interrupt.push(c),n._.end.push(d)),h.on=n}),o===0&&u()})}var CA=0;function vr(e,n,i,s){this._groups=e,this._parents=n,this._name=i,this._id=s}function Zk(){return++CA}var hr=$o.prototype;vr.prototype={constructor:vr,select:aA,selectAll:uA,selectChild:hr.selectChild,selectChildren:hr.selectChildren,filter:eA,merge:tA,selection:cA,transition:EA,call:hr.call,nodes:hr.nodes,node:hr.node,size:hr.size,empty:hr.empty,each:hr.each,on:iA,attr:$j,attrTween:Uj,style:mA,styleTween:yA,text:_A,textTween:kA,remove:oA,tween:Aj,delay:Wj,duration:Kj,ease:Qj,easeVarying:Jj,end:NA,[Symbol.iterator]:hr[Symbol.iterator]};function TA(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var RA={time:null,delay:0,duration:250,ease:TA};function jA(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 AA(e){var n,i;e instanceof vr?(n=e._id,e=e._name):(n=Zk(),(i=RA).time=Lg(),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,h=0;h<c;++h)(d=l[h])&&Ru(d,e,n,h,l,i||jA(d,n));return new vr(s,this._parents,e,n)}$o.prototype.interrupt=Tj;$o.prototype.transition=AA;const eu=e=>()=>e;function IA(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 mr(e,n,i){this.k=e,this.x=n,this.y=i}mr.prototype={constructor:mr,scale:function(e){return e===1?this:new mr(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new mr(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 gr=new mr(1,0,0);mr.prototype;function $c(e){e.stopImmediatePropagation()}function yo(e){e.preventDefault(),e.stopImmediatePropagation()}function MA(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function PA(){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 mw(){return this.__zoom||gr}function OA(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function qA(){return navigator.maxTouchPoints||"ontouchstart"in this}function LA(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 Jk(){var e=MA,n=PA,i=LA,s=OA,o=qA,u=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,d=xj,h=Nu("start","zoom","end"),p,m,y,x=500,N=150,_=0,S=10;function b(j){j.property("__zoom",mw).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",L).filter(o).on("touchstart.zoom",F).on("touchmove.zoom",Q).on("touchend.zoom touchcancel.zoom",X).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(j,G,U,ne){var K=j.selection?j.selection():j;K.property("__zoom",mw),j!==K?A(j,G,U,ne):K.interrupt().each(function(){P(this,arguments).event(ne).start().zoom(null,typeof G=="function"?G.apply(this,arguments):G).end()})},b.scaleBy=function(j,G,U,ne){b.scaleTo(j,function(){var K=this.__zoom.k,D=typeof G=="function"?G.apply(this,arguments):G;return K*D},U,ne)},b.scaleTo=function(j,G,U,ne){b.transform(j,function(){var K=n.apply(this,arguments),D=this.__zoom,V=U==null?C(K):typeof U=="function"?U.apply(this,arguments):U,O=D.invert(V),B=typeof G=="function"?G.apply(this,arguments):G;return i(E(k(D,B),V,O),K,l)},U,ne)},b.translateBy=function(j,G,U,ne){b.transform(j,function(){return i(this.__zoom.translate(typeof G=="function"?G.apply(this,arguments):G,typeof U=="function"?U.apply(this,arguments):U),n.apply(this,arguments),l)},null,ne)},b.translateTo=function(j,G,U,ne,K){b.transform(j,function(){var D=n.apply(this,arguments),V=this.__zoom,O=ne==null?C(D):typeof ne=="function"?ne.apply(this,arguments):ne;return i(gr.translate(O[0],O[1]).scale(V.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof U=="function"?-U.apply(this,arguments):-U),D,l)},ne,K)};function k(j,G){return G=Math.max(u[0],Math.min(u[1],G)),G===j.k?j:new mr(G,j.x,j.y)}function E(j,G,U){var ne=G[0]-U[0]*j.k,K=G[1]-U[1]*j.k;return ne===j.x&&K===j.y?j:new mr(j.k,ne,K)}function C(j){return[(+j[0][0]+ +j[1][0])/2,(+j[0][1]+ +j[1][1])/2]}function A(j,G,U,ne){j.on("start.zoom",function(){P(this,arguments).event(ne).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).event(ne).end()}).tween("zoom",function(){var K=this,D=arguments,V=P(K,D).event(ne),O=n.apply(K,D),B=U==null?C(O):typeof U=="function"?U.apply(K,D):U,ae=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),z=K.__zoom,W=typeof G=="function"?G.apply(K,D):G,J=d(z.invert(B).concat(ae/z.k),W.invert(B).concat(ae/W.k));return function(se){if(se===1)se=W;else{var ue=J(se),he=ae/ue[2];se=new mr(he,B[0]-ue[0]*he,B[1]-ue[1]*he)}V.zoom(null,se)}})}function P(j,G,U){return!U&&j.__zooming||new I(j,G)}function I(j,G){this.that=j,this.args=G,this.active=0,this.sourceEvent=null,this.extent=n.apply(j,G),this.taps=0}I.prototype={event:function(j){return j&&(this.sourceEvent=j),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(j,G){return this.mouse&&j!=="mouse"&&(this.mouse[1]=G.invert(this.mouse[0])),this.touch0&&j!=="touch"&&(this.touch0[1]=G.invert(this.touch0[0])),this.touch1&&j!=="touch"&&(this.touch1[1]=G.invert(this.touch1[0])),this.that.__zoom=G,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(j){var G=Rn(this.that).datum();h.call(j,this.that,new IA(j,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:h}),G)}};function M(j,...G){if(!e.apply(this,arguments))return;var U=P(this,G).event(j),ne=this.__zoom,K=Math.max(u[0],Math.min(u[1],ne.k*Math.pow(2,s.apply(this,arguments)))),D=Bn(j);if(U.wheel)(U.mouse[0][0]!==D[0]||U.mouse[0][1]!==D[1])&&(U.mouse[1]=ne.invert(U.mouse[0]=D)),clearTimeout(U.wheel);else{if(ne.k===K)return;U.mouse=[D,ne.invert(D)],hu(this),U.start()}yo(j),U.wheel=setTimeout(V,N),U.zoom("mouse",i(E(k(ne,K),U.mouse[0],U.mouse[1]),U.extent,l));function V(){U.wheel=null,U.end()}}function R(j,...G){if(y||!e.apply(this,arguments))return;var U=j.currentTarget,ne=P(this,G,!0).event(j),K=Rn(j.view).on("mousemove.zoom",B,!0).on("mouseup.zoom",ae,!0),D=Bn(j,U),V=j.clientX,O=j.clientY;$k(j.view),$c(j),ne.mouse=[D,this.__zoom.invert(D)],hu(this),ne.start();function B(z){if(yo(z),!ne.moved){var W=z.clientX-V,J=z.clientY-O;ne.moved=W*W+J*J>_}ne.event(z).zoom("mouse",i(E(ne.that.__zoom,ne.mouse[0]=Bn(z,U),ne.mouse[1]),ne.extent,l))}function ae(z){K.on("mousemove.zoom mouseup.zoom",null),Dk(z.view,ne.moved),yo(z),ne.event(z).end()}}function L(j,...G){if(e.apply(this,arguments)){var U=this.__zoom,ne=Bn(j.changedTouches?j.changedTouches[0]:j,this),K=U.invert(ne),D=U.k*(j.shiftKey?.5:2),V=i(E(k(U,D),ne,K),n.apply(this,G),l);yo(j),c>0?Rn(this).transition().duration(c).call(A,V,ne,j):Rn(this).call(b.transform,V,ne,j)}}function F(j,...G){if(e.apply(this,arguments)){var U=j.touches,ne=U.length,K=P(this,G,j.changedTouches.length===ne).event(j),D,V,O,B;for($c(j),V=0;V<ne;++V)O=U[V],B=Bn(O,this),B=[B,this.__zoom.invert(B),O.identifier],K.touch0?!K.touch1&&K.touch0[2]!==B[2]&&(K.touch1=B,K.taps=0):(K.touch0=B,D=!0,K.taps=1+!!p);p&&(p=clearTimeout(p)),D&&(K.taps<2&&(m=B[0],p=setTimeout(function(){p=null},x)),hu(this),K.start())}}function Q(j,...G){if(this.__zooming){var U=P(this,G).event(j),ne=j.changedTouches,K=ne.length,D,V,O,B;for(yo(j),D=0;D<K;++D)V=ne[D],O=Bn(V,this),U.touch0&&U.touch0[2]===V.identifier?U.touch0[0]=O:U.touch1&&U.touch1[2]===V.identifier&&(U.touch1[0]=O);if(V=U.that.__zoom,U.touch1){var ae=U.touch0[0],z=U.touch0[1],W=U.touch1[0],J=U.touch1[1],se=(se=W[0]-ae[0])*se+(se=W[1]-ae[1])*se,ue=(ue=J[0]-z[0])*ue+(ue=J[1]-z[1])*ue;V=k(V,Math.sqrt(se/ue)),O=[(ae[0]+W[0])/2,(ae[1]+W[1])/2],B=[(z[0]+J[0])/2,(z[1]+J[1])/2]}else if(U.touch0)O=U.touch0[0],B=U.touch0[1];else return;U.zoom("touch",i(E(V,O,B),U.extent,l))}}function X(j,...G){if(this.__zooming){var U=P(this,G).event(j),ne=j.changedTouches,K=ne.length,D,V;for($c(j),y&&clearTimeout(y),y=setTimeout(function(){y=null},x),D=0;D<K;++D)V=ne[D],U.touch0&&U.touch0[2]===V.identifier?delete U.touch0:U.touch1&&U.touch1[2]===V.identifier&&delete U.touch1;if(U.touch1&&!U.touch0&&(U.touch0=U.touch1,delete U.touch1),U.touch0)U.touch0[1]=this.__zoom.invert(U.touch0[0]);else if(U.end(),U.taps===2&&(V=Bn(V,this),Math.hypot(m[0]-V[0],m[1]-V[1])<S)){var O=Rn(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return b.wheelDelta=function(j){return arguments.length?(s=typeof j=="function"?j:eu(+j),b):s},b.filter=function(j){return arguments.length?(e=typeof j=="function"?j:eu(!!j),b):e},b.touchable=function(j){return arguments.length?(o=typeof j=="function"?j:eu(!!j),b):o},b.extent=function(j){return arguments.length?(n=typeof j=="function"?j:eu([[+j[0][0],+j[0][1]],[+j[1][0],+j[1][1]]]),b):n},b.scaleExtent=function(j){return arguments.length?(u[0]=+j[0],u[1]=+j[1],b):[u[0],u[1]]},b.translateExtent=function(j){return arguments.length?(l[0][0]=+j[0][0],l[1][0]=+j[1][0],l[0][1]=+j[0][1],l[1][1]=+j[1][1],b):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},b.constrain=function(j){return arguments.length?(i=j,b):i},b.duration=function(j){return arguments.length?(c=+j,b):c},b.interpolate=function(j){return arguments.length?(d=j,b):d},b.on=function(){var j=h.on.apply(h,arguments);return j===h?b:j},b.clickDistance=function(j){return arguments.length?(_=(j=+j)*j,b):Math.sqrt(_)},b.tapDistance=function(j){return arguments.length?(S=+j,b):S},b}kk();const ju=q.createContext(null),$A=ju.Provider,yr={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.`},eE=yr.error001();function Xe(e,n){const i=q.useContext(ju);if(i===null)throw new Error(eE);return Ek(i,e,n)}const bt=()=>{const e=q.useContext(ju);if(e===null)throw new Error(eE);return q.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},DA=e=>e.userSelectionActive?"none":"all";function Fg({position:e,children:n,className:i,style:s,...o}){const u=Xe(DA),l=`${e}`.split("-");return oe.createElement("div",{className:qt(["react-flow__panel",i,...l]),style:{...s,pointerEvents:u},...o},n)}function FA({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:oe.createElement(Fg,{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 zA=({x:e,y:n,label:i,labelStyle:s={},labelShowBg:o=!0,labelBgStyle:u={},labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:d,className:h,...p})=>{const m=q.useRef(null),[y,x]=q.useState({x:0,y:0,width:0,height:0}),N=qt(["react-flow__edge-textwrapper",h]);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:N,visibility:y.width?"visible":"hidden",...p},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 BA=q.memo(zA);const zg=e=>({width:e.offsetWidth,height:e.offsetHeight}),js=(e,n=0,i=1)=>Math.min(Math.max(e,n),i),Bg=(e={x:0,y:0},n)=>({x:js(e.x,n[0][0],n[1][0]),y:js(e.y,n[0][1],n[1][1])}),gw=(e,n,i)=>e<n?js(Math.abs(e-n),1,50)/50:e>i?-js(Math.abs(e-i),1,50)/50:0,tE=(e,n)=>{const i=gw(e.x,35,n.width-35)*20,s=gw(e.y,35,n.height-35)*20;return[i,s]},nE=e=>{var n;return((n=e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},rE=(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)}),Po=({x:e,y:n,width:i,height:s})=>({x:e,y:n,x2:e+i,y2:n+s}),iE=({x:e,y:n,x2:i,y2:s})=>({x:e,y:n,width:i-e,height:s-n}),vw=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),UA=(e,n)=>iE(rE(Po(e),Po(n))),wg=(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)},HA=e=>jn(e.width)&&jn(e.height)&&jn(e.x)&&jn(e.y),jn=e=>!isNaN(e)&&isFinite(e),ht=Symbol.for("internals"),sE=["Enter"," ","Escape"],VA=(e,n)=>{},WA=e=>"nativeEvent"in e;function xg(e){var o,u;const n=WA(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 oE=e=>"clientX"in e,Zr=(e,n)=>{var u,l;const i=oE(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)}},xu=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},Fo=({id:e,path:n,labelX:i,labelY:s,label:o,labelStyle:u,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:y,interactionWidth:x=20})=>oe.createElement(oe.Fragment,null,oe.createElement("path",{id:e,style:p,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&&jn(i)&&jn(s)?oe.createElement(BA,{x:i,y:s,label:o,labelStyle:u,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h}):null);Fo.displayName="BaseEdge";function wo(e,n,i){return i===void 0?i:s=>{const o=n().edges.find(u=>u.id===e);o&&i(s,{...o})}}function aE({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 uE({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,h=n*.125+u*.375+c*.375+s*.125,p=Math.abs(d-e),m=Math.abs(h-n);return[d,h,p,m]}var Mi;(function(e){e.Strict="strict",e.Loose="loose"})(Mi||(Mi={}));var Ti;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ti||(Ti={}));var Oo;(function(e){e.Partial="partial",e.Full="full"})(Oo||(Oo={}));var Qr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Qr||(Qr={}));var _u;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(_u||(_u={}));var Ce;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ce||(Ce={}));function yw({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 lE({sourceX:e,sourceY:n,sourcePosition:i=Ce.Bottom,targetX:s,targetY:o,targetPosition:u=Ce.Top}){const[l,c]=yw({pos:i,x1:e,y1:n,x2:s,y2:o}),[d,h]=yw({pos:u,x1:s,y1:o,x2:e,y2:n}),[p,m,y,x]=uE({sourceX:e,sourceY:n,targetX:s,targetY:o,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:h});return[`M${e},${n} C${l},${c} ${d},${h} ${s},${o}`,p,m,y,x]}const Ug=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:h,labelBgPadding:p,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:N,interactionWidth:_})=>{const[S,b,k]=lE({sourceX:e,sourceY:n,sourcePosition:o,targetX:i,targetY:s,targetPosition:u});return oe.createElement(Fo,{path:S,labelX:b,labelY:k,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:N,interactionWidth:_})});Ug.displayName="SimpleBezierEdge";const ww={[Ce.Left]:{x:-1,y:0},[Ce.Right]:{x:1,y:0},[Ce.Top]:{x:0,y:-1},[Ce.Bottom]:{x:0,y:1}},GA=({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},xw=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function YA({source:e,sourcePosition:n=Ce.Bottom,target:i,targetPosition:s=Ce.Top,center:o,offset:u}){const l=ww[n],c=ww[s],d={x:e.x+l.x*u,y:e.y+l.y*u},h={x:i.x+c.x*u,y:i.y+c.y*u},p=GA({source:d,sourcePosition:n,target:h}),m=p.x!==0?"x":"y",y=p[m];let x=[],N,_;const S={x:0,y:0},b={x:0,y:0},[k,E,C,A]=aE({sourceX:e.x,sourceY:e.y,targetX:i.x,targetY:i.y});if(l[m]*c[m]===-1){N=o.x??k,_=o.y??E;const I=[{x:N,y:d.y},{x:N,y:h.y}],M=[{x:d.x,y:_},{x:h.x,y:_}];l[m]===y?x=m==="x"?I:M:x=m==="x"?M:I}else{const I=[{x:d.x,y:h.y}],M=[{x:h.x,y:d.y}];if(m==="x"?x=l.x===y?M:I:x=l.y===y?I:M,n===s){const X=Math.abs(e[m]-i[m]);if(X<=u){const j=Math.min(u-1,u-X);l[m]===y?S[m]=(d[m]>e[m]?-1:1)*j:b[m]=(h[m]>i[m]?-1:1)*j}}if(n!==s){const X=m==="x"?"y":"x",j=l[m]===c[X],G=d[X]>h[X],U=d[X]<h[X];(l[m]===1&&(!j&&G||j&&U)||l[m]!==1&&(!j&&U||j&&G))&&(x=m==="x"?I:M)}const R={x:d.x+S.x,y:d.y+S.y},L={x:h.x+b.x,y:h.y+b.y},F=Math.max(Math.abs(R.x-x[0].x),Math.abs(L.x-x[0].x)),Q=Math.max(Math.abs(R.y-x[0].y),Math.abs(L.y-x[0].y));F>=Q?(N=(R.x+L.x)/2,_=x[0].y):(N=x[0].x,_=(R.y+L.y)/2)}return[[e,{x:d.x+S.x,y:d.y+S.y},...x,{x:h.x+b.x,y:h.y+b.y},i],N,_,C,A]}function KA(e,n,i,s){const o=Math.min(xw(e,n)/2,xw(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 h=e.x<i.x?-1:1,p=e.y<i.y?1:-1;return`L ${u+o*h},${l}Q ${u},${l} ${u},${l+o*p}`}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 _g({sourceX:e,sourceY:n,sourcePosition:i=Ce.Bottom,targetX:s,targetY:o,targetPosition:u=Ce.Top,borderRadius:l=5,centerX:c,centerY:d,offset:h=20}){const[p,m,y,x,N]=YA({source:{x:e,y:n},sourcePosition:i,target:{x:s,y:o},targetPosition:u,center:{x:c,y:d},offset:h});return[p.reduce((S,b,k)=>{let E="";return k>0&&k<p.length-1?E=KA(p[k-1],b,p[k+1],l):E=`${k===0?"M":"L"}${b.x} ${b.y}`,S+=E,S},""),m,y,x,N]}const Au=q.memo(({sourceX:e,sourceY:n,targetX:i,targetY:s,label:o,labelStyle:u,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:p,sourcePosition:m=Ce.Bottom,targetPosition:y=Ce.Top,markerEnd:x,markerStart:N,pathOptions:_,interactionWidth:S})=>{const[b,k,E]=_g({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(Fo,{path:b,labelX:k,labelY:E,label:o,labelStyle:u,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:x,markerStart:N,interactionWidth:S})});Au.displayName="SmoothStepEdge";const Hg=q.memo(e=>{var n;return oe.createElement(Au,{...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])})});Hg.displayName="StepEdge";function XA({sourceX:e,sourceY:n,targetX:i,targetY:s}){const[o,u,l,c]=aE({sourceX:e,sourceY:n,targetX:i,targetY:s});return[`M ${e},${n}L ${i},${s}`,o,u,l,c]}const Vg=q.memo(({sourceX:e,sourceY:n,targetX:i,targetY:s,label:o,labelStyle:u,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:y,interactionWidth:x})=>{const[N,_,S]=XA({sourceX:e,sourceY:n,targetX:i,targetY:s});return oe.createElement(Fo,{path:N,labelX:_,labelY:S,label:o,labelStyle:u,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:y,interactionWidth:x})});Vg.displayName="StraightEdge";function tu(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function _w({pos:e,x1:n,y1:i,x2:s,y2:o,c:u}){switch(e){case Ce.Left:return[n-tu(n-s,u),i];case Ce.Right:return[n+tu(s-n,u),i];case Ce.Top:return[n,i-tu(i-o,u)];case Ce.Bottom:return[n,i+tu(o-i,u)]}}function cE({sourceX:e,sourceY:n,sourcePosition:i=Ce.Bottom,targetX:s,targetY:o,targetPosition:u=Ce.Top,curvature:l=.25}){const[c,d]=_w({pos:i,x1:e,y1:n,x2:s,y2:o,c:l}),[h,p]=_w({pos:u,x1:s,y1:o,x2:e,y2:n,c:l}),[m,y,x,N]=uE({sourceX:e,sourceY:n,targetX:s,targetY:o,sourceControlX:c,sourceControlY:d,targetControlX:h,targetControlY:p});return[`M${e},${n} C${c},${d} ${h},${p} ${s},${o}`,m,y,x,N]}const Su=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:h,labelBgPadding:p,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:N,pathOptions:_,interactionWidth:S})=>{const[b,k,E]=cE({sourceX:e,sourceY:n,sourcePosition:o,targetX:i,targetY:s,targetPosition:u,curvature:_==null?void 0:_.curvature});return oe.createElement(Fo,{path:b,labelX:k,labelY:E,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:y,markerEnd:x,markerStart:N,interactionWidth:S})});Su.displayName="BezierEdge";const Wg=q.createContext(null),QA=Wg.Provider;Wg.Consumer;const ZA=()=>q.useContext(Wg),JA=e=>"id"in e&&"source"in e&&"target"in e,eI=({source:e,sourceHandle:n,target:i,targetHandle:s})=>`reactflow__edge-${e}${n||""}-${i}${s||""}`,Sg=(e,n)=>typeof e>"u"?"":typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`,tI=(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)),nI=(e,n)=>{if(!e.source||!e.target)return n;let i;return JA(e)?i={...e}:i={...e,id:eI(e)},tI(i,n)?n:n.concat(i)},bg=({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},fE=({x:e,y:n},[i,s,o])=>({x:e*o+i,y:n*o+s}),ji=(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}},Iu=(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}=ji(o,n).positionAbsolute;return rE(s,Po({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 iE(i)},dE=(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},h=[];return e.forEach(p=>{const{width:m,height:y,selectable:x=!0,hidden:N=!1}=p;if(l&&!x||N)return!1;const{positionAbsolute:_}=ji(p,c),S={x:_.x,y:_.y,width:m||0,height:y||0},b=wg(d,S),k=typeof m>"u"||typeof y>"u"||m===null||y===null,E=u&&b>0,C=(m||0)*(y||0);(k||E||b>=C||p.dragging)&&h.push(p)}),h},hE=(e,n)=>{const i=e.map(s=>s.id);return n.filter(s=>i.includes(s.source)||i.includes(s.target))},pE=(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),h=js(d,s,o),p=e.x+e.width/2,m=e.y+e.height/2,y=n/2-p*h,x=i/2-m*h;return{x:y,y:x,zoom:h}},Ni=(e,n=0)=>e.transition().duration(n);function Sw(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 rI(e,n,i,s,o,u){const{x:l,y:c}=Zr(e),h=n.elementsFromPoint(l,c).find(N=>N.classList.contains("react-flow__handle"));if(h){const N=h.getAttribute("data-nodeid");if(N){const _=Gg(void 0,h),S=h.getAttribute("data-handleid"),b=u({nodeId:N,id:S,type:_});if(b){const k=o.find(E=>E.nodeId===N&&E.type===_&&E.id===S);return{handle:{id:S,type:_,nodeId:N,x:(k==null?void 0:k.x)||i.x,y:(k==null?void 0:k.y)||i.y},validHandleResult:b}}}}let p=[],m=1/0;if(o.forEach(N=>{const _=Math.sqrt((N.x-i.x)**2+(N.y-i.y)**2);if(_<=s){const S=u(N);_<=m&&(_<m?p=[{handle:N,validHandleResult:S}]:_===m&&p.push({handle:N,validHandleResult:S}),m=_)}}),!p.length)return{handle:null,validHandleResult:mE()};if(p.length===1)return p[0];const y=p.some(({validHandleResult:N})=>N.isValid),x=p.some(({handle:N})=>N.type==="target");return p.find(({handle:N,validHandleResult:_})=>x?N.type==="target":y?_.isValid:!0)||p[0]}const iI={source:null,target:null,sourceHandle:null,targetHandle:null},mE=()=>({handleDomNode:null,isValid:!1,connection:iI,endHandle:null});function gE(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}"]`),h={...mE(),handleDomNode:d};if(d){const p=Gg(void 0,d),m=d.getAttribute("data-nodeid"),y=d.getAttribute("data-handleid"),x=d.classList.contains("connectable"),N=d.classList.contains("connectableend"),_={source:c?m:i,sourceHandle:c?y:s,target:c?i:m,targetHandle:c?s:y};h.connection=_,x&&N&&(n===Mi.Strict?c&&p==="source"||!c&&p==="target":m!==i||y!==s)&&(h.endHandle={nodeId:m,handleId:y,type:p},h.isValid=u(_))}return h}function sI({nodes:e,nodeId:n,handleId:i,handleType:s}){return e.reduce((o,u)=>{if(u[ht]){const{handleBounds:l}=u[ht];let c=[],d=[];l&&(c=Sw(u,l,"source",`${n}-${i}-${s}`),d=Sw(u,l,"target",`${n}-${i}-${s}`)),o.push(...c,...d)}return o},[])}function Gg(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function Dc(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function oI(e,n){let i=null;return n?i="valid":e&&!n&&(i="invalid"),i}function vE({event:e,handleId:n,nodeId:i,onConnect:s,isTarget:o,getState:u,setState:l,isValidConnection:c,edgeUpdaterType:d,onReconnectEnd:h}){const p=nE(e.target),{connectionMode:m,domNode:y,autoPanOnConnect:x,connectionRadius:N,onConnectStart:_,panBy:S,getNodes:b,cancelConnection:k}=u();let E=0,C;const{x:A,y:P}=Zr(e),I=p==null?void 0:p.elementFromPoint(A,P),M=Gg(d,I),R=y==null?void 0:y.getBoundingClientRect();if(!R||!M)return;let L,F=Zr(e,R),Q=!1,X=null,j=!1,G=null;const U=sI({nodes:b(),nodeId:i,handleId:n,handleType:M}),ne=()=>{if(!x)return;const[V,O]=tE(F,R);S({x:V,y:O}),E=requestAnimationFrame(ne)};l({connectionPosition:F,connectionStatus:null,connectionNodeId:i,connectionHandleId:n,connectionHandleType:M,connectionStartHandle:{nodeId:i,handleId:n,type:M},connectionEndHandle:null}),_==null||_(e,{nodeId:i,handleId:n,handleType:M});function K(V){const{transform:O}=u();F=Zr(V,R);const{handle:B,validHandleResult:ae}=rI(V,p,bg(F,O,!1,[1,1]),N,U,z=>gE(z,m,i,n,o?"target":"source",c,p));if(C=B,Q||(ne(),Q=!0),G=ae.handleDomNode,X=ae.connection,j=ae.isValid,l({connectionPosition:C&&j?fE({x:C.x,y:C.y},O):F,connectionStatus:oI(!!C,j),connectionEndHandle:ae.endHandle}),!C&&!j&&!G)return Dc(L);X.source!==X.target&&G&&(Dc(L),L=G,G.classList.add("connecting","react-flow__handle-connecting"),G.classList.toggle("valid",j),G.classList.toggle("react-flow__handle-valid",j))}function D(V){var O,B;(C||G)&&X&&j&&(s==null||s(X)),(B=(O=u()).onConnectEnd)==null||B.call(O,V),d&&(h==null||h(V)),Dc(L),k(),cancelAnimationFrame(E),Q=!1,j=!1,X=null,G=null,p.removeEventListener("mousemove",K),p.removeEventListener("mouseup",D),p.removeEventListener("touchmove",K),p.removeEventListener("touchend",D)}p.addEventListener("mousemove",K),p.addEventListener("mouseup",D),p.addEventListener("touchmove",K),p.addEventListener("touchend",D)}const bw=()=>!0,aI=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),uI=(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}},yE=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:h,onMouseDown:p,onTouchStart:m,...y},x)=>{var R,L;const N=l||null,_=e==="target",S=bt(),b=ZA(),{connectOnClick:k,noPanClassName:E}=Xe(aI,St),{connecting:C,clickConnecting:A}=Xe(uI(b,N,e),St);b||(L=(R=S.getState()).onError)==null||L.call(R,"010",yr.error010());const P=F=>{const{defaultEdgeOptions:Q,onConnect:X,hasDefaultEdges:j}=S.getState(),G={...Q,...F};if(j){const{edges:U,setEdges:ne}=S.getState();ne(nI(G,U))}X==null||X(G),c==null||c(G)},I=F=>{if(!b)return;const Q=oE(F);o&&(Q&&F.button===0||!Q)&&vE({event:F,handleId:N,nodeId:b,onConnect:P,isTarget:_,getState:S.getState,setState:S.setState,isValidConnection:i||S.getState().isValidConnection||bw}),Q?p==null||p(F):m==null||m(F)},M=F=>{const{onClickConnectStart:Q,onClickConnectEnd:X,connectionClickStartHandle:j,connectionMode:G,isValidConnection:U}=S.getState();if(!b||!j&&!o)return;if(!j){Q==null||Q(F,{nodeId:b,handleId:N,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:b,type:e,handleId:N}});return}const ne=nE(F.target),K=i||U||bw,{connection:D,isValid:V}=gE({nodeId:b,id:N,type:e},G,j.nodeId,j.handleId||null,j.type,K,ne);V&&P(D),X==null||X(F),S.setState({connectionClickStartHandle:null})};return oe.createElement("div",{"data-handleid":N,"data-nodeid":b,"data-handlepos":n,"data-id":`${b}-${N}-${e}`,className:qt(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",E,h,{source:!_,target:_,connectable:s,connectablestart:o,connectableend:u,connecting:A,connectionindicator:s&&(o&&!C||u&&C)}]),onMouseDown:I,onTouchStart:I,onClick:k?M:void 0,ref:x,...y},d)});yE.displayName="Handle";var As=q.memo(yE);const wE=({data:e,isConnectable:n,targetPosition:i=Ce.Top,sourcePosition:s=Ce.Bottom})=>oe.createElement(oe.Fragment,null,oe.createElement(As,{type:"target",position:i,isConnectable:n}),e==null?void 0:e.label,oe.createElement(As,{type:"source",position:s,isConnectable:n}));wE.displayName="DefaultNode";var kg=q.memo(wE);const xE=({data:e,isConnectable:n,sourcePosition:i=Ce.Bottom})=>oe.createElement(oe.Fragment,null,e==null?void 0:e.label,oe.createElement(As,{type:"source",position:i,isConnectable:n}));xE.displayName="InputNode";var _E=q.memo(xE);const SE=({data:e,isConnectable:n,targetPosition:i=Ce.Top})=>oe.createElement(oe.Fragment,null,oe.createElement(As,{type:"target",position:i,isConnectable:n}),e==null?void 0:e.label);SE.displayName="OutputNode";var bE=q.memo(SE);const Yg=()=>null;Yg.displayName="GroupNode";const lI=e=>({selectedNodes:e.getNodes().filter(n=>n.selected),selectedEdges:e.edges.filter(n=>n.selected).map(n=>({...n}))}),nu=e=>e.id;function cI(e,n){return St(e.selectedNodes.map(nu),n.selectedNodes.map(nu))&&St(e.selectedEdges.map(nu),n.selectedEdges.map(nu))}const kE=q.memo(({onSelectionChange:e})=>{const n=bt(),{selectedNodes:i,selectedEdges:s}=Xe(lI,cI);return q.useEffect(()=>{const o={nodes:i,edges:s};e==null||e(o),n.getState().onSelectionChange.forEach(u=>u(o))},[i,s,e]),null});kE.displayName="SelectionListener";const fI=e=>!!e.onSelectionChange;function dI({onSelectionChange:e}){const n=Xe(fI);return e||n?oe.createElement(kE,{onSelectionChange:e}):null}const hI=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 gs(e,n){q.useEffect(()=>{typeof e<"u"&&n(e)},[e])}function De(e,n,i){q.useEffect(()=>{typeof n<"u"&&i({[e]:n})},[n])}const pI=({nodes:e,edges:n,defaultNodes:i,defaultEdges:s,onConnect:o,onConnectStart:u,onConnectEnd:l,onClickConnectStart:c,onClickConnectEnd:d,nodesDraggable:h,nodesConnectable:p,nodesFocusable:m,edgesFocusable:y,edgesUpdatable:x,elevateNodesOnSelect:N,minZoom:_,maxZoom:S,nodeExtent:b,onNodesChange:k,onEdgesChange:E,elementsSelectable:C,connectionMode:A,snapGrid:P,snapToGrid:I,translateExtent:M,connectOnClick:R,defaultEdgeOptions:L,fitView:F,fitViewOptions:Q,onNodesDelete:X,onEdgesDelete:j,onNodeDrag:G,onNodeDragStart:U,onNodeDragStop:ne,onSelectionDrag:K,onSelectionDragStart:D,onSelectionDragStop:V,noPanClassName:O,nodeOrigin:B,rfId:ae,autoPanOnConnect:z,autoPanOnNodeDrag:W,onError:J,connectionRadius:se,isValidConnection:ue,nodeDragThreshold:he})=>{const{setNodes:ge,setEdges:Me,setDefaultNodesAndEdges:Fe,setMinZoom:Re,setMaxZoom:Pe,setTranslateExtent:be,setNodeExtent:Oe,reset:ve}=Xe(hI,St),ye=bt();return q.useEffect(()=>{const qe=s==null?void 0:s.map(Ye=>({...Ye,...L}));return Fe(i,qe),()=>{ve()}},[]),De("defaultEdgeOptions",L,ye.setState),De("connectionMode",A,ye.setState),De("onConnect",o,ye.setState),De("onConnectStart",u,ye.setState),De("onConnectEnd",l,ye.setState),De("onClickConnectStart",c,ye.setState),De("onClickConnectEnd",d,ye.setState),De("nodesDraggable",h,ye.setState),De("nodesConnectable",p,ye.setState),De("nodesFocusable",m,ye.setState),De("edgesFocusable",y,ye.setState),De("edgesUpdatable",x,ye.setState),De("elementsSelectable",C,ye.setState),De("elevateNodesOnSelect",N,ye.setState),De("snapToGrid",I,ye.setState),De("snapGrid",P,ye.setState),De("onNodesChange",k,ye.setState),De("onEdgesChange",E,ye.setState),De("connectOnClick",R,ye.setState),De("fitViewOnInit",F,ye.setState),De("fitViewOnInitOptions",Q,ye.setState),De("onNodesDelete",X,ye.setState),De("onEdgesDelete",j,ye.setState),De("onNodeDrag",G,ye.setState),De("onNodeDragStart",U,ye.setState),De("onNodeDragStop",ne,ye.setState),De("onSelectionDrag",K,ye.setState),De("onSelectionDragStart",D,ye.setState),De("onSelectionDragStop",V,ye.setState),De("noPanClassName",O,ye.setState),De("nodeOrigin",B,ye.setState),De("rfId",ae,ye.setState),De("autoPanOnConnect",z,ye.setState),De("autoPanOnNodeDrag",W,ye.setState),De("onError",J,ye.setState),De("connectionRadius",se,ye.setState),De("isValidConnection",ue,ye.setState),De("nodeDragThreshold",he,ye.setState),gs(e,ge),gs(n,Me),gs(_,Re),gs(S,Pe),gs(M,be),gs(b,Oe),null},kw={display:"none"},mI={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},EE="react-flow__node-desc",NE="react-flow__edge-desc",gI="react-flow__aria-live",vI=e=>e.ariaLiveMessage;function yI({rfId:e}){const n=Xe(vI);return oe.createElement("div",{id:`${gI}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:mI},n)}function wI({rfId:e,disableKeyboardA11y:n}){return oe.createElement(oe.Fragment,null,oe.createElement("div",{id:`${EE}-${e}`,style:kw},"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:`${NE}-${e}`,style:kw},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!n&&oe.createElement(yI,{rfId:e}))}var qo=(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 h=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.split("+")),p=h.reduce((m,y)=>m.concat(...y),[]);return[h,p]}return[[],[]]},[e]);return q.useEffect(()=>{const d=typeof document<"u"?document:null,h=(n==null?void 0:n.target)||d;if(e!==null){const p=x=>{if(o.current=x.ctrlKey||x.metaKey||x.shiftKey,(!o.current||o.current&&!n.actInsideInputWithModifier)&&xg(x))return!1;const _=Nw(x.code,c);u.current.add(x[_]),Ew(l,u.current,!1)&&(x.preventDefault(),s(!0))},m=x=>{if((!o.current||o.current&&!n.actInsideInputWithModifier)&&xg(x))return!1;const _=Nw(x.code,c);Ew(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 h==null||h.addEventListener("keydown",p),h==null||h.addEventListener("keyup",m),window.addEventListener("blur",y),()=>{h==null||h.removeEventListener("keydown",p),h==null||h.removeEventListener("keyup",m),window.removeEventListener("blur",y)}}},[e,s]),i};function Ew(e,n,i){return e.filter(s=>i||s.length===n.size).some(s=>s.every(o=>n.has(o)))}function Nw(e,n){return n.includes(e)?"code":"key"}function CE(e,n,i,s){var c,d;const o=e.parentNode||e.parentId;if(!o)return i;const u=n.get(o),l=ji(u,s);return CE(u,n,{x:(i.x??0)+l.x,y:(i.y??0)+l.y,z:(((c=u[ht])==null?void 0:c.z)??0)>(i.z??0)?((d=u[ht])==null?void 0:d.z)??0:i.z??0},s)}function TE(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}=CE(s,e,{...s.position,z:((u=s[ht])==null?void 0:u.z)??0},n);s.positionAbsolute={x:l,y:c},s[ht].z=d,i!=null&&i[s.id]&&(s[ht].isParent=!0)}})}function Fc(e,n,i,s){const o=new Map,u={},l=s?1e3:0;return e.forEach(c=>{var x;const d=(jn(c.zIndex)?c.zIndex:0)+(c.selected?l:0),h=n.get(c.id),p={...c,positionAbsolute:{x:c.position.x,y:c.position.y}},m=c.parentNode||c.parentId;m&&(u[m]=!0);const y=(h==null?void 0:h.type)&&(h==null?void 0:h.type)!==c.type;Object.defineProperty(p,ht,{enumerable:!1,value:{handleBounds:y||(x=h==null?void 0:h[ht])==null?void 0:x.handleBounds,z:d}}),o.set(c.id,p)}),TE(o,i,u),o}function RE(e,n={}){const{getNodes:i,width:s,height:o,minZoom:u,maxZoom:l,d3Zoom:c,d3Selection:d,fitViewOnInitDone:h,fitViewOnInit:p,nodeOrigin:m}=e(),y=n.initial&&!h&&p;if(c&&d&&(y||!n.initial)){const N=i().filter(S=>{var k;const b=n.includeHiddenNodes?S.width&&S.height:!S.hidden;return(k=n.nodes)!=null&&k.length?b&&n.nodes.some(E=>E.id===S.id):b}),_=N.every(S=>S.width&&S.height);if(N.length>0&&_){const S=Iu(N,m),{x:b,y:k,zoom:E}=pE(S,s,o,n.minZoom??u,n.maxZoom??l,n.padding??.1),C=gr.translate(b,k).scale(E);return typeof n.duration=="number"&&n.duration>0?c.transform(Ni(d,n.duration),C):c.transform(d,C),!0}}return!1}function xI(e,n){return e.forEach(i=>{const s=n.get(i.id);s&&n.set(s.id,{...s,[ht]:s[ht],selected:i.selected})}),new Map(n)}function _I(e,n){return n.map(i=>{const s=e.find(o=>o.id===i.id);return s&&(i.selected=s.selected),i})}function ru({changedNodes:e,changedEdges:n,get:i,set:s}){const{nodeInternals:o,edges:u,onNodesChange:l,onEdgesChange:c,hasDefaultNodes:d,hasDefaultEdges:h}=i();e!=null&&e.length&&(d&&s({nodeInternals:xI(e,o)}),l==null||l(e)),n!=null&&n.length&&(h&&s({edges:_I(n,u)}),c==null||c(n))}const vs=()=>{},SI={zoomIn:vs,zoomOut:vs,zoomTo:vs,getZoom:()=>1,setViewport:vs,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:vs,fitBounds:vs,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},bI=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),kI=()=>{const e=bt(),{d3Zoom:n,d3Selection:i}=Xe(bI,St);return q.useMemo(()=>i&&n?{zoomIn:o=>n.scaleBy(Ni(i,o==null?void 0:o.duration),1.2),zoomOut:o=>n.scaleBy(Ni(i,o==null?void 0:o.duration),1/1.2),zoomTo:(o,u)=>n.scaleTo(Ni(i,u==null?void 0:u.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,u)=>{const[l,c,d]=e.getState().transform,h=gr.translate(o.x??l,o.y??c).scale(o.zoom??d);n.transform(Ni(i,u==null?void 0:u.duration),h)},getViewport:()=>{const[o,u,l]=e.getState().transform;return{x:o,y:u,zoom:l}},fitView:o=>RE(e.getState,o),setCenter:(o,u,l)=>{const{width:c,height:d,maxZoom:h}=e.getState(),p=typeof(l==null?void 0:l.zoom)<"u"?l.zoom:h,m=c/2-o*p,y=d/2-u*p,x=gr.translate(m,y).scale(p);n.transform(Ni(i,l==null?void 0:l.duration),x)},fitBounds:(o,u)=>{const{width:l,height:c,minZoom:d,maxZoom:h}=e.getState(),{x:p,y:m,zoom:y}=pE(o,l,c,d,h,(u==null?void 0:u.padding)??.1),x=gr.translate(p,m).scale(y);n.transform(Ni(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"),bg(o,u,l,c)},screenToFlowPosition:o=>{const{transform:u,snapToGrid:l,snapGrid:c,domNode:d}=e.getState();if(!d)return o;const{x:h,y:p}=d.getBoundingClientRect(),m={x:o.x-h,y:o.y-p};return bg(m,u,l,c)},flowToScreenPosition:o=>{const{transform:u,domNode:l}=e.getState();if(!l)return o;const{x:c,y:d}=l.getBoundingClientRect(),h=fE(o,u);return{x:h.x+c,y:h.y+d}},viewportInitialized:!0}:SI,[n,i])};function zo(){const e=kI(),n=bt(),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(b=>b.id===_)},[]),l=q.useCallback(_=>{const{getNodes:S,setNodes:b,hasDefaultNodes:k,onNodesChange:E}=n.getState(),C=S(),A=typeof _=="function"?_(C):_;if(k)b(A);else if(E){const P=A.length===0?C.map(I=>({type:"remove",id:I.id})):A.map(I=>({item:I,type:"reset"}));E(P)}},[]),c=q.useCallback(_=>{const{edges:S=[],setEdges:b,hasDefaultEdges:k,onEdgesChange:E}=n.getState(),C=typeof _=="function"?_(S):_;if(k)b(C);else if(E){const A=C.length===0?S.map(P=>({type:"remove",id:P.id})):C.map(P=>({item:P,type:"reset"}));E(A)}},[]),d=q.useCallback(_=>{const S=Array.isArray(_)?_:[_],{getNodes:b,setNodes:k,hasDefaultNodes:E,onNodesChange:C}=n.getState();if(E){const P=[...b(),...S];k(P)}else if(C){const A=S.map(P=>({item:P,type:"add"}));C(A)}},[]),h=q.useCallback(_=>{const S=Array.isArray(_)?_:[_],{edges:b=[],setEdges:k,hasDefaultEdges:E,onEdgesChange:C}=n.getState();if(E)k([...b,...S]);else if(C){const A=S.map(P=>({item:P,type:"add"}));C(A)}},[]),p=q.useCallback(()=>{const{getNodes:_,edges:S=[],transform:b}=n.getState(),[k,E,C]=b;return{nodes:_().map(A=>({...A})),edges:S.map(A=>({...A})),viewport:{x:k,y:E,zoom:C}}},[]),m=q.useCallback(({nodes:_,edges:S})=>{const{nodeInternals:b,getNodes:k,edges:E,hasDefaultNodes:C,hasDefaultEdges:A,onNodesDelete:P,onEdgesDelete:I,onNodesChange:M,onEdgesChange:R}=n.getState(),L=(_||[]).map(G=>G.id),F=(S||[]).map(G=>G.id),Q=k().reduce((G,U)=>{const ne=U.parentNode||U.parentId,K=!L.includes(U.id)&&ne&&G.find(V=>V.id===ne);return(typeof U.deletable=="boolean"?U.deletable:!0)&&(L.includes(U.id)||K)&&G.push(U),G},[]),X=E.filter(G=>typeof G.deletable=="boolean"?G.deletable:!0),j=X.filter(G=>F.includes(G.id));if(Q||j){const G=hE(Q,X),U=[...j,...G],ne=U.reduce((K,D)=>(K.includes(D.id)||K.push(D.id),K),[]);if((A||C)&&(A&&n.setState({edges:E.filter(K=>!ne.includes(K.id))}),C&&(Q.forEach(K=>{b.delete(K.id)}),n.setState({nodeInternals:new Map(b)}))),ne.length>0&&(I==null||I(U),R&&R(ne.map(K=>({id:K,type:"remove"})))),Q.length>0&&(P==null||P(Q),M)){const K=Q.map(D=>({id:D.id,type:"remove"}));M(K)}}},[]),y=q.useCallback(_=>{const S=HA(_),b=S?null:n.getState().nodeInternals.get(_.id);return!S&&!b?[null,null,S]:[S?_:vw(b),b,S]},[]),x=q.useCallback((_,S=!0,b)=>{const[k,E,C]=y(_);return k?(b||n.getState().getNodes()).filter(A=>{if(!C&&(A.id===E.id||!A.positionAbsolute))return!1;const P=vw(A),I=wg(P,k);return S&&I>0||I>=k.width*k.height}):[]},[]),N=q.useCallback((_,S,b=!0)=>{const[k]=y(_);if(!k)return!1;const E=wg(k,S);return b&&E>0||E>=k.width*k.height},[]);return q.useMemo(()=>({...e,getNodes:i,getNode:s,getEdges:o,getEdge:u,setNodes:l,setEdges:c,addNodes:d,addEdges:h,toObject:p,deleteElements:m,getIntersectingNodes:x,isNodeIntersecting:N}),[e,i,s,o,u,l,c,d,h,p,m,x,N])}const EI={actInsideInputWithModifier:!1};var NI=({deleteKeyCode:e,multiSelectionKeyCode:n})=>{const i=bt(),{deleteElements:s}=zo(),o=qo(e,EI),u=qo(n);q.useEffect(()=>{if(o){const{edges:l,getNodes:c}=i.getState(),d=c().filter(p=>p.selected),h=l.filter(p=>p.selected);s({nodes:d,edges:h}),i.setState({nodesSelectionActive:!1})}},[o]),q.useEffect(()=>{i.setState({multiSelectionActive:u})},[u])};function CI(e){const n=bt();q.useEffect(()=>{let i;const s=()=>{var u,l;if(!e.current)return;const o=zg(e.current);(o.height===0||o.width===0)&&((l=(u=n.getState()).onError)==null||l.call(u,"004",yr.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 Kg={position:"absolute",width:"100%",height:"100%",top:0,left:0},TI=(e,n)=>e.x!==n.x||e.y!==n.y||e.zoom!==n.k,iu=e=>({x:e.x,y:e.y,zoom:e.k}),ys=(e,n)=>e.target.closest(`.${n}`),Cw=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),Tw=e=>{const n=e.ctrlKey&&xu()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n},RI=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),jI=({onMove:e,onMoveStart:n,onMoveEnd:i,onPaneContextMenu:s,zoomOnScroll:o=!0,zoomOnPinch:u=!0,panOnScroll:l=!1,panOnScrollSpeed:c=.5,panOnScrollMode:d=Ti.Free,zoomOnDoubleClick:h=!0,elementsSelectable:p,panOnDrag:m=!0,defaultViewport:y,translateExtent:x,minZoom:N,maxZoom:_,zoomActivationKeyCode:S,preventScrolling:b=!0,children:k,noWheelClassName:E,noPanClassName:C})=>{const A=q.useRef(),P=bt(),I=q.useRef(!1),M=q.useRef(!1),R=q.useRef(null),L=q.useRef({x:0,y:0,zoom:0}),{d3Zoom:F,d3Selection:Q,d3ZoomHandler:X,userSelectionActive:j}=Xe(RI,St),G=qo(S),U=q.useRef(0),ne=q.useRef(!1),K=q.useRef();return CI(R),q.useEffect(()=>{if(R.current){const D=R.current.getBoundingClientRect(),V=Jk().scaleExtent([N,_]).translateExtent(x),O=Rn(R.current).call(V),B=gr.translate(y.x,y.y).scale(js(y.zoom,N,_)),ae=[[0,0],[D.width,D.height]],z=V.constrain()(B,ae,x);V.transform(O,z),V.wheelDelta(Tw),P.setState({d3Zoom:V,d3Selection:O,d3ZoomHandler:O.on("wheel.zoom"),transform:[z.x,z.y,z.k],domNode:R.current.closest(".react-flow")})}},[]),q.useEffect(()=>{Q&&F&&(l&&!G&&!j?Q.on("wheel.zoom",D=>{if(ys(D,E))return!1;D.preventDefault(),D.stopImmediatePropagation();const V=Q.property("__zoom").k||1;if(D.ctrlKey&&u){const ue=Bn(D),he=Tw(D),ge=V*Math.pow(2,he);F.scaleTo(Q,ge,ue,D);return}const O=D.deltaMode===1?20:1;let B=d===Ti.Vertical?0:D.deltaX*O,ae=d===Ti.Horizontal?0:D.deltaY*O;!xu()&&D.shiftKey&&d!==Ti.Vertical&&(B=D.deltaY*O,ae=0),F.translateBy(Q,-(B/V)*c,-(ae/V)*c,{internal:!0});const z=iu(Q.property("__zoom")),{onViewportChangeStart:W,onViewportChange:J,onViewportChangeEnd:se}=P.getState();clearTimeout(K.current),ne.current||(ne.current=!0,n==null||n(D,z),W==null||W(z)),ne.current&&(e==null||e(D,z),J==null||J(z),K.current=setTimeout(()=>{i==null||i(D,z),se==null||se(z),ne.current=!1},150))},{passive:!1}):typeof X<"u"&&Q.on("wheel.zoom",function(D,V){if(!b&&D.type==="wheel"&&!D.ctrlKey||ys(D,E))return null;D.preventDefault(),X.call(this,D,V)},{passive:!1}))},[j,l,d,Q,F,X,G,u,b,E,n,e,i]),q.useEffect(()=>{F&&F.on("start",D=>{var B,ae;if(!D.sourceEvent||D.sourceEvent.internal)return null;U.current=(B=D.sourceEvent)==null?void 0:B.button;const{onViewportChangeStart:V}=P.getState(),O=iu(D.transform);I.current=!0,L.current=O,((ae=D.sourceEvent)==null?void 0:ae.type)==="mousedown"&&P.setState({paneDragging:!0}),V==null||V(O),n==null||n(D.sourceEvent,O)})},[F,n]),q.useEffect(()=>{F&&(j&&!I.current?F.on("zoom",null):j||F.on("zoom",D=>{var O;const{onViewportChange:V}=P.getState();if(P.setState({transform:[D.transform.x,D.transform.y,D.transform.k]}),M.current=!!(s&&Cw(m,U.current??0)),(e||V)&&!((O=D.sourceEvent)!=null&&O.internal)){const B=iu(D.transform);V==null||V(B),e==null||e(D.sourceEvent,B)}}))},[j,F,e,m,s]),q.useEffect(()=>{F&&F.on("end",D=>{if(!D.sourceEvent||D.sourceEvent.internal)return null;const{onViewportChangeEnd:V}=P.getState();if(I.current=!1,P.setState({paneDragging:!1}),s&&Cw(m,U.current??0)&&!M.current&&s(D.sourceEvent),M.current=!1,(i||V)&&TI(L.current,D.transform)){const O=iu(D.transform);L.current=O,clearTimeout(A.current),A.current=setTimeout(()=>{V==null||V(O),i==null||i(D.sourceEvent,O)},l?150:0)}})},[F,l,m,i,s]),q.useEffect(()=>{F&&F.filter(D=>{const V=G||o,O=u&&D.ctrlKey;if((m===!0||Array.isArray(m)&&m.includes(1))&&D.button===1&&D.type==="mousedown"&&(ys(D,"react-flow__node")||ys(D,"react-flow__edge")))return!0;if(!m&&!V&&!l&&!h&&!u||j||!h&&D.type==="dblclick"||ys(D,E)&&D.type==="wheel"||ys(D,C)&&(D.type!=="wheel"||l&&D.type==="wheel"&&!G)||!u&&D.ctrlKey&&D.type==="wheel"||!V&&!l&&!O&&D.type==="wheel"||!m&&(D.type==="mousedown"||D.type==="touchstart")||Array.isArray(m)&&!m.includes(D.button)&&D.type==="mousedown")return!1;const B=Array.isArray(m)&&m.includes(D.button)||!D.button||D.button<=1;return(!D.ctrlKey||D.type==="wheel")&&B})},[j,F,o,u,l,h,m,p,G]),oe.createElement("div",{className:"react-flow__renderer",ref:R,style:Kg},k)},AI=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function II(){const{userSelectionActive:e,userSelectionRect:n}=Xe(AI,St);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 Rw(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 MI(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&&Rw(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&&Rw(s,l);break}case"remove":return s}return s.push(l),s},i)}function PI(e,n){return MI(e,n)}const Xr=(e,n)=>({id:e,type:"select",selected:n});function _s(e,n){return e.reduce((i,s)=>{const o=n.includes(s.id);return!s.selected&&o?(s.selected=!0,i.push(Xr(s.id,!0))):s.selected&&!o&&(s.selected=!1,i.push(Xr(s.id,!1))),i},[])}const zc=(e,n)=>i=>{i.target===n.current&&(e==null||e(i))},OI=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),jE=q.memo(({isSelecting:e,selectionMode:n=Oo.Full,panOnDrag:i,onSelectionStart:s,onSelectionEnd:o,onPaneClick:u,onPaneContextMenu:l,onPaneScroll:c,onPaneMouseEnter:d,onPaneMouseMove:h,onPaneMouseLeave:p,children:m})=>{const y=q.useRef(null),x=bt(),N=q.useRef(0),_=q.useRef(0),S=q.useRef(),{userSelectionActive:b,elementsSelectable:k,dragging:E}=Xe(OI,St),C=()=>{x.setState({userSelectionActive:!1,userSelectionRect:null}),N.current=0,_.current=0},A=X=>{u==null||u(X),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},P=X=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){X.preventDefault();return}l==null||l(X)},I=c?X=>c(X):void 0,M=X=>{const{resetSelectedElements:j,domNode:G}=x.getState();if(S.current=G==null?void 0:G.getBoundingClientRect(),!k||!e||X.button!==0||X.target!==y.current||!S.current)return;const{x:U,y:ne}=Zr(X,S.current);j(),x.setState({userSelectionRect:{width:0,height:0,startX:U,startY:ne,x:U,y:ne}}),s==null||s(X)},R=X=>{const{userSelectionRect:j,nodeInternals:G,edges:U,transform:ne,onNodesChange:K,onEdgesChange:D,nodeOrigin:V,getNodes:O}=x.getState();if(!e||!S.current||!j)return;x.setState({userSelectionActive:!0,nodesSelectionActive:!1});const B=Zr(X,S.current),ae=j.startX??0,z=j.startY??0,W={...j,x:B.x<ae?B.x:ae,y:B.y<z?B.y:z,width:Math.abs(B.x-ae),height:Math.abs(B.y-z)},J=O(),se=dE(G,W,ne,n===Oo.Partial,!0,V),ue=hE(se,U).map(ge=>ge.id),he=se.map(ge=>ge.id);if(N.current!==he.length){N.current=he.length;const ge=_s(J,he);ge.length&&(K==null||K(ge))}if(_.current!==ue.length){_.current=ue.length;const ge=_s(U,ue);ge.length&&(D==null||D(ge))}x.setState({userSelectionRect:W})},L=X=>{if(X.button!==0)return;const{userSelectionRect:j}=x.getState();!b&&j&&X.target===y.current&&(A==null||A(X)),x.setState({nodesSelectionActive:N.current>0}),C(),o==null||o(X)},F=X=>{b&&(x.setState({nodesSelectionActive:N.current>0}),o==null||o(X)),C()},Q=k&&(e||b);return oe.createElement("div",{className:qt(["react-flow__pane",{dragging:E,selection:e}]),onClick:Q?void 0:zc(A,y),onContextMenu:zc(P,y),onWheel:zc(I,y),onMouseEnter:Q?void 0:d,onMouseDown:Q?M:void 0,onMouseMove:Q?R:h,onMouseUp:Q?L:void 0,onMouseLeave:Q?F:p,ref:y,style:Kg},m,oe.createElement(II,null))});jE.displayName="Pane";function AE(e,n){const i=e.parentNode||e.parentId;if(!i)return!1;const s=n.get(i);return s?s.selected?!0:AE(s,n):!1}function jw(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 qI(e,n,i,s){return Array.from(e.values()).filter(o=>(o.selected||o.id===s)&&(!o.parentNode||o.parentId||!AE(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 LI(e,n){return!n||n==="parent"?n:[n[0],[n[1][0]-(e.width||0),n[1][1]-(e.height||0)]]}function IE(e,n,i,s,o=[0,0],u){const l=LI(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}=ji(m,o).positionAbsolute;c=m&&jn(y)&&jn(x)&&jn(m.width)&&jn(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",yr.error005()),c=l;else if(e.extent&&d&&e.extent!=="parent"){const m=i.get(d),{x:y,y:x}=ji(m,o).positionAbsolute;c=[[e.extent[0][0]+y,e.extent[0][1]+x],[e.extent[1][0]+y,e.extent[1][1]+x]]}let h={x:0,y:0};if(d){const m=i.get(d);h=ji(m,o).positionAbsolute}const p=c&&c!=="parent"?Bg(n,c):n;return{position:{x:p.x-h.x,y:p.y-h.y},positionAbsolute:p}}function Bc({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 Aw=(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 h=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),position:d.getAttribute("data-handlepos"),x:(h.left-l.left-c.x)/i,y:(h.top-l.top-c.y)/i,...zg(d)}})};function xo(e,n,i){return i===void 0?i:s=>{const o=n().nodeInternals.get(e);o&&i(s,{...o})}}function Eg({id:e,store:n,unselect:i=!1,nodeRef:s}){const{addSelectedNodes:o,unselectNodesAndEdges:u,multiSelectionActive:l,nodeInternals:c,onError:d}=n.getState(),h=c.get(e);if(!h){d==null||d("012",yr.error012(e));return}n.setState({nodesSelectionActive:!1}),h.selected?(i||h.selected&&l)&&(u({nodes:[h],edges:[]}),requestAnimationFrame(()=>{var p;return(p=s==null?void 0:s.current)==null?void 0:p.blur()})):o([e])}function $I(){const e=bt();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 Uc(e){return(n,i,s)=>e==null?void 0:e(n,s)}function ME({nodeRef:e,disabled:n=!1,noDragClassName:i,handleSelector:s,nodeId:o,isSelectable:u,selectNodesOnDrag:l}){const c=bt(),[d,h]=q.useState(!1),p=q.useRef([]),m=q.useRef({x:null,y:null}),y=q.useRef(0),x=q.useRef(null),N=q.useRef({x:0,y:0}),_=q.useRef(null),S=q.useRef(!1),b=q.useRef(!1),k=q.useRef(!1),E=$I();return q.useEffect(()=>{if(e!=null&&e.current){const C=Rn(e.current),A=({x:M,y:R})=>{const{nodeInternals:L,onNodeDrag:F,onSelectionDrag:Q,updateNodePositions:X,nodeExtent:j,snapGrid:G,snapToGrid:U,nodeOrigin:ne,onError:K}=c.getState();m.current={x:M,y:R};let D=!1,V={x:0,y:0,x2:0,y2:0};if(p.current.length>1&&j){const B=Iu(p.current,ne);V=Po(B)}if(p.current=p.current.map(B=>{const ae={x:M-B.distance.x,y:R-B.distance.y};U&&(ae.x=G[0]*Math.round(ae.x/G[0]),ae.y=G[1]*Math.round(ae.y/G[1]));const z=[[j[0][0],j[0][1]],[j[1][0],j[1][1]]];p.current.length>1&&j&&!B.extent&&(z[0][0]=B.positionAbsolute.x-V.x+j[0][0],z[1][0]=B.positionAbsolute.x+(B.width??0)-V.x2+j[1][0],z[0][1]=B.positionAbsolute.y-V.y+j[0][1],z[1][1]=B.positionAbsolute.y+(B.height??0)-V.y2+j[1][1]);const W=IE(B,ae,L,z,ne,K);return D=D||B.position.x!==W.position.x||B.position.y!==W.position.y,B.position=W.position,B.positionAbsolute=W.positionAbsolute,B}),!D)return;X(p.current,!0,!0),h(!0);const O=o?F:Uc(Q);if(O&&_.current){const[B,ae]=Bc({nodeId:o,dragItems:p.current,nodeInternals:L});O(_.current,B,ae)}},P=()=>{if(!x.current)return;const[M,R]=tE(N.current,x.current);if(M!==0||R!==0){const{transform:L,panBy:F}=c.getState();m.current.x=(m.current.x??0)-M/L[2],m.current.y=(m.current.y??0)-R/L[2],F({x:M,y:R})&&A(m.current)}y.current=requestAnimationFrame(P)},I=M=>{var ne;const{nodeInternals:R,multiSelectionActive:L,nodesDraggable:F,unselectNodesAndEdges:Q,onNodeDragStart:X,onSelectionDragStart:j}=c.getState();b.current=!0;const G=o?X:Uc(j);(!l||!u)&&!L&&o&&((ne=R.get(o))!=null&&ne.selected||Q()),o&&u&&l&&Eg({id:o,store:c,nodeRef:e});const U=E(M);if(m.current=U,p.current=qI(R,F,U,o),G&&p.current){const[K,D]=Bc({nodeId:o,dragItems:p.current,nodeInternals:R});G(M.sourceEvent,K,D)}};if(n)C.on(".drag",null);else{const M=Y2().on("start",R=>{const{domNode:L,nodeDragThreshold:F}=c.getState();F===0&&I(R),k.current=!1;const Q=E(R);m.current=Q,x.current=(L==null?void 0:L.getBoundingClientRect())||null,N.current=Zr(R.sourceEvent,x.current)}).on("drag",R=>{var X,j;const L=E(R),{autoPanOnNodeDrag:F,nodeDragThreshold:Q}=c.getState();if(R.sourceEvent.type==="touchmove"&&R.sourceEvent.touches.length>1&&(k.current=!0),!k.current){if(!S.current&&b.current&&F&&(S.current=!0,P()),!b.current){const G=L.xSnapped-(((X=m==null?void 0:m.current)==null?void 0:X.x)??0),U=L.ySnapped-(((j=m==null?void 0:m.current)==null?void 0:j.y)??0);Math.sqrt(G*G+U*U)>Q&&I(R)}(m.current.x!==L.xSnapped||m.current.y!==L.ySnapped)&&p.current&&b.current&&(_.current=R.sourceEvent,N.current=Zr(R.sourceEvent,x.current),A(L))}}).on("end",R=>{if(!(!b.current||k.current)&&(h(!1),S.current=!1,b.current=!1,cancelAnimationFrame(y.current),p.current)){const{updateNodePositions:L,nodeInternals:F,onNodeDragStop:Q,onSelectionDragStop:X}=c.getState(),j=o?Q:Uc(X);if(L(p.current,!1,!1),j){const[G,U]=Bc({nodeId:o,dragItems:p.current,nodeInternals:F});j(R.sourceEvent,G,U)}}}).filter(R=>{const L=R.target;return!R.button&&(!i||!jw(L,`.${i}`,e))&&(!s||jw(L,s,e))});return C.call(M),()=>{C.on(".drag",null)}}}},[e,n,i,s,u,c,o,l,E]),d}function PE(){const e=bt();return q.useCallback(i=>{const{nodeInternals:s,nodeExtent:o,updateNodePositions:u,getNodes:l,snapToGrid:c,snapGrid:d,onError:h,nodesDraggable:p}=e.getState(),m=l().filter(k=>k.selected&&(k.draggable||p&&typeof k.draggable>"u")),y=c?d[0]:5,x=c?d[1]:5,N=i.isShiftPressed?4:1,_=i.x*y*N,S=i.y*x*N,b=m.map(k=>{if(k.positionAbsolute){const E={x:k.positionAbsolute.x+_,y:k.positionAbsolute.y+S};c&&(E.x=d[0]*Math.round(E.x/d[0]),E.y=d[1]*Math.round(E.y/d[1]));const{positionAbsolute:C,position:A}=IE(k,E,s,o,void 0,h);k.position=A,k.positionAbsolute=C}return k});u(b,!0,!1)},[])}const Es={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var _o=e=>{const n=({id:i,type:s,data:o,xPos:u,yPos:l,xPosOrigin:c,yPosOrigin:d,selected:h,onClick:p,onMouseEnter:m,onMouseMove:y,onMouseLeave:x,onContextMenu:N,onDoubleClick:_,style:S,className:b,isDraggable:k,isSelectable:E,isConnectable:C,isFocusable:A,selectNodesOnDrag:P,sourcePosition:I,targetPosition:M,hidden:R,resizeObserver:L,dragHandle:F,zIndex:Q,isParent:X,noDragClassName:j,noPanClassName:G,initialized:U,disableKeyboardA11y:ne,ariaLabel:K,rfId:D,hasHandleBounds:V})=>{const O=bt(),B=q.useRef(null),ae=q.useRef(null),z=q.useRef(I),W=q.useRef(M),J=q.useRef(s),se=E||k||p||m||y||x,ue=PE(),he=xo(i,O.getState,m),ge=xo(i,O.getState,y),Me=xo(i,O.getState,x),Fe=xo(i,O.getState,N),Re=xo(i,O.getState,_),Pe=ve=>{const{nodeDragThreshold:ye}=O.getState();if(E&&(!P||!k||ye>0)&&Eg({id:i,store:O,nodeRef:B}),p){const qe=O.getState().nodeInternals.get(i);qe&&p(ve,{...qe})}},be=ve=>{if(!xg(ve)&&!ne)if(sE.includes(ve.key)&&E){const ye=ve.key==="Escape";Eg({id:i,store:O,unselect:ye,nodeRef:B})}else k&&h&&Object.prototype.hasOwnProperty.call(Es,ve.key)&&(O.setState({ariaLiveMessage:`Moved selected node ${ve.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~u}, y: ${~~l}`}),ue({x:Es[ve.key].x,y:Es[ve.key].y,isShiftPressed:ve.shiftKey}))};q.useEffect(()=>()=>{ae.current&&(L==null||L.unobserve(ae.current),ae.current=null)},[]),q.useEffect(()=>{if(B.current&&!R){const ve=B.current;(!U||!V||ae.current!==ve)&&(ae.current&&(L==null||L.unobserve(ae.current)),L==null||L.observe(ve),ae.current=ve)}},[R,U,V]),q.useEffect(()=>{const ve=J.current!==s,ye=z.current!==I,qe=W.current!==M;B.current&&(ve||ye||qe)&&(ve&&(J.current=s),ye&&(z.current=I),qe&&(W.current=M),O.getState().updateNodeDimensions([{id:i,nodeElement:B.current,forceUpdate:!0}]))},[i,s,I,M]);const Oe=ME({nodeRef:B,disabled:R||!k,noDragClassName:j,handleSelector:F,nodeId:i,isSelectable:E,selectNodesOnDrag:P});return R?null:oe.createElement("div",{className:qt(["react-flow__node",`react-flow__node-${s}`,{[G]:k},b,{selected:h,selectable:E,parent:X,dragging:Oe}]),ref:B,style:{zIndex:Q,transform:`translate(${c}px,${d}px)`,pointerEvents:se?"all":"none",visibility:U?"visible":"hidden",...S},"data-id":i,"data-testid":`rf__node-${i}`,onMouseEnter:he,onMouseMove:ge,onMouseLeave:Me,onContextMenu:Fe,onClick:Pe,onDoubleClick:Re,onKeyDown:A?be:void 0,tabIndex:A?0:void 0,role:A?"button":void 0,"aria-describedby":ne?void 0:`${EE}-${D}`,"aria-label":K},oe.createElement(QA,{value:i},oe.createElement(e,{id:i,data:o,type:s,xPos:u,yPos:l,selected:h,isConnectable:C,sourcePosition:I,targetPosition:M,dragging:Oe,dragHandle:F,zIndex:Q})))};return n.displayName="NodeWrapper",q.memo(n)};const DI=e=>{const n=e.getNodes().filter(i=>i.selected);return{...Iu(n,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function FI({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:i}){const s=bt(),{width:o,height:u,x:l,y:c,transformString:d,userSelectionActive:h}=Xe(DI,St),p=PE(),m=q.useRef(null);if(q.useEffect(()=>{var N;i||(N=m.current)==null||N.focus({preventScroll:!0})},[i]),ME({nodeRef:m}),h||!o||!u)return null;const y=e?N=>{const _=s.getState().getNodes().filter(S=>S.selected);e(N,_)}:void 0,x=N=>{Object.prototype.hasOwnProperty.call(Es,N.key)&&p({x:Es[N.key].x,y:Es[N.key].y,isShiftPressed:N.shiftKey})};return oe.createElement("div",{className:qt(["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 zI=q.memo(FI);const BI=e=>e.nodesSelectionActive,OE=({children:e,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:u,onPaneScroll:l,deleteKeyCode:c,onMove:d,onMoveStart:h,onMoveEnd:p,selectionKeyCode:m,selectionOnDrag:y,selectionMode:x,onSelectionStart:N,onSelectionEnd:_,multiSelectionKeyCode:S,panActivationKeyCode:b,zoomActivationKeyCode:k,elementsSelectable:E,zoomOnScroll:C,zoomOnPinch:A,panOnScroll:P,panOnScrollSpeed:I,panOnScrollMode:M,zoomOnDoubleClick:R,panOnDrag:L,defaultViewport:F,translateExtent:Q,minZoom:X,maxZoom:j,preventScrolling:G,onSelectionContextMenu:U,noWheelClassName:ne,noPanClassName:K,disableKeyboardA11y:D})=>{const V=Xe(BI),O=qo(m),B=qo(b),ae=B||L,z=B||P,W=O||y&&ae!==!0;return NI({deleteKeyCode:c,multiSelectionKeyCode:S}),oe.createElement(jI,{onMove:d,onMoveStart:h,onMoveEnd:p,onPaneContextMenu:u,elementsSelectable:E,zoomOnScroll:C,zoomOnPinch:A,panOnScroll:z,panOnScrollSpeed:I,panOnScrollMode:M,zoomOnDoubleClick:R,panOnDrag:!O&&ae,defaultViewport:F,translateExtent:Q,minZoom:X,maxZoom:j,zoomActivationKeyCode:k,preventScrolling:G,noWheelClassName:ne,noPanClassName:K},oe.createElement(jE,{onSelectionStart:N,onSelectionEnd:_,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:u,onPaneScroll:l,panOnDrag:ae,isSelecting:!!W,selectionMode:x},e,V&&oe.createElement(zI,{onSelectionContextMenu:U,noPanClassName:K,disableKeyboardA11y:D})))};OE.displayName="FlowRenderer";var UI=q.memo(OE);function HI(e){return Xe(q.useCallback(i=>e?dE(i.nodeInternals,{x:0,y:0,width:i.width,height:i.height},i.transform,!0):i.getNodes(),[e]))}function VI(e){const n={input:_o(e.input||_E),default:_o(e.default||kg),output:_o(e.output||bE),group:_o(e.group||Yg)},i={},s=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,u)=>(o[u]=_o(e[u]||kg),o),i);return{...n,...s}}const WI=({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]},GI=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),qE=e=>{const{nodesDraggable:n,nodesConnectable:i,nodesFocusable:s,elementsSelectable:o,updateNodeDimensions:u,onError:l}=Xe(GI,St),c=HI(e.onlyRenderVisibleElements),d=q.useRef(),h=q.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const p=new ResizeObserver(m=>{const y=m.map(x=>({id:x.target.getAttribute("data-id"),nodeElement:x.target,forceUpdate:!0}));u(y)});return d.current=p,p},[]);return q.useEffect(()=>()=>{var p;(p=d==null?void 0:d.current)==null||p.disconnect()},[]),oe.createElement("div",{className:"react-flow__nodes",style:Kg},c.map(p=>{var A,P,I;let m=p.type||"default";e.nodeTypes[m]||(l==null||l("003",yr.error003(m)),m="default");const y=e.nodeTypes[m]||e.nodeTypes.default,x=!!(p.draggable||n&&typeof p.draggable>"u"),N=!!(p.selectable||o&&typeof p.selectable>"u"),_=!!(p.connectable||i&&typeof p.connectable>"u"),S=!!(p.focusable||s&&typeof p.focusable>"u"),b=e.nodeExtent?Bg(p.positionAbsolute,e.nodeExtent):p.positionAbsolute,k=(b==null?void 0:b.x)??0,E=(b==null?void 0:b.y)??0,C=WI({x:k,y:E,width:p.width??0,height:p.height??0,origin:e.nodeOrigin});return oe.createElement(y,{key:p.id,id:p.id,className:p.className,style:p.style,type:m,data:p.data,sourcePosition:p.sourcePosition||Ce.Bottom,targetPosition:p.targetPosition||Ce.Top,hidden:p.hidden,xPos:k,yPos:E,xPosOrigin:C.x,yPosOrigin:C.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!p.selected,isDraggable:x,isSelectable:N,isConnectable:_,isFocusable:S,resizeObserver:h,dragHandle:p.dragHandle,zIndex:((A=p[ht])==null?void 0:A.z)??0,isParent:!!((P=p[ht])!=null&&P.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!p.width&&!!p.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:p.ariaLabel,hasHandleBounds:!!((I=p[ht])!=null&&I.handleBounds)})}))};qE.displayName="NodeRenderer";var YI=q.memo(qE);const KI=(e,n,i)=>i===Ce.Left?e-n:i===Ce.Right?e+n:e,XI=(e,n,i)=>i===Ce.Top?e-n:i===Ce.Bottom?e+n:e,Iw="react-flow__edgeupdater",Mw=({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:qt([Iw,`${Iw}-${c}`]),cx:KI(n,s,e),cy:XI(i,s,e),r:s,stroke:"transparent",fill:"transparent"}),QI=()=>!0;var ws=e=>{const n=({id:i,className:s,type:o,data:u,onClick:l,onEdgeDoubleClick:c,selected:d,animated:h,label:p,labelStyle:m,labelShowBg:y,labelBgStyle:x,labelBgPadding:N,labelBgBorderRadius:_,style:S,source:b,target:k,sourceX:E,sourceY:C,targetX:A,targetY:P,sourcePosition:I,targetPosition:M,elementsSelectable:R,hidden:L,sourceHandleId:F,targetHandleId:Q,onContextMenu:X,onMouseEnter:j,onMouseMove:G,onMouseLeave:U,reconnectRadius:ne,onReconnect:K,onReconnectStart:D,onReconnectEnd:V,markerEnd:O,markerStart:B,rfId:ae,ariaLabel:z,isFocusable:W,isReconnectable:J,pathOptions:se,interactionWidth:ue,disableKeyboardA11y:he})=>{const ge=q.useRef(null),[Me,Fe]=q.useState(!1),[Re,Pe]=q.useState(!1),be=bt(),Oe=q.useMemo(()=>`url('#${Sg(B,ae)}')`,[B,ae]),ve=q.useMemo(()=>`url('#${Sg(O,ae)}')`,[O,ae]);if(L)return null;const ye=We=>{var wt;const{edges:Et,addSelectedEdges:Ge,unselectNodesAndEdges:ft,multiSelectionActive:on}=be.getState(),Lt=Et.find(an=>an.id===i);Lt&&(R&&(be.setState({nodesSelectionActive:!1}),Lt.selected&&on?(ft({nodes:[],edges:[Lt]}),(wt=ge.current)==null||wt.blur()):Ge([i])),l&&l(We,Lt))},qe=wo(i,be.getState,c),Ye=wo(i,be.getState,X),Qe=wo(i,be.getState,j),et=wo(i,be.getState,G),Be=wo(i,be.getState,U),Ze=(We,Et)=>{if(We.button!==0)return;const{edges:Ge,isValidConnection:ft}=be.getState(),on=Et?k:b,Lt=(Et?Q:F)||null,wt=Et?"target":"source",an=ft||QI,Bt=Et,vn=Ge.find(wn=>wn.id===i);Pe(!0),D==null||D(We,vn,wt);const un=wn=>{Pe(!1),V==null||V(wn,vn,wt)};vE({event:We,handleId:Lt,nodeId:on,onConnect:wn=>K==null?void 0:K(vn,wn),isTarget:Bt,getState:be.getState,setState:be.setState,isValidConnection:an,edgeUpdaterType:wt,onReconnectEnd:un})},At=We=>Ze(We,!0),Vt=We=>Ze(We,!1),It=()=>Fe(!0),pt=()=>Fe(!1),tt=!R&&!l,kt=We=>{var Et;if(!he&&sE.includes(We.key)&&R){const{unselectNodesAndEdges:Ge,addSelectedEdges:ft,edges:on}=be.getState();We.key==="Escape"?((Et=ge.current)==null||Et.blur(),Ge({edges:[on.find(wt=>wt.id===i)]})):ft([i])}};return oe.createElement("g",{className:qt(["react-flow__edge",`react-flow__edge-${o}`,s,{selected:d,animated:h,inactive:tt,updating:Me}]),onClick:ye,onDoubleClick:qe,onContextMenu:Ye,onMouseEnter:Qe,onMouseMove:et,onMouseLeave:Be,onKeyDown:W?kt:void 0,tabIndex:W?0:void 0,role:W?"button":"img","data-testid":`rf__edge-${i}`,"aria-label":z===null?void 0:z||`Edge from ${b} to ${k}`,"aria-describedby":W?`${NE}-${ae}`:void 0,ref:ge},!Re&&oe.createElement(e,{id:i,source:b,target:k,selected:d,animated:h,label:p,labelStyle:m,labelShowBg:y,labelBgStyle:x,labelBgPadding:N,labelBgBorderRadius:_,data:u,style:S,sourceX:E,sourceY:C,targetX:A,targetY:P,sourcePosition:I,targetPosition:M,sourceHandleId:F,targetHandleId:Q,markerStart:Oe,markerEnd:ve,pathOptions:se,interactionWidth:ue}),J&&oe.createElement(oe.Fragment,null,(J==="source"||J===!0)&&oe.createElement(Mw,{position:I,centerX:E,centerY:C,radius:ne,onMouseDown:At,onMouseEnter:It,onMouseOut:pt,type:"source"}),(J==="target"||J===!0)&&oe.createElement(Mw,{position:M,centerX:A,centerY:P,radius:ne,onMouseDown:Vt,onMouseEnter:It,onMouseOut:pt,type:"target"})))};return n.displayName="EdgeWrapper",q.memo(n)};function ZI(e){const n={default:ws(e.default||Su),straight:ws(e.bezier||Vg),step:ws(e.step||Hg),smoothstep:ws(e.step||Au),simplebezier:ws(e.simplebezier||Ug)},i={},s=Object.keys(e).filter(o=>!["default","bezier"].includes(o)).reduce((o,u)=>(o[u]=ws(e[u]||Su),o),i);return{...n,...s}}function Pw(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 Ow(e,n){return e?e.length===1||!n?e[0]:n&&e.find(i=>i.id===n)||null:null}const JI=(e,n,i,s,o,u)=>{const l=Pw(i,e,n),c=Pw(u,s,o);return{sourceX:l.x,sourceY:l.y,targetX:c.x,targetY:c.y}};function eM({sourcePos:e,targetPos:n,sourceWidth:i,sourceHeight:s,targetWidth:o,targetHeight:u,width:l,height:c,transform:d}){const h={x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x+i,n.x+o),y2:Math.max(e.y+s,n.y+u)};h.x===h.x2&&(h.x2+=1),h.y===h.y2&&(h.y2+=1);const p=Po({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(p.x2,h.x2)-Math.max(p.x,h.x)),y=Math.max(0,Math.min(p.y2,h.y2)-Math.max(p.y,h.y));return Math.ceil(m*y)>0}function qw(e){var s,o,u,l,c;const n=((s=e==null?void 0:e[ht])==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 tM=[{level:0,isMaxLevel:!0,edges:[]}];function nM(e,n,i=!1){let s=-1;const o=e.reduce((l,c)=>{var p,m;const d=jn(c.zIndex);let h=d?c.zIndex:0;if(i){const y=n.get(c.target),x=n.get(c.source),N=c.selected||(y==null?void 0:y.selected)||(x==null?void 0:x.selected),_=Math.max(((p=x==null?void 0:x[ht])==null?void 0:p.z)||0,((m=y==null?void 0:y[ht])==null?void 0:m.z)||0,1e3);h=(d?c.zIndex:0)+(N?_:0)}return l[h]?l[h].push(c):l[h]=[c],s=h>s?h:s,l},{}),u=Object.entries(o).map(([l,c])=>{const d=+l;return{edges:c,level:d,isMaxLevel:d===s}});return u.length===0?tM:u}function rM(e,n,i){const s=Xe(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)&&eM({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 nM(s,n,i)}const iM=({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"}),sM=({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"}),Lw={[_u.Arrow]:iM,[_u.ArrowClosed]:sM};function oM(e){const n=bt();return q.useMemo(()=>{var o,u;return Object.prototype.hasOwnProperty.call(Lw,e)?Lw[e]:((u=(o=n.getState()).onError)==null||u.call(o,"009",yr.error009(e)),null)},[e])}const aM=({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=oM(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},uM=({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=Sg(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))},LE=({defaultColor:e,rfId:n})=>{const i=Xe(q.useCallback(uM({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(aM,{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})))};LE.displayName="MarkerDefinitions";var lM=q.memo(LE);const cM=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}),$E=({defaultMarkerColor:e,onlyRenderVisibleElements:n,elevateEdgesOnSelect:i,rfId:s,edgeTypes:o,noPanClassName:u,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:d,onEdgeMouseLeave:h,onEdgeClick:p,onEdgeDoubleClick:m,onReconnect:y,onReconnectStart:x,onReconnectEnd:N,reconnectRadius:_,children:S,disableKeyboardA11y:b})=>{const{edgesFocusable:k,edgesUpdatable:E,elementsSelectable:C,width:A,height:P,connectionMode:I,nodeInternals:M,onError:R}=Xe(cM,St),L=rM(n,M,i);return A?oe.createElement(oe.Fragment,null,L.map(({level:F,edges:Q,isMaxLevel:X})=>oe.createElement("svg",{key:F,style:{zIndex:F},width:A,height:P,className:"react-flow__edges react-flow__container"},X&&oe.createElement(lM,{defaultColor:e,rfId:s}),oe.createElement("g",null,Q.map(j=>{const[G,U,ne]=qw(M.get(j.source)),[K,D,V]=qw(M.get(j.target));if(!ne||!V)return null;let O=j.type||"default";o[O]||(R==null||R("011",yr.error011(O)),O="default");const B=o[O]||o.default,ae=I===Mi.Strict?D.target:(D.target??[]).concat(D.source??[]),z=Ow(U.source,j.sourceHandle),W=Ow(ae,j.targetHandle),J=(z==null?void 0:z.position)||Ce.Bottom,se=(W==null?void 0:W.position)||Ce.Top,ue=!!(j.focusable||k&&typeof j.focusable>"u"),he=j.reconnectable||j.updatable,ge=typeof y<"u"&&(he||E&&typeof he>"u");if(!z||!W)return R==null||R("008",yr.error008(z,j)),null;const{sourceX:Me,sourceY:Fe,targetX:Re,targetY:Pe}=JI(G,z,J,K,W,se);return oe.createElement(B,{key:j.id,id:j.id,className:qt([j.className,u]),type:O,data:j.data,selected:!!j.selected,animated:!!j.animated,hidden:!!j.hidden,label:j.label,labelStyle:j.labelStyle,labelShowBg:j.labelShowBg,labelBgStyle:j.labelBgStyle,labelBgPadding:j.labelBgPadding,labelBgBorderRadius:j.labelBgBorderRadius,style:j.style,source:j.source,target:j.target,sourceHandleId:j.sourceHandle,targetHandleId:j.targetHandle,markerEnd:j.markerEnd,markerStart:j.markerStart,sourceX:Me,sourceY:Fe,targetX:Re,targetY:Pe,sourcePosition:J,targetPosition:se,elementsSelectable:C,onContextMenu:l,onMouseEnter:c,onMouseMove:d,onMouseLeave:h,onClick:p,onEdgeDoubleClick:m,onReconnect:y,onReconnectStart:x,onReconnectEnd:N,reconnectRadius:_,rfId:s,ariaLabel:j.ariaLabel,isFocusable:ue,isReconnectable:ge,pathOptions:"pathOptions"in j?j.pathOptions:void 0,interactionWidth:j.interactionWidth,disableKeyboardA11y:b})})))),S):null};$E.displayName="EdgeRenderer";var fM=q.memo($E);const dM=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function hM({children:e}){const n=Xe(dM);return oe.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:n}},e)}function pM(e){const n=zo(),i=q.useRef(!1);q.useEffect(()=>{!i.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),i.current=!0)},[e,n.viewportInitialized])}const mM={[Ce.Left]:Ce.Right,[Ce.Right]:Ce.Left,[Ce.Top]:Ce.Bottom,[Ce.Bottom]:Ce.Top},DE=({nodeId:e,handleType:n,style:i,type:s=Qr.Bezier,CustomComponent:o,connectionStatus:u})=>{var P,I,M;const{fromNode:l,handleId:c,toX:d,toY:h,connectionMode:p}=Xe(q.useCallback(R=>({fromNode:R.nodeInternals.get(e),handleId:R.connectionHandleId,toX:(R.connectionPosition.x-R.transform[0])/R.transform[2],toY:(R.connectionPosition.y-R.transform[1])/R.transform[2],connectionMode:R.connectionMode}),[e]),St),m=(P=l==null?void 0:l[ht])==null?void 0:P.handleBounds;let y=m==null?void 0:m[n];if(p===Mi.Loose&&(y=y||(m==null?void 0:m[n==="source"?"target":"source"])),!l||!y)return null;const x=c?y.find(R=>R.id===c):y[0],N=x?x.x+x.width/2:(l.width??0)/2,_=x?x.y+x.height/2:l.height??0,S=(((I=l.positionAbsolute)==null?void 0:I.x)??0)+N,b=(((M=l.positionAbsolute)==null?void 0:M.y)??0)+_,k=x==null?void 0:x.position,E=k?mM[k]:null;if(!k||!E)return null;if(o)return oe.createElement(o,{connectionLineType:s,connectionLineStyle:i,fromNode:l,fromHandle:x,fromX:S,fromY:b,toX:d,toY:h,fromPosition:k,toPosition:E,connectionStatus:u});let C="";const A={sourceX:S,sourceY:b,sourcePosition:k,targetX:d,targetY:h,targetPosition:E};return s===Qr.Bezier?[C]=cE(A):s===Qr.Step?[C]=_g({...A,borderRadius:0}):s===Qr.SmoothStep?[C]=_g(A):s===Qr.SimpleBezier?[C]=lE(A):C=`M${S},${b} ${d},${h}`,oe.createElement("path",{d:C,fill:"none",className:"react-flow__connection-path",style:i})};DE.displayName="ConnectionLine";const gM=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function vM({containerStyle:e,style:n,type:i,component:s}){const{nodeId:o,handleType:u,nodesConnectable:l,width:c,height:d,connectionStatus:h}=Xe(gM,St);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:qt(["react-flow__connection",h])},oe.createElement(DE,{nodeId:o,handleType:u,style:n,type:i,CustomComponent:s,connectionStatus:h})))}function $w(e,n){return q.useRef(null),bt(),q.useMemo(()=>n(e),[e])}const FE=({nodeTypes:e,edgeTypes:n,onMove:i,onMoveStart:s,onMoveEnd:o,onInit:u,onNodeClick:l,onEdgeClick:c,onNodeDoubleClick:d,onEdgeDoubleClick:h,onNodeMouseEnter:p,onNodeMouseMove:m,onNodeMouseLeave:y,onNodeContextMenu:x,onSelectionContextMenu:N,onSelectionStart:_,onSelectionEnd:S,connectionLineType:b,connectionLineStyle:k,connectionLineComponent:E,connectionLineContainerStyle:C,selectionKeyCode:A,selectionOnDrag:P,selectionMode:I,multiSelectionKeyCode:M,panActivationKeyCode:R,zoomActivationKeyCode:L,deleteKeyCode:F,onlyRenderVisibleElements:Q,elementsSelectable:X,selectNodesOnDrag:j,defaultViewport:G,translateExtent:U,minZoom:ne,maxZoom:K,preventScrolling:D,defaultMarkerColor:V,zoomOnScroll:O,zoomOnPinch:B,panOnScroll:ae,panOnScrollSpeed:z,panOnScrollMode:W,zoomOnDoubleClick:J,panOnDrag:se,onPaneClick:ue,onPaneMouseEnter:he,onPaneMouseMove:ge,onPaneMouseLeave:Me,onPaneScroll:Fe,onPaneContextMenu:Re,onEdgeContextMenu:Pe,onEdgeMouseEnter:be,onEdgeMouseMove:Oe,onEdgeMouseLeave:ve,onReconnect:ye,onReconnectStart:qe,onReconnectEnd:Ye,reconnectRadius:Qe,noDragClassName:et,noWheelClassName:Be,noPanClassName:Ze,elevateEdgesOnSelect:At,disableKeyboardA11y:Vt,nodeOrigin:It,nodeExtent:pt,rfId:tt})=>{const kt=$w(e,VI),We=$w(n,ZI);return pM(u),oe.createElement(UI,{onPaneClick:ue,onPaneMouseEnter:he,onPaneMouseMove:ge,onPaneMouseLeave:Me,onPaneContextMenu:Re,onPaneScroll:Fe,deleteKeyCode:F,selectionKeyCode:A,selectionOnDrag:P,selectionMode:I,onSelectionStart:_,onSelectionEnd:S,multiSelectionKeyCode:M,panActivationKeyCode:R,zoomActivationKeyCode:L,elementsSelectable:X,onMove:i,onMoveStart:s,onMoveEnd:o,zoomOnScroll:O,zoomOnPinch:B,zoomOnDoubleClick:J,panOnScroll:ae,panOnScrollSpeed:z,panOnScrollMode:W,panOnDrag:se,defaultViewport:G,translateExtent:U,minZoom:ne,maxZoom:K,onSelectionContextMenu:N,preventScrolling:D,noDragClassName:et,noWheelClassName:Be,noPanClassName:Ze,disableKeyboardA11y:Vt},oe.createElement(hM,null,oe.createElement(fM,{edgeTypes:We,onEdgeClick:c,onEdgeDoubleClick:h,onlyRenderVisibleElements:Q,onEdgeContextMenu:Pe,onEdgeMouseEnter:be,onEdgeMouseMove:Oe,onEdgeMouseLeave:ve,onReconnect:ye,onReconnectStart:qe,onReconnectEnd:Ye,reconnectRadius:Qe,defaultMarkerColor:V,noPanClassName:Ze,elevateEdgesOnSelect:!!At,disableKeyboardA11y:Vt,rfId:tt},oe.createElement(vM,{style:k,type:b,component:E,containerStyle:C})),oe.createElement("div",{className:"react-flow__edgelabel-renderer"}),oe.createElement(YI,{nodeTypes:kt,onNodeClick:l,onNodeDoubleClick:d,onNodeMouseEnter:p,onNodeMouseMove:m,onNodeMouseLeave:y,onNodeContextMenu:x,selectNodesOnDrag:j,onlyRenderVisibleElements:Q,noPanClassName:Ze,noDragClassName:et,disableKeyboardA11y:Vt,nodeOrigin:It,nodeExtent:pt,rfId:tt})))};FE.displayName="GraphView";var yM=q.memo(FE);const Ng=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Yr={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:Ng,nodeExtent:Ng,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Mi.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:VA,isValidConnection:void 0},wM=()=>oR((e,n)=>({...Yr,setNodes:i=>{const{nodeInternals:s,nodeOrigin:o,elevateNodesOnSelect:u}=n();e({nodeInternals:Fc(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?Fc(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:h}=n(),p=d==null?void 0:d.querySelector(".react-flow__viewport");if(!p)return;const m=window.getComputedStyle(p),{m22:y}=new window.DOMMatrixReadOnly(m.transform),x=i.reduce((_,S)=>{const b=o.get(S.id);if(b!=null&&b.hidden)o.set(b.id,{...b,[ht]:{...b[ht],handleBounds:void 0}});else if(b){const k=zg(S.nodeElement);!!(k.width&&k.height&&(b.width!==k.width||b.height!==k.height||S.forceUpdate))&&(o.set(b.id,{...b,[ht]:{...b[ht],handleBounds:{source:Aw(".source",S.nodeElement,y,h),target:Aw(".target",S.nodeElement,y,h)}},...k}),_.push({id:b.id,type:"dimensions",dimensions:k}))}return _},[]);TE(o,h);const N=l||u&&!l&&RE(n,{initial:!0,...c});e({nodeInternals:new Map(o),fitViewOnInitDone:N}),(x==null?void 0:x.length)>0&&(s==null||s(x))},updateNodePositions:(i,s=!0,o=!1)=>{const{triggerNodeChanges: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 h=PI(i,c()),p=Fc(h,o,l,d);e({nodeInternals:p})}s==null||s(i)}},addSelectedNodes:i=>{const{multiSelectionActive:s,edges:o,getNodes:u}=n();let l,c=null;s?l=i.map(d=>Xr(d,!0)):(l=_s(u(),i),c=_s(o,[])),ru({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=>Xr(d,!0)):(l=_s(o,i),c=_s(u(),[])),ru({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(p=>(p.selected=!1,Xr(p.id,!1))),h=c.map(p=>Xr(p.id,!1));ru({changedNodes:d,changedEdges:h,get:n,set:e})},setMinZoom:i=>{const{d3Zoom:s,maxZoom:o}=n();s==null||s.scaleExtent([i,o]),e({minZoom:i})},setMaxZoom:i=>{const{d3Zoom:s,minZoom:o}=n();s==null||s.scaleExtent([o,i]),e({maxZoom:i})},setTranslateExtent:i=>{var s;(s=n().d3Zoom)==null||s.translateExtent(i),e({translateExtent:i})},resetSelectedElements:()=>{const{edges:i,getNodes:s}=n(),u=s().filter(c=>c.selected).map(c=>Xr(c.id,!1)),l=i.filter(c=>c.selected).map(c=>Xr(c.id,!1));ru({changedNodes:u,changedEdges:l,get:n,set:e})},setNodeExtent:i=>{const{nodeInternals:s}=n();s.forEach(o=>{o.positionAbsolute=Bg(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 h=gr.translate(s[0]+i.x,s[1]+i.y).scale(s[2]),p=[[0,0],[o,u]],m=l==null?void 0:l.constrain()(h,p,d);return l.transform(c,m),s[0]!==m.x||s[1]!==m.y||s[2]!==m.k},cancelConnection:()=>e({connectionNodeId:Yr.connectionNodeId,connectionHandleId:Yr.connectionHandleId,connectionHandleType:Yr.connectionHandleType,connectionStatus:Yr.connectionStatus,connectionStartHandle:Yr.connectionStartHandle,connectionEndHandle:Yr.connectionEndHandle}),reset:()=>e({...Yr})}),Object.is),Xg=({children:e})=>{const n=q.useRef(null);return n.current||(n.current=wM()),oe.createElement($A,{value:n.current},e)};Xg.displayName="ReactFlowProvider";const zE=({children:e})=>q.useContext(ju)?oe.createElement(oe.Fragment,null,e):oe.createElement(Xg,null,e);zE.displayName="ReactFlowWrapper";const xM={input:_E,default:kg,output:bE,group:Yg},_M={default:Su,straight:Vg,step:Hg,smoothstep:Au,simplebezier:Ug},SM=[0,0],bM=[15,15],kM={x:0,y:0,zoom:1},EM={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},BE=q.forwardRef(({nodes:e,edges:n,defaultNodes:i,defaultEdges:s,className:o,nodeTypes:u=xM,edgeTypes:l=_M,onNodeClick:c,onEdgeClick:d,onInit:h,onMove:p,onMoveStart:m,onMoveEnd:y,onConnect:x,onConnectStart:N,onConnectEnd:_,onClickConnectStart:S,onClickConnectEnd:b,onNodeMouseEnter:k,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:A,onNodeDoubleClick:P,onNodeDragStart:I,onNodeDrag:M,onNodeDragStop:R,onNodesDelete:L,onEdgesDelete:F,onSelectionChange:Q,onSelectionDragStart:X,onSelectionDrag:j,onSelectionDragStop:G,onSelectionContextMenu:U,onSelectionStart:ne,onSelectionEnd:K,connectionMode:D=Mi.Strict,connectionLineType:V=Qr.Bezier,connectionLineStyle:O,connectionLineComponent:B,connectionLineContainerStyle:ae,deleteKeyCode:z="Backspace",selectionKeyCode:W="Shift",selectionOnDrag:J=!1,selectionMode:se=Oo.Full,panActivationKeyCode:ue="Space",multiSelectionKeyCode:he=xu()?"Meta":"Control",zoomActivationKeyCode:ge=xu()?"Meta":"Control",snapToGrid:Me=!1,snapGrid:Fe=bM,onlyRenderVisibleElements:Re=!1,selectNodesOnDrag:Pe=!0,nodesDraggable:be,nodesConnectable:Oe,nodesFocusable:ve,nodeOrigin:ye=SM,edgesFocusable:qe,edgesUpdatable:Ye,elementsSelectable:Qe,defaultViewport:et=kM,minZoom:Be=.5,maxZoom:Ze=2,translateExtent:At=Ng,preventScrolling:Vt=!0,nodeExtent:It,defaultMarkerColor:pt="#b1b1b7",zoomOnScroll:tt=!0,zoomOnPinch:kt=!0,panOnScroll:We=!1,panOnScrollSpeed:Et=.5,panOnScrollMode:Ge=Ti.Free,zoomOnDoubleClick:ft=!0,panOnDrag:on=!0,onPaneClick:Lt,onPaneMouseEnter:wt,onPaneMouseMove:an,onPaneMouseLeave:Bt,onPaneScroll:vn,onPaneContextMenu:un,children:yn,onEdgeContextMenu:wn,onEdgeDoubleClick:_r,onEdgeMouseEnter:Mn,onEdgeMouseMove:ti,onEdgeMouseLeave:$i,onEdgeUpdate:Sr,onEdgeUpdateStart:ni,onEdgeUpdateEnd:ir,onReconnect:Nt,onReconnectStart:Pn,onReconnectEnd:Yn,reconnectRadius:ln=10,edgeUpdaterRadius:Kn=10,onNodesChange:Xn,onEdgesChange:br,noDragClassName:kr="nodrag",noWheelClassName:Di="nowheel",noPanClassName:Fi="nopan",fitView:xn=!1,fitViewOptions:zi,connectOnClick:Bi=!0,attributionPosition:ri,proOptions:cn,defaultEdgeOptions:Er,elevateNodesOnSelect:ii=!0,elevateEdgesOnSelect:Ui=!1,disableKeyboardA11y:Hi=!1,autoPanOnConnect:Vi=!0,autoPanOnNodeDrag:nt=!0,connectionRadius:Wt=20,isValidConnection:si,onError:oi,style:Nr,id:Wi,nodeDragThreshold:ai,..._n},Gt)=>{const gt=Wi||"1";return oe.createElement("div",{..._n,style:{...Nr,...EM},ref:Gt,className:qt(["react-flow",o]),"data-testid":"rf__wrapper",id:Wi},oe.createElement(zE,null,oe.createElement(yM,{onInit:h,onMove:p,onMoveStart:m,onMoveEnd:y,onNodeClick:c,onEdgeClick:d,onNodeMouseEnter:k,onNodeMouseMove:E,onNodeMouseLeave:C,onNodeContextMenu:A,onNodeDoubleClick:P,nodeTypes:u,edgeTypes:l,connectionLineType:V,connectionLineStyle:O,connectionLineComponent:B,connectionLineContainerStyle:ae,selectionKeyCode:W,selectionOnDrag:J,selectionMode:se,deleteKeyCode:z,multiSelectionKeyCode:he,panActivationKeyCode:ue,zoomActivationKeyCode:ge,onlyRenderVisibleElements:Re,selectNodesOnDrag:Pe,defaultViewport:et,translateExtent:At,minZoom:Be,maxZoom:Ze,preventScrolling:Vt,zoomOnScroll:tt,zoomOnPinch:kt,zoomOnDoubleClick:ft,panOnScroll:We,panOnScrollSpeed:Et,panOnScrollMode:Ge,panOnDrag:on,onPaneClick:Lt,onPaneMouseEnter:wt,onPaneMouseMove:an,onPaneMouseLeave:Bt,onPaneScroll:vn,onPaneContextMenu:un,onSelectionContextMenu:U,onSelectionStart:ne,onSelectionEnd:K,onEdgeContextMenu:wn,onEdgeDoubleClick:_r,onEdgeMouseEnter:Mn,onEdgeMouseMove:ti,onEdgeMouseLeave:$i,onReconnect:Nt??Sr,onReconnectStart:Pn??ni,onReconnectEnd:Yn??ir,reconnectRadius:ln??Kn,defaultMarkerColor:pt,noDragClassName:kr,noWheelClassName:Di,noPanClassName:Fi,elevateEdgesOnSelect:Ui,rfId:gt,disableKeyboardA11y:Hi,nodeOrigin:ye,nodeExtent:It}),oe.createElement(pI,{nodes:e,edges:n,defaultNodes:i,defaultEdges:s,onConnect:x,onConnectStart:N,onConnectEnd:_,onClickConnectStart:S,onClickConnectEnd:b,nodesDraggable:be,nodesConnectable:Oe,nodesFocusable:ve,edgesFocusable:qe,edgesUpdatable:Ye,elementsSelectable:Qe,elevateNodesOnSelect:ii,minZoom:Be,maxZoom:Ze,nodeExtent:It,onNodesChange:Xn,onEdgesChange:br,snapToGrid:Me,snapGrid:Fe,connectionMode:D,translateExtent:At,connectOnClick:Bi,defaultEdgeOptions:Er,fitView:xn,fitViewOptions:zi,onNodesDelete:L,onEdgesDelete:F,onNodeDragStart:I,onNodeDrag:M,onNodeDragStop:R,onSelectionDrag:j,onSelectionDragStart:X,onSelectionDragStop:G,noPanClassName:Fi,nodeOrigin:ye,rfId:gt,autoPanOnConnect:Vi,autoPanOnNodeDrag:nt,onError:oi,connectionRadius:Wt,isValidConnection:si,nodeDragThreshold:ai}),oe.createElement(dI,{onSelectionChange:Q}),yn,oe.createElement(FA,{proOptions:cn,position:ri}),oe.createElement(wI,{rfId:gt,disableKeyboardA11y:Hi})))});BE.displayName="ReactFlow";const NM=e=>({x:e.transform[0],y:e.transform[1],zoom:e.transform[2]});function UE(){return Xe(NM,St)}const HE=({id:e,x:n,y:i,width:s,height:o,style:u,color:l,strokeColor:c,strokeWidth:d,className:h,borderRadius:p,shapeRendering:m,onClick:y,selected:x})=>{const{background:N,backgroundColor:_}=u||{},S=l||N||_;return oe.createElement("rect",{className:qt(["react-flow__minimap-node",{selected:x},h]),x:n,y:i,rx:p,ry:p,width:s,height:o,fill:S,stroke:c,strokeWidth:d,shapeRendering:m,onClick:y?b=>y(b,e):void 0})};HE.displayName="MiniMapNode";var CM=q.memo(HE);const TM=e=>e.nodeOrigin,RM=e=>e.getNodes().filter(n=>!n.hidden&&n.width&&n.height),Hc=e=>e instanceof Function?e:()=>e;function jM({nodeStrokeColor:e="transparent",nodeColor:n="#e2e2e2",nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:o=2,nodeComponent:u=CM,onClick:l}){const c=Xe(RM,St),d=Xe(TM),h=Hc(n),p=Hc(e),m=Hc(i),y=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return oe.createElement(oe.Fragment,null,c.map(x=>{const{x:N,y:_}=ji(x,d).positionAbsolute;return oe.createElement(u,{key:x.id,x:N,y:_,width:x.width,height:x.height,style:x.style,selected:x.selected,className:m(x),color:h(x),borderRadius:s,strokeColor:p(x),strokeWidth:o,shapeRendering:y,onClick:l,id:x.id})}))}var AM=q.memo(jM);const IM=200,MM=150,PM=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?UA(Iu(n,e.nodeOrigin),i):i,rfId:e.rfId}},OM="react-flow__minimap-desc";function VE({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:h="none",maskStrokeWidth:p=1,position:m="bottom-right",onClick:y,onNodeClick:x,pannable:N=!1,zoomable:_=!1,ariaLabel:S="React Flow mini map",inversePan:b=!1,zoomStep:k=10,offsetScale:E=5}){const C=bt(),A=q.useRef(null),{boundingRect:P,viewBB:I,rfId:M}=Xe(PM,St),R=(e==null?void 0:e.width)??IM,L=(e==null?void 0:e.height)??MM,F=P.width/R,Q=P.height/L,X=Math.max(F,Q),j=X*R,G=X*L,U=E*X,ne=P.x-(j-P.width)/2-U,K=P.y-(G-P.height)/2-U,D=j+U*2,V=G+U*2,O=`${OM}-${M}`,B=q.useRef(0);B.current=X,q.useEffect(()=>{if(A.current){const W=Rn(A.current),J=he=>{const{transform:ge,d3Selection:Me,d3Zoom:Fe}=C.getState();if(he.sourceEvent.type!=="wheel"||!Me||!Fe)return;const Re=-he.sourceEvent.deltaY*(he.sourceEvent.deltaMode===1?.05:he.sourceEvent.deltaMode?1:.002)*k,Pe=ge[2]*Math.pow(2,Re);Fe.scaleTo(Me,Pe)},se=he=>{const{transform:ge,d3Selection:Me,d3Zoom:Fe,translateExtent:Re,width:Pe,height:be}=C.getState();if(he.sourceEvent.type!=="mousemove"||!Me||!Fe)return;const Oe=B.current*Math.max(1,ge[2])*(b?-1:1),ve={x:ge[0]-he.sourceEvent.movementX*Oe,y:ge[1]-he.sourceEvent.movementY*Oe},ye=[[0,0],[Pe,be]],qe=gr.translate(ve.x,ve.y).scale(ge[2]),Ye=Fe.constrain()(qe,ye,Re);Fe.transform(Me,Ye)},ue=Jk().on("zoom",N?se:null).on("zoom.wheel",_?J:null);return W.call(ue),()=>{W.on("zoom",null)}}},[N,_,b,k]);const ae=y?W=>{const J=Bn(W);y(W,{x:J[0],y:J[1]})}:void 0,z=x?(W,J)=>{const se=C.getState().nodeInternals.get(J);x(W,se)}:void 0;return oe.createElement(Fg,{position:m,style:e,className:qt(["react-flow__minimap",n]),"data-testid":"rf__minimap"},oe.createElement("svg",{width:R,height:L,viewBox:`${ne} ${K} ${D} ${V}`,role:"img","aria-labelledby":O,ref:A,onClick:ae},S&&oe.createElement("title",{id:O},S),oe.createElement(AM,{onClick:z,nodeColor:s,nodeStrokeColor:i,nodeBorderRadius:u,nodeClassName:o,nodeStrokeWidth:l,nodeComponent:c}),oe.createElement("path",{className:"react-flow__minimap-mask",d:`M${ne-U},${K-U}h${D+U*2}v${V+U*2}h${-D-U*2}z
57
+ M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`,fill:d,fillRule:"evenodd",stroke:h,strokeWidth:p,pointerEvents:"none"})))}VE.displayName="MiniMap";var qM=q.memo(VE);function LM(){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 $M(){return oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},oe.createElement("path",{d:"M0 0h32v4.2H0z"}))}function DM(){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 FM(){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 zM(){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 Ss=({children:e,className:n,...i})=>oe.createElement("button",{type:"button",className:qt(["react-flow__controls-button",n]),...i},e);Ss.displayName="ControlButton";const BM=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),WE=({style:e,showZoom:n=!0,showFitView:i=!0,showInteractive:s=!0,fitViewOptions:o,onZoomIn:u,onZoomOut:l,onFitView:c,onInteractiveChange:d,className:h,children:p,position:m="bottom-left"})=>{const y=bt(),[x,N]=q.useState(!1),{isInteractive:_,minZoomReached:S,maxZoomReached:b}=Xe(BM,St),{zoomIn:k,zoomOut:E,fitView:C}=zo();if(q.useEffect(()=>{N(!0)},[]),!x)return null;const A=()=>{k(),u==null||u()},P=()=>{E(),l==null||l()},I=()=>{C(o),c==null||c()},M=()=>{y.setState({nodesDraggable:!_,nodesConnectable:!_,elementsSelectable:!_}),d==null||d(!_)};return oe.createElement(Fg,{className:qt(["react-flow__controls",h]),position:m,style:e,"data-testid":"rf__controls"},n&&oe.createElement(oe.Fragment,null,oe.createElement(Ss,{onClick:A,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:b},oe.createElement(LM,null)),oe.createElement(Ss,{onClick:P,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:S},oe.createElement($M,null))),i&&oe.createElement(Ss,{className:"react-flow__controls-fitview",onClick:I,title:"fit view","aria-label":"fit view"},oe.createElement(DM,null)),s&&oe.createElement(Ss,{className:"react-flow__controls-interactive",onClick:M,title:"toggle interactivity","aria-label":"toggle interactivity"},_?oe.createElement(zM,null):oe.createElement(FM,null)),p)};WE.displayName="Controls";var UM=q.memo(WE),Hn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Hn||(Hn={}));function HM({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 VM({color:e,radius:n}){return oe.createElement("circle",{cx:n,cy:n,r:n,fill:e})}const WM={[Hn.Dots]:"#91919a",[Hn.Lines]:"#eee",[Hn.Cross]:"#e2e2e2"},GM={[Hn.Dots]:1,[Hn.Lines]:1,[Hn.Cross]:6},YM=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function GE({id:e,variant:n=Hn.Dots,gap:i=20,size:s,lineWidth:o=1,offset:u=2,color:l,style:c,className:d}){const h=q.useRef(null),{transform:p,patternId:m}=Xe(YM,St),y=l||WM[n],x=s||GM[n],N=n===Hn.Dots,_=n===Hn.Cross,S=Array.isArray(i)?i:[i,i],b=[S[0]*p[2]||1,S[1]*p[2]||1],k=x*p[2],E=_?[k,k]:b,C=N?[k/u,k/u]:[E[0]/u,E[1]/u];return oe.createElement("svg",{className:qt(["react-flow__background",d]),style:{...c,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:h,"data-testid":"rf__background"},oe.createElement("pattern",{id:m+e,x:p[0]%b[0],y:p[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`},N?oe.createElement(VM,{color:y,radius:k/u}):oe.createElement(HM,{dimensions:E,color:y,lineWidth:o})),oe.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${m+e})`}))}GE.displayName="Background";var KM=q.memo(GE);function YE(){return{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreateTokens:0}}function KE(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=KE(s,n+1);if(o)return o}return null}function XM(e,n){e.inputTokens+=n.inputTokens,e.outputTokens+=n.outputTokens,e.cacheReadTokens+=n.cacheReadTokens,e.cacheCreateTokens+=n.cacheCreateTokens}const QM=/^(?:claude[-_]|gpt[-_]|o\d|codex[-_])/i;function XE(e,n=0){if(!e||typeof e!="object"||n>6)return null;const i=e;if(typeof i.model=="string"&&QM.test(i.model))return i.model;for(const s of Object.values(i)){const o=XE(s,n+1);if(o)return o}return null}function Cg(){return{agents:new Map,toolIndex:new Map,toolOwner:new Map,activeSubagentStack:new Map,lastSeq:0,totalEvents:0}}function Jr(e){if(!e)return;const n=e.replace(/\\/g,"/").split("/").filter(Boolean);return n[n.length-1]}function Qg(e,n){return`${e}::${n}`}function bu(e){return e.agent_type??e.subagent_type??"subagent"}function Tg(e){return e.agent_id?e.agent_id:e.parent_tool_use_id?e.parent_tool_use_id:null}function To(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:YE()},e.agents.set(o,u),u)}function QE(e,n,i,s){const o=Qg(n,i),u=e.agents.get(o);if(!u)return null;!u.cwd&&s.cwd&&(u.cwd=s.cwd,u.cwdBasename=Jr(s.cwd));const l=bu(s);return l&&(u.label==="subagent"||!u.label)&&(u.label=l),u}function Dw(e,n,i){const s=n.session_id??"unknown",o=Tg(n);if(o){const d=QE(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(Qg(s,l));if(d)return!d.cwd&&n.cwd&&(d.cwd=n.cwd,d.cwdBasename=Jr(n.cwd)),d}const c=To(e,s,i,!1);return c.synthetic&&(c.synthetic=!1,c.startedAt=i),!c.cwd&&n.cwd&&(c.cwd=n.cwd,c.cwdBasename=Jr(n.cwd)),c.label==="session"&&n.cwd&&(c.label=Jr(n.cwd)??"session"),c}function ZM(e,n,i,s,o){const u=Qg(n,i),l=To(e,n,o,!0);let c=e.agents.get(u);if(c){!c.cwd&&s.cwd&&(c.cwd=s.cwd,c.cwdBasename=Jr(s.cwd));const d=bu(s);return d&&(c.label==="subagent"||!c.label)&&(c.label=d),c}return c={id:u,sessionId:n,label:bu(s),kind:"subagent",parentId:l.id,state:"active",startedAt:o,tools:[],prompts:[],cwd:s.cwd,cwdBasename:Jr(s.cwd),toolCount:0,childCount:0,inFlightTool:null,usage:YE()},e.agents.set(u,c),l.childCount+=1,c}function JM(e,n,i){const s=e.activeSubagentStack.get(n)??[];s.push(i),e.activeSubagentStack.set(n,s)}function eP(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 Vc(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 ko(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 tP(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 nP(e,n,i,s){const o=new Map;for(const[h,p]of e.agents){let m=o.get(p.sessionId);m||(m={ids:[],endedAt:0,live:!1},o.set(p.sessionId,m)),m.ids.push(h),p.state==="done"&&p.endedAt!=null?m.endedAt=Math.max(m.endedAt,p.endedAt):m.live=!0}const u=[...o.values()].filter(h=>!h.live&&h.endedAt>0&&n-h.endedAt>s).sort((h,p)=>h.endedAt-p.endedAt);let c=[...o.values()].filter(h=>!h.live).length-i;if(c<=0)return!1;let d=!1;for(const h of u){if(c<=0)break;for(const p of h.ids)e.agents.delete(p);c--,d=!0}return d}function rP(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&&ko(o)}return s}function Fw(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{...Cg(),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 p=e.agents.get(u);p&&(p.model=d)}const h=i.subagentModels;if(h&&typeof h=="object")for(const[p,m]of Object.entries(h)){if(typeof m!="string")continue;const y=`${u}::${p}`,x=e.agents.get(y);x&&(x.model=m)}return e}if(o==="ContextObserved"){const d=i.context??null;if(d){const h=e.agents.get(u);h&&(h.context={msgsUser:Number(d.msgsUser??0),msgsAssistant:Number(d.msgsAssistant??0),toolUses:Number(d.toolUses??0),toolResults:Number(d.toolResults??0),systemReminders:Number(d.systemReminders??0),currentContextTokens:Number(d.currentContextTokens??0),claudeMdFiles:Array.isArray(d.claudeMdFiles)?d.claudeMdFiles:[]})}return e}if(o==="UsageObserved"){const d=i.usage??null;if(d){const h=e.agents.get(u);h&&(h.usage.inputTokens=Number(d.input_tokens??0),h.usage.outputTokens=Number(d.output_tokens??0),h.usage.cacheReadTokens=Number(d.cache_read_input_tokens??d.cached_input_tokens??0),h.usage.cacheCreateTokens=Number(d.cache_creation_input_tokens??0),typeof d.reasoning_output_tokens=="number"&&(h.usage.reasoningOutputTokens=Number(d.reasoning_output_tokens)))}return e}const l=Dw(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=XE(i);switch(c&&(l.model=c),o){case"SessionStart":{const d=To(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=Jr(i.cwd)),d.label==="session"&&i.cwd&&(d.label=Jr(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=To(e,u,s,!1);d.state="active",d.endedAt=void 0,d.exitAt=void 0;const h=Dw(e,i,s);h.state="active",h.exitAt=void 0,h.endedAt=void 0;const p=(typeof i.prompt=="string"?i.prompt:typeof i.message=="string"?i.message:"")??"";p&&(h.prompts.push({at:s,text:p}),h.firstPrompt||(h.firstPrompt=Vc(p,120)));break}case"PreToolUse":{const d=i.tool_use_id??`${l.id}:${l.toolCount}`,h={id:d,name:i.tool_name??"?",input:i.tool_input,inputPreview:Vc(i.tool_input),agentId:l.id,startedAt:s};l.tools.push(h),l.toolCount+=1,l.state="active",e.toolIndex.set(d,h),e.toolOwner.set(d,l.id),ko(l);break}case"PostToolUse":case"PostToolUseFailure":{const d=i.tool_use_id;if(!d)break;let h=e.toolIndex.get(d),p=!1;if(!h)for(const x of e.agents.values()){const N=x.tools.find(_=>_.id===d);if(N){h=N,p=!0;break}}if(!h)break;h.endedAt=s,h.ok=o==="PostToolUse",h.response=i.tool_response,o==="PostToolUseFailure"?h.errorPreview=Vc(i.tool_response):p&&(h.errorPreview=void 0);const m=KE(i.tool_response);m&&(h.usage=m),e.toolIndex.delete(d);const y=e.toolOwner.get(d)??h.agentId;if(e.toolOwner.delete(d),y){const x=e.agents.get(y);x&&(m&&XM(x.usage,m),ko(x))}break}case"SubagentStart":{const d=Tg(i);if(!d)break;const h=ZM(e,u,d,i,s);h.state="active",h.startedAt=h.startedAt||s,h.exitAt=void 0,h.endedAt=void 0;const p=bu(i);p&&(h.label=p),JM(e,u,d);break}case"SubagentStop":{const d=Tg(i);if(!d)break;const h=QE(e,u,d,i);if(!h)break;h.state="done",h.endedAt=s,ko(h),eP(e,u,d);break}case"Stop":case"SessionEnd":{const d=To(e,u,s,!1);d.state="done",d.endedAt=s,ko(d);break}}return e}function Zg(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 iP=Date.UTC(2026,8,1);function sP(){return Date.now()<iP?{input:2,output:10,cacheRead:.2,cacheWrite:2.5}:{input:3,output:15,cacheRead:.3,cacheWrite:3.75}}const oP=[{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:sP()},{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 aP(e){return e?/^(?:gpt[-_]|codex[-_]|o\d)/i.test(e):!1}function Jg(e){if(!e)return null;for(const n of oP)if(n.match.test(e))return n.rates;return null}const uP=272e3,lP=/^gpt[-_]5[-_.](?:6(?![-_]cyber)|5|4)/i;function cP(e,n){return!e||n<=uP?{input:1,output:1}:lP.test(e)?{input:2,output:1.5}:{input:1,output:1}}function rn(e,n){const i=Jg(n);if(!i)return{input:0,output:0,cacheRead:0,cacheWrite:0,total:0};const s=aP(n),o=s?Math.max(0,e.inputTokens-e.cacheReadTokens):e.inputTokens,u=s?cP(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,h=e.cacheCreateTokens*i.cacheWrite*u.input/1e6;return{input:l,output:c,cacheRead:d,cacheWrite:h,total:l+c+d+h}}const zw=2e5,fP=1e6,dP=[/\[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],hP=[{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 zw;for(const n of dP)if(n.test(e))return fP;for(const n of hP)if(n.match.test(e))return n.window;return zw}function He(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 ku(e,n){if(e<=0||n<10)return null;const i=e/n,s=i*60;return s>=.01?`${He(s)}/min`:`${He(i*3600)}/hr`}function Tn(e){return e.toLocaleString()}function pP(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function mP({agent:e,onClose:n}){var h;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=rn(s,e.model),d=s.inputTokens+s.cacheReadTokens+s.cacheCreateTokens;return v.jsx("div",{className:"ctx-modal-backdrop",onClick:n,role:"presentation",children:v.jsxs("div",{className:"ctx-modal",onClick:p=>p.stopPropagation(),role:"dialog","aria-label":"Context breakdown",children:[v.jsxs("header",{className:"ctx-modal-head",children:[v.jsxs("div",{children:[v.jsxs("div",{className:"ctx-modal-title",children:["Context · ",e.label]}),v.jsx("div",{className:"ctx-modal-sub",children:"approximation — CC's /context isn't hook-exposed"})]}),v.jsx("button",{className:"ctx-modal-close",onClick:n,"aria-label":"Close",children:"×"})]}),v.jsxs("section",{className:"ctx-window-row",children:[v.jsx("div",{className:"ctx-window-bar",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(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:[Tn(o)," / ",Tn(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(zn,{label:"input tokens",val:Tn(s.inputTokens)}),v.jsx(zn,{label:"output tokens",val:Tn(s.outputTokens)}),v.jsx(zn,{label:"cache reads",val:Tn(s.cacheReadTokens)}),v.jsx(zn,{label:"cache writes",val:Tn(s.cacheCreateTokens)}),v.jsx(zn,{label:"cumulative total",val:Tn(d)}),v.jsx(zn,{label:"estimated cost",val:He(c.total),accent:!0})]}),v.jsx("h3",{className:"ctx-section-title",children:"Transcript composition"}),v.jsxs("div",{className:"ctx-grid",children:[v.jsx(zn,{label:"user messages",val:Tn((i==null?void 0:i.msgsUser)??0)}),v.jsx(zn,{label:"assistant messages",val:Tn((i==null?void 0:i.msgsAssistant)??0)}),v.jsx(zn,{label:"tool uses",val:Tn((i==null?void 0:i.toolUses)??0)}),v.jsx(zn,{label:"tool results",val:Tn((i==null?void 0:i.toolResults)??0)}),v.jsx(zn,{label:"system-reminders",val:Tn((i==null?void 0:i.systemReminders)??0)})]}),v.jsx("h3",{className:"ctx-section-title",children:"CLAUDE.md files in scope"}),(((h=i==null?void 0:i.claudeMdFiles)==null?void 0:h.length)??0)===0?v.jsx("div",{className:"ctx-empty",children:"No CLAUDE.md files found on the path from cwd to ~/.claude."}):v.jsx("ul",{className:"ctx-md-list",children:i.claudeMdFiles.map(p=>v.jsxs("li",{children:[v.jsx("span",{className:"ctx-md-path",title:p.path,children:p.path}),v.jsx("span",{className:"ctx-md-size",children:pP(p.bytes)})]},p.path))})]})})}function zn({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 gP({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,h=2*Math.PI*c,p=h*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:`${p} ${h-p}`,strokeDashoffset:h/4,strokeLinecap:"round",style:{transition:"stroke-dasharray 400ms ease"}}),v.jsx("text",{x:d,y:d+3,textAnchor:"middle",fontSize:"8",fill:"var(--text)",fontWeight:"600",children:Math.round(l*100)})]})})}function vP(e,n){const i=Jg(n);if(!i)return"no rates for this model";const s=l=>l.toLocaleString(),o=l=>`$${l}/MTok`,u=rn(e,n);return[`model: ${n}`,`input ${s(e.inputTokens).padStart(14)} × ${o(i.input).padEnd(11)} = ${He(u.input)}`,`output ${s(e.outputTokens).padStart(14)} × ${o(i.output).padEnd(11)} = ${He(u.output)}`,`cache r ${s(e.cacheReadTokens).padStart(14)} × ${o(i.cacheRead).padEnd(11)} = ${He(u.cacheRead)}`,`cache w ${s(e.cacheCreateTokens).padStart(14)} × ${o(i.cacheWrite).padEnd(11)} = ${He(u.cacheWrite)}`,"─────────────────────────────────────────",`total = ${He(u.total)}`].join(`
58
+ `)}function yP(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 wP({data:e,selected:n}){var h;const i=e.now??Date.now(),s=["agent-node",`state-${e.state}`,e.synthetic?"synthetic":"",n?"selected":""].filter(Boolean).join(" "),o=e.tools.filter(p=>!p.endedAt).length,l=`hsl(${Zg(e.sessionId)} 70% 60%)`,c=((h=e.context)==null?void 0:h.currentContextTokens)??0,d=e.kind==="root"&&c>0;return v.jsxs("div",{className:s,style:{"--accent":l},children:[v.jsx("span",{className:"accent-stripe"}),v.jsx(As,{type:"target",position:Ce.Left,style:{background:"transparent",border:"none"}}),v.jsxs("div",{className:"head",children:[v.jsxs("div",{className:"title",children:[v.jsx(xP,{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(gP,{currentContextTokens:c,modelId:e.model,onClick:()=>e.onOpenContext(e.sessionId)}),v.jsx("div",{className:"time",title:`Started ${new Date(e.startedAt).toLocaleTimeString()}`,children:yP(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:Bo(e.model)})]}),e.tools.length>0&&v.jsx(SP,{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:_P(e.usage.inputTokens+e.usage.outputTokens)})," tok"]}),e.model&&Jg(e.model)&&(()=>{const p=rn(e.usage,e.model);if(p.total<=0)return null;const m=Math.max(0,((e.endedAt??i)-e.startedAt)/1e3),y=e.state==="active"?ku(p.total,m):null,x=vP(e.usage,e.model)+(y?`
59
+ burn: ${y}`:"");return v.jsxs("span",{className:"cost-meta",title:x,children:[v.jsx("b",{children:He(p.total)}),y&&v.jsx("span",{className:"cost-rate",children:y})]})})()]}),v.jsx(As,{type:"source",position:Ce.Right,style:{background:"transparent",border:"none"}})]})}function xP({state:e}){const n=e==="active"?"live":e==="done"?"done":"err";return v.jsx("span",{className:`state-pill state-${e}`,children:n})}function _P(e){return e<1e3?`${e}`:e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(2)}M`}function SP({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 N=23-Math.floor(x/2500);N>=0&&N<24&&(u[N]+=1,l+=1)}const c=Math.max(1,...u),d=132,h=14,p=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:h,viewBox:`0 0 ${d} ${h}`,"aria-hidden":!0,children:u.map((y,x)=>{const N=y===0?1.5:Math.max(1.5,y/c*h),_=x===23&&y>0,b=`tool-spark-bar${y>0?" active":""}${_?" latest":""}`;return v.jsx("rect",{x:x*p+.4,y:h-N,width:Math.max(.5,p-1),height:N,rx:.8,className:b},x)})}),v.jsx("span",{className:"tool-spark-label",children:"60s"})]})}function Bo(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 Bw(e){if(e==null)return"(none)";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function bP(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 kP({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:bP(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:Bw(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…)":Bw(e.response??e.errorPreview)})]})]})]})})}const su=18,Uw=26,EP=12;function NP(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,h=c+o.height,p=n.get(u.sessionId);p?(p.minX=Math.min(p.minX,l),p.minY=Math.min(p.minY,c),p.maxX=Math.max(p.maxX,d),p.maxY=Math.max(p.maxY,h),u.kind==="root"&&(p.label=Hw(u)??p.label)):n.set(u.sessionId,{minX:l,minY:c,maxX:d,maxY:h,label:Hw(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} · ${CP(o)}`:u.label;s.push({sessionId:o,label:c,x:u.minX-su,y:u.minY-su-Uw,w:u.maxX-u.minX+su*2,h:u.maxY-u.minY+su*2+Uw})}return s}function CP(e){const n=e.match(/[a-zA-Z0-9]{4}/);return n?n[0]:e.slice(0,4)}function Hw(e){if(e.kind==="root")return e.label}function TP(){const{x:e,y:n,zoom:i}=UE(),s=zo(),o=Xe(NP,RP);if(o.length<=1)return null;const u=l=>{try{const c=s.getNodes().filter(d=>{const h=d.data;return(h==null?void 0:h.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=Zg(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)`},h={position:"absolute",left:l.x*i+e+16*i,top:(l.y-EP)*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:h,title:`Fit view to ${l.label} · drag the wrapper to move the whole session`,onClick:()=>u(l.sessionId),children:l.label})]},l.sessionId)})})}function RP(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 jP({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 JE=600,AP=36,Rg=16,IP=60,MP=6,Vw=220,Ww=96,PP=28,OP={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 qP(e){return e.startsWith("mcp__")?"mcp":OP[e]??"other"}const LP={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 Gw(e){return e.startsWith("mcp__")?"🔌":LP[e]??"✨"}const $P={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 eN(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 eN(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 DP(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 FP=new Set(["Bash","PowerShell","shell","exec_command","shell_command","write_stdin","wait"]),zP=new Set(["shell","exec_command","shell_command","write_stdin","wait","apply_patch","update_plan"]);function BP(e,n){return zP.has(e)?Math.max(Ww,34+n.length*7.5):Ww}function UP(e,n){if(!FP.has(e))return null;const i=DP(n);if(!i)return null;const s=eN(i);return s?{emoji:$P[s]??"⚙️",label:s,category:"shell",detail:i}:null}const HP=new Set(["Read","Write","Edit","MultiEdit","NotebookEdit","LS","Glob","apply_patch"]),Yw={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:"🗄️"},Kw={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 VP(e){const i=e.replace(/\\/g,"/").replace(/\/+$/,""),s=i.lastIndexOf("/");return s>=0?i.slice(s+1):i}function WP(e){const n=e.toLowerCase();if(Kw[n])return Kw[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(Yw[s])return Yw[s]}return"📄"}function GP(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 YP(e,n){if(!HP.has(e))return null;const i=GP(e,n);if(!i)return null;const s=VP(i);return s?{emoji:e==="LS"?"📂":WP(s),label:s,category:"file",detail:i}:null}const tN={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 nN(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 KP(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 XP(e,n){const i=nN(e);if(!i)return null;const{server:s,method:o}=i;if(!o)return null;const u=tN[s.toLowerCase()];return{emoji:(u==null?void 0:u.emoji)??"🔌",label:o,category:"mcp",detail:u?`${u.name} · ${o}`:`${s} · ${o}`}}function QP(e,n){return UP(e,n)??YP(e,n)??XP(e)}const ZP={shell:"Shell",exec_command:"Shell",shell_command:"Shell",write_stdin:"stdin",wait:"wait",apply_patch:"Edit",update_plan:"Plan"};function JP(e){const n=nN(e);if(n){const s=tN[n.server.toLowerCase()];return s?{emoji:s.emoji,label:s.name}:{emoji:"🔌",label:n.server,hue:KP(n.server)}}const i=ZP[e];return i?{emoji:Gw(e),label:i}:{emoji:Gw(e),label:e}}function e3(e){return e.endedAt==null?"inflight":e.ok===!1?"err":"done"}function t3(e,n,i){if(i==null)return 1;const s=n-i;return s<0?1:Math.max(0,1-s/JE)}function n3(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>JE)continue;const d=s.get(c.id)??i.get(c.id);if(!d)continue;const h=c.tools.slice(-4);if(h.length===0)continue;const p=c.exitAt??null,m=o.get(c.id),y=Math.max((m==null?void 0:m.width)??Vw,Vw),x=(m==null?void 0:m.height)??130,N=d.x,_=d.y,S=N+y,b=_+x/2;h.forEach((k,E)=>{const C=E*AP,A=N+y+IP,P=_+MP+C,I=t3(k,u,p),M=k.inputPreview??"",R=e3(k),L=I<.999,F=JP(k.name);l.push({id:k.id,toolId:k.id,agentId:c.id,toolName:k.name,name:F.label,emoji:F.emoji,status:R,category:qP(k.name),mcpHue:F.hue,inputPreview:M,fade:I,fading:L,worldX:A,worldY:P,anchorX:S,anchorY:b,spawnDx:S-A,spawnDy:b-(P+Rg)});const Q=QP(k.name,k.input);if(Q){const X=BP(k.name,F.label),j=A+X+PP,G=P,U=A+X,ne=P+Rg;l.push({id:`sub:${k.id}`,toolId:k.id,agentId:c.id,toolName:k.name,name:Q.label,emoji:Q.emoji,isSub:!0,status:R,category:Q.category,inputPreview:Q.detail??M,fade:I,fading:L,worldX:j,worldY:G,anchorX:U,anchorY:ne,spawnDx:U-j,spawnDy:0})}})}return l}function r3({agents:e,visibleAgentIds:n,positions:i,pinned:s,measured:o,dimUnmatched:u,spotlight:l,hiddenCategories:c,now:d,onOpenTool:h}){const{x:p,y:m,zoom:y}=UE(),x=n3(e,n,i,s,o,d),N=c&&c.size>0?x.filter(_=>!c.has(_.category)):x;return v.jsxs("div",{className:"tool-bursts-layer","aria-hidden":!0,children:[v.jsx("svg",{className:"tool-bursts-svg",children:N.map(_=>{const S=_.anchorX*y+p,b=_.anchorY*y+m,k=(_.worldX+6)*y+p,E=(_.worldY+Rg)*y+m,C=S+(k-S)*.55,A=u!=null&&!u.has(_.agentId),P=l!=null&&!l.has(_.agentId),I=_.fade*(A||P?.14:1);return v.jsx("path",{d:`M ${S} ${b} Q ${C} ${b}, ${k} ${E}`,className:`tool-conn status-${_.status}${_.fading?" fading":""}`,opacity:I},`l:${_.id}`)})}),N.map(_=>{const S=_.worldX*y+p,b=_.worldY*y+m,k={left:`${S}px`,top:`${b}px`,transform:`scale(${y})`,transformOrigin:"left top","--spawn-dx":`${_.spawnDx}px`,"--spawn-dy":`${_.spawnDy}px`},E=_.isSub?`${_.toolName} · ${_.name}`:_.toolName,C=_.inputPreview?`${E} · ${_.inputPreview}`:E,A=h!=null,P=_.mcpHue!=null?{"--cat-accent":`hsl(${_.mcpHue} 65% 65%)`}:{},I=u!=null&&!u.has(_.agentId),M=l!=null&&!l.has(_.agentId),R=I||M?" dim":"";return v.jsx("div",{className:"tool-burst-wrap",style:k,children:v.jsxs("div",{className:`tool-burst cat-${_.category} status-${_.status}${_.fading?" fading":""}${A?" clickable":""}${_.isSub?" sub":""}${R}`,style:P,title:C,role:A?"button":void 0,tabIndex:A?0:void 0,"aria-label":A?`Open ${_.toolName} ${_.status==="inflight"?"in flight":_.status} — click for details`:void 0,onClick:A?()=>h(_.toolId):void 0,onKeyDown:A?L=>{(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),h(_.toolId))}:void 0,children:[v.jsx("span",{className:"tb-emoji",children:_.emoji}),v.jsx("span",{className:"tb-name",children:_.name}),_.status==="inflight"&&v.jsx("span",{className:"tb-spin"}),_.status==="done"&&v.jsx("span",{className:"tb-mark done",children:"✓"}),_.status==="err"&&v.jsx("span",{className:"tb-mark err",children:"×"})]})},_.id)})]})}function i3({state:e,sessionId:n,onClose:i}){const s=q.useMemo(()=>o3(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:He(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:Bo(o)},o))})]}),v.jsx("div",{className:"ss-hero-right",children:s.cost.total>0&&v.jsxs(v.Fragment,{children:[v.jsx(s3,{cost:s.cost}),v.jsxs("div",{className:"ss-cost-legend",children:[v.jsxs("span",{className:"ssl ssl-in",children:["input ",v.jsx("b",{children:He(s.cost.input)})]}),v.jsxs("span",{className:"ssl ssl-out",children:["output ",v.jsx("b",{children:He(s.cost.output)})]}),v.jsxs("span",{className:"ssl ssl-cr",children:["cache r ",v.jsx("b",{children:He(s.cost.cacheRead)})]}),v.jsxs("span",{className:"ssl ssl-cw",children:["cache w ",v.jsx("b",{children:He(s.cost.cacheWrite)})]})]})]})})]}),v.jsxs("section",{className:"ss-stats",children:[v.jsx(xs,{label:"agents",value:s.agentCount}),v.jsx(xs,{label:"subagents",value:s.subagentCount}),v.jsx(xs,{label:"tool calls",value:s.toolCount}),v.jsx(xs,{label:"prompts",value:s.promptCount}),v.jsx(xs,{label:"tokens",value:s.tokensSum.toLocaleString()}),s.errCount>0&&v.jsx(xs,{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 xs({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 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}: ${He(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 o3(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,h=0,p=0,m=0,y,x=1/0,N=0;for(const E of s){const C=rn(E.usage,E.model);o.input+=C.input,o.output+=C.output,o.cacheRead+=C.cacheRead,o.cacheWrite+=C.cacheWrite,o.total+=C.total,E.model&&u.add(E.model),E.kind==="subagent"&&m++,d+=E.prompts.length,!y&&E.prompts.length>0&&(y=E.prompts[0].text),h+=E.usage.inputTokens+E.usage.outputTokens,c+=E.tools.length,x=Math.min(x,E.startedAt),N=Math.max(N,E.endedAt??Date.now());for(const A of E.tools)l.set(A.name,(l.get(A.name)??0)+1),A.ok===!1&&p++}const _=Math.max(0,N-x),S=Math.floor(_/1e3),b=S<60?`${S}s`:S<3600?`${Math.floor(S/60)}m ${String(S%60).padStart(2,"0")}s`:`${Math.floor(S/3600)}h ${Math.floor(S%3600/60)}m`,k=Array.from(l.entries()).sort((E,C)=>C[1]-E[1]).slice(0,5);return{sessionId:n,label:i.label||i.cwdBasename||"session",cwd:i.cwd,durationLabel:b,cost:o,modelChips:Array.from(u),agentCount:s.length,subagentCount:m,toolCount:c,promptCount:d,tokensSum:h,errCount:p,topTools:k,firstPrompt:y}}function a3(e,n){const i=[];for(const s of e.agents.values()){if(s.kind!=="root")continue;let o=s.tools.length,u=rn(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+=rn(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 u3(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 l3({state:e,now:n,selectedIds:i,onSelect:s,onClose:o}){const u=q.useMemo(()=>a3(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:Bo(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:He(c.cost)})}),v.jsx("span",{className:"sl-elapsed",title:`Started ${new Date(c.startedAt).toLocaleString()}`,children:u3(c.startedAt,c.state==="active"?void 0:c.lastActivity,n)})]})]})]},c.sessionId)})]})]})}function Xw(e,n){if(!e)return null;const i=n-Math.floor(e/1e3);return i<10?"just now":i<60?`${i}s ago`:i<3600?`${Math.floor(i/60)}m ago`:`${Math.floor(i/3600)}h ago`}function c3(e){return e==="claude-swap"?"Read from claude-swap's last collection — costs no request against your usage-endpoint budget":e==="api"?"Fetched from Anthropic's usage endpoint, at most once every 5 minutes":e==="cli"?"Parsed from `claude /usage`, at most once every 5 minutes":"Last update"}function pr(e){return e<1e3?`${e}`:e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(2)}M`}function f3({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}: ${He(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 d3(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 h3(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,h=u>0?e/u:0,p=h>0?d/h:1/0,m={label:`${Math.round(c)}% ahead`,color:"var(--warn)",expectedPct:l,isDeficit:!0};if(p<o&&p<86400){const y=Math.floor(p/3600),x=Math.floor(p%3600/60);m.runsOutIn=y>0?`${y}h ${x}m`:`${x}m`}return m}return{label:`${Math.round(-c)}% reserve`,color:"var(--ok)",expectedPct:l,isDeficit:!1}}function bi({pct:e,label:n,reset:i,resetAt:s,windowSec:o,limitReached:u,nowSec:l}){const c=Math.min(100,Math.max(0,e)),h=u||c>=90?"var(--err)":c>=70?"var(--warn)":"var(--accent)",p=c===0?"< 1%":`${c}%`,m=c===0?2:c,y=s?d3(s,l):null,x=s&&o?h3(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:h},children:p})]}),v.jsxs("div",{className:"qb-track",children:[v.jsx("div",{className:"qb-fill",style:{width:`${m}%`,background:h,opacity:c===0?.4:1}}),x&&v.jsx("div",{className:"qb-pace-marker",style:{left:`${x.expectedPct}%`,background:x.isDeficit?"var(--err)":"var(--ok)"},title:`To last until reset, stay near ${Math.round(x.expectedPct)}% by now`})]}),v.jsxs("div",{className:"qb-reset-row",children:[y?v.jsxs("span",{className:"qb-reset",children:["resets in ",y]}):i?v.jsxs("span",{className:"qb-reset",children:["resets ",i]}):null,x&&v.jsx("span",{className:"qb-pace",style:{color:x.color},children:x.runsOutIn?`runs out in ${x.runsOutIn}`:x.label})]})]})}const p3=6e4;function m3(){const[e,n]=q.useState(null),[i,s]=q.useState(!1),o=q.useRef(null),u=async(c=!1)=>{c&&s(!0);try{const h=await fetch(c?"/api/quota?refresh=1":"/api/quota");h.ok&&n(await h.json())}catch{}finally{c&&s(!1)}};return q.useEffect(()=>(u(!0),o.current=window.setInterval(()=>u(!1),p3),()=>{o.current!=null&&window.clearInterval(o.current)}),[]),{quota:e,loading:i,refresh:()=>u(!0)}}function g3(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 rN=6e4;function v3(){const[e,n]=q.useState(null),[i,s]=q.useState(!1),o=q.useRef(null),u=async(c=!1)=>{c&&s(!0);try{const h=await fetch(c?"/api/codex-quota?refresh=1":"/api/codex-quota");h.ok&&n(await h.json())}catch{}finally{c&&s(!1)}};return q.useEffect(()=>(u(!0),o.current=window.setInterval(()=>u(!1),rN),()=>{o.current!=null&&window.clearInterval(o.current)}),[]),{data:e,loading:i,refresh:()=>u(!0)}}function y3(){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,rN),()=>{i.current!=null&&window.clearInterval(i.current)}),[]),{data:e}}function w3({state:e,now:n,onClose:i}){var I,M;const{quota:s,loading:o,refresh:u}=m3(),{data:l,loading:c,refresh:d}=v3(),{data:h}=y3(),[p,m]=q.useState(()=>Math.floor(Date.now()/1e3));q.useEffect(()=>{const R=window.setInterval(()=>m(Math.floor(Date.now()/1e3)),3e4);return()=>window.clearInterval(R)},[]);const{byModel:y,totalCost:x,totalTokens:N,burnRate:_}=q.useMemo(()=>{const R=new Map,L={total:0,input:0,output:0,cacheRead:0,cacheWrite:0};let F=0,Q=0,X=0,j=0;for(const D of e.agents.values()){const V=D.model??"__unknown__",O=rn(D.usage,D.model),B=R.get(V);B?(B.inputTokens+=D.usage.inputTokens,B.outputTokens+=D.usage.outputTokens,B.cacheReadTokens+=D.usage.cacheReadTokens,B.cacheCreateTokens+=D.usage.cacheCreateTokens,B.cost.total+=O.total,B.cost.input+=O.input,B.cost.output+=O.output,B.cost.cacheRead+=O.cacheRead,B.cost.cacheWrite+=O.cacheWrite,B.agentCount++):R.set(V,{model:V,inputTokens:D.usage.inputTokens,outputTokens:D.usage.outputTokens,cacheReadTokens:D.usage.cacheReadTokens,cacheCreateTokens:D.usage.cacheCreateTokens,cost:{...O},agentCount:1}),L.total+=O.total,L.input+=O.input,L.output+=O.output,L.cacheRead+=O.cacheRead,L.cacheWrite+=O.cacheWrite,F+=D.usage.inputTokens,Q+=D.usage.outputTokens,X+=D.usage.cacheReadTokens,j+=D.usage.cacheCreateTokens}const G=Array.from(R.values()).sort((D,V)=>V.cost.total-D.cost.total);let U=0,ne=0;for(const D of e.agents.values()){if(D.state!=="active")continue;const V=rn(D.usage,D.model);U+=V.total,ne=Math.max(ne,((D.endedAt??n)-D.startedAt)/1e3)}const K=ne>0?ku(U,ne):null;return{byModel:G,totalCost:L,totalTokens:{in:F,out:Q,cacheR:X,cacheC:j},burnRate:K}},[e,e.lastSeq,n]),S=q.useMemo(()=>{const R=[];for(const L of e.agents.values()){if(L.kind!=="root")continue;let F=rn(L.usage,L.model).total,Q=L.usage.inputTokens,X=L.usage.outputTokens;for(const j of e.agents.values())j.sessionId!==L.sessionId||j.kind==="root"||(F+=rn(j.usage,j.model).total,Q+=j.usage.inputTokens,X+=j.usage.outputTokens);R.push({sessionId:L.sessionId,label:L.label||L.cwdBasename||"session",state:L.state,cost:F,inputTokens:Q,outputTokens:X})}return R.sort((L,F)=>F.cost-L.cost).slice(0,12)},[e,e.lastSeq]),b=x.total>0,k=N.in+N.out,E=o||c,C=Xw(s==null?void 0:s.fetchedAt,p),A=Xw(l==null?void 0:l.fetchedAt,p),P=()=>{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:[v.jsx("button",{type:"button",className:"btn up-refresh-btn",onClick:P,disabled:E,title:"Refresh Claude + Codex quota",children:E?"…":"↻"}),v.jsx("button",{type:"button",className:"btn icon-btn up-close",onClick:i,"aria-label":"Close usage panel",title:"Close (U)",children:"×"})]})]}),v.jsxs("section",{className:"up-section up-quota-section",children:[v.jsxs("h4",{className:"up-section-title",children:["Claude quota",C&&!o&&v.jsx("span",{className:"up-section-age",title:c3(s==null?void 0:s.source),children:C})]}),s!=null&&s.ok?v.jsxs("div",{className:"up-quota-bars",children:[s.session5hPct!=null&&v.jsx(bi,{label:"5-hour window",pct:s.session5hPct,reset:s.session5hReset,resetAt:s.session5hResetAt,windowSec:s.session5hWindowSec,nowSec:p}),s.week7dPct!=null&&v.jsx(bi,{label:"7-day window",pct:s.week7dPct,reset:s.week7dReset,resetAt:s.week7dResetAt,windowSec:s.week7dWindowSec,nowSec:p}),s.weekSonnetPct!=null&&v.jsx(bi,{label:"Sonnet (7d)",pct:s.weekSonnetPct,nowSec:p}),s.weekOpusPct!=null&&v.jsx(bi,{label:"Opus (7d)",pct:s.weekOpusPct,nowSec:p})]}):(s==null?void 0:s.ok)===!1?v.jsxs("div",{className:"up-quota-na",children:[v.jsx("span",{children:"Quota unavailable."}),v.jsxs("span",{className:"up-quota-hint",children:["Run ",v.jsx("code",{children:"/usage"})," in a claude session, then click ↻"]})]}):v.jsx("div",{className:"up-quota-na up-quota-loading",children:"Checking…"})]}),v.jsxs("section",{className:"up-section up-quota-section",children:[v.jsxs("h4",{className:"up-section-title",children:["Codex quota",(l==null?void 0:l.ok)&&l.planLabel&&v.jsx("span",{className:"up-plan-badge",children:l.planLabel}),A&&!c&&v.jsx("span",{className:"up-section-age",title:"Fetched from the Codex usage endpoint",children:A})]}),l!=null&&l.ok?v.jsxs("div",{className:"up-quota-bars",children:[(I=l.windows)==null?void 0:I.map(R=>v.jsx(bi,{label:R.label,pct:R.pct,reset:R.reset??void 0,resetAt:R.resetAt??void 0,windowSec:R.windowSec??void 0,limitReached:l.limitReached&&R.pct>=100,nowSec:p},R.id)),(M=l.extraWindows)==null?void 0:M.map(R=>v.jsx(bi,{label:R.label,pct:R.pct,reset:R.reset??void 0,resetAt:R.resetAt??void 0,windowSec:R.windowSec??void 0,nowSec:p},R.id)),l.creditLimit&&v.jsx(bi,{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:p}),(h==null?void 0:h.ok)&&h.window7d&&h.window7d.sessionCount>0&&v.jsxs("div",{className:"up-quota-sub",children:[pr(h.window7d.totalTokens)," tokens · ",h.window7d.sessionCount," session",h.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:g3(l.reason)})]}):v.jsx("div",{className:"up-quota-na up-quota-loading",children:"Checking…"})]}),b?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"up-total",children:[v.jsx("span",{className:"up-total-value",children:He(x.total)}),v.jsx("span",{className:"up-total-label",children:"total spend"})]}),v.jsx(f3,{cost:x}),k>0&&v.jsxs("div",{className:"up-tokens-row",children:[v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"in"}),pr(N.in)]}),v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"out"}),pr(N.out)]}),N.cacheR>0&&v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"cache r"}),pr(N.cacheR)]}),N.cacheC>0&&v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"cache c"}),pr(N.cacheC)]})]}),y.filter(R=>R.cost.total>0).length>0&&v.jsxs("section",{className:"up-section",children:[v.jsx("h4",{className:"up-section-title",children:"By model"}),v.jsxs("table",{className:"up-table",children:[v.jsx("thead",{children:v.jsxs("tr",{children:[v.jsx("th",{children:"Model"}),v.jsx("th",{children:"Tokens"}),v.jsx("th",{children:"Cost"})]})}),v.jsx("tbody",{children:y.filter(R=>R.cost.total>0).map(R=>v.jsxs("tr",{children:[v.jsx("td",{className:"up-model-name",title:R.model,children:Bo(R.model)}),v.jsx("td",{className:"up-num",children:pr(R.inputTokens+R.outputTokens)}),v.jsx("td",{className:"up-num up-cost-val",children:He(R.cost.total)})]},R.model))})]})]}),S.filter(R=>R.cost>0).length>0&&v.jsxs("section",{className:"up-section",children:[v.jsx("h4",{className:"up-section-title",children:"By session"}),v.jsx("div",{className:"up-sessions",children:S.filter(R=>R.cost>0).map(R=>v.jsxs("div",{className:"up-session-row",children:[v.jsx("span",{className:`sl-dot state-${R.state}`,"aria-hidden":!0}),v.jsx("span",{className:"up-session-label",children:R.label}),v.jsx("span",{className:"up-session-tokens",children:pr(R.inputTokens+R.outputTokens)}),v.jsx("span",{className:"up-session-cost",children:He(R.cost)})]},R.sessionId))})]})]}):k>0?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"up-tokens-row",children:[v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"in"}),pr(N.in)]}),v.jsxs("span",{className:"up-tok",children:[v.jsx("span",{className:"up-k",children:"out"}),pr(N.out)]})]}),v.jsx("div",{className:"up-hint",children:"Cost appears once a known model is detected."})]}):v.jsxs("div",{className:"up-empty",children:["No usage data yet.",v.jsx("br",{}),"Start a Claude Code or Codex session."]})]})}const x3=15e3,_3=[70,80,85,90,95];function S3(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 Qw(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 b3(e){return e==="http-429"?"rate limited":e==="http-401"?"re-login needed":e==="timeout"?"timed out":e==="network"?"unreachable":e}function k3({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?S3(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 E3({onClose:e}){var A,P,I;const[n,i]=q.useState(null),[s,o]=q.useState(null),[u,l]=q.useState(null),[c,d]=q.useState(null),[h,p]=q.useState(null),[m,y]=q.useState(()=>Math.floor(Date.now()/1e3)),x=q.useRef(null),N=q.useCallback(async(M=!1)=>{try{const[R,L]=await Promise.all([fetch(`/api/claude-accounts${M?"?refresh=1":""}`),fetch("/api/cswap-auto")]);R.ok&&i(await R.json()),L.ok&&o(await L.json())}catch{}},[]),_=q.useCallback(async(M,R)=>{l(R),p(null);try{const F=await(await fetch("/api/cswap-auto",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(M)})).json().catch(()=>null);return F!=null&&F.ok||p((F==null?void 0:F.detail)||(F==null?void 0:F.reason)||"command failed"),F}catch{return p("server unreachable"),null}finally{l(null)}},[]);q.useEffect(()=>(N(!0),x.current=window.setInterval(()=>N(!1),x3),()=>{x.current!=null&&window.clearInterval(x.current)}),[N]),q.useEffect(()=>{const M=window.setInterval(()=>y(Math.floor(Date.now()/1e3)),3e4);return()=>window.clearInterval(M)},[]);const S=((A=s==null?void 0:s.settings["autoswitch.threshold"])==null?void 0:A.value)??"90",b=(P=n==null?void 0:n.accounts)==null?void 0:P.find(M=>M.active),k=b!=null&&b.lanes.length?Math.max(...b.lanes.map(M=>M.pct)):null,E=k!=null&&k>=Number(S)-15,C=async M=>{d(M),p(null);try{const L=await(await fetch("/api/claude-accounts/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({account:M})})).json().catch(()=>null);L!=null&&L.ok||p((L==null?void 0:L.output)||(L==null?void 0:L.reason)||"switch failed"),await N(!0)}catch{p("server unreachable")}finally{d(null)}};return v.jsxs("div",{className:"accounts-panel","aria-label":"Claude accounts",children:[v.jsxs("div",{className:"ap-header",children:[v.jsx("h3",{children:"Accounts"}),v.jsxs("div",{className:"ap-header-right",children:[v.jsx("button",{type:"button",className:"btn ap-refresh",onClick:()=>N(!0),title:"Reload from claude-swap",children:"↻"}),v.jsx("button",{type:"button",className:"btn icon-btn",onClick:e,"aria-label":"Close accounts panel",title:"Close (A)",children:"×"})]})]}),n==null?v.jsx("div",{className:"ap-empty",children:"Checking…"}):n.ok?v.jsxs(v.Fragment,{children:[(I=n.accounts)==null?void 0:I.map(M=>v.jsxs("div",{className:`ap-account${M.active?" active":""}${M.disabled?" disabled":""}`,children:[v.jsxs("div",{className:"ap-account-head",children:[v.jsx("span",{className:"ap-num",children:M.num}),M.alias&&v.jsx("span",{className:"ap-alias",children:M.alias}),v.jsx("span",{className:"ap-email",title:M.org??void 0,children:M.email}),M.active?v.jsx("span",{className:"ap-badge-active",children:"● active"}):v.jsx("button",{type:"button",className:"btn ap-switch",disabled:c!=null||M.disabled,onClick:()=>C(M.num),title:M.disabled?"Held out of rotation":`Switch to ${M.alias??M.email}`,children:c===M.num?"…":"switch"})]}),M.lanes.length>0?M.lanes.map(R=>v.jsx(k3,{lane:R,nowSec:m},R.id)):v.jsx("div",{className:"ap-hint",children:"No usage recorded yet."}),v.jsxs("div",{className:"ap-meta",children:[M.error&&v.jsx("span",{className:"ap-err",children:b3(M.error)}),M.fetchedAt?v.jsx("span",{className:M.stale?"ap-stale":void 0,children:Qw(M.fetchedAt,m)}):v.jsx("span",{className:"ap-stale",children:"never fetched"}),((s==null?void 0:s.enabled)||(s==null?void 0:s.external))&&!M.active&&v.jsx("button",{type:"button",className:"ap-rotate",disabled:u!=null,onClick:()=>_({action:"account",account:M.num,enabled:M.disabled},`rot-${M.num}`).then(()=>N(!0)),title:M.disabled?"Return this account to auto-rotation":"Hold this account out of auto-rotation",children:M.disabled?"held out":"in rotation"})]})]},M.num)),(s==null?void 0:s.ok)&&v.jsxs("div",{className:"ap-auto",children:[v.jsxs("div",{className:"ap-auto-head",children:[v.jsx("span",{className:"ap-auto-title",children:"Auto-switch"}),v.jsxs("span",{className:"ap-auto-ctl",children:[k!=null&&v.jsxs("span",{className:`ap-auto-now${E?" near":""}`,children:[Math.round(k),"%"]}),v.jsx("span",{className:"ap-field",title:"Switch once the active account passes this much of its limit",children:v.jsx("select",{"aria-label":"Switch threshold",value:S,disabled:u!=null,onChange:M=>_({action:"setting",key:"autoswitch.threshold",value:M.target.value},"threshold").then(()=>N(!0)),children:_3.map(M=>v.jsxs("option",{value:M,children:[M,"%"]},M))})}),v.jsxs("button",{type:"button",className:`ap-auto-state toggle${s.enabled?" live":""}`,role:"switch","aria-checked":s.enabled,disabled:u!=null,onClick:()=>_({action:"enable",enabled:!s.enabled},"enable").then(()=>N(!0)),title:s.enabled?"Stop switching accounts automatically":"Switch accounts automatically when the active one nears its limit",children:[v.jsx("i",{className:s.enabled?"ap-pulse":"ap-dot","aria-hidden":!0}),s.enabled?"on":"off"]})]})]}),s.external&&v.jsxs("p",{className:"ap-auto-note",children:[v.jsx("i",{className:"ap-pulse","aria-hidden":!0})," A ",v.jsx("code",{children:"cswap auto"})," loop in your terminal is doing the switching. The deck stands down while it runs",s.enabled?" — this toggle takes over when you stop it.":"."]}),s.lastTick&&v.jsx("div",{className:"ap-auto-foot",children:v.jsxs("span",{className:"ap-auto-result",children:["checked ",Qw(s.lastTick.at,m)]})})]}),h&&v.jsx("div",{className:"ap-failure",children:h}),v.jsx("p",{className:"ap-footnote",title:"Anthropic's usage endpoint allows roughly 28–30 requests per hour per account, shared by every tool on this machine. Polling it from here would rate-limit your account, so the deck reads what claude-swap already collected.",children:"Read from claude-swap, not polled."})]}):v.jsx("div",{className:"ap-empty",children:n.reason==="no_cswap"?v.jsxs(v.Fragment,{children:[v.jsx("span",{children:"claude-swap isn't installed."}),v.jsx("span",{className:"ap-hint",children:"This panel reads the account store claude-swap keeps — without it there is nothing to show. It is a separate tool, published on PyPI, so it does not come with this package."}),n.hint&&v.jsx("code",{className:"ap-cmd",children:n.hint}),v.jsxs("span",{className:"ap-hint",children:["Then add your accounts with ",v.jsx("code",{children:"cswap add"})," and reload."]})]}):n.reason==="no_accounts"?v.jsxs(v.Fragment,{children:[v.jsx("span",{children:"No accounts added yet."}),v.jsx("span",{className:"ap-hint",children:"claude-swap is installed but has nothing in its store."}),v.jsx("code",{className:"ap-cmd",children:"cswap add"})]}):v.jsxs(v.Fragment,{children:[v.jsx("span",{children:"Couldn't read the account store."}),v.jsxs("span",{className:"ap-hint",children:["claude-swap is installed, but its store could not be read",n.reason?` (${n.reason})`:"","."]})]})})]})}function ki(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 Zw(e){return e.replace(/^anthropic\./,"").replace(/^claude-/,"").replace(/-\d{8}$/,"")}function ou(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 N3(e){return new Date(Date.now()-(e-1)*864e5).toISOString().slice(0,10).replace(/-/g,"")}const C3=[7,14,30,90];function T3(e){const[n,i]=q.useState(null),[s,o]=q.useState(!1),u=(l=!1)=>{o(!0);const d=`/api/ccusage?since=${N3(e)}${l?"&refresh=1":""}`;fetch(d).then(h=>h.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 R3({onClose:e}){var b,k;const[n,i]=q.useState(30),[s,o]=q.useState(null),{data:u,loading:l,reload:c}=T3(n);q.useEffect(()=>{const E=C=>{C.key==="Escape"&&e()};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[e]);const d=u!=null&&u.ok?u.days??[]:[],h=q.useMemo(()=>d.reduce((E,C)=>Math.max(E,C.totalCost),0),[d]),{totalCost:p,totalTok:m,inOut:y,cacheRead:x,modelCosts:N}=q.useMemo(()=>{let E=0,C=0,A=0,P=0;const I=new Map;for(const M of d){E+=M.totalCost,C+=M.totalTokens,A+=M.inputTokens+M.outputTokens,P+=M.cacheReadTokens;for(const R of M.modelBreakdowns)I.set(R.modelName,(I.get(R.modelName)??0)+R.cost)}return{totalCost:E,totalTok:C,inOut:A,cacheRead:P,modelCosts:I}},[d]),_=q.useMemo(()=>Array.from(N.entries()).sort((E,C)=>C[1]-E[1]),[N]),S=s?d.find(E=>E.period===s)??null:null;return v.jsx("div",{className:"uh-backdrop",onClick:e,role:"presentation",children:v.jsxs("div",{className:"uh-modal",onClick:E=>E.stopPropagation(),role:"dialog","aria-label":"Usage history",children:[v.jsxs("header",{className:"uh-head",children:[v.jsxs("div",{className:"uh-titlewrap",children:[v.jsx("div",{className:"uh-title",children:"Usage history"}),v.jsx("div",{className:"uh-sub",children:"via ccusage · local Claude / Codex logs"})]}),v.jsx("div",{className:"uh-range",role:"tablist","aria-label":"Range",children:C3.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(au,{label:"total cost",val:He(p),accent:!0}),v.jsx(au,{label:"tokens",val:ki(m)}),v.jsx(au,{label:"input+output",val:ki(y)}),v.jsx(au,{label:"cache reads",val:ki(x)})]}),v.jsx("div",{className:"uh-chart",role:"img","aria-label":"Daily cost by model",children:d.map(E=>{const C=h>0?E.totalCost/h*100:0,A=E.period===s;return v.jsxs("button",{className:`uh-bar-col${A?" sel":""}`,onClick:()=>o(A?null:E.period),title:`${E.period} · ${He(E.totalCost)}`,style:{flexBasis:`${100/d.length}%`},children:[v.jsx("div",{className:"uh-bar",style:{height:`${Math.max(C,E.totalCost>0?2:0)}%`},children:E.modelBreakdowns.slice().sort((P,I)=>I.cost-P.cost).map(P=>{const I=E.totalCost>0?P.cost/E.totalCost*100:0;return v.jsx("div",{className:"uh-bar-seg",style:{height:`${I}%`,background:ou(P.modelName)}},P.modelName)})}),v.jsx("span",{className:"uh-bar-label",children:E.period.slice(5)})]},E.period)})}),v.jsx("div",{className:"uh-legend",children:_.map(([E,C])=>v.jsxs("span",{className:"uh-legend-item",children:[v.jsx("span",{className:"uh-legend-dot",style:{background:ou(E)}}),Zw(E)," ",v.jsx("span",{className:"uh-legend-cost",children:He(C)})]},E))}),S&&v.jsxs("div",{className:"uh-detail",children:[v.jsxs("div",{className:"uh-detail-head",children:[v.jsx("span",{className:"uh-detail-date",children:S.period}),v.jsx("span",{className:"uh-detail-cost",children:He(S.totalCost)}),(k=(b=S.metadata)==null?void 0:b.agents)!=null&&k.length?v.jsx("span",{className:"uh-detail-agents",children:S.metadata.agents.join(" · ")}):null]}),v.jsxs("div",{className:"uh-detail-mini",children:[v.jsx(uu,{label:"input",val:ki(S.inputTokens)}),v.jsx(uu,{label:"output",val:ki(S.outputTokens)}),v.jsx(uu,{label:"cache write",val:ki(S.cacheCreationTokens)}),v.jsx(uu,{label:"cache read",val:ki(S.cacheReadTokens)})]}),v.jsx("div",{className:"uh-detail-models",children:S.modelBreakdowns.slice().sort((E,C)=>C.cost-E.cost).map(E=>{const C=S.totalCost>0?E.cost/S.totalCost*100:0;return v.jsxs("div",{className:"uh-model-row",children:[v.jsxs("span",{className:"uh-model-name",children:[v.jsx("span",{className:"uh-legend-dot",style:{background:ou(E.modelName)}}),Zw(E.modelName)]}),v.jsx("span",{className:"uh-model-bar",children:v.jsx("span",{className:"uh-model-bar-fill",style:{width:`${C}%`,background:ou(E.modelName)}})}),v.jsx("span",{className:"uh-model-cost",children:He(E.cost)})]},E.modelName)})})]})]})]})})}function au({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 uu({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 ev(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 Wc,Jw;function j3(){if(Jw)return Wc;Jw=1;function e(){this.__data__=[],this.size=0}return Wc=e,Wc}var Gc,ex;function Is(){if(ex)return Gc;ex=1;function e(n,i){return n===i||n!==n&&i!==i}return Gc=e,Gc}var Yc,tx;function Mu(){if(tx)return Yc;tx=1;var e=Is();function n(i,s){for(var o=i.length;o--;)if(e(i[o][0],s))return o;return-1}return Yc=n,Yc}var Kc,nx;function A3(){if(nx)return Kc;nx=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 Kc=s,Kc}var Xc,rx;function I3(){if(rx)return Xc;rx=1;var e=Mu();function n(i){var s=this.__data__,o=e(s,i);return o<0?void 0:s[o][1]}return Xc=n,Xc}var Qc,ix;function M3(){if(ix)return Qc;ix=1;var e=Mu();function n(i){return e(this.__data__,i)>-1}return Qc=n,Qc}var Zc,sx;function P3(){if(sx)return Zc;sx=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 Zc=n,Zc}var Jc,ox;function Pu(){if(ox)return Jc;ox=1;var e=j3(),n=A3(),i=I3(),s=M3(),o=P3();function u(l){var c=-1,d=l==null?0:l.length;for(this.clear();++c<d;){var h=l[c];this.set(h[0],h[1])}}return u.prototype.clear=e,u.prototype.delete=n,u.prototype.get=i,u.prototype.has=s,u.prototype.set=o,Jc=u,Jc}var ef,ax;function O3(){if(ax)return ef;ax=1;var e=Pu();function n(){this.__data__=new e,this.size=0}return ef=n,ef}var tf,ux;function q3(){if(ux)return tf;ux=1;function e(n){var i=this.__data__,s=i.delete(n);return this.size=i.size,s}return tf=e,tf}var nf,lx;function L3(){if(lx)return nf;lx=1;function e(n){return this.__data__.get(n)}return nf=e,nf}var rf,cx;function $3(){if(cx)return rf;cx=1;function e(n){return this.__data__.has(n)}return rf=e,rf}var sf,fx;function iN(){if(fx)return sf;fx=1;var e=typeof Ya=="object"&&Ya&&Ya.Object===Object&&Ya;return sf=e,sf}var of,dx;function Gn(){if(dx)return of;dx=1;var e=iN(),n=typeof self=="object"&&self&&self.Object===Object&&self,i=e||n||Function("return this")();return of=i,of}var af,hx;function Ms(){if(hx)return af;hx=1;var e=Gn(),n=e.Symbol;return af=n,af}var uf,px;function D3(){if(px)return uf;px=1;var e=Ms(),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 h=!0}catch{}var p=s.call(l);return h&&(c?l[o]=d:delete l[o]),p}return uf=u,uf}var lf,mx;function F3(){if(mx)return lf;mx=1;var e=Object.prototype,n=e.toString;function i(s){return n.call(s)}return lf=i,lf}var cf,gx;function Pi(){if(gx)return cf;gx=1;var e=Ms(),n=D3(),i=F3(),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 cf=l,cf}var ff,vx;function An(){if(vx)return ff;vx=1;function e(n){var i=typeof n;return n!=null&&(i=="object"||i=="function")}return ff=e,ff}var df,yx;function Uo(){if(yx)return df;yx=1;var e=Pi(),n=An(),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 df=l,df}var hf,wx;function z3(){if(wx)return hf;wx=1;var e=Gn(),n=e["__core-js_shared__"];return hf=n,hf}var pf,xx;function B3(){if(xx)return pf;xx=1;var e=z3(),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 pf=i,pf}var mf,_x;function sN(){if(_x)return mf;_x=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 mf=i,mf}var gf,Sx;function U3(){if(Sx)return gf;Sx=1;var e=Uo(),n=B3(),i=An(),s=sN(),o=/[\\^$.*+?()[\]{}|]/g,u=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,d=l.toString,h=c.hasOwnProperty,p=RegExp("^"+d.call(h).replace(o,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function m(y){if(!i(y)||n(y))return!1;var x=e(y)?p:u;return x.test(s(y))}return gf=m,gf}var vf,bx;function H3(){if(bx)return vf;bx=1;function e(n,i){return n==null?void 0:n[i]}return vf=e,vf}var yf,kx;function Oi(){if(kx)return yf;kx=1;var e=U3(),n=H3();function i(s,o){var u=n(s,o);return e(u)?u:void 0}return yf=i,yf}var wf,Ex;function tv(){if(Ex)return wf;Ex=1;var e=Oi(),n=Gn(),i=e(n,"Map");return wf=i,wf}var xf,Nx;function Ou(){if(Nx)return xf;Nx=1;var e=Oi(),n=e(Object,"create");return xf=n,xf}var _f,Cx;function V3(){if(Cx)return _f;Cx=1;var e=Ou();function n(){this.__data__=e?e(null):{},this.size=0}return _f=n,_f}var Sf,Tx;function W3(){if(Tx)return Sf;Tx=1;function e(n){var i=this.has(n)&&delete this.__data__[n];return this.size-=i?1:0,i}return Sf=e,Sf}var bf,Rx;function G3(){if(Rx)return bf;Rx=1;var e=Ou(),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 bf=o,bf}var kf,jx;function Y3(){if(jx)return kf;jx=1;var e=Ou(),n=Object.prototype,i=n.hasOwnProperty;function s(o){var u=this.__data__;return e?u[o]!==void 0:i.call(u,o)}return kf=s,kf}var Ef,Ax;function K3(){if(Ax)return Ef;Ax=1;var e=Ou(),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 Ef=i,Ef}var Nf,Ix;function X3(){if(Ix)return Nf;Ix=1;var e=V3(),n=W3(),i=G3(),s=Y3(),o=K3();function u(l){var c=-1,d=l==null?0:l.length;for(this.clear();++c<d;){var h=l[c];this.set(h[0],h[1])}}return u.prototype.clear=e,u.prototype.delete=n,u.prototype.get=i,u.prototype.has=s,u.prototype.set=o,Nf=u,Nf}var Cf,Mx;function Q3(){if(Mx)return Cf;Mx=1;var e=X3(),n=Pu(),i=tv();function s(){this.size=0,this.__data__={hash:new e,map:new(i||n),string:new e}}return Cf=s,Cf}var Tf,Px;function Z3(){if(Px)return Tf;Px=1;function e(n){var i=typeof n;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?n!=="__proto__":n===null}return Tf=e,Tf}var Rf,Ox;function qu(){if(Ox)return Rf;Ox=1;var e=Z3();function n(i,s){var o=i.__data__;return e(s)?o[typeof s=="string"?"string":"hash"]:o.map}return Rf=n,Rf}var jf,qx;function J3(){if(qx)return jf;qx=1;var e=qu();function n(i){var s=e(this,i).delete(i);return this.size-=s?1:0,s}return jf=n,jf}var Af,Lx;function eO(){if(Lx)return Af;Lx=1;var e=qu();function n(i){return e(this,i).get(i)}return Af=n,Af}var If,$x;function tO(){if($x)return If;$x=1;var e=qu();function n(i){return e(this,i).has(i)}return If=n,If}var Mf,Dx;function nO(){if(Dx)return Mf;Dx=1;var e=qu();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 Mf=n,Mf}var Pf,Fx;function nv(){if(Fx)return Pf;Fx=1;var e=Q3(),n=J3(),i=eO(),s=tO(),o=nO();function u(l){var c=-1,d=l==null?0:l.length;for(this.clear();++c<d;){var h=l[c];this.set(h[0],h[1])}}return u.prototype.clear=e,u.prototype.delete=n,u.prototype.get=i,u.prototype.has=s,u.prototype.set=o,Pf=u,Pf}var Of,zx;function rO(){if(zx)return Of;zx=1;var e=Pu(),n=tv(),i=nv(),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 Of=o,Of}var qf,Bx;function Lu(){if(Bx)return qf;Bx=1;var e=Pu(),n=O3(),i=q3(),s=L3(),o=$3(),u=rO();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,qf=l,qf}var Lf,Ux;function rv(){if(Ux)return Lf;Ux=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 Lf=e,Lf}var $f,Hx;function oN(){if(Hx)return $f;Hx=1;var e=Oi(),n=(function(){try{var i=e(Object,"defineProperty");return i({},"",{}),i}catch{}})();return $f=n,$f}var Df,Vx;function $u(){if(Vx)return Df;Vx=1;var e=oN();function n(i,s,o){s=="__proto__"&&e?e(i,s,{configurable:!0,enumerable:!0,value:o,writable:!0}):i[s]=o}return Df=n,Df}var Ff,Wx;function Du(){if(Wx)return Ff;Wx=1;var e=$u(),n=Is(),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 Ff=o,Ff}var zf,Gx;function Ho(){if(Gx)return zf;Gx=1;var e=Du(),n=$u();function i(s,o,u,l){var c=!u;u||(u={});for(var d=-1,h=o.length;++d<h;){var p=o[d],m=l?l(u[p],s[p],p,u,s):void 0;m===void 0&&(m=s[p]),c?n(u,p,m):e(u,p,m)}return u}return zf=i,zf}var Bf,Yx;function iO(){if(Yx)return Bf;Yx=1;function e(n,i){for(var s=-1,o=Array(n);++s<n;)o[s]=i(s);return o}return Bf=e,Bf}var Uf,Kx;function rr(){if(Kx)return Uf;Kx=1;function e(n){return n!=null&&typeof n=="object"}return Uf=e,Uf}var Hf,Xx;function sO(){if(Xx)return Hf;Xx=1;var e=Pi(),n=rr(),i="[object Arguments]";function s(o){return n(o)&&e(o)==i}return Hf=s,Hf}var Vf,Qx;function Vo(){if(Qx)return Vf;Qx=1;var e=sO(),n=rr(),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 Vf=u,Vf}var Wf,Zx;function yt(){if(Zx)return Wf;Zx=1;var e=Array.isArray;return Wf=e,Wf}var Eo={exports:{}},Gf,Jx;function oO(){if(Jx)return Gf;Jx=1;function e(){return!1}return Gf=e,Gf}Eo.exports;var e1;function Ps(){return e1||(e1=1,(function(e,n){var i=Gn(),s=oO(),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,h=d||s;e.exports=h})(Eo,Eo.exports)),Eo.exports}var Yf,t1;function Fu(){if(t1)return Yf;t1=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 Yf=i,Yf}var Kf,n1;function iv(){if(n1)return Kf;n1=1;var e=9007199254740991;function n(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=e}return Kf=n,Kf}var Xf,r1;function aO(){if(r1)return Xf;r1=1;var e=Pi(),n=iv(),i=rr(),s="[object Arguments]",o="[object Array]",u="[object Boolean]",l="[object Date]",c="[object Error]",d="[object Function]",h="[object Map]",p="[object Number]",m="[object Object]",y="[object RegExp]",x="[object Set]",N="[object String]",_="[object WeakMap]",S="[object ArrayBuffer]",b="[object DataView]",k="[object Float32Array]",E="[object Float64Array]",C="[object Int8Array]",A="[object Int16Array]",P="[object Int32Array]",I="[object Uint8Array]",M="[object Uint8ClampedArray]",R="[object Uint16Array]",L="[object Uint32Array]",F={};F[k]=F[E]=F[C]=F[A]=F[P]=F[I]=F[M]=F[R]=F[L]=!0,F[s]=F[o]=F[S]=F[u]=F[b]=F[l]=F[c]=F[d]=F[h]=F[p]=F[m]=F[y]=F[x]=F[N]=F[_]=!1;function Q(X){return i(X)&&n(X.length)&&!!F[e(X)]}return Xf=Q,Xf}var Qf,i1;function zu(){if(i1)return Qf;i1=1;function e(n){return function(i){return n(i)}}return Qf=e,Qf}var No={exports:{}};No.exports;var s1;function sv(){return s1||(s1=1,(function(e,n){var i=iN(),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 Zf,o1;function Wo(){if(o1)return Zf;o1=1;var e=aO(),n=zu(),i=sv(),s=i&&i.isTypedArray,o=s?n(s):e;return Zf=o,Zf}var Jf,a1;function aN(){if(a1)return Jf;a1=1;var e=iO(),n=Vo(),i=yt(),s=Ps(),o=Fu(),u=Wo(),l=Object.prototype,c=l.hasOwnProperty;function d(h,p){var m=i(h),y=!m&&n(h),x=!m&&!y&&s(h),N=!m&&!y&&!x&&u(h),_=m||y||x||N,S=_?e(h.length,String):[],b=S.length;for(var k in h)(p||c.call(h,k))&&!(_&&(k=="length"||x&&(k=="offset"||k=="parent")||N&&(k=="buffer"||k=="byteLength"||k=="byteOffset")||o(k,b)))&&S.push(k);return S}return Jf=d,Jf}var ed,u1;function Bu(){if(u1)return ed;u1=1;var e=Object.prototype;function n(i){var s=i&&i.constructor,o=typeof s=="function"&&s.prototype||e;return i===o}return ed=n,ed}var td,l1;function uN(){if(l1)return td;l1=1;function e(n,i){return function(s){return n(i(s))}}return td=e,td}var nd,c1;function uO(){if(c1)return nd;c1=1;var e=uN(),n=e(Object.keys,Object);return nd=n,nd}var rd,f1;function ov(){if(f1)return rd;f1=1;var e=Bu(),n=uO(),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 rd=o,rd}var id,d1;function wr(){if(d1)return id;d1=1;var e=Uo(),n=iv();function i(s){return s!=null&&n(s.length)&&!e(s)}return id=i,id}var sd,h1;function ei(){if(h1)return sd;h1=1;var e=aN(),n=ov(),i=wr();function s(o){return i(o)?e(o):n(o)}return sd=s,sd}var od,p1;function lO(){if(p1)return od;p1=1;var e=Ho(),n=ei();function i(s,o){return s&&e(o,n(o),s)}return od=i,od}var ad,m1;function cO(){if(m1)return ad;m1=1;function e(n){var i=[];if(n!=null)for(var s in Object(n))i.push(s);return i}return ad=e,ad}var ud,g1;function fO(){if(g1)return ud;g1=1;var e=An(),n=Bu(),i=cO(),s=Object.prototype,o=s.hasOwnProperty;function u(l){if(!e(l))return i(l);var c=n(l),d=[];for(var h in l)h=="constructor"&&(c||!o.call(l,h))||d.push(h);return d}return ud=u,ud}var ld,v1;function qi(){if(v1)return ld;v1=1;var e=aN(),n=fO(),i=wr();function s(o){return i(o)?e(o,!0):n(o)}return ld=s,ld}var cd,y1;function dO(){if(y1)return cd;y1=1;var e=Ho(),n=qi();function i(s,o){return s&&e(o,n(o),s)}return cd=i,cd}var Co={exports:{}};Co.exports;var w1;function lN(){return w1||(w1=1,(function(e,n){var i=Gn(),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(h,p){if(p)return h.slice();var m=h.length,y=c?c(m):new h.constructor(m);return h.copy(y),y}e.exports=d})(Co,Co.exports)),Co.exports}var fd,x1;function cN(){if(x1)return fd;x1=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 fd=e,fd}var dd,_1;function fN(){if(_1)return dd;_1=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 dd=e,dd}var hd,S1;function dN(){if(S1)return hd;S1=1;function e(){return[]}return hd=e,hd}var pd,b1;function av(){if(b1)return pd;b1=1;var e=fN(),n=dN(),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 pd=u,pd}var md,k1;function hO(){if(k1)return md;k1=1;var e=Ho(),n=av();function i(s,o){return e(s,n(s),o)}return md=i,md}var gd,E1;function uv(){if(E1)return gd;E1=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 gd=e,gd}var vd,N1;function Uu(){if(N1)return vd;N1=1;var e=uN(),n=e(Object.getPrototypeOf,Object);return vd=n,vd}var yd,C1;function hN(){if(C1)return yd;C1=1;var e=uv(),n=Uu(),i=av(),s=dN(),o=Object.getOwnPropertySymbols,u=o?function(l){for(var c=[];l;)e(c,i(l)),l=n(l);return c}:s;return yd=u,yd}var wd,T1;function pO(){if(T1)return wd;T1=1;var e=Ho(),n=hN();function i(s,o){return e(s,n(s),o)}return wd=i,wd}var xd,R1;function pN(){if(R1)return xd;R1=1;var e=uv(),n=yt();function i(s,o,u){var l=o(s);return n(s)?l:e(l,u(s))}return xd=i,xd}var _d,j1;function mN(){if(j1)return _d;j1=1;var e=pN(),n=av(),i=ei();function s(o){return e(o,i,n)}return _d=s,_d}var Sd,A1;function mO(){if(A1)return Sd;A1=1;var e=pN(),n=hN(),i=qi();function s(o){return e(o,i,n)}return Sd=s,Sd}var bd,I1;function gO(){if(I1)return bd;I1=1;var e=Oi(),n=Gn(),i=e(n,"DataView");return bd=i,bd}var kd,M1;function vO(){if(M1)return kd;M1=1;var e=Oi(),n=Gn(),i=e(n,"Promise");return kd=i,kd}var Ed,P1;function gN(){if(P1)return Ed;P1=1;var e=Oi(),n=Gn(),i=e(n,"Set");return Ed=i,Ed}var Nd,O1;function yO(){if(O1)return Nd;O1=1;var e=Oi(),n=Gn(),i=e(n,"WeakMap");return Nd=i,Nd}var Cd,q1;function Os(){if(q1)return Cd;q1=1;var e=gO(),n=tv(),i=vO(),s=gN(),o=yO(),u=Pi(),l=sN(),c="[object Map]",d="[object Object]",h="[object Promise]",p="[object Set]",m="[object WeakMap]",y="[object DataView]",x=l(e),N=l(n),_=l(i),S=l(s),b=l(o),k=u;return(e&&k(new e(new ArrayBuffer(1)))!=y||n&&k(new n)!=c||i&&k(i.resolve())!=h||s&&k(new s)!=p||o&&k(new o)!=m)&&(k=function(E){var C=u(E),A=C==d?E.constructor:void 0,P=A?l(A):"";if(P)switch(P){case x:return y;case N:return c;case _:return h;case S:return p;case b:return m}return C}),Cd=k,Cd}var Td,L1;function wO(){if(L1)return Td;L1=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 Td=i,Td}var Rd,$1;function vN(){if($1)return Rd;$1=1;var e=Gn(),n=e.Uint8Array;return Rd=n,Rd}var jd,D1;function lv(){if(D1)return jd;D1=1;var e=vN();function n(i){var s=new i.constructor(i.byteLength);return new e(s).set(new e(i)),s}return jd=n,jd}var Ad,F1;function xO(){if(F1)return Ad;F1=1;var e=lv();function n(i,s){var o=s?e(i.buffer):i.buffer;return new i.constructor(o,i.byteOffset,i.byteLength)}return Ad=n,Ad}var Id,z1;function _O(){if(z1)return Id;z1=1;var e=/\w*$/;function n(i){var s=new i.constructor(i.source,e.exec(i));return s.lastIndex=i.lastIndex,s}return Id=n,Id}var Md,B1;function SO(){if(B1)return Md;B1=1;var e=Ms(),n=e?e.prototype:void 0,i=n?n.valueOf:void 0;function s(o){return i?Object(i.call(o)):{}}return Md=s,Md}var Pd,U1;function yN(){if(U1)return Pd;U1=1;var e=lv();function n(i,s){var o=s?e(i.buffer):i.buffer;return new i.constructor(o,i.byteOffset,i.length)}return Pd=n,Pd}var Od,H1;function bO(){if(H1)return Od;H1=1;var e=lv(),n=xO(),i=_O(),s=SO(),o=yN(),u="[object Boolean]",l="[object Date]",c="[object Map]",d="[object Number]",h="[object RegExp]",p="[object Set]",m="[object String]",y="[object Symbol]",x="[object ArrayBuffer]",N="[object DataView]",_="[object Float32Array]",S="[object Float64Array]",b="[object Int8Array]",k="[object Int16Array]",E="[object Int32Array]",C="[object Uint8Array]",A="[object Uint8ClampedArray]",P="[object Uint16Array]",I="[object Uint32Array]";function M(R,L,F){var Q=R.constructor;switch(L){case x:return e(R);case u:case l:return new Q(+R);case N:return n(R,F);case _:case S:case b:case k:case E:case C:case A:case P:case I:return o(R,F);case c:return new Q;case d:case m:return new Q(R);case h:return i(R);case p:return new Q;case y:return s(R)}}return Od=M,Od}var qd,V1;function wN(){if(V1)return qd;V1=1;var e=An(),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 qd=i,qd}var Ld,W1;function xN(){if(W1)return Ld;W1=1;var e=wN(),n=Uu(),i=Bu();function s(o){return typeof o.constructor=="function"&&!i(o)?e(n(o)):{}}return Ld=s,Ld}var $d,G1;function kO(){if(G1)return $d;G1=1;var e=Os(),n=rr(),i="[object Map]";function s(o){return n(o)&&e(o)==i}return $d=s,$d}var Dd,Y1;function EO(){if(Y1)return Dd;Y1=1;var e=kO(),n=zu(),i=sv(),s=i&&i.isMap,o=s?n(s):e;return Dd=o,Dd}var Fd,K1;function NO(){if(K1)return Fd;K1=1;var e=Os(),n=rr(),i="[object Set]";function s(o){return n(o)&&e(o)==i}return Fd=s,Fd}var zd,X1;function CO(){if(X1)return zd;X1=1;var e=NO(),n=zu(),i=sv(),s=i&&i.isSet,o=s?n(s):e;return zd=o,zd}var Bd,Q1;function _N(){if(Q1)return Bd;Q1=1;var e=Lu(),n=rv(),i=Du(),s=lO(),o=dO(),u=lN(),l=cN(),c=hO(),d=pO(),h=mN(),p=mO(),m=Os(),y=wO(),x=bO(),N=xN(),_=yt(),S=Ps(),b=EO(),k=An(),E=CO(),C=ei(),A=qi(),P=1,I=2,M=4,R="[object Arguments]",L="[object Array]",F="[object Boolean]",Q="[object Date]",X="[object Error]",j="[object Function]",G="[object GeneratorFunction]",U="[object Map]",ne="[object Number]",K="[object Object]",D="[object RegExp]",V="[object Set]",O="[object String]",B="[object Symbol]",ae="[object WeakMap]",z="[object ArrayBuffer]",W="[object DataView]",J="[object Float32Array]",se="[object Float64Array]",ue="[object Int8Array]",he="[object Int16Array]",ge="[object Int32Array]",Me="[object Uint8Array]",Fe="[object Uint8ClampedArray]",Re="[object Uint16Array]",Pe="[object Uint32Array]",be={};be[R]=be[L]=be[z]=be[W]=be[F]=be[Q]=be[J]=be[se]=be[ue]=be[he]=be[ge]=be[U]=be[ne]=be[K]=be[D]=be[V]=be[O]=be[B]=be[Me]=be[Fe]=be[Re]=be[Pe]=!0,be[X]=be[j]=be[ae]=!1;function Oe(ve,ye,qe,Ye,Qe,et){var Be,Ze=ye&P,At=ye&I,Vt=ye&M;if(qe&&(Be=Qe?qe(ve,Ye,Qe,et):qe(ve)),Be!==void 0)return Be;if(!k(ve))return ve;var It=_(ve);if(It){if(Be=y(ve),!Ze)return l(ve,Be)}else{var pt=m(ve),tt=pt==j||pt==G;if(S(ve))return u(ve,Ze);if(pt==K||pt==R||tt&&!Qe){if(Be=At||tt?{}:N(ve),!Ze)return At?d(ve,o(Be,ve)):c(ve,s(Be,ve))}else{if(!be[pt])return Qe?ve:{};Be=x(ve,pt,Ze)}}et||(et=new e);var kt=et.get(ve);if(kt)return kt;et.set(ve,Be),E(ve)?ve.forEach(function(Ge){Be.add(Oe(Ge,ye,qe,Ge,ve,et))}):b(ve)&&ve.forEach(function(Ge,ft){Be.set(ft,Oe(Ge,ye,qe,ft,ve,et))});var We=Vt?At?p:h:At?A:C,Et=It?void 0:We(ve);return n(Et||ve,function(Ge,ft){Et&&(ft=Ge,Ge=ve[ft]),i(Be,ft,Oe(Ge,ye,qe,ft,ve,et))}),Be}return Bd=Oe,Bd}var Ud,Z1;function TO(){if(Z1)return Ud;Z1=1;var e=_N(),n=4;function i(s){return e(s,n)}return Ud=i,Ud}var Hd,J1;function cv(){if(J1)return Hd;J1=1;function e(n){return function(){return n}}return Hd=e,Hd}var Vd,e_;function RO(){if(e_)return Vd;e_=1;function e(n){return function(i,s,o){for(var u=-1,l=Object(i),c=o(i),d=c.length;d--;){var h=c[n?d:++u];if(s(l[h],h,l)===!1)break}return i}}return Vd=e,Vd}var Wd,t_;function fv(){if(t_)return Wd;t_=1;var e=RO(),n=e();return Wd=n,Wd}var Gd,n_;function dv(){if(n_)return Gd;n_=1;var e=fv(),n=ei();function i(s,o){return s&&e(s,o,n)}return Gd=i,Gd}var Yd,r_;function jO(){if(r_)return Yd;r_=1;var e=wr();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 Yd=n,Yd}var Kd,i_;function Hu(){if(i_)return Kd;i_=1;var e=dv(),n=jO(),i=n(e);return Kd=i,Kd}var Xd,s_;function Li(){if(s_)return Xd;s_=1;function e(n){return n}return Xd=e,Xd}var Qd,o_;function SN(){if(o_)return Qd;o_=1;var e=Li();function n(i){return typeof i=="function"?i:e}return Qd=n,Qd}var Zd,a_;function bN(){if(a_)return Zd;a_=1;var e=rv(),n=Hu(),i=SN(),s=yt();function o(u,l){var c=s(u)?e:n;return c(u,i(l))}return Zd=o,Zd}var Jd,u_;function kN(){return u_||(u_=1,Jd=bN()),Jd}var eh,l_;function AO(){if(l_)return eh;l_=1;var e=Hu();function n(i,s){var o=[];return e(i,function(u,l,c){s(u,l,c)&&o.push(u)}),o}return eh=n,eh}var th,c_;function IO(){if(c_)return th;c_=1;var e="__lodash_hash_undefined__";function n(i){return this.__data__.set(i,e),this}return th=n,th}var nh,f_;function MO(){if(f_)return nh;f_=1;function e(n){return this.__data__.has(n)}return nh=e,nh}var rh,d_;function EN(){if(d_)return rh;d_=1;var e=nv(),n=IO(),i=MO();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,rh=s,rh}var ih,h_;function PO(){if(h_)return ih;h_=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 ih=e,ih}var sh,p_;function NN(){if(p_)return sh;p_=1;function e(n,i){return n.has(i)}return sh=e,sh}var oh,m_;function CN(){if(m_)return oh;m_=1;var e=EN(),n=PO(),i=NN(),s=1,o=2;function u(l,c,d,h,p,m){var y=d&s,x=l.length,N=c.length;if(x!=N&&!(y&&N>x))return!1;var _=m.get(l),S=m.get(c);if(_&&S)return _==c&&S==l;var b=-1,k=!0,E=d&o?new e:void 0;for(m.set(l,c),m.set(c,l);++b<x;){var C=l[b],A=c[b];if(h)var P=y?h(A,C,b,c,l,m):h(C,A,b,l,c,m);if(P!==void 0){if(P)continue;k=!1;break}if(E){if(!n(c,function(I,M){if(!i(E,M)&&(C===I||p(C,I,d,h,m)))return E.push(M)})){k=!1;break}}else if(!(C===A||p(C,A,d,h,m))){k=!1;break}}return m.delete(l),m.delete(c),k}return oh=u,oh}var ah,g_;function OO(){if(g_)return ah;g_=1;function e(n){var i=-1,s=Array(n.size);return n.forEach(function(o,u){s[++i]=[u,o]}),s}return ah=e,ah}var uh,v_;function hv(){if(v_)return uh;v_=1;function e(n){var i=-1,s=Array(n.size);return n.forEach(function(o){s[++i]=o}),s}return uh=e,uh}var lh,y_;function qO(){if(y_)return lh;y_=1;var e=Ms(),n=vN(),i=Is(),s=CN(),o=OO(),u=hv(),l=1,c=2,d="[object Boolean]",h="[object Date]",p="[object Error]",m="[object Map]",y="[object Number]",x="[object RegExp]",N="[object Set]",_="[object String]",S="[object Symbol]",b="[object ArrayBuffer]",k="[object DataView]",E=e?e.prototype:void 0,C=E?E.valueOf:void 0;function A(P,I,M,R,L,F,Q){switch(M){case k:if(P.byteLength!=I.byteLength||P.byteOffset!=I.byteOffset)return!1;P=P.buffer,I=I.buffer;case b:return!(P.byteLength!=I.byteLength||!F(new n(P),new n(I)));case d:case h:case y:return i(+P,+I);case p:return P.name==I.name&&P.message==I.message;case x:case _:return P==I+"";case m:var X=o;case N:var j=R&l;if(X||(X=u),P.size!=I.size&&!j)return!1;var G=Q.get(P);if(G)return G==I;R|=c,Q.set(P,I);var U=s(X(P),X(I),R,L,F,Q);return Q.delete(P),U;case S:if(C)return C.call(P)==C.call(I)}return!1}return lh=A,lh}var ch,w_;function LO(){if(w_)return ch;w_=1;var e=mN(),n=1,i=Object.prototype,s=i.hasOwnProperty;function o(u,l,c,d,h,p){var m=c&n,y=e(u),x=y.length,N=e(l),_=N.length;if(x!=_&&!m)return!1;for(var S=x;S--;){var b=y[S];if(!(m?b in l:s.call(l,b)))return!1}var k=p.get(u),E=p.get(l);if(k&&E)return k==l&&E==u;var C=!0;p.set(u,l),p.set(l,u);for(var A=m;++S<x;){b=y[S];var P=u[b],I=l[b];if(d)var M=m?d(I,P,b,l,u,p):d(P,I,b,u,l,p);if(!(M===void 0?P===I||h(P,I,c,d,p):M)){C=!1;break}A||(A=b=="constructor")}if(C&&!A){var R=u.constructor,L=l.constructor;R!=L&&"constructor"in u&&"constructor"in l&&!(typeof R=="function"&&R instanceof R&&typeof L=="function"&&L instanceof L)&&(C=!1)}return p.delete(u),p.delete(l),C}return ch=o,ch}var fh,x_;function $O(){if(x_)return fh;x_=1;var e=Lu(),n=CN(),i=qO(),s=LO(),o=Os(),u=yt(),l=Ps(),c=Wo(),d=1,h="[object Arguments]",p="[object Array]",m="[object Object]",y=Object.prototype,x=y.hasOwnProperty;function N(_,S,b,k,E,C){var A=u(_),P=u(S),I=A?p:o(_),M=P?p:o(S);I=I==h?m:I,M=M==h?m:M;var R=I==m,L=M==m,F=I==M;if(F&&l(_)){if(!l(S))return!1;A=!0,R=!1}if(F&&!R)return C||(C=new e),A||c(_)?n(_,S,b,k,E,C):i(_,S,I,b,k,E,C);if(!(b&d)){var Q=R&&x.call(_,"__wrapped__"),X=L&&x.call(S,"__wrapped__");if(Q||X){var j=Q?_.value():_,G=X?S.value():S;return C||(C=new e),E(j,G,b,k,C)}}return F?(C||(C=new e),s(_,S,b,k,E,C)):!1}return fh=N,fh}var dh,__;function TN(){if(__)return dh;__=1;var e=$O(),n=rr();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 dh=i,dh}var hh,S_;function DO(){if(S_)return hh;S_=1;var e=Lu(),n=TN(),i=1,s=2;function o(u,l,c,d){var h=c.length,p=h,m=!d;if(u==null)return!p;for(u=Object(u);h--;){var y=c[h];if(m&&y[2]?y[1]!==u[y[0]]:!(y[0]in u))return!1}for(;++h<p;){y=c[h];var x=y[0],N=u[x],_=y[1];if(m&&y[2]){if(N===void 0&&!(x in u))return!1}else{var S=new e;if(d)var b=d(N,_,x,u,l,S);if(!(b===void 0?n(_,N,i|s,d,S):b))return!1}}return!0}return hh=o,hh}var ph,b_;function RN(){if(b_)return ph;b_=1;var e=An();function n(i){return i===i&&!e(i)}return ph=n,ph}var mh,k_;function FO(){if(k_)return mh;k_=1;var e=RN(),n=ei();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 mh=i,mh}var gh,E_;function jN(){if(E_)return gh;E_=1;function e(n,i){return function(s){return s==null?!1:s[n]===i&&(i!==void 0||n in Object(s))}}return gh=e,gh}var vh,N_;function zO(){if(N_)return vh;N_=1;var e=DO(),n=FO(),i=jN();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 vh=s,vh}var yh,C_;function qs(){if(C_)return yh;C_=1;var e=Pi(),n=rr(),i="[object Symbol]";function s(o){return typeof o=="symbol"||n(o)&&e(o)==i}return yh=s,yh}var wh,T_;function pv(){if(T_)return wh;T_=1;var e=yt(),n=qs(),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 wh=o,wh}var xh,R_;function BO(){if(R_)return xh;R_=1;var e=nv(),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 h=s.apply(this,l);return u.cache=d.set(c,h)||d,h};return u.cache=new(i.Cache||e),u}return i.Cache=e,xh=i,xh}var _h,j_;function UO(){if(j_)return _h;j_=1;var e=BO(),n=500;function i(s){var o=e(s,function(l){return u.size===n&&u.clear(),l}),u=o.cache;return o}return _h=i,_h}var Sh,A_;function HO(){if(A_)return Sh;A_=1;var e=UO(),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,h){u.push(d?h.replace(i,"$1"):c||l)}),u});return Sh=s,Sh}var bh,I_;function Vu(){if(I_)return bh;I_=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 bh=e,bh}var kh,M_;function VO(){if(M_)return kh;M_=1;var e=Ms(),n=Vu(),i=yt(),s=qs(),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 kh=l,kh}var Eh,P_;function AN(){if(P_)return Eh;P_=1;var e=VO();function n(i){return i==null?"":e(i)}return Eh=n,Eh}var Nh,O_;function Wu(){if(O_)return Nh;O_=1;var e=yt(),n=pv(),i=HO(),s=AN();function o(u,l){return e(u)?u:n(u,l)?[u]:i(s(u))}return Nh=o,Nh}var Ch,q_;function Go(){if(q_)return Ch;q_=1;var e=qs();function n(i){if(typeof i=="string"||e(i))return i;var s=i+"";return s=="0"&&1/i==-1/0?"-0":s}return Ch=n,Ch}var Th,L_;function Gu(){if(L_)return Th;L_=1;var e=Wu(),n=Go();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 Th=i,Th}var Rh,$_;function WO(){if($_)return Rh;$_=1;var e=Gu();function n(i,s,o){var u=i==null?void 0:e(i,s);return u===void 0?o:u}return Rh=n,Rh}var jh,D_;function GO(){if(D_)return jh;D_=1;function e(n,i){return n!=null&&i in Object(n)}return jh=e,jh}var Ah,F_;function IN(){if(F_)return Ah;F_=1;var e=Wu(),n=Vo(),i=yt(),s=Fu(),o=iv(),u=Go();function l(c,d,h){d=e(d,c);for(var p=-1,m=d.length,y=!1;++p<m;){var x=u(d[p]);if(!(y=c!=null&&h(c,x)))break;c=c[x]}return y||++p!=m?y:(m=c==null?0:c.length,!!m&&o(m)&&s(x,m)&&(i(c)||n(c)))}return Ah=l,Ah}var Ih,z_;function MN(){if(z_)return Ih;z_=1;var e=GO(),n=IN();function i(s,o){return s!=null&&n(s,o,e)}return Ih=i,Ih}var Mh,B_;function YO(){if(B_)return Mh;B_=1;var e=TN(),n=WO(),i=MN(),s=pv(),o=RN(),u=jN(),l=Go(),c=1,d=2;function h(p,m){return s(p)&&o(m)?u(l(p),m):function(y){var x=n(y,p);return x===void 0&&x===m?i(y,p):e(m,x,c|d)}}return Mh=h,Mh}var Ph,U_;function PN(){if(U_)return Ph;U_=1;function e(n){return function(i){return i==null?void 0:i[n]}}return Ph=e,Ph}var Oh,H_;function KO(){if(H_)return Oh;H_=1;var e=Gu();function n(i){return function(s){return e(s,i)}}return Oh=n,Oh}var qh,V_;function XO(){if(V_)return qh;V_=1;var e=PN(),n=KO(),i=pv(),s=Go();function o(u){return i(u)?e(s(u)):n(u)}return qh=o,qh}var Lh,W_;function xr(){if(W_)return Lh;W_=1;var e=zO(),n=YO(),i=Li(),s=yt(),o=XO();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 Lh=u,Lh}var $h,G_;function ON(){if(G_)return $h;G_=1;var e=fN(),n=AO(),i=xr(),s=yt();function o(u,l){var c=s(u)?e:n;return c(u,i(l,3))}return $h=o,$h}var Dh,Y_;function QO(){if(Y_)return Dh;Y_=1;var e=Object.prototype,n=e.hasOwnProperty;function i(s,o){return s!=null&&n.call(s,o)}return Dh=i,Dh}var Fh,K_;function qN(){if(K_)return Fh;K_=1;var e=QO(),n=IN();function i(s,o){return s!=null&&n(s,o,e)}return Fh=i,Fh}var zh,X_;function ZO(){if(X_)return zh;X_=1;var e=ov(),n=Os(),i=Vo(),s=yt(),o=wr(),u=Ps(),l=Bu(),c=Wo(),d="[object Map]",h="[object Set]",p=Object.prototype,m=p.hasOwnProperty;function y(x){if(x==null)return!0;if(o(x)&&(s(x)||typeof x=="string"||typeof x.splice=="function"||u(x)||c(x)||i(x)))return!x.length;var N=n(x);if(N==d||N==h)return!x.size;if(l(x))return!e(x).length;for(var _ in x)if(m.call(x,_))return!1;return!0}return zh=y,zh}var Bh,Q_;function LN(){if(Q_)return Bh;Q_=1;function e(n){return n===void 0}return Bh=e,Bh}var Uh,Z_;function $N(){if(Z_)return Uh;Z_=1;var e=Hu(),n=wr();function i(s,o){var u=-1,l=n(s)?Array(s.length):[];return e(s,function(c,d,h){l[++u]=o(c,d,h)}),l}return Uh=i,Uh}var Hh,J_;function DN(){if(J_)return Hh;J_=1;var e=Vu(),n=xr(),i=$N(),s=yt();function o(u,l){var c=s(u)?e:i;return c(u,n(l,3))}return Hh=o,Hh}var Vh,eS;function JO(){if(eS)return Vh;eS=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 Vh=e,Vh}var Wh,tS;function eq(){if(tS)return Wh;tS=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 Wh=e,Wh}var Gh,nS;function FN(){if(nS)return Gh;nS=1;var e=JO(),n=Hu(),i=xr(),s=eq(),o=yt();function u(l,c,d){var h=o(l)?e:s,p=arguments.length<3;return h(l,i(c,4),d,p,n)}return Gh=u,Gh}var Yh,rS;function tq(){if(rS)return Yh;rS=1;var e=Pi(),n=yt(),i=rr(),s="[object String]";function o(u){return typeof u=="string"||!n(u)&&i(u)&&e(u)==s}return Yh=o,Yh}var Kh,iS;function nq(){if(iS)return Kh;iS=1;var e=PN(),n=e("length");return Kh=n,Kh}var Xh,sS;function rq(){if(sS)return Xh;sS=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(h){return c.test(h)}return Xh=d,Xh}var Qh,oS;function iq(){if(oS)return Qh;oS=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]",h="(?:"+c+"|"+d+")",p="[^"+e+"]",m="(?:\\ud83c[\\udde6-\\uddff]){2}",y="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",N=h+"?",_="["+u+"]?",S="(?:"+x+"(?:"+[p,m,y].join("|")+")"+_+N+")*",b=_+N+S,k="(?:"+[p+c+"?",c,m,y,l].join("|")+")",E=RegExp(d+"(?="+d+")|"+k+b,"g");function C(A){for(var P=E.lastIndex=0;E.test(A);)++P;return P}return Qh=C,Qh}var Zh,aS;function sq(){if(aS)return Zh;aS=1;var e=nq(),n=rq(),i=iq();function s(o){return n(o)?i(o):e(o)}return Zh=s,Zh}var Jh,uS;function oq(){if(uS)return Jh;uS=1;var e=ov(),n=Os(),i=wr(),s=tq(),o=sq(),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 h=n(d);return h==u||h==l?d.size:e(d).length}return Jh=c,Jh}var ep,lS;function aq(){if(lS)return ep;lS=1;var e=rv(),n=wN(),i=dv(),s=xr(),o=Uu(),u=yt(),l=Ps(),c=Uo(),d=An(),h=Wo();function p(m,y,x){var N=u(m),_=N||l(m)||h(m);if(y=s(y,4),x==null){var S=m&&m.constructor;_?x=N?new S:[]:d(m)?x=c(S)?n(o(m)):{}:x={}}return(_?e:i)(m,function(b,k,E){return y(x,b,k,E)}),x}return ep=p,ep}var tp,cS;function uq(){if(cS)return tp;cS=1;var e=Ms(),n=Vo(),i=yt(),s=e?e.isConcatSpreadable:void 0;function o(u){return i(u)||n(u)||!!(s&&u&&u[s])}return tp=o,tp}var np,fS;function mv(){if(fS)return np;fS=1;var e=uv(),n=uq();function i(s,o,u,l,c){var d=-1,h=s.length;for(u||(u=n),c||(c=[]);++d<h;){var p=s[d];o>0&&u(p)?o>1?i(p,o-1,u,l,c):e(c,p):l||(c[c.length]=p)}return c}return np=i,np}var rp,dS;function lq(){if(dS)return rp;dS=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 rp=e,rp}var ip,hS;function zN(){if(hS)return ip;hS=1;var e=lq(),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),h=Array(d);++c<d;)h[c]=l[o+c];c=-1;for(var p=Array(o+1);++c<o;)p[c]=l[c];return p[o]=u(h),e(s,this,p)}}return ip=i,ip}var sp,pS;function cq(){if(pS)return sp;pS=1;var e=cv(),n=oN(),i=Li(),s=n?function(o,u){return n(o,"toString",{configurable:!0,enumerable:!1,value:e(u),writable:!0})}:i;return sp=s,sp}var op,mS;function fq(){if(mS)return op;mS=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 op=s,op}var ap,gS;function BN(){if(gS)return ap;gS=1;var e=cq(),n=fq(),i=n(e);return ap=i,ap}var up,vS;function Yu(){if(vS)return up;vS=1;var e=Li(),n=zN(),i=BN();function s(o,u){return i(n(o,u,e),o+"")}return up=s,up}var lp,yS;function UN(){if(yS)return lp;yS=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 lp=e,lp}var cp,wS;function dq(){if(wS)return cp;wS=1;function e(n){return n!==n}return cp=e,cp}var fp,xS;function hq(){if(xS)return fp;xS=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 fp=e,fp}var dp,_S;function pq(){if(_S)return dp;_S=1;var e=UN(),n=dq(),i=hq();function s(o,u,l){return u===u?i(o,u,l):e(o,n,l)}return dp=s,dp}var hp,SS;function mq(){if(SS)return hp;SS=1;var e=pq();function n(i,s){var o=i==null?0:i.length;return!!o&&e(i,s,0)>-1}return hp=n,hp}var pp,bS;function gq(){if(bS)return pp;bS=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 pp=e,pp}var mp,kS;function vq(){if(kS)return mp;kS=1;function e(){}return mp=e,mp}var gp,ES;function yq(){if(ES)return gp;ES=1;var e=gN(),n=vq(),i=hv(),s=1/0,o=e&&1/i(new e([,-0]))[1]==s?function(u){return new e(u)}:n;return gp=o,gp}var vp,NS;function wq(){if(NS)return vp;NS=1;var e=EN(),n=mq(),i=gq(),s=NN(),o=yq(),u=hv(),l=200;function c(d,h,p){var m=-1,y=n,x=d.length,N=!0,_=[],S=_;if(p)N=!1,y=i;else if(x>=l){var b=h?null:o(d);if(b)return u(b);N=!1,y=s,S=new e}else S=h?[]:_;e:for(;++m<x;){var k=d[m],E=h?h(k):k;if(k=p||k!==0?k:0,N&&E===E){for(var C=S.length;C--;)if(S[C]===E)continue e;h&&S.push(E),_.push(k)}else y(S,E,p)||(S!==_&&S.push(E),_.push(k))}return _}return vp=c,vp}var yp,CS;function HN(){if(CS)return yp;CS=1;var e=wr(),n=rr();function i(s){return n(s)&&e(s)}return yp=i,yp}var wp,TS;function xq(){if(TS)return wp;TS=1;var e=mv(),n=Yu(),i=wq(),s=HN(),o=n(function(u){return i(e(u,1,s,!0))});return wp=o,wp}var xp,RS;function _q(){if(RS)return xp;RS=1;var e=Vu();function n(i,s){return e(s,function(o){return i[o]})}return xp=n,xp}var _p,jS;function VN(){if(jS)return _p;jS=1;var e=_q(),n=ei();function i(s){return s==null?[]:e(s,n(s))}return _p=i,_p}var Sp,AS;function In(){if(AS)return Sp;AS=1;var e;if(typeof ev=="function")try{e={clone:TO(),constant:cv(),each:kN(),filter:ON(),has:qN(),isArray:yt(),isEmpty:ZO(),isFunction:Uo(),isUndefined:LN(),keys:ei(),map:DN(),reduce:FN(),size:oq(),transform:aq(),union:xq(),values:VN()}}catch{}return e||(e=window._),Sp=e,Sp}var bp,IS;function gv(){if(IS)return bp;IS=1;var e=In();bp=o;var n="\0",i="\0",s="";function o(p){this._isDirected=e.has(p,"directed")?p.directed:!0,this._isMultigraph=e.has(p,"multigraph")?p.multigraph:!1,this._isCompound=e.has(p,"compound")?p.compound:!1,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[i]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}o.prototype._nodeCount=0,o.prototype._edgeCount=0,o.prototype.isDirected=function(){return this._isDirected},o.prototype.isMultigraph=function(){return this._isMultigraph},o.prototype.isCompound=function(){return this._isCompound},o.prototype.setGraph=function(p){return this._label=p,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(p){return e.isFunction(p)||(p=e.constant(p)),this._defaultNodeLabelFn=p,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return e.keys(this._nodes)},o.prototype.sources=function(){var p=this;return e.filter(this.nodes(),function(m){return e.isEmpty(p._in[m])})},o.prototype.sinks=function(){var p=this;return e.filter(this.nodes(),function(m){return e.isEmpty(p._out[m])})},o.prototype.setNodes=function(p,m){var y=arguments,x=this;return e.each(p,function(N){y.length>1?x.setNode(N,m):x.setNode(N)}),this},o.prototype.setNode=function(p,m){return e.has(this._nodes,p)?(arguments.length>1&&(this._nodes[p]=m),this):(this._nodes[p]=arguments.length>1?m:this._defaultNodeLabelFn(p),this._isCompound&&(this._parent[p]=i,this._children[p]={},this._children[i][p]=!0),this._in[p]={},this._preds[p]={},this._out[p]={},this._sucs[p]={},++this._nodeCount,this)},o.prototype.node=function(p){return this._nodes[p]},o.prototype.hasNode=function(p){return e.has(this._nodes,p)},o.prototype.removeNode=function(p){var m=this;if(e.has(this._nodes,p)){var y=function(x){m.removeEdge(m._edgeObjs[x])};delete this._nodes[p],this._isCompound&&(this._removeFromParentsChildList(p),delete this._parent[p],e.each(this.children(p),function(x){m.setParent(x)}),delete this._children[p]),e.each(e.keys(this._in[p]),y),delete this._in[p],delete this._preds[p],e.each(e.keys(this._out[p]),y),delete this._out[p],delete this._sucs[p],--this._nodeCount}return this},o.prototype.setParent=function(p,m){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(m))m=i;else{m+="";for(var y=m;!e.isUndefined(y);y=this.parent(y))if(y===p)throw new Error("Setting "+m+" as parent of "+p+" would create a cycle");this.setNode(m)}return this.setNode(p),this._removeFromParentsChildList(p),this._parent[p]=m,this._children[m][p]=!0,this},o.prototype._removeFromParentsChildList=function(p){delete this._children[this._parent[p]][p]},o.prototype.parent=function(p){if(this._isCompound){var m=this._parent[p];if(m!==i)return m}},o.prototype.children=function(p){if(e.isUndefined(p)&&(p=i),this._isCompound){var m=this._children[p];if(m)return e.keys(m)}else{if(p===i)return this.nodes();if(this.hasNode(p))return[]}},o.prototype.predecessors=function(p){var m=this._preds[p];if(m)return e.keys(m)},o.prototype.successors=function(p){var m=this._sucs[p];if(m)return e.keys(m)},o.prototype.neighbors=function(p){var m=this.predecessors(p);if(m)return e.union(m,this.successors(p))},o.prototype.isLeaf=function(p){var m;return this.isDirected()?m=this.successors(p):m=this.neighbors(p),m.length===0},o.prototype.filterNodes=function(p){var m=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});m.setGraph(this.graph());var y=this;e.each(this._nodes,function(_,S){p(S)&&m.setNode(S,_)}),e.each(this._edgeObjs,function(_){m.hasNode(_.v)&&m.hasNode(_.w)&&m.setEdge(_,y.edge(_))});var x={};function N(_){var S=y.parent(_);return S===void 0||m.hasNode(S)?(x[_]=S,S):S in x?x[S]:N(S)}return this._isCompound&&e.each(m.nodes(),function(_){m.setParent(_,N(_))}),m},o.prototype.setDefaultEdgeLabel=function(p){return e.isFunction(p)||(p=e.constant(p)),this._defaultEdgeLabelFn=p,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return e.values(this._edgeObjs)},o.prototype.setPath=function(p,m){var y=this,x=arguments;return e.reduce(p,function(N,_){return x.length>1?y.setEdge(N,_,m):y.setEdge(N,_),_}),this},o.prototype.setEdge=function(){var p,m,y,x,N=!1,_=arguments[0];typeof _=="object"&&_!==null&&"v"in _?(p=_.v,m=_.w,y=_.name,arguments.length===2&&(x=arguments[1],N=!0)):(p=_,m=arguments[1],y=arguments[3],arguments.length>2&&(x=arguments[2],N=!0)),p=""+p,m=""+m,e.isUndefined(y)||(y=""+y);var S=c(this._isDirected,p,m,y);if(e.has(this._edgeLabels,S))return N&&(this._edgeLabels[S]=x),this;if(!e.isUndefined(y)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(p),this.setNode(m),this._edgeLabels[S]=N?x:this._defaultEdgeLabelFn(p,m,y);var b=d(this._isDirected,p,m,y);return p=b.v,m=b.w,Object.freeze(b),this._edgeObjs[S]=b,u(this._preds[m],p),u(this._sucs[p],m),this._in[m][S]=b,this._out[p][S]=b,this._edgeCount++,this},o.prototype.edge=function(p,m,y){var x=arguments.length===1?h(this._isDirected,arguments[0]):c(this._isDirected,p,m,y);return this._edgeLabels[x]},o.prototype.hasEdge=function(p,m,y){var x=arguments.length===1?h(this._isDirected,arguments[0]):c(this._isDirected,p,m,y);return e.has(this._edgeLabels,x)},o.prototype.removeEdge=function(p,m,y){var x=arguments.length===1?h(this._isDirected,arguments[0]):c(this._isDirected,p,m,y),N=this._edgeObjs[x];return N&&(p=N.v,m=N.w,delete this._edgeLabels[x],delete this._edgeObjs[x],l(this._preds[m],p),l(this._sucs[p],m),delete this._in[m][x],delete this._out[p][x],this._edgeCount--),this},o.prototype.inEdges=function(p,m){var y=this._in[p];if(y){var x=e.values(y);return m?e.filter(x,function(N){return N.v===m}):x}},o.prototype.outEdges=function(p,m){var y=this._out[p];if(y){var x=e.values(y);return m?e.filter(x,function(N){return N.w===m}):x}},o.prototype.nodeEdges=function(p,m){var y=this.inEdges(p,m);if(y)return y.concat(this.outEdges(p,m))};function u(p,m){p[m]?p[m]++:p[m]=1}function l(p,m){--p[m]||delete p[m]}function c(p,m,y,x){var N=""+m,_=""+y;if(!p&&N>_){var S=N;N=_,_=S}return N+s+_+s+(e.isUndefined(x)?n:x)}function d(p,m,y,x){var N=""+m,_=""+y;if(!p&&N>_){var S=N;N=_,_=S}var b={v:N,w:_};return x&&(b.name=x),b}function h(p,m){return c(p,m.v,m.w,m.name)}return bp}var kp,MS;function Sq(){return MS||(MS=1,kp="2.1.8"),kp}var Ep,PS;function bq(){return PS||(PS=1,Ep={Graph:gv(),version:Sq()}),Ep}var Np,OS;function kq(){if(OS)return Np;OS=1;var e=In(),n=gv();Np={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),h=l.parent(c),p={v:c};return e.isUndefined(d)||(p.value=d),e.isUndefined(h)||(p.parent=h),p})}function o(l){return e.map(l.edges(),function(c){var d=l.edge(c),h={v:c.v,w:c.w};return e.isUndefined(c.name)||(h.name=c.name),e.isUndefined(d)||(h.value=d),h})}function 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 Np}var Cp,qS;function Eq(){if(qS)return Cp;qS=1;var e=In();Cp=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 Cp}var Tp,LS;function WN(){if(LS)return Tp;LS=1;var e=In();Tp=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},Tp}var Rp,$S;function GN(){if($S)return Rp;$S=1;var e=In(),n=WN();Rp=s;var i=e.constant(1);function s(u,l,c,d){return o(u,String(l),c||i,d||function(h){return u.outEdges(h)})}function o(u,l,c,d){var h={},p=new n,m,y,x=function(N){var _=N.v!==m?N.v:N.w,S=h[_],b=c(N),k=y.distance+b;if(b<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+N+" Weight: "+b);k<S.distance&&(S.distance=k,S.predecessor=m,p.decrease(_,k))};for(u.nodes().forEach(function(N){var _=N===l?0:Number.POSITIVE_INFINITY;h[N]={distance:_},p.add(N,_)});p.size()>0&&(m=p.removeMin(),y=h[m],y.distance!==Number.POSITIVE_INFINITY);)d(m).forEach(x);return h}return Rp}var jp,DS;function Nq(){if(DS)return jp;DS=1;var e=GN(),n=In();jp=i;function i(s,o,u){return n.transform(s.nodes(),function(l,c){l[c]=e(s,c,o,u)},{})}return jp}var Ap,FS;function YN(){if(FS)return Ap;FS=1;var e=In();Ap=n;function n(i){var s=0,o=[],u={},l=[];function c(d){var h=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&&(h.lowlink=Math.min(h.lowlink,u[y].index)):(c(y),h.lowlink=Math.min(h.lowlink,u[y].lowlink))}),h.lowlink===h.index){var p=[],m;do m=o.pop(),u[m].onStack=!1,p.push(m);while(d!==m);l.push(p)}}return i.nodes().forEach(function(d){e.has(u,d)||c(d)}),l}return Ap}var Ip,zS;function Cq(){if(zS)return Ip;zS=1;var e=In(),n=YN();Ip=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 Ip}var Mp,BS;function Tq(){if(BS)return Mp;BS=1;var e=In();Mp=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(h){c[h]={},c[h][h]={distance:0},d.forEach(function(p){h!==p&&(c[h][p]={distance:Number.POSITIVE_INFINITY})}),l(h).forEach(function(p){var m=p.v===h?p.w:p.v,y=u(p);c[h][m]={distance:y,predecessor:h}})}),d.forEach(function(h){var p=c[h];d.forEach(function(m){var y=c[m];d.forEach(function(x){var N=y[h],_=p[x],S=y[x],b=N.distance+_.distance;b<S.distance&&(S.distance=b,S.predecessor=_.predecessor)})})}),c}return Mp}var Pp,US;function KN(){if(US)return Pp;US=1;var e=In();Pp=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,Pp}var Op,HS;function Rq(){if(HS)return Op;HS=1;var e=KN();Op=n;function n(i){try{e(i)}catch(s){if(s instanceof e.CycleException)return!1;throw s}return!0}return Op}var qp,VS;function XN(){if(VS)return qp;VS=1;var e=In();qp=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(h){if(!s.hasNode(h))throw new Error("Graph does not have node: "+h);i(s,h,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(h){i(s,h,u,l,c,d)}),u&&d.push(o))}return qp}var Lp,WS;function jq(){if(WS)return Lp;WS=1;var e=XN();Lp=n;function n(i,s){return e(i,s,"post")}return Lp}var $p,GS;function Aq(){if(GS)return $p;GS=1;var e=XN();$p=n;function n(i,s){return e(i,s,"pre")}return $p}var Dp,YS;function Iq(){if(YS)return Dp;YS=1;var e=In(),n=gv(),i=WN();Dp=s;function s(o,u){var l=new n,c={},d=new i,h;function p(y){var x=y.v===h?y.w:y.v,N=d.priority(x);if(N!==void 0){var _=u(y);_<N&&(c[x]=h,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(h=d.removeMin(),e.has(c,h))l.setEdge(h,c[h]);else{if(m)throw new Error("Input graph is not connected: "+o);m=!0}o.nodeEdges(h).forEach(p)}return l}return Dp}var Fp,KS;function Mq(){return KS||(KS=1,Fp={components:Eq(),dijkstra:GN(),dijkstraAll:Nq(),findCycles:Cq(),floydWarshall:Tq(),isAcyclic:Rq(),postorder:jq(),preorder:Aq(),prim:Iq(),tarjan:YN(),topsort:KN()}),Fp}var zp,XS;function Pq(){if(XS)return zp;XS=1;var e=bq();return zp={Graph:e.Graph,json:kq(),alg:Mq(),version:e.version},zp}var Bp,QS;function Vn(){if(QS)return Bp;QS=1;var e;if(typeof ev=="function")try{e=Pq()}catch{}return e||(e=window.graphlib),Bp=e,Bp}var Up,ZS;function Oq(){if(ZS)return Up;ZS=1;var e=_N(),n=1,i=4;function s(o){return e(o,n|i)}return Up=s,Up}var Hp,JS;function Ku(){if(JS)return Hp;JS=1;var e=Is(),n=wr(),i=Fu(),s=An();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 Hp=o,Hp}var Vp,eb;function qq(){if(eb)return Vp;eb=1;var e=Yu(),n=Is(),i=Ku(),s=qi(),o=Object.prototype,u=o.hasOwnProperty,l=e(function(c,d){c=Object(c);var h=-1,p=d.length,m=p>2?d[2]:void 0;for(m&&i(d[0],d[1],m)&&(p=1);++h<p;)for(var y=d[h],x=s(y),N=-1,_=x.length;++N<_;){var S=x[N],b=c[S];(b===void 0||n(b,o[S])&&!u.call(c,S))&&(c[S]=y[S])}return c});return Vp=l,Vp}var Wp,tb;function Lq(){if(tb)return Wp;tb=1;var e=xr(),n=wr(),i=ei();function s(o){return function(u,l,c){var d=Object(u);if(!n(u)){var h=e(l,3);u=i(u),l=function(m){return h(d[m],m,d)}}var p=o(u,l,c);return p>-1?d[h?u[p]:p]:void 0}}return Wp=s,Wp}var Gp,nb;function $q(){if(nb)return Gp;nb=1;var e=/\s/;function n(i){for(var s=i.length;s--&&e.test(i.charAt(s)););return s}return Gp=n,Gp}var Yp,rb;function Dq(){if(rb)return Yp;rb=1;var e=$q(),n=/^\s+/;function i(s){return s&&s.slice(0,e(s)+1).replace(n,"")}return Yp=i,Yp}var Kp,ib;function Fq(){if(ib)return Kp;ib=1;var e=Dq(),n=An(),i=qs(),s=NaN,o=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;function d(h){if(typeof h=="number")return h;if(i(h))return s;if(n(h)){var p=typeof h.valueOf=="function"?h.valueOf():h;h=n(p)?p+"":p}if(typeof h!="string")return h===0?h:+h;h=e(h);var m=u.test(h);return m||l.test(h)?c(h.slice(2),m?2:8):o.test(h)?s:+h}return Kp=d,Kp}var Xp,sb;function QN(){if(sb)return Xp;sb=1;var e=Fq(),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 Xp=s,Xp}var Qp,ob;function zq(){if(ob)return Qp;ob=1;var e=QN();function n(i){var s=e(i),o=s%1;return s===s?o?s-o:s:0}return Qp=n,Qp}var Zp,ab;function Bq(){if(ab)return Zp;ab=1;var e=UN(),n=xr(),i=zq(),s=Math.max;function o(u,l,c){var d=u==null?0:u.length;if(!d)return-1;var h=c==null?0:i(c);return h<0&&(h=s(d+h,0)),e(u,n(l,3),h)}return Zp=o,Zp}var Jp,ub;function Uq(){if(ub)return Jp;ub=1;var e=Lq(),n=Bq(),i=e(n);return Jp=i,Jp}var em,lb;function ZN(){if(lb)return em;lb=1;var e=mv();function n(i){var s=i==null?0:i.length;return s?e(i,1):[]}return em=n,em}var tm,cb;function Hq(){if(cb)return tm;cb=1;var e=fv(),n=SN(),i=qi();function s(o,u){return o==null?o:e(o,n(u),i)}return tm=s,tm}var nm,fb;function Vq(){if(fb)return nm;fb=1;function e(n){var i=n==null?0:n.length;return i?n[i-1]:void 0}return nm=e,nm}var rm,db;function Wq(){if(db)return rm;db=1;var e=$u(),n=dv(),i=xr();function s(o,u){var l={};return u=i(u,3),n(o,function(c,d,h){e(l,d,u(c,d,h))}),l}return rm=s,rm}var im,hb;function vv(){if(hb)return im;hb=1;var e=qs();function n(i,s,o){for(var u=-1,l=i.length;++u<l;){var c=i[u],d=s(c);if(d!=null&&(h===void 0?d===d&&!e(d):o(d,h)))var h=d,p=c}return p}return im=n,im}var sm,pb;function Gq(){if(pb)return sm;pb=1;function e(n,i){return n>i}return sm=e,sm}var om,mb;function Yq(){if(mb)return om;mb=1;var e=vv(),n=Gq(),i=Li();function s(o){return o&&o.length?e(o,i,n):void 0}return om=s,om}var am,gb;function JN(){if(gb)return am;gb=1;var e=$u(),n=Is();function i(s,o,u){(u!==void 0&&!n(s[o],u)||u===void 0&&!(o in s))&&e(s,o,u)}return am=i,am}var um,vb;function Kq(){if(vb)return um;vb=1;var e=Pi(),n=Uu(),i=rr(),s="[object Object]",o=Function.prototype,u=Object.prototype,l=o.toString,c=u.hasOwnProperty,d=l.call(Object);function h(p){if(!i(p)||e(p)!=s)return!1;var m=n(p);if(m===null)return!0;var y=c.call(m,"constructor")&&m.constructor;return typeof y=="function"&&y instanceof y&&l.call(y)==d}return um=h,um}var lm,yb;function eC(){if(yb)return lm;yb=1;function e(n,i){if(!(i==="constructor"&&typeof n[i]=="function")&&i!="__proto__")return n[i]}return lm=e,lm}var cm,wb;function Xq(){if(wb)return cm;wb=1;var e=Ho(),n=qi();function i(s){return e(s,n(s))}return cm=i,cm}var fm,xb;function Qq(){if(xb)return fm;xb=1;var e=JN(),n=lN(),i=yN(),s=cN(),o=xN(),u=Vo(),l=yt(),c=HN(),d=Ps(),h=Uo(),p=An(),m=Kq(),y=Wo(),x=eC(),N=Xq();function _(S,b,k,E,C,A,P){var I=x(S,k),M=x(b,k),R=P.get(M);if(R){e(S,k,R);return}var L=A?A(I,M,k+"",S,b,P):void 0,F=L===void 0;if(F){var Q=l(M),X=!Q&&d(M),j=!Q&&!X&&y(M);L=M,Q||X||j?l(I)?L=I:c(I)?L=s(I):X?(F=!1,L=n(M,!0)):j?(F=!1,L=i(M,!0)):L=[]:m(M)||u(M)?(L=I,u(I)?L=N(I):(!p(I)||h(I))&&(L=o(M))):F=!1}F&&(P.set(M,L),C(L,M,E,A,P),P.delete(M)),e(S,k,L)}return fm=_,fm}var dm,_b;function Zq(){if(_b)return dm;_b=1;var e=Lu(),n=JN(),i=fv(),s=Qq(),o=An(),u=qi(),l=eC();function c(d,h,p,m,y){d!==h&&i(h,function(x,N){if(y||(y=new e),o(x))s(d,h,N,p,c,m,y);else{var _=m?m(l(d,N),x,N+"",d,h,y):void 0;_===void 0&&(_=x),n(d,N,_)}},u)}return dm=c,dm}var hm,Sb;function Jq(){if(Sb)return hm;Sb=1;var e=Yu(),n=Ku();function i(s){return e(function(o,u){var l=-1,c=u.length,d=c>1?u[c-1]:void 0,h=c>2?u[2]:void 0;for(d=s.length>3&&typeof d=="function"?(c--,d):void 0,h&&n(u[0],u[1],h)&&(d=c<3?void 0:d,c=1),o=Object(o);++l<c;){var p=u[l];p&&s(o,p,l,d)}return o})}return hm=i,hm}var pm,bb;function eL(){if(bb)return pm;bb=1;var e=Zq(),n=Jq(),i=n(function(s,o,u){e(s,o,u)});return pm=i,pm}var mm,kb;function tC(){if(kb)return mm;kb=1;function e(n,i){return n<i}return mm=e,mm}var gm,Eb;function tL(){if(Eb)return gm;Eb=1;var e=vv(),n=tC(),i=Li();function s(o){return o&&o.length?e(o,i,n):void 0}return gm=s,gm}var vm,Nb;function nL(){if(Nb)return vm;Nb=1;var e=vv(),n=xr(),i=tC();function s(o,u){return o&&o.length?e(o,n(u,2),i):void 0}return vm=s,vm}var ym,Cb;function rL(){if(Cb)return ym;Cb=1;var e=Gn(),n=function(){return e.Date.now()};return ym=n,ym}var wm,Tb;function iL(){if(Tb)return wm;Tb=1;var e=Du(),n=Wu(),i=Fu(),s=An(),o=Go();function u(l,c,d,h){if(!s(l))return l;c=n(c,l);for(var p=-1,m=c.length,y=m-1,x=l;x!=null&&++p<m;){var N=o(c[p]),_=d;if(N==="__proto__"||N==="constructor"||N==="prototype")return l;if(p!=y){var S=x[N];_=h?h(S,N,x):void 0,_===void 0&&(_=s(S)?S:i(c[p+1])?[]:{})}e(x,N,_),x=x[N]}return l}return wm=u,wm}var xm,Rb;function sL(){if(Rb)return xm;Rb=1;var e=Gu(),n=iL(),i=Wu();function s(o,u,l){for(var c=-1,d=u.length,h={};++c<d;){var p=u[c],m=e(o,p);l(m,p)&&n(h,i(p,o),m)}return h}return xm=s,xm}var _m,jb;function oL(){if(jb)return _m;jb=1;var e=sL(),n=MN();function i(s,o){return e(s,o,function(u,l){return n(s,l)})}return _m=i,_m}var Sm,Ab;function aL(){if(Ab)return Sm;Ab=1;var e=ZN(),n=zN(),i=BN();function s(o){return i(n(o,void 0,e),o+"")}return Sm=s,Sm}var bm,Ib;function uL(){if(Ib)return bm;Ib=1;var e=oL(),n=aL(),i=n(function(s,o){return s==null?{}:e(s,o)});return bm=i,bm}var km,Mb;function lL(){if(Mb)return km;Mb=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),h=Array(d);d--;)h[l?d:++c]=s,s+=u;return h}return km=i,km}var Em,Pb;function cL(){if(Pb)return Em;Pb=1;var e=lL(),n=Ku(),i=QN();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 Em=s,Em}var Nm,Ob;function fL(){if(Ob)return Nm;Ob=1;var e=cL(),n=e();return Nm=n,Nm}var Cm,qb;function dL(){if(qb)return Cm;qb=1;function e(n,i){var s=n.length;for(n.sort(i);s--;)n[s]=n[s].value;return n}return Cm=e,Cm}var Tm,Lb;function hL(){if(Lb)return Tm;Lb=1;var e=qs();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,h=s===null,p=s===s,m=e(s);if(!h&&!m&&!c&&i>s||c&&d&&p&&!h&&!m||u&&d&&p||!o&&p||!l)return 1;if(!u&&!c&&!m&&i<s||m&&o&&l&&!u&&!c||h&&o&&l||!d&&l||!p)return-1}return 0}return Tm=n,Tm}var Rm,$b;function pL(){if($b)return Rm;$b=1;var e=hL();function n(i,s,o){for(var u=-1,l=i.criteria,c=s.criteria,d=l.length,h=o.length;++u<d;){var p=e(l[u],c[u]);if(p){if(u>=h)return p;var m=o[u];return p*(m=="desc"?-1:1)}}return i.index-s.index}return Rm=n,Rm}var jm,Db;function mL(){if(Db)return jm;Db=1;var e=Vu(),n=Gu(),i=xr(),s=$N(),o=dL(),u=zu(),l=pL(),c=Li(),d=yt();function h(p,m,y){m.length?m=e(m,function(_){return d(_)?function(S){return n(S,_.length===1?_[0]:_)}:_}):m=[c];var x=-1;m=e(m,u(i));var N=s(p,function(_,S,b){var k=e(m,function(E){return E(_)});return{criteria:k,index:++x,value:_}});return o(N,function(_,S){return l(_,S,y)})}return jm=h,jm}var Am,Fb;function gL(){if(Fb)return Am;Fb=1;var e=mv(),n=mL(),i=Yu(),s=Ku(),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 Am=o,Am}var Im,zb;function vL(){if(zb)return Im;zb=1;var e=AN(),n=0;function i(s){var o=++n;return e(s)+o}return Im=i,Im}var Mm,Bb;function yL(){if(Bb)return Mm;Bb=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 Mm=e,Mm}var Pm,Ub;function wL(){if(Ub)return Pm;Ub=1;var e=Du(),n=yL();function i(s,o){return n(s||[],o||[],e)}return Pm=i,Pm}var Om,Hb;function ut(){if(Hb)return Om;Hb=1;var e;if(typeof ev=="function")try{e={cloneDeep:Oq(),constant:cv(),defaults:qq(),each:kN(),filter:ON(),find:Uq(),flatten:ZN(),forEach:bN(),forIn:Hq(),has:qN(),isUndefined:LN(),last:Vq(),map:DN(),mapValues:Wq(),max:Yq(),merge:eL(),min:tL(),minBy:nL(),now:rL(),pick:uL(),range:fL(),reduce:FN(),sortBy:gL(),uniqueId:vL(),values:VN(),zipObject:wL()}}catch{}return e||(e=window._),Om=e,Om}var qm,Vb;function xL(){if(Vb)return qm;Vb=1,qm=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 qm}var Lm,Wb;function _L(){if(Wb)return Lm;Wb=1;var e=ut(),n=Vn().Graph,i=xL();Lm=o;var s=e.constant(1);function o(h,p){if(h.nodeCount()<=1)return[];var m=c(h,p||s),y=u(m.graph,m.buckets,m.zeroIdx);return e.flatten(e.map(y,function(x){return h.outEdges(x.v,x.w)}),!0)}function u(h,p,m){for(var y=[],x=p[p.length-1],N=p[0],_;h.nodeCount();){for(;_=N.dequeue();)l(h,p,m,_);for(;_=x.dequeue();)l(h,p,m,_);if(h.nodeCount()){for(var S=p.length-2;S>0;--S)if(_=p[S].dequeue(),_){y=y.concat(l(h,p,m,_,!0));break}}}return y}function l(h,p,m,y,x){var N=x?[]:void 0;return e.forEach(h.inEdges(y.v),function(_){var S=h.edge(_),b=h.node(_.v);x&&N.push({v:_.v,w:_.w}),b.out-=S,d(p,m,b)}),e.forEach(h.outEdges(y.v),function(_){var S=h.edge(_),b=_.w,k=h.node(b);k.in-=S,d(p,m,k)}),h.removeNode(y.v),N}function c(h,p){var m=new n,y=0,x=0;e.forEach(h.nodes(),function(S){m.setNode(S,{v:S,in:0,out:0})}),e.forEach(h.edges(),function(S){var b=m.edge(S.v,S.w)||0,k=p(S),E=b+k;m.setEdge(S.v,S.w,E),x=Math.max(x,m.node(S.v).out+=k),y=Math.max(y,m.node(S.w).in+=k)});var N=e.range(x+y+3).map(function(){return new i}),_=y+1;return e.forEach(m.nodes(),function(S){d(N,_,m.node(S))}),{graph:m,buckets:N,zeroIdx:_}}function d(h,p,m){m.out?m.in?h[m.out-m.in+p].enqueue(m):h[h.length-1].enqueue(m):h[0].enqueue(m)}return Lm}var $m,Gb;function SL(){if(Gb)return $m;Gb=1;var e=ut(),n=_L();$m={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 h=u.edge(d);u.removeEdge(d),h.forwardName=d.name,h.reversed=!0,u.setEdge(d.w,d.v,h,e.uniqueId("rev"))});function c(d){return function(h){return d.edge(h).weight}}}function s(u){var l=[],c={},d={};function h(p){e.has(d,p)||(d[p]=!0,c[p]=!0,e.forEach(u.outEdges(p),function(m){e.has(c,m.w)?l.push(m):h(m.w)}),delete c[p])}return e.forEach(u.nodes(),h),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 $m}var Dm,Yb;function sn(){if(Yb)return Dm;Yb=1;var e=ut(),n=Vn().Graph;Dm={addDummyNode:i,simplify:s,asNonCompoundGraph:o,successorWeights:u,predecessorWeights:l,intersectRect:c,buildLayerMatrix:d,normalizeRanks:h,removeEmptyRanks:p,addBorderNode:m,maxRank:y,partition:x,time:N,notime:_};function i(S,b,k,E){var C;do C=e.uniqueId(E);while(S.hasNode(C));return k.dummy=b,S.setNode(C,k),C}function s(S){var b=new n().setGraph(S.graph());return e.forEach(S.nodes(),function(k){b.setNode(k,S.node(k))}),e.forEach(S.edges(),function(k){var E=b.edge(k.v,k.w)||{weight:0,minlen:1},C=S.edge(k);b.setEdge(k.v,k.w,{weight:E.weight+C.weight,minlen:Math.max(E.minlen,C.minlen)})}),b}function o(S){var b=new n({multigraph:S.isMultigraph()}).setGraph(S.graph());return e.forEach(S.nodes(),function(k){S.children(k).length||b.setNode(k,S.node(k))}),e.forEach(S.edges(),function(k){b.setEdge(k,S.edge(k))}),b}function u(S){var b=e.map(S.nodes(),function(k){var E={};return e.forEach(S.outEdges(k),function(C){E[C.w]=(E[C.w]||0)+S.edge(C).weight}),E});return e.zipObject(S.nodes(),b)}function l(S){var b=e.map(S.nodes(),function(k){var E={};return e.forEach(S.inEdges(k),function(C){E[C.v]=(E[C.v]||0)+S.edge(C).weight}),E});return e.zipObject(S.nodes(),b)}function c(S,b){var k=S.x,E=S.y,C=b.x-k,A=b.y-E,P=S.width/2,I=S.height/2;if(!C&&!A)throw new Error("Not possible to find intersection inside of the rectangle");var M,R;return Math.abs(A)*P>Math.abs(C)*I?(A<0&&(I=-I),M=I*C/A,R=I):(C<0&&(P=-P),M=P,R=P*A/C),{x:k+M,y:E+R}}function d(S){var b=e.map(e.range(y(S)+1),function(){return[]});return e.forEach(S.nodes(),function(k){var E=S.node(k),C=E.rank;e.isUndefined(C)||(b[C][E.order]=k)}),b}function h(S){var b=e.min(e.map(S.nodes(),function(k){return S.node(k).rank}));e.forEach(S.nodes(),function(k){var E=S.node(k);e.has(E,"rank")&&(E.rank-=b)})}function p(S){var b=e.min(e.map(S.nodes(),function(A){return S.node(A).rank})),k=[];e.forEach(S.nodes(),function(A){var P=S.node(A).rank-b;k[P]||(k[P]=[]),k[P].push(A)});var E=0,C=S.graph().nodeRankFactor;e.forEach(k,function(A,P){e.isUndefined(A)&&P%C!==0?--E:E&&e.forEach(A,function(I){S.node(I).rank+=E})})}function m(S,b,k,E){var C={width:0,height:0};return arguments.length>=4&&(C.rank=k,C.order=E),i(S,"border",C,b)}function y(S){return e.max(e.map(S.nodes(),function(b){var k=S.node(b).rank;if(!e.isUndefined(k))return k}))}function x(S,b){var k={lhs:[],rhs:[]};return e.forEach(S,function(E){b(E)?k.lhs.push(E):k.rhs.push(E)}),k}function N(S,b){var k=e.now();try{return b()}finally{console.log(S+" time: "+(e.now()-k)+"ms")}}function _(S,b){return b()}return Dm}var Fm,Kb;function bL(){if(Kb)return Fm;Kb=1;var e=ut(),n=sn();Fm={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,h=l.w,p=u.node(h).rank,m=l.name,y=u.edge(l),x=y.labelRank;if(p!==d+1){u.removeEdge(l);var N,_,S;for(S=0,++d;d<p;++S,++d)y.points=[],_={width:0,height:0,edgeLabel:y,edgeObj:l,rank:d},N=n.addDummyNode(u,"edge",_,"_d"),d===x&&(_.width=y.width,_.height=y.height,_.dummy="edge-label",_.labelpos=y.labelpos),u.setEdge(c,N,{weight:y.weight},m),S===0&&u.graph().dummyChains.push(N),c=N;u.setEdge(c,h,{weight:y.weight},m)}}function o(u){e.forEach(u.graph().dummyChains,function(l){var c=u.node(l),d=c.edgeLabel,h;for(u.setEdge(c.edgeObj,d);c.dummy;)h=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=h,c=u.node(l)})}return Fm}var zm,Xb;function Eu(){if(Xb)return zm;Xb=1;var e=ut();zm={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(h){return u(h.w)-s.edge(h).minlen}));return(d===Number.POSITIVE_INFINITY||d===void 0||d===null)&&(d=0),c.rank=d}e.forEach(s.sources(),u)}function i(s,o){return s.node(o.w).rank-s.node(o.v).rank-s.edge(o).minlen}return zm}var Bm,Qb;function nC(){if(Qb)return Bm;Qb=1;var e=ut(),n=Vn().Graph,i=Eu().slack;Bm=s;function s(c){var d=new n({directed:!1}),h=c.nodes()[0],p=c.nodeCount();d.setNode(h,{});for(var m,y;o(d,c)<p;)m=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 h(p){e.forEach(d.nodeEdges(p),function(m){var y=m.v,x=p===y?m.w:y;!c.hasNode(x)&&!i(d,m)&&(c.setNode(x,{}),c.setEdge(p,x,{}),h(x))})}return e.forEach(c.nodes(),h),c.nodeCount()}function u(c,d){return e.minBy(d.edges(),function(h){if(c.hasNode(h.v)!==c.hasNode(h.w))return i(d,h)})}function l(c,d,h){e.forEach(c.nodes(),function(p){d.node(p).rank+=h})}return Bm}var Um,Zb;function kL(){if(Zb)return Um;Zb=1;var e=ut(),n=nC(),i=Eu().slack,s=Eu().longestPath,o=Vn().alg.preorder,u=Vn().alg.postorder,l=sn().simplify;Um=c,c.initLowLimValues=m,c.initCutValues=d,c.calcCutValue=p,c.leaveEdge=x,c.enterEdge=N,c.exchangeEdges=_;function c(E){E=l(E),s(E);var C=n(E);m(C),d(C,E);for(var A,P;A=x(C);)P=N(C,E,A),_(C,E,A,P)}function d(E,C){var A=u(E,E.nodes());A=A.slice(0,A.length-1),e.forEach(A,function(P){h(E,C,P)})}function h(E,C,A){var P=E.node(A),I=P.parent;E.edge(A,I).cutvalue=p(E,C,A)}function p(E,C,A){var P=E.node(A),I=P.parent,M=!0,R=C.edge(A,I),L=0;return R||(M=!1,R=C.edge(I,A)),L=R.weight,e.forEach(C.nodeEdges(A),function(F){var Q=F.v===A,X=Q?F.w:F.v;if(X!==I){var j=Q===M,G=C.edge(F).weight;if(L+=j?G:-G,b(E,A,X)){var U=E.edge(A,X).cutvalue;L+=j?-U:U}}}),L}function m(E,C){arguments.length<2&&(C=E.nodes()[0]),y(E,{},1,C)}function y(E,C,A,P,I){var M=A,R=E.node(P);return C[P]=!0,e.forEach(E.neighbors(P),function(L){e.has(C,L)||(A=y(E,C,A,L,P))}),R.low=M,R.lim=A++,I?R.parent=I:delete R.parent,A}function x(E){return e.find(E.edges(),function(C){return E.edge(C).cutvalue<0})}function N(E,C,A){var P=A.v,I=A.w;C.hasEdge(P,I)||(P=A.w,I=A.v);var M=E.node(P),R=E.node(I),L=M,F=!1;M.lim>R.lim&&(L=R,F=!0);var Q=e.filter(C.edges(),function(X){return F===k(E,E.node(X.v),L)&&F!==k(E,E.node(X.w),L)});return e.minBy(Q,function(X){return i(C,X)})}function _(E,C,A,P){var I=A.v,M=A.w;E.removeEdge(I,M),E.setEdge(P.v,P.w,{}),m(E),d(E,C),S(E,C)}function S(E,C){var A=e.find(E.nodes(),function(I){return!C.node(I).parent}),P=o(E,A);P=P.slice(1),e.forEach(P,function(I){var M=E.node(I).parent,R=C.edge(I,M),L=!1;R||(R=C.edge(M,I),L=!0),C.node(I).rank=C.node(M).rank+(L?R.minlen:-R.minlen)})}function b(E,C,A){return E.hasEdge(C,A)}function k(E,C,A){return A.low<=C.lim&&C.lim<=A.lim}return Um}var Hm,Jb;function EL(){if(Jb)return Hm;Jb=1;var e=Eu(),n=e.longestPath,i=nC(),s=kL();Hm=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 Hm}var Vm,ek;function NL(){if(ek)return Vm;ek=1;var e=ut();Vm=n;function n(o){var u=s(o);e.forEach(o.graph().dummyChains,function(l){for(var c=o.node(l),d=c.edgeObj,h=i(o,u,d.v,d.w),p=h.path,m=h.lca,y=0,x=p[y],N=!0;l!==d.w;){if(c=o.node(l),N){for(;(x=p[y])!==m&&o.node(x).maxRank<c.rank;)y++;x===m&&(N=!1)}if(!N){for(;y<p.length-1&&o.node(x=p[y+1]).minRank<=c.rank;)y++;x=p[y]}o.setParent(l,x),l=o.successors(l)[0]}})}function i(o,u,l,c){var d=[],h=[],p=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>p||m>u[y].lim));for(x=y,y=c;(y=o.parent(y))!==x;)h.push(y);return{path:d.concat(h.reverse()),lca:x}}function s(o){var u={},l=0;function c(d){var h=l;e.forEach(o.children(d),c),u[d]={low:h,lim:l++}}return e.forEach(o.children(),c),u}return Vm}var Wm,tk;function CL(){if(tk)return Wm;tk=1;var e=ut(),n=sn();Wm={run:i,cleanup:l};function i(c){var d=n.addDummyNode(c,"root",{},"_root"),h=o(c),p=e.max(e.values(h))-1,m=2*p+1;c.graph().nestingRoot=d,e.forEach(c.edges(),function(x){c.edge(x).minlen*=m});var y=u(c)+1;e.forEach(c.children(),function(x){s(c,d,m,y,p,h,x)}),c.graph().nodeRankFactor=m}function s(c,d,h,p,m,y,x){var N=c.children(x);if(!N.length){x!==d&&c.setEdge(d,x,{weight:0,minlen:h});return}var _=n.addBorderNode(c,"_bt"),S=n.addBorderNode(c,"_bb"),b=c.node(x);c.setParent(_,x),b.borderTop=_,c.setParent(S,x),b.borderBottom=S,e.forEach(N,function(k){s(c,d,h,p,m,y,k);var E=c.node(k),C=E.borderTop?E.borderTop:k,A=E.borderBottom?E.borderBottom:k,P=E.borderTop?p:2*p,I=C!==A?1:m-y[x]+1;c.setEdge(_,C,{weight:P,minlen:I,nestingEdge:!0}),c.setEdge(A,S,{weight:P,minlen:I,nestingEdge:!0})}),c.parent(x)||c.setEdge(d,_,{weight:0,minlen:m+y[x]})}function o(c){var d={};function h(p,m){var y=c.children(p);y&&y.length&&e.forEach(y,function(x){h(x,m+1)}),d[p]=m}return e.forEach(c.children(),function(p){h(p,1)}),d}function u(c){return e.reduce(c.edges(),function(d,h){return d+c.edge(h).weight},0)}function l(c){var d=c.graph();c.removeNode(d.nestingRoot),delete d.nestingRoot,e.forEach(c.edges(),function(h){var p=c.edge(h);p.nestingEdge&&c.removeEdge(h)})}return Wm}var Gm,nk;function TL(){if(nk)return Gm;nk=1;var e=ut(),n=sn();Gm=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 h=d.minRank,p=d.maxRank+1;h<p;++h)s(o,"borderLeft","_bl",l,d,h),s(o,"borderRight","_br",l,d,h)}}e.forEach(o.children(),u)}function s(o,u,l,c,d,h){var p={width:0,height:0,rank:h,borderType:u},m=d[u][h-1],y=n.addDummyNode(o,"border",p,l);d[u][h]=y,o.setParent(y,c),m&&o.setEdge(m,y,{weight:1})}return Gm}var Ym,rk;function RL(){if(rk)return Ym;rk=1;var e=ut();Ym={adjust:n,undo:i};function n(h){var p=h.graph().rankdir.toLowerCase();(p==="lr"||p==="rl")&&s(h)}function i(h){var p=h.graph().rankdir.toLowerCase();(p==="bt"||p==="rl")&&u(h),(p==="lr"||p==="rl")&&(c(h),s(h))}function s(h){e.forEach(h.nodes(),function(p){o(h.node(p))}),e.forEach(h.edges(),function(p){o(h.edge(p))})}function o(h){var p=h.width;h.width=h.height,h.height=p}function u(h){e.forEach(h.nodes(),function(p){l(h.node(p))}),e.forEach(h.edges(),function(p){var m=h.edge(p);e.forEach(m.points,l),e.has(m,"y")&&l(m)})}function l(h){h.y=-h.y}function c(h){e.forEach(h.nodes(),function(p){d(h.node(p))}),e.forEach(h.edges(),function(p){var m=h.edge(p);e.forEach(m.points,d),e.has(m,"x")&&d(m)})}function d(h){var p=h.x;h.x=h.y,h.y=p}return Ym}var Km,ik;function jL(){if(ik)return Km;ik=1;var e=ut();Km=n;function n(i){var s={},o=e.filter(i.nodes(),function(h){return!i.children(h).length}),u=e.max(e.map(o,function(h){return i.node(h).rank})),l=e.map(e.range(u+1),function(){return[]});function c(h){if(!e.has(s,h)){s[h]=!0;var p=i.node(h);l[p.rank].push(h),e.forEach(i.successors(h),c)}}var d=e.sortBy(o,function(h){return i.node(h).rank});return e.forEach(d,c),l}return Km}var Xm,sk;function AL(){if(sk)return Xm;sk=1;var e=ut();Xm=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 h=2*d-1;d-=1;var p=e.map(new Array(h),function(){return 0}),m=0;return e.forEach(c.forEach(function(y){var x=y.pos+d;p[x]+=y.weight;for(var N=0;x>0;)x%2&&(N+=p[x+1]),x=x-1>>1,p[x]+=y.weight;m+=y.weight*N})),m}return Xm}var Qm,ok;function IL(){if(ok)return Qm;ok=1;var e=ut();Qm=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 h=i.edge(d),p=i.node(d.v);return{sum:c.sum+h.weight*p.order,weight:c.weight+h.weight}},{sum:0,weight:0});return{v:o,barycenter:l.sum/l.weight,weight:l.weight}}else return{v:o}})}return Qm}var Zm,ak;function ML(){if(ak)return Zm;ak=1;var e=ut();Zm=n;function n(o,u){var l={};e.forEach(o,function(d,h){var p=l[d.v]={indegree:0,in:[],out:[],vs:[d.v],i:h};e.isUndefined(d.barycenter)||(p.barycenter=d.barycenter,p.weight=d.weight)}),e.forEach(u.edges(),function(d){var h=l[d.v],p=l[d.w];!e.isUndefined(h)&&!e.isUndefined(p)&&(p.indegree++,h.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(h){return function(p){p.merged||(e.isUndefined(p.barycenter)||e.isUndefined(h.barycenter)||p.barycenter>=h.barycenter)&&s(h,p)}}function c(h){return function(p){p.in.push(h),--p.indegree===0&&o.push(p)}}for(;o.length;){var d=o.pop();u.push(d),e.forEach(d.in.reverse(),l(d)),e.forEach(d.out,c(d))}return e.map(e.filter(u,function(h){return!h.merged}),function(h){return e.pick(h,["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 Zm}var Jm,uk;function PL(){if(uk)return Jm;uk=1;var e=ut(),n=sn();Jm=i;function i(u,l){var c=n.partition(u,function(_){return e.has(_,"barycenter")}),d=c.lhs,h=e.sortBy(c.rhs,function(_){return-_.i}),p=[],m=0,y=0,x=0;d.sort(o(!!l)),x=s(p,h,x),e.forEach(d,function(_){x+=_.vs.length,p.push(_.vs),m+=_.barycenter*_.weight,y+=_.weight,x=s(p,h,x)});var N={vs:e.flatten(p,!0)};return y&&(N.barycenter=m/y,N.weight=y),N}function s(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 Jm}var eg,lk;function OL(){if(lk)return eg;lk=1;var e=ut(),n=IL(),i=ML(),s=PL();eg=o;function o(c,d,h,p){var m=c.children(d),y=c.node(d),x=y?y.borderLeft:void 0,N=y?y.borderRight:void 0,_={};x&&(m=e.filter(m,function(A){return A!==x&&A!==N}));var S=n(c,m);e.forEach(S,function(A){if(c.children(A.v).length){var P=o(c,A.v,h,p);_[A.v]=P,e.has(P,"barycenter")&&l(A,P)}});var b=i(S,h);u(b,_);var k=s(b,p);if(x&&(k.vs=e.flatten([x,k.vs,N],!0),c.predecessors(x).length)){var E=c.node(c.predecessors(x)[0]),C=c.node(c.predecessors(N)[0]);e.has(k,"barycenter")||(k.barycenter=0,k.weight=0),k.barycenter=(k.barycenter*k.weight+E.order+C.order)/(k.weight+2),k.weight+=2}return k}function u(c,d){e.forEach(c,function(h){h.vs=e.flatten(h.vs.map(function(p){return d[p]?d[p].vs:p}),!0)})}function 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 eg}var tg,ck;function qL(){if(ck)return tg;ck=1;var e=ut(),n=Vn().Graph;tg=i;function i(o,u,l){var c=s(o),d=new n({compound:!0}).setGraph({root:c}).setDefaultNodeLabel(function(h){return o.node(h)});return e.forEach(o.nodes(),function(h){var p=o.node(h),m=o.parent(h);(p.rank===u||p.minRank<=u&&u<=p.maxRank)&&(d.setNode(h),d.setParent(h,m||c),e.forEach(o[l](h),function(y){var x=y.v===h?y.w:y.v,N=d.edge(x,h),_=e.isUndefined(N)?0:N.weight;d.setEdge(x,h,{weight:o.edge(y).weight+_})}),e.has(p,"minRank")&&d.setNode(h,{borderLeft:p.borderLeft[u],borderRight:p.borderRight[u]}))}),d}function s(o){for(var u;o.hasNode(u=e.uniqueId("_root")););return u}return tg}var ng,fk;function LL(){if(fk)return ng;fk=1;var e=ut();ng=n;function n(i,s,o){var u={},l;e.forEach(o,function(c){for(var d=i.parent(c),h,p;d;){if(h=i.parent(d),h?(p=u[h],u[h]=d):(p=l,l=d),p&&p!==d){s.setEdge(p,d);return}d=h}})}return ng}var rg,dk;function $L(){if(dk)return rg;dk=1;var e=ut(),n=jL(),i=AL(),s=OL(),o=qL(),u=LL(),l=Vn().Graph,c=sn();rg=d;function d(y){var x=c.maxRank(y),N=h(y,e.range(1,x+1),"inEdges"),_=h(y,e.range(x-1,-1,-1),"outEdges"),S=n(y);m(y,S);for(var b=Number.POSITIVE_INFINITY,k,E=0,C=0;C<4;++E,++C){p(E%2?N:_,E%4>=2),S=c.buildLayerMatrix(y);var A=i(y,S);A<b&&(C=0,k=e.cloneDeep(S),b=A)}m(y,k)}function h(y,x,N){return e.map(x,function(_){return o(y,_,N)})}function p(y,x){var N=new l;e.forEach(y,function(_){var S=_.graph().root,b=s(_,S,N,x);e.forEach(b.vs,function(k,E){_.node(k).order=E}),u(_,N,b.vs)})}function m(y,x){e.forEach(x,function(N){e.forEach(N,function(_,S){y.node(_).order=S})})}return rg}var ig,hk;function DL(){if(hk)return ig;hk=1;var e=ut(),n=Vn().Graph,i=sn();ig={positionX:N,findType1Conflicts:s,findType2Conflicts:o,addConflict:l,hasConflict:c,verticalAlignment:d,horizontalCompaction:h,alignCoordinates:y,findSmallestWidthAlignment:m,balance:x};function s(b,k){var E={};function C(A,P){var I=0,M=0,R=A.length,L=e.last(P);return e.forEach(P,function(F,Q){var X=u(b,F),j=X?b.node(X).order:R;(X||F===L)&&(e.forEach(P.slice(M,Q+1),function(G){e.forEach(b.predecessors(G),function(U){var ne=b.node(U),K=ne.order;(K<I||j<K)&&!(ne.dummy&&b.node(G).dummy)&&l(E,U,G)})}),M=Q+1,I=j)}),P}return e.reduce(k,C),E}function o(b,k){var E={};function C(P,I,M,R,L){var F;e.forEach(e.range(I,M),function(Q){F=P[Q],b.node(F).dummy&&e.forEach(b.predecessors(F),function(X){var j=b.node(X);j.dummy&&(j.order<R||j.order>L)&&l(E,X,F)})})}function A(P,I){var M=-1,R,L=0;return e.forEach(I,function(F,Q){if(b.node(F).dummy==="border"){var X=b.predecessors(F);X.length&&(R=b.node(X[0]).order,C(I,L,Q,M,R),L=Q,M=R)}C(I,L,I.length,R,P.length)}),I}return e.reduce(k,A),E}function u(b,k){if(b.node(k).dummy)return e.find(b.predecessors(k),function(E){return b.node(E).dummy})}function l(b,k,E){if(k>E){var C=k;k=E,E=C}var A=b[k];A||(b[k]=A={}),A[E]=!0}function c(b,k,E){if(k>E){var C=k;k=E,E=C}return e.has(b[k],E)}function d(b,k,E,C){var A={},P={},I={};return e.forEach(k,function(M){e.forEach(M,function(R,L){A[R]=R,P[R]=R,I[R]=L})}),e.forEach(k,function(M){var R=-1;e.forEach(M,function(L){var F=C(L);if(F.length){F=e.sortBy(F,function(U){return I[U]});for(var Q=(F.length-1)/2,X=Math.floor(Q),j=Math.ceil(Q);X<=j;++X){var G=F[X];P[L]===L&&R<I[G]&&!c(E,L,G)&&(P[G]=L,P[L]=A[L]=A[G],R=I[G])}}})}),{root:A,align:P}}function h(b,k,E,C,A){var P={},I=p(b,k,E,A),M=A?"borderLeft":"borderRight";function R(Q,X){for(var j=I.nodes(),G=j.pop(),U={};G;)U[G]?Q(G):(U[G]=!0,j.push(G),j=j.concat(X(G))),G=j.pop()}function L(Q){P[Q]=I.inEdges(Q).reduce(function(X,j){return Math.max(X,P[j.v]+I.edge(j))},0)}function F(Q){var X=I.outEdges(Q).reduce(function(G,U){return Math.min(G,P[U.w]-I.edge(U))},Number.POSITIVE_INFINITY),j=b.node(Q);X!==Number.POSITIVE_INFINITY&&j.borderType!==M&&(P[Q]=Math.max(P[Q],X))}return R(L,I.predecessors.bind(I)),R(F,I.successors.bind(I)),e.forEach(C,function(Q){P[Q]=P[E[Q]]}),P}function p(b,k,E,C){var A=new n,P=b.graph(),I=_(P.nodesep,P.edgesep,C);return e.forEach(k,function(M){var R;e.forEach(M,function(L){var F=E[L];if(A.setNode(F),R){var Q=E[R],X=A.edge(Q,F);A.setEdge(Q,F,Math.max(I(b,L,R),X||0))}R=L})}),A}function m(b,k){return e.minBy(e.values(k),function(E){var C=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY;return e.forIn(E,function(P,I){var M=S(b,I)/2;C=Math.max(P+M,C),A=Math.min(P-M,A)}),C-A})}function y(b,k){var E=e.values(k),C=e.min(E),A=e.max(E);e.forEach(["u","d"],function(P){e.forEach(["l","r"],function(I){var M=P+I,R=b[M],L;if(R!==k){var F=e.values(R);L=I==="l"?C-e.min(F):A-e.max(F),L&&(b[M]=e.mapValues(R,function(Q){return Q+L}))}})})}function x(b,k){return e.mapValues(b.ul,function(E,C){if(k)return b[k.toLowerCase()][C];var A=e.sortBy(e.map(b,C));return(A[1]+A[2])/2})}function N(b){var k=i.buildLayerMatrix(b),E=e.merge(s(b,k),o(b,k)),C={},A;e.forEach(["u","d"],function(I){A=I==="u"?k:e.values(k).reverse(),e.forEach(["l","r"],function(M){M==="r"&&(A=e.map(A,function(Q){return e.values(Q).reverse()}));var R=(I==="u"?b.predecessors:b.successors).bind(b),L=d(b,A,E,R),F=h(b,A,L.root,L.align,M==="r");M==="r"&&(F=e.mapValues(F,function(Q){return-Q})),C[I+M]=F})});var P=m(b,C);return y(C,P),x(C,b.graph().align)}function _(b,k,E){return function(C,A,P){var I=C.node(A),M=C.node(P),R=0,L;if(R+=I.width/2,e.has(I,"labelpos"))switch(I.labelpos.toLowerCase()){case"l":L=-I.width/2;break;case"r":L=I.width/2;break}if(L&&(R+=E?L:-L),L=0,R+=(I.dummy?k:b)/2,R+=(M.dummy?k:b)/2,R+=M.width/2,e.has(M,"labelpos"))switch(M.labelpos.toLowerCase()){case"l":L=M.width/2;break;case"r":L=-M.width/2;break}return L&&(R+=E?L:-L),L=0,R}}function S(b,k){return b.node(k).width}return ig}var sg,pk;function FL(){if(pk)return sg;pk=1;var e=ut(),n=sn(),i=DL().positionX;sg=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(h){var p=e.max(e.map(h,function(m){return u.node(m).height}));e.forEach(h,function(m){u.node(m).y=d+p/2}),d+=p+c})}return sg}var og,mk;function zL(){if(mk)return og;mk=1;var e=ut(),n=SL(),i=bL(),s=EL(),o=sn().normalizeRanks,u=NL(),l=sn().removeEmptyRanks,c=CL(),d=TL(),h=RL(),p=$L(),m=FL(),y=sn(),x=Vn().Graph;og=N;function N(z,W){var J=W&&W.debugTiming?y.time:y.notime;J("layout",function(){var se=J(" buildLayoutGraph",function(){return R(z)});J(" runLayout",function(){_(se,J)}),J(" updateInputGraph",function(){S(z,se)})})}function _(z,W){W(" makeSpaceForEdgeLabels",function(){L(z)}),W(" removeSelfEdges",function(){D(z)}),W(" acyclic",function(){n.run(z)}),W(" nestingGraph.run",function(){c.run(z)}),W(" rank",function(){s(y.asNonCompoundGraph(z))}),W(" injectEdgeLabelProxies",function(){F(z)}),W(" removeEmptyRanks",function(){l(z)}),W(" nestingGraph.cleanup",function(){c.cleanup(z)}),W(" normalizeRanks",function(){o(z)}),W(" assignRankMinMax",function(){Q(z)}),W(" removeEdgeLabelProxies",function(){X(z)}),W(" normalize.run",function(){i.run(z)}),W(" parentDummyChains",function(){u(z)}),W(" addBorderSegments",function(){d(z)}),W(" order",function(){p(z)}),W(" insertSelfEdges",function(){V(z)}),W(" adjustCoordinateSystem",function(){h.adjust(z)}),W(" position",function(){m(z)}),W(" positionSelfEdges",function(){O(z)}),W(" removeBorderNodes",function(){K(z)}),W(" normalize.undo",function(){i.undo(z)}),W(" fixupEdgeLabelCoords",function(){U(z)}),W(" undoCoordinateSystem",function(){h.undo(z)}),W(" translateGraph",function(){j(z)}),W(" assignNodeIntersects",function(){G(z)}),W(" reversePoints",function(){ne(z)}),W(" acyclic.undo",function(){n.undo(z)})}function S(z,W){e.forEach(z.nodes(),function(J){var se=z.node(J),ue=W.node(J);se&&(se.x=ue.x,se.y=ue.y,W.children(J).length&&(se.width=ue.width,se.height=ue.height))}),e.forEach(z.edges(),function(J){var se=z.edge(J),ue=W.edge(J);se.points=ue.points,e.has(ue,"x")&&(se.x=ue.x,se.y=ue.y)}),z.graph().width=W.graph().width,z.graph().height=W.graph().height}var b=["nodesep","edgesep","ranksep","marginx","marginy"],k={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},E=["acyclicer","ranker","rankdir","align"],C=["width","height"],A={width:0,height:0},P=["minlen","weight","width","height","labeloffset"],I={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},M=["labelpos"];function R(z){var W=new x({multigraph:!0,compound:!0}),J=ae(z.graph());return W.setGraph(e.merge({},k,B(J,b),e.pick(J,E))),e.forEach(z.nodes(),function(se){var ue=ae(z.node(se));W.setNode(se,e.defaults(B(ue,C),A)),W.setParent(se,z.parent(se))}),e.forEach(z.edges(),function(se){var ue=ae(z.edge(se));W.setEdge(se,e.merge({},I,B(ue,P),e.pick(ue,M)))}),W}function L(z){var W=z.graph();W.ranksep/=2,e.forEach(z.edges(),function(J){var se=z.edge(J);se.minlen*=2,se.labelpos.toLowerCase()!=="c"&&(W.rankdir==="TB"||W.rankdir==="BT"?se.width+=se.labeloffset:se.height+=se.labeloffset)})}function F(z){e.forEach(z.edges(),function(W){var J=z.edge(W);if(J.width&&J.height){var se=z.node(W.v),ue=z.node(W.w),he={rank:(ue.rank-se.rank)/2+se.rank,e:W};y.addDummyNode(z,"edge-proxy",he,"_ep")}})}function Q(z){var W=0;e.forEach(z.nodes(),function(J){var se=z.node(J);se.borderTop&&(se.minRank=z.node(se.borderTop).rank,se.maxRank=z.node(se.borderBottom).rank,W=e.max(W,se.maxRank))}),z.graph().maxRank=W}function X(z){e.forEach(z.nodes(),function(W){var J=z.node(W);J.dummy==="edge-proxy"&&(z.edge(J.e).labelRank=J.rank,z.removeNode(W))})}function j(z){var W=Number.POSITIVE_INFINITY,J=0,se=Number.POSITIVE_INFINITY,ue=0,he=z.graph(),ge=he.marginx||0,Me=he.marginy||0;function Fe(Re){var Pe=Re.x,be=Re.y,Oe=Re.width,ve=Re.height;W=Math.min(W,Pe-Oe/2),J=Math.max(J,Pe+Oe/2),se=Math.min(se,be-ve/2),ue=Math.max(ue,be+ve/2)}e.forEach(z.nodes(),function(Re){Fe(z.node(Re))}),e.forEach(z.edges(),function(Re){var Pe=z.edge(Re);e.has(Pe,"x")&&Fe(Pe)}),W-=ge,se-=Me,e.forEach(z.nodes(),function(Re){var Pe=z.node(Re);Pe.x-=W,Pe.y-=se}),e.forEach(z.edges(),function(Re){var Pe=z.edge(Re);e.forEach(Pe.points,function(be){be.x-=W,be.y-=se}),e.has(Pe,"x")&&(Pe.x-=W),e.has(Pe,"y")&&(Pe.y-=se)}),he.width=J-W+ge,he.height=ue-se+Me}function G(z){e.forEach(z.edges(),function(W){var J=z.edge(W),se=z.node(W.v),ue=z.node(W.w),he,ge;J.points?(he=J.points[0],ge=J.points[J.points.length-1]):(J.points=[],he=ue,ge=se),J.points.unshift(y.intersectRect(se,he)),J.points.push(y.intersectRect(ue,ge))})}function U(z){e.forEach(z.edges(),function(W){var J=z.edge(W);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 ne(z){e.forEach(z.edges(),function(W){var J=z.edge(W);J.reversed&&J.points.reverse()})}function K(z){e.forEach(z.nodes(),function(W){if(z.children(W).length){var J=z.node(W),se=z.node(J.borderTop),ue=z.node(J.borderBottom),he=z.node(e.last(J.borderLeft)),ge=z.node(e.last(J.borderRight));J.width=Math.abs(ge.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(z.nodes(),function(W){z.node(W).dummy==="border"&&z.removeNode(W)})}function D(z){e.forEach(z.edges(),function(W){if(W.v===W.w){var J=z.node(W.v);J.selfEdges||(J.selfEdges=[]),J.selfEdges.push({e:W,label:z.edge(W)}),z.removeEdge(W)}})}function V(z){var W=y.buildLayerMatrix(z);e.forEach(W,function(J){var se=0;e.forEach(J,function(ue,he){var ge=z.node(ue);ge.order=he+se,e.forEach(ge.selfEdges,function(Me){y.addDummyNode(z,"selfedge",{width:Me.label.width,height:Me.label.height,rank:ge.rank,order:he+ ++se,e:Me.e,label:Me.label},"_se")}),delete ge.selfEdges})})}function O(z){e.forEach(z.nodes(),function(W){var J=z.node(W);if(J.dummy==="selfedge"){var se=z.node(J.e.v),ue=se.x+se.width/2,he=se.y,ge=J.x-ue,Me=se.height/2;z.setEdge(J.e,J.label),z.removeNode(W),J.label.points=[{x:ue+2*ge/3,y:he-Me},{x:ue+5*ge/6,y:he-Me},{x:ue+ge,y:he},{x:ue+5*ge/6,y:he+Me},{x:ue+2*ge/3,y:he+Me}],J.label.x=J.x,J.label.y=J.y}})}function B(z,W){return e.mapValues(e.pick(z,W),Number)}function ae(z){var W={};return e.forEach(z,function(J,se){W[se.toLowerCase()]=J}),W}return og}var ag,gk;function BL(){if(gk)return ag;gk=1;var e=ut(),n=sn(),i=Vn().Graph;ag={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 h="layer"+d;l.setNode(h,{rank:"same"}),e.reduce(c,function(p,m){return l.setEdge(p,m,{style:"invis"}),m})}),l}return ag}var ug,vk;function UL(){return vk||(vk=1,ug="0.8.5"),ug}var lg,yk;function HL(){return yk||(yk=1,lg={graphlib:Vn(),layout:zL(),debug:BL(),util:{time:sn().time,notime:sn().notime},version:UL()}),lg}var VL=HL();const wk=Mg(VL),Ai=240,Ns=130,Cs=74,Xu=72,xk=Cs+Xu;function WL(e){let n=Ai;for(const i of e.values())n=Math.max(n,i.width);return n}const GL=420,YL=2;function Qu(e){var i;return((i=e.data)==null?void 0:i.sessionId)??"_default"}function KL(e,n,i,s,o){const u=new wk.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)??Ai,height:(S==null?void 0:S.height)??Ns})}for(const _ of n)c.has(_.source)&&c.has(_.target)&&u.setEdge(_.source,_.target);wk.layout(u);const d=new Map;let h=1/0,p=1/0,m=-1/0,y=-1/0;for(const _ of l){const S=u.node(_);if(!S)continue;const b=s.get(_),k=(b==null?void 0:b.width)??Ai,E=(b==null?void 0:b.height)??Ns,C=S.x-k/2,A=S.y-E/2;d.set(_,{x:C,y:A}),C<h&&(h=C),A<p&&(p=A),C+k>m&&(m=C+k),A+E>y&&(y=A+E)}if(Number.isFinite(h)&&Number.isFinite(p))for(const[_,S]of d)d.set(_,{x:S.x-h,y:S.y-p});let x=Number.isFinite(m)?m-h:0,N=Number.isFinite(y)?y-p:0;for(const _ of e){const S=o.get(_);if(!S)continue;const b=s.get(_);x=Math.max(x,S.x+((b==null?void 0:b.width)??Ai)),N=Math.max(N,S.y+((b==null?void 0:b.height)??Ns))}return{positions:d,width:x,height:N}}function XL(e,n,i={}){const s=i.direction??"LR",o=i.pinned??new Map,u=i.measured??new Map,l=new Map;for(const S of e){const b=Qu(S),k=l.get(b);k?k.push(S.id):l.set(b,[S.id])}const d=Array.from(l.keys()).sort().map(S=>({sid:S,...KL(l.get(S),n,s,u,o)})),h=WL(u),p=i.availableHeight&&i.availableHeight>0?i.availableHeight:Number.POSITIVE_INFINITY,m=S=>{const b=[[]];let k=0;for(const E of d)b.length<S&&k>0&&k+E.height>p&&(b.push([]),k=0),b[b.length-1].push(E),k+=E.height+xk;return b},y=S=>S.reduce((b,k)=>Math.max(b,k.width),0)+GL;let x=m(i.availableWidth?YL:1);x.length>1&&x.reduce((b,k)=>b+y(k),0)+h*(x.length-1)>(i.availableWidth??0)&&(x=m(1));const N=new Map;let _=0;for(const S of x){let b=0;for(const{positions:k,height:E}of S){for(const[C,A]of k)N.set(C,{x:A.x+_,y:A.y+b});b+=E+xk}_+=y(S)+h}return e.map(S=>{const b=o.get(S.id);if(b)return{...S,position:b};const k=N.get(S.id);return k?{...S,position:k}:S})}function QL(e,n,i,s){const u=Cs+Xu,l=60,c=y=>{const x=s.get(y);return{w:(x==null?void 0:x.width)??Ai,h:(x==null?void 0:x.height)??Ns}},d=new Map(e.map(y=>[y.id,Qu(y)])),h=[],p=e.map(y=>({id:y.id,pos:i.get(y.id)??n.get(y.id)})).filter(y=>y.pos!=null).sort((y,x)=>y.pos.y-x.pos.y||y.pos.x-x.pos.x||y.id.localeCompare(x.id)),m=[];for(const{id:y,pos:x}of p){const{w:N,h:_}=c(y),S=d.get(y)??"_default";if(i.has(y)){h.push({x:x.x,y:x.y,w:N,h:_,sid:S});continue}let b=x.y;for(let k=0;k<h.length+1;k++){const E=h.find(C=>{const A=C.sid===S?24:l,P=C.sid===S?24:u;return x.x<C.x+C.w+A&&C.x<x.x+N+A&&b<C.y+C.h+P&&C.y<b+_+P});if(!E)break;b=E.y+E.h+(E.sid===S?24:u)}b!==x.y&&(n.set(y,{x:x.x,y:b}),m.push(y)),h.push({x:x.x,y:b,w:N,h:_,sid:S})}return m}function ZL(e,n,i,s,o){const u=y=>{const x=s.get(y);return{w:(x==null?void 0:x.width)??Ai,h:(x==null?void 0:x.height)??Ns}},l=y=>i.get(y)??n.get(y),c=new Map,d=[];for(const y of e){const x=l(y.id);if(!x)continue;const{w:N,h:_}=u(y.id);if(o.has(y.id)&&!i.has(y.id)){const S=Qu(y);(c.get(S)??c.set(S,[]).get(S)).push(y)}else d.push({x:x.x,y:x.y,w:N,h:_})}if(c.size===0)return[];const h=Cs+Xu,p=(y,x,N,_)=>d.some(S=>y<S.x+S.w+Cs&&S.x<y+N+Cs&&x<S.y+S.h+h&&S.y<x+_+h),m=[];for(const y of[...c.keys()].sort()){const x=c.get(y);let N=1/0,_=1/0,S=-1/0,b=-1/0;for(const M of x){const R=l(M.id),{w:L,h:F}=u(M.id);N=Math.min(N,R.x),_=Math.min(_,R.y),S=Math.max(S,R.x+L),b=Math.max(b,R.y+F)}const k=S-N,E=b-_,C=[...new Set(d.map(M=>Math.round(M.x)))].sort((M,R)=>M-R),A=C.length?C:[N],P=[0,...d.map(M=>M.y+M.h+h)].sort((M,R)=>M-R);let I=null;e:for(const M of A)for(const R of P){if(R>=_)break;if(!p(M,R,k,E)){I={x:M,y:R};break e}}if(I){const M=I.x-N,R=I.y-_;for(const L of x){const F=l(L.id);n.set(L.id,{x:F.x+M,y:F.y+R})}m.push(y)}for(const M of x){const R=l(M.id),{w:L,h:F}=u(M.id);d.push({x:R.x,y:R.y,w:L,h:F})}}return m}function JL(e,n,i,s,o,u=!1){const d=Cs+Xu+1,h=8,p=1.75,m=200,y=.7,x=.01,N=I=>{const M=s.get(I);return{w:(M==null?void 0:M.width)??Ai,h:(M==null?void 0:M.height)??Ns}},_=I=>i.get(I)??n.get(I),S=new Map;for(const I of e){if(!_(I.id))continue;const M=Qu(I),R=S.get(M);R?R.push(I):S.set(M,[I])}const b=[],k=new Set,E=new Set;for(const I of[...S.keys()].sort()){const M=S.get(I);let R=1/0,L=1/0,F=-1/0,Q=-1/0,X=!1;for(const ne of M){const K=_(ne.id),{w:D,h:V}=N(ne.id);R=Math.min(R,K.x),L=Math.min(L,K.y),F=Math.max(F,K.x+D),Q=Math.max(Q,K.y+V),i.has(ne.id)&&(X=!0)}const j=F-R,G=Q-L;E.add(I);const U=o.get(I);U&&(j>U.w+h||G>U.h+h)&&k.add(I),o.set(I,{w:j,h:G}),b.push({sid:I,members:M.map(ne=>ne.id),x:R,y:L,w:j,h:G,anchored:X,mass:1})}for(const I of[...o.keys()])E.has(I)||o.delete(I);if(u||k.size===0)return[];for(const I of b)k.has(I.sid)&&(I.mass=8);const C=new Map(b.map(I=>[I.sid,I.x])),A=new Map(b.map(I=>[I.sid,I.y]));for(let I=0;I<m;I++){const M=new Map,R=new Map;let L=0;for(let F=0;F<b.length;F++)for(let Q=F+1;Q<b.length;Q++){const X=b[F],j=b[Q];if(X.anchored&&j.anchored)continue;const G=X.x+X.w/2,U=X.y+X.h/2,ne=j.x+j.w/2,K=j.y+j.h/2,D=(X.w+j.w)/2+61-Math.abs(G-ne),V=(X.h+j.h)/2+d-Math.abs(U-K);if(D<=0||V<=0)continue;const O=(Ye,Qe)=>!Ye.anchored&&!(Qe<0&&Ye.x<=0),B=(Ye,Qe)=>!Ye.anchored&&!(Qe<0&&Ye.y<=0),ae=(Ye,Qe,et)=>{const Be=Ye===Qe,Ze=Be?X.sid<j.sid?-1:1:Math.sign(Ye-Qe);return et(X,Ze)||et(j,-Ze)?Ze:Be&&(et(X,-Ze)||et(j,Ze))?-Ze:0},z=ae(G,ne,O),W=ae(U,K,B),J=z!==0,se=W!==0;if(!J&&!se)continue;const ue=J&&(!se||D*p<V),[he,ge,Me,Fe]=ue?[z,D,M,O]:[W,V,R,B],Re=Fe(X,he),Pe=Fe(j,-he),be=X.mass,Oe=j.mass,ve=Re?Pe?Oe/(be+Oe):1:0,ye=Pe?Re?be/(be+Oe):1:0,qe=ge*y;Me.set(X.sid,(Me.get(X.sid)??0)+he*qe*ve),Me.set(j.sid,(Me.get(j.sid)??0)-he*qe*ye),L+=qe}for(const F of b)F.anchored||(F.x=Math.max(0,F.x+(M.get(F.sid)??0)),F.y=Math.max(0,F.y+(R.get(F.sid)??0)));if(L<x)break}const P=[];for(const I of b){const M=I.x-C.get(I.sid),R=I.y-A.get(I.sid);if(!(Math.abs(M)<1&&Math.abs(R)<1)){for(const L of I.members){if(i.has(L))continue;const F=n.get(L);F&&n.set(L,{x:F.x+M,y:F.y+R})}P.push(I.sid)}}return P}const e$=600;function jg(e,n){return!(e.exitAt!=null&&n-e.exitAt>e$||e.kind==="root"&&e.state==="done"&&e.tools.length===0&&e.endedAt!=null&&e.endedAt-e.startedAt<3e3)}function t$(e,n){const i=new Set;for(const s of e.agents.values())jg(s,n)&&i.add(s.id);return i}function Ei(e){return typeof window>"u"?"":getComputedStyle(document.documentElement).getPropertyValue(e).trim()||""}function n$(e){return e<1e3?`${e}`:e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(2)}M`}const r$={agent:wP,sessionGroup:jP},i$=420,lu=18,s$=9e4,o$=200,a$=5*6e4,u$=6,l$=2*6e4,yv="agent-dag.layout",wv="agent-dag.viewport",rC="agent-dag.summariesDismissed",iC="agent-dag.sessionListOpen",sC="agent-dag.detailOpen",oC="agent-dag.usagePanelOpen",_k="agent-dag.accountsPanelOpen";function c$(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(iC)==="1"}catch{return!1}}function f$(e){if(!(typeof window>"u"))try{window.localStorage.setItem(iC,e?"1":"0")}catch{}}function d$(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(sC)==="1"}catch{return!1}}function h$(e){if(!(typeof window>"u"))try{window.localStorage.setItem(sC,e?"1":"0")}catch{}}function p$(){if(typeof window>"u")return!0;const e=window.localStorage.getItem(oC);try{return e===null?!0:e==="1"}catch{return!0}}function m$(e){if(!(typeof window>"u"))try{window.localStorage.setItem(oC,e?"1":"0")}catch{}}function g$(){if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(rC);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 Sk(e){if(!(typeof window>"u"))try{const n=Array.from(e),i=n.length>200?n.slice(-200):n;window.localStorage.setItem(rC,JSON.stringify(i))}catch{}}function v$(){const e={positions:[],pins:[]};if(typeof window>"u")return e;try{const n=window.localStorage.getItem(yv);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 cg(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(yv,JSON.stringify({v:2,positions:i,pins:Array.from(n.keys())}))}catch{}}function y$(){if(typeof window>"u")return null;try{const e=window.localStorage.getItem(wv);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 w$(e){if(!(typeof window>"u"))try{window.localStorage.setItem(wv,JSON.stringify(e))}catch{}}function bk(){if(!(typeof window>"u")){try{window.localStorage.removeItem(yv)}catch{}try{window.localStorage.removeItem(wv)}catch{}}}function x$(e,n){const i=e.agents.get(n);if(!i)return;const s=[];for(const p of e.agents.values())p.sessionId===n&&s.push(p);const o={schemaVersion:1,exportedAt:new Date().toISOString(),sessionId:n,label:i.label,cwd:i.cwd,startedAt:i.startedAt,endedAt:i.endedAt,model:i.model,agents:s.map(p=>({id:p.id,kind:p.kind,label:p.label,parentId:p.parentId,state:p.state,startedAt:p.startedAt,endedAt:p.endedAt,model:p.model,cwd:p.cwd,usage:p.usage,prompts:p.prompts,tools:p.tools.map(m=>({id:m.id,name:m.name,inputPreview:m.inputPreview,startedAt:m.startedAt,endedAt:m.endedAt,ok:m.ok,errorPreview:m.errorPreview,usage:m.usage}))}))},u=JSON.stringify(o,null,2),l=new Blob([u],{type:"application/json"}),c=URL.createObjectURL(l),d=document.createElement("a"),h=(i.label||"session").replace(/[^a-z0-9._-]/gi,"_");d.href=c,d.download=`agents-deck-${h}-${n.slice(0,8)}.json`,document.body.appendChild(d),d.click(),document.body.removeChild(d),setTimeout(()=>URL.revokeObjectURL(c),1e3)}const Ag={file:"📁",shell:"⚡",web:"🌐",agent:"🤖",task:"📋",plan:"🧭",mcp:"🔌",other:"✨"},Ig={file:"file",shell:"shell",web:"web",agent:"agent",task:"task",plan:"plan",mcp:"mcp",other:"other"},_$={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 aC(e){return e.startsWith("mcp__")?"mcp":_$[e]??"other"}function uC(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 S$(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 b$(e,n,i,s,o,u,l,c,d,h,p,m,y,x,N,_,S,b){const k=[],E=[],C=new Set;if(u)for(const R of e.agents.values())uC(R,u)&&C.add(R.id);for(const R of e.agents.values()){if(!S.has(R.id))continue;const L=u?!C.has(R.id):!1,F=R.exitAt!=null,Q=_!=null&&!_.has(R.id),X=[L?"rf-dim":"",F?"rf-exiting":"",Q?"rf-spotlit-out":""].filter(Boolean).join(" ")||void 0,j=l.get(R.id);if(k.push({id:R.id,type:"agent",position:{x:0,y:0},data:{...R,now:n,dim:L,onOpenContext:b},className:X,...j?{width:j.width,height:j.height}:null}),R.parentId&&S.has(R.parentId)){const G=Zg(R.sessionId),U=R.state==="active"?`hsl(${G} 80% 72%)`:`hsl(${G} 50% 55%)`,ne=u&&!C.has(R.id)&&!C.has(R.parentId),K=F,D=N.size>0&&(N.has(R.id)||N.has(R.parentId)),V=_!=null&&!_.has(R.id)&&!_.has(R.parentId),O=R.state==="active"?2:1.5,B=D?O+1.5:O,ae=ne||K?.2:V?.12:1,z=[K?"rf-edge-exiting":"",D?"rf-edge-selected":""].filter(Boolean).join(" ")||void 0;E.push({id:`e:${R.parentId}->${R.id}`,source:R.parentId,target:R.id,animated:(R.state==="active"||D)&&!ne&&!K,type:"smoothstep",style:{stroke:U,strokeWidth:B,opacity:ae,transition:"opacity 500ms ease, stroke-width 200ms ease"},className:z})}}const A=k.filter(R=>!o.has(R.id)&&!m.has(R.id));if(A.length>0||y!==x.current){if(A.length>0){const R=XL(k,E,{direction:"LR",pinned:o,measured:l,availableWidth:i,availableHeight:s});for(const L of R)m.has(L.id)||m.set(L.id,L.position);ZL(k,m,o,l,new Set(A.map(L=>L.id)))}QL(k,m,o,l),x.current=y}const P=JL(k,m,o,l,c,!h||p);P.length>0&&d(P);for(const R of Array.from(m.keys()))e.agents.has(R)||m.delete(R);if(e.agents.size>0)for(const R of Array.from(o.keys()))e.agents.has(R)||o.delete(R);const I=[];let M=!1;for(const R of k){let L=o.get(R.id)??m.get(R.id);L||(L={x:0,y:0},m.set(R.id,L),M=!0),I.push({...R,position:L})}return M&&(x.current=""),{nodes:I,edges:E}}function k$(){return v.jsx(Xg,{children:v.jsx(E$,{})})}function E$(){const e=zo(),n=q.useRef(Cg()),[,i]=q.useState(0),s=q.useCallback(()=>i(Z=>Z+1),[]),[o,u]=q.useState(()=>new Set),[l,c]=q.useState(null),[d,h]=q.useState(null),p=q.useCallback((Z,te)=>{u(ce=>{if(!te)return new Set([Z]);const me=new Set(ce);return me.has(Z)?me.delete(Z):me.add(Z),me}),c(ce=>te&&ce===Z?ce:Z)},[]),m=q.useCallback(()=>{u(new Set),c(null)},[]),[y,x]=q.useState(null),[N,_]=q.useState(null),S=q.useCallback(Z=>_(Z),[]),b=q.useRef(g$()),[k,E]=q.useState(c$);q.useEffect(()=>{f$(k)},[k]);const[C,A]=q.useState(d$);q.useEffect(()=>{h$(C)},[C]);const[P,I]=q.useState(p$);q.useEffect(()=>{m$(P)},[P]);const[M,R]=q.useState(()=>{try{const Z=window.localStorage.getItem(_k);return Z===null?!0:Z==="1"}catch{return!0}});q.useEffect(()=>{try{window.localStorage.setItem(_k,M?"1":"0")}catch{}},[M]);const[L,F]=q.useState(null),[Q,X]=q.useState(!1),[j,G]=q.useState(0),[U,ne]=q.useState(0);q.useEffect(()=>{fetch("/api/sound-hook").then(Z=>Z.ok?Z.json():null).then(Z=>{Z!=null&&Z.ok&&(F(Z.enabled===!0),G((Z.foreign??[]).filter(te=>te.worksHere).length),ne(typeof Z.parked=="number"?Z.parked:0))}).catch(()=>{})},[]);const K=q.useCallback(async()=>{X(!0);try{const te=await(await fetch("/api/sound-hook",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:!L})})).json().catch(()=>null);te!=null&&te.ok&&F(te.enabled===!0),fetch("/api/sound-hook").then(ce=>ce.ok?ce.json():null).then(ce=>{ce!=null&&ce.ok&&(G((ce.foreign??[]).filter(me=>me.worksHere).length),ne(typeof ce.parked=="number"?ce.parked:0))}).catch(()=>{})}catch{}finally{X(!1)}},[L]),D=q.useCallback(()=>{E(Z=>(Z||R(!1),!Z))},[]),V=q.useCallback(()=>{R(Z=>(Z||E(!1),!Z))},[]),[O,B]=q.useState(!1),[ae,z]=q.useState(0),W=q.useRef(null),[J,se]=q.useState(0),[ue,he]=q.useState(!1),[ge,Me]=q.useState(!1),Fe=q.useRef([]),[Re,Pe]=q.useState(Date.now()),be=q.useRef(v$()).current;q.useRef(!1);const Oe=q.useRef(new Map(be.positions.filter(([Z])=>be.pins.includes(Z)))),ve=q.useRef(null),ye=q.useState(()=>y$())[0],[qe,Ye]=q.useState(""),[Qe,et]=q.useState(()=>new Set),[Be,Ze]=q.useState(()=>typeof window>"u"?"dark":window.localStorage.getItem("agent-dag.theme")??"dark"),[At,Vt]=q.useState(!1),It=q.useRef(null);q.useEffect(()=>{document.documentElement.dataset.theme=Be;try{window.localStorage.setItem("agent-dag.theme",Be)}catch{}},[Be]),q.useEffect(()=>{if(!ye)return;const Z=window.setTimeout(()=>{try{e.setViewport(ye,{duration:0})}catch{}},60);return()=>window.clearTimeout(Z)},[e,ye]);const pt=q.useRef(!0),tt=q.useRef(null);q.useEffect(()=>{const Z=new EventSource("/events");return Z.addEventListener("open",()=>{he(!0),Vt(!0)}),Z.addEventListener("error",()=>he(!1)),Z.addEventListener("replay-end",()=>{pt.current=!1,tt.current!=null&&(window.clearTimeout(tt.current),tt.current=null),s()}),Z.addEventListener("hook",te=>{try{const ce=JSON.parse(te.data);if(ge){Fe.current.push(ce);return}n.current=Fw(n.current,ce),ce.replay===!0||pt.current||Date.now()-ce.receivedAt>3e4?(tt.current!=null&&window.clearTimeout(tt.current),tt.current=window.setTimeout(()=>{tt.current=null,s()},120)):(tt.current!=null&&(window.clearTimeout(tt.current),tt.current=null),s())}catch{}}),()=>{Z.close(),tt.current!=null&&(window.clearTimeout(tt.current),tt.current=null)}},[ge,s]),q.useEffect(()=>{if(!ge&&Fe.current.length!==0){for(const Z of Fe.current)n.current=Fw(n.current,Z);Fe.current.length=0,s()}},[ge,s]),q.useEffect(()=>{const Z=setInterval(()=>{const te=Date.now();Pe(te);let ce=rP(n.current,te,s$);tP(n.current,te,o$,a$)&&(ce=!0),nP(n.current,te,u$,l$)&&(ce=!0),ce&&s()},250);return()=>clearInterval(Z)},[s]);const kt=q.useRef(null),We=q.useRef(0),Et=420,Ge=q.useCallback((Z=500)=>{try{const we=document.querySelector(".canvas-wrap"),Le=Array.from(document.querySelectorAll(".react-flow__node")).filter(Je=>Je.offsetWidth>0);if(!we||Le.length===0)return;const ze=we.getBoundingClientRect(),Te=e.getViewport();if(!Number.isFinite(Te.zoom)||Te.zoom<=0)return;const Ke=Je=>(Je-ze.left-Te.x)/Te.zoom,it=Je=>(Je-ze.top-Te.y)/Te.zoom,Kt=Le.map(Je=>Je.getBoundingClientRect()),Rr=Math.min(...Kt.map(Je=>Ke(Je.left))),Gi=Math.max(...Kt.map(Je=>Ke(Je.right))),jr=Math.min(...Kt.map(Je=>it(Je.top))),li=Math.max(...Kt.map(Je=>it(Je.bottom))),ci=Gi-Rr,fn=li-jr;if(!(ci>0&&fn>0))return;const Ct=Math.max(.2,Math.min(1,(ze.width-160)/(ci+Et)*.86,(ze.height-160)/fn*.86));e.setViewport({x:80-Rr*Ct,y:Math.max(80,(ze.height-fn*Ct)/2)-jr*Ct,zoom:Ct},{duration:Z}),We.current=Date.now(),window.setTimeout(()=>{try{const Je={x:80-Rr*Ct,y:Math.max(80,(ze.height-fn*Ct)/2)-jr*Ct,zoom:Ct},Ar=e.getViewport();(Math.abs(Ar.zoom-Ct)>.01||Math.abs(Ar.x-Je.x)>2)&&e.setViewport(Je,{duration:0})}catch{}},Z+60)}catch{}},[e]),ft=q.useRef(""),on=q.useRef(null),Lt=q.useRef(0),wt=q.useCallback(()=>{Lt.current=Date.now()},[]),an="agent-dag.autoFitDisabled",Bt=q.useRef((()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem(an)==="1"}catch{return!1}})()),[vn,un]=q.useState(Bt.current),yn=q.useCallback(()=>{if(!Bt.current){Bt.current=!0,un(!0);try{window.localStorage.setItem(an,"1")}catch{}}},[]),wn=q.useCallback(()=>{Bt.current=!1,un(!1);try{window.localStorage.removeItem(an)}catch{}Ge(400)},[e,Ge]);q.useEffect(()=>{const Z=setInterval(()=>{if(Bt.current||Date.now()-Lt.current<800)return;const te=n.current,ce=Date.now(),me=[];for(const Ke of te.agents.values())jg(Ke,ce)&&me.push({id:Ke.id});if(me.length===0)return;const _e=e.getViewport(),we=window.innerWidth-360,Le=window.innerHeight-52;let ze=!1,Te=!1;for(const{id:Ke}of me){const it=Mn.current.get(Ke),Kt=Oe.current.get(Ke)??Nt.current.get(Ke);if(!it||!Kt)continue;Te=!0;const Rr=Kt.x*_e.zoom+_e.x,Gi=Kt.y*_e.zoom+_e.y,jr=(Kt.x+it.width)*_e.zoom+_e.x,li=(Kt.y+it.height)*_e.zoom+_e.y;if(jr>0&&Rr<we&&li>0&&Gi<Le){ze=!0;break}}Te&&!ze&&Ge(600)},1500);return()=>clearInterval(Z)},[e]);const _r=q.useRef(!1),Mn=q.useRef(new Map),ti=q.useRef(0),$i=q.useCallback(Z=>{const te=Mn.current;let ce=!1;for(const me of Z.nodeInternals.values()){const _e=me.width,we=me.height;if(_e==null||we==null)continue;const Le=te.get(me.id);Le?(Math.abs(Le.height-we)>4||Math.abs(Le.width-_e)>4)&&(te.set(me.id,{width:_e,height:we}),ce=!0):(te.set(me.id,{width:_e,height:we}),ce=!0)}return ce&&(ti.current+=1),ti.current},[]),Sr=Xe($i),[ni,ir]=q.useState(0);q.useEffect(()=>{let Z=0;const te=()=>{const me=Mn.current;let _e=!1;for(const we of document.querySelectorAll(".react-flow__node[data-id]")){const Le=we.getAttribute("data-id");if(!Le)continue;const ze=we.offsetWidth,Te=we.offsetHeight;if(!ze||!Te)continue;const Ke=me.get(Le);(!Ke||Math.abs(Ke.width-ze)>4||Math.abs(Ke.height-Te)>4)&&(me.set(Le,{width:ze,height:Te}),_e=!0)}_e&&ir(we=>we+1)};if(_r.current)return;let ce=0;return document.visibilityState==="hidden"?ce=window.setTimeout(te,32):Z=requestAnimationFrame(te),()=>{cancelAnimationFrame(Z),window.clearTimeout(ce)}});const Nt=q.useRef(new Map(be.positions)),Pn=q.useRef(""),Yn=q.useMemo(()=>{const Z=[];for(const te of n.current.agents.values())jg(te,Re)&&Z.push(te.id+(te.parentId?`>${te.parentId}`:""));return Z.sort(),`${Z.join("|")}#sv${Sr}.${ni}`},[n.current,n.current.lastSeq,Re,Sr,ni]),ln=q.useRef(null);q.useEffect(()=>(ln.current!=null&&window.clearTimeout(ln.current),ln.current=window.setTimeout(()=>{cg(Nt.current,Oe.current)},1500),()=>{ln.current!=null&&window.clearTimeout(ln.current)}),[Yn]),q.useEffect(()=>{if(ft.current===Yn)return;const Z=ft.current;if(ft.current=Yn,!Z||Bt.current)return;Date.now()-We.current>1200&&Ge(400),kt.current&&window.clearTimeout(kt.current),kt.current=window.setTimeout(()=>{Bt.current||Ge(500)},280)},[Yn,e,Ge]);const Kn=q.useMemo(()=>{if(o.size===0)return null;const Z=new Set;for(const te of o){const ce=S$(n.current,te);if(ce)for(const me of ce)Z.add(me)}return Z.size>0?Z:null},[n.current,n.current.lastSeq,o]),Xn=q.useMemo(()=>t$(n.current,Re),[n.current,n.current.lastSeq,Re]),br=q.useRef(null),[kr,Di]=q.useState({w:0,h:0});q.useEffect(()=>{const Z=br.current;if(!Z||typeof ResizeObserver>"u")return;const te=new ResizeObserver(ce=>{var _e;const me=(_e=ce[0])==null?void 0:_e.contentRect;me&&Di(we=>Math.abs(we.w-me.width)>40||Math.abs(we.h-me.height)>40?{w:me.width,h:me.height}:we)});return te.observe(Z),Di({w:Z.clientWidth,h:Z.clientHeight}),()=>te.disconnect()},[]);const Fi=q.useRef(new Map),[xn,zi]=q.useState(!1);q.useEffect(()=>{const Z=window.setTimeout(()=>zi(!0),2500);return()=>window.clearTimeout(Z)},[]);const[Bi,ri]=q.useState(!1),cn=q.useRef(null),[Er,ii]=q.useState(!1),Ui=q.useCallback(()=>{cn.current&&(window.clearTimeout(cn.current),cn.current=null),ri(!1)},[]),Hi=q.useCallback(Z=>{Z.length!==0&&queueMicrotask(()=>{ri(!0),cn.current&&window.clearTimeout(cn.current),cn.current=window.setTimeout(()=>ri(!1),i$+80)})},[]);q.useEffect(()=>()=>{cn.current&&window.clearTimeout(cn.current)},[]);const Vi=kr.w>0?kr.w*.92:0,nt=kr.h>0?kr.h:0,{nodes:Wt,edges:si}=q.useMemo(()=>b$(n.current,Re,Vi,nt,Oe.current,qe,Mn.current,Fi.current,Hi,xn,Er,Nt.current,Yn,Pn,o,Kn,Xn,S),[n.current,n.current.lastSeq,Re,Vi,nt,xn,Er,qe,Yn,o,Kn,Xn,S,ae]),oi=q.useMemo(()=>{const Z=new Map;for(const ce of Wt){const me=ce.data;if(!(me!=null&&me.sessionId)||me.exitAt!=null)continue;const _e=ce.width,we=ce.height;if(_e==null||we==null)continue;const Le=ce.position.x,ze=ce.position.y,Te=Le+_e,Ke=ze+we,it=Z.get(me.sessionId);it?(it.minX=Math.min(it.minX,Le),it.minY=Math.min(it.minY,ze),it.maxX=Math.max(it.maxX,Te),it.maxY=Math.max(it.maxY,Ke)):Z.set(me.sessionId,{minX:Le,minY:ze,maxX:Te,maxY:Ke})}const te=[];for(const[ce,me]of Z){const _e=me.maxX-me.minX+lu*2,we=me.maxY-me.minY+lu*2;te.push({id:`group:${ce}`,type:"sessionGroup",position:{x:me.minX-lu,y:me.minY-lu},data:{sessionId:ce,w:_e,h:we},width:_e,height:we,style:{width:_e,height:we},zIndex:-1,draggable:!0,selectable:!1,focusable:!1,deletable:!1,connectable:!1})}return te},[Wt,Re]),Nr=q.useMemo(()=>{const Z=[...oi,...Wt],te=W.current;return!te||te.size===0?Z:Z.map(ce=>{const me=te.get(ce.id);return me?{...ce,position:me}:ce})},[oi,Wt,J]),Wi=q.useMemo(()=>{if(!qe)return null;const Z=new Set;for(const te of n.current.agents.values())uC(te,qe)&&Z.add(te.id);return Z},[n.current,n.current.lastSeq,qe]),ai=q.useMemo(()=>{const Z=new Set;for(const te of n.current.agents.values())for(const ce of te.tools)Z.add(aC(ce.name));return Object.keys(Ag).filter(te=>Z.has(te))},[n.current,n.current.lastSeq]),_n=q.useMemo(()=>{const Z=new Map;for(const ce of n.current.agents.values())for(const me of ce.tools){if(!me.name.startsWith("mcp__"))continue;const _e=me.name.slice(5),we=_e.indexOf("__"),Le=we>0?_e.slice(0,we):_e;Z.set(Le,(Z.get(Le)??0)+1)}const te=[];for(const[ce,me]of Z){let _e=5381;for(let we=0;we<ce.length;we++)_e=(_e<<5)+_e^ce.charCodeAt(we);te.push({server:ce,count:me,hue:Math.abs(_e)%360})}return te.sort((ce,me)=>me.count-ce.count),te},[n.current,n.current.lastSeq]),Gt=q.useCallback(Z=>{et(te=>{const ce=new Set(te);return ce.has(Z)?ce.delete(Z):ce.add(Z),ce})},[]),gt=l?n.current.agents.get(l):null,Yt=d?Array.from(n.current.agents.values()).flatMap(Z=>Z.tools).find(Z=>Z.id===d)??null:null,Ls=q.useCallback(async()=>{try{await fetch("/api/clear",{method:"POST"})}catch{}n.current=Cg(),Oe.current.clear(),Mn.current.clear(),Nt.current.clear(),Pn.current="",bk(),m(),s()},[s,m]),$s=q.useCallback(()=>{Oe.current.clear(),Nt.current.clear(),Pn.current="",bk(),s(),window.setTimeout(()=>Ge(500),80)},[s,e,Ge]),Yo=q.useCallback(()=>Ge(500),[Ge]),Cr=q.useCallback(Z=>{if(Wt.length===0)return;const te=Wt.slice().sort((we,Le)=>we.position.y-Le.position.y||we.position.x-Le.position.x),ce=l?te.findIndex(we=>we.id===l):-1;let me;ce===-1?me=Z===1?0:te.length-1:me=(ce+Z+te.length)%te.length;const _e=te[me];_e&&(p(_e.id,!1),window.setTimeout(()=>{try{e.fitView({padding:.35,duration:350,nodes:[_e]})}catch{}We.current=Date.now()},30))},[Wt,l,p,e]);q.useEffect(()=>{const Z=te=>{var me,_e;const ce=((me=te.target)==null?void 0:me.tagName)==="INPUT";if(te.key==="Escape"){ce?te.target.blur():m();return}if(!ce){if(te.key==="/"){te.preventDefault(),(_e=It.current)==null||_e.focus();return}te.key===" "&&(te.preventDefault(),Me(we=>!we)),(te.key==="c"||te.key==="C")&&Ls(),(te.key==="r"||te.key==="R")&&$s(),(te.key==="f"||te.key==="F")&&Yo(),(te.key==="l"||te.key==="L")&&D(),(te.key==="h"||te.key==="H")&&B(we=>!we),(te.key==="u"||te.key==="U")&&I(we=>!we),(te.key==="a"||te.key==="A")&&V(),(te.key==="j"||te.key==="J")&&Cr(1),(te.key==="k"||te.key==="K")&&Cr(-1),(te.key==="t"||te.key==="T")&&Ze(we=>we==="dark"?"light":"dark")}};return window.addEventListener("keydown",Z),()=>window.removeEventListener("keydown",Z)},[Ls,$s,Yo,m,Cr]);const Tr=n.current.agents.size,ui=new Set(Array.from(n.current.agents.values()).map(Z=>Z.sessionId)).size,Mt=q.useMemo(()=>{let Z=0,te=0,ce=0,me=0,_e=0,we=0,Le=0,ze=0,Te=0;for(const Ke of n.current.agents.values()){Z+=Ke.usage.inputTokens,te+=Ke.usage.outputTokens,ce+=Ke.usage.cacheReadTokens,me+=Ke.usage.cacheCreateTokens;const it=rn(Ke.usage,Ke.model);_e+=it.total,we+=it.input,Le+=it.output,ze+=it.cacheRead,Te+=it.cacheWrite}return{inT:Z,outT:te,cacheR:ce,cacheC:me,sum:Z+te,cost:{total:_e,input:we,output:Le,cacheRead:ze,cacheWrite:Te}}},[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.30.4"]})]}),gt&&(()=>{const Z=rn(gt.usage,gt.model),te=Math.max(0,((gt.endedAt??Re)-gt.startedAt)/1e3),ce=gt.state==="active"?ku(Z.total,te):null,me=o.size-1;return v.jsxs("button",{type:"button",className:"selected-ribbon",title:`Fit view to ${gt.label}`,onClick:()=>{try{const _e=Wt.find(we=>we.id===gt.id);_e&&e.fitView({padding:.35,duration:500,nodes:[_e]}),We.current=Date.now()}catch{}},children:[v.jsx("span",{className:`state-pill state-${gt.state}`,children:gt.state==="active"?"live":gt.state}),v.jsx("span",{className:"selected-label",children:gt.label}),Z.total>0&&v.jsxs("span",{className:"selected-cost",children:[He(Z.total),ce?v.jsxs("span",{className:"selected-rate",children:[" · ",ce]}):null]}),me>0&&v.jsxs("span",{className:"selected-extra",children:["+",me]}),v.jsx("span",{role:"button","aria-label":"Deselect",className:"selected-close",onClick:_e=>{_e.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:It,type:"text",placeholder:"Search agents, cwd, tools…",value:qe,onChange:Z=>Ye(Z.target.value),spellCheck:!1,"aria-label":"Filter the graph"}),qe?v.jsx("button",{className:"search-clear","aria-label":"Clear search",onClick:()=>Ye(""),children:"×"}):v.jsx("kbd",{className:"search-kbd","aria-hidden":!0,children:"/"})]}),v.jsxs("span",{className:"status",role:"status",children:[v.jsx("span",{className:`pill ${ue?"live":"dead"}`,title:ue?"Receiving events":"SSE disconnected",children:ue?"live":"offline"}),v.jsxs("span",{className:"stat",title:"Distinct CC sessions",children:[v.jsx("span",{className:"count",children:ui}),v.jsx("span",{className:"lbl",children:"sessions"})]}),v.jsxs("span",{className:"stat",title:"Total agents (root + subagents)",children:[v.jsx("span",{className:"count",children:Tr}),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"})]}),Mt.sum>0&&v.jsxs("span",{className:"stat",title:`in:${Mt.inT.toLocaleString()} out:${Mt.outT.toLocaleString()} cache-r:${Mt.cacheR.toLocaleString()} cache-c:${Mt.cacheC.toLocaleString()}`,children:[v.jsx("span",{className:"count",children:n$(Mt.sum)}),v.jsx("span",{className:"lbl",children:"tokens"})]}),_n.length>0&&v.jsxs("span",{className:"stat mcp-legend",title:`MCP servers seen this session:
60
+ ${_n.map(Z=>` ${Z.server}: ${Z.count} call${Z.count===1?"":"s"}`).join(`
61
+ `)}`,children:[_n.slice(0,6).map(Z=>v.jsx("span",{className:"mcp-dot",style:{background:`hsl(${Z.hue} 65% 65%)`}},Z.server)),_n.length>6&&v.jsxs("span",{className:"mcp-more",children:["+",_n.length-6]}),v.jsx("span",{className:"lbl",children:"mcp"})]}),Mt.cost.total>0&&(()=>{let Z=0,te=0;for(const _e of n.current.agents.values()){if(_e.state!=="active")continue;const we=rn(_e.usage,_e.model);Z+=we.total,te=Math.max(te,((_e.endedAt??Re)-_e.startedAt)/1e3)}const ce=te>0?ku(Z,te):null,me=`input ${He(Mt.cost.input)} + output ${He(Mt.cost.output)} + cache r ${He(Mt.cost.cacheRead)} + cache w ${He(Mt.cost.cacheWrite)}${ce?`
62
+ active burn: ${ce}`:""}`;return v.jsxs("span",{className:"stat",title:me,children:[v.jsx("span",{className:"count",children:He(Mt.cost.total)}),v.jsxs("span",{className:"lbl",children:["cost",ce?` · ${ce}`:""]})]})})()]}),v.jsx("button",{className:`btn ${ge?"warn":""}`,onClick:()=>Me(Z=>!Z),title:"Pause/resume live updates (Space)",children:ge?`Resume${Fe.current.length?` · ${Fe.current.length}`:""}`:"Pause"}),v.jsx("button",{className:`btn icon-btn ${P?"primary":""}`,onClick:()=>I(Z=>!Z),title:`${P?"Hide":"Show"} usage panel (U)`,"aria-label":"Toggle usage panel",children:"$"}),L!==null&&v.jsx("button",{className:`btn icon-btn ${L?"primary":""}`,onClick:Z=>{if(Z.shiftKey&&U>0){X(!0),fetch("/api/sound-hook",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"restore"})}).then(()=>fetch("/api/sound-hook")).then(te=>te.ok?te.json():null).then(te=>{te!=null&&te.ok&&(F(te.enabled===!0),ne(te.parked??0))}).catch(()=>{}).finally(()=>X(!1));return}K()},disabled:Q,title:(L?"Sound on turn finish: on — click to remove the hook":"Sound on turn finish: off — click to add a Stop hook")+(j>0?`
63
+
64
+ ${j} sound hook${j>1?"s":""} of your own in settings.json also run${j>1?"":"s"} here.`:"")+(U>0?`
65
+
66
+ ${U} of your own sound hook${U>1?"s were":" was"} set aside so this switch actually controls the sound. Nothing was deleted — shift-click to put ${U>1?"them":"it"} back.`:""),"aria-label":"Toggle finish sound","aria-pressed":L,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"}),L?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 ${M?"primary":""}`,onClick:V,title:`${M?"Hide":"Show"} accounts (A)`,"aria-label":"Toggle accounts panel",children:v.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 14 14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[v.jsx("circle",{cx:"7",cy:"4.6",r:"2.4"}),v.jsx("path",{d:"M2.4 12c0-2.3 2.1-3.7 4.6-3.7s4.6 1.4 4.6 3.7"})]})}),v.jsx("button",{className:`btn icon-btn ${k?"primary":""}`,onClick:D,title:`${k?"Hide":"Show"} session list (L)`,"aria-label":"Toggle session list",children:"☰"}),v.jsx("button",{className:`btn icon-btn ${O?"primary":""}`,onClick:()=>B(Z=>!Z),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:$s,title:"Auto-arrange — clear pins (R)",children:"Re-layout"}),v.jsx("button",{className:"btn",onClick:Ls,title:"Clear canvas (C)",children:"Clear"}),v.jsx("button",{className:"btn icon-btn",onClick:()=>Ze(Z=>Z==="dark"?"light":"dark"),title:`Switch to ${Be==="dark"?"light":"dark"} mode (T)`,"aria-label":"Toggle theme",children:Be==="dark"?"☀":"☾"})]})]}),At&&!ue&&v.jsxs("div",{className:"conn-banner",role:"alert",children:[v.jsx("span",{className:"conn-dot"}),"Lost connection to agents-deck server. Reconnecting…"]}),P&&v.jsx(w3,{state:n.current,now:Re,onClose:()=>I(!1)}),M&&v.jsx(E3,{onClose:()=>R(!1)}),k&&v.jsx(l3,{state:n.current,now:Re,selectedIds:o,onSelect:Z=>{p(Z,!1),window.setTimeout(()=>{try{const te=Wt.find(ce=>ce.id===Z);te&&e.fitView({padding:.3,duration:500,nodes:[te]}),We.current=Date.now()}catch{}},60)},onClose:()=>E(!1)}),v.jsxs("div",{className:`canvas-wrap${Bi?" bubbling":""}${Er?" dragging-any":""}`,ref:br,children:[Tr===0&&v.jsx(N$,{live:ue,everConnected:At}),ai.length>1&&v.jsx("div",{className:"cat-filter-bar",role:"toolbar","aria-label":"Filter tools by category",children:ai.map(Z=>{const te=Qe.has(Z);return v.jsxs("button",{type:"button",className:`cat-filter${te?" off":""}`,onClick:()=>Gt(Z),title:`${te?"Show":"Hide"} ${Ig[Z]} tools`,children:[v.jsx("span",{className:"cat-emoji",children:Ag[Z]}),v.jsx("span",{className:"cat-name",children:Ig[Z]})]},Z)})}),v.jsxs(BE,{nodes:Nr,edges:si,nodeTypes:r$,fitView:!ye,fitViewOptions:{padding:.25,duration:400},minZoom:.2,maxZoom:1.6,panOnScroll:!0,nodesDraggable:!0,nodesConnectable:!1,selectionOnDrag:!1,onNodeClick:(Z,te)=>{if(te.type==="sessionGroup"){m();return}p(te.id,Z.shiftKey)},onPaneClick:()=>m(),onMoveStart:()=>{Date.now()-We.current<1200||yn()},onMove:(Z,te)=>{wt(),on.current&&window.clearTimeout(on.current),on.current=window.setTimeout(()=>w$(te),250)},onNodeDragStart:(Z,te)=>{var ce;if(Ui(),_r.current=!0,W.current=new Map,ii(!0),wt(),yn(),te.type==="sessionGroup"){const me=(ce=te.data)==null?void 0:ce.sessionId,_e=new Map;if(me)for(const we of Wt){const Le=we.data;(Le==null?void 0:Le.sessionId)===me&&_e.set(we.id,{x:we.position.x,y:we.position.y})}ve.current={start:{x:te.position.x,y:te.position.y},members:_e};return}Oe.current.set(te.id,{x:te.position.x,y:te.position.y})},onNodeDrag:(Z,te)=>{var ce;if(wt(),te.type==="sessionGroup"){const me=ve.current;if(!me)return;const _e=te.position.x-me.start.x,we=te.position.y-me.start.y;for(const[ze,Te]of me.members){const Ke={x:Te.x+_e,y:Te.y+we};Oe.current.set(ze,Ke),Nt.current.set(ze,Ke)}const Le=W.current;if(Le){for(const[ze,Te]of me.members)Le.set(ze,{x:Te.x+_e,y:Te.y+we});Le.set(te.id,{x:te.position.x,y:te.position.y})}se(ze=>ze+1);return}Oe.current.set(te.id,{x:te.position.x,y:te.position.y}),Nt.current.set(te.id,{x:te.position.x,y:te.position.y}),(ce=W.current)==null||ce.set(te.id,{x:te.position.x,y:te.position.y}),se(me=>me+1)},onNodeDragStop:(Z,te)=>{if(wt(),_r.current=!1,W.current=null,ii(!1),z(ce=>ce+1),te.type==="sessionGroup"){const ce=ve.current;if(ce){const me=te.position.x-ce.start.x,_e=te.position.y-ce.start.y;for(const[we,Le]of ce.members){const ze={x:Le.x+me,y:Le.y+_e};Oe.current.set(we,ze),Nt.current.set(we,ze)}}ve.current=null,cg(Nt.current,Oe.current),z(me=>me+1);return}Oe.current.set(te.id,{x:te.position.x,y:te.position.y}),Nt.current.set(te.id,{x:te.position.x,y:te.position.y}),cg(Nt.current,Oe.current)},children:[v.jsx(KM,{gap:28,size:1,color:Ei("--grid-line")}),v.jsx(TP,{}),v.jsx(r3,{agents:n.current.agents,visibleAgentIds:Xn,positions:Nt.current,pinned:Oe.current,measured:Mn.current,dimUnmatched:Wi,spotlight:Kn,hiddenCategories:Qe,now:Re,onOpenTool:h}),v.jsx(UM,{showInteractive:!1,children:v.jsx(Ss,{onClick:wn,title:vn?"Recenter view + re-enable autofit":"Recenter view (autofit already on)","aria-label":"Recenter view",style:vn?{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(qM,{zoomable:!0,pannable:!0,nodeColor:Z=>{const te=Z.data;return te.state==="err"?Ei("--err"):te.state==="active"?Ei("--inflight"):Ei("--ok")},nodeStrokeWidth:2,maskColor:Ei("--minimap-mask"),style:{background:Ei("--panel"),border:`1px solid ${Ei("--line")}`,borderRadius:8}})]})]}),C?v.jsxs("aside",{className:"detail",children:[v.jsx("button",{type:"button",className:"detail-close",title:"Close panel","aria-label":"Close detail panel",onClick:()=>A(!1),children:"×"}),gt?v.jsx(R$,{agent:gt,now:Re,onOpenTool:h,onShowSummary:Z=>{b.current.has(Z)&&(b.current.delete(Z),Sk(b.current)),x(Z)},onExportSession:Z=>x$(n.current,Z)}):v.jsx(T$,{count:Tr})]}):v.jsx("button",{type:"button",className:"detail-reopen",title:"Show detail panel","aria-label":"Show detail panel",onClick:()=>A(!0),children:"‹"}),Yt&&v.jsx(kP,{tool:Yt,onClose:()=>h(null)}),O&&v.jsx(R3,{onClose:()=>B(!1)}),N&&(()=>{const Z=n.current.agents.get(N);return Z?v.jsx(mP,{agent:Z,onClose:()=>_(null)}):null})(),y&&v.jsx(i3,{state:n.current,sessionId:y,onClose:()=>{b.current.add(y),Sk(b.current),x(null)}})]})}function N$({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."]})]}):C$()]})}function C$(){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 T$({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 R$({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=rn(e.usage,e.model),h=d.total>0,p=e.usage.inputTokens+e.usage.outputTokens,m=new Map;for(const _ of e.tools){const S=aC(_.name);m.set(S,(m.get(S)??0)+1)}const y=e.tools.filter(_=>_.ok===!1).length,x=e.tools.filter(_=>!_.endedAt).length,N=Array.from(m.entries()).sort((_,S)=>S[1]-_[1]);return v.jsxs(v.Fragment,{children:[v.jsxs("header",{className:"detail-hero",children:[v.jsxs("div",{className:"hero-line",children:[v.jsx("span",{className:`state-pill state-${e.state}`,children:e.state==="active"?"live":e.state}),v.jsx("h2",{className:"hero-title",title:e.cwd??e.label,children:e.label})]}),v.jsxs("div",{className:"hero-meta",children:[v.jsx("span",{className:"hero-meta-item",children:e.kind}),v.jsx("span",{className:"hero-sep",children:"·"}),v.jsx("span",{className:"hero-meta-item",title:`started ${new Date(e.startedAt).toLocaleString()}`,children:c}),e.model&&v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"hero-sep",children:"·"}),v.jsx("span",{className:"model-chip",title:e.model,children:Bo(e.model)})]})]}),h&&v.jsxs("div",{className:"hero-cost",children:[v.jsxs("div",{className:"hero-cost-headline",children:[v.jsx("span",{className:"hero-cost-value",children:He(d.total)}),v.jsx("span",{className:"hero-cost-label",children:"spend"})]}),v.jsx(j$,{cost:d})]}),v.jsxs("div",{className:"hero-actions",children:[e.kind==="root"&&e.state==="done"&&s&&v.jsx("button",{type:"button",className:"btn hero-action-btn",onClick:()=>s(e.sessionId),title:"Reopen the end-of-session recap modal",children:"Show recap"}),o&&v.jsx("button",{type:"button",className:"btn hero-action-btn",onClick:()=>o(e.sessionId),title:"Download this session as JSON",children:"Export JSON"})]})]}),e.tools.length>0&&v.jsxs("section",{className:"detail-section",children:[v.jsx("h3",{children:"Activity"}),v.jsxs("div",{className:"activity-row",children:[v.jsxs("div",{className:"activity-counters",children:[v.jsxs("span",{className:"ac-item",children:[v.jsx("b",{children:e.toolCount})," calls"]}),x>0&&v.jsxs("span",{className:"ac-item ac-live",children:[v.jsx("b",{children:x})," live"]}),y>0&&v.jsxs("span",{className:"ac-item ac-err",children:[v.jsx("b",{children:y})," err"]})]}),v.jsx("div",{className:"cat-strip",children:N.map(([_,S])=>v.jsxs("span",{className:`cat-chip cat-${_}`,title:`${S} ${Ig[_]} call${S===1?"":"s"}`,children:[v.jsx("span",{className:"cat-emoji",children:Ag[_]}),v.jsx("span",{className:"cat-count",children:S})]},_))})]})]}),p>0&&v.jsxs("section",{className:"detail-section",children:[v.jsx("h3",{children:"Tokens"}),v.jsxs("div",{className:"tokens-grid",children:[v.jsxs("div",{children:[v.jsx("span",{className:"k",children:"in"}),v.jsx("b",{children:e.usage.inputTokens.toLocaleString()})]}),v.jsxs("div",{children:[v.jsx("span",{className:"k",children:"out"}),v.jsx("b",{children:e.usage.outputTokens.toLocaleString()})]}),v.jsxs("div",{children:[v.jsx("span",{className:"k",children:"cache r"}),v.jsx("b",{children:e.usage.cacheReadTokens.toLocaleString()})]}),v.jsxs("div",{children:[v.jsx("span",{className:"k",children:"cache c"}),v.jsx("b",{children:e.usage.cacheCreateTokens.toLocaleString()})]})]})]}),v.jsxs("section",{className:"detail-section",children:[v.jsx("h3",{children:"Identity"}),v.jsxs("div",{children:[e.cwd&&v.jsxs("div",{className:"row",children:[v.jsx("span",{className:"k",children:"cwd"}),v.jsx("span",{className:"v",title:e.cwd,children:e.cwd})]}),v.jsxs("div",{className:"row",children:[v.jsx("span",{className:"k",children:"session"}),v.jsxs("span",{className:"v",children:[e.sessionId.slice(0,12),"…"]})]}),e.parentId&&v.jsxs("div",{className:"row",children:[v.jsx("span",{className:"k",children:"parent"}),v.jsxs("span",{className:"v",children:[e.parentId.slice(0,12),"…"]})]})]})]}),e.prompts.length>0&&v.jsxs("section",{className:"detail-section",children:[v.jsxs("h3",{children:["Prompts ",v.jsx("span",{className:"section-count",children:e.prompts.length})]}),v.jsx("div",{className:"prompts",children:e.prompts.slice().reverse().map((_,S)=>v.jsxs("div",{className:"prompt-entry",children:[v.jsx("div",{className:"prompt-time",children:new Date(_.at).toLocaleTimeString()}),v.jsx("div",{className:"prompt-text",children:_.text})]},S))})]}),v.jsxs("section",{className:"detail-section",children:[v.jsxs("h3",{children:["Tool calls ",v.jsx("span",{className:"section-count",children:e.tools.length})]}),e.tools.length===0&&v.jsx("div",{className:"empty",children:"No tool calls yet."}),v.jsx("div",{children:e.tools.slice().reverse().map(_=>v.jsx(A$,{t:_,now:n,onClick:()=>i(_.id)},_.id))})]})]})}function j$({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}: ${He(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 A$({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 I$=YT.createRoot(document.getElementById("root"));I$.render(v.jsx(k$,{}));