@johnz4021/illuminate 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,70 +0,0 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var MC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oh={exports:{}},Rs={},ih={exports:{}},re={};/**
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 Go=Symbol.for("react.element"),_y=Symbol.for("react.portal"),Ny=Symbol.for("react.fragment"),Cy=Symbol.for("react.strict_mode"),My=Symbol.for("react.profiler"),jy=Symbol.for("react.provider"),Py=Symbol.for("react.context"),$y=Symbol.for("react.forward_ref"),Iy=Symbol.for("react.suspense"),Ty=Symbol.for("react.memo"),zy=Symbol.for("react.lazy"),jc=Symbol.iterator;function Ly(e){return e===null||typeof e!="object"?null:(e=jc&&e[jc]||e["@@iterator"],typeof e=="function"?e:null)}var sh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},lh=Object.assign,ah={};function Br(e,t,n){this.props=e,this.context=t,this.refs=ah,this.updater=n||sh}Br.prototype.isReactComponent={};Br.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};Br.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function uh(){}uh.prototype=Br.prototype;function lu(e,t,n){this.props=e,this.context=t,this.refs=ah,this.updater=n||sh}var au=lu.prototype=new uh;au.constructor=lu;lh(au,Br.prototype);au.isPureReactComponent=!0;var Pc=Array.isArray,ch=Object.prototype.hasOwnProperty,uu={current:null},fh={key:!0,ref:!0,__self:!0,__source:!0};function dh(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)ch.call(t,r)&&!fh.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var a=Array(l),u=0;u<l;u++)a[u]=arguments[u+2];o.children=a}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:Go,type:e,key:i,ref:s,props:o,_owner:uu.current}}function by(e,t){return{$$typeof:Go,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function cu(e){return typeof e=="object"&&e!==null&&e.$$typeof===Go}function Ay(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var $c=/\/+/g;function gl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Ay(""+e.key):t.toString(36)}function Ri(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Go:case _y:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+gl(s,0):r,Pc(o)?(n="",e!=null&&(n=e.replace($c,"$&/")+"/"),Ri(o,t,n,"",function(u){return u})):o!=null&&(cu(o)&&(o=by(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace($c,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",Pc(e))for(var l=0;l<e.length;l++){i=e[l];var a=r+gl(i,l);s+=Ri(i,t,n,a,o)}else if(a=Ly(e),typeof a=="function")for(e=a.call(e),l=0;!(i=e.next()).done;)i=i.value,a=r+gl(i,l++),s+=Ri(i,t,n,a,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function ci(e,t,n){if(e==null)return e;var r=[],o=0;return Ri(e,r,"","",function(i){return t.call(n,i,o++)}),r}function Ry(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var be={current:null},Di={transition:null},Dy={ReactCurrentDispatcher:be,ReactCurrentBatchConfig:Di,ReactCurrentOwner:uu};function hh(){throw Error("act(...) is not supported in production builds of React.")}re.Children={map:ci,forEach:function(e,t,n){ci(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ci(e,function(){t++}),t},toArray:function(e){return ci(e,function(t){return t})||[]},only:function(e){if(!cu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};re.Component=Br;re.Fragment=Ny;re.Profiler=My;re.PureComponent=lu;re.StrictMode=Cy;re.Suspense=Iy;re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Dy;re.act=hh;re.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=lh({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=uu.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)ch.call(t,a)&&!fh.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&l!==void 0?l[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){l=Array(a);for(var u=0;u<a;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:Go,type:e.type,key:o,ref:i,props:r,_owner:s}};re.createContext=function(e){return e={$$typeof:Py,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:jy,_context:e},e.Consumer=e};re.createElement=dh;re.createFactory=function(e){var t=dh.bind(null,e);return t.type=e,t};re.createRef=function(){return{current:null}};re.forwardRef=function(e){return{$$typeof:$y,render:e}};re.isValidElement=cu;re.lazy=function(e){return{$$typeof:zy,_payload:{_status:-1,_result:e},_init:Ry}};re.memo=function(e,t){return{$$typeof:Ty,type:e,compare:t===void 0?null:t}};re.startTransition=function(e){var t=Di.transition;Di.transition={};try{e()}finally{Di.transition=t}};re.unstable_act=hh;re.useCallback=function(e,t){return be.current.useCallback(e,t)};re.useContext=function(e){return be.current.useContext(e)};re.useDebugValue=function(){};re.useDeferredValue=function(e){return be.current.useDeferredValue(e)};re.useEffect=function(e,t){return be.current.useEffect(e,t)};re.useId=function(){return be.current.useId()};re.useImperativeHandle=function(e,t,n){return be.current.useImperativeHandle(e,t,n)};re.useInsertionEffect=function(e,t){return be.current.useInsertionEffect(e,t)};re.useLayoutEffect=function(e,t){return be.current.useLayoutEffect(e,t)};re.useMemo=function(e,t){return be.current.useMemo(e,t)};re.useReducer=function(e,t,n){return be.current.useReducer(e,t,n)};re.useRef=function(e){return be.current.useRef(e)};re.useState=function(e){return be.current.useState(e)};re.useSyncExternalStore=function(e,t,n){return be.current.useSyncExternalStore(e,t,n)};re.useTransition=function(){return be.current.useTransition()};re.version="18.3.1";ih.exports=re;var I=ih.exports;const Oy=rh(I);/**
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 Fy=I,Hy=Symbol.for("react.element"),Vy=Symbol.for("react.fragment"),By=Object.prototype.hasOwnProperty,Uy=Fy.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Wy={key:!0,ref:!0,__self:!0,__source:!0};function ph(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)By.call(t,r)&&!Wy.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:Hy,type:e,key:i,ref:s,props:o,_owner:Uy.current}}Rs.Fragment=Vy;Rs.jsx=ph;Rs.jsxs=ph;oh.exports=Rs;var y=oh.exports,mh={exports:{}},Ge={},gh={exports:{}},yh={};/**
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
- */(function(e){function t(P,j){var M=P.length;P.push(j);e:for(;0<M;){var b=M-1>>>1,F=P[b];if(0<o(F,j))P[b]=j,P[M]=F,M=b;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var j=P[0],M=P.pop();if(M!==j){P[0]=M;e:for(var b=0,F=P.length,W=F>>>1;b<W;){var B=2*(b+1)-1,G=P[B],q=B+1,Q=P[q];if(0>o(G,M))q<F&&0>o(Q,G)?(P[b]=Q,P[q]=M,b=q):(P[b]=G,P[B]=M,b=B);else if(q<F&&0>o(Q,M))P[b]=Q,P[q]=M,b=q;else break e}}return j}function o(P,j){var M=P.sortIndex-j.sortIndex;return M!==0?M:P.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var a=[],u=[],c=1,d=null,f=3,g=!1,v=!1,w=!1,k=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function h(P){for(var j=n(u);j!==null;){if(j.callback===null)r(u);else if(j.startTime<=P)r(u),j.sortIndex=j.expirationTime,t(a,j);else break;j=n(u)}}function x(P){if(w=!1,h(P),!v)if(n(a)!==null)v=!0,T(S);else{var j=n(u);j!==null&&A(x,j.startTime-P)}}function S(P,j){v=!1,w&&(w=!1,m(C),C=-1),g=!0;var M=f;try{for(h(j),d=n(a);d!==null&&(!(d.expirationTime>j)||P&&!R());){var b=d.callback;if(typeof b=="function"){d.callback=null,f=d.priorityLevel;var F=b(d.expirationTime<=j);j=e.unstable_now(),typeof F=="function"?d.callback=F:d===n(a)&&r(a),h(j)}else r(a);d=n(a)}if(d!==null)var W=!0;else{var B=n(u);B!==null&&A(x,B.startTime-j),W=!1}return W}finally{d=null,f=M,g=!1}}var _=!1,N=null,C=-1,$=5,D=-1;function R(){return!(e.unstable_now()-D<$)}function L(){if(N!==null){var P=e.unstable_now();D=P;var j=!0;try{j=N(!0,P)}finally{j?O():(_=!1,N=null)}}else _=!1}var O;if(typeof p=="function")O=function(){p(L)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,z=E.port2;E.port1.onmessage=L,O=function(){z.postMessage(null)}}else O=function(){k(L,0)};function T(P){N=P,_||(_=!0,O())}function A(P,j){C=k(function(){P(e.unstable_now())},j)}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(P){P.callback=null},e.unstable_continueExecution=function(){v||g||(v=!0,T(S))},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(P){switch(f){case 1:case 2:case 3:var j=3;break;default:j=f}var M=f;f=j;try{return P()}finally{f=M}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(P,j){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var M=f;f=P;try{return j()}finally{f=M}},e.unstable_scheduleCallback=function(P,j,M){var b=e.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?b+M:b):M=b,P){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=M+F,P={id:c++,callback:j,priorityLevel:P,startTime:M,expirationTime:F,sortIndex:-1},M>b?(P.sortIndex=M,t(u,P),n(a)===null&&P===n(u)&&(w?(m(C),C=-1):w=!0,A(x,M-b))):(P.sortIndex=F,t(a,P),v||g||(v=!0,T(S))),P},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(P){var j=f;return function(){var M=f;f=j;try{return P.apply(this,arguments)}finally{f=M}}}})(yh);gh.exports=yh;var Yy=gh.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 Xy=I,Qe=Yy;function V(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var vh=new Set,So={};function qn(e,t){Cr(e,t),Cr(e+"Capture",t)}function Cr(e,t){for(So[e]=t,e=0;e<t.length;e++)vh.add(t[e])}var Yt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Jl=Object.prototype.hasOwnProperty,Qy=/^[: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]*$/,Ic={},Tc={};function Ky(e){return Jl.call(Tc,e)?!0:Jl.call(Ic,e)?!1:Qy.test(e)?Tc[e]=!0:(Ic[e]=!0,!1)}function Gy(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function qy(e,t,n,r){if(t===null||typeof t>"u"||Gy(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ae(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var je={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){je[e]=new Ae(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];je[t]=new Ae(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){je[e]=new Ae(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){je[e]=new Ae(e,2,!1,e,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(e){je[e]=new Ae(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){je[e]=new Ae(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){je[e]=new Ae(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){je[e]=new Ae(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){je[e]=new Ae(e,5,!1,e.toLowerCase(),null,!1,!1)});var fu=/[\-:]([a-z])/g;function du(e){return e[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(e){var t=e.replace(fu,du);je[t]=new Ae(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(fu,du);je[t]=new Ae(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(fu,du);je[t]=new Ae(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){je[e]=new Ae(e,1,!1,e.toLowerCase(),null,!1,!1)});je.xlinkHref=new Ae("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){je[e]=new Ae(e,1,!1,e.toLowerCase(),null,!0,!0)});function hu(e,t,n,r){var o=je.hasOwnProperty(t)?je[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(qy(t,n,o,r)&&(n=null),r||o===null?Ky(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var qt=Xy.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,fi=Symbol.for("react.element"),ir=Symbol.for("react.portal"),sr=Symbol.for("react.fragment"),pu=Symbol.for("react.strict_mode"),ea=Symbol.for("react.profiler"),xh=Symbol.for("react.provider"),wh=Symbol.for("react.context"),mu=Symbol.for("react.forward_ref"),ta=Symbol.for("react.suspense"),na=Symbol.for("react.suspense_list"),gu=Symbol.for("react.memo"),tn=Symbol.for("react.lazy"),Sh=Symbol.for("react.offscreen"),zc=Symbol.iterator;function Xr(e){return e===null||typeof e!="object"?null:(e=zc&&e[zc]||e["@@iterator"],typeof e=="function"?e:null)}var ge=Object.assign,yl;function ro(e){if(yl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);yl=t&&t[1]||""}return`
34
- `+yl+e}var vl=!1;function xl(e,t){if(!e||vl)return"";vl=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
35
- `),i=r.stack.split(`
36
- `),s=o.length-1,l=i.length-1;1<=s&&0<=l&&o[s]!==i[l];)l--;for(;1<=s&&0<=l;s--,l--)if(o[s]!==i[l]){if(s!==1||l!==1)do if(s--,l--,0>l||o[s]!==i[l]){var a=`
37
- `+o[s].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=s&&0<=l);break}}}finally{vl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ro(e):""}function Zy(e){switch(e.tag){case 5:return ro(e.type);case 16:return ro("Lazy");case 13:return ro("Suspense");case 19:return ro("SuspenseList");case 0:case 2:case 15:return e=xl(e.type,!1),e;case 11:return e=xl(e.type.render,!1),e;case 1:return e=xl(e.type,!0),e;default:return""}}function ra(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case sr:return"Fragment";case ir:return"Portal";case ea:return"Profiler";case pu:return"StrictMode";case ta:return"Suspense";case na:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case wh:return(e.displayName||"Context")+".Consumer";case xh:return(e._context.displayName||"Context")+".Provider";case mu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case gu:return t=e.displayName||null,t!==null?t:ra(e.type)||"Memo";case tn:t=e._payload,e=e._init;try{return ra(e(t))}catch{}}return null}function Jy(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ra(t);case 8:return t===pu?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function xn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function kh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ev(e){var t=kh(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function di(e){e._valueTracker||(e._valueTracker=ev(e))}function Eh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=kh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ns(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function oa(e,t){var n=t.checked;return ge({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Lc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=xn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function _h(e,t){t=t.checked,t!=null&&hu(e,"checked",t,!1)}function ia(e,t){_h(e,t);var n=xn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?sa(e,t.type,n):t.hasOwnProperty("defaultValue")&&sa(e,t.type,xn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function bc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function sa(e,t,n){(t!=="number"||ns(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var oo=Array.isArray;function vr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+xn(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function la(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(V(91));return ge({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ac(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(V(92));if(oo(n)){if(1<n.length)throw Error(V(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:xn(n)}}function Nh(e,t){var n=xn(t.value),r=xn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Rc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ch(e){switch(e){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 aa(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ch(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var hi,Mh=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(hi=hi||document.createElement("div"),hi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=hi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ko(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var uo={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},tv=["Webkit","ms","Moz","O"];Object.keys(uo).forEach(function(e){tv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),uo[t]=uo[e]})});function jh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||uo.hasOwnProperty(e)&&uo[e]?(""+t).trim():t+"px"}function Ph(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=jh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var nv=ge({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 ua(e,t){if(t){if(nv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(V(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(V(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(V(61))}if(t.style!=null&&typeof t.style!="object")throw Error(V(62))}}function ca(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var fa=null;function yu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var da=null,xr=null,wr=null;function Dc(e){if(e=Jo(e)){if(typeof da!="function")throw Error(V(280));var t=e.stateNode;t&&(t=Vs(t),da(e.stateNode,e.type,t))}}function $h(e){xr?wr?wr.push(e):wr=[e]:xr=e}function Ih(){if(xr){var e=xr,t=wr;if(wr=xr=null,Dc(e),t)for(e=0;e<t.length;e++)Dc(t[e])}}function Th(e,t){return e(t)}function zh(){}var wl=!1;function Lh(e,t,n){if(wl)return e(t,n);wl=!0;try{return Th(e,t,n)}finally{wl=!1,(xr!==null||wr!==null)&&(zh(),Ih())}}function Eo(e,t){var n=e.stateNode;if(n===null)return null;var r=Vs(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(V(231,t,typeof n));return n}var ha=!1;if(Yt)try{var Qr={};Object.defineProperty(Qr,"passive",{get:function(){ha=!0}}),window.addEventListener("test",Qr,Qr),window.removeEventListener("test",Qr,Qr)}catch{ha=!1}function rv(e,t,n,r,o,i,s,l,a){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var co=!1,rs=null,os=!1,pa=null,ov={onError:function(e){co=!0,rs=e}};function iv(e,t,n,r,o,i,s,l,a){co=!1,rs=null,rv.apply(ov,arguments)}function sv(e,t,n,r,o,i,s,l,a){if(iv.apply(this,arguments),co){if(co){var u=rs;co=!1,rs=null}else throw Error(V(198));os||(os=!0,pa=u)}}function Zn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function bh(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Oc(e){if(Zn(e)!==e)throw Error(V(188))}function lv(e){var t=e.alternate;if(!t){if(t=Zn(e),t===null)throw Error(V(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return Oc(o),e;if(i===r)return Oc(o),t;i=i.sibling}throw Error(V(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s){for(l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s)throw Error(V(189))}}if(n.alternate!==r)throw Error(V(190))}if(n.tag!==3)throw Error(V(188));return n.stateNode.current===n?e:t}function Ah(e){return e=lv(e),e!==null?Rh(e):null}function Rh(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Rh(e);if(t!==null)return t;e=e.sibling}return null}var Dh=Qe.unstable_scheduleCallback,Fc=Qe.unstable_cancelCallback,av=Qe.unstable_shouldYield,uv=Qe.unstable_requestPaint,xe=Qe.unstable_now,cv=Qe.unstable_getCurrentPriorityLevel,vu=Qe.unstable_ImmediatePriority,Oh=Qe.unstable_UserBlockingPriority,is=Qe.unstable_NormalPriority,fv=Qe.unstable_LowPriority,Fh=Qe.unstable_IdlePriority,Ds=null,$t=null;function dv(e){if($t&&typeof $t.onCommitFiberRoot=="function")try{$t.onCommitFiberRoot(Ds,e,void 0,(e.current.flags&128)===128)}catch{}}var yt=Math.clz32?Math.clz32:mv,hv=Math.log,pv=Math.LN2;function mv(e){return e>>>=0,e===0?32:31-(hv(e)/pv|0)|0}var pi=64,mi=4194304;function io(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ss(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~o;l!==0?r=io(l):(i&=s,i!==0&&(r=io(i)))}else s=n&~o,s!==0?r=io(s):i!==0&&(r=io(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-yt(t),o=1<<n,r|=e[n],t&=~o;return r}function gv(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 yv(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-yt(i),l=1<<s,a=o[s];a===-1?(!(l&n)||l&r)&&(o[s]=gv(l,t)):a<=t&&(e.expiredLanes|=l),i&=~l}}function ma(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Hh(){var e=pi;return pi<<=1,!(pi&4194240)&&(pi=64),e}function Sl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function qo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-yt(t),e[t]=n}function vv(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-yt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function xu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-yt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var le=0;function Vh(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Bh,wu,Uh,Wh,Yh,ga=!1,gi=[],fn=null,dn=null,hn=null,_o=new Map,No=new Map,on=[],xv="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 Hc(e,t){switch(e){case"focusin":case"focusout":fn=null;break;case"dragenter":case"dragleave":dn=null;break;case"mouseover":case"mouseout":hn=null;break;case"pointerover":case"pointerout":_o.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":No.delete(t.pointerId)}}function Kr(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=Jo(t),t!==null&&wu(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function wv(e,t,n,r,o){switch(t){case"focusin":return fn=Kr(fn,e,t,n,r,o),!0;case"dragenter":return dn=Kr(dn,e,t,n,r,o),!0;case"mouseover":return hn=Kr(hn,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return _o.set(i,Kr(_o.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,No.set(i,Kr(No.get(i)||null,e,t,n,r,o)),!0}return!1}function Xh(e){var t=$n(e.target);if(t!==null){var n=Zn(t);if(n!==null){if(t=n.tag,t===13){if(t=bh(n),t!==null){e.blockedOn=t,Yh(e.priority,function(){Uh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Oi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ya(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);fa=r,n.target.dispatchEvent(r),fa=null}else return t=Jo(n),t!==null&&wu(t),e.blockedOn=n,!1;t.shift()}return!0}function Vc(e,t,n){Oi(e)&&n.delete(t)}function Sv(){ga=!1,fn!==null&&Oi(fn)&&(fn=null),dn!==null&&Oi(dn)&&(dn=null),hn!==null&&Oi(hn)&&(hn=null),_o.forEach(Vc),No.forEach(Vc)}function Gr(e,t){e.blockedOn===t&&(e.blockedOn=null,ga||(ga=!0,Qe.unstable_scheduleCallback(Qe.unstable_NormalPriority,Sv)))}function Co(e){function t(o){return Gr(o,e)}if(0<gi.length){Gr(gi[0],e);for(var n=1;n<gi.length;n++){var r=gi[n];r.blockedOn===e&&(r.blockedOn=null)}}for(fn!==null&&Gr(fn,e),dn!==null&&Gr(dn,e),hn!==null&&Gr(hn,e),_o.forEach(t),No.forEach(t),n=0;n<on.length;n++)r=on[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<on.length&&(n=on[0],n.blockedOn===null);)Xh(n),n.blockedOn===null&&on.shift()}var Sr=qt.ReactCurrentBatchConfig,ls=!0;function kv(e,t,n,r){var o=le,i=Sr.transition;Sr.transition=null;try{le=1,Su(e,t,n,r)}finally{le=o,Sr.transition=i}}function Ev(e,t,n,r){var o=le,i=Sr.transition;Sr.transition=null;try{le=4,Su(e,t,n,r)}finally{le=o,Sr.transition=i}}function Su(e,t,n,r){if(ls){var o=ya(e,t,n,r);if(o===null)Il(e,t,r,as,n),Hc(e,r);else if(wv(o,e,t,n,r))r.stopPropagation();else if(Hc(e,r),t&4&&-1<xv.indexOf(e)){for(;o!==null;){var i=Jo(o);if(i!==null&&Bh(i),i=ya(e,t,n,r),i===null&&Il(e,t,r,as,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Il(e,t,r,null,n)}}var as=null;function ya(e,t,n,r){if(as=null,e=yu(r),e=$n(e),e!==null)if(t=Zn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=bh(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return as=e,null}function Qh(e){switch(e){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(cv()){case vu:return 1;case Oh:return 4;case is:case fv:return 16;case Fh:return 536870912;default:return 16}default:return 16}}var an=null,ku=null,Fi=null;function Kh(){if(Fi)return Fi;var e,t=ku,n=t.length,r,o="value"in an?an.value:an.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Fi=o.slice(e,1<r?1-r:void 0)}function Hi(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function yi(){return!0}function Bc(){return!1}function qe(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?yi:Bc,this.isPropagationStopped=Bc,this}return ge(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=yi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=yi)},persist:function(){},isPersistent:yi}),t}var Ur={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Eu=qe(Ur),Zo=ge({},Ur,{view:0,detail:0}),_v=qe(Zo),kl,El,qr,Os=ge({},Zo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_u,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==qr&&(qr&&e.type==="mousemove"?(kl=e.screenX-qr.screenX,El=e.screenY-qr.screenY):El=kl=0,qr=e),kl)},movementY:function(e){return"movementY"in e?e.movementY:El}}),Uc=qe(Os),Nv=ge({},Os,{dataTransfer:0}),Cv=qe(Nv),Mv=ge({},Zo,{relatedTarget:0}),_l=qe(Mv),jv=ge({},Ur,{animationName:0,elapsedTime:0,pseudoElement:0}),Pv=qe(jv),$v=ge({},Ur,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Iv=qe($v),Tv=ge({},Ur,{data:0}),Wc=qe(Tv),zv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Lv={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"},bv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Av(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=bv[e])?!!t[e]:!1}function _u(){return Av}var Rv=ge({},Zo,{key:function(e){if(e.key){var t=zv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Hi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Lv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_u,charCode:function(e){return e.type==="keypress"?Hi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Hi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Dv=qe(Rv),Ov=ge({},Os,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yc=qe(Ov),Fv=ge({},Zo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_u}),Hv=qe(Fv),Vv=ge({},Ur,{propertyName:0,elapsedTime:0,pseudoElement:0}),Bv=qe(Vv),Uv=ge({},Os,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Wv=qe(Uv),Yv=[9,13,27,32],Nu=Yt&&"CompositionEvent"in window,fo=null;Yt&&"documentMode"in document&&(fo=document.documentMode);var Xv=Yt&&"TextEvent"in window&&!fo,Gh=Yt&&(!Nu||fo&&8<fo&&11>=fo),Xc=" ",Qc=!1;function qh(e,t){switch(e){case"keyup":return Yv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var lr=!1;function Qv(e,t){switch(e){case"compositionend":return Zh(t);case"keypress":return t.which!==32?null:(Qc=!0,Xc);case"textInput":return e=t.data,e===Xc&&Qc?null:e;default:return null}}function Kv(e,t){if(lr)return e==="compositionend"||!Nu&&qh(e,t)?(e=Kh(),Fi=ku=an=null,lr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Gh&&t.locale!=="ko"?null:t.data;default:return null}}var Gv={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 Kc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Gv[e.type]:t==="textarea"}function Jh(e,t,n,r){$h(r),t=us(t,"onChange"),0<t.length&&(n=new Eu("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ho=null,Mo=null;function qv(e){cp(e,0)}function Fs(e){var t=cr(e);if(Eh(t))return e}function Zv(e,t){if(e==="change")return t}var ep=!1;if(Yt){var Nl;if(Yt){var Cl="oninput"in document;if(!Cl){var Gc=document.createElement("div");Gc.setAttribute("oninput","return;"),Cl=typeof Gc.oninput=="function"}Nl=Cl}else Nl=!1;ep=Nl&&(!document.documentMode||9<document.documentMode)}function qc(){ho&&(ho.detachEvent("onpropertychange",tp),Mo=ho=null)}function tp(e){if(e.propertyName==="value"&&Fs(Mo)){var t=[];Jh(t,Mo,e,yu(e)),Lh(qv,t)}}function Jv(e,t,n){e==="focusin"?(qc(),ho=t,Mo=n,ho.attachEvent("onpropertychange",tp)):e==="focusout"&&qc()}function ex(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Fs(Mo)}function tx(e,t){if(e==="click")return Fs(t)}function nx(e,t){if(e==="input"||e==="change")return Fs(t)}function rx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xt=typeof Object.is=="function"?Object.is:rx;function jo(e,t){if(xt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Jl.call(t,o)||!xt(e[o],t[o]))return!1}return!0}function Zc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jc(e,t){var n=Zc(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Zc(n)}}function np(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?np(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function rp(){for(var e=window,t=ns();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ns(e.document)}return t}function Cu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function ox(e){var t=rp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&np(n.ownerDocument.documentElement,n)){if(r!==null&&Cu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Jc(n,i);var s=Jc(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ix=Yt&&"documentMode"in document&&11>=document.documentMode,ar=null,va=null,po=null,xa=!1;function ef(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;xa||ar==null||ar!==ns(r)||(r=ar,"selectionStart"in r&&Cu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),po&&jo(po,r)||(po=r,r=us(va,"onSelect"),0<r.length&&(t=new Eu("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ar)))}function vi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ur={animationend:vi("Animation","AnimationEnd"),animationiteration:vi("Animation","AnimationIteration"),animationstart:vi("Animation","AnimationStart"),transitionend:vi("Transition","TransitionEnd")},Ml={},op={};Yt&&(op=document.createElement("div").style,"AnimationEvent"in window||(delete ur.animationend.animation,delete ur.animationiteration.animation,delete ur.animationstart.animation),"TransitionEvent"in window||delete ur.transitionend.transition);function Hs(e){if(Ml[e])return Ml[e];if(!ur[e])return e;var t=ur[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in op)return Ml[e]=t[n];return e}var ip=Hs("animationend"),sp=Hs("animationiteration"),lp=Hs("animationstart"),ap=Hs("transitionend"),up=new Map,tf="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 Sn(e,t){up.set(e,t),qn(t,[e])}for(var jl=0;jl<tf.length;jl++){var Pl=tf[jl],sx=Pl.toLowerCase(),lx=Pl[0].toUpperCase()+Pl.slice(1);Sn(sx,"on"+lx)}Sn(ip,"onAnimationEnd");Sn(sp,"onAnimationIteration");Sn(lp,"onAnimationStart");Sn("dblclick","onDoubleClick");Sn("focusin","onFocus");Sn("focusout","onBlur");Sn(ap,"onTransitionEnd");Cr("onMouseEnter",["mouseout","mouseover"]);Cr("onMouseLeave",["mouseout","mouseover"]);Cr("onPointerEnter",["pointerout","pointerover"]);Cr("onPointerLeave",["pointerout","pointerover"]);qn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));qn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));qn("onBeforeInput",["compositionend","keypress","textInput","paste"]);qn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));qn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));qn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var so="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(" "),ax=new Set("cancel close invalid load scroll toggle".split(" ").concat(so));function nf(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,sv(r,t,void 0,e),e.currentTarget=null}function cp(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],a=l.instance,u=l.currentTarget;if(l=l.listener,a!==i&&o.isPropagationStopped())break e;nf(o,l,u),i=a}else for(s=0;s<r.length;s++){if(l=r[s],a=l.instance,u=l.currentTarget,l=l.listener,a!==i&&o.isPropagationStopped())break e;nf(o,l,u),i=a}}}if(os)throw e=pa,os=!1,pa=null,e}function ce(e,t){var n=t[_a];n===void 0&&(n=t[_a]=new Set);var r=e+"__bubble";n.has(r)||(fp(t,e,2,!1),n.add(r))}function $l(e,t,n){var r=0;t&&(r|=4),fp(n,e,r,t)}var xi="_reactListening"+Math.random().toString(36).slice(2);function Po(e){if(!e[xi]){e[xi]=!0,vh.forEach(function(n){n!=="selectionchange"&&(ax.has(n)||$l(n,!1,e),$l(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xi]||(t[xi]=!0,$l("selectionchange",!1,t))}}function fp(e,t,n,r){switch(Qh(t)){case 1:var o=kv;break;case 4:o=Ev;break;default:o=Su}n=o.bind(null,t,n,e),o=void 0,!ha||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Il(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var a=s.tag;if((a===3||a===4)&&(a=s.stateNode.containerInfo,a===o||a.nodeType===8&&a.parentNode===o))return;s=s.return}for(;l!==null;){if(s=$n(l),s===null)return;if(a=s.tag,a===5||a===6){r=i=s;continue e}l=l.parentNode}}r=r.return}Lh(function(){var u=i,c=yu(n),d=[];e:{var f=up.get(e);if(f!==void 0){var g=Eu,v=e;switch(e){case"keypress":if(Hi(n)===0)break e;case"keydown":case"keyup":g=Dv;break;case"focusin":v="focus",g=_l;break;case"focusout":v="blur",g=_l;break;case"beforeblur":case"afterblur":g=_l;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=Uc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=Cv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=Hv;break;case ip:case sp:case lp:g=Pv;break;case ap:g=Bv;break;case"scroll":g=_v;break;case"wheel":g=Wv;break;case"copy":case"cut":case"paste":g=Iv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=Yc}var w=(t&4)!==0,k=!w&&e==="scroll",m=w?f!==null?f+"Capture":null:f;w=[];for(var p=u,h;p!==null;){h=p;var x=h.stateNode;if(h.tag===5&&x!==null&&(h=x,m!==null&&(x=Eo(p,m),x!=null&&w.push($o(p,x,h)))),k)break;p=p.return}0<w.length&&(f=new g(f,v,null,n,c),d.push({event:f,listeners:w}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",f&&n!==fa&&(v=n.relatedTarget||n.fromElement)&&($n(v)||v[Xt]))break e;if((g||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,g?(v=n.relatedTarget||n.toElement,g=u,v=v?$n(v):null,v!==null&&(k=Zn(v),v!==k||v.tag!==5&&v.tag!==6)&&(v=null)):(g=null,v=u),g!==v)){if(w=Uc,x="onMouseLeave",m="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(w=Yc,x="onPointerLeave",m="onPointerEnter",p="pointer"),k=g==null?f:cr(g),h=v==null?f:cr(v),f=new w(x,p+"leave",g,n,c),f.target=k,f.relatedTarget=h,x=null,$n(c)===u&&(w=new w(m,p+"enter",v,n,c),w.target=h,w.relatedTarget=k,x=w),k=x,g&&v)t:{for(w=g,m=v,p=0,h=w;h;h=Jn(h))p++;for(h=0,x=m;x;x=Jn(x))h++;for(;0<p-h;)w=Jn(w),p--;for(;0<h-p;)m=Jn(m),h--;for(;p--;){if(w===m||m!==null&&w===m.alternate)break t;w=Jn(w),m=Jn(m)}w=null}else w=null;g!==null&&rf(d,f,g,w,!1),v!==null&&k!==null&&rf(d,k,v,w,!0)}}e:{if(f=u?cr(u):window,g=f.nodeName&&f.nodeName.toLowerCase(),g==="select"||g==="input"&&f.type==="file")var S=Zv;else if(Kc(f))if(ep)S=nx;else{S=ex;var _=Jv}else(g=f.nodeName)&&g.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(S=tx);if(S&&(S=S(e,u))){Jh(d,S,n,c);break e}_&&_(e,f,u),e==="focusout"&&(_=f._wrapperState)&&_.controlled&&f.type==="number"&&sa(f,"number",f.value)}switch(_=u?cr(u):window,e){case"focusin":(Kc(_)||_.contentEditable==="true")&&(ar=_,va=u,po=null);break;case"focusout":po=va=ar=null;break;case"mousedown":xa=!0;break;case"contextmenu":case"mouseup":case"dragend":xa=!1,ef(d,n,c);break;case"selectionchange":if(ix)break;case"keydown":case"keyup":ef(d,n,c)}var N;if(Nu)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else lr?qh(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(Gh&&n.locale!=="ko"&&(lr||C!=="onCompositionStart"?C==="onCompositionEnd"&&lr&&(N=Kh()):(an=c,ku="value"in an?an.value:an.textContent,lr=!0)),_=us(u,C),0<_.length&&(C=new Wc(C,e,null,n,c),d.push({event:C,listeners:_}),N?C.data=N:(N=Zh(n),N!==null&&(C.data=N)))),(N=Xv?Qv(e,n):Kv(e,n))&&(u=us(u,"onBeforeInput"),0<u.length&&(c=new Wc("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=N))}cp(d,t)})}function $o(e,t,n){return{instance:e,listener:t,currentTarget:n}}function us(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Eo(e,n),i!=null&&r.unshift($o(e,i,o)),i=Eo(e,t),i!=null&&r.push($o(e,i,o))),e=e.return}return r}function Jn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function rf(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var l=n,a=l.alternate,u=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&u!==null&&(l=u,o?(a=Eo(n,i),a!=null&&s.unshift($o(n,a,l))):o||(a=Eo(n,i),a!=null&&s.push($o(n,a,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var ux=/\r\n?/g,cx=/\u0000|\uFFFD/g;function of(e){return(typeof e=="string"?e:""+e).replace(ux,`
38
- `).replace(cx,"")}function wi(e,t,n){if(t=of(t),of(e)!==t&&n)throw Error(V(425))}function cs(){}var wa=null,Sa=null;function ka(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ea=typeof setTimeout=="function"?setTimeout:void 0,fx=typeof clearTimeout=="function"?clearTimeout:void 0,sf=typeof Promise=="function"?Promise:void 0,dx=typeof queueMicrotask=="function"?queueMicrotask:typeof sf<"u"?function(e){return sf.resolve(null).then(e).catch(hx)}:Ea;function hx(e){setTimeout(function(){throw e})}function Tl(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Co(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Co(t)}function pn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function lf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Wr=Math.random().toString(36).slice(2),jt="__reactFiber$"+Wr,Io="__reactProps$"+Wr,Xt="__reactContainer$"+Wr,_a="__reactEvents$"+Wr,px="__reactListeners$"+Wr,mx="__reactHandles$"+Wr;function $n(e){var t=e[jt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Xt]||n[jt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=lf(e);e!==null;){if(n=e[jt])return n;e=lf(e)}return t}e=n,n=e.parentNode}return null}function Jo(e){return e=e[jt]||e[Xt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function cr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(V(33))}function Vs(e){return e[Io]||null}var Na=[],fr=-1;function kn(e){return{current:e}}function fe(e){0>fr||(e.current=Na[fr],Na[fr]=null,fr--)}function ue(e,t){fr++,Na[fr]=e.current,e.current=t}var wn={},Te=kn(wn),He=kn(!1),Hn=wn;function Mr(e,t){var n=e.type.contextTypes;if(!n)return wn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ve(e){return e=e.childContextTypes,e!=null}function fs(){fe(He),fe(Te)}function af(e,t,n){if(Te.current!==wn)throw Error(V(168));ue(Te,t),ue(He,n)}function dp(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(V(108,Jy(e)||"Unknown",o));return ge({},n,r)}function ds(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||wn,Hn=Te.current,ue(Te,e),ue(He,He.current),!0}function uf(e,t,n){var r=e.stateNode;if(!r)throw Error(V(169));n?(e=dp(e,t,Hn),r.__reactInternalMemoizedMergedChildContext=e,fe(He),fe(Te),ue(Te,e)):fe(He),ue(He,n)}var Ft=null,Bs=!1,zl=!1;function hp(e){Ft===null?Ft=[e]:Ft.push(e)}function gx(e){Bs=!0,hp(e)}function En(){if(!zl&&Ft!==null){zl=!0;var e=0,t=le;try{var n=Ft;for(le=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ft=null,Bs=!1}catch(o){throw Ft!==null&&(Ft=Ft.slice(e+1)),Dh(vu,En),o}finally{le=t,zl=!1}}return null}var dr=[],hr=0,hs=null,ps=0,Je=[],et=0,Vn=null,Ht=1,Vt="";function Mn(e,t){dr[hr++]=ps,dr[hr++]=hs,hs=e,ps=t}function pp(e,t,n){Je[et++]=Ht,Je[et++]=Vt,Je[et++]=Vn,Vn=e;var r=Ht;e=Vt;var o=32-yt(r)-1;r&=~(1<<o),n+=1;var i=32-yt(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,Ht=1<<32-yt(t)+o|n<<o|r,Vt=i+e}else Ht=1<<i|n<<o|r,Vt=e}function Mu(e){e.return!==null&&(Mn(e,1),pp(e,1,0))}function ju(e){for(;e===hs;)hs=dr[--hr],dr[hr]=null,ps=dr[--hr],dr[hr]=null;for(;e===Vn;)Vn=Je[--et],Je[et]=null,Vt=Je[--et],Je[et]=null,Ht=Je[--et],Je[et]=null}var Xe=null,Ye=null,he=!1,ht=null;function mp(e,t){var n=tt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function cf(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Xe=e,Ye=pn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Xe=e,Ye=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Vn!==null?{id:Ht,overflow:Vt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=tt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Xe=e,Ye=null,!0):!1;default:return!1}}function Ca(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ma(e){if(he){var t=Ye;if(t){var n=t;if(!cf(e,t)){if(Ca(e))throw Error(V(418));t=pn(n.nextSibling);var r=Xe;t&&cf(e,t)?mp(r,n):(e.flags=e.flags&-4097|2,he=!1,Xe=e)}}else{if(Ca(e))throw Error(V(418));e.flags=e.flags&-4097|2,he=!1,Xe=e}}}function ff(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Xe=e}function Si(e){if(e!==Xe)return!1;if(!he)return ff(e),he=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ka(e.type,e.memoizedProps)),t&&(t=Ye)){if(Ca(e))throw gp(),Error(V(418));for(;t;)mp(e,t),t=pn(t.nextSibling)}if(ff(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(V(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ye=pn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ye=null}}else Ye=Xe?pn(e.stateNode.nextSibling):null;return!0}function gp(){for(var e=Ye;e;)e=pn(e.nextSibling)}function jr(){Ye=Xe=null,he=!1}function Pu(e){ht===null?ht=[e]:ht.push(e)}var yx=qt.ReactCurrentBatchConfig;function Zr(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(V(309));var r=n.stateNode}if(!r)throw Error(V(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var l=o.refs;s===null?delete l[i]:l[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(V(284));if(!n._owner)throw Error(V(290,e))}return e}function ki(e,t){throw e=Object.prototype.toString.call(t),Error(V(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function df(e){var t=e._init;return t(e._payload)}function yp(e){function t(m,p){if(e){var h=m.deletions;h===null?(m.deletions=[p],m.flags|=16):h.push(p)}}function n(m,p){if(!e)return null;for(;p!==null;)t(m,p),p=p.sibling;return null}function r(m,p){for(m=new Map;p!==null;)p.key!==null?m.set(p.key,p):m.set(p.index,p),p=p.sibling;return m}function o(m,p){return m=vn(m,p),m.index=0,m.sibling=null,m}function i(m,p,h){return m.index=h,e?(h=m.alternate,h!==null?(h=h.index,h<p?(m.flags|=2,p):h):(m.flags|=2,p)):(m.flags|=1048576,p)}function s(m){return e&&m.alternate===null&&(m.flags|=2),m}function l(m,p,h,x){return p===null||p.tag!==6?(p=Fl(h,m.mode,x),p.return=m,p):(p=o(p,h),p.return=m,p)}function a(m,p,h,x){var S=h.type;return S===sr?c(m,p,h.props.children,x,h.key):p!==null&&(p.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===tn&&df(S)===p.type)?(x=o(p,h.props),x.ref=Zr(m,p,h),x.return=m,x):(x=Qi(h.type,h.key,h.props,null,m.mode,x),x.ref=Zr(m,p,h),x.return=m,x)}function u(m,p,h,x){return p===null||p.tag!==4||p.stateNode.containerInfo!==h.containerInfo||p.stateNode.implementation!==h.implementation?(p=Hl(h,m.mode,x),p.return=m,p):(p=o(p,h.children||[]),p.return=m,p)}function c(m,p,h,x,S){return p===null||p.tag!==7?(p=Rn(h,m.mode,x,S),p.return=m,p):(p=o(p,h),p.return=m,p)}function d(m,p,h){if(typeof p=="string"&&p!==""||typeof p=="number")return p=Fl(""+p,m.mode,h),p.return=m,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case fi:return h=Qi(p.type,p.key,p.props,null,m.mode,h),h.ref=Zr(m,null,p),h.return=m,h;case ir:return p=Hl(p,m.mode,h),p.return=m,p;case tn:var x=p._init;return d(m,x(p._payload),h)}if(oo(p)||Xr(p))return p=Rn(p,m.mode,h,null),p.return=m,p;ki(m,p)}return null}function f(m,p,h,x){var S=p!==null?p.key:null;if(typeof h=="string"&&h!==""||typeof h=="number")return S!==null?null:l(m,p,""+h,x);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case fi:return h.key===S?a(m,p,h,x):null;case ir:return h.key===S?u(m,p,h,x):null;case tn:return S=h._init,f(m,p,S(h._payload),x)}if(oo(h)||Xr(h))return S!==null?null:c(m,p,h,x,null);ki(m,h)}return null}function g(m,p,h,x,S){if(typeof x=="string"&&x!==""||typeof x=="number")return m=m.get(h)||null,l(p,m,""+x,S);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case fi:return m=m.get(x.key===null?h:x.key)||null,a(p,m,x,S);case ir:return m=m.get(x.key===null?h:x.key)||null,u(p,m,x,S);case tn:var _=x._init;return g(m,p,h,_(x._payload),S)}if(oo(x)||Xr(x))return m=m.get(h)||null,c(p,m,x,S,null);ki(p,x)}return null}function v(m,p,h,x){for(var S=null,_=null,N=p,C=p=0,$=null;N!==null&&C<h.length;C++){N.index>C?($=N,N=null):$=N.sibling;var D=f(m,N,h[C],x);if(D===null){N===null&&(N=$);break}e&&N&&D.alternate===null&&t(m,N),p=i(D,p,C),_===null?S=D:_.sibling=D,_=D,N=$}if(C===h.length)return n(m,N),he&&Mn(m,C),S;if(N===null){for(;C<h.length;C++)N=d(m,h[C],x),N!==null&&(p=i(N,p,C),_===null?S=N:_.sibling=N,_=N);return he&&Mn(m,C),S}for(N=r(m,N);C<h.length;C++)$=g(N,m,C,h[C],x),$!==null&&(e&&$.alternate!==null&&N.delete($.key===null?C:$.key),p=i($,p,C),_===null?S=$:_.sibling=$,_=$);return e&&N.forEach(function(R){return t(m,R)}),he&&Mn(m,C),S}function w(m,p,h,x){var S=Xr(h);if(typeof S!="function")throw Error(V(150));if(h=S.call(h),h==null)throw Error(V(151));for(var _=S=null,N=p,C=p=0,$=null,D=h.next();N!==null&&!D.done;C++,D=h.next()){N.index>C?($=N,N=null):$=N.sibling;var R=f(m,N,D.value,x);if(R===null){N===null&&(N=$);break}e&&N&&R.alternate===null&&t(m,N),p=i(R,p,C),_===null?S=R:_.sibling=R,_=R,N=$}if(D.done)return n(m,N),he&&Mn(m,C),S;if(N===null){for(;!D.done;C++,D=h.next())D=d(m,D.value,x),D!==null&&(p=i(D,p,C),_===null?S=D:_.sibling=D,_=D);return he&&Mn(m,C),S}for(N=r(m,N);!D.done;C++,D=h.next())D=g(N,m,C,D.value,x),D!==null&&(e&&D.alternate!==null&&N.delete(D.key===null?C:D.key),p=i(D,p,C),_===null?S=D:_.sibling=D,_=D);return e&&N.forEach(function(L){return t(m,L)}),he&&Mn(m,C),S}function k(m,p,h,x){if(typeof h=="object"&&h!==null&&h.type===sr&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case fi:e:{for(var S=h.key,_=p;_!==null;){if(_.key===S){if(S=h.type,S===sr){if(_.tag===7){n(m,_.sibling),p=o(_,h.props.children),p.return=m,m=p;break e}}else if(_.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===tn&&df(S)===_.type){n(m,_.sibling),p=o(_,h.props),p.ref=Zr(m,_,h),p.return=m,m=p;break e}n(m,_);break}else t(m,_);_=_.sibling}h.type===sr?(p=Rn(h.props.children,m.mode,x,h.key),p.return=m,m=p):(x=Qi(h.type,h.key,h.props,null,m.mode,x),x.ref=Zr(m,p,h),x.return=m,m=x)}return s(m);case ir:e:{for(_=h.key;p!==null;){if(p.key===_)if(p.tag===4&&p.stateNode.containerInfo===h.containerInfo&&p.stateNode.implementation===h.implementation){n(m,p.sibling),p=o(p,h.children||[]),p.return=m,m=p;break e}else{n(m,p);break}else t(m,p);p=p.sibling}p=Hl(h,m.mode,x),p.return=m,m=p}return s(m);case tn:return _=h._init,k(m,p,_(h._payload),x)}if(oo(h))return v(m,p,h,x);if(Xr(h))return w(m,p,h,x);ki(m,h)}return typeof h=="string"&&h!==""||typeof h=="number"?(h=""+h,p!==null&&p.tag===6?(n(m,p.sibling),p=o(p,h),p.return=m,m=p):(n(m,p),p=Fl(h,m.mode,x),p.return=m,m=p),s(m)):n(m,p)}return k}var Pr=yp(!0),vp=yp(!1),ms=kn(null),gs=null,pr=null,$u=null;function Iu(){$u=pr=gs=null}function Tu(e){var t=ms.current;fe(ms),e._currentValue=t}function ja(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function kr(e,t){gs=e,$u=pr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Oe=!0),e.firstContext=null)}function ot(e){var t=e._currentValue;if($u!==e)if(e={context:e,memoizedValue:t,next:null},pr===null){if(gs===null)throw Error(V(308));pr=e,gs.dependencies={lanes:0,firstContext:e}}else pr=pr.next=e;return t}var In=null;function zu(e){In===null?In=[e]:In.push(e)}function xp(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,zu(t)):(n.next=o.next,o.next=n),t.interleaved=n,Qt(e,r)}function Qt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var nn=!1;function Lu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function wp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ut(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function mn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,se&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Qt(e,n)}return o=r.interleaved,o===null?(t.next=t,zu(r)):(t.next=o.next,o.next=t),r.interleaved=t,Qt(e,n)}function Vi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,xu(e,n)}}function hf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ys(e,t,n,r){var o=e.updateQueue;nn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var a=l,u=a.next;a.next=null,s===null?i=u:s.next=u,s=a;var c=e.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==s&&(l===null?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=a))}if(i!==null){var d=o.baseState;s=0,c=u=a=null,l=i;do{var f=l.lane,g=l.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:g,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,w=l;switch(f=t,g=n,w.tag){case 1:if(v=w.payload,typeof v=="function"){d=v.call(g,d,f);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=w.payload,f=typeof v=="function"?v.call(g,d,f):v,f==null)break e;d=ge({},d,f);break e;case 2:nn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[l]:f.push(l))}else g={eventTime:g,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=g,a=d):c=c.next=g,s|=f;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;f=l,l=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(c===null&&(a=d),o.baseState=a,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Un|=s,e.lanes=s,e.memoizedState=d}}function pf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(V(191,o));o.call(r)}}}var ei={},It=kn(ei),To=kn(ei),zo=kn(ei);function Tn(e){if(e===ei)throw Error(V(174));return e}function bu(e,t){switch(ue(zo,t),ue(To,e),ue(It,ei),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:aa(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=aa(t,e)}fe(It),ue(It,t)}function $r(){fe(It),fe(To),fe(zo)}function Sp(e){Tn(zo.current);var t=Tn(It.current),n=aa(t,e.type);t!==n&&(ue(To,e),ue(It,n))}function Au(e){To.current===e&&(fe(It),fe(To))}var pe=kn(0);function vs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ll=[];function Ru(){for(var e=0;e<Ll.length;e++)Ll[e]._workInProgressVersionPrimary=null;Ll.length=0}var Bi=qt.ReactCurrentDispatcher,bl=qt.ReactCurrentBatchConfig,Bn=0,me=null,ke=null,_e=null,xs=!1,mo=!1,Lo=0,vx=0;function Pe(){throw Error(V(321))}function Du(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!xt(e[n],t[n]))return!1;return!0}function Ou(e,t,n,r,o,i){if(Bn=i,me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Bi.current=e===null||e.memoizedState===null?kx:Ex,e=n(r,o),mo){i=0;do{if(mo=!1,Lo=0,25<=i)throw Error(V(301));i+=1,_e=ke=null,t.updateQueue=null,Bi.current=_x,e=n(r,o)}while(mo)}if(Bi.current=ws,t=ke!==null&&ke.next!==null,Bn=0,_e=ke=me=null,xs=!1,t)throw Error(V(300));return e}function Fu(){var e=Lo!==0;return Lo=0,e}function Ct(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _e===null?me.memoizedState=_e=e:_e=_e.next=e,_e}function it(){if(ke===null){var e=me.alternate;e=e!==null?e.memoizedState:null}else e=ke.next;var t=_e===null?me.memoizedState:_e.next;if(t!==null)_e=t,ke=e;else{if(e===null)throw Error(V(310));ke=e,e={memoizedState:ke.memoizedState,baseState:ke.baseState,baseQueue:ke.baseQueue,queue:ke.queue,next:null},_e===null?me.memoizedState=_e=e:_e=_e.next=e}return _e}function bo(e,t){return typeof t=="function"?t(e):t}function Al(e){var t=it(),n=t.queue;if(n===null)throw Error(V(311));n.lastRenderedReducer=e;var r=ke,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=s=null,a=null,u=i;do{var c=u.lane;if((Bn&c)===c)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(l=a=d,s=r):a=a.next=d,me.lanes|=c,Un|=c}u=u.next}while(u!==null&&u!==i);a===null?s=r:a.next=l,xt(r,t.memoizedState)||(Oe=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,me.lanes|=i,Un|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Rl(e){var t=it(),n=t.queue;if(n===null)throw Error(V(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);xt(i,t.memoizedState)||(Oe=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function kp(){}function Ep(e,t){var n=me,r=it(),o=t(),i=!xt(r.memoizedState,o);if(i&&(r.memoizedState=o,Oe=!0),r=r.queue,Hu(Cp.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||_e!==null&&_e.memoizedState.tag&1){if(n.flags|=2048,Ao(9,Np.bind(null,n,r,o,t),void 0,null),Ne===null)throw Error(V(349));Bn&30||_p(n,t,o)}return o}function _p(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=me.updateQueue,t===null?(t={lastEffect:null,stores:null},me.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Np(e,t,n,r){t.value=n,t.getSnapshot=r,Mp(t)&&jp(e)}function Cp(e,t,n){return n(function(){Mp(t)&&jp(e)})}function Mp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xt(e,n)}catch{return!0}}function jp(e){var t=Qt(e,1);t!==null&&vt(t,e,1,-1)}function mf(e){var t=Ct();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bo,lastRenderedState:e},t.queue=e,e=e.dispatch=Sx.bind(null,me,e),[t.memoizedState,e]}function Ao(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=me.updateQueue,t===null?(t={lastEffect:null,stores:null},me.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Pp(){return it().memoizedState}function Ui(e,t,n,r){var o=Ct();me.flags|=e,o.memoizedState=Ao(1|t,n,void 0,r===void 0?null:r)}function Us(e,t,n,r){var o=it();r=r===void 0?null:r;var i=void 0;if(ke!==null){var s=ke.memoizedState;if(i=s.destroy,r!==null&&Du(r,s.deps)){o.memoizedState=Ao(t,n,i,r);return}}me.flags|=e,o.memoizedState=Ao(1|t,n,i,r)}function gf(e,t){return Ui(8390656,8,e,t)}function Hu(e,t){return Us(2048,8,e,t)}function $p(e,t){return Us(4,2,e,t)}function Ip(e,t){return Us(4,4,e,t)}function Tp(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function zp(e,t,n){return n=n!=null?n.concat([e]):null,Us(4,4,Tp.bind(null,t,e),n)}function Vu(){}function Lp(e,t){var n=it();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Du(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function bp(e,t){var n=it();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Du(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ap(e,t,n){return Bn&21?(xt(n,t)||(n=Hh(),me.lanes|=n,Un|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Oe=!0),e.memoizedState=n)}function xx(e,t){var n=le;le=n!==0&&4>n?n:4,e(!0);var r=bl.transition;bl.transition={};try{e(!1),t()}finally{le=n,bl.transition=r}}function Rp(){return it().memoizedState}function wx(e,t,n){var r=yn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Dp(e))Op(t,n);else if(n=xp(e,t,n,r),n!==null){var o=Le();vt(n,e,r,o),Fp(n,t,r)}}function Sx(e,t,n){var r=yn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Dp(e))Op(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,l=i(s,n);if(o.hasEagerState=!0,o.eagerState=l,xt(l,s)){var a=t.interleaved;a===null?(o.next=o,zu(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=xp(e,t,o,r),n!==null&&(o=Le(),vt(n,e,r,o),Fp(n,t,r))}}function Dp(e){var t=e.alternate;return e===me||t!==null&&t===me}function Op(e,t){mo=xs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fp(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,xu(e,n)}}var ws={readContext:ot,useCallback:Pe,useContext:Pe,useEffect:Pe,useImperativeHandle:Pe,useInsertionEffect:Pe,useLayoutEffect:Pe,useMemo:Pe,useReducer:Pe,useRef:Pe,useState:Pe,useDebugValue:Pe,useDeferredValue:Pe,useTransition:Pe,useMutableSource:Pe,useSyncExternalStore:Pe,useId:Pe,unstable_isNewReconciler:!1},kx={readContext:ot,useCallback:function(e,t){return Ct().memoizedState=[e,t===void 0?null:t],e},useContext:ot,useEffect:gf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ui(4194308,4,Tp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ui(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ui(4,2,e,t)},useMemo:function(e,t){var n=Ct();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ct();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=wx.bind(null,me,e),[r.memoizedState,e]},useRef:function(e){var t=Ct();return e={current:e},t.memoizedState=e},useState:mf,useDebugValue:Vu,useDeferredValue:function(e){return Ct().memoizedState=e},useTransition:function(){var e=mf(!1),t=e[0];return e=xx.bind(null,e[1]),Ct().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=me,o=Ct();if(he){if(n===void 0)throw Error(V(407));n=n()}else{if(n=t(),Ne===null)throw Error(V(349));Bn&30||_p(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,gf(Cp.bind(null,r,i,e),[e]),r.flags|=2048,Ao(9,Np.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ct(),t=Ne.identifierPrefix;if(he){var n=Vt,r=Ht;n=(r&~(1<<32-yt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Lo++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=vx++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Ex={readContext:ot,useCallback:Lp,useContext:ot,useEffect:Hu,useImperativeHandle:zp,useInsertionEffect:$p,useLayoutEffect:Ip,useMemo:bp,useReducer:Al,useRef:Pp,useState:function(){return Al(bo)},useDebugValue:Vu,useDeferredValue:function(e){var t=it();return Ap(t,ke.memoizedState,e)},useTransition:function(){var e=Al(bo)[0],t=it().memoizedState;return[e,t]},useMutableSource:kp,useSyncExternalStore:Ep,useId:Rp,unstable_isNewReconciler:!1},_x={readContext:ot,useCallback:Lp,useContext:ot,useEffect:Hu,useImperativeHandle:zp,useInsertionEffect:$p,useLayoutEffect:Ip,useMemo:bp,useReducer:Rl,useRef:Pp,useState:function(){return Rl(bo)},useDebugValue:Vu,useDeferredValue:function(e){var t=it();return ke===null?t.memoizedState=e:Ap(t,ke.memoizedState,e)},useTransition:function(){var e=Rl(bo)[0],t=it().memoizedState;return[e,t]},useMutableSource:kp,useSyncExternalStore:Ep,useId:Rp,unstable_isNewReconciler:!1};function ut(e,t){if(e&&e.defaultProps){t=ge({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Pa(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ge({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ws={isMounted:function(e){return(e=e._reactInternals)?Zn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Le(),o=yn(e),i=Ut(r,o);i.payload=t,n!=null&&(i.callback=n),t=mn(e,i,o),t!==null&&(vt(t,e,o,r),Vi(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Le(),o=yn(e),i=Ut(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=mn(e,i,o),t!==null&&(vt(t,e,o,r),Vi(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Le(),r=yn(e),o=Ut(n,r);o.tag=2,t!=null&&(o.callback=t),t=mn(e,o,r),t!==null&&(vt(t,e,r,n),Vi(t,e,r))}};function yf(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!jo(n,r)||!jo(o,i):!0}function Hp(e,t,n){var r=!1,o=wn,i=t.contextType;return typeof i=="object"&&i!==null?i=ot(i):(o=Ve(t)?Hn:Te.current,r=t.contextTypes,i=(r=r!=null)?Mr(e,o):wn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ws,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function vf(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ws.enqueueReplaceState(t,t.state,null)}function $a(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Lu(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=ot(i):(i=Ve(t)?Hn:Te.current,o.context=Mr(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Pa(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Ws.enqueueReplaceState(o,o.state,null),ys(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Ir(e,t){try{var n="",r=t;do n+=Zy(r),r=r.return;while(r);var o=n}catch(i){o=`
39
- Error generating stack: `+i.message+`
40
- `+i.stack}return{value:e,source:t,stack:o,digest:null}}function Dl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ia(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Nx=typeof WeakMap=="function"?WeakMap:Map;function Vp(e,t,n){n=Ut(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ks||(ks=!0,Ha=r),Ia(e,t)},n}function Bp(e,t,n){n=Ut(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Ia(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Ia(e,t),typeof r!="function"&&(gn===null?gn=new Set([this]):gn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function xf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Nx;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Ox.bind(null,e,t,n),t.then(e,e))}function wf(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Sf(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Ut(-1,1),t.tag=2,mn(n,t,1))),n.lanes|=1),e)}var Cx=qt.ReactCurrentOwner,Oe=!1;function ze(e,t,n,r){t.child=e===null?vp(t,null,n,r):Pr(t,e.child,n,r)}function kf(e,t,n,r,o){n=n.render;var i=t.ref;return kr(t,o),r=Ou(e,t,n,r,i,o),n=Fu(),e!==null&&!Oe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Kt(e,t,o)):(he&&n&&Mu(t),t.flags|=1,ze(e,t,r,o),t.child)}function Ef(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Gu(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Up(e,t,i,r,o)):(e=Qi(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:jo,n(s,r)&&e.ref===t.ref)return Kt(e,t,o)}return t.flags|=1,e=vn(i,r),e.ref=t.ref,e.return=t,t.child=e}function Up(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(jo(i,r)&&e.ref===t.ref)if(Oe=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Oe=!0);else return t.lanes=e.lanes,Kt(e,t,o)}return Ta(e,t,n,r,o)}function Wp(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ue(gr,Ue),Ue|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ue(gr,Ue),Ue|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ue(gr,Ue),Ue|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ue(gr,Ue),Ue|=r;return ze(e,t,o,n),t.child}function Yp(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ta(e,t,n,r,o){var i=Ve(n)?Hn:Te.current;return i=Mr(t,i),kr(t,o),n=Ou(e,t,n,r,i,o),r=Fu(),e!==null&&!Oe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Kt(e,t,o)):(he&&r&&Mu(t),t.flags|=1,ze(e,t,n,o),t.child)}function _f(e,t,n,r,o){if(Ve(n)){var i=!0;ds(t)}else i=!1;if(kr(t,o),t.stateNode===null)Wi(e,t),Hp(t,n,r),$a(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var a=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=ot(u):(u=Ve(n)?Hn:Te.current,u=Mr(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||a!==u)&&vf(t,s,r,u),nn=!1;var f=t.memoizedState;s.state=f,ys(t,r,s,o),a=t.memoizedState,l!==r||f!==a||He.current||nn?(typeof c=="function"&&(Pa(t,n,c,r),a=t.memoizedState),(l=nn||yf(t,n,l,r,f,a,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),s.props=r,s.state=a,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,wp(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:ut(t.type,l),s.props=u,d=t.pendingProps,f=s.context,a=n.contextType,typeof a=="object"&&a!==null?a=ot(a):(a=Ve(n)?Hn:Te.current,a=Mr(t,a));var g=n.getDerivedStateFromProps;(c=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==d||f!==a)&&vf(t,s,r,a),nn=!1,f=t.memoizedState,s.state=f,ys(t,r,s,o);var v=t.memoizedState;l!==d||f!==v||He.current||nn?(typeof g=="function"&&(Pa(t,n,g,r),v=t.memoizedState),(u=nn||yf(t,n,u,r,f,v,a)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,v,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,v,a)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),s.props=r,s.state=v,s.context=a,r=u):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return za(e,t,n,r,i,o)}function za(e,t,n,r,o,i){Yp(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&uf(t,n,!1),Kt(e,t,i);r=t.stateNode,Cx.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Pr(t,e.child,null,i),t.child=Pr(t,null,l,i)):ze(e,t,l,i),t.memoizedState=r.state,o&&uf(t,n,!0),t.child}function Xp(e){var t=e.stateNode;t.pendingContext?af(e,t.pendingContext,t.pendingContext!==t.context):t.context&&af(e,t.context,!1),bu(e,t.containerInfo)}function Nf(e,t,n,r,o){return jr(),Pu(o),t.flags|=256,ze(e,t,n,r),t.child}var La={dehydrated:null,treeContext:null,retryLane:0};function ba(e){return{baseLanes:e,cachePool:null,transitions:null}}function Qp(e,t,n){var r=t.pendingProps,o=pe.current,i=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ue(pe,o&1),e===null)return Ma(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=Qs(s,r,0,null),e=Rn(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=ba(n),t.memoizedState=La,e):Bu(t,s));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return Mx(e,t,s,r,l,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,l=o.sibling;var a={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=vn(o,a),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=vn(l,i):(i=Rn(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?ba(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=La,r}return i=e.child,e=i.sibling,r=vn(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Bu(e,t){return t=Qs({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ei(e,t,n,r){return r!==null&&Pu(r),Pr(t,e.child,null,n),e=Bu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Mx(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=Dl(Error(V(422))),Ei(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Qs({mode:"visible",children:r.children},o,0,null),i=Rn(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Pr(t,e.child,null,s),t.child.memoizedState=ba(s),t.memoizedState=La,i);if(!(t.mode&1))return Ei(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(V(419)),r=Dl(i,r,void 0),Ei(e,t,s,r)}if(l=(s&e.childLanes)!==0,Oe||l){if(r=Ne,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,Qt(e,o),vt(r,e,o,-1))}return Ku(),r=Dl(Error(V(421))),Ei(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Fx.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Ye=pn(o.nextSibling),Xe=t,he=!0,ht=null,e!==null&&(Je[et++]=Ht,Je[et++]=Vt,Je[et++]=Vn,Ht=e.id,Vt=e.overflow,Vn=t),t=Bu(t,r.children),t.flags|=4096,t)}function Cf(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ja(e.return,t,n)}function Ol(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Kp(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(ze(e,t,r.children,n),r=pe.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cf(e,n,t);else if(e.tag===19)Cf(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ue(pe,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&vs(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Ol(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&vs(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Ol(t,!0,n,null,i);break;case"together":Ol(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Wi(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Kt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Un|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(V(153));if(t.child!==null){for(e=t.child,n=vn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=vn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function jx(e,t,n){switch(t.tag){case 3:Xp(t),jr();break;case 5:Sp(t);break;case 1:Ve(t.type)&&ds(t);break;case 4:bu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ue(ms,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ue(pe,pe.current&1),t.flags|=128,null):n&t.child.childLanes?Qp(e,t,n):(ue(pe,pe.current&1),e=Kt(e,t,n),e!==null?e.sibling:null);ue(pe,pe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Kp(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ue(pe,pe.current),r)break;return null;case 22:case 23:return t.lanes=0,Wp(e,t,n)}return Kt(e,t,n)}var Gp,Aa,qp,Zp;Gp=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Aa=function(){};qp=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Tn(It.current);var i=null;switch(n){case"input":o=oa(e,o),r=oa(e,r),i=[];break;case"select":o=ge({},o,{value:void 0}),r=ge({},r,{value:void 0}),i=[];break;case"textarea":o=la(e,o),r=la(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=cs)}ua(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(So.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var a=r[u];if(l=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&a!==l&&(a!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||a&&a.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in a)a.hasOwnProperty(s)&&l[s]!==a[s]&&(n||(n={}),n[s]=a[s])}else n||(i||(i=[]),i.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(i=i||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(i=i||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(So.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&ce("scroll",e),i||l===a||(i=[])):(i=i||[]).push(u,a))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Zp=function(e,t,n,r){n!==r&&(t.flags|=4)};function Jr(e,t){if(!he)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function $e(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Px(e,t,n){var r=t.pendingProps;switch(ju(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return $e(t),null;case 1:return Ve(t.type)&&fs(),$e(t),null;case 3:return r=t.stateNode,$r(),fe(He),fe(Te),Ru(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Si(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ht!==null&&(Ua(ht),ht=null))),Aa(e,t),$e(t),null;case 5:Au(t);var o=Tn(zo.current);if(n=t.type,e!==null&&t.stateNode!=null)qp(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(V(166));return $e(t),null}if(e=Tn(It.current),Si(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[jt]=t,r[Io]=i,e=(t.mode&1)!==0,n){case"dialog":ce("cancel",r),ce("close",r);break;case"iframe":case"object":case"embed":ce("load",r);break;case"video":case"audio":for(o=0;o<so.length;o++)ce(so[o],r);break;case"source":ce("error",r);break;case"img":case"image":case"link":ce("error",r),ce("load",r);break;case"details":ce("toggle",r);break;case"input":Lc(r,i),ce("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ce("invalid",r);break;case"textarea":Ac(r,i),ce("invalid",r)}ua(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];s==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&wi(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&wi(r.textContent,l,e),o=["children",""+l]):So.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&ce("scroll",r)}switch(n){case"input":di(r),bc(r,i,!0);break;case"textarea":di(r),Rc(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=cs)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ch(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[jt]=t,e[Io]=r,Gp(e,t,!1,!1),t.stateNode=e;e:{switch(s=ca(n,r),n){case"dialog":ce("cancel",e),ce("close",e),o=r;break;case"iframe":case"object":case"embed":ce("load",e),o=r;break;case"video":case"audio":for(o=0;o<so.length;o++)ce(so[o],e);o=r;break;case"source":ce("error",e),o=r;break;case"img":case"image":case"link":ce("error",e),ce("load",e),o=r;break;case"details":ce("toggle",e),o=r;break;case"input":Lc(e,r),o=oa(e,r),ce("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=ge({},r,{value:void 0}),ce("invalid",e);break;case"textarea":Ac(e,r),o=la(e,r),ce("invalid",e);break;default:o=r}ua(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var a=l[i];i==="style"?Ph(e,a):i==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&Mh(e,a)):i==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&ko(e,a):typeof a=="number"&&ko(e,""+a):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(So.hasOwnProperty(i)?a!=null&&i==="onScroll"&&ce("scroll",e):a!=null&&hu(e,i,a,s))}switch(n){case"input":di(e),bc(e,r,!1);break;case"textarea":di(e),Rc(e);break;case"option":r.value!=null&&e.setAttribute("value",""+xn(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?vr(e,!!r.multiple,i,!1):r.defaultValue!=null&&vr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=cs)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return $e(t),null;case 6:if(e&&t.stateNode!=null)Zp(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(V(166));if(n=Tn(zo.current),Tn(It.current),Si(t)){if(r=t.stateNode,n=t.memoizedProps,r[jt]=t,(i=r.nodeValue!==n)&&(e=Xe,e!==null))switch(e.tag){case 3:wi(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&wi(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[jt]=t,t.stateNode=r}return $e(t),null;case 13:if(fe(pe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(he&&Ye!==null&&t.mode&1&&!(t.flags&128))gp(),jr(),t.flags|=98560,i=!1;else if(i=Si(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(V(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(V(317));i[jt]=t}else jr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;$e(t),i=!1}else ht!==null&&(Ua(ht),ht=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||pe.current&1?Ee===0&&(Ee=3):Ku())),t.updateQueue!==null&&(t.flags|=4),$e(t),null);case 4:return $r(),Aa(e,t),e===null&&Po(t.stateNode.containerInfo),$e(t),null;case 10:return Tu(t.type._context),$e(t),null;case 17:return Ve(t.type)&&fs(),$e(t),null;case 19:if(fe(pe),i=t.memoizedState,i===null)return $e(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)Jr(i,!1);else{if(Ee!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=vs(e),s!==null){for(t.flags|=128,Jr(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ue(pe,pe.current&1|2),t.child}e=e.sibling}i.tail!==null&&xe()>Tr&&(t.flags|=128,r=!0,Jr(i,!1),t.lanes=4194304)}else{if(!r)if(e=vs(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Jr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!he)return $e(t),null}else 2*xe()-i.renderingStartTime>Tr&&n!==1073741824&&(t.flags|=128,r=!0,Jr(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=xe(),t.sibling=null,n=pe.current,ue(pe,r?n&1|2:n&1),t):($e(t),null);case 22:case 23:return Qu(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ue&1073741824&&($e(t),t.subtreeFlags&6&&(t.flags|=8192)):$e(t),null;case 24:return null;case 25:return null}throw Error(V(156,t.tag))}function $x(e,t){switch(ju(t),t.tag){case 1:return Ve(t.type)&&fs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return $r(),fe(He),fe(Te),Ru(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Au(t),null;case 13:if(fe(pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(V(340));jr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return fe(pe),null;case 4:return $r(),null;case 10:return Tu(t.type._context),null;case 22:case 23:return Qu(),null;case 24:return null;default:return null}}var _i=!1,Ie=!1,Ix=typeof WeakSet=="function"?WeakSet:Set,Y=null;function mr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ve(e,t,r)}else n.current=null}function Ra(e,t,n){try{n()}catch(r){ve(e,t,r)}}var Mf=!1;function Tx(e,t){if(wa=ls,e=rp(),Cu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,l=-1,a=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var g;d!==n||o!==0&&d.nodeType!==3||(l=s+o),d!==i||r!==0&&d.nodeType!==3||(a=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(g=d.firstChild)!==null;)f=d,d=g;for(;;){if(d===e)break t;if(f===n&&++u===o&&(l=s),f===i&&++c===r&&(a=s),(g=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=g}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Sa={focusedElem:e,selectionRange:n},ls=!1,Y=t;Y!==null;)if(t=Y,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Y=e;else for(;Y!==null;){t=Y;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var w=v.memoizedProps,k=v.memoizedState,m=t.stateNode,p=m.getSnapshotBeforeUpdate(t.elementType===t.type?w:ut(t.type,w),k);m.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var h=t.stateNode.containerInfo;h.nodeType===1?h.textContent="":h.nodeType===9&&h.documentElement&&h.removeChild(h.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(V(163))}}catch(x){ve(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,Y=e;break}Y=t.return}return v=Mf,Mf=!1,v}function go(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Ra(t,n,i)}o=o.next}while(o!==r)}}function Ys(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Da(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Jp(e){var t=e.alternate;t!==null&&(e.alternate=null,Jp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[jt],delete t[Io],delete t[_a],delete t[px],delete t[mx])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function em(e){return e.tag===5||e.tag===3||e.tag===4}function jf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||em(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Oa(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=cs));else if(r!==4&&(e=e.child,e!==null))for(Oa(e,t,n),e=e.sibling;e!==null;)Oa(e,t,n),e=e.sibling}function Fa(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Fa(e,t,n),e=e.sibling;e!==null;)Fa(e,t,n),e=e.sibling}var Ce=null,ct=!1;function Zt(e,t,n){for(n=n.child;n!==null;)tm(e,t,n),n=n.sibling}function tm(e,t,n){if($t&&typeof $t.onCommitFiberUnmount=="function")try{$t.onCommitFiberUnmount(Ds,n)}catch{}switch(n.tag){case 5:Ie||mr(n,t);case 6:var r=Ce,o=ct;Ce=null,Zt(e,t,n),Ce=r,ct=o,Ce!==null&&(ct?(e=Ce,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ce.removeChild(n.stateNode));break;case 18:Ce!==null&&(ct?(e=Ce,n=n.stateNode,e.nodeType===8?Tl(e.parentNode,n):e.nodeType===1&&Tl(e,n),Co(e)):Tl(Ce,n.stateNode));break;case 4:r=Ce,o=ct,Ce=n.stateNode.containerInfo,ct=!0,Zt(e,t,n),Ce=r,ct=o;break;case 0:case 11:case 14:case 15:if(!Ie&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Ra(n,t,s),o=o.next}while(o!==r)}Zt(e,t,n);break;case 1:if(!Ie&&(mr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){ve(n,t,l)}Zt(e,t,n);break;case 21:Zt(e,t,n);break;case 22:n.mode&1?(Ie=(r=Ie)||n.memoizedState!==null,Zt(e,t,n),Ie=r):Zt(e,t,n);break;default:Zt(e,t,n)}}function Pf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ix),t.forEach(function(r){var o=Hx.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function lt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:Ce=l.stateNode,ct=!1;break e;case 3:Ce=l.stateNode.containerInfo,ct=!0;break e;case 4:Ce=l.stateNode.containerInfo,ct=!0;break e}l=l.return}if(Ce===null)throw Error(V(160));tm(i,s,o),Ce=null,ct=!1;var a=o.alternate;a!==null&&(a.return=null),o.return=null}catch(u){ve(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)nm(t,e),t=t.sibling}function nm(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(lt(t,e),Nt(e),r&4){try{go(3,e,e.return),Ys(3,e)}catch(w){ve(e,e.return,w)}try{go(5,e,e.return)}catch(w){ve(e,e.return,w)}}break;case 1:lt(t,e),Nt(e),r&512&&n!==null&&mr(n,n.return);break;case 5:if(lt(t,e),Nt(e),r&512&&n!==null&&mr(n,n.return),e.flags&32){var o=e.stateNode;try{ko(o,"")}catch(w){ve(e,e.return,w)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,l=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&_h(o,i),ca(l,s);var u=ca(l,i);for(s=0;s<a.length;s+=2){var c=a[s],d=a[s+1];c==="style"?Ph(o,d):c==="dangerouslySetInnerHTML"?Mh(o,d):c==="children"?ko(o,d):hu(o,c,d,u)}switch(l){case"input":ia(o,i);break;case"textarea":Nh(o,i);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var g=i.value;g!=null?vr(o,!!i.multiple,g,!1):f!==!!i.multiple&&(i.defaultValue!=null?vr(o,!!i.multiple,i.defaultValue,!0):vr(o,!!i.multiple,i.multiple?[]:"",!1))}o[Io]=i}catch(w){ve(e,e.return,w)}}break;case 6:if(lt(t,e),Nt(e),r&4){if(e.stateNode===null)throw Error(V(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(w){ve(e,e.return,w)}}break;case 3:if(lt(t,e),Nt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Co(t.containerInfo)}catch(w){ve(e,e.return,w)}break;case 4:lt(t,e),Nt(e);break;case 13:lt(t,e),Nt(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Yu=xe())),r&4&&Pf(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Ie=(u=Ie)||c,lt(t,e),Ie=u):lt(t,e),Nt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(Y=e,c=e.child;c!==null;){for(d=Y=c;Y!==null;){switch(f=Y,g=f.child,f.tag){case 0:case 11:case 14:case 15:go(4,f,f.return);break;case 1:mr(f,f.return);var v=f.stateNode;if(typeof v.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(w){ve(r,n,w)}}break;case 5:mr(f,f.return);break;case 22:if(f.memoizedState!==null){If(d);continue}}g!==null?(g.return=f,Y=g):If(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{o=d.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=d.stateNode,a=d.memoizedProps.style,s=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=jh("display",s))}catch(w){ve(e,e.return,w)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(w){ve(e,e.return,w)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:lt(t,e),Nt(e),r&4&&Pf(e);break;case 21:break;default:lt(t,e),Nt(e)}}function Nt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(em(n)){var r=n;break e}n=n.return}throw Error(V(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(ko(o,""),r.flags&=-33);var i=jf(e);Fa(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,l=jf(e);Oa(e,l,s);break;default:throw Error(V(161))}}catch(a){ve(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zx(e,t,n){Y=e,rm(e)}function rm(e,t,n){for(var r=(e.mode&1)!==0;Y!==null;){var o=Y,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||_i;if(!s){var l=o.alternate,a=l!==null&&l.memoizedState!==null||Ie;l=_i;var u=Ie;if(_i=s,(Ie=a)&&!u)for(Y=o;Y!==null;)s=Y,a=s.child,s.tag===22&&s.memoizedState!==null?Tf(o):a!==null?(a.return=s,Y=a):Tf(o);for(;i!==null;)Y=i,rm(i),i=i.sibling;Y=o,_i=l,Ie=u}$f(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,Y=i):$f(e)}}function $f(e){for(;Y!==null;){var t=Y;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ie||Ys(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ie)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:ut(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&pf(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}pf(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&Co(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(V(163))}Ie||t.flags&512&&Da(t)}catch(f){ve(t,t.return,f)}}if(t===e){Y=null;break}if(n=t.sibling,n!==null){n.return=t.return,Y=n;break}Y=t.return}}function If(e){for(;Y!==null;){var t=Y;if(t===e){Y=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Y=n;break}Y=t.return}}function Tf(e){for(;Y!==null;){var t=Y;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ys(4,t)}catch(a){ve(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(a){ve(t,o,a)}}var i=t.return;try{Da(t)}catch(a){ve(t,i,a)}break;case 5:var s=t.return;try{Da(t)}catch(a){ve(t,s,a)}}}catch(a){ve(t,t.return,a)}if(t===e){Y=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Y=l;break}Y=t.return}}var Lx=Math.ceil,Ss=qt.ReactCurrentDispatcher,Uu=qt.ReactCurrentOwner,nt=qt.ReactCurrentBatchConfig,se=0,Ne=null,we=null,Me=0,Ue=0,gr=kn(0),Ee=0,Ro=null,Un=0,Xs=0,Wu=0,yo=null,Re=null,Yu=0,Tr=1/0,Ot=null,ks=!1,Ha=null,gn=null,Ni=!1,un=null,Es=0,vo=0,Va=null,Yi=-1,Xi=0;function Le(){return se&6?xe():Yi!==-1?Yi:Yi=xe()}function yn(e){return e.mode&1?se&2&&Me!==0?Me&-Me:yx.transition!==null?(Xi===0&&(Xi=Hh()),Xi):(e=le,e!==0||(e=window.event,e=e===void 0?16:Qh(e.type)),e):1}function vt(e,t,n,r){if(50<vo)throw vo=0,Va=null,Error(V(185));qo(e,n,r),(!(se&2)||e!==Ne)&&(e===Ne&&(!(se&2)&&(Xs|=n),Ee===4&&sn(e,Me)),Be(e,r),n===1&&se===0&&!(t.mode&1)&&(Tr=xe()+500,Bs&&En()))}function Be(e,t){var n=e.callbackNode;yv(e,t);var r=ss(e,e===Ne?Me:0);if(r===0)n!==null&&Fc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Fc(n),t===1)e.tag===0?gx(zf.bind(null,e)):hp(zf.bind(null,e)),dx(function(){!(se&6)&&En()}),n=null;else{switch(Vh(r)){case 1:n=vu;break;case 4:n=Oh;break;case 16:n=is;break;case 536870912:n=Fh;break;default:n=is}n=fm(n,om.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function om(e,t){if(Yi=-1,Xi=0,se&6)throw Error(V(327));var n=e.callbackNode;if(Er()&&e.callbackNode!==n)return null;var r=ss(e,e===Ne?Me:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=_s(e,r);else{t=r;var o=se;se|=2;var i=sm();(Ne!==e||Me!==t)&&(Ot=null,Tr=xe()+500,An(e,t));do try{Rx();break}catch(l){im(e,l)}while(!0);Iu(),Ss.current=i,se=o,we!==null?t=0:(Ne=null,Me=0,t=Ee)}if(t!==0){if(t===2&&(o=ma(e),o!==0&&(r=o,t=Ba(e,o))),t===1)throw n=Ro,An(e,0),sn(e,r),Be(e,xe()),n;if(t===6)sn(e,r);else{if(o=e.current.alternate,!(r&30)&&!bx(o)&&(t=_s(e,r),t===2&&(i=ma(e),i!==0&&(r=i,t=Ba(e,i))),t===1))throw n=Ro,An(e,0),sn(e,r),Be(e,xe()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(V(345));case 2:jn(e,Re,Ot);break;case 3:if(sn(e,r),(r&130023424)===r&&(t=Yu+500-xe(),10<t)){if(ss(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Le(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Ea(jn.bind(null,e,Re,Ot),t);break}jn(e,Re,Ot);break;case 4:if(sn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-yt(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=xe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Lx(r/1960))-r,10<r){e.timeoutHandle=Ea(jn.bind(null,e,Re,Ot),r);break}jn(e,Re,Ot);break;case 5:jn(e,Re,Ot);break;default:throw Error(V(329))}}}return Be(e,xe()),e.callbackNode===n?om.bind(null,e):null}function Ba(e,t){var n=yo;return e.current.memoizedState.isDehydrated&&(An(e,t).flags|=256),e=_s(e,t),e!==2&&(t=Re,Re=n,t!==null&&Ua(t)),e}function Ua(e){Re===null?Re=e:Re.push.apply(Re,e)}function bx(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!xt(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function sn(e,t){for(t&=~Wu,t&=~Xs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-yt(t),r=1<<n;e[n]=-1,t&=~r}}function zf(e){if(se&6)throw Error(V(327));Er();var t=ss(e,0);if(!(t&1))return Be(e,xe()),null;var n=_s(e,t);if(e.tag!==0&&n===2){var r=ma(e);r!==0&&(t=r,n=Ba(e,r))}if(n===1)throw n=Ro,An(e,0),sn(e,t),Be(e,xe()),n;if(n===6)throw Error(V(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,jn(e,Re,Ot),Be(e,xe()),null}function Xu(e,t){var n=se;se|=1;try{return e(t)}finally{se=n,se===0&&(Tr=xe()+500,Bs&&En())}}function Wn(e){un!==null&&un.tag===0&&!(se&6)&&Er();var t=se;se|=1;var n=nt.transition,r=le;try{if(nt.transition=null,le=1,e)return e()}finally{le=r,nt.transition=n,se=t,!(se&6)&&En()}}function Qu(){Ue=gr.current,fe(gr)}function An(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,fx(n)),we!==null)for(n=we.return;n!==null;){var r=n;switch(ju(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&fs();break;case 3:$r(),fe(He),fe(Te),Ru();break;case 5:Au(r);break;case 4:$r();break;case 13:fe(pe);break;case 19:fe(pe);break;case 10:Tu(r.type._context);break;case 22:case 23:Qu()}n=n.return}if(Ne=e,we=e=vn(e.current,null),Me=Ue=t,Ee=0,Ro=null,Wu=Xs=Un=0,Re=yo=null,In!==null){for(t=0;t<In.length;t++)if(n=In[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}In=null}return e}function im(e,t){do{var n=we;try{if(Iu(),Bi.current=ws,xs){for(var r=me.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}xs=!1}if(Bn=0,_e=ke=me=null,mo=!1,Lo=0,Uu.current=null,n===null||n.return===null){Ee=1,Ro=t,we=null;break}e:{var i=e,s=n.return,l=n,a=t;if(t=Me,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,c=l,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var g=wf(s);if(g!==null){g.flags&=-257,Sf(g,s,l,i,t),g.mode&1&&xf(i,u,t),t=g,a=u;var v=t.updateQueue;if(v===null){var w=new Set;w.add(a),t.updateQueue=w}else v.add(a);break e}else{if(!(t&1)){xf(i,u,t),Ku();break e}a=Error(V(426))}}else if(he&&l.mode&1){var k=wf(s);if(k!==null){!(k.flags&65536)&&(k.flags|=256),Sf(k,s,l,i,t),Pu(Ir(a,l));break e}}i=a=Ir(a,l),Ee!==4&&(Ee=2),yo===null?yo=[i]:yo.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var m=Vp(i,a,t);hf(i,m);break e;case 1:l=a;var p=i.type,h=i.stateNode;if(!(i.flags&128)&&(typeof p.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(gn===null||!gn.has(h)))){i.flags|=65536,t&=-t,i.lanes|=t;var x=Bp(i,l,t);hf(i,x);break e}}i=i.return}while(i!==null)}am(n)}catch(S){t=S,we===n&&n!==null&&(we=n=n.return);continue}break}while(!0)}function sm(){var e=Ss.current;return Ss.current=ws,e===null?ws:e}function Ku(){(Ee===0||Ee===3||Ee===2)&&(Ee=4),Ne===null||!(Un&268435455)&&!(Xs&268435455)||sn(Ne,Me)}function _s(e,t){var n=se;se|=2;var r=sm();(Ne!==e||Me!==t)&&(Ot=null,An(e,t));do try{Ax();break}catch(o){im(e,o)}while(!0);if(Iu(),se=n,Ss.current=r,we!==null)throw Error(V(261));return Ne=null,Me=0,Ee}function Ax(){for(;we!==null;)lm(we)}function Rx(){for(;we!==null&&!av();)lm(we)}function lm(e){var t=cm(e.alternate,e,Ue);e.memoizedProps=e.pendingProps,t===null?am(e):we=t,Uu.current=null}function am(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=$x(n,t),n!==null){n.flags&=32767,we=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ee=6,we=null;return}}else if(n=Px(n,t,Ue),n!==null){we=n;return}if(t=t.sibling,t!==null){we=t;return}we=t=e}while(t!==null);Ee===0&&(Ee=5)}function jn(e,t,n){var r=le,o=nt.transition;try{nt.transition=null,le=1,Dx(e,t,n,r)}finally{nt.transition=o,le=r}return null}function Dx(e,t,n,r){do Er();while(un!==null);if(se&6)throw Error(V(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(V(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(vv(e,i),e===Ne&&(we=Ne=null,Me=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ni||(Ni=!0,fm(is,function(){return Er(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=nt.transition,nt.transition=null;var s=le;le=1;var l=se;se|=4,Uu.current=null,Tx(e,n),nm(n,e),ox(Sa),ls=!!wa,Sa=wa=null,e.current=n,zx(n),uv(),se=l,le=s,nt.transition=i}else e.current=n;if(Ni&&(Ni=!1,un=e,Es=o),i=e.pendingLanes,i===0&&(gn=null),dv(n.stateNode),Be(e,xe()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(ks)throw ks=!1,e=Ha,Ha=null,e;return Es&1&&e.tag!==0&&Er(),i=e.pendingLanes,i&1?e===Va?vo++:(vo=0,Va=e):vo=0,En(),null}function Er(){if(un!==null){var e=Vh(Es),t=nt.transition,n=le;try{if(nt.transition=null,le=16>e?16:e,un===null)var r=!1;else{if(e=un,un=null,Es=0,se&6)throw Error(V(331));var o=se;for(se|=4,Y=e.current;Y!==null;){var i=Y,s=i.child;if(Y.flags&16){var l=i.deletions;if(l!==null){for(var a=0;a<l.length;a++){var u=l[a];for(Y=u;Y!==null;){var c=Y;switch(c.tag){case 0:case 11:case 15:go(8,c,i)}var d=c.child;if(d!==null)d.return=c,Y=d;else for(;Y!==null;){c=Y;var f=c.sibling,g=c.return;if(Jp(c),c===u){Y=null;break}if(f!==null){f.return=g,Y=f;break}Y=g}}}var v=i.alternate;if(v!==null){var w=v.child;if(w!==null){v.child=null;do{var k=w.sibling;w.sibling=null,w=k}while(w!==null)}}Y=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,Y=s;else e:for(;Y!==null;){if(i=Y,i.flags&2048)switch(i.tag){case 0:case 11:case 15:go(9,i,i.return)}var m=i.sibling;if(m!==null){m.return=i.return,Y=m;break e}Y=i.return}}var p=e.current;for(Y=p;Y!==null;){s=Y;var h=s.child;if(s.subtreeFlags&2064&&h!==null)h.return=s,Y=h;else e:for(s=p;Y!==null;){if(l=Y,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Ys(9,l)}}catch(S){ve(l,l.return,S)}if(l===s){Y=null;break e}var x=l.sibling;if(x!==null){x.return=l.return,Y=x;break e}Y=l.return}}if(se=o,En(),$t&&typeof $t.onPostCommitFiberRoot=="function")try{$t.onPostCommitFiberRoot(Ds,e)}catch{}r=!0}return r}finally{le=n,nt.transition=t}}return!1}function Lf(e,t,n){t=Ir(n,t),t=Vp(e,t,1),e=mn(e,t,1),t=Le(),e!==null&&(qo(e,1,t),Be(e,t))}function ve(e,t,n){if(e.tag===3)Lf(e,e,n);else for(;t!==null;){if(t.tag===3){Lf(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(gn===null||!gn.has(r))){e=Ir(n,e),e=Bp(t,e,1),t=mn(t,e,1),e=Le(),t!==null&&(qo(t,1,e),Be(t,e));break}}t=t.return}}function Ox(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Le(),e.pingedLanes|=e.suspendedLanes&n,Ne===e&&(Me&n)===n&&(Ee===4||Ee===3&&(Me&130023424)===Me&&500>xe()-Yu?An(e,0):Wu|=n),Be(e,t)}function um(e,t){t===0&&(e.mode&1?(t=mi,mi<<=1,!(mi&130023424)&&(mi=4194304)):t=1);var n=Le();e=Qt(e,t),e!==null&&(qo(e,t,n),Be(e,n))}function Fx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),um(e,n)}function Hx(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(V(314))}r!==null&&r.delete(t),um(e,n)}var cm;cm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||He.current)Oe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Oe=!1,jx(e,t,n);Oe=!!(e.flags&131072)}else Oe=!1,he&&t.flags&1048576&&pp(t,ps,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Wi(e,t),e=t.pendingProps;var o=Mr(t,Te.current);kr(t,n),o=Ou(null,t,r,e,o,n);var i=Fu();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ve(r)?(i=!0,ds(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Lu(t),o.updater=Ws,t.stateNode=o,o._reactInternals=t,$a(t,r,e,n),t=za(null,t,r,!0,i,n)):(t.tag=0,he&&i&&Mu(t),ze(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Wi(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Bx(r),e=ut(r,e),o){case 0:t=Ta(null,t,r,e,n);break e;case 1:t=_f(null,t,r,e,n);break e;case 11:t=kf(null,t,r,e,n);break e;case 14:t=Ef(null,t,r,ut(r.type,e),n);break e}throw Error(V(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ut(r,o),Ta(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ut(r,o),_f(e,t,r,o,n);case 3:e:{if(Xp(t),e===null)throw Error(V(387));r=t.pendingProps,i=t.memoizedState,o=i.element,wp(e,t),ys(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Ir(Error(V(423)),t),t=Nf(e,t,r,n,o);break e}else if(r!==o){o=Ir(Error(V(424)),t),t=Nf(e,t,r,n,o);break e}else for(Ye=pn(t.stateNode.containerInfo.firstChild),Xe=t,he=!0,ht=null,n=vp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(jr(),r===o){t=Kt(e,t,n);break e}ze(e,t,r,n)}t=t.child}return t;case 5:return Sp(t),e===null&&Ma(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,ka(r,o)?s=null:i!==null&&ka(r,i)&&(t.flags|=32),Yp(e,t),ze(e,t,s,n),t.child;case 6:return e===null&&Ma(t),null;case 13:return Qp(e,t,n);case 4:return bu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pr(t,null,r,n):ze(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ut(r,o),kf(e,t,r,o,n);case 7:return ze(e,t,t.pendingProps,n),t.child;case 8:return ze(e,t,t.pendingProps.children,n),t.child;case 12:return ze(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,ue(ms,r._currentValue),r._currentValue=s,i!==null)if(xt(i.value,s)){if(i.children===o.children&&!He.current){t=Kt(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){s=i.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=Ut(-1,n&-n),a.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),ja(i.return,n,t),l.lanes|=n;break}a=a.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(V(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),ja(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}ze(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,kr(t,n),o=ot(o),r=r(o),t.flags|=1,ze(e,t,r,n),t.child;case 14:return r=t.type,o=ut(r,t.pendingProps),o=ut(r.type,o),Ef(e,t,r,o,n);case 15:return Up(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ut(r,o),Wi(e,t),t.tag=1,Ve(r)?(e=!0,ds(t)):e=!1,kr(t,n),Hp(t,r,o),$a(t,r,o,n),za(null,t,r,!0,e,n);case 19:return Kp(e,t,n);case 22:return Wp(e,t,n)}throw Error(V(156,t.tag))};function fm(e,t){return Dh(e,t)}function Vx(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tt(e,t,n,r){return new Vx(e,t,n,r)}function Gu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Bx(e){if(typeof e=="function")return Gu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===mu)return 11;if(e===gu)return 14}return 2}function vn(e,t){var n=e.alternate;return n===null?(n=tt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Qi(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Gu(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case sr:return Rn(n.children,o,i,t);case pu:s=8,o|=8;break;case ea:return e=tt(12,n,t,o|2),e.elementType=ea,e.lanes=i,e;case ta:return e=tt(13,n,t,o),e.elementType=ta,e.lanes=i,e;case na:return e=tt(19,n,t,o),e.elementType=na,e.lanes=i,e;case Sh:return Qs(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case xh:s=10;break e;case wh:s=9;break e;case mu:s=11;break e;case gu:s=14;break e;case tn:s=16,r=null;break e}throw Error(V(130,e==null?e:typeof e,""))}return t=tt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Rn(e,t,n,r){return e=tt(7,e,r,t),e.lanes=n,e}function Qs(e,t,n,r){return e=tt(22,e,r,t),e.elementType=Sh,e.lanes=n,e.stateNode={isHidden:!1},e}function Fl(e,t,n){return e=tt(6,e,null,t),e.lanes=n,e}function Hl(e,t,n){return t=tt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ux(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Sl(0),this.expirationTimes=Sl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sl(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function qu(e,t,n,r,o,i,s,l,a){return e=new Ux(e,t,n,l,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=tt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Lu(i),e}function Wx(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ir,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function dm(e){if(!e)return wn;e=e._reactInternals;e:{if(Zn(e)!==e||e.tag!==1)throw Error(V(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ve(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(V(171))}if(e.tag===1){var n=e.type;if(Ve(n))return dp(e,n,t)}return t}function hm(e,t,n,r,o,i,s,l,a){return e=qu(n,r,!0,e,o,i,s,l,a),e.context=dm(null),n=e.current,r=Le(),o=yn(n),i=Ut(r,o),i.callback=t??null,mn(n,i,o),e.current.lanes=o,qo(e,o,r),Be(e,r),e}function Ks(e,t,n,r){var o=t.current,i=Le(),s=yn(o);return n=dm(n),t.context===null?t.context=n:t.pendingContext=n,t=Ut(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=mn(o,t,s),e!==null&&(vt(e,o,s,i),Vi(e,o,s)),s}function Ns(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function bf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Zu(e,t){bf(e,t),(e=e.alternate)&&bf(e,t)}function Yx(){return null}var pm=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ju(e){this._internalRoot=e}Gs.prototype.render=Ju.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(V(409));Ks(e,t,null,null)};Gs.prototype.unmount=Ju.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Wn(function(){Ks(null,e,null,null)}),t[Xt]=null}};function Gs(e){this._internalRoot=e}Gs.prototype.unstable_scheduleHydration=function(e){if(e){var t=Wh();e={blockedOn:null,target:e,priority:t};for(var n=0;n<on.length&&t!==0&&t<on[n].priority;n++);on.splice(n,0,e),n===0&&Xh(e)}};function ec(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function qs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Af(){}function Xx(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=Ns(s);i.call(u)}}var s=hm(t,r,e,0,null,!1,!1,"",Af);return e._reactRootContainer=s,e[Xt]=s.current,Po(e.nodeType===8?e.parentNode:e),Wn(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var u=Ns(a);l.call(u)}}var a=qu(e,0,!1,null,null,!1,!1,"",Af);return e._reactRootContainer=a,e[Xt]=a.current,Po(e.nodeType===8?e.parentNode:e),Wn(function(){Ks(t,a,n,r)}),a}function Zs(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var l=o;o=function(){var a=Ns(s);l.call(a)}}Ks(t,s,e,o)}else s=Xx(n,t,e,o,r);return Ns(s)}Bh=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=io(t.pendingLanes);n!==0&&(xu(t,n|1),Be(t,xe()),!(se&6)&&(Tr=xe()+500,En()))}break;case 13:Wn(function(){var r=Qt(e,1);if(r!==null){var o=Le();vt(r,e,1,o)}}),Zu(e,1)}};wu=function(e){if(e.tag===13){var t=Qt(e,134217728);if(t!==null){var n=Le();vt(t,e,134217728,n)}Zu(e,134217728)}};Uh=function(e){if(e.tag===13){var t=yn(e),n=Qt(e,t);if(n!==null){var r=Le();vt(n,e,t,r)}Zu(e,t)}};Wh=function(){return le};Yh=function(e,t){var n=le;try{return le=e,t()}finally{le=n}};da=function(e,t,n){switch(t){case"input":if(ia(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Vs(r);if(!o)throw Error(V(90));Eh(r),ia(r,o)}}}break;case"textarea":Nh(e,n);break;case"select":t=n.value,t!=null&&vr(e,!!n.multiple,t,!1)}};Th=Xu;zh=Wn;var Qx={usingClientEntryPoint:!1,Events:[Jo,cr,Vs,$h,Ih,Xu]},eo={findFiberByHostInstance:$n,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Kx={bundleType:eo.bundleType,version:eo.version,rendererPackageName:eo.rendererPackageName,rendererConfig:eo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:qt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Ah(e),e===null?null:e.stateNode},findFiberByHostInstance:eo.findFiberByHostInstance||Yx,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 Ci=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ci.isDisabled&&Ci.supportsFiber)try{Ds=Ci.inject(Kx),$t=Ci}catch{}}Ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Qx;Ge.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ec(t))throw Error(V(200));return Wx(e,t,null,n)};Ge.createRoot=function(e,t){if(!ec(e))throw Error(V(299));var n=!1,r="",o=pm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=qu(e,1,!1,null,null,n,!1,r,o),e[Xt]=t.current,Po(e.nodeType===8?e.parentNode:e),new Ju(t)};Ge.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(V(188)):(e=Object.keys(e).join(","),Error(V(268,e)));return e=Ah(t),e=e===null?null:e.stateNode,e};Ge.flushSync=function(e){return Wn(e)};Ge.hydrate=function(e,t,n){if(!qs(t))throw Error(V(200));return Zs(null,e,t,!0,n)};Ge.hydrateRoot=function(e,t,n){if(!ec(e))throw Error(V(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=pm;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=hm(t,null,e,1,n??null,o,!1,i,s),e[Xt]=t.current,Po(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Gs(t)};Ge.render=function(e,t,n){if(!qs(t))throw Error(V(200));return Zs(null,e,t,!1,n)};Ge.unmountComponentAtNode=function(e){if(!qs(e))throw Error(V(40));return e._reactRootContainer?(Wn(function(){Zs(null,null,e,!1,function(){e._reactRootContainer=null,e[Xt]=null})}),!0):!1};Ge.unstable_batchedUpdates=Xu;Ge.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!qs(n))throw Error(V(200));if(e==null||e._reactInternals===void 0)throw Error(V(38));return Zs(e,t,n,!1,r)};Ge.version="18.3.1-next-f1338f8080-20240426";function mm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(mm)}catch(e){console.error(e)}}mm(),mh.exports=Ge;var gm=mh.exports,ym,Rf=gm;ym=Rf.createRoot,Rf.hydrateRoot;function Se(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Se(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Gx={value:()=>{}};function Js(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ki(n)}function Ki(e){this._=e}function qx(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ki.prototype=Js.prototype={constructor:Ki,on:function(e,t){var n=this._,r=qx(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=Zx(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=Df(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Df(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ki(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function Zx(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function Df(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=Gx,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Wa="http://www.w3.org/1999/xhtml";const Of={svg:"http://www.w3.org/2000/svg",xhtml:Wa,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function el(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Of.hasOwnProperty(t)?{space:Of[t],local:e}:e}function Jx(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Wa&&t.documentElement.namespaceURI===Wa?t.createElement(e):t.createElementNS(n,e)}}function ew(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function vm(e){var t=el(e);return(t.local?ew:Jx)(t)}function tw(){}function tc(e){return e==null?tw:function(){return this.querySelector(e)}}function nw(e){typeof e!="function"&&(e=tc(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=new Array(s),a,u,c=0;c<s;++c)(a=i[c])&&(u=e.call(a,a.__data__,c,i))&&("__data__"in a&&(u.__data__=a.__data__),l[c]=u);return new Ke(r,this._parents)}function rw(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ow(){return[]}function xm(e){return e==null?ow:function(){return this.querySelectorAll(e)}}function iw(e){return function(){return rw(e.apply(this,arguments))}}function sw(e){typeof e=="function"?e=iw(e):e=xm(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&(r.push(e.call(a,a.__data__,u,s)),o.push(a));return new Ke(r,o)}function wm(e){return function(){return this.matches(e)}}function Sm(e){return function(t){return t.matches(e)}}var lw=Array.prototype.find;function aw(e){return function(){return lw.call(this.children,e)}}function uw(){return this.firstElementChild}function cw(e){return this.select(e==null?uw:aw(typeof e=="function"?e:Sm(e)))}var fw=Array.prototype.filter;function dw(){return Array.from(this.children)}function hw(e){return function(){return fw.call(this.children,e)}}function pw(e){return this.selectAll(e==null?dw:hw(typeof e=="function"?e:Sm(e)))}function mw(e){typeof e!="function"&&(e=wm(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new Ke(r,this._parents)}function km(e){return new Array(e.length)}function gw(){return new Ke(this._enter||this._groups.map(km),this._parents)}function Cs(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Cs.prototype={constructor:Cs,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function yw(e){return function(){return e}}function vw(e,t,n,r,o,i){for(var s=0,l,a=t.length,u=i.length;s<u;++s)(l=t[s])?(l.__data__=i[s],r[s]=l):n[s]=new Cs(e,i[s]);for(;s<a;++s)(l=t[s])&&(o[s]=l)}function xw(e,t,n,r,o,i,s){var l,a,u=new Map,c=t.length,d=i.length,f=new Array(c),g;for(l=0;l<c;++l)(a=t[l])&&(f[l]=g=s.call(a,a.__data__,l,t)+"",u.has(g)?o[l]=a:u.set(g,a));for(l=0;l<d;++l)g=s.call(e,i[l],l,i)+"",(a=u.get(g))?(r[l]=a,a.__data__=i[l],u.delete(g)):n[l]=new Cs(e,i[l]);for(l=0;l<c;++l)(a=t[l])&&u.get(f[l])===a&&(o[l]=a)}function ww(e){return e.__data__}function Sw(e,t){if(!arguments.length)return Array.from(this,ww);var n=t?xw:vw,r=this._parents,o=this._groups;typeof e!="function"&&(e=yw(e));for(var i=o.length,s=new Array(i),l=new Array(i),a=new Array(i),u=0;u<i;++u){var c=r[u],d=o[u],f=d.length,g=kw(e.call(c,c&&c.__data__,u,r)),v=g.length,w=l[u]=new Array(v),k=s[u]=new Array(v),m=a[u]=new Array(f);n(c,d,w,k,m,g,t);for(var p=0,h=0,x,S;p<v;++p)if(x=w[p]){for(p>=h&&(h=p+1);!(S=k[h])&&++h<v;);x._next=S||null}}return s=new Ke(s,r),s._enter=l,s._exit=a,s}function kw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ew(){return new Ke(this._exit||this._groups.map(km),this._parents)}function _w(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function Nw(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),l=new Array(o),a=0;a<s;++a)for(var u=n[a],c=r[a],d=u.length,f=l[a]=new Array(d),g,v=0;v<d;++v)(g=u[v]||c[v])&&(f[v]=g);for(;a<o;++a)l[a]=n[a];return new Ke(l,this._parents)}function Cw(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function Mw(e){e||(e=jw);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],l=s.length,a=o[i]=new Array(l),u,c=0;c<l;++c)(u=s[c])&&(a[c]=u);a.sort(t)}return new Ke(o,this._parents).order()}function jw(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Pw(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function $w(){return Array.from(this)}function Iw(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function Tw(){let e=0;for(const t of this)++e;return e}function zw(){return!this.node()}function Lw(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,l;i<s;++i)(l=o[i])&&e.call(l,l.__data__,i,o);return this}function bw(e){return function(){this.removeAttribute(e)}}function Aw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Rw(e,t){return function(){this.setAttribute(e,t)}}function Dw(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ow(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Fw(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Hw(e,t){var n=el(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Aw:bw:typeof t=="function"?n.local?Fw:Ow:n.local?Dw:Rw)(n,t))}function Em(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Vw(e){return function(){this.style.removeProperty(e)}}function Bw(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Uw(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Ww(e,t,n){return arguments.length>1?this.each((t==null?Vw:typeof t=="function"?Uw:Bw)(e,t,n??"")):zr(this.node(),e)}function zr(e,t){return e.style.getPropertyValue(t)||Em(e).getComputedStyle(e,null).getPropertyValue(t)}function Yw(e){return function(){delete this[e]}}function Xw(e,t){return function(){this[e]=t}}function Qw(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Kw(e,t){return arguments.length>1?this.each((t==null?Yw:typeof t=="function"?Qw:Xw)(e,t)):this.node()[e]}function _m(e){return e.trim().split(/^|\s+/)}function nc(e){return e.classList||new Nm(e)}function Nm(e){this._node=e,this._names=_m(e.getAttribute("class")||"")}Nm.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Cm(e,t){for(var n=nc(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Mm(e,t){for(var n=nc(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function Gw(e){return function(){Cm(this,e)}}function qw(e){return function(){Mm(this,e)}}function Zw(e,t){return function(){(t.apply(this,arguments)?Cm:Mm)(this,e)}}function Jw(e,t){var n=_m(e+"");if(arguments.length<2){for(var r=nc(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?Zw:t?Gw:qw)(n,t))}function e1(){this.textContent=""}function t1(e){return function(){this.textContent=e}}function n1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function r1(e){return arguments.length?this.each(e==null?e1:(typeof e=="function"?n1:t1)(e)):this.node().textContent}function o1(){this.innerHTML=""}function i1(e){return function(){this.innerHTML=e}}function s1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function l1(e){return arguments.length?this.each(e==null?o1:(typeof e=="function"?s1:i1)(e)):this.node().innerHTML}function a1(){this.nextSibling&&this.parentNode.appendChild(this)}function u1(){return this.each(a1)}function c1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function f1(){return this.each(c1)}function d1(e){var t=typeof e=="function"?e:vm(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function h1(){return null}function p1(e,t){var n=typeof e=="function"?e:vm(e),r=t==null?h1:typeof t=="function"?t:tc(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function m1(){var e=this.parentNode;e&&e.removeChild(this)}function g1(){return this.each(m1)}function y1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function v1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function x1(e){return this.select(e?v1:y1)}function w1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function S1(e){return function(t){e.call(this,t,this.__data__)}}function k1(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function E1(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function _1(e,t,n){return function(){var r=this.__on,o,i=S1(t);if(r){for(var s=0,l=r.length;s<l;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function N1(e,t,n){var r=k1(e+""),o,i=r.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,u=l.length,c;a<u;++a)for(o=0,c=l[a];o<i;++o)if((s=r[o]).type===c.type&&s.name===c.name)return c.value}return}for(l=t?_1:E1,o=0;o<i;++o)this.each(l(r[o],t,n));return this}function jm(e,t,n){var r=Em(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function C1(e,t){return function(){return jm(this,e,t)}}function M1(e,t){return function(){return jm(this,e,t.apply(this,arguments))}}function j1(e,t){return this.each((typeof t=="function"?M1:C1)(e,t))}function*P1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var Pm=[null];function Ke(e,t){this._groups=e,this._parents=t}function ti(){return new Ke([[document.documentElement]],Pm)}function $1(){return this}Ke.prototype=ti.prototype={constructor:Ke,select:nw,selectAll:sw,selectChild:cw,selectChildren:pw,filter:mw,data:Sw,enter:gw,exit:Ew,join:_w,merge:Nw,selection:$1,order:Cw,sort:Mw,call:Pw,nodes:$w,node:Iw,size:Tw,empty:zw,each:Lw,attr:Hw,style:Ww,property:Kw,classed:Jw,text:r1,html:l1,raise:u1,lower:f1,append:d1,insert:p1,remove:g1,clone:x1,datum:w1,on:N1,dispatch:j1,[Symbol.iterator]:P1};function We(e){return typeof e=="string"?new Ke([[document.querySelector(e)]],[document.documentElement]):new Ke([[e]],Pm)}function I1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ft(e,t){if(e=I1(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const T1={passive:!1},Do={capture:!0,passive:!1};function Vl(e){e.stopImmediatePropagation()}function _r(e){e.preventDefault(),e.stopImmediatePropagation()}function $m(e){var t=e.document.documentElement,n=We(e).on("dragstart.drag",_r,Do);"onselectstart"in t?n.on("selectstart.drag",_r,Do):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Im(e,t){var n=e.document.documentElement,r=We(e).on("dragstart.drag",null);t&&(r.on("click.drag",_r,Do),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Mi=e=>()=>e;function Ya(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:l,dx:a,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}Ya.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function z1(e){return!e.ctrlKey&&!e.button}function L1(){return this.parentNode}function b1(e,t){return t??{x:e.x,y:e.y}}function A1(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tm(){var e=z1,t=L1,n=b1,r=A1,o={},i=Js("start","drag","end"),s=0,l,a,u,c,d=0;function f(x){x.on("mousedown.drag",g).filter(r).on("touchstart.drag",k).on("touchmove.drag",m,T1).on("touchend.drag touchcancel.drag",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(x,S){if(!(c||!e.call(this,x,S))){var _=h(this,t.call(this,x,S),x,S,"mouse");_&&(We(x.view).on("mousemove.drag",v,Do).on("mouseup.drag",w,Do),$m(x.view),Vl(x),u=!1,l=x.clientX,a=x.clientY,_("start",x))}}function v(x){if(_r(x),!u){var S=x.clientX-l,_=x.clientY-a;u=S*S+_*_>d}o.mouse("drag",x)}function w(x){We(x.view).on("mousemove.drag mouseup.drag",null),Im(x.view,u),_r(x),o.mouse("end",x)}function k(x,S){if(e.call(this,x,S)){var _=x.changedTouches,N=t.call(this,x,S),C=_.length,$,D;for($=0;$<C;++$)(D=h(this,N,x,S,_[$].identifier,_[$]))&&(Vl(x),D("start",x,_[$]))}}function m(x){var S=x.changedTouches,_=S.length,N,C;for(N=0;N<_;++N)(C=o[S[N].identifier])&&(_r(x),C("drag",x,S[N]))}function p(x){var S=x.changedTouches,_=S.length,N,C;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),N=0;N<_;++N)(C=o[S[N].identifier])&&(Vl(x),C("end",x,S[N]))}function h(x,S,_,N,C,$){var D=i.copy(),R=ft($||_,S),L,O,E;if((E=n.call(x,new Ya("beforestart",{sourceEvent:_,target:f,identifier:C,active:s,x:R[0],y:R[1],dx:0,dy:0,dispatch:D}),N))!=null)return L=E.x-R[0]||0,O=E.y-R[1]||0,function z(T,A,P){var j=R,M;switch(T){case"start":o[C]=z,M=s++;break;case"end":delete o[C],--s;case"drag":R=ft(P||A,S),M=s;break}D.call(T,x,new Ya(T,{sourceEvent:A,subject:E,target:f,identifier:C,active:M,x:R[0]+L,y:R[1]+O,dx:R[0]-j[0],dy:R[1]-j[1],dispatch:D}),N)}}return f.filter=function(x){return arguments.length?(e=typeof x=="function"?x:Mi(!!x),f):e},f.container=function(x){return arguments.length?(t=typeof x=="function"?x:Mi(x),f):t},f.subject=function(x){return arguments.length?(n=typeof x=="function"?x:Mi(x),f):n},f.touchable=function(x){return arguments.length?(r=typeof x=="function"?x:Mi(!!x),f):r},f.on=function(){var x=i.on.apply(i,arguments);return x===i?f:x},f.clickDistance=function(x){return arguments.length?(d=(x=+x)*x,f):Math.sqrt(d)},f}function rc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function zm(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ni(){}var Oo=.7,Ms=1/Oo,Nr="\\s*([+-]?\\d+)\\s*",Fo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Tt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",R1=/^#([0-9a-f]{3,8})$/,D1=new RegExp(`^rgb\\(${Nr},${Nr},${Nr}\\)$`),O1=new RegExp(`^rgb\\(${Tt},${Tt},${Tt}\\)$`),F1=new RegExp(`^rgba\\(${Nr},${Nr},${Nr},${Fo}\\)$`),H1=new RegExp(`^rgba\\(${Tt},${Tt},${Tt},${Fo}\\)$`),V1=new RegExp(`^hsl\\(${Fo},${Tt},${Tt}\\)$`),B1=new RegExp(`^hsla\\(${Fo},${Tt},${Tt},${Fo}\\)$`),Ff={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};rc(ni,Yn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Hf,formatHex:Hf,formatHex8:U1,formatHsl:W1,formatRgb:Vf,toString:Vf});function Hf(){return this.rgb().formatHex()}function U1(){return this.rgb().formatHex8()}function W1(){return Lm(this).formatHsl()}function Vf(){return this.rgb().formatRgb()}function Yn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=R1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Bf(t):n===3?new Fe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ji(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ji(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=D1.exec(e))?new Fe(t[1],t[2],t[3],1):(t=O1.exec(e))?new Fe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=F1.exec(e))?ji(t[1],t[2],t[3],t[4]):(t=H1.exec(e))?ji(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=V1.exec(e))?Yf(t[1],t[2]/100,t[3]/100,1):(t=B1.exec(e))?Yf(t[1],t[2]/100,t[3]/100,t[4]):Ff.hasOwnProperty(e)?Bf(Ff[e]):e==="transparent"?new Fe(NaN,NaN,NaN,0):null}function Bf(e){return new Fe(e>>16&255,e>>8&255,e&255,1)}function ji(e,t,n,r){return r<=0&&(e=t=n=NaN),new Fe(e,t,n,r)}function Y1(e){return e instanceof ni||(e=Yn(e)),e?(e=e.rgb(),new Fe(e.r,e.g,e.b,e.opacity)):new Fe}function Xa(e,t,n,r){return arguments.length===1?Y1(e):new Fe(e,t,n,r??1)}function Fe(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}rc(Fe,Xa,zm(ni,{brighter(e){return e=e==null?Ms:Math.pow(Ms,e),new Fe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Oo:Math.pow(Oo,e),new Fe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Fe(Dn(this.r),Dn(this.g),Dn(this.b),js(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:Uf,formatHex:Uf,formatHex8:X1,formatRgb:Wf,toString:Wf}));function Uf(){return`#${zn(this.r)}${zn(this.g)}${zn(this.b)}`}function X1(){return`#${zn(this.r)}${zn(this.g)}${zn(this.b)}${zn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Wf(){const e=js(this.opacity);return`${e===1?"rgb(":"rgba("}${Dn(this.r)}, ${Dn(this.g)}, ${Dn(this.b)}${e===1?")":`, ${e})`}`}function js(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Dn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zn(e){return e=Dn(e),(e<16?"0":"")+e.toString(16)}function Yf(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new pt(e,t,n,r)}function Lm(e){if(e instanceof pt)return new pt(e.h,e.s,e.l,e.opacity);if(e instanceof ni||(e=Yn(e)),!e)return new pt;if(e instanceof pt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,l=i-o,a=(i+o)/2;return l?(t===i?s=(n-r)/l+(n<r)*6:n===i?s=(r-t)/l+2:s=(t-n)/l+4,l/=a<.5?i+o:2-i-o,s*=60):l=a>0&&a<1?0:s,new pt(s,l,a,e.opacity)}function Q1(e,t,n,r){return arguments.length===1?Lm(e):new pt(e,t,n,r??1)}function pt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}rc(pt,Q1,zm(ni,{brighter(e){return e=e==null?Ms:Math.pow(Ms,e),new pt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Oo:Math.pow(Oo,e),new pt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new Fe(Bl(e>=240?e-240:e+120,o,r),Bl(e,o,r),Bl(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new pt(Xf(this.h),Pi(this.s),Pi(this.l),js(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=js(this.opacity);return`${e===1?"hsl(":"hsla("}${Xf(this.h)}, ${Pi(this.s)*100}%, ${Pi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Xf(e){return e=(e||0)%360,e<0?e+360:e}function Pi(e){return Math.max(0,Math.min(1,e||0))}function Bl(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const oc=e=>()=>e;function K1(e,t){return function(n){return e+n*t}}function G1(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function q1(e){return(e=+e)==1?bm:function(t,n){return n-t?G1(t,n,e):oc(isNaN(t)?n:t)}}function bm(e,t){var n=t-e;return n?K1(e,n):oc(isNaN(e)?t:e)}const Ps=function e(t){var n=q1(t);function r(o,i){var s=n((o=Xa(o)).r,(i=Xa(i)).r),l=n(o.g,i.g),a=n(o.b,i.b),u=bm(o.opacity,i.opacity);return function(c){return o.r=s(c),o.g=l(c),o.b=a(c),o.opacity=u(c),o+""}}return r.gamma=e,r}(1);function Z1(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(i){for(o=0;o<n;++o)r[o]=e[o]*(1-i)+t[o]*i;return r}}function J1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function eS(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,o=new Array(r),i=new Array(n),s;for(s=0;s<r;++s)o[s]=xo(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(l){for(s=0;s<r;++s)i[s]=o[s](l);return i}}function tS(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Mt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function nS(e,t){var n={},r={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?n[o]=xo(e[o],t[o]):r[o]=t[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var Qa=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ul=new RegExp(Qa.source,"g");function rS(e){return function(){return e}}function oS(e){return function(t){return e(t)+""}}function Am(e,t){var n=Qa.lastIndex=Ul.lastIndex=0,r,o,i,s=-1,l=[],a=[];for(e=e+"",t=t+"";(r=Qa.exec(e))&&(o=Ul.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),l[s]?l[s]+=i:l[++s]=i),(r=r[0])===(o=o[0])?l[s]?l[s]+=o:l[++s]=o:(l[++s]=null,a.push({i:s,x:Mt(r,o)})),n=Ul.lastIndex;return n<t.length&&(i=t.slice(n),l[s]?l[s]+=i:l[++s]=i),l.length<2?a[0]?oS(a[0].x):rS(t):(t=a.length,function(u){for(var c=0,d;c<t;++c)l[(d=a[c]).i]=d.x(u);return l.join("")})}function xo(e,t){var n=typeof t,r;return t==null||n==="boolean"?oc(t):(n==="number"?Mt:n==="string"?(r=Yn(t))?(t=r,Ps):Am:t instanceof Yn?Ps:t instanceof Date?tS:J1(t)?Z1:Array.isArray(t)?eS:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?nS:Mt)(e,t)}var Qf=180/Math.PI,Ka={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Rm(e,t,n,r,o,i){var s,l,a;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(a=e*n+t*r)&&(n-=e*a,r-=t*a),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,a/=l),e*r<t*n&&(e=-e,t=-t,a=-a,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*Qf,skewX:Math.atan(a)*Qf,scaleX:s,scaleY:l}}var $i;function iS(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ka:Rm(t.a,t.b,t.c,t.d,t.e,t.f)}function sS(e){return e==null||($i||($i=document.createElementNS("http://www.w3.org/2000/svg","g")),$i.setAttribute("transform",e),!(e=$i.transform.baseVal.consolidate()))?Ka:(e=e.matrix,Rm(e.a,e.b,e.c,e.d,e.e,e.f))}function Dm(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,c,d,f,g,v){if(u!==d||c!==f){var w=g.push("translate(",null,t,null,n);v.push({i:w-4,x:Mt(u,d)},{i:w-2,x:Mt(c,f)})}else(d||f)&&g.push("translate("+d+t+f+n)}function s(u,c,d,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:d.push(o(d)+"rotate(",null,r)-2,x:Mt(u,c)})):c&&d.push(o(d)+"rotate("+c+r)}function l(u,c,d,f){u!==c?f.push({i:d.push(o(d)+"skewX(",null,r)-2,x:Mt(u,c)}):c&&d.push(o(d)+"skewX("+c+r)}function a(u,c,d,f,g,v){if(u!==d||c!==f){var w=g.push(o(g)+"scale(",null,",",null,")");v.push({i:w-4,x:Mt(u,d)},{i:w-2,x:Mt(c,f)})}else(d!==1||f!==1)&&g.push(o(g)+"scale("+d+","+f+")")}return function(u,c){var d=[],f=[];return u=e(u),c=e(c),i(u.translateX,u.translateY,c.translateX,c.translateY,d,f),s(u.rotate,c.rotate,d,f),l(u.skewX,c.skewX,d,f),a(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,f),u=c=null,function(g){for(var v=-1,w=f.length,k;++v<w;)d[(k=f[v]).i]=k.x(g);return d.join("")}}}var lS=Dm(iS,"px, ","px)","deg)"),aS=Dm(sS,", ",")",")"),uS=1e-12;function Kf(e){return((e=Math.exp(e))+1/e)/2}function cS(e){return((e=Math.exp(e))-1/e)/2}function fS(e){return((e=Math.exp(2*e))-1)/(e+1)}const Gi=function e(t,n,r){function o(i,s){var l=i[0],a=i[1],u=i[2],c=s[0],d=s[1],f=s[2],g=c-l,v=d-a,w=g*g+v*v,k,m;if(w<uS)m=Math.log(f/u)/t,k=function(N){return[l+N*g,a+N*v,u*Math.exp(t*N*m)]};else{var p=Math.sqrt(w),h=(f*f-u*u+r*w)/(2*u*n*p),x=(f*f-u*u-r*w)/(2*f*n*p),S=Math.log(Math.sqrt(h*h+1)-h),_=Math.log(Math.sqrt(x*x+1)-x);m=(_-S)/t,k=function(N){var C=N*m,$=Kf(S),D=u/(n*p)*($*fS(t*C+S)-cS(S));return[l+D*g,a+D*v,u*$/Kf(t*C+S)]}}return k.duration=m*1e3*t/Math.SQRT2,k}return o.rho=function(i){var s=Math.max(.001,+i),l=s*s,a=l*l;return e(s,l,a)},o}(Math.SQRT2,2,4);var Lr=0,lo=0,to=0,Om=1e3,$s,ao,Is=0,Xn=0,tl=0,Ho=typeof performance=="object"&&performance.now?performance:Date,Fm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function ic(){return Xn||(Fm(dS),Xn=Ho.now()+tl)}function dS(){Xn=0}function Ts(){this._call=this._time=this._next=null}Ts.prototype=Hm.prototype={constructor:Ts,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?ic():+n)+(t==null?0:+t),!this._next&&ao!==this&&(ao?ao._next=this:$s=this,ao=this),this._call=e,this._time=n,Ga()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ga())}};function Hm(e,t,n){var r=new Ts;return r.restart(e,t,n),r}function hS(){ic(),++Lr;for(var e=$s,t;e;)(t=Xn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Lr}function Gf(){Xn=(Is=Ho.now())+tl,Lr=lo=0;try{hS()}finally{Lr=0,mS(),Xn=0}}function pS(){var e=Ho.now(),t=e-Is;t>Om&&(tl-=t,Is=e)}function mS(){for(var e,t=$s,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:$s=n);ao=e,Ga(r)}function Ga(e){if(!Lr){lo&&(lo=clearTimeout(lo));var t=e-Xn;t>24?(e<1/0&&(lo=setTimeout(Gf,e-Ho.now()-tl)),to&&(to=clearInterval(to))):(to||(Is=Ho.now(),to=setInterval(pS,Om)),Lr=1,Fm(Gf))}}function qf(e,t,n){var r=new Ts;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var gS=Js("start","end","cancel","interrupt"),yS=[],Vm=0,Zf=1,qa=2,qi=3,Jf=4,Za=5,Zi=6;function nl(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;vS(e,n,{name:t,index:r,group:o,on:gS,tween:yS,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Vm})}function sc(e,t){var n=St(e,t);if(n.state>Vm)throw new Error("too late; already scheduled");return n}function zt(e,t){var n=St(e,t);if(n.state>qi)throw new Error("too late; already running");return n}function St(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function vS(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=Hm(i,0,n.time);function i(u){n.state=Zf,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,f,g;if(n.state!==Zf)return a();for(c in r)if(g=r[c],g.name===n.name){if(g.state===qi)return qf(s);g.state===Jf?(g.state=Zi,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[c]):+c<t&&(g.state=Zi,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[c])}if(qf(function(){n.state===qi&&(n.state=Jf,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=qa,n.on.call("start",e,e.__data__,n.index,n.group),n.state===qa){for(n.state=qi,o=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(g=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++d]=g);o.length=d+1}}function l(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=Za,1),d=-1,f=o.length;++d<f;)o[d].call(e,c);n.state===Za&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Zi,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Ji(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>qa&&r.state<Za,r.state=Zi,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function xS(e){return this.each(function(){Ji(this,e)})}function wS(e,t){var n,r;return function(){var o=zt(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,l=r.length;s<l;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function SS(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=zt(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var l={name:t,value:n},a=0,u=o.length;a<u;++a)if(o[a].name===t){o[a]=l;break}a===u&&o.push(l)}i.tween=o}}function kS(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=St(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?wS:SS)(n,e,t))}function lc(e,t,n){var r=e._id;return e.each(function(){var o=zt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return St(o,r).value[t]}}function Bm(e,t){var n;return(typeof t=="number"?Mt:t instanceof Yn?Ps:(n=Yn(t))?(t=n,Ps):Am)(e,t)}function ES(e){return function(){this.removeAttribute(e)}}function _S(e){return function(){this.removeAttributeNS(e.space,e.local)}}function NS(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function CS(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function MS(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function jS(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function PS(e,t){var n=el(e),r=n==="transform"?aS:Bm;return this.attrTween(e,typeof t=="function"?(n.local?jS:MS)(n,r,lc(this,"attr."+e,t)):t==null?(n.local?_S:ES)(n):(n.local?CS:NS)(n,r,t))}function $S(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function IS(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function TS(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&IS(e,i)),n}return o._value=t,o}function zS(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&$S(e,i)),n}return o._value=t,o}function LS(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=el(e);return this.tween(n,(r.local?TS:zS)(r,t))}function bS(e,t){return function(){sc(this,e).delay=+t.apply(this,arguments)}}function AS(e,t){return t=+t,function(){sc(this,e).delay=t}}function RS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?bS:AS)(t,e)):St(this.node(),t).delay}function DS(e,t){return function(){zt(this,e).duration=+t.apply(this,arguments)}}function OS(e,t){return t=+t,function(){zt(this,e).duration=t}}function FS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?DS:OS)(t,e)):St(this.node(),t).duration}function HS(e,t){if(typeof t!="function")throw new Error;return function(){zt(this,e).ease=t}}function VS(e){var t=this._id;return arguments.length?this.each(HS(t,e)):St(this.node(),t).ease}function BS(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;zt(this,e).ease=n}}function US(e){if(typeof e!="function")throw new Error;return this.each(BS(this._id,e))}function WS(e){typeof e!="function"&&(e=wm(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new Gt(r,this._parents,this._name,this._id)}function YS(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),l=0;l<i;++l)for(var a=t[l],u=n[l],c=a.length,d=s[l]=new Array(c),f,g=0;g<c;++g)(f=a[g]||u[g])&&(d[g]=f);for(;l<r;++l)s[l]=t[l];return new Gt(s,this._parents,this._name,this._id)}function XS(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function QS(e,t,n){var r,o,i=XS(t)?sc:zt;return function(){var s=i(this,e),l=s.on;l!==r&&(o=(r=l).copy()).on(t,n),s.on=o}}function KS(e,t){var n=this._id;return arguments.length<2?St(this.node(),n).on.on(e):this.each(QS(n,e,t))}function GS(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function qS(){return this.on("end.remove",GS(this._id))}function ZS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=tc(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var l=r[s],a=l.length,u=i[s]=new Array(a),c,d,f=0;f<a;++f)(c=l[f])&&(d=e.call(c,c.__data__,f,l))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,nl(u[f],t,n,f,u,St(c,n)));return new Gt(i,this._parents,t,n)}function JS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=xm(e));for(var r=this._groups,o=r.length,i=[],s=[],l=0;l<o;++l)for(var a=r[l],u=a.length,c,d=0;d<u;++d)if(c=a[d]){for(var f=e.call(c,c.__data__,d,a),g,v=St(c,n),w=0,k=f.length;w<k;++w)(g=f[w])&&nl(g,t,n,w,f,v);i.push(f),s.push(c)}return new Gt(i,s,t,n)}var ek=ti.prototype.constructor;function tk(){return new ek(this._groups,this._parents)}function nk(e,t){var n,r,o;return function(){var i=zr(this,e),s=(this.style.removeProperty(e),zr(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function Um(e){return function(){this.style.removeProperty(e)}}function rk(e,t,n){var r,o=n+"",i;return function(){var s=zr(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function ok(e,t,n){var r,o,i;return function(){var s=zr(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),zr(this,e))),s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l))}}function ik(e,t){var n,r,o,i="style."+t,s="end."+i,l;return function(){var a=zt(this,e),u=a.on,c=a.value[i]==null?l||(l=Um(t)):void 0;(u!==n||o!==c)&&(r=(n=u).copy()).on(s,o=c),a.on=r}}function sk(e,t,n){var r=(e+="")=="transform"?lS:Bm;return t==null?this.styleTween(e,nk(e,r)).on("end.style."+e,Um(e)):typeof t=="function"?this.styleTween(e,ok(e,r,lc(this,"style."+e,t))).each(ik(this._id,e)):this.styleTween(e,rk(e,r,t),n).on("end.style."+e,null)}function lk(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function ak(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&lk(e,s,n)),r}return i._value=t,i}function uk(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,ak(e,t,n??""))}function ck(e){return function(){this.textContent=e}}function fk(e){return function(){var t=e(this);this.textContent=t??""}}function dk(e){return this.tween("text",typeof e=="function"?fk(lc(this,"text",e)):ck(e==null?"":e+""))}function hk(e){return function(t){this.textContent=e.call(this,t)}}function pk(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&hk(o)),t}return r._value=e,r}function mk(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,pk(e))}function gk(){for(var e=this._name,t=this._id,n=Wm(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,a,u=0;u<l;++u)if(a=s[u]){var c=St(a,t);nl(a,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Gt(r,this._parents,e,n)}function yk(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var l={value:s},a={value:function(){--o===0&&i()}};n.each(function(){var u=zt(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),u.on=t}),o===0&&i()})}var vk=0;function Gt(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Wm(){return++vk}var Rt=ti.prototype;Gt.prototype={constructor:Gt,select:ZS,selectAll:JS,selectChild:Rt.selectChild,selectChildren:Rt.selectChildren,filter:WS,merge:YS,selection:tk,transition:gk,call:Rt.call,nodes:Rt.nodes,node:Rt.node,size:Rt.size,empty:Rt.empty,each:Rt.each,on:KS,attr:PS,attrTween:LS,style:sk,styleTween:uk,text:dk,textTween:mk,remove:qS,tween:kS,delay:RS,duration:FS,ease:VS,easeVarying:US,end:yk,[Symbol.iterator]:Rt[Symbol.iterator]};function xk(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var wk={time:null,delay:0,duration:250,ease:xk};function Sk(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function kk(e){var t,n;e instanceof Gt?(t=e._id,e=e._name):(t=Wm(),(n=wk).time=ic(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&nl(a,e,t,u,s,n||Sk(a,t));return new Gt(r,this._parents,e,t)}ti.prototype.interrupt=xS;ti.prototype.transition=kk;const Ii=e=>()=>e;function Ek(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function Bt(e,t,n){this.k=e,this.x=t,this.y=n}Bt.prototype={constructor:Bt,scale:function(e){return e===1?this:new Bt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Bt(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var rl=new Bt(1,0,0);Ym.prototype=Bt.prototype;function Ym(e){for(;!e.__zoom;)if(!(e=e.parentNode))return rl;return e.__zoom}function Wl(e){e.stopImmediatePropagation()}function no(e){e.preventDefault(),e.stopImmediatePropagation()}function _k(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Nk(){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 ed(){return this.__zoom||rl}function Ck(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Mk(){return navigator.maxTouchPoints||"ontouchstart"in this}function jk(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function Xm(){var e=_k,t=Nk,n=jk,r=Ck,o=Mk,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,a=Gi,u=Js("start","zoom","end"),c,d,f,g=500,v=150,w=0,k=10;function m(E){E.property("__zoom",ed).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",D).filter(o).on("touchstart.zoom",R).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(E,z,T,A){var P=E.selection?E.selection():E;P.property("__zoom",ed),E!==P?S(E,z,T,A):P.interrupt().each(function(){_(this,arguments).event(A).start().zoom(null,typeof z=="function"?z.apply(this,arguments):z).end()})},m.scaleBy=function(E,z,T,A){m.scaleTo(E,function(){var P=this.__zoom.k,j=typeof z=="function"?z.apply(this,arguments):z;return P*j},T,A)},m.scaleTo=function(E,z,T,A){m.transform(E,function(){var P=t.apply(this,arguments),j=this.__zoom,M=T==null?x(P):typeof T=="function"?T.apply(this,arguments):T,b=j.invert(M),F=typeof z=="function"?z.apply(this,arguments):z;return n(h(p(j,F),M,b),P,s)},T,A)},m.translateBy=function(E,z,T,A){m.transform(E,function(){return n(this.__zoom.translate(typeof z=="function"?z.apply(this,arguments):z,typeof T=="function"?T.apply(this,arguments):T),t.apply(this,arguments),s)},null,A)},m.translateTo=function(E,z,T,A,P){m.transform(E,function(){var j=t.apply(this,arguments),M=this.__zoom,b=A==null?x(j):typeof A=="function"?A.apply(this,arguments):A;return n(rl.translate(b[0],b[1]).scale(M.k).translate(typeof z=="function"?-z.apply(this,arguments):-z,typeof T=="function"?-T.apply(this,arguments):-T),j,s)},A,P)};function p(E,z){return z=Math.max(i[0],Math.min(i[1],z)),z===E.k?E:new Bt(z,E.x,E.y)}function h(E,z,T){var A=z[0]-T[0]*E.k,P=z[1]-T[1]*E.k;return A===E.x&&P===E.y?E:new Bt(E.k,A,P)}function x(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function S(E,z,T,A){E.on("start.zoom",function(){_(this,arguments).event(A).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(A).end()}).tween("zoom",function(){var P=this,j=arguments,M=_(P,j).event(A),b=t.apply(P,j),F=T==null?x(b):typeof T=="function"?T.apply(P,j):T,W=Math.max(b[1][0]-b[0][0],b[1][1]-b[0][1]),B=P.__zoom,G=typeof z=="function"?z.apply(P,j):z,q=a(B.invert(F).concat(W/B.k),G.invert(F).concat(W/G.k));return function(Q){if(Q===1)Q=G;else{var H=q(Q),U=W/H[2];Q=new Bt(U,F[0]-H[0]*U,F[1]-H[1]*U)}M.zoom(null,Q)}})}function _(E,z,T){return!T&&E.__zooming||new N(E,z)}function N(E,z){this.that=E,this.args=z,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,z),this.taps=0}N.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,z){return this.mouse&&E!=="mouse"&&(this.mouse[1]=z.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=z.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=z.invert(this.touch1[0])),this.that.__zoom=z,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var z=We(this.that).datum();u.call(E,this.that,new Ek(E,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:u}),z)}};function C(E,...z){if(!e.apply(this,arguments))return;var T=_(this,z).event(E),A=this.__zoom,P=Math.max(i[0],Math.min(i[1],A.k*Math.pow(2,r.apply(this,arguments)))),j=ft(E);if(T.wheel)(T.mouse[0][0]!==j[0]||T.mouse[0][1]!==j[1])&&(T.mouse[1]=A.invert(T.mouse[0]=j)),clearTimeout(T.wheel);else{if(A.k===P)return;T.mouse=[j,A.invert(j)],Ji(this),T.start()}no(E),T.wheel=setTimeout(M,v),T.zoom("mouse",n(h(p(A,P),T.mouse[0],T.mouse[1]),T.extent,s));function M(){T.wheel=null,T.end()}}function $(E,...z){if(f||!e.apply(this,arguments))return;var T=E.currentTarget,A=_(this,z,!0).event(E),P=We(E.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",W,!0),j=ft(E,T),M=E.clientX,b=E.clientY;$m(E.view),Wl(E),A.mouse=[j,this.__zoom.invert(j)],Ji(this),A.start();function F(B){if(no(B),!A.moved){var G=B.clientX-M,q=B.clientY-b;A.moved=G*G+q*q>w}A.event(B).zoom("mouse",n(h(A.that.__zoom,A.mouse[0]=ft(B,T),A.mouse[1]),A.extent,s))}function W(B){P.on("mousemove.zoom mouseup.zoom",null),Im(B.view,A.moved),no(B),A.event(B).end()}}function D(E,...z){if(e.apply(this,arguments)){var T=this.__zoom,A=ft(E.changedTouches?E.changedTouches[0]:E,this),P=T.invert(A),j=T.k*(E.shiftKey?.5:2),M=n(h(p(T,j),A,P),t.apply(this,z),s);no(E),l>0?We(this).transition().duration(l).call(S,M,A,E):We(this).call(m.transform,M,A,E)}}function R(E,...z){if(e.apply(this,arguments)){var T=E.touches,A=T.length,P=_(this,z,E.changedTouches.length===A).event(E),j,M,b,F;for(Wl(E),M=0;M<A;++M)b=T[M],F=ft(b,this),F=[F,this.__zoom.invert(F),b.identifier],P.touch0?!P.touch1&&P.touch0[2]!==F[2]&&(P.touch1=F,P.taps=0):(P.touch0=F,j=!0,P.taps=1+!!c);c&&(c=clearTimeout(c)),j&&(P.taps<2&&(d=F[0],c=setTimeout(function(){c=null},g)),Ji(this),P.start())}}function L(E,...z){if(this.__zooming){var T=_(this,z).event(E),A=E.changedTouches,P=A.length,j,M,b,F;for(no(E),j=0;j<P;++j)M=A[j],b=ft(M,this),T.touch0&&T.touch0[2]===M.identifier?T.touch0[0]=b:T.touch1&&T.touch1[2]===M.identifier&&(T.touch1[0]=b);if(M=T.that.__zoom,T.touch1){var W=T.touch0[0],B=T.touch0[1],G=T.touch1[0],q=T.touch1[1],Q=(Q=G[0]-W[0])*Q+(Q=G[1]-W[1])*Q,H=(H=q[0]-B[0])*H+(H=q[1]-B[1])*H;M=p(M,Math.sqrt(Q/H)),b=[(W[0]+G[0])/2,(W[1]+G[1])/2],F=[(B[0]+q[0])/2,(B[1]+q[1])/2]}else if(T.touch0)b=T.touch0[0],F=T.touch0[1];else return;T.zoom("touch",n(h(M,b,F),T.extent,s))}}function O(E,...z){if(this.__zooming){var T=_(this,z).event(E),A=E.changedTouches,P=A.length,j,M;for(Wl(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},g),j=0;j<P;++j)M=A[j],T.touch0&&T.touch0[2]===M.identifier?delete T.touch0:T.touch1&&T.touch1[2]===M.identifier&&delete T.touch1;if(T.touch1&&!T.touch0&&(T.touch0=T.touch1,delete T.touch1),T.touch0)T.touch0[1]=this.__zoom.invert(T.touch0[0]);else if(T.end(),T.taps===2&&(M=ft(M,this),Math.hypot(d[0]-M[0],d[1]-M[1])<k)){var b=We(this).on("dblclick.zoom");b&&b.apply(this,arguments)}}}return m.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:Ii(+E),m):r},m.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Ii(!!E),m):e},m.touchable=function(E){return arguments.length?(o=typeof E=="function"?E:Ii(!!E),m):o},m.extent=function(E){return arguments.length?(t=typeof E=="function"?E:Ii([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),m):t},m.scaleExtent=function(E){return arguments.length?(i[0]=+E[0],i[1]=+E[1],m):[i[0],i[1]]},m.translateExtent=function(E){return arguments.length?(s[0][0]=+E[0][0],s[1][0]=+E[1][0],s[0][1]=+E[0][1],s[1][1]=+E[1][1],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(E){return arguments.length?(n=E,m):n},m.duration=function(E){return arguments.length?(l=+E,m):l},m.interpolate=function(E){return arguments.length?(a=E,m):a},m.on=function(){var E=u.on.apply(u,arguments);return E===u?m:E},m.clickDistance=function(E){return arguments.length?(w=(E=+E)*E,m):Math.sqrt(w)},m.tapDistance=function(E){return arguments.length?(k=+E,m):k},m}const wt={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Vo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Qm=["Enter"," ","Escape"],Km={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var br;(function(e){e.Strict="strict",e.Loose="loose"})(br||(br={}));var On;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(On||(On={}));var Bo;(function(e){e.Partial="partial",e.Full="full"})(Bo||(Bo={}));const Gm={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ln;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ln||(ln={}));var Uo;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Uo||(Uo={}));var X;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(X||(X={}));const td={[X.Left]:X.Right,[X.Right]:X.Left,[X.Top]:X.Bottom,[X.Bottom]:X.Top},qm=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,Pk=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),ac=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ri=(e,t=[0,0])=>{const{width:n,height:r}=kt(e),o=e.origin??t,i=n*o[0],s=r*o[1];return{x:e.position.x-i,y:e.position.y-s}},$k=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1;const r=e.reduce((o,i)=>{const s=typeof i=="string";let l=!t.nodeLookup&&!s?i:void 0;return t.nodeLookup&&(l=s?t.nodeLookup.get(i):ac(i)?i:t.nodeLookup.get(i.id)),l?(n=!0,ol(o,zs(l,t.nodeOrigin))):o},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?il(r):{x:0,y:0,width:0,height:0}},oi=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(n=ol(n,zs(o)),r=!0)}),r?il(n):{x:0,y:0,width:0,height:0}},uc=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1)=>{const l=(t.x-n)/o,a=(t.y-r)/o,u=t.width/o,c=t.height/o,d=[];for(const f of e.values()){const{measured:g,selectable:v=!0,hidden:w=!1}=f;if(s&&!v||w)continue;const k=g.width??f.width??f.initialWidth??0,m=g.height??f.height??f.initialHeight??0,{x:p,y:h}=f.internals.positionAbsolute,x=tg(l,a,u,c,p,h,k,m),S=k*m,_=i&&x>0;(!f.internals.handleBounds||_||x>=S||f.dragging)&&d.push(f)}return d},Ik=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Tk(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{let i;if(t!=null&&t.includeHiddenNodes){const{width:s,height:l}=kt(o);i=s>0&&l>0}else i=!!(o.measured.width&&o.measured.height&&!o.hidden);i&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function zk({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return!0;const l=Tk(e,s),a=oi(l),u=fc(a,t,n,(s==null?void 0:s.minZoom)??o,(s==null?void 0:s.maxZoom)??i,(s==null?void 0:s.padding)??.1);return await r.setViewport(u,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),!0}function Zm({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){const s=n.get(e),l=s.parentId?n.get(s.parentId):void 0,{x:a,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},c=s.origin??r;let d=s.extent||o;if(s.extent==="parent"&&!s.expandParent)if(!l)i==null||i("005",wt.error005());else{const{width:g,height:v}=kt(l);g&&v&&(d=[[a,u],[a+g,u+v]])}else l&&Kn(s.extent)&&(d=[[s.extent[0][0]+a,s.extent[0][1]+u],[s.extent[1][0]+a,s.extent[1][1]+u]]);const f=Kn(d)?Qn(t,d,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",wt.error015())),{position:{x:f.x-a+(s.measured.width??0)*c[0],y:f.y-u+(s.measured.height??0)*c[1]},positionAbsolute:f}}async function Lk({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const g=i.has(f.id),v=!g&&f.parentId&&s.find(w=>w.id===f.parentId);(g||v)&&s.push(f)}const l=new Set(t.map(f=>f.id)),a=r.filter(f=>f.deletable!==!1),c=Ik(s,a);for(const f of a)l.has(f.id)&&!c.find(v=>v.id===f.id)&&c.push(f);if(!o)return{edges:c,nodes:s};const d=await o({nodes:s,edges:c});return typeof d=="boolean"?d?{edges:c,nodes:s}:{edges:[],nodes:[]}:d}const Ar=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Qn=(e={x:0,y:0},t,n)=>({x:Ar(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Ar(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Jm(e,t,n){const{width:r,height:o}=kt(n),{x:i,y:s}=n.internals.positionAbsolute;return Qn(e,[[i,s],[i+r,s+o]],t)}const nd=(e,t,n)=>e<t?Ar(Math.abs(e-t),1,t)/t:e>n?-Ar(Math.abs(e-n),1,t)/t:0,cc=(e,t,n=15,r=40)=>{const o=nd(e.x,r,t.width-r)*n,i=nd(e.y,r,t.height-r)*n;return[o,i]},ol=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Ja=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),il=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Wo=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=ac(e)?e.internals.positionAbsolute:ri(e,t);return{x:n,y:r,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},zs=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=ac(e)?e.internals.positionAbsolute:ri(e,t);return{x:n,y:r,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},eg=(e,t)=>il(ol(Ja(e),Ja(t))),tg=(e,t,n,r,o,i,s,l)=>{const a=Math.max(0,Math.min(e+n,o+s)-Math.max(e,o)),u=Math.max(0,Math.min(t+r,i+l)-Math.max(t,i));return Math.ceil(a*u)},Ls=(e,t)=>tg(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),rd=e=>mt(e.width)&&mt(e.height)&&mt(e.x)&&mt(e.y),mt=e=>!isNaN(e)&&isFinite(e),ng=(e,t)=>(n,r)=>{},ii=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),si=({x:e,y:t},[n,r,o],i=!1,s=[1,1])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?ii(l,s):l},Rr=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function er(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function bk(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=er(e,n),o=er(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=er(e.top??e.y??0,n),o=er(e.bottom??e.y??0,n),i=er(e.left??e.x??0,t),s=er(e.right??e.x??0,t);return{top:r,right:s,bottom:o,left:i,x:i+s,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Ak(e,t,n,r,o,i){const{x:s,y:l}=Rr(e,[t,n,r]),{x:a,y:u}=Rr({x:e.x+e.width,y:e.y+e.height},[t,n,r]),c=o-a,d=i-u;return{left:Math.floor(s),top:Math.floor(l),right:Math.floor(c),bottom:Math.floor(d)}}const fc=(e,t,n,r,o,i)=>{const s=bk(i,t,n),l=(t-s.x)/e.width,a=(n-s.y)/e.height,u=Math.min(l,a),c=Ar(u,r,o),d=e.x+e.width/2,f=e.y+e.height/2,g=t/2-d*c,v=n/2-f*c,w=Ak(e,g,v,c,t,n),k={left:Math.min(w.left-s.left,0),top:Math.min(w.top-s.top,0),right:Math.min(w.right-s.right,0),bottom:Math.min(w.bottom-s.bottom,0)};return{x:g-k.left+k.right,y:v-k.top+k.bottom,zoom:c}},Yo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Kn(e){return e!=null&&e!=="parent"}function kt(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function rg(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function og(e,t={width:0,height:0},n,r,o){const i={...e},s=r.get(n);if(s){const l=s.origin||o;i.x+=s.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function od(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Rk(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function Dk(e){return{...Km,...e||{}}}function ig(e){return e===null?null:e?"valid":"invalid"}function wo(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:s}=gt(e),l=si({x:i-((o==null?void 0:o.left)??0),y:s-((o==null?void 0:o.top)??0)},r),{x:a,y:u}=n?ii(l,t):l;return{xSnapped:a,ySnapped:u,...l}}const dc=e=>({width:e.offsetWidth,height:e.offsetHeight}),sg=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Ok=["INPUT","SELECT","TEXTAREA"];function lg(e){var r,o;const t=((o=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:Ok.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const ag=e=>"clientX"in e,gt=(e,t)=>{var i,s;const n=ag(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},id=(e,t,n,r,o)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const l=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:o,position:s.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...dc(s)}})};function ug({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:l}){const a=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+l*.375+r*.125,c=Math.abs(a-e),d=Math.abs(u-t);return[a,u,c,d]}function Ti(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function sd({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case X.Left:return[t-Ti(t-r,i),n];case X.Right:return[t+Ti(r-t,i),n];case X.Top:return[t,n-Ti(n-o,i)];case X.Bottom:return[t,n+Ti(o-n,i)]}}function hc({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:o,targetPosition:i=X.Top,curvature:s=.25}){const[l,a]=sd({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,c]=sd({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[d,f,g,v]=ug({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:a,targetControlX:u,targetControlY:c});return[`M${e},${t} C${l},${a} ${u},${c} ${r},${o}`,d,f,g,v]}function cg({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,l=r<t?r+s:r-s;return[i,l,o,s]}function Fk({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:i="basic"}){if(i==="manual")return r;const s=o&&n?r+1e3:r,l=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return s+l}function Hk({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=ol(zs(e),zs(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return Ls(s,il(i))>0}const Vk=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,Bk=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Uk=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",wt.error006()),t;const r=n.getEdgeId||Vk;let o;return qm(e)?o={...e}:o={...e,id:r(e)},Bk(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function fg({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,l]=cg({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,l]}const ld={[X.Left]:{x:-1,y:0},[X.Right]:{x:1,y:0},[X.Top]:{x:0,y:-1},[X.Bottom]:{x:0,y:1}},Wk=({source:e,sourcePosition:t=X.Bottom,target:n})=>t===X.Left||t===X.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},ad=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Yk({source:e,sourcePosition:t=X.Bottom,target:n,targetPosition:r=X.Top,center:o,offset:i,stepPosition:s}){const l=ld[t],a=ld[r],u={x:e.x+l.x*i,y:e.y+l.y*i},c={x:n.x+a.x*i,y:n.y+a.y*i},d=Wk({source:u,sourcePosition:t,target:c}),f=d.x!==0?"x":"y",g=d[f];let v=[],w,k;const m={x:0,y:0},p={x:0,y:0},[,,h,x]=cg({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[f]*a[f]===-1){f==="x"?(w=o.x??u.x+(c.x-u.x)*s,k=o.y??(u.y+c.y)/2):(w=o.x??(u.x+c.x)/2,k=o.y??u.y+(c.y-u.y)*s);const C=[{x:w,y:u.y},{x:w,y:c.y}],$=[{x:u.x,y:k},{x:c.x,y:k}];l[f]===g?v=f==="x"?C:$:v=f==="x"?$:C}else{const C=[{x:u.x,y:c.y}],$=[{x:c.x,y:u.y}];if(f==="x"?v=l.x===g?$:C:v=l.y===g?C:$,t===r){const E=Math.abs(e[f]-n[f]);if(E<=i){const z=Math.min(i-1,i-E);l[f]===g?m[f]=(u[f]>e[f]?-1:1)*z:p[f]=(c[f]>n[f]?-1:1)*z}}if(t!==r){const E=f==="x"?"y":"x",z=l[f]===a[E],T=u[E]>c[E],A=u[E]<c[E];(l[f]===1&&(!z&&T||z&&A)||l[f]!==1&&(!z&&A||z&&T))&&(v=f==="x"?C:$)}const D={x:u.x+m.x,y:u.y+m.y},R={x:c.x+p.x,y:c.y+p.y},L=Math.max(Math.abs(D.x-v[0].x),Math.abs(R.x-v[0].x)),O=Math.max(Math.abs(D.y-v[0].y),Math.abs(R.y-v[0].y));L>=O?(w=(D.x+R.x)/2,k=v[0].y):(w=v[0].x,k=(D.y+R.y)/2)}const S={x:u.x+m.x,y:u.y+m.y},_={x:c.x+p.x,y:c.y+p.y};return[[e,...S.x!==v[0].x||S.y!==v[0].y?[S]:[],...v,..._.x!==v[v.length-1].x||_.y!==v[v.length-1].y?[_]:[],n],w,k,h,x]}function Xk(e,t,n,r){const o=Math.min(ad(e,t)/2,ad(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${i+o*u},${s}Q ${i},${s} ${i},${s+o*c}`}const l=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${i},${s+o*a}Q ${i},${s} ${i+o*l},${s}`}function eu({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:o,targetPosition:i=X.Top,borderRadius:s=5,centerX:l,centerY:a,offset:u=20,stepPosition:c=.5}){const[d,f,g,v,w]=Yk({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:l,y:a},offset:u,stepPosition:c});let k=`M${d[0].x} ${d[0].y}`;for(let m=1;m<d.length-1;m++)k+=Xk(d[m-1],d[m],d[m+1],s);return k+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[k,f,g,v,w]}function ud(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Qk(e){var d;const{sourceNode:t,targetNode:n}=e;if(!ud(t)||!ud(n))return null;const r=t.internals.handleBounds||cd(t.handles),o=n.internals.handleBounds||cd(n.handles),i=fd((r==null?void 0:r.source)??[],e.sourceHandle),s=fd(e.connectionMode===br.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!i||!s)return(d=e.onError)==null||d.call(e,"008",wt.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(i==null?void 0:i.position)||X.Bottom,a=(s==null?void 0:s.position)||X.Top,u=Gn(t,i,l),c=Gn(n,s,a);return{sourceX:u.x,sourceY:u.y,targetX:c.x,targetY:c.y,sourcePosition:l,targetPosition:a}}function cd(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Gn(e,t,n=X.Left,r=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:l}=t??kt(e);if(r)return{x:o+s/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case X.Top:return{x:o+s/2,y:i};case X.Right:return{x:o+s,y:i+l/2};case X.Bottom:return{x:o+s/2,y:i+l};case X.Left:return{x:o,y:i+l/2}}}function fd(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function tu(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Kk(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const i=new Set;return e.reduce((s,l)=>([l.markerStart||r,l.markerEnd||o].forEach(a=>{if(a&&typeof a=="object"){const u=tu(a,t);i.has(u)||(s.push({id:u,color:a.color||n,...a}),i.add(u))}}),s),[]).sort((s,l)=>s.id.localeCompare(l.id))}const dg=1e3,Gk=10,pc={nodeOrigin:[0,0],nodeExtent:Vo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},qk={...pc,checkEquality:!0};function mc(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Zk(e,t,n){const r=mc(pc,n);for(const o of e.values())if(o.parentId)yc(o,e,t,r);else{const i=ri(o,r.nodeOrigin),s=Kn(o.extent)?o.extent:r.nodeExtent,l=Qn(i,s,kt(o));o.internals.positionAbsolute=l}}function Jk(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const o of e.handles){const i={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(i):o.type==="target"&&r.push(i)}return{source:n,target:r}}function gc(e){return e==="manual"}function nu(e,t,n,r={}){var c,d;const o=mc(qk,r),i={i:0},s=new Map(t),l=o!=null&&o.elevateNodesOnSelect&&!gc(o.zIndexMode)?dg:0;let a=e.length>0,u=!1;t.clear(),n.clear();for(const f of e){let g=s.get(f.id);if(o.checkEquality&&f===(g==null?void 0:g.internals.userNode))t.set(f.id,g);else{const v=ri(f,o.nodeOrigin),w=Kn(f.extent)?f.extent:o.nodeExtent,k=Qn(v,w,kt(f));g={...o.defaults,...f,measured:{width:(c=f.measured)==null?void 0:c.width,height:(d=f.measured)==null?void 0:d.height},internals:{positionAbsolute:k,handleBounds:Jk(f,g),z:hg(f,l,o.zIndexMode),userNode:f}},t.set(f.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(a=!1),f.parentId&&yc(g,t,n,r,i),u||(u=f.selected??!1)}return{nodesInitialized:a,hasSelectedNodes:u}}function eE(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function yc(e,t,n,r,o){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:l,zIndexMode:a}=mc(pc,r),u=e.parentId,c=t.get(u);if(!c){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}eE(e,n),o&&!c.parentId&&c.internals.rootParentIndex===void 0&&a==="auto"&&(c.internals.rootParentIndex=++o.i,c.internals.z=c.internals.z+o.i*Gk),o&&c.internals.rootParentIndex!==void 0&&(o.i=c.internals.rootParentIndex);const d=i&&!gc(a)?dg:0,{x:f,y:g,z:v}=tE(e,c,s,l,d,a),{positionAbsolute:w}=e.internals,k=f!==w.x||g!==w.y;(k||v!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:k?{x:f,y:g}:w,z:v}})}function hg(e,t,n){const r=mt(e.zIndex)?e.zIndex:0;return gc(n)?r:r+(e.selected?t:0)}function tE(e,t,n,r,o,i){const{x:s,y:l}=t.internals.positionAbsolute,a=kt(e),u=ri(e,n),c=Kn(e.extent)?Qn(u,e.extent,a):u;let d=Qn({x:s+c.x,y:l+c.y},r,a);e.extent==="parent"&&(d=Jm(d,a,t));const f=hg(e,o,i),g=t.internals.z??0;return{x:d.x,y:d.y,z:g>=f?g+1:f}}function vc(e,t,n,r=[0,0]){var s;const o=[],i=new Map;for(const l of e){const a=t.get(l.parentId);if(!a)continue;const u=((s=i.get(l.parentId))==null?void 0:s.expandedRect)??Wo(a),c=eg(u,l.rect);i.set(l.parentId,{expandedRect:c,parent:a})}return i.size>0&&i.forEach(({expandedRect:l,parent:a},u)=>{var h;const c=a.internals.positionAbsolute,d=kt(a),f=a.origin??r,g=l.x<c.x?Math.round(Math.abs(c.x-l.x)):0,v=l.y<c.y?Math.round(Math.abs(c.y-l.y)):0,w=Math.max(d.width,Math.round(l.width)),k=Math.max(d.height,Math.round(l.height)),m=(w-d.width)*f[0],p=(k-d.height)*f[1];(g>0||v>0||m||p)&&(o.push({id:u,type:"position",position:{x:a.position.x-g+m,y:a.position.y-v+p}}),(h=n.get(u))==null||h.forEach(x=>{e.some(S=>S.id===x.id)||o.push({id:x.id,type:"position",position:{x:x.position.x+g,y:x.position.y+v}})})),(d.width<l.width||d.height<l.height||g||v)&&o.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:w+(g?f[0]*g-m:0),height:k+(v?f[1]*v-p:0)}})}),o}function nE(e,t,n,r,o,i,s){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let a=!1;if(!l)return{changes:[],updatedInternals:a};const u=[],c=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(c.transform),f=[];for(const g of e.values()){const v=t.get(g.id);if(!v)continue;if(v.hidden){t.set(v.id,{...v,internals:{...v.internals,handleBounds:void 0}}),a=!0;continue}const w=dc(g.nodeElement),k=v.measured.width!==w.width||v.measured.height!==w.height;if(!!(w.width&&w.height&&(k||!v.internals.handleBounds||g.force))){const p=g.nodeElement.getBoundingClientRect(),h=Kn(v.extent)?v.extent:i;let{positionAbsolute:x}=v.internals;if(v.parentId&&v.extent==="parent"){const _=t.get(v.parentId);_&&(x=Jm(x,w,_))}else h&&(x=Qn(x,h,w));const S={...v,measured:w,internals:{...v.internals,positionAbsolute:x,handleBounds:{source:id("source",g.nodeElement,p,d,v.id),target:id("target",g.nodeElement,p,d,v.id)}}};t.set(v.id,S),v.parentId&&yc(S,t,n,{nodeOrigin:o,zIndexMode:s}),a=!0,k&&(u.push({id:v.id,type:"dimensions",dimensions:w}),v.expandParent&&v.parentId&&f.push({id:v.id,parentId:v.parentId,rect:Wo(S,o)}))}}if(f.length>0){const g=vc(f,t,n,o);u.push(...g)}return{changes:u,updatedInternals:a}}async function rE({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return!1;const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r);return!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2])}function dd(e,t,n,r,o,i){let s=o;const l=r.get(s)||new Map;r.set(s,l.set(n,t)),s=`${o}-${e}`;const a=r.get(s)||new Map;if(r.set(s,a.set(n,t)),i){s=`${o}-${e}-${i}`;const u=r.get(s)||new Map;r.set(s,u.set(n,t))}}function pg(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:i,sourceHandle:s=null,targetHandle:l=null}=r,a={edgeId:r.id,source:o,target:i,sourceHandle:s,targetHandle:l},u=`${o}-${s}--${i}-${l}`,c=`${i}-${l}--${o}-${s}`;dd("source",a,c,e,o,s),dd("target",a,u,e,i,l),t.set(r.id,r)}}function mg(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:mg(n,t):!1}function hd(e,t,n){var o;let r=e;do{if((o=r==null?void 0:r.matches)!=null&&o.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function oE(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!mg(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const l=e.get(i);l&&o.set(i,{id:i,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return o}function Yl({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,l,a;const o=[];for(const[u,c]of t){const d=(s=n.get(u))==null?void 0:s.internals.userNode;d&&o.push({...d,position:c.position,dragging:r})}if(!e)return[o[0],o];const i=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((a=t.get(e))==null?void 0:a.position)||i.position,dragging:r}:o[0],o]}function iE({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const i={x:n-o.distance.x,y:r-o.distance.y},s=ii(i,t);return{x:s.x-i.x,y:s.y-i.y}}function sE({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},s=0,l=new Map,a=!1,u={x:0,y:0},c=null,d=!1,f=null,g=!1,v=!1,w=null;function k({noDragClassName:p,handleSelector:h,domNode:x,isSelectable:S,nodeId:_,nodeClickDistance:N=0}){f=We(x);function C({x:L,y:O}){const{nodeLookup:E,nodeExtent:z,snapGrid:T,snapToGrid:A,nodeOrigin:P,onNodeDrag:j,onSelectionDrag:M,onError:b,updateNodePositions:F}=t();i={x:L,y:O};let W=!1;const B=l.size>1,G=B&&z?Ja(oi(l)):null,q=B&&A?iE({dragItems:l,snapGrid:T,x:L,y:O}):null;for(const[Q,H]of l){if(!E.has(Q))continue;let U={x:L-H.distance.x,y:O-H.distance.y};A&&(U=q?{x:Math.round(U.x+q.x),y:Math.round(U.y+q.y)}:ii(U,T));let Z=null;if(B&&z&&!H.extent&&G){const{positionAbsolute:ee}=H.internals,te=ee.x-G.x+z[0][0],ne=ee.x+H.measured.width-G.x2+z[1][0],ie=ee.y-G.y+z[0][1],ae=ee.y+H.measured.height-G.y2+z[1][1];Z=[[te,ie],[ne,ae]]}const{position:J,positionAbsolute:K}=Zm({nodeId:Q,nextPosition:U,nodeLookup:E,nodeExtent:Z||z,nodeOrigin:P,onError:b});W=W||H.position.x!==J.x||H.position.y!==J.y,H.position=J,H.internals.positionAbsolute=K}if(v=v||W,!!W&&(F(l,!0),w&&(r||j||!_&&M))){const[Q,H]=Yl({nodeId:_,dragItems:l,nodeLookup:E});r==null||r(w,l,Q,H),j==null||j(w,Q,H),_||M==null||M(w,H)}}async function $(){if(!c)return;const{transform:L,panBy:O,autoPanSpeed:E,autoPanOnNodeDrag:z}=t();if(!z){a=!1,cancelAnimationFrame(s);return}const[T,A]=cc(u,c,E);(T!==0||A!==0)&&(i.x=(i.x??0)-T/L[2],i.y=(i.y??0)-A/L[2],await O({x:T,y:A})&&C(i)),s=requestAnimationFrame($)}function D(L){var B;const{nodeLookup:O,multiSelectionActive:E,nodesDraggable:z,transform:T,snapGrid:A,snapToGrid:P,selectNodesOnDrag:j,onNodeDragStart:M,onSelectionDragStart:b,unselectNodesAndEdges:F}=t();d=!0,(!j||!S)&&!E&&_&&((B=O.get(_))!=null&&B.selected||F()),S&&j&&_&&(e==null||e(_));const W=wo(L.sourceEvent,{transform:T,snapGrid:A,snapToGrid:P,containerBounds:c});if(i=W,l=oE(O,z,W,_),l.size>0&&(n||M||!_&&b)){const[G,q]=Yl({nodeId:_,dragItems:l,nodeLookup:O});n==null||n(L.sourceEvent,l,G,q),M==null||M(L.sourceEvent,G,q),_||b==null||b(L.sourceEvent,q)}}const R=Tm().clickDistance(N).on("start",L=>{const{domNode:O,nodeDragThreshold:E,transform:z,snapGrid:T,snapToGrid:A}=t();c=(O==null?void 0:O.getBoundingClientRect())||null,g=!1,v=!1,w=L.sourceEvent,E===0&&D(L),i=wo(L.sourceEvent,{transform:z,snapGrid:T,snapToGrid:A,containerBounds:c}),u=gt(L.sourceEvent,c)}).on("drag",L=>{const{autoPanOnNodeDrag:O,transform:E,snapGrid:z,snapToGrid:T,nodeDragThreshold:A,nodeLookup:P}=t(),j=wo(L.sourceEvent,{transform:E,snapGrid:z,snapToGrid:T,containerBounds:c});if(w=L.sourceEvent,(L.sourceEvent.type==="touchmove"&&L.sourceEvent.touches.length>1||_&&!P.has(_))&&(g=!0),!g){if(!a&&O&&d&&(a=!0,$()),!d){const M=gt(L.sourceEvent,c),b=M.x-u.x,F=M.y-u.y;Math.sqrt(b*b+F*F)>A&&D(L)}(i.x!==j.xSnapped||i.y!==j.ySnapped)&&l&&d&&(u=gt(L.sourceEvent,c),C(j))}}).on("end",L=>{if(!d||g){g&&l.size>0&&t().updateNodePositions(l,!1);return}if(a=!1,d=!1,cancelAnimationFrame(s),l.size>0){const{nodeLookup:O,updateNodePositions:E,onNodeDragStop:z,onSelectionDragStop:T}=t();if(v&&(E(l,!1),v=!1),o||z||!_&&T){const[A,P]=Yl({nodeId:_,dragItems:l,nodeLookup:O,dragging:!1});o==null||o(L.sourceEvent,l,A,P),z==null||z(L.sourceEvent,A,P),_||T==null||T(L.sourceEvent,P)}}}).filter(L=>{const O=L.target;return!L.button&&(!p||!hd(O,`.${p}`,x))&&(!h||hd(O,h,x))});f.call(R)}function m(){f==null||f.on(".drag",null)}return{update:k,destroy:m}}function lE(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())Ls(o,Wo(i))>0&&r.push(i);return r}const aE=250;function uE(e,t,n,r){var l,a;let o=[],i=1/0;const s=lE(e,n,t+aE);for(const u of s){const c=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((a=u.internals.handleBounds)==null?void 0:a.target)??[]];for(const d of c){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:f,y:g}=Gn(u,d,d.position,!0),v=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(g-e.y,2));v>t||(v<i?(o=[{...d,x:f,y:g}],i=v):v===i&&o.push({...d,x:f,y:g}))}}if(!o.length)return null;if(o.length>1){const u=r.type==="source"?"target":"source";return o.find(c=>c.type===u)??o[0]}return o[0]}function gg(e,t,n,r,o,i=!1){var u,c,d;const s=r.get(e);if(!s)return null;const l=o==="strict"?(u=s.internals.handleBounds)==null?void 0:u[t]:[...((c=s.internals.handleBounds)==null?void 0:c.source)??[],...((d=s.internals.handleBounds)==null?void 0:d.target)??[]],a=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return a&&i?{...a,...Gn(s,a,a.position,!0)}:a}function yg(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function cE(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const vg=()=>!0;function fE(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:s,domNode:l,nodeLookup:a,lib:u,autoPanOnConnect:c,flowId:d,panBy:f,cancelConnection:g,onConnectStart:v,onConnect:w,onConnectEnd:k,isValidConnection:m=vg,onReconnectEnd:p,updateConnection:h,getTransform:x,getFromHandle:S,autoPanSpeed:_,dragThreshold:N=1,handleDomNode:C}){const $=sg(e.target);let D=0,R;const{x:L,y:O}=gt(e),E=yg(i,C),z=l==null?void 0:l.getBoundingClientRect();let T=!1;if(!z||!E)return;const A=gg(o,E,r,a,t);if(!A)return;let P=gt(e,z),j=!1,M=null,b=!1,F=null;function W(){if(!c||!z)return;const[J,K]=cc(P,z,_);f({x:J,y:K}),D=requestAnimationFrame(W)}const B={...A,nodeId:o,type:E,position:A.position},G=a.get(o);let Q={inProgress:!0,isValid:null,from:Gn(G,B,X.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:G,to:P,toHandle:null,toPosition:td[B.position],toNode:null,pointer:P};function H(){T=!0,h(Q),v==null||v(e,{nodeId:o,handleId:r,handleType:E})}N===0&&H();function U(J){if(!T){const{x:ae,y:Ze}=gt(J),Et=ae-L,_t=Ze-O;if(!(Et*Et+_t*_t>N*N))return;H()}if(!S()||!B){Z(J);return}const K=x();P=gt(J,z),R=uE(si(P,K,!1,[1,1]),n,a,B),j||(W(),j=!0);const ee=xg(J,{handle:R,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:m,doc:$,lib:u,flowId:d,nodeLookup:a});F=ee.handleDomNode,M=ee.connection,b=cE(!!R,ee.isValid);const te=a.get(o),ne=te?Gn(te,B,X.Left,!0):Q.from,ie={...Q,from:ne,isValid:b,to:ee.toHandle&&b?Rr({x:ee.toHandle.x,y:ee.toHandle.y},K):P,toHandle:ee.toHandle,toPosition:b&&ee.toHandle?ee.toHandle.position:td[B.position],toNode:ee.toHandle?a.get(ee.toHandle.nodeId):null,pointer:P};h(ie),Q=ie}function Z(J){if(!("touches"in J&&J.touches.length>0)){if(T){(R||F)&&M&&b&&(w==null||w(M));const{inProgress:K,...ee}=Q,te={...ee,toPosition:Q.toHandle?Q.toPosition:null};k==null||k(J,te),i&&(p==null||p(J,te))}g(),cancelAnimationFrame(D),j=!1,b=!1,M=null,F=null,$.removeEventListener("mousemove",U),$.removeEventListener("mouseup",Z),$.removeEventListener("touchmove",U),$.removeEventListener("touchend",Z)}}$.addEventListener("mousemove",U),$.addEventListener("mouseup",Z),$.addEventListener("touchmove",U),$.addEventListener("touchend",Z)}function xg(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:l,flowId:a,isValidConnection:u=vg,nodeLookup:c}){const d=i==="target",f=t?s.querySelector(`.${l}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:g,y:v}=gt(e),w=s.elementFromPoint(g,v),k=w!=null&&w.classList.contains(`${l}-flow__handle`)?w:f,m={handleDomNode:k,isValid:!1,connection:null,toHandle:null};if(k){const p=yg(void 0,k),h=k.getAttribute("data-nodeid"),x=k.getAttribute("data-handleid"),S=k.classList.contains("connectable"),_=k.classList.contains("connectableend");if(!h||!p)return m;const N={source:d?h:r,sourceHandle:d?x:o,target:d?r:h,targetHandle:d?o:x};m.connection=N;const $=S&&_&&(n===br.Strict?d&&p==="source"||!d&&p==="target":h!==r||x!==o);m.isValid=$&&u(N),m.toHandle=gg(h,p,x,c,n,!0)}return m}const ru={onPointerDown:fE,isValid:xg};function dE({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=We(e);function i({translateExtent:l,width:a,height:u,zoomStep:c=1,pannable:d=!0,zoomable:f=!0,inversePan:g=!1}){const v=h=>{if(h.sourceEvent.type!=="wheel"||!t)return;const x=n(),S=h.sourceEvent.ctrlKey&&Yo()?10:1,_=-h.sourceEvent.deltaY*(h.sourceEvent.deltaMode===1?.05:h.sourceEvent.deltaMode?1:.002)*c,N=x[2]*Math.pow(2,_*S);t.scaleTo(N)};let w=[0,0];const k=h=>{(h.sourceEvent.type==="mousedown"||h.sourceEvent.type==="touchstart")&&(w=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY])},m=h=>{const x=n();if(h.sourceEvent.type!=="mousemove"&&h.sourceEvent.type!=="touchmove"||!t)return;const S=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY],_=[S[0]-w[0],S[1]-w[1]];w=S;const N=r()*Math.max(x[2],Math.log(x[2]))*(g?-1:1),C={x:x[0]-_[0]*N,y:x[1]-_[1]*N},$=[[0,0],[a,u]];t.setViewportConstrained({x:C.x,y:C.y,zoom:x[2]},$,l)},p=Xm().on("start",k).on("zoom",d?m:null).on("zoom.wheel",f?v:null);o.call(p,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:ft}}const sl=e=>({x:e.x,y:e.y,zoom:e.k}),Xl=({x:e,y:t,zoom:n})=>rl.translate(e,t).scale(n),rn=(e,t)=>e.target.closest(`.${t}`),wg=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),hE=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Ql=(e,t=0,n=hE,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},Sg=e=>{const t=e.ctrlKey&&Yo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function pE({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:u}){return c=>{if(rn(c,t))return c.ctrlKey&&c.preventDefault(),!1;c.preventDefault(),c.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(c.ctrlKey&&s){const k=ft(c),m=Sg(c),p=d*Math.pow(2,m);r.scaleTo(n,p,k,c);return}const f=c.deltaMode===1?20:1;let g=o===On.Vertical?0:c.deltaX*f,v=o===On.Horizontal?0:c.deltaY*f;!Yo()&&c.shiftKey&&o!==On.Vertical&&(g=c.deltaY*f,v=0),r.translateBy(n,-(g/d)*i,-(v/d)*i,{internal:!0});const w=sl(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?a==null||a(c,w):(e.isPanScrolling=!0,l==null||l(c,w)),e.panScrollTimeout=setTimeout(()=>{u==null||u(c,w),e.isPanScrolling=!1},150)}}function mE({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,l=rn(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),s||l)return null;r.preventDefault(),n.call(this,r,o)}}function gE({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,l;if((i=r.sourceEvent)!=null&&i.internal)return;const o=sl(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,o))}}function yE({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var s,l;e.usedRightMouseButton=!!(n&&wg(t,e.mouseButton??0)),(s=i.sourceEvent)!=null&&s.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!((l=i.sourceEvent)!=null&&l.internal)&&(o==null||o(i.sourceEvent,sl(i.transform)))}}function vE({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return s=>{var l;if(!((l=s.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&wg(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const a=sl(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,a)},n?150:0)}}}function xE({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:o,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:l,noWheelClassName:a,noPanClassName:u,lib:c,connectionInProgress:d}){return f=>{var m;const g=t||n,v=r&&f.ctrlKey,w=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(rn(f,`${c}-flow__node`)||rn(f,`${c}-flow__edge`)||rn(f,`${c}-flow__selection`)||rn(f,`${c}-flow__nodesselection`)))return!0;if(!o&&!g&&!i&&!s&&!r||l||d&&!w||rn(f,a)&&w||rn(f,u)&&(!w||i&&w&&!t)||!r&&f.ctrlKey&&w)return!1;if(!r&&f.type==="touchstart"&&((m=f.touches)==null?void 0:m.length)>1)return f.preventDefault(),!1;if(!g&&!i&&!v&&w||!o&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(o)&&!o.includes(f.button)&&f.type==="mousedown")return!1;const k=Array.isArray(o)&&o.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||w||e)&&k}}function wE({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:l,onDraggingChange:a}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},c=e.getBoundingClientRect();let d=[[0,0],[c.width,c.height]];const f=typeof ResizeObserver<"u"?new ResizeObserver(O=>{const E=O[0];E&&(d=[[0,0],[E.contentRect.width,E.contentRect.height]])}):null;f==null||f.observe(e);const g=Xm().extent(()=>d).scaleExtent([t,n]).translateExtent(r),v=We(e).call(g);x({x:o.x,y:o.y,zoom:Ar(o.zoom,t,n)},[[0,0],[c.width,c.height]],r);const w=v.on("wheel.zoom"),k=v.on("dblclick.zoom");g.wheelDelta(Sg);async function m(O,E){return v?new Promise(z=>{g==null||g.interpolate((E==null?void 0:E.interpolate)==="linear"?xo:Gi).transform(Ql(v,E==null?void 0:E.duration,E==null?void 0:E.ease,()=>z(!0)),O)}):!1}function p({noWheelClassName:O,noPanClassName:E,onPaneContextMenu:z,userSelectionActive:T,panOnScroll:A,panOnDrag:P,panOnScrollMode:j,panOnScrollSpeed:M,preventScrolling:b,zoomOnPinch:F,zoomOnScroll:W,zoomOnDoubleClick:B,panActivationKeyPressed:G=!1,zoomActivationKeyPressed:q,lib:Q,onTransformChange:H,connectionInProgress:U,paneClickDistance:Z,selectionOnDrag:J}){T&&!u.isZoomingOrPanning&&h();const K=A&&!q&&!T;g.clickDistance(J?1/0:!mt(Z)||Z<0?0:Z);const ee=K?pE({zoomPanValues:u,noWheelClassName:O,d3Selection:v,d3Zoom:g,panOnScrollMode:j,panOnScrollSpeed:M,zoomOnPinch:F,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:l}):mE({noWheelClassName:O,preventScrolling:b,d3ZoomHandler:w});v.on("wheel.zoom",ee,{passive:!1});const te=gE({zoomPanValues:u,onDraggingChange:a,onPanZoomStart:s});g.on("start",te);const ne=yE({zoomPanValues:u,panOnDrag:P,onPaneContextMenu:!!z,onPanZoom:i,onTransformChange:H});g.on("zoom",ne);const ie=vE({zoomPanValues:u,panOnDrag:P,panOnScroll:A,onPaneContextMenu:z,onPanZoomEnd:l,onDraggingChange:a});g.on("end",ie);const ae=xE({panActivationKeyPressed:G,zoomActivationKeyPressed:q,panOnDrag:P,zoomOnScroll:W,panOnScroll:A,zoomOnDoubleClick:B,zoomOnPinch:F,userSelectionActive:T,noPanClassName:E,noWheelClassName:O,lib:Q,connectionInProgress:U});g.filter(ae),B?v.on("dblclick.zoom",k):v.on("dblclick.zoom",null)}function h(){g.on("zoom",null)}async function x(O,E,z){const T=Xl(O),A=g==null?void 0:g.constrain()(T,E,z);return A&&await m(A),A}async function S(O,E){const z=Xl(O);return await m(z,E),z}function _(O){if(v){const E=Xl(O),z=v.property("__zoom");(z.k!==O.zoom||z.x!==O.x||z.y!==O.y)&&(g==null||g.transform(v,E,null,{sync:!0}))}}function N(){const O=v?Ym(v.node()):{x:0,y:0,k:1};return{x:O.x,y:O.y,zoom:O.k}}async function C(O,E){return v?new Promise(z=>{g==null||g.interpolate((E==null?void 0:E.interpolate)==="linear"?xo:Gi).scaleTo(Ql(v,E==null?void 0:E.duration,E==null?void 0:E.ease,()=>z(!0)),O)}):!1}async function $(O,E){return v?new Promise(z=>{g==null||g.interpolate((E==null?void 0:E.interpolate)==="linear"?xo:Gi).scaleBy(Ql(v,E==null?void 0:E.duration,E==null?void 0:E.ease,()=>z(!0)),O)}):!1}function D(O){g==null||g.scaleExtent(O)}function R(O){g==null||g.translateExtent(O)}function L(O){const E=!mt(O)||O<0?0:O;g==null||g.clickDistance(E)}return{update:p,destroy:h,setViewport:S,setViewportConstrained:x,getViewport:N,scaleTo:C,scaleBy:$,setScaleExtent:D,setTranslateExtent:R,syncViewport:_,setClickDistance:L}}var Dr;(function(e){e.Line="line",e.Handle="handle"})(Dr||(Dr={}));function SE({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:i}){const s=e-t,l=n-r,a=[s>0?1:s<0?-1:0,l>0?1:l<0?-1:0];return s&&o&&(a[0]=a[0]*-1),l&&i&&(a[1]=a[1]*-1),a}function pd(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:o}}function Jt(e,t){return Math.max(0,t-e)}function en(e,t){return Math.max(0,e-t)}function zi(e,t,n){return Math.max(0,t-e,e-n)}function md(e,t){return e?!t:t}function kE(e,t,n,r,o,i,s,l){let{affectsX:a,affectsY:u}=t;const{isHorizontal:c,isVertical:d}=t,f=c&&d,{xSnapped:g,ySnapped:v}=n,{minWidth:w,maxWidth:k,minHeight:m,maxHeight:p}=r,{x:h,y:x,width:S,height:_,aspectRatio:N}=e;let C=Math.floor(c?g-e.pointerX:0),$=Math.floor(d?v-e.pointerY:0);const D=S+(a?-C:C),R=_+(u?-$:$),L=-i[0]*S,O=-i[1]*_;let E=zi(D,w,k),z=zi(R,m,p);if(s){let P=0,j=0;a&&C<0?P=Jt(h+C+L,s[0][0]):!a&&C>0&&(P=en(h+D+L,s[1][0])),u&&$<0?j=Jt(x+$+O,s[0][1]):!u&&$>0&&(j=en(x+R+O,s[1][1])),E=Math.max(E,P),z=Math.max(z,j)}if(l){let P=0,j=0;a&&C>0?P=en(h+C,l[0][0]):!a&&C<0&&(P=Jt(h+D,l[1][0])),u&&$>0?j=en(x+$,l[0][1]):!u&&$<0&&(j=Jt(x+R,l[1][1])),E=Math.max(E,P),z=Math.max(z,j)}if(o){if(c){const P=zi(D/N,m,p)*N;if(E=Math.max(E,P),s){let j=0;!a&&!u||a&&!u&&f?j=en(x+O+D/N,s[1][1])*N:j=Jt(x+O+(a?C:-C)/N,s[0][1])*N,E=Math.max(E,j)}if(l){let j=0;!a&&!u||a&&!u&&f?j=Jt(x+D/N,l[1][1])*N:j=en(x+(a?C:-C)/N,l[0][1])*N,E=Math.max(E,j)}}if(d){const P=zi(R*N,w,k)/N;if(z=Math.max(z,P),s){let j=0;!a&&!u||u&&!a&&f?j=en(h+R*N+L,s[1][0])/N:j=Jt(h+(u?$:-$)*N+L,s[0][0])/N,z=Math.max(z,j)}if(l){let j=0;!a&&!u||u&&!a&&f?j=Jt(h+R*N,l[1][0])/N:j=en(h+(u?$:-$)*N,l[0][0])/N,z=Math.max(z,j)}}}$=$+($<0?z:-z),C=C+(C<0?E:-E),o&&(f?D>R*N?$=(md(a,u)?-C:C)/N:C=(md(a,u)?-$:$)*N:c?($=C/N,u=a):(C=$*N,a=u));const T=a?h+C:h,A=u?x+$:x;return{width:S+(a?-C:C),height:_+(u?-$:$),x:i[0]*C*(a?-1:1)+T,y:i[1]*$*(u?-1:1)+A}}const kg={width:0,height:0,x:0,y:0},EE={...kg,pointerX:0,pointerY:0,aspectRatio:1};function _E(e,t,n){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,l=n[0]*i,a=n[1]*s;return[[r-l,o-a],[r+i-l,o+s-a]]}function NE({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const i=We(e);let s={controlDirection:pd("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:c,keepAspectRatio:d,resizeDirection:f,onResizeStart:g,onResize:v,onResizeEnd:w,shouldResize:k}){let m={...kg},p={...EE};s={boundaries:c,resizeDirection:f,keepAspectRatio:d,controlDirection:pd(u)};let h,x=null,S=[],_,N,C;const $=Tm().on("start",D=>{const{nodeLookup:R,transform:L,snapGrid:O,snapToGrid:E,nodeOrigin:z,paneDomNode:T}=n();if(h=R.get(t),!h)return;x=(T==null?void 0:T.getBoundingClientRect())??null;const{xSnapped:A,ySnapped:P}=wo(D.sourceEvent,{transform:L,snapGrid:O,snapToGrid:E,containerBounds:x});m={width:h.measured.width??0,height:h.measured.height??0,x:h.position.x??0,y:h.position.y??0},p={...m,pointerX:A,pointerY:P,aspectRatio:m.width/m.height},_=void 0,N=Kn(h.extent)?h.extent:void 0,h.parentId&&(h.extent==="parent"||h.expandParent)&&(_=R.get(h.parentId)),_&&h.extent==="parent"&&(N=[[0,0],[_.measured.width,_.measured.height]]),S=[],C=void 0;for(const[j,M]of R)if(M.parentId===t&&(S.push({id:j,position:{...M.position},extent:M.extent}),M.extent==="parent"||M.expandParent)){const b=_E(M,h,M.origin??z);C?C=[[Math.min(b[0][0],C[0][0]),Math.min(b[0][1],C[0][1])],[Math.max(b[1][0],C[1][0]),Math.max(b[1][1],C[1][1])]]:C=b}g==null||g(D,{...m})}).on("drag",D=>{const{transform:R,snapGrid:L,snapToGrid:O,nodeOrigin:E}=n(),z=wo(D.sourceEvent,{transform:R,snapGrid:L,snapToGrid:O,containerBounds:x}),T=[];if(!h)return;const{x:A,y:P,width:j,height:M}=m,b={},F=h.origin??E,{width:W,height:B,x:G,y:q}=kE(p,s.controlDirection,z,s.boundaries,s.keepAspectRatio,F,N,C),Q=W!==j,H=B!==M,U=G!==A&&Q,Z=q!==P&&H;if(!U&&!Z&&!Q&&!H)return;const J={prevValues:{...m},startX:p.x,startY:p.y,childNodes:S.map(ne=>({...ne,position:{...ne.position}}))};if((U||Z||F[0]===1||F[1]===1)&&(b.x=U?G:m.x,b.y=Z?q:m.y,m.x=b.x,m.y=b.y,S.length>0)){const ne=G-A,ie=q-P;for(const ae of S)ae.position={x:ae.position.x-ne+F[0]*(W-j),y:ae.position.y-ie+F[1]*(B-M)},T.push(ae)}if((Q||H)&&(b.width=Q&&(!s.resizeDirection||s.resizeDirection==="horizontal")?W:m.width,b.height=H&&(!s.resizeDirection||s.resizeDirection==="vertical")?B:m.height,m.width=b.width,m.height=b.height),_&&h.expandParent){const ne=F[0]*(b.width??0);b.x&&b.x<ne&&(m.x=ne,p.x=p.x-(b.x-ne));const ie=F[1]*(b.height??0);b.y&&b.y<ie&&(m.y=ie,p.y=p.y-(b.y-ie))}const K=SE({width:m.width,prevWidth:j,height:m.height,prevHeight:M,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),ee={...m,direction:K};if((k==null?void 0:k(D,ee))===!1){m=J.prevValues,p.x=J.startX,p.y=J.startY,S.forEach((ne,ie)=>{ne.position=J.childNodes[ie].position});return}v==null||v(D,ee),r(b,T)}).on("end",D=>{w==null||w(D,{...m}),o==null||o({...m})});i.call($)}function a(){i.on(".drag",null)}return{update:l,destroy:a}}var Eg={exports:{}},_g={},Ng={exports:{}},Cg={};/**
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 Or=I;function CE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ME=typeof Object.is=="function"?Object.is:CE,jE=Or.useState,PE=Or.useEffect,$E=Or.useLayoutEffect,IE=Or.useDebugValue;function TE(e,t){var n=t(),r=jE({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return $E(function(){o.value=n,o.getSnapshot=t,Kl(o)&&i({inst:o})},[e,n,t]),PE(function(){return Kl(o)&&i({inst:o}),e(function(){Kl(o)&&i({inst:o})})},[e]),IE(n),n}function Kl(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ME(e,n)}catch{return!0}}function zE(e,t){return t()}var LE=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?zE:TE;Cg.useSyncExternalStore=Or.useSyncExternalStore!==void 0?Or.useSyncExternalStore:LE;Ng.exports=Cg;var bE=Ng.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 ll=I,AE=bE;function RE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var DE=typeof Object.is=="function"?Object.is:RE,OE=AE.useSyncExternalStore,FE=ll.useRef,HE=ll.useEffect,VE=ll.useMemo,BE=ll.useDebugValue;_g.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=FE(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=VE(function(){function a(g){if(!u){if(u=!0,c=g,g=r(g),o!==void 0&&s.hasValue){var v=s.value;if(o(v,g))return d=v}return d=g}if(v=d,DE(c,g))return v;var w=r(g);return o!==void 0&&o(v,w)?(c=g,v):(c=g,d=w)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return a(t())},f===null?void 0:function(){return a(f())}]},[t,n,r,o]);var l=OE(e,i[0],i[1]);return HE(function(){s.hasValue=!0,s.value=l},[l]),BE(l),l};Eg.exports=_g;var UE=Eg.exports;const WE=rh(UE),YE={},gd=e=>{let t;const n=new Set,r=(c,d)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const g=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(v=>v(t,g))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(YE?"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."),n.clear()}},u=t=e(r,o,a);return a},XE=e=>e?gd(e):gd,{useDebugValue:QE}=Oy,{useSyncExternalStoreWithSelector:KE}=WE,GE=e=>e;function Mg(e,t=GE,n){const r=KE(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return QE(r),r}const yd=(e,t)=>{const n=XE(e),r=(o,i=t)=>Mg(n,o,i);return Object.assign(r,n),r},qE=(e,t)=>e?yd(e,t):yd;function ye(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const al=I.createContext(null),ZE=al.Provider,jg=wt.error001("react");function oe(e,t){const n=I.useContext(al);if(n===null)throw new Error(jg);return Mg(n,e,t)}function de(){const e=I.useContext(al);if(e===null)throw new Error(jg);return I.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const vd={display:"none"},JE={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Pg="react-flow__node-desc",$g="react-flow__edge-desc",e_="react-flow__aria-live",t_=e=>e.ariaLiveMessage,n_=e=>e.ariaLabelConfig;function r_({rfId:e}){const t=oe(t_);return y.jsx("div",{id:`${e_}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:JE,children:t})}function o_({rfId:e,disableKeyboardA11y:t}){const n=oe(n_);return y.jsxs(y.Fragment,{children:[y.jsx("div",{id:`${Pg}-${e}`,style:vd,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),y.jsx("div",{id:`${$g}-${e}`,style:vd,children:n["edge.a11yDescription.default"]}),!t&&y.jsx(r_,{rfId:e})]})}const ul=I.forwardRef(({position:e="top-left",children:t,className:n,style:r,...o},i)=>{const s=`${e}`.split("-");return y.jsx("div",{className:Se(["react-flow__panel",n,...s]),style:r,ref:i,...o,children:t})});ul.displayName="Panel";const xd="https://reactflow.dev?utm_source=attribution";function i_({proOptions:e,position:t="bottom-right"}){return I.useEffect(()=>{},[]),e!=null&&e.hideAttribution?null:y.jsx(ul,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${xd}`,children:y.jsx("a",{href:xd,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const s_=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Li=e=>e.id;function l_(e,t){return ye(e.selectedNodes.map(Li),t.selectedNodes.map(Li))&&ye(e.selectedEdges.map(Li),t.selectedEdges.map(Li))}function a_({onSelectionChange:e}){const t=de(),{selectedNodes:n,selectedEdges:r}=oe(s_,l_);return I.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(i=>i(o))},[n,r,e]),null}const u_=e=>!!e.onSelectionChangeHandlers;function c_({onSelectionChange:e}){const t=oe(u_);return e||t?y.jsx(a_,{onSelectionChange:e}):null}const Ig=[0,0],f_={x:0,y:0,zoom:1},d_=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],wd=[...d_,"rfId"],h_=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Sd={translateExtent:Vo,nodeOrigin:Ig,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function p_(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:i,setNodeExtent:s,reset:l,setDefaultNodesAndEdges:a}=oe(h_,ye),u=de();I.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{c.current=Sd,l()}),[]);const c=I.useRef(Sd);return I.useEffect(()=>{for(const d of wd){const f=e[d],g=c.current[d];f!==g&&(typeof e[d]>"u"||(d==="nodes"?t(f):d==="edges"?n(f):d==="minZoom"?r(f):d==="maxZoom"?o(f):d==="translateExtent"?i(f):d==="nodeExtent"?s(f):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:Dk(f)}):d==="fitView"?u.setState({fitViewQueued:f}):d==="fitViewOptions"?u.setState({fitViewOptions:f}):u.setState({[d]:f})))}c.current=e},wd.map(d=>e[d])),null}function kd(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function m_(e){var r;const[t,n]=I.useState(e==="system"?null:e);return I.useEffect(()=>{if(e!=="system"){n(e);return}const o=kd(),i=()=>n(o!=null&&o.matches?"dark":"light");return i(),o==null||o.addEventListener("change",i),()=>{o==null||o.removeEventListener("change",i)}},[e]),t!==null?t:(r=kd())!=null&&r.matches?"dark":"light"}const Ed=typeof document<"u"?document:null;function Xo(e=null,t={target:Ed,actInsideInputWithModifier:!0}){const[n,r]=I.useState(!1),o=I.useRef(!1),i=I.useRef(new Set([])),[s,l]=I.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace(/\+/g,`
57
- `).replace(`
58
-
59
- `,`
60
- +`).split(`
61
- `)),c=u.reduce((d,f)=>d.concat(...f),[]);return[u,c]}return[[],[]]},[e]);return I.useEffect(()=>{const a=(t==null?void 0:t.target)??Ed,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const c=g=>{var k,m;if(o.current=g.ctrlKey||g.metaKey||g.shiftKey||g.altKey,(!o.current||o.current&&!u)&&lg(g))return!1;const w=Nd(g.code,l);if(i.current.add(g[w]),_d(s,i.current,!1)){const p=((m=(k=g.composedPath)==null?void 0:k.call(g))==null?void 0:m[0])||g.target,h=(p==null?void 0:p.nodeName)==="BUTTON"||(p==null?void 0:p.nodeName)==="A";t.preventDefault!==!1&&(o.current||!h)&&g.preventDefault(),r(!0)}},d=g=>{const v=Nd(g.code,l);_d(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(g[v]),g.key==="Meta"&&i.current.clear(),o.current=!1},f=()=>{i.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",c),a==null||a.addEventListener("keyup",d),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{a==null||a.removeEventListener("keydown",c),a==null||a.removeEventListener("keyup",d),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function _d(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function Nd(e,t){return t.includes(e)?"code":"key"}const g_=()=>{const e=de();return I.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,o,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??i},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:o,minZoom:i,maxZoom:s,panZoom:l}=e.getState(),a=fc(t,r,o,i,s,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(a,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:o,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:l,y:a}=s.getBoundingClientRect(),u={x:t.x-l,y:t.y-a},c=n.snapGrid??o,d=n.snapToGrid??i;return si(u,r,d,c)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:i}=r.getBoundingClientRect(),s=Rr(t,n);return{x:s.x+o,y:s.y+i}}}),[])};function Tg(e,t){const n=[],r=new Map,o=[];for(const i of e)if(i.type==="add"){o.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const s=r.get(i.id);s?s.push(i):r.set(i.id,[i])}for(const i of t){const s=r.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const l={...i};for(const a of s)y_(a,l);n.push(l)}return o.length&&o.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function y_(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function v_(e,t){return Tg(e,t)}function x_(e,t){return Tg(e,t)}function Pn(e,t){return{id:e,type:"select",selected:t}}function yr(e,t=new Set,n=!1){const r=[];for(const[o,i]of e){const s=t.has(o);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),r.push(Pn(i.id,s)))}return r}function Cd({items:e=[],lookup:t}){var o;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,s]of e.entries()){const l=t.get(s.id),a=((o=l==null?void 0:l.internals)==null?void 0:o.userNode)??l;a!==void 0&&a!==s&&n.push({id:s.id,item:s,type:"replace"}),a===void 0&&n.push({item:s,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function Md(e){return{id:e.id,type:"remove"}}const w_=ng();function S_(e,t,n={}){return Uk(e,t,{...n,onError:n.onError??w_})}const jd=e=>Pk(e),k_=e=>qm(e);function zg(e){return I.forwardRef(e)}const Lg=typeof window<"u"?I.useLayoutEffect:I.useEffect;function Pd(e){const[t,n]=I.useState(BigInt(0)),[r]=I.useState(()=>E_(()=>n(o=>o+BigInt(1))));return Lg(()=>{const o=r.get();o.length&&(e(o),r.reset())},[t]),r}function E_(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const bg=I.createContext(null);function __({children:e}){const t=de(),n=I.useCallback(l=>{const{nodes:a=[],setNodes:u,hasDefaultNodes:c,onNodesChange:d,nodeLookup:f,fitViewQueued:g,onNodesChangeMiddlewareMap:v}=t.getState();let w=a;for(const m of l)w=typeof m=="function"?m(w):m;let k=Cd({items:w,lookup:f});for(const m of v.values())k=m(k);c&&u(w),k.length>0?d==null||d(k):g&&window.requestAnimationFrame(()=>{const{fitViewQueued:m,nodes:p,setNodes:h}=t.getState();m&&h(p)})},[]),r=Pd(n),o=I.useCallback(l=>{const{edges:a=[],setEdges:u,hasDefaultEdges:c,onEdgesChange:d,edgeLookup:f}=t.getState();let g=a;for(const v of l)g=typeof v=="function"?v(g):v;c?u(g):d&&d(Cd({items:g,lookup:f}))},[]),i=Pd(o),s=I.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return y.jsx(bg.Provider,{value:s,children:e})}function N_(){const e=I.useContext(bg);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const C_=e=>!!e.panZoom;function cl(){const e=g_(),t=de(),n=N_(),r=oe(C_),o=I.useMemo(()=>{const i=d=>t.getState().nodeLookup.get(d),s=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},a=d=>{var m,p;const{nodeLookup:f,nodeOrigin:g}=t.getState(),v=jd(d)?d:f.get(d.id),w=v.parentId?og(v.position,v.measured,v.parentId,f,g):v.position,k={...v,position:w,width:((m=v.measured)==null?void 0:m.width)??v.width,height:((p=v.measured)==null?void 0:p.height)??v.height};return Wo(k)},u=(d,f,g={replace:!1})=>{s(v=>v.map(w=>{if(w.id===d){const k=typeof f=="function"?f(w):f;return g.replace&&jd(k)?k:{...w,...k}}return w}))},c=(d,f,g={replace:!1})=>{l(v=>v.map(w=>{if(w.id===d){const k=typeof f=="function"?f(w):f;return g.replace&&k_(k)?k:{...w,...k}}return w}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var f;return(f=i(d))==null?void 0:f.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(f=>({...f}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:s,setEdges:l,addNodes:d=>{const f=Array.isArray(d)?d:[d];n.nodeQueue.push(g=>[...g,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(g=>[...g,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:g}=t.getState(),[v,w,k]=g;return{nodes:d.map(m=>({...m})),edges:f.map(m=>({...m})),viewport:{x:v,y:w,zoom:k}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:g,edges:v,onNodesDelete:w,onEdgesDelete:k,triggerNodeChanges:m,triggerEdgeChanges:p,onDelete:h,onBeforeDelete:x}=t.getState(),{nodes:S,edges:_}=await Lk({nodesToRemove:d,edgesToRemove:f,nodes:g,edges:v,onBeforeDelete:x}),N=_.length>0,C=S.length>0;if(N){const $=_.map(Md);k==null||k(_),p($)}if(C){const $=S.map(Md);w==null||w(S),m($)}return(C||N)&&(h==null||h({nodes:S,edges:_})),{deletedNodes:S,deletedEdges:_}},getIntersectingNodes:(d,f=!0,g)=>{const v=rd(d),w=v?d:a(d),k=g!==void 0;return w?(g||t.getState().nodes).filter(m=>{const p=t.getState().nodeLookup.get(m.id);if(p&&!v&&(m.id===d.id||!p.internals.positionAbsolute))return!1;const h=Wo(k?m:p),x=Ls(h,w);return f&&x>0||x>=h.width*h.height||x>=w.width*w.height}):[]},isNodeIntersecting:(d,f,g=!0)=>{const w=rd(d)?d:a(d);if(!w)return!1;const k=Ls(w,f);return g&&k>0||k>=f.width*f.height||k>=w.width*w.height},updateNode:u,updateNodeData:(d,f,g={replace:!1})=>{u(d,v=>{const w=typeof f=="function"?f(v):f;return g.replace?{...v,data:w}:{...v,data:{...v.data,...w}}},g)},updateEdge:c,updateEdgeData:(d,f,g={replace:!1})=>{c(d,v=>{const w=typeof f=="function"?f(v):f;return g.replace?{...v,data:w}:{...v,data:{...v.data,...w}}},g)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:g}=t.getState();return $k(d,{nodeLookup:f,nodeOrigin:g})},getHandleConnections:({type:d,id:f,nodeId:g})=>{var v;return Array.from(((v=t.getState().connectionLookup.get(`${g}-${d}${f?`-${f}`:""}`))==null?void 0:v.values())??[])},getNodeConnections:({type:d,handleId:f,nodeId:g})=>{var v;return Array.from(((v=t.getState().connectionLookup.get(`${g}${d?f?`-${d}-${f}`:`-${d}`:""}`))==null?void 0:v.values())??[])},fitView:async d=>{const f=t.getState().fitViewResolver??Rk();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:f}),n.nodeQueue.push(g=>[...g]),f.promise}}},[]);return I.useMemo(()=>({...o,...e,viewportInitialized:r}),[r])}const $d=e=>e.selected,M_=typeof window<"u"?window:void 0;function j_({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=de(),{deleteElements:r}=cl(),o=Xo(e,{actInsideInputWithModifier:!1}),i=Xo(t,{target:M_});I.useEffect(()=>{if(o){const{edges:s,nodes:l}=n.getState();r({nodes:l.filter($d),edges:s.filter($d)}),n.setState({nodesSelectionActive:!1})}},[o]),I.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function P_(e){const t=de();I.useEffect(()=>{const n=()=>{var o,i,s,l;if(!e.current||!(((i=(o=e.current).checkVisibility)==null?void 0:i.call(o))??!0))return!1;const r=dc(e.current);(r.height===0||r.width===0)&&((l=(s=t.getState()).onError)==null||l.call(s,"004",wt.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const fl={position:"absolute",width:"100%",height:"100%",top:0,left:0},$_=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function I_({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:o,panOnScrollSpeed:i=.5,panOnScrollMode:s=On.Free,zoomOnDoubleClick:l=!0,panOnDrag:a=!0,defaultViewport:u,translateExtent:c,minZoom:d,maxZoom:f,zoomActivationKeyCode:g,preventScrolling:v=!0,children:w,noWheelClassName:k,noPanClassName:m,onViewportChange:p,isControlledViewport:h,paneClickDistance:x,selectionOnDrag:S}){const _=de(),N=I.useRef(null),{userSelectionActive:C,lib:$,connectionInProgress:D}=oe($_,ye),R=Xo(g),L=I.useRef();P_(N);const O=I.useCallback(E=>{p==null||p({x:E[0],y:E[1],zoom:E[2]}),h||_.setState({transform:E})},[p,h]);return I.useEffect(()=>{if(N.current){L.current=wE({domNode:N.current,minZoom:d,maxZoom:f,translateExtent:c,viewport:u,onDraggingChange:A=>_.setState(P=>P.paneDragging===A?P:{paneDragging:A}),onPanZoomStart:(A,P)=>{const{onViewportChangeStart:j,onMoveStart:M}=_.getState();M==null||M(A,P),j==null||j(P)},onPanZoom:(A,P)=>{const{onViewportChange:j,onMove:M}=_.getState();M==null||M(A,P),j==null||j(P)},onPanZoomEnd:(A,P)=>{const{onViewportChangeEnd:j,onMoveEnd:M}=_.getState();M==null||M(A,P),j==null||j(P)}});const{x:E,y:z,zoom:T}=L.current.getViewport();return _.setState({panZoom:L.current,transform:[E,z,T],domNode:N.current.closest(".react-flow")}),()=>{var A;(A=L.current)==null||A.destroy()}}},[]),I.useEffect(()=>{var E;(E=L.current)==null||E.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:o,panOnScrollSpeed:i,panOnScrollMode:s,zoomOnDoubleClick:l,panOnDrag:a,zoomActivationKeyPressed:R,preventScrolling:v,noPanClassName:m,userSelectionActive:C,noWheelClassName:k,lib:$,onTransformChange:O,connectionInProgress:D,selectionOnDrag:S,paneClickDistance:x})},[e,t,n,r,o,i,s,l,a,R,v,m,C,k,$,O,D,S,x]),y.jsx("div",{className:"react-flow__renderer",ref:N,style:fl,children:w})}const T_=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function z_(){const{userSelectionActive:e,userSelectionRect:t}=oe(T_,ye);return e&&t?y.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Gl=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},L_=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function b_({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Bo.Full,panOnDrag:r,autoPanOnSelection:o,paneClickDistance:i,selectionOnDrag:s,onSelectionStart:l,onSelectionEnd:a,onPaneClick:u,onPaneContextMenu:c,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:g,onPaneMouseLeave:v,children:w}){const k=I.useRef(0),m=de(),{userSelectionActive:p,elementsSelectable:h,dragging:x,panBy:S,autoPanSpeed:_}=oe(L_,ye),N=h&&(e||p),C=I.useRef(null),$=I.useRef(),D=I.useRef(new Set),R=I.useRef(new Set),L=I.useRef(!1),O=I.useRef(!1),E=I.useRef({x:0,y:0}),z=I.useRef(!1),T=H=>{if(O.current||L.current||m.getState().connection.inProgress){O.current=!1,L.current=!1;return}u==null||u(H),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},A=H=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){H.preventDefault();return}c==null||c(H)},P=d?H=>d(H):void 0,j=H=>{O.current&&(H.stopPropagation(),O.current=!1)},M=H=>{var ae,Ze;if(H.pointerType==="touch"&&r!==!1&&!t)return;const{domNode:U,transform:Z}=m.getState();if($.current=U==null?void 0:U.getBoundingClientRect(),!$.current)return;const J=H.target===C.current;if(!J&&!!H.target.closest(".nokey")||!e||!(s&&J||t)||H.button!==0||!H.isPrimary)return;(Ze=(ae=H.target)==null?void 0:ae.setPointerCapture)==null||Ze.call(ae,H.pointerId),O.current=!1;const{x:te,y:ne}=gt(H.nativeEvent,$.current),ie=si({x:te,y:ne},Z);m.setState({userSelectionRect:{width:0,height:0,startX:ie.x,startY:ie.y,x:te,y:ne}}),J||(H.stopPropagation(),H.preventDefault())};function b(H,U){const{userSelectionRect:Z}=m.getState();if(!Z)return;const{transform:J,nodeLookup:K,edgeLookup:ee,connectionLookup:te,triggerNodeChanges:ne,triggerEdgeChanges:ie,defaultEdgeOptions:ae}=m.getState(),Ze={x:Z.startX,y:Z.startY},{x:Et,y:_t}=Rr(Ze,J),Lt={startX:Ze.x,startY:Ze.y,x:H<Et?H:Et,y:U<_t?U:_t,width:Math.abs(H-Et),height:Math.abs(U-_t)},Yr=D.current,_n=R.current;D.current=new Set(uc(K,Lt,J,n===Bo.Partial,!0).map(st=>st.id)),R.current=new Set;const Nn=(ae==null?void 0:ae.selectable)??!0;for(const st of D.current){const bt=te.get(st);if(bt)for(const{edgeId:At}of bt.values()){const Cn=ee.get(At);Cn&&(Cn.selectable??Nn)&&R.current.add(At)}}if(!od(Yr,D.current)){const st=yr(K,D.current,!0);ne(st)}if(!od(_n,R.current)){const st=yr(ee,R.current);ie(st)}m.setState({userSelectionRect:Lt,userSelectionActive:!0,nodesSelectionActive:!1})}function F(){if(!o||!$.current)return;const[H,U]=cc(E.current,$.current,_);S({x:H,y:U}).then(Z=>{if(!O.current||!Z){k.current=requestAnimationFrame(F);return}const{x:J,y:K}=E.current;b(J,K),k.current=requestAnimationFrame(F)})}const W=()=>{cancelAnimationFrame(k.current),k.current=0,z.current=!1};I.useEffect(()=>()=>W(),[]);const B=H=>{const{userSelectionRect:U,transform:Z,resetSelectedElements:J}=m.getState();if(!$.current||!U)return;const{x:K,y:ee}=gt(H.nativeEvent,$.current);E.current={x:K,y:ee};const te=Rr({x:U.startX,y:U.startY},Z);if(!O.current){const ne=t?0:i;if(Math.hypot(K-te.x,ee-te.y)<=ne)return;J(),l==null||l(H)}O.current=!0,z.current||(F(),z.current=!0),b(K,ee)},G=H=>{var U,Z;if(!N){H.target===C.current&&m.getState().connection.inProgress&&(L.current=!0);return}H.button===0&&((Z=(U=H.target)==null?void 0:U.releasePointerCapture)==null||Z.call(U,H.pointerId),!p&&H.target===C.current&&m.getState().userSelectionRect&&(T==null||T(H)),m.setState({userSelectionActive:!1,userSelectionRect:null}),O.current&&(a==null||a(H),m.setState({nodesSelectionActive:D.current.size>0})),W())},q=H=>{var U,Z;(Z=(U=H.target)==null?void 0:U.releasePointerCapture)==null||Z.call(U,H.pointerId),W()},Q=r===!0||Array.isArray(r)&&r.includes(0);return y.jsxs("div",{className:Se(["react-flow__pane",{draggable:Q,dragging:x,selection:e}]),onClick:N?void 0:Gl(T,C),onContextMenu:Gl(A,C),onWheel:Gl(P,C),onPointerEnter:N?void 0:f,onPointerMove:N?B:g,onPointerUp:G,onPointerCancel:N?q:void 0,onPointerDownCapture:N?M:void 0,onClickCapture:N?j:void 0,onPointerLeave:v,ref:C,style:fl,children:[w,y.jsx(z_,{})]})}function ou({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:l,onError:a}=t.getState(),u=l.get(e);if(!u){a==null||a("012",wt.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var c;return(c=r==null?void 0:r.current)==null?void 0:c.blur()})):o([e])}function Ag({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,nodeClickDistance:s}){const l=de(),[a,u]=I.useState(!1),c=I.useRef();return I.useEffect(()=>{if(!t)return c.current=sE({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{ou({id:d,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}}),()=>{var d;(d=c.current)==null||d.destroy(),c.current=void 0}},[t,l,e]),I.useEffect(()=>{t||!e.current||!c.current||c.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:o,nodeClickDistance:s})},[n,r,t,i,e,o,s]),a}const A_=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Rg(){const e=de();return I.useCallback(n=>{const{nodeExtent:r,snapToGrid:o,snapGrid:i,nodesDraggable:s,onError:l,updateNodePositions:a,nodeLookup:u,nodeOrigin:c}=e.getState(),d=new Map,f=A_(s),g=o?i[0]:5,v=o?i[1]:5,w=n.direction.x*g*n.factor,k=n.direction.y*v*n.factor;for(const[,m]of u){if(!f(m))continue;let p={x:m.internals.positionAbsolute.x+w,y:m.internals.positionAbsolute.y+k};o&&(p=ii(p,i));const{position:h,positionAbsolute:x}=Zm({nodeId:m.id,nextPosition:p,nodeLookup:u,nodeExtent:r,nodeOrigin:c,onError:l});m.position=h,m.internals.positionAbsolute=x,d.set(m.id,m)}a(d)},[])}const xc=I.createContext(null),R_=xc.Provider;xc.Consumer;const Dg=()=>I.useContext(xc),D_=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Og=I.createContext(null);function O_({children:e}){const t=oe(D_,ye);return y.jsx(Og.Provider,{value:t,children:e})}function F_(){const e=I.useContext(Og);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const H_={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},V_=(e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:i,connection:s}=r,{fromHandle:l,toHandle:a,isValid:u}=s;if(!l&&!o)return H_;const c=(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:c,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:i===br.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!o,valid:c&&u}};function B_({type:e="source",position:t=X.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:l,children:a,className:u,onMouseDown:c,onTouchStart:d,...f},g){var z,T;const v=s||null,w=e==="target",k=de(),m=Dg(),{connectOnClick:p,noPanClassName:h,rfId:x}=F_(),{connectingFrom:S,connectingTo:_,clickConnecting:N,isPossibleEndHandle:C,connectionInProcess:$,clickConnectionInProcess:D,valid:R}=oe(V_(m,v,e),ye);m||(T=(z=k.getState()).onError)==null||T.call(z,"010",wt.error010());const L=A=>{const{defaultEdgeOptions:P,onConnect:j,hasDefaultEdges:M}=k.getState(),b={...P,...A};if(M){const{edges:F,setEdges:W,onError:B}=k.getState();W(S_(b,F,{onError:B}))}j==null||j(b),l==null||l(b)},O=A=>{if(!m)return;const P=ag(A.nativeEvent);if(o&&(P&&A.button===0||!P)){const j=k.getState();ru.onPointerDown(A.nativeEvent,{handleDomNode:A.currentTarget,autoPanOnConnect:j.autoPanOnConnect,connectionMode:j.connectionMode,connectionRadius:j.connectionRadius,domNode:j.domNode,nodeLookup:j.nodeLookup,lib:j.lib,isTarget:w,handleId:v,nodeId:m,flowId:j.rfId,panBy:j.panBy,cancelConnection:j.cancelConnection,onConnectStart:j.onConnectStart,onConnectEnd:(...M)=>{var b,F;return(F=(b=k.getState()).onConnectEnd)==null?void 0:F.call(b,...M)},updateConnection:j.updateConnection,onConnect:L,isValidConnection:n||((...M)=>{var b,F;return((F=(b=k.getState()).isValidConnection)==null?void 0:F.call(b,...M))??!0}),getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,autoPanSpeed:j.autoPanSpeed,dragThreshold:j.connectionDragThreshold})}P?c==null||c(A):d==null||d(A)},E=A=>{const{onClickConnectStart:P,onClickConnectEnd:j,connectionClickStartHandle:M,connectionMode:b,isValidConnection:F,lib:W,rfId:B,nodeLookup:G,connection:q}=k.getState();if(!m||!M&&!o)return;if(!M){P==null||P(A.nativeEvent,{nodeId:m,handleId:v,handleType:e}),k.setState({connectionClickStartHandle:{nodeId:m,type:e,id:v}});return}const Q=sg(A.target),H=n||F,{connection:U,isValid:Z}=ru.isValid(A.nativeEvent,{handle:{nodeId:m,id:v,type:e},connectionMode:b,fromNodeId:M.nodeId,fromHandleId:M.id||null,fromType:M.type,isValidConnection:H,flowId:B,doc:Q,lib:W,nodeLookup:G});Z&&U&&L(U);const J=structuredClone(q);delete J.inProgress,J.toPosition=J.toHandle?J.toHandle.position:null,j==null||j(A,J),k.setState({connectionClickStartHandle:null})};return y.jsx("div",{"data-handleid":v,"data-nodeid":m,"data-handlepos":t,"data-id":`${x}-${m}-${v}-${e}`,className:Se(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",h,u,{source:!w,target:w,connectable:r,connectablestart:o,connectableend:i,clickconnecting:N,connectingfrom:S,connectingto:_,valid:R,connectionindicator:r&&(!$||C)&&($||D?i:o)}]),onMouseDown:O,onTouchStart:O,onClick:p?E:void 0,ref:g,...f,children:a})}const Fr=I.memo(zg(B_));function U_({data:e,isConnectable:t,sourcePosition:n=X.Bottom}){return y.jsxs(y.Fragment,{children:[e==null?void 0:e.label,y.jsx(Fr,{type:"source",position:n,isConnectable:t})]})}function W_({data:e,isConnectable:t,targetPosition:n=X.Top,sourcePosition:r=X.Bottom}){return y.jsxs(y.Fragment,{children:[y.jsx(Fr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,y.jsx(Fr,{type:"source",position:r,isConnectable:t})]})}function Y_(){return null}function X_({data:e,isConnectable:t,targetPosition:n=X.Top}){return y.jsxs(y.Fragment,{children:[y.jsx(Fr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const bs={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Id={input:U_,default:W_,output:X_,group:Y_};function Q_(e){var t,n,r,o;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((o=e.style)==null?void 0:o.height)}}const K_=e=>{const{width:t,height:n,x:r,y:o}=oi(e.nodeLookup,{filter:i=>!!i.selected});return{width:mt(t)?t:null,height:mt(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function G_({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=de(),{width:o,height:i,transformString:s,userSelectionActive:l}=oe(K_,ye),a=Rg(),u=I.useRef(null);I.useEffect(()=>{var g;n||(g=u.current)==null||g.focus({preventScroll:!0})},[n]);const c=!l&&o!==null&&i!==null;if(Ag({nodeRef:u,disabled:!c}),!c)return null;const d=e?g=>{const v=r.getState().nodes.filter(w=>w.selected);e(g,v)}:void 0,f=g=>{Object.prototype.hasOwnProperty.call(bs,g.key)&&(g.preventDefault(),a({direction:bs[g.key],factor:g.shiftKey?4:1}))};return y.jsx("div",{className:Se(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:y.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:f,style:{width:o,height:i}})})}const Td=typeof window<"u"?window:void 0,q_=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Fg({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:l,deleteKeyCode:a,selectionKeyCode:u,selectionOnDrag:c,selectionMode:d,onSelectionStart:f,onSelectionEnd:g,multiSelectionKeyCode:v,panActivationKeyCode:w,zoomActivationKeyCode:k,elementsSelectable:m,zoomOnScroll:p,zoomOnPinch:h,panOnScroll:x,panOnScrollSpeed:S,panOnScrollMode:_,zoomOnDoubleClick:N,panOnDrag:C,autoPanOnSelection:$,defaultViewport:D,translateExtent:R,minZoom:L,maxZoom:O,preventScrolling:E,onSelectionContextMenu:z,noWheelClassName:T,noPanClassName:A,disableKeyboardA11y:P,onViewportChange:j,isControlledViewport:M}){const{nodesSelectionActive:b,userSelectionActive:F}=oe(q_,ye),W=Xo(u,{target:Td}),B=Xo(w,{target:Td}),G=B||C,q=B||x,Q=c&&G!==!0,H=W||F||Q;return j_({deleteKeyCode:a,multiSelectionKeyCode:v}),y.jsx(I_,{onPaneContextMenu:i,elementsSelectable:m,zoomOnScroll:p,zoomOnPinch:h,panOnScroll:q,panActivationKeyPressed:B,panOnScrollSpeed:S,panOnScrollMode:_,zoomOnDoubleClick:N,panOnDrag:!W&&G,defaultViewport:D,translateExtent:R,minZoom:L,maxZoom:O,zoomActivationKeyCode:k,preventScrolling:E,noWheelClassName:T,noPanClassName:A,onViewportChange:j,isControlledViewport:M,paneClickDistance:l,selectionOnDrag:Q,children:y.jsxs(b_,{onSelectionStart:f,onSelectionEnd:g,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:G,autoPanOnSelection:$,isSelecting:!!H,selectionMode:d,selectionKeyPressed:W,paneClickDistance:l,selectionOnDrag:Q,children:[e,b&&y.jsx(G_,{onSelectionContextMenu:z,noPanClassName:A,disableKeyboardA11y:P})]})})}Fg.displayName="FlowRenderer";const Z_=I.memo(Fg),J_=e=>t=>e?uc(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function eN(e){return oe(I.useCallback(J_(e),[e]),ye)}const tN=e=>e.updateNodeInternals;function nN(){const e=oe(tN),[t]=I.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(o=>{const i=o.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:o.target,force:!0})}),e(r)}));return I.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function rN({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=de(),i=I.useRef(null),s=I.useRef(null),l=I.useRef(e.sourcePosition),a=I.useRef(e.targetPosition),u=I.useRef(t),c=n&&!!e.internals.handleBounds;return I.useEffect(()=>{i.current&&!e.hidden&&(!c||s.current!==i.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(i.current),s.current=i.current)},[c,e.hidden]),I.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),I.useEffect(()=>{if(i.current){const d=u.current!==t,f=l.current!==e.sourcePosition,g=a.current!==e.targetPosition;(d||f||g)&&(u.current=t,l.current=e.sourcePosition,a.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function oN({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:i,onDoubleClick:s,nodesDraggable:l,elementsSelectable:a,nodesConnectable:u,nodesFocusable:c,resizeObserver:d,noDragClassName:f,noPanClassName:g,disableKeyboardA11y:v,rfId:w,nodeTypes:k,nodeClickDistance:m,onError:p}){const{node:h,internals:x,isParent:S}=oe(H=>{const U=H.nodeLookup.get(e),Z=H.parentLookup.has(e);return{node:U,internals:U.internals,isParent:Z}},ye);let _=h.type||"default",N=(k==null?void 0:k[_])||Id[_];N===void 0&&(p==null||p("003",wt.error003(_)),_="default",N=(k==null?void 0:k.default)||Id.default);const C=!!(h.draggable||l&&typeof h.draggable>"u"),$=!!(h.selectable||a&&typeof h.selectable>"u"),D=!!(h.connectable||u&&typeof h.connectable>"u"),R=!!(h.focusable||c&&typeof h.focusable>"u"),L=de(),O=rg(h),E=rN({node:h,nodeType:_,hasDimensions:O,resizeObserver:d}),z=Ag({nodeRef:E,disabled:h.hidden||!C,noDragClassName:f,handleSelector:h.dragHandle,nodeId:e,isSelectable:$,nodeClickDistance:m}),T=Rg();if(h.hidden)return null;const A=kt(h),P=Q_(h),j=$||C||t||n||r||o,M=n?H=>n(H,{...x.userNode}):void 0,b=r?H=>r(H,{...x.userNode}):void 0,F=o?H=>o(H,{...x.userNode}):void 0,W=i?H=>i(H,{...x.userNode}):void 0,B=s?H=>s(H,{...x.userNode}):void 0,G=H=>{const{selectNodesOnDrag:U,nodeDragThreshold:Z}=L.getState();$&&(!U||!C||Z>0)&&ou({id:e,store:L,nodeRef:E}),t&&t(H,{...x.userNode})},q=H=>{if(!(lg(H.nativeEvent)||v)){if(Qm.includes(H.key)&&$){const U=H.key==="Escape";ou({id:e,store:L,unselect:U,nodeRef:E})}else if(C&&h.selected&&Object.prototype.hasOwnProperty.call(bs,H.key)){H.preventDefault();const{ariaLabelConfig:U}=L.getState();L.setState({ariaLiveMessage:U["node.a11yDescription.ariaLiveMessage"]({direction:H.key.replace("Arrow","").toLowerCase(),x:~~x.positionAbsolute.x,y:~~x.positionAbsolute.y})}),T({direction:bs[H.key],factor:H.shiftKey?4:1})}}},Q=()=>{var te;if(v||!((te=E.current)!=null&&te.matches(":focus-visible")))return;const{transform:H,width:U,height:Z,autoPanOnNodeFocus:J,setCenter:K}=L.getState();if(!J)return;uc(new Map([[e,h]]),{x:0,y:0,width:U,height:Z},H,!0).length>0||K(h.position.x+A.width/2,h.position.y+A.height/2,{zoom:H[2]})};return y.jsx("div",{className:Se(["react-flow__node",`react-flow__node-${_}`,{[g]:C},h.className,{selected:h.selected,selectable:$,parent:S,draggable:C,dragging:z}]),ref:E,style:{zIndex:x.z,transform:`translate(${x.positionAbsolute.x}px,${x.positionAbsolute.y}px)`,pointerEvents:j?"all":"none",visibility:O?"visible":"hidden",...h.style,...P},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:M,onMouseMove:b,onMouseLeave:F,onContextMenu:W,onClick:G,onDoubleClick:B,onKeyDown:R?q:void 0,tabIndex:R?0:void 0,onFocus:R?Q:void 0,role:h.ariaRole??(R?"group":void 0),"aria-roledescription":"node","aria-describedby":v?void 0:`${Pg}-${w}`,"aria-label":h.ariaLabel,...h.domAttributes,children:y.jsx(R_,{value:e,children:y.jsx(N,{id:e,data:h.data,type:_,positionAbsoluteX:x.positionAbsolute.x,positionAbsoluteY:x.positionAbsolute.y,selected:h.selected??!1,selectable:$,draggable:C,deletable:h.deletable??!0,isConnectable:D,sourcePosition:h.sourcePosition,targetPosition:h.targetPosition,dragging:z,dragHandle:h.dragHandle,zIndex:x.z,parentId:h.parentId,...A})})})}var iN=I.memo(oN);const sN=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Hg(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:o}=oe(sN,ye),i=eN(e.onlyRenderVisibleElements),s=nN();return y.jsx("div",{className:"react-flow__nodes",style:fl,children:i.map(l=>y.jsx(iN,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:o},l))})}Hg.displayName="NodeRenderer";const lN=I.memo(Hg);function aN(e){return oe(I.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const r=[];if(n.width&&n.height)for(const o of n.edges){const i=n.nodeLookup.get(o.source),s=n.nodeLookup.get(o.target);i&&s&&Hk({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(o.id)}return r},[e]),ye)}const uN=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return y.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},cN=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return y.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},zd={[Uo.Arrow]:uN,[Uo.ArrowClosed]:cN};function fN(e){const t=de();return I.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(zd,e)?zd[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",wt.error009(e)),null)},[e])}const dN=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const a=fN(t);return a?y.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:y.jsx(a,{color:n,strokeWidth:s})}):null},Vg=({defaultColor:e,rfId:t})=>{const n=oe(i=>i.edges),r=oe(i=>i.defaultEdgeOptions),o=I.useMemo(()=>Kk(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return o.length?y.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:y.jsx("defs",{children:o.map(i=>y.jsx(dN,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};Vg.displayName="MarkerDefinitions";var hN=I.memo(Vg);function Bg({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:a,className:u,...c}){const[d,f]=I.useState({x:1,y:0,width:0,height:0}),g=Se(["react-flow__edge-textwrapper",u]),v=I.useRef(null);return I.useEffect(()=>{if(v.current){const w=v.current.getBBox();f({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?y.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:g,visibility:d.width?"visible":"hidden",...c,children:[o&&y.jsx("rect",{width:d.width+2*s[0],x:-s[0],y:-s[1],height:d.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),y.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:v,style:r,children:n}),a]}):null}Bg.displayName="EdgeText";const pN=I.memo(Bg);function li({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a,interactionWidth:u=20,...c}){return y.jsxs(y.Fragment,{children:[y.jsx("path",{...c,d:e,fill:"none",className:Se(["react-flow__edge-path",c.className])}),u?y.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&mt(t)&&mt(n)?y.jsx(pN,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a}):null]})}function Ld({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===X.Left||e===X.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Ug({sourceX:e,sourceY:t,sourcePosition:n=X.Bottom,targetX:r,targetY:o,targetPosition:i=X.Top}){const[s,l]=Ld({pos:n,x1:e,y1:t,x2:r,y2:o}),[a,u]=Ld({pos:i,x1:r,y1:o,x2:e,y2:t}),[c,d,f,g]=ug({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:a,targetControlY:u});return[`M${e},${t} C${s},${l} ${a},${u} ${r},${o}`,c,d,f,g]}function Wg(e){return I.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s,targetPosition:l,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:v,markerEnd:w,markerStart:k,interactionWidth:m})=>{const[p,h,x]=Ug({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l}),S=e.isInternal?void 0:t;return y.jsx(li,{id:S,path:p,labelX:h,labelY:x,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:v,markerEnd:w,markerStart:k,interactionWidth:m})})}const mN=Wg({isInternal:!1}),Yg=Wg({isInternal:!0});mN.displayName="SimpleBezierEdge";Yg.displayName="SimpleBezierEdgeInternal";function Xg(e){return I.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,sourcePosition:g=X.Bottom,targetPosition:v=X.Top,markerEnd:w,markerStart:k,pathOptions:m,interactionWidth:p})=>{const[h,x,S]=eu({sourceX:n,sourceY:r,sourcePosition:g,targetX:o,targetY:i,targetPosition:v,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset,stepPosition:m==null?void 0:m.stepPosition}),_=e.isInternal?void 0:t;return y.jsx(li,{id:_,path:h,labelX:x,labelY:S,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:w,markerStart:k,interactionWidth:p})})}const Qg=Xg({isInternal:!1}),Kg=Xg({isInternal:!0});Qg.displayName="SmoothStepEdge";Kg.displayName="SmoothStepEdgeInternal";function Gg(e){return I.memo(({id:t,...n})=>{var o;const r=e.isInternal?void 0:t;return y.jsx(Qg,{...n,id:r,pathOptions:I.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const gN=Gg({isInternal:!1}),qg=Gg({isInternal:!0});gN.displayName="StepEdge";qg.displayName="StepEdgeInternal";function Zg(e){return I.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:g,markerStart:v,interactionWidth:w})=>{const[k,m,p]=fg({sourceX:n,sourceY:r,targetX:o,targetY:i}),h=e.isInternal?void 0:t;return y.jsx(li,{id:h,path:k,labelX:m,labelY:p,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:g,markerStart:v,interactionWidth:w})})}const yN=Zg({isInternal:!1}),Jg=Zg({isInternal:!0});yN.displayName="StraightEdge";Jg.displayName="StraightEdgeInternal";function e0(e){return I.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s=X.Bottom,targetPosition:l=X.Top,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:v,markerEnd:w,markerStart:k,pathOptions:m,interactionWidth:p})=>{const[h,x,S]=hc({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l,curvature:m==null?void 0:m.curvature}),_=e.isInternal?void 0:t;return y.jsx(li,{id:_,path:h,labelX:x,labelY:S,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:v,markerEnd:w,markerStart:k,interactionWidth:p})})}const vN=e0({isInternal:!1}),t0=e0({isInternal:!0});vN.displayName="BezierEdge";t0.displayName="BezierEdgeInternal";const bd={default:t0,straight:Jg,step:qg,smoothstep:Kg,simplebezier:Yg},Ad={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},xN=(e,t,n)=>n===X.Left?e-t:n===X.Right?e+t:e,wN=(e,t,n)=>n===X.Top?e-t:n===X.Bottom?e+t:e,Rd="react-flow__edgeupdater";function Dd({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:l}){return y.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:Se([Rd,`${Rd}-${l}`]),cx:xN(t,r,e),cy:wN(n,r,e),r,stroke:"transparent",fill:"transparent"})}function SN({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:i,targetY:s,sourcePosition:l,targetPosition:a,onReconnect:u,onReconnectStart:c,onReconnectEnd:d,setReconnecting:f,setUpdateHover:g}){const v=de(),w=(x,S)=>{if(x.button!==0)return;const{autoPanOnConnect:_,domNode:N,connectionMode:C,connectionRadius:$,lib:D,onConnectStart:R,cancelConnection:L,nodeLookup:O,rfId:E,panBy:z,updateConnection:T}=v.getState(),A=S.type==="target",P=(b,F)=>{f(!1),d==null||d(b,n,S.type,F)},j=b=>u==null?void 0:u(n,b),M=(b,F)=>{f(!0),c==null||c(x,n,S.type),R==null||R(b,F)};ru.onPointerDown(x.nativeEvent,{autoPanOnConnect:_,connectionMode:C,connectionRadius:$,domNode:N,handleId:S.id,nodeId:S.nodeId,nodeLookup:O,isTarget:A,edgeUpdaterType:S.type,lib:D,flowId:E,cancelConnection:L,panBy:z,isValidConnection:(...b)=>{var F,W;return((W=(F=v.getState()).isValidConnection)==null?void 0:W.call(F,...b))??!0},onConnect:j,onConnectStart:M,onConnectEnd:(...b)=>{var F,W;return(W=(F=v.getState()).onConnectEnd)==null?void 0:W.call(F,...b)},onReconnectEnd:P,updateConnection:T,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,dragThreshold:v.getState().connectionDragThreshold,handleDomNode:x.currentTarget})},k=x=>w(x,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=x=>w(x,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),p=()=>g(!0),h=()=>g(!1);return y.jsxs(y.Fragment,{children:[(e===!0||e==="source")&&y.jsx(Dd,{position:l,centerX:r,centerY:o,radius:t,onMouseDown:k,onMouseEnter:p,onMouseOut:h,type:"source"}),(e===!0||e==="target")&&y.jsx(Dd,{position:a,centerX:i,centerY:s,radius:t,onMouseDown:m,onMouseEnter:p,onMouseOut:h,type:"target"})]})}function kN({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:i,onContextMenu:s,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,reconnectRadius:c,onReconnect:d,onReconnectStart:f,onReconnectEnd:g,rfId:v,edgeTypes:w,noPanClassName:k,onError:m,disableKeyboardA11y:p}){let h=oe(K=>K.edgeLookup.get(e));const x=oe(K=>K.defaultEdgeOptions);h=x?{...x,...h}:h;let S=h.type||"default",_=(w==null?void 0:w[S])||bd[S];_===void 0&&(m==null||m("011",wt.error011(S)),S="default",_=(w==null?void 0:w.default)||bd.default);const N=!!(h.focusable||t&&typeof h.focusable>"u"),C=typeof d<"u"&&(h.reconnectable||n&&typeof h.reconnectable>"u"),$=!!(h.selectable||r&&typeof h.selectable>"u"),D=I.useRef(null),[R,L]=I.useState(!1),[O,E]=I.useState(!1),z=de(),{zIndex:T=h.zIndex,sourceX:A,sourceY:P,targetX:j,targetY:M,sourcePosition:b,targetPosition:F}=oe(I.useCallback(K=>{const ee=K.nodeLookup.get(h.source),te=K.nodeLookup.get(h.target);if(!ee||!te)return Ad;const ne=Qk({id:e,sourceNode:ee,targetNode:te,sourceHandle:h.sourceHandle||null,targetHandle:h.targetHandle||null,connectionMode:K.connectionMode,onError:m}),ie=Fk({selected:h.selected,zIndex:h.zIndex,sourceNode:ee,targetNode:te,elevateOnSelect:K.elevateEdgesOnSelect,zIndexMode:K.zIndexMode});return{...ne||Ad,zIndex:ie}},[h.source,h.target,h.sourceHandle,h.targetHandle,h.selected,h.zIndex,m]),ye),W=I.useMemo(()=>h.markerStart?`url('#${tu(h.markerStart,v)}')`:void 0,[h.markerStart,v]),B=I.useMemo(()=>h.markerEnd?`url('#${tu(h.markerEnd,v)}')`:void 0,[h.markerEnd,v]);if(h.hidden||A===null||P===null||j===null||M===null)return null;const G=K=>{var ie;const{addSelectedEdges:ee,unselectNodesAndEdges:te,multiSelectionActive:ne}=z.getState();$&&(z.setState({nodesSelectionActive:!1}),h.selected&&ne?(te({nodes:[],edges:[h]}),(ie=D.current)==null||ie.blur()):ee([e])),o&&o(K,h)},q=i?K=>{i(K,{...h})}:void 0,Q=s?K=>{s(K,{...h})}:void 0,H=l?K=>{l(K,{...h})}:void 0,U=a?K=>{a(K,{...h})}:void 0,Z=u?K=>{u(K,{...h})}:void 0,J=K=>{var ee;if(!p&&Qm.includes(K.key)&&$){const{unselectNodesAndEdges:te,addSelectedEdges:ne}=z.getState();K.key==="Escape"?((ee=D.current)==null||ee.blur(),te({edges:[h]})):ne([e])}};return y.jsx("svg",{style:{zIndex:T},children:y.jsxs("g",{className:Se(["react-flow__edge",`react-flow__edge-${S}`,h.className,k,{selected:h.selected,animated:h.animated,inactive:!$&&!o,updating:R,selectable:$}]),onClick:G,onDoubleClick:q,onContextMenu:Q,onMouseEnter:H,onMouseMove:U,onMouseLeave:Z,onKeyDown:N?J:void 0,tabIndex:N?0:void 0,role:h.ariaRole??(N?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":h.ariaLabel===null?void 0:h.ariaLabel||`Edge from ${h.source} to ${h.target}`,"aria-describedby":N?`${$g}-${v}`:void 0,ref:D,...h.domAttributes,children:[!O&&y.jsx(_,{id:e,source:h.source,target:h.target,type:h.type,selected:h.selected,animated:h.animated,selectable:$,deletable:h.deletable??!0,label:h.label,labelStyle:h.labelStyle,labelShowBg:h.labelShowBg,labelBgStyle:h.labelBgStyle,labelBgPadding:h.labelBgPadding,labelBgBorderRadius:h.labelBgBorderRadius,sourceX:A,sourceY:P,targetX:j,targetY:M,sourcePosition:b,targetPosition:F,data:h.data,style:h.style,sourceHandleId:h.sourceHandle,targetHandleId:h.targetHandle,markerStart:W,markerEnd:B,pathOptions:"pathOptions"in h?h.pathOptions:void 0,interactionWidth:h.interactionWidth}),C&&y.jsx(SN,{edge:h,isReconnectable:C,reconnectRadius:c,onReconnect:d,onReconnectStart:f,onReconnectEnd:g,sourceX:A,sourceY:P,targetX:j,targetY:M,sourcePosition:b,targetPosition:F,setUpdateHover:L,setReconnecting:E})]})})}var EN=I.memo(kN);const _N=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function n0({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:a,onEdgeMouseLeave:u,onEdgeClick:c,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:g,onReconnectEnd:v,disableKeyboardA11y:w}){const{edgesFocusable:k,edgesReconnectable:m,elementsSelectable:p,onError:h}=oe(_N,ye),x=aN(t);return y.jsxs("div",{className:"react-flow__edges",children:[y.jsx(hN,{defaultColor:e,rfId:n}),x.map(S=>y.jsx(EN,{id:S,edgesFocusable:k,edgesReconnectable:m,elementsSelectable:p,noPanClassName:o,onReconnect:i,onContextMenu:s,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,onClick:c,reconnectRadius:d,onDoubleClick:f,onReconnectStart:g,onReconnectEnd:v,rfId:n,onError:h,edgeTypes:r,disableKeyboardA11y:w},S))]})}n0.displayName="EdgeRenderer";const NN=I.memo(n0),Od=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function CN({children:e}){const t=de(),n=I.useRef(null),[r]=I.useState(()=>t.getState().transform);return Lg(()=>{let o=null;const i=()=>{const s=t.getState().transform;o&&s[0]===o[0]&&s[1]===o[1]&&s[2]===o[2]||(o=s,n.current&&(n.current.style.transform=Od(s)))};return i(),t.subscribe(i)},[t]),y.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:Od(r)},children:e})}function MN(e){const t=cl(),n=I.useRef(!1);I.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const jN=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function PN(e){const t=oe(jN),n=de();return I.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function $N(e){return e.connection.inProgress?{...e.connection,to:si(e.connection.to,e.transform)}:{...e.connection}}function IN(e){return $N}function TN(e){const t=IN();return oe(t,ye)}const zN=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function LN({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:i,height:s,isValid:l,inProgress:a}=oe(zN,ye);return!(i&&o&&a)?null:y.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:y.jsx("g",{className:Se(["react-flow__connection",ig(l)]),children:y.jsx(r0,{style:t,type:n,CustomComponent:r,isValid:l})})})}const r0=({style:e,type:t=ln.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:o,from:i,fromNode:s,fromHandle:l,fromPosition:a,to:u,toNode:c,toHandle:d,toPosition:f,pointer:g}=TN();if(!o)return;if(n)return y.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:a,toPosition:f,connectionStatus:ig(r),toNode:c,toHandle:d,pointer:g});let v="";const w={sourceX:i.x,sourceY:i.y,sourcePosition:a,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case ln.Bezier:[v]=hc(w);break;case ln.SimpleBezier:[v]=Ug(w);break;case ln.Step:[v]=eu({...w,borderRadius:0});break;case ln.SmoothStep:[v]=eu(w);break;default:[v]=fg(w)}return y.jsx("path",{d:v,fill:"none",className:"react-flow__connection-path",style:e})};r0.displayName="ConnectionLine";const bN={};function Fd(e=bN){I.useRef(e),de(),I.useEffect(()=>{},[e])}function AN(){de(),I.useRef(!1),I.useEffect(()=>{},[])}function o0({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:c,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:g,connectionLineType:v,connectionLineStyle:w,connectionLineComponent:k,connectionLineContainerStyle:m,selectionKeyCode:p,selectionOnDrag:h,selectionMode:x,multiSelectionKeyCode:S,panActivationKeyCode:_,zoomActivationKeyCode:N,deleteKeyCode:C,onlyRenderVisibleElements:$,elementsSelectable:D,defaultViewport:R,translateExtent:L,minZoom:O,maxZoom:E,preventScrolling:z,defaultMarkerColor:T,zoomOnScroll:A,zoomOnPinch:P,panOnScroll:j,panOnScrollSpeed:M,panOnScrollMode:b,zoomOnDoubleClick:F,panOnDrag:W,autoPanOnSelection:B,onPaneClick:G,onPaneMouseEnter:q,onPaneMouseMove:Q,onPaneMouseLeave:H,onPaneScroll:U,onPaneContextMenu:Z,paneClickDistance:J,nodeClickDistance:K,onEdgeContextMenu:ee,onEdgeMouseEnter:te,onEdgeMouseMove:ne,onEdgeMouseLeave:ie,reconnectRadius:ae,onReconnect:Ze,onReconnectStart:Et,onReconnectEnd:_t,noDragClassName:Lt,noWheelClassName:Yr,noPanClassName:_n,disableKeyboardA11y:Nn,nodeExtent:st,rfId:bt,viewport:At,onViewportChange:Cn,nodesDraggable:hl}){return Fd(e),Fd(t),AN(),MN(n),PN(At),y.jsx(Z_,{onPaneClick:G,onPaneMouseEnter:q,onPaneMouseMove:Q,onPaneMouseLeave:H,onPaneContextMenu:Z,onPaneScroll:U,paneClickDistance:J,deleteKeyCode:C,selectionKeyCode:p,selectionOnDrag:h,selectionMode:x,onSelectionStart:f,onSelectionEnd:g,multiSelectionKeyCode:S,panActivationKeyCode:_,zoomActivationKeyCode:N,elementsSelectable:D,zoomOnScroll:A,zoomOnPinch:P,zoomOnDoubleClick:F,panOnScroll:j,panOnScrollSpeed:M,panOnScrollMode:b,panOnDrag:W,autoPanOnSelection:B,defaultViewport:R,translateExtent:L,minZoom:O,maxZoom:E,onSelectionContextMenu:d,preventScrolling:z,noDragClassName:Lt,noWheelClassName:Yr,noPanClassName:_n,disableKeyboardA11y:Nn,onViewportChange:Cn,isControlledViewport:!!At,children:y.jsxs(CN,{children:[y.jsx(NN,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:s,onReconnect:Ze,onReconnectStart:Et,onReconnectEnd:_t,onlyRenderVisibleElements:$,onEdgeContextMenu:ee,onEdgeMouseEnter:te,onEdgeMouseMove:ne,onEdgeMouseLeave:ie,reconnectRadius:ae,defaultMarkerColor:T,noPanClassName:_n,disableKeyboardA11y:Nn,rfId:bt}),y.jsx(LN,{style:w,type:v,component:k,containerStyle:m}),y.jsx("div",{className:"react-flow__edgelabel-renderer"}),y.jsx(lN,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:c,nodeClickDistance:K,onlyRenderVisibleElements:$,noPanClassName:_n,noDragClassName:Lt,disableKeyboardA11y:Nn,nodeExtent:st,rfId:bt,nodesDraggable:hl}),y.jsx("div",{className:"react-flow__viewport-portal"})]})})}o0.displayName="GraphView";const RN=I.memo(o0),DN=ng(),Hd=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a=.5,maxZoom:u=2,nodeOrigin:c,nodeExtent:d,zIndexMode:f="basic"}={})=>{const g=new Map,v=new Map,w=new Map,k=new Map,m=r??t??[],p=n??e??[],h=c??[0,0],x=d??Vo;pg(w,k,m);const{nodesInitialized:S}=nu(p,g,v,{nodeOrigin:h,nodeExtent:x,zIndexMode:f});let _=[0,0,1];if(s&&o&&i){const N=oi(g,{filter:R=>!!((R.width||R.initialWidth)&&(R.height||R.initialHeight))}),{x:C,y:$,zoom:D}=fc(N,o,i,a,u,(l==null?void 0:l.padding)??.1);_=[C,$,D]}return{rfId:"1",width:o??0,height:i??0,transform:_,nodes:p,nodesInitialized:S,nodeLookup:g,parentLookup:v,edges:m,edgeLookup:k,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:a,maxZoom:u,translateExtent:Vo,nodeExtent:x,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:br.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:h,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:l,fitViewResolver:null,connection:{...Gm},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:DN,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Km,zIndexMode:f,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},ON=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a,maxZoom:u,nodeOrigin:c,nodeExtent:d,zIndexMode:f})=>qE((g,v)=>{async function w(){const{nodeLookup:k,panZoom:m,fitViewOptions:p,fitViewResolver:h,width:x,height:S,minZoom:_,maxZoom:N}=v();m&&(await zk({nodes:k,width:x,height:S,panZoom:m,minZoom:_,maxZoom:N},p),h==null||h.resolve(!0),g({fitViewResolver:null}))}return{...Hd({nodes:e,edges:t,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a,maxZoom:u,nodeOrigin:c,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:k=>{const{nodeLookup:m,parentLookup:p,nodeOrigin:h,nodeExtent:x,elevateNodesOnSelect:S,fitViewQueued:_,zIndexMode:N,nodesSelectionActive:C}=v(),{nodesInitialized:$,hasSelectedNodes:D}=nu(k,m,p,{nodeOrigin:h,nodeExtent:x,elevateNodesOnSelect:S,checkEquality:!0,zIndexMode:N}),R=C&&D;_&&$?(w(),g({nodes:k,nodesInitialized:$,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:R})):g({nodes:k,nodesInitialized:$,nodesSelectionActive:R})},setEdges:k=>{const{connectionLookup:m,edgeLookup:p}=v();pg(m,p,k),g({edges:k})},setDefaultNodesAndEdges:(k,m)=>{if(k){const{setNodes:p}=v();p(k),g({hasDefaultNodes:!0})}if(m){const{setEdges:p}=v();p(m),g({hasDefaultEdges:!0})}},updateNodeInternals:k=>{const{triggerNodeChanges:m,nodeLookup:p,parentLookup:h,domNode:x,nodeOrigin:S,nodeExtent:_,debug:N,fitViewQueued:C,zIndexMode:$}=v(),{changes:D,updatedInternals:R}=nE(k,p,h,x,S,_,$);R&&(Zk(p,h,{nodeOrigin:S,nodeExtent:_,zIndexMode:$}),C?(w(),g({fitViewQueued:!1,fitViewOptions:void 0})):g({}),(D==null?void 0:D.length)>0&&(N&&console.log("React Flow: trigger node changes",D),m==null||m(D)))},updateNodePositions:(k,m=!1)=>{const p=[];let h=[];const{nodeLookup:x,triggerNodeChanges:S,connection:_,updateConnection:N,onNodesChangeMiddlewareMap:C}=v();for(const[$,D]of k){const R=x.get($),L=!!(R!=null&&R.expandParent&&(R!=null&&R.parentId)&&(D!=null&&D.position)),O={id:$,type:"position",position:L?{x:Math.max(0,D.position.x),y:Math.max(0,D.position.y)}:D.position,dragging:m};if(R&&_.inProgress&&_.fromNode.id===R.id){const E=Gn(R,_.fromHandle,X.Left,!0);N({..._,from:E})}L&&R.parentId&&p.push({id:$,parentId:R.parentId,rect:{...D.internals.positionAbsolute,width:D.measured.width??0,height:D.measured.height??0}}),h.push(O)}if(p.length>0){const{parentLookup:$,nodeOrigin:D}=v(),R=vc(p,x,$,D);h.push(...R)}for(const $ of C.values())h=$(h);S(h)},triggerNodeChanges:k=>{const{onNodesChange:m,setNodes:p,nodes:h,hasDefaultNodes:x,debug:S}=v();if(k!=null&&k.length){if(x){const _=v_(k,h);p(_)}S&&console.log("React Flow: trigger node changes",k),m==null||m(k)}},triggerEdgeChanges:k=>{const{onEdgesChange:m,setEdges:p,edges:h,hasDefaultEdges:x,debug:S}=v();if(k!=null&&k.length){if(x){const _=x_(k,h);p(_)}S&&console.log("React Flow: trigger edge changes",k),m==null||m(k)}},addSelectedNodes:k=>{const{multiSelectionActive:m,edgeLookup:p,nodeLookup:h,triggerNodeChanges:x,triggerEdgeChanges:S}=v();if(m){const _=k.map(N=>Pn(N,!0));x(_);return}x(yr(h,new Set([...k]),!0)),S(yr(p))},addSelectedEdges:k=>{const{multiSelectionActive:m,edgeLookup:p,nodeLookup:h,triggerNodeChanges:x,triggerEdgeChanges:S}=v();if(m){const _=k.map(N=>Pn(N,!0));S(_);return}S(yr(p,new Set([...k]))),x(yr(h,new Set,!0))},unselectNodesAndEdges:({nodes:k,edges:m}={})=>{const{edges:p,nodes:h,nodeLookup:x,triggerNodeChanges:S,triggerEdgeChanges:_}=v(),N=k||h,C=m||p,$=[];for(const R of N){if(!R.selected)continue;const L=x.get(R.id);L&&(L.selected=!1),$.push(Pn(R.id,!1))}const D=[];for(const R of C)R.selected&&D.push(Pn(R.id,!1));S($),_(D)},setMinZoom:k=>{const{panZoom:m,maxZoom:p}=v();m==null||m.setScaleExtent([k,p]),g({minZoom:k})},setMaxZoom:k=>{const{panZoom:m,minZoom:p}=v();m==null||m.setScaleExtent([p,k]),g({maxZoom:k})},setTranslateExtent:k=>{var m;(m=v().panZoom)==null||m.setTranslateExtent(k),g({translateExtent:k})},resetSelectedElements:()=>{const{edges:k,nodes:m,triggerNodeChanges:p,triggerEdgeChanges:h,elementsSelectable:x}=v();if(!x)return;const S=m.reduce((N,C)=>C.selected?[...N,Pn(C.id,!1)]:N,[]),_=k.reduce((N,C)=>C.selected?[...N,Pn(C.id,!1)]:N,[]);p(S),h(_)},setNodeExtent:k=>{const{nodes:m,nodeLookup:p,parentLookup:h,nodeOrigin:x,elevateNodesOnSelect:S,nodeExtent:_,zIndexMode:N}=v();k[0][0]===_[0][0]&&k[0][1]===_[0][1]&&k[1][0]===_[1][0]&&k[1][1]===_[1][1]||(nu(m,p,h,{nodeOrigin:x,nodeExtent:k,elevateNodesOnSelect:S,checkEquality:!1,zIndexMode:N}),g({nodeExtent:k}))},panBy:k=>{const{transform:m,width:p,height:h,panZoom:x,translateExtent:S}=v();return rE({delta:k,panZoom:x,transform:m,translateExtent:S,width:p,height:h})},setCenter:async(k,m,p)=>{const{width:h,height:x,maxZoom:S,panZoom:_}=v();if(!_)return!1;const N=typeof(p==null?void 0:p.zoom)<"u"?p.zoom:S;return await _.setViewport({x:h/2-k*N,y:x/2-m*N,zoom:N},{duration:p==null?void 0:p.duration,ease:p==null?void 0:p.ease,interpolate:p==null?void 0:p.interpolate}),!0},cancelConnection:()=>{g({connection:{...Gm}})},updateConnection:k=>{g({connection:k})},reset:()=>g({...Hd()})}},Object.is);function i0({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:i,initialMinZoom:s,initialMaxZoom:l,initialFitViewOptions:a,fitView:u,nodeOrigin:c,nodeExtent:d,zIndexMode:f,children:g}){const[v]=I.useState(()=>ON({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:u,minZoom:s,maxZoom:l,fitViewOptions:a,nodeOrigin:c,nodeExtent:d,zIndexMode:f}));return y.jsx(ZE,{value:v,children:y.jsx(__,{children:y.jsx(O_,{children:g})})})}function FN({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:i,height:s,fitView:l,fitViewOptions:a,minZoom:u,maxZoom:c,nodeOrigin:d,nodeExtent:f,zIndexMode:g}){return I.useContext(al)?y.jsx(y.Fragment,{children:e}):y.jsx(i0,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:i,initialHeight:s,fitView:l,initialFitViewOptions:a,initialMinZoom:u,initialMaxZoom:c,nodeOrigin:d,nodeExtent:f,zIndexMode:g,children:e})}const HN={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function VN({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i,edgeTypes:s,onNodeClick:l,onEdgeClick:a,onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onConnect:g,onConnectStart:v,onConnectEnd:w,onClickConnectStart:k,onClickConnectEnd:m,onNodeMouseEnter:p,onNodeMouseMove:h,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:_,onNodeDragStart:N,onNodeDrag:C,onNodeDragStop:$,onNodesDelete:D,onEdgesDelete:R,onDelete:L,onSelectionChange:O,onSelectionDragStart:E,onSelectionDrag:z,onSelectionDragStop:T,onSelectionContextMenu:A,onSelectionStart:P,onSelectionEnd:j,onBeforeDelete:M,connectionMode:b,connectionLineType:F=ln.Bezier,connectionLineStyle:W,connectionLineComponent:B,connectionLineContainerStyle:G,deleteKeyCode:q="Backspace",selectionKeyCode:Q="Shift",selectionOnDrag:H=!1,selectionMode:U=Bo.Full,panActivationKeyCode:Z="Space",multiSelectionKeyCode:J=Yo()?"Meta":"Control",zoomActivationKeyCode:K=Yo()?"Meta":"Control",snapToGrid:ee,snapGrid:te,onlyRenderVisibleElements:ne=!1,selectNodesOnDrag:ie,nodesDraggable:ae,autoPanOnNodeFocus:Ze,nodesConnectable:Et,nodesFocusable:_t,nodeOrigin:Lt=Ig,edgesFocusable:Yr,edgesReconnectable:_n,elementsSelectable:Nn=!0,defaultViewport:st=f_,minZoom:bt=.5,maxZoom:At=2,translateExtent:Cn=Vo,preventScrolling:hl=!0,nodeExtent:pl,defaultMarkerColor:S0="#b1b1b7",zoomOnScroll:k0=!0,zoomOnPinch:E0=!0,panOnScroll:_0=!1,panOnScrollSpeed:N0=.5,panOnScrollMode:C0=On.Free,zoomOnDoubleClick:M0=!0,panOnDrag:j0=!0,onPaneClick:P0,onPaneMouseEnter:$0,onPaneMouseMove:I0,onPaneMouseLeave:T0,onPaneScroll:z0,onPaneContextMenu:L0,paneClickDistance:b0=1,nodeClickDistance:A0=0,children:R0,onReconnect:D0,onReconnectStart:O0,onReconnectEnd:F0,onEdgeContextMenu:H0,onEdgeDoubleClick:V0,onEdgeMouseEnter:B0,onEdgeMouseMove:U0,onEdgeMouseLeave:W0,reconnectRadius:Y0=10,onNodesChange:X0,onEdgesChange:Q0,noDragClassName:K0="nodrag",noWheelClassName:G0="nowheel",noPanClassName:Sc="nopan",fitView:kc,fitViewOptions:Ec,connectOnClick:q0,attributionPosition:Z0,proOptions:J0,defaultEdgeOptions:ey,elevateNodesOnSelect:ty=!0,elevateEdgesOnSelect:ny=!1,disableKeyboardA11y:_c=!1,autoPanOnConnect:ry,autoPanOnNodeDrag:oy,autoPanOnSelection:iy=!0,autoPanSpeed:sy,connectionRadius:ly,isValidConnection:ay,onError:uy,style:cy,id:Nc,nodeDragThreshold:fy,connectionDragThreshold:dy,viewport:hy,onViewportChange:py,width:my,height:gy,colorMode:yy="light",debug:vy,onScroll:ui,ariaLabelConfig:xy,zIndexMode:Cc="basic",...wy},Sy){const ml=Nc||"1",ky=m_(yy),Ey=I.useCallback(Mc=>{Mc.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ui==null||ui(Mc)},[ui]);return y.jsx("div",{"data-testid":"rf__wrapper",...wy,onScroll:Ey,style:{...cy,...HN},ref:Sy,className:Se(["react-flow",o,ky]),id:Nc,role:"application",children:y.jsxs(FN,{nodes:e,edges:t,width:my,height:gy,fitView:kc,fitViewOptions:Ec,minZoom:bt,maxZoom:At,nodeOrigin:Lt,nodeExtent:pl,zIndexMode:Cc,children:[y.jsx(p_,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:g,onConnectStart:v,onConnectEnd:w,onClickConnectStart:k,onClickConnectEnd:m,nodesDraggable:ae,autoPanOnNodeFocus:Ze,nodesConnectable:Et,nodesFocusable:_t,edgesFocusable:Yr,edgesReconnectable:_n,elementsSelectable:Nn,elevateNodesOnSelect:ty,elevateEdgesOnSelect:ny,minZoom:bt,maxZoom:At,nodeExtent:pl,onNodesChange:X0,onEdgesChange:Q0,snapToGrid:ee,snapGrid:te,connectionMode:b,translateExtent:Cn,connectOnClick:q0,defaultEdgeOptions:ey,fitView:kc,fitViewOptions:Ec,onNodesDelete:D,onEdgesDelete:R,onDelete:L,onNodeDragStart:N,onNodeDrag:C,onNodeDragStop:$,onSelectionDrag:z,onSelectionDragStart:E,onSelectionDragStop:T,onMove:c,onMoveStart:d,onMoveEnd:f,noPanClassName:Sc,nodeOrigin:Lt,rfId:ml,autoPanOnConnect:ry,autoPanOnNodeDrag:oy,autoPanSpeed:sy,onError:uy,connectionRadius:ly,isValidConnection:ay,selectNodesOnDrag:ie,nodeDragThreshold:fy,connectionDragThreshold:dy,onBeforeDelete:M,debug:vy,ariaLabelConfig:xy,zIndexMode:Cc}),y.jsx(RN,{onInit:u,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:p,onNodeMouseMove:h,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:_,nodeTypes:i,edgeTypes:s,connectionLineType:F,connectionLineStyle:W,connectionLineComponent:B,connectionLineContainerStyle:G,selectionKeyCode:Q,selectionOnDrag:H,selectionMode:U,deleteKeyCode:q,multiSelectionKeyCode:J,panActivationKeyCode:Z,zoomActivationKeyCode:K,onlyRenderVisibleElements:ne,defaultViewport:st,translateExtent:Cn,minZoom:bt,maxZoom:At,preventScrolling:hl,zoomOnScroll:k0,zoomOnPinch:E0,zoomOnDoubleClick:M0,panOnScroll:_0,panOnScrollSpeed:N0,panOnScrollMode:C0,panOnDrag:j0,autoPanOnSelection:iy,onPaneClick:P0,onPaneMouseEnter:$0,onPaneMouseMove:I0,onPaneMouseLeave:T0,onPaneScroll:z0,onPaneContextMenu:L0,paneClickDistance:b0,nodeClickDistance:A0,onSelectionContextMenu:A,onSelectionStart:P,onSelectionEnd:j,onReconnect:D0,onReconnectStart:O0,onReconnectEnd:F0,onEdgeContextMenu:H0,onEdgeDoubleClick:V0,onEdgeMouseEnter:B0,onEdgeMouseMove:U0,onEdgeMouseLeave:W0,reconnectRadius:Y0,defaultMarkerColor:S0,noDragClassName:K0,noWheelClassName:G0,noPanClassName:Sc,rfId:ml,disableKeyboardA11y:_c,nodeExtent:pl,viewport:hy,onViewportChange:py,nodesDraggable:ae}),y.jsx(c_,{onSelectionChange:O}),R0,y.jsx(i_,{proOptions:J0,position:Z0}),y.jsx(o_,{rfId:ml,disableKeyboardA11y:_c})]})})}var BN=zg(VN);const UN=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function WN({children:e}){const t=oe(UN);return t?gm.createPortal(e,t):null}function YN({dimensions:e,lineWidth:t,variant:n,className:r}){return y.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Se(["react-flow__background-pattern",n,r])})}function XN({radius:e,className:t}){return y.jsx("circle",{cx:e,cy:e,r:e,className:Se(["react-flow__background-pattern","dots",t])})}var Wt;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Wt||(Wt={}));const QN={[Wt.Dots]:1,[Wt.Lines]:1,[Wt.Cross]:6},KN=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function s0({id:e,variant:t=Wt.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=0,color:s,bgColor:l,style:a,className:u,patternClassName:c}){const d=I.useRef(null),{transform:f,patternId:g}=oe(KN,ye),v=r||QN[t],w=t===Wt.Dots,k=t===Wt.Cross,m=Array.isArray(n)?n:[n,n],p=[m[0]*f[2]||1,m[1]*f[2]||1],h=v*f[2],x=Array.isArray(i)?i:[i,i],S=k?[h,h]:p,_=[x[0]*f[2]+S[0]/2,x[1]*f[2]+S[1]/2],N=`${g}${e||""}`;return y.jsxs("svg",{className:Se(["react-flow__background",u]),style:{...a,...fl,"--xy-background-color-props":l,"--xy-background-pattern-color-props":s},ref:d,"data-testid":"rf__background",children:[y.jsx("pattern",{id:N,x:f[0]%p[0],y:f[1]%p[1],width:p[0],height:p[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${_[0]},-${_[1]})`,children:w?y.jsx(XN,{radius:h/2,className:c}):y.jsx(YN,{dimensions:S,lineWidth:o,variant:t,className:c})}),y.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${N})`})]})}s0.displayName="Background";const GN=I.memo(s0);function qN(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:y.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function ZN(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:y.jsx("path",{d:"M0 0h32v4.2H0z"})})}function JN(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:y.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function e2(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function t2(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function bi({children:e,className:t,...n}){return y.jsx("button",{type:"button",className:Se(["react-flow__controls-button",t]),...n,children:e})}const n2=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function l0({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:l,onInteractiveChange:a,className:u,children:c,position:d="bottom-left",orientation:f="vertical","aria-label":g}){const v=de(),{isInteractive:w,minZoomReached:k,maxZoomReached:m,ariaLabelConfig:p}=oe(n2,ye),{zoomIn:h,zoomOut:x,fitView:S}=cl(),_=()=>{h(),i==null||i()},N=()=>{x(),s==null||s()},C=()=>{S(o),l==null||l()},$=()=>{v.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),a==null||a(!w)},D=f==="horizontal"?"horizontal":"vertical";return y.jsxs(ul,{className:Se(["react-flow__controls",D,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":g??p["controls.ariaLabel"],children:[t&&y.jsxs(y.Fragment,{children:[y.jsx(bi,{onClick:_,className:"react-flow__controls-zoomin",title:p["controls.zoomIn.ariaLabel"],"aria-label":p["controls.zoomIn.ariaLabel"],disabled:m,children:y.jsx(qN,{})}),y.jsx(bi,{onClick:N,className:"react-flow__controls-zoomout",title:p["controls.zoomOut.ariaLabel"],"aria-label":p["controls.zoomOut.ariaLabel"],disabled:k,children:y.jsx(ZN,{})})]}),n&&y.jsx(bi,{className:"react-flow__controls-fitview",onClick:C,title:p["controls.fitView.ariaLabel"],"aria-label":p["controls.fitView.ariaLabel"],children:y.jsx(JN,{})}),r&&y.jsx(bi,{className:"react-flow__controls-interactive",onClick:$,title:p["controls.interactive.ariaLabel"],"aria-label":p["controls.interactive.ariaLabel"],children:w?y.jsx(t2,{}):y.jsx(e2,{})}),c]})}l0.displayName="Controls";I.memo(l0);function r2({id:e,x:t,y:n,width:r,height:o,style:i,color:s,strokeColor:l,strokeWidth:a,className:u,borderRadius:c,shapeRendering:d,selected:f,onClick:g}){const{background:v,backgroundColor:w}=i||{},k=s||v||w;return y.jsx("rect",{className:Se(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:c,ry:c,width:r,height:o,style:{fill:k,stroke:l,strokeWidth:a},shapeRendering:d,onClick:g?m=>g(m,e):void 0})}const o2=I.memo(r2),i2=e=>e.nodes.map(t=>t.id),ql=e=>e instanceof Function?e:()=>e;function s2({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:i=o2,onClick:s}){const l=oe(i2,ye),a=ql(t),u=ql(e),c=ql(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return y.jsx(y.Fragment,{children:l.map(f=>y.jsx(a2,{id:f,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:c,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:i,onClick:s,shapeRendering:d},f))})}function l2({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:l,onClick:a}){const{node:u,x:c,y:d,width:f,height:g}=oe(v=>{const w=v.nodeLookup.get(e);if(!w)return{node:void 0,x:0,y:0,width:0,height:0};const k=w.internals.userNode,{x:m,y:p}=w.internals.positionAbsolute,{width:h,height:x}=kt(k);return{node:k,x:m,y:p,width:h,height:x}},ye);return!u||u.hidden||!rg(u)?null:y.jsx(l,{x:c,y:d,width:f,height:g,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:o,strokeColor:n(u),strokeWidth:i,shapeRendering:s,onClick:a,id:u.id})}const a2=I.memo(l2);var u2=I.memo(s2);const c2=200,f2=150,d2=e=>!e.hidden,h2=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};let n=!1;for(const r of e.nodeLookup.values())if(!r.hidden){n=!0;break}return{viewBB:t,boundingRect:n?eg(oi(e.nodeLookup,{filter:d2}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Vd=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,p2=(e,t)=>Vd(e.viewBB,t.viewBB)&&Vd(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,m2="react-flow__minimap-desc";function a0({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:l,bgColor:a,maskColor:u,maskStrokeColor:c,maskStrokeWidth:d,position:f="bottom-right",onClick:g,onNodeClick:v,pannable:w=!1,zoomable:k=!1,ariaLabel:m,inversePan:p,zoomStep:h=1,offsetScale:x=5}){const S=de(),_=I.useRef(null),{boundingRect:N,panZoom:C,viewBB:$,rfId:D,translateExtent:R,flowWidth:L,flowHeight:O,ariaLabelConfig:E}=oe(h2,p2),z=(e==null?void 0:e.width)??c2,T=(e==null?void 0:e.height)??f2,A=N.width/z,P=N.height/T,j=Math.max(A,P),M=j*z,b=j*T,F=x*j,W=N.x-(M-N.width)/2-F,B=N.y-(b-N.height)/2-F,G=M+F*2,q=b+F*2,Q=`${m2}-${D}`,H=I.useRef(0),U=I.useRef();H.current=j,I.useEffect(()=>{const te=S.getState().panZoom;if(_.current&&te)return U.current=dE({domNode:_.current,panZoom:te,getTransform:()=>S.getState().transform,getViewScale:()=>H.current}),()=>{var ne;(ne=U.current)==null||ne.destroy()}},[C]),I.useEffect(()=>{var te;(te=U.current)==null||te.update({translateExtent:R,width:L,height:O,inversePan:p,pannable:w,zoomStep:h,zoomable:k})},[w,k,p,h,R,L,O]);const Z=g?te=>{var ae;const[ne,ie]=((ae=U.current)==null?void 0:ae.pointer(te))||[0,0];g(te,{x:ne,y:ie})}:void 0,J=I.useCallback((te,ne)=>{const ie=S.getState().nodeLookup.get(ne).internals.userNode;v==null||v(te,ie)},[v]),K=v?J:void 0,ee=m??E["minimap.ariaLabel"];return y.jsx(ul,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*j:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:Se(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:y.jsxs("svg",{width:z,height:T,viewBox:`${W} ${B} ${G} ${q}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Q,ref:_,onClick:Z,children:[ee&&y.jsx("title",{id:Q,children:ee}),y.jsx(u2,{onClick:K,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:s,nodeComponent:l}),y.jsx("path",{className:"react-flow__minimap-mask",d:`M${W-F},${B-F}h${G+F*2}v${q+F*2}h${-G-F*2}z
62
- M${$.x},${$.y}h${$.width}v${$.height}h${-$.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}a0.displayName="MiniMap";I.memo(a0);const g2=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,y2={[Dr.Line]:"right",[Dr.Handle]:"bottom-right"};function v2({nodeId:e,position:t,variant:n=Dr.Handle,className:r,style:o=void 0,children:i,color:s,minWidth:l=10,minHeight:a=10,maxWidth:u=Number.MAX_VALUE,maxHeight:c=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:g=!0,shouldResize:v,onResizeStart:w,onResize:k,onResizeEnd:m}){const p=Dg(),h=typeof e=="string"?e:p,x=de(),S=I.useRef(null),_=n===Dr.Handle,N=oe(I.useCallback(g2(_&&g),[_,g]),ye),C=I.useRef(null),$=t??y2[n];I.useEffect(()=>{if(!(!S.current||!h))return C.current||(C.current=NE({domNode:S.current,nodeId:h,getStoreItems:()=>{const{nodeLookup:R,transform:L,snapGrid:O,snapToGrid:E,nodeOrigin:z,domNode:T}=x.getState();return{nodeLookup:R,transform:L,snapGrid:O,snapToGrid:E,nodeOrigin:z,paneDomNode:T}},onChange:(R,L)=>{const{triggerNodeChanges:O,nodeLookup:E,parentLookup:z,nodeOrigin:T}=x.getState(),A=[],P={x:R.x,y:R.y},j=E.get(h);if(j&&j.expandParent&&j.parentId){const M=j.origin??T,b=R.width??j.measured.width??0,F=R.height??j.measured.height??0,W={id:j.id,parentId:j.parentId,rect:{width:b,height:F,...og({x:R.x??j.position.x,y:R.y??j.position.y},{width:b,height:F},j.parentId,E,M)}},B=vc([W],E,z,T);A.push(...B),P.x=R.x?Math.max(M[0]*b,R.x):void 0,P.y=R.y?Math.max(M[1]*F,R.y):void 0}if(P.x!==void 0&&P.y!==void 0){const M={id:h,type:"position",position:{...P}};A.push(M)}if(R.width!==void 0&&R.height!==void 0){const b={id:h,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:R.width,height:R.height}};A.push(b)}for(const M of L){const b={...M,type:"position"};A.push(b)}O(A)},onEnd:({width:R,height:L})=>{const O={id:h,type:"dimensions",resizing:!1,dimensions:{width:R,height:L}};x.getState().triggerNodeChanges([O])}})),C.current.update({controlPosition:$,boundaries:{minWidth:l,minHeight:a,maxWidth:u,maxHeight:c},keepAspectRatio:d,resizeDirection:f,onResizeStart:w,onResize:k,onResizeEnd:m,shouldResize:v}),()=>{var R;(R=C.current)==null||R.destroy()}},[$,l,a,u,c,d,w,k,m,v]);const D=$.split("-");return y.jsx("div",{className:Se(["react-flow__resize-control","nodrag",...D,n,r]),ref:S,style:{...o,scale:N,...s&&{[_?"backgroundColor":"borderColor"]:s}},children:i})}I.memo(v2);function x2(){const e=new URLSearchParams(location.search).get("t");try{return e&&sessionStorage.setItem("illuminate-token",e),e??sessionStorage.getItem("illuminate-token")??""}catch{return e??""}}const Hr=x2(),Pt=e=>`/${e?`m/${encodeURIComponent(e)}`:""}?t=${encodeURIComponent(Hr)}`,Bd=e=>e.kind==="capture"?`/api/screens/${encodeURIComponent(e.capture)}.png?t=${encodeURIComponent(Hr)}`:`/api/repo-image?file=${encodeURIComponent(e.file)}&t=${encodeURIComponent(Hr)}`;class u0 extends Error{constructor(t,n=[]){super(t),this.problems=n}}async function Dt(e,t,n){const r=await fetch(t,{method:e,headers:{"x-illuminate-token":Hr,"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}),o=await r.json().catch(()=>({}));if(!r.ok)throw new u0(o.error??`Request failed (${r.status})`,o.problems??[]);return o}const cn={list:()=>Dt("GET","/api/maps"),get:e=>Dt("GET",`/api/maps/${encodeURIComponent(e)}`),make:(e,t)=>Dt("POST","/api/maps",{question:e,parent:t}),offer:(e,t,n)=>Dt("POST",`/api/maps/${encodeURIComponent(e)}/answers/${encodeURIComponent(t)}/offer`,{choice:n}),ask:(e,t,n)=>Dt("POST",`/api/maps/${encodeURIComponent(e)}/ask`,{question:t,selection:n}),approve:(e,t)=>Dt("POST",`/api/maps/${encodeURIComponent(e)}/fixes/${encodeURIComponent(t)}/approve`),reject:(e,t)=>Dt("POST",`/api/maps/${encodeURIComponent(e)}/fixes/${encodeURIComponent(t)}/reject`),undo:(e,t)=>Dt("POST",`/api/maps/${encodeURIComponent(e)}/fixes/${encodeURIComponent(t)}/undo`),stop:()=>Dt("POST","/api/stop")},w2=4e3;function c0(e,t,n){let r=null,o=!1,i=null;const s=()=>{r=new WebSocket(`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws?t=${encodeURIComponent(Hr)}`),r.onopen=()=>t(!0),r.onmessage=l=>{try{e(JSON.parse(String(l.data)))}catch{}},r.onclose=l=>{t(!1),l.code===w2?(o=!0,n()):o||(i=setTimeout(s,1e3))}};return s(),()=>{o=!0,i&&clearTimeout(i),r==null||r.close()}}const S2=(...e)=>e.filter(Boolean).join(" "),tr=e=>`${Math.max(0,Math.min(1,e))*100}%`;function As(e,t){var r;const n=(r=e==null?void 0:e.screens)==null?void 0:r[t];return(n==null?void 0:n.status)==="confirmed"?n.show:null}function k2(e,t,n){for(const r of n){const o=As(t,r),i=e.nodes.find(s=>s.id===r);if(o&&i)return{name:i.name,show:o}}return null}function wc({show:e,name:t}){var i;const[n,r]=I.useState(!1);if(e.kind==="capture"){const s=e.box,l=!!s&&!n,a=s?`${tr(s.x+s.w/2)} ${tr(s.y+s.h/2)}`:void 0;return y.jsxs("figure",{className:"screen",children:[y.jsx("div",{className:"screen-shot",style:{aspectRatio:`${e.width} / ${e.height}`},children:y.jsxs("div",{className:"screen-zoom",style:l?{transform:"scale(2.2)",transformOrigin:a}:void 0,children:[y.jsx("img",{src:Bd(e),alt:`The screen at “${t}”${e.title?`: ${e.title}`:""}`,loading:"lazy"}),s&&y.jsx("i",{className:"screen-mark","aria-hidden":"true",style:{left:tr(s.x),top:tr(s.y),width:tr(s.w),height:tr(s.h)}})]})}),y.jsxs("figcaption",{className:"muted small",children:["Screenshot of ",e.from,s&&y.jsxs(y.Fragment,{children:[" · ",y.jsx("button",{className:"linklike",onClick:()=>r(!n),children:n?"Zoom in":"Show the whole screen"})]})]})]})}if(e.kind==="image")return y.jsxs("figure",{className:"screen",children:[y.jsx("div",{className:"screen-image",children:y.jsx("img",{src:Bd(e),alt:`Image used at “${t}”`,loading:"lazy"})}),y.jsx("figcaption",{className:"muted small",children:e.file})]});const o=(i=e.highlight)==null?void 0:i.trim().toLowerCase();return y.jsxs("figure",{className:"screen",children:[y.jsx("div",{className:"screen-sketch",role:"img","aria-label":`Rough sketch of the screen at “${t}”`,children:e.elements.map((s,l)=>y.jsx("span",{className:S2("sk",`sk-${s.kind}`,o===s.text.trim().toLowerCase()&&"sk-mark"),children:s.kind==="image"?`▧ ${s.text}`:s.text},l))}),y.jsxs("figcaption",{className:"muted small",children:["Rough sketch from ",e.file,", not a screenshot"]})]})}const Ud=/^\s*(```|~~~)/,E2=/^\s{0,3}#{1,6}\s+(.*?)\s*#*\s*$/,_2=/^\s*[-*+•]\s+(.*)$/,N2=/^\s*(\d{1,4})[.)]\s+(.*)$/;function C2(e){const t=e.replace(/\r\n?/g,`
63
- `).split(`
64
- `),n=[];let r=[];const o=()=>{r.length&&n.push({kind:"p",text:r.join(`
65
- `)}),r=[]};for(let i=0;i<t.length;i++){const s=t[i];if(Ud.test(s)){o();const d=[];for(i++;i<t.length&&!Ud.test(t[i]);i++)d.push(t[i]);n.push({kind:"code",text:d.join(`
66
- `)});continue}if(!s.trim()){o();continue}const l=E2.exec(s);if(l){o(),n.push({kind:"h",text:l[1]});continue}const a=_2.exec(s),u=a?null:N2.exec(s);if(a||u){o();const d=a?"ul":"ol",f=n[n.length-1],g=a?a[1]:u[2];f&&f.kind===d?f.items.push(g):n.push(d==="ul"?{kind:d,items:[g]}:{kind:d,items:[g],start:Number(u[1])});continue}const c=n[n.length-1];if(!r.length&&c&&(c.kind==="ul"||c.kind==="ol")&&/^\s+\S/.test(s)){c.items[c.items.length-1]+=` ${s.trim()}`;continue}r.push(s)}return o(),n}const M2=new RegExp("(`+)([^`]+?)\\1|\\*\\*(.+?)\\*\\*|__(.+?)__|\\*(?!\\s)(.+?)\\*|(?<![\\w])_(?!\\s)(.+?)_(?![\\w])|\\[([^\\]]+)\\]\\(([^)\\s]+)\\)","g");function Ln(e,t="i"){const n=[];let r=0,o=0;const i=s=>{s.split(`
67
- `).forEach((l,a)=>{a>0&&n.push(y.jsx("br",{},`${t}-br${o++}`)),l&&n.push(l)})};for(const s of e.matchAll(M2)){i(e.slice(r,s.index));const l=`${t}-${o++}`;if(s[2]!==void 0)n.push(y.jsx("code",{children:s[2]},l));else if(s[3]!==void 0||s[4]!==void 0)n.push(y.jsx("strong",{children:Ln(s[3]??s[4],l)},l));else if(s[5]!==void 0||s[6]!==void 0)n.push(y.jsx("em",{children:Ln(s[5]??s[6],l)},l));else if(s[7]!==void 0){const a=s[8];n.push(/^https?:\/\//i.test(a)?y.jsx("a",{href:a,target:"_blank",rel:"noreferrer",children:Ln(s[7],l)},l):y.jsx("span",{children:Ln(s[7],l)},l))}r=s.index+s[0].length}return i(e.slice(r)),n}function Qo({text:e,className:t}){const n=C2(e);return n.length?y.jsx("div",{className:t?`md ${t}`:"md",children:n.map((r,o)=>{const i=`b${o}`;if(r.kind==="p")return y.jsx("p",{children:Ln(r.text,i)},i);if(r.kind==="h")return y.jsx("p",{className:"md-h",children:Ln(r.text,i)},i);if(r.kind==="code")return y.jsx("pre",{children:y.jsx("code",{children:r.text})},i);const s=r.items.map((l,a)=>y.jsx("li",{children:Ln(l,`${i}-${a}`)},`${i}-${a}`));return r.kind==="ul"?y.jsx("ul",{children:s},i):y.jsx("ol",{start:r.start,children:s},i)})}):null}const rr=()=>({nodes:[],edges:[],absences:[]}),es=e=>e.nodes.length+e.edges.length+e.absences.length,j2=e=>({mapId:e,phase:"loading",meta:null,map:null,report:null,job:null,error:null,answers:[],shown:null,selection:rr(),tour:null,views:[],viewIndex:-1,fixes:{},fresh:[],hidden:[],connected:!1}),P2=e=>e.views[e.viewIndex]??null;function ai(e){if(!e.map)return[];const t=new Set([...e.map.areas,...e.map.nodes,...e.map.edges,...e.map.absences].map(n=>n.id));return e.answers.flatMap(n=>{const r=n.added.filter(o=>t.has(o));return r.length?[{answerId:n.id,question:n.question,ids:r,visible:!e.hidden.includes(n.id)}]:[]})}const $2=e=>ai(e).flatMap(t=>t.ids);function f0(e){if(!e.map)return null;const t=new Set(ai(e).filter(o=>!o.visible).flatMap(o=>o.ids));if(!t.size)return e.map;const n=e.map.nodes.filter(o=>!t.has(o.id)),r=new Set(n.map(o=>o.id));return{...e.map,areas:e.map.areas.filter(o=>!t.has(o.id)),nodes:n,edges:e.map.edges.filter(o=>!t.has(o.id)&&r.has(o.from)&&r.has(o.to)),absences:e.map.absences.filter(o=>!t.has(o.id)&&(!o.between||r.has(o.between.from)&&r.has(o.between.to)))}}function I2(e,t){if(!t)return e;const n=(r,o)=>r.filter(i=>o.some(s=>s.id===i));return{nodes:n(e.nodes,t.nodes),edges:n(e.edges,t.edges),absences:n(e.absences,t.absences)}}function T2(e,t){var s,l,a;const n=e.tour[t];if(!n)return null;const r=e.nodes.filter(u=>{var c;return(c=n.focus.areas)==null?void 0:c.includes(u.area)}).map(u=>u.id),o=[...n.focus.nodes??[],...n.focus.edges??[],...n.focus.absences??[],...r],i=(n.focus.edges??[]).length||(n.focus.absences??[]).length?[]:d0(e,new Set(o));return{focus:((s=n.focus.nodes)==null?void 0:s[0])??((l=n.focus.edges)==null?void 0:l[0])??((a=n.focus.absences)==null?void 0:a[0])??null,highlight:[...new Set([...o,...i])]}}function d0(e,t){return e.edges.filter(n=>t.has(n.from)&&t.has(n.to)).map(n=>n.id)}function Wd(e,t){const n=[...t.moves.highlight,...t.added],r=e?[...new Set([...n,...d0(e,new Set(n))])]:n;return r.length||t.moves.focus?{focus:t.moves.focus??r[0]??null,highlight:r}:null}function nr(e,t){if(!t)return e;const n=[...e.views.slice(0,e.viewIndex+1),t].slice(-50);return{...e,views:n,viewIndex:n.length-1}}function Yd(e,t,n){const r={...t};for(const o of e){if(!o.fix||r[o.fix.id]&&!n)continue;const i=n?n[o.fix.id]:{status:"proposed"};r[o.fix.id]={proposal:o.fix,answerId:o.id,status:(i==null?void 0:i.status)??"rejected",problems:[],edgeId:(i==null?void 0:i.edgeId)??null,closed:(i==null?void 0:i.closed)??[],undoable:(i==null?void 0:i.undoable)??!0}}return r}function z2(e,t){var n;switch(t.type){case"loaded":{const r=t.payload,o=r.map?"ready":r.job?"making":r.failure?"failed":"missing";return{...e,phase:o,meta:r.meta,map:r.map,report:r.report,job:r.job,error:((n=r.failure)==null?void 0:n.error)??null,answers:r.answers,shown:null,fixes:Yd(r.answers,e.fixes,r.fixes??{})}}case"missing":return{...e,phase:"missing"};case"connected":return{...e,connected:t.value};case"event":{const r=t.event;if(r.mapId!==e.mapId)return e;if(r.type==="job")return r.status==="started"?{...e,job:{kind:r.job,question:r.question,progress:[]},error:null,phase:r.job==="make"?"making":e.phase}:r.status==="failed"?{...e,job:null,error:r.error??"Something went wrong.",phase:r.job==="make"&&!e.map?"failed":e.phase}:{...e,job:null};if(r.type==="progress")return e.job?{...e,job:{...e.job,progress:[...e.job.progress,r.text].slice(-200)}}:e;if(r.type==="map"){const o=s=>s.filter(l=>r.map.nodes.some(a=>a.id===l)||r.map.edges.some(a=>a.id===l)||r.map.absences.some(a=>a.id===l)),i={nodes:o(e.selection.nodes),edges:o(e.selection.edges),absences:o(e.selection.absences)};return{...e,phase:"ready",meta:r.meta,map:r.map,report:r.report,selection:i}}if(r.type==="answer"){const o=[...e.answers,r.answer],i={...e,answers:o,shown:r.answer.id,tour:null,fresh:r.answer.added,fixes:Yd([r.answer],e.fixes,void 0)};return nr(i,Wd(e.map,r.answer))}if(r.type==="answerUpdate")return{...e,answers:e.answers.map(o=>o.id===r.answer.id?r.answer:o)};if(r.type==="fix"){const o=e.fixes[r.fixId];if(!o)return e;const i=r.status,s={...e.fixes,[r.fixId]:{...o,status:i,problems:r.problems??[],edgeId:r.edgeId??o.edgeId,closed:r.closed??o.closed,undoable:r.status==="applied"?!0:o.undoable}},l={...e,fixes:s};if(r.status==="applied"&&r.edgeId){const a=o.proposal.connects;return nr(l,{focus:r.edgeId,highlight:[r.edgeId,...a?[a.from,a.to]:[]]})}return l}return e}case"select":{const r=e.selection[t.kind],o=r.includes(t.id),i=t.additive?{...e.selection,[t.kind]:o?r.filter(s=>s!==t.id):[...r,t.id]}:{...rr(),[t.kind]:o&&es(e.selection)===1?[]:[t.id]};return{...e,selection:i}}case"selectMany":return{...e,selection:t.selection};case"clearSelection":return{...e,selection:rr()};case"tour":{if(t.stop===null||!e.map)return{...e,tour:null};const r=Math.max(0,Math.min(t.stop,e.map.tour.length-1));return nr({...e,tour:r,selection:rr()},T2(e.map,r))}case"focus":{if(!e.map)return e;const r=e.map.nodes.some(o=>o.id===t.id)?"nodes":e.map.edges.some(o=>o.id===t.id)?"edges":e.map.absences.some(o=>o.id===t.id)?"absences":null;return r?nr({...e,tour:null,selection:{...rr(),[r]:[t.id]}},{focus:t.id,highlight:[t.id]}):e}case"back":return e.viewIndex>0?{...e,viewIndex:e.viewIndex-1}:e.viewIndex===0?{...e,viewIndex:-1}:e;case"forward":return e.viewIndex<e.views.length-1?{...e,viewIndex:e.viewIndex+1}:e;case"show":{const r=e.answers.find(o=>o.id===t.answerId);return nr({...e,shown:t.answerId,tour:null},r?Wd(e.map,r):null)}case"overview":return nr({...e,shown:null,tour:null,selection:rr(),fresh:[]},{focus:null,highlight:[]});case"layer":case"allLayers":{const r=t.type==="layer"?[t.answerId]:ai(e).map(s=>s.answerId),o=t.visible?e.hidden.filter(s=>!r.includes(s)):[...new Set([...e.hidden,...r])],i={...e,hidden:o};return{...i,selection:I2(e.selection,f0(i))}}case"fixStatus":{const r=e.fixes[t.fixId];return r?{...e,fixes:{...e.fixes,[t.fixId]:{...r,status:t.status,problems:t.problems??r.problems}}}:e}case"error":return{...e,error:t.message}}}const Vr=(...e)=>e.filter(Boolean).join(" ");function rt(e,t){const n=e.nodes.find(s=>s.id===t);if(n)return n.name;const r=e.edges.find(s=>s.id===t);if(r)return`${rt(e,r.from)} → ${rt(e,r.to)}`;const o=e.absences.find(s=>s.id===t);if(o)return o.claim;const i=e.areas.find(s=>s.id===t);return(i==null?void 0:i.label)??t}function iu(e,t){return e?e.nodes[t]??e.edges[t]??(e.absences[t]?{status:e.absences[t].status,reasons:e.absences[t].reasons}:null):null}function De({eyebrow:e,title:t,children:n,tone:r,className:o}){return y.jsxs("section",{className:Vr("card",r&&`card-${r}`,o),children:[e&&y.jsx("div",{className:"eyebrow",children:e}),t&&y.jsx("h2",{className:"card-title",children:t}),n]})}function L2({map:e,ids:t,onPick:n}){return t.length?y.jsx("div",{className:"chips",children:t.map(({id:r,status:o})=>y.jsxs("button",{className:Vr("chip",o!=="confirmed"&&"chip-unconfirmed"),onClick:()=>n(r),title:o==="confirmed"?"Confirmed against the code":"Couldn't confirm against the code",children:[y.jsx("span",{className:o==="confirmed"?"tick":"qmark",children:o==="confirmed"?"✓":"?"}),rt(e,r)]},r))}):null}function Xd({lines:e,working:t}){const n=e.slice(-8);return y.jsxs("ul",{className:"progress",children:[n.map((r,o)=>y.jsxs("li",{className:Vr(t&&o===n.length-1&&"running"),children:[y.jsx("span",{className:"ic",children:t&&o===n.length-1?"…":"✓"}),r]},`${o}-${r}`)),!n.length&&t&&y.jsxs("li",{className:"running",children:[y.jsx("span",{className:"ic",children:"…"}),"Starting"]})]})}function b2({fix:e,onApprove:t,onReject:n,onUndo:r,map:o}){const i=e.proposal,s=i.files.filter(l=>l.uncommitted);return e.status==="applied"?y.jsxs(De,{eyebrow:"Fix applied · re-checked",tone:"ok",children:[y.jsxs("ul",{className:"progress",children:[y.jsxs("li",{children:[y.jsx("span",{className:"ic",children:"✓"}),"Changed ",i.files.length," ",i.files.length===1?"file":"files",": ",i.files.map(l=>l.file).join(", ")]}),e.edgeId&&y.jsxs("li",{children:[y.jsx("span",{className:"ic",children:"✓"}),"New confirmed connection: ",rt(o,e.edgeId)]}),e.closed.length>0&&y.jsxs("li",{children:[y.jsx("span",{className:"ic",children:"✓"}),"Closed: ",e.closed.length===1?"the missing connection":`${e.closed.length} missing connections`]})]}),e.undoable?y.jsx("div",{className:"btns",children:y.jsx("button",{className:"btn",onClick:r,children:"Undo this fix"})}):y.jsx("p",{className:"muted small",children:"Undo ended when illuminate stopped. Use git to reverse it."})]}):e.status==="rejected"||e.status==="undone"?y.jsxs(De,{eyebrow:e.status==="undone"?"Fix undone":"Fix rejected",children:[y.jsx(Qo,{text:i.summary,className:"muted"}),e.status==="undone"&&y.jsx("div",{className:"btns",children:y.jsx("button",{className:"btn",onClick:t,children:"Apply it again"})})]}):y.jsxs(De,{eyebrow:`Proposed fix · ${i.files.length} ${i.files.length===1?"file":"files"} · nothing changed yet`,tone:"ai",children:[y.jsx(Qo,{text:i.summary}),i.connects&&y.jsx("p",{className:"muted small",children:"The green dashed arrow is the connection it adds."}),y.jsx("pre",{className:"diff",children:i.diff.split(`
68
- `).map((l,a)=>y.jsxs("span",{className:l.startsWith("+ ")?"add":l.startsWith("- ")?"del":l.includes(" · ")?"file":"",children:[l,`
69
- `]},a))}),s.length>0?y.jsxs("p",{className:"warn small",children:["⚠ ",s.map(l=>l.file).join(", ")," ",s.length===1?"has":"have"," uncommitted changes. They'll be kept; the fix applies on top."]}):null,e.problems.length>0&&y.jsx("ul",{className:"problems",children:e.problems.map(l=>y.jsx("li",{children:l},l))}),y.jsxs("div",{className:"btns",children:[y.jsx("button",{className:"btn primary",disabled:e.status==="applying",onClick:t,children:e.status==="applying"?"Applying…":"Approve"}),y.jsx("button",{className:"btn",onClick:n,children:"Reject"})]}),y.jsx("p",{className:"muted small",children:"Won't apply if these files change first."})]})}function A2({state:e,dispatch:t,onFix:n,onFocus:r,onOffer:o,composer:i}){const s=e.map,l=e.job,a=I.useRef(null);if(I.useEffect(()=>{const f=a.current;f&&(f.scrollTop=f.scrollHeight)},[e.answers.length,l==null?void 0:l.progress.length,!!l]),e.phase==="loading")return y.jsx("aside",{className:"panel",children:y.jsx("div",{className:"panel-scroll",children:y.jsx(De,{children:y.jsx("p",{className:"muted",children:"Loading…"})})})});if(e.phase==="missing")return y.jsx("aside",{className:"panel",children:y.jsx("div",{className:"panel-scroll",children:y.jsx(De,{title:"No map here",children:y.jsx("p",{className:"muted",children:"This map isn't in this repo."})})})});if(!s)return y.jsx("aside",{className:"panel",children:y.jsxs("div",{className:"panel-scroll",children:[l&&y.jsx(De,{eyebrow:"Making your map",title:l.question,tone:"ai",children:y.jsx(Xd,{lines:l.progress,working:!0})}),e.phase==="failed"&&y.jsx(De,{title:"The map couldn't be made",tone:"dead",children:y.jsx("p",{children:e.error})})]})});const u=[...e.selection.nodes,...e.selection.edges,...e.selection.absences],c=ai(e),d=c.length>0&&c.every(f=>!f.visible);return y.jsxs("aside",{className:"panel","aria-label":"Conversation about this map",children:[y.jsxs("header",{className:"panel-head",children:[y.jsx("h2",{className:"panel-title",children:"Conversation"}),c.length>0&&y.jsx("button",{className:"link-btn small",onClick:()=>t({type:"allLayers",visible:d}),children:d?"Show everything":"Show the original map"}),y.jsx("button",{className:"card-close","aria-label":"Close the conversation",title:"Close (Esc). It stays here to reopen.",onClick:()=>t({type:"overview"}),children:"×"})]}),y.jsxs("div",{className:"panel-scroll",ref:a,children:[e.error&&y.jsxs("div",{className:"banner banner-dead",role:"alert",children:[e.error,y.jsx("button",{className:"link-btn",onClick:()=>t({type:"error",message:null}),children:"Dismiss"})]}),e.answers.map(f=>y.jsx(R2,{answer:f,state:e,dispatch:t,onFix:n,onFocus:r,onOffer:o},f.id)),(l==null?void 0:l.kind)==="ask"&&y.jsxs("article",{className:"turn",children:[y.jsx(h0,{question:l.question}),y.jsx(De,{eyebrow:"Claude is working",tone:"ai",children:y.jsx(Xd,{lines:l.progress,working:!0})})]}),!e.answers.length&&!l&&!u.length&&y.jsx("p",{className:"muted small thread-empty",children:"Ask anything about this map. Click a box or arrow first to ask about it."})]}),y.jsxs("footer",{className:"panel-foot",children:[u.length>0&&y.jsx(O2,{map:s,report:e.report,ids:u,compact:e.answers.length>0||(l==null?void 0:l.kind)==="ask"},u.join(" ")),i]})]})}function h0({question:e,about:t}){return y.jsxs("div",{className:"you",children:[y.jsx("p",{className:"you-q",children:e}),t&&y.jsxs("span",{className:"you-about",children:["About ",t]})]})}function R2({answer:e,state:t,dispatch:n,onFix:r,onFocus:o,onOffer:i}){const s=t.map,l=e.fix?t.fixes[e.fix.id]??null:null,a=e.id===t.shown,u=[...e.selection.nodes??[],...e.selection.edges??[],...e.selection.absences??[]].map(w=>rt(s,w)).join(", "),c=ai(t).find(w=>w.answerId===e.id),d=e.problems.filter(w=>w.startsWith("The proposed fix")),f=e.problems.filter(w=>!w.startsWith("The proposed fix")),g=e.refs.filter(w=>{var k;return w.status!=="unknown"&&((k=iu(t.report,w.id))==null?void 0:k.status)==="unconfirmed"}).map(w=>w.id),v=e.moves.highlight.length>0||!!e.moves.focus||e.added.length>0||(e.screens??[]).length>0;return y.jsxs("article",{className:"turn",children:[y.jsx(h0,{question:e.question,about:u||void 0}),e.offer?y.jsx(D2,{answer:e,busy:!!t.job,onOffer:i}):y.jsxs("section",{className:Vr("card","reply",a&&"card-focus"),children:[y.jsxs("div",{className:"reply-meta",children:[y.jsx("span",{children:e.source==="map"?"From the map":"Looked in the code"}),v&&(a?y.jsx("span",{className:"reply-lit",children:"Lit on the map"}):y.jsx("button",{className:"link-btn small",onClick:()=>n({type:"show",answerId:e.id}),children:"Show on the map"}))]}),y.jsx(Qo,{text:e.concept,className:"depth-text"}),(e.screens??[]).map(w=>{const k=As(t.report,w);return k?y.jsx(wc,{show:k,name:rt(s,w)},w):null}),g.length>0&&y.jsxs("p",{className:"warn small reply-warn",children:["Relies on ",g.length===1?"1 thing":`${g.length} things`," the checker couldn't confirm:"," ",g.map((w,k)=>y.jsxs("span",{children:[k>0&&", ",y.jsx("button",{className:"link-btn small",title:"Show it on the map",onClick:()=>o(w),children:rt(s,w)})]},w))]}),c&&y.jsxs("div",{className:"reply-added",children:[y.jsxs("span",{children:["Added ",c.ids.length," to the map"]}),y.jsx("button",{className:"link-btn small",onClick:()=>n({type:"layer",answerId:e.id,visible:!c.visible}),children:c.visible?"Hide":"Show"})]}),f.length>0&&y.jsxs("details",{className:"problems-box",children:[y.jsxs("summary",{children:[f.length," thing",f.length===1?"":"s"," Claude found but couldn't confirm or show"]}),y.jsx("ul",{className:"problems",children:f.map(w=>y.jsx("li",{children:w},w))})]})]}),l&&y.jsx(b2,{fix:l,map:s,onApprove:()=>r(l.proposal.id,"approve"),onReject:()=>r(l.proposal.id,"reject"),onUndo:()=>r(l.proposal.id,"undo")}),d.length>0&&y.jsxs(De,{eyebrow:"The proposed fix can't be applied",tone:"dead",children:[y.jsx("ul",{className:"problems",children:d.map(w=>y.jsx("li",{children:w.replace("The proposed fix can't be applied: ","")},w))}),y.jsx("p",{className:"muted small",children:"Ask again, or ask for a smaller change."})]})]})}function D2({answer:e,busy:t,onOffer:n}){const r=e.offer;return r.status==="mapped"?y.jsxs(De,{eyebrow:"A different part of the app",children:[y.jsx("p",{className:"muted",children:"You made a new map for this."}),r.mapId&&y.jsx("div",{className:"btns",children:y.jsx("a",{className:"btn primary",href:Pt(r.mapId),children:"Open it"})})]}):r.status==="answered"?y.jsx(De,{eyebrow:"A different part of the app",children:y.jsx("p",{className:"muted",children:"Answered in words, below."})}):y.jsxs(De,{eyebrow:"A different part of the app",tone:"ai",children:[y.jsx("p",{children:"This is about a different part of the app than this map shows."}),r.existing&&y.jsxs("p",{children:["There's already a map for it: “",r.existing.question,"”."]}),y.jsxs("div",{className:"btns",children:[r.existing&&y.jsx("a",{className:"btn primary",href:Pt(r.existing.id),children:"Open that map"}),y.jsx("button",{className:r.existing?"btn":"btn primary",onClick:()=>n(e.id,"map"),children:"Make a new map for this"}),y.jsx("button",{className:"btn",disabled:t,onClick:()=>n(e.id,"words"),title:t?"Claude is still working on this map":void 0,children:"Just answer in words"})]})]})}function O2({map:e,report:t,ids:n,compact:r}){var v,w,k;const[o,i]=I.useState(!r);if(n.length>1)return y.jsx(De,{eyebrow:`Asking about ${n.length} things`,className:"card-selected",children:y.jsx(L2,{map:e,ids:n.map(m=>{var p;return{id:m,status:((p=iu(t,m))==null?void 0:p.status)??"unknown"}}),onPick:()=>{}})});const s=n[0],l=e.nodes.find(m=>m.id===s),a=e.edges.find(m=>m.id===s),u=e.absences.find(m=>m.id===s),c=iu(t,s),d=(l==null?void 0:l.evidence)??(a==null?void 0:a.evidence)??[],f=c&&"evidence"in c&&c.evidence?c.evidence:[],g=l?"Step":a?"Connection":"Missing connection";return o?y.jsxs(De,{eyebrow:g,title:rt(e,s),tone:u?"dead":void 0,className:"card-selected",children:[r&&y.jsx("button",{className:"link-btn small selected-hide",onClick:()=>i(!1),children:"Hide details"}),((v=l==null?void 0:l.explain)==null?void 0:v.concept)&&y.jsx(Qo,{text:l.explain.concept,className:"depth-text"}),l&&As(t,l.id)&&y.jsx(wc,{show:As(t,l.id),name:l.name}),u&&y.jsxs("p",{children:["Nothing in the code connects these. Searching ",y.jsx("code",{children:u.search.pattern}),u.search.paths?y.jsxs(y.Fragment,{children:[" in ",y.jsx("code",{children:u.search.paths.join(", ")})]}):null,": ",((w=t==null?void 0:t.absences[u.id])==null?void 0:w.found)??"?"," ",((k=t==null?void 0:t.absences[u.id])==null?void 0:k.found)===1?"match":"matches","."]}),c&&c.status!=="confirmed"&&y.jsxs("div",{className:"warn small",children:["Couldn't confirm against the code: ",c.reasons.join("; ")]}),d.length>0&&y.jsxs("div",{className:"basis",children:[y.jsx("div",{className:"eyebrow",children:"In the code"}),y.jsx("div",{className:"chips",children:d.map((m,p)=>{var x,S;const h=((x=f[p])==null?void 0:x.ok)??!1;return y.jsxs("span",{className:Vr("chip static",!h&&"chip-unconfirmed"),children:[y.jsx("span",{className:h?"tick":"qmark",children:h?"✓":"?"}),m.file,":",((S=f[p])==null?void 0:S.foundAt)??m.line]},p)})})]})]}):y.jsxs("div",{className:Vr("selected-line",u&&"selected-line-dead"),children:[y.jsx("span",{className:"eyebrow",children:g}),y.jsx("span",{className:"selected-name",children:rt(e,s)}),y.jsx("button",{className:"link-btn small",onClick:()=>i(!0),children:"Details"})]})}function F2({map:e,selection:t,draft:n,busy:r,autoFocus:o,onDraft:i,onRemove:s,onSend:l}){const a=I.useRef(null),u=["nodes","edges","absences"].flatMap(c=>t[c].map(d=>({kind:c,id:d})));return I.useEffect(()=>{const c=a.current;c&&(c.style.height="auto",c.style.height=`${Math.min(c.scrollHeight,140)}px`)},[n]),I.useEffect(()=>{var c;n&&((c=a.current)==null||c.focus())},[n===""]),I.useEffect(()=>{var c;o&&((c=a.current)==null||c.focus({preventScroll:!0}))},[]),y.jsxs("form",{className:"composer",onSubmit:c=>{c.preventDefault(),!r&&n.trim()&&l()},children:[u.map(c=>y.jsxs("span",{className:`sel-chip sel-${c.kind}`,children:[y.jsxs("span",{className:"sel-text",title:rt(e,c.id),children:[c.kind==="absences"?"✕ ":"◉ ",rt(e,c.id)]}),y.jsx("button",{type:"button","aria-label":`Remove ${rt(e,c.id)}`,onClick:()=>s(c.kind,c.id),children:"×"})]},`${c.kind}:${c.id}`)),y.jsx("textarea",{ref:a,id:"ask",rows:1,value:n,placeholder:r?"Claude is working…":u.length?"Ask about what you selected…":"Ask about this map…",onChange:c=>i(c.target.value),onKeyDown:c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),!r&&n.trim()&&l())},"aria-label":"Ask a question about the map"}),y.jsx("button",{type:"submit",className:"send",disabled:r||!n.trim(),"aria-label":"Send",children:"↑"})]})}function H2({map:e,tour:t,onTour:n,selected:r,children:o}){const i=e.tour.length,s=i>0&&t===null;return!s&&!o?null:y.jsxs("div",{className:"dock",children:[s&&y.jsxs("section",{className:"dock-part dock-walk","aria-label":"Walkthrough",children:[y.jsx("h2",{className:"dock-title",children:"Walkthrough"}),y.jsxs("button",{className:"dock-start",onClick:()=>n(0),children:["Take the walkthrough ",y.jsxs("span",{className:"muted",children:[i," ",i===1?"stop":"stops"]})]})]}),o&&y.jsxs("section",{className:"dock-part dock-ask","aria-label":"Ask about the map",children:[y.jsxs("div",{className:"dock-head",children:[y.jsx("h2",{className:"dock-title",children:"Ask about the map"}),y.jsx("span",{className:"dock-hint",children:r?"Shift-click to add more":"Click a box or arrow to ask about it"})]}),o]})]})}function V2({state:e,dispatch:t}){const n=e.answers[e.answers.length-1];return n?y.jsx("div",{className:"history-corner",children:y.jsxs("button",{className:"pill-btn history-btn",onClick:()=>t({type:"show",answerId:n.id}),title:"Open the conversation about this map",children:["Conversation ",y.jsx("span",{className:"muted",children:e.answers.length})]})}):null}const B2="modulepreload",U2=function(e){return"/"+e},Qd={},W2=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),l=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.allSettled(n.map(a=>{if(a=U2(a),a in Qd)return;Qd[a]=!0;const u=a.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":B2,u||(d.as="script"),d.crossOrigin="",d.href=a,l&&d.setAttribute("nonce",l),document.head.appendChild(d),u)return new Promise((f,g)=>{d.addEventListener("load",f),d.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${a}`)))})}))}function i(s){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=s,window.dispatchEvent(l),!l.defaultPrevented)throw s}return o.then(s=>{for(const l of s||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},Fn=232,bn=96;let Y2=null;const p0=()=>Y2??(Y2=W2(()=>import("./elk.bundled-0O-UVY-Y.js").then(e=>e.e),[]).then(e=>new e.default)),m0={"elk.algorithm":"layered","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.considerModelOrder.strategy":"NODES_AND_EDGES"};function g0(e,t){const n=new Set(e.nodes.map(r=>r.id));return[...e.edges.map(r=>({id:`e:${r.id}`,from:r.from,to:r.to})),...e.absences.flatMap(r=>r.between?[{id:`a:${r.id}`,from:r.between.from,to:r.between.to}]:[]),...t.map(r=>({id:`x:${r.id}`,from:r.from,to:r.to}))].filter(r=>n.has(r.from)&&n.has(r.to)&&r.from!==r.to)}const dt={top:52,side:26,bottom:26},or=64,ts=44,X2=56,Q2=140;async function y0(e,t,n,r){const o=await e.layout({id:t,layoutOptions:{...m0,"elk.direction":"DOWN","elk.padding":`[top=${dt.top},left=${dt.side},bottom=${dt.bottom},right=${dt.side}]`,"elk.layered.spacing.nodeNodeBetweenLayers":String(or),"elk.spacing.nodeNode":String(ts)},children:n.map(s=>({id:s.id,width:Fn,height:bn})),edges:r.map(s=>({id:s.id,sources:[s.from],targets:[s.to]}))}),i={};for(const s of o.children??[])i[s.id]={x:s.x??0,y:s.y??0,w:Fn,h:bn};return{nodes:i,size:{w:o.width??Fn+2*dt.side,h:o.height??bn+dt.top+dt.bottom}}}function K2(e,t){const n=e.nodes.filter(o=>!t.has(o.id)),r=new Set(n.map(o=>o.id));return{...e,areas:e.areas.filter(o=>!t.has(o.id)),nodes:n,edges:e.edges.filter(o=>!t.has(o.id)&&r.has(o.from)&&r.has(o.to)),absences:e.absences.filter(o=>!t.has(o.id)&&(!o.between||r.has(o.between.from)&&r.has(o.between.to)))}}async function G2(e,t=[],n=new Set){var x;const r=e.nodes.filter(S=>n.has(S.id));if(!r.length)return Kd(e,t);const o=K2(e,n),i=new Set(o.nodes.map(S=>S.id)),s=await Kd(o,t.filter(S=>i.has(S.from)&&i.has(S.to))),l=await p0(),a=Object.fromEntries(Object.entries(s.areas).map(([S,_])=>[S,{..._}])),u={...s.nodes},c={},d={};for(const S of r)(d[x=S.area]??(d[x]=[])).push(S);for(const[S,_]of Object.entries(d)){const N=a[S];if(!N)continue;const C=Math.max(1,Math.floor((N.w-2*dt.side+ts)/(Fn+ts))),$=Math.max(dt.top-or,...o.nodes.filter(R=>R.area===S).map(R=>{var L;return(((L=u[R.id])==null?void 0:L.y)??0)+bn}))+or;_.forEach((R,L)=>{u[R.id]={x:dt.side+L%C*(Fn+ts),y:$+Math.floor(L/C)*(bn+or),w:Fn,h:bn}});const D=Math.max(N.h,$+Math.ceil(_.length/C)*(bn+or)-or+dt.bottom);c[S]=D-N.h,N.h=D}const f=Object.fromEntries(Object.entries(s.areas).map(([S,_])=>[S,_])),g=Object.keys(f).sort((S,_)=>f[S].y-f[_].y),v={};for(const S of g){const _=f[S];v[S]=Math.max(0,...g.filter(N=>N!==S&&v[N]!==void 0).filter(N=>{const C=f[N];return C.y+C.h<=_.y+1&&C.x<_.x+_.w&&_.x<C.x+C.w}).map(N=>v[N]+(c[N]??0))),a[S].y+=v[S]}const w=g0(e,t),k=new Map(e.nodes.map(S=>[S.id,S.area])),m=Math.max(0,...Object.values(a).map(S=>S.x+S.w))+Q2;let p=0;for(const S of e.areas){if(a[S.id])continue;const _=e.nodes.filter($=>$.area===S.id);if(!_.length)continue;const N=w.filter($=>k.get($.from)===S.id&&k.get($.to)===S.id),C=await y0(l,S.id,_,N);Object.assign(u,C.nodes),a[S.id]={x:m,y:p,w:C.size.w,h:C.size.h},p+=C.size.h+X2}const h=Object.values(a);return{areas:a,nodes:u,width:Math.max(0,...h.map(S=>S.x+S.w)),height:Math.max(0,...h.map(S=>S.y+S.h))}}async function Kd(e,t){const n=await p0(),r=new Map(e.nodes.map(c=>[c.id,c.area])),o=g0(e,t),i={},s={};for(const c of e.areas){const d=e.nodes.filter(v=>v.area===c.id);if(!d.length)continue;const f=o.filter(v=>r.get(v.from)===c.id&&r.get(v.to)===c.id),g=await y0(n,c.id,d,f);Object.assign(i,g.nodes),s[c.id]=g.size}const l=new Map;for(const c of o){const d=r.get(c.from),f=r.get(c.to);d!==f&&s[d]&&s[f]&&l.set(`${d}>${f}`,{from:d,to:f})}const a=await n.layout({id:"root",layoutOptions:{...m0,"elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"120","elk.spacing.nodeNode":"48","elk.spacing.componentComponent":"64"},children:e.areas.filter(c=>s[c.id]).map(c=>({id:c.id,width:s[c.id].w,height:s[c.id].h})),edges:[...l.values()].map((c,d)=>({id:`p${d}`,sources:[c.from],targets:[c.to]}))}),u={};for(const c of a.children??[])u[c.id]={x:c.x??0,y:c.y??0,w:c.width??0,h:c.height??0};return{areas:u,nodes:i,width:a.width??0,height:a.height??0}}function q2(e,t,n,r){const o=c=>{var d;return((d=e.nodes.find(f=>f.id===c))==null?void 0:d.area)??""},i=c=>{const d=t.areas[o(c)],f=t.nodes[c];return d&&f?{x:d.x+f.x+f.w/2,y:d.y+f.y+f.h/2}:{x:0,y:0}},s=i(n),l=i(r),a=l.x-s.x,u=l.y-s.y;return o(n)===o(r)||Math.abs(a)<Fn*.75?u>=0?["b","t"]:["t","b"]:a>=0?["r","l"]:["l","r"]}function Z2(e,t=[],n=[]){return JSON.stringify([[...n].sort(),e.areas.map(r=>r.id),e.nodes.map(r=>`${r.id}@${r.area}`),e.edges.map(r=>`${r.from}>${r.to}`),e.absences.map(r=>r.between?`${r.between.from}~${r.between.to}`:""),t.map(r=>`${r.from}+${r.to}`)])}const Ko=(...e)=>e.filter(Boolean).join(" "),Ai={entry:["Where it starts","▸"],store:["Saved data","▤"],external:["Outside the app","↗"],job:["Background job","◷"]},Gd=[["t",X.Top],["r",X.Right],["b",X.Bottom],["l",X.Left]];function J2(){return y.jsxs(y.Fragment,{children:[Gd.map(([e,t])=>y.jsx(Fr,{id:`s${e}`,type:"source",position:t,className:"handle",isConnectable:!1},`s${e}`)),Gd.map(([e,t])=>y.jsx(Fr,{id:`t${e}`,type:"target",position:t,className:"handle",isConnectable:!1},`t${e}`))]})}function eC({data:e}){return y.jsxs("div",{className:Ko("step","nopan",`kind-${e.kind}`,!e.confirmed&&"unconfirmed",e.selected&&"selected",e.hl&&"hl",e.dim&&"dim"),onClick:t=>{t.stopPropagation(),e.onClick(t.shiftKey||t.metaKey)},children:[y.jsx(J2,{}),(Ai[e.kind]||e.fresh||e.screen)&&y.jsxs("div",{className:"step-head",children:[Ai[e.kind]&&y.jsxs(y.Fragment,{children:[y.jsx("i",{className:"step-mark","aria-hidden":"true",children:Ai[e.kind][1]}),Ai[e.kind][0]]}),e.screen&&y.jsx("span",{className:"badge-screen",title:"Select this step to see the screen",children:"▣ Screen"}),e.fresh&&y.jsx("span",{className:"badge-new",children:"New"})]}),y.jsx("div",{className:"step-name",title:e.name,children:e.name}),y.jsxs("div",{className:"step-code",title:e.confirmed?"Confirmed against the code":"The checker couldn't confirm this against the code",children:[y.jsx("span",{className:e.confirmed?"tick":"qmark",children:e.confirmed?"✓":"?"}),y.jsx("span",{className:"step-sub",children:e.sub})]})]})}function tC({data:e}){return y.jsx("div",{className:Ko("area",e.dim&&"dim"),children:y.jsxs("div",{className:"area-label",children:[e.label,e.note&&y.jsxs("span",{className:"area-note",children:[" ",e.note]})]})})}function nC(e,t,n,r,o){const i=Math.hypot(n-e,r-t)||1,s=-(r-t)/i,l=(n-e)/i,a=(e+n)/2+s*o*2,u=(t+r)/2+l*o*2;return[`M ${e} ${t} Q ${a} ${u} ${n} ${r}`,(e+n)/2+s*o,(t+r)/2+l*o]}function rC({id:e,sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:i,targetPosition:s,markerEnd:l,data:a}){const[u,c,d]=a!=null&&a.offset?nC(t,n,r,o,a.offset):hc({sourceX:t,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:s});return a?y.jsxs(y.Fragment,{children:[a.selected&&y.jsx("path",{d:u,className:"edge-halo"}),y.jsx(li,{id:e,path:u,markerEnd:l,interactionWidth:18}),y.jsx(WN,{children:y.jsxs("div",{className:Ko("link-label",`link-${a.variant}`,!a.confirmed&&"unconfirmed",a.hl&&"hl",a.dim&&"dim",a.selected&&"selected","nodrag nopan"),style:{transform:`translate(-50%, -50%) translate(${c}px, ${d}px)`},onClick:f=>{var g;f.stopPropagation(),(g=a.onClick)==null||g.call(a,f.shiftKey||f.metaKey)},children:[a.variant==="absence"&&y.jsx("span",{className:"gap-q","aria-hidden":"true",children:"?"}),y.jsx("span",{className:"link-text",children:a.label}),!a.confirmed&&a.variant==="edge"&&y.jsx("span",{className:"q",children:" ?"})]})})]}):null}const oC={step:eC,area:tC},iC={link:rC};function qd(e,t){const n=new Set;for(const r of t){e.nodes.some(s=>s.id===r)&&n.add(r);const o=e.edges.find(s=>s.id===r);o&&n.add(o.from).add(o.to);const i=e.absences.find(s=>s.id===r);i!=null&&i.between&&n.add(i.between.from).add(i.between.to)}return[...n]}const sC="440px",lC=e=>e.length>28?`${e.slice(0,26)}…`:e;function Zd(e){var k,m,p,h;const t=(k=e.ghost)!=null&&k.connects&&e.map.nodes.some(x=>x.id===e.ghost.connects.from)&&e.map.nodes.some(x=>x.id===e.ghost.connects.to)?e.ghost:null,n=I.useMemo(()=>t!=null&&t.connects?[{id:t.id,from:t.connects.from,to:t.connects.to}]:[],[t]),r=Z2(e.map,n,e.added),[o,i]=I.useState(null),s=cl();I.useEffect(()=>{let x=!0;return G2(e.map,n,new Set(e.added)).then(S=>x&&i({key:r,layout:S})),()=>{x=!1}},[r]);const l=(m=e.view)!=null&&m.highlight.length?new Set(e.view.highlight):null,a=I.useMemo(()=>l?new Set(qd(e.map,[...l])):null,[l,e.map]),u=e.selection,c=I.useMemo(()=>{if(!o)return[];const x=o.layout,S=C=>!a||e.map.nodes.some($=>$.area===C&&a.has($.id)),_=e.map.areas.flatMap(C=>{const $=x.areas[C.id];return $?[{id:`area:${C.id}`,type:"area",position:{x:$.x,y:$.y},style:{width:$.w,height:$.h},data:{label:C.label,note:null,dim:!S(C.id)},selectable:!1,draggable:!1,zIndex:0}]:[]}),N=e.map.nodes.flatMap(C=>{var R,L,O,E,z;const $=x.nodes[C.id];if(!$)return[];const D=C.symbol?C.symbol.slice(C.symbol.indexOf("#")+1):`${C.evidence[0].file.split("/").pop()}:${C.evidence[0].line}`;return[{id:C.id,type:"step",parentId:`area:${C.area}`,extent:"parent",position:{x:$.x,y:$.y},data:{name:C.name,sub:D,kind:C.kind,confirmed:((L=(R=e.report)==null?void 0:R.nodes[C.id])==null?void 0:L.status)==="confirmed",screen:((z=(E=(O=e.report)==null?void 0:O.screens)==null?void 0:E[C.id])==null?void 0:z.status)==="confirmed",selected:u.nodes.includes(C.id),hl:!!(a!=null&&a.has(C.id)),dim:!!a&&!a.has(C.id),fresh:e.fresh.includes(C.id),onClick:T=>e.onSelect("nodes",C.id,T)},draggable:!1,zIndex:1}]});return[..._,...N]},[o,e.map,e.report,u,a,e.fresh,e.onSelect]),d=I.useMemo(()=>{var D,R;if(!o)return[];const x=L=>({type:Uo.ArrowClosed,width:16,height:16,color:L}),S=L=>!!(l!=null&&l.has(L)),_=(L,O)=>{const[E,z]=q2(e.map,o.layout,L,O);return{sourceHandle:`s${E}`,targetHandle:`t${z}`}},N=e.map.edges.map(L=>{var T,A;const O=((A=(T=e.report)==null?void 0:T.edges[L.id])==null?void 0:A.status)==="confirmed",E=S(L.id)||!!a&&a.has(L.from)&&a.has(L.to)&&!l,z="edge";return{id:`e:${L.id}`,source:L.from,target:L.to,..._(L.from,L.to),type:"link",className:Ko("link",`link-${z}`,!O&&"unconfirmed",S(L.id)&&"hl",!!l&&!S(L.id)&&"dim",u.edges.includes(L.id)&&"selected"),markerEnd:x(S(L.id)?"var(--path)":"var(--line-strong)"),zIndex:2,data:{label:L.label,variant:z,confirmed:O,hl:E,dim:!!l&&!S(L.id),selected:u.edges.includes(L.id),onClick:P=>e.onSelect("edges",L.id,P)}}}),C=L=>{var O;return((O=t==null?void 0:t.connects)==null?void 0:O.from)===L.from&&t.connects.to===L.to};for(const L of e.map.absences){if(!L.between||C(L.between))continue;const O=((R=(D=e.report)==null?void 0:D.absences[L.id])==null?void 0:R.status)==="confirmed";N.push({id:`a:${L.id}`,source:L.between.from,target:L.between.to,..._(L.between.from,L.between.to),type:"link",className:Ko("link","link-absence",!O&&"unconfirmed",S(L.id)&&"hl",!!l&&!S(L.id)&&"dim",u.absences.includes(L.id)&&"selected"),markerEnd:x("var(--dead)"),zIndex:2,data:{label:lC(L.claim),variant:"absence",confirmed:O,hl:S(L.id),dim:!!l&&!S(L.id),selected:u.absences.includes(L.id),onClick:E=>e.onSelect("absences",L.id,E)}})}t!=null&&t.connects&&N.push({id:`g:${t.id}`,source:t.connects.from,target:t.connects.to,..._(t.connects.from,t.connects.to),type:"link",className:"link link-ghost",markerEnd:x("var(--ok)"),zIndex:3,data:{label:`+ ${t.connects.label}`,variant:"ghost",confirmed:!0,hl:!0,dim:!1,selected:!1}});const $=new Map;for(const L of N){const O=[L.source,L.target].sort().join("|");$.set(O,[...$.get(O)??[],L])}for(const L of $.values())L.length<2||L.forEach((O,E)=>{O.data&&(O.data.offset=(E-(L.length-1)/2)*44)});return N},[o,e.map,e.report,u,l,a,t,e.onSelect]),f=oe(x=>x.width),g=I.useRef(0);I.useEffect(()=>{const x=g.current;if(g.current=f,!x||!f||x===f)return;const S=s.getViewport();s.setViewport({...S,x:S.x+(f-x)/2})},[f]);const v=JSON.stringify([o==null?void 0:o.key,(p=e.view)==null?void 0:p.focus,(h=e.view)==null?void 0:h.highlight,e.touring]),w=I.useRef(!0);return I.useEffect(()=>{if(!o)return;const x=e.view?qd(e.map,e.view.highlight.length?e.view.highlight:e.view.focus?[e.view.focus]:[]):[];let S=0,_=0;const N=()=>{const C=s.getNodes();if(S<2||!C.length||!C.every(R=>{var L,O;return(O=(L=s.getInternalNode(R.id))==null?void 0:L.measured)==null?void 0:O.width})){S++<60&&(_=requestAnimationFrame(N));return}const $=w.current?0:650;w.current=!1;const D=x.length?{top:"60px",left:e.touring?sC:"60px",right:"60px",bottom:"150px"}:{top:"64px",left:"32px",right:"32px",bottom:"130px"};s.fitView(x.length?{nodes:x.map(R=>({id:R})),duration:$,padding:D,maxZoom:1.15}:{duration:$,padding:D,maxZoom:1.1})};return _=requestAnimationFrame(N),()=>cancelAnimationFrame(_)},[v]),y.jsx(BN,{nodes:c,edges:d,nodeTypes:oC,edgeTypes:iC,onNodeClick:()=>{},onEdgeClick:(x,S)=>{S.id.startsWith("e:")&&e.onSelect("edges",S.id.slice(2),x.shiftKey||x.metaKey),S.id.startsWith("a:")&&e.onSelect("absences",S.id.slice(2),x.shiftKey||x.metaKey)},onPaneClick:e.onClear,panOnDrag:!0,elementsSelectable:!1,nodesDraggable:!1,nodesConnectable:!1,minZoom:.15,maxZoom:2,children:y.jsx(GN,{variant:Wt.Dots,gap:22,size:1.3})})}function dl(e){e!==`${location.pathname}${location.search}`&&(history.pushState(null,"",e),window.dispatchEvent(new PopStateEvent("popstate")))}function aC(){const[e,t]=I.useState(location.pathname);return I.useEffect(()=>{const n=()=>t(location.pathname),r=o=>{var s,l;if(o.defaultPrevented||o.button!==0||o.metaKey||o.ctrlKey||o.shiftKey||o.altKey)return;const i=(l=(s=o.target)==null?void 0:s.closest)==null?void 0:l.call(s,"a[href]");!(i instanceof HTMLAnchorElement)||i.target||i.origin!==location.origin||(o.preventDefault(),dl(`${i.pathname}${i.search}`))};return window.addEventListener("popstate",n),document.addEventListener("click",r),()=>{window.removeEventListener("popstate",n),document.removeEventListener("click",r)}},[]),e}function v0({busy:e,onStopped:t,onError:n}){return y.jsx("button",{className:"pill-btn",disabled:e,title:e?"Claude is still working":"Maps stay saved. Undo for applied fixes ends.",onClick:()=>cn.stop().then(t,r=>n(r.message)),children:"Stop illuminate"})}function uC(){return y.jsxs("main",{className:"home",children:[y.jsx("h1",{children:"illuminate has stopped"}),y.jsx("p",{className:"muted lede",children:"You can close this tab."}),y.jsxs("p",{className:"muted lede",children:["Maps are saved in ",y.jsx("code",{children:".illuminate/maps"}),". Run ",y.jsx("code",{children:"illume open"})," in the repo to see them again."]})]})}function cC({onStopped:e}){const[t,n]=I.useState(""),[r,o]=I.useState(null),[i,s]=I.useState([]),[l,a]=I.useState(""),[u,c]=I.useState(null),[d,f]=I.useState(!1);I.useEffect(()=>c0(()=>{},()=>{},e),[e]),I.useEffect(()=>{cn.list().then(v=>{n(v.repo),o(v.maps),s(v.making)},v=>c(v.message))},[]);const g=async()=>{if(l.trim()){f(!0);try{const{id:v}=await cn.make(l.trim());dl(Pt(v))}catch(v){c(v.message),f(!1)}}};return y.jsxs("main",{className:"home",children:[y.jsxs("div",{className:"home-brand",children:[y.jsx("i",{className:"brand-mark","aria-hidden":"true"}),"illuminate",t&&y.jsx("span",{className:"muted",children:t})]}),y.jsx("h1",{children:"Ask how your code works"}),y.jsx("p",{className:"muted lede",children:"Every box and arrow is checked against the code."}),y.jsxs("form",{className:"home-ask",onSubmit:v=>{v.preventDefault(),g()},children:[y.jsx("input",{id:"question",value:l,onChange:v=>a(v.target.value),placeholder:"What happens when a user signs up?","aria-label":"Your question",autoFocus:!0}),y.jsx("button",{className:"btn primary",disabled:d||!l.trim(),children:d?"Starting…":"Map it"})]}),u&&y.jsx("div",{className:"banner banner-dead",role:"alert",children:u}),i.length>0&&y.jsxs("section",{children:[y.jsx("h2",{className:"section-title",children:"Being made now"}),y.jsx("ul",{className:"maplist",children:i.map(v=>y.jsxs("li",{children:[y.jsx("a",{href:Pt(v.id),children:v.question}),y.jsx("span",{className:"muted small",children:"Claude is exploring…"})]},v.id))})]}),y.jsxs("section",{children:[y.jsx("h2",{className:"section-title",children:"Maps in this repo"}),r===null?y.jsx("p",{className:"muted",children:"Loading…"}):r.length===0?y.jsx("p",{className:"muted",children:"None yet."}):y.jsx("ul",{className:"maplist",children:r.map(v=>y.jsxs("li",{children:[y.jsx("a",{href:Pt(v.id),children:v.question}),y.jsxs("span",{className:"muted small",children:[new Date(v.updatedAt).toLocaleString(),v.commit?` · ${v.commit.slice(0,7)}`:""]})]},v.id))})]}),y.jsx("footer",{className:"home-foot",children:y.jsx(v0,{busy:i.length>0,onStopped:e,onError:c})})]})}const Jd="illuminate-panel-width",su=300,x0=400,fC=360,Zl=e=>Math.round(Math.max(su,Math.min(e,Math.max(su,window.innerWidth-fC))));function dC(){const[e,t]=I.useState(()=>{const r=Number(localStorage.getItem(Jd));return Zl(r>0?r:x0)}),n=I.useCallback(r=>{const o=Zl(r);t(o),localStorage.setItem(Jd,String(o))},[]);return I.useEffect(()=>{const r=()=>t(o=>Zl(o));return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),[e,n]}function hC({width:e,onWidth:t}){return y.jsx("div",{className:"panel-handle",role:"separator","aria-orientation":"vertical","aria-label":"Panel width","aria-valuenow":e,"aria-valuemin":su,tabIndex:0,title:"Drag to resize the panel",onPointerDown:n=>{n.preventDefault();const r=n.currentTarget;r.setPointerCapture(n.pointerId),document.body.classList.add("resizing");const o=s=>t(window.innerWidth-s.clientX),i=()=>{r.removeEventListener("pointermove",o),r.removeEventListener("pointerup",i),r.removeEventListener("pointercancel",i),document.body.classList.remove("resizing")};r.addEventListener("pointermove",o),r.addEventListener("pointerup",i),r.addEventListener("pointercancel",i)},onDoubleClick:()=>t(x0),onKeyDown:n=>{n.key==="ArrowLeft"&&(n.preventDefault(),t(e+24)),n.key==="ArrowRight"&&(n.preventDefault(),t(e-24))}})}const pC=(...e)=>e.filter(Boolean).join(" ");function mC({map:e,report:t,stop:n,onTour:r,onAsk:o}){var a;const i=e.tour[n];if(!i)return null;const s=n===e.tour.length-1,l=k2(e,t,i.focus.nodes??[]);return y.jsxs("section",{className:"card card-focus tour-bubble","aria-label":"Walkthrough","aria-live":"polite",children:[y.jsx("button",{className:"card-close","aria-label":"Leave the walkthrough",title:"Leave the walkthrough (Esc)",onClick:()=>r(null),children:"×"}),y.jsxs("div",{className:"tour-head",children:[y.jsxs("span",{className:"eyebrow",children:["Walkthrough, stop ",n+1," of ",e.tour.length]}),y.jsx("span",{className:"dots","aria-hidden":"true",children:e.tour.map((u,c)=>y.jsx("i",{className:pC(c===n&&"on",c<n&&"done")},u.id))})]}),y.jsx("h2",{className:"card-title",children:i.title}),y.jsx(Qo,{text:i.text,className:"depth-text"}),l&&y.jsx(wc,{show:l.show,name:l.name}),(a=i.terms)!=null&&a.length?y.jsxs("p",{className:"muted small",children:["Terms: ",i.terms.join(", ")]}):null,y.jsxs("div",{className:"tour-nav",children:[y.jsx("button",{className:"btn",disabled:n===0,onClick:()=>r(n-1),children:"‹ Back"}),y.jsx("button",{className:"btn",onClick:()=>o(`About “${i.title}”: `),children:"Ask about this step"}),y.jsx("span",{className:"grow"}),s?y.jsx("button",{className:"btn primary",onClick:()=>r(null),children:"Done"}):y.jsx("button",{className:"btn primary",onClick:()=>r(n+1),children:"Next ›"})]}),y.jsx("div",{className:"kbd",children:"← → to step, Esc to leave"})]})}const gC="ov.",at=e=>`${gC}${e}`,eh=(e,t,n)=>`ov${e}.${t}.${n}`;function yC(e){if(e.some(t=>t.kind==="entry"))return"entry";for(const t of["external","store","job"])if(e.length&&e.every(n=>n.kind===t))return t;return"step"}const vC=e=>{const t=[...new Set(e)],n=t.slice(0,2).join(", ")+(t.length>2?` +${t.length-2}`:"");return n.length>52?`${n.slice(0,51)}…`:n};function xC(e,t){const n=new Map(e.nodes.map(p=>[p.id,p.area])),r={},o={},i=(p,h)=>{(r[p]??(r[p]=[])).push(h),o[h]=p};for(const p of e.nodes)i(at(p.area),p.id);const s=e.tour.flatMap(p=>p.focus.edges??[]),l=new Map;for(const p of[...s,...e.edges.map(h=>h.id)])l.has(p)||l.set(p,l.size);const a=[...e.edges].sort((p,h)=>l.get(p.id)-l.get(h.id)),u=new Map;for(const p of a){const h=n.get(p.from),x=n.get(p.to);if(!h||!x)continue;if(h===x){i(at(h),p.id);continue}const S=eh("e",h,x);u.has(S)||u.set(S,{from:h,to:x,labels:[]}),u.get(S).labels.push(p.label),i(S,p.id)}const c=e.areas.filter(p=>{var h;return(h=r[at(p.id)])==null?void 0:h.length}),d=c.map(p=>{const h=e.nodes.filter(x=>x.area===p.id);return{id:at(p.id),area:at(p.id),kind:yC(h),name:p.label,symbol:`overview#${h.length} ${h.length===1?"step":"steps"}`,explain:{concept:h.map(x=>x.name).join(" → ")},evidence:h.flatMap(x=>x.evidence)}}),f=[...u].map(([p,h],x)=>({id:p,from:at(h.from),to:at(h.to),kind:"then",label:`${x+1} · ${vC(h.labels)}`,evidence:[]})),g=e.absences.flatMap(p=>{const h=p.between&&n.get(p.between.from),x=p.between&&n.get(p.between.to);if(!h||!x)return[];if(h===x)return i(at(h),p.id),[];const S=eh("a",h,x);return i(S,p.id),r[S].length>1?[]:[{...p,id:S,between:{from:at(h),to:at(x)}}]}),v=p=>{var h;return((h=(t==null?void 0:t.nodes[p])??(t==null?void 0:t.edges[p])??(t==null?void 0:t.absences[p]))==null?void 0:h.status)==="confirmed"},w=p=>(r[p]??[]).every(v)?"confirmed":"unconfirmed",k=p=>({status:w(p),proof:null,evidence:[],reasons:[]}),m=t&&{nodes:Object.fromEntries(d.map(p=>[p.id,k(p.id)])),edges:Object.fromEntries(f.map(p=>[p.id,k(p.id)])),absences:Object.fromEntries(g.map(p=>[p.id,{...t.absences[r[p.id][0]],status:w(p.id)}])),tour:{},screens:Object.fromEntries(d.flatMap(p=>{const h=(r[p.id]??[]).map(x=>{var S;return(S=t.screens)==null?void 0:S[x]}).find(x=>(x==null?void 0:x.status)==="confirmed");return h?[[p.id,h]]:[]})),summary:t.summary};return{map:{...e,areas:c.map(p=>({id:at(p.id),label:""})),nodes:d,edges:f,absences:g,tour:[]},report:m,inside:r,standsFor:o}}function th(e,t){return[...new Set(t.flatMap(n=>e.standsFor[n]?[e.standsFor[n]]:[]))]}function wC(){return Hr?y.jsx(SC,{}):y.jsxs("main",{className:"home",children:[y.jsx("h1",{children:"Open illuminate from its link"}),y.jsxs("p",{className:"muted lede",children:["Use the link illuminate printed in your terminal (it ends in ",y.jsx("code",{children:"?t=…"}),")."]})]})}function SC(){const[e,t]=I.useState(!1),n=I.useCallback(()=>{window.close(),t(!0)},[]),r=aC();if(e)return y.jsx(uC,{});const o=/^\/m\/([a-z0-9-]{1,80})\/?$/.exec(r);return o?y.jsx(CC,{mapId:o[1],onStopped:n},o[1]):y.jsx(cC,{onStopped:n})}function kC({mapId:e,question:t}){const[n,r]=I.useState([]);I.useEffect(()=>{cn.list().then(i=>r([...i.making.map(s=>({...s,making:!0})),...i.maps.map(s=>({id:s.id,question:s.question}))]),()=>{})},[e]);const o=n.some(i=>i.id===e)?n:[{id:e,question:t},...n];return y.jsx("select",{className:"switcher",value:e,onChange:i=>dl(Pt(i.target.value)),"aria-label":"Switch to another map",title:"Switch to another map in this repo",children:o.map(i=>y.jsxs("option",{value:i.id,children:[i.question||i.id,i.making?" (being made)":""]},i.id))})}function EC({report:e}){if(!e)return null;const t=e.summary.unconfirmed;return t?y.jsx("span",{className:"map-status off",title:"Every time the map is shown, illuminate re-checks it against the code. These parts no longer hold, usually because the code changed after the map was made. They're dashed and marked ? on the map; click one to see why.",children:t===1?"1 part of this map doesn’t match the code":`${t} parts of this map don’t match the code`}):y.jsx("span",{className:"map-status ok",title:"Every box, arrow and gap on this map was just re-checked against the code, and all of it holds.",children:"✓ Matches the code"})}const w0="illuminate-level",_C=()=>{try{return localStorage.getItem(w0)==="big"?"big":"steps"}catch{return"steps"}},NC={nodes:[],edges:[],absences:[]},nh=[];function CC({mapId:e,onStopped:t}){var z,T,A,P,j;const[n,r]=I.useReducer(z2,e,j2),[o,i]=I.useState(""),[s,l]=dC(),a=I.useRef(!1),[u,c]=I.useState(_C),d=I.useCallback(M=>{c(M);try{localStorage.setItem(w0,M)}catch{}},[]),f=I.useCallback(()=>{cn.get(e).then(M=>r({type:"loaded",payload:M}),M=>r(M instanceof u0&&/No such map/.test(M.message)?{type:"missing"}:{type:"error",message:M.message}))},[e]);I.useEffect(f,[f]),I.useEffect(()=>c0(M=>r({type:"event",event:M}),M=>{r({type:"connected",value:M}),M&&a.current===!1&&n.phase!=="loading"&&f(),a.current=M},t),[]);const g=I.useCallback(M=>{const b=M.trim();!b||n.job||cn.ask(e,b,n.selection).then(()=>i(""),F=>r({type:"error",message:F.message}))},[e,n.job,n.selection]),v=(M,b)=>{b==="approve"&&r({type:"fixStatus",fixId:M,status:"applying",problems:[]}),cn[b](e,M).catch(F=>{r(b==="approve"?{type:"fixStatus",fixId:M,status:"failed",problems:F.problems.length?F.problems:[F.message]}:{type:"error",message:[F.message,...F.problems].join(" ")})})},w=(M,b)=>{cn.offer(e,M,b).then(F=>{F.id&&dl(Pt(F.id))},F=>r({type:"error",message:F.message}))};I.useEffect(()=>{const M=b=>{const F=b.target instanceof HTMLTextAreaElement||b.target instanceof HTMLInputElement;if(b.key==="Escape"){n.tour!==null?r({type:"tour",stop:null}):es(n.selection)?r({type:"clearSelection"}):r({type:"overview"});return}F||n.tour===null||(b.key==="ArrowRight"&&r({type:"tour",stop:n.tour+1}),b.key==="ArrowLeft"&&r({type:"tour",stop:n.tour-1}))};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[n.tour,n.selection]);const k=n.answers.find(M=>M.id===n.shown),m=k!=null&&k.fix&&["proposed","applying","failed"].includes(((z=n.fixes[k.fix.id])==null?void 0:z.status)??"")?k.fix:null,p=I.useCallback((M,b,F)=>r({type:"select",kind:M,id:b,additive:F}),[]),h=I.useCallback(()=>r({type:"clearSelection"}),[]),x=f0(n),S=$2(n),_=I.useMemo(()=>u==="big"&&x?xC(x,n.report):null,[u,x,n.report]),N=P2(n),C=I.useMemo(()=>_&&N?{focus:N.focus?th(_,[N.focus])[0]??null:null,highlight:th(_,N.highlight)}:null,[_,N]),$=I.useCallback((M,b)=>{var W;const F=(W=_==null?void 0:_.inside[b])==null?void 0:W[0];d("steps"),F&&r({type:"focus",id:F})},[_,d]),D=!!n.map&&n.tour!==null,L=(!n.map||!!n.error||!!n.job||n.shown!==null||es(n.selection)>0)&&(!D||!!n.error||((T=n.job)==null?void 0:T.kind)==="ask"),O=L&&!!n.map,E=n.map?y.jsx(F2,{map:n.map,selection:n.selection,draft:o,busy:!!n.job,autoFocus:O,onDraft:i,onRemove:(M,b)=>r({type:"select",kind:M,id:b,additive:!0}),onSend:()=>g(o)}):null;return y.jsx(i0,{children:y.jsxs("div",{className:"app",children:[y.jsxs("header",{className:"topbar",children:[y.jsxs("a",{className:"brand",href:Pt(),title:"All maps in this repo",children:[y.jsx("i",{className:"brand-mark","aria-hidden":"true"}),"illuminate"]}),y.jsxs("div",{className:"topbar-map",children:[((A=n.meta)==null?void 0:A.parent)&&y.jsxs("a",{className:"crumb",href:Pt(n.meta.parent.mapId),title:`Back to the map this one came from: ${n.meta.parent.question}`,children:["← ",n.meta.parent.question]}),y.jsx(kC,{mapId:e,question:((P=n.map)==null?void 0:P.question)??((j=n.job)==null?void 0:j.question)??""})]}),y.jsx(EC,{report:n.report}),y.jsx("a",{className:"pill-btn",href:Pt(),title:"Ask a new question and make a map for it",children:"New map"}),y.jsx(v0,{busy:!!n.job,onStopped:t,onError:M=>r({type:"error",message:M})}),y.jsx("span",{className:n.connected?"live on":"live",title:n.connected?"Connected to illuminate":"Reconnecting to illuminate…"})]}),y.jsxs("div",{className:L?"body":"body full",style:{"--panel-w":`${s}px`},children:[y.jsx("div",{className:"canvas",children:n.map&&x?y.jsxs(y.Fragment,{children:[_?y.jsx(Zd,{map:_.map,report:_.report,selection:NC,view:C,fresh:nh,added:nh,ghost:null,touring:D,onSelect:$,onClear:h},"big"):y.jsx(Zd,{map:x,report:n.report,selection:n.selection,view:N,fresh:n.fresh,added:S,ghost:m??null,touring:D,onSelect:p,onClear:h},"steps"),y.jsxs("div",{className:"level",role:"group","aria-label":"How much detail the map shows",children:[y.jsx("button",{className:u==="big"?"on":void 0,"aria-pressed":u==="big",onClick:()=>d("big"),title:"Each part of the app as one box",children:"Big picture"}),y.jsx("button",{className:u==="steps"?"on":void 0,"aria-pressed":u==="steps",onClick:()=>d("steps"),title:"Every step inside each part",children:"Steps"})]}),!D&&!L&&y.jsx(V2,{state:n,dispatch:r}),D&&y.jsx(mC,{map:n.map,report:n.report,stop:n.tour,onTour:M=>r({type:"tour",stop:M}),onAsk:i}),y.jsx(H2,{map:n.map,tour:n.tour,onTour:M=>r({type:"tour",stop:M}),selected:es(n.selection),children:O?null:E})]}):y.jsx("div",{className:"empty",children:n.phase==="making"?y.jsx("div",{className:"pulse",children:"Claude is exploring the code…"}):null})}),L&&y.jsx(hC,{width:s,onWidth:l}),L&&y.jsx(A2,{state:n,dispatch:r,onFix:v,onFocus:M=>r({type:"focus",id:M}),onOffer:w,composer:O?E:null})]})]})})}ym(document.getElementById("root")).render(y.jsx(I.StrictMode,{children:y.jsx(wC,{})}));export{MC as c,rh as g};
70
- //# sourceMappingURL=index-D374Mq5G.js.map