@johnz4021/illuminate 0.3.0 → 0.4.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,71 +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 FC=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hh={exports:{}},Ws={},ph={exports:{}},oe={};/**
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 ei=Symbol.for("react.element"),Ty=Symbol.for("react.portal"),by=Symbol.for("react.fragment"),zy=Symbol.for("react.strict_mode"),Ly=Symbol.for("react.profiler"),Ay=Symbol.for("react.provider"),Ry=Symbol.for("react.context"),Dy=Symbol.for("react.forward_ref"),Oy=Symbol.for("react.suspense"),Fy=Symbol.for("react.memo"),Hy=Symbol.for("react.lazy"),Oc=Symbol.iterator;function By(e){return e===null||typeof e!="object"?null:(e=Oc&&e[Oc]||e["@@iterator"],typeof e=="function"?e:null)}var mh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},gh=Object.assign,yh={};function Yr(e,t,n){this.props=e,this.context=t,this.refs=yh,this.updater=n||mh}Yr.prototype.isReactComponent={};Yr.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")};Yr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function vh(){}vh.prototype=Yr.prototype;function mu(e,t,n){this.props=e,this.context=t,this.refs=yh,this.updater=n||mh}var gu=mu.prototype=new vh;gu.constructor=mu;gh(gu,Yr.prototype);gu.isPureReactComponent=!0;var Fc=Array.isArray,xh=Object.prototype.hasOwnProperty,yu={current:null},wh={key:!0,ref:!0,__self:!0,__source:!0};function kh(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)xh.call(t,r)&&!wh.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:ei,type:e,key:i,ref:s,props:o,_owner:yu.current}}function Vy(e,t){return{$$typeof:ei,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function vu(e){return typeof e=="object"&&e!==null&&e.$$typeof===ei}function Wy(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Hc=/\/+/g;function Nl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Wy(""+e.key):t.toString(36)}function Bi(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 ei:case Ty:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Nl(s,0):r,Fc(o)?(n="",e!=null&&(n=e.replace(Hc,"$&/")+"/"),Bi(o,t,n,"",function(u){return u})):o!=null&&(vu(o)&&(o=Vy(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(Hc,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",Fc(e))for(var l=0;l<e.length;l++){i=e[l];var a=r+Nl(i,l);s+=Bi(i,t,n,a,o)}else if(a=By(e),typeof a=="function")for(e=a.call(e),l=0;!(i=e.next()).done;)i=i.value,a=r+Nl(i,l++),s+=Bi(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 mi(e,t,n){if(e==null)return e;var r=[],o=0;return Bi(e,r,"","",function(i){return t.call(n,i,o++)}),r}function Uy(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 Re={current:null},Vi={transition:null},Yy={ReactCurrentDispatcher:Re,ReactCurrentBatchConfig:Vi,ReactCurrentOwner:yu};function Sh(){throw Error("act(...) is not supported in production builds of React.")}oe.Children={map:mi,forEach:function(e,t,n){mi(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return mi(e,function(){t++}),t},toArray:function(e){return mi(e,function(t){return t})||[]},only:function(e){if(!vu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};oe.Component=Yr;oe.Fragment=by;oe.Profiler=Ly;oe.PureComponent=mu;oe.StrictMode=zy;oe.Suspense=Oy;oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yy;oe.act=Sh;oe.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=gh({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=yu.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)xh.call(t,a)&&!wh.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:ei,type:e.type,key:o,ref:i,props:r,_owner:s}};oe.createContext=function(e){return e={$$typeof:Ry,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Ay,_context:e},e.Consumer=e};oe.createElement=kh;oe.createFactory=function(e){var t=kh.bind(null,e);return t.type=e,t};oe.createRef=function(){return{current:null}};oe.forwardRef=function(e){return{$$typeof:Dy,render:e}};oe.isValidElement=vu;oe.lazy=function(e){return{$$typeof:Hy,_payload:{_status:-1,_result:e},_init:Uy}};oe.memo=function(e,t){return{$$typeof:Fy,type:e,compare:t===void 0?null:t}};oe.startTransition=function(e){var t=Vi.transition;Vi.transition={};try{e()}finally{Vi.transition=t}};oe.unstable_act=Sh;oe.useCallback=function(e,t){return Re.current.useCallback(e,t)};oe.useContext=function(e){return Re.current.useContext(e)};oe.useDebugValue=function(){};oe.useDeferredValue=function(e){return Re.current.useDeferredValue(e)};oe.useEffect=function(e,t){return Re.current.useEffect(e,t)};oe.useId=function(){return Re.current.useId()};oe.useImperativeHandle=function(e,t,n){return Re.current.useImperativeHandle(e,t,n)};oe.useInsertionEffect=function(e,t){return Re.current.useInsertionEffect(e,t)};oe.useLayoutEffect=function(e,t){return Re.current.useLayoutEffect(e,t)};oe.useMemo=function(e,t){return Re.current.useMemo(e,t)};oe.useReducer=function(e,t,n){return Re.current.useReducer(e,t,n)};oe.useRef=function(e){return Re.current.useRef(e)};oe.useState=function(e){return Re.current.useState(e)};oe.useSyncExternalStore=function(e,t,n){return Re.current.useSyncExternalStore(e,t,n)};oe.useTransition=function(){return Re.current.useTransition()};oe.version="18.3.1";ph.exports=oe;var b=ph.exports;const Xy=fh(b);/**
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 Ky=b,Qy=Symbol.for("react.element"),Gy=Symbol.for("react.fragment"),qy=Object.prototype.hasOwnProperty,Zy=Ky.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Jy={key:!0,ref:!0,__self:!0,__source:!0};function Eh(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)qy.call(t,r)&&!Jy.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:Qy,type:e,key:i,ref:s,props:o,_owner:Zy.current}}Ws.Fragment=Gy;Ws.jsx=Eh;Ws.jsxs=Eh;hh.exports=Ws;var h=hh.exports,Nh={exports:{}},Ze={},_h={exports:{}},Ch={};/**
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,$){var z=P.length;P.push($);e:for(;0<z;){var j=z-1>>>1,A=P[j];if(0<o(A,$))P[j]=$,P[z]=A,z=j;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var $=P[0],z=P.pop();if(z!==$){P[0]=z;e:for(var j=0,A=P.length,V=A>>>1;j<V;){var U=2*(j+1)-1,G=P[U],B=U+1,X=P[B];if(0>o(G,z))B<A&&0>o(X,G)?(P[j]=X,P[B]=z,j=B):(P[j]=G,P[U]=z,j=U);else if(B<A&&0>o(X,z))P[j]=X,P[B]=z,j=B;else break e}}return $}function o(P,$){var z=P.sortIndex-$.sortIndex;return z!==0?z:P.id-$.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,f=null,d=3,p=!1,y=!1,x=!1,k=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(P){for(var $=n(u);$!==null;){if($.callback===null)r(u);else if($.startTime<=P)r(u),$.sortIndex=$.expirationTime,t(a,$);else break;$=n(u)}}function w(P){if(x=!1,g(P),!y)if(n(a)!==null)y=!0,M(N);else{var $=n(u);$!==null&&T(w,$.startTime-P)}}function N(P,$){y=!1,x&&(x=!1,m(C),C=-1),p=!0;var z=d;try{for(g($),f=n(a);f!==null&&(!(f.expirationTime>$)||P&&!D());){var j=f.callback;if(typeof j=="function"){f.callback=null,d=f.priorityLevel;var A=j(f.expirationTime<=$);$=e.unstable_now(),typeof A=="function"?f.callback=A:f===n(a)&&r(a),g($)}else r(a);f=n(a)}if(f!==null)var V=!0;else{var U=n(u);U!==null&&T(w,U.startTime-$),V=!1}return V}finally{f=null,d=z,p=!1}}var S=!1,_=null,C=-1,I=5,R=-1;function D(){return!(e.unstable_now()-R<I)}function H(){if(_!==null){var P=e.unstable_now();R=P;var $=!0;try{$=_(!0,P)}finally{$?F():(S=!1,_=null)}}else S=!1}var F;if(typeof v=="function")F=function(){v(H)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,L=E.port2;E.port1.onmessage=H,F=function(){L.postMessage(null)}}else F=function(){k(H,0)};function M(P){_=P,S||(S=!0,F())}function T(P,$){C=k(function(){P(e.unstable_now())},$)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_continueExecution=function(){y||p||(y=!0,M(N))},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"):I=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(P){switch(d){case 1:case 2:case 3:var $=3;break;default:$=d}var z=d;d=$;try{return P()}finally{d=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(P,$){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var z=d;d=P;try{return $()}finally{d=z}},e.unstable_scheduleCallback=function(P,$,z){var j=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?j+z:j):z=j,P){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=z+A,P={id:c++,callback:$,priorityLevel:P,startTime:z,expirationTime:A,sortIndex:-1},z>j?(P.sortIndex=z,t(u,P),n(a)===null&&P===n(u)&&(x?(m(C),C=-1):x=!0,T(w,z-j))):(P.sortIndex=A,t(a,P),y||p||(y=!0,M(N))),P},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(P){var $=d;return function(){var z=d;d=$;try{return P.apply(this,arguments)}finally{d=z}}}})(Ch);_h.exports=Ch;var ev=_h.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 tv=b,Ge=ev;function W(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 jh=new Set,_o={};function tr(e,t){Pr(e,t),Pr(e+"Capture",t)}function Pr(e,t){for(_o[e]=t,e=0;e<t.length;e++)jh.add(t[e])}var Ut=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),la=Object.prototype.hasOwnProperty,nv=/^[: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]*$/,Bc={},Vc={};function rv(e){return la.call(Vc,e)?!0:la.call(Bc,e)?!1:nv.test(e)?Vc[e]=!0:(Bc[e]=!0,!1)}function ov(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 iv(e,t,n,r){if(t===null||typeof t>"u"||ov(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 De(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 $e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$e[e]=new De(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$e[t]=new De(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$e[e]=new De(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$e[e]=new De(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){$e[e]=new De(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$e[e]=new De(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$e[e]=new De(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$e[e]=new De(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$e[e]=new De(e,5,!1,e.toLowerCase(),null,!1,!1)});var xu=/[\-:]([a-z])/g;function wu(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(xu,wu);$e[t]=new De(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(xu,wu);$e[t]=new De(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(xu,wu);$e[t]=new De(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$e[e]=new De(e,1,!1,e.toLowerCase(),null,!1,!1)});$e.xlinkHref=new De("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$e[e]=new De(e,1,!1,e.toLowerCase(),null,!0,!0)});function ku(e,t,n,r){var o=$e.hasOwnProperty(t)?$e[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(iv(t,n,o,r)&&(n=null),r||o===null?rv(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 Gt=tv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,gi=Symbol.for("react.element"),ur=Symbol.for("react.portal"),cr=Symbol.for("react.fragment"),Su=Symbol.for("react.strict_mode"),aa=Symbol.for("react.profiler"),Mh=Symbol.for("react.provider"),$h=Symbol.for("react.context"),Eu=Symbol.for("react.forward_ref"),ua=Symbol.for("react.suspense"),ca=Symbol.for("react.suspense_list"),Nu=Symbol.for("react.memo"),en=Symbol.for("react.lazy"),Ph=Symbol.for("react.offscreen"),Wc=Symbol.iterator;function Gr(e){return e===null||typeof e!="object"?null:(e=Wc&&e[Wc]||e["@@iterator"],typeof e=="function"?e:null)}var ge=Object.assign,_l;function so(e){if(_l===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);_l=t&&t[1]||""}return`
34
- `+_l+e}var Cl=!1;function jl(e,t){if(!e||Cl)return"";Cl=!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{Cl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?so(e):""}function sv(e){switch(e.tag){case 5:return so(e.type);case 16:return so("Lazy");case 13:return so("Suspense");case 19:return so("SuspenseList");case 0:case 2:case 15:return e=jl(e.type,!1),e;case 11:return e=jl(e.type.render,!1),e;case 1:return e=jl(e.type,!0),e;default:return""}}function da(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 cr:return"Fragment";case ur:return"Portal";case aa:return"Profiler";case Su:return"StrictMode";case ua:return"Suspense";case ca:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case $h:return(e.displayName||"Context")+".Consumer";case Mh:return(e._context.displayName||"Context")+".Provider";case Eu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Nu:return t=e.displayName||null,t!==null?t:da(e.type)||"Memo";case en:t=e._payload,e=e._init;try{return da(e(t))}catch{}}return null}function lv(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 da(t);case 8:return t===Su?"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 wn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ih(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function av(e){var t=Ih(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 yi(e){e._valueTracker||(e._valueTracker=av(e))}function Th(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ih(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ss(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 fa(e,t){var n=t.checked;return ge({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Uc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=wn(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 bh(e,t){t=t.checked,t!=null&&ku(e,"checked",t,!1)}function ha(e,t){bh(e,t);var n=wn(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")?pa(e,t.type,n):t.hasOwnProperty("defaultValue")&&pa(e,t.type,wn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Yc(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 pa(e,t,n){(t!=="number"||ss(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var lo=Array.isArray;function Sr(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=""+wn(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 ma(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(W(91));return ge({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Xc(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(W(92));if(lo(n)){if(1<n.length)throw Error(W(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:wn(n)}}function zh(e,t){var n=wn(t.value),r=wn(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 Kc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Lh(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 ga(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Lh(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var vi,Ah=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(vi=vi||document.createElement("div"),vi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=vi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Co(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ho={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},uv=["Webkit","ms","Moz","O"];Object.keys(ho).forEach(function(e){uv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ho[t]=ho[e]})});function Rh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ho.hasOwnProperty(e)&&ho[e]?(""+t).trim():t+"px"}function Dh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Rh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var cv=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 ya(e,t){if(t){if(cv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(W(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(W(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(W(61))}if(t.style!=null&&typeof t.style!="object")throw Error(W(62))}}function va(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 xa=null;function _u(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wa=null,Er=null,Nr=null;function Qc(e){if(e=ri(e)){if(typeof wa!="function")throw Error(W(280));var t=e.stateNode;t&&(t=Qs(t),wa(e.stateNode,e.type,t))}}function Oh(e){Er?Nr?Nr.push(e):Nr=[e]:Er=e}function Fh(){if(Er){var e=Er,t=Nr;if(Nr=Er=null,Qc(e),t)for(e=0;e<t.length;e++)Qc(t[e])}}function Hh(e,t){return e(t)}function Bh(){}var Ml=!1;function Vh(e,t,n){if(Ml)return e(t,n);Ml=!0;try{return Hh(e,t,n)}finally{Ml=!1,(Er!==null||Nr!==null)&&(Bh(),Fh())}}function jo(e,t){var n=e.stateNode;if(n===null)return null;var r=Qs(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(W(231,t,typeof n));return n}var ka=!1;if(Ut)try{var qr={};Object.defineProperty(qr,"passive",{get:function(){ka=!0}}),window.addEventListener("test",qr,qr),window.removeEventListener("test",qr,qr)}catch{ka=!1}function dv(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 po=!1,ls=null,as=!1,Sa=null,fv={onError:function(e){po=!0,ls=e}};function hv(e,t,n,r,o,i,s,l,a){po=!1,ls=null,dv.apply(fv,arguments)}function pv(e,t,n,r,o,i,s,l,a){if(hv.apply(this,arguments),po){if(po){var u=ls;po=!1,ls=null}else throw Error(W(198));as||(as=!0,Sa=u)}}function nr(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 Wh(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 Gc(e){if(nr(e)!==e)throw Error(W(188))}function mv(e){var t=e.alternate;if(!t){if(t=nr(e),t===null)throw Error(W(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 Gc(o),e;if(i===r)return Gc(o),t;i=i.sibling}throw Error(W(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(W(189))}}if(n.alternate!==r)throw Error(W(190))}if(n.tag!==3)throw Error(W(188));return n.stateNode.current===n?e:t}function Uh(e){return e=mv(e),e!==null?Yh(e):null}function Yh(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Yh(e);if(t!==null)return t;e=e.sibling}return null}var Xh=Ge.unstable_scheduleCallback,qc=Ge.unstable_cancelCallback,gv=Ge.unstable_shouldYield,yv=Ge.unstable_requestPaint,xe=Ge.unstable_now,vv=Ge.unstable_getCurrentPriorityLevel,Cu=Ge.unstable_ImmediatePriority,Kh=Ge.unstable_UserBlockingPriority,us=Ge.unstable_NormalPriority,xv=Ge.unstable_LowPriority,Qh=Ge.unstable_IdlePriority,Us=null,$t=null;function wv(e){if($t&&typeof $t.onCommitFiberRoot=="function")try{$t.onCommitFiberRoot(Us,e,void 0,(e.current.flags&128)===128)}catch{}}var vt=Math.clz32?Math.clz32:Ev,kv=Math.log,Sv=Math.LN2;function Ev(e){return e>>>=0,e===0?32:31-(kv(e)/Sv|0)|0}var xi=64,wi=4194304;function ao(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 cs(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=ao(l):(i&=s,i!==0&&(r=ao(i)))}else s=n&~o,s!==0?r=ao(s):i!==0&&(r=ao(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-vt(t),o=1<<n,r|=e[n],t&=~o;return r}function Nv(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 _v(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-vt(i),l=1<<s,a=o[s];a===-1?(!(l&n)||l&r)&&(o[s]=Nv(l,t)):a<=t&&(e.expiredLanes|=l),i&=~l}}function Ea(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Gh(){var e=xi;return xi<<=1,!(xi&4194240)&&(xi=64),e}function $l(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ti(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-vt(t),e[t]=n}function Cv(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-vt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function ju(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-vt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var ae=0;function qh(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Zh,Mu,Jh,ep,tp,Na=!1,ki=[],fn=null,hn=null,pn=null,Mo=new Map,$o=new Map,on=[],jv="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 Zc(e,t){switch(e){case"focusin":case"focusout":fn=null;break;case"dragenter":case"dragleave":hn=null;break;case"mouseover":case"mouseout":pn=null;break;case"pointerover":case"pointerout":Mo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":$o.delete(t.pointerId)}}function Zr(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=ri(t),t!==null&&Mu(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Mv(e,t,n,r,o){switch(t){case"focusin":return fn=Zr(fn,e,t,n,r,o),!0;case"dragenter":return hn=Zr(hn,e,t,n,r,o),!0;case"mouseover":return pn=Zr(pn,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Mo.set(i,Zr(Mo.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,$o.set(i,Zr($o.get(i)||null,e,t,n,r,o)),!0}return!1}function np(e){var t=Tn(e.target);if(t!==null){var n=nr(t);if(n!==null){if(t=n.tag,t===13){if(t=Wh(n),t!==null){e.blockedOn=t,tp(e.priority,function(){Jh(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 Wi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=_a(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);xa=r,n.target.dispatchEvent(r),xa=null}else return t=ri(n),t!==null&&Mu(t),e.blockedOn=n,!1;t.shift()}return!0}function Jc(e,t,n){Wi(e)&&n.delete(t)}function $v(){Na=!1,fn!==null&&Wi(fn)&&(fn=null),hn!==null&&Wi(hn)&&(hn=null),pn!==null&&Wi(pn)&&(pn=null),Mo.forEach(Jc),$o.forEach(Jc)}function Jr(e,t){e.blockedOn===t&&(e.blockedOn=null,Na||(Na=!0,Ge.unstable_scheduleCallback(Ge.unstable_NormalPriority,$v)))}function Po(e){function t(o){return Jr(o,e)}if(0<ki.length){Jr(ki[0],e);for(var n=1;n<ki.length;n++){var r=ki[n];r.blockedOn===e&&(r.blockedOn=null)}}for(fn!==null&&Jr(fn,e),hn!==null&&Jr(hn,e),pn!==null&&Jr(pn,e),Mo.forEach(t),$o.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);)np(n),n.blockedOn===null&&on.shift()}var _r=Gt.ReactCurrentBatchConfig,ds=!0;function Pv(e,t,n,r){var o=ae,i=_r.transition;_r.transition=null;try{ae=1,$u(e,t,n,r)}finally{ae=o,_r.transition=i}}function Iv(e,t,n,r){var o=ae,i=_r.transition;_r.transition=null;try{ae=4,$u(e,t,n,r)}finally{ae=o,_r.transition=i}}function $u(e,t,n,r){if(ds){var o=_a(e,t,n,r);if(o===null)Ol(e,t,r,fs,n),Zc(e,r);else if(Mv(o,e,t,n,r))r.stopPropagation();else if(Zc(e,r),t&4&&-1<jv.indexOf(e)){for(;o!==null;){var i=ri(o);if(i!==null&&Zh(i),i=_a(e,t,n,r),i===null&&Ol(e,t,r,fs,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Ol(e,t,r,null,n)}}var fs=null;function _a(e,t,n,r){if(fs=null,e=_u(r),e=Tn(e),e!==null)if(t=nr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Wh(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 fs=e,null}function rp(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(vv()){case Cu:return 1;case Kh:return 4;case us:case xv:return 16;case Qh:return 536870912;default:return 16}default:return 16}}var an=null,Pu=null,Ui=null;function op(){if(Ui)return Ui;var e,t=Pu,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 Ui=o.slice(e,1<r?1-r:void 0)}function Yi(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 Si(){return!0}function ed(){return!1}function Je(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)?Si:ed,this.isPropagationStopped=ed,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=Si)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Si)},persist:function(){},isPersistent:Si}),t}var Xr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Iu=Je(Xr),ni=ge({},Xr,{view:0,detail:0}),Tv=Je(ni),Pl,Il,eo,Ys=ge({},ni,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Tu,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!==eo&&(eo&&e.type==="mousemove"?(Pl=e.screenX-eo.screenX,Il=e.screenY-eo.screenY):Il=Pl=0,eo=e),Pl)},movementY:function(e){return"movementY"in e?e.movementY:Il}}),td=Je(Ys),bv=ge({},Ys,{dataTransfer:0}),zv=Je(bv),Lv=ge({},ni,{relatedTarget:0}),Tl=Je(Lv),Av=ge({},Xr,{animationName:0,elapsedTime:0,pseudoElement:0}),Rv=Je(Av),Dv=ge({},Xr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Ov=Je(Dv),Fv=ge({},Xr,{data:0}),nd=Je(Fv),Hv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bv={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"},Vv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Wv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Vv[e])?!!t[e]:!1}function Tu(){return Wv}var Uv=ge({},ni,{key:function(e){if(e.key){var t=Hv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Yi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Bv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Tu,charCode:function(e){return e.type==="keypress"?Yi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Yv=Je(Uv),Xv=ge({},Ys,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rd=Je(Xv),Kv=ge({},ni,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Tu}),Qv=Je(Kv),Gv=ge({},Xr,{propertyName:0,elapsedTime:0,pseudoElement:0}),qv=Je(Gv),Zv=ge({},Ys,{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}),Jv=Je(Zv),ex=[9,13,27,32],bu=Ut&&"CompositionEvent"in window,mo=null;Ut&&"documentMode"in document&&(mo=document.documentMode);var tx=Ut&&"TextEvent"in window&&!mo,ip=Ut&&(!bu||mo&&8<mo&&11>=mo),od=" ",id=!1;function sp(e,t){switch(e){case"keyup":return ex.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var dr=!1;function nx(e,t){switch(e){case"compositionend":return lp(t);case"keypress":return t.which!==32?null:(id=!0,od);case"textInput":return e=t.data,e===od&&id?null:e;default:return null}}function rx(e,t){if(dr)return e==="compositionend"||!bu&&sp(e,t)?(e=op(),Ui=Pu=an=null,dr=!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 ip&&t.locale!=="ko"?null:t.data;default:return null}}var ox={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 sd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ox[e.type]:t==="textarea"}function ap(e,t,n,r){Oh(r),t=hs(t,"onChange"),0<t.length&&(n=new Iu("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var go=null,Io=null;function ix(e){xp(e,0)}function Xs(e){var t=pr(e);if(Th(t))return e}function sx(e,t){if(e==="change")return t}var up=!1;if(Ut){var bl;if(Ut){var zl="oninput"in document;if(!zl){var ld=document.createElement("div");ld.setAttribute("oninput","return;"),zl=typeof ld.oninput=="function"}bl=zl}else bl=!1;up=bl&&(!document.documentMode||9<document.documentMode)}function ad(){go&&(go.detachEvent("onpropertychange",cp),Io=go=null)}function cp(e){if(e.propertyName==="value"&&Xs(Io)){var t=[];ap(t,Io,e,_u(e)),Vh(ix,t)}}function lx(e,t,n){e==="focusin"?(ad(),go=t,Io=n,go.attachEvent("onpropertychange",cp)):e==="focusout"&&ad()}function ax(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xs(Io)}function ux(e,t){if(e==="click")return Xs(t)}function cx(e,t){if(e==="input"||e==="change")return Xs(t)}function dx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wt=typeof Object.is=="function"?Object.is:dx;function To(e,t){if(wt(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(!la.call(t,o)||!wt(e[o],t[o]))return!1}return!0}function ud(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cd(e,t){var n=ud(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=ud(n)}}function dp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?dp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function fp(){for(var e=window,t=ss();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ss(e.document)}return t}function zu(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 fx(e){var t=fp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&dp(n.ownerDocument.documentElement,n)){if(r!==null&&zu(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=cd(n,i);var s=cd(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 hx=Ut&&"documentMode"in document&&11>=document.documentMode,fr=null,Ca=null,yo=null,ja=!1;function dd(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ja||fr==null||fr!==ss(r)||(r=fr,"selectionStart"in r&&zu(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}),yo&&To(yo,r)||(yo=r,r=hs(Ca,"onSelect"),0<r.length&&(t=new Iu("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=fr)))}function Ei(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var hr={animationend:Ei("Animation","AnimationEnd"),animationiteration:Ei("Animation","AnimationIteration"),animationstart:Ei("Animation","AnimationStart"),transitionend:Ei("Transition","TransitionEnd")},Ll={},hp={};Ut&&(hp=document.createElement("div").style,"AnimationEvent"in window||(delete hr.animationend.animation,delete hr.animationiteration.animation,delete hr.animationstart.animation),"TransitionEvent"in window||delete hr.transitionend.transition);function Ks(e){if(Ll[e])return Ll[e];if(!hr[e])return e;var t=hr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in hp)return Ll[e]=t[n];return e}var pp=Ks("animationend"),mp=Ks("animationiteration"),gp=Ks("animationstart"),yp=Ks("transitionend"),vp=new Map,fd="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 En(e,t){vp.set(e,t),tr(t,[e])}for(var Al=0;Al<fd.length;Al++){var Rl=fd[Al],px=Rl.toLowerCase(),mx=Rl[0].toUpperCase()+Rl.slice(1);En(px,"on"+mx)}En(pp,"onAnimationEnd");En(mp,"onAnimationIteration");En(gp,"onAnimationStart");En("dblclick","onDoubleClick");En("focusin","onFocus");En("focusout","onBlur");En(yp,"onTransitionEnd");Pr("onMouseEnter",["mouseout","mouseover"]);Pr("onMouseLeave",["mouseout","mouseover"]);Pr("onPointerEnter",["pointerout","pointerover"]);Pr("onPointerLeave",["pointerout","pointerover"]);tr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));tr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));tr("onBeforeInput",["compositionend","keypress","textInput","paste"]);tr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));tr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));tr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var uo="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(" "),gx=new Set("cancel close invalid load scroll toggle".split(" ").concat(uo));function hd(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,pv(r,t,void 0,e),e.currentTarget=null}function xp(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;hd(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;hd(o,l,u),i=a}}}if(as)throw e=Sa,as=!1,Sa=null,e}function ce(e,t){var n=t[Ta];n===void 0&&(n=t[Ta]=new Set);var r=e+"__bubble";n.has(r)||(wp(t,e,2,!1),n.add(r))}function Dl(e,t,n){var r=0;t&&(r|=4),wp(n,e,r,t)}var Ni="_reactListening"+Math.random().toString(36).slice(2);function bo(e){if(!e[Ni]){e[Ni]=!0,jh.forEach(function(n){n!=="selectionchange"&&(gx.has(n)||Dl(n,!1,e),Dl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ni]||(t[Ni]=!0,Dl("selectionchange",!1,t))}}function wp(e,t,n,r){switch(rp(t)){case 1:var o=Pv;break;case 4:o=Iv;break;default:o=$u}n=o.bind(null,t,n,e),o=void 0,!ka||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 Ol(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=Tn(l),s===null)return;if(a=s.tag,a===5||a===6){r=i=s;continue e}l=l.parentNode}}r=r.return}Vh(function(){var u=i,c=_u(n),f=[];e:{var d=vp.get(e);if(d!==void 0){var p=Iu,y=e;switch(e){case"keypress":if(Yi(n)===0)break e;case"keydown":case"keyup":p=Yv;break;case"focusin":y="focus",p=Tl;break;case"focusout":y="blur",p=Tl;break;case"beforeblur":case"afterblur":p=Tl;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":p=td;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=zv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=Qv;break;case pp:case mp:case gp:p=Rv;break;case yp:p=qv;break;case"scroll":p=Tv;break;case"wheel":p=Jv;break;case"copy":case"cut":case"paste":p=Ov;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=rd}var x=(t&4)!==0,k=!x&&e==="scroll",m=x?d!==null?d+"Capture":null:d;x=[];for(var v=u,g;v!==null;){g=v;var w=g.stateNode;if(g.tag===5&&w!==null&&(g=w,m!==null&&(w=jo(v,m),w!=null&&x.push(zo(v,w,g)))),k)break;v=v.return}0<x.length&&(d=new p(d,y,null,n,c),f.push({event:d,listeners:x}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",d&&n!==xa&&(y=n.relatedTarget||n.fromElement)&&(Tn(y)||y[Yt]))break e;if((p||d)&&(d=c.window===c?c:(d=c.ownerDocument)?d.defaultView||d.parentWindow:window,p?(y=n.relatedTarget||n.toElement,p=u,y=y?Tn(y):null,y!==null&&(k=nr(y),y!==k||y.tag!==5&&y.tag!==6)&&(y=null)):(p=null,y=u),p!==y)){if(x=td,w="onMouseLeave",m="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(x=rd,w="onPointerLeave",m="onPointerEnter",v="pointer"),k=p==null?d:pr(p),g=y==null?d:pr(y),d=new x(w,v+"leave",p,n,c),d.target=k,d.relatedTarget=g,w=null,Tn(c)===u&&(x=new x(m,v+"enter",y,n,c),x.target=g,x.relatedTarget=k,w=x),k=w,p&&y)t:{for(x=p,m=y,v=0,g=x;g;g=rr(g))v++;for(g=0,w=m;w;w=rr(w))g++;for(;0<v-g;)x=rr(x),v--;for(;0<g-v;)m=rr(m),g--;for(;v--;){if(x===m||m!==null&&x===m.alternate)break t;x=rr(x),m=rr(m)}x=null}else x=null;p!==null&&pd(f,d,p,x,!1),y!==null&&k!==null&&pd(f,k,y,x,!0)}}e:{if(d=u?pr(u):window,p=d.nodeName&&d.nodeName.toLowerCase(),p==="select"||p==="input"&&d.type==="file")var N=sx;else if(sd(d))if(up)N=cx;else{N=ax;var S=lx}else(p=d.nodeName)&&p.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(N=ux);if(N&&(N=N(e,u))){ap(f,N,n,c);break e}S&&S(e,d,u),e==="focusout"&&(S=d._wrapperState)&&S.controlled&&d.type==="number"&&pa(d,"number",d.value)}switch(S=u?pr(u):window,e){case"focusin":(sd(S)||S.contentEditable==="true")&&(fr=S,Ca=u,yo=null);break;case"focusout":yo=Ca=fr=null;break;case"mousedown":ja=!0;break;case"contextmenu":case"mouseup":case"dragend":ja=!1,dd(f,n,c);break;case"selectionchange":if(hx)break;case"keydown":case"keyup":dd(f,n,c)}var _;if(bu)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 dr?sp(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(ip&&n.locale!=="ko"&&(dr||C!=="onCompositionStart"?C==="onCompositionEnd"&&dr&&(_=op()):(an=c,Pu="value"in an?an.value:an.textContent,dr=!0)),S=hs(u,C),0<S.length&&(C=new nd(C,e,null,n,c),f.push({event:C,listeners:S}),_?C.data=_:(_=lp(n),_!==null&&(C.data=_)))),(_=tx?nx(e,n):rx(e,n))&&(u=hs(u,"onBeforeInput"),0<u.length&&(c=new nd("onBeforeInput","beforeinput",null,n,c),f.push({event:c,listeners:u}),c.data=_))}xp(f,t)})}function zo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function hs(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=jo(e,n),i!=null&&r.unshift(zo(e,i,o)),i=jo(e,t),i!=null&&r.push(zo(e,i,o))),e=e.return}return r}function rr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function pd(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=jo(n,i),a!=null&&s.unshift(zo(n,a,l))):o||(a=jo(n,i),a!=null&&s.push(zo(n,a,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var yx=/\r\n?/g,vx=/\u0000|\uFFFD/g;function md(e){return(typeof e=="string"?e:""+e).replace(yx,`
38
- `).replace(vx,"")}function _i(e,t,n){if(t=md(t),md(e)!==t&&n)throw Error(W(425))}function ps(){}var Ma=null,$a=null;function Pa(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 Ia=typeof setTimeout=="function"?setTimeout:void 0,xx=typeof clearTimeout=="function"?clearTimeout:void 0,gd=typeof Promise=="function"?Promise:void 0,wx=typeof queueMicrotask=="function"?queueMicrotask:typeof gd<"u"?function(e){return gd.resolve(null).then(e).catch(kx)}:Ia;function kx(e){setTimeout(function(){throw e})}function Fl(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),Po(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Po(t)}function mn(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 yd(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 Kr=Math.random().toString(36).slice(2),jt="__reactFiber$"+Kr,Lo="__reactProps$"+Kr,Yt="__reactContainer$"+Kr,Ta="__reactEvents$"+Kr,Sx="__reactListeners$"+Kr,Ex="__reactHandles$"+Kr;function Tn(e){var t=e[jt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Yt]||n[jt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=yd(e);e!==null;){if(n=e[jt])return n;e=yd(e)}return t}e=n,n=e.parentNode}return null}function ri(e){return e=e[jt]||e[Yt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function pr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(W(33))}function Qs(e){return e[Lo]||null}var ba=[],mr=-1;function Nn(e){return{current:e}}function de(e){0>mr||(e.current=ba[mr],ba[mr]=null,mr--)}function ue(e,t){mr++,ba[mr]=e.current,e.current=t}var kn={},be=Nn(kn),Ve=Nn(!1),Un=kn;function Ir(e,t){var n=e.type.contextTypes;if(!n)return kn;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 We(e){return e=e.childContextTypes,e!=null}function ms(){de(Ve),de(be)}function vd(e,t,n){if(be.current!==kn)throw Error(W(168));ue(be,t),ue(Ve,n)}function kp(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(W(108,lv(e)||"Unknown",o));return ge({},n,r)}function gs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||kn,Un=be.current,ue(be,e),ue(Ve,Ve.current),!0}function xd(e,t,n){var r=e.stateNode;if(!r)throw Error(W(169));n?(e=kp(e,t,Un),r.__reactInternalMemoizedMergedChildContext=e,de(Ve),de(be),ue(be,e)):de(Ve),ue(Ve,n)}var Ot=null,Gs=!1,Hl=!1;function Sp(e){Ot===null?Ot=[e]:Ot.push(e)}function Nx(e){Gs=!0,Sp(e)}function _n(){if(!Hl&&Ot!==null){Hl=!0;var e=0,t=ae;try{var n=Ot;for(ae=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ot=null,Gs=!1}catch(o){throw Ot!==null&&(Ot=Ot.slice(e+1)),Xh(Cu,_n),o}finally{ae=t,Hl=!1}}return null}var gr=[],yr=0,ys=null,vs=0,tt=[],nt=0,Yn=null,Ft=1,Ht="";function $n(e,t){gr[yr++]=vs,gr[yr++]=ys,ys=e,vs=t}function Ep(e,t,n){tt[nt++]=Ft,tt[nt++]=Ht,tt[nt++]=Yn,Yn=e;var r=Ft;e=Ht;var o=32-vt(r)-1;r&=~(1<<o),n+=1;var i=32-vt(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,Ft=1<<32-vt(t)+o|n<<o|r,Ht=i+e}else Ft=1<<i|n<<o|r,Ht=e}function Lu(e){e.return!==null&&($n(e,1),Ep(e,1,0))}function Au(e){for(;e===ys;)ys=gr[--yr],gr[yr]=null,vs=gr[--yr],gr[yr]=null;for(;e===Yn;)Yn=tt[--nt],tt[nt]=null,Ht=tt[--nt],tt[nt]=null,Ft=tt[--nt],tt[nt]=null}var Qe=null,Ke=null,he=!1,pt=null;function Np(e,t){var n=rt(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 wd(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,Qe=e,Ke=mn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Qe=e,Ke=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Yn!==null?{id:Ft,overflow:Ht}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=rt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Qe=e,Ke=null,!0):!1;default:return!1}}function za(e){return(e.mode&1)!==0&&(e.flags&128)===0}function La(e){if(he){var t=Ke;if(t){var n=t;if(!wd(e,t)){if(za(e))throw Error(W(418));t=mn(n.nextSibling);var r=Qe;t&&wd(e,t)?Np(r,n):(e.flags=e.flags&-4097|2,he=!1,Qe=e)}}else{if(za(e))throw Error(W(418));e.flags=e.flags&-4097|2,he=!1,Qe=e}}}function kd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Qe=e}function Ci(e){if(e!==Qe)return!1;if(!he)return kd(e),he=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Pa(e.type,e.memoizedProps)),t&&(t=Ke)){if(za(e))throw _p(),Error(W(418));for(;t;)Np(e,t),t=mn(t.nextSibling)}if(kd(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(W(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ke=mn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ke=null}}else Ke=Qe?mn(e.stateNode.nextSibling):null;return!0}function _p(){for(var e=Ke;e;)e=mn(e.nextSibling)}function Tr(){Ke=Qe=null,he=!1}function Ru(e){pt===null?pt=[e]:pt.push(e)}var _x=Gt.ReactCurrentBatchConfig;function to(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(W(309));var r=n.stateNode}if(!r)throw Error(W(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(W(284));if(!n._owner)throw Error(W(290,e))}return e}function ji(e,t){throw e=Object.prototype.toString.call(t),Error(W(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Sd(e){var t=e._init;return t(e._payload)}function Cp(e){function t(m,v){if(e){var g=m.deletions;g===null?(m.deletions=[v],m.flags|=16):g.push(v)}}function n(m,v){if(!e)return null;for(;v!==null;)t(m,v),v=v.sibling;return null}function r(m,v){for(m=new Map;v!==null;)v.key!==null?m.set(v.key,v):m.set(v.index,v),v=v.sibling;return m}function o(m,v){return m=xn(m,v),m.index=0,m.sibling=null,m}function i(m,v,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<v?(m.flags|=2,v):g):(m.flags|=2,v)):(m.flags|=1048576,v)}function s(m){return e&&m.alternate===null&&(m.flags|=2),m}function l(m,v,g,w){return v===null||v.tag!==6?(v=Kl(g,m.mode,w),v.return=m,v):(v=o(v,g),v.return=m,v)}function a(m,v,g,w){var N=g.type;return N===cr?c(m,v,g.props.children,w,g.key):v!==null&&(v.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===en&&Sd(N)===v.type)?(w=o(v,g.props),w.ref=to(m,v,g),w.return=m,w):(w=Ji(g.type,g.key,g.props,null,m.mode,w),w.ref=to(m,v,g),w.return=m,w)}function u(m,v,g,w){return v===null||v.tag!==4||v.stateNode.containerInfo!==g.containerInfo||v.stateNode.implementation!==g.implementation?(v=Ql(g,m.mode,w),v.return=m,v):(v=o(v,g.children||[]),v.return=m,v)}function c(m,v,g,w,N){return v===null||v.tag!==7?(v=On(g,m.mode,w,N),v.return=m,v):(v=o(v,g),v.return=m,v)}function f(m,v,g){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Kl(""+v,m.mode,g),v.return=m,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case gi:return g=Ji(v.type,v.key,v.props,null,m.mode,g),g.ref=to(m,null,v),g.return=m,g;case ur:return v=Ql(v,m.mode,g),v.return=m,v;case en:var w=v._init;return f(m,w(v._payload),g)}if(lo(v)||Gr(v))return v=On(v,m.mode,g,null),v.return=m,v;ji(m,v)}return null}function d(m,v,g,w){var N=v!==null?v.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return N!==null?null:l(m,v,""+g,w);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case gi:return g.key===N?a(m,v,g,w):null;case ur:return g.key===N?u(m,v,g,w):null;case en:return N=g._init,d(m,v,N(g._payload),w)}if(lo(g)||Gr(g))return N!==null?null:c(m,v,g,w,null);ji(m,g)}return null}function p(m,v,g,w,N){if(typeof w=="string"&&w!==""||typeof w=="number")return m=m.get(g)||null,l(v,m,""+w,N);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case gi:return m=m.get(w.key===null?g:w.key)||null,a(v,m,w,N);case ur:return m=m.get(w.key===null?g:w.key)||null,u(v,m,w,N);case en:var S=w._init;return p(m,v,g,S(w._payload),N)}if(lo(w)||Gr(w))return m=m.get(g)||null,c(v,m,w,N,null);ji(v,w)}return null}function y(m,v,g,w){for(var N=null,S=null,_=v,C=v=0,I=null;_!==null&&C<g.length;C++){_.index>C?(I=_,_=null):I=_.sibling;var R=d(m,_,g[C],w);if(R===null){_===null&&(_=I);break}e&&_&&R.alternate===null&&t(m,_),v=i(R,v,C),S===null?N=R:S.sibling=R,S=R,_=I}if(C===g.length)return n(m,_),he&&$n(m,C),N;if(_===null){for(;C<g.length;C++)_=f(m,g[C],w),_!==null&&(v=i(_,v,C),S===null?N=_:S.sibling=_,S=_);return he&&$n(m,C),N}for(_=r(m,_);C<g.length;C++)I=p(_,m,C,g[C],w),I!==null&&(e&&I.alternate!==null&&_.delete(I.key===null?C:I.key),v=i(I,v,C),S===null?N=I:S.sibling=I,S=I);return e&&_.forEach(function(D){return t(m,D)}),he&&$n(m,C),N}function x(m,v,g,w){var N=Gr(g);if(typeof N!="function")throw Error(W(150));if(g=N.call(g),g==null)throw Error(W(151));for(var S=N=null,_=v,C=v=0,I=null,R=g.next();_!==null&&!R.done;C++,R=g.next()){_.index>C?(I=_,_=null):I=_.sibling;var D=d(m,_,R.value,w);if(D===null){_===null&&(_=I);break}e&&_&&D.alternate===null&&t(m,_),v=i(D,v,C),S===null?N=D:S.sibling=D,S=D,_=I}if(R.done)return n(m,_),he&&$n(m,C),N;if(_===null){for(;!R.done;C++,R=g.next())R=f(m,R.value,w),R!==null&&(v=i(R,v,C),S===null?N=R:S.sibling=R,S=R);return he&&$n(m,C),N}for(_=r(m,_);!R.done;C++,R=g.next())R=p(_,m,C,R.value,w),R!==null&&(e&&R.alternate!==null&&_.delete(R.key===null?C:R.key),v=i(R,v,C),S===null?N=R:S.sibling=R,S=R);return e&&_.forEach(function(H){return t(m,H)}),he&&$n(m,C),N}function k(m,v,g,w){if(typeof g=="object"&&g!==null&&g.type===cr&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case gi:e:{for(var N=g.key,S=v;S!==null;){if(S.key===N){if(N=g.type,N===cr){if(S.tag===7){n(m,S.sibling),v=o(S,g.props.children),v.return=m,m=v;break e}}else if(S.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===en&&Sd(N)===S.type){n(m,S.sibling),v=o(S,g.props),v.ref=to(m,S,g),v.return=m,m=v;break e}n(m,S);break}else t(m,S);S=S.sibling}g.type===cr?(v=On(g.props.children,m.mode,w,g.key),v.return=m,m=v):(w=Ji(g.type,g.key,g.props,null,m.mode,w),w.ref=to(m,v,g),w.return=m,m=w)}return s(m);case ur:e:{for(S=g.key;v!==null;){if(v.key===S)if(v.tag===4&&v.stateNode.containerInfo===g.containerInfo&&v.stateNode.implementation===g.implementation){n(m,v.sibling),v=o(v,g.children||[]),v.return=m,m=v;break e}else{n(m,v);break}else t(m,v);v=v.sibling}v=Ql(g,m.mode,w),v.return=m,m=v}return s(m);case en:return S=g._init,k(m,v,S(g._payload),w)}if(lo(g))return y(m,v,g,w);if(Gr(g))return x(m,v,g,w);ji(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,v!==null&&v.tag===6?(n(m,v.sibling),v=o(v,g),v.return=m,m=v):(n(m,v),v=Kl(g,m.mode,w),v.return=m,m=v),s(m)):n(m,v)}return k}var br=Cp(!0),jp=Cp(!1),xs=Nn(null),ws=null,vr=null,Du=null;function Ou(){Du=vr=ws=null}function Fu(e){var t=xs.current;de(xs),e._currentValue=t}function Aa(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 Cr(e,t){ws=e,Du=vr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(He=!0),e.firstContext=null)}function st(e){var t=e._currentValue;if(Du!==e)if(e={context:e,memoizedValue:t,next:null},vr===null){if(ws===null)throw Error(W(308));vr=e,ws.dependencies={lanes:0,firstContext:e}}else vr=vr.next=e;return t}var bn=null;function Hu(e){bn===null?bn=[e]:bn.push(e)}function Mp(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Hu(t)):(n.next=o.next,o.next=n),t.interleaved=n,Xt(e,r)}function Xt(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 tn=!1;function Bu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $p(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 Vt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function gn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,le&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Xt(e,n)}return o=r.interleaved,o===null?(t.next=t,Hu(r)):(t.next=o.next,o.next=t),r.interleaved=t,Xt(e,n)}function Xi(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,ju(e,n)}}function Ed(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 ks(e,t,n,r){var o=e.updateQueue;tn=!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 f=o.baseState;s=0,c=u=a=null,l=i;do{var d=l.lane,p=l.eventTime;if((r&d)===d){c!==null&&(c=c.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,x=l;switch(d=t,p=n,x.tag){case 1:if(y=x.payload,typeof y=="function"){f=y.call(p,f,d);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=x.payload,d=typeof y=="function"?y.call(p,f,d):y,d==null)break e;f=ge({},f,d);break e;case 2:tn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,d=o.effects,d===null?o.effects=[l]:d.push(l))}else p={eventTime:p,lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=p,a=f):c=c.next=p,s|=d;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;d=l,l=d.next,d.next=null,o.lastBaseUpdate=d,o.shared.pending=null}}while(!0);if(c===null&&(a=f),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);Kn|=s,e.lanes=s,e.memoizedState=f}}function Nd(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(W(191,o));o.call(r)}}}var oi={},Pt=Nn(oi),Ao=Nn(oi),Ro=Nn(oi);function zn(e){if(e===oi)throw Error(W(174));return e}function Vu(e,t){switch(ue(Ro,t),ue(Ao,e),ue(Pt,oi),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ga(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ga(t,e)}de(Pt),ue(Pt,t)}function zr(){de(Pt),de(Ao),de(Ro)}function Pp(e){zn(Ro.current);var t=zn(Pt.current),n=ga(t,e.type);t!==n&&(ue(Ao,e),ue(Pt,n))}function Wu(e){Ao.current===e&&(de(Pt),de(Ao))}var pe=Nn(0);function Ss(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 Bl=[];function Uu(){for(var e=0;e<Bl.length;e++)Bl[e]._workInProgressVersionPrimary=null;Bl.length=0}var Ki=Gt.ReactCurrentDispatcher,Vl=Gt.ReactCurrentBatchConfig,Xn=0,me=null,Se=null,_e=null,Es=!1,vo=!1,Do=0,Cx=0;function Pe(){throw Error(W(321))}function Yu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!wt(e[n],t[n]))return!1;return!0}function Xu(e,t,n,r,o,i){if(Xn=i,me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ki.current=e===null||e.memoizedState===null?Px:Ix,e=n(r,o),vo){i=0;do{if(vo=!1,Do=0,25<=i)throw Error(W(301));i+=1,_e=Se=null,t.updateQueue=null,Ki.current=Tx,e=n(r,o)}while(vo)}if(Ki.current=Ns,t=Se!==null&&Se.next!==null,Xn=0,_e=Se=me=null,Es=!1,t)throw Error(W(300));return e}function Ku(){var e=Do!==0;return Do=0,e}function _t(){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 lt(){if(Se===null){var e=me.alternate;e=e!==null?e.memoizedState:null}else e=Se.next;var t=_e===null?me.memoizedState:_e.next;if(t!==null)_e=t,Se=e;else{if(e===null)throw Error(W(310));Se=e,e={memoizedState:Se.memoizedState,baseState:Se.baseState,baseQueue:Se.baseQueue,queue:Se.queue,next:null},_e===null?me.memoizedState=_e=e:_e=_e.next=e}return _e}function Oo(e,t){return typeof t=="function"?t(e):t}function Wl(e){var t=lt(),n=t.queue;if(n===null)throw Error(W(311));n.lastRenderedReducer=e;var r=Se,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((Xn&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 f={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(l=a=f,s=r):a=a.next=f,me.lanes|=c,Kn|=c}u=u.next}while(u!==null&&u!==i);a===null?s=r:a.next=l,wt(r,t.memoizedState)||(He=!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,Kn|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ul(e){var t=lt(),n=t.queue;if(n===null)throw Error(W(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);wt(i,t.memoizedState)||(He=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Ip(){}function Tp(e,t){var n=me,r=lt(),o=t(),i=!wt(r.memoizedState,o);if(i&&(r.memoizedState=o,He=!0),r=r.queue,Qu(Lp.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||_e!==null&&_e.memoizedState.tag&1){if(n.flags|=2048,Fo(9,zp.bind(null,n,r,o,t),void 0,null),Ce===null)throw Error(W(349));Xn&30||bp(n,t,o)}return o}function bp(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 zp(e,t,n,r){t.value=n,t.getSnapshot=r,Ap(t)&&Rp(e)}function Lp(e,t,n){return n(function(){Ap(t)&&Rp(e)})}function Ap(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wt(e,n)}catch{return!0}}function Rp(e){var t=Xt(e,1);t!==null&&xt(t,e,1,-1)}function _d(e){var t=_t();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:e},t.queue=e,e=e.dispatch=$x.bind(null,me,e),[t.memoizedState,e]}function Fo(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 Dp(){return lt().memoizedState}function Qi(e,t,n,r){var o=_t();me.flags|=e,o.memoizedState=Fo(1|t,n,void 0,r===void 0?null:r)}function qs(e,t,n,r){var o=lt();r=r===void 0?null:r;var i=void 0;if(Se!==null){var s=Se.memoizedState;if(i=s.destroy,r!==null&&Yu(r,s.deps)){o.memoizedState=Fo(t,n,i,r);return}}me.flags|=e,o.memoizedState=Fo(1|t,n,i,r)}function Cd(e,t){return Qi(8390656,8,e,t)}function Qu(e,t){return qs(2048,8,e,t)}function Op(e,t){return qs(4,2,e,t)}function Fp(e,t){return qs(4,4,e,t)}function Hp(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 Bp(e,t,n){return n=n!=null?n.concat([e]):null,qs(4,4,Hp.bind(null,t,e),n)}function Gu(){}function Vp(e,t){var n=lt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Yu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Wp(e,t){var n=lt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Yu(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Up(e,t,n){return Xn&21?(wt(n,t)||(n=Gh(),me.lanes|=n,Kn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,He=!0),e.memoizedState=n)}function jx(e,t){var n=ae;ae=n!==0&&4>n?n:4,e(!0);var r=Vl.transition;Vl.transition={};try{e(!1),t()}finally{ae=n,Vl.transition=r}}function Yp(){return lt().memoizedState}function Mx(e,t,n){var r=vn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Xp(e))Kp(t,n);else if(n=Mp(e,t,n,r),n!==null){var o=Ae();xt(n,e,r,o),Qp(n,t,r)}}function $x(e,t,n){var r=vn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Xp(e))Kp(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,wt(l,s)){var a=t.interleaved;a===null?(o.next=o,Hu(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=Mp(e,t,o,r),n!==null&&(o=Ae(),xt(n,e,r,o),Qp(n,t,r))}}function Xp(e){var t=e.alternate;return e===me||t!==null&&t===me}function Kp(e,t){vo=Es=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Qp(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ju(e,n)}}var Ns={readContext:st,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},Px={readContext:st,useCallback:function(e,t){return _t().memoizedState=[e,t===void 0?null:t],e},useContext:st,useEffect:Cd,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Qi(4194308,4,Hp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Qi(4194308,4,e,t)},useInsertionEffect:function(e,t){return Qi(4,2,e,t)},useMemo:function(e,t){var n=_t();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=_t();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=Mx.bind(null,me,e),[r.memoizedState,e]},useRef:function(e){var t=_t();return e={current:e},t.memoizedState=e},useState:_d,useDebugValue:Gu,useDeferredValue:function(e){return _t().memoizedState=e},useTransition:function(){var e=_d(!1),t=e[0];return e=jx.bind(null,e[1]),_t().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=me,o=_t();if(he){if(n===void 0)throw Error(W(407));n=n()}else{if(n=t(),Ce===null)throw Error(W(349));Xn&30||bp(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Cd(Lp.bind(null,r,i,e),[e]),r.flags|=2048,Fo(9,zp.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=_t(),t=Ce.identifierPrefix;if(he){var n=Ht,r=Ft;n=(r&~(1<<32-vt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Do++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Cx++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Ix={readContext:st,useCallback:Vp,useContext:st,useEffect:Qu,useImperativeHandle:Bp,useInsertionEffect:Op,useLayoutEffect:Fp,useMemo:Wp,useReducer:Wl,useRef:Dp,useState:function(){return Wl(Oo)},useDebugValue:Gu,useDeferredValue:function(e){var t=lt();return Up(t,Se.memoizedState,e)},useTransition:function(){var e=Wl(Oo)[0],t=lt().memoizedState;return[e,t]},useMutableSource:Ip,useSyncExternalStore:Tp,useId:Yp,unstable_isNewReconciler:!1},Tx={readContext:st,useCallback:Vp,useContext:st,useEffect:Qu,useImperativeHandle:Bp,useInsertionEffect:Op,useLayoutEffect:Fp,useMemo:Wp,useReducer:Ul,useRef:Dp,useState:function(){return Ul(Oo)},useDebugValue:Gu,useDeferredValue:function(e){var t=lt();return Se===null?t.memoizedState=e:Up(t,Se.memoizedState,e)},useTransition:function(){var e=Ul(Oo)[0],t=lt().memoizedState;return[e,t]},useMutableSource:Ip,useSyncExternalStore:Tp,useId:Yp,unstable_isNewReconciler:!1};function ct(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 Ra(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 Zs={isMounted:function(e){return(e=e._reactInternals)?nr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ae(),o=vn(e),i=Vt(r,o);i.payload=t,n!=null&&(i.callback=n),t=gn(e,i,o),t!==null&&(xt(t,e,o,r),Xi(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ae(),o=vn(e),i=Vt(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=gn(e,i,o),t!==null&&(xt(t,e,o,r),Xi(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ae(),r=vn(e),o=Vt(n,r);o.tag=2,t!=null&&(o.callback=t),t=gn(e,o,r),t!==null&&(xt(t,e,r,n),Xi(t,e,r))}};function jd(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?!To(n,r)||!To(o,i):!0}function Gp(e,t,n){var r=!1,o=kn,i=t.contextType;return typeof i=="object"&&i!==null?i=st(i):(o=We(t)?Un:be.current,r=t.contextTypes,i=(r=r!=null)?Ir(e,o):kn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Zs,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Md(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&&Zs.enqueueReplaceState(t,t.state,null)}function Da(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Bu(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=st(i):(i=We(t)?Un:be.current,o.context=Ir(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Ra(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&&Zs.enqueueReplaceState(o,o.state,null),ks(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Lr(e,t){try{var n="",r=t;do n+=sv(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 Yl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Oa(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var bx=typeof WeakMap=="function"?WeakMap:Map;function qp(e,t,n){n=Vt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Cs||(Cs=!0,Qa=r),Oa(e,t)},n}function Zp(e,t,n){n=Vt(-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(){Oa(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Oa(e,t),typeof r!="function"&&(yn===null?yn=new Set([this]):yn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function $d(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new bx;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=Xx.bind(null,e,t,n),t.then(e,e))}function Pd(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 Id(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=Vt(-1,1),t.tag=2,gn(n,t,1))),n.lanes|=1),e)}var zx=Gt.ReactCurrentOwner,He=!1;function Le(e,t,n,r){t.child=e===null?jp(t,null,n,r):br(t,e.child,n,r)}function Td(e,t,n,r,o){n=n.render;var i=t.ref;return Cr(t,o),r=Xu(e,t,n,r,i,o),n=Ku(),e!==null&&!He?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Kt(e,t,o)):(he&&n&&Lu(t),t.flags|=1,Le(e,t,r,o),t.child)}function bd(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!oc(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Jp(e,t,i,r,o)):(e=Ji(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:To,n(s,r)&&e.ref===t.ref)return Kt(e,t,o)}return t.flags|=1,e=xn(i,r),e.ref=t.ref,e.return=t,t.child=e}function Jp(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(To(i,r)&&e.ref===t.ref)if(He=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(He=!0);else return t.lanes=e.lanes,Kt(e,t,o)}return Fa(e,t,n,r,o)}function em(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(wr,Ye),Ye|=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(wr,Ye),Ye|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ue(wr,Ye),Ye|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ue(wr,Ye),Ye|=r;return Le(e,t,o,n),t.child}function tm(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Fa(e,t,n,r,o){var i=We(n)?Un:be.current;return i=Ir(t,i),Cr(t,o),n=Xu(e,t,n,r,i,o),r=Ku(),e!==null&&!He?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Kt(e,t,o)):(he&&r&&Lu(t),t.flags|=1,Le(e,t,n,o),t.child)}function zd(e,t,n,r,o){if(We(n)){var i=!0;gs(t)}else i=!1;if(Cr(t,o),t.stateNode===null)Gi(e,t),Gp(t,n,r),Da(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=st(u):(u=We(n)?Un:be.current,u=Ir(t,u));var c=n.getDerivedStateFromProps,f=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||a!==u)&&Md(t,s,r,u),tn=!1;var d=t.memoizedState;s.state=d,ks(t,r,s,o),a=t.memoizedState,l!==r||d!==a||Ve.current||tn?(typeof c=="function"&&(Ra(t,n,c,r),a=t.memoizedState),(l=tn||jd(t,n,l,r,d,a,u))?(f||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,$p(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:ct(t.type,l),s.props=u,f=t.pendingProps,d=s.context,a=n.contextType,typeof a=="object"&&a!==null?a=st(a):(a=We(n)?Un:be.current,a=Ir(t,a));var p=n.getDerivedStateFromProps;(c=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==f||d!==a)&&Md(t,s,r,a),tn=!1,d=t.memoizedState,s.state=d,ks(t,r,s,o);var y=t.memoizedState;l!==f||d!==y||Ve.current||tn?(typeof p=="function"&&(Ra(t,n,p,r),y=t.memoizedState),(u=tn||jd(t,n,u,r,d,y,a)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,y,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,y,a)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),s.props=r,s.state=y,s.context=a,r=u):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return Ha(e,t,n,r,i,o)}function Ha(e,t,n,r,o,i){tm(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&xd(t,n,!1),Kt(e,t,i);r=t.stateNode,zx.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=br(t,e.child,null,i),t.child=br(t,null,l,i)):Le(e,t,l,i),t.memoizedState=r.state,o&&xd(t,n,!0),t.child}function nm(e){var t=e.stateNode;t.pendingContext?vd(e,t.pendingContext,t.pendingContext!==t.context):t.context&&vd(e,t.context,!1),Vu(e,t.containerInfo)}function Ld(e,t,n,r,o){return Tr(),Ru(o),t.flags|=256,Le(e,t,n,r),t.child}var Ba={dehydrated:null,treeContext:null,retryLane:0};function Va(e){return{baseLanes:e,cachePool:null,transitions:null}}function rm(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 La(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=tl(s,r,0,null),e=On(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Va(n),t.memoizedState=Ba,e):qu(t,s));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return Lx(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=xn(o,a),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=xn(l,i):(i=On(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?Va(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Ba,r}return i=e.child,e=i.sibling,r=xn(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 qu(e,t){return t=tl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Mi(e,t,n,r){return r!==null&&Ru(r),br(t,e.child,null,n),e=qu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Lx(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=Yl(Error(W(422))),Mi(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=tl({mode:"visible",children:r.children},o,0,null),i=On(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&br(t,e.child,null,s),t.child.memoizedState=Va(s),t.memoizedState=Ba,i);if(!(t.mode&1))return Mi(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(W(419)),r=Yl(i,r,void 0),Mi(e,t,s,r)}if(l=(s&e.childLanes)!==0,He||l){if(r=Ce,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,Xt(e,o),xt(r,e,o,-1))}return rc(),r=Yl(Error(W(421))),Mi(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Kx.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Ke=mn(o.nextSibling),Qe=t,he=!0,pt=null,e!==null&&(tt[nt++]=Ft,tt[nt++]=Ht,tt[nt++]=Yn,Ft=e.id,Ht=e.overflow,Yn=t),t=qu(t,r.children),t.flags|=4096,t)}function Ad(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Aa(e.return,t,n)}function Xl(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 om(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Le(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&&Ad(e,n,t);else if(e.tag===19)Ad(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&&Ss(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Xl(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&&Ss(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Xl(t,!0,n,null,i);break;case"together":Xl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Gi(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),Kn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(W(153));if(t.child!==null){for(e=t.child,n=xn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=xn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ax(e,t,n){switch(t.tag){case 3:nm(t),Tr();break;case 5:Pp(t);break;case 1:We(t.type)&&gs(t);break;case 4:Vu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ue(xs,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?rm(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 om(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,em(e,t,n)}return Kt(e,t,n)}var im,Wa,sm,lm;im=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}};Wa=function(){};sm=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,zn(Pt.current);var i=null;switch(n){case"input":o=fa(e,o),r=fa(e,r),i=[];break;case"select":o=ge({},o,{value:void 0}),r=ge({},r,{value:void 0}),i=[];break;case"textarea":o=ma(e,o),r=ma(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ps)}ya(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"&&(_o.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"&&(_o.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)}};lm=function(e,t,n,r){n!==r&&(t.flags|=4)};function no(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 Ie(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 Rx(e,t,n){var r=t.pendingProps;switch(Au(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ie(t),null;case 1:return We(t.type)&&ms(),Ie(t),null;case 3:return r=t.stateNode,zr(),de(Ve),de(be),Uu(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ci(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,pt!==null&&(Za(pt),pt=null))),Wa(e,t),Ie(t),null;case 5:Wu(t);var o=zn(Ro.current);if(n=t.type,e!==null&&t.stateNode!=null)sm(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(W(166));return Ie(t),null}if(e=zn(Pt.current),Ci(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[jt]=t,r[Lo]=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<uo.length;o++)ce(uo[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":Uc(r,i),ce("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ce("invalid",r);break;case"textarea":Xc(r,i),ce("invalid",r)}ya(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&&_i(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&_i(r.textContent,l,e),o=["children",""+l]):_o.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&ce("scroll",r)}switch(n){case"input":yi(r),Yc(r,i,!0);break;case"textarea":yi(r),Kc(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=ps)}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=Lh(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[Lo]=r,im(e,t,!1,!1),t.stateNode=e;e:{switch(s=va(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<uo.length;o++)ce(uo[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":Uc(e,r),o=fa(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":Xc(e,r),o=ma(e,r),ce("invalid",e);break;default:o=r}ya(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var a=l[i];i==="style"?Dh(e,a):i==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&Ah(e,a)):i==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Co(e,a):typeof a=="number"&&Co(e,""+a):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(_o.hasOwnProperty(i)?a!=null&&i==="onScroll"&&ce("scroll",e):a!=null&&ku(e,i,a,s))}switch(n){case"input":yi(e),Yc(e,r,!1);break;case"textarea":yi(e),Kc(e);break;case"option":r.value!=null&&e.setAttribute("value",""+wn(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Sr(e,!!r.multiple,i,!1):r.defaultValue!=null&&Sr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=ps)}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 Ie(t),null;case 6:if(e&&t.stateNode!=null)lm(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(W(166));if(n=zn(Ro.current),zn(Pt.current),Ci(t)){if(r=t.stateNode,n=t.memoizedProps,r[jt]=t,(i=r.nodeValue!==n)&&(e=Qe,e!==null))switch(e.tag){case 3:_i(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&_i(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 Ie(t),null;case 13:if(de(pe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(he&&Ke!==null&&t.mode&1&&!(t.flags&128))_p(),Tr(),t.flags|=98560,i=!1;else if(i=Ci(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(W(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(W(317));i[jt]=t}else Tr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ie(t),i=!1}else pt!==null&&(Za(pt),pt=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):rc())),t.updateQueue!==null&&(t.flags|=4),Ie(t),null);case 4:return zr(),Wa(e,t),e===null&&bo(t.stateNode.containerInfo),Ie(t),null;case 10:return Fu(t.type._context),Ie(t),null;case 17:return We(t.type)&&ms(),Ie(t),null;case 19:if(de(pe),i=t.memoizedState,i===null)return Ie(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)no(i,!1);else{if(Ee!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Ss(e),s!==null){for(t.flags|=128,no(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()>Ar&&(t.flags|=128,r=!0,no(i,!1),t.lanes=4194304)}else{if(!r)if(e=Ss(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),no(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!he)return Ie(t),null}else 2*xe()-i.renderingStartTime>Ar&&n!==1073741824&&(t.flags|=128,r=!0,no(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):(Ie(t),null);case 22:case 23:return nc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ye&1073741824&&(Ie(t),t.subtreeFlags&6&&(t.flags|=8192)):Ie(t),null;case 24:return null;case 25:return null}throw Error(W(156,t.tag))}function Dx(e,t){switch(Au(t),t.tag){case 1:return We(t.type)&&ms(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zr(),de(Ve),de(be),Uu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Wu(t),null;case 13:if(de(pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(W(340));Tr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return de(pe),null;case 4:return zr(),null;case 10:return Fu(t.type._context),null;case 22:case 23:return nc(),null;case 24:return null;default:return null}}var $i=!1,Te=!1,Ox=typeof WeakSet=="function"?WeakSet:Set,K=null;function xr(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 Ua(e,t,n){try{n()}catch(r){ve(e,t,r)}}var Rd=!1;function Fx(e,t){if(Ma=ds,e=fp(),zu(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,f=e,d=null;t:for(;;){for(var p;f!==n||o!==0&&f.nodeType!==3||(l=s+o),f!==i||r!==0&&f.nodeType!==3||(a=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(p=f.firstChild)!==null;)d=f,f=p;for(;;){if(f===e)break t;if(d===n&&++u===o&&(l=s),d===i&&++c===r&&(a=s),(p=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=p}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for($a={focusedElem:e,selectionRange:n},ds=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var x=y.memoizedProps,k=y.memoizedState,m=t.stateNode,v=m.getSnapshotBeforeUpdate(t.elementType===t.type?x:ct(t.type,x),k);m.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(W(163))}}catch(w){ve(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return y=Rd,Rd=!1,y}function xo(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&&Ua(t,n,i)}o=o.next}while(o!==r)}}function Js(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 Ya(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 am(e){var t=e.alternate;t!==null&&(e.alternate=null,am(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[jt],delete t[Lo],delete t[Ta],delete t[Sx],delete t[Ex])),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 um(e){return e.tag===5||e.tag===3||e.tag===4}function Dd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||um(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 Xa(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=ps));else if(r!==4&&(e=e.child,e!==null))for(Xa(e,t,n),e=e.sibling;e!==null;)Xa(e,t,n),e=e.sibling}function Ka(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(Ka(e,t,n),e=e.sibling;e!==null;)Ka(e,t,n),e=e.sibling}var je=null,dt=!1;function qt(e,t,n){for(n=n.child;n!==null;)cm(e,t,n),n=n.sibling}function cm(e,t,n){if($t&&typeof $t.onCommitFiberUnmount=="function")try{$t.onCommitFiberUnmount(Us,n)}catch{}switch(n.tag){case 5:Te||xr(n,t);case 6:var r=je,o=dt;je=null,qt(e,t,n),je=r,dt=o,je!==null&&(dt?(e=je,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):je.removeChild(n.stateNode));break;case 18:je!==null&&(dt?(e=je,n=n.stateNode,e.nodeType===8?Fl(e.parentNode,n):e.nodeType===1&&Fl(e,n),Po(e)):Fl(je,n.stateNode));break;case 4:r=je,o=dt,je=n.stateNode.containerInfo,dt=!0,qt(e,t,n),je=r,dt=o;break;case 0:case 11:case 14:case 15:if(!Te&&(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)&&Ua(n,t,s),o=o.next}while(o!==r)}qt(e,t,n);break;case 1:if(!Te&&(xr(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)}qt(e,t,n);break;case 21:qt(e,t,n);break;case 22:n.mode&1?(Te=(r=Te)||n.memoizedState!==null,qt(e,t,n),Te=r):qt(e,t,n);break;default:qt(e,t,n)}}function Od(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ox),t.forEach(function(r){var o=Qx.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function ut(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:je=l.stateNode,dt=!1;break e;case 3:je=l.stateNode.containerInfo,dt=!0;break e;case 4:je=l.stateNode.containerInfo,dt=!0;break e}l=l.return}if(je===null)throw Error(W(160));cm(i,s,o),je=null,dt=!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;)dm(t,e),t=t.sibling}function dm(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ut(t,e),Nt(e),r&4){try{xo(3,e,e.return),Js(3,e)}catch(x){ve(e,e.return,x)}try{xo(5,e,e.return)}catch(x){ve(e,e.return,x)}}break;case 1:ut(t,e),Nt(e),r&512&&n!==null&&xr(n,n.return);break;case 5:if(ut(t,e),Nt(e),r&512&&n!==null&&xr(n,n.return),e.flags&32){var o=e.stateNode;try{Co(o,"")}catch(x){ve(e,e.return,x)}}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&&bh(o,i),va(l,s);var u=va(l,i);for(s=0;s<a.length;s+=2){var c=a[s],f=a[s+1];c==="style"?Dh(o,f):c==="dangerouslySetInnerHTML"?Ah(o,f):c==="children"?Co(o,f):ku(o,c,f,u)}switch(l){case"input":ha(o,i);break;case"textarea":zh(o,i);break;case"select":var d=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?Sr(o,!!i.multiple,p,!1):d!==!!i.multiple&&(i.defaultValue!=null?Sr(o,!!i.multiple,i.defaultValue,!0):Sr(o,!!i.multiple,i.multiple?[]:"",!1))}o[Lo]=i}catch(x){ve(e,e.return,x)}}break;case 6:if(ut(t,e),Nt(e),r&4){if(e.stateNode===null)throw Error(W(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(x){ve(e,e.return,x)}}break;case 3:if(ut(t,e),Nt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Po(t.containerInfo)}catch(x){ve(e,e.return,x)}break;case 4:ut(t,e),Nt(e);break;case 13:ut(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||(ec=xe())),r&4&&Od(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Te=(u=Te)||c,ut(t,e),Te=u):ut(t,e),Nt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(K=e,c=e.child;c!==null;){for(f=K=c;K!==null;){switch(d=K,p=d.child,d.tag){case 0:case 11:case 14:case 15:xo(4,d,d.return);break;case 1:xr(d,d.return);var y=d.stateNode;if(typeof y.componentWillUnmount=="function"){r=d,n=d.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(x){ve(r,n,x)}}break;case 5:xr(d,d.return);break;case 22:if(d.memoizedState!==null){Hd(f);continue}}p!==null?(p.return=d,K=p):Hd(f)}c=c.sibling}e:for(c=null,f=e;;){if(f.tag===5){if(c===null){c=f;try{o=f.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=f.stateNode,a=f.memoizedProps.style,s=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=Rh("display",s))}catch(x){ve(e,e.return,x)}}}else if(f.tag===6){if(c===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(x){ve(e,e.return,x)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;c===f&&(c=null),f=f.return}c===f&&(c=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:ut(t,e),Nt(e),r&4&&Od(e);break;case 21:break;default:ut(t,e),Nt(e)}}function Nt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(um(n)){var r=n;break e}n=n.return}throw Error(W(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Co(o,""),r.flags&=-33);var i=Dd(e);Ka(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,l=Dd(e);Xa(e,l,s);break;default:throw Error(W(161))}}catch(a){ve(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Hx(e,t,n){K=e,fm(e)}function fm(e,t,n){for(var r=(e.mode&1)!==0;K!==null;){var o=K,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||Te;l=$i;var u=Te;if($i=s,(Te=a)&&!u)for(K=o;K!==null;)s=K,a=s.child,s.tag===22&&s.memoizedState!==null?Bd(o):a!==null?(a.return=s,K=a):Bd(o);for(;i!==null;)K=i,fm(i),i=i.sibling;K=o,$i=l,Te=u}Fd(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,K=i):Fd(e)}}function Fd(e){for(;K!==null;){var t=K;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Te||Js(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Te)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:ct(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Nd(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}Nd(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 f=c.dehydrated;f!==null&&Po(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(W(163))}Te||t.flags&512&&Ya(t)}catch(d){ve(t,t.return,d)}}if(t===e){K=null;break}if(n=t.sibling,n!==null){n.return=t.return,K=n;break}K=t.return}}function Hd(e){for(;K!==null;){var t=K;if(t===e){K=null;break}var n=t.sibling;if(n!==null){n.return=t.return,K=n;break}K=t.return}}function Bd(e){for(;K!==null;){var t=K;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Js(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{Ya(t)}catch(a){ve(t,i,a)}break;case 5:var s=t.return;try{Ya(t)}catch(a){ve(t,s,a)}}}catch(a){ve(t,t.return,a)}if(t===e){K=null;break}var l=t.sibling;if(l!==null){l.return=t.return,K=l;break}K=t.return}}var Bx=Math.ceil,_s=Gt.ReactCurrentDispatcher,Zu=Gt.ReactCurrentOwner,ot=Gt.ReactCurrentBatchConfig,le=0,Ce=null,we=null,Me=0,Ye=0,wr=Nn(0),Ee=0,Ho=null,Kn=0,el=0,Ju=0,wo=null,Oe=null,ec=0,Ar=1/0,Dt=null,Cs=!1,Qa=null,yn=null,Pi=!1,un=null,js=0,ko=0,Ga=null,qi=-1,Zi=0;function Ae(){return le&6?xe():qi!==-1?qi:qi=xe()}function vn(e){return e.mode&1?le&2&&Me!==0?Me&-Me:_x.transition!==null?(Zi===0&&(Zi=Gh()),Zi):(e=ae,e!==0||(e=window.event,e=e===void 0?16:rp(e.type)),e):1}function xt(e,t,n,r){if(50<ko)throw ko=0,Ga=null,Error(W(185));ti(e,n,r),(!(le&2)||e!==Ce)&&(e===Ce&&(!(le&2)&&(el|=n),Ee===4&&sn(e,Me)),Ue(e,r),n===1&&le===0&&!(t.mode&1)&&(Ar=xe()+500,Gs&&_n()))}function Ue(e,t){var n=e.callbackNode;_v(e,t);var r=cs(e,e===Ce?Me:0);if(r===0)n!==null&&qc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&qc(n),t===1)e.tag===0?Nx(Vd.bind(null,e)):Sp(Vd.bind(null,e)),wx(function(){!(le&6)&&_n()}),n=null;else{switch(qh(r)){case 1:n=Cu;break;case 4:n=Kh;break;case 16:n=us;break;case 536870912:n=Qh;break;default:n=us}n=wm(n,hm.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function hm(e,t){if(qi=-1,Zi=0,le&6)throw Error(W(327));var n=e.callbackNode;if(jr()&&e.callbackNode!==n)return null;var r=cs(e,e===Ce?Me:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ms(e,r);else{t=r;var o=le;le|=2;var i=mm();(Ce!==e||Me!==t)&&(Dt=null,Ar=xe()+500,Dn(e,t));do try{Ux();break}catch(l){pm(e,l)}while(!0);Ou(),_s.current=i,le=o,we!==null?t=0:(Ce=null,Me=0,t=Ee)}if(t!==0){if(t===2&&(o=Ea(e),o!==0&&(r=o,t=qa(e,o))),t===1)throw n=Ho,Dn(e,0),sn(e,r),Ue(e,xe()),n;if(t===6)sn(e,r);else{if(o=e.current.alternate,!(r&30)&&!Vx(o)&&(t=Ms(e,r),t===2&&(i=Ea(e),i!==0&&(r=i,t=qa(e,i))),t===1))throw n=Ho,Dn(e,0),sn(e,r),Ue(e,xe()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(W(345));case 2:Pn(e,Oe,Dt);break;case 3:if(sn(e,r),(r&130023424)===r&&(t=ec+500-xe(),10<t)){if(cs(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Ae(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Ia(Pn.bind(null,e,Oe,Dt),t);break}Pn(e,Oe,Dt);break;case 4:if(sn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-vt(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*Bx(r/1960))-r,10<r){e.timeoutHandle=Ia(Pn.bind(null,e,Oe,Dt),r);break}Pn(e,Oe,Dt);break;case 5:Pn(e,Oe,Dt);break;default:throw Error(W(329))}}}return Ue(e,xe()),e.callbackNode===n?hm.bind(null,e):null}function qa(e,t){var n=wo;return e.current.memoizedState.isDehydrated&&(Dn(e,t).flags|=256),e=Ms(e,t),e!==2&&(t=Oe,Oe=n,t!==null&&Za(t)),e}function Za(e){Oe===null?Oe=e:Oe.push.apply(Oe,e)}function Vx(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(!wt(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&=~Ju,t&=~el,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-vt(t),r=1<<n;e[n]=-1,t&=~r}}function Vd(e){if(le&6)throw Error(W(327));jr();var t=cs(e,0);if(!(t&1))return Ue(e,xe()),null;var n=Ms(e,t);if(e.tag!==0&&n===2){var r=Ea(e);r!==0&&(t=r,n=qa(e,r))}if(n===1)throw n=Ho,Dn(e,0),sn(e,t),Ue(e,xe()),n;if(n===6)throw Error(W(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Pn(e,Oe,Dt),Ue(e,xe()),null}function tc(e,t){var n=le;le|=1;try{return e(t)}finally{le=n,le===0&&(Ar=xe()+500,Gs&&_n())}}function Qn(e){un!==null&&un.tag===0&&!(le&6)&&jr();var t=le;le|=1;var n=ot.transition,r=ae;try{if(ot.transition=null,ae=1,e)return e()}finally{ae=r,ot.transition=n,le=t,!(le&6)&&_n()}}function nc(){Ye=wr.current,de(wr)}function Dn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,xx(n)),we!==null)for(n=we.return;n!==null;){var r=n;switch(Au(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ms();break;case 3:zr(),de(Ve),de(be),Uu();break;case 5:Wu(r);break;case 4:zr();break;case 13:de(pe);break;case 19:de(pe);break;case 10:Fu(r.type._context);break;case 22:case 23:nc()}n=n.return}if(Ce=e,we=e=xn(e.current,null),Me=Ye=t,Ee=0,Ho=null,Ju=el=Kn=0,Oe=wo=null,bn!==null){for(t=0;t<bn.length;t++)if(n=bn[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}bn=null}return e}function pm(e,t){do{var n=we;try{if(Ou(),Ki.current=Ns,Es){for(var r=me.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Es=!1}if(Xn=0,_e=Se=me=null,vo=!1,Do=0,Zu.current=null,n===null||n.return===null){Ee=1,Ho=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,f=c.tag;if(!(c.mode&1)&&(f===0||f===11||f===15)){var d=c.alternate;d?(c.updateQueue=d.updateQueue,c.memoizedState=d.memoizedState,c.lanes=d.lanes):(c.updateQueue=null,c.memoizedState=null)}var p=Pd(s);if(p!==null){p.flags&=-257,Id(p,s,l,i,t),p.mode&1&&$d(i,u,t),t=p,a=u;var y=t.updateQueue;if(y===null){var x=new Set;x.add(a),t.updateQueue=x}else y.add(a);break e}else{if(!(t&1)){$d(i,u,t),rc();break e}a=Error(W(426))}}else if(he&&l.mode&1){var k=Pd(s);if(k!==null){!(k.flags&65536)&&(k.flags|=256),Id(k,s,l,i,t),Ru(Lr(a,l));break e}}i=a=Lr(a,l),Ee!==4&&(Ee=2),wo===null?wo=[i]:wo.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var m=qp(i,a,t);Ed(i,m);break e;case 1:l=a;var v=i.type,g=i.stateNode;if(!(i.flags&128)&&(typeof v.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(yn===null||!yn.has(g)))){i.flags|=65536,t&=-t,i.lanes|=t;var w=Zp(i,l,t);Ed(i,w);break e}}i=i.return}while(i!==null)}ym(n)}catch(N){t=N,we===n&&n!==null&&(we=n=n.return);continue}break}while(!0)}function mm(){var e=_s.current;return _s.current=Ns,e===null?Ns:e}function rc(){(Ee===0||Ee===3||Ee===2)&&(Ee=4),Ce===null||!(Kn&268435455)&&!(el&268435455)||sn(Ce,Me)}function Ms(e,t){var n=le;le|=2;var r=mm();(Ce!==e||Me!==t)&&(Dt=null,Dn(e,t));do try{Wx();break}catch(o){pm(e,o)}while(!0);if(Ou(),le=n,_s.current=r,we!==null)throw Error(W(261));return Ce=null,Me=0,Ee}function Wx(){for(;we!==null;)gm(we)}function Ux(){for(;we!==null&&!gv();)gm(we)}function gm(e){var t=xm(e.alternate,e,Ye);e.memoizedProps=e.pendingProps,t===null?ym(e):we=t,Zu.current=null}function ym(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Dx(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=Rx(n,t,Ye),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 Pn(e,t,n){var r=ae,o=ot.transition;try{ot.transition=null,ae=1,Yx(e,t,n,r)}finally{ot.transition=o,ae=r}return null}function Yx(e,t,n,r){do jr();while(un!==null);if(le&6)throw Error(W(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(W(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(Cv(e,i),e===Ce&&(we=Ce=null,Me=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Pi||(Pi=!0,wm(us,function(){return jr(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=ot.transition,ot.transition=null;var s=ae;ae=1;var l=le;le|=4,Zu.current=null,Fx(e,n),dm(n,e),fx($a),ds=!!Ma,$a=Ma=null,e.current=n,Hx(n),yv(),le=l,ae=s,ot.transition=i}else e.current=n;if(Pi&&(Pi=!1,un=e,js=o),i=e.pendingLanes,i===0&&(yn=null),wv(n.stateNode),Ue(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(Cs)throw Cs=!1,e=Qa,Qa=null,e;return js&1&&e.tag!==0&&jr(),i=e.pendingLanes,i&1?e===Ga?ko++:(ko=0,Ga=e):ko=0,_n(),null}function jr(){if(un!==null){var e=qh(js),t=ot.transition,n=ae;try{if(ot.transition=null,ae=16>e?16:e,un===null)var r=!1;else{if(e=un,un=null,js=0,le&6)throw Error(W(331));var o=le;for(le|=4,K=e.current;K!==null;){var i=K,s=i.child;if(K.flags&16){var l=i.deletions;if(l!==null){for(var a=0;a<l.length;a++){var u=l[a];for(K=u;K!==null;){var c=K;switch(c.tag){case 0:case 11:case 15:xo(8,c,i)}var f=c.child;if(f!==null)f.return=c,K=f;else for(;K!==null;){c=K;var d=c.sibling,p=c.return;if(am(c),c===u){K=null;break}if(d!==null){d.return=p,K=d;break}K=p}}}var y=i.alternate;if(y!==null){var x=y.child;if(x!==null){y.child=null;do{var k=x.sibling;x.sibling=null,x=k}while(x!==null)}}K=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,K=s;else e:for(;K!==null;){if(i=K,i.flags&2048)switch(i.tag){case 0:case 11:case 15:xo(9,i,i.return)}var m=i.sibling;if(m!==null){m.return=i.return,K=m;break e}K=i.return}}var v=e.current;for(K=v;K!==null;){s=K;var g=s.child;if(s.subtreeFlags&2064&&g!==null)g.return=s,K=g;else e:for(s=v;K!==null;){if(l=K,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Js(9,l)}}catch(N){ve(l,l.return,N)}if(l===s){K=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,K=w;break e}K=l.return}}if(le=o,_n(),$t&&typeof $t.onPostCommitFiberRoot=="function")try{$t.onPostCommitFiberRoot(Us,e)}catch{}r=!0}return r}finally{ae=n,ot.transition=t}}return!1}function Wd(e,t,n){t=Lr(n,t),t=qp(e,t,1),e=gn(e,t,1),t=Ae(),e!==null&&(ti(e,1,t),Ue(e,t))}function ve(e,t,n){if(e.tag===3)Wd(e,e,n);else for(;t!==null;){if(t.tag===3){Wd(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(yn===null||!yn.has(r))){e=Lr(n,e),e=Zp(t,e,1),t=gn(t,e,1),e=Ae(),t!==null&&(ti(t,1,e),Ue(t,e));break}}t=t.return}}function Xx(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Ae(),e.pingedLanes|=e.suspendedLanes&n,Ce===e&&(Me&n)===n&&(Ee===4||Ee===3&&(Me&130023424)===Me&&500>xe()-ec?Dn(e,0):Ju|=n),Ue(e,t)}function vm(e,t){t===0&&(e.mode&1?(t=wi,wi<<=1,!(wi&130023424)&&(wi=4194304)):t=1);var n=Ae();e=Xt(e,t),e!==null&&(ti(e,t,n),Ue(e,n))}function Kx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),vm(e,n)}function Qx(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(W(314))}r!==null&&r.delete(t),vm(e,n)}var xm;xm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ve.current)He=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return He=!1,Ax(e,t,n);He=!!(e.flags&131072)}else He=!1,he&&t.flags&1048576&&Ep(t,vs,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Gi(e,t),e=t.pendingProps;var o=Ir(t,be.current);Cr(t,n),o=Xu(null,t,r,e,o,n);var i=Ku();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,We(r)?(i=!0,gs(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Bu(t),o.updater=Zs,t.stateNode=o,o._reactInternals=t,Da(t,r,e,n),t=Ha(null,t,r,!0,i,n)):(t.tag=0,he&&i&&Lu(t),Le(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Gi(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=qx(r),e=ct(r,e),o){case 0:t=Fa(null,t,r,e,n);break e;case 1:t=zd(null,t,r,e,n);break e;case 11:t=Td(null,t,r,e,n);break e;case 14:t=bd(null,t,r,ct(r.type,e),n);break e}throw Error(W(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ct(r,o),Fa(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ct(r,o),zd(e,t,r,o,n);case 3:e:{if(nm(t),e===null)throw Error(W(387));r=t.pendingProps,i=t.memoizedState,o=i.element,$p(e,t),ks(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=Lr(Error(W(423)),t),t=Ld(e,t,r,n,o);break e}else if(r!==o){o=Lr(Error(W(424)),t),t=Ld(e,t,r,n,o);break e}else for(Ke=mn(t.stateNode.containerInfo.firstChild),Qe=t,he=!0,pt=null,n=jp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Tr(),r===o){t=Kt(e,t,n);break e}Le(e,t,r,n)}t=t.child}return t;case 5:return Pp(t),e===null&&La(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Pa(r,o)?s=null:i!==null&&Pa(r,i)&&(t.flags|=32),tm(e,t),Le(e,t,s,n),t.child;case 6:return e===null&&La(t),null;case 13:return rm(e,t,n);case 4:return Vu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=br(t,null,r,n):Le(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ct(r,o),Td(e,t,r,o,n);case 7:return Le(e,t,t.pendingProps,n),t.child;case 8:return Le(e,t,t.pendingProps.children,n),t.child;case 12:return Le(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(xs,r._currentValue),r._currentValue=s,i!==null)if(wt(i.value,s)){if(i.children===o.children&&!Ve.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=Vt(-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),Aa(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(W(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Aa(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}Le(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Cr(t,n),o=st(o),r=r(o),t.flags|=1,Le(e,t,r,n),t.child;case 14:return r=t.type,o=ct(r,t.pendingProps),o=ct(r.type,o),bd(e,t,r,o,n);case 15:return Jp(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ct(r,o),Gi(e,t),t.tag=1,We(r)?(e=!0,gs(t)):e=!1,Cr(t,n),Gp(t,r,o),Da(t,r,o,n),Ha(null,t,r,!0,e,n);case 19:return om(e,t,n);case 22:return em(e,t,n)}throw Error(W(156,t.tag))};function wm(e,t){return Xh(e,t)}function Gx(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 rt(e,t,n,r){return new Gx(e,t,n,r)}function oc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function qx(e){if(typeof e=="function")return oc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Eu)return 11;if(e===Nu)return 14}return 2}function xn(e,t){var n=e.alternate;return n===null?(n=rt(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 Ji(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")oc(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case cr:return On(n.children,o,i,t);case Su:s=8,o|=8;break;case aa:return e=rt(12,n,t,o|2),e.elementType=aa,e.lanes=i,e;case ua:return e=rt(13,n,t,o),e.elementType=ua,e.lanes=i,e;case ca:return e=rt(19,n,t,o),e.elementType=ca,e.lanes=i,e;case Ph:return tl(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Mh:s=10;break e;case $h:s=9;break e;case Eu:s=11;break e;case Nu:s=14;break e;case en:s=16,r=null;break e}throw Error(W(130,e==null?e:typeof e,""))}return t=rt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function On(e,t,n,r){return e=rt(7,e,r,t),e.lanes=n,e}function tl(e,t,n,r){return e=rt(22,e,r,t),e.elementType=Ph,e.lanes=n,e.stateNode={isHidden:!1},e}function Kl(e,t,n){return e=rt(6,e,null,t),e.lanes=n,e}function Ql(e,t,n){return t=rt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Zx(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=$l(0),this.expirationTimes=$l(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$l(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function ic(e,t,n,r,o,i,s,l,a){return e=new Zx(e,t,n,l,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=rt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bu(i),e}function Jx(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ur,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function km(e){if(!e)return kn;e=e._reactInternals;e:{if(nr(e)!==e||e.tag!==1)throw Error(W(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(We(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(W(171))}if(e.tag===1){var n=e.type;if(We(n))return kp(e,n,t)}return t}function Sm(e,t,n,r,o,i,s,l,a){return e=ic(n,r,!0,e,o,i,s,l,a),e.context=km(null),n=e.current,r=Ae(),o=vn(n),i=Vt(r,o),i.callback=t??null,gn(n,i,o),e.current.lanes=o,ti(e,o,r),Ue(e,r),e}function nl(e,t,n,r){var o=t.current,i=Ae(),s=vn(o);return n=km(n),t.context===null?t.context=n:t.pendingContext=n,t=Vt(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=gn(o,t,s),e!==null&&(xt(e,o,s,i),Xi(e,o,s)),s}function $s(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 Ud(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function sc(e,t){Ud(e,t),(e=e.alternate)&&Ud(e,t)}function ew(){return null}var Em=typeof reportError=="function"?reportError:function(e){console.error(e)};function lc(e){this._internalRoot=e}rl.prototype.render=lc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(W(409));nl(e,t,null,null)};rl.prototype.unmount=lc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Qn(function(){nl(null,e,null,null)}),t[Yt]=null}};function rl(e){this._internalRoot=e}rl.prototype.unstable_scheduleHydration=function(e){if(e){var t=ep();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&&np(e)}};function ac(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ol(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Yd(){}function tw(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=$s(s);i.call(u)}}var s=Sm(t,r,e,0,null,!1,!1,"",Yd);return e._reactRootContainer=s,e[Yt]=s.current,bo(e.nodeType===8?e.parentNode:e),Qn(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var u=$s(a);l.call(u)}}var a=ic(e,0,!1,null,null,!1,!1,"",Yd);return e._reactRootContainer=a,e[Yt]=a.current,bo(e.nodeType===8?e.parentNode:e),Qn(function(){nl(t,a,n,r)}),a}function il(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=$s(s);l.call(a)}}nl(t,s,e,o)}else s=tw(n,t,e,o,r);return $s(s)}Zh=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=ao(t.pendingLanes);n!==0&&(ju(t,n|1),Ue(t,xe()),!(le&6)&&(Ar=xe()+500,_n()))}break;case 13:Qn(function(){var r=Xt(e,1);if(r!==null){var o=Ae();xt(r,e,1,o)}}),sc(e,1)}};Mu=function(e){if(e.tag===13){var t=Xt(e,134217728);if(t!==null){var n=Ae();xt(t,e,134217728,n)}sc(e,134217728)}};Jh=function(e){if(e.tag===13){var t=vn(e),n=Xt(e,t);if(n!==null){var r=Ae();xt(n,e,t,r)}sc(e,t)}};ep=function(){return ae};tp=function(e,t){var n=ae;try{return ae=e,t()}finally{ae=n}};wa=function(e,t,n){switch(t){case"input":if(ha(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=Qs(r);if(!o)throw Error(W(90));Th(r),ha(r,o)}}}break;case"textarea":zh(e,n);break;case"select":t=n.value,t!=null&&Sr(e,!!n.multiple,t,!1)}};Hh=tc;Bh=Qn;var nw={usingClientEntryPoint:!1,Events:[ri,pr,Qs,Oh,Fh,tc]},ro={findFiberByHostInstance:Tn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},rw={bundleType:ro.bundleType,version:ro.version,rendererPackageName:ro.rendererPackageName,rendererConfig:ro.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Gt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Uh(e),e===null?null:e.stateNode},findFiberByHostInstance:ro.findFiberByHostInstance||ew,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 Ii=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ii.isDisabled&&Ii.supportsFiber)try{Us=Ii.inject(rw),$t=Ii}catch{}}Ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=nw;Ze.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ac(t))throw Error(W(200));return Jx(e,t,null,n)};Ze.createRoot=function(e,t){if(!ac(e))throw Error(W(299));var n=!1,r="",o=Em;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=ic(e,1,!1,null,null,n,!1,r,o),e[Yt]=t.current,bo(e.nodeType===8?e.parentNode:e),new lc(t)};Ze.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(W(188)):(e=Object.keys(e).join(","),Error(W(268,e)));return e=Uh(t),e=e===null?null:e.stateNode,e};Ze.flushSync=function(e){return Qn(e)};Ze.hydrate=function(e,t,n){if(!ol(t))throw Error(W(200));return il(null,e,t,!0,n)};Ze.hydrateRoot=function(e,t,n){if(!ac(e))throw Error(W(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=Em;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=Sm(t,null,e,1,n??null,o,!1,i,s),e[Yt]=t.current,bo(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 rl(t)};Ze.render=function(e,t,n){if(!ol(t))throw Error(W(200));return il(null,e,t,!1,n)};Ze.unmountComponentAtNode=function(e){if(!ol(e))throw Error(W(40));return e._reactRootContainer?(Qn(function(){il(null,null,e,!1,function(){e._reactRootContainer=null,e[Yt]=null})}),!0):!1};Ze.unstable_batchedUpdates=tc;Ze.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ol(n))throw Error(W(200));if(e==null||e._reactInternals===void 0)throw Error(W(38));return il(e,t,n,!1,r)};Ze.version="18.3.1-next-f1338f8080-20240426";function Nm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Nm)}catch(e){console.error(e)}}Nm(),Nh.exports=Ze;var _m=Nh.exports,Cm,Xd=_m;Cm=Xd.createRoot,Xd.hydrateRoot;function ke(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=ke(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var ow={value:()=>{}};function sl(){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 es(n)}function es(e){this._=e}function iw(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}})}es.prototype=sl.prototype={constructor:es,on:function(e,t){var n=this._,r=iw(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=sw(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]=Kd(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Kd(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 es(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 sw(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function Kd(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=ow,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ja="http://www.w3.org/1999/xhtml";const Qd={svg:"http://www.w3.org/2000/svg",xhtml:Ja,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ll(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Qd.hasOwnProperty(t)?{space:Qd[t],local:e}:e}function lw(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ja&&t.documentElement.namespaceURI===Ja?t.createElement(e):t.createElementNS(n,e)}}function aw(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function jm(e){var t=ll(e);return(t.local?aw:lw)(t)}function uw(){}function uc(e){return e==null?uw:function(){return this.querySelector(e)}}function cw(e){typeof e!="function"&&(e=uc(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 qe(r,this._parents)}function dw(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function fw(){return[]}function Mm(e){return e==null?fw:function(){return this.querySelectorAll(e)}}function hw(e){return function(){return dw(e.apply(this,arguments))}}function pw(e){typeof e=="function"?e=hw(e):e=Mm(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 qe(r,o)}function $m(e){return function(){return this.matches(e)}}function Pm(e){return function(t){return t.matches(e)}}var mw=Array.prototype.find;function gw(e){return function(){return mw.call(this.children,e)}}function yw(){return this.firstElementChild}function vw(e){return this.select(e==null?yw:gw(typeof e=="function"?e:Pm(e)))}var xw=Array.prototype.filter;function ww(){return Array.from(this.children)}function kw(e){return function(){return xw.call(this.children,e)}}function Sw(e){return this.selectAll(e==null?ww:kw(typeof e=="function"?e:Pm(e)))}function Ew(e){typeof e!="function"&&(e=$m(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 qe(r,this._parents)}function Im(e){return new Array(e.length)}function Nw(){return new qe(this._enter||this._groups.map(Im),this._parents)}function Ps(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ps.prototype={constructor:Ps,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 _w(e){return function(){return e}}function Cw(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 Ps(e,i[s]);for(;s<a;++s)(l=t[s])&&(o[s]=l)}function jw(e,t,n,r,o,i,s){var l,a,u=new Map,c=t.length,f=i.length,d=new Array(c),p;for(l=0;l<c;++l)(a=t[l])&&(d[l]=p=s.call(a,a.__data__,l,t)+"",u.has(p)?o[l]=a:u.set(p,a));for(l=0;l<f;++l)p=s.call(e,i[l],l,i)+"",(a=u.get(p))?(r[l]=a,a.__data__=i[l],u.delete(p)):n[l]=new Ps(e,i[l]);for(l=0;l<c;++l)(a=t[l])&&u.get(d[l])===a&&(o[l]=a)}function Mw(e){return e.__data__}function $w(e,t){if(!arguments.length)return Array.from(this,Mw);var n=t?jw:Cw,r=this._parents,o=this._groups;typeof e!="function"&&(e=_w(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],f=o[u],d=f.length,p=Pw(e.call(c,c&&c.__data__,u,r)),y=p.length,x=l[u]=new Array(y),k=s[u]=new Array(y),m=a[u]=new Array(d);n(c,f,x,k,m,p,t);for(var v=0,g=0,w,N;v<y;++v)if(w=x[v]){for(v>=g&&(g=v+1);!(N=k[g])&&++g<y;);w._next=N||null}}return s=new qe(s,r),s._enter=l,s._exit=a,s}function Pw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Iw(){return new qe(this._exit||this._groups.map(Im),this._parents)}function Tw(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 bw(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],f=u.length,d=l[a]=new Array(f),p,y=0;y<f;++y)(p=u[y]||c[y])&&(d[y]=p);for(;a<o;++a)l[a]=n[a];return new qe(l,this._parents)}function zw(){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 Lw(e){e||(e=Aw);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}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 qe(o,this._parents).order()}function Aw(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Rw(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Dw(){return Array.from(this)}function Ow(){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 Fw(){let e=0;for(const t of this)++e;return e}function Hw(){return!this.node()}function Bw(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 Vw(e){return function(){this.removeAttribute(e)}}function Ww(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Uw(e,t){return function(){this.setAttribute(e,t)}}function Yw(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Xw(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Kw(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 Qw(e,t){var n=ll(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?Ww:Vw:typeof t=="function"?n.local?Kw:Xw:n.local?Yw:Uw)(n,t))}function Tm(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Gw(e){return function(){this.style.removeProperty(e)}}function qw(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Zw(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Jw(e,t,n){return arguments.length>1?this.each((t==null?Gw:typeof t=="function"?Zw:qw)(e,t,n??"")):Rr(this.node(),e)}function Rr(e,t){return e.style.getPropertyValue(t)||Tm(e).getComputedStyle(e,null).getPropertyValue(t)}function e1(e){return function(){delete this[e]}}function t1(e,t){return function(){this[e]=t}}function n1(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function r1(e,t){return arguments.length>1?this.each((t==null?e1:typeof t=="function"?n1:t1)(e,t)):this.node()[e]}function bm(e){return e.trim().split(/^|\s+/)}function cc(e){return e.classList||new zm(e)}function zm(e){this._node=e,this._names=bm(e.getAttribute("class")||"")}zm.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 Lm(e,t){for(var n=cc(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Am(e,t){for(var n=cc(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function o1(e){return function(){Lm(this,e)}}function i1(e){return function(){Am(this,e)}}function s1(e,t){return function(){(t.apply(this,arguments)?Lm:Am)(this,e)}}function l1(e,t){var n=bm(e+"");if(arguments.length<2){for(var r=cc(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?s1:t?o1:i1)(n,t))}function a1(){this.textContent=""}function u1(e){return function(){this.textContent=e}}function c1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function d1(e){return arguments.length?this.each(e==null?a1:(typeof e=="function"?c1:u1)(e)):this.node().textContent}function f1(){this.innerHTML=""}function h1(e){return function(){this.innerHTML=e}}function p1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function m1(e){return arguments.length?this.each(e==null?f1:(typeof e=="function"?p1:h1)(e)):this.node().innerHTML}function g1(){this.nextSibling&&this.parentNode.appendChild(this)}function y1(){return this.each(g1)}function v1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function x1(){return this.each(v1)}function w1(e){var t=typeof e=="function"?e:jm(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function k1(){return null}function S1(e,t){var n=typeof e=="function"?e:jm(e),r=t==null?k1:typeof t=="function"?t:uc(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function E1(){var e=this.parentNode;e&&e.removeChild(this)}function N1(){return this.each(E1)}function _1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function C1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function j1(e){return this.select(e?C1:_1)}function M1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function $1(e){return function(t){e.call(this,t,this.__data__)}}function P1(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 I1(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 T1(e,t,n){return function(){var r=this.__on,o,i=$1(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 b1(e,t,n){var r=P1(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?T1:I1,o=0;o<i;++o)this.each(l(r[o],t,n));return this}function Rm(e,t,n){var r=Tm(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 z1(e,t){return function(){return Rm(this,e,t)}}function L1(e,t){return function(){return Rm(this,e,t.apply(this,arguments))}}function A1(e,t){return this.each((typeof t=="function"?L1:z1)(e,t))}function*R1(){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 Dm=[null];function qe(e,t){this._groups=e,this._parents=t}function ii(){return new qe([[document.documentElement]],Dm)}function D1(){return this}qe.prototype=ii.prototype={constructor:qe,select:cw,selectAll:pw,selectChild:vw,selectChildren:Sw,filter:Ew,data:$w,enter:Nw,exit:Iw,join:Tw,merge:bw,selection:D1,order:zw,sort:Lw,call:Rw,nodes:Dw,node:Ow,size:Fw,empty:Hw,each:Bw,attr:Qw,style:Jw,property:r1,classed:l1,text:d1,html:m1,raise:y1,lower:x1,append:w1,insert:S1,remove:N1,clone:j1,datum:M1,on:b1,dispatch:A1,[Symbol.iterator]:R1};function Xe(e){return typeof e=="string"?new qe([[document.querySelector(e)]],[document.documentElement]):new qe([[e]],Dm)}function O1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function ft(e,t){if(e=O1(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 F1={passive:!1},Bo={capture:!0,passive:!1};function Gl(e){e.stopImmediatePropagation()}function Mr(e){e.preventDefault(),e.stopImmediatePropagation()}function Om(e){var t=e.document.documentElement,n=Xe(e).on("dragstart.drag",Mr,Bo);"onselectstart"in t?n.on("selectstart.drag",Mr,Bo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Fm(e,t){var n=e.document.documentElement,r=Xe(e).on("dragstart.drag",null);t&&(r.on("click.drag",Mr,Bo),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 Ti=e=>()=>e;function eu(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}})}eu.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function H1(e){return!e.ctrlKey&&!e.button}function B1(){return this.parentNode}function V1(e,t){return t??{x:e.x,y:e.y}}function W1(){return navigator.maxTouchPoints||"ontouchstart"in this}function Hm(){var e=H1,t=B1,n=V1,r=W1,o={},i=sl("start","drag","end"),s=0,l,a,u,c,f=0;function d(w){w.on("mousedown.drag",p).filter(r).on("touchstart.drag",k).on("touchmove.drag",m,F1).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(w,N){if(!(c||!e.call(this,w,N))){var S=g(this,t.call(this,w,N),w,N,"mouse");S&&(Xe(w.view).on("mousemove.drag",y,Bo).on("mouseup.drag",x,Bo),Om(w.view),Gl(w),u=!1,l=w.clientX,a=w.clientY,S("start",w))}}function y(w){if(Mr(w),!u){var N=w.clientX-l,S=w.clientY-a;u=N*N+S*S>f}o.mouse("drag",w)}function x(w){Xe(w.view).on("mousemove.drag mouseup.drag",null),Fm(w.view,u),Mr(w),o.mouse("end",w)}function k(w,N){if(e.call(this,w,N)){var S=w.changedTouches,_=t.call(this,w,N),C=S.length,I,R;for(I=0;I<C;++I)(R=g(this,_,w,N,S[I].identifier,S[I]))&&(Gl(w),R("start",w,S[I]))}}function m(w){var N=w.changedTouches,S=N.length,_,C;for(_=0;_<S;++_)(C=o[N[_].identifier])&&(Mr(w),C("drag",w,N[_]))}function v(w){var N=w.changedTouches,S=N.length,_,C;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),_=0;_<S;++_)(C=o[N[_].identifier])&&(Gl(w),C("end",w,N[_]))}function g(w,N,S,_,C,I){var R=i.copy(),D=ft(I||S,N),H,F,E;if((E=n.call(w,new eu("beforestart",{sourceEvent:S,target:d,identifier:C,active:s,x:D[0],y:D[1],dx:0,dy:0,dispatch:R}),_))!=null)return H=E.x-D[0]||0,F=E.y-D[1]||0,function L(M,T,P){var $=D,z;switch(M){case"start":o[C]=L,z=s++;break;case"end":delete o[C],--s;case"drag":D=ft(P||T,N),z=s;break}R.call(M,w,new eu(M,{sourceEvent:T,subject:E,target:d,identifier:C,active:z,x:D[0]+H,y:D[1]+F,dx:D[0]-$[0],dy:D[1]-$[1],dispatch:R}),_)}}return d.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Ti(!!w),d):e},d.container=function(w){return arguments.length?(t=typeof w=="function"?w:Ti(w),d):t},d.subject=function(w){return arguments.length?(n=typeof w=="function"?w:Ti(w),d):n},d.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:Ti(!!w),d):r},d.on=function(){var w=i.on.apply(i,arguments);return w===i?d:w},d.clickDistance=function(w){return arguments.length?(f=(w=+w)*w,d):Math.sqrt(f)},d}function dc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Bm(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function si(){}var Vo=.7,Is=1/Vo,$r="\\s*([+-]?\\d+)\\s*",Wo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",It="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",U1=/^#([0-9a-f]{3,8})$/,Y1=new RegExp(`^rgb\\(${$r},${$r},${$r}\\)$`),X1=new RegExp(`^rgb\\(${It},${It},${It}\\)$`),K1=new RegExp(`^rgba\\(${$r},${$r},${$r},${Wo}\\)$`),Q1=new RegExp(`^rgba\\(${It},${It},${It},${Wo}\\)$`),G1=new RegExp(`^hsl\\(${Wo},${It},${It}\\)$`),q1=new RegExp(`^hsla\\(${Wo},${It},${It},${Wo}\\)$`),Gd={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};dc(si,Gn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:qd,formatHex:qd,formatHex8:Z1,formatHsl:J1,formatRgb:Zd,toString:Zd});function qd(){return this.rgb().formatHex()}function Z1(){return this.rgb().formatHex8()}function J1(){return Vm(this).formatHsl()}function Zd(){return this.rgb().formatRgb()}function Gn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=U1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Jd(t):n===3?new Be(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?bi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?bi(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=Y1.exec(e))?new Be(t[1],t[2],t[3],1):(t=X1.exec(e))?new Be(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=K1.exec(e))?bi(t[1],t[2],t[3],t[4]):(t=Q1.exec(e))?bi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=G1.exec(e))?nf(t[1],t[2]/100,t[3]/100,1):(t=q1.exec(e))?nf(t[1],t[2]/100,t[3]/100,t[4]):Gd.hasOwnProperty(e)?Jd(Gd[e]):e==="transparent"?new Be(NaN,NaN,NaN,0):null}function Jd(e){return new Be(e>>16&255,e>>8&255,e&255,1)}function bi(e,t,n,r){return r<=0&&(e=t=n=NaN),new Be(e,t,n,r)}function ek(e){return e instanceof si||(e=Gn(e)),e?(e=e.rgb(),new Be(e.r,e.g,e.b,e.opacity)):new Be}function tu(e,t,n,r){return arguments.length===1?ek(e):new Be(e,t,n,r??1)}function Be(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}dc(Be,tu,Bm(si,{brighter(e){return e=e==null?Is:Math.pow(Is,e),new Be(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Vo:Math.pow(Vo,e),new Be(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Be(Fn(this.r),Fn(this.g),Fn(this.b),Ts(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:ef,formatHex:ef,formatHex8:tk,formatRgb:tf,toString:tf}));function ef(){return`#${Ln(this.r)}${Ln(this.g)}${Ln(this.b)}`}function tk(){return`#${Ln(this.r)}${Ln(this.g)}${Ln(this.b)}${Ln((isNaN(this.opacity)?1:this.opacity)*255)}`}function tf(){const e=Ts(this.opacity);return`${e===1?"rgb(":"rgba("}${Fn(this.r)}, ${Fn(this.g)}, ${Fn(this.b)}${e===1?")":`, ${e})`}`}function Ts(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Fn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ln(e){return e=Fn(e),(e<16?"0":"")+e.toString(16)}function nf(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new mt(e,t,n,r)}function Vm(e){if(e instanceof mt)return new mt(e.h,e.s,e.l,e.opacity);if(e instanceof si||(e=Gn(e)),!e)return new mt;if(e instanceof mt)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 mt(s,l,a,e.opacity)}function nk(e,t,n,r){return arguments.length===1?Vm(e):new mt(e,t,n,r??1)}function mt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}dc(mt,nk,Bm(si,{brighter(e){return e=e==null?Is:Math.pow(Is,e),new mt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Vo:Math.pow(Vo,e),new mt(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 Be(ql(e>=240?e-240:e+120,o,r),ql(e,o,r),ql(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new mt(rf(this.h),zi(this.s),zi(this.l),Ts(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=Ts(this.opacity);return`${e===1?"hsl(":"hsla("}${rf(this.h)}, ${zi(this.s)*100}%, ${zi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function rf(e){return e=(e||0)%360,e<0?e+360:e}function zi(e){return Math.max(0,Math.min(1,e||0))}function ql(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 fc=e=>()=>e;function rk(e,t){return function(n){return e+n*t}}function ok(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 ik(e){return(e=+e)==1?Wm:function(t,n){return n-t?ok(t,n,e):fc(isNaN(t)?n:t)}}function Wm(e,t){var n=t-e;return n?rk(e,n):fc(isNaN(e)?t:e)}const bs=function e(t){var n=ik(t);function r(o,i){var s=n((o=tu(o)).r,(i=tu(i)).r),l=n(o.g,i.g),a=n(o.b,i.b),u=Wm(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 sk(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 lk(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ak(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]=So(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 uk(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ct(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function ck(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]=So(e[o],t[o]):r[o]=t[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var nu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Zl=new RegExp(nu.source,"g");function dk(e){return function(){return e}}function fk(e){return function(t){return e(t)+""}}function Um(e,t){var n=nu.lastIndex=Zl.lastIndex=0,r,o,i,s=-1,l=[],a=[];for(e=e+"",t=t+"";(r=nu.exec(e))&&(o=Zl.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:Ct(r,o)})),n=Zl.lastIndex;return n<t.length&&(i=t.slice(n),l[s]?l[s]+=i:l[++s]=i),l.length<2?a[0]?fk(a[0].x):dk(t):(t=a.length,function(u){for(var c=0,f;c<t;++c)l[(f=a[c]).i]=f.x(u);return l.join("")})}function So(e,t){var n=typeof t,r;return t==null||n==="boolean"?fc(t):(n==="number"?Ct:n==="string"?(r=Gn(t))?(t=r,bs):Um:t instanceof Gn?bs:t instanceof Date?uk:lk(t)?sk:Array.isArray(t)?ak:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?ck:Ct)(e,t)}var of=180/Math.PI,ru={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ym(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)*of,skewX:Math.atan(a)*of,scaleX:s,scaleY:l}}var Li;function hk(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ru:Ym(t.a,t.b,t.c,t.d,t.e,t.f)}function pk(e){return e==null||(Li||(Li=document.createElementNS("http://www.w3.org/2000/svg","g")),Li.setAttribute("transform",e),!(e=Li.transform.baseVal.consolidate()))?ru:(e=e.matrix,Ym(e.a,e.b,e.c,e.d,e.e,e.f))}function Xm(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,c,f,d,p,y){if(u!==f||c!==d){var x=p.push("translate(",null,t,null,n);y.push({i:x-4,x:Ct(u,f)},{i:x-2,x:Ct(c,d)})}else(f||d)&&p.push("translate("+f+t+d+n)}function s(u,c,f,d){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),d.push({i:f.push(o(f)+"rotate(",null,r)-2,x:Ct(u,c)})):c&&f.push(o(f)+"rotate("+c+r)}function l(u,c,f,d){u!==c?d.push({i:f.push(o(f)+"skewX(",null,r)-2,x:Ct(u,c)}):c&&f.push(o(f)+"skewX("+c+r)}function a(u,c,f,d,p,y){if(u!==f||c!==d){var x=p.push(o(p)+"scale(",null,",",null,")");y.push({i:x-4,x:Ct(u,f)},{i:x-2,x:Ct(c,d)})}else(f!==1||d!==1)&&p.push(o(p)+"scale("+f+","+d+")")}return function(u,c){var f=[],d=[];return u=e(u),c=e(c),i(u.translateX,u.translateY,c.translateX,c.translateY,f,d),s(u.rotate,c.rotate,f,d),l(u.skewX,c.skewX,f,d),a(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,d),u=c=null,function(p){for(var y=-1,x=d.length,k;++y<x;)f[(k=d[y]).i]=k.x(p);return f.join("")}}}var mk=Xm(hk,"px, ","px)","deg)"),gk=Xm(pk,", ",")",")"),yk=1e-12;function sf(e){return((e=Math.exp(e))+1/e)/2}function vk(e){return((e=Math.exp(e))-1/e)/2}function xk(e){return((e=Math.exp(2*e))-1)/(e+1)}const ts=function e(t,n,r){function o(i,s){var l=i[0],a=i[1],u=i[2],c=s[0],f=s[1],d=s[2],p=c-l,y=f-a,x=p*p+y*y,k,m;if(x<yk)m=Math.log(d/u)/t,k=function(_){return[l+_*p,a+_*y,u*Math.exp(t*_*m)]};else{var v=Math.sqrt(x),g=(d*d-u*u+r*x)/(2*u*n*v),w=(d*d-u*u-r*x)/(2*d*n*v),N=Math.log(Math.sqrt(g*g+1)-g),S=Math.log(Math.sqrt(w*w+1)-w);m=(S-N)/t,k=function(_){var C=_*m,I=sf(N),R=u/(n*v)*(I*xk(t*C+N)-vk(N));return[l+R*p,a+R*y,u*I/sf(t*C+N)]}}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 Dr=0,co=0,oo=0,Km=1e3,zs,fo,Ls=0,qn=0,al=0,Uo=typeof performance=="object"&&performance.now?performance:Date,Qm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function hc(){return qn||(Qm(wk),qn=Uo.now()+al)}function wk(){qn=0}function As(){this._call=this._time=this._next=null}As.prototype=Gm.prototype={constructor:As,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?hc():+n)+(t==null?0:+t),!this._next&&fo!==this&&(fo?fo._next=this:zs=this,fo=this),this._call=e,this._time=n,ou()},stop:function(){this._call&&(this._call=null,this._time=1/0,ou())}};function Gm(e,t,n){var r=new As;return r.restart(e,t,n),r}function kk(){hc(),++Dr;for(var e=zs,t;e;)(t=qn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Dr}function lf(){qn=(Ls=Uo.now())+al,Dr=co=0;try{kk()}finally{Dr=0,Ek(),qn=0}}function Sk(){var e=Uo.now(),t=e-Ls;t>Km&&(al-=t,Ls=e)}function Ek(){for(var e,t=zs,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:zs=n);fo=e,ou(r)}function ou(e){if(!Dr){co&&(co=clearTimeout(co));var t=e-qn;t>24?(e<1/0&&(co=setTimeout(lf,e-Uo.now()-al)),oo&&(oo=clearInterval(oo))):(oo||(Ls=Uo.now(),oo=setInterval(Sk,Km)),Dr=1,Qm(lf))}}function af(e,t,n){var r=new As;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var Nk=sl("start","end","cancel","interrupt"),_k=[],qm=0,uf=1,iu=2,ns=3,cf=4,su=5,rs=6;function ul(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Ck(e,n,{name:t,index:r,group:o,on:Nk,tween:_k,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:qm})}function pc(e,t){var n=St(e,t);if(n.state>qm)throw new Error("too late; already scheduled");return n}function Tt(e,t){var n=St(e,t);if(n.state>ns)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 Ck(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=Gm(i,0,n.time);function i(u){n.state=uf,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,f,d,p;if(n.state!==uf)return a();for(c in r)if(p=r[c],p.name===n.name){if(p.state===ns)return af(s);p.state===cf?(p.state=rs,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[c]):+c<t&&(p.state=rs,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[c])}if(af(function(){n.state===ns&&(n.state=cf,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=iu,n.on.call("start",e,e.__data__,n.index,n.group),n.state===iu){for(n.state=ns,o=new Array(d=n.tween.length),c=0,f=-1;c<d;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++f]=p);o.length=f+1}}function l(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=su,1),f=-1,d=o.length;++f<d;)o[f].call(e,c);n.state===su&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=rs,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function os(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>iu&&r.state<su,r.state=rs,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function jk(e){return this.each(function(){os(this,e)})}function Mk(e,t){var n,r;return function(){var o=Tt(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 $k(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=Tt(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 Pk(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?Mk:$k)(n,e,t))}function mc(e,t,n){var r=e._id;return e.each(function(){var o=Tt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return St(o,r).value[t]}}function Zm(e,t){var n;return(typeof t=="number"?Ct:t instanceof Gn?bs:(n=Gn(t))?(t=n,bs):Um)(e,t)}function Ik(e){return function(){this.removeAttribute(e)}}function Tk(e){return function(){this.removeAttributeNS(e.space,e.local)}}function bk(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 zk(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 Lk(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 Ak(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 Rk(e,t){var n=ll(e),r=n==="transform"?gk:Zm;return this.attrTween(e,typeof t=="function"?(n.local?Ak:Lk)(n,r,mc(this,"attr."+e,t)):t==null?(n.local?Tk:Ik)(n):(n.local?zk:bk)(n,r,t))}function Dk(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Ok(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Fk(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Ok(e,i)),n}return o._value=t,o}function Hk(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Dk(e,i)),n}return o._value=t,o}function Bk(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=ll(e);return this.tween(n,(r.local?Fk:Hk)(r,t))}function Vk(e,t){return function(){pc(this,e).delay=+t.apply(this,arguments)}}function Wk(e,t){return t=+t,function(){pc(this,e).delay=t}}function Uk(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Vk:Wk)(t,e)):St(this.node(),t).delay}function Yk(e,t){return function(){Tt(this,e).duration=+t.apply(this,arguments)}}function Xk(e,t){return t=+t,function(){Tt(this,e).duration=t}}function Kk(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Yk:Xk)(t,e)):St(this.node(),t).duration}function Qk(e,t){if(typeof t!="function")throw new Error;return function(){Tt(this,e).ease=t}}function Gk(e){var t=this._id;return arguments.length?this.each(Qk(t,e)):St(this.node(),t).ease}function qk(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Tt(this,e).ease=n}}function Zk(e){if(typeof e!="function")throw new Error;return this.each(qk(this._id,e))}function Jk(e){typeof e!="function"&&(e=$m(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 Qt(r,this._parents,this._name,this._id)}function eS(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,f=s[l]=new Array(c),d,p=0;p<c;++p)(d=a[p]||u[p])&&(f[p]=d);for(;l<r;++l)s[l]=t[l];return new Qt(s,this._parents,this._name,this._id)}function tS(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 nS(e,t,n){var r,o,i=tS(t)?pc:Tt;return function(){var s=i(this,e),l=s.on;l!==r&&(o=(r=l).copy()).on(t,n),s.on=o}}function rS(e,t){var n=this._id;return arguments.length<2?St(this.node(),n).on.on(e):this.each(nS(n,e,t))}function oS(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function iS(){return this.on("end.remove",oS(this._id))}function sS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=uc(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,f,d=0;d<a;++d)(c=l[d])&&(f=e.call(c,c.__data__,d,l))&&("__data__"in c&&(f.__data__=c.__data__),u[d]=f,ul(u[d],t,n,d,u,St(c,n)));return new Qt(i,this._parents,t,n)}function lS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Mm(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,f=0;f<u;++f)if(c=a[f]){for(var d=e.call(c,c.__data__,f,a),p,y=St(c,n),x=0,k=d.length;x<k;++x)(p=d[x])&&ul(p,t,n,x,d,y);i.push(d),s.push(c)}return new Qt(i,s,t,n)}var aS=ii.prototype.constructor;function uS(){return new aS(this._groups,this._parents)}function cS(e,t){var n,r,o;return function(){var i=Rr(this,e),s=(this.style.removeProperty(e),Rr(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function Jm(e){return function(){this.style.removeProperty(e)}}function dS(e,t,n){var r,o=n+"",i;return function(){var s=Rr(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function fS(e,t,n){var r,o,i;return function(){var s=Rr(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),Rr(this,e))),s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l))}}function hS(e,t){var n,r,o,i="style."+t,s="end."+i,l;return function(){var a=Tt(this,e),u=a.on,c=a.value[i]==null?l||(l=Jm(t)):void 0;(u!==n||o!==c)&&(r=(n=u).copy()).on(s,o=c),a.on=r}}function pS(e,t,n){var r=(e+="")=="transform"?mk:Zm;return t==null?this.styleTween(e,cS(e,r)).on("end.style."+e,Jm(e)):typeof t=="function"?this.styleTween(e,fS(e,r,mc(this,"style."+e,t))).each(hS(this._id,e)):this.styleTween(e,dS(e,r,t),n).on("end.style."+e,null)}function mS(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function gS(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&mS(e,s,n)),r}return i._value=t,i}function yS(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,gS(e,t,n??""))}function vS(e){return function(){this.textContent=e}}function xS(e){return function(){var t=e(this);this.textContent=t??""}}function wS(e){return this.tween("text",typeof e=="function"?xS(mc(this,"text",e)):vS(e==null?"":e+""))}function kS(e){return function(t){this.textContent=e.call(this,t)}}function SS(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&kS(o)),t}return r._value=e,r}function ES(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,SS(e))}function NS(){for(var e=this._name,t=this._id,n=eg(),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);ul(a,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Qt(r,this._parents,e,n)}function _S(){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=Tt(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 CS=0;function Qt(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function eg(){return++CS}var At=ii.prototype;Qt.prototype={constructor:Qt,select:sS,selectAll:lS,selectChild:At.selectChild,selectChildren:At.selectChildren,filter:Jk,merge:eS,selection:uS,transition:NS,call:At.call,nodes:At.nodes,node:At.node,size:At.size,empty:At.empty,each:At.each,on:rS,attr:Rk,attrTween:Bk,style:pS,styleTween:yS,text:wS,textTween:ES,remove:iS,tween:Pk,delay:Uk,duration:Kk,ease:Gk,easeVarying:Zk,end:_S,[Symbol.iterator]:At[Symbol.iterator]};function jS(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var MS={time:null,delay:0,duration:250,ease:jS};function $S(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 PS(e){var t,n;e instanceof Qt?(t=e._id,e=e._name):(t=eg(),(n=MS).time=hc(),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])&&ul(a,e,t,u,s,n||$S(a,t));return new Qt(r,this._parents,e,t)}ii.prototype.interrupt=jk;ii.prototype.transition=PS;const Ai=e=>()=>e;function IS(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 cl=new Bt(1,0,0);tg.prototype=Bt.prototype;function tg(e){for(;!e.__zoom;)if(!(e=e.parentNode))return cl;return e.__zoom}function Jl(e){e.stopImmediatePropagation()}function io(e){e.preventDefault(),e.stopImmediatePropagation()}function TS(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function bS(){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 df(){return this.__zoom||cl}function zS(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function LS(){return navigator.maxTouchPoints||"ontouchstart"in this}function AS(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 ng(){var e=TS,t=bS,n=AS,r=zS,o=LS,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,a=ts,u=sl("start","zoom","end"),c,f,d,p=500,y=150,x=0,k=10;function m(E){E.property("__zoom",df).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",R).filter(o).on("touchstart.zoom",D).on("touchmove.zoom",H).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(E,L,M,T){var P=E.selection?E.selection():E;P.property("__zoom",df),E!==P?N(E,L,M,T):P.interrupt().each(function(){S(this,arguments).event(T).start().zoom(null,typeof L=="function"?L.apply(this,arguments):L).end()})},m.scaleBy=function(E,L,M,T){m.scaleTo(E,function(){var P=this.__zoom.k,$=typeof L=="function"?L.apply(this,arguments):L;return P*$},M,T)},m.scaleTo=function(E,L,M,T){m.transform(E,function(){var P=t.apply(this,arguments),$=this.__zoom,z=M==null?w(P):typeof M=="function"?M.apply(this,arguments):M,j=$.invert(z),A=typeof L=="function"?L.apply(this,arguments):L;return n(g(v($,A),z,j),P,s)},M,T)},m.translateBy=function(E,L,M,T){m.transform(E,function(){return n(this.__zoom.translate(typeof L=="function"?L.apply(this,arguments):L,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),s)},null,T)},m.translateTo=function(E,L,M,T,P){m.transform(E,function(){var $=t.apply(this,arguments),z=this.__zoom,j=T==null?w($):typeof T=="function"?T.apply(this,arguments):T;return n(cl.translate(j[0],j[1]).scale(z.k).translate(typeof L=="function"?-L.apply(this,arguments):-L,typeof M=="function"?-M.apply(this,arguments):-M),$,s)},T,P)};function v(E,L){return L=Math.max(i[0],Math.min(i[1],L)),L===E.k?E:new Bt(L,E.x,E.y)}function g(E,L,M){var T=L[0]-M[0]*E.k,P=L[1]-M[1]*E.k;return T===E.x&&P===E.y?E:new Bt(E.k,T,P)}function w(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function N(E,L,M,T){E.on("start.zoom",function(){S(this,arguments).event(T).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(T).end()}).tween("zoom",function(){var P=this,$=arguments,z=S(P,$).event(T),j=t.apply(P,$),A=M==null?w(j):typeof M=="function"?M.apply(P,$):M,V=Math.max(j[1][0]-j[0][0],j[1][1]-j[0][1]),U=P.__zoom,G=typeof L=="function"?L.apply(P,$):L,B=a(U.invert(A).concat(V/U.k),G.invert(A).concat(V/G.k));return function(X){if(X===1)X=G;else{var O=B(X),Y=V/O[2];X=new Bt(Y,A[0]-O[0]*Y,A[1]-O[1]*Y)}z.zoom(null,X)}})}function S(E,L,M){return!M&&E.__zooming||new _(E,L)}function _(E,L){this.that=E,this.args=L,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,L),this.taps=0}_.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,L){return this.mouse&&E!=="mouse"&&(this.mouse[1]=L.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=L.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=L.invert(this.touch1[0])),this.that.__zoom=L,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var L=Xe(this.that).datum();u.call(E,this.that,new IS(E,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:u}),L)}};function C(E,...L){if(!e.apply(this,arguments))return;var M=S(this,L).event(E),T=this.__zoom,P=Math.max(i[0],Math.min(i[1],T.k*Math.pow(2,r.apply(this,arguments)))),$=ft(E);if(M.wheel)(M.mouse[0][0]!==$[0]||M.mouse[0][1]!==$[1])&&(M.mouse[1]=T.invert(M.mouse[0]=$)),clearTimeout(M.wheel);else{if(T.k===P)return;M.mouse=[$,T.invert($)],os(this),M.start()}io(E),M.wheel=setTimeout(z,y),M.zoom("mouse",n(g(v(T,P),M.mouse[0],M.mouse[1]),M.extent,s));function z(){M.wheel=null,M.end()}}function I(E,...L){if(d||!e.apply(this,arguments))return;var M=E.currentTarget,T=S(this,L,!0).event(E),P=Xe(E.view).on("mousemove.zoom",A,!0).on("mouseup.zoom",V,!0),$=ft(E,M),z=E.clientX,j=E.clientY;Om(E.view),Jl(E),T.mouse=[$,this.__zoom.invert($)],os(this),T.start();function A(U){if(io(U),!T.moved){var G=U.clientX-z,B=U.clientY-j;T.moved=G*G+B*B>x}T.event(U).zoom("mouse",n(g(T.that.__zoom,T.mouse[0]=ft(U,M),T.mouse[1]),T.extent,s))}function V(U){P.on("mousemove.zoom mouseup.zoom",null),Fm(U.view,T.moved),io(U),T.event(U).end()}}function R(E,...L){if(e.apply(this,arguments)){var M=this.__zoom,T=ft(E.changedTouches?E.changedTouches[0]:E,this),P=M.invert(T),$=M.k*(E.shiftKey?.5:2),z=n(g(v(M,$),T,P),t.apply(this,L),s);io(E),l>0?Xe(this).transition().duration(l).call(N,z,T,E):Xe(this).call(m.transform,z,T,E)}}function D(E,...L){if(e.apply(this,arguments)){var M=E.touches,T=M.length,P=S(this,L,E.changedTouches.length===T).event(E),$,z,j,A;for(Jl(E),z=0;z<T;++z)j=M[z],A=ft(j,this),A=[A,this.__zoom.invert(A),j.identifier],P.touch0?!P.touch1&&P.touch0[2]!==A[2]&&(P.touch1=A,P.taps=0):(P.touch0=A,$=!0,P.taps=1+!!c);c&&(c=clearTimeout(c)),$&&(P.taps<2&&(f=A[0],c=setTimeout(function(){c=null},p)),os(this),P.start())}}function H(E,...L){if(this.__zooming){var M=S(this,L).event(E),T=E.changedTouches,P=T.length,$,z,j,A;for(io(E),$=0;$<P;++$)z=T[$],j=ft(z,this),M.touch0&&M.touch0[2]===z.identifier?M.touch0[0]=j:M.touch1&&M.touch1[2]===z.identifier&&(M.touch1[0]=j);if(z=M.that.__zoom,M.touch1){var V=M.touch0[0],U=M.touch0[1],G=M.touch1[0],B=M.touch1[1],X=(X=G[0]-V[0])*X+(X=G[1]-V[1])*X,O=(O=B[0]-U[0])*O+(O=B[1]-U[1])*O;z=v(z,Math.sqrt(X/O)),j=[(V[0]+G[0])/2,(V[1]+G[1])/2],A=[(U[0]+B[0])/2,(U[1]+B[1])/2]}else if(M.touch0)j=M.touch0[0],A=M.touch0[1];else return;M.zoom("touch",n(g(z,j,A),M.extent,s))}}function F(E,...L){if(this.__zooming){var M=S(this,L).event(E),T=E.changedTouches,P=T.length,$,z;for(Jl(E),d&&clearTimeout(d),d=setTimeout(function(){d=null},p),$=0;$<P;++$)z=T[$],M.touch0&&M.touch0[2]===z.identifier?delete M.touch0:M.touch1&&M.touch1[2]===z.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(z=ft(z,this),Math.hypot(f[0]-z[0],f[1]-z[1])<k)){var j=Xe(this).on("dblclick.zoom");j&&j.apply(this,arguments)}}}return m.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:Ai(+E),m):r},m.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Ai(!!E),m):e},m.touchable=function(E){return arguments.length?(o=typeof E=="function"?E:Ai(!!E),m):o},m.extent=function(E){return arguments.length?(t=typeof E=="function"?E:Ai([[+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?(x=(E=+E)*E,m):Math.sqrt(x)},m.tapDistance=function(E){return arguments.length?(k=+E,m):k},m}const kt={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.`},Yo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],rg=["Enter"," ","Escape"],og={"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 Or;(function(e){e.Strict="strict",e.Loose="loose"})(Or||(Or={}));var Hn;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Hn||(Hn={}));var Xo;(function(e){e.Partial="partial",e.Full="full"})(Xo||(Xo={}));const ig={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 Ko;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ko||(Ko={}));var Z;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Z||(Z={}));const ff={[Z.Left]:Z.Right,[Z.Right]:Z.Left,[Z.Top]:Z.Bottom,[Z.Bottom]:Z.Top},sg=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,RS=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),gc=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),li=(e,t=[0,0])=>{const{width:n,height:r}=Et(e),o=e.origin??t,i=n*o[0],s=r*o[1];return{x:e.position.x-i,y:e.position.y-s}},DS=(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):gc(i)?i:t.nodeLookup.get(i.id)),l?(n=!0,dl(o,Rs(l,t.nodeOrigin))):o},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?fl(r):{x:0,y:0,width:0,height:0}},ai=(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=dl(n,Rs(o)),r=!0)}),r?fl(n):{x:0,y:0,width:0,height:0}},yc=(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,f=[];for(const d of e.values()){const{measured:p,selectable:y=!0,hidden:x=!1}=d;if(s&&!y||x)continue;const k=p.width??d.width??d.initialWidth??0,m=p.height??d.height??d.initialHeight??0,{x:v,y:g}=d.internals.positionAbsolute,w=cg(l,a,u,c,v,g,k,m),N=k*m,S=i&&w>0;(!d.internals.handleBounds||S||w>=N||d.dragging)&&f.push(d)}return f},OS=(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 FS(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}=Et(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 HS({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return!0;const l=FS(e,s),a=ai(l),u=xc(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 lg({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 f=s.extent||o;if(s.extent==="parent"&&!s.expandParent)if(!l)i==null||i("005",kt.error005());else{const{width:p,height:y}=Et(l);p&&y&&(f=[[a,u],[a+p,u+y]])}else l&&Jn(s.extent)&&(f=[[s.extent[0][0]+a,s.extent[0][1]+u],[s.extent[1][0]+a,s.extent[1][1]+u]]);const d=Jn(f)?Zn(t,f,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",kt.error015())),{position:{x:d.x-a+(s.measured.width??0)*c[0],y:d.y-u+(s.measured.height??0)*c[1]},positionAbsolute:d}}async function BS({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const i=new Set(e.map(d=>d.id)),s=[];for(const d of n){if(d.deletable===!1)continue;const p=i.has(d.id),y=!p&&d.parentId&&s.find(x=>x.id===d.parentId);(p||y)&&s.push(d)}const l=new Set(t.map(d=>d.id)),a=r.filter(d=>d.deletable!==!1),c=OS(s,a);for(const d of a)l.has(d.id)&&!c.find(y=>y.id===d.id)&&c.push(d);if(!o)return{edges:c,nodes:s};const f=await o({nodes:s,edges:c});return typeof f=="boolean"?f?{edges:c,nodes:s}:{edges:[],nodes:[]}:f}const Fr=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Zn=(e={x:0,y:0},t,n)=>({x:Fr(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Fr(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function ag(e,t,n){const{width:r,height:o}=Et(n),{x:i,y:s}=n.internals.positionAbsolute;return Zn(e,[[i,s],[i+r,s+o]],t)}const hf=(e,t,n)=>e<t?Fr(Math.abs(e-t),1,t)/t:e>n?-Fr(Math.abs(e-n),1,t)/t:0,vc=(e,t,n=15,r=40)=>{const o=hf(e.x,r,t.width-r)*n,i=hf(e.y,r,t.height-r)*n;return[o,i]},dl=(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)}),lu=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),fl=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Qo=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=gc(e)?e.internals.positionAbsolute:li(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}},Rs=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=gc(e)?e.internals.positionAbsolute:li(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)}},ug=(e,t)=>fl(dl(lu(e),lu(t))),cg=(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)},Ds=(e,t)=>cg(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),pf=e=>gt(e.width)&&gt(e.height)&&gt(e.x)&&gt(e.y),gt=e=>!isNaN(e)&&isFinite(e),dg=(e,t)=>(n,r)=>{},ui=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ci=({x:e,y:t},[n,r,o],i=!1,s=[1,1])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?ui(l,s):l},Hr=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function or(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 VS(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=or(e,n),o=or(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=or(e.top??e.y??0,n),o=or(e.bottom??e.y??0,n),i=or(e.left??e.x??0,t),s=or(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 WS(e,t,n,r,o,i){const{x:s,y:l}=Hr(e,[t,n,r]),{x:a,y:u}=Hr({x:e.x+e.width,y:e.y+e.height},[t,n,r]),c=o-a,f=i-u;return{left:Math.floor(s),top:Math.floor(l),right:Math.floor(c),bottom:Math.floor(f)}}const xc=(e,t,n,r,o,i)=>{const s=VS(i,t,n),l=(t-s.x)/e.width,a=(n-s.y)/e.height,u=Math.min(l,a),c=Fr(u,r,o),f=e.x+e.width/2,d=e.y+e.height/2,p=t/2-f*c,y=n/2-d*c,x=WS(e,p,y,c,t,n),k={left:Math.min(x.left-s.left,0),top:Math.min(x.top-s.top,0),right:Math.min(x.right-s.right,0),bottom:Math.min(x.bottom-s.bottom,0)};return{x:p-k.left+k.right,y:y-k.top+k.bottom,zoom:c}},Go=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Jn(e){return e!=null&&e!=="parent"}function Et(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 fg(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 hg(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 mf(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function US(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function YS(e){return{...og,...e||{}}}function pg(e){return e===null?null:e?"valid":"invalid"}function Eo(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:s}=yt(e),l=ci({x:i-((o==null?void 0:o.left)??0),y:s-((o==null?void 0:o.top)??0)},r),{x:a,y:u}=n?ui(l,t):l;return{xSnapped:a,ySnapped:u,...l}}const wc=e=>({width:e.offsetWidth,height:e.offsetHeight}),mg=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},XS=["INPUT","SELECT","TEXTAREA"];function gg(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:XS.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const yg=e=>"clientX"in e,yt=(e,t)=>{var i,s;const n=yg(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)}},gf=(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,...wc(s)}})};function vg({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),f=Math.abs(u-t);return[a,u,c,f]}function Ri(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function yf({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case Z.Left:return[t-Ri(t-r,i),n];case Z.Right:return[t+Ri(r-t,i),n];case Z.Top:return[t,n-Ri(n-o,i)];case Z.Bottom:return[t,n+Ri(o-n,i)]}}function kc({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:o,targetPosition:i=Z.Top,curvature:s=.25}){const[l,a]=yf({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,c]=yf({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[f,d,p,y]=vg({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}`,f,d,p,y]}function xg({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 KS({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 QS({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=dl(Rs(e),Rs(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 Ds(s,fl(i))>0}const GS=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,qS=(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)),ZS=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",kt.error006()),t;const r=n.getEdgeId||GS;let o;return sg(e)?o={...e}:o={...e,id:r(e)},qS(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function wg({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,l]=xg({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,l]}const vf={[Z.Left]:{x:-1,y:0},[Z.Right]:{x:1,y:0},[Z.Top]:{x:0,y:-1},[Z.Bottom]:{x:0,y:1}},JS=({source:e,sourcePosition:t=Z.Bottom,target:n})=>t===Z.Left||t===Z.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},xf=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function eE({source:e,sourcePosition:t=Z.Bottom,target:n,targetPosition:r=Z.Top,center:o,offset:i,stepPosition:s}){const l=vf[t],a=vf[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},f=JS({source:u,sourcePosition:t,target:c}),d=f.x!==0?"x":"y",p=f[d];let y=[],x,k;const m={x:0,y:0},v={x:0,y:0},[,,g,w]=xg({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[d]*a[d]===-1){d==="x"?(x=o.x??u.x+(c.x-u.x)*s,k=o.y??(u.y+c.y)/2):(x=o.x??(u.x+c.x)/2,k=o.y??u.y+(c.y-u.y)*s);const C=[{x,y:u.y},{x,y:c.y}],I=[{x:u.x,y:k},{x:c.x,y:k}];l[d]===p?y=d==="x"?C:I:y=d==="x"?I:C}else{const C=[{x:u.x,y:c.y}],I=[{x:c.x,y:u.y}];if(d==="x"?y=l.x===p?I:C:y=l.y===p?C:I,t===r){const E=Math.abs(e[d]-n[d]);if(E<=i){const L=Math.min(i-1,i-E);l[d]===p?m[d]=(u[d]>e[d]?-1:1)*L:v[d]=(c[d]>n[d]?-1:1)*L}}if(t!==r){const E=d==="x"?"y":"x",L=l[d]===a[E],M=u[E]>c[E],T=u[E]<c[E];(l[d]===1&&(!L&&M||L&&T)||l[d]!==1&&(!L&&T||L&&M))&&(y=d==="x"?C:I)}const R={x:u.x+m.x,y:u.y+m.y},D={x:c.x+v.x,y:c.y+v.y},H=Math.max(Math.abs(R.x-y[0].x),Math.abs(D.x-y[0].x)),F=Math.max(Math.abs(R.y-y[0].y),Math.abs(D.y-y[0].y));H>=F?(x=(R.x+D.x)/2,k=y[0].y):(x=y[0].x,k=(R.y+D.y)/2)}const N={x:u.x+m.x,y:u.y+m.y},S={x:c.x+v.x,y:c.y+v.y};return[[e,...N.x!==y[0].x||N.y!==y[0].y?[N]:[],...y,...S.x!==y[y.length-1].x||S.y!==y[y.length-1].y?[S]:[],n],x,k,g,w]}function tE(e,t,n,r){const o=Math.min(xf(e,t)/2,xf(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 Os({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:o,targetPosition:i=Z.Top,borderRadius:s=5,centerX:l,centerY:a,offset:u=20,stepPosition:c=.5}){const[f,d,p,y,x]=eE({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${f[0].x} ${f[0].y}`;for(let m=1;m<f.length-1;m++)k+=tE(f[m-1],f[m],f[m+1],s);return k+=`L${f[f.length-1].x} ${f[f.length-1].y}`,[k,d,p,y,x]}function wf(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function nE(e){var f;const{sourceNode:t,targetNode:n}=e;if(!wf(t)||!wf(n))return null;const r=t.internals.handleBounds||kf(t.handles),o=n.internals.handleBounds||kf(n.handles),i=Sf((r==null?void 0:r.source)??[],e.sourceHandle),s=Sf(e.connectionMode===Or.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(f=e.onError)==null||f.call(e,"008",kt.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(i==null?void 0:i.position)||Z.Bottom,a=(s==null?void 0:s.position)||Z.Top,u=er(t,i,l),c=er(n,s,a);return{sourceX:u.x,sourceY:u.y,targetX:c.x,targetY:c.y,sourcePosition:l,targetPosition:a}}function kf(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 er(e,t,n=Z.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??Et(e);if(r)return{x:o+s/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case Z.Top:return{x:o+s/2,y:i};case Z.Right:return{x:o+s,y:i+l/2};case Z.Bottom:return{x:o+s/2,y:i+l};case Z.Left:return{x:o,y:i+l/2}}}function Sf(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function au(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function rE(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=au(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 kg=1e3,oE=10,Sc={nodeOrigin:[0,0],nodeExtent:Yo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},iE={...Sc,checkEquality:!0};function Ec(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function sE(e,t,n){const r=Ec(Sc,n);for(const o of e.values())if(o.parentId)_c(o,e,t,r);else{const i=li(o,r.nodeOrigin),s=Jn(o.extent)?o.extent:r.nodeExtent,l=Zn(i,s,Et(o));o.internals.positionAbsolute=l}}function lE(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 Nc(e){return e==="manual"}function uu(e,t,n,r={}){var c,f;const o=Ec(iE,r),i={i:0},s=new Map(t),l=o!=null&&o.elevateNodesOnSelect&&!Nc(o.zIndexMode)?kg:0;let a=e.length>0,u=!1;t.clear(),n.clear();for(const d of e){let p=s.get(d.id);if(o.checkEquality&&d===(p==null?void 0:p.internals.userNode))t.set(d.id,p);else{const y=li(d,o.nodeOrigin),x=Jn(d.extent)?d.extent:o.nodeExtent,k=Zn(y,x,Et(d));p={...o.defaults,...d,measured:{width:(c=d.measured)==null?void 0:c.width,height:(f=d.measured)==null?void 0:f.height},internals:{positionAbsolute:k,handleBounds:lE(d,p),z:Sg(d,l,o.zIndexMode),userNode:d}},t.set(d.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(a=!1),d.parentId&&_c(p,t,n,r,i),u||(u=d.selected??!1)}return{nodesInitialized:a,hasSelectedNodes:u}}function aE(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 _c(e,t,n,r,o){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:l,zIndexMode:a}=Ec(Sc,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}aE(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*oE),o&&c.internals.rootParentIndex!==void 0&&(o.i=c.internals.rootParentIndex);const f=i&&!Nc(a)?kg:0,{x:d,y:p,z:y}=uE(e,c,s,l,f,a),{positionAbsolute:x}=e.internals,k=d!==x.x||p!==x.y;(k||y!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:k?{x:d,y:p}:x,z:y}})}function Sg(e,t,n){const r=gt(e.zIndex)?e.zIndex:0;return Nc(n)?r:r+(e.selected?t:0)}function uE(e,t,n,r,o,i){const{x:s,y:l}=t.internals.positionAbsolute,a=Et(e),u=li(e,n),c=Jn(e.extent)?Zn(u,e.extent,a):u;let f=Zn({x:s+c.x,y:l+c.y},r,a);e.extent==="parent"&&(f=ag(f,a,t));const d=Sg(e,o,i),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=d?p+1:d}}function Cc(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)??Qo(a),c=ug(u,l.rect);i.set(l.parentId,{expandedRect:c,parent:a})}return i.size>0&&i.forEach(({expandedRect:l,parent:a},u)=>{var g;const c=a.internals.positionAbsolute,f=Et(a),d=a.origin??r,p=l.x<c.x?Math.round(Math.abs(c.x-l.x)):0,y=l.y<c.y?Math.round(Math.abs(c.y-l.y)):0,x=Math.max(f.width,Math.round(l.width)),k=Math.max(f.height,Math.round(l.height)),m=(x-f.width)*d[0],v=(k-f.height)*d[1];(p>0||y>0||m||v)&&(o.push({id:u,type:"position",position:{x:a.position.x-p+m,y:a.position.y-y+v}}),(g=n.get(u))==null||g.forEach(w=>{e.some(N=>N.id===w.id)||o.push({id:w.id,type:"position",position:{x:w.position.x+p,y:w.position.y+y}})})),(f.width<l.width||f.height<l.height||p||y)&&o.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:x+(p?d[0]*p-m:0),height:k+(y?d[1]*y-v:0)}})}),o}function cE(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:f}=new window.DOMMatrixReadOnly(c.transform),d=[];for(const p of e.values()){const y=t.get(p.id);if(!y)continue;if(y.hidden){t.set(y.id,{...y,internals:{...y.internals,handleBounds:void 0}}),a=!0;continue}const x=wc(p.nodeElement),k=y.measured.width!==x.width||y.measured.height!==x.height;if(!!(x.width&&x.height&&(k||!y.internals.handleBounds||p.force))){const v=p.nodeElement.getBoundingClientRect(),g=Jn(y.extent)?y.extent:i;let{positionAbsolute:w}=y.internals;if(y.parentId&&y.extent==="parent"){const S=t.get(y.parentId);S&&(w=ag(w,x,S))}else g&&(w=Zn(w,g,x));const N={...y,measured:x,internals:{...y.internals,positionAbsolute:w,handleBounds:{source:gf("source",p.nodeElement,v,f,y.id),target:gf("target",p.nodeElement,v,f,y.id)}}};t.set(y.id,N),y.parentId&&_c(N,t,n,{nodeOrigin:o,zIndexMode:s}),a=!0,k&&(u.push({id:y.id,type:"dimensions",dimensions:x}),y.expandParent&&y.parentId&&d.push({id:y.id,parentId:y.parentId,rect:Qo(N,o)}))}}if(d.length>0){const p=Cc(d,t,n,o);u.push(...p)}return{changes:u,updatedInternals:a}}async function dE({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 Ef(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 Eg(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}`;Ef("source",a,c,e,o,s),Ef("target",a,u,e,i,l),t.set(r.id,r)}}function Ng(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Ng(n,t):!1}function Nf(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 fE(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!Ng(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 ea({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,l,a;const o=[];for(const[u,c]of t){const f=(s=n.get(u))==null?void 0:s.internals.userNode;f&&o.push({...f,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 hE({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=ui(i,t);return{x:s.x-i.x,y:s.y-i.y}}function pE({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,f=!1,d=null,p=!1,y=!1,x=null;function k({noDragClassName:v,handleSelector:g,domNode:w,isSelectable:N,nodeId:S,nodeClickDistance:_=0}){d=Xe(w);function C({x:H,y:F}){const{nodeLookup:E,nodeExtent:L,snapGrid:M,snapToGrid:T,nodeOrigin:P,onNodeDrag:$,onSelectionDrag:z,onError:j,updateNodePositions:A}=t();i={x:H,y:F};let V=!1;const U=l.size>1,G=U&&L?lu(ai(l)):null,B=U&&T?hE({dragItems:l,snapGrid:M,x:H,y:F}):null;for(const[X,O]of l){if(!E.has(X))continue;let Y={x:H-O.distance.x,y:F-O.distance.y};T&&(Y=B?{x:Math.round(Y.x+B.x),y:Math.round(Y.y+B.y)}:ui(Y,M));let q=null;if(U&&L&&!O.extent&&G){const{positionAbsolute:ee}=O.internals,te=ee.x-G.x+L[0][0],ne=ee.x+O.measured.width-G.x2+L[1][0],re=ee.y-G.y+L[0][1],se=ee.y+O.measured.height-G.y2+L[1][1];q=[[te,re],[ne,se]]}const{position:J,positionAbsolute:Q}=lg({nodeId:X,nextPosition:Y,nodeLookup:E,nodeExtent:q||L,nodeOrigin:P,onError:j});V=V||O.position.x!==J.x||O.position.y!==J.y,O.position=J,O.internals.positionAbsolute=Q}if(y=y||V,!!V&&(A(l,!0),x&&(r||$||!S&&z))){const[X,O]=ea({nodeId:S,dragItems:l,nodeLookup:E});r==null||r(x,l,X,O),$==null||$(x,X,O),S||z==null||z(x,O)}}async function I(){if(!c)return;const{transform:H,panBy:F,autoPanSpeed:E,autoPanOnNodeDrag:L}=t();if(!L){a=!1,cancelAnimationFrame(s);return}const[M,T]=vc(u,c,E);(M!==0||T!==0)&&(i.x=(i.x??0)-M/H[2],i.y=(i.y??0)-T/H[2],await F({x:M,y:T})&&C(i)),s=requestAnimationFrame(I)}function R(H){var U;const{nodeLookup:F,multiSelectionActive:E,nodesDraggable:L,transform:M,snapGrid:T,snapToGrid:P,selectNodesOnDrag:$,onNodeDragStart:z,onSelectionDragStart:j,unselectNodesAndEdges:A}=t();f=!0,(!$||!N)&&!E&&S&&((U=F.get(S))!=null&&U.selected||A()),N&&$&&S&&(e==null||e(S));const V=Eo(H.sourceEvent,{transform:M,snapGrid:T,snapToGrid:P,containerBounds:c});if(i=V,l=fE(F,L,V,S),l.size>0&&(n||z||!S&&j)){const[G,B]=ea({nodeId:S,dragItems:l,nodeLookup:F});n==null||n(H.sourceEvent,l,G,B),z==null||z(H.sourceEvent,G,B),S||j==null||j(H.sourceEvent,B)}}const D=Hm().clickDistance(_).on("start",H=>{const{domNode:F,nodeDragThreshold:E,transform:L,snapGrid:M,snapToGrid:T}=t();c=(F==null?void 0:F.getBoundingClientRect())||null,p=!1,y=!1,x=H.sourceEvent,E===0&&R(H),i=Eo(H.sourceEvent,{transform:L,snapGrid:M,snapToGrid:T,containerBounds:c}),u=yt(H.sourceEvent,c)}).on("drag",H=>{const{autoPanOnNodeDrag:F,transform:E,snapGrid:L,snapToGrid:M,nodeDragThreshold:T,nodeLookup:P}=t(),$=Eo(H.sourceEvent,{transform:E,snapGrid:L,snapToGrid:M,containerBounds:c});if(x=H.sourceEvent,(H.sourceEvent.type==="touchmove"&&H.sourceEvent.touches.length>1||S&&!P.has(S))&&(p=!0),!p){if(!a&&F&&f&&(a=!0,I()),!f){const z=yt(H.sourceEvent,c),j=z.x-u.x,A=z.y-u.y;Math.sqrt(j*j+A*A)>T&&R(H)}(i.x!==$.xSnapped||i.y!==$.ySnapped)&&l&&f&&(u=yt(H.sourceEvent,c),C($))}}).on("end",H=>{if(!f||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(a=!1,f=!1,cancelAnimationFrame(s),l.size>0){const{nodeLookup:F,updateNodePositions:E,onNodeDragStop:L,onSelectionDragStop:M}=t();if(y&&(E(l,!1),y=!1),o||L||!S&&M){const[T,P]=ea({nodeId:S,dragItems:l,nodeLookup:F,dragging:!1});o==null||o(H.sourceEvent,l,T,P),L==null||L(H.sourceEvent,T,P),S||M==null||M(H.sourceEvent,P)}}}).filter(H=>{const F=H.target;return!H.button&&(!v||!Nf(F,`.${v}`,w))&&(!g||Nf(F,g,w))});d.call(D)}function m(){d==null||d.on(".drag",null)}return{update:k,destroy:m}}function mE(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())Ds(o,Qo(i))>0&&r.push(i);return r}const gE=250;function yE(e,t,n,r){var l,a;let o=[],i=1/0;const s=mE(e,n,t+gE);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 f of c){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:d,y:p}=er(u,f,f.position,!0),y=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(p-e.y,2));y>t||(y<i?(o=[{...f,x:d,y:p}],i=y):y===i&&o.push({...f,x:d,y:p}))}}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 _g(e,t,n,r,o,i=!1){var u,c,f;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)??[],...((f=s.internals.handleBounds)==null?void 0:f.target)??[]],a=(n?l==null?void 0:l.find(d=>d.id===n):l==null?void 0:l[0])??null;return a&&i?{...a,...er(s,a,a.position,!0)}:a}function Cg(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function vE(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const jg=()=>!0;function xE(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:s,domNode:l,nodeLookup:a,lib:u,autoPanOnConnect:c,flowId:f,panBy:d,cancelConnection:p,onConnectStart:y,onConnect:x,onConnectEnd:k,isValidConnection:m=jg,onReconnectEnd:v,updateConnection:g,getTransform:w,getFromHandle:N,autoPanSpeed:S,dragThreshold:_=1,handleDomNode:C}){const I=mg(e.target);let R=0,D;const{x:H,y:F}=yt(e),E=Cg(i,C),L=l==null?void 0:l.getBoundingClientRect();let M=!1;if(!L||!E)return;const T=_g(o,E,r,a,t);if(!T)return;let P=yt(e,L),$=!1,z=null,j=!1,A=null;function V(){if(!c||!L)return;const[J,Q]=vc(P,L,S);d({x:J,y:Q}),R=requestAnimationFrame(V)}const U={...T,nodeId:o,type:E,position:T.position},G=a.get(o);let X={inProgress:!0,isValid:null,from:er(G,U,Z.Left,!0),fromHandle:U,fromPosition:U.position,fromNode:G,to:P,toHandle:null,toPosition:ff[U.position],toNode:null,pointer:P};function O(){M=!0,g(X),y==null||y(e,{nodeId:o,handleId:r,handleType:E})}_===0&&O();function Y(J){if(!M){const{x:se,y:Ne}=yt(J),ze=se-H,et=Ne-F;if(!(ze*ze+et*et>_*_))return;O()}if(!N()||!U){q(J);return}const Q=w();P=yt(J,L),D=yE(ci(P,Q,!1,[1,1]),n,a,U),$||(V(),$=!0);const ee=Mg(J,{handle:D,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:m,doc:I,lib:u,flowId:f,nodeLookup:a});A=ee.handleDomNode,z=ee.connection,j=vE(!!D,ee.isValid);const te=a.get(o),ne=te?er(te,U,Z.Left,!0):X.from,re={...X,from:ne,isValid:j,to:ee.toHandle&&j?Hr({x:ee.toHandle.x,y:ee.toHandle.y},Q):P,toHandle:ee.toHandle,toPosition:j&&ee.toHandle?ee.toHandle.position:ff[U.position],toNode:ee.toHandle?a.get(ee.toHandle.nodeId):null,pointer:P};g(re),X=re}function q(J){if(!("touches"in J&&J.touches.length>0)){if(M){(D||A)&&z&&j&&(x==null||x(z));const{inProgress:Q,...ee}=X,te={...ee,toPosition:X.toHandle?X.toPosition:null};k==null||k(J,te),i&&(v==null||v(J,te))}p(),cancelAnimationFrame(R),$=!1,j=!1,z=null,A=null,I.removeEventListener("mousemove",Y),I.removeEventListener("mouseup",q),I.removeEventListener("touchmove",Y),I.removeEventListener("touchend",q)}}I.addEventListener("mousemove",Y),I.addEventListener("mouseup",q),I.addEventListener("touchmove",Y),I.addEventListener("touchend",q)}function Mg(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:l,flowId:a,isValidConnection:u=jg,nodeLookup:c}){const f=i==="target",d=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:p,y}=yt(e),x=s.elementFromPoint(p,y),k=x!=null&&x.classList.contains(`${l}-flow__handle`)?x:d,m={handleDomNode:k,isValid:!1,connection:null,toHandle:null};if(k){const v=Cg(void 0,k),g=k.getAttribute("data-nodeid"),w=k.getAttribute("data-handleid"),N=k.classList.contains("connectable"),S=k.classList.contains("connectableend");if(!g||!v)return m;const _={source:f?g:r,sourceHandle:f?w:o,target:f?r:g,targetHandle:f?o:w};m.connection=_;const I=N&&S&&(n===Or.Strict?f&&v==="source"||!f&&v==="target":g!==r||w!==o);m.isValid=I&&u(_),m.toHandle=_g(g,v,w,c,n,!0)}return m}const cu={onPointerDown:xE,isValid:Mg};function wE({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=Xe(e);function i({translateExtent:l,width:a,height:u,zoomStep:c=1,pannable:f=!0,zoomable:d=!0,inversePan:p=!1}){const y=g=>{if(g.sourceEvent.type!=="wheel"||!t)return;const w=n(),N=g.sourceEvent.ctrlKey&&Go()?10:1,S=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*c,_=w[2]*Math.pow(2,S*N);t.scaleTo(_)};let x=[0,0];const k=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(x=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},m=g=>{const w=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;const N=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],S=[N[0]-x[0],N[1]-x[1]];x=N;const _=r()*Math.max(w[2],Math.log(w[2]))*(p?-1:1),C={x:w[0]-S[0]*_,y:w[1]-S[1]*_},I=[[0,0],[a,u]];t.setViewportConstrained({x:C.x,y:C.y,zoom:w[2]},I,l)},v=ng().on("start",k).on("zoom",f?m:null).on("zoom.wheel",d?y:null);o.call(v,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:ft}}const hl=e=>({x:e.x,y:e.y,zoom:e.k}),ta=({x:e,y:t,zoom:n})=>cl.translate(e,t).scale(n),nn=(e,t)=>e.target.closest(`.${t}`),$g=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),kE=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,na=(e,t=0,n=kE,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},Pg=e=>{const t=e.ctrlKey&&Go()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function SE({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:u}){return c=>{if(nn(c,t))return c.ctrlKey&&c.preventDefault(),!1;c.preventDefault(),c.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(c.ctrlKey&&s){const k=ft(c),m=Pg(c),v=f*Math.pow(2,m);r.scaleTo(n,v,k,c);return}const d=c.deltaMode===1?20:1;let p=o===Hn.Vertical?0:c.deltaX*d,y=o===Hn.Horizontal?0:c.deltaY*d;!Go()&&c.shiftKey&&o!==Hn.Vertical&&(p=c.deltaY*d,y=0),r.translateBy(n,-(p/f)*i,-(y/f)*i,{internal:!0});const x=hl(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?a==null||a(c,x):(e.isPanScrolling=!0,l==null||l(c,x)),e.panScrollTimeout=setTimeout(()=>{u==null||u(c,x),e.isPanScrolling=!1},150)}}function EE({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,l=nn(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),s||l)return null;r.preventDefault(),n.call(this,r,o)}}function NE({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,l;if((i=r.sourceEvent)!=null&&i.internal)return;const o=hl(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 _E({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var s,l;e.usedRightMouseButton=!!(n&&$g(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,hl(i.transform)))}}function CE({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&&$g(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const a=hl(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,a)},n?150:0)}}}function jE({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:o,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:l,noWheelClassName:a,noPanClassName:u,lib:c,connectionInProgress:f}){return d=>{var m;const p=t||n,y=r&&d.ctrlKey,x=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(nn(d,`${c}-flow__node`)||nn(d,`${c}-flow__edge`)||nn(d,`${c}-flow__selection`)||nn(d,`${c}-flow__nodesselection`)))return!0;if(!o&&!p&&!i&&!s&&!r||l||f&&!x||nn(d,a)&&x||nn(d,u)&&(!x||i&&x&&!t)||!r&&d.ctrlKey&&x)return!1;if(!r&&d.type==="touchstart"&&((m=d.touches)==null?void 0:m.length)>1)return d.preventDefault(),!1;if(!p&&!i&&!y&&x||!o&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(o)&&!o.includes(d.button)&&d.type==="mousedown")return!1;const k=Array.isArray(o)&&o.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||x||e)&&k}}function ME({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 f=[[0,0],[c.width,c.height]];const d=typeof ResizeObserver<"u"?new ResizeObserver(F=>{const E=F[0];E&&(f=[[0,0],[E.contentRect.width,E.contentRect.height]])}):null;d==null||d.observe(e);const p=ng().extent(()=>f).scaleExtent([t,n]).translateExtent(r),y=Xe(e).call(p);w({x:o.x,y:o.y,zoom:Fr(o.zoom,t,n)},[[0,0],[c.width,c.height]],r);const x=y.on("wheel.zoom"),k=y.on("dblclick.zoom");p.wheelDelta(Pg);async function m(F,E){return y?new Promise(L=>{p==null||p.interpolate((E==null?void 0:E.interpolate)==="linear"?So:ts).transform(na(y,E==null?void 0:E.duration,E==null?void 0:E.ease,()=>L(!0)),F)}):!1}function v({noWheelClassName:F,noPanClassName:E,onPaneContextMenu:L,userSelectionActive:M,panOnScroll:T,panOnDrag:P,panOnScrollMode:$,panOnScrollSpeed:z,preventScrolling:j,zoomOnPinch:A,zoomOnScroll:V,zoomOnDoubleClick:U,panActivationKeyPressed:G=!1,zoomActivationKeyPressed:B,lib:X,onTransformChange:O,connectionInProgress:Y,paneClickDistance:q,selectionOnDrag:J}){M&&!u.isZoomingOrPanning&&g();const Q=T&&!B&&!M;p.clickDistance(J?1/0:!gt(q)||q<0?0:q);const ee=Q?SE({zoomPanValues:u,noWheelClassName:F,d3Selection:y,d3Zoom:p,panOnScrollMode:$,panOnScrollSpeed:z,zoomOnPinch:A,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:l}):EE({noWheelClassName:F,preventScrolling:j,d3ZoomHandler:x});y.on("wheel.zoom",ee,{passive:!1});const te=NE({zoomPanValues:u,onDraggingChange:a,onPanZoomStart:s});p.on("start",te);const ne=_E({zoomPanValues:u,panOnDrag:P,onPaneContextMenu:!!L,onPanZoom:i,onTransformChange:O});p.on("zoom",ne);const re=CE({zoomPanValues:u,panOnDrag:P,panOnScroll:T,onPaneContextMenu:L,onPanZoomEnd:l,onDraggingChange:a});p.on("end",re);const se=jE({panActivationKeyPressed:G,zoomActivationKeyPressed:B,panOnDrag:P,zoomOnScroll:V,panOnScroll:T,zoomOnDoubleClick:U,zoomOnPinch:A,userSelectionActive:M,noPanClassName:E,noWheelClassName:F,lib:X,connectionInProgress:Y});p.filter(se),U?y.on("dblclick.zoom",k):y.on("dblclick.zoom",null)}function g(){p.on("zoom",null)}async function w(F,E,L){const M=ta(F),T=p==null?void 0:p.constrain()(M,E,L);return T&&await m(T),T}async function N(F,E){const L=ta(F);return await m(L,E),L}function S(F){if(y){const E=ta(F),L=y.property("__zoom");(L.k!==F.zoom||L.x!==F.x||L.y!==F.y)&&(p==null||p.transform(y,E,null,{sync:!0}))}}function _(){const F=y?tg(y.node()):{x:0,y:0,k:1};return{x:F.x,y:F.y,zoom:F.k}}async function C(F,E){return y?new Promise(L=>{p==null||p.interpolate((E==null?void 0:E.interpolate)==="linear"?So:ts).scaleTo(na(y,E==null?void 0:E.duration,E==null?void 0:E.ease,()=>L(!0)),F)}):!1}async function I(F,E){return y?new Promise(L=>{p==null||p.interpolate((E==null?void 0:E.interpolate)==="linear"?So:ts).scaleBy(na(y,E==null?void 0:E.duration,E==null?void 0:E.ease,()=>L(!0)),F)}):!1}function R(F){p==null||p.scaleExtent(F)}function D(F){p==null||p.translateExtent(F)}function H(F){const E=!gt(F)||F<0?0:F;p==null||p.clickDistance(E)}return{update:v,destroy:g,setViewport:N,setViewportConstrained:w,getViewport:_,scaleTo:C,scaleBy:I,setScaleExtent:R,setTranslateExtent:D,syncViewport:S,setClickDistance:H}}var Br;(function(e){e.Line="line",e.Handle="handle"})(Br||(Br={}));function $E({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 _f(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 Zt(e,t){return Math.max(0,t-e)}function Jt(e,t){return Math.max(0,e-t)}function Di(e,t,n){return Math.max(0,t-e,e-n)}function Cf(e,t){return e?!t:t}function PE(e,t,n,r,o,i,s,l){let{affectsX:a,affectsY:u}=t;const{isHorizontal:c,isVertical:f}=t,d=c&&f,{xSnapped:p,ySnapped:y}=n,{minWidth:x,maxWidth:k,minHeight:m,maxHeight:v}=r,{x:g,y:w,width:N,height:S,aspectRatio:_}=e;let C=Math.floor(c?p-e.pointerX:0),I=Math.floor(f?y-e.pointerY:0);const R=N+(a?-C:C),D=S+(u?-I:I),H=-i[0]*N,F=-i[1]*S;let E=Di(R,x,k),L=Di(D,m,v);if(s){let P=0,$=0;a&&C<0?P=Zt(g+C+H,s[0][0]):!a&&C>0&&(P=Jt(g+R+H,s[1][0])),u&&I<0?$=Zt(w+I+F,s[0][1]):!u&&I>0&&($=Jt(w+D+F,s[1][1])),E=Math.max(E,P),L=Math.max(L,$)}if(l){let P=0,$=0;a&&C>0?P=Jt(g+C,l[0][0]):!a&&C<0&&(P=Zt(g+R,l[1][0])),u&&I>0?$=Jt(w+I,l[0][1]):!u&&I<0&&($=Zt(w+D,l[1][1])),E=Math.max(E,P),L=Math.max(L,$)}if(o){if(c){const P=Di(R/_,m,v)*_;if(E=Math.max(E,P),s){let $=0;!a&&!u||a&&!u&&d?$=Jt(w+F+R/_,s[1][1])*_:$=Zt(w+F+(a?C:-C)/_,s[0][1])*_,E=Math.max(E,$)}if(l){let $=0;!a&&!u||a&&!u&&d?$=Zt(w+R/_,l[1][1])*_:$=Jt(w+(a?C:-C)/_,l[0][1])*_,E=Math.max(E,$)}}if(f){const P=Di(D*_,x,k)/_;if(L=Math.max(L,P),s){let $=0;!a&&!u||u&&!a&&d?$=Jt(g+D*_+H,s[1][0])/_:$=Zt(g+(u?I:-I)*_+H,s[0][0])/_,L=Math.max(L,$)}if(l){let $=0;!a&&!u||u&&!a&&d?$=Zt(g+D*_,l[1][0])/_:$=Jt(g+(u?I:-I)*_,l[0][0])/_,L=Math.max(L,$)}}}I=I+(I<0?L:-L),C=C+(C<0?E:-E),o&&(d?R>D*_?I=(Cf(a,u)?-C:C)/_:C=(Cf(a,u)?-I:I)*_:c?(I=C/_,u=a):(C=I*_,a=u));const M=a?g+C:g,T=u?w+I:w;return{width:N+(a?-C:C),height:S+(u?-I:I),x:i[0]*C*(a?-1:1)+M,y:i[1]*I*(u?-1:1)+T}}const Ig={width:0,height:0,x:0,y:0},IE={...Ig,pointerX:0,pointerY:0,aspectRatio:1};function TE(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 bE({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const i=Xe(e);let s={controlDirection:_f("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:f,resizeDirection:d,onResizeStart:p,onResize:y,onResizeEnd:x,shouldResize:k}){let m={...Ig},v={...IE};s={boundaries:c,resizeDirection:d,keepAspectRatio:f,controlDirection:_f(u)};let g,w=null,N=[],S,_,C;const I=Hm().on("start",R=>{const{nodeLookup:D,transform:H,snapGrid:F,snapToGrid:E,nodeOrigin:L,paneDomNode:M}=n();if(g=D.get(t),!g)return;w=(M==null?void 0:M.getBoundingClientRect())??null;const{xSnapped:T,ySnapped:P}=Eo(R.sourceEvent,{transform:H,snapGrid:F,snapToGrid:E,containerBounds:w});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},v={...m,pointerX:T,pointerY:P,aspectRatio:m.width/m.height},S=void 0,_=Jn(g.extent)?g.extent:void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(S=D.get(g.parentId)),S&&g.extent==="parent"&&(_=[[0,0],[S.measured.width,S.measured.height]]),N=[],C=void 0;for(const[$,z]of D)if(z.parentId===t&&(N.push({id:$,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const j=TE(z,g,z.origin??L);C?C=[[Math.min(j[0][0],C[0][0]),Math.min(j[0][1],C[0][1])],[Math.max(j[1][0],C[1][0]),Math.max(j[1][1],C[1][1])]]:C=j}p==null||p(R,{...m})}).on("drag",R=>{const{transform:D,snapGrid:H,snapToGrid:F,nodeOrigin:E}=n(),L=Eo(R.sourceEvent,{transform:D,snapGrid:H,snapToGrid:F,containerBounds:w}),M=[];if(!g)return;const{x:T,y:P,width:$,height:z}=m,j={},A=g.origin??E,{width:V,height:U,x:G,y:B}=PE(v,s.controlDirection,L,s.boundaries,s.keepAspectRatio,A,_,C),X=V!==$,O=U!==z,Y=G!==T&&X,q=B!==P&&O;if(!Y&&!q&&!X&&!O)return;const J={prevValues:{...m},startX:v.x,startY:v.y,childNodes:N.map(ne=>({...ne,position:{...ne.position}}))};if((Y||q||A[0]===1||A[1]===1)&&(j.x=Y?G:m.x,j.y=q?B:m.y,m.x=j.x,m.y=j.y,N.length>0)){const ne=G-T,re=B-P;for(const se of N)se.position={x:se.position.x-ne+A[0]*(V-$),y:se.position.y-re+A[1]*(U-z)},M.push(se)}if((X||O)&&(j.width=X&&(!s.resizeDirection||s.resizeDirection==="horizontal")?V:m.width,j.height=O&&(!s.resizeDirection||s.resizeDirection==="vertical")?U:m.height,m.width=j.width,m.height=j.height),S&&g.expandParent){const ne=A[0]*(j.width??0);j.x&&j.x<ne&&(m.x=ne,v.x=v.x-(j.x-ne));const re=A[1]*(j.height??0);j.y&&j.y<re&&(m.y=re,v.y=v.y-(j.y-re))}const Q=$E({width:m.width,prevWidth:$,height:m.height,prevHeight:z,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),ee={...m,direction:Q};if((k==null?void 0:k(R,ee))===!1){m=J.prevValues,v.x=J.startX,v.y=J.startY,N.forEach((ne,re)=>{ne.position=J.childNodes[re].position});return}y==null||y(R,ee),r(j,M)}).on("end",R=>{x==null||x(R,{...m}),o==null||o({...m})});i.call(I)}function a(){i.on(".drag",null)}return{update:l,destroy:a}}var Tg={exports:{}},bg={},zg={exports:{}},Lg={};/**
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 Vr=b;function zE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var LE=typeof Object.is=="function"?Object.is:zE,AE=Vr.useState,RE=Vr.useEffect,DE=Vr.useLayoutEffect,OE=Vr.useDebugValue;function FE(e,t){var n=t(),r=AE({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return DE(function(){o.value=n,o.getSnapshot=t,ra(o)&&i({inst:o})},[e,n,t]),RE(function(){return ra(o)&&i({inst:o}),e(function(){ra(o)&&i({inst:o})})},[e]),OE(n),n}function ra(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!LE(e,n)}catch{return!0}}function HE(e,t){return t()}var BE=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?HE:FE;Lg.useSyncExternalStore=Vr.useSyncExternalStore!==void 0?Vr.useSyncExternalStore:BE;zg.exports=Lg;var VE=zg.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 pl=b,WE=VE;function UE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var YE=typeof Object.is=="function"?Object.is:UE,XE=WE.useSyncExternalStore,KE=pl.useRef,QE=pl.useEffect,GE=pl.useMemo,qE=pl.useDebugValue;bg.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=KE(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=GE(function(){function a(p){if(!u){if(u=!0,c=p,p=r(p),o!==void 0&&s.hasValue){var y=s.value;if(o(y,p))return f=y}return f=p}if(y=f,YE(c,p))return y;var x=r(p);return o!==void 0&&o(y,x)?(c=p,y):(c=p,f=x)}var u=!1,c,f,d=n===void 0?null:n;return[function(){return a(t())},d===null?void 0:function(){return a(d())}]},[t,n,r,o]);var l=XE(e,i[0],i[1]);return QE(function(){s.hasValue=!0,s.value=l},[l]),qE(l),l};Tg.exports=bg;var ZE=Tg.exports;const JE=fh(ZE),eN={},jf=e=>{let t;const n=new Set,r=(c,f)=>{const d=typeof c=="function"?c(t):c;if(!Object.is(d,t)){const p=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(y=>y(t,p))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(eN?"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},tN=e=>e?jf(e):jf,{useDebugValue:nN}=Xy,{useSyncExternalStoreWithSelector:rN}=JE,oN=e=>e;function Ag(e,t=oN,n){const r=rN(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return nN(r),r}const Mf=(e,t)=>{const n=tN(e),r=(o,i=t)=>Ag(n,o,i);return Object.assign(r,n),r},iN=(e,t)=>e?Mf(e,t):Mf;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 ml=b.createContext(null),sN=ml.Provider,Rg=kt.error001("react");function ie(e,t){const n=b.useContext(ml);if(n===null)throw new Error(Rg);return Ag(n,e,t)}function fe(){const e=b.useContext(ml);if(e===null)throw new Error(Rg);return b.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const $f={display:"none"},lN={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Dg="react-flow__node-desc",Og="react-flow__edge-desc",aN="react-flow__aria-live",uN=e=>e.ariaLiveMessage,cN=e=>e.ariaLabelConfig;function dN({rfId:e}){const t=ie(uN);return h.jsx("div",{id:`${aN}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:lN,children:t})}function fN({rfId:e,disableKeyboardA11y:t}){const n=ie(cN);return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:`${Dg}-${e}`,style:$f,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),h.jsx("div",{id:`${Og}-${e}`,style:$f,children:n["edge.a11yDescription.default"]}),!t&&h.jsx(dN,{rfId:e})]})}const di=b.forwardRef(({position:e="top-left",children:t,className:n,style:r,...o},i)=>{const s=`${e}`.split("-");return h.jsx("div",{className:ke(["react-flow__panel",n,...s]),style:r,ref:i,...o,children:t})});di.displayName="Panel";const Pf="https://reactflow.dev?utm_source=attribution";function hN({proOptions:e,position:t="bottom-right"}){return b.useEffect(()=>{},[]),e!=null&&e.hideAttribution?null:h.jsx(di,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Pf}`,children:h.jsx("a",{href:Pf,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const pN=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}},Oi=e=>e.id;function mN(e,t){return ye(e.selectedNodes.map(Oi),t.selectedNodes.map(Oi))&&ye(e.selectedEdges.map(Oi),t.selectedEdges.map(Oi))}function gN({onSelectionChange:e}){const t=fe(),{selectedNodes:n,selectedEdges:r}=ie(pN,mN);return b.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(i=>i(o))},[n,r,e]),null}const yN=e=>!!e.onSelectionChangeHandlers;function vN({onSelectionChange:e}){const t=ie(yN);return e||t?h.jsx(gN,{onSelectionChange:e}):null}const Fg=[0,0],xN={x:0,y:0,zoom:1},wN=["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"],If=[...wN,"rfId"],kN=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}),Tf={translateExtent:Yo,nodeOrigin:Fg,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function SN(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:i,setNodeExtent:s,reset:l,setDefaultNodesAndEdges:a}=ie(kN,ye),u=fe();b.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{c.current=Tf,l()}),[]);const c=b.useRef(Tf);return b.useEffect(()=>{for(const f of If){const d=e[f],p=c.current[f];d!==p&&(typeof e[f]>"u"||(f==="nodes"?t(d):f==="edges"?n(d):f==="minZoom"?r(d):f==="maxZoom"?o(d):f==="translateExtent"?i(d):f==="nodeExtent"?s(d):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:YS(d)}):f==="fitView"?u.setState({fitViewQueued:d}):f==="fitViewOptions"?u.setState({fitViewOptions:d}):u.setState({[f]:d})))}c.current=e},If.map(f=>e[f])),null}function bf(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function EN(e){var r;const[t,n]=b.useState(e==="system"?null:e);return b.useEffect(()=>{if(e!=="system"){n(e);return}const o=bf(),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=bf())!=null&&r.matches?"dark":"light"}const zf=typeof document<"u"?document:null;function qo(e=null,t={target:zf,actInsideInputWithModifier:!0}){const[n,r]=b.useState(!1),o=b.useRef(!1),i=b.useRef(new Set([])),[s,l]=b.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace(/\+/g,`
57
- `).replace(`
58
-
59
- `,`
60
- +`).split(`
61
- `)),c=u.reduce((f,d)=>f.concat(...d),[]);return[u,c]}return[[],[]]},[e]);return b.useEffect(()=>{const a=(t==null?void 0:t.target)??zf,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const c=p=>{var k,m;if(o.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!o.current||o.current&&!u)&&gg(p))return!1;const x=Af(p.code,l);if(i.current.add(p[x]),Lf(s,i.current,!1)){const v=((m=(k=p.composedPath)==null?void 0:k.call(p))==null?void 0:m[0])||p.target,g=(v==null?void 0:v.nodeName)==="BUTTON"||(v==null?void 0:v.nodeName)==="A";t.preventDefault!==!1&&(o.current||!g)&&p.preventDefault(),r(!0)}},f=p=>{const y=Af(p.code,l);Lf(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(p[y]),p.key==="Meta"&&i.current.clear(),o.current=!1},d=()=>{i.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",c),a==null||a.addEventListener("keyup",f),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{a==null||a.removeEventListener("keydown",c),a==null||a.removeEventListener("keyup",f),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[e,r]),n}function Lf(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function Af(e,t){return t.includes(e)?"code":"key"}const NN=()=>{const e=fe();return b.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=xc(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,f=n.snapToGrid??i;return ci(u,r,f,c)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:i}=r.getBoundingClientRect(),s=Hr(t,n);return{x:s.x+o,y:s.y+i}}}),[])};function Hg(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)_N(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 _N(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 CN(e,t){return Hg(e,t)}function jN(e,t){return Hg(e,t)}function In(e,t){return{id:e,type:"select",selected:t}}function kr(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(In(i.id,s)))}return r}function Rf({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 Df(e){return{id:e.id,type:"remove"}}const MN=dg();function $N(e,t,n={}){return ZS(e,t,{...n,onError:n.onError??MN})}const Of=e=>RS(e),PN=e=>sg(e);function Bg(e){return b.forwardRef(e)}const Vg=typeof window<"u"?b.useLayoutEffect:b.useEffect;function Ff(e){const[t,n]=b.useState(BigInt(0)),[r]=b.useState(()=>IN(()=>n(o=>o+BigInt(1))));return Vg(()=>{const o=r.get();o.length&&(e(o),r.reset())},[t]),r}function IN(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Wg=b.createContext(null);function TN({children:e}){const t=fe(),n=b.useCallback(l=>{const{nodes:a=[],setNodes:u,hasDefaultNodes:c,onNodesChange:f,nodeLookup:d,fitViewQueued:p,onNodesChangeMiddlewareMap:y}=t.getState();let x=a;for(const m of l)x=typeof m=="function"?m(x):m;let k=Rf({items:x,lookup:d});for(const m of y.values())k=m(k);c&&u(x),k.length>0?f==null||f(k):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:m,nodes:v,setNodes:g}=t.getState();m&&g(v)})},[]),r=Ff(n),o=b.useCallback(l=>{const{edges:a=[],setEdges:u,hasDefaultEdges:c,onEdgesChange:f,edgeLookup:d}=t.getState();let p=a;for(const y of l)p=typeof y=="function"?y(p):y;c?u(p):f&&f(Rf({items:p,lookup:d}))},[]),i=Ff(o),s=b.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return h.jsx(Wg.Provider,{value:s,children:e})}function bN(){const e=b.useContext(Wg);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const zN=e=>!!e.panZoom;function gl(){const e=NN(),t=fe(),n=bN(),r=ie(zN),o=b.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),s=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},a=f=>{var m,v;const{nodeLookup:d,nodeOrigin:p}=t.getState(),y=Of(f)?f:d.get(f.id),x=y.parentId?hg(y.position,y.measured,y.parentId,d,p):y.position,k={...y,position:x,width:((m=y.measured)==null?void 0:m.width)??y.width,height:((v=y.measured)==null?void 0:v.height)??y.height};return Qo(k)},u=(f,d,p={replace:!1})=>{s(y=>y.map(x=>{if(x.id===f){const k=typeof d=="function"?d(x):d;return p.replace&&Of(k)?k:{...x,...k}}return x}))},c=(f,d,p={replace:!1})=>{l(y=>y.map(x=>{if(x.id===f){const k=typeof d=="function"?d(x):d;return p.replace&&PN(k)?k:{...x,...k}}return x}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var d;return(d=i(f))==null?void 0:d.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(d=>({...d}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:s,setEdges:l,addNodes:f=>{const d=Array.isArray(f)?f:[f];n.nodeQueue.push(p=>[...p,...d])},addEdges:f=>{const d=Array.isArray(f)?f:[f];n.edgeQueue.push(p=>[...p,...d])},toObject:()=>{const{nodes:f=[],edges:d=[],transform:p}=t.getState(),[y,x,k]=p;return{nodes:f.map(m=>({...m})),edges:d.map(m=>({...m})),viewport:{x:y,y:x,zoom:k}}},deleteElements:async({nodes:f=[],edges:d=[]})=>{const{nodes:p,edges:y,onNodesDelete:x,onEdgesDelete:k,triggerNodeChanges:m,triggerEdgeChanges:v,onDelete:g,onBeforeDelete:w}=t.getState(),{nodes:N,edges:S}=await BS({nodesToRemove:f,edgesToRemove:d,nodes:p,edges:y,onBeforeDelete:w}),_=S.length>0,C=N.length>0;if(_){const I=S.map(Df);k==null||k(S),v(I)}if(C){const I=N.map(Df);x==null||x(N),m(I)}return(C||_)&&(g==null||g({nodes:N,edges:S})),{deletedNodes:N,deletedEdges:S}},getIntersectingNodes:(f,d=!0,p)=>{const y=pf(f),x=y?f:a(f),k=p!==void 0;return x?(p||t.getState().nodes).filter(m=>{const v=t.getState().nodeLookup.get(m.id);if(v&&!y&&(m.id===f.id||!v.internals.positionAbsolute))return!1;const g=Qo(k?m:v),w=Ds(g,x);return d&&w>0||w>=g.width*g.height||w>=x.width*x.height}):[]},isNodeIntersecting:(f,d,p=!0)=>{const x=pf(f)?f:a(f);if(!x)return!1;const k=Ds(x,d);return p&&k>0||k>=d.width*d.height||k>=x.width*x.height},updateNode:u,updateNodeData:(f,d,p={replace:!1})=>{u(f,y=>{const x=typeof d=="function"?d(y):d;return p.replace?{...y,data:x}:{...y,data:{...y.data,...x}}},p)},updateEdge:c,updateEdgeData:(f,d,p={replace:!1})=>{c(f,y=>{const x=typeof d=="function"?d(y):d;return p.replace?{...y,data:x}:{...y,data:{...y.data,...x}}},p)},getNodesBounds:f=>{const{nodeLookup:d,nodeOrigin:p}=t.getState();return DS(f,{nodeLookup:d,nodeOrigin:p})},getHandleConnections:({type:f,id:d,nodeId:p})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${p}-${f}${d?`-${d}`:""}`))==null?void 0:y.values())??[])},getNodeConnections:({type:f,handleId:d,nodeId:p})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${p}${f?d?`-${f}-${d}`:`-${f}`:""}`))==null?void 0:y.values())??[])},fitView:async f=>{const d=t.getState().fitViewResolver??US();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:d}),n.nodeQueue.push(p=>[...p]),d.promise}}},[]);return b.useMemo(()=>({...o,...e,viewportInitialized:r}),[r])}const Hf=e=>e.selected,LN=typeof window<"u"?window:void 0;function AN({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=fe(),{deleteElements:r}=gl(),o=qo(e,{actInsideInputWithModifier:!1}),i=qo(t,{target:LN});b.useEffect(()=>{if(o){const{edges:s,nodes:l}=n.getState();r({nodes:l.filter(Hf),edges:s.filter(Hf)}),n.setState({nodesSelectionActive:!1})}},[o]),b.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function RN(e){const t=fe();b.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=wc(e.current);(r.height===0||r.width===0)&&((l=(s=t.getState()).onError)==null||l.call(s,"004",kt.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 yl={position:"absolute",width:"100%",height:"100%",top:0,left:0},DN=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function ON({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:o,panOnScrollSpeed:i=.5,panOnScrollMode:s=Hn.Free,zoomOnDoubleClick:l=!0,panOnDrag:a=!0,defaultViewport:u,translateExtent:c,minZoom:f,maxZoom:d,zoomActivationKeyCode:p,preventScrolling:y=!0,children:x,noWheelClassName:k,noPanClassName:m,onViewportChange:v,isControlledViewport:g,paneClickDistance:w,selectionOnDrag:N}){const S=fe(),_=b.useRef(null),{userSelectionActive:C,lib:I,connectionInProgress:R}=ie(DN,ye),D=qo(p),H=b.useRef();RN(_);const F=b.useCallback(E=>{v==null||v({x:E[0],y:E[1],zoom:E[2]}),g||S.setState({transform:E})},[v,g]);return b.useEffect(()=>{if(_.current){H.current=ME({domNode:_.current,minZoom:f,maxZoom:d,translateExtent:c,viewport:u,onDraggingChange:T=>S.setState(P=>P.paneDragging===T?P:{paneDragging:T}),onPanZoomStart:(T,P)=>{const{onViewportChangeStart:$,onMoveStart:z}=S.getState();z==null||z(T,P),$==null||$(P)},onPanZoom:(T,P)=>{const{onViewportChange:$,onMove:z}=S.getState();z==null||z(T,P),$==null||$(P)},onPanZoomEnd:(T,P)=>{const{onViewportChangeEnd:$,onMoveEnd:z}=S.getState();z==null||z(T,P),$==null||$(P)}});const{x:E,y:L,zoom:M}=H.current.getViewport();return S.setState({panZoom:H.current,transform:[E,L,M],domNode:_.current.closest(".react-flow")}),()=>{var T;(T=H.current)==null||T.destroy()}}},[]),b.useEffect(()=>{var E;(E=H.current)==null||E.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:o,panOnScrollSpeed:i,panOnScrollMode:s,zoomOnDoubleClick:l,panOnDrag:a,zoomActivationKeyPressed:D,preventScrolling:y,noPanClassName:m,userSelectionActive:C,noWheelClassName:k,lib:I,onTransformChange:F,connectionInProgress:R,selectionOnDrag:N,paneClickDistance:w})},[e,t,n,r,o,i,s,l,a,D,y,m,C,k,I,F,R,N,w]),h.jsx("div",{className:"react-flow__renderer",ref:_,style:yl,children:x})}const FN=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function HN(){const{userSelectionActive:e,userSelectionRect:t}=ie(FN,ye);return e&&t?h.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 oa=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},BN=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function VN({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Xo.Full,panOnDrag:r,autoPanOnSelection:o,paneClickDistance:i,selectionOnDrag:s,onSelectionStart:l,onSelectionEnd:a,onPaneClick:u,onPaneContextMenu:c,onPaneScroll:f,onPaneMouseEnter:d,onPaneMouseMove:p,onPaneMouseLeave:y,children:x}){const k=b.useRef(0),m=fe(),{userSelectionActive:v,elementsSelectable:g,dragging:w,panBy:N,autoPanSpeed:S}=ie(BN,ye),_=g&&(e||v),C=b.useRef(null),I=b.useRef(),R=b.useRef(new Set),D=b.useRef(new Set),H=b.useRef(!1),F=b.useRef(!1),E=b.useRef({x:0,y:0}),L=b.useRef(!1),M=O=>{if(F.current||H.current||m.getState().connection.inProgress){F.current=!1,H.current=!1;return}u==null||u(O),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},T=O=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){O.preventDefault();return}c==null||c(O)},P=f?O=>f(O):void 0,$=O=>{F.current&&(O.stopPropagation(),F.current=!1)},z=O=>{var se,Ne;if(O.pointerType==="touch"&&r!==!1&&!t)return;const{domNode:Y,transform:q}=m.getState();if(I.current=Y==null?void 0:Y.getBoundingClientRect(),!I.current)return;const J=O.target===C.current;if(!J&&!!O.target.closest(".nokey")||!e||!(s&&J||t)||O.button!==0||!O.isPrimary)return;(Ne=(se=O.target)==null?void 0:se.setPointerCapture)==null||Ne.call(se,O.pointerId),F.current=!1;const{x:te,y:ne}=yt(O.nativeEvent,I.current),re=ci({x:te,y:ne},q);m.setState({userSelectionRect:{width:0,height:0,startX:re.x,startY:re.y,x:te,y:ne}}),J||(O.stopPropagation(),O.preventDefault())};function j(O,Y){const{userSelectionRect:q}=m.getState();if(!q)return;const{transform:J,nodeLookup:Q,edgeLookup:ee,connectionLookup:te,triggerNodeChanges:ne,triggerEdgeChanges:re,defaultEdgeOptions:se}=m.getState(),Ne={x:q.startX,y:q.startY},{x:ze,y:et}=Hr(Ne,J),bt={startX:Ne.x,startY:Ne.y,x:O<ze?O:ze,y:Y<et?Y:et,width:Math.abs(O-ze),height:Math.abs(Y-et)},Qr=R.current,Cn=D.current;R.current=new Set(yc(Q,bt,J,n===Xo.Partial,!0).map(at=>at.id)),D.current=new Set;const jn=(se==null?void 0:se.selectable)??!0;for(const at of R.current){const zt=te.get(at);if(zt)for(const{edgeId:Lt}of zt.values()){const Mn=ee.get(Lt);Mn&&(Mn.selectable??jn)&&D.current.add(Lt)}}if(!mf(Qr,R.current)){const at=kr(Q,R.current,!0);ne(at)}if(!mf(Cn,D.current)){const at=kr(ee,D.current);re(at)}m.setState({userSelectionRect:bt,userSelectionActive:!0,nodesSelectionActive:!1})}function A(){if(!o||!I.current)return;const[O,Y]=vc(E.current,I.current,S);N({x:O,y:Y}).then(q=>{if(!F.current||!q){k.current=requestAnimationFrame(A);return}const{x:J,y:Q}=E.current;j(J,Q),k.current=requestAnimationFrame(A)})}const V=()=>{cancelAnimationFrame(k.current),k.current=0,L.current=!1};b.useEffect(()=>()=>V(),[]);const U=O=>{const{userSelectionRect:Y,transform:q,resetSelectedElements:J}=m.getState();if(!I.current||!Y)return;const{x:Q,y:ee}=yt(O.nativeEvent,I.current);E.current={x:Q,y:ee};const te=Hr({x:Y.startX,y:Y.startY},q);if(!F.current){const ne=t?0:i;if(Math.hypot(Q-te.x,ee-te.y)<=ne)return;J(),l==null||l(O)}F.current=!0,L.current||(A(),L.current=!0),j(Q,ee)},G=O=>{var Y,q;if(!_){O.target===C.current&&m.getState().connection.inProgress&&(H.current=!0);return}O.button===0&&((q=(Y=O.target)==null?void 0:Y.releasePointerCapture)==null||q.call(Y,O.pointerId),!v&&O.target===C.current&&m.getState().userSelectionRect&&(M==null||M(O)),m.setState({userSelectionActive:!1,userSelectionRect:null}),F.current&&(a==null||a(O),m.setState({nodesSelectionActive:R.current.size>0})),V())},B=O=>{var Y,q;(q=(Y=O.target)==null?void 0:Y.releasePointerCapture)==null||q.call(Y,O.pointerId),V()},X=r===!0||Array.isArray(r)&&r.includes(0);return h.jsxs("div",{className:ke(["react-flow__pane",{draggable:X,dragging:w,selection:e}]),onClick:_?void 0:oa(M,C),onContextMenu:oa(T,C),onWheel:oa(P,C),onPointerEnter:_?void 0:d,onPointerMove:_?U:p,onPointerUp:G,onPointerCancel:_?B:void 0,onPointerDownCapture:_?z:void 0,onClickCapture:_?$:void 0,onPointerLeave:y,ref:C,style:yl,children:[x,h.jsx(HN,{})]})}function du({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",kt.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 Ug({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,nodeClickDistance:s}){const l=fe(),[a,u]=b.useState(!1),c=b.useRef();return b.useEffect(()=>{if(!t)return c.current=pE({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{du({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}}),()=>{var f;(f=c.current)==null||f.destroy(),c.current=void 0}},[t,l,e]),b.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 WN=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Yg(){const e=fe();return b.useCallback(n=>{const{nodeExtent:r,snapToGrid:o,snapGrid:i,nodesDraggable:s,onError:l,updateNodePositions:a,nodeLookup:u,nodeOrigin:c}=e.getState(),f=new Map,d=WN(s),p=o?i[0]:5,y=o?i[1]:5,x=n.direction.x*p*n.factor,k=n.direction.y*y*n.factor;for(const[,m]of u){if(!d(m))continue;let v={x:m.internals.positionAbsolute.x+x,y:m.internals.positionAbsolute.y+k};o&&(v=ui(v,i));const{position:g,positionAbsolute:w}=lg({nodeId:m.id,nextPosition:v,nodeLookup:u,nodeExtent:r,nodeOrigin:c,onError:l});m.position=g,m.internals.positionAbsolute=w,f.set(m.id,m)}a(f)},[])}const jc=b.createContext(null),UN=jc.Provider;jc.Consumer;const Xg=()=>b.useContext(jc),YN=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Kg=b.createContext(null);function XN({children:e}){const t=ie(YN,ye);return h.jsx(Kg.Provider,{value:t,children:e})}function KN(){const e=b.useContext(Kg);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const QN={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},GN=(e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:i,connection:s}=r,{fromHandle:l,toHandle:a,isValid:u}=s;if(!l&&!o)return QN;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===Or.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 qN({type:e="source",position:t=Z.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:l,children:a,className:u,onMouseDown:c,onTouchStart:f,...d},p){var L,M;const y=s||null,x=e==="target",k=fe(),m=Xg(),{connectOnClick:v,noPanClassName:g,rfId:w}=KN(),{connectingFrom:N,connectingTo:S,clickConnecting:_,isPossibleEndHandle:C,connectionInProcess:I,clickConnectionInProcess:R,valid:D}=ie(GN(m,y,e),ye);m||(M=(L=k.getState()).onError)==null||M.call(L,"010",kt.error010());const H=T=>{const{defaultEdgeOptions:P,onConnect:$,hasDefaultEdges:z}=k.getState(),j={...P,...T};if(z){const{edges:A,setEdges:V,onError:U}=k.getState();V($N(j,A,{onError:U}))}$==null||$(j),l==null||l(j)},F=T=>{if(!m)return;const P=yg(T.nativeEvent);if(o&&(P&&T.button===0||!P)){const $=k.getState();cu.onPointerDown(T.nativeEvent,{handleDomNode:T.currentTarget,autoPanOnConnect:$.autoPanOnConnect,connectionMode:$.connectionMode,connectionRadius:$.connectionRadius,domNode:$.domNode,nodeLookup:$.nodeLookup,lib:$.lib,isTarget:x,handleId:y,nodeId:m,flowId:$.rfId,panBy:$.panBy,cancelConnection:$.cancelConnection,onConnectStart:$.onConnectStart,onConnectEnd:(...z)=>{var j,A;return(A=(j=k.getState()).onConnectEnd)==null?void 0:A.call(j,...z)},updateConnection:$.updateConnection,onConnect:H,isValidConnection:n||((...z)=>{var j,A;return((A=(j=k.getState()).isValidConnection)==null?void 0:A.call(j,...z))??!0}),getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,autoPanSpeed:$.autoPanSpeed,dragThreshold:$.connectionDragThreshold})}P?c==null||c(T):f==null||f(T)},E=T=>{const{onClickConnectStart:P,onClickConnectEnd:$,connectionClickStartHandle:z,connectionMode:j,isValidConnection:A,lib:V,rfId:U,nodeLookup:G,connection:B}=k.getState();if(!m||!z&&!o)return;if(!z){P==null||P(T.nativeEvent,{nodeId:m,handleId:y,handleType:e}),k.setState({connectionClickStartHandle:{nodeId:m,type:e,id:y}});return}const X=mg(T.target),O=n||A,{connection:Y,isValid:q}=cu.isValid(T.nativeEvent,{handle:{nodeId:m,id:y,type:e},connectionMode:j,fromNodeId:z.nodeId,fromHandleId:z.id||null,fromType:z.type,isValidConnection:O,flowId:U,doc:X,lib:V,nodeLookup:G});q&&Y&&H(Y);const J=structuredClone(B);delete J.inProgress,J.toPosition=J.toHandle?J.toHandle.position:null,$==null||$(T,J),k.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":y,"data-nodeid":m,"data-handlepos":t,"data-id":`${w}-${m}-${y}-${e}`,className:ke(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,u,{source:!x,target:x,connectable:r,connectablestart:o,connectableend:i,clickconnecting:_,connectingfrom:N,connectingto:S,valid:D,connectionindicator:r&&(!I||C)&&(I||R?i:o)}]),onMouseDown:F,onTouchStart:F,onClick:v?E:void 0,ref:p,...d,children:a})}const Wr=b.memo(Bg(qN));function ZN({data:e,isConnectable:t,sourcePosition:n=Z.Bottom}){return h.jsxs(h.Fragment,{children:[e==null?void 0:e.label,h.jsx(Wr,{type:"source",position:n,isConnectable:t})]})}function JN({data:e,isConnectable:t,targetPosition:n=Z.Top,sourcePosition:r=Z.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(Wr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,h.jsx(Wr,{type:"source",position:r,isConnectable:t})]})}function e_(){return null}function t_({data:e,isConnectable:t,targetPosition:n=Z.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(Wr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Fs={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Bf={input:ZN,default:JN,output:t_,group:e_};function n_(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 r_=e=>{const{width:t,height:n,x:r,y:o}=ai(e.nodeLookup,{filter:i=>!!i.selected});return{width:gt(t)?t:null,height:gt(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 o_({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=fe(),{width:o,height:i,transformString:s,userSelectionActive:l}=ie(r_,ye),a=Yg(),u=b.useRef(null);b.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const c=!l&&o!==null&&i!==null;if(Ug({nodeRef:u,disabled:!c}),!c)return null;const f=e?p=>{const y=r.getState().nodes.filter(x=>x.selected);e(p,y)}:void 0,d=p=>{Object.prototype.hasOwnProperty.call(Fs,p.key)&&(p.preventDefault(),a({direction:Fs[p.key],factor:p.shiftKey?4:1}))};return h.jsx("div",{className:ke(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:h.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:o,height:i}})})}const Vf=typeof window<"u"?window:void 0,i_=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Qg({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:l,deleteKeyCode:a,selectionKeyCode:u,selectionOnDrag:c,selectionMode:f,onSelectionStart:d,onSelectionEnd:p,multiSelectionKeyCode:y,panActivationKeyCode:x,zoomActivationKeyCode:k,elementsSelectable:m,zoomOnScroll:v,zoomOnPinch:g,panOnScroll:w,panOnScrollSpeed:N,panOnScrollMode:S,zoomOnDoubleClick:_,panOnDrag:C,autoPanOnSelection:I,defaultViewport:R,translateExtent:D,minZoom:H,maxZoom:F,preventScrolling:E,onSelectionContextMenu:L,noWheelClassName:M,noPanClassName:T,disableKeyboardA11y:P,onViewportChange:$,isControlledViewport:z}){const{nodesSelectionActive:j,userSelectionActive:A}=ie(i_,ye),V=qo(u,{target:Vf}),U=qo(x,{target:Vf}),G=U||C,B=U||w,X=c&&G!==!0,O=V||A||X;return AN({deleteKeyCode:a,multiSelectionKeyCode:y}),h.jsx(ON,{onPaneContextMenu:i,elementsSelectable:m,zoomOnScroll:v,zoomOnPinch:g,panOnScroll:B,panActivationKeyPressed:U,panOnScrollSpeed:N,panOnScrollMode:S,zoomOnDoubleClick:_,panOnDrag:!V&&G,defaultViewport:R,translateExtent:D,minZoom:H,maxZoom:F,zoomActivationKeyCode:k,preventScrolling:E,noWheelClassName:M,noPanClassName:T,onViewportChange:$,isControlledViewport:z,paneClickDistance:l,selectionOnDrag:X,children:h.jsxs(VN,{onSelectionStart:d,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:G,autoPanOnSelection:I,isSelecting:!!O,selectionMode:f,selectionKeyPressed:V,paneClickDistance:l,selectionOnDrag:X,children:[e,j&&h.jsx(o_,{onSelectionContextMenu:L,noPanClassName:T,disableKeyboardA11y:P})]})})}Qg.displayName="FlowRenderer";const s_=b.memo(Qg),l_=e=>t=>e?yc(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 a_(e){return ie(b.useCallback(l_(e),[e]),ye)}const u_=e=>e.updateNodeInternals;function c_(){const e=ie(u_),[t]=b.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 b.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function d_({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=fe(),i=b.useRef(null),s=b.useRef(null),l=b.useRef(e.sourcePosition),a=b.useRef(e.targetPosition),u=b.useRef(t),c=n&&!!e.internals.handleBounds;return b.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]),b.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),b.useEffect(()=>{if(i.current){const f=u.current!==t,d=l.current!==e.sourcePosition,p=a.current!==e.targetPosition;(f||d||p)&&(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 f_({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:i,onDoubleClick:s,nodesDraggable:l,elementsSelectable:a,nodesConnectable:u,nodesFocusable:c,resizeObserver:f,noDragClassName:d,noPanClassName:p,disableKeyboardA11y:y,rfId:x,nodeTypes:k,nodeClickDistance:m,onError:v}){const{node:g,internals:w,isParent:N}=ie(O=>{const Y=O.nodeLookup.get(e),q=O.parentLookup.has(e);return{node:Y,internals:Y.internals,isParent:q}},ye);let S=g.type||"default",_=(k==null?void 0:k[S])||Bf[S];_===void 0&&(v==null||v("003",kt.error003(S)),S="default",_=(k==null?void 0:k.default)||Bf.default);const C=!!(g.draggable||l&&typeof g.draggable>"u"),I=!!(g.selectable||a&&typeof g.selectable>"u"),R=!!(g.connectable||u&&typeof g.connectable>"u"),D=!!(g.focusable||c&&typeof g.focusable>"u"),H=fe(),F=fg(g),E=d_({node:g,nodeType:S,hasDimensions:F,resizeObserver:f}),L=Ug({nodeRef:E,disabled:g.hidden||!C,noDragClassName:d,handleSelector:g.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:m}),M=Yg();if(g.hidden)return null;const T=Et(g),P=n_(g),$=I||C||t||n||r||o,z=n?O=>n(O,{...w.userNode}):void 0,j=r?O=>r(O,{...w.userNode}):void 0,A=o?O=>o(O,{...w.userNode}):void 0,V=i?O=>i(O,{...w.userNode}):void 0,U=s?O=>s(O,{...w.userNode}):void 0,G=O=>{const{selectNodesOnDrag:Y,nodeDragThreshold:q}=H.getState();I&&(!Y||!C||q>0)&&du({id:e,store:H,nodeRef:E}),t&&t(O,{...w.userNode})},B=O=>{if(!(gg(O.nativeEvent)||y)){if(rg.includes(O.key)&&I){const Y=O.key==="Escape";du({id:e,store:H,unselect:Y,nodeRef:E})}else if(C&&g.selected&&Object.prototype.hasOwnProperty.call(Fs,O.key)){O.preventDefault();const{ariaLabelConfig:Y}=H.getState();H.setState({ariaLiveMessage:Y["node.a11yDescription.ariaLiveMessage"]({direction:O.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),M({direction:Fs[O.key],factor:O.shiftKey?4:1})}}},X=()=>{var te;if(y||!((te=E.current)!=null&&te.matches(":focus-visible")))return;const{transform:O,width:Y,height:q,autoPanOnNodeFocus:J,setCenter:Q}=H.getState();if(!J)return;yc(new Map([[e,g]]),{x:0,y:0,width:Y,height:q},O,!0).length>0||Q(g.position.x+T.width/2,g.position.y+T.height/2,{zoom:O[2]})};return h.jsx("div",{className:ke(["react-flow__node",`react-flow__node-${S}`,{[p]:C},g.className,{selected:g.selected,selectable:I,parent:N,draggable:C,dragging:L}]),ref:E,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:$?"all":"none",visibility:F?"visible":"hidden",...g.style,...P},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:z,onMouseMove:j,onMouseLeave:A,onContextMenu:V,onClick:G,onDoubleClick:U,onKeyDown:D?B:void 0,tabIndex:D?0:void 0,onFocus:D?X:void 0,role:g.ariaRole??(D?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${Dg}-${x}`,"aria-label":g.ariaLabel,...g.domAttributes,children:h.jsx(UN,{value:e,children:h.jsx(_,{id:e,data:g.data,type:S,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:g.selected??!1,selectable:I,draggable:C,deletable:g.deletable??!0,isConnectable:R,sourcePosition:g.sourcePosition,targetPosition:g.targetPosition,dragging:L,dragHandle:g.dragHandle,zIndex:w.z,parentId:g.parentId,...T})})})}var h_=b.memo(f_);const p_=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Gg(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:o}=ie(p_,ye),i=a_(e.onlyRenderVisibleElements),s=c_();return h.jsx("div",{className:"react-flow__nodes",style:yl,children:i.map(l=>h.jsx(h_,{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))})}Gg.displayName="NodeRenderer";const m_=b.memo(Gg);function g_(e){return ie(b.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&&QS({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(o.id)}return r},[e]),ye)}const y_=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return h.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},v_=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return h.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Wf={[Ko.Arrow]:y_,[Ko.ArrowClosed]:v_};function x_(e){const t=fe();return b.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(Wf,e)?Wf[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",kt.error009(e)),null)},[e])}const w_=({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=x_(t);return a?h.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:h.jsx(a,{color:n,strokeWidth:s})}):null},qg=({defaultColor:e,rfId:t})=>{const n=ie(i=>i.edges),r=ie(i=>i.defaultEdgeOptions),o=b.useMemo(()=>rE(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?h.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:h.jsx("defs",{children:o.map(i=>h.jsx(w_,{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};qg.displayName="MarkerDefinitions";var k_=b.memo(qg);function Zg({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[f,d]=b.useState({x:1,y:0,width:0,height:0}),p=ke(["react-flow__edge-textwrapper",u]),y=b.useRef(null);return b.useEffect(()=>{if(y.current){const x=y.current.getBBox();d({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),n?h.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...c,children:[o&&h.jsx("rect",{width:f.width+2*s[0],x:-s[0],y:-s[1],height:f.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),h.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:y,style:r,children:n}),a]}):null}Zg.displayName="EdgeText";const S_=b.memo(Zg);function fi({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a,interactionWidth:u=20,...c}){return h.jsxs(h.Fragment,{children:[h.jsx("path",{...c,d:e,fill:"none",className:ke(["react-flow__edge-path",c.className])}),u?h.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&gt(t)&&gt(n)?h.jsx(S_,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a}):null]})}function Uf({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===Z.Left||e===Z.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Jg({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:o,targetPosition:i=Z.Top}){const[s,l]=Uf({pos:n,x1:e,y1:t,x2:r,y2:o}),[a,u]=Uf({pos:i,x1:r,y1:o,x2:e,y2:t}),[c,f,d,p]=vg({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,f,d,p]}function e0(e){return b.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s,targetPosition:l,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:k,interactionWidth:m})=>{const[v,g,w]=Jg({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l}),N=e.isInternal?void 0:t;return h.jsx(fi,{id:N,path:v,labelX:g,labelY:w,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:k,interactionWidth:m})})}const E_=e0({isInternal:!1}),t0=e0({isInternal:!0});E_.displayName="SimpleBezierEdge";t0.displayName="SimpleBezierEdgeInternal";function n0(e){return b.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:d,sourcePosition:p=Z.Bottom,targetPosition:y=Z.Top,markerEnd:x,markerStart:k,pathOptions:m,interactionWidth:v})=>{const[g,w,N]=Os({sourceX:n,sourceY:r,sourcePosition:p,targetX:o,targetY:i,targetPosition:y,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset,stepPosition:m==null?void 0:m.stepPosition}),S=e.isInternal?void 0:t;return h.jsx(fi,{id:S,path:g,labelX:w,labelY:N,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:d,markerEnd:x,markerStart:k,interactionWidth:v})})}const r0=n0({isInternal:!1}),o0=n0({isInternal:!0});r0.displayName="SmoothStepEdge";o0.displayName="SmoothStepEdgeInternal";function i0(e){return b.memo(({id:t,...n})=>{var o;const r=e.isInternal?void 0:t;return h.jsx(r0,{...n,id:r,pathOptions:b.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const N_=i0({isInternal:!1}),s0=i0({isInternal:!0});N_.displayName="StepEdge";s0.displayName="StepEdgeInternal";function l0(e){return b.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:d,markerEnd:p,markerStart:y,interactionWidth:x})=>{const[k,m,v]=wg({sourceX:n,sourceY:r,targetX:o,targetY:i}),g=e.isInternal?void 0:t;return h.jsx(fi,{id:g,path:k,labelX:m,labelY:v,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:d,markerEnd:p,markerStart:y,interactionWidth:x})})}const __=l0({isInternal:!1}),a0=l0({isInternal:!0});__.displayName="StraightEdge";a0.displayName="StraightEdgeInternal";function u0(e){return b.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s=Z.Bottom,targetPosition:l=Z.Top,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:k,pathOptions:m,interactionWidth:v})=>{const[g,w,N]=kc({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l,curvature:m==null?void 0:m.curvature}),S=e.isInternal?void 0:t;return h.jsx(fi,{id:S,path:g,labelX:w,labelY:N,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:k,interactionWidth:v})})}const C_=u0({isInternal:!1}),c0=u0({isInternal:!0});C_.displayName="BezierEdge";c0.displayName="BezierEdgeInternal";const Yf={default:c0,straight:a0,step:s0,smoothstep:o0,simplebezier:t0},Xf={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},j_=(e,t,n)=>n===Z.Left?e-t:n===Z.Right?e+t:e,M_=(e,t,n)=>n===Z.Top?e-t:n===Z.Bottom?e+t:e,Kf="react-flow__edgeupdater";function Qf({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:l}){return h.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:ke([Kf,`${Kf}-${l}`]),cx:j_(t,r,e),cy:M_(n,r,e),r,stroke:"transparent",fill:"transparent"})}function $_({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:i,targetY:s,sourcePosition:l,targetPosition:a,onReconnect:u,onReconnectStart:c,onReconnectEnd:f,setReconnecting:d,setUpdateHover:p}){const y=fe(),x=(w,N)=>{if(w.button!==0)return;const{autoPanOnConnect:S,domNode:_,connectionMode:C,connectionRadius:I,lib:R,onConnectStart:D,cancelConnection:H,nodeLookup:F,rfId:E,panBy:L,updateConnection:M}=y.getState(),T=N.type==="target",P=(j,A)=>{d(!1),f==null||f(j,n,N.type,A)},$=j=>u==null?void 0:u(n,j),z=(j,A)=>{d(!0),c==null||c(w,n,N.type),D==null||D(j,A)};cu.onPointerDown(w.nativeEvent,{autoPanOnConnect:S,connectionMode:C,connectionRadius:I,domNode:_,handleId:N.id,nodeId:N.nodeId,nodeLookup:F,isTarget:T,edgeUpdaterType:N.type,lib:R,flowId:E,cancelConnection:H,panBy:L,isValidConnection:(...j)=>{var A,V;return((V=(A=y.getState()).isValidConnection)==null?void 0:V.call(A,...j))??!0},onConnect:$,onConnectStart:z,onConnectEnd:(...j)=>{var A,V;return(V=(A=y.getState()).onConnectEnd)==null?void 0:V.call(A,...j)},onReconnectEnd:P,updateConnection:M,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,dragThreshold:y.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},k=w=>x(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=w=>x(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>p(!0),g=()=>p(!1);return h.jsxs(h.Fragment,{children:[(e===!0||e==="source")&&h.jsx(Qf,{position:l,centerX:r,centerY:o,radius:t,onMouseDown:k,onMouseEnter:v,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&h.jsx(Qf,{position:a,centerX:i,centerY:s,radius:t,onMouseDown:m,onMouseEnter:v,onMouseOut:g,type:"target"})]})}function P_({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:i,onContextMenu:s,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,reconnectRadius:c,onReconnect:f,onReconnectStart:d,onReconnectEnd:p,rfId:y,edgeTypes:x,noPanClassName:k,onError:m,disableKeyboardA11y:v}){let g=ie(Q=>Q.edgeLookup.get(e));const w=ie(Q=>Q.defaultEdgeOptions);g=w?{...w,...g}:g;let N=g.type||"default",S=(x==null?void 0:x[N])||Yf[N];S===void 0&&(m==null||m("011",kt.error011(N)),N="default",S=(x==null?void 0:x.default)||Yf.default);const _=!!(g.focusable||t&&typeof g.focusable>"u"),C=typeof f<"u"&&(g.reconnectable||n&&typeof g.reconnectable>"u"),I=!!(g.selectable||r&&typeof g.selectable>"u"),R=b.useRef(null),[D,H]=b.useState(!1),[F,E]=b.useState(!1),L=fe(),{zIndex:M=g.zIndex,sourceX:T,sourceY:P,targetX:$,targetY:z,sourcePosition:j,targetPosition:A}=ie(b.useCallback(Q=>{const ee=Q.nodeLookup.get(g.source),te=Q.nodeLookup.get(g.target);if(!ee||!te)return Xf;const ne=nE({id:e,sourceNode:ee,targetNode:te,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:Q.connectionMode,onError:m}),re=KS({selected:g.selected,zIndex:g.zIndex,sourceNode:ee,targetNode:te,elevateOnSelect:Q.elevateEdgesOnSelect,zIndexMode:Q.zIndexMode});return{...ne||Xf,zIndex:re}},[g.source,g.target,g.sourceHandle,g.targetHandle,g.selected,g.zIndex,m]),ye),V=b.useMemo(()=>g.markerStart?`url('#${au(g.markerStart,y)}')`:void 0,[g.markerStart,y]),U=b.useMemo(()=>g.markerEnd?`url('#${au(g.markerEnd,y)}')`:void 0,[g.markerEnd,y]);if(g.hidden||T===null||P===null||$===null||z===null)return null;const G=Q=>{var re;const{addSelectedEdges:ee,unselectNodesAndEdges:te,multiSelectionActive:ne}=L.getState();I&&(L.setState({nodesSelectionActive:!1}),g.selected&&ne?(te({nodes:[],edges:[g]}),(re=R.current)==null||re.blur()):ee([e])),o&&o(Q,g)},B=i?Q=>{i(Q,{...g})}:void 0,X=s?Q=>{s(Q,{...g})}:void 0,O=l?Q=>{l(Q,{...g})}:void 0,Y=a?Q=>{a(Q,{...g})}:void 0,q=u?Q=>{u(Q,{...g})}:void 0,J=Q=>{var ee;if(!v&&rg.includes(Q.key)&&I){const{unselectNodesAndEdges:te,addSelectedEdges:ne}=L.getState();Q.key==="Escape"?((ee=R.current)==null||ee.blur(),te({edges:[g]})):ne([e])}};return h.jsx("svg",{style:{zIndex:M},children:h.jsxs("g",{className:ke(["react-flow__edge",`react-flow__edge-${N}`,g.className,k,{selected:g.selected,animated:g.animated,inactive:!I&&!o,updating:D,selectable:I}]),onClick:G,onDoubleClick:B,onContextMenu:X,onMouseEnter:O,onMouseMove:Y,onMouseLeave:q,onKeyDown:_?J:void 0,tabIndex:_?0:void 0,role:g.ariaRole??(_?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":g.ariaLabel===null?void 0:g.ariaLabel||`Edge from ${g.source} to ${g.target}`,"aria-describedby":_?`${Og}-${y}`:void 0,ref:R,...g.domAttributes,children:[!F&&h.jsx(S,{id:e,source:g.source,target:g.target,type:g.type,selected:g.selected,animated:g.animated,selectable:I,deletable:g.deletable??!0,label:g.label,labelStyle:g.labelStyle,labelShowBg:g.labelShowBg,labelBgStyle:g.labelBgStyle,labelBgPadding:g.labelBgPadding,labelBgBorderRadius:g.labelBgBorderRadius,sourceX:T,sourceY:P,targetX:$,targetY:z,sourcePosition:j,targetPosition:A,data:g.data,style:g.style,sourceHandleId:g.sourceHandle,targetHandleId:g.targetHandle,markerStart:V,markerEnd:U,pathOptions:"pathOptions"in g?g.pathOptions:void 0,interactionWidth:g.interactionWidth}),C&&h.jsx($_,{edge:g,isReconnectable:C,reconnectRadius:c,onReconnect:f,onReconnectStart:d,onReconnectEnd:p,sourceX:T,sourceY:P,targetX:$,targetY:z,sourcePosition:j,targetPosition:A,setUpdateHover:H,setReconnecting:E})]})})}var I_=b.memo(P_);const T_=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function d0({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:a,onEdgeMouseLeave:u,onEdgeClick:c,reconnectRadius:f,onEdgeDoubleClick:d,onReconnectStart:p,onReconnectEnd:y,disableKeyboardA11y:x}){const{edgesFocusable:k,edgesReconnectable:m,elementsSelectable:v,onError:g}=ie(T_,ye),w=g_(t);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(k_,{defaultColor:e,rfId:n}),w.map(N=>h.jsx(I_,{id:N,edgesFocusable:k,edgesReconnectable:m,elementsSelectable:v,noPanClassName:o,onReconnect:i,onContextMenu:s,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,onClick:c,reconnectRadius:f,onDoubleClick:d,onReconnectStart:p,onReconnectEnd:y,rfId:n,onError:g,edgeTypes:r,disableKeyboardA11y:x},N))]})}d0.displayName="EdgeRenderer";const b_=b.memo(d0),Gf=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function z_({children:e}){const t=fe(),n=b.useRef(null),[r]=b.useState(()=>t.getState().transform);return Vg(()=>{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=Gf(s)))};return i(),t.subscribe(i)},[t]),h.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:Gf(r)},children:e})}function L_(e){const t=gl(),n=b.useRef(!1);b.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const A_=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function R_(e){const t=ie(A_),n=fe();return b.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function D_(e){return e.connection.inProgress?{...e.connection,to:ci(e.connection.to,e.transform)}:{...e.connection}}function O_(e){return D_}function F_(e){const t=O_();return ie(t,ye)}const H_=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function B_({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:i,height:s,isValid:l,inProgress:a}=ie(H_,ye);return!(i&&o&&a)?null:h.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:h.jsx("g",{className:ke(["react-flow__connection",pg(l)]),children:h.jsx(f0,{style:t,type:n,CustomComponent:r,isValid:l})})})}const f0=({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:f,toPosition:d,pointer:p}=F_();if(!o)return;if(n)return h.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:d,connectionStatus:pg(r),toNode:c,toHandle:f,pointer:p});let y="";const x={sourceX:i.x,sourceY:i.y,sourcePosition:a,targetX:u.x,targetY:u.y,targetPosition:d};switch(t){case ln.Bezier:[y]=kc(x);break;case ln.SimpleBezier:[y]=Jg(x);break;case ln.Step:[y]=Os({...x,borderRadius:0});break;case ln.SmoothStep:[y]=Os(x);break;default:[y]=wg(x)}return h.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:e})};f0.displayName="ConnectionLine";const V_={};function qf(e=V_){b.useRef(e),fe(),b.useEffect(()=>{},[e])}function W_(){fe(),b.useRef(!1),b.useEffect(()=>{},[])}function h0({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:c,onSelectionContextMenu:f,onSelectionStart:d,onSelectionEnd:p,connectionLineType:y,connectionLineStyle:x,connectionLineComponent:k,connectionLineContainerStyle:m,selectionKeyCode:v,selectionOnDrag:g,selectionMode:w,multiSelectionKeyCode:N,panActivationKeyCode:S,zoomActivationKeyCode:_,deleteKeyCode:C,onlyRenderVisibleElements:I,elementsSelectable:R,defaultViewport:D,translateExtent:H,minZoom:F,maxZoom:E,preventScrolling:L,defaultMarkerColor:M,zoomOnScroll:T,zoomOnPinch:P,panOnScroll:$,panOnScrollSpeed:z,panOnScrollMode:j,zoomOnDoubleClick:A,panOnDrag:V,autoPanOnSelection:U,onPaneClick:G,onPaneMouseEnter:B,onPaneMouseMove:X,onPaneMouseLeave:O,onPaneScroll:Y,onPaneContextMenu:q,paneClickDistance:J,nodeClickDistance:Q,onEdgeContextMenu:ee,onEdgeMouseEnter:te,onEdgeMouseMove:ne,onEdgeMouseLeave:re,reconnectRadius:se,onReconnect:Ne,onReconnectStart:ze,onReconnectEnd:et,noDragClassName:bt,noWheelClassName:Qr,noPanClassName:Cn,disableKeyboardA11y:jn,nodeExtent:at,rfId:zt,viewport:Lt,onViewportChange:Mn,nodesDraggable:kl}){return qf(e),qf(t),W_(),L_(n),R_(Lt),h.jsx(s_,{onPaneClick:G,onPaneMouseEnter:B,onPaneMouseMove:X,onPaneMouseLeave:O,onPaneContextMenu:q,onPaneScroll:Y,paneClickDistance:J,deleteKeyCode:C,selectionKeyCode:v,selectionOnDrag:g,selectionMode:w,onSelectionStart:d,onSelectionEnd:p,multiSelectionKeyCode:N,panActivationKeyCode:S,zoomActivationKeyCode:_,elementsSelectable:R,zoomOnScroll:T,zoomOnPinch:P,zoomOnDoubleClick:A,panOnScroll:$,panOnScrollSpeed:z,panOnScrollMode:j,panOnDrag:V,autoPanOnSelection:U,defaultViewport:D,translateExtent:H,minZoom:F,maxZoom:E,onSelectionContextMenu:f,preventScrolling:L,noDragClassName:bt,noWheelClassName:Qr,noPanClassName:Cn,disableKeyboardA11y:jn,onViewportChange:Mn,isControlledViewport:!!Lt,children:h.jsxs(z_,{children:[h.jsx(b_,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:s,onReconnect:Ne,onReconnectStart:ze,onReconnectEnd:et,onlyRenderVisibleElements:I,onEdgeContextMenu:ee,onEdgeMouseEnter:te,onEdgeMouseMove:ne,onEdgeMouseLeave:re,reconnectRadius:se,defaultMarkerColor:M,noPanClassName:Cn,disableKeyboardA11y:jn,rfId:zt}),h.jsx(B_,{style:x,type:y,component:k,containerStyle:m}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(m_,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:c,nodeClickDistance:Q,onlyRenderVisibleElements:I,noPanClassName:Cn,noDragClassName:bt,disableKeyboardA11y:jn,nodeExtent:at,rfId:zt,nodesDraggable:kl}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}h0.displayName="GraphView";const U_=b.memo(h0),Y_=dg(),Zf=({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:f,zIndexMode:d="basic"}={})=>{const p=new Map,y=new Map,x=new Map,k=new Map,m=r??t??[],v=n??e??[],g=c??[0,0],w=f??Yo;Eg(x,k,m);const{nodesInitialized:N}=uu(v,p,y,{nodeOrigin:g,nodeExtent:w,zIndexMode:d});let S=[0,0,1];if(s&&o&&i){const _=ai(p,{filter:D=>!!((D.width||D.initialWidth)&&(D.height||D.initialHeight))}),{x:C,y:I,zoom:R}=xc(_,o,i,a,u,(l==null?void 0:l.padding)??.1);S=[C,I,R]}return{rfId:"1",width:o??0,height:i??0,transform:S,nodes:v,nodesInitialized:N,nodeLookup:p,parentLookup:y,edges:m,edgeLookup:k,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:a,maxZoom:u,translateExtent:Yo,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Or.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:g,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:{...ig},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Y_,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:og,zIndexMode:d,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}},X_=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a,maxZoom:u,nodeOrigin:c,nodeExtent:f,zIndexMode:d})=>iN((p,y)=>{async function x(){const{nodeLookup:k,panZoom:m,fitViewOptions:v,fitViewResolver:g,width:w,height:N,minZoom:S,maxZoom:_}=y();m&&(await HS({nodes:k,width:w,height:N,panZoom:m,minZoom:S,maxZoom:_},v),g==null||g.resolve(!0),p({fitViewResolver:null}))}return{...Zf({nodes:e,edges:t,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a,maxZoom:u,nodeOrigin:c,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:d}),setNodes:k=>{const{nodeLookup:m,parentLookup:v,nodeOrigin:g,nodeExtent:w,elevateNodesOnSelect:N,fitViewQueued:S,zIndexMode:_,nodesSelectionActive:C}=y(),{nodesInitialized:I,hasSelectedNodes:R}=uu(k,m,v,{nodeOrigin:g,nodeExtent:w,elevateNodesOnSelect:N,checkEquality:!0,zIndexMode:_}),D=C&&R;S&&I?(x(),p({nodes:k,nodesInitialized:I,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:D})):p({nodes:k,nodesInitialized:I,nodesSelectionActive:D})},setEdges:k=>{const{connectionLookup:m,edgeLookup:v}=y();Eg(m,v,k),p({edges:k})},setDefaultNodesAndEdges:(k,m)=>{if(k){const{setNodes:v}=y();v(k),p({hasDefaultNodes:!0})}if(m){const{setEdges:v}=y();v(m),p({hasDefaultEdges:!0})}},updateNodeInternals:k=>{const{triggerNodeChanges:m,nodeLookup:v,parentLookup:g,domNode:w,nodeOrigin:N,nodeExtent:S,debug:_,fitViewQueued:C,zIndexMode:I}=y(),{changes:R,updatedInternals:D}=cE(k,v,g,w,N,S,I);D&&(sE(v,g,{nodeOrigin:N,nodeExtent:S,zIndexMode:I}),C?(x(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(R==null?void 0:R.length)>0&&(_&&console.log("React Flow: trigger node changes",R),m==null||m(R)))},updateNodePositions:(k,m=!1)=>{const v=[];let g=[];const{nodeLookup:w,triggerNodeChanges:N,connection:S,updateConnection:_,onNodesChangeMiddlewareMap:C}=y();for(const[I,R]of k){const D=w.get(I),H=!!(D!=null&&D.expandParent&&(D!=null&&D.parentId)&&(R!=null&&R.position)),F={id:I,type:"position",position:H?{x:Math.max(0,R.position.x),y:Math.max(0,R.position.y)}:R.position,dragging:m};if(D&&S.inProgress&&S.fromNode.id===D.id){const E=er(D,S.fromHandle,Z.Left,!0);_({...S,from:E})}H&&D.parentId&&v.push({id:I,parentId:D.parentId,rect:{...R.internals.positionAbsolute,width:R.measured.width??0,height:R.measured.height??0}}),g.push(F)}if(v.length>0){const{parentLookup:I,nodeOrigin:R}=y(),D=Cc(v,w,I,R);g.push(...D)}for(const I of C.values())g=I(g);N(g)},triggerNodeChanges:k=>{const{onNodesChange:m,setNodes:v,nodes:g,hasDefaultNodes:w,debug:N}=y();if(k!=null&&k.length){if(w){const S=CN(k,g);v(S)}N&&console.log("React Flow: trigger node changes",k),m==null||m(k)}},triggerEdgeChanges:k=>{const{onEdgesChange:m,setEdges:v,edges:g,hasDefaultEdges:w,debug:N}=y();if(k!=null&&k.length){if(w){const S=jN(k,g);v(S)}N&&console.log("React Flow: trigger edge changes",k),m==null||m(k)}},addSelectedNodes:k=>{const{multiSelectionActive:m,edgeLookup:v,nodeLookup:g,triggerNodeChanges:w,triggerEdgeChanges:N}=y();if(m){const S=k.map(_=>In(_,!0));w(S);return}w(kr(g,new Set([...k]),!0)),N(kr(v))},addSelectedEdges:k=>{const{multiSelectionActive:m,edgeLookup:v,nodeLookup:g,triggerNodeChanges:w,triggerEdgeChanges:N}=y();if(m){const S=k.map(_=>In(_,!0));N(S);return}N(kr(v,new Set([...k]))),w(kr(g,new Set,!0))},unselectNodesAndEdges:({nodes:k,edges:m}={})=>{const{edges:v,nodes:g,nodeLookup:w,triggerNodeChanges:N,triggerEdgeChanges:S}=y(),_=k||g,C=m||v,I=[];for(const D of _){if(!D.selected)continue;const H=w.get(D.id);H&&(H.selected=!1),I.push(In(D.id,!1))}const R=[];for(const D of C)D.selected&&R.push(In(D.id,!1));N(I),S(R)},setMinZoom:k=>{const{panZoom:m,maxZoom:v}=y();m==null||m.setScaleExtent([k,v]),p({minZoom:k})},setMaxZoom:k=>{const{panZoom:m,minZoom:v}=y();m==null||m.setScaleExtent([v,k]),p({maxZoom:k})},setTranslateExtent:k=>{var m;(m=y().panZoom)==null||m.setTranslateExtent(k),p({translateExtent:k})},resetSelectedElements:()=>{const{edges:k,nodes:m,triggerNodeChanges:v,triggerEdgeChanges:g,elementsSelectable:w}=y();if(!w)return;const N=m.reduce((_,C)=>C.selected?[..._,In(C.id,!1)]:_,[]),S=k.reduce((_,C)=>C.selected?[..._,In(C.id,!1)]:_,[]);v(N),g(S)},setNodeExtent:k=>{const{nodes:m,nodeLookup:v,parentLookup:g,nodeOrigin:w,elevateNodesOnSelect:N,nodeExtent:S,zIndexMode:_}=y();k[0][0]===S[0][0]&&k[0][1]===S[0][1]&&k[1][0]===S[1][0]&&k[1][1]===S[1][1]||(uu(m,v,g,{nodeOrigin:w,nodeExtent:k,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:_}),p({nodeExtent:k}))},panBy:k=>{const{transform:m,width:v,height:g,panZoom:w,translateExtent:N}=y();return dE({delta:k,panZoom:w,transform:m,translateExtent:N,width:v,height:g})},setCenter:async(k,m,v)=>{const{width:g,height:w,maxZoom:N,panZoom:S}=y();if(!S)return!1;const _=typeof(v==null?void 0:v.zoom)<"u"?v.zoom:N;return await S.setViewport({x:g/2-k*_,y:w/2-m*_,zoom:_},{duration:v==null?void 0:v.duration,ease:v==null?void 0:v.ease,interpolate:v==null?void 0:v.interpolate}),!0},cancelConnection:()=>{p({connection:{...ig}})},updateConnection:k=>{p({connection:k})},reset:()=>p({...Zf()})}},Object.is);function p0({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:i,initialMinZoom:s,initialMaxZoom:l,initialFitViewOptions:a,fitView:u,nodeOrigin:c,nodeExtent:f,zIndexMode:d,children:p}){const[y]=b.useState(()=>X_({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:u,minZoom:s,maxZoom:l,fitViewOptions:a,nodeOrigin:c,nodeExtent:f,zIndexMode:d}));return h.jsx(sN,{value:y,children:h.jsx(TN,{children:h.jsx(XN,{children:p})})})}function K_({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:i,height:s,fitView:l,fitViewOptions:a,minZoom:u,maxZoom:c,nodeOrigin:f,nodeExtent:d,zIndexMode:p}){return b.useContext(ml)?h.jsx(h.Fragment,{children:e}):h.jsx(p0,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:i,initialHeight:s,fitView:l,initialFitViewOptions:a,initialMinZoom:u,initialMaxZoom:c,nodeOrigin:f,nodeExtent:d,zIndexMode:p,children:e})}const Q_={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function G_({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i,edgeTypes:s,onNodeClick:l,onEdgeClick:a,onInit:u,onMove:c,onMoveStart:f,onMoveEnd:d,onConnect:p,onConnectStart:y,onConnectEnd:x,onClickConnectStart:k,onClickConnectEnd:m,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:w,onNodeContextMenu:N,onNodeDoubleClick:S,onNodeDragStart:_,onNodeDrag:C,onNodeDragStop:I,onNodesDelete:R,onEdgesDelete:D,onDelete:H,onSelectionChange:F,onSelectionDragStart:E,onSelectionDrag:L,onSelectionDragStop:M,onSelectionContextMenu:T,onSelectionStart:P,onSelectionEnd:$,onBeforeDelete:z,connectionMode:j,connectionLineType:A=ln.Bezier,connectionLineStyle:V,connectionLineComponent:U,connectionLineContainerStyle:G,deleteKeyCode:B="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:O=!1,selectionMode:Y=Xo.Full,panActivationKeyCode:q="Space",multiSelectionKeyCode:J=Go()?"Meta":"Control",zoomActivationKeyCode:Q=Go()?"Meta":"Control",snapToGrid:ee,snapGrid:te,onlyRenderVisibleElements:ne=!1,selectNodesOnDrag:re,nodesDraggable:se,autoPanOnNodeFocus:Ne,nodesConnectable:ze,nodesFocusable:et,nodeOrigin:bt=Fg,edgesFocusable:Qr,edgesReconnectable:Cn,elementsSelectable:jn=!0,defaultViewport:at=xN,minZoom:zt=.5,maxZoom:Lt=2,translateExtent:Mn=Yo,preventScrolling:kl=!0,nodeExtent:Sl,defaultMarkerColor:$0="#b1b1b7",zoomOnScroll:P0=!0,zoomOnPinch:I0=!0,panOnScroll:T0=!1,panOnScrollSpeed:b0=.5,panOnScrollMode:z0=Hn.Free,zoomOnDoubleClick:L0=!0,panOnDrag:A0=!0,onPaneClick:R0,onPaneMouseEnter:D0,onPaneMouseMove:O0,onPaneMouseLeave:F0,onPaneScroll:H0,onPaneContextMenu:B0,paneClickDistance:V0=1,nodeClickDistance:W0=0,children:U0,onReconnect:Y0,onReconnectStart:X0,onReconnectEnd:K0,onEdgeContextMenu:Q0,onEdgeDoubleClick:G0,onEdgeMouseEnter:q0,onEdgeMouseMove:Z0,onEdgeMouseLeave:J0,reconnectRadius:ey=10,onNodesChange:ty,onEdgesChange:ny,noDragClassName:ry="nodrag",noWheelClassName:oy="nowheel",noPanClassName:Tc="nopan",fitView:bc,fitViewOptions:zc,connectOnClick:iy,attributionPosition:sy,proOptions:ly,defaultEdgeOptions:ay,elevateNodesOnSelect:uy=!0,elevateEdgesOnSelect:cy=!1,disableKeyboardA11y:Lc=!1,autoPanOnConnect:dy,autoPanOnNodeDrag:fy,autoPanOnSelection:hy=!0,autoPanSpeed:py,connectionRadius:my,isValidConnection:gy,onError:yy,style:vy,id:Ac,nodeDragThreshold:xy,connectionDragThreshold:wy,viewport:ky,onViewportChange:Sy,width:Ey,height:Ny,colorMode:_y="light",debug:Cy,onScroll:pi,ariaLabelConfig:jy,zIndexMode:Rc="basic",...My},$y){const El=Ac||"1",Py=EN(_y),Iy=b.useCallback(Dc=>{Dc.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),pi==null||pi(Dc)},[pi]);return h.jsx("div",{"data-testid":"rf__wrapper",...My,onScroll:Iy,style:{...vy,...Q_},ref:$y,className:ke(["react-flow",o,Py]),id:Ac,role:"application",children:h.jsxs(K_,{nodes:e,edges:t,width:Ey,height:Ny,fitView:bc,fitViewOptions:zc,minZoom:zt,maxZoom:Lt,nodeOrigin:bt,nodeExtent:Sl,zIndexMode:Rc,children:[h.jsx(SN,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:y,onConnectEnd:x,onClickConnectStart:k,onClickConnectEnd:m,nodesDraggable:se,autoPanOnNodeFocus:Ne,nodesConnectable:ze,nodesFocusable:et,edgesFocusable:Qr,edgesReconnectable:Cn,elementsSelectable:jn,elevateNodesOnSelect:uy,elevateEdgesOnSelect:cy,minZoom:zt,maxZoom:Lt,nodeExtent:Sl,onNodesChange:ty,onEdgesChange:ny,snapToGrid:ee,snapGrid:te,connectionMode:j,translateExtent:Mn,connectOnClick:iy,defaultEdgeOptions:ay,fitView:bc,fitViewOptions:zc,onNodesDelete:R,onEdgesDelete:D,onDelete:H,onNodeDragStart:_,onNodeDrag:C,onNodeDragStop:I,onSelectionDrag:L,onSelectionDragStart:E,onSelectionDragStop:M,onMove:c,onMoveStart:f,onMoveEnd:d,noPanClassName:Tc,nodeOrigin:bt,rfId:El,autoPanOnConnect:dy,autoPanOnNodeDrag:fy,autoPanSpeed:py,onError:yy,connectionRadius:my,isValidConnection:gy,selectNodesOnDrag:re,nodeDragThreshold:xy,connectionDragThreshold:wy,onBeforeDelete:z,debug:Cy,ariaLabelConfig:jy,zIndexMode:Rc}),h.jsx(U_,{onInit:u,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:v,onNodeMouseMove:g,onNodeMouseLeave:w,onNodeContextMenu:N,onNodeDoubleClick:S,nodeTypes:i,edgeTypes:s,connectionLineType:A,connectionLineStyle:V,connectionLineComponent:U,connectionLineContainerStyle:G,selectionKeyCode:X,selectionOnDrag:O,selectionMode:Y,deleteKeyCode:B,multiSelectionKeyCode:J,panActivationKeyCode:q,zoomActivationKeyCode:Q,onlyRenderVisibleElements:ne,defaultViewport:at,translateExtent:Mn,minZoom:zt,maxZoom:Lt,preventScrolling:kl,zoomOnScroll:P0,zoomOnPinch:I0,zoomOnDoubleClick:L0,panOnScroll:T0,panOnScrollSpeed:b0,panOnScrollMode:z0,panOnDrag:A0,autoPanOnSelection:hy,onPaneClick:R0,onPaneMouseEnter:D0,onPaneMouseMove:O0,onPaneMouseLeave:F0,onPaneScroll:H0,onPaneContextMenu:B0,paneClickDistance:V0,nodeClickDistance:W0,onSelectionContextMenu:T,onSelectionStart:P,onSelectionEnd:$,onReconnect:Y0,onReconnectStart:X0,onReconnectEnd:K0,onEdgeContextMenu:Q0,onEdgeDoubleClick:G0,onEdgeMouseEnter:q0,onEdgeMouseMove:Z0,onEdgeMouseLeave:J0,reconnectRadius:ey,defaultMarkerColor:$0,noDragClassName:ry,noWheelClassName:oy,noPanClassName:Tc,rfId:El,disableKeyboardA11y:Lc,nodeExtent:Sl,viewport:ky,onViewportChange:Sy,nodesDraggable:se}),h.jsx(vN,{onSelectionChange:F}),U0,h.jsx(hN,{proOptions:ly,position:sy}),h.jsx(fN,{rfId:El,disableKeyboardA11y:Lc})]})})}var q_=Bg(G_);const Z_=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function J_({children:e}){const t=ie(Z_);return t?_m.createPortal(e,t):null}function e2({dimensions:e,lineWidth:t,variant:n,className:r}){return h.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ke(["react-flow__background-pattern",n,r])})}function t2({radius:e,className:t}){return h.jsx("circle",{cx:e,cy:e,r:e,className:ke(["react-flow__background-pattern","dots",t])})}var Wt;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Wt||(Wt={}));const n2={[Wt.Dots]:1,[Wt.Lines]:1,[Wt.Cross]:6},r2=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function m0({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 f=b.useRef(null),{transform:d,patternId:p}=ie(r2,ye),y=r||n2[t],x=t===Wt.Dots,k=t===Wt.Cross,m=Array.isArray(n)?n:[n,n],v=[m[0]*d[2]||1,m[1]*d[2]||1],g=y*d[2],w=Array.isArray(i)?i:[i,i],N=k?[g,g]:v,S=[w[0]*d[2]+N[0]/2,w[1]*d[2]+N[1]/2],_=`${p}${e||""}`;return h.jsxs("svg",{className:ke(["react-flow__background",u]),style:{...a,...yl,"--xy-background-color-props":l,"--xy-background-pattern-color-props":s},ref:f,"data-testid":"rf__background",children:[h.jsx("pattern",{id:_,x:d[0]%v[0],y:d[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:x?h.jsx(t2,{radius:g/2,className:c}):h.jsx(e2,{dimensions:N,lineWidth:o,variant:t,className:c})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${_})`})]})}m0.displayName="Background";const o2=b.memo(m0);function i2(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:h.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function s2(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:h.jsx("path",{d:"M0 0h32v4.2H0z"})})}function l2(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:h.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 a2(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 u2(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 Fi({children:e,className:t,...n}){return h.jsx("button",{type:"button",className:ke(["react-flow__controls-button",t]),...n,children:e})}const c2=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function g0({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:f="bottom-left",orientation:d="vertical","aria-label":p}){const y=fe(),{isInteractive:x,minZoomReached:k,maxZoomReached:m,ariaLabelConfig:v}=ie(c2,ye),{zoomIn:g,zoomOut:w,fitView:N}=gl(),S=()=>{g(),i==null||i()},_=()=>{w(),s==null||s()},C=()=>{N(o),l==null||l()},I=()=>{y.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),a==null||a(!x)},R=d==="horizontal"?"horizontal":"vertical";return h.jsxs(di,{className:ke(["react-flow__controls",R,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":p??v["controls.ariaLabel"],children:[t&&h.jsxs(h.Fragment,{children:[h.jsx(Fi,{onClick:S,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:m,children:h.jsx(i2,{})}),h.jsx(Fi,{onClick:_,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:k,children:h.jsx(s2,{})})]}),n&&h.jsx(Fi,{className:"react-flow__controls-fitview",onClick:C,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:h.jsx(l2,{})}),r&&h.jsx(Fi,{className:"react-flow__controls-interactive",onClick:I,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:x?h.jsx(u2,{}):h.jsx(a2,{})}),c]})}g0.displayName="Controls";b.memo(g0);function d2({id:e,x:t,y:n,width:r,height:o,style:i,color:s,strokeColor:l,strokeWidth:a,className:u,borderRadius:c,shapeRendering:f,selected:d,onClick:p}){const{background:y,backgroundColor:x}=i||{},k=s||y||x;return h.jsx("rect",{className:ke(["react-flow__minimap-node",{selected:d},u]),x:t,y:n,rx:c,ry:c,width:r,height:o,style:{fill:k,stroke:l,strokeWidth:a},shapeRendering:f,onClick:p?m=>p(m,e):void 0})}const f2=b.memo(d2),h2=e=>e.nodes.map(t=>t.id),ia=e=>e instanceof Function?e:()=>e;function p2({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:i=f2,onClick:s}){const l=ie(h2,ye),a=ia(t),u=ia(e),c=ia(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:l.map(d=>h.jsx(g2,{id:d,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:c,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:i,onClick:s,shapeRendering:f},d))})}function m2({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:l,onClick:a}){const{node:u,x:c,y:f,width:d,height:p}=ie(y=>{const x=y.nodeLookup.get(e);if(!x)return{node:void 0,x:0,y:0,width:0,height:0};const k=x.internals.userNode,{x:m,y:v}=x.internals.positionAbsolute,{width:g,height:w}=Et(k);return{node:k,x:m,y:v,width:g,height:w}},ye);return!u||u.hidden||!fg(u)?null:h.jsx(l,{x:c,y:f,width:d,height:p,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 g2=b.memo(m2);var y2=b.memo(p2);const v2=200,x2=150,w2=e=>!e.hidden,k2=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?ug(ai(e.nodeLookup,{filter:w2}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Jf=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,S2=(e,t)=>Jf(e.viewBB,t.viewBB)&&Jf(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,E2="react-flow__minimap-desc";function y0({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:l,bgColor:a,maskColor:u,maskStrokeColor:c,maskStrokeWidth:f,position:d="bottom-right",onClick:p,onNodeClick:y,pannable:x=!1,zoomable:k=!1,ariaLabel:m,inversePan:v,zoomStep:g=1,offsetScale:w=5}){const N=fe(),S=b.useRef(null),{boundingRect:_,panZoom:C,viewBB:I,rfId:R,translateExtent:D,flowWidth:H,flowHeight:F,ariaLabelConfig:E}=ie(k2,S2),L=(e==null?void 0:e.width)??v2,M=(e==null?void 0:e.height)??x2,T=_.width/L,P=_.height/M,$=Math.max(T,P),z=$*L,j=$*M,A=w*$,V=_.x-(z-_.width)/2-A,U=_.y-(j-_.height)/2-A,G=z+A*2,B=j+A*2,X=`${E2}-${R}`,O=b.useRef(0),Y=b.useRef();O.current=$,b.useEffect(()=>{const te=N.getState().panZoom;if(S.current&&te)return Y.current=wE({domNode:S.current,panZoom:te,getTransform:()=>N.getState().transform,getViewScale:()=>O.current}),()=>{var ne;(ne=Y.current)==null||ne.destroy()}},[C]),b.useEffect(()=>{var te;(te=Y.current)==null||te.update({translateExtent:D,width:H,height:F,inversePan:v,pannable:x,zoomStep:g,zoomable:k})},[x,k,v,g,D,H,F]);const q=p?te=>{var se;const[ne,re]=((se=Y.current)==null?void 0:se.pointer(te))||[0,0];p(te,{x:ne,y:re})}:void 0,J=b.useCallback((te,ne)=>{const re=N.getState().nodeLookup.get(ne).internals.userNode;y==null||y(te,re)},[y]),Q=y?J:void 0,ee=m??E["minimap.ariaLabel"];return h.jsx(di,{position:d,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 f=="number"?f*$: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:ke(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:L,height:M,viewBox:`${V} ${U} ${G} ${B}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:S,onClick:q,children:[ee&&h.jsx("title",{id:X,children:ee}),h.jsx(y2,{onClick:Q,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:s,nodeComponent:l}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${V-A},${U-A}h${G+A*2}v${B+A*2}h${-G-A*2}z
62
- M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}y0.displayName="MiniMap";b.memo(y0);const N2=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,_2={[Br.Line]:"right",[Br.Handle]:"bottom-right"};function C2({nodeId:e,position:t,variant:n=Br.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:f=!1,resizeDirection:d,autoScale:p=!0,shouldResize:y,onResizeStart:x,onResize:k,onResizeEnd:m}){const v=Xg(),g=typeof e=="string"?e:v,w=fe(),N=b.useRef(null),S=n===Br.Handle,_=ie(b.useCallback(N2(S&&p),[S,p]),ye),C=b.useRef(null),I=t??_2[n];b.useEffect(()=>{if(!(!N.current||!g))return C.current||(C.current=bE({domNode:N.current,nodeId:g,getStoreItems:()=>{const{nodeLookup:D,transform:H,snapGrid:F,snapToGrid:E,nodeOrigin:L,domNode:M}=w.getState();return{nodeLookup:D,transform:H,snapGrid:F,snapToGrid:E,nodeOrigin:L,paneDomNode:M}},onChange:(D,H)=>{const{triggerNodeChanges:F,nodeLookup:E,parentLookup:L,nodeOrigin:M}=w.getState(),T=[],P={x:D.x,y:D.y},$=E.get(g);if($&&$.expandParent&&$.parentId){const z=$.origin??M,j=D.width??$.measured.width??0,A=D.height??$.measured.height??0,V={id:$.id,parentId:$.parentId,rect:{width:j,height:A,...hg({x:D.x??$.position.x,y:D.y??$.position.y},{width:j,height:A},$.parentId,E,z)}},U=Cc([V],E,L,M);T.push(...U),P.x=D.x?Math.max(z[0]*j,D.x):void 0,P.y=D.y?Math.max(z[1]*A,D.y):void 0}if(P.x!==void 0&&P.y!==void 0){const z={id:g,type:"position",position:{...P}};T.push(z)}if(D.width!==void 0&&D.height!==void 0){const j={id:g,type:"dimensions",resizing:!0,setAttributes:d?d==="horizontal"?"width":"height":!0,dimensions:{width:D.width,height:D.height}};T.push(j)}for(const z of H){const j={...z,type:"position"};T.push(j)}F(T)},onEnd:({width:D,height:H})=>{const F={id:g,type:"dimensions",resizing:!1,dimensions:{width:D,height:H}};w.getState().triggerNodeChanges([F])}})),C.current.update({controlPosition:I,boundaries:{minWidth:l,minHeight:a,maxWidth:u,maxHeight:c},keepAspectRatio:f,resizeDirection:d,onResizeStart:x,onResize:k,onResizeEnd:m,shouldResize:y}),()=>{var D;(D=C.current)==null||D.destroy()}},[I,l,a,u,c,f,x,k,m,y]);const R=I.split("-");return h.jsx("div",{className:ke(["react-flow__resize-control","nodrag",...R,n,r]),ref:N,style:{...o,scale:_,...s&&{[S?"backgroundColor":"borderColor"]:s}},children:i})}b.memo(C2);function j2(){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 Ur=j2(),Mt=e=>`/${e?`m/${encodeURIComponent(e)}`:""}?t=${encodeURIComponent(Ur)}`,Hs=e=>e.kind==="capture"?`/api/screens/${encodeURIComponent(e.capture)}.png?t=${encodeURIComponent(Ur)}`:`/api/repo-image?file=${encodeURIComponent(e.file)}&t=${encodeURIComponent(Ur)}`;class v0 extends Error{constructor(t,n=[]){super(t),this.problems=n}}async function Rt(e,t,n){const r=await fetch(t,{method:e,headers:{"x-illuminate-token":Ur,"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}),o=await r.json().catch(()=>({}));if(!r.ok)throw new v0(o.error??`Request failed (${r.status})`,o.problems??[]);return o}const cn={list:()=>Rt("GET","/api/maps"),get:e=>Rt("GET",`/api/maps/${encodeURIComponent(e)}`),make:(e,t)=>Rt("POST","/api/maps",{question:e,parent:t}),offer:(e,t,n)=>Rt("POST",`/api/maps/${encodeURIComponent(e)}/answers/${encodeURIComponent(t)}/offer`,{choice:n}),ask:(e,t,n)=>Rt("POST",`/api/maps/${encodeURIComponent(e)}/ask`,{question:t,selection:n}),approve:(e,t)=>Rt("POST",`/api/maps/${encodeURIComponent(e)}/fixes/${encodeURIComponent(t)}/approve`),reject:(e,t)=>Rt("POST",`/api/maps/${encodeURIComponent(e)}/fixes/${encodeURIComponent(t)}/reject`),undo:(e,t)=>Rt("POST",`/api/maps/${encodeURIComponent(e)}/fixes/${encodeURIComponent(t)}/undo`),stop:()=>Rt("POST","/api/stop")},M2=4e3;function x0(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(Ur)}`),r.onopen=()=>t(!0),r.onmessage=l=>{try{e(JSON.parse(String(l.data)))}catch{}},r.onclose=l=>{t(!1),l.code===M2?(o=!0,n()):o||(i=setTimeout(s,1e3))}};return s(),()=>{o=!0,i&&clearTimeout(i),r==null||r.close()}}const No=(...e)=>e.filter(Boolean).join(" "),rn=e=>`${Math.max(0,Math.min(1,e))*100}%`;function Zo(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 w0(e,t,n){for(const r of n){const o=Zo(t,r),i=e.nodes.find(s=>s.id===r);if(o&&i)return{name:i.name,show:o}}return null}const $2=600,P2=560;function k0({show:e,small:t=!1}){var a;const n=u=>e.page.regions.filter(c=>c.slot===u),r=(a=e.highlight)==null?void 0:a.trim().toLowerCase(),o=u=>{const c=u.id===e.region,f=p=>c&&p.text.trim().toLowerCase()===r,d=t?u.elements.filter(f):u.elements;return h.jsxs("div",{className:No("wf-region",c&&"wf-on"),children:[h.jsx("span",{className:"wf-label",children:u.label}),h.jsx("span",{className:"wf-els",children:d.map((p,y)=>h.jsx("span",{className:No("sk",`sk-${p.kind}`,f(p)&&"sk-mark"),title:p.text,children:p.kind==="image"?`▧ ${p.text}`:p.text},y))})]},u.id)},i=u=>n(u).length?h.jsx("div",{className:`wf-slot wf-${u}`,children:n(u).map(o)}):null,s=n("left").length+n("right").length,l=[n("left").length&&"minmax(0, 1fr)",(n("main").length||!s)&&"minmax(0, 2.6fr)",n("right").length&&"minmax(0, 1fr)"].filter(Boolean).join(" ");return h.jsxs("div",{className:No("wf",t&&"wf-small"),children:[i("top"),(s>0||n("main").length>0)&&h.jsxs("div",{className:"wf-mid",style:{gridTemplateColumns:l},children:[i("left"),i("main"),i("right")]}),i("bottom")]})}function Mc({show:e,name:t}){var i;const[n,r]=b.useState(!1);if(e.kind==="capture"){const s=e.box,l=!!s&&!n,a=s?`${rn(s.x+s.w/2)} ${rn(s.y+s.h/2)}`:void 0;return h.jsxs("figure",{className:"screen",children:[h.jsx("div",{className:"screen-shot",style:{aspectRatio:`${e.width} / ${e.height}`},children:h.jsxs("div",{className:"screen-zoom",style:l?{transform:"scale(2.2)",transformOrigin:a}:void 0,children:[h.jsx("img",{src:Hs(e),alt:`The screen at “${t}”${e.title?`: ${e.title}`:""}`,loading:"lazy"}),s&&h.jsx("i",{className:"screen-mark","aria-hidden":"true",style:{left:rn(s.x),top:rn(s.y),width:rn(s.w),height:rn(s.h)}})]})}),h.jsxs("figcaption",{className:"muted small",children:["Screenshot of ",e.from,s&&h.jsxs(h.Fragment,{children:[" · ",h.jsx("button",{className:"linklike",onClick:()=>r(!n),children:n?"Zoom in":"Show the whole screen"})]})]})]})}if(e.kind==="wireframe")return h.jsxs("figure",{className:"screen",children:[h.jsx("div",{role:"img","aria-label":`Wireframe of ${e.page.name}, the page at “${t}”`,children:h.jsx(k0,{show:e})}),h.jsxs("figcaption",{className:"muted small",children:["Wireframe of ",e.page.name,", from ",e.page.file,". Where things sit is approximate; it isn’t a screenshot."]})]});if(e.kind==="image")return h.jsxs("figure",{className:"screen",children:[h.jsx("div",{className:"screen-image",children:h.jsx("img",{src:Hs(e),alt:`Image used at “${t}”`,loading:"lazy"})}),h.jsx("figcaption",{className:"muted small",children:e.file})]});const o=(i=e.highlight)==null?void 0:i.trim().toLowerCase();return h.jsxs("figure",{className:"screen",children:[h.jsx("div",{className:"screen-sketch",role:"img","aria-label":`Rough sketch of the screen at “${t}”`,children:e.elements.map((s,l)=>h.jsxs("span",{className:No("sk",`sk-${s.kind}`,s.proposed&&"sk-proposed",o===s.text.trim().toLowerCase()&&"sk-mark"),title:s.proposed?"Proposed: not on the screen yet":void 0,children:[s.kind==="image"?`▧ ${s.text}`:s.text,s.proposed&&h.jsx("i",{className:"sk-new",children:"proposed"})]},l))}),h.jsxs("figcaption",{className:"muted small",children:[e.elements.every(s=>s.proposed)?`Rough sketch of a proposed screen (${e.file})`:`Rough sketch from ${e.file}, not a screenshot`,e.elements.some(s=>s.proposed)&&!e.elements.every(s=>s.proposed)&&" · violet parts are proposed"]})]})}function I2({show:e,name:t}){var r;if(e.kind==="sketch"){const o=(r=e.highlight)==null?void 0:r.trim().toLowerCase(),i=e.elements.slice(0,4);return h.jsxs("div",{className:"thumb thumb-sketch",role:"img","aria-label":`Rough sketch of the screen at “${t}”`,children:[i.map((s,l)=>h.jsx("span",{className:No("sk",`sk-${s.kind}`,s.proposed&&"sk-proposed",o===s.text.trim().toLowerCase()&&"sk-mark"),children:s.kind==="image"?`▧ ${s.text}`:s.text},l)),e.elements.length>i.length&&h.jsxs("span",{className:"thumb-more",children:["+",e.elements.length-i.length," more"]})]})}if(e.kind==="wireframe")return h.jsx("div",{className:"thumb thumb-wire",role:"img","aria-label":`Wireframe of ${e.page.name}, the page at “${t}”`,children:h.jsx(k0,{show:e,small:!0})});if(e.kind==="image")return h.jsx("div",{className:"thumb thumb-image",children:h.jsx("img",{src:Hs(e),alt:`Image used at “${t}”`,loading:"lazy"})});const n=e.box;return h.jsx("div",{className:"thumb thumb-shot",children:h.jsx("img",{src:Hs(e),alt:`The screen at “${t}”`,loading:"lazy",style:n?{transform:"scale(1.8)",transformOrigin:`${rn(n.x+n.w/2)} ${rn(n.y+n.h/2)}`}:void 0})})}const eh=/^\s*(```|~~~)/,T2=/^\s{0,3}#{1,6}\s+(.*?)\s*#*\s*$/,b2=/^\s*[-*+•]\s+(.*)$/,z2=/^\s*(\d{1,4})[.)]\s+(.*)$/;function L2(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(eh.test(s)){o();const f=[];for(i++;i<t.length&&!eh.test(t[i]);i++)f.push(t[i]);n.push({kind:"code",text:f.join(`
66
- `)});continue}if(!s.trim()){o();continue}const l=T2.exec(s);if(l){o(),n.push({kind:"h",text:l[1]});continue}const a=b2.exec(s),u=a?null:z2.exec(s);if(a||u){o();const f=a?"ul":"ol",d=n[n.length-1],p=a?a[1]:u[2];d&&d.kind===f?d.items.push(p):n.push(f==="ul"?{kind:f,items:[p]}:{kind:f,items:[p],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 A2=new RegExp("(`+)([^`]+?)\\1|\\*\\*(.+?)\\*\\*|__(.+?)__|\\*(?!\\s)(.+?)\\*|(?<![\\w])_(?!\\s)(.+?)_(?![\\w])|\\[([^\\]]+)\\]\\(([^)\\s]+)\\)","g");function An(e,t="i"){const n=[];let r=0,o=0;const i=s=>{s.split(`
67
- `).forEach((l,a)=>{a>0&&n.push(h.jsx("br",{},`${t}-br${o++}`)),l&&n.push(l)})};for(const s of e.matchAll(A2)){i(e.slice(r,s.index));const l=`${t}-${o++}`;if(s[2]!==void 0)n.push(h.jsx("code",{children:s[2]},l));else if(s[3]!==void 0||s[4]!==void 0)n.push(h.jsx("strong",{children:An(s[3]??s[4],l)},l));else if(s[5]!==void 0||s[6]!==void 0)n.push(h.jsx("em",{children:An(s[5]??s[6],l)},l));else if(s[7]!==void 0){const a=s[8];n.push(/^https?:\/\//i.test(a)?h.jsx("a",{href:a,target:"_blank",rel:"noreferrer",children:An(s[7],l)},l):h.jsx("span",{children:An(s[7],l)},l))}r=s.index+s[0].length}return i(e.slice(r)),n}function Jo({text:e,className:t}){const n=L2(e);return n.length?h.jsx("div",{className:t?`md ${t}`:"md",children:n.map((r,o)=>{const i=`b${o}`;if(r.kind==="p")return h.jsx("p",{children:An(r.text,i)},i);if(r.kind==="h")return h.jsx("p",{className:"md-h",children:An(r.text,i)},i);if(r.kind==="code")return h.jsx("pre",{children:h.jsx("code",{children:r.text})},i);const s=r.items.map((l,a)=>h.jsx("li",{children:An(l,`${i}-${a}`)},`${i}-${a}`));return r.kind==="ul"?h.jsx("ul",{children:s},i):h.jsx("ol",{start:r.start,children:s},i)})}):null}const sr=()=>({nodes:[],edges:[],absences:[]}),lr=e=>e.nodes.length+e.edges.length+e.absences.length,R2=e=>({mapId:e,phase:"loading",meta:null,map:null,report:null,job:null,error:null,answers:[],shown:null,selection:sr(),tour:null,views:[],viewIndex:-1,fixes:{},fresh:[],hidden:[],connected:!1}),D2=e=>e.views[e.viewIndex]??null;function hi(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 O2=e=>hi(e).flatMap(t=>t.ids);function S0(e){if(!e.map)return null;const t=new Set(hi(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 F2(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 H2(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?[]:E0(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 E0(e,t){return e.edges.filter(n=>t.has(n.from)&&t.has(n.to)).map(n=>n.id)}function th(e,t){const n=[...t.moves.highlight,...t.added],r=e?[...new Set([...n,...E0(e,new Set(n))])]:n;return r.length||t.moves.focus?{focus:t.moves.focus??r[0]??null,highlight:r}:null}function ir(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 nh(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 B2(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:nh(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:nh([r.answer],e.fixes,void 0)};return ir(i,th(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 ir(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]}:{...sr(),[t.kind]:o&&lr(e.selection)===1?[]:[t.id]};return{...e,selection:i}}case"selectMany":return{...e,selection:t.selection};case"clearSelection":return{...e,selection:sr()};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 ir({...e,tour:r,selection:sr()},H2(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?ir({...e,tour:null,selection:{...sr(),[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 ir({...e,shown:t.answerId,tour:null},r?th(e.map,r):null)}case"overview":return ir({...e,shown:null,tour:null,selection:sr(),fresh:[]},{focus:null,highlight:[]});case"layer":case"allLayers":{const r=t.type==="layer"?[t.answerId]:hi(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:F2(e.selection,S0(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 dn=(...e)=>e.filter(Boolean).join(" ");function it(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`${it(e,r.from)} → ${it(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}const V2={add:{pending:"Proposed: this isn’t in the code yet.",done:"This was proposed, and the code now has it."},change:{pending:"Proposed: this code would change.",done:"This was proposed to change, and the code here has changed since."},remove:{pending:"Proposed: this code would be removed.",done:"This was proposed for removal, and it’s no longer in the code."}},W2={added:"New since",changed:"Changed since",removed:"Removed since"};function fu(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 Fe({eyebrow:e,title:t,children:n,tone:r,className:o}){return h.jsxs("section",{className:dn("card",r&&`card-${r}`,o),children:[e&&h.jsx("div",{className:"eyebrow",children:e}),t&&h.jsx("h2",{className:"card-title",children:t}),n]})}function U2({map:e,ids:t,onPick:n}){return t.length?h.jsx("div",{className:"chips",children:t.map(({id:r,status:o})=>h.jsxs("button",{className:dn("chip",o==="proposed"?"chip-proposed":o!=="confirmed"&&"chip-unconfirmed"),onClick:()=>n(r),title:o==="confirmed"?"Confirmed against the code":o==="proposed"?"Part of a proposal, not in the code":"Couldn't confirm against the code",children:[h.jsx("span",{className:o==="confirmed"?"tick":o==="proposed"?"pmark":"qmark",children:o==="confirmed"?"✓":o==="proposed"?"+":"?"}),it(e,r)]},r))}):null}function rh({lines:e,working:t}){const n=e.slice(-8);return h.jsxs("ul",{className:"progress",children:[n.map((r,o)=>h.jsxs("li",{className:dn(t&&o===n.length-1&&"running"),children:[h.jsx("span",{className:"ic",children:t&&o===n.length-1?"…":"✓"}),r]},`${o}-${r}`)),!n.length&&t&&h.jsxs("li",{className:"running",children:[h.jsx("span",{className:"ic",children:"…"}),"Starting"]})]})}function Y2({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"?h.jsxs(Fe,{eyebrow:"Fix applied · re-checked",tone:"ok",children:[h.jsxs("ul",{className:"progress",children:[h.jsxs("li",{children:[h.jsx("span",{className:"ic",children:"✓"}),"Changed ",i.files.length," ",i.files.length===1?"file":"files",": ",i.files.map(l=>l.file).join(", ")]}),e.edgeId&&h.jsxs("li",{children:[h.jsx("span",{className:"ic",children:"✓"}),"New confirmed connection: ",it(o,e.edgeId)]}),e.closed.length>0&&h.jsxs("li",{children:[h.jsx("span",{className:"ic",children:"✓"}),"Closed: ",e.closed.length===1?"the missing connection":`${e.closed.length} missing connections`]})]}),e.undoable?h.jsx("div",{className:"btns",children:h.jsx("button",{className:"btn",onClick:r,children:"Undo this fix"})}):h.jsx("p",{className:"muted small",children:"Undo ended when illuminate stopped. Use git to reverse it."})]}):e.status==="rejected"||e.status==="undone"?h.jsxs(Fe,{eyebrow:e.status==="undone"?"Fix undone":"Fix rejected",children:[h.jsx(Jo,{text:i.summary,className:"muted"}),e.status==="undone"&&h.jsx("div",{className:"btns",children:h.jsx("button",{className:"btn",onClick:t,children:"Apply it again"})})]}):h.jsxs(Fe,{eyebrow:`Proposed fix · ${i.files.length} ${i.files.length===1?"file":"files"} · nothing changed yet`,tone:"ai",children:[h.jsx(Jo,{text:i.summary}),i.connects&&h.jsx("p",{className:"muted small",children:"The green dashed arrow is the connection it adds."}),h.jsx("pre",{className:"diff",children:i.diff.split(`
68
- `).map((l,a)=>h.jsxs("span",{className:l.startsWith("+ ")?"add":l.startsWith("- ")?"del":l.includes(" · ")?"file":"",children:[l,`
69
- `]},a))}),s.length>0?h.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&&h.jsx("ul",{className:"problems",children:e.problems.map(l=>h.jsx("li",{children:l},l))}),h.jsxs("div",{className:"btns",children:[h.jsx("button",{className:"btn primary",disabled:e.status==="applying",onClick:t,children:e.status==="applying"?"Applying…":"Approve"}),h.jsx("button",{className:"btn",onClick:n,children:"Reject"})]}),h.jsx("p",{className:"muted small",children:"Won't apply if these files change first."})]})}function X2({state:e,dispatch:t,onFix:n,onFocus:r,onOffer:o,composer:i}){const s=e.map,l=e.job,a=b.useRef(null);if(b.useEffect(()=>{const d=a.current;d&&(d.scrollTop=d.scrollHeight)},[e.answers.length,l==null?void 0:l.progress.length,!!l]),e.phase==="loading")return h.jsx("aside",{className:"panel",children:h.jsx("div",{className:"panel-scroll",children:h.jsx(Fe,{children:h.jsx("p",{className:"muted",children:"Loading…"})})})});if(e.phase==="missing")return h.jsx("aside",{className:"panel",children:h.jsx("div",{className:"panel-scroll",children:h.jsx(Fe,{title:"No map here",children:h.jsx("p",{className:"muted",children:"This map isn't in this repo."})})})});if(!s)return h.jsx("aside",{className:"panel",children:h.jsxs("div",{className:"panel-scroll",children:[l&&h.jsx(Fe,{eyebrow:"Making your map",title:l.question,tone:"ai",children:h.jsx(rh,{lines:l.progress,working:!0})}),e.phase==="failed"&&h.jsx(Fe,{title:"The map couldn't be made",tone:"dead",children:h.jsx("p",{children:e.error})})]})});const u=[...e.selection.nodes,...e.selection.edges,...e.selection.absences],c=hi(e),f=c.length>0&&c.every(d=>!d.visible);return h.jsxs("aside",{className:"panel","aria-label":"Conversation about this map",children:[h.jsxs("header",{className:"panel-head",children:[h.jsx("h2",{className:"panel-title",children:"Conversation"}),c.length>0&&h.jsx("button",{className:"link-btn small",onClick:()=>t({type:"allLayers",visible:f}),children:f?"Show everything":"Show the original map"}),h.jsx("button",{className:"card-close","aria-label":"Close the conversation",title:"Close (Esc). It stays here to reopen.",onClick:()=>t({type:"overview"}),children:"×"})]}),h.jsxs("div",{className:"panel-scroll",ref:a,children:[e.error&&h.jsxs("div",{className:"banner banner-dead",role:"alert",children:[e.error,h.jsx("button",{className:"link-btn",onClick:()=>t({type:"error",message:null}),children:"Dismiss"})]}),e.answers.map(d=>h.jsx(K2,{answer:d,state:e,dispatch:t,onFix:n,onFocus:r,onOffer:o},d.id)),(l==null?void 0:l.kind)==="ask"&&h.jsxs("article",{className:"turn",children:[h.jsx(N0,{question:l.question}),h.jsx(Fe,{eyebrow:"Claude is working",tone:"ai",children:h.jsx(rh,{lines:l.progress,working:!0})})]}),!e.answers.length&&!l&&!u.length&&h.jsx("p",{className:"muted small thread-empty",children:"Ask anything about this map. Click a box or arrow first to ask about it."})]}),h.jsxs("footer",{className:"panel-foot",children:[u.length>0&&h.jsx(G2,{map:s,report:e.report,ids:u,compact:e.answers.length>0||(l==null?void 0:l.kind)==="ask"},u.join(" ")),i]})]})}function N0({question:e,about:t}){return h.jsxs("div",{className:"you",children:[h.jsx("p",{className:"you-q",children:e}),t&&h.jsxs("span",{className:"you-about",children:["About ",t]})]})}function K2({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(x=>it(s,x)).join(", "),c=hi(t).find(x=>x.answerId===e.id),f=e.problems.filter(x=>x.startsWith("The proposed fix")),d=e.problems.filter(x=>!x.startsWith("The proposed fix")),p=e.refs.filter(x=>{var k;return x.status!=="unknown"&&((k=fu(t.report,x.id))==null?void 0:k.status)==="unconfirmed"}).map(x=>x.id),y=e.moves.highlight.length>0||!!e.moves.focus||e.added.length>0||(e.screens??[]).length>0;return h.jsxs("article",{className:"turn",children:[h.jsx(N0,{question:e.question,about:u||void 0}),e.offer?h.jsx(Q2,{answer:e,busy:!!t.job,onOffer:i}):h.jsxs("section",{className:dn("card","reply",a&&"card-focus"),children:[h.jsxs("div",{className:"reply-meta",children:[h.jsx("span",{children:e.source==="map"?"From the map":"Looked in the code"}),y&&(a?h.jsx("span",{className:"reply-lit",children:"Lit on the map"}):h.jsx("button",{className:"link-btn small",onClick:()=>n({type:"show",answerId:e.id}),children:"Show on the map"}))]}),h.jsx(Jo,{text:e.concept,className:"depth-text"}),(e.screens??[]).map(x=>{const k=Zo(t.report,x);return k?h.jsx(Mc,{show:k,name:it(s,x)},x):null}),p.length>0&&h.jsxs("p",{className:"warn small reply-warn",children:["Relies on ",p.length===1?"1 thing":`${p.length} things`," the checker couldn't confirm:"," ",p.map((x,k)=>h.jsxs("span",{children:[k>0&&", ",h.jsx("button",{className:"link-btn small",title:"Show it on the map",onClick:()=>o(x),children:it(s,x)})]},x))]}),c&&h.jsxs("div",{className:"reply-added",children:[h.jsxs("span",{children:["Added ",c.ids.length," to the map"]}),h.jsx("button",{className:"link-btn small",onClick:()=>n({type:"layer",answerId:e.id,visible:!c.visible}),children:c.visible?"Hide":"Show"})]}),d.length>0&&h.jsxs("details",{className:"problems-box",children:[h.jsxs("summary",{children:[d.length," thing",d.length===1?"":"s"," Claude found but couldn't confirm or show"]}),h.jsx("ul",{className:"problems",children:d.map(x=>h.jsx("li",{children:x},x))})]})]}),l&&h.jsx(Y2,{fix:l,map:s,onApprove:()=>r(l.proposal.id,"approve"),onReject:()=>r(l.proposal.id,"reject"),onUndo:()=>r(l.proposal.id,"undo")}),f.length>0&&h.jsxs(Fe,{eyebrow:"The proposed fix can't be applied",tone:"dead",children:[h.jsx("ul",{className:"problems",children:f.map(x=>h.jsx("li",{children:x.replace("The proposed fix can't be applied: ","")},x))}),h.jsx("p",{className:"muted small",children:"Ask again, or ask for a smaller change."})]})]})}function Q2({answer:e,busy:t,onOffer:n}){const r=e.offer;return r.status==="mapped"?h.jsxs(Fe,{eyebrow:"A different part of the app",children:[h.jsx("p",{className:"muted",children:"You made a new map for this."}),r.mapId&&h.jsx("div",{className:"btns",children:h.jsx("a",{className:"btn primary",href:Mt(r.mapId),children:"Open it"})})]}):r.status==="answered"?h.jsx(Fe,{eyebrow:"A different part of the app",children:h.jsx("p",{className:"muted",children:"Answered in words, below."})}):h.jsxs(Fe,{eyebrow:"A different part of the app",tone:"ai",children:[h.jsx("p",{children:"This is about a different part of the app than this map shows."}),r.existing&&h.jsxs("p",{children:["There's already a map for it: “",r.existing.question,"”."]}),h.jsxs("div",{className:"btns",children:[r.existing&&h.jsx("a",{className:"btn primary",href:Mt(r.existing.id),children:"Open that map"}),h.jsx("button",{className:r.existing?"btn":"btn primary",onClick:()=>n(e.id,"map"),children:"Make a new map for this"}),h.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 G2({map:e,report:t,ids:n,compact:r}){var g,w,N,S,_;const[o,i]=b.useState(!r);if(n.length>1)return h.jsx(Fe,{eyebrow:`Asking about ${n.length} things`,className:"card-selected",children:h.jsx(U2,{map:e,ids:n.map(C=>{var I;return{id:C,status:((I=fu(t,C))==null?void 0:I.status)??"unknown"}}),onPick:()=>{}})});const s=n[0],l=e.nodes.find(C=>C.id===s),a=e.edges.find(C=>C.id===s),u=e.absences.find(C=>C.id===s),c=fu(t,s),f=(l==null?void 0:l.evidence)??(a==null?void 0:a.evidence)??[],d=c&&"evidence"in c&&c.evidence?c.evidence:[],p=l?"Step":a?"Connection":"Missing connection",y=(c==null?void 0:c.proposal)??null,x=(w=(g=l??a)==null?void 0:g.proposed)==null?void 0:w.note,k=c&&"change"in c?c.change??null:null,m=((S=(N=t==null?void 0:t.since)==null?void 0:N.commit)==null?void 0:S.slice(0,7))??"the commit this map is compared with",v=u?(t==null?void 0:t.absences[u.id])??null:null;return o?h.jsxs(Fe,{eyebrow:p,title:it(e,s),tone:u?"dead":void 0,className:"card-selected",children:[r&&h.jsx("button",{className:"link-btn small selected-hide",onClick:()=>i(!1),children:"Hide details"}),((_=l==null?void 0:l.explain)==null?void 0:_.concept)&&h.jsx(Jo,{text:l.explain.concept,className:"depth-text"}),l&&Zo(t,l.id)&&h.jsx(Mc,{show:Zo(t,l.id),name:l.name}),y&&h.jsxs("div",{className:dn("proposal-note",`proposal-note-${y.state}`),children:[h.jsx("strong",{children:V2[y.kind][y.state]}),x&&h.jsxs(h.Fragment,{children:[" ",x]})]}),k&&h.jsxs("div",{className:dn("change-note",`change-note-${k.kind}`),children:[h.jsxs("strong",{children:[W2[k.kind]," ",m,"."]}),k.kind==="changed"&&!k.diff&&" A line it cites wasn’t there then.",k.kind==="removed"&&" It was in the code then and is gone now.",k.diff&&h.jsx("pre",{className:"diff",children:k.diff.map((C,I)=>h.jsxs("span",{className:C.startsWith("+ ")?"add":C.startsWith("- ")?"del":"",children:[C,`
70
- `]},I))})]}),u&&v&&h.jsxs("p",{children:[v.found>u.matches?"This may no longer be missing: the search below now finds something.":"Nothing in the code connects these, going by this search."," ","Searched ",v.searched??"?"," ",v.searched===1?"file":"files",u.search.paths?h.jsxs(h.Fragment,{children:[" in ",h.jsx("code",{children:u.search.paths.join(", ")})]}):" (the whole repo)"," for ",h.jsx("code",{children:u.search.pattern}),": ",v.found," ",v.found===1?"match":"matches","."]}),c&&c.status==="unconfirmed"&&h.jsxs("div",{className:"warn small",children:["Couldn't confirm against the code: ",c.reasons.join("; ")]}),f.length>0&&h.jsxs("div",{className:"basis",children:[h.jsx("div",{className:"eyebrow",children:(k==null?void 0:k.kind)==="removed"?`In the code as it was at ${m}`:"In the code"}),h.jsx("div",{className:"chips",children:f.map((C,I)=>{var D,H;const R=((D=d[I])==null?void 0:D.ok)??!1;return h.jsxs("span",{className:dn("chip static",!R&&"chip-unconfirmed"),children:[h.jsx("span",{className:R?"tick":"qmark",children:R?"✓":"?"}),C.file,":",((H=d[I])==null?void 0:H.foundAt)??C.line]},I)})})]})]}):h.jsxs("div",{className:dn("selected-line",u&&"selected-line-dead"),children:[h.jsx("span",{className:"eyebrow",children:p}),h.jsx("span",{className:"selected-name",children:it(e,s)}),h.jsx("button",{className:"link-btn small",onClick:()=>i(!0),children:"Details"})]})}function q2({map:e,selection:t,draft:n,busy:r,autoFocus:o,onDraft:i,onRemove:s,onSend:l}){const a=b.useRef(null),u=["nodes","edges","absences"].flatMap(c=>t[c].map(f=>({kind:c,id:f})));return b.useEffect(()=>{const c=a.current;c&&(c.style.height="auto",c.style.height=`${Math.min(c.scrollHeight,140)}px`)},[n]),b.useEffect(()=>{var c;n&&((c=a.current)==null||c.focus())},[n===""]),b.useEffect(()=>{var c;o&&((c=a.current)==null||c.focus({preventScroll:!0}))},[]),h.jsxs("form",{className:"composer",onSubmit:c=>{c.preventDefault(),!r&&n.trim()&&l()},children:[u.map(c=>h.jsxs("span",{className:`sel-chip sel-${c.kind}`,children:[h.jsxs("span",{className:"sel-text",title:it(e,c.id),children:[c.kind==="absences"?"✕ ":"◉ ",it(e,c.id)]}),h.jsx("button",{type:"button","aria-label":`Remove ${it(e,c.id)}`,onClick:()=>s(c.kind,c.id),children:"×"})]},`${c.kind}:${c.id}`)),h.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"}),h.jsx("button",{type:"submit",className:"send",disabled:r||!n.trim(),"aria-label":"Send",children:"↑"})]})}function Z2({map:e,tour:t,onTour:n,selected:r,children:o}){const i=e.tour.length,s=i>0&&t===null;return!s&&!o?null:h.jsxs("div",{className:"dock",children:[s&&h.jsxs("section",{className:"dock-part dock-walk","aria-label":"Walkthrough",children:[h.jsx("h2",{className:"dock-title",children:"Walkthrough"}),h.jsxs("button",{className:"dock-start",onClick:()=>n(0),children:["Take the walkthrough ",h.jsxs("span",{className:"muted",children:[i," ",i===1?"stop":"stops"]})]})]}),o&&h.jsxs("section",{className:"dock-part dock-ask","aria-label":"Ask about the map",children:[h.jsxs("div",{className:"dock-head",children:[h.jsx("h2",{className:"dock-title",children:"Ask about the map"}),h.jsx("span",{className:"dock-hint",children:r?"Shift-click to add more":"Click a box or arrow to ask about it"})]}),o]})]})}function J2({state:e,dispatch:t}){const n=e.answers[e.answers.length-1];return n?h.jsx("div",{className:"history-corner",children:h.jsxs("button",{className:"pill-btn history-btn",onClick:()=>t({type:"show",answerId:n.id}),title:"Open the conversation about this map",children:["Conversation ",h.jsx("span",{className:"muted",children:e.answers.length})]})}):null}const eC="modulepreload",tC=function(e){return"/"+e},oh={},nC=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=tC(a),a in oh)return;oh[a]=!0;const u=a.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${c}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":eC,u||(f.as="script"),f.crossOrigin="",f.href=a,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((d,p)=>{f.addEventListener("load",d),f.addEventListener("error",()=>p(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)})},Bn=232,Rn=96;function Bs(e,t){var i;const n=((i=e.nodes[t])==null?void 0:i.y)??0,r=e.rowTops??[];let o=0;for(const[s,l]of r.entries())n>=l-1&&(o=s);return o}const rC=132;function ih(e,t=!1){return e==="choice"?{w:196,h:132}:e==="action"?{w:196,h:60}:t?{w:232,h:64+rC}:{w:196,h:72}}let oC=null;const $c=()=>oC??(oC=nC(()=>import("./elk.bundled-Cc32fJO7.js").then(e=>e.e),[]).then(e=>new e.default)),Pc={"elk.algorithm":"layered","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.considerModelOrder.strategy":"NODES_AND_EDGES"};function Ic(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 ht={top:52,side:26,bottom:26},ar=64,is=44,iC=56,sC=140;async function _0(e,t,n,r){const o=await e.layout({id:t,layoutOptions:{...Pc,"elk.direction":"DOWN","elk.padding":`[top=${ht.top},left=${ht.side},bottom=${ht.bottom},right=${ht.side}]`,"elk.layered.spacing.nodeNodeBetweenLayers":String(ar),"elk.spacing.nodeNode":String(is)},children:n.map(s=>({id:s.id,width:Bn,height:Rn})),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:Bn,h:Rn};return{nodes:i,size:{w:o.width??Bn+2*ht.side,h:o.height??Rn+ht.top+ht.bottom}}}function lC(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 aC(e,t=[],n=new Set,r=new Set){var N;if(e.view==="journey")return uC(e,t,r);const o=e.nodes.filter(S=>n.has(S.id));if(!o.length)return lh(e,t);const i=lC(e,n),s=new Set(i.nodes.map(S=>S.id)),l=await lh(i,t.filter(S=>s.has(S.from)&&s.has(S.to))),a=await $c(),u=Object.fromEntries(Object.entries(l.areas).map(([S,_])=>[S,{..._}])),c={...l.nodes},f={},d={};for(const S of o)(d[N=S.area]??(d[N]=[])).push(S);for(const[S,_]of Object.entries(d)){const C=u[S];if(!C)continue;const I=Math.max(1,Math.floor((C.w-2*ht.side+is)/(Bn+is))),R=Math.max(ht.top-ar,...i.nodes.filter(H=>H.area===S).map(H=>{var F;return(((F=c[H.id])==null?void 0:F.y)??0)+Rn}))+ar;_.forEach((H,F)=>{c[H.id]={x:ht.side+F%I*(Bn+is),y:R+Math.floor(F/I)*(Rn+ar),w:Bn,h:Rn}});const D=Math.max(C.h,R+Math.ceil(_.length/I)*(Rn+ar)-ar+ht.bottom);f[S]=D-C.h,C.h=D}const p=Object.fromEntries(Object.entries(l.areas).map(([S,_])=>[S,_])),y=Object.keys(p).sort((S,_)=>p[S].y-p[_].y),x={};for(const S of y){const _=p[S];x[S]=Math.max(0,...y.filter(C=>C!==S&&x[C]!==void 0).filter(C=>{const I=p[C];return I.y+I.h<=_.y+1&&I.x<_.x+_.w&&_.x<I.x+I.w}).map(C=>x[C]+(f[C]??0))),u[S].y+=x[S]}const k=Ic(e,t),m=new Map(e.nodes.map(S=>[S.id,S.area])),v=Math.max(0,...Object.values(u).map(S=>S.x+S.w))+sC;let g=0;for(const S of e.areas){if(u[S.id])continue;const _=e.nodes.filter(R=>R.area===S.id);if(!_.length)continue;const C=k.filter(R=>m.get(R.from)===S.id&&m.get(R.to)===S.id),I=await _0(a,S.id,_,C);Object.assign(c,I.nodes),u[S.id]={x:v,y:g,w:I.size.w,h:I.size.h},g+=I.size.h+iC}const w=Object.values(u);return{areas:u,nodes:c,width:Math.max(0,...w.map(S=>S.x+S.w)),height:Math.max(0,...w.map(S=>S.y+S.h))}}const sh=1900,hu=130;async function uC(e,t,n){const o=await(await $c()).layout({id:"root",layoutOptions:{...Pc,"elk.direction":"RIGHT","elk.layered.cycleBreaking.strategy":"MODEL_ORDER","elk.layered.spacing.nodeNodeBetweenLayers":"176","elk.spacing.nodeNode":"56","elk.spacing.componentComponent":"72"},children:e.nodes.map(p=>({id:p.id,width:ih(p.kind,n.has(p.id)).w,height:ih(p.kind,n.has(p.id)).h})),edges:Ic(e,t).map(p=>({id:p.id,sources:[p.from],targets:[p.to]}))}),i={};for(const p of o.children??[])i[p.id]={x:p.x??0,y:p.y??0,w:p.width??0,h:p.height??0};const s=o.width??0;if(s<=sh)return{areas:{},nodes:i,width:s,height:o.height??0,flat:!0};const l=[];for(const[p,y]of Object.entries(i).sort((x,k)=>x[1].x+x[1].w/2-(k[1].x+k[1].w/2))){const x=l[l.length-1];x&&y.x+y.w/2<x.right?(x.ids.push(p),x.left=Math.min(x.left,y.x),x.right=Math.max(x.right,y.x+y.w)):l.push({left:y.x,right:y.x+y.w,ids:[p]})}const a=Math.ceil(s/sh),u=Math.ceil(l.length/a);let c=0,f=0;const d=[];for(let p=0;p*u<l.length;p++){const y=l.slice(p*u,(p+1)*u),x=y.flatMap(v=>v.ids),k=y[0].left,m=Math.min(...x.map(v=>i[v].y));d.push(c);for(const v of x)i[v]={...i[v],x:i[v].x-k,y:i[v].y-m+c};c=Math.max(...x.map(v=>i[v].y+i[v].h))+hu,f=Math.max(f,y[y.length-1].right-k)}return{areas:{},nodes:i,width:f,height:c-hu,flat:!0,rowTops:d}}async function lh(e,t){const n=await $c(),r=new Map(e.nodes.map(c=>[c.id,c.area])),o=Ic(e,t),i={},s={};for(const c of e.areas){const f=e.nodes.filter(y=>y.area===c.id);if(!f.length)continue;const d=o.filter(y=>r.get(y.from)===c.id&&r.get(y.to)===c.id),p=await _0(n,c.id,f,d);Object.assign(i,p.nodes),s[c.id]=p.size}const l=new Map;for(const c of o){const f=r.get(c.from),d=r.get(c.to);f!==d&&s[f]&&s[d]&&l.set(`${f}>${d}`,{from:f,to:d})}const a=await n.layout({id:"root",layoutOptions:{...Pc,"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,f)=>({id:`p${f}`,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 cC(e,t,n,r){if(t.flat){const c=y=>{const x=t.nodes[y];return x?{x:x.x+x.w/2,y:x.y+x.h/2}:{x:0,y:0}},f=c(r).x-c(n).x,d=c(r).y-c(n).y;if(Math.abs(f)<40)return d>=0?["b","t"]:["t","b"];const p=Bs(t,r)-Bs(t,n);return p?p>0?["b","t"]:["r","b"]:f>=0?["r","l"]:["l","r"]}const o=c=>{var f;return((f=e.nodes.find(d=>d.id===c))==null?void 0:f.area)??""},i=c=>{const f=t.areas[o(c)],d=t.nodes[c];return f&&d?{x:f.x+d.x+d.w/2,y:f.y+d.y+d.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)<Bn*.75?u>=0?["b","t"]:["t","b"]:a>=0?["r","l"]:["l","r"]}function dC(e,t=[],n=[],r=[]){return JSON.stringify([e.view==="journey"?[e.nodes.map(o=>o.kind),[...r].sort()]:null,[...n].sort(),e.areas.map(o=>o.id),e.nodes.map(o=>`${o.id}@${o.area}`),e.edges.map(o=>`${o.from}>${o.to}`),e.absences.map(o=>o.between?`${o.between.from}~${o.between.to}`:""),t.map(o=>`${o.from}+${o.to}`)])}const Sn=(...e)=>e.filter(Boolean).join(" "),Vn={add:{pending:"Proposed",done:"Now in the code",mark:"+",title:"Proposed: not in the code yet"},change:{pending:"Would change",done:"Changed",mark:"~",title:"Proposed: this code would change"},remove:{pending:"Would be removed",done:"Removed",mark:"−",title:"Proposed: this code would be removed"}},vl=e=>e&&`proposal proposal-${e.kind} proposal-${e.state}`,Wn={added:{label:"Added",mark:"+",title:"New since the commit this map is compared with"},changed:{label:"Changed",mark:"~",title:"Different from the commit this map is compared with"},removed:{label:"Removed",mark:"−",title:"Was in the code at the commit this map is compared with, and is gone now"}},xl=e=>e&&`change change-${e}`,Vs={later:{label:"Not there yet",title:"Added after this version of the code"},gone:{label:"Gone",title:"Removed: it was in the code before, and isn’t now"}};function fC(e){if(!(e!=null&&e.length))return null;const t=e.filter(r=>r.startsWith("+ ")).length,n=e.filter(r=>r.startsWith("- ")).length;return[t&&`+${t}`,n&&`−${n}`].filter(Boolean).join(" ")||null}const hC=[["before","Before","The code as it was at that commit; what was added since is a shadow"],["after","After","The code as it is now; what was removed is a shadow"],["both","Both","The code as it is now, with what was removed drawn in too"]];function pC({commit:e,when:t,onWhen:n}){return h.jsxs("div",{className:"change-key",children:[h.jsx("div",{className:"seg",role:"group","aria-label":"Which version of the code to show",children:hC.map(([r,o,i])=>h.jsx("button",{className:Sn("seg-btn",t===r&&"on"),title:i,"aria-pressed":t===r,onClick:()=>n(r),children:o},r))}),h.jsx("span",{className:"change-key-title",children:t==="before"?`The code at ${e}`:t==="after"?"The code now":`Now, compared with ${e}`}),t==="both"&&h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:"key-swatch"}),"Same as before"]}),t==="both"&&h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:"key-swatch key-added"}),"Added"]}),h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:Sn("key-swatch key-changed",t!=="both"&&"key-quiet")}),t==="before"?"Changes later":"Changed"]}),t==="both"&&h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:"key-swatch key-removed"}),"Removed (only in the before)"]}),t!=="both"&&h.jsxs("span",{className:"key-item",children:[h.jsx("i",{className:"key-swatch key-ghost"}),t==="before"?"Not there yet":"Gone"]})]})}const Hi={entry:["Where it starts","▸"],store:["Saved data","▤"],external:["Outside the app","↗"],job:["Background job","◷"]},ah=[["t",Z.Top],["r",Z.Right],["b",Z.Bottom],["l",Z.Left]];function C0(){return h.jsxs(h.Fragment,{children:[ah.map(([e,t])=>h.jsx(Wr,{id:`s${e}`,type:"source",position:t,className:"handle",isConnectable:!1},`s${e}`)),ah.map(([e,t])=>h.jsx(Wr,{id:`t${e}`,type:"target",position:t,className:"handle",isConnectable:!1},`t${e}`))]})}function mC({data:e}){var t,n,r;return e.journey?h.jsx(gC,{data:e}):h.jsxs("div",{className:Sn("step","nopan",`kind-${e.kind}`,!e.confirmed&&"unconfirmed",vl(e.proposal),xl(e.change),e.quiet&&"quiet",e.ghost&&"ghost",e.selected&&"selected",e.hl&&"hl",e.dim&&"dim"),onClick:o=>{o.stopPropagation(),e.onClick(o.shiftKey||o.metaKey)},children:[h.jsx(C0,{}),(Hi[e.kind]||e.fresh||e.screen||e.proposal||e.change||e.ghost)&&h.jsxs("div",{className:"step-head",children:[e.ghost&&h.jsx("span",{className:"badge-ghost",title:Vs[e.ghost].title,children:Vs[e.ghost].label}),e.proposal&&h.jsx("span",{className:"badge-proposal",children:Vn[e.proposal.kind][e.proposal.state]}),e.change&&h.jsxs("span",{className:"badge-change",title:Wn[e.change].title,children:[e.quiet==="before"?"Changes later":Wn[e.change].label,e.changeSize&&!e.quiet&&h.jsxs("span",{className:"change-size",children:[" ",e.changeSize]})]}),Hi[e.kind]&&!e.proposal&&!e.change&&!e.ghost&&h.jsxs(h.Fragment,{children:[h.jsx("i",{className:"step-mark","aria-hidden":"true",children:Hi[e.kind][1]}),Hi[e.kind][0]]}),e.screen&&h.jsx("span",{className:"badge-screen",title:"Select this step to see the screen",children:"▣ Screen"}),e.fresh&&h.jsx("span",{className:"badge-new",children:"New"})]}),h.jsx("div",{className:"step-name",title:e.name,children:e.name}),h.jsxs("div",{className:"step-code",title:((t=e.proposal)==null?void 0:t.state)==="pending"?Vn[e.proposal.kind].title:e.confirmed?"Confirmed against the code":"The checker couldn't confirm this against the code",children:[((n=e.proposal)==null?void 0:n.state)==="pending"&&e.proposal.kind==="add"?h.jsx("span",{className:"pmark",children:"+"}):((r=e.proposal)==null?void 0:r.state)==="done"&&e.proposal.kind!=="add"?h.jsx("span",{className:"pmark",children:Vn[e.proposal.kind].mark}):e.change&&e.confirmed?h.jsx("span",{className:"cmark",children:Wn[e.change].mark}):h.jsx("span",{className:e.confirmed?"tick":"qmark",children:e.confirmed?"✓":"?"}),h.jsx("span",{className:"step-sub",children:e.sub})]})]})}function gC({data:e}){const t=e.journey,n=e.proposal;return h.jsxs("div",{className:Sn("step","jstep","nopan",`j-${t.shape}`,t.show&&"j-pictured",t.outside&&"j-outside",!e.confirmed&&"unconfirmed",vl(n),xl(e.change),e.quiet&&"quiet",e.ghost&&"ghost",e.selected&&"selected",e.hl&&"hl",e.dim&&"dim"),style:{width:t.w,height:t.h},onClick:r=>{r.stopPropagation(),e.onClick(r.shiftKey||r.metaKey)},children:[h.jsx(C0,{}),t.stage&&h.jsx("div",{className:"j-stage",children:t.stage}),t.shape==="choice"&&h.jsx("svg",{className:"j-diamond",viewBox:"0 0 100 100",preserveAspectRatio:"none","aria-hidden":"true",children:h.jsx("polygon",{points:"50,1 99,50 50,99 1,50",vectorEffect:"non-scaling-stroke"})}),h.jsxs("div",{className:"j-tags",children:[n&&h.jsx("span",{className:"badge-proposal",children:Vn[n.kind][n.state]}),e.ghost&&h.jsx("span",{className:"badge-ghost",title:Vs[e.ghost].title,children:Vs[e.ghost].label}),e.change&&h.jsx("span",{className:"badge-change",title:Wn[e.change].title,children:e.quiet==="before"?"Changes later":Wn[e.change].label}),!e.confirmed&&h.jsx("span",{className:"j-q",title:"The checker couldn't confirm this against the code",children:"?"}),e.fresh&&h.jsx("span",{className:"badge-new",children:"New"})]}),t.show&&h.jsx(I2,{show:t.show,name:e.name}),h.jsx("div",{className:"j-name",title:e.name,children:e.name}),t.outside&&t.shape!=="choice"&&h.jsx("div",{className:"j-note",children:"Outside the app"})]})}function yC({data:e}){return h.jsx("div",{className:Sn("area",e.dim&&"dim"),children:h.jsxs("div",{className:"area-label",children:[e.label,e.note&&h.jsxs("span",{className:"area-note",children:[" ",e.note]})]})})}function vC(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 xC(e,t=18){let n=`M ${e[0][0]} ${e[0][1]}`;for(let i=1;i<e.length-1;i++){const[s,l]=e[i-1],[a,u]=e[i],[c,f]=e[i+1],d=Math.min(t,Math.hypot(a-s,u-l)/2),p=Math.min(t,Math.hypot(c-a,f-u)/2),y=Math.sign(a-s),x=Math.sign(u-l),k=Math.sign(c-a),m=Math.sign(f-u);n+=` L ${a-y*d} ${u-x*d} Q ${a} ${u} ${a+k*p} ${u+m*p}`}const r=e[e.length-1];n+=` L ${r[0]} ${r[1]}`;let o=[0,e[0][0],e[0][1]];for(let i=1;i<e.length;i++){const[s,l]=e[i-1],[a,u]=e[i];l===u&&Math.abs(a-s)>o[0]&&(o=[Math.abs(a-s),(s+a)/2,u])}return[n,o[1],o[2]]}function wC({id:e,sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:i,targetPosition:s,markerEnd:l,data:a}){const[u,c,f]=(a==null?void 0:a.wrapY)!==void 0&&i===Z.Right?xC([[t,n],[t+30,n],[t+30,a.wrapY],[r,a.wrapY],[r,o]]):(a==null?void 0:a.wrapY)!==void 0?Os({sourceX:t,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:s,borderRadius:18,centerY:a.wrapY}):a!=null&&a.offset?vC(t,n,r,o,a.offset):kc({sourceX:t,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:s});return a?h.jsxs(h.Fragment,{children:[a.selected&&h.jsx("path",{d:u,className:"edge-halo"}),h.jsx(fi,{id:e,path:u,markerEnd:l,interactionWidth:18}),h.jsx(J_,{children:h.jsxs("div",{className:Sn("link-label",`link-${a.variant}`,!a.confirmed&&"unconfirmed",vl(a.proposal),xl(a.change),a.ghost&&"ghost",a.hl&&"hl",a.dim&&"dim",a.selected&&"selected","nodrag nopan"),style:{transform:`translate(-50%, -50%) translate(${c}px, ${f}px)`},onClick:d=>{var p;d.stopPropagation(),(p=a.onClick)==null||p.call(a,d.shiftKey||d.metaKey)},children:[a.variant==="absence"&&h.jsx("span",{className:"gap-q","aria-hidden":"true",children:"?"}),a.proposal&&h.jsx("span",{className:"pmark",title:a.proposal.state==="done"?Vn[a.proposal.kind].done:Vn[a.proposal.kind].title,children:a.proposal.state==="done"&&a.proposal.kind==="add"?"✓":Vn[a.proposal.kind].mark}),a.change&&h.jsx("span",{className:"cmark",title:Wn[a.change].title,children:Wn[a.change].mark}),h.jsx("span",{className:"link-text",children:a.label}),!a.confirmed&&a.variant==="edge"&&h.jsx("span",{className:"q",children:" ?"})]})})]}):null}const kC={step:mC,area:yC},SC={link:wC};function uh(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 EC="440px",NC=`${$2+40}px`,_C=e=>e.length>28?`${e.slice(0,26)}…`:e;function CC(e){var C,I,R,D,H,F,E,L;const t=(C=e.ghost)!=null&&C.connects&&e.map.nodes.some(M=>M.id===e.ghost.connects.from)&&e.map.nodes.some(M=>M.id===e.ghost.connects.to)?e.ghost:null,n=b.useMemo(()=>t!=null&&t.connects?[{id:t.id,from:t.connects.from,to:t.connects.to}]:[],[t]),r=b.useMemo(()=>e.map.view==="journey"?e.map.nodes.filter(M=>{var T,P,$;return M.kind!=="action"&&M.kind!=="choice"&&(($=(P=(T=e.report)==null?void 0:T.screens)==null?void 0:P[M.id])==null?void 0:$.status)==="confirmed"}).map(M=>M.id):[],[e.map,e.report]),o=dC(e.map,n,e.added,r),[i,s]=b.useState(null),l=gl(),[a,u]=b.useState("both"),f=!!((R=(I=e.report)==null?void 0:I.since)!=null&&R.commit)?a:"both",d=M=>{var T,P,$,z,j,A;return(($=(P=(T=e.report)==null?void 0:T.nodes[M])==null?void 0:P.change)==null?void 0:$.kind)??((A=(j=(z=e.report)==null?void 0:z.edges[M])==null?void 0:j.change)==null?void 0:A.kind)??null},p=M=>f==="before"&&d(M)==="added"?"later":f==="after"&&d(M)==="removed"?"gone":null,y=M=>f==="both"||M==="changed"?M:null;b.useEffect(()=>{let M=!0;return aC(e.map,n,new Set(e.added),new Set(r)).then(T=>M&&s({key:o,layout:T})),()=>{M=!1}},[o]);const x=(D=e.view)!=null&&D.highlight.length?new Set(e.view.highlight):null,k=b.useMemo(()=>x?new Set(uh(e.map,[...x])):null,[x,e.map]),m=e.selection,v=b.useMemo(()=>{if(!i)return[];const M=i.layout,T=j=>!k||e.map.nodes.some(A=>A.area===j&&k.has(A.id)),P=e.map.areas.flatMap(j=>{const A=M.areas[j.id];return A?[{id:`area:${j.id}`,type:"area",position:{x:A.x,y:A.y},style:{width:A.w,height:A.h},data:{label:j.label,note:null,dim:!T(j.id)},selectable:!1,draggable:!1,zIndex:0}]:[]}),$=new Map;if(M.flat)for(const j of e.map.areas){const A=e.map.nodes.filter(V=>V.area===j.id&&M.nodes[V.id]).sort((V,U)=>M.nodes[V.id].x-M.nodes[U.id].x||M.nodes[V.id].y-M.nodes[U.id].y)[0];A&&$.set(A.id,j.label)}const z=e.map.nodes.flatMap(j=>{var G,B,X,O,Y,q,J,Q,ee,te,ne,re,se,Ne,ze;const A=M.nodes[j.id];if(!A)return[];const V=j.evidence[0],U=j.symbol?j.symbol.slice(j.symbol.indexOf("#")+1):V?`${V.file.split("/").pop()}:${V.line}`:"not in the code yet";return[{id:j.id,type:"step",...M.flat?{}:{parentId:`area:${j.area}`,extent:"parent"},position:{x:A.x,y:A.y},data:{name:j.name,sub:U,kind:j.kind,confirmed:!!e.report&&((G=e.report.nodes[j.id])==null?void 0:G.status)!=="unconfirmed",proposal:((X=(B=e.report)==null?void 0:B.nodes[j.id])==null?void 0:X.proposal)??null,screen:((q=(Y=(O=e.report)==null?void 0:O.screens)==null?void 0:Y[j.id])==null?void 0:q.status)==="confirmed",selected:m.nodes.includes(j.id),hl:!!(k!=null&&k.has(j.id)),dim:!!k&&!k.has(j.id),fresh:e.fresh.includes(j.id),change:y(((ee=(Q=(J=e.report)==null?void 0:J.nodes[j.id])==null?void 0:Q.change)==null?void 0:ee.kind)??null),changeSize:fC((re=(ne=(te=e.report)==null?void 0:te.nodes[j.id])==null?void 0:ne.change)==null?void 0:re.diff),ghost:p(j.id),quiet:f==="both"?null:f,...M.flat&&{journey:{w:A.w,h:A.h,shape:j.kind==="choice"?"choice":j.kind==="action"?"action":"screen",outside:j.kind==="external",stage:$.get(j.id)??null,show:r.includes(j.id)?((ze=(Ne=(se=e.report)==null?void 0:se.screens)==null?void 0:Ne[j.id])==null?void 0:ze.show)??null:null}},onClick:et=>e.onSelect("nodes",j.id,et)},draggable:!1,zIndex:1}]});return[...P,...z]},[i,e.map,e.report,m,k,e.fresh,e.onSelect,r,f]),g=b.useMemo(()=>{var U,G;if(!i)return[];const M=B=>({type:Ko.ArrowClosed,width:16,height:16,color:B}),T=B=>!!(x!=null&&x.has(B)),P=(B,X)=>{const[O,Y]=cC(e.map,i.layout,B,X);return{sourceHandle:`s${O}`,targetHandle:`t${Y}`}},$=new Map,z=(B,X)=>{const O=i.layout.rowTops,Y=Bs(i.layout,B),q=Bs(i.layout,X);if(!O||Y===q)return;const J=Math.max(Y,q),Q=$.get(J)??0;return $.set(J,Q+1),O[J]-hu/2+(Q%2?1:-1)*Math.ceil(Q/2)*18},j=e.map.edges.map(B=>{var ee,te,ne,re,se,Ne;const X=!!e.report&&((ee=e.report.edges[B.id])==null?void 0:ee.status)!=="unconfirmed",O=((ne=(te=e.report)==null?void 0:te.edges[B.id])==null?void 0:ne.proposal)??null,Y=y(((Ne=(se=(re=e.report)==null?void 0:re.edges[B.id])==null?void 0:se.change)==null?void 0:Ne.kind)??null),q=p(B.id)??p(B.from)??p(B.to),J=T(B.id)||!!k&&k.has(B.from)&&k.has(B.to)&&!x,Q="edge";return{id:`e:${B.id}`,source:B.from,target:B.to,...P(B.from,B.to),type:"link",className:Sn("link",`link-${Q}`,!X&&"unconfirmed",vl(O),xl(Y),q&&"ghost",T(B.id)&&"hl",!!x&&!T(B.id)&&"dim",m.edges.includes(B.id)&&"selected"),markerEnd:M(q?"var(--line)":(O==null?void 0:O.state)==="pending"&&O.kind!=="remove"?"var(--ai)":Y==="added"?"var(--ok)":Y==="removed"?"var(--dead)":T(B.id)?"var(--path)":"var(--line-strong)"),zIndex:2,data:{label:B.label,wrapY:z(B.from,B.to),variant:Q,proposal:O,change:Y,ghost:q,confirmed:X,hl:J,dim:!!x&&!T(B.id),selected:m.edges.includes(B.id),onClick:ze=>e.onSelect("edges",B.id,ze)}}}),A=B=>{var X;return((X=t==null?void 0:t.connects)==null?void 0:X.from)===B.from&&t.connects.to===B.to};for(const B of e.map.absences){if(!B.between||A(B.between))continue;const X=((G=(U=e.report)==null?void 0:U.absences[B.id])==null?void 0:G.status)==="confirmed";j.push({id:`a:${B.id}`,hidden:f==="before",source:B.between.from,target:B.between.to,...P(B.between.from,B.between.to),type:"link",className:Sn("link","link-absence",!X&&"unconfirmed",T(B.id)&&"hl",!!x&&!T(B.id)&&"dim",m.absences.includes(B.id)&&"selected"),markerEnd:M("var(--dead)"),zIndex:2,data:{label:_C(B.claim),variant:"absence",confirmed:X,hl:T(B.id),dim:!!x&&!T(B.id),selected:m.absences.includes(B.id),onClick:O=>e.onSelect("absences",B.id,O)}})}t!=null&&t.connects&&j.push({id:`g:${t.id}`,source:t.connects.from,target:t.connects.to,...P(t.connects.from,t.connects.to),type:"link",className:"link link-ghost",markerEnd:M("var(--ok)"),zIndex:3,data:{label:`+ ${t.connects.label}`,variant:"ghost",confirmed:!0,hl:!0,dim:!1,selected:!1}});const V=new Map;for(const B of j){const X=[B.source,B.target].sort().join("|");V.set(X,[...V.get(X)??[],B])}for(const B of V.values())B.length<2||B.forEach((X,O)=>{X.data&&(X.data.offset=(O-(B.length-1)/2)*44)});return j},[i,e.map,e.report,m,x,k,t,e.onSelect,f]),w=ie(M=>M.width),N=b.useRef(0);b.useEffect(()=>{const M=N.current;if(N.current=w,!M||!w||M===w)return;const T=l.getViewport();l.setViewport({...T,x:T.x+(w-M)/2})},[w]);const S=JSON.stringify([i==null?void 0:i.key,(H=e.view)==null?void 0:H.focus,(F=e.view)==null?void 0:F.highlight,e.touring,e.tourWide]),_=b.useRef(!0);return b.useEffect(()=>{if(!i)return;const M=e.view?uh(e.map,e.view.highlight.length?e.view.highlight:e.view.focus?[e.view.focus]:[]):[];let T=0,P=0;const $=()=>{const z=l.getNodes();if(T<2||!z.length||!z.every(V=>{var U,G;return(G=(U=l.getInternalNode(V.id))==null?void 0:U.measured)==null?void 0:G.width})){T++<60&&(P=requestAnimationFrame($));return}const j=_.current?0:650;_.current=!1;const A=M.length?{top:"60px",left:e.touring?e.tourWide?NC:EC:"60px",right:"60px",bottom:"150px"}:{top:"64px",left:"32px",right:"32px",bottom:"130px"};l.fitView(M.length?{nodes:M.map(V=>({id:V})),duration:j,padding:A,maxZoom:1.15}:{duration:j,padding:A,maxZoom:1.1})};return P=requestAnimationFrame($),()=>cancelAnimationFrame(P)},[S]),h.jsxs(q_,{className:i!=null&&i.layout.flat?"journey":void 0,nodes:v,edges:g,nodeTypes:kC,edgeTypes:SC,onNodeClick:()=>{},onEdgeClick:(M,T)=>{T.id.startsWith("e:")&&e.onSelect("edges",T.id.slice(2),M.shiftKey||M.metaKey),T.id.startsWith("a:")&&e.onSelect("absences",T.id.slice(2),M.shiftKey||M.metaKey)},onPaneClick:e.onClear,panOnDrag:!0,elementsSelectable:!1,nodesDraggable:!1,nodesConnectable:!1,minZoom:.15,maxZoom:2,children:[h.jsx(o2,{variant:Wt.Dots,gap:22,size:1.3}),((L=(E=e.report)==null?void 0:E.since)==null?void 0:L.commit)&&h.jsx(di,{position:"top-left",children:h.jsx(pC,{commit:e.report.since.commit.slice(0,7),when:f,onWhen:u})})]})}function wl(e){e!==`${location.pathname}${location.search}`&&(history.pushState(null,"",e),window.dispatchEvent(new PopStateEvent("popstate")))}function jC(){const[e,t]=b.useState(location.pathname);return b.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(),wl(`${i.pathname}${i.search}`))};return window.addEventListener("popstate",n),document.addEventListener("click",r),()=>{window.removeEventListener("popstate",n),document.removeEventListener("click",r)}},[]),e}function j0({busy:e,onStopped:t,onError:n}){return h.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 MC(){return h.jsxs("main",{className:"home",children:[h.jsx("h1",{children:"illuminate has stopped"}),h.jsx("p",{className:"muted lede",children:"You can close this tab."}),h.jsxs("p",{className:"muted lede",children:["Maps are saved in ",h.jsx("code",{children:".illuminate/maps"}),". Run ",h.jsx("code",{children:"illume open"})," in the repo to see them again."]})]})}function $C({onStopped:e}){const[t,n]=b.useState(""),[r,o]=b.useState(null),[i,s]=b.useState([]),[l,a]=b.useState(""),[u,c]=b.useState(null),[f,d]=b.useState(!1);b.useEffect(()=>x0(()=>{},()=>{},e),[e]),b.useEffect(()=>{cn.list().then(y=>{n(y.repo),o(y.maps),s(y.making)},y=>c(y.message))},[]);const p=async()=>{if(l.trim()){d(!0);try{const{id:y}=await cn.make(l.trim());wl(Mt(y))}catch(y){c(y.message),d(!1)}}};return h.jsxs("main",{className:"home",children:[h.jsxs("div",{className:"home-brand",children:[h.jsx("i",{className:"brand-mark","aria-hidden":"true"}),"illuminate",t&&h.jsx("span",{className:"muted",children:t})]}),h.jsx("h1",{children:"Ask how your code works"}),h.jsx("p",{className:"muted lede",children:"Every box and arrow is checked against the code."}),h.jsxs("form",{className:"home-ask",onSubmit:y=>{y.preventDefault(),p()},children:[h.jsx("input",{id:"question",value:l,onChange:y=>a(y.target.value),placeholder:"What happens when a user signs up?","aria-label":"Your question",autoFocus:!0}),h.jsx("button",{className:"btn primary",disabled:f||!l.trim(),children:f?"Starting…":"Map it"})]}),u&&h.jsx("div",{className:"banner banner-dead",role:"alert",children:u}),i.length>0&&h.jsxs("section",{children:[h.jsx("h2",{className:"section-title",children:"Being made now"}),h.jsx("ul",{className:"maplist",children:i.map(y=>h.jsxs("li",{children:[h.jsx("a",{href:Mt(y.id),children:y.question}),h.jsx("span",{className:"muted small",children:"Claude is exploring…"})]},y.id))})]}),h.jsxs("section",{children:[h.jsx("h2",{className:"section-title",children:"Maps in this repo"}),r===null?h.jsx("p",{className:"muted",children:"Loading…"}):r.length===0?h.jsx("p",{className:"muted",children:"None yet."}):h.jsx("ul",{className:"maplist",children:r.map(y=>h.jsxs("li",{children:[h.jsx("a",{href:Mt(y.id),children:y.question}),h.jsxs("span",{className:"muted small",children:[new Date(y.updatedAt).toLocaleString(),y.commit?` · ${y.commit.slice(0,7)}`:""]})]},y.id))})]}),h.jsx("footer",{className:"home-foot",children:h.jsx(j0,{busy:i.length>0,onStopped:e,onError:c})})]})}const ch="illuminate-panel-width",pu=300,M0=400,PC=360,sa=e=>Math.round(Math.max(pu,Math.min(e,Math.max(pu,window.innerWidth-PC))));function IC(){const[e,t]=b.useState(()=>{const r=Number(localStorage.getItem(ch));return sa(r>0?r:M0)}),n=b.useCallback(r=>{const o=sa(r);t(o),localStorage.setItem(ch,String(o))},[]);return b.useEffect(()=>{const r=()=>t(o=>sa(o));return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),[e,n]}function TC({width:e,onWidth:t}){return h.jsx("div",{className:"panel-handle",role:"separator","aria-orientation":"vertical","aria-label":"Panel width","aria-valuenow":e,"aria-valuemin":pu,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(M0),onKeyDown:n=>{n.key==="ArrowLeft"&&(n.preventDefault(),t(e+24)),n.key==="ArrowRight"&&(n.preventDefault(),t(e-24))}})}const dh=(...e)=>e.filter(Boolean).join(" ");function bC({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=w0(e,t,i.focus.nodes??[]);return h.jsxs("section",{className:dh("card card-focus tour-bubble",(l==null?void 0:l.show.kind)==="wireframe"&&"tour-wide"),"aria-label":"Walkthrough","aria-live":"polite",children:[h.jsx("button",{className:"card-close","aria-label":"Leave the walkthrough",title:"Leave the walkthrough (Esc)",onClick:()=>r(null),children:"×"}),h.jsxs("div",{className:"tour-head",children:[h.jsxs("span",{className:"eyebrow",children:["Walkthrough, stop ",n+1," of ",e.tour.length]}),h.jsx("span",{className:"dots","aria-hidden":"true",children:e.tour.map((u,c)=>h.jsx("i",{className:dh(c===n&&"on",c<n&&"done")},u.id))})]}),h.jsx("h2",{className:"card-title",children:i.title}),h.jsx(Jo,{text:i.text,className:"depth-text"}),l&&h.jsx(Mc,{show:l.show,name:l.name}),(a=i.terms)!=null&&a.length?h.jsxs("p",{className:"muted small",children:["Terms: ",i.terms.join(", ")]}):null,h.jsxs("div",{className:"tour-nav",children:[h.jsx("button",{className:"btn",disabled:n===0,onClick:()=>r(n-1),children:"‹ Back"}),h.jsx("button",{className:"btn",onClick:()=>o(`About “${i.title}”: `),children:"Ask about this step"}),h.jsx("span",{className:"grow"}),s?h.jsx("button",{className:"btn primary",onClick:()=>r(null),children:"Done"}):h.jsx("button",{className:"btn primary",onClick:()=>r(n+1),children:"Next ›"})]}),h.jsx("div",{className:"kbd",children:"← → to step, Esc to leave"})]})}function zC(){return Ur?h.jsx(LC,{}):h.jsxs("main",{className:"home",children:[h.jsx("h1",{children:"Open illuminate from its link"}),h.jsxs("p",{className:"muted lede",children:["Use the link illuminate printed in your terminal (it ends in ",h.jsx("code",{children:"?t=…"}),")."]})]})}function LC(){const[e,t]=b.useState(!1),n=b.useCallback(()=>{window.close(),t(!0)},[]),r=jC();if(e)return h.jsx(MC,{});const o=/^\/m\/([a-z0-9-]{1,80})\/?$/.exec(r);return o?h.jsx(OC,{mapId:o[1],onStopped:n},o[1]):h.jsx($C,{onStopped:n})}function AC({mapId:e,question:t}){const[n,r]=b.useState([]);b.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 h.jsx("select",{className:"switcher",value:e,onChange:i=>wl(Mt(i.target.value)),"aria-label":"Switch to another map",title:"Switch to another map in this repo",children:o.map(i=>h.jsxs("option",{value:i.id,children:[i.question||i.id,i.making?" (being made)":""]},i.id))})}function RC({report:e}){if(!e)return null;const t=e.summary.unconfirmed,{pending:n,done:r}=e.summary.proposals??{pending:0,done:0},o=n+r,i=o?h.jsx("span",{className:"map-status proposals",title:"Parts of this map are a proposal, drawn in violet: they aren't in the code yet, or would change or go. illuminate checks the code to see which have been done.",children:r===0?`${o} proposed ${o===1?"change":"changes"}`:`${r} of ${o} proposed changes done`}):null,s=h.jsxs(h.Fragment,{children:[i,h.jsx(DC,{report:e})]});return t?h.jsxs(h.Fragment,{children:[h.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`}),s]}):h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"map-status ok",title:"Every box and arrow on this map was just re-checked and is really in the code, and every gap's search still finds nothing. That shows each part is real; it doesn't show the map covers everything.",children:"✓ Every part is in the code"}),s]})}function DC({report:e}){const t=e.since;if(!t)return null;if(!t.commit)return h.jsx("span",{className:"map-status off",title:`This map compares the code with "${t.ref}", but that isn't a commit in this repo, so nothing could be compared.`,children:"Can’t find the commit this map compares with"});const{added:n,changed:r,removed:o}=e.summary.changes??{added:0,changed:0,removed:0},i=t.date?new Date(t.date).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):null,s=[n&&`${n} added`,r&&`${r} changed`,o&&`${o} removed`].filter(Boolean).join(" · ");return h.jsxs("span",{className:"map-status changes",title:`This map shows the code as it is now, compared with commit ${t.commit.slice(0,7)}${t.subject?` ("${t.subject}")`:""}. illuminate works out from the two versions which boxes and arrows are new, different or gone. It can't tell who made a change.`,children:["Changes since ",t.commit.slice(0,7),i?` (${i})`:"",s?`: ${s}`:": nothing on this map differs"]})}function OC({mapId:e,onStopped:t}){var F,E,L,M,T,P,$,z;const[n,r]=b.useReducer(B2,e,R2),[o,i]=b.useState(""),[s,l]=IC(),a=b.useRef(!1),u=b.useCallback(()=>{cn.get(e).then(j=>r({type:"loaded",payload:j}),j=>r(j instanceof v0&&/No such map/.test(j.message)?{type:"missing"}:{type:"error",message:j.message}))},[e]);b.useEffect(u,[u]),b.useEffect(()=>x0(j=>r({type:"event",event:j}),j=>{r({type:"connected",value:j}),j&&a.current===!1&&n.phase!=="loading"&&u(),a.current=j},t),[]);const c=b.useCallback(j=>{const A=j.trim();!A||n.job||cn.ask(e,A,n.selection).then(()=>i(""),V=>r({type:"error",message:V.message}))},[e,n.job,n.selection]),f=(j,A)=>{A==="approve"&&r({type:"fixStatus",fixId:j,status:"applying",problems:[]}),cn[A](e,j).catch(V=>{r(A==="approve"?{type:"fixStatus",fixId:j,status:"failed",problems:V.problems.length?V.problems:[V.message]}:{type:"error",message:[V.message,...V.problems].join(" ")})})},d=(j,A)=>{cn.offer(e,j,A).then(V=>{V.id&&wl(Mt(V.id))},V=>r({type:"error",message:V.message}))};b.useEffect(()=>{const j=A=>{const V=A.target instanceof HTMLTextAreaElement||A.target instanceof HTMLInputElement;if(A.key==="Escape"){n.tour!==null?r({type:"tour",stop:null}):lr(n.selection)?r({type:"clearSelection"}):r({type:"overview"});return}V||n.tour===null||(A.key==="ArrowRight"&&r({type:"tour",stop:n.tour+1}),A.key==="ArrowLeft"&&r({type:"tour",stop:n.tour-1}))};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[n.tour,n.selection]);const p=n.answers.find(j=>j.id===n.shown),y=p!=null&&p.fix&&["proposed","applying","failed"].includes(((F=n.fixes[p.fix.id])==null?void 0:F.status)??"")?p.fix:null,x=b.useCallback((j,A,V)=>r({type:"select",kind:j,id:A,additive:V}),[]),k=b.useCallback(()=>r({type:"clearSelection"}),[]),m=S0(n),v=O2(n),g=D2(n),w=!!n.map&&n.tour!==null,S=(!n.map||!!n.error||!!n.job||n.shown!==null||lr(n.selection)>0)&&(!w||!!n.error||((E=n.job)==null?void 0:E.kind)==="ask"||lr(n.selection)>0),_=w&&((M=w0(n.map,n.report,((L=n.map.tour[n.tour])==null?void 0:L.focus.nodes)??[]))==null?void 0:M.show.kind)==="wireframe",C=lr(n.selection)===1?n.selection.nodes[0]:void 0,R=!!C&&((T=Zo(n.report,C))==null?void 0:T.kind)==="wireframe"?Math.max(s,Math.min(P2,window.innerWidth-360)):s,D=S&&!!n.map,H=n.map?h.jsx(q2,{map:n.map,selection:n.selection,draft:o,busy:!!n.job,autoFocus:D,onDraft:i,onRemove:(j,A)=>r({type:"select",kind:j,id:A,additive:!0}),onSend:()=>c(o)}):null;return h.jsx(p0,{children:h.jsxs("div",{className:"app",children:[h.jsxs("header",{className:"topbar",children:[h.jsxs("a",{className:"brand",href:Mt(),title:"All maps in this repo",children:[h.jsx("i",{className:"brand-mark","aria-hidden":"true"}),"illuminate"]}),h.jsxs("div",{className:"topbar-map",children:[((P=n.meta)==null?void 0:P.parent)&&h.jsxs("a",{className:"crumb",href:Mt(n.meta.parent.mapId),title:`Back to the map this one came from: ${n.meta.parent.question}`,children:["← ",n.meta.parent.question]}),h.jsx(AC,{mapId:e,question:(($=n.map)==null?void 0:$.question)??((z=n.job)==null?void 0:z.question)??""})]}),h.jsx(RC,{report:n.report}),h.jsx("a",{className:"pill-btn",href:Mt(),title:"Ask a new question and make a map for it",children:"New map"}),h.jsx(j0,{busy:!!n.job,onStopped:t,onError:j=>r({type:"error",message:j})}),h.jsx("span",{className:n.connected?"live on":"live",title:n.connected?"Connected to illuminate":"Reconnecting to illuminate…"})]}),h.jsxs("div",{className:S?"body":"body full",style:{"--panel-w":`${R}px`},children:[h.jsx("div",{className:"canvas",children:n.map&&m?h.jsxs(h.Fragment,{children:[h.jsx(CC,{map:m,report:n.report,selection:n.selection,view:g,fresh:n.fresh,added:v,ghost:y??null,touring:w,tourWide:_,onSelect:x,onClear:k}),!w&&!S&&h.jsx(J2,{state:n,dispatch:r}),w&&h.jsx(bC,{map:n.map,report:n.report,stop:n.tour,onTour:j=>r({type:"tour",stop:j}),onAsk:i}),h.jsx(Z2,{map:n.map,tour:n.tour,onTour:j=>r({type:"tour",stop:j}),selected:lr(n.selection),children:D?null:H})]}):h.jsx("div",{className:"empty",children:n.phase==="making"?h.jsx("div",{className:"pulse",children:"Claude is exploring the code…"}):null})}),S&&h.jsx(TC,{width:R,onWidth:l}),S&&h.jsx(X2,{state:n,dispatch:r,onFix:f,onFocus:j=>r({type:"focus",id:j}),onOffer:d,composer:D?H:null})]})]})})}Cm(document.getElementById("root")).render(h.jsx(b.StrictMode,{children:h.jsx(zC,{})}));export{FC as c,fh as g};
71
- //# sourceMappingURL=index-DQUK_1bX.js.map