@johnz4021/illuminate 0.5.1 → 0.5.3
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.
- package/README.md +2 -2
- package/dist/cli.mjs +1 -1
- package/package.json +1 -1
- package/viewer/assets/{elk.bundled-CUh_UDad.js → elk.bundled-BIfdAZMH.js} +2 -2
- package/viewer/assets/{elk.bundled-CUh_UDad.js.map → elk.bundled-BIfdAZMH.js.map} +1 -1
- package/viewer/assets/index-Bcn6ZqFw.css +1 -0
- package/viewer/assets/index-yqlrfm1R.js +71 -0
- package/viewer/assets/index-yqlrfm1R.js.map +1 -0
- package/viewer/index.html +3 -3
- package/viewer/assets/index-Booj4TYt.js +0 -71
- package/viewer/assets/index-Booj4TYt.js.map +0 -1
- package/viewer/assets/index-CoJiShhd.css +0 -1
|
@@ -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 zj=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ch(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jh={exports:{}},Gs={},Mh={exports:{}},se={};/**
|
|
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 ri=Symbol.for("react.element"),ev=Symbol.for("react.portal"),tv=Symbol.for("react.fragment"),nv=Symbol.for("react.strict_mode"),rv=Symbol.for("react.profiler"),ov=Symbol.for("react.provider"),iv=Symbol.for("react.context"),sv=Symbol.for("react.forward_ref"),lv=Symbol.for("react.suspense"),av=Symbol.for("react.memo"),uv=Symbol.for("react.lazy"),Qc=Symbol.iterator;function cv(e){return e===null||typeof e!="object"?null:(e=Qc&&e[Qc]||e["@@iterator"],typeof e=="function"?e:null)}var $h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},bh=Object.assign,Ph={};function Kr(e,t,n){this.props=e,this.context=t,this.refs=Ph,this.updater=n||$h}Kr.prototype.isReactComponent={};Kr.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")};Kr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ih(){}Ih.prototype=Kr.prototype;function ju(e,t,n){this.props=e,this.context=t,this.refs=Ph,this.updater=n||$h}var Mu=ju.prototype=new Ih;Mu.constructor=ju;bh(Mu,Kr.prototype);Mu.isPureReactComponent=!0;var qc=Array.isArray,Th=Object.prototype.hasOwnProperty,$u={current:null},zh={key:!0,ref:!0,__self:!0,__source:!0};function Lh(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)Th.call(t,r)&&!zh.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:ri,type:e,key:i,ref:s,props:o,_owner:$u.current}}function dv(e,t){return{$$typeof:ri,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function bu(e){return typeof e=="object"&&e!==null&&e.$$typeof===ri}function fv(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Zc=/\/+/g;function Pl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?fv(""+e.key):t.toString(36)}function Xi(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 ri:case ev:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Pl(s,0):r,qc(o)?(n="",e!=null&&(n=e.replace(Zc,"$&/")+"/"),Xi(o,t,n,"",function(u){return u})):o!=null&&(bu(o)&&(o=dv(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(Zc,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",qc(e))for(var l=0;l<e.length;l++){i=e[l];var a=r+Pl(i,l);s+=Xi(i,t,n,a,o)}else if(a=cv(e),typeof a=="function")for(e=a.call(e),l=0;!(i=e.next()).done;)i=i.value,a=r+Pl(i,l++),s+=Xi(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 xi(e,t,n){if(e==null)return e;var r=[],o=0;return Xi(e,r,"","",function(i){return t.call(n,i,o++)}),r}function hv(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 Ue={current:null},Ki={transition:null},pv={ReactCurrentDispatcher:Ue,ReactCurrentBatchConfig:Ki,ReactCurrentOwner:$u};function Ah(){throw Error("act(...) is not supported in production builds of React.")}se.Children={map:xi,forEach:function(e,t,n){xi(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return xi(e,function(){t++}),t},toArray:function(e){return xi(e,function(t){return t})||[]},only:function(e){if(!bu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};se.Component=Kr;se.Fragment=tv;se.Profiler=rv;se.PureComponent=ju;se.StrictMode=nv;se.Suspense=lv;se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=pv;se.act=Ah;se.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=bh({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=$u.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)Th.call(t,a)&&!zh.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:ri,type:e.type,key:o,ref:i,props:r,_owner:s}};se.createContext=function(e){return e={$$typeof:iv,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:ov,_context:e},e.Consumer=e};se.createElement=Lh;se.createFactory=function(e){var t=Lh.bind(null,e);return t.type=e,t};se.createRef=function(){return{current:null}};se.forwardRef=function(e){return{$$typeof:sv,render:e}};se.isValidElement=bu;se.lazy=function(e){return{$$typeof:uv,_payload:{_status:-1,_result:e},_init:hv}};se.memo=function(e,t){return{$$typeof:av,type:e,compare:t===void 0?null:t}};se.startTransition=function(e){var t=Ki.transition;Ki.transition={};try{e()}finally{Ki.transition=t}};se.unstable_act=Ah;se.useCallback=function(e,t){return Ue.current.useCallback(e,t)};se.useContext=function(e){return Ue.current.useContext(e)};se.useDebugValue=function(){};se.useDeferredValue=function(e){return Ue.current.useDeferredValue(e)};se.useEffect=function(e,t){return Ue.current.useEffect(e,t)};se.useId=function(){return Ue.current.useId()};se.useImperativeHandle=function(e,t,n){return Ue.current.useImperativeHandle(e,t,n)};se.useInsertionEffect=function(e,t){return Ue.current.useInsertionEffect(e,t)};se.useLayoutEffect=function(e,t){return Ue.current.useLayoutEffect(e,t)};se.useMemo=function(e,t){return Ue.current.useMemo(e,t)};se.useReducer=function(e,t,n){return Ue.current.useReducer(e,t,n)};se.useRef=function(e){return Ue.current.useRef(e)};se.useState=function(e){return Ue.current.useState(e)};se.useSyncExternalStore=function(e,t,n){return Ue.current.useSyncExternalStore(e,t,n)};se.useTransition=function(){return Ue.current.useTransition()};se.version="18.3.1";Mh.exports=se;var $=Mh.exports;const mv=Ch($);/**
|
|
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 gv=$,yv=Symbol.for("react.element"),vv=Symbol.for("react.fragment"),xv=Object.prototype.hasOwnProperty,wv=gv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,kv={key:!0,ref:!0,__self:!0,__source:!0};function Rh(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)xv.call(t,r)&&!kv.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:yv,type:e,key:i,ref:s,props:o,_owner:wv.current}}Gs.Fragment=vv;Gs.jsx=Rh;Gs.jsxs=Rh;jh.exports=Gs;var f=jh.exports,Dh={exports:{}},at={},Oh={exports:{}},Fh={};/**
|
|
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(b,M){var L=b.length;b.push(M);e:for(;0<L;){var P=L-1>>>1,H=b[P];if(0<o(H,M))b[P]=M,b[L]=H,L=P;else break e}}function n(b){return b.length===0?null:b[0]}function r(b){if(b.length===0)return null;var M=b[0],L=b.pop();if(L!==M){b[0]=L;e:for(var P=0,H=b.length,ee=H>>>1;P<ee;){var K=2*(P+1)-1,Y=b[K],V=K+1,X=b[V];if(0>o(Y,L))V<H&&0>o(X,Y)?(b[P]=X,b[V]=L,P=V):(b[P]=Y,b[K]=L,P=K);else if(V<H&&0>o(X,L))b[P]=X,b[V]=L,P=V;else break e}}return M}function o(b,M){var L=b.sortIndex-M.sortIndex;return L!==0?L:b.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var a=[],u=[],c=1,d=null,h=3,p=!1,y=!1,x=!1,k=typeof setTimeout=="function"?setTimeout:null,g=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 m(b){for(var M=n(u);M!==null;){if(M.callback===null)r(u);else if(M.startTime<=b)r(u),M.sortIndex=M.expirationTime,t(a,M);else break;M=n(u)}}function w(b){if(x=!1,m(b),!y)if(n(a)!==null)y=!0,z(C);else{var M=n(u);M!==null&&D(w,M.startTime-b)}}function C(b,M){y=!1,x&&(x=!1,g(j),j=-1),p=!0;var L=h;try{for(m(M),d=n(a);d!==null&&(!(d.expirationTime>M)||b&&!F());){var P=d.callback;if(typeof P=="function"){d.callback=null,h=d.priorityLevel;var H=P(d.expirationTime<=M);M=e.unstable_now(),typeof H=="function"?d.callback=H:d===n(a)&&r(a),m(M)}else r(a);d=n(a)}if(d!==null)var ee=!0;else{var K=n(u);K!==null&&D(w,K.startTime-M),ee=!1}return ee}finally{d=null,h=L,p=!1}}var S=!1,_=null,j=-1,I=5,O=-1;function F(){return!(e.unstable_now()-O<I)}function U(){if(_!==null){var b=e.unstable_now();O=b;var M=!0;try{M=_(!0,b)}finally{M?B():(S=!1,_=null)}}else S=!1}var B;if(typeof v=="function")B=function(){v(U)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,T=N.port2;N.port1.onmessage=U,B=function(){T.postMessage(null)}}else B=function(){k(U,0)};function z(b){_=b,S||(S=!0,B())}function D(b,M){j=k(function(){b(e.unstable_now())},M)}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(b){b.callback=null},e.unstable_continueExecution=function(){y||p||(y=!0,z(C))},e.unstable_forceFrameRate=function(b){0>b||125<b?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<b?Math.floor(1e3/b):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(b){switch(h){case 1:case 2:case 3:var M=3;break;default:M=h}var L=h;h=M;try{return b()}finally{h=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(b,M){switch(b){case 1:case 2:case 3:case 4:case 5:break;default:b=3}var L=h;h=b;try{return M()}finally{h=L}},e.unstable_scheduleCallback=function(b,M,L){var P=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?P+L:P):L=P,b){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=L+H,b={id:c++,callback:M,priorityLevel:b,startTime:L,expirationTime:H,sortIndex:-1},L>P?(b.sortIndex=L,t(u,b),n(a)===null&&b===n(u)&&(x?(g(j),j=-1):x=!0,D(w,L-P))):(b.sortIndex=H,t(a,b),y||p||(y=!0,z(C))),b},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(b){var M=h;return function(){var L=h;h=M;try{return b.apply(this,arguments)}finally{h=L}}}})(Fh);Oh.exports=Fh;var Sv=Oh.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 Nv=$,st=Sv;function J(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 Hh=new Set,Mo={};function nr(e,t){Pr(e,t),Pr(e+"Capture",t)}function Pr(e,t){for(Mo[e]=t,e=0;e<t.length;e++)Hh.add(t[e])}var qt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ma=Object.prototype.hasOwnProperty,Ev=/^[: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]*$/,Jc={},ed={};function _v(e){return ma.call(ed,e)?!0:ma.call(Jc,e)?!1:Ev.test(e)?ed[e]=!0:(Jc[e]=!0,!1)}function Cv(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 jv(e,t,n,r){if(t===null||typeof t>"u"||Cv(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 Ye(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 Le={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Le[e]=new Ye(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Le[t]=new Ye(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Le[e]=new Ye(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Le[e]=new Ye(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){Le[e]=new Ye(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Le[e]=new Ye(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Le[e]=new Ye(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Le[e]=new Ye(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Le[e]=new Ye(e,5,!1,e.toLowerCase(),null,!1,!1)});var Pu=/[\-:]([a-z])/g;function Iu(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(Pu,Iu);Le[t]=new Ye(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(Pu,Iu);Le[t]=new Ye(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(Pu,Iu);Le[t]=new Ye(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Le[e]=new Ye(e,1,!1,e.toLowerCase(),null,!1,!1)});Le.xlinkHref=new Ye("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Le[e]=new Ye(e,1,!1,e.toLowerCase(),null,!0,!0)});function Tu(e,t,n,r){var o=Le.hasOwnProperty(t)?Le[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(jv(t,n,o,r)&&(n=null),r||o===null?_v(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 rn=Nv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,wi=Symbol.for("react.element"),cr=Symbol.for("react.portal"),dr=Symbol.for("react.fragment"),zu=Symbol.for("react.strict_mode"),ga=Symbol.for("react.profiler"),Bh=Symbol.for("react.provider"),Vh=Symbol.for("react.context"),Lu=Symbol.for("react.forward_ref"),ya=Symbol.for("react.suspense"),va=Symbol.for("react.suspense_list"),Au=Symbol.for("react.memo"),an=Symbol.for("react.lazy"),Wh=Symbol.for("react.offscreen"),td=Symbol.iterator;function Zr(e){return e===null||typeof e!="object"?null:(e=td&&e[td]||e["@@iterator"],typeof e=="function"?e:null)}var xe=Object.assign,Il;function ao(e){if(Il===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Il=t&&t[1]||""}return`
|
|
34
|
-
`+Il+e}var Tl=!1;function zl(e,t){if(!e||Tl)return"";Tl=!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{Tl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ao(e):""}function Mv(e){switch(e.tag){case 5:return ao(e.type);case 16:return ao("Lazy");case 13:return ao("Suspense");case 19:return ao("SuspenseList");case 0:case 2:case 15:return e=zl(e.type,!1),e;case 11:return e=zl(e.type.render,!1),e;case 1:return e=zl(e.type,!0),e;default:return""}}function xa(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 dr:return"Fragment";case cr:return"Portal";case ga:return"Profiler";case zu:return"StrictMode";case ya:return"Suspense";case va:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Vh:return(e.displayName||"Context")+".Consumer";case Bh:return(e._context.displayName||"Context")+".Provider";case Lu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Au:return t=e.displayName||null,t!==null?t:xa(e.type)||"Memo";case an:t=e._payload,e=e._init;try{return xa(e(t))}catch{}}return null}function $v(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 xa(t);case 8:return t===zu?"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 _n(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Uh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function bv(e){var t=Uh(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 ki(e){e._valueTracker||(e._valueTracker=bv(e))}function Yh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Uh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ds(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 wa(e,t){var n=t.checked;return xe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function nd(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=_n(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 Xh(e,t){t=t.checked,t!=null&&Tu(e,"checked",t,!1)}function ka(e,t){Xh(e,t);var n=_n(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Sa(e,t.type,n):t.hasOwnProperty("defaultValue")&&Sa(e,t.type,_n(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function rd(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Sa(e,t,n){(t!=="number"||ds(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var uo=Array.isArray;function Nr(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=""+_n(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 Na(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(J(91));return xe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function od(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(J(92));if(uo(n)){if(1<n.length)throw Error(J(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:_n(n)}}function Kh(e,t){var n=_n(t.value),r=_n(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 id(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Gh(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 Ea(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Gh(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Si,Qh=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(Si=Si||document.createElement("div"),Si.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Si.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function $o(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var go={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},Pv=["Webkit","ms","Moz","O"];Object.keys(go).forEach(function(e){Pv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),go[t]=go[e]})});function qh(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||go.hasOwnProperty(e)&&go[e]?(""+t).trim():t+"px"}function Zh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=qh(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Iv=xe({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 _a(e,t){if(t){if(Iv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(J(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(J(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(J(61))}if(t.style!=null&&typeof t.style!="object")throw Error(J(62))}}function Ca(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ja=null;function Ru(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ma=null,Er=null,_r=null;function sd(e){if(e=si(e)){if(typeof Ma!="function")throw Error(J(280));var t=e.stateNode;t&&(t=el(t),Ma(e.stateNode,e.type,t))}}function Jh(e){Er?_r?_r.push(e):_r=[e]:Er=e}function ep(){if(Er){var e=Er,t=_r;if(_r=Er=null,sd(e),t)for(e=0;e<t.length;e++)sd(t[e])}}function tp(e,t){return e(t)}function np(){}var Ll=!1;function rp(e,t,n){if(Ll)return e(t,n);Ll=!0;try{return tp(e,t,n)}finally{Ll=!1,(Er!==null||_r!==null)&&(np(),ep())}}function bo(e,t){var n=e.stateNode;if(n===null)return null;var r=el(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(J(231,t,typeof n));return n}var $a=!1;if(qt)try{var Jr={};Object.defineProperty(Jr,"passive",{get:function(){$a=!0}}),window.addEventListener("test",Jr,Jr),window.removeEventListener("test",Jr,Jr)}catch{$a=!1}function Tv(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 yo=!1,fs=null,hs=!1,ba=null,zv={onError:function(e){yo=!0,fs=e}};function Lv(e,t,n,r,o,i,s,l,a){yo=!1,fs=null,Tv.apply(zv,arguments)}function Av(e,t,n,r,o,i,s,l,a){if(Lv.apply(this,arguments),yo){if(yo){var u=fs;yo=!1,fs=null}else throw Error(J(198));hs||(hs=!0,ba=u)}}function rr(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 op(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 ld(e){if(rr(e)!==e)throw Error(J(188))}function Rv(e){var t=e.alternate;if(!t){if(t=rr(e),t===null)throw Error(J(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 ld(o),e;if(i===r)return ld(o),t;i=i.sibling}throw Error(J(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(J(189))}}if(n.alternate!==r)throw Error(J(190))}if(n.tag!==3)throw Error(J(188));return n.stateNode.current===n?e:t}function ip(e){return e=Rv(e),e!==null?sp(e):null}function sp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=sp(e);if(t!==null)return t;e=e.sibling}return null}var lp=st.unstable_scheduleCallback,ad=st.unstable_cancelCallback,Dv=st.unstable_shouldYield,Ov=st.unstable_requestPaint,Ne=st.unstable_now,Fv=st.unstable_getCurrentPriorityLevel,Du=st.unstable_ImmediatePriority,ap=st.unstable_UserBlockingPriority,ps=st.unstable_NormalPriority,Hv=st.unstable_LowPriority,up=st.unstable_IdlePriority,Qs=null,Ot=null;function Bv(e){if(Ot&&typeof Ot.onCommitFiberRoot=="function")try{Ot.onCommitFiberRoot(Qs,e,void 0,(e.current.flags&128)===128)}catch{}}var Mt=Math.clz32?Math.clz32:Uv,Vv=Math.log,Wv=Math.LN2;function Uv(e){return e>>>=0,e===0?32:31-(Vv(e)/Wv|0)|0}var Ni=64,Ei=4194304;function co(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 ms(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=co(l):(i&=s,i!==0&&(r=co(i)))}else s=n&~o,s!==0?r=co(s):i!==0&&(r=co(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-Mt(t),o=1<<n,r|=e[n],t&=~o;return r}function Yv(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 Xv(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Mt(i),l=1<<s,a=o[s];a===-1?(!(l&n)||l&r)&&(o[s]=Yv(l,t)):a<=t&&(e.expiredLanes|=l),i&=~l}}function Pa(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function cp(){var e=Ni;return Ni<<=1,!(Ni&4194240)&&(Ni=64),e}function Al(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function oi(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Mt(t),e[t]=n}function Kv(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-Mt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Ou(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Mt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var ue=0;function dp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var fp,Fu,hp,pp,mp,Ia=!1,_i=[],yn=null,vn=null,xn=null,Po=new Map,Io=new Map,fn=[],Gv="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 ud(e,t){switch(e){case"focusin":case"focusout":yn=null;break;case"dragenter":case"dragleave":vn=null;break;case"mouseover":case"mouseout":xn=null;break;case"pointerover":case"pointerout":Po.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Io.delete(t.pointerId)}}function eo(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=si(t),t!==null&&Fu(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Qv(e,t,n,r,o){switch(t){case"focusin":return yn=eo(yn,e,t,n,r,o),!0;case"dragenter":return vn=eo(vn,e,t,n,r,o),!0;case"mouseover":return xn=eo(xn,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Po.set(i,eo(Po.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Io.set(i,eo(Io.get(i)||null,e,t,n,r,o)),!0}return!1}function gp(e){var t=Tn(e.target);if(t!==null){var n=rr(t);if(n!==null){if(t=n.tag,t===13){if(t=op(n),t!==null){e.blockedOn=t,mp(e.priority,function(){hp(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 Gi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ta(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);ja=r,n.target.dispatchEvent(r),ja=null}else return t=si(n),t!==null&&Fu(t),e.blockedOn=n,!1;t.shift()}return!0}function cd(e,t,n){Gi(e)&&n.delete(t)}function qv(){Ia=!1,yn!==null&&Gi(yn)&&(yn=null),vn!==null&&Gi(vn)&&(vn=null),xn!==null&&Gi(xn)&&(xn=null),Po.forEach(cd),Io.forEach(cd)}function to(e,t){e.blockedOn===t&&(e.blockedOn=null,Ia||(Ia=!0,st.unstable_scheduleCallback(st.unstable_NormalPriority,qv)))}function To(e){function t(o){return to(o,e)}if(0<_i.length){to(_i[0],e);for(var n=1;n<_i.length;n++){var r=_i[n];r.blockedOn===e&&(r.blockedOn=null)}}for(yn!==null&&to(yn,e),vn!==null&&to(vn,e),xn!==null&&to(xn,e),Po.forEach(t),Io.forEach(t),n=0;n<fn.length;n++)r=fn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<fn.length&&(n=fn[0],n.blockedOn===null);)gp(n),n.blockedOn===null&&fn.shift()}var Cr=rn.ReactCurrentBatchConfig,gs=!0;function Zv(e,t,n,r){var o=ue,i=Cr.transition;Cr.transition=null;try{ue=1,Hu(e,t,n,r)}finally{ue=o,Cr.transition=i}}function Jv(e,t,n,r){var o=ue,i=Cr.transition;Cr.transition=null;try{ue=4,Hu(e,t,n,r)}finally{ue=o,Cr.transition=i}}function Hu(e,t,n,r){if(gs){var o=Ta(e,t,n,r);if(o===null)Yl(e,t,r,ys,n),ud(e,r);else if(Qv(o,e,t,n,r))r.stopPropagation();else if(ud(e,r),t&4&&-1<Gv.indexOf(e)){for(;o!==null;){var i=si(o);if(i!==null&&fp(i),i=Ta(e,t,n,r),i===null&&Yl(e,t,r,ys,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Yl(e,t,r,null,n)}}var ys=null;function Ta(e,t,n,r){if(ys=null,e=Ru(r),e=Tn(e),e!==null)if(t=rr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=op(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 ys=e,null}function yp(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(Fv()){case Du:return 1;case ap:return 4;case ps:case Hv:return 16;case up:return 536870912;default:return 16}default:return 16}}var mn=null,Bu=null,Qi=null;function vp(){if(Qi)return Qi;var e,t=Bu,n=t.length,r,o="value"in mn?mn.value:mn.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 Qi=o.slice(e,1<r?1-r:void 0)}function qi(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 Ci(){return!0}function dd(){return!1}function ut(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)?Ci:dd,this.isPropagationStopped=dd,this}return xe(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=Ci)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ci)},persist:function(){},isPersistent:Ci}),t}var Gr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vu=ut(Gr),ii=xe({},Gr,{view:0,detail:0}),ex=ut(ii),Rl,Dl,no,qs=xe({},ii,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wu,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!==no&&(no&&e.type==="mousemove"?(Rl=e.screenX-no.screenX,Dl=e.screenY-no.screenY):Dl=Rl=0,no=e),Rl)},movementY:function(e){return"movementY"in e?e.movementY:Dl}}),fd=ut(qs),tx=xe({},qs,{dataTransfer:0}),nx=ut(tx),rx=xe({},ii,{relatedTarget:0}),Ol=ut(rx),ox=xe({},Gr,{animationName:0,elapsedTime:0,pseudoElement:0}),ix=ut(ox),sx=xe({},Gr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),lx=ut(sx),ax=xe({},Gr,{data:0}),hd=ut(ax),ux={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cx={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"},dx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=dx[e])?!!t[e]:!1}function Wu(){return fx}var hx=xe({},ii,{key:function(e){if(e.key){var t=ux[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=qi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?cx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wu,charCode:function(e){return e.type==="keypress"?qi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?qi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),px=ut(hx),mx=xe({},qs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pd=ut(mx),gx=xe({},ii,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wu}),yx=ut(gx),vx=xe({},Gr,{propertyName:0,elapsedTime:0,pseudoElement:0}),xx=ut(vx),wx=xe({},qs,{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}),kx=ut(wx),Sx=[9,13,27,32],Uu=qt&&"CompositionEvent"in window,vo=null;qt&&"documentMode"in document&&(vo=document.documentMode);var Nx=qt&&"TextEvent"in window&&!vo,xp=qt&&(!Uu||vo&&8<vo&&11>=vo),md=" ",gd=!1;function wp(e,t){switch(e){case"keyup":return Sx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var fr=!1;function Ex(e,t){switch(e){case"compositionend":return kp(t);case"keypress":return t.which!==32?null:(gd=!0,md);case"textInput":return e=t.data,e===md&&gd?null:e;default:return null}}function _x(e,t){if(fr)return e==="compositionend"||!Uu&&wp(e,t)?(e=vp(),Qi=Bu=mn=null,fr=!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 xp&&t.locale!=="ko"?null:t.data;default:return null}}var Cx={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 yd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Cx[e.type]:t==="textarea"}function Sp(e,t,n,r){Jh(r),t=vs(t,"onChange"),0<t.length&&(n=new Vu("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var xo=null,zo=null;function jx(e){Tp(e,0)}function Zs(e){var t=mr(e);if(Yh(t))return e}function Mx(e,t){if(e==="change")return t}var Np=!1;if(qt){var Fl;if(qt){var Hl="oninput"in document;if(!Hl){var vd=document.createElement("div");vd.setAttribute("oninput","return;"),Hl=typeof vd.oninput=="function"}Fl=Hl}else Fl=!1;Np=Fl&&(!document.documentMode||9<document.documentMode)}function xd(){xo&&(xo.detachEvent("onpropertychange",Ep),zo=xo=null)}function Ep(e){if(e.propertyName==="value"&&Zs(zo)){var t=[];Sp(t,zo,e,Ru(e)),rp(jx,t)}}function $x(e,t,n){e==="focusin"?(xd(),xo=t,zo=n,xo.attachEvent("onpropertychange",Ep)):e==="focusout"&&xd()}function bx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zs(zo)}function Px(e,t){if(e==="click")return Zs(t)}function Ix(e,t){if(e==="input"||e==="change")return Zs(t)}function Tx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bt=typeof Object.is=="function"?Object.is:Tx;function Lo(e,t){if(bt(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(!ma.call(t,o)||!bt(e[o],t[o]))return!1}return!0}function wd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function kd(e,t){var n=wd(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=wd(n)}}function _p(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_p(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cp(){for(var e=window,t=ds();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ds(e.document)}return t}function Yu(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 zx(e){var t=Cp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&_p(n.ownerDocument.documentElement,n)){if(r!==null&&Yu(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=kd(n,i);var s=kd(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 Lx=qt&&"documentMode"in document&&11>=document.documentMode,hr=null,za=null,wo=null,La=!1;function Sd(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;La||hr==null||hr!==ds(r)||(r=hr,"selectionStart"in r&&Yu(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}),wo&&Lo(wo,r)||(wo=r,r=vs(za,"onSelect"),0<r.length&&(t=new Vu("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=hr)))}function ji(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var pr={animationend:ji("Animation","AnimationEnd"),animationiteration:ji("Animation","AnimationIteration"),animationstart:ji("Animation","AnimationStart"),transitionend:ji("Transition","TransitionEnd")},Bl={},jp={};qt&&(jp=document.createElement("div").style,"AnimationEvent"in window||(delete pr.animationend.animation,delete pr.animationiteration.animation,delete pr.animationstart.animation),"TransitionEvent"in window||delete pr.transitionend.transition);function Js(e){if(Bl[e])return Bl[e];if(!pr[e])return e;var t=pr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in jp)return Bl[e]=t[n];return e}var Mp=Js("animationend"),$p=Js("animationiteration"),bp=Js("animationstart"),Pp=Js("transitionend"),Ip=new Map,Nd="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 jn(e,t){Ip.set(e,t),nr(t,[e])}for(var Vl=0;Vl<Nd.length;Vl++){var Wl=Nd[Vl],Ax=Wl.toLowerCase(),Rx=Wl[0].toUpperCase()+Wl.slice(1);jn(Ax,"on"+Rx)}jn(Mp,"onAnimationEnd");jn($p,"onAnimationIteration");jn(bp,"onAnimationStart");jn("dblclick","onDoubleClick");jn("focusin","onFocus");jn("focusout","onBlur");jn(Pp,"onTransitionEnd");Pr("onMouseEnter",["mouseout","mouseover"]);Pr("onMouseLeave",["mouseout","mouseover"]);Pr("onPointerEnter",["pointerout","pointerover"]);Pr("onPointerLeave",["pointerout","pointerover"]);nr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));nr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));nr("onBeforeInput",["compositionend","keypress","textInput","paste"]);nr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));nr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));nr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fo="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(" "),Dx=new Set("cancel close invalid load scroll toggle".split(" ").concat(fo));function Ed(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Av(r,t,void 0,e),e.currentTarget=null}function Tp(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;Ed(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;Ed(o,l,u),i=a}}}if(hs)throw e=ba,hs=!1,ba=null,e}function fe(e,t){var n=t[Fa];n===void 0&&(n=t[Fa]=new Set);var r=e+"__bubble";n.has(r)||(zp(t,e,2,!1),n.add(r))}function Ul(e,t,n){var r=0;t&&(r|=4),zp(n,e,r,t)}var Mi="_reactListening"+Math.random().toString(36).slice(2);function Ao(e){if(!e[Mi]){e[Mi]=!0,Hh.forEach(function(n){n!=="selectionchange"&&(Dx.has(n)||Ul(n,!1,e),Ul(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Mi]||(t[Mi]=!0,Ul("selectionchange",!1,t))}}function zp(e,t,n,r){switch(yp(t)){case 1:var o=Zv;break;case 4:o=Jv;break;default:o=Hu}n=o.bind(null,t,n,e),o=void 0,!$a||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 Yl(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}rp(function(){var u=i,c=Ru(n),d=[];e:{var h=Ip.get(e);if(h!==void 0){var p=Vu,y=e;switch(e){case"keypress":if(qi(n)===0)break e;case"keydown":case"keyup":p=px;break;case"focusin":y="focus",p=Ol;break;case"focusout":y="blur",p=Ol;break;case"beforeblur":case"afterblur":p=Ol;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=fd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=nx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=yx;break;case Mp:case $p:case bp:p=ix;break;case Pp:p=xx;break;case"scroll":p=ex;break;case"wheel":p=kx;break;case"copy":case"cut":case"paste":p=lx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=pd}var x=(t&4)!==0,k=!x&&e==="scroll",g=x?h!==null?h+"Capture":null:h;x=[];for(var v=u,m;v!==null;){m=v;var w=m.stateNode;if(m.tag===5&&w!==null&&(m=w,g!==null&&(w=bo(v,g),w!=null&&x.push(Ro(v,w,m)))),k)break;v=v.return}0<x.length&&(h=new p(h,y,null,n,c),d.push({event:h,listeners:x}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==ja&&(y=n.relatedTarget||n.fromElement)&&(Tn(y)||y[Zt]))break e;if((p||h)&&(h=c.window===c?c:(h=c.ownerDocument)?h.defaultView||h.parentWindow:window,p?(y=n.relatedTarget||n.toElement,p=u,y=y?Tn(y):null,y!==null&&(k=rr(y),y!==k||y.tag!==5&&y.tag!==6)&&(y=null)):(p=null,y=u),p!==y)){if(x=fd,w="onMouseLeave",g="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(x=pd,w="onPointerLeave",g="onPointerEnter",v="pointer"),k=p==null?h:mr(p),m=y==null?h:mr(y),h=new x(w,v+"leave",p,n,c),h.target=k,h.relatedTarget=m,w=null,Tn(c)===u&&(x=new x(g,v+"enter",y,n,c),x.target=m,x.relatedTarget=k,w=x),k=w,p&&y)t:{for(x=p,g=y,v=0,m=x;m;m=or(m))v++;for(m=0,w=g;w;w=or(w))m++;for(;0<v-m;)x=or(x),v--;for(;0<m-v;)g=or(g),m--;for(;v--;){if(x===g||g!==null&&x===g.alternate)break t;x=or(x),g=or(g)}x=null}else x=null;p!==null&&_d(d,h,p,x,!1),y!==null&&k!==null&&_d(d,k,y,x,!0)}}e:{if(h=u?mr(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var C=Mx;else if(yd(h))if(Np)C=Ix;else{C=bx;var S=$x}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(C=Px);if(C&&(C=C(e,u))){Sp(d,C,n,c);break e}S&&S(e,h,u),e==="focusout"&&(S=h._wrapperState)&&S.controlled&&h.type==="number"&&Sa(h,"number",h.value)}switch(S=u?mr(u):window,e){case"focusin":(yd(S)||S.contentEditable==="true")&&(hr=S,za=u,wo=null);break;case"focusout":wo=za=hr=null;break;case"mousedown":La=!0;break;case"contextmenu":case"mouseup":case"dragend":La=!1,Sd(d,n,c);break;case"selectionchange":if(Lx)break;case"keydown":case"keyup":Sd(d,n,c)}var _;if(Uu)e:{switch(e){case"compositionstart":var j="onCompositionStart";break e;case"compositionend":j="onCompositionEnd";break e;case"compositionupdate":j="onCompositionUpdate";break e}j=void 0}else fr?wp(e,n)&&(j="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(j="onCompositionStart");j&&(xp&&n.locale!=="ko"&&(fr||j!=="onCompositionStart"?j==="onCompositionEnd"&&fr&&(_=vp()):(mn=c,Bu="value"in mn?mn.value:mn.textContent,fr=!0)),S=vs(u,j),0<S.length&&(j=new hd(j,e,null,n,c),d.push({event:j,listeners:S}),_?j.data=_:(_=kp(n),_!==null&&(j.data=_)))),(_=Nx?Ex(e,n):_x(e,n))&&(u=vs(u,"onBeforeInput"),0<u.length&&(c=new hd("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=_))}Tp(d,t)})}function Ro(e,t,n){return{instance:e,listener:t,currentTarget:n}}function vs(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=bo(e,n),i!=null&&r.unshift(Ro(e,i,o)),i=bo(e,t),i!=null&&r.push(Ro(e,i,o))),e=e.return}return r}function or(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function _d(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=bo(n,i),a!=null&&s.unshift(Ro(n,a,l))):o||(a=bo(n,i),a!=null&&s.push(Ro(n,a,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var Ox=/\r\n?/g,Fx=/\u0000|\uFFFD/g;function Cd(e){return(typeof e=="string"?e:""+e).replace(Ox,`
|
|
38
|
-
`).replace(Fx,"")}function $i(e,t,n){if(t=Cd(t),Cd(e)!==t&&n)throw Error(J(425))}function xs(){}var Aa=null,Ra=null;function Da(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 Oa=typeof setTimeout=="function"?setTimeout:void 0,Hx=typeof clearTimeout=="function"?clearTimeout:void 0,jd=typeof Promise=="function"?Promise:void 0,Bx=typeof queueMicrotask=="function"?queueMicrotask:typeof jd<"u"?function(e){return jd.resolve(null).then(e).catch(Vx)}:Oa;function Vx(e){setTimeout(function(){throw e})}function Xl(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),To(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);To(t)}function wn(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 Md(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 Qr=Math.random().toString(36).slice(2),Rt="__reactFiber$"+Qr,Do="__reactProps$"+Qr,Zt="__reactContainer$"+Qr,Fa="__reactEvents$"+Qr,Wx="__reactListeners$"+Qr,Ux="__reactHandles$"+Qr;function Tn(e){var t=e[Rt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Zt]||n[Rt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Md(e);e!==null;){if(n=e[Rt])return n;e=Md(e)}return t}e=n,n=e.parentNode}return null}function si(e){return e=e[Rt]||e[Zt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function mr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(J(33))}function el(e){return e[Do]||null}var Ha=[],gr=-1;function Mn(e){return{current:e}}function he(e){0>gr||(e.current=Ha[gr],Ha[gr]=null,gr--)}function ce(e,t){gr++,Ha[gr]=e.current,e.current=t}var Cn={},Fe=Mn(Cn),qe=Mn(!1),Yn=Cn;function Ir(e,t){var n=e.type.contextTypes;if(!n)return Cn;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 Ze(e){return e=e.childContextTypes,e!=null}function ws(){he(qe),he(Fe)}function $d(e,t,n){if(Fe.current!==Cn)throw Error(J(168));ce(Fe,t),ce(qe,n)}function Lp(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(J(108,$v(e)||"Unknown",o));return xe({},n,r)}function ks(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Cn,Yn=Fe.current,ce(Fe,e),ce(qe,qe.current),!0}function bd(e,t,n){var r=e.stateNode;if(!r)throw Error(J(169));n?(e=Lp(e,t,Yn),r.__reactInternalMemoizedMergedChildContext=e,he(qe),he(Fe),ce(Fe,e)):he(qe),ce(qe,n)}var Ut=null,tl=!1,Kl=!1;function Ap(e){Ut===null?Ut=[e]:Ut.push(e)}function Yx(e){tl=!0,Ap(e)}function $n(){if(!Kl&&Ut!==null){Kl=!0;var e=0,t=ue;try{var n=Ut;for(ue=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ut=null,tl=!1}catch(o){throw Ut!==null&&(Ut=Ut.slice(e+1)),lp(Du,$n),o}finally{ue=t,Kl=!1}}return null}var yr=[],vr=0,Ss=null,Ns=0,ft=[],ht=0,Xn=null,Yt=1,Xt="";function bn(e,t){yr[vr++]=Ns,yr[vr++]=Ss,Ss=e,Ns=t}function Rp(e,t,n){ft[ht++]=Yt,ft[ht++]=Xt,ft[ht++]=Xn,Xn=e;var r=Yt;e=Xt;var o=32-Mt(r)-1;r&=~(1<<o),n+=1;var i=32-Mt(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,Yt=1<<32-Mt(t)+o|n<<o|r,Xt=i+e}else Yt=1<<i|n<<o|r,Xt=e}function Xu(e){e.return!==null&&(bn(e,1),Rp(e,1,0))}function Ku(e){for(;e===Ss;)Ss=yr[--vr],yr[vr]=null,Ns=yr[--vr],yr[vr]=null;for(;e===Xn;)Xn=ft[--ht],ft[ht]=null,Xt=ft[--ht],ft[ht]=null,Yt=ft[--ht],ft[ht]=null}var it=null,ot=null,ge=!1,Nt=null;function Dp(e,t){var n=pt(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 Pd(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,it=e,ot=wn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,it=e,ot=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Xn!==null?{id:Yt,overflow:Xt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=pt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,it=e,ot=null,!0):!1;default:return!1}}function Ba(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Va(e){if(ge){var t=ot;if(t){var n=t;if(!Pd(e,t)){if(Ba(e))throw Error(J(418));t=wn(n.nextSibling);var r=it;t&&Pd(e,t)?Dp(r,n):(e.flags=e.flags&-4097|2,ge=!1,it=e)}}else{if(Ba(e))throw Error(J(418));e.flags=e.flags&-4097|2,ge=!1,it=e}}}function Id(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;it=e}function bi(e){if(e!==it)return!1;if(!ge)return Id(e),ge=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Da(e.type,e.memoizedProps)),t&&(t=ot)){if(Ba(e))throw Op(),Error(J(418));for(;t;)Dp(e,t),t=wn(t.nextSibling)}if(Id(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(J(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ot=wn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ot=null}}else ot=it?wn(e.stateNode.nextSibling):null;return!0}function Op(){for(var e=ot;e;)e=wn(e.nextSibling)}function Tr(){ot=it=null,ge=!1}function Gu(e){Nt===null?Nt=[e]:Nt.push(e)}var Xx=rn.ReactCurrentBatchConfig;function ro(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(J(309));var r=n.stateNode}if(!r)throw Error(J(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(J(284));if(!n._owner)throw Error(J(290,e))}return e}function Pi(e,t){throw e=Object.prototype.toString.call(t),Error(J(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Td(e){var t=e._init;return t(e._payload)}function Fp(e){function t(g,v){if(e){var m=g.deletions;m===null?(g.deletions=[v],g.flags|=16):m.push(v)}}function n(g,v){if(!e)return null;for(;v!==null;)t(g,v),v=v.sibling;return null}function r(g,v){for(g=new Map;v!==null;)v.key!==null?g.set(v.key,v):g.set(v.index,v),v=v.sibling;return g}function o(g,v){return g=En(g,v),g.index=0,g.sibling=null,g}function i(g,v,m){return g.index=m,e?(m=g.alternate,m!==null?(m=m.index,m<v?(g.flags|=2,v):m):(g.flags|=2,v)):(g.flags|=1048576,v)}function s(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,v,m,w){return v===null||v.tag!==6?(v=ta(m,g.mode,w),v.return=g,v):(v=o(v,m),v.return=g,v)}function a(g,v,m,w){var C=m.type;return C===dr?c(g,v,m.props.children,w,m.key):v!==null&&(v.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===an&&Td(C)===v.type)?(w=o(v,m.props),w.ref=ro(g,v,m),w.return=g,w):(w=os(m.type,m.key,m.props,null,g.mode,w),w.ref=ro(g,v,m),w.return=g,w)}function u(g,v,m,w){return v===null||v.tag!==4||v.stateNode.containerInfo!==m.containerInfo||v.stateNode.implementation!==m.implementation?(v=na(m,g.mode,w),v.return=g,v):(v=o(v,m.children||[]),v.return=g,v)}function c(g,v,m,w,C){return v===null||v.tag!==7?(v=Fn(m,g.mode,w,C),v.return=g,v):(v=o(v,m),v.return=g,v)}function d(g,v,m){if(typeof v=="string"&&v!==""||typeof v=="number")return v=ta(""+v,g.mode,m),v.return=g,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case wi:return m=os(v.type,v.key,v.props,null,g.mode,m),m.ref=ro(g,null,v),m.return=g,m;case cr:return v=na(v,g.mode,m),v.return=g,v;case an:var w=v._init;return d(g,w(v._payload),m)}if(uo(v)||Zr(v))return v=Fn(v,g.mode,m,null),v.return=g,v;Pi(g,v)}return null}function h(g,v,m,w){var C=v!==null?v.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return C!==null?null:l(g,v,""+m,w);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case wi:return m.key===C?a(g,v,m,w):null;case cr:return m.key===C?u(g,v,m,w):null;case an:return C=m._init,h(g,v,C(m._payload),w)}if(uo(m)||Zr(m))return C!==null?null:c(g,v,m,w,null);Pi(g,m)}return null}function p(g,v,m,w,C){if(typeof w=="string"&&w!==""||typeof w=="number")return g=g.get(m)||null,l(v,g,""+w,C);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case wi:return g=g.get(w.key===null?m:w.key)||null,a(v,g,w,C);case cr:return g=g.get(w.key===null?m:w.key)||null,u(v,g,w,C);case an:var S=w._init;return p(g,v,m,S(w._payload),C)}if(uo(w)||Zr(w))return g=g.get(m)||null,c(v,g,w,C,null);Pi(v,w)}return null}function y(g,v,m,w){for(var C=null,S=null,_=v,j=v=0,I=null;_!==null&&j<m.length;j++){_.index>j?(I=_,_=null):I=_.sibling;var O=h(g,_,m[j],w);if(O===null){_===null&&(_=I);break}e&&_&&O.alternate===null&&t(g,_),v=i(O,v,j),S===null?C=O:S.sibling=O,S=O,_=I}if(j===m.length)return n(g,_),ge&&bn(g,j),C;if(_===null){for(;j<m.length;j++)_=d(g,m[j],w),_!==null&&(v=i(_,v,j),S===null?C=_:S.sibling=_,S=_);return ge&&bn(g,j),C}for(_=r(g,_);j<m.length;j++)I=p(_,g,j,m[j],w),I!==null&&(e&&I.alternate!==null&&_.delete(I.key===null?j:I.key),v=i(I,v,j),S===null?C=I:S.sibling=I,S=I);return e&&_.forEach(function(F){return t(g,F)}),ge&&bn(g,j),C}function x(g,v,m,w){var C=Zr(m);if(typeof C!="function")throw Error(J(150));if(m=C.call(m),m==null)throw Error(J(151));for(var S=C=null,_=v,j=v=0,I=null,O=m.next();_!==null&&!O.done;j++,O=m.next()){_.index>j?(I=_,_=null):I=_.sibling;var F=h(g,_,O.value,w);if(F===null){_===null&&(_=I);break}e&&_&&F.alternate===null&&t(g,_),v=i(F,v,j),S===null?C=F:S.sibling=F,S=F,_=I}if(O.done)return n(g,_),ge&&bn(g,j),C;if(_===null){for(;!O.done;j++,O=m.next())O=d(g,O.value,w),O!==null&&(v=i(O,v,j),S===null?C=O:S.sibling=O,S=O);return ge&&bn(g,j),C}for(_=r(g,_);!O.done;j++,O=m.next())O=p(_,g,j,O.value,w),O!==null&&(e&&O.alternate!==null&&_.delete(O.key===null?j:O.key),v=i(O,v,j),S===null?C=O:S.sibling=O,S=O);return e&&_.forEach(function(U){return t(g,U)}),ge&&bn(g,j),C}function k(g,v,m,w){if(typeof m=="object"&&m!==null&&m.type===dr&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case wi:e:{for(var C=m.key,S=v;S!==null;){if(S.key===C){if(C=m.type,C===dr){if(S.tag===7){n(g,S.sibling),v=o(S,m.props.children),v.return=g,g=v;break e}}else if(S.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===an&&Td(C)===S.type){n(g,S.sibling),v=o(S,m.props),v.ref=ro(g,S,m),v.return=g,g=v;break e}n(g,S);break}else t(g,S);S=S.sibling}m.type===dr?(v=Fn(m.props.children,g.mode,w,m.key),v.return=g,g=v):(w=os(m.type,m.key,m.props,null,g.mode,w),w.ref=ro(g,v,m),w.return=g,g=w)}return s(g);case cr:e:{for(S=m.key;v!==null;){if(v.key===S)if(v.tag===4&&v.stateNode.containerInfo===m.containerInfo&&v.stateNode.implementation===m.implementation){n(g,v.sibling),v=o(v,m.children||[]),v.return=g,g=v;break e}else{n(g,v);break}else t(g,v);v=v.sibling}v=na(m,g.mode,w),v.return=g,g=v}return s(g);case an:return S=m._init,k(g,v,S(m._payload),w)}if(uo(m))return y(g,v,m,w);if(Zr(m))return x(g,v,m,w);Pi(g,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,v!==null&&v.tag===6?(n(g,v.sibling),v=o(v,m),v.return=g,g=v):(n(g,v),v=ta(m,g.mode,w),v.return=g,g=v),s(g)):n(g,v)}return k}var zr=Fp(!0),Hp=Fp(!1),Es=Mn(null),_s=null,xr=null,Qu=null;function qu(){Qu=xr=_s=null}function Zu(e){var t=Es.current;he(Es),e._currentValue=t}function Wa(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 jr(e,t){_s=e,Qu=xr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ge=!0),e.firstContext=null)}function gt(e){var t=e._currentValue;if(Qu!==e)if(e={context:e,memoizedValue:t,next:null},xr===null){if(_s===null)throw Error(J(308));xr=e,_s.dependencies={lanes:0,firstContext:e}}else xr=xr.next=e;return t}var zn=null;function Ju(e){zn===null?zn=[e]:zn.push(e)}function Bp(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Ju(t)):(n.next=o.next,o.next=n),t.interleaved=n,Jt(e,r)}function Jt(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 un=!1;function ec(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Vp(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 Gt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function kn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ae&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Jt(e,n)}return o=r.interleaved,o===null?(t.next=t,Ju(r)):(t.next=o.next,o.next=t),r.interleaved=t,Jt(e,n)}function Zi(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,Ou(e,n)}}function zd(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 Cs(e,t,n,r){var o=e.updateQueue;un=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var a=l,u=a.next;a.next=null,s===null?i=u:s.next=u,s=a;var c=e.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==s&&(l===null?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=a))}if(i!==null){var d=o.baseState;s=0,c=u=a=null,l=i;do{var h=l.lane,p=l.eventTime;if((r&h)===h){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(h=t,p=n,x.tag){case 1:if(y=x.payload,typeof y=="function"){d=y.call(p,d,h);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=x.payload,h=typeof y=="function"?y.call(p,d,h):y,h==null)break e;d=xe({},d,h);break e;case 2:un=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=p,a=d):c=c.next=p,s|=h;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;h=l,l=h.next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}}while(!0);if(c===null&&(a=d),o.baseState=a,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Gn|=s,e.lanes=s,e.memoizedState=d}}function Ld(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(J(191,o));o.call(r)}}}var li={},Ft=Mn(li),Oo=Mn(li),Fo=Mn(li);function Ln(e){if(e===li)throw Error(J(174));return e}function tc(e,t){switch(ce(Fo,t),ce(Oo,e),ce(Ft,li),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ea(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ea(t,e)}he(Ft),ce(Ft,t)}function Lr(){he(Ft),he(Oo),he(Fo)}function Wp(e){Ln(Fo.current);var t=Ln(Ft.current),n=Ea(t,e.type);t!==n&&(ce(Oo,e),ce(Ft,n))}function nc(e){Oo.current===e&&(he(Ft),he(Oo))}var ye=Mn(0);function js(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 Gl=[];function rc(){for(var e=0;e<Gl.length;e++)Gl[e]._workInProgressVersionPrimary=null;Gl.length=0}var Ji=rn.ReactCurrentDispatcher,Ql=rn.ReactCurrentBatchConfig,Kn=0,ve=null,Ce=null,$e=null,Ms=!1,ko=!1,Ho=0,Kx=0;function Re(){throw Error(J(321))}function oc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!bt(e[n],t[n]))return!1;return!0}function ic(e,t,n,r,o,i){if(Kn=i,ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ji.current=e===null||e.memoizedState===null?Zx:Jx,e=n(r,o),ko){i=0;do{if(ko=!1,Ho=0,25<=i)throw Error(J(301));i+=1,$e=Ce=null,t.updateQueue=null,Ji.current=ew,e=n(r,o)}while(ko)}if(Ji.current=$s,t=Ce!==null&&Ce.next!==null,Kn=0,$e=Ce=ve=null,Ms=!1,t)throw Error(J(300));return e}function sc(){var e=Ho!==0;return Ho=0,e}function Lt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $e===null?ve.memoizedState=$e=e:$e=$e.next=e,$e}function yt(){if(Ce===null){var e=ve.alternate;e=e!==null?e.memoizedState:null}else e=Ce.next;var t=$e===null?ve.memoizedState:$e.next;if(t!==null)$e=t,Ce=e;else{if(e===null)throw Error(J(310));Ce=e,e={memoizedState:Ce.memoizedState,baseState:Ce.baseState,baseQueue:Ce.baseQueue,queue:Ce.queue,next:null},$e===null?ve.memoizedState=$e=e:$e=$e.next=e}return $e}function Bo(e,t){return typeof t=="function"?t(e):t}function ql(e){var t=yt(),n=t.queue;if(n===null)throw Error(J(311));n.lastRenderedReducer=e;var r=Ce,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((Kn&c)===c)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(l=a=d,s=r):a=a.next=d,ve.lanes|=c,Gn|=c}u=u.next}while(u!==null&&u!==i);a===null?s=r:a.next=l,bt(r,t.memoizedState)||(Ge=!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,ve.lanes|=i,Gn|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Zl(e){var t=yt(),n=t.queue;if(n===null)throw Error(J(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);bt(i,t.memoizedState)||(Ge=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Up(){}function Yp(e,t){var n=ve,r=yt(),o=t(),i=!bt(r.memoizedState,o);if(i&&(r.memoizedState=o,Ge=!0),r=r.queue,lc(Gp.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||$e!==null&&$e.memoizedState.tag&1){if(n.flags|=2048,Vo(9,Kp.bind(null,n,r,o,t),void 0,null),be===null)throw Error(J(349));Kn&30||Xp(n,t,o)}return o}function Xp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ve.updateQueue,t===null?(t={lastEffect:null,stores:null},ve.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Kp(e,t,n,r){t.value=n,t.getSnapshot=r,Qp(t)&&qp(e)}function Gp(e,t,n){return n(function(){Qp(t)&&qp(e)})}function Qp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!bt(e,n)}catch{return!0}}function qp(e){var t=Jt(e,1);t!==null&&$t(t,e,1,-1)}function Ad(e){var t=Lt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bo,lastRenderedState:e},t.queue=e,e=e.dispatch=qx.bind(null,ve,e),[t.memoizedState,e]}function Vo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ve.updateQueue,t===null?(t={lastEffect:null,stores:null},ve.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 Zp(){return yt().memoizedState}function es(e,t,n,r){var o=Lt();ve.flags|=e,o.memoizedState=Vo(1|t,n,void 0,r===void 0?null:r)}function nl(e,t,n,r){var o=yt();r=r===void 0?null:r;var i=void 0;if(Ce!==null){var s=Ce.memoizedState;if(i=s.destroy,r!==null&&oc(r,s.deps)){o.memoizedState=Vo(t,n,i,r);return}}ve.flags|=e,o.memoizedState=Vo(1|t,n,i,r)}function Rd(e,t){return es(8390656,8,e,t)}function lc(e,t){return nl(2048,8,e,t)}function Jp(e,t){return nl(4,2,e,t)}function em(e,t){return nl(4,4,e,t)}function tm(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 nm(e,t,n){return n=n!=null?n.concat([e]):null,nl(4,4,tm.bind(null,t,e),n)}function ac(){}function rm(e,t){var n=yt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&oc(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function om(e,t){var n=yt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&oc(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function im(e,t,n){return Kn&21?(bt(n,t)||(n=cp(),ve.lanes|=n,Gn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ge=!0),e.memoizedState=n)}function Gx(e,t){var n=ue;ue=n!==0&&4>n?n:4,e(!0);var r=Ql.transition;Ql.transition={};try{e(!1),t()}finally{ue=n,Ql.transition=r}}function sm(){return yt().memoizedState}function Qx(e,t,n){var r=Nn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},lm(e))am(t,n);else if(n=Bp(e,t,n,r),n!==null){var o=We();$t(n,e,r,o),um(n,t,r)}}function qx(e,t,n){var r=Nn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(lm(e))am(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,bt(l,s)){var a=t.interleaved;a===null?(o.next=o,Ju(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=Bp(e,t,o,r),n!==null&&(o=We(),$t(n,e,r,o),um(n,t,r))}}function lm(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function am(e,t){ko=Ms=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function um(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ou(e,n)}}var $s={readContext:gt,useCallback:Re,useContext:Re,useEffect:Re,useImperativeHandle:Re,useInsertionEffect:Re,useLayoutEffect:Re,useMemo:Re,useReducer:Re,useRef:Re,useState:Re,useDebugValue:Re,useDeferredValue:Re,useTransition:Re,useMutableSource:Re,useSyncExternalStore:Re,useId:Re,unstable_isNewReconciler:!1},Zx={readContext:gt,useCallback:function(e,t){return Lt().memoizedState=[e,t===void 0?null:t],e},useContext:gt,useEffect:Rd,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,es(4194308,4,tm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return es(4194308,4,e,t)},useInsertionEffect:function(e,t){return es(4,2,e,t)},useMemo:function(e,t){var n=Lt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Lt();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=Qx.bind(null,ve,e),[r.memoizedState,e]},useRef:function(e){var t=Lt();return e={current:e},t.memoizedState=e},useState:Ad,useDebugValue:ac,useDeferredValue:function(e){return Lt().memoizedState=e},useTransition:function(){var e=Ad(!1),t=e[0];return e=Gx.bind(null,e[1]),Lt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ve,o=Lt();if(ge){if(n===void 0)throw Error(J(407));n=n()}else{if(n=t(),be===null)throw Error(J(349));Kn&30||Xp(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Rd(Gp.bind(null,r,i,e),[e]),r.flags|=2048,Vo(9,Kp.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Lt(),t=be.identifierPrefix;if(ge){var n=Xt,r=Yt;n=(r&~(1<<32-Mt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ho++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Kx++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Jx={readContext:gt,useCallback:rm,useContext:gt,useEffect:lc,useImperativeHandle:nm,useInsertionEffect:Jp,useLayoutEffect:em,useMemo:om,useReducer:ql,useRef:Zp,useState:function(){return ql(Bo)},useDebugValue:ac,useDeferredValue:function(e){var t=yt();return im(t,Ce.memoizedState,e)},useTransition:function(){var e=ql(Bo)[0],t=yt().memoizedState;return[e,t]},useMutableSource:Up,useSyncExternalStore:Yp,useId:sm,unstable_isNewReconciler:!1},ew={readContext:gt,useCallback:rm,useContext:gt,useEffect:lc,useImperativeHandle:nm,useInsertionEffect:Jp,useLayoutEffect:em,useMemo:om,useReducer:Zl,useRef:Zp,useState:function(){return Zl(Bo)},useDebugValue:ac,useDeferredValue:function(e){var t=yt();return Ce===null?t.memoizedState=e:im(t,Ce.memoizedState,e)},useTransition:function(){var e=Zl(Bo)[0],t=yt().memoizedState;return[e,t]},useMutableSource:Up,useSyncExternalStore:Yp,useId:sm,unstable_isNewReconciler:!1};function xt(e,t){if(e&&e.defaultProps){t=xe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ua(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:xe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var rl={isMounted:function(e){return(e=e._reactInternals)?rr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=We(),o=Nn(e),i=Gt(r,o);i.payload=t,n!=null&&(i.callback=n),t=kn(e,i,o),t!==null&&($t(t,e,o,r),Zi(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=We(),o=Nn(e),i=Gt(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=kn(e,i,o),t!==null&&($t(t,e,o,r),Zi(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=We(),r=Nn(e),o=Gt(n,r);o.tag=2,t!=null&&(o.callback=t),t=kn(e,o,r),t!==null&&($t(t,e,r,n),Zi(t,e,r))}};function Dd(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?!Lo(n,r)||!Lo(o,i):!0}function cm(e,t,n){var r=!1,o=Cn,i=t.contextType;return typeof i=="object"&&i!==null?i=gt(i):(o=Ze(t)?Yn:Fe.current,r=t.contextTypes,i=(r=r!=null)?Ir(e,o):Cn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=rl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Od(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&&rl.enqueueReplaceState(t,t.state,null)}function Ya(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},ec(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=gt(i):(i=Ze(t)?Yn:Fe.current,o.context=Ir(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Ua(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&&rl.enqueueReplaceState(o,o.state,null),Cs(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Ar(e,t){try{var n="",r=t;do n+=Mv(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 Jl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Xa(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var tw=typeof WeakMap=="function"?WeakMap:Map;function dm(e,t,n){n=Gt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ps||(Ps=!0,ru=r),Xa(e,t)},n}function fm(e,t,n){n=Gt(-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(){Xa(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Xa(e,t),typeof r!="function"&&(Sn===null?Sn=new Set([this]):Sn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Fd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new tw;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=mw.bind(null,e,t,n),t.then(e,e))}function Hd(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 Bd(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=Gt(-1,1),t.tag=2,kn(n,t,1))),n.lanes|=1),e)}var nw=rn.ReactCurrentOwner,Ge=!1;function Ve(e,t,n,r){t.child=e===null?Hp(t,null,n,r):zr(t,e.child,n,r)}function Vd(e,t,n,r,o){n=n.render;var i=t.ref;return jr(t,o),r=ic(e,t,n,r,i,o),n=sc(),e!==null&&!Ge?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,en(e,t,o)):(ge&&n&&Xu(t),t.flags|=1,Ve(e,t,r,o),t.child)}function Wd(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!gc(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,hm(e,t,i,r,o)):(e=os(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:Lo,n(s,r)&&e.ref===t.ref)return en(e,t,o)}return t.flags|=1,e=En(i,r),e.ref=t.ref,e.return=t,t.child=e}function hm(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Lo(i,r)&&e.ref===t.ref)if(Ge=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Ge=!0);else return t.lanes=e.lanes,en(e,t,o)}return Ka(e,t,n,r,o)}function pm(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},ce(kr,nt),nt|=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,ce(kr,nt),nt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ce(kr,nt),nt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ce(kr,nt),nt|=r;return Ve(e,t,o,n),t.child}function mm(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ka(e,t,n,r,o){var i=Ze(n)?Yn:Fe.current;return i=Ir(t,i),jr(t,o),n=ic(e,t,n,r,i,o),r=sc(),e!==null&&!Ge?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,en(e,t,o)):(ge&&r&&Xu(t),t.flags|=1,Ve(e,t,n,o),t.child)}function Ud(e,t,n,r,o){if(Ze(n)){var i=!0;ks(t)}else i=!1;if(jr(t,o),t.stateNode===null)ts(e,t),cm(t,n,r),Ya(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=gt(u):(u=Ze(n)?Yn:Fe.current,u=Ir(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||a!==u)&&Od(t,s,r,u),un=!1;var h=t.memoizedState;s.state=h,Cs(t,r,s,o),a=t.memoizedState,l!==r||h!==a||qe.current||un?(typeof c=="function"&&(Ua(t,n,c,r),a=t.memoizedState),(l=un||Dd(t,n,l,r,h,a,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),s.props=r,s.state=a,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Vp(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:xt(t.type,l),s.props=u,d=t.pendingProps,h=s.context,a=n.contextType,typeof a=="object"&&a!==null?a=gt(a):(a=Ze(n)?Yn:Fe.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!==d||h!==a)&&Od(t,s,r,a),un=!1,h=t.memoizedState,s.state=h,Cs(t,r,s,o);var y=t.memoizedState;l!==d||h!==y||qe.current||un?(typeof p=="function"&&(Ua(t,n,p,r),y=t.memoizedState),(u=un||Dd(t,n,u,r,h,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&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===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&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Ga(e,t,n,r,i,o)}function Ga(e,t,n,r,o,i){mm(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&bd(t,n,!1),en(e,t,i);r=t.stateNode,nw.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=zr(t,e.child,null,i),t.child=zr(t,null,l,i)):Ve(e,t,l,i),t.memoizedState=r.state,o&&bd(t,n,!0),t.child}function gm(e){var t=e.stateNode;t.pendingContext?$d(e,t.pendingContext,t.pendingContext!==t.context):t.context&&$d(e,t.context,!1),tc(e,t.containerInfo)}function Yd(e,t,n,r,o){return Tr(),Gu(o),t.flags|=256,Ve(e,t,n,r),t.child}var Qa={dehydrated:null,treeContext:null,retryLane:0};function qa(e){return{baseLanes:e,cachePool:null,transitions:null}}function ym(e,t,n){var r=t.pendingProps,o=ye.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),ce(ye,o&1),e===null)return Va(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=sl(s,r,0,null),e=Fn(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=qa(n),t.memoizedState=Qa,e):uc(t,s));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return rw(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=En(o,a),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=En(l,i):(i=Fn(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?qa(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Qa,r}return i=e.child,e=i.sibling,r=En(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 uc(e,t){return t=sl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ii(e,t,n,r){return r!==null&&Gu(r),zr(t,e.child,null,n),e=uc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rw(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=Jl(Error(J(422))),Ii(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=sl({mode:"visible",children:r.children},o,0,null),i=Fn(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&zr(t,e.child,null,s),t.child.memoizedState=qa(s),t.memoizedState=Qa,i);if(!(t.mode&1))return Ii(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(J(419)),r=Jl(i,r,void 0),Ii(e,t,s,r)}if(l=(s&e.childLanes)!==0,Ge||l){if(r=be,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,Jt(e,o),$t(r,e,o,-1))}return mc(),r=Jl(Error(J(421))),Ii(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=gw.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,ot=wn(o.nextSibling),it=t,ge=!0,Nt=null,e!==null&&(ft[ht++]=Yt,ft[ht++]=Xt,ft[ht++]=Xn,Yt=e.id,Xt=e.overflow,Xn=t),t=uc(t,r.children),t.flags|=4096,t)}function Xd(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wa(e.return,t,n)}function ea(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 vm(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Ve(e,t,r.children,n),r=ye.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&&Xd(e,n,t);else if(e.tag===19)Xd(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(ce(ye,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&&js(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),ea(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&&js(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}ea(t,!0,n,null,i);break;case"together":ea(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ts(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function en(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Gn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(J(153));if(t.child!==null){for(e=t.child,n=En(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=En(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ow(e,t,n){switch(t.tag){case 3:gm(t),Tr();break;case 5:Wp(t);break;case 1:Ze(t.type)&&ks(t);break;case 4:tc(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ce(Es,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ce(ye,ye.current&1),t.flags|=128,null):n&t.child.childLanes?ym(e,t,n):(ce(ye,ye.current&1),e=en(e,t,n),e!==null?e.sibling:null);ce(ye,ye.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return vm(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ce(ye,ye.current),r)break;return null;case 22:case 23:return t.lanes=0,pm(e,t,n)}return en(e,t,n)}var xm,Za,wm,km;xm=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}};Za=function(){};wm=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Ln(Ft.current);var i=null;switch(n){case"input":o=wa(e,o),r=wa(e,r),i=[];break;case"select":o=xe({},o,{value:void 0}),r=xe({},r,{value:void 0}),i=[];break;case"textarea":o=Na(e,o),r=Na(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=xs)}_a(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"&&(Mo.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"&&(Mo.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&fe("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)}};km=function(e,t,n,r){n!==r&&(t.flags|=4)};function oo(e,t){if(!ge)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 De(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 iw(e,t,n){var r=t.pendingProps;switch(Ku(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return De(t),null;case 1:return Ze(t.type)&&ws(),De(t),null;case 3:return r=t.stateNode,Lr(),he(qe),he(Fe),rc(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(bi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Nt!==null&&(su(Nt),Nt=null))),Za(e,t),De(t),null;case 5:nc(t);var o=Ln(Fo.current);if(n=t.type,e!==null&&t.stateNode!=null)wm(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(J(166));return De(t),null}if(e=Ln(Ft.current),bi(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Rt]=t,r[Do]=i,e=(t.mode&1)!==0,n){case"dialog":fe("cancel",r),fe("close",r);break;case"iframe":case"object":case"embed":fe("load",r);break;case"video":case"audio":for(o=0;o<fo.length;o++)fe(fo[o],r);break;case"source":fe("error",r);break;case"img":case"image":case"link":fe("error",r),fe("load",r);break;case"details":fe("toggle",r);break;case"input":nd(r,i),fe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},fe("invalid",r);break;case"textarea":od(r,i),fe("invalid",r)}_a(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]):Mo.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&fe("scroll",r)}switch(n){case"input":ki(r),rd(r,i,!0);break;case"textarea":ki(r),id(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=xs)}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=Gh(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[Rt]=t,e[Do]=r,xm(e,t,!1,!1),t.stateNode=e;e:{switch(s=Ca(n,r),n){case"dialog":fe("cancel",e),fe("close",e),o=r;break;case"iframe":case"object":case"embed":fe("load",e),o=r;break;case"video":case"audio":for(o=0;o<fo.length;o++)fe(fo[o],e);o=r;break;case"source":fe("error",e),o=r;break;case"img":case"image":case"link":fe("error",e),fe("load",e),o=r;break;case"details":fe("toggle",e),o=r;break;case"input":nd(e,r),o=wa(e,r),fe("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=xe({},r,{value:void 0}),fe("invalid",e);break;case"textarea":od(e,r),o=Na(e,r),fe("invalid",e);break;default:o=r}_a(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var a=l[i];i==="style"?Zh(e,a):i==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&Qh(e,a)):i==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&$o(e,a):typeof a=="number"&&$o(e,""+a):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Mo.hasOwnProperty(i)?a!=null&&i==="onScroll"&&fe("scroll",e):a!=null&&Tu(e,i,a,s))}switch(n){case"input":ki(e),rd(e,r,!1);break;case"textarea":ki(e),id(e);break;case"option":r.value!=null&&e.setAttribute("value",""+_n(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Nr(e,!!r.multiple,i,!1):r.defaultValue!=null&&Nr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=xs)}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 De(t),null;case 6:if(e&&t.stateNode!=null)km(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(J(166));if(n=Ln(Fo.current),Ln(Ft.current),bi(t)){if(r=t.stateNode,n=t.memoizedProps,r[Rt]=t,(i=r.nodeValue!==n)&&(e=it,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[Rt]=t,t.stateNode=r}return De(t),null;case 13:if(he(ye),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ge&&ot!==null&&t.mode&1&&!(t.flags&128))Op(),Tr(),t.flags|=98560,i=!1;else if(i=bi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(J(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(J(317));i[Rt]=t}else Tr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;De(t),i=!1}else Nt!==null&&(su(Nt),Nt=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||ye.current&1?je===0&&(je=3):mc())),t.updateQueue!==null&&(t.flags|=4),De(t),null);case 4:return Lr(),Za(e,t),e===null&&Ao(t.stateNode.containerInfo),De(t),null;case 10:return Zu(t.type._context),De(t),null;case 17:return Ze(t.type)&&ws(),De(t),null;case 19:if(he(ye),i=t.memoizedState,i===null)return De(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)oo(i,!1);else{if(je!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=js(e),s!==null){for(t.flags|=128,oo(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 ce(ye,ye.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ne()>Rr&&(t.flags|=128,r=!0,oo(i,!1),t.lanes=4194304)}else{if(!r)if(e=js(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),oo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!ge)return De(t),null}else 2*Ne()-i.renderingStartTime>Rr&&n!==1073741824&&(t.flags|=128,r=!0,oo(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=Ne(),t.sibling=null,n=ye.current,ce(ye,r?n&1|2:n&1),t):(De(t),null);case 22:case 23:return pc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?nt&1073741824&&(De(t),t.subtreeFlags&6&&(t.flags|=8192)):De(t),null;case 24:return null;case 25:return null}throw Error(J(156,t.tag))}function sw(e,t){switch(Ku(t),t.tag){case 1:return Ze(t.type)&&ws(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Lr(),he(qe),he(Fe),rc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return nc(t),null;case 13:if(he(ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(J(340));Tr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return he(ye),null;case 4:return Lr(),null;case 10:return Zu(t.type._context),null;case 22:case 23:return pc(),null;case 24:return null;default:return null}}var Ti=!1,Oe=!1,lw=typeof WeakSet=="function"?WeakSet:Set,ne=null;function wr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Se(e,t,r)}else n.current=null}function Ja(e,t,n){try{n()}catch(r){Se(e,t,r)}}var Kd=!1;function aw(e,t){if(Aa=gs,e=Cp(),Yu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,l=-1,a=-1,u=0,c=0,d=e,h=null;t:for(;;){for(var p;d!==n||o!==0&&d.nodeType!==3||(l=s+o),d!==i||r!==0&&d.nodeType!==3||(a=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===e)break t;if(h===n&&++u===o&&(l=s),h===i&&++c===r&&(a=s),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ra={focusedElem:e,selectionRange:n},gs=!1,ne=t;ne!==null;)if(t=ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ne=e;else for(;ne!==null;){t=ne;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,g=t.stateNode,v=g.getSnapshotBeforeUpdate(t.elementType===t.type?x:xt(t.type,x),k);g.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(J(163))}}catch(w){Se(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,ne=e;break}ne=t.return}return y=Kd,Kd=!1,y}function So(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&&Ja(t,n,i)}o=o.next}while(o!==r)}}function ol(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 eu(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 Sm(e){var t=e.alternate;t!==null&&(e.alternate=null,Sm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Rt],delete t[Do],delete t[Fa],delete t[Wx],delete t[Ux])),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 Nm(e){return e.tag===5||e.tag===3||e.tag===4}function Gd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Nm(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 tu(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=xs));else if(r!==4&&(e=e.child,e!==null))for(tu(e,t,n),e=e.sibling;e!==null;)tu(e,t,n),e=e.sibling}function nu(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(nu(e,t,n),e=e.sibling;e!==null;)nu(e,t,n),e=e.sibling}var Te=null,wt=!1;function on(e,t,n){for(n=n.child;n!==null;)Em(e,t,n),n=n.sibling}function Em(e,t,n){if(Ot&&typeof Ot.onCommitFiberUnmount=="function")try{Ot.onCommitFiberUnmount(Qs,n)}catch{}switch(n.tag){case 5:Oe||wr(n,t);case 6:var r=Te,o=wt;Te=null,on(e,t,n),Te=r,wt=o,Te!==null&&(wt?(e=Te,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Te.removeChild(n.stateNode));break;case 18:Te!==null&&(wt?(e=Te,n=n.stateNode,e.nodeType===8?Xl(e.parentNode,n):e.nodeType===1&&Xl(e,n),To(e)):Xl(Te,n.stateNode));break;case 4:r=Te,o=wt,Te=n.stateNode.containerInfo,wt=!0,on(e,t,n),Te=r,wt=o;break;case 0:case 11:case 14:case 15:if(!Oe&&(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)&&Ja(n,t,s),o=o.next}while(o!==r)}on(e,t,n);break;case 1:if(!Oe&&(wr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Se(n,t,l)}on(e,t,n);break;case 21:on(e,t,n);break;case 22:n.mode&1?(Oe=(r=Oe)||n.memoizedState!==null,on(e,t,n),Oe=r):on(e,t,n);break;default:on(e,t,n)}}function Qd(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new lw),t.forEach(function(r){var o=yw.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function vt(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:Te=l.stateNode,wt=!1;break e;case 3:Te=l.stateNode.containerInfo,wt=!0;break e;case 4:Te=l.stateNode.containerInfo,wt=!0;break e}l=l.return}if(Te===null)throw Error(J(160));Em(i,s,o),Te=null,wt=!1;var a=o.alternate;a!==null&&(a.return=null),o.return=null}catch(u){Se(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)_m(t,e),t=t.sibling}function _m(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(vt(t,e),zt(e),r&4){try{So(3,e,e.return),ol(3,e)}catch(x){Se(e,e.return,x)}try{So(5,e,e.return)}catch(x){Se(e,e.return,x)}}break;case 1:vt(t,e),zt(e),r&512&&n!==null&&wr(n,n.return);break;case 5:if(vt(t,e),zt(e),r&512&&n!==null&&wr(n,n.return),e.flags&32){var o=e.stateNode;try{$o(o,"")}catch(x){Se(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&&Xh(o,i),Ca(l,s);var u=Ca(l,i);for(s=0;s<a.length;s+=2){var c=a[s],d=a[s+1];c==="style"?Zh(o,d):c==="dangerouslySetInnerHTML"?Qh(o,d):c==="children"?$o(o,d):Tu(o,c,d,u)}switch(l){case"input":ka(o,i);break;case"textarea":Kh(o,i);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?Nr(o,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?Nr(o,!!i.multiple,i.defaultValue,!0):Nr(o,!!i.multiple,i.multiple?[]:"",!1))}o[Do]=i}catch(x){Se(e,e.return,x)}}break;case 6:if(vt(t,e),zt(e),r&4){if(e.stateNode===null)throw Error(J(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(x){Se(e,e.return,x)}}break;case 3:if(vt(t,e),zt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{To(t.containerInfo)}catch(x){Se(e,e.return,x)}break;case 4:vt(t,e),zt(e);break;case 13:vt(t,e),zt(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(fc=Ne())),r&4&&Qd(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Oe=(u=Oe)||c,vt(t,e),Oe=u):vt(t,e),zt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(ne=e,c=e.child;c!==null;){for(d=ne=c;ne!==null;){switch(h=ne,p=h.child,h.tag){case 0:case 11:case 14:case 15:So(4,h,h.return);break;case 1:wr(h,h.return);var y=h.stateNode;if(typeof y.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(x){Se(r,n,x)}}break;case 5:wr(h,h.return);break;case 22:if(h.memoizedState!==null){Zd(d);continue}}p!==null?(p.return=h,ne=p):Zd(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{o=d.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=d.stateNode,a=d.memoizedProps.style,s=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=qh("display",s))}catch(x){Se(e,e.return,x)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(x){Se(e,e.return,x)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:vt(t,e),zt(e),r&4&&Qd(e);break;case 21:break;default:vt(t,e),zt(e)}}function zt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Nm(n)){var r=n;break e}n=n.return}throw Error(J(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&($o(o,""),r.flags&=-33);var i=Gd(e);nu(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,l=Gd(e);tu(e,l,s);break;default:throw Error(J(161))}}catch(a){Se(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function uw(e,t,n){ne=e,Cm(e)}function Cm(e,t,n){for(var r=(e.mode&1)!==0;ne!==null;){var o=ne,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Ti;if(!s){var l=o.alternate,a=l!==null&&l.memoizedState!==null||Oe;l=Ti;var u=Oe;if(Ti=s,(Oe=a)&&!u)for(ne=o;ne!==null;)s=ne,a=s.child,s.tag===22&&s.memoizedState!==null?Jd(o):a!==null?(a.return=s,ne=a):Jd(o);for(;i!==null;)ne=i,Cm(i),i=i.sibling;ne=o,Ti=l,Oe=u}qd(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,ne=i):qd(e)}}function qd(e){for(;ne!==null;){var t=ne;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Oe||ol(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Oe)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:xt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Ld(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}Ld(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&To(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(J(163))}Oe||t.flags&512&&eu(t)}catch(h){Se(t,t.return,h)}}if(t===e){ne=null;break}if(n=t.sibling,n!==null){n.return=t.return,ne=n;break}ne=t.return}}function Zd(e){for(;ne!==null;){var t=ne;if(t===e){ne=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ne=n;break}ne=t.return}}function Jd(e){for(;ne!==null;){var t=ne;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ol(4,t)}catch(a){Se(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(a){Se(t,o,a)}}var i=t.return;try{eu(t)}catch(a){Se(t,i,a)}break;case 5:var s=t.return;try{eu(t)}catch(a){Se(t,s,a)}}}catch(a){Se(t,t.return,a)}if(t===e){ne=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ne=l;break}ne=t.return}}var cw=Math.ceil,bs=rn.ReactCurrentDispatcher,cc=rn.ReactCurrentOwner,mt=rn.ReactCurrentBatchConfig,ae=0,be=null,Ee=null,ze=0,nt=0,kr=Mn(0),je=0,Wo=null,Gn=0,il=0,dc=0,No=null,Xe=null,fc=0,Rr=1/0,Wt=null,Ps=!1,ru=null,Sn=null,zi=!1,gn=null,Is=0,Eo=0,ou=null,ns=-1,rs=0;function We(){return ae&6?Ne():ns!==-1?ns:ns=Ne()}function Nn(e){return e.mode&1?ae&2&&ze!==0?ze&-ze:Xx.transition!==null?(rs===0&&(rs=cp()),rs):(e=ue,e!==0||(e=window.event,e=e===void 0?16:yp(e.type)),e):1}function $t(e,t,n,r){if(50<Eo)throw Eo=0,ou=null,Error(J(185));oi(e,n,r),(!(ae&2)||e!==be)&&(e===be&&(!(ae&2)&&(il|=n),je===4&&hn(e,ze)),Je(e,r),n===1&&ae===0&&!(t.mode&1)&&(Rr=Ne()+500,tl&&$n()))}function Je(e,t){var n=e.callbackNode;Xv(e,t);var r=ms(e,e===be?ze:0);if(r===0)n!==null&&ad(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&ad(n),t===1)e.tag===0?Yx(ef.bind(null,e)):Ap(ef.bind(null,e)),Bx(function(){!(ae&6)&&$n()}),n=null;else{switch(dp(r)){case 1:n=Du;break;case 4:n=ap;break;case 16:n=ps;break;case 536870912:n=up;break;default:n=ps}n=zm(n,jm.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function jm(e,t){if(ns=-1,rs=0,ae&6)throw Error(J(327));var n=e.callbackNode;if(Mr()&&e.callbackNode!==n)return null;var r=ms(e,e===be?ze:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ts(e,r);else{t=r;var o=ae;ae|=2;var i=$m();(be!==e||ze!==t)&&(Wt=null,Rr=Ne()+500,On(e,t));do try{hw();break}catch(l){Mm(e,l)}while(!0);qu(),bs.current=i,ae=o,Ee!==null?t=0:(be=null,ze=0,t=je)}if(t!==0){if(t===2&&(o=Pa(e),o!==0&&(r=o,t=iu(e,o))),t===1)throw n=Wo,On(e,0),hn(e,r),Je(e,Ne()),n;if(t===6)hn(e,r);else{if(o=e.current.alternate,!(r&30)&&!dw(o)&&(t=Ts(e,r),t===2&&(i=Pa(e),i!==0&&(r=i,t=iu(e,i))),t===1))throw n=Wo,On(e,0),hn(e,r),Je(e,Ne()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(J(345));case 2:Pn(e,Xe,Wt);break;case 3:if(hn(e,r),(r&130023424)===r&&(t=fc+500-Ne(),10<t)){if(ms(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){We(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Oa(Pn.bind(null,e,Xe,Wt),t);break}Pn(e,Xe,Wt);break;case 4:if(hn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Mt(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=Ne()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*cw(r/1960))-r,10<r){e.timeoutHandle=Oa(Pn.bind(null,e,Xe,Wt),r);break}Pn(e,Xe,Wt);break;case 5:Pn(e,Xe,Wt);break;default:throw Error(J(329))}}}return Je(e,Ne()),e.callbackNode===n?jm.bind(null,e):null}function iu(e,t){var n=No;return e.current.memoizedState.isDehydrated&&(On(e,t).flags|=256),e=Ts(e,t),e!==2&&(t=Xe,Xe=n,t!==null&&su(t)),e}function su(e){Xe===null?Xe=e:Xe.push.apply(Xe,e)}function dw(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(!bt(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 hn(e,t){for(t&=~dc,t&=~il,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Mt(t),r=1<<n;e[n]=-1,t&=~r}}function ef(e){if(ae&6)throw Error(J(327));Mr();var t=ms(e,0);if(!(t&1))return Je(e,Ne()),null;var n=Ts(e,t);if(e.tag!==0&&n===2){var r=Pa(e);r!==0&&(t=r,n=iu(e,r))}if(n===1)throw n=Wo,On(e,0),hn(e,t),Je(e,Ne()),n;if(n===6)throw Error(J(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Pn(e,Xe,Wt),Je(e,Ne()),null}function hc(e,t){var n=ae;ae|=1;try{return e(t)}finally{ae=n,ae===0&&(Rr=Ne()+500,tl&&$n())}}function Qn(e){gn!==null&&gn.tag===0&&!(ae&6)&&Mr();var t=ae;ae|=1;var n=mt.transition,r=ue;try{if(mt.transition=null,ue=1,e)return e()}finally{ue=r,mt.transition=n,ae=t,!(ae&6)&&$n()}}function pc(){nt=kr.current,he(kr)}function On(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Hx(n)),Ee!==null)for(n=Ee.return;n!==null;){var r=n;switch(Ku(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ws();break;case 3:Lr(),he(qe),he(Fe),rc();break;case 5:nc(r);break;case 4:Lr();break;case 13:he(ye);break;case 19:he(ye);break;case 10:Zu(r.type._context);break;case 22:case 23:pc()}n=n.return}if(be=e,Ee=e=En(e.current,null),ze=nt=t,je=0,Wo=null,dc=il=Gn=0,Xe=No=null,zn!==null){for(t=0;t<zn.length;t++)if(n=zn[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}zn=null}return e}function Mm(e,t){do{var n=Ee;try{if(qu(),Ji.current=$s,Ms){for(var r=ve.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Ms=!1}if(Kn=0,$e=Ce=ve=null,ko=!1,Ho=0,cc.current=null,n===null||n.return===null){je=1,Wo=t,Ee=null;break}e:{var i=e,s=n.return,l=n,a=t;if(t=ze,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,c=l,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var h=c.alternate;h?(c.updateQueue=h.updateQueue,c.memoizedState=h.memoizedState,c.lanes=h.lanes):(c.updateQueue=null,c.memoizedState=null)}var p=Hd(s);if(p!==null){p.flags&=-257,Bd(p,s,l,i,t),p.mode&1&&Fd(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)){Fd(i,u,t),mc();break e}a=Error(J(426))}}else if(ge&&l.mode&1){var k=Hd(s);if(k!==null){!(k.flags&65536)&&(k.flags|=256),Bd(k,s,l,i,t),Gu(Ar(a,l));break e}}i=a=Ar(a,l),je!==4&&(je=2),No===null?No=[i]:No.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=dm(i,a,t);zd(i,g);break e;case 1:l=a;var v=i.type,m=i.stateNode;if(!(i.flags&128)&&(typeof v.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Sn===null||!Sn.has(m)))){i.flags|=65536,t&=-t,i.lanes|=t;var w=fm(i,l,t);zd(i,w);break e}}i=i.return}while(i!==null)}Pm(n)}catch(C){t=C,Ee===n&&n!==null&&(Ee=n=n.return);continue}break}while(!0)}function $m(){var e=bs.current;return bs.current=$s,e===null?$s:e}function mc(){(je===0||je===3||je===2)&&(je=4),be===null||!(Gn&268435455)&&!(il&268435455)||hn(be,ze)}function Ts(e,t){var n=ae;ae|=2;var r=$m();(be!==e||ze!==t)&&(Wt=null,On(e,t));do try{fw();break}catch(o){Mm(e,o)}while(!0);if(qu(),ae=n,bs.current=r,Ee!==null)throw Error(J(261));return be=null,ze=0,je}function fw(){for(;Ee!==null;)bm(Ee)}function hw(){for(;Ee!==null&&!Dv();)bm(Ee)}function bm(e){var t=Tm(e.alternate,e,nt);e.memoizedProps=e.pendingProps,t===null?Pm(e):Ee=t,cc.current=null}function Pm(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=sw(n,t),n!==null){n.flags&=32767,Ee=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{je=6,Ee=null;return}}else if(n=iw(n,t,nt),n!==null){Ee=n;return}if(t=t.sibling,t!==null){Ee=t;return}Ee=t=e}while(t!==null);je===0&&(je=5)}function Pn(e,t,n){var r=ue,o=mt.transition;try{mt.transition=null,ue=1,pw(e,t,n,r)}finally{mt.transition=o,ue=r}return null}function pw(e,t,n,r){do Mr();while(gn!==null);if(ae&6)throw Error(J(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(J(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(Kv(e,i),e===be&&(Ee=be=null,ze=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||zi||(zi=!0,zm(ps,function(){return Mr(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=mt.transition,mt.transition=null;var s=ue;ue=1;var l=ae;ae|=4,cc.current=null,aw(e,n),_m(n,e),zx(Ra),gs=!!Aa,Ra=Aa=null,e.current=n,uw(n),Ov(),ae=l,ue=s,mt.transition=i}else e.current=n;if(zi&&(zi=!1,gn=e,Is=o),i=e.pendingLanes,i===0&&(Sn=null),Bv(n.stateNode),Je(e,Ne()),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(Ps)throw Ps=!1,e=ru,ru=null,e;return Is&1&&e.tag!==0&&Mr(),i=e.pendingLanes,i&1?e===ou?Eo++:(Eo=0,ou=e):Eo=0,$n(),null}function Mr(){if(gn!==null){var e=dp(Is),t=mt.transition,n=ue;try{if(mt.transition=null,ue=16>e?16:e,gn===null)var r=!1;else{if(e=gn,gn=null,Is=0,ae&6)throw Error(J(331));var o=ae;for(ae|=4,ne=e.current;ne!==null;){var i=ne,s=i.child;if(ne.flags&16){var l=i.deletions;if(l!==null){for(var a=0;a<l.length;a++){var u=l[a];for(ne=u;ne!==null;){var c=ne;switch(c.tag){case 0:case 11:case 15:So(8,c,i)}var d=c.child;if(d!==null)d.return=c,ne=d;else for(;ne!==null;){c=ne;var h=c.sibling,p=c.return;if(Sm(c),c===u){ne=null;break}if(h!==null){h.return=p,ne=h;break}ne=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)}}ne=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,ne=s;else e:for(;ne!==null;){if(i=ne,i.flags&2048)switch(i.tag){case 0:case 11:case 15:So(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,ne=g;break e}ne=i.return}}var v=e.current;for(ne=v;ne!==null;){s=ne;var m=s.child;if(s.subtreeFlags&2064&&m!==null)m.return=s,ne=m;else e:for(s=v;ne!==null;){if(l=ne,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:ol(9,l)}}catch(C){Se(l,l.return,C)}if(l===s){ne=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,ne=w;break e}ne=l.return}}if(ae=o,$n(),Ot&&typeof Ot.onPostCommitFiberRoot=="function")try{Ot.onPostCommitFiberRoot(Qs,e)}catch{}r=!0}return r}finally{ue=n,mt.transition=t}}return!1}function tf(e,t,n){t=Ar(n,t),t=dm(e,t,1),e=kn(e,t,1),t=We(),e!==null&&(oi(e,1,t),Je(e,t))}function Se(e,t,n){if(e.tag===3)tf(e,e,n);else for(;t!==null;){if(t.tag===3){tf(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Sn===null||!Sn.has(r))){e=Ar(n,e),e=fm(t,e,1),t=kn(t,e,1),e=We(),t!==null&&(oi(t,1,e),Je(t,e));break}}t=t.return}}function mw(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=We(),e.pingedLanes|=e.suspendedLanes&n,be===e&&(ze&n)===n&&(je===4||je===3&&(ze&130023424)===ze&&500>Ne()-fc?On(e,0):dc|=n),Je(e,t)}function Im(e,t){t===0&&(e.mode&1?(t=Ei,Ei<<=1,!(Ei&130023424)&&(Ei=4194304)):t=1);var n=We();e=Jt(e,t),e!==null&&(oi(e,t,n),Je(e,n))}function gw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Im(e,n)}function yw(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(J(314))}r!==null&&r.delete(t),Im(e,n)}var Tm;Tm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||qe.current)Ge=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ge=!1,ow(e,t,n);Ge=!!(e.flags&131072)}else Ge=!1,ge&&t.flags&1048576&&Rp(t,Ns,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ts(e,t),e=t.pendingProps;var o=Ir(t,Fe.current);jr(t,n),o=ic(null,t,r,e,o,n);var i=sc();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,Ze(r)?(i=!0,ks(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,ec(t),o.updater=rl,t.stateNode=o,o._reactInternals=t,Ya(t,r,e,n),t=Ga(null,t,r,!0,i,n)):(t.tag=0,ge&&i&&Xu(t),Ve(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ts(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=xw(r),e=xt(r,e),o){case 0:t=Ka(null,t,r,e,n);break e;case 1:t=Ud(null,t,r,e,n);break e;case 11:t=Vd(null,t,r,e,n);break e;case 14:t=Wd(null,t,r,xt(r.type,e),n);break e}throw Error(J(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xt(r,o),Ka(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xt(r,o),Ud(e,t,r,o,n);case 3:e:{if(gm(t),e===null)throw Error(J(387));r=t.pendingProps,i=t.memoizedState,o=i.element,Vp(e,t),Cs(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=Ar(Error(J(423)),t),t=Yd(e,t,r,n,o);break e}else if(r!==o){o=Ar(Error(J(424)),t),t=Yd(e,t,r,n,o);break e}else for(ot=wn(t.stateNode.containerInfo.firstChild),it=t,ge=!0,Nt=null,n=Hp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Tr(),r===o){t=en(e,t,n);break e}Ve(e,t,r,n)}t=t.child}return t;case 5:return Wp(t),e===null&&Va(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Da(r,o)?s=null:i!==null&&Da(r,i)&&(t.flags|=32),mm(e,t),Ve(e,t,s,n),t.child;case 6:return e===null&&Va(t),null;case 13:return ym(e,t,n);case 4:return tc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=zr(t,null,r,n):Ve(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xt(r,o),Vd(e,t,r,o,n);case 7:return Ve(e,t,t.pendingProps,n),t.child;case 8:return Ve(e,t,t.pendingProps.children,n),t.child;case 12:return Ve(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,ce(Es,r._currentValue),r._currentValue=s,i!==null)if(bt(i.value,s)){if(i.children===o.children&&!qe.current){t=en(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=Gt(-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),Wa(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(J(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Wa(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}Ve(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,jr(t,n),o=gt(o),r=r(o),t.flags|=1,Ve(e,t,r,n),t.child;case 14:return r=t.type,o=xt(r,t.pendingProps),o=xt(r.type,o),Wd(e,t,r,o,n);case 15:return hm(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xt(r,o),ts(e,t),t.tag=1,Ze(r)?(e=!0,ks(t)):e=!1,jr(t,n),cm(t,r,o),Ya(t,r,o,n),Ga(null,t,r,!0,e,n);case 19:return vm(e,t,n);case 22:return pm(e,t,n)}throw Error(J(156,t.tag))};function zm(e,t){return lp(e,t)}function vw(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 pt(e,t,n,r){return new vw(e,t,n,r)}function gc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function xw(e){if(typeof e=="function")return gc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Lu)return 11;if(e===Au)return 14}return 2}function En(e,t){var n=e.alternate;return n===null?(n=pt(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 os(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")gc(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case dr:return Fn(n.children,o,i,t);case zu:s=8,o|=8;break;case ga:return e=pt(12,n,t,o|2),e.elementType=ga,e.lanes=i,e;case ya:return e=pt(13,n,t,o),e.elementType=ya,e.lanes=i,e;case va:return e=pt(19,n,t,o),e.elementType=va,e.lanes=i,e;case Wh:return sl(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Bh:s=10;break e;case Vh:s=9;break e;case Lu:s=11;break e;case Au:s=14;break e;case an:s=16,r=null;break e}throw Error(J(130,e==null?e:typeof e,""))}return t=pt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Fn(e,t,n,r){return e=pt(7,e,r,t),e.lanes=n,e}function sl(e,t,n,r){return e=pt(22,e,r,t),e.elementType=Wh,e.lanes=n,e.stateNode={isHidden:!1},e}function ta(e,t,n){return e=pt(6,e,null,t),e.lanes=n,e}function na(e,t,n){return t=pt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ww(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=Al(0),this.expirationTimes=Al(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Al(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function yc(e,t,n,r,o,i,s,l,a){return e=new ww(e,t,n,l,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=pt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ec(i),e}function kw(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:cr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Lm(e){if(!e)return Cn;e=e._reactInternals;e:{if(rr(e)!==e||e.tag!==1)throw Error(J(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ze(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(J(171))}if(e.tag===1){var n=e.type;if(Ze(n))return Lp(e,n,t)}return t}function Am(e,t,n,r,o,i,s,l,a){return e=yc(n,r,!0,e,o,i,s,l,a),e.context=Lm(null),n=e.current,r=We(),o=Nn(n),i=Gt(r,o),i.callback=t??null,kn(n,i,o),e.current.lanes=o,oi(e,o,r),Je(e,r),e}function ll(e,t,n,r){var o=t.current,i=We(),s=Nn(o);return n=Lm(n),t.context===null?t.context=n:t.pendingContext=n,t=Gt(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=kn(o,t,s),e!==null&&($t(e,o,s,i),Zi(e,o,s)),s}function zs(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 nf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vc(e,t){nf(e,t),(e=e.alternate)&&nf(e,t)}function Sw(){return null}var Rm=typeof reportError=="function"?reportError:function(e){console.error(e)};function xc(e){this._internalRoot=e}al.prototype.render=xc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(J(409));ll(e,t,null,null)};al.prototype.unmount=xc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Qn(function(){ll(null,e,null,null)}),t[Zt]=null}};function al(e){this._internalRoot=e}al.prototype.unstable_scheduleHydration=function(e){if(e){var t=pp();e={blockedOn:null,target:e,priority:t};for(var n=0;n<fn.length&&t!==0&&t<fn[n].priority;n++);fn.splice(n,0,e),n===0&&gp(e)}};function wc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ul(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function rf(){}function Nw(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=zs(s);i.call(u)}}var s=Am(t,r,e,0,null,!1,!1,"",rf);return e._reactRootContainer=s,e[Zt]=s.current,Ao(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=zs(a);l.call(u)}}var a=yc(e,0,!1,null,null,!1,!1,"",rf);return e._reactRootContainer=a,e[Zt]=a.current,Ao(e.nodeType===8?e.parentNode:e),Qn(function(){ll(t,a,n,r)}),a}function cl(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=zs(s);l.call(a)}}ll(t,s,e,o)}else s=Nw(n,t,e,o,r);return zs(s)}fp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=co(t.pendingLanes);n!==0&&(Ou(t,n|1),Je(t,Ne()),!(ae&6)&&(Rr=Ne()+500,$n()))}break;case 13:Qn(function(){var r=Jt(e,1);if(r!==null){var o=We();$t(r,e,1,o)}}),vc(e,1)}};Fu=function(e){if(e.tag===13){var t=Jt(e,134217728);if(t!==null){var n=We();$t(t,e,134217728,n)}vc(e,134217728)}};hp=function(e){if(e.tag===13){var t=Nn(e),n=Jt(e,t);if(n!==null){var r=We();$t(n,e,t,r)}vc(e,t)}};pp=function(){return ue};mp=function(e,t){var n=ue;try{return ue=e,t()}finally{ue=n}};Ma=function(e,t,n){switch(t){case"input":if(ka(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=el(r);if(!o)throw Error(J(90));Yh(r),ka(r,o)}}}break;case"textarea":Kh(e,n);break;case"select":t=n.value,t!=null&&Nr(e,!!n.multiple,t,!1)}};tp=hc;np=Qn;var Ew={usingClientEntryPoint:!1,Events:[si,mr,el,Jh,ep,hc]},io={findFiberByHostInstance:Tn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},_w={bundleType:io.bundleType,version:io.version,rendererPackageName:io.rendererPackageName,rendererConfig:io.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:rn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ip(e),e===null?null:e.stateNode},findFiberByHostInstance:io.findFiberByHostInstance||Sw,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 Li=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Li.isDisabled&&Li.supportsFiber)try{Qs=Li.inject(_w),Ot=Li}catch{}}at.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ew;at.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!wc(t))throw Error(J(200));return kw(e,t,null,n)};at.createRoot=function(e,t){if(!wc(e))throw Error(J(299));var n=!1,r="",o=Rm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=yc(e,1,!1,null,null,n,!1,r,o),e[Zt]=t.current,Ao(e.nodeType===8?e.parentNode:e),new xc(t)};at.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(J(188)):(e=Object.keys(e).join(","),Error(J(268,e)));return e=ip(t),e=e===null?null:e.stateNode,e};at.flushSync=function(e){return Qn(e)};at.hydrate=function(e,t,n){if(!ul(t))throw Error(J(200));return cl(null,e,t,!0,n)};at.hydrateRoot=function(e,t,n){if(!wc(e))throw Error(J(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=Rm;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=Am(t,null,e,1,n??null,o,!1,i,s),e[Zt]=t.current,Ao(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 al(t)};at.render=function(e,t,n){if(!ul(t))throw Error(J(200));return cl(null,e,t,!1,n)};at.unmountComponentAtNode=function(e){if(!ul(e))throw Error(J(40));return e._reactRootContainer?(Qn(function(){cl(null,null,e,!1,function(){e._reactRootContainer=null,e[Zt]=null})}),!0):!1};at.unstable_batchedUpdates=hc;at.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ul(n))throw Error(J(200));if(e==null||e._reactInternals===void 0)throw Error(J(38));return cl(e,t,n,!1,r)};at.version="18.3.1-next-f1338f8080-20240426";function Dm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Dm)}catch(e){console.error(e)}}Dm(),Dh.exports=at;var Om=Dh.exports,Fm,of=Om;Fm=of.createRoot,of.hydrateRoot;function _e(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=_e(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Cw={value:()=>{}};function dl(){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 is(n)}function is(e){this._=e}function jw(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}})}is.prototype=dl.prototype={constructor:is,on:function(e,t){var n=this._,r=jw(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=Mw(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]=sf(n[o],e.name,t);else if(t==null)for(o in n)n[o]=sf(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 is(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 Mw(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function sf(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=Cw,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var lu="http://www.w3.org/1999/xhtml";const lf={svg:"http://www.w3.org/2000/svg",xhtml:lu,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function fl(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),lf.hasOwnProperty(t)?{space:lf[t],local:e}:e}function $w(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===lu&&t.documentElement.namespaceURI===lu?t.createElement(e):t.createElementNS(n,e)}}function bw(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Hm(e){var t=fl(e);return(t.local?bw:$w)(t)}function Pw(){}function kc(e){return e==null?Pw:function(){return this.querySelector(e)}}function Iw(e){typeof e!="function"&&(e=kc(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 lt(r,this._parents)}function Tw(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function zw(){return[]}function Bm(e){return e==null?zw:function(){return this.querySelectorAll(e)}}function Lw(e){return function(){return Tw(e.apply(this,arguments))}}function Aw(e){typeof e=="function"?e=Lw(e):e=Bm(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 lt(r,o)}function Vm(e){return function(){return this.matches(e)}}function Wm(e){return function(t){return t.matches(e)}}var Rw=Array.prototype.find;function Dw(e){return function(){return Rw.call(this.children,e)}}function Ow(){return this.firstElementChild}function Fw(e){return this.select(e==null?Ow:Dw(typeof e=="function"?e:Wm(e)))}var Hw=Array.prototype.filter;function Bw(){return Array.from(this.children)}function Vw(e){return function(){return Hw.call(this.children,e)}}function Ww(e){return this.selectAll(e==null?Bw:Vw(typeof e=="function"?e:Wm(e)))}function Uw(e){typeof e!="function"&&(e=Vm(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 lt(r,this._parents)}function Um(e){return new Array(e.length)}function Yw(){return new lt(this._enter||this._groups.map(Um),this._parents)}function Ls(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ls.prototype={constructor:Ls,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 Xw(e){return function(){return e}}function Kw(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 Ls(e,i[s]);for(;s<a;++s)(l=t[s])&&(o[s]=l)}function Gw(e,t,n,r,o,i,s){var l,a,u=new Map,c=t.length,d=i.length,h=new Array(c),p;for(l=0;l<c;++l)(a=t[l])&&(h[l]=p=s.call(a,a.__data__,l,t)+"",u.has(p)?o[l]=a:u.set(p,a));for(l=0;l<d;++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 Ls(e,i[l]);for(l=0;l<c;++l)(a=t[l])&&u.get(h[l])===a&&(o[l]=a)}function Qw(e){return e.__data__}function qw(e,t){if(!arguments.length)return Array.from(this,Qw);var n=t?Gw:Kw,r=this._parents,o=this._groups;typeof e!="function"&&(e=Xw(e));for(var i=o.length,s=new Array(i),l=new Array(i),a=new Array(i),u=0;u<i;++u){var c=r[u],d=o[u],h=d.length,p=Zw(e.call(c,c&&c.__data__,u,r)),y=p.length,x=l[u]=new Array(y),k=s[u]=new Array(y),g=a[u]=new Array(h);n(c,d,x,k,g,p,t);for(var v=0,m=0,w,C;v<y;++v)if(w=x[v]){for(v>=m&&(m=v+1);!(C=k[m])&&++m<y;);w._next=C||null}}return s=new lt(s,r),s._enter=l,s._exit=a,s}function Zw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Jw(){return new lt(this._exit||this._groups.map(Um),this._parents)}function e1(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 t1(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),l=new Array(o),a=0;a<s;++a)for(var u=n[a],c=r[a],d=u.length,h=l[a]=new Array(d),p,y=0;y<d;++y)(p=u[y]||c[y])&&(h[y]=p);for(;a<o;++a)l[a]=n[a];return new lt(l,this._parents)}function n1(){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 r1(e){e||(e=o1);function t(d,h){return d&&h?e(d.__data__,h.__data__):!d-!h}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 lt(o,this._parents).order()}function o1(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function i1(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function s1(){return Array.from(this)}function l1(){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 a1(){let e=0;for(const t of this)++e;return e}function u1(){return!this.node()}function c1(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 d1(e){return function(){this.removeAttribute(e)}}function f1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function h1(e,t){return function(){this.setAttribute(e,t)}}function p1(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function m1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function g1(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 y1(e,t){var n=fl(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?f1:d1:typeof t=="function"?n.local?g1:m1:n.local?p1:h1)(n,t))}function Ym(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function v1(e){return function(){this.style.removeProperty(e)}}function x1(e,t,n){return function(){this.style.setProperty(e,t,n)}}function w1(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function k1(e,t,n){return arguments.length>1?this.each((t==null?v1:typeof t=="function"?w1:x1)(e,t,n??"")):Dr(this.node(),e)}function Dr(e,t){return e.style.getPropertyValue(t)||Ym(e).getComputedStyle(e,null).getPropertyValue(t)}function S1(e){return function(){delete this[e]}}function N1(e,t){return function(){this[e]=t}}function E1(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function _1(e,t){return arguments.length>1?this.each((t==null?S1:typeof t=="function"?E1:N1)(e,t)):this.node()[e]}function Xm(e){return e.trim().split(/^|\s+/)}function Sc(e){return e.classList||new Km(e)}function Km(e){this._node=e,this._names=Xm(e.getAttribute("class")||"")}Km.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 Gm(e,t){for(var n=Sc(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Qm(e,t){for(var n=Sc(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function C1(e){return function(){Gm(this,e)}}function j1(e){return function(){Qm(this,e)}}function M1(e,t){return function(){(t.apply(this,arguments)?Gm:Qm)(this,e)}}function $1(e,t){var n=Xm(e+"");if(arguments.length<2){for(var r=Sc(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?M1:t?C1:j1)(n,t))}function b1(){this.textContent=""}function P1(e){return function(){this.textContent=e}}function I1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function T1(e){return arguments.length?this.each(e==null?b1:(typeof e=="function"?I1:P1)(e)):this.node().textContent}function z1(){this.innerHTML=""}function L1(e){return function(){this.innerHTML=e}}function A1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function R1(e){return arguments.length?this.each(e==null?z1:(typeof e=="function"?A1:L1)(e)):this.node().innerHTML}function D1(){this.nextSibling&&this.parentNode.appendChild(this)}function O1(){return this.each(D1)}function F1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function H1(){return this.each(F1)}function B1(e){var t=typeof e=="function"?e:Hm(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function V1(){return null}function W1(e,t){var n=typeof e=="function"?e:Hm(e),r=t==null?V1:typeof t=="function"?t:kc(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function U1(){var e=this.parentNode;e&&e.removeChild(this)}function Y1(){return this.each(U1)}function X1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function K1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function G1(e){return this.select(e?K1:X1)}function Q1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function q1(e){return function(t){e.call(this,t,this.__data__)}}function Z1(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 J1(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 ek(e,t,n){return function(){var r=this.__on,o,i=q1(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 tk(e,t,n){var r=Z1(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?ek:J1,o=0;o<i;++o)this.each(l(r[o],t,n));return this}function qm(e,t,n){var r=Ym(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 nk(e,t){return function(){return qm(this,e,t)}}function rk(e,t){return function(){return qm(this,e,t.apply(this,arguments))}}function ok(e,t){return this.each((typeof t=="function"?rk:nk)(e,t))}function*ik(){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 Zm=[null];function lt(e,t){this._groups=e,this._parents=t}function ai(){return new lt([[document.documentElement]],Zm)}function sk(){return this}lt.prototype=ai.prototype={constructor:lt,select:Iw,selectAll:Aw,selectChild:Fw,selectChildren:Ww,filter:Uw,data:qw,enter:Yw,exit:Jw,join:e1,merge:t1,selection:sk,order:n1,sort:r1,call:i1,nodes:s1,node:l1,size:a1,empty:u1,each:c1,attr:y1,style:k1,property:_1,classed:$1,text:T1,html:R1,raise:O1,lower:H1,append:B1,insert:W1,remove:Y1,clone:G1,datum:Q1,on:tk,dispatch:ok,[Symbol.iterator]:ik};function rt(e){return typeof e=="string"?new lt([[document.querySelector(e)]],[document.documentElement]):new lt([[e]],Zm)}function lk(e){let t;for(;t=e.sourceEvent;)e=t;return e}function kt(e,t){if(e=lk(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 ak={passive:!1},Uo={capture:!0,passive:!1};function ra(e){e.stopImmediatePropagation()}function $r(e){e.preventDefault(),e.stopImmediatePropagation()}function Jm(e){var t=e.document.documentElement,n=rt(e).on("dragstart.drag",$r,Uo);"onselectstart"in t?n.on("selectstart.drag",$r,Uo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function eg(e,t){var n=e.document.documentElement,r=rt(e).on("dragstart.drag",null);t&&(r.on("click.drag",$r,Uo),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 Ai=e=>()=>e;function au(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}})}au.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function uk(e){return!e.ctrlKey&&!e.button}function ck(){return this.parentNode}function dk(e,t){return t??{x:e.x,y:e.y}}function fk(){return navigator.maxTouchPoints||"ontouchstart"in this}function tg(){var e=uk,t=ck,n=dk,r=fk,o={},i=dl("start","drag","end"),s=0,l,a,u,c,d=0;function h(w){w.on("mousedown.drag",p).filter(r).on("touchstart.drag",k).on("touchmove.drag",g,ak).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(w,C){if(!(c||!e.call(this,w,C))){var S=m(this,t.call(this,w,C),w,C,"mouse");S&&(rt(w.view).on("mousemove.drag",y,Uo).on("mouseup.drag",x,Uo),Jm(w.view),ra(w),u=!1,l=w.clientX,a=w.clientY,S("start",w))}}function y(w){if($r(w),!u){var C=w.clientX-l,S=w.clientY-a;u=C*C+S*S>d}o.mouse("drag",w)}function x(w){rt(w.view).on("mousemove.drag mouseup.drag",null),eg(w.view,u),$r(w),o.mouse("end",w)}function k(w,C){if(e.call(this,w,C)){var S=w.changedTouches,_=t.call(this,w,C),j=S.length,I,O;for(I=0;I<j;++I)(O=m(this,_,w,C,S[I].identifier,S[I]))&&(ra(w),O("start",w,S[I]))}}function g(w){var C=w.changedTouches,S=C.length,_,j;for(_=0;_<S;++_)(j=o[C[_].identifier])&&($r(w),j("drag",w,C[_]))}function v(w){var C=w.changedTouches,S=C.length,_,j;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),_=0;_<S;++_)(j=o[C[_].identifier])&&(ra(w),j("end",w,C[_]))}function m(w,C,S,_,j,I){var O=i.copy(),F=kt(I||S,C),U,B,N;if((N=n.call(w,new au("beforestart",{sourceEvent:S,target:h,identifier:j,active:s,x:F[0],y:F[1],dx:0,dy:0,dispatch:O}),_))!=null)return U=N.x-F[0]||0,B=N.y-F[1]||0,function T(z,D,b){var M=F,L;switch(z){case"start":o[j]=T,L=s++;break;case"end":delete o[j],--s;case"drag":F=kt(b||D,C),L=s;break}O.call(z,w,new au(z,{sourceEvent:D,subject:N,target:h,identifier:j,active:L,x:F[0]+U,y:F[1]+B,dx:F[0]-M[0],dy:F[1]-M[1],dispatch:O}),_)}}return h.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Ai(!!w),h):e},h.container=function(w){return arguments.length?(t=typeof w=="function"?w:Ai(w),h):t},h.subject=function(w){return arguments.length?(n=typeof w=="function"?w:Ai(w),h):n},h.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:Ai(!!w),h):r},h.on=function(){var w=i.on.apply(i,arguments);return w===i?h:w},h.clickDistance=function(w){return arguments.length?(d=(w=+w)*w,h):Math.sqrt(d)},h}function Nc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ng(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ui(){}var Yo=.7,As=1/Yo,br="\\s*([+-]?\\d+)\\s*",Xo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ht="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",hk=/^#([0-9a-f]{3,8})$/,pk=new RegExp(`^rgb\\(${br},${br},${br}\\)$`),mk=new RegExp(`^rgb\\(${Ht},${Ht},${Ht}\\)$`),gk=new RegExp(`^rgba\\(${br},${br},${br},${Xo}\\)$`),yk=new RegExp(`^rgba\\(${Ht},${Ht},${Ht},${Xo}\\)$`),vk=new RegExp(`^hsl\\(${Xo},${Ht},${Ht}\\)$`),xk=new RegExp(`^hsla\\(${Xo},${Ht},${Ht},${Xo}\\)$`),af={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};Nc(ui,qn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:uf,formatHex:uf,formatHex8:wk,formatHsl:kk,formatRgb:cf,toString:cf});function uf(){return this.rgb().formatHex()}function wk(){return this.rgb().formatHex8()}function kk(){return rg(this).formatHsl()}function cf(){return this.rgb().formatRgb()}function qn(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=hk.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?df(t):n===3?new Qe(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ri(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ri(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=pk.exec(e))?new Qe(t[1],t[2],t[3],1):(t=mk.exec(e))?new Qe(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=gk.exec(e))?Ri(t[1],t[2],t[3],t[4]):(t=yk.exec(e))?Ri(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=vk.exec(e))?pf(t[1],t[2]/100,t[3]/100,1):(t=xk.exec(e))?pf(t[1],t[2]/100,t[3]/100,t[4]):af.hasOwnProperty(e)?df(af[e]):e==="transparent"?new Qe(NaN,NaN,NaN,0):null}function df(e){return new Qe(e>>16&255,e>>8&255,e&255,1)}function Ri(e,t,n,r){return r<=0&&(e=t=n=NaN),new Qe(e,t,n,r)}function Sk(e){return e instanceof ui||(e=qn(e)),e?(e=e.rgb(),new Qe(e.r,e.g,e.b,e.opacity)):new Qe}function uu(e,t,n,r){return arguments.length===1?Sk(e):new Qe(e,t,n,r??1)}function Qe(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Nc(Qe,uu,ng(ui,{brighter(e){return e=e==null?As:Math.pow(As,e),new Qe(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Yo:Math.pow(Yo,e),new Qe(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Qe(Hn(this.r),Hn(this.g),Hn(this.b),Rs(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:ff,formatHex:ff,formatHex8:Nk,formatRgb:hf,toString:hf}));function ff(){return`#${An(this.r)}${An(this.g)}${An(this.b)}`}function Nk(){return`#${An(this.r)}${An(this.g)}${An(this.b)}${An((isNaN(this.opacity)?1:this.opacity)*255)}`}function hf(){const e=Rs(this.opacity);return`${e===1?"rgb(":"rgba("}${Hn(this.r)}, ${Hn(this.g)}, ${Hn(this.b)}${e===1?")":`, ${e})`}`}function Rs(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Hn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function An(e){return e=Hn(e),(e<16?"0":"")+e.toString(16)}function pf(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Et(e,t,n,r)}function rg(e){if(e instanceof Et)return new Et(e.h,e.s,e.l,e.opacity);if(e instanceof ui||(e=qn(e)),!e)return new Et;if(e instanceof Et)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 Et(s,l,a,e.opacity)}function Ek(e,t,n,r){return arguments.length===1?rg(e):new Et(e,t,n,r??1)}function Et(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Nc(Et,Ek,ng(ui,{brighter(e){return e=e==null?As:Math.pow(As,e),new Et(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Yo:Math.pow(Yo,e),new Et(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 Qe(oa(e>=240?e-240:e+120,o,r),oa(e,o,r),oa(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Et(mf(this.h),Di(this.s),Di(this.l),Rs(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=Rs(this.opacity);return`${e===1?"hsl(":"hsla("}${mf(this.h)}, ${Di(this.s)*100}%, ${Di(this.l)*100}%${e===1?")":`, ${e})`}`}}));function mf(e){return e=(e||0)%360,e<0?e+360:e}function Di(e){return Math.max(0,Math.min(1,e||0))}function oa(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 Ec=e=>()=>e;function _k(e,t){return function(n){return e+n*t}}function Ck(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 jk(e){return(e=+e)==1?og:function(t,n){return n-t?Ck(t,n,e):Ec(isNaN(t)?n:t)}}function og(e,t){var n=t-e;return n?_k(e,n):Ec(isNaN(e)?t:e)}const Ds=function e(t){var n=jk(t);function r(o,i){var s=n((o=uu(o)).r,(i=uu(i)).r),l=n(o.g,i.g),a=n(o.b,i.b),u=og(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 Mk(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 $k(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function bk(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]=_o(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 Pk(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function At(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Ik(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]=_o(e[o],t[o]):r[o]=t[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var cu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ia=new RegExp(cu.source,"g");function Tk(e){return function(){return e}}function zk(e){return function(t){return e(t)+""}}function ig(e,t){var n=cu.lastIndex=ia.lastIndex=0,r,o,i,s=-1,l=[],a=[];for(e=e+"",t=t+"";(r=cu.exec(e))&&(o=ia.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:At(r,o)})),n=ia.lastIndex;return n<t.length&&(i=t.slice(n),l[s]?l[s]+=i:l[++s]=i),l.length<2?a[0]?zk(a[0].x):Tk(t):(t=a.length,function(u){for(var c=0,d;c<t;++c)l[(d=a[c]).i]=d.x(u);return l.join("")})}function _o(e,t){var n=typeof t,r;return t==null||n==="boolean"?Ec(t):(n==="number"?At:n==="string"?(r=qn(t))?(t=r,Ds):ig:t instanceof qn?Ds:t instanceof Date?Pk:$k(t)?Mk:Array.isArray(t)?bk:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Ik:At)(e,t)}var gf=180/Math.PI,du={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function sg(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)*gf,skewX:Math.atan(a)*gf,scaleX:s,scaleY:l}}var Oi;function Lk(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?du:sg(t.a,t.b,t.c,t.d,t.e,t.f)}function Ak(e){return e==null||(Oi||(Oi=document.createElementNS("http://www.w3.org/2000/svg","g")),Oi.setAttribute("transform",e),!(e=Oi.transform.baseVal.consolidate()))?du:(e=e.matrix,sg(e.a,e.b,e.c,e.d,e.e,e.f))}function lg(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,c,d,h,p,y){if(u!==d||c!==h){var x=p.push("translate(",null,t,null,n);y.push({i:x-4,x:At(u,d)},{i:x-2,x:At(c,h)})}else(d||h)&&p.push("translate("+d+t+h+n)}function s(u,c,d,h){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),h.push({i:d.push(o(d)+"rotate(",null,r)-2,x:At(u,c)})):c&&d.push(o(d)+"rotate("+c+r)}function l(u,c,d,h){u!==c?h.push({i:d.push(o(d)+"skewX(",null,r)-2,x:At(u,c)}):c&&d.push(o(d)+"skewX("+c+r)}function a(u,c,d,h,p,y){if(u!==d||c!==h){var x=p.push(o(p)+"scale(",null,",",null,")");y.push({i:x-4,x:At(u,d)},{i:x-2,x:At(c,h)})}else(d!==1||h!==1)&&p.push(o(p)+"scale("+d+","+h+")")}return function(u,c){var d=[],h=[];return u=e(u),c=e(c),i(u.translateX,u.translateY,c.translateX,c.translateY,d,h),s(u.rotate,c.rotate,d,h),l(u.skewX,c.skewX,d,h),a(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,h),u=c=null,function(p){for(var y=-1,x=h.length,k;++y<x;)d[(k=h[y]).i]=k.x(p);return d.join("")}}}var Rk=lg(Lk,"px, ","px)","deg)"),Dk=lg(Ak,", ",")",")"),Ok=1e-12;function yf(e){return((e=Math.exp(e))+1/e)/2}function Fk(e){return((e=Math.exp(e))-1/e)/2}function Hk(e){return((e=Math.exp(2*e))-1)/(e+1)}const ss=function e(t,n,r){function o(i,s){var l=i[0],a=i[1],u=i[2],c=s[0],d=s[1],h=s[2],p=c-l,y=d-a,x=p*p+y*y,k,g;if(x<Ok)g=Math.log(h/u)/t,k=function(_){return[l+_*p,a+_*y,u*Math.exp(t*_*g)]};else{var v=Math.sqrt(x),m=(h*h-u*u+r*x)/(2*u*n*v),w=(h*h-u*u-r*x)/(2*h*n*v),C=Math.log(Math.sqrt(m*m+1)-m),S=Math.log(Math.sqrt(w*w+1)-w);g=(S-C)/t,k=function(_){var j=_*g,I=yf(C),O=u/(n*v)*(I*Hk(t*j+C)-Fk(C));return[l+O*p,a+O*y,u*I/yf(t*j+C)]}}return k.duration=g*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 Or=0,ho=0,so=0,ag=1e3,Os,po,Fs=0,Zn=0,hl=0,Ko=typeof performance=="object"&&performance.now?performance:Date,ug=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function _c(){return Zn||(ug(Bk),Zn=Ko.now()+hl)}function Bk(){Zn=0}function Hs(){this._call=this._time=this._next=null}Hs.prototype=cg.prototype={constructor:Hs,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?_c():+n)+(t==null?0:+t),!this._next&&po!==this&&(po?po._next=this:Os=this,po=this),this._call=e,this._time=n,fu()},stop:function(){this._call&&(this._call=null,this._time=1/0,fu())}};function cg(e,t,n){var r=new Hs;return r.restart(e,t,n),r}function Vk(){_c(),++Or;for(var e=Os,t;e;)(t=Zn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Or}function vf(){Zn=(Fs=Ko.now())+hl,Or=ho=0;try{Vk()}finally{Or=0,Uk(),Zn=0}}function Wk(){var e=Ko.now(),t=e-Fs;t>ag&&(hl-=t,Fs=e)}function Uk(){for(var e,t=Os,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:Os=n);po=e,fu(r)}function fu(e){if(!Or){ho&&(ho=clearTimeout(ho));var t=e-Zn;t>24?(e<1/0&&(ho=setTimeout(vf,e-Ko.now()-hl)),so&&(so=clearInterval(so))):(so||(Fs=Ko.now(),so=setInterval(Wk,ag)),Or=1,ug(vf))}}function xf(e,t,n){var r=new Hs;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var Yk=dl("start","end","cancel","interrupt"),Xk=[],dg=0,wf=1,hu=2,ls=3,kf=4,pu=5,as=6;function pl(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Kk(e,n,{name:t,index:r,group:o,on:Yk,tween:Xk,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:dg})}function Cc(e,t){var n=It(e,t);if(n.state>dg)throw new Error("too late; already scheduled");return n}function Bt(e,t){var n=It(e,t);if(n.state>ls)throw new Error("too late; already running");return n}function It(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Kk(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=cg(i,0,n.time);function i(u){n.state=wf,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,h,p;if(n.state!==wf)return a();for(c in r)if(p=r[c],p.name===n.name){if(p.state===ls)return xf(s);p.state===kf?(p.state=as,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[c]):+c<t&&(p.state=as,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[c])}if(xf(function(){n.state===ls&&(n.state=kf,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=hu,n.on.call("start",e,e.__data__,n.index,n.group),n.state===hu){for(n.state=ls,o=new Array(h=n.tween.length),c=0,d=-1;c<h;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++d]=p);o.length=d+1}}function l(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=pu,1),d=-1,h=o.length;++d<h;)o[d].call(e,c);n.state===pu&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=as,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function us(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>hu&&r.state<pu,r.state=as,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function Gk(e){return this.each(function(){us(this,e)})}function Qk(e,t){var n,r;return function(){var o=Bt(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 qk(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=Bt(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 Zk(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=It(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?Qk:qk)(n,e,t))}function jc(e,t,n){var r=e._id;return e.each(function(){var o=Bt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return It(o,r).value[t]}}function fg(e,t){var n;return(typeof t=="number"?At:t instanceof qn?Ds:(n=qn(t))?(t=n,Ds):ig)(e,t)}function Jk(e){return function(){this.removeAttribute(e)}}function eS(e){return function(){this.removeAttributeNS(e.space,e.local)}}function tS(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 nS(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 rS(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 oS(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 iS(e,t){var n=fl(e),r=n==="transform"?Dk:fg;return this.attrTween(e,typeof t=="function"?(n.local?oS:rS)(n,r,jc(this,"attr."+e,t)):t==null?(n.local?eS:Jk)(n):(n.local?nS:tS)(n,r,t))}function sS(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function lS(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function aS(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&lS(e,i)),n}return o._value=t,o}function uS(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&sS(e,i)),n}return o._value=t,o}function cS(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=fl(e);return this.tween(n,(r.local?aS:uS)(r,t))}function dS(e,t){return function(){Cc(this,e).delay=+t.apply(this,arguments)}}function fS(e,t){return t=+t,function(){Cc(this,e).delay=t}}function hS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?dS:fS)(t,e)):It(this.node(),t).delay}function pS(e,t){return function(){Bt(this,e).duration=+t.apply(this,arguments)}}function mS(e,t){return t=+t,function(){Bt(this,e).duration=t}}function gS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?pS:mS)(t,e)):It(this.node(),t).duration}function yS(e,t){if(typeof t!="function")throw new Error;return function(){Bt(this,e).ease=t}}function vS(e){var t=this._id;return arguments.length?this.each(yS(t,e)):It(this.node(),t).ease}function xS(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Bt(this,e).ease=n}}function wS(e){if(typeof e!="function")throw new Error;return this.each(xS(this._id,e))}function kS(e){typeof e!="function"&&(e=Vm(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 tn(r,this._parents,this._name,this._id)}function SS(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),l=0;l<i;++l)for(var a=t[l],u=n[l],c=a.length,d=s[l]=new Array(c),h,p=0;p<c;++p)(h=a[p]||u[p])&&(d[p]=h);for(;l<r;++l)s[l]=t[l];return new tn(s,this._parents,this._name,this._id)}function NS(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 ES(e,t,n){var r,o,i=NS(t)?Cc:Bt;return function(){var s=i(this,e),l=s.on;l!==r&&(o=(r=l).copy()).on(t,n),s.on=o}}function _S(e,t){var n=this._id;return arguments.length<2?It(this.node(),n).on.on(e):this.each(ES(n,e,t))}function CS(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function jS(){return this.on("end.remove",CS(this._id))}function MS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=kc(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var l=r[s],a=l.length,u=i[s]=new Array(a),c,d,h=0;h<a;++h)(c=l[h])&&(d=e.call(c,c.__data__,h,l))&&("__data__"in c&&(d.__data__=c.__data__),u[h]=d,pl(u[h],t,n,h,u,It(c,n)));return new tn(i,this._parents,t,n)}function $S(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Bm(e));for(var r=this._groups,o=r.length,i=[],s=[],l=0;l<o;++l)for(var a=r[l],u=a.length,c,d=0;d<u;++d)if(c=a[d]){for(var h=e.call(c,c.__data__,d,a),p,y=It(c,n),x=0,k=h.length;x<k;++x)(p=h[x])&&pl(p,t,n,x,h,y);i.push(h),s.push(c)}return new tn(i,s,t,n)}var bS=ai.prototype.constructor;function PS(){return new bS(this._groups,this._parents)}function IS(e,t){var n,r,o;return function(){var i=Dr(this,e),s=(this.style.removeProperty(e),Dr(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function hg(e){return function(){this.style.removeProperty(e)}}function TS(e,t,n){var r,o=n+"",i;return function(){var s=Dr(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function zS(e,t,n){var r,o,i;return function(){var s=Dr(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),Dr(this,e))),s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l))}}function LS(e,t){var n,r,o,i="style."+t,s="end."+i,l;return function(){var a=Bt(this,e),u=a.on,c=a.value[i]==null?l||(l=hg(t)):void 0;(u!==n||o!==c)&&(r=(n=u).copy()).on(s,o=c),a.on=r}}function AS(e,t,n){var r=(e+="")=="transform"?Rk:fg;return t==null?this.styleTween(e,IS(e,r)).on("end.style."+e,hg(e)):typeof t=="function"?this.styleTween(e,zS(e,r,jc(this,"style."+e,t))).each(LS(this._id,e)):this.styleTween(e,TS(e,r,t),n).on("end.style."+e,null)}function RS(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function DS(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&RS(e,s,n)),r}return i._value=t,i}function OS(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,DS(e,t,n??""))}function FS(e){return function(){this.textContent=e}}function HS(e){return function(){var t=e(this);this.textContent=t??""}}function BS(e){return this.tween("text",typeof e=="function"?HS(jc(this,"text",e)):FS(e==null?"":e+""))}function VS(e){return function(t){this.textContent=e.call(this,t)}}function WS(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&VS(o)),t}return r._value=e,r}function US(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,WS(e))}function YS(){for(var e=this._name,t=this._id,n=pg(),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=It(a,t);pl(a,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new tn(r,this._parents,e,n)}function XS(){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=Bt(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 KS=0;function tn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function pg(){return++KS}var Vt=ai.prototype;tn.prototype={constructor:tn,select:MS,selectAll:$S,selectChild:Vt.selectChild,selectChildren:Vt.selectChildren,filter:kS,merge:SS,selection:PS,transition:YS,call:Vt.call,nodes:Vt.nodes,node:Vt.node,size:Vt.size,empty:Vt.empty,each:Vt.each,on:_S,attr:iS,attrTween:cS,style:AS,styleTween:OS,text:BS,textTween:US,remove:jS,tween:Zk,delay:hS,duration:gS,ease:vS,easeVarying:wS,end:XS,[Symbol.iterator]:Vt[Symbol.iterator]};function GS(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var QS={time:null,delay:0,duration:250,ease:GS};function qS(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 ZS(e){var t,n;e instanceof tn?(t=e._id,e=e._name):(t=pg(),(n=QS).time=_c(),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])&&pl(a,e,t,u,s,n||qS(a,t));return new tn(r,this._parents,e,t)}ai.prototype.interrupt=Gk;ai.prototype.transition=ZS;const Fi=e=>()=>e;function JS(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 Kt(e,t,n){this.k=e,this.x=t,this.y=n}Kt.prototype={constructor:Kt,scale:function(e){return e===1?this:new Kt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Kt(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 ml=new Kt(1,0,0);mg.prototype=Kt.prototype;function mg(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ml;return e.__zoom}function sa(e){e.stopImmediatePropagation()}function lo(e){e.preventDefault(),e.stopImmediatePropagation()}function eN(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function tN(){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 Sf(){return this.__zoom||ml}function nN(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function rN(){return navigator.maxTouchPoints||"ontouchstart"in this}function oN(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 gg(){var e=eN,t=tN,n=oN,r=nN,o=rN,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,a=ss,u=dl("start","zoom","end"),c,d,h,p=500,y=150,x=0,k=10;function g(N){N.property("__zoom",Sf).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",O).filter(o).on("touchstart.zoom",F).on("touchmove.zoom",U).on("touchend.zoom touchcancel.zoom",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(N,T,z,D){var b=N.selection?N.selection():N;b.property("__zoom",Sf),N!==b?C(N,T,z,D):b.interrupt().each(function(){S(this,arguments).event(D).start().zoom(null,typeof T=="function"?T.apply(this,arguments):T).end()})},g.scaleBy=function(N,T,z,D){g.scaleTo(N,function(){var b=this.__zoom.k,M=typeof T=="function"?T.apply(this,arguments):T;return b*M},z,D)},g.scaleTo=function(N,T,z,D){g.transform(N,function(){var b=t.apply(this,arguments),M=this.__zoom,L=z==null?w(b):typeof z=="function"?z.apply(this,arguments):z,P=M.invert(L),H=typeof T=="function"?T.apply(this,arguments):T;return n(m(v(M,H),L,P),b,s)},z,D)},g.translateBy=function(N,T,z,D){g.transform(N,function(){return n(this.__zoom.translate(typeof T=="function"?T.apply(this,arguments):T,typeof z=="function"?z.apply(this,arguments):z),t.apply(this,arguments),s)},null,D)},g.translateTo=function(N,T,z,D,b){g.transform(N,function(){var M=t.apply(this,arguments),L=this.__zoom,P=D==null?w(M):typeof D=="function"?D.apply(this,arguments):D;return n(ml.translate(P[0],P[1]).scale(L.k).translate(typeof T=="function"?-T.apply(this,arguments):-T,typeof z=="function"?-z.apply(this,arguments):-z),M,s)},D,b)};function v(N,T){return T=Math.max(i[0],Math.min(i[1],T)),T===N.k?N:new Kt(T,N.x,N.y)}function m(N,T,z){var D=T[0]-z[0]*N.k,b=T[1]-z[1]*N.k;return D===N.x&&b===N.y?N:new Kt(N.k,D,b)}function w(N){return[(+N[0][0]+ +N[1][0])/2,(+N[0][1]+ +N[1][1])/2]}function C(N,T,z,D){N.on("start.zoom",function(){S(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(D).end()}).tween("zoom",function(){var b=this,M=arguments,L=S(b,M).event(D),P=t.apply(b,M),H=z==null?w(P):typeof z=="function"?z.apply(b,M):z,ee=Math.max(P[1][0]-P[0][0],P[1][1]-P[0][1]),K=b.__zoom,Y=typeof T=="function"?T.apply(b,M):T,V=a(K.invert(H).concat(ee/K.k),Y.invert(H).concat(ee/Y.k));return function(X){if(X===1)X=Y;else{var E=V(X),R=ee/E[2];X=new Kt(R,H[0]-E[0]*R,H[1]-E[1]*R)}L.zoom(null,X)}})}function S(N,T,z){return!z&&N.__zooming||new _(N,T)}function _(N,T){this.that=N,this.args=T,this.active=0,this.sourceEvent=null,this.extent=t.apply(N,T),this.taps=0}_.prototype={event:function(N){return N&&(this.sourceEvent=N),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(N,T){return this.mouse&&N!=="mouse"&&(this.mouse[1]=T.invert(this.mouse[0])),this.touch0&&N!=="touch"&&(this.touch0[1]=T.invert(this.touch0[0])),this.touch1&&N!=="touch"&&(this.touch1[1]=T.invert(this.touch1[0])),this.that.__zoom=T,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(N){var T=rt(this.that).datum();u.call(N,this.that,new JS(N,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:u}),T)}};function j(N,...T){if(!e.apply(this,arguments))return;var z=S(this,T).event(N),D=this.__zoom,b=Math.max(i[0],Math.min(i[1],D.k*Math.pow(2,r.apply(this,arguments)))),M=kt(N);if(z.wheel)(z.mouse[0][0]!==M[0]||z.mouse[0][1]!==M[1])&&(z.mouse[1]=D.invert(z.mouse[0]=M)),clearTimeout(z.wheel);else{if(D.k===b)return;z.mouse=[M,D.invert(M)],us(this),z.start()}lo(N),z.wheel=setTimeout(L,y),z.zoom("mouse",n(m(v(D,b),z.mouse[0],z.mouse[1]),z.extent,s));function L(){z.wheel=null,z.end()}}function I(N,...T){if(h||!e.apply(this,arguments))return;var z=N.currentTarget,D=S(this,T,!0).event(N),b=rt(N.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",ee,!0),M=kt(N,z),L=N.clientX,P=N.clientY;Jm(N.view),sa(N),D.mouse=[M,this.__zoom.invert(M)],us(this),D.start();function H(K){if(lo(K),!D.moved){var Y=K.clientX-L,V=K.clientY-P;D.moved=Y*Y+V*V>x}D.event(K).zoom("mouse",n(m(D.that.__zoom,D.mouse[0]=kt(K,z),D.mouse[1]),D.extent,s))}function ee(K){b.on("mousemove.zoom mouseup.zoom",null),eg(K.view,D.moved),lo(K),D.event(K).end()}}function O(N,...T){if(e.apply(this,arguments)){var z=this.__zoom,D=kt(N.changedTouches?N.changedTouches[0]:N,this),b=z.invert(D),M=z.k*(N.shiftKey?.5:2),L=n(m(v(z,M),D,b),t.apply(this,T),s);lo(N),l>0?rt(this).transition().duration(l).call(C,L,D,N):rt(this).call(g.transform,L,D,N)}}function F(N,...T){if(e.apply(this,arguments)){var z=N.touches,D=z.length,b=S(this,T,N.changedTouches.length===D).event(N),M,L,P,H;for(sa(N),L=0;L<D;++L)P=z[L],H=kt(P,this),H=[H,this.__zoom.invert(H),P.identifier],b.touch0?!b.touch1&&b.touch0[2]!==H[2]&&(b.touch1=H,b.taps=0):(b.touch0=H,M=!0,b.taps=1+!!c);c&&(c=clearTimeout(c)),M&&(b.taps<2&&(d=H[0],c=setTimeout(function(){c=null},p)),us(this),b.start())}}function U(N,...T){if(this.__zooming){var z=S(this,T).event(N),D=N.changedTouches,b=D.length,M,L,P,H;for(lo(N),M=0;M<b;++M)L=D[M],P=kt(L,this),z.touch0&&z.touch0[2]===L.identifier?z.touch0[0]=P:z.touch1&&z.touch1[2]===L.identifier&&(z.touch1[0]=P);if(L=z.that.__zoom,z.touch1){var ee=z.touch0[0],K=z.touch0[1],Y=z.touch1[0],V=z.touch1[1],X=(X=Y[0]-ee[0])*X+(X=Y[1]-ee[1])*X,E=(E=V[0]-K[0])*E+(E=V[1]-K[1])*E;L=v(L,Math.sqrt(X/E)),P=[(ee[0]+Y[0])/2,(ee[1]+Y[1])/2],H=[(K[0]+V[0])/2,(K[1]+V[1])/2]}else if(z.touch0)P=z.touch0[0],H=z.touch0[1];else return;z.zoom("touch",n(m(L,P,H),z.extent,s))}}function B(N,...T){if(this.__zooming){var z=S(this,T).event(N),D=N.changedTouches,b=D.length,M,L;for(sa(N),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),M=0;M<b;++M)L=D[M],z.touch0&&z.touch0[2]===L.identifier?delete z.touch0:z.touch1&&z.touch1[2]===L.identifier&&delete z.touch1;if(z.touch1&&!z.touch0&&(z.touch0=z.touch1,delete z.touch1),z.touch0)z.touch0[1]=this.__zoom.invert(z.touch0[0]);else if(z.end(),z.taps===2&&(L=kt(L,this),Math.hypot(d[0]-L[0],d[1]-L[1])<k)){var P=rt(this).on("dblclick.zoom");P&&P.apply(this,arguments)}}}return g.wheelDelta=function(N){return arguments.length?(r=typeof N=="function"?N:Fi(+N),g):r},g.filter=function(N){return arguments.length?(e=typeof N=="function"?N:Fi(!!N),g):e},g.touchable=function(N){return arguments.length?(o=typeof N=="function"?N:Fi(!!N),g):o},g.extent=function(N){return arguments.length?(t=typeof N=="function"?N:Fi([[+N[0][0],+N[0][1]],[+N[1][0],+N[1][1]]]),g):t},g.scaleExtent=function(N){return arguments.length?(i[0]=+N[0],i[1]=+N[1],g):[i[0],i[1]]},g.translateExtent=function(N){return arguments.length?(s[0][0]=+N[0][0],s[1][0]=+N[1][0],s[0][1]=+N[0][1],s[1][1]=+N[1][1],g):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},g.constrain=function(N){return arguments.length?(n=N,g):n},g.duration=function(N){return arguments.length?(l=+N,g):l},g.interpolate=function(N){return arguments.length?(a=N,g):a},g.on=function(){var N=u.on.apply(u,arguments);return N===u?g:N},g.clickDistance=function(N){return arguments.length?(x=(N=+N)*N,g):Math.sqrt(x)},g.tapDistance=function(N){return arguments.length?(k=+N,g):k},g}const Pt={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.`},Go=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],yg=["Enter"," ","Escape"],vg={"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 Fr;(function(e){e.Strict="strict",e.Loose="loose"})(Fr||(Fr={}));var Bn;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Bn||(Bn={}));var Qo;(function(e){e.Partial="partial",e.Full="full"})(Qo||(Qo={}));const xg={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var pn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(pn||(pn={}));var qo;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(qo||(qo={}));var re;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(re||(re={}));const Nf={[re.Left]:re.Right,[re.Right]:re.Left,[re.Top]:re.Bottom,[re.Bottom]:re.Top},wg=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,iN=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Mc=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ci=(e,t=[0,0])=>{const{width:n,height:r}=Tt(e),o=e.origin??t,i=n*o[0],s=r*o[1];return{x:e.position.x-i,y:e.position.y-s}},sN=(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):Mc(i)?i:t.nodeLookup.get(i.id)),l?(n=!0,gl(o,Bs(l,t.nodeOrigin))):o},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?yl(r):{x:0,y:0,width:0,height:0}},di=(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=gl(n,Bs(o)),r=!0)}),r?yl(n):{x:0,y:0,width:0,height:0}},$c=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1)=>{const l=(t.x-n)/o,a=(t.y-r)/o,u=t.width/o,c=t.height/o,d=[];for(const h of e.values()){const{measured:p,selectable:y=!0,hidden:x=!1}=h;if(s&&!y||x)continue;const k=p.width??h.width??h.initialWidth??0,g=p.height??h.height??h.initialHeight??0,{x:v,y:m}=h.internals.positionAbsolute,w=Eg(l,a,u,c,v,m,k,g),C=k*g,S=i&&w>0;(!h.internals.handleBounds||S||w>=C||h.dragging)&&d.push(h)}return d},lN=(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 aN(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}=Tt(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 uN({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return!0;const l=aN(e,s),a=di(l),u=Pc(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 kg({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){const s=n.get(e),l=s.parentId?n.get(s.parentId):void 0,{x:a,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},c=s.origin??r;let d=s.extent||o;if(s.extent==="parent"&&!s.expandParent)if(!l)i==null||i("005",Pt.error005());else{const{width:p,height:y}=Tt(l);p&&y&&(d=[[a,u],[a+p,u+y]])}else l&&er(s.extent)&&(d=[[s.extent[0][0]+a,s.extent[0][1]+u],[s.extent[1][0]+a,s.extent[1][1]+u]]);const h=er(d)?Jn(t,d,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",Pt.error015())),{position:{x:h.x-a+(s.measured.width??0)*c[0],y:h.y-u+(s.measured.height??0)*c[1]},positionAbsolute:h}}async function cN({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const i=new Set(e.map(h=>h.id)),s=[];for(const h of n){if(h.deletable===!1)continue;const p=i.has(h.id),y=!p&&h.parentId&&s.find(x=>x.id===h.parentId);(p||y)&&s.push(h)}const l=new Set(t.map(h=>h.id)),a=r.filter(h=>h.deletable!==!1),c=lN(s,a);for(const h of a)l.has(h.id)&&!c.find(y=>y.id===h.id)&&c.push(h);if(!o)return{edges:c,nodes:s};const d=await o({nodes:s,edges:c});return typeof d=="boolean"?d?{edges:c,nodes:s}:{edges:[],nodes:[]}:d}const Hr=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Jn=(e={x:0,y:0},t,n)=>({x:Hr(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Hr(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Sg(e,t,n){const{width:r,height:o}=Tt(n),{x:i,y:s}=n.internals.positionAbsolute;return Jn(e,[[i,s],[i+r,s+o]],t)}const Ef=(e,t,n)=>e<t?Hr(Math.abs(e-t),1,t)/t:e>n?-Hr(Math.abs(e-n),1,t)/t:0,bc=(e,t,n=15,r=40)=>{const o=Ef(e.x,r,t.width-r)*n,i=Ef(e.y,r,t.height-r)*n;return[o,i]},gl=(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)}),mu=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),yl=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Zo=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Mc(e)?e.internals.positionAbsolute:ci(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}},Bs=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=Mc(e)?e.internals.positionAbsolute:ci(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)}},Ng=(e,t)=>yl(gl(mu(e),mu(t))),Eg=(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)},Vs=(e,t)=>Eg(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),_f=e=>Ct(e.width)&&Ct(e.height)&&Ct(e.x)&&Ct(e.y),Ct=e=>!isNaN(e)&&isFinite(e),_g=(e,t)=>(n,r)=>{},fi=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),hi=({x:e,y:t},[n,r,o],i=!1,s=[1,1])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?fi(l,s):l},Br=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function ir(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 dN(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=ir(e,n),o=ir(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=ir(e.top??e.y??0,n),o=ir(e.bottom??e.y??0,n),i=ir(e.left??e.x??0,t),s=ir(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 fN(e,t,n,r,o,i){const{x:s,y:l}=Br(e,[t,n,r]),{x:a,y:u}=Br({x:e.x+e.width,y:e.y+e.height},[t,n,r]),c=o-a,d=i-u;return{left:Math.floor(s),top:Math.floor(l),right:Math.floor(c),bottom:Math.floor(d)}}const Pc=(e,t,n,r,o,i)=>{const s=dN(i,t,n),l=(t-s.x)/e.width,a=(n-s.y)/e.height,u=Math.min(l,a),c=Hr(u,r,o),d=e.x+e.width/2,h=e.y+e.height/2,p=t/2-d*c,y=n/2-h*c,x=fN(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}},Jo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function er(e){return e!=null&&e!=="parent"}function Tt(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 Cg(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 jg(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 Cf(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function hN(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function pN(e){return{...vg,...e||{}}}function Mg(e){return e===null?null:e?"valid":"invalid"}function Co(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:s}=jt(e),l=hi({x:i-((o==null?void 0:o.left)??0),y:s-((o==null?void 0:o.top)??0)},r),{x:a,y:u}=n?fi(l,t):l;return{xSnapped:a,ySnapped:u,...l}}const Ic=e=>({width:e.offsetWidth,height:e.offsetHeight}),$g=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},mN=["INPUT","SELECT","TEXTAREA"];function bg(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:mN.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Pg=e=>"clientX"in e,jt=(e,t)=>{var i,s;const n=Pg(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)}},jf=(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,...Ic(s)}})};function Ig({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:l}){const a=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+l*.375+r*.125,c=Math.abs(a-e),d=Math.abs(u-t);return[a,u,c,d]}function Hi(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Mf({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case re.Left:return[t-Hi(t-r,i),n];case re.Right:return[t+Hi(r-t,i),n];case re.Top:return[t,n-Hi(n-o,i)];case re.Bottom:return[t,n+Hi(o-n,i)]}}function Tc({sourceX:e,sourceY:t,sourcePosition:n=re.Bottom,targetX:r,targetY:o,targetPosition:i=re.Top,curvature:s=.25}){const[l,a]=Mf({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,c]=Mf({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[d,h,p,y]=Ig({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:a,targetControlX:u,targetControlY:c});return[`M${e},${t} C${l},${a} ${u},${c} ${r},${o}`,d,h,p,y]}function Tg({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 gN({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 yN({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=gl(Bs(e),Bs(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 Vs(s,yl(i))>0}const vN=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,xN=(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)),wN=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",Pt.error006()),t;const r=n.getEdgeId||vN;let o;return wg(e)?o={...e}:o={...e,id:r(e)},xN(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function zg({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,l]=Tg({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,l]}const $f={[re.Left]:{x:-1,y:0},[re.Right]:{x:1,y:0},[re.Top]:{x:0,y:-1},[re.Bottom]:{x:0,y:1}},kN=({source:e,sourcePosition:t=re.Bottom,target:n})=>t===re.Left||t===re.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},bf=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function SN({source:e,sourcePosition:t=re.Bottom,target:n,targetPosition:r=re.Top,center:o,offset:i,stepPosition:s}){const l=$f[t],a=$f[r],u={x:e.x+l.x*i,y:e.y+l.y*i},c={x:n.x+a.x*i,y:n.y+a.y*i},d=kN({source:u,sourcePosition:t,target:c}),h=d.x!==0?"x":"y",p=d[h];let y=[],x,k;const g={x:0,y:0},v={x:0,y:0},[,,m,w]=Tg({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*a[h]===-1){h==="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 j=[{x,y:u.y},{x,y:c.y}],I=[{x:u.x,y:k},{x:c.x,y:k}];l[h]===p?y=h==="x"?j:I:y=h==="x"?I:j}else{const j=[{x:u.x,y:c.y}],I=[{x:c.x,y:u.y}];if(h==="x"?y=l.x===p?I:j:y=l.y===p?j:I,t===r){const N=Math.abs(e[h]-n[h]);if(N<=i){const T=Math.min(i-1,i-N);l[h]===p?g[h]=(u[h]>e[h]?-1:1)*T:v[h]=(c[h]>n[h]?-1:1)*T}}if(t!==r){const N=h==="x"?"y":"x",T=l[h]===a[N],z=u[N]>c[N],D=u[N]<c[N];(l[h]===1&&(!T&&z||T&&D)||l[h]!==1&&(!T&&D||T&&z))&&(y=h==="x"?j:I)}const O={x:u.x+g.x,y:u.y+g.y},F={x:c.x+v.x,y:c.y+v.y},U=Math.max(Math.abs(O.x-y[0].x),Math.abs(F.x-y[0].x)),B=Math.max(Math.abs(O.y-y[0].y),Math.abs(F.y-y[0].y));U>=B?(x=(O.x+F.x)/2,k=y[0].y):(x=y[0].x,k=(O.y+F.y)/2)}const C={x:u.x+g.x,y:u.y+g.y},S={x:c.x+v.x,y:c.y+v.y};return[[e,...C.x!==y[0].x||C.y!==y[0].y?[C]:[],...y,...S.x!==y[y.length-1].x||S.y!==y[y.length-1].y?[S]:[],n],x,k,m,w]}function NN(e,t,n,r){const o=Math.min(bf(e,t)/2,bf(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 Ws({sourceX:e,sourceY:t,sourcePosition:n=re.Bottom,targetX:r,targetY:o,targetPosition:i=re.Top,borderRadius:s=5,centerX:l,centerY:a,offset:u=20,stepPosition:c=.5}){const[d,h,p,y,x]=SN({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:l,y:a},offset:u,stepPosition:c});let k=`M${d[0].x} ${d[0].y}`;for(let g=1;g<d.length-1;g++)k+=NN(d[g-1],d[g],d[g+1],s);return k+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[k,h,p,y,x]}function Pf(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function EN(e){var d;const{sourceNode:t,targetNode:n}=e;if(!Pf(t)||!Pf(n))return null;const r=t.internals.handleBounds||If(t.handles),o=n.internals.handleBounds||If(n.handles),i=Tf((r==null?void 0:r.source)??[],e.sourceHandle),s=Tf(e.connectionMode===Fr.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!i||!s)return(d=e.onError)==null||d.call(e,"008",Pt.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(i==null?void 0:i.position)||re.Bottom,a=(s==null?void 0:s.position)||re.Top,u=tr(t,i,l),c=tr(n,s,a);return{sourceX:u.x,sourceY:u.y,targetX:c.x,targetY:c.y,sourcePosition:l,targetPosition:a}}function If(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 tr(e,t,n=re.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??Tt(e);if(r)return{x:o+s/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case re.Top:return{x:o+s/2,y:i};case re.Right:return{x:o+s,y:i+l/2};case re.Bottom:return{x:o+s/2,y:i+l};case re.Left:return{x:o,y:i+l/2}}}function Tf(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function gu(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function _N(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=gu(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 Lg=1e3,CN=10,zc={nodeOrigin:[0,0],nodeExtent:Go,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},jN={...zc,checkEquality:!0};function Lc(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function MN(e,t,n){const r=Lc(zc,n);for(const o of e.values())if(o.parentId)Rc(o,e,t,r);else{const i=ci(o,r.nodeOrigin),s=er(o.extent)?o.extent:r.nodeExtent,l=Jn(i,s,Tt(o));o.internals.positionAbsolute=l}}function $N(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 Ac(e){return e==="manual"}function yu(e,t,n,r={}){var c,d;const o=Lc(jN,r),i={i:0},s=new Map(t),l=o!=null&&o.elevateNodesOnSelect&&!Ac(o.zIndexMode)?Lg:0;let a=e.length>0,u=!1;t.clear(),n.clear();for(const h of e){let p=s.get(h.id);if(o.checkEquality&&h===(p==null?void 0:p.internals.userNode))t.set(h.id,p);else{const y=ci(h,o.nodeOrigin),x=er(h.extent)?h.extent:o.nodeExtent,k=Jn(y,x,Tt(h));p={...o.defaults,...h,measured:{width:(c=h.measured)==null?void 0:c.width,height:(d=h.measured)==null?void 0:d.height},internals:{positionAbsolute:k,handleBounds:$N(h,p),z:Ag(h,l,o.zIndexMode),userNode:h}},t.set(h.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(a=!1),h.parentId&&Rc(p,t,n,r,i),u||(u=h.selected??!1)}return{nodesInitialized:a,hasSelectedNodes:u}}function bN(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 Rc(e,t,n,r,o){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:l,zIndexMode:a}=Lc(zc,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}bN(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*CN),o&&c.internals.rootParentIndex!==void 0&&(o.i=c.internals.rootParentIndex);const d=i&&!Ac(a)?Lg:0,{x:h,y:p,z:y}=PN(e,c,s,l,d,a),{positionAbsolute:x}=e.internals,k=h!==x.x||p!==x.y;(k||y!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:k?{x:h,y:p}:x,z:y}})}function Ag(e,t,n){const r=Ct(e.zIndex)?e.zIndex:0;return Ac(n)?r:r+(e.selected?t:0)}function PN(e,t,n,r,o,i){const{x:s,y:l}=t.internals.positionAbsolute,a=Tt(e),u=ci(e,n),c=er(e.extent)?Jn(u,e.extent,a):u;let d=Jn({x:s+c.x,y:l+c.y},r,a);e.extent==="parent"&&(d=Sg(d,a,t));const h=Ag(e,o,i),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=h?p+1:h}}function Dc(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)??Zo(a),c=Ng(u,l.rect);i.set(l.parentId,{expandedRect:c,parent:a})}return i.size>0&&i.forEach(({expandedRect:l,parent:a},u)=>{var m;const c=a.internals.positionAbsolute,d=Tt(a),h=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(d.width,Math.round(l.width)),k=Math.max(d.height,Math.round(l.height)),g=(x-d.width)*h[0],v=(k-d.height)*h[1];(p>0||y>0||g||v)&&(o.push({id:u,type:"position",position:{x:a.position.x-p+g,y:a.position.y-y+v}}),(m=n.get(u))==null||m.forEach(w=>{e.some(C=>C.id===w.id)||o.push({id:w.id,type:"position",position:{x:w.position.x+p,y:w.position.y+y}})})),(d.width<l.width||d.height<l.height||p||y)&&o.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:x+(p?h[0]*p-g:0),height:k+(y?h[1]*y-v:0)}})}),o}function IN(e,t,n,r,o,i,s){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let a=!1;if(!l)return{changes:[],updatedInternals:a};const u=[],c=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(c.transform),h=[];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=Ic(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(),m=er(y.extent)?y.extent:i;let{positionAbsolute:w}=y.internals;if(y.parentId&&y.extent==="parent"){const S=t.get(y.parentId);S&&(w=Sg(w,x,S))}else m&&(w=Jn(w,m,x));const C={...y,measured:x,internals:{...y.internals,positionAbsolute:w,handleBounds:{source:jf("source",p.nodeElement,v,d,y.id),target:jf("target",p.nodeElement,v,d,y.id)}}};t.set(y.id,C),y.parentId&&Rc(C,t,n,{nodeOrigin:o,zIndexMode:s}),a=!0,k&&(u.push({id:y.id,type:"dimensions",dimensions:x}),y.expandParent&&y.parentId&&h.push({id:y.id,parentId:y.parentId,rect:Zo(C,o)}))}}if(h.length>0){const p=Dc(h,t,n,o);u.push(...p)}return{changes:u,updatedInternals:a}}async function TN({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 zf(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 Rg(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}`;zf("source",a,c,e,o,s),zf("target",a,u,e,i,l),t.set(r.id,r)}}function Dg(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Dg(n,t):!1}function Lf(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 zN(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!Dg(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 la({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,l,a;const o=[];for(const[u,c]of t){const d=(s=n.get(u))==null?void 0:s.internals.userNode;d&&o.push({...d,position:c.position,dragging:r})}if(!e)return[o[0],o];const i=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((a=t.get(e))==null?void 0:a.position)||i.position,dragging:r}:o[0],o]}function LN({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=fi(i,t);return{x:s.x-i.x,y:s.y-i.y}}function AN({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},s=0,l=new Map,a=!1,u={x:0,y:0},c=null,d=!1,h=null,p=!1,y=!1,x=null;function k({noDragClassName:v,handleSelector:m,domNode:w,isSelectable:C,nodeId:S,nodeClickDistance:_=0}){h=rt(w);function j({x:U,y:B}){const{nodeLookup:N,nodeExtent:T,snapGrid:z,snapToGrid:D,nodeOrigin:b,onNodeDrag:M,onSelectionDrag:L,onError:P,updateNodePositions:H}=t();i={x:U,y:B};let ee=!1;const K=l.size>1,Y=K&&T?mu(di(l)):null,V=K&&D?LN({dragItems:l,snapGrid:z,x:U,y:B}):null;for(const[X,E]of l){if(!N.has(X))continue;let R={x:U-E.distance.x,y:B-E.distance.y};D&&(R=V?{x:Math.round(R.x+V.x),y:Math.round(R.y+V.y)}:fi(R,z));let q=null;if(K&&T&&!E.extent&&Y){const{positionAbsolute:A}=E.internals,W=A.x-Y.x+T[0][0],Z=A.x+E.measured.width-Y.x2+T[1][0],te=A.y-Y.y+T[0][1],oe=A.y+E.measured.height-Y.y2+T[1][1];q=[[W,te],[Z,oe]]}const{position:Q,positionAbsolute:G}=kg({nodeId:X,nextPosition:R,nodeLookup:N,nodeExtent:q||T,nodeOrigin:b,onError:P});ee=ee||E.position.x!==Q.x||E.position.y!==Q.y,E.position=Q,E.internals.positionAbsolute=G}if(y=y||ee,!!ee&&(H(l,!0),x&&(r||M||!S&&L))){const[X,E]=la({nodeId:S,dragItems:l,nodeLookup:N});r==null||r(x,l,X,E),M==null||M(x,X,E),S||L==null||L(x,E)}}async function I(){if(!c)return;const{transform:U,panBy:B,autoPanSpeed:N,autoPanOnNodeDrag:T}=t();if(!T){a=!1,cancelAnimationFrame(s);return}const[z,D]=bc(u,c,N);(z!==0||D!==0)&&(i.x=(i.x??0)-z/U[2],i.y=(i.y??0)-D/U[2],await B({x:z,y:D})&&j(i)),s=requestAnimationFrame(I)}function O(U){var K;const{nodeLookup:B,multiSelectionActive:N,nodesDraggable:T,transform:z,snapGrid:D,snapToGrid:b,selectNodesOnDrag:M,onNodeDragStart:L,onSelectionDragStart:P,unselectNodesAndEdges:H}=t();d=!0,(!M||!C)&&!N&&S&&((K=B.get(S))!=null&&K.selected||H()),C&&M&&S&&(e==null||e(S));const ee=Co(U.sourceEvent,{transform:z,snapGrid:D,snapToGrid:b,containerBounds:c});if(i=ee,l=zN(B,T,ee,S),l.size>0&&(n||L||!S&&P)){const[Y,V]=la({nodeId:S,dragItems:l,nodeLookup:B});n==null||n(U.sourceEvent,l,Y,V),L==null||L(U.sourceEvent,Y,V),S||P==null||P(U.sourceEvent,V)}}const F=tg().clickDistance(_).on("start",U=>{const{domNode:B,nodeDragThreshold:N,transform:T,snapGrid:z,snapToGrid:D}=t();c=(B==null?void 0:B.getBoundingClientRect())||null,p=!1,y=!1,x=U.sourceEvent,N===0&&O(U),i=Co(U.sourceEvent,{transform:T,snapGrid:z,snapToGrid:D,containerBounds:c}),u=jt(U.sourceEvent,c)}).on("drag",U=>{const{autoPanOnNodeDrag:B,transform:N,snapGrid:T,snapToGrid:z,nodeDragThreshold:D,nodeLookup:b}=t(),M=Co(U.sourceEvent,{transform:N,snapGrid:T,snapToGrid:z,containerBounds:c});if(x=U.sourceEvent,(U.sourceEvent.type==="touchmove"&&U.sourceEvent.touches.length>1||S&&!b.has(S))&&(p=!0),!p){if(!a&&B&&d&&(a=!0,I()),!d){const L=jt(U.sourceEvent,c),P=L.x-u.x,H=L.y-u.y;Math.sqrt(P*P+H*H)>D&&O(U)}(i.x!==M.xSnapped||i.y!==M.ySnapped)&&l&&d&&(u=jt(U.sourceEvent,c),j(M))}}).on("end",U=>{if(!d||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(a=!1,d=!1,cancelAnimationFrame(s),l.size>0){const{nodeLookup:B,updateNodePositions:N,onNodeDragStop:T,onSelectionDragStop:z}=t();if(y&&(N(l,!1),y=!1),o||T||!S&&z){const[D,b]=la({nodeId:S,dragItems:l,nodeLookup:B,dragging:!1});o==null||o(U.sourceEvent,l,D,b),T==null||T(U.sourceEvent,D,b),S||z==null||z(U.sourceEvent,b)}}}).filter(U=>{const B=U.target;return!U.button&&(!v||!Lf(B,`.${v}`,w))&&(!m||Lf(B,m,w))});h.call(F)}function g(){h==null||h.on(".drag",null)}return{update:k,destroy:g}}function RN(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())Vs(o,Zo(i))>0&&r.push(i);return r}const DN=250;function ON(e,t,n,r){var l,a;let o=[],i=1/0;const s=RN(e,n,t+DN);for(const u of s){const c=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((a=u.internals.handleBounds)==null?void 0:a.target)??[]];for(const d of c){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:h,y:p}=tr(u,d,d.position,!0),y=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(p-e.y,2));y>t||(y<i?(o=[{...d,x:h,y:p}],i=y):y===i&&o.push({...d,x:h,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 Og(e,t,n,r,o,i=!1){var u,c,d;const s=r.get(e);if(!s)return null;const l=o==="strict"?(u=s.internals.handleBounds)==null?void 0:u[t]:[...((c=s.internals.handleBounds)==null?void 0:c.source)??[],...((d=s.internals.handleBounds)==null?void 0:d.target)??[]],a=(n?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return a&&i?{...a,...tr(s,a,a.position,!0)}:a}function Fg(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function FN(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Hg=()=>!0;function HN(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:s,domNode:l,nodeLookup:a,lib:u,autoPanOnConnect:c,flowId:d,panBy:h,cancelConnection:p,onConnectStart:y,onConnect:x,onConnectEnd:k,isValidConnection:g=Hg,onReconnectEnd:v,updateConnection:m,getTransform:w,getFromHandle:C,autoPanSpeed:S,dragThreshold:_=1,handleDomNode:j}){const I=$g(e.target);let O=0,F;const{x:U,y:B}=jt(e),N=Fg(i,j),T=l==null?void 0:l.getBoundingClientRect();let z=!1;if(!T||!N)return;const D=Og(o,N,r,a,t);if(!D)return;let b=jt(e,T),M=!1,L=null,P=!1,H=null;function ee(){if(!c||!T)return;const[Q,G]=bc(b,T,S);h({x:Q,y:G}),O=requestAnimationFrame(ee)}const K={...D,nodeId:o,type:N,position:D.position},Y=a.get(o);let X={inProgress:!0,isValid:null,from:tr(Y,K,re.Left,!0),fromHandle:K,fromPosition:K.position,fromNode:Y,to:b,toHandle:null,toPosition:Nf[K.position],toNode:null,pointer:b};function E(){z=!0,m(X),y==null||y(e,{nodeId:o,handleId:r,handleType:N})}_===0&&E();function R(Q){if(!z){const{x:oe,y:de}=jt(Q),me=oe-U,ke=de-B;if(!(me*me+ke*ke>_*_))return;E()}if(!C()||!K){q(Q);return}const G=w();b=jt(Q,T),F=ON(hi(b,G,!1,[1,1]),n,a,K),M||(ee(),M=!0);const A=Bg(Q,{handle:F,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:g,doc:I,lib:u,flowId:d,nodeLookup:a});H=A.handleDomNode,L=A.connection,P=FN(!!F,A.isValid);const W=a.get(o),Z=W?tr(W,K,re.Left,!0):X.from,te={...X,from:Z,isValid:P,to:A.toHandle&&P?Br({x:A.toHandle.x,y:A.toHandle.y},G):b,toHandle:A.toHandle,toPosition:P&&A.toHandle?A.toHandle.position:Nf[K.position],toNode:A.toHandle?a.get(A.toHandle.nodeId):null,pointer:b};m(te),X=te}function q(Q){if(!("touches"in Q&&Q.touches.length>0)){if(z){(F||H)&&L&&P&&(x==null||x(L));const{inProgress:G,...A}=X,W={...A,toPosition:X.toHandle?X.toPosition:null};k==null||k(Q,W),i&&(v==null||v(Q,W))}p(),cancelAnimationFrame(O),M=!1,P=!1,L=null,H=null,I.removeEventListener("mousemove",R),I.removeEventListener("mouseup",q),I.removeEventListener("touchmove",R),I.removeEventListener("touchend",q)}}I.addEventListener("mousemove",R),I.addEventListener("mouseup",q),I.addEventListener("touchmove",R),I.addEventListener("touchend",q)}function Bg(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:l,flowId:a,isValidConnection:u=Hg,nodeLookup:c}){const d=i==="target",h=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}=jt(e),x=s.elementFromPoint(p,y),k=x!=null&&x.classList.contains(`${l}-flow__handle`)?x:h,g={handleDomNode:k,isValid:!1,connection:null,toHandle:null};if(k){const v=Fg(void 0,k),m=k.getAttribute("data-nodeid"),w=k.getAttribute("data-handleid"),C=k.classList.contains("connectable"),S=k.classList.contains("connectableend");if(!m||!v)return g;const _={source:d?m:r,sourceHandle:d?w:o,target:d?r:m,targetHandle:d?o:w};g.connection=_;const I=C&&S&&(n===Fr.Strict?d&&v==="source"||!d&&v==="target":m!==r||w!==o);g.isValid=I&&u(_),g.toHandle=Og(m,v,w,c,n,!0)}return g}const vu={onPointerDown:HN,isValid:Bg};function BN({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=rt(e);function i({translateExtent:l,width:a,height:u,zoomStep:c=1,pannable:d=!0,zoomable:h=!0,inversePan:p=!1}){const y=m=>{if(m.sourceEvent.type!=="wheel"||!t)return;const w=n(),C=m.sourceEvent.ctrlKey&&Jo()?10:1,S=-m.sourceEvent.deltaY*(m.sourceEvent.deltaMode===1?.05:m.sourceEvent.deltaMode?1:.002)*c,_=w[2]*Math.pow(2,S*C);t.scaleTo(_)};let x=[0,0];const k=m=>{(m.sourceEvent.type==="mousedown"||m.sourceEvent.type==="touchstart")&&(x=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY])},g=m=>{const w=n();if(m.sourceEvent.type!=="mousemove"&&m.sourceEvent.type!=="touchmove"||!t)return;const C=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY],S=[C[0]-x[0],C[1]-x[1]];x=C;const _=r()*Math.max(w[2],Math.log(w[2]))*(p?-1:1),j={x:w[0]-S[0]*_,y:w[1]-S[1]*_},I=[[0,0],[a,u]];t.setViewportConstrained({x:j.x,y:j.y,zoom:w[2]},I,l)},v=gg().on("start",k).on("zoom",d?g:null).on("zoom.wheel",h?y:null);o.call(v,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:kt}}const vl=e=>({x:e.x,y:e.y,zoom:e.k}),aa=({x:e,y:t,zoom:n})=>ml.translate(e,t).scale(n),cn=(e,t)=>e.target.closest(`.${t}`),Vg=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),VN=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,ua=(e,t=0,n=VN,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},Wg=e=>{const t=e.ctrlKey&&Jo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function WN({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:u}){return c=>{if(cn(c,t))return c.ctrlKey&&c.preventDefault(),!1;c.preventDefault(),c.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(c.ctrlKey&&s){const k=kt(c),g=Wg(c),v=d*Math.pow(2,g);r.scaleTo(n,v,k,c);return}const h=c.deltaMode===1?20:1;let p=o===Bn.Vertical?0:c.deltaX*h,y=o===Bn.Horizontal?0:c.deltaY*h;!Jo()&&c.shiftKey&&o!==Bn.Vertical&&(p=c.deltaY*h,y=0),r.translateBy(n,-(p/d)*i,-(y/d)*i,{internal:!0});const x=vl(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 UN({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,l=cn(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),s||l)return null;r.preventDefault(),n.call(this,r,o)}}function YN({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,l;if((i=r.sourceEvent)!=null&&i.internal)return;const o=vl(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 XN({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var s,l;e.usedRightMouseButton=!!(n&&Vg(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,vl(i.transform)))}}function KN({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&&Vg(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const a=vl(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,a)},n?150:0)}}}function GN({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:o,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:l,noWheelClassName:a,noPanClassName:u,lib:c,connectionInProgress:d}){return h=>{var g;const p=t||n,y=r&&h.ctrlKey,x=h.type==="wheel";if(h.button===1&&h.type==="mousedown"&&(cn(h,`${c}-flow__node`)||cn(h,`${c}-flow__edge`)||cn(h,`${c}-flow__selection`)||cn(h,`${c}-flow__nodesselection`)))return!0;if(!o&&!p&&!i&&!s&&!r||l||d&&!x||cn(h,a)&&x||cn(h,u)&&(!x||i&&x&&!t)||!r&&h.ctrlKey&&x)return!1;if(!r&&h.type==="touchstart"&&((g=h.touches)==null?void 0:g.length)>1)return h.preventDefault(),!1;if(!p&&!i&&!y&&x||!o&&(h.type==="mousedown"||h.type==="touchstart")||Array.isArray(o)&&!o.includes(h.button)&&h.type==="mousedown")return!1;const k=Array.isArray(o)&&o.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||x||e)&&k}}function QN({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:l,onDraggingChange:a}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},c=e.getBoundingClientRect();let d=[[0,0],[c.width,c.height]];const h=typeof ResizeObserver<"u"?new ResizeObserver(B=>{const N=B[0];N&&(d=[[0,0],[N.contentRect.width,N.contentRect.height]])}):null;h==null||h.observe(e);const p=gg().extent(()=>d).scaleExtent([t,n]).translateExtent(r),y=rt(e).call(p);w({x:o.x,y:o.y,zoom:Hr(o.zoom,t,n)},[[0,0],[c.width,c.height]],r);const x=y.on("wheel.zoom"),k=y.on("dblclick.zoom");p.wheelDelta(Wg);async function g(B,N){return y?new Promise(T=>{p==null||p.interpolate((N==null?void 0:N.interpolate)==="linear"?_o:ss).transform(ua(y,N==null?void 0:N.duration,N==null?void 0:N.ease,()=>T(!0)),B)}):!1}function v({noWheelClassName:B,noPanClassName:N,onPaneContextMenu:T,userSelectionActive:z,panOnScroll:D,panOnDrag:b,panOnScrollMode:M,panOnScrollSpeed:L,preventScrolling:P,zoomOnPinch:H,zoomOnScroll:ee,zoomOnDoubleClick:K,panActivationKeyPressed:Y=!1,zoomActivationKeyPressed:V,lib:X,onTransformChange:E,connectionInProgress:R,paneClickDistance:q,selectionOnDrag:Q}){z&&!u.isZoomingOrPanning&&m();const G=D&&!V&&!z;p.clickDistance(Q?1/0:!Ct(q)||q<0?0:q);const A=G?WN({zoomPanValues:u,noWheelClassName:B,d3Selection:y,d3Zoom:p,panOnScrollMode:M,panOnScrollSpeed:L,zoomOnPinch:H,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:l}):UN({noWheelClassName:B,preventScrolling:P,d3ZoomHandler:x});y.on("wheel.zoom",A,{passive:!1});const W=YN({zoomPanValues:u,onDraggingChange:a,onPanZoomStart:s});p.on("start",W);const Z=XN({zoomPanValues:u,panOnDrag:b,onPaneContextMenu:!!T,onPanZoom:i,onTransformChange:E});p.on("zoom",Z);const te=KN({zoomPanValues:u,panOnDrag:b,panOnScroll:D,onPaneContextMenu:T,onPanZoomEnd:l,onDraggingChange:a});p.on("end",te);const oe=GN({panActivationKeyPressed:Y,zoomActivationKeyPressed:V,panOnDrag:b,zoomOnScroll:ee,panOnScroll:D,zoomOnDoubleClick:K,zoomOnPinch:H,userSelectionActive:z,noPanClassName:N,noWheelClassName:B,lib:X,connectionInProgress:R});p.filter(oe),K?y.on("dblclick.zoom",k):y.on("dblclick.zoom",null)}function m(){p.on("zoom",null)}async function w(B,N,T){const z=aa(B),D=p==null?void 0:p.constrain()(z,N,T);return D&&await g(D),D}async function C(B,N){const T=aa(B);return await g(T,N),T}function S(B){if(y){const N=aa(B),T=y.property("__zoom");(T.k!==B.zoom||T.x!==B.x||T.y!==B.y)&&(p==null||p.transform(y,N,null,{sync:!0}))}}function _(){const B=y?mg(y.node()):{x:0,y:0,k:1};return{x:B.x,y:B.y,zoom:B.k}}async function j(B,N){return y?new Promise(T=>{p==null||p.interpolate((N==null?void 0:N.interpolate)==="linear"?_o:ss).scaleTo(ua(y,N==null?void 0:N.duration,N==null?void 0:N.ease,()=>T(!0)),B)}):!1}async function I(B,N){return y?new Promise(T=>{p==null||p.interpolate((N==null?void 0:N.interpolate)==="linear"?_o:ss).scaleBy(ua(y,N==null?void 0:N.duration,N==null?void 0:N.ease,()=>T(!0)),B)}):!1}function O(B){p==null||p.scaleExtent(B)}function F(B){p==null||p.translateExtent(B)}function U(B){const N=!Ct(B)||B<0?0:B;p==null||p.clickDistance(N)}return{update:v,destroy:m,setViewport:C,setViewportConstrained:w,getViewport:_,scaleTo:j,scaleBy:I,setScaleExtent:O,setTranslateExtent:F,syncViewport:S,setClickDistance:U}}var Vr;(function(e){e.Line="line",e.Handle="handle"})(Vr||(Vr={}));function qN({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 Af(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 sn(e,t){return Math.max(0,t-e)}function ln(e,t){return Math.max(0,e-t)}function Bi(e,t,n){return Math.max(0,t-e,e-n)}function Rf(e,t){return e?!t:t}function ZN(e,t,n,r,o,i,s,l){let{affectsX:a,affectsY:u}=t;const{isHorizontal:c,isVertical:d}=t,h=c&&d,{xSnapped:p,ySnapped:y}=n,{minWidth:x,maxWidth:k,minHeight:g,maxHeight:v}=r,{x:m,y:w,width:C,height:S,aspectRatio:_}=e;let j=Math.floor(c?p-e.pointerX:0),I=Math.floor(d?y-e.pointerY:0);const O=C+(a?-j:j),F=S+(u?-I:I),U=-i[0]*C,B=-i[1]*S;let N=Bi(O,x,k),T=Bi(F,g,v);if(s){let b=0,M=0;a&&j<0?b=sn(m+j+U,s[0][0]):!a&&j>0&&(b=ln(m+O+U,s[1][0])),u&&I<0?M=sn(w+I+B,s[0][1]):!u&&I>0&&(M=ln(w+F+B,s[1][1])),N=Math.max(N,b),T=Math.max(T,M)}if(l){let b=0,M=0;a&&j>0?b=ln(m+j,l[0][0]):!a&&j<0&&(b=sn(m+O,l[1][0])),u&&I>0?M=ln(w+I,l[0][1]):!u&&I<0&&(M=sn(w+F,l[1][1])),N=Math.max(N,b),T=Math.max(T,M)}if(o){if(c){const b=Bi(O/_,g,v)*_;if(N=Math.max(N,b),s){let M=0;!a&&!u||a&&!u&&h?M=ln(w+B+O/_,s[1][1])*_:M=sn(w+B+(a?j:-j)/_,s[0][1])*_,N=Math.max(N,M)}if(l){let M=0;!a&&!u||a&&!u&&h?M=sn(w+O/_,l[1][1])*_:M=ln(w+(a?j:-j)/_,l[0][1])*_,N=Math.max(N,M)}}if(d){const b=Bi(F*_,x,k)/_;if(T=Math.max(T,b),s){let M=0;!a&&!u||u&&!a&&h?M=ln(m+F*_+U,s[1][0])/_:M=sn(m+(u?I:-I)*_+U,s[0][0])/_,T=Math.max(T,M)}if(l){let M=0;!a&&!u||u&&!a&&h?M=sn(m+F*_,l[1][0])/_:M=ln(m+(u?I:-I)*_,l[0][0])/_,T=Math.max(T,M)}}}I=I+(I<0?T:-T),j=j+(j<0?N:-N),o&&(h?O>F*_?I=(Rf(a,u)?-j:j)/_:j=(Rf(a,u)?-I:I)*_:c?(I=j/_,u=a):(j=I*_,a=u));const z=a?m+j:m,D=u?w+I:w;return{width:C+(a?-j:j),height:S+(u?-I:I),x:i[0]*j*(a?-1:1)+z,y:i[1]*I*(u?-1:1)+D}}const Ug={width:0,height:0,x:0,y:0},JN={...Ug,pointerX:0,pointerY:0,aspectRatio:1};function eE(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 tE({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const i=rt(e);let s={controlDirection:Af("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:c,keepAspectRatio:d,resizeDirection:h,onResizeStart:p,onResize:y,onResizeEnd:x,shouldResize:k}){let g={...Ug},v={...JN};s={boundaries:c,resizeDirection:h,keepAspectRatio:d,controlDirection:Af(u)};let m,w=null,C=[],S,_,j;const I=tg().on("start",O=>{const{nodeLookup:F,transform:U,snapGrid:B,snapToGrid:N,nodeOrigin:T,paneDomNode:z}=n();if(m=F.get(t),!m)return;w=(z==null?void 0:z.getBoundingClientRect())??null;const{xSnapped:D,ySnapped:b}=Co(O.sourceEvent,{transform:U,snapGrid:B,snapToGrid:N,containerBounds:w});g={width:m.measured.width??0,height:m.measured.height??0,x:m.position.x??0,y:m.position.y??0},v={...g,pointerX:D,pointerY:b,aspectRatio:g.width/g.height},S=void 0,_=er(m.extent)?m.extent:void 0,m.parentId&&(m.extent==="parent"||m.expandParent)&&(S=F.get(m.parentId)),S&&m.extent==="parent"&&(_=[[0,0],[S.measured.width,S.measured.height]]),C=[],j=void 0;for(const[M,L]of F)if(L.parentId===t&&(C.push({id:M,position:{...L.position},extent:L.extent}),L.extent==="parent"||L.expandParent)){const P=eE(L,m,L.origin??T);j?j=[[Math.min(P[0][0],j[0][0]),Math.min(P[0][1],j[0][1])],[Math.max(P[1][0],j[1][0]),Math.max(P[1][1],j[1][1])]]:j=P}p==null||p(O,{...g})}).on("drag",O=>{const{transform:F,snapGrid:U,snapToGrid:B,nodeOrigin:N}=n(),T=Co(O.sourceEvent,{transform:F,snapGrid:U,snapToGrid:B,containerBounds:w}),z=[];if(!m)return;const{x:D,y:b,width:M,height:L}=g,P={},H=m.origin??N,{width:ee,height:K,x:Y,y:V}=ZN(v,s.controlDirection,T,s.boundaries,s.keepAspectRatio,H,_,j),X=ee!==M,E=K!==L,R=Y!==D&&X,q=V!==b&&E;if(!R&&!q&&!X&&!E)return;const Q={prevValues:{...g},startX:v.x,startY:v.y,childNodes:C.map(Z=>({...Z,position:{...Z.position}}))};if((R||q||H[0]===1||H[1]===1)&&(P.x=R?Y:g.x,P.y=q?V:g.y,g.x=P.x,g.y=P.y,C.length>0)){const Z=Y-D,te=V-b;for(const oe of C)oe.position={x:oe.position.x-Z+H[0]*(ee-M),y:oe.position.y-te+H[1]*(K-L)},z.push(oe)}if((X||E)&&(P.width=X&&(!s.resizeDirection||s.resizeDirection==="horizontal")?ee:g.width,P.height=E&&(!s.resizeDirection||s.resizeDirection==="vertical")?K:g.height,g.width=P.width,g.height=P.height),S&&m.expandParent){const Z=H[0]*(P.width??0);P.x&&P.x<Z&&(g.x=Z,v.x=v.x-(P.x-Z));const te=H[1]*(P.height??0);P.y&&P.y<te&&(g.y=te,v.y=v.y-(P.y-te))}const G=qN({width:g.width,prevWidth:M,height:g.height,prevHeight:L,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),A={...g,direction:G};if((k==null?void 0:k(O,A))===!1){g=Q.prevValues,v.x=Q.startX,v.y=Q.startY,C.forEach((Z,te)=>{Z.position=Q.childNodes[te].position});return}y==null||y(O,A),r(P,z)}).on("end",O=>{x==null||x(O,{...g}),o==null||o({...g})});i.call(I)}function a(){i.on(".drag",null)}return{update:l,destroy:a}}var Yg={exports:{}},Xg={},Kg={exports:{}},Gg={};/**
|
|
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 Wr=$;function nE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rE=typeof Object.is=="function"?Object.is:nE,oE=Wr.useState,iE=Wr.useEffect,sE=Wr.useLayoutEffect,lE=Wr.useDebugValue;function aE(e,t){var n=t(),r=oE({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return sE(function(){o.value=n,o.getSnapshot=t,ca(o)&&i({inst:o})},[e,n,t]),iE(function(){return ca(o)&&i({inst:o}),e(function(){ca(o)&&i({inst:o})})},[e]),lE(n),n}function ca(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!rE(e,n)}catch{return!0}}function uE(e,t){return t()}var cE=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?uE:aE;Gg.useSyncExternalStore=Wr.useSyncExternalStore!==void 0?Wr.useSyncExternalStore:cE;Kg.exports=Gg;var dE=Kg.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 xl=$,fE=dE;function hE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pE=typeof Object.is=="function"?Object.is:hE,mE=fE.useSyncExternalStore,gE=xl.useRef,yE=xl.useEffect,vE=xl.useMemo,xE=xl.useDebugValue;Xg.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=gE(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=vE(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 d=y}return d=p}if(y=d,pE(c,p))return y;var x=r(p);return o!==void 0&&o(y,x)?(c=p,y):(c=p,d=x)}var u=!1,c,d,h=n===void 0?null:n;return[function(){return a(t())},h===null?void 0:function(){return a(h())}]},[t,n,r,o]);var l=mE(e,i[0],i[1]);return yE(function(){s.hasValue=!0,s.value=l},[l]),xE(l),l};Yg.exports=Xg;var wE=Yg.exports;const kE=Ch(wE),SE={},Df=e=>{let t;const n=new Set,r=(c,d)=>{const h=typeof c=="function"?c(t):c;if(!Object.is(h,t)){const p=t;t=d??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(y=>y(t,p))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(SE?"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},NE=e=>e?Df(e):Df,{useDebugValue:EE}=mv,{useSyncExternalStoreWithSelector:_E}=kE,CE=e=>e;function Qg(e,t=CE,n){const r=_E(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return EE(r),r}const Of=(e,t)=>{const n=NE(e),r=(o,i=t)=>Qg(n,o,i);return Object.assign(r,n),r},jE=(e,t)=>e?Of(e,t):Of;function we(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 wl=$.createContext(null),ME=wl.Provider,qg=Pt.error001("react");function le(e,t){const n=$.useContext(wl);if(n===null)throw new Error(qg);return Qg(n,e,t)}function pe(){const e=$.useContext(wl);if(e===null)throw new Error(qg);return $.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Ff={display:"none"},$E={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Zg="react-flow__node-desc",Jg="react-flow__edge-desc",bE="react-flow__aria-live",PE=e=>e.ariaLiveMessage,IE=e=>e.ariaLabelConfig;function TE({rfId:e}){const t=le(PE);return f.jsx("div",{id:`${bE}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:$E,children:t})}function zE({rfId:e,disableKeyboardA11y:t}){const n=le(IE);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${Zg}-${e}`,style:Ff,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${Jg}-${e}`,style:Ff,children:n["edge.a11yDescription.default"]}),!t&&f.jsx(TE,{rfId:e})]})}const pi=$.forwardRef(({position:e="top-left",children:t,className:n,style:r,...o},i)=>{const s=`${e}`.split("-");return f.jsx("div",{className:_e(["react-flow__panel",n,...s]),style:r,ref:i,...o,children:t})});pi.displayName="Panel";const Hf="https://reactflow.dev?utm_source=attribution";function LE({proOptions:e,position:t="bottom-right"}){return $.useEffect(()=>{},[]),e!=null&&e.hideAttribution?null:f.jsx(pi,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Hf}`,children:f.jsx("a",{href:Hf,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const AE=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}},Vi=e=>e.id;function RE(e,t){return we(e.selectedNodes.map(Vi),t.selectedNodes.map(Vi))&&we(e.selectedEdges.map(Vi),t.selectedEdges.map(Vi))}function DE({onSelectionChange:e}){const t=pe(),{selectedNodes:n,selectedEdges:r}=le(AE,RE);return $.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(i=>i(o))},[n,r,e]),null}const OE=e=>!!e.onSelectionChangeHandlers;function FE({onSelectionChange:e}){const t=le(OE);return e||t?f.jsx(DE,{onSelectionChange:e}):null}const e0=[0,0],HE={x:0,y:0,zoom:1},BE=["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"],Bf=[...BE,"rfId"],VE=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}),Vf={translateExtent:Go,nodeOrigin:e0,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function WE(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:i,setNodeExtent:s,reset:l,setDefaultNodesAndEdges:a}=le(VE,we),u=pe();$.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{c.current=Vf,l()}),[]);const c=$.useRef(Vf);return $.useEffect(()=>{for(const d of Bf){const h=e[d],p=c.current[d];h!==p&&(typeof e[d]>"u"||(d==="nodes"?t(h):d==="edges"?n(h):d==="minZoom"?r(h):d==="maxZoom"?o(h):d==="translateExtent"?i(h):d==="nodeExtent"?s(h):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:pN(h)}):d==="fitView"?u.setState({fitViewQueued:h}):d==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[d]:h})))}c.current=e},Bf.map(d=>e[d])),null}function Wf(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function UE(e){var r;const[t,n]=$.useState(e==="system"?null:e);return $.useEffect(()=>{if(e!=="system"){n(e);return}const o=Wf(),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=Wf())!=null&&r.matches?"dark":"light"}const Uf=typeof document<"u"?document:null;function ei(e=null,t={target:Uf,actInsideInputWithModifier:!0}){const[n,r]=$.useState(!1),o=$.useRef(!1),i=$.useRef(new Set([])),[s,l]=$.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace(/\+/g,`
|
|
57
|
-
`).replace(`
|
|
58
|
-
|
|
59
|
-
`,`
|
|
60
|
-
+`).split(`
|
|
61
|
-
`)),c=u.reduce((d,h)=>d.concat(...h),[]);return[u,c]}return[[],[]]},[e]);return $.useEffect(()=>{const a=(t==null?void 0:t.target)??Uf,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const c=p=>{var k,g;if(o.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!o.current||o.current&&!u)&&bg(p))return!1;const x=Xf(p.code,l);if(i.current.add(p[x]),Yf(s,i.current,!1)){const v=((g=(k=p.composedPath)==null?void 0:k.call(p))==null?void 0:g[0])||p.target,m=(v==null?void 0:v.nodeName)==="BUTTON"||(v==null?void 0:v.nodeName)==="A";t.preventDefault!==!1&&(o.current||!m)&&p.preventDefault(),r(!0)}},d=p=>{const y=Xf(p.code,l);Yf(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(p[y]),p.key==="Meta"&&i.current.clear(),o.current=!1},h=()=>{i.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",c),a==null||a.addEventListener("keyup",d),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{a==null||a.removeEventListener("keydown",c),a==null||a.removeEventListener("keyup",d),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,r]),n}function Yf(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function Xf(e,t){return t.includes(e)?"code":"key"}const YE=()=>{const e=pe();return $.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=Pc(t,r,o,i,s,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(a,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:o,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:l,y:a}=s.getBoundingClientRect(),u={x:t.x-l,y:t.y-a},c=n.snapGrid??o,d=n.snapToGrid??i;return hi(u,r,d,c)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:i}=r.getBoundingClientRect(),s=Br(t,n);return{x:s.x+o,y:s.y+i}}}),[])};function t0(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)XE(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 XE(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 KE(e,t){return t0(e,t)}function GE(e,t){return t0(e,t)}function In(e,t){return{id:e,type:"select",selected:t}}function Sr(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 Kf({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 Gf(e){return{id:e.id,type:"remove"}}const QE=_g();function qE(e,t,n={}){return wN(e,t,{...n,onError:n.onError??QE})}const Qf=e=>iN(e),ZE=e=>wg(e);function n0(e){return $.forwardRef(e)}const r0=typeof window<"u"?$.useLayoutEffect:$.useEffect;function qf(e){const[t,n]=$.useState(BigInt(0)),[r]=$.useState(()=>JE(()=>n(o=>o+BigInt(1))));return r0(()=>{const o=r.get();o.length&&(e(o),r.reset())},[t]),r}function JE(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const o0=$.createContext(null);function e_({children:e}){const t=pe(),n=$.useCallback(l=>{const{nodes:a=[],setNodes:u,hasDefaultNodes:c,onNodesChange:d,nodeLookup:h,fitViewQueued:p,onNodesChangeMiddlewareMap:y}=t.getState();let x=a;for(const g of l)x=typeof g=="function"?g(x):g;let k=Kf({items:x,lookup:h});for(const g of y.values())k=g(k);c&&u(x),k.length>0?d==null||d(k):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:g,nodes:v,setNodes:m}=t.getState();g&&m(v)})},[]),r=qf(n),o=$.useCallback(l=>{const{edges:a=[],setEdges:u,hasDefaultEdges:c,onEdgesChange:d,edgeLookup:h}=t.getState();let p=a;for(const y of l)p=typeof y=="function"?y(p):y;c?u(p):d&&d(Kf({items:p,lookup:h}))},[]),i=qf(o),s=$.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return f.jsx(o0.Provider,{value:s,children:e})}function t_(){const e=$.useContext(o0);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const n_=e=>!!e.panZoom;function mi(){const e=YE(),t=pe(),n=t_(),r=le(n_),o=$.useMemo(()=>{const i=d=>t.getState().nodeLookup.get(d),s=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},a=d=>{var g,v;const{nodeLookup:h,nodeOrigin:p}=t.getState(),y=Qf(d)?d:h.get(d.id),x=y.parentId?jg(y.position,y.measured,y.parentId,h,p):y.position,k={...y,position:x,width:((g=y.measured)==null?void 0:g.width)??y.width,height:((v=y.measured)==null?void 0:v.height)??y.height};return Zo(k)},u=(d,h,p={replace:!1})=>{s(y=>y.map(x=>{if(x.id===d){const k=typeof h=="function"?h(x):h;return p.replace&&Qf(k)?k:{...x,...k}}return x}))},c=(d,h,p={replace:!1})=>{l(y=>y.map(x=>{if(x.id===d){const k=typeof h=="function"?h(x):h;return p.replace&&ZE(k)?k:{...x,...k}}return x}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var h;return(h=i(d))==null?void 0:h.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(h=>({...h}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:s,setEdges:l,addNodes:d=>{const h=Array.isArray(d)?d:[d];n.nodeQueue.push(p=>[...p,...h])},addEdges:d=>{const h=Array.isArray(d)?d:[d];n.edgeQueue.push(p=>[...p,...h])},toObject:()=>{const{nodes:d=[],edges:h=[],transform:p}=t.getState(),[y,x,k]=p;return{nodes:d.map(g=>({...g})),edges:h.map(g=>({...g})),viewport:{x:y,y:x,zoom:k}}},deleteElements:async({nodes:d=[],edges:h=[]})=>{const{nodes:p,edges:y,onNodesDelete:x,onEdgesDelete:k,triggerNodeChanges:g,triggerEdgeChanges:v,onDelete:m,onBeforeDelete:w}=t.getState(),{nodes:C,edges:S}=await cN({nodesToRemove:d,edgesToRemove:h,nodes:p,edges:y,onBeforeDelete:w}),_=S.length>0,j=C.length>0;if(_){const I=S.map(Gf);k==null||k(S),v(I)}if(j){const I=C.map(Gf);x==null||x(C),g(I)}return(j||_)&&(m==null||m({nodes:C,edges:S})),{deletedNodes:C,deletedEdges:S}},getIntersectingNodes:(d,h=!0,p)=>{const y=_f(d),x=y?d:a(d),k=p!==void 0;return x?(p||t.getState().nodes).filter(g=>{const v=t.getState().nodeLookup.get(g.id);if(v&&!y&&(g.id===d.id||!v.internals.positionAbsolute))return!1;const m=Zo(k?g:v),w=Vs(m,x);return h&&w>0||w>=m.width*m.height||w>=x.width*x.height}):[]},isNodeIntersecting:(d,h,p=!0)=>{const x=_f(d)?d:a(d);if(!x)return!1;const k=Vs(x,h);return p&&k>0||k>=h.width*h.height||k>=x.width*x.height},updateNode:u,updateNodeData:(d,h,p={replace:!1})=>{u(d,y=>{const x=typeof h=="function"?h(y):h;return p.replace?{...y,data:x}:{...y,data:{...y.data,...x}}},p)},updateEdge:c,updateEdgeData:(d,h,p={replace:!1})=>{c(d,y=>{const x=typeof h=="function"?h(y):h;return p.replace?{...y,data:x}:{...y,data:{...y.data,...x}}},p)},getNodesBounds:d=>{const{nodeLookup:h,nodeOrigin:p}=t.getState();return sN(d,{nodeLookup:h,nodeOrigin:p})},getHandleConnections:({type:d,id:h,nodeId:p})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${p}-${d}${h?`-${h}`:""}`))==null?void 0:y.values())??[])},getNodeConnections:({type:d,handleId:h,nodeId:p})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${p}${d?h?`-${d}-${h}`:`-${d}`:""}`))==null?void 0:y.values())??[])},fitView:async d=>{const h=t.getState().fitViewResolver??hN();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:h}),n.nodeQueue.push(p=>[...p]),h.promise}}},[]);return $.useMemo(()=>({...o,...e,viewportInitialized:r}),[r])}const Zf=e=>e.selected,r_=typeof window<"u"?window:void 0;function o_({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=pe(),{deleteElements:r}=mi(),o=ei(e,{actInsideInputWithModifier:!1}),i=ei(t,{target:r_});$.useEffect(()=>{if(o){const{edges:s,nodes:l}=n.getState();r({nodes:l.filter(Zf),edges:s.filter(Zf)}),n.setState({nodesSelectionActive:!1})}},[o]),$.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function i_(e){const t=pe();$.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=Ic(e.current);(r.height===0||r.width===0)&&((l=(s=t.getState()).onError)==null||l.call(s,"004",Pt.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 kl={position:"absolute",width:"100%",height:"100%",top:0,left:0},s_=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function l_({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:o,panOnScrollSpeed:i=.5,panOnScrollMode:s=Bn.Free,zoomOnDoubleClick:l=!0,panOnDrag:a=!0,defaultViewport:u,translateExtent:c,minZoom:d,maxZoom:h,zoomActivationKeyCode:p,preventScrolling:y=!0,children:x,noWheelClassName:k,noPanClassName:g,onViewportChange:v,isControlledViewport:m,paneClickDistance:w,selectionOnDrag:C}){const S=pe(),_=$.useRef(null),{userSelectionActive:j,lib:I,connectionInProgress:O}=le(s_,we),F=ei(p),U=$.useRef();i_(_);const B=$.useCallback(N=>{v==null||v({x:N[0],y:N[1],zoom:N[2]}),m||S.setState({transform:N})},[v,m]);return $.useEffect(()=>{if(_.current){U.current=QN({domNode:_.current,minZoom:d,maxZoom:h,translateExtent:c,viewport:u,onDraggingChange:D=>S.setState(b=>b.paneDragging===D?b:{paneDragging:D}),onPanZoomStart:(D,b)=>{const{onViewportChangeStart:M,onMoveStart:L}=S.getState();L==null||L(D,b),M==null||M(b)},onPanZoom:(D,b)=>{const{onViewportChange:M,onMove:L}=S.getState();L==null||L(D,b),M==null||M(b)},onPanZoomEnd:(D,b)=>{const{onViewportChangeEnd:M,onMoveEnd:L}=S.getState();L==null||L(D,b),M==null||M(b)}});const{x:N,y:T,zoom:z}=U.current.getViewport();return S.setState({panZoom:U.current,transform:[N,T,z],domNode:_.current.closest(".react-flow")}),()=>{var D;(D=U.current)==null||D.destroy()}}},[]),$.useEffect(()=>{var N;(N=U.current)==null||N.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:o,panOnScrollSpeed:i,panOnScrollMode:s,zoomOnDoubleClick:l,panOnDrag:a,zoomActivationKeyPressed:F,preventScrolling:y,noPanClassName:g,userSelectionActive:j,noWheelClassName:k,lib:I,onTransformChange:B,connectionInProgress:O,selectionOnDrag:C,paneClickDistance:w})},[e,t,n,r,o,i,s,l,a,F,y,g,j,k,I,B,O,C,w]),f.jsx("div",{className:"react-flow__renderer",ref:_,style:kl,children:x})}const a_=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function u_(){const{userSelectionActive:e,userSelectionRect:t}=le(a_,we);return e&&t?f.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 da=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},c_=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function d_({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Qo.Full,panOnDrag:r,autoPanOnSelection:o,paneClickDistance:i,selectionOnDrag:s,onSelectionStart:l,onSelectionEnd:a,onPaneClick:u,onPaneContextMenu:c,onPaneScroll:d,onPaneMouseEnter:h,onPaneMouseMove:p,onPaneMouseLeave:y,children:x}){const k=$.useRef(0),g=pe(),{userSelectionActive:v,elementsSelectable:m,dragging:w,panBy:C,autoPanSpeed:S}=le(c_,we),_=m&&(e||v),j=$.useRef(null),I=$.useRef(),O=$.useRef(new Set),F=$.useRef(new Set),U=$.useRef(!1),B=$.useRef(!1),N=$.useRef({x:0,y:0}),T=$.useRef(!1),z=E=>{if(B.current||U.current||g.getState().connection.inProgress){B.current=!1,U.current=!1;return}u==null||u(E),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},D=E=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){E.preventDefault();return}c==null||c(E)},b=d?E=>d(E):void 0,M=E=>{B.current&&(E.stopPropagation(),B.current=!1)},L=E=>{var oe,de;if(E.pointerType==="touch"&&r!==!1&&!t)return;const{domNode:R,transform:q}=g.getState();if(I.current=R==null?void 0:R.getBoundingClientRect(),!I.current)return;const Q=E.target===j.current;if(!Q&&!!E.target.closest(".nokey")||!e||!(s&&Q||t)||E.button!==0||!E.isPrimary)return;(de=(oe=E.target)==null?void 0:oe.setPointerCapture)==null||de.call(oe,E.pointerId),B.current=!1;const{x:W,y:Z}=jt(E.nativeEvent,I.current),te=hi({x:W,y:Z},q);g.setState({userSelectionRect:{width:0,height:0,startX:te.x,startY:te.y,x:W,y:Z}}),Q||(E.stopPropagation(),E.preventDefault())};function P(E,R){const{userSelectionRect:q}=g.getState();if(!q)return;const{transform:Q,nodeLookup:G,edgeLookup:A,connectionLookup:W,triggerNodeChanges:Z,triggerEdgeChanges:te,defaultEdgeOptions:oe}=g.getState(),de={x:q.startX,y:q.startY},{x:me,y:ke}=Br(de,Q),Me={startX:de.x,startY:de.y,x:E<me?E:me,y:R<ke?R:ke,width:Math.abs(E-me),height:Math.abs(R-ke)},ie=O.current,Ae=F.current;O.current=new Set($c(G,Me,Q,n===Qo.Partial,!0).map(Pe=>Pe.id)),F.current=new Set;const tt=(oe==null?void 0:oe.selectable)??!0;for(const Pe of O.current){const He=W.get(Pe);if(He)for(const{edgeId:Be}of He.values()){const ct=A.get(Be);ct&&(ct.selectable??tt)&&F.current.add(Be)}}if(!Cf(ie,O.current)){const Pe=Sr(G,O.current,!0);Z(Pe)}if(!Cf(Ae,F.current)){const Pe=Sr(A,F.current);te(Pe)}g.setState({userSelectionRect:Me,userSelectionActive:!0,nodesSelectionActive:!1})}function H(){if(!o||!I.current)return;const[E,R]=bc(N.current,I.current,S);C({x:E,y:R}).then(q=>{if(!B.current||!q){k.current=requestAnimationFrame(H);return}const{x:Q,y:G}=N.current;P(Q,G),k.current=requestAnimationFrame(H)})}const ee=()=>{cancelAnimationFrame(k.current),k.current=0,T.current=!1};$.useEffect(()=>()=>ee(),[]);const K=E=>{const{userSelectionRect:R,transform:q,resetSelectedElements:Q}=g.getState();if(!I.current||!R)return;const{x:G,y:A}=jt(E.nativeEvent,I.current);N.current={x:G,y:A};const W=Br({x:R.startX,y:R.startY},q);if(!B.current){const Z=t?0:i;if(Math.hypot(G-W.x,A-W.y)<=Z)return;Q(),l==null||l(E)}B.current=!0,T.current||(H(),T.current=!0),P(G,A)},Y=E=>{var R,q;if(!_){E.target===j.current&&g.getState().connection.inProgress&&(U.current=!0);return}E.button===0&&((q=(R=E.target)==null?void 0:R.releasePointerCapture)==null||q.call(R,E.pointerId),!v&&E.target===j.current&&g.getState().userSelectionRect&&(z==null||z(E)),g.setState({userSelectionActive:!1,userSelectionRect:null}),B.current&&(a==null||a(E),g.setState({nodesSelectionActive:O.current.size>0})),ee())},V=E=>{var R,q;(q=(R=E.target)==null?void 0:R.releasePointerCapture)==null||q.call(R,E.pointerId),ee()},X=r===!0||Array.isArray(r)&&r.includes(0);return f.jsxs("div",{className:_e(["react-flow__pane",{draggable:X,dragging:w,selection:e}]),onClick:_?void 0:da(z,j),onContextMenu:da(D,j),onWheel:da(b,j),onPointerEnter:_?void 0:h,onPointerMove:_?K:p,onPointerUp:Y,onPointerCancel:_?V:void 0,onPointerDownCapture:_?L:void 0,onClickCapture:_?M:void 0,onPointerLeave:y,ref:j,style:kl,children:[x,f.jsx(u_,{})]})}function xu({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",Pt.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 i0({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,nodeClickDistance:s}){const l=pe(),[a,u]=$.useState(!1),c=$.useRef();return $.useEffect(()=>{if(!t)return c.current=AN({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{xu({id:d,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}}),()=>{var d;(d=c.current)==null||d.destroy(),c.current=void 0}},[t,l,e]),$.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 f_=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function s0(){const e=pe();return $.useCallback(n=>{const{nodeExtent:r,snapToGrid:o,snapGrid:i,nodesDraggable:s,onError:l,updateNodePositions:a,nodeLookup:u,nodeOrigin:c}=e.getState(),d=new Map,h=f_(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[,g]of u){if(!h(g))continue;let v={x:g.internals.positionAbsolute.x+x,y:g.internals.positionAbsolute.y+k};o&&(v=fi(v,i));const{position:m,positionAbsolute:w}=kg({nodeId:g.id,nextPosition:v,nodeLookup:u,nodeExtent:r,nodeOrigin:c,onError:l});g.position=m,g.internals.positionAbsolute=w,d.set(g.id,g)}a(d)},[])}const Oc=$.createContext(null),h_=Oc.Provider;Oc.Consumer;const l0=()=>$.useContext(Oc),p_=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),a0=$.createContext(null);function m_({children:e}){const t=le(p_,we);return f.jsx(a0.Provider,{value:t,children:e})}function g_(){const e=$.useContext(a0);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const y_={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},v_=(e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:i,connection:s}=r,{fromHandle:l,toHandle:a,isValid:u}=s;if(!l&&!o)return y_;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===Fr.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 x_({type:e="source",position:t=re.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:l,children:a,className:u,onMouseDown:c,onTouchStart:d,...h},p){var T,z;const y=s||null,x=e==="target",k=pe(),g=l0(),{connectOnClick:v,noPanClassName:m,rfId:w}=g_(),{connectingFrom:C,connectingTo:S,clickConnecting:_,isPossibleEndHandle:j,connectionInProcess:I,clickConnectionInProcess:O,valid:F}=le(v_(g,y,e),we);g||(z=(T=k.getState()).onError)==null||z.call(T,"010",Pt.error010());const U=D=>{const{defaultEdgeOptions:b,onConnect:M,hasDefaultEdges:L}=k.getState(),P={...b,...D};if(L){const{edges:H,setEdges:ee,onError:K}=k.getState();ee(qE(P,H,{onError:K}))}M==null||M(P),l==null||l(P)},B=D=>{if(!g)return;const b=Pg(D.nativeEvent);if(o&&(b&&D.button===0||!b)){const M=k.getState();vu.onPointerDown(D.nativeEvent,{handleDomNode:D.currentTarget,autoPanOnConnect:M.autoPanOnConnect,connectionMode:M.connectionMode,connectionRadius:M.connectionRadius,domNode:M.domNode,nodeLookup:M.nodeLookup,lib:M.lib,isTarget:x,handleId:y,nodeId:g,flowId:M.rfId,panBy:M.panBy,cancelConnection:M.cancelConnection,onConnectStart:M.onConnectStart,onConnectEnd:(...L)=>{var P,H;return(H=(P=k.getState()).onConnectEnd)==null?void 0:H.call(P,...L)},updateConnection:M.updateConnection,onConnect:U,isValidConnection:n||((...L)=>{var P,H;return((H=(P=k.getState()).isValidConnection)==null?void 0:H.call(P,...L))??!0}),getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,autoPanSpeed:M.autoPanSpeed,dragThreshold:M.connectionDragThreshold})}b?c==null||c(D):d==null||d(D)},N=D=>{const{onClickConnectStart:b,onClickConnectEnd:M,connectionClickStartHandle:L,connectionMode:P,isValidConnection:H,lib:ee,rfId:K,nodeLookup:Y,connection:V}=k.getState();if(!g||!L&&!o)return;if(!L){b==null||b(D.nativeEvent,{nodeId:g,handleId:y,handleType:e}),k.setState({connectionClickStartHandle:{nodeId:g,type:e,id:y}});return}const X=$g(D.target),E=n||H,{connection:R,isValid:q}=vu.isValid(D.nativeEvent,{handle:{nodeId:g,id:y,type:e},connectionMode:P,fromNodeId:L.nodeId,fromHandleId:L.id||null,fromType:L.type,isValidConnection:E,flowId:K,doc:X,lib:ee,nodeLookup:Y});q&&R&&U(R);const Q=structuredClone(V);delete Q.inProgress,Q.toPosition=Q.toHandle?Q.toHandle.position:null,M==null||M(D,Q),k.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":y,"data-nodeid":g,"data-handlepos":t,"data-id":`${w}-${g}-${y}-${e}`,className:_e(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",m,u,{source:!x,target:x,connectable:r,connectablestart:o,connectableend:i,clickconnecting:_,connectingfrom:C,connectingto:S,valid:F,connectionindicator:r&&(!I||j)&&(I||O?i:o)}]),onMouseDown:B,onTouchStart:B,onClick:v?N:void 0,ref:p,...h,children:a})}const Ur=$.memo(n0(x_));function w_({data:e,isConnectable:t,sourcePosition:n=re.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(Ur,{type:"source",position:n,isConnectable:t})]})}function k_({data:e,isConnectable:t,targetPosition:n=re.Top,sourcePosition:r=re.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(Ur,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,f.jsx(Ur,{type:"source",position:r,isConnectable:t})]})}function S_(){return null}function N_({data:e,isConnectable:t,targetPosition:n=re.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(Ur,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Us={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Jf={input:w_,default:k_,output:N_,group:S_};function E_(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 __=e=>{const{width:t,height:n,x:r,y:o}=di(e.nodeLookup,{filter:i=>!!i.selected});return{width:Ct(t)?t:null,height:Ct(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 C_({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=pe(),{width:o,height:i,transformString:s,userSelectionActive:l}=le(__,we),a=s0(),u=$.useRef(null);$.useEffect(()=>{var p;n||(p=u.current)==null||p.focus({preventScroll:!0})},[n]);const c=!l&&o!==null&&i!==null;if(i0({nodeRef:u,disabled:!c}),!c)return null;const d=e?p=>{const y=r.getState().nodes.filter(x=>x.selected);e(p,y)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(Us,p.key)&&(p.preventDefault(),a({direction:Us[p.key],factor:p.shiftKey?4:1}))};return f.jsx("div",{className:_e(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:f.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:o,height:i}})})}const eh=typeof window<"u"?window:void 0,j_=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function u0({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:l,deleteKeyCode:a,selectionKeyCode:u,selectionOnDrag:c,selectionMode:d,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:y,panActivationKeyCode:x,zoomActivationKeyCode:k,elementsSelectable:g,zoomOnScroll:v,zoomOnPinch:m,panOnScroll:w,panOnScrollSpeed:C,panOnScrollMode:S,zoomOnDoubleClick:_,panOnDrag:j,autoPanOnSelection:I,defaultViewport:O,translateExtent:F,minZoom:U,maxZoom:B,preventScrolling:N,onSelectionContextMenu:T,noWheelClassName:z,noPanClassName:D,disableKeyboardA11y:b,onViewportChange:M,isControlledViewport:L}){const{nodesSelectionActive:P,userSelectionActive:H}=le(j_,we),ee=ei(u,{target:eh}),K=ei(x,{target:eh}),Y=K||j,V=K||w,X=c&&Y!==!0,E=ee||H||X;return o_({deleteKeyCode:a,multiSelectionKeyCode:y}),f.jsx(l_,{onPaneContextMenu:i,elementsSelectable:g,zoomOnScroll:v,zoomOnPinch:m,panOnScroll:V,panActivationKeyPressed:K,panOnScrollSpeed:C,panOnScrollMode:S,zoomOnDoubleClick:_,panOnDrag:!ee&&Y,defaultViewport:O,translateExtent:F,minZoom:U,maxZoom:B,zoomActivationKeyCode:k,preventScrolling:N,noWheelClassName:z,noPanClassName:D,onViewportChange:M,isControlledViewport:L,paneClickDistance:l,selectionOnDrag:X,children:f.jsxs(d_,{onSelectionStart:h,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:Y,autoPanOnSelection:I,isSelecting:!!E,selectionMode:d,selectionKeyPressed:ee,paneClickDistance:l,selectionOnDrag:X,children:[e,P&&f.jsx(C_,{onSelectionContextMenu:T,noPanClassName:D,disableKeyboardA11y:b})]})})}u0.displayName="FlowRenderer";const M_=$.memo(u0),$_=e=>t=>e?$c(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 b_(e){return le($.useCallback($_(e),[e]),we)}const P_=e=>e.updateNodeInternals;function I_(){const e=le(P_),[t]=$.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 $.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function T_({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=pe(),i=$.useRef(null),s=$.useRef(null),l=$.useRef(e.sourcePosition),a=$.useRef(e.targetPosition),u=$.useRef(t),c=n&&!!e.internals.handleBounds;return $.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]),$.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),$.useEffect(()=>{if(i.current){const d=u.current!==t,h=l.current!==e.sourcePosition,p=a.current!==e.targetPosition;(d||h||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 z_({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:i,onDoubleClick:s,nodesDraggable:l,elementsSelectable:a,nodesConnectable:u,nodesFocusable:c,resizeObserver:d,noDragClassName:h,noPanClassName:p,disableKeyboardA11y:y,rfId:x,nodeTypes:k,nodeClickDistance:g,onError:v}){const{node:m,internals:w,isParent:C}=le(E=>{const R=E.nodeLookup.get(e),q=E.parentLookup.has(e);return{node:R,internals:R.internals,isParent:q}},we);let S=m.type||"default",_=(k==null?void 0:k[S])||Jf[S];_===void 0&&(v==null||v("003",Pt.error003(S)),S="default",_=(k==null?void 0:k.default)||Jf.default);const j=!!(m.draggable||l&&typeof m.draggable>"u"),I=!!(m.selectable||a&&typeof m.selectable>"u"),O=!!(m.connectable||u&&typeof m.connectable>"u"),F=!!(m.focusable||c&&typeof m.focusable>"u"),U=pe(),B=Cg(m),N=T_({node:m,nodeType:S,hasDimensions:B,resizeObserver:d}),T=i0({nodeRef:N,disabled:m.hidden||!j,noDragClassName:h,handleSelector:m.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:g}),z=s0();if(m.hidden)return null;const D=Tt(m),b=E_(m),M=I||j||t||n||r||o,L=n?E=>n(E,{...w.userNode}):void 0,P=r?E=>r(E,{...w.userNode}):void 0,H=o?E=>o(E,{...w.userNode}):void 0,ee=i?E=>i(E,{...w.userNode}):void 0,K=s?E=>s(E,{...w.userNode}):void 0,Y=E=>{const{selectNodesOnDrag:R,nodeDragThreshold:q}=U.getState();I&&(!R||!j||q>0)&&xu({id:e,store:U,nodeRef:N}),t&&t(E,{...w.userNode})},V=E=>{if(!(bg(E.nativeEvent)||y)){if(yg.includes(E.key)&&I){const R=E.key==="Escape";xu({id:e,store:U,unselect:R,nodeRef:N})}else if(j&&m.selected&&Object.prototype.hasOwnProperty.call(Us,E.key)){E.preventDefault();const{ariaLabelConfig:R}=U.getState();U.setState({ariaLiveMessage:R["node.a11yDescription.ariaLiveMessage"]({direction:E.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),z({direction:Us[E.key],factor:E.shiftKey?4:1})}}},X=()=>{var W;if(y||!((W=N.current)!=null&&W.matches(":focus-visible")))return;const{transform:E,width:R,height:q,autoPanOnNodeFocus:Q,setCenter:G}=U.getState();if(!Q)return;$c(new Map([[e,m]]),{x:0,y:0,width:R,height:q},E,!0).length>0||G(m.position.x+D.width/2,m.position.y+D.height/2,{zoom:E[2]})};return f.jsx("div",{className:_e(["react-flow__node",`react-flow__node-${S}`,{[p]:j},m.className,{selected:m.selected,selectable:I,parent:C,draggable:j,dragging:T}]),ref:N,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:M?"all":"none",visibility:B?"visible":"hidden",...m.style,...b},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:L,onMouseMove:P,onMouseLeave:H,onContextMenu:ee,onClick:Y,onDoubleClick:K,onKeyDown:F?V:void 0,tabIndex:F?0:void 0,onFocus:F?X:void 0,role:m.ariaRole??(F?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${Zg}-${x}`,"aria-label":m.ariaLabel,...m.domAttributes,children:f.jsx(h_,{value:e,children:f.jsx(_,{id:e,data:m.data,type:S,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:m.selected??!1,selectable:I,draggable:j,deletable:m.deletable??!0,isConnectable:O,sourcePosition:m.sourcePosition,targetPosition:m.targetPosition,dragging:T,dragHandle:m.dragHandle,zIndex:w.z,parentId:m.parentId,...D})})})}var L_=$.memo(z_);const A_=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function c0(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:o}=le(A_,we),i=b_(e.onlyRenderVisibleElements),s=I_();return f.jsx("div",{className:"react-flow__nodes",style:kl,children:i.map(l=>f.jsx(L_,{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))})}c0.displayName="NodeRenderer";const R_=$.memo(c0);function D_(e){return le($.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&&yN({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(o.id)}return r},[e]),we)}const O_=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},F_=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},th={[qo.Arrow]:O_,[qo.ArrowClosed]:F_};function H_(e){const t=pe();return $.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(th,e)?th[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",Pt.error009(e)),null)},[e])}const B_=({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=H_(t);return a?f.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:f.jsx(a,{color:n,strokeWidth:s})}):null},d0=({defaultColor:e,rfId:t})=>{const n=le(i=>i.edges),r=le(i=>i.defaultEdgeOptions),o=$.useMemo(()=>_N(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?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:o.map(i=>f.jsx(B_,{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};d0.displayName="MarkerDefinitions";var V_=$.memo(d0);function f0({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:a,className:u,...c}){const[d,h]=$.useState({x:1,y:0,width:0,height:0}),p=_e(["react-flow__edge-textwrapper",u]),y=$.useRef(null);return $.useEffect(()=>{if(y.current){const x=y.current.getBBox();h({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),n?f.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?"visible":"hidden",...c,children:[o&&f.jsx("rect",{width:d.width+2*s[0],x:-s[0],y:-s[1],height:d.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),f.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:y,style:r,children:n}),a]}):null}f0.displayName="EdgeText";const W_=$.memo(f0);function gi({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a,interactionWidth:u=20,...c}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{...c,d:e,fill:"none",className:_e(["react-flow__edge-path",c.className])}),u?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Ct(t)&&Ct(n)?f.jsx(W_,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a}):null]})}function nh({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===re.Left||e===re.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function h0({sourceX:e,sourceY:t,sourcePosition:n=re.Bottom,targetX:r,targetY:o,targetPosition:i=re.Top}){const[s,l]=nh({pos:n,x1:e,y1:t,x2:r,y2:o}),[a,u]=nh({pos:i,x1:r,y1:o,x2:e,y2:t}),[c,d,h,p]=Ig({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:a,targetControlY:u});return[`M${e},${t} C${s},${l} ${a},${u} ${r},${o}`,c,d,h,p]}function p0(e){return $.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s,targetPosition:l,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:k,interactionWidth:g})=>{const[v,m,w]=h0({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l}),C=e.isInternal?void 0:t;return f.jsx(gi,{id:C,path:v,labelX:m,labelY:w,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:k,interactionWidth:g})})}const U_=p0({isInternal:!1}),m0=p0({isInternal:!0});U_.displayName="SimpleBezierEdge";m0.displayName="SimpleBezierEdgeInternal";function g0(e){return $.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:h,sourcePosition:p=re.Bottom,targetPosition:y=re.Top,markerEnd:x,markerStart:k,pathOptions:g,interactionWidth:v})=>{const[m,w,C]=Ws({sourceX:n,sourceY:r,sourcePosition:p,targetX:o,targetY:i,targetPosition:y,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset,stepPosition:g==null?void 0:g.stepPosition}),S=e.isInternal?void 0:t;return f.jsx(gi,{id:S,path:m,labelX:w,labelY:C,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:h,markerEnd:x,markerStart:k,interactionWidth:v})})}const y0=g0({isInternal:!1}),v0=g0({isInternal:!0});y0.displayName="SmoothStepEdge";v0.displayName="SmoothStepEdgeInternal";function x0(e){return $.memo(({id:t,...n})=>{var o;const r=e.isInternal?void 0:t;return f.jsx(y0,{...n,id:r,pathOptions:$.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const Y_=x0({isInternal:!1}),w0=x0({isInternal:!0});Y_.displayName="StepEdge";w0.displayName="StepEdgeInternal";function k0(e){return $.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:h,markerEnd:p,markerStart:y,interactionWidth:x})=>{const[k,g,v]=zg({sourceX:n,sourceY:r,targetX:o,targetY:i}),m=e.isInternal?void 0:t;return f.jsx(gi,{id:m,path:k,labelX:g,labelY:v,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:h,markerEnd:p,markerStart:y,interactionWidth:x})})}const X_=k0({isInternal:!1}),S0=k0({isInternal:!0});X_.displayName="StraightEdge";S0.displayName="StraightEdgeInternal";function N0(e){return $.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s=re.Bottom,targetPosition:l=re.Top,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:k,pathOptions:g,interactionWidth:v})=>{const[m,w,C]=Tc({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l,curvature:g==null?void 0:g.curvature}),S=e.isInternal?void 0:t;return f.jsx(gi,{id:S,path:m,labelX:w,labelY:C,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:k,interactionWidth:v})})}const K_=N0({isInternal:!1}),E0=N0({isInternal:!0});K_.displayName="BezierEdge";E0.displayName="BezierEdgeInternal";const rh={default:E0,straight:S0,step:w0,smoothstep:v0,simplebezier:m0},oh={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},G_=(e,t,n)=>n===re.Left?e-t:n===re.Right?e+t:e,Q_=(e,t,n)=>n===re.Top?e-t:n===re.Bottom?e+t:e,ih="react-flow__edgeupdater";function sh({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:l}){return f.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:_e([ih,`${ih}-${l}`]),cx:G_(t,r,e),cy:Q_(n,r,e),r,stroke:"transparent",fill:"transparent"})}function q_({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:i,targetY:s,sourcePosition:l,targetPosition:a,onReconnect:u,onReconnectStart:c,onReconnectEnd:d,setReconnecting:h,setUpdateHover:p}){const y=pe(),x=(w,C)=>{if(w.button!==0)return;const{autoPanOnConnect:S,domNode:_,connectionMode:j,connectionRadius:I,lib:O,onConnectStart:F,cancelConnection:U,nodeLookup:B,rfId:N,panBy:T,updateConnection:z}=y.getState(),D=C.type==="target",b=(P,H)=>{h(!1),d==null||d(P,n,C.type,H)},M=P=>u==null?void 0:u(n,P),L=(P,H)=>{h(!0),c==null||c(w,n,C.type),F==null||F(P,H)};vu.onPointerDown(w.nativeEvent,{autoPanOnConnect:S,connectionMode:j,connectionRadius:I,domNode:_,handleId:C.id,nodeId:C.nodeId,nodeLookup:B,isTarget:D,edgeUpdaterType:C.type,lib:O,flowId:N,cancelConnection:U,panBy:T,isValidConnection:(...P)=>{var H,ee;return((ee=(H=y.getState()).isValidConnection)==null?void 0:ee.call(H,...P))??!0},onConnect:M,onConnectStart:L,onConnectEnd:(...P)=>{var H,ee;return(ee=(H=y.getState()).onConnectEnd)==null?void 0:ee.call(H,...P)},onReconnectEnd:b,updateConnection:z,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"}),g=w=>x(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>p(!0),m=()=>p(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(sh,{position:l,centerX:r,centerY:o,radius:t,onMouseDown:k,onMouseEnter:v,onMouseOut:m,type:"source"}),(e===!0||e==="target")&&f.jsx(sh,{position:a,centerX:i,centerY:s,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:m,type:"target"})]})}function Z_({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:i,onContextMenu:s,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,reconnectRadius:c,onReconnect:d,onReconnectStart:h,onReconnectEnd:p,rfId:y,edgeTypes:x,noPanClassName:k,onError:g,disableKeyboardA11y:v}){let m=le(G=>G.edgeLookup.get(e));const w=le(G=>G.defaultEdgeOptions);m=w?{...w,...m}:m;let C=m.type||"default",S=(x==null?void 0:x[C])||rh[C];S===void 0&&(g==null||g("011",Pt.error011(C)),C="default",S=(x==null?void 0:x.default)||rh.default);const _=!!(m.focusable||t&&typeof m.focusable>"u"),j=typeof d<"u"&&(m.reconnectable||n&&typeof m.reconnectable>"u"),I=!!(m.selectable||r&&typeof m.selectable>"u"),O=$.useRef(null),[F,U]=$.useState(!1),[B,N]=$.useState(!1),T=pe(),{zIndex:z=m.zIndex,sourceX:D,sourceY:b,targetX:M,targetY:L,sourcePosition:P,targetPosition:H}=le($.useCallback(G=>{const A=G.nodeLookup.get(m.source),W=G.nodeLookup.get(m.target);if(!A||!W)return oh;const Z=EN({id:e,sourceNode:A,targetNode:W,sourceHandle:m.sourceHandle||null,targetHandle:m.targetHandle||null,connectionMode:G.connectionMode,onError:g}),te=gN({selected:m.selected,zIndex:m.zIndex,sourceNode:A,targetNode:W,elevateOnSelect:G.elevateEdgesOnSelect,zIndexMode:G.zIndexMode});return{...Z||oh,zIndex:te}},[m.source,m.target,m.sourceHandle,m.targetHandle,m.selected,m.zIndex,g]),we),ee=$.useMemo(()=>m.markerStart?`url('#${gu(m.markerStart,y)}')`:void 0,[m.markerStart,y]),K=$.useMemo(()=>m.markerEnd?`url('#${gu(m.markerEnd,y)}')`:void 0,[m.markerEnd,y]);if(m.hidden||D===null||b===null||M===null||L===null)return null;const Y=G=>{var te;const{addSelectedEdges:A,unselectNodesAndEdges:W,multiSelectionActive:Z}=T.getState();I&&(T.setState({nodesSelectionActive:!1}),m.selected&&Z?(W({nodes:[],edges:[m]}),(te=O.current)==null||te.blur()):A([e])),o&&o(G,m)},V=i?G=>{i(G,{...m})}:void 0,X=s?G=>{s(G,{...m})}:void 0,E=l?G=>{l(G,{...m})}:void 0,R=a?G=>{a(G,{...m})}:void 0,q=u?G=>{u(G,{...m})}:void 0,Q=G=>{var A;if(!v&&yg.includes(G.key)&&I){const{unselectNodesAndEdges:W,addSelectedEdges:Z}=T.getState();G.key==="Escape"?((A=O.current)==null||A.blur(),W({edges:[m]})):Z([e])}};return f.jsx("svg",{style:{zIndex:z},children:f.jsxs("g",{className:_e(["react-flow__edge",`react-flow__edge-${C}`,m.className,k,{selected:m.selected,animated:m.animated,inactive:!I&&!o,updating:F,selectable:I}]),onClick:Y,onDoubleClick:V,onContextMenu:X,onMouseEnter:E,onMouseMove:R,onMouseLeave:q,onKeyDown:_?Q:void 0,tabIndex:_?0:void 0,role:m.ariaRole??(_?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":m.ariaLabel===null?void 0:m.ariaLabel||`Edge from ${m.source} to ${m.target}`,"aria-describedby":_?`${Jg}-${y}`:void 0,ref:O,...m.domAttributes,children:[!B&&f.jsx(S,{id:e,source:m.source,target:m.target,type:m.type,selected:m.selected,animated:m.animated,selectable:I,deletable:m.deletable??!0,label:m.label,labelStyle:m.labelStyle,labelShowBg:m.labelShowBg,labelBgStyle:m.labelBgStyle,labelBgPadding:m.labelBgPadding,labelBgBorderRadius:m.labelBgBorderRadius,sourceX:D,sourceY:b,targetX:M,targetY:L,sourcePosition:P,targetPosition:H,data:m.data,style:m.style,sourceHandleId:m.sourceHandle,targetHandleId:m.targetHandle,markerStart:ee,markerEnd:K,pathOptions:"pathOptions"in m?m.pathOptions:void 0,interactionWidth:m.interactionWidth}),j&&f.jsx(q_,{edge:m,isReconnectable:j,reconnectRadius:c,onReconnect:d,onReconnectStart:h,onReconnectEnd:p,sourceX:D,sourceY:b,targetX:M,targetY:L,sourcePosition:P,targetPosition:H,setUpdateHover:U,setReconnecting:N})]})})}var J_=$.memo(Z_);const e2=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function _0({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:a,onEdgeMouseLeave:u,onEdgeClick:c,reconnectRadius:d,onEdgeDoubleClick:h,onReconnectStart:p,onReconnectEnd:y,disableKeyboardA11y:x}){const{edgesFocusable:k,edgesReconnectable:g,elementsSelectable:v,onError:m}=le(e2,we),w=D_(t);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(V_,{defaultColor:e,rfId:n}),w.map(C=>f.jsx(J_,{id:C,edgesFocusable:k,edgesReconnectable:g,elementsSelectable:v,noPanClassName:o,onReconnect:i,onContextMenu:s,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,onClick:c,reconnectRadius:d,onDoubleClick:h,onReconnectStart:p,onReconnectEnd:y,rfId:n,onError:m,edgeTypes:r,disableKeyboardA11y:x},C))]})}_0.displayName="EdgeRenderer";const t2=$.memo(_0),lh=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function n2({children:e}){const t=pe(),n=$.useRef(null),[r]=$.useState(()=>t.getState().transform);return r0(()=>{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=lh(s)))};return i(),t.subscribe(i)},[t]),f.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:lh(r)},children:e})}function r2(e){const t=mi(),n=$.useRef(!1);$.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const o2=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function i2(e){const t=le(o2),n=pe();return $.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function s2(e){return e.connection.inProgress?{...e.connection,to:hi(e.connection.to,e.transform)}:{...e.connection}}function l2(e){return s2}function a2(e){const t=l2();return le(t,we)}const u2=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function c2({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:i,height:s,isValid:l,inProgress:a}=le(u2,we);return!(i&&o&&a)?null:f.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:_e(["react-flow__connection",Mg(l)]),children:f.jsx(C0,{style:t,type:n,CustomComponent:r,isValid:l})})})}const C0=({style:e,type:t=pn.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:o,from:i,fromNode:s,fromHandle:l,fromPosition:a,to:u,toNode:c,toHandle:d,toPosition:h,pointer:p}=a2();if(!o)return;if(n)return f.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:h,connectionStatus:Mg(r),toNode:c,toHandle:d,pointer:p});let y="";const x={sourceX:i.x,sourceY:i.y,sourcePosition:a,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case pn.Bezier:[y]=Tc(x);break;case pn.SimpleBezier:[y]=h0(x);break;case pn.Step:[y]=Ws({...x,borderRadius:0});break;case pn.SmoothStep:[y]=Ws(x);break;default:[y]=zg(x)}return f.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:e})};C0.displayName="ConnectionLine";const d2={};function ah(e=d2){$.useRef(e),pe(),$.useEffect(()=>{},[e])}function f2(){pe(),$.useRef(!1),$.useEffect(()=>{},[])}function j0({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:c,onSelectionContextMenu:d,onSelectionStart:h,onSelectionEnd:p,connectionLineType:y,connectionLineStyle:x,connectionLineComponent:k,connectionLineContainerStyle:g,selectionKeyCode:v,selectionOnDrag:m,selectionMode:w,multiSelectionKeyCode:C,panActivationKeyCode:S,zoomActivationKeyCode:_,deleteKeyCode:j,onlyRenderVisibleElements:I,elementsSelectable:O,defaultViewport:F,translateExtent:U,minZoom:B,maxZoom:N,preventScrolling:T,defaultMarkerColor:z,zoomOnScroll:D,zoomOnPinch:b,panOnScroll:M,panOnScrollSpeed:L,panOnScrollMode:P,zoomOnDoubleClick:H,panOnDrag:ee,autoPanOnSelection:K,onPaneClick:Y,onPaneMouseEnter:V,onPaneMouseMove:X,onPaneMouseLeave:E,onPaneScroll:R,onPaneContextMenu:q,paneClickDistance:Q,nodeClickDistance:G,onEdgeContextMenu:A,onEdgeMouseEnter:W,onEdgeMouseMove:Z,onEdgeMouseLeave:te,reconnectRadius:oe,onReconnect:de,onReconnectStart:me,onReconnectEnd:ke,noDragClassName:Me,noWheelClassName:ie,noPanClassName:Ae,disableKeyboardA11y:tt,nodeExtent:Pe,rfId:He,viewport:Be,onViewportChange:ct,nodesDraggable:qr}){return ah(e),ah(t),f2(),r2(n),i2(Be),f.jsx(M_,{onPaneClick:Y,onPaneMouseEnter:V,onPaneMouseMove:X,onPaneMouseLeave:E,onPaneContextMenu:q,onPaneScroll:R,paneClickDistance:Q,deleteKeyCode:j,selectionKeyCode:v,selectionOnDrag:m,selectionMode:w,onSelectionStart:h,onSelectionEnd:p,multiSelectionKeyCode:C,panActivationKeyCode:S,zoomActivationKeyCode:_,elementsSelectable:O,zoomOnScroll:D,zoomOnPinch:b,zoomOnDoubleClick:H,panOnScroll:M,panOnScrollSpeed:L,panOnScrollMode:P,panOnDrag:ee,autoPanOnSelection:K,defaultViewport:F,translateExtent:U,minZoom:B,maxZoom:N,onSelectionContextMenu:d,preventScrolling:T,noDragClassName:Me,noWheelClassName:ie,noPanClassName:Ae,disableKeyboardA11y:tt,onViewportChange:ct,isControlledViewport:!!Be,children:f.jsxs(n2,{children:[f.jsx(t2,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:s,onReconnect:de,onReconnectStart:me,onReconnectEnd:ke,onlyRenderVisibleElements:I,onEdgeContextMenu:A,onEdgeMouseEnter:W,onEdgeMouseMove:Z,onEdgeMouseLeave:te,reconnectRadius:oe,defaultMarkerColor:z,noPanClassName:Ae,disableKeyboardA11y:tt,rfId:He}),f.jsx(c2,{style:x,type:y,component:k,containerStyle:g}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(R_,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:c,nodeClickDistance:G,onlyRenderVisibleElements:I,noPanClassName:Ae,noDragClassName:Me,disableKeyboardA11y:tt,nodeExtent:Pe,rfId:He,nodesDraggable:qr}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}j0.displayName="GraphView";const h2=$.memo(j0),p2=_g(),uh=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a=.5,maxZoom:u=2,nodeOrigin:c,nodeExtent:d,zIndexMode:h="basic"}={})=>{const p=new Map,y=new Map,x=new Map,k=new Map,g=r??t??[],v=n??e??[],m=c??[0,0],w=d??Go;Rg(x,k,g);const{nodesInitialized:C}=yu(v,p,y,{nodeOrigin:m,nodeExtent:w,zIndexMode:h});let S=[0,0,1];if(s&&o&&i){const _=di(p,{filter:F=>!!((F.width||F.initialWidth)&&(F.height||F.initialHeight))}),{x:j,y:I,zoom:O}=Pc(_,o,i,a,u,(l==null?void 0:l.padding)??.1);S=[j,I,O]}return{rfId:"1",width:o??0,height:i??0,transform:S,nodes:v,nodesInitialized:C,nodeLookup:p,parentLookup:y,edges:g,edgeLookup:k,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:a,maxZoom:u,translateExtent:Go,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Fr.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:m,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:{...xg},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:p2,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:vg,zIndexMode:h,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}},m2=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a,maxZoom:u,nodeOrigin:c,nodeExtent:d,zIndexMode:h})=>jE((p,y)=>{async function x(){const{nodeLookup:k,panZoom:g,fitViewOptions:v,fitViewResolver:m,width:w,height:C,minZoom:S,maxZoom:_}=y();g&&(await uN({nodes:k,width:w,height:C,panZoom:g,minZoom:S,maxZoom:_},v),m==null||m.resolve(!0),p({fitViewResolver:null}))}return{...uh({nodes:e,edges:t,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a,maxZoom:u,nodeOrigin:c,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:h}),setNodes:k=>{const{nodeLookup:g,parentLookup:v,nodeOrigin:m,nodeExtent:w,elevateNodesOnSelect:C,fitViewQueued:S,zIndexMode:_,nodesSelectionActive:j}=y(),{nodesInitialized:I,hasSelectedNodes:O}=yu(k,g,v,{nodeOrigin:m,nodeExtent:w,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:_}),F=j&&O;S&&I?(x(),p({nodes:k,nodesInitialized:I,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:F})):p({nodes:k,nodesInitialized:I,nodesSelectionActive:F})},setEdges:k=>{const{connectionLookup:g,edgeLookup:v}=y();Rg(g,v,k),p({edges:k})},setDefaultNodesAndEdges:(k,g)=>{if(k){const{setNodes:v}=y();v(k),p({hasDefaultNodes:!0})}if(g){const{setEdges:v}=y();v(g),p({hasDefaultEdges:!0})}},updateNodeInternals:k=>{const{triggerNodeChanges:g,nodeLookup:v,parentLookup:m,domNode:w,nodeOrigin:C,nodeExtent:S,debug:_,fitViewQueued:j,zIndexMode:I}=y(),{changes:O,updatedInternals:F}=IN(k,v,m,w,C,S,I);F&&(MN(v,m,{nodeOrigin:C,nodeExtent:S,zIndexMode:I}),j?(x(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(O==null?void 0:O.length)>0&&(_&&console.log("React Flow: trigger node changes",O),g==null||g(O)))},updateNodePositions:(k,g=!1)=>{const v=[];let m=[];const{nodeLookup:w,triggerNodeChanges:C,connection:S,updateConnection:_,onNodesChangeMiddlewareMap:j}=y();for(const[I,O]of k){const F=w.get(I),U=!!(F!=null&&F.expandParent&&(F!=null&&F.parentId)&&(O!=null&&O.position)),B={id:I,type:"position",position:U?{x:Math.max(0,O.position.x),y:Math.max(0,O.position.y)}:O.position,dragging:g};if(F&&S.inProgress&&S.fromNode.id===F.id){const N=tr(F,S.fromHandle,re.Left,!0);_({...S,from:N})}U&&F.parentId&&v.push({id:I,parentId:F.parentId,rect:{...O.internals.positionAbsolute,width:O.measured.width??0,height:O.measured.height??0}}),m.push(B)}if(v.length>0){const{parentLookup:I,nodeOrigin:O}=y(),F=Dc(v,w,I,O);m.push(...F)}for(const I of j.values())m=I(m);C(m)},triggerNodeChanges:k=>{const{onNodesChange:g,setNodes:v,nodes:m,hasDefaultNodes:w,debug:C}=y();if(k!=null&&k.length){if(w){const S=KE(k,m);v(S)}C&&console.log("React Flow: trigger node changes",k),g==null||g(k)}},triggerEdgeChanges:k=>{const{onEdgesChange:g,setEdges:v,edges:m,hasDefaultEdges:w,debug:C}=y();if(k!=null&&k.length){if(w){const S=GE(k,m);v(S)}C&&console.log("React Flow: trigger edge changes",k),g==null||g(k)}},addSelectedNodes:k=>{const{multiSelectionActive:g,edgeLookup:v,nodeLookup:m,triggerNodeChanges:w,triggerEdgeChanges:C}=y();if(g){const S=k.map(_=>In(_,!0));w(S);return}w(Sr(m,new Set([...k]),!0)),C(Sr(v))},addSelectedEdges:k=>{const{multiSelectionActive:g,edgeLookup:v,nodeLookup:m,triggerNodeChanges:w,triggerEdgeChanges:C}=y();if(g){const S=k.map(_=>In(_,!0));C(S);return}C(Sr(v,new Set([...k]))),w(Sr(m,new Set,!0))},unselectNodesAndEdges:({nodes:k,edges:g}={})=>{const{edges:v,nodes:m,nodeLookup:w,triggerNodeChanges:C,triggerEdgeChanges:S}=y(),_=k||m,j=g||v,I=[];for(const F of _){if(!F.selected)continue;const U=w.get(F.id);U&&(U.selected=!1),I.push(In(F.id,!1))}const O=[];for(const F of j)F.selected&&O.push(In(F.id,!1));C(I),S(O)},setMinZoom:k=>{const{panZoom:g,maxZoom:v}=y();g==null||g.setScaleExtent([k,v]),p({minZoom:k})},setMaxZoom:k=>{const{panZoom:g,minZoom:v}=y();g==null||g.setScaleExtent([v,k]),p({maxZoom:k})},setTranslateExtent:k=>{var g;(g=y().panZoom)==null||g.setTranslateExtent(k),p({translateExtent:k})},resetSelectedElements:()=>{const{edges:k,nodes:g,triggerNodeChanges:v,triggerEdgeChanges:m,elementsSelectable:w}=y();if(!w)return;const C=g.reduce((_,j)=>j.selected?[..._,In(j.id,!1)]:_,[]),S=k.reduce((_,j)=>j.selected?[..._,In(j.id,!1)]:_,[]);v(C),m(S)},setNodeExtent:k=>{const{nodes:g,nodeLookup:v,parentLookup:m,nodeOrigin:w,elevateNodesOnSelect:C,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]||(yu(g,v,m,{nodeOrigin:w,nodeExtent:k,elevateNodesOnSelect:C,checkEquality:!1,zIndexMode:_}),p({nodeExtent:k}))},panBy:k=>{const{transform:g,width:v,height:m,panZoom:w,translateExtent:C}=y();return TN({delta:k,panZoom:w,transform:g,translateExtent:C,width:v,height:m})},setCenter:async(k,g,v)=>{const{width:m,height:w,maxZoom:C,panZoom:S}=y();if(!S)return!1;const _=typeof(v==null?void 0:v.zoom)<"u"?v.zoom:C;return await S.setViewport({x:m/2-k*_,y:w/2-g*_,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:{...xg}})},updateConnection:k=>{p({connection:k})},reset:()=>p({...uh()})}},Object.is);function M0({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:i,initialMinZoom:s,initialMaxZoom:l,initialFitViewOptions:a,fitView:u,nodeOrigin:c,nodeExtent:d,zIndexMode:h,children:p}){const[y]=$.useState(()=>m2({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:u,minZoom:s,maxZoom:l,fitViewOptions:a,nodeOrigin:c,nodeExtent:d,zIndexMode:h}));return f.jsx(ME,{value:y,children:f.jsx(e_,{children:f.jsx(m_,{children:p})})})}function g2({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:i,height:s,fitView:l,fitViewOptions:a,minZoom:u,maxZoom:c,nodeOrigin:d,nodeExtent:h,zIndexMode:p}){return $.useContext(wl)?f.jsx(f.Fragment,{children:e}):f.jsx(M0,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:i,initialHeight:s,fitView:l,initialFitViewOptions:a,initialMinZoom:u,initialMaxZoom:c,nodeOrigin:d,nodeExtent:h,zIndexMode:p,children:e})}const y2={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function v2({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i,edgeTypes:s,onNodeClick:l,onEdgeClick:a,onInit:u,onMove:c,onMoveStart:d,onMoveEnd:h,onConnect:p,onConnectStart:y,onConnectEnd:x,onClickConnectStart:k,onClickConnectEnd:g,onNodeMouseEnter:v,onNodeMouseMove:m,onNodeMouseLeave:w,onNodeContextMenu:C,onNodeDoubleClick:S,onNodeDragStart:_,onNodeDrag:j,onNodeDragStop:I,onNodesDelete:O,onEdgesDelete:F,onDelete:U,onSelectionChange:B,onSelectionDragStart:N,onSelectionDrag:T,onSelectionDragStop:z,onSelectionContextMenu:D,onSelectionStart:b,onSelectionEnd:M,onBeforeDelete:L,connectionMode:P,connectionLineType:H=pn.Bezier,connectionLineStyle:ee,connectionLineComponent:K,connectionLineContainerStyle:Y,deleteKeyCode:V="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:E=!1,selectionMode:R=Qo.Full,panActivationKeyCode:q="Space",multiSelectionKeyCode:Q=Jo()?"Meta":"Control",zoomActivationKeyCode:G=Jo()?"Meta":"Control",snapToGrid:A,snapGrid:W,onlyRenderVisibleElements:Z=!1,selectNodesOnDrag:te,nodesDraggable:oe,autoPanOnNodeFocus:de,nodesConnectable:me,nodesFocusable:ke,nodeOrigin:Me=e0,edgesFocusable:ie,edgesReconnectable:Ae,elementsSelectable:tt=!0,defaultViewport:Pe=HE,minZoom:He=.5,maxZoom:Be=2,translateExtent:ct=Go,preventScrolling:qr=!0,nodeExtent:$l,defaultMarkerColor:q0="#b1b1b7",zoomOnScroll:Z0=!0,zoomOnPinch:J0=!0,panOnScroll:ey=!1,panOnScrollSpeed:ty=.5,panOnScrollMode:ny=Bn.Free,zoomOnDoubleClick:ry=!0,panOnDrag:oy=!0,onPaneClick:iy,onPaneMouseEnter:sy,onPaneMouseMove:ly,onPaneMouseLeave:ay,onPaneScroll:uy,onPaneContextMenu:cy,paneClickDistance:dy=1,nodeClickDistance:fy=0,children:hy,onReconnect:py,onReconnectStart:my,onReconnectEnd:gy,onEdgeContextMenu:yy,onEdgeDoubleClick:vy,onEdgeMouseEnter:xy,onEdgeMouseMove:wy,onEdgeMouseLeave:ky,reconnectRadius:Sy=10,onNodesChange:Ny,onEdgesChange:Ey,noDragClassName:_y="nodrag",noWheelClassName:Cy="nowheel",noPanClassName:Vc="nopan",fitView:Wc,fitViewOptions:Uc,connectOnClick:jy,attributionPosition:My,proOptions:$y,defaultEdgeOptions:by,elevateNodesOnSelect:Py=!0,elevateEdgesOnSelect:Iy=!1,disableKeyboardA11y:Yc=!1,autoPanOnConnect:Ty,autoPanOnNodeDrag:zy,autoPanOnSelection:Ly=!0,autoPanSpeed:Ay,connectionRadius:Ry,isValidConnection:Dy,onError:Oy,style:Fy,id:Xc,nodeDragThreshold:Hy,connectionDragThreshold:By,viewport:Vy,onViewportChange:Wy,width:Uy,height:Yy,colorMode:Xy="light",debug:Ky,onScroll:vi,ariaLabelConfig:Gy,zIndexMode:Kc="basic",...Qy},qy){const bl=Xc||"1",Zy=UE(Xy),Jy=$.useCallback(Gc=>{Gc.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),vi==null||vi(Gc)},[vi]);return f.jsx("div",{"data-testid":"rf__wrapper",...Qy,onScroll:Jy,style:{...Fy,...y2},ref:qy,className:_e(["react-flow",o,Zy]),id:Xc,role:"application",children:f.jsxs(g2,{nodes:e,edges:t,width:Uy,height:Yy,fitView:Wc,fitViewOptions:Uc,minZoom:He,maxZoom:Be,nodeOrigin:Me,nodeExtent:$l,zIndexMode:Kc,children:[f.jsx(WE,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:y,onConnectEnd:x,onClickConnectStart:k,onClickConnectEnd:g,nodesDraggable:oe,autoPanOnNodeFocus:de,nodesConnectable:me,nodesFocusable:ke,edgesFocusable:ie,edgesReconnectable:Ae,elementsSelectable:tt,elevateNodesOnSelect:Py,elevateEdgesOnSelect:Iy,minZoom:He,maxZoom:Be,nodeExtent:$l,onNodesChange:Ny,onEdgesChange:Ey,snapToGrid:A,snapGrid:W,connectionMode:P,translateExtent:ct,connectOnClick:jy,defaultEdgeOptions:by,fitView:Wc,fitViewOptions:Uc,onNodesDelete:O,onEdgesDelete:F,onDelete:U,onNodeDragStart:_,onNodeDrag:j,onNodeDragStop:I,onSelectionDrag:T,onSelectionDragStart:N,onSelectionDragStop:z,onMove:c,onMoveStart:d,onMoveEnd:h,noPanClassName:Vc,nodeOrigin:Me,rfId:bl,autoPanOnConnect:Ty,autoPanOnNodeDrag:zy,autoPanSpeed:Ay,onError:Oy,connectionRadius:Ry,isValidConnection:Dy,selectNodesOnDrag:te,nodeDragThreshold:Hy,connectionDragThreshold:By,onBeforeDelete:L,debug:Ky,ariaLabelConfig:Gy,zIndexMode:Kc}),f.jsx(h2,{onInit:u,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:v,onNodeMouseMove:m,onNodeMouseLeave:w,onNodeContextMenu:C,onNodeDoubleClick:S,nodeTypes:i,edgeTypes:s,connectionLineType:H,connectionLineStyle:ee,connectionLineComponent:K,connectionLineContainerStyle:Y,selectionKeyCode:X,selectionOnDrag:E,selectionMode:R,deleteKeyCode:V,multiSelectionKeyCode:Q,panActivationKeyCode:q,zoomActivationKeyCode:G,onlyRenderVisibleElements:Z,defaultViewport:Pe,translateExtent:ct,minZoom:He,maxZoom:Be,preventScrolling:qr,zoomOnScroll:Z0,zoomOnPinch:J0,zoomOnDoubleClick:ry,panOnScroll:ey,panOnScrollSpeed:ty,panOnScrollMode:ny,panOnDrag:oy,autoPanOnSelection:Ly,onPaneClick:iy,onPaneMouseEnter:sy,onPaneMouseMove:ly,onPaneMouseLeave:ay,onPaneScroll:uy,onPaneContextMenu:cy,paneClickDistance:dy,nodeClickDistance:fy,onSelectionContextMenu:D,onSelectionStart:b,onSelectionEnd:M,onReconnect:py,onReconnectStart:my,onReconnectEnd:gy,onEdgeContextMenu:yy,onEdgeDoubleClick:vy,onEdgeMouseEnter:xy,onEdgeMouseMove:wy,onEdgeMouseLeave:ky,reconnectRadius:Sy,defaultMarkerColor:q0,noDragClassName:_y,noWheelClassName:Cy,noPanClassName:Vc,rfId:bl,disableKeyboardA11y:Yc,nodeExtent:$l,viewport:Vy,onViewportChange:Wy,nodesDraggable:oe}),f.jsx(FE,{onSelectionChange:B}),hy,f.jsx(LE,{proOptions:$y,position:My}),f.jsx(zE,{rfId:bl,disableKeyboardA11y:Yc})]})})}var x2=n0(v2);const w2=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function k2({children:e}){const t=le(w2);return t?Om.createPortal(e,t):null}function S2({dimensions:e,lineWidth:t,variant:n,className:r}){return f.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:_e(["react-flow__background-pattern",n,r])})}function N2({radius:e,className:t}){return f.jsx("circle",{cx:e,cy:e,r:e,className:_e(["react-flow__background-pattern","dots",t])})}var Qt;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Qt||(Qt={}));const E2={[Qt.Dots]:1,[Qt.Lines]:1,[Qt.Cross]:6},_2=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function $0({id:e,variant:t=Qt.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=0,color:s,bgColor:l,style:a,className:u,patternClassName:c}){const d=$.useRef(null),{transform:h,patternId:p}=le(_2,we),y=r||E2[t],x=t===Qt.Dots,k=t===Qt.Cross,g=Array.isArray(n)?n:[n,n],v=[g[0]*h[2]||1,g[1]*h[2]||1],m=y*h[2],w=Array.isArray(i)?i:[i,i],C=k?[m,m]:v,S=[w[0]*h[2]+C[0]/2,w[1]*h[2]+C[1]/2],_=`${p}${e||""}`;return f.jsxs("svg",{className:_e(["react-flow__background",u]),style:{...a,...kl,"--xy-background-color-props":l,"--xy-background-pattern-color-props":s},ref:d,"data-testid":"rf__background",children:[f.jsx("pattern",{id:_,x:h[0]%v[0],y:h[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:x?f.jsx(N2,{radius:m/2,className:c}):f.jsx(S2,{dimensions:C,lineWidth:o,variant:t,className:c})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${_})`})]})}$0.displayName="Background";const C2=$.memo($0);function j2(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function M2(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function $2(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.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 b2(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 P2(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 Wi({children:e,className:t,...n}){return f.jsx("button",{type:"button",className:_e(["react-flow__controls-button",t]),...n,children:e})}const I2=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function b0({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:l,onInteractiveChange:a,className:u,children:c,position:d="bottom-left",orientation:h="vertical","aria-label":p}){const y=pe(),{isInteractive:x,minZoomReached:k,maxZoomReached:g,ariaLabelConfig:v}=le(I2,we),{zoomIn:m,zoomOut:w,fitView:C}=mi(),S=()=>{m(),i==null||i()},_=()=>{w(),s==null||s()},j=()=>{C(o),l==null||l()},I=()=>{y.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),a==null||a(!x)},O=h==="horizontal"?"horizontal":"vertical";return f.jsxs(pi,{className:_e(["react-flow__controls",O,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":p??v["controls.ariaLabel"],children:[t&&f.jsxs(f.Fragment,{children:[f.jsx(Wi,{onClick:S,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:g,children:f.jsx(j2,{})}),f.jsx(Wi,{onClick:_,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:k,children:f.jsx(M2,{})})]}),n&&f.jsx(Wi,{className:"react-flow__controls-fitview",onClick:j,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:f.jsx($2,{})}),r&&f.jsx(Wi,{className:"react-flow__controls-interactive",onClick:I,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:x?f.jsx(P2,{}):f.jsx(b2,{})}),c]})}b0.displayName="Controls";$.memo(b0);function T2({id:e,x:t,y:n,width:r,height:o,style:i,color:s,strokeColor:l,strokeWidth:a,className:u,borderRadius:c,shapeRendering:d,selected:h,onClick:p}){const{background:y,backgroundColor:x}=i||{},k=s||y||x;return f.jsx("rect",{className:_e(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:c,ry:c,width:r,height:o,style:{fill:k,stroke:l,strokeWidth:a},shapeRendering:d,onClick:p?g=>p(g,e):void 0})}const z2=$.memo(T2),L2=e=>e.nodes.map(t=>t.id),fa=e=>e instanceof Function?e:()=>e;function A2({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:i=z2,onClick:s}){const l=le(L2,we),a=fa(t),u=fa(e),c=fa(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:l.map(h=>f.jsx(D2,{id:h,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:c,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:i,onClick:s,shapeRendering:d},h))})}function R2({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:l,onClick:a}){const{node:u,x:c,y:d,width:h,height:p}=le(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:g,y:v}=x.internals.positionAbsolute,{width:m,height:w}=Tt(k);return{node:k,x:g,y:v,width:m,height:w}},we);return!u||u.hidden||!Cg(u)?null:f.jsx(l,{x:c,y:d,width:h,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 D2=$.memo(R2);var O2=$.memo(A2);const F2=200,H2=150,B2=e=>!e.hidden,V2=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?Ng(di(e.nodeLookup,{filter:B2}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},ch=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,W2=(e,t)=>ch(e.viewBB,t.viewBB)&&ch(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,U2="react-flow__minimap-desc";function P0({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:l,bgColor:a,maskColor:u,maskStrokeColor:c,maskStrokeWidth:d,position:h="bottom-right",onClick:p,onNodeClick:y,pannable:x=!1,zoomable:k=!1,ariaLabel:g,inversePan:v,zoomStep:m=1,offsetScale:w=5}){const C=pe(),S=$.useRef(null),{boundingRect:_,panZoom:j,viewBB:I,rfId:O,translateExtent:F,flowWidth:U,flowHeight:B,ariaLabelConfig:N}=le(V2,W2),T=(e==null?void 0:e.width)??F2,z=(e==null?void 0:e.height)??H2,D=_.width/T,b=_.height/z,M=Math.max(D,b),L=M*T,P=M*z,H=w*M,ee=_.x-(L-_.width)/2-H,K=_.y-(P-_.height)/2-H,Y=L+H*2,V=P+H*2,X=`${U2}-${O}`,E=$.useRef(0),R=$.useRef();E.current=M,$.useEffect(()=>{const W=C.getState().panZoom;if(S.current&&W)return R.current=BN({domNode:S.current,panZoom:W,getTransform:()=>C.getState().transform,getViewScale:()=>E.current}),()=>{var Z;(Z=R.current)==null||Z.destroy()}},[j]),$.useEffect(()=>{var W;(W=R.current)==null||W.update({translateExtent:F,width:U,height:B,inversePan:v,pannable:x,zoomStep:m,zoomable:k})},[x,k,v,m,F,U,B]);const q=p?W=>{var oe;const[Z,te]=((oe=R.current)==null?void 0:oe.pointer(W))||[0,0];p(W,{x:Z,y:te})}:void 0,Q=$.useCallback((W,Z)=>{const te=C.getState().nodeLookup.get(Z).internals.userNode;y==null||y(W,te)},[y]),G=y?Q:void 0,A=g??N["minimap.ariaLabel"];return f.jsx(pi,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*M: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:_e(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:T,height:z,viewBox:`${ee} ${K} ${Y} ${V}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:S,onClick:q,children:[A&&f.jsx("title",{id:X,children:A}),f.jsx(O2,{onClick:G,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:s,nodeComponent:l}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${ee-H},${K-H}h${Y+H*2}v${V+H*2}h${-Y-H*2}z
|
|
62
|
-
M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}P0.displayName="MiniMap";$.memo(P0);const Y2=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,X2={[Vr.Line]:"right",[Vr.Handle]:"bottom-right"};function K2({nodeId:e,position:t,variant:n=Vr.Handle,className:r,style:o=void 0,children:i,color:s,minWidth:l=10,minHeight:a=10,maxWidth:u=Number.MAX_VALUE,maxHeight:c=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:h,autoScale:p=!0,shouldResize:y,onResizeStart:x,onResize:k,onResizeEnd:g}){const v=l0(),m=typeof e=="string"?e:v,w=pe(),C=$.useRef(null),S=n===Vr.Handle,_=le($.useCallback(Y2(S&&p),[S,p]),we),j=$.useRef(null),I=t??X2[n];$.useEffect(()=>{if(!(!C.current||!m))return j.current||(j.current=tE({domNode:C.current,nodeId:m,getStoreItems:()=>{const{nodeLookup:F,transform:U,snapGrid:B,snapToGrid:N,nodeOrigin:T,domNode:z}=w.getState();return{nodeLookup:F,transform:U,snapGrid:B,snapToGrid:N,nodeOrigin:T,paneDomNode:z}},onChange:(F,U)=>{const{triggerNodeChanges:B,nodeLookup:N,parentLookup:T,nodeOrigin:z}=w.getState(),D=[],b={x:F.x,y:F.y},M=N.get(m);if(M&&M.expandParent&&M.parentId){const L=M.origin??z,P=F.width??M.measured.width??0,H=F.height??M.measured.height??0,ee={id:M.id,parentId:M.parentId,rect:{width:P,height:H,...jg({x:F.x??M.position.x,y:F.y??M.position.y},{width:P,height:H},M.parentId,N,L)}},K=Dc([ee],N,T,z);D.push(...K),b.x=F.x?Math.max(L[0]*P,F.x):void 0,b.y=F.y?Math.max(L[1]*H,F.y):void 0}if(b.x!==void 0&&b.y!==void 0){const L={id:m,type:"position",position:{...b}};D.push(L)}if(F.width!==void 0&&F.height!==void 0){const P={id:m,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:F.width,height:F.height}};D.push(P)}for(const L of U){const P={...L,type:"position"};D.push(P)}B(D)},onEnd:({width:F,height:U})=>{const B={id:m,type:"dimensions",resizing:!1,dimensions:{width:F,height:U}};w.getState().triggerNodeChanges([B])}})),j.current.update({controlPosition:I,boundaries:{minWidth:l,minHeight:a,maxWidth:u,maxHeight:c},keepAspectRatio:d,resizeDirection:h,onResizeStart:x,onResize:k,onResizeEnd:g,shouldResize:y}),()=>{var F;(F=j.current)==null||F.destroy()}},[I,l,a,u,c,d,x,k,g,y]);const O=I.split("-");return f.jsx("div",{className:_e(["react-flow__resize-control","nodrag",...O,n,r]),ref:C,style:{...o,scale:_,...s&&{[S?"backgroundColor":"borderColor"]:s}},children:i})}$.memo(K2);function G2(){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 Yr=G2(),Dt=e=>`/${e?`m/${encodeURIComponent(e)}`:""}?t=${encodeURIComponent(Yr)}`,Ys=e=>e.kind==="capture"?`/api/screens/${encodeURIComponent(e.capture)}.png?t=${encodeURIComponent(Yr)}`:`/api/repo-image?file=${encodeURIComponent(e.file)}&t=${encodeURIComponent(Yr)}`;class I0 extends Error{constructor(t,n=[]){super(t),this.problems=n}}async function dt(e,t,n){const r=await fetch(t,{method:e,headers:{"x-illuminate-token":Yr,"content-type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)}),o=await r.json().catch(()=>({}));if(!r.ok)throw new I0(o.error??`Request failed (${r.status})`,o.problems??[]);return o}const _t={list:()=>dt("GET","/api/maps"),get:e=>dt("GET",`/api/maps/${encodeURIComponent(e)}`),make:(e,t)=>dt("POST","/api/maps",{question:e,parent:t}),offer:(e,t,n)=>dt("POST",`/api/maps/${encodeURIComponent(e)}/answers/${encodeURIComponent(t)}/offer`,{choice:n}),selection:(e,t,n)=>dt("PUT",`/api/maps/${encodeURIComponent(e)}/selection`,{selection:t,step:n}),ask:(e,t,n)=>dt("POST",`/api/maps/${encodeURIComponent(e)}/ask`,{question:t,selection:n}),approve:(e,t)=>dt("POST",`/api/maps/${encodeURIComponent(e)}/fixes/${encodeURIComponent(t)}/approve`),reject:(e,t)=>dt("POST",`/api/maps/${encodeURIComponent(e)}/fixes/${encodeURIComponent(t)}/reject`),undo:(e,t)=>dt("POST",`/api/maps/${encodeURIComponent(e)}/fixes/${encodeURIComponent(t)}/undo`),code:(e,t,n="now")=>dt("GET",`/api/maps/${encodeURIComponent(e)}/code?item=${encodeURIComponent(t)}${n==="before"?"&when=before":""}`),answerCode:(e,t)=>dt("GET",`/api/maps/${encodeURIComponent(e)}/answers/${encodeURIComponent(t)}/code`),stop:()=>dt("POST","/api/stop")},Q2=4e3;function T0(e,t,n,r){let o=null,i=!1,s=null;const l=()=>{o=new WebSocket(`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws?t=${encodeURIComponent(Yr)}${r?`&m=${encodeURIComponent(r)}`:""}`),o.onopen=()=>t(!0),o.onmessage=a=>{try{e(JSON.parse(String(a.data)))}catch{}},o.onclose=a=>{t(!1),a.code===Q2?(i=!0,n()):i||(s=setTimeout(l,1e3))}};return l(),()=>{i=!0,s&&clearTimeout(s),o==null||o.close()}}const z0={name:"Claude",asks:"page"},Sl=e=>e.asks==="chat";function q2(e,t,n){return{title:`Ask in the ${e.name} chat beside this page`,detail:t?`${e.name} will see what you selected here.`:n?`${e.name} will know you're on the step “${n}”.`:`${e.name} will see what you select here.`}}function Z2(e,t,n){return Sl(e)?{selection:t,step:n}:null}function J2(e,t){var r;if(((r=e.offer)==null?void 0:r.status)==="pending")return!0;const n=e.fix?t[e.fix.id]:void 0;return!!n&&(n.status==="proposed"||n.status==="applying"||n.status==="failed"||n.status==="applied"&&n.undoable)}function eC(e,t,n){return Sl(e)?t.filter(r=>J2(r,n)):t}const Fc=[{id:"vscode",name:"VS Code"},{id:"cursor",name:"Cursor"},{id:"windsurf",name:"Windsurf"},{id:"zed",name:"Zed"}];function tC(e,t,n,r){const o=`${t.replace(/\\/g,"/").replace(/\/+$/,"")}/${n}`;return`${e}://file${o.startsWith("/")?"":"/"}${o.split("/").map(encodeURIComponent).join("/").replace(/%3A/g,":")}:${r}`}const wu=(...e)=>e.filter(Boolean).join(" "),ti=e=>{try{return localStorage.getItem(e)}catch{return null}},Nl=(e,t)=>{try{localStorage.setItem(e,t)}catch{}};function nC(){const[e,t]=$.useState(()=>{var n;return((n=Fc.find(r=>r.id===ti("illuminate-editor")))==null?void 0:n.id)??"vscode"});return[e,n=>{Nl("illuminate-editor",n),t(n)}]}function L0(e,t){const[n,r]=$.useState(void 0);return $.useEffect(()=>{let o=!0;return e().then(i=>o&&r(i),()=>o&&r(null)),()=>{o=!1}},t),n}const rC=(e,t)=>`${e}:${t}`;function oC({block:e,root:t,editor:n,before:r}){const o=$.useRef(null);$.useEffect(()=>{const u=o.current,c=u==null?void 0:u.querySelector(".code-line.cited");u&&c&&c.offsetTop-u.offsetTop+c.offsetHeight>u.clientHeight&&(u.scrollTop=Math.max(0,c.offsetTop-u.offsetTop-48))},[e.file,e.start,e.cited.join(",")]);const i=new Set(e.cited),s=new Map(e.notes.map(u=>[u.line,u.note])),l=e.cited[0]??e.start,a=Fc.find(u=>u.id===n).name;return f.jsxs("figure",{className:"code-block",children:[f.jsxs("figcaption",{className:"code-cap",children:[f.jsxs("span",{className:"code-where",children:[e.name&&f.jsx("strong",{className:"code-name",children:e.name}),f.jsxs("span",{className:"code-file",children:[e.file,!e.whole&&`:${e.start}`]})]}),!r&&f.jsxs("a",{className:"code-open",href:tC(n,t,e.file,l),title:`Open ${e.file} at line ${l} in ${a}`,children:["Open in ",a]})]}),f.jsx("div",{className:"code-lines",ref:o,tabIndex:0,"aria-label":`Code from ${e.file}`,children:f.jsx("div",{className:"code-inner",children:e.lines.map((u,c)=>{const d=e.start+c;return f.jsxs("div",{"data-at":rC(e.file,d),className:wu("code-line",i.has(d)&&"cited",s.has(d)&&"noted"),children:[f.jsx("span",{className:"code-n",children:d}),f.jsx("span",{className:"code-t",children:u||" "}),s.has(d)&&f.jsx("span",{className:"code-note",children:s.get(d)})]},d)})})})]})}function A0({view:e,jump:t,before:n=!1,what:r}){const[o,i]=nC(),s=$.useRef(null);return $.useEffect(()=>{var u;if(!t)return;const l=[...((u=s.current)==null?void 0:u.querySelectorAll(".code-line"))??[]].find(c=>c.dataset.at===t.at);if(!l)return;l.scrollIntoView({block:"center",behavior:"smooth"}),l.classList.add("flash");const a=setTimeout(()=>l.classList.remove("flash"),1200);return()=>clearTimeout(a)},[t==null?void 0:t.at,t==null?void 0:t.n,e]),f.jsxs("div",{className:"code-view",ref:s,children:[e.blocks.map(l=>f.jsx(oC,{block:l,root:e.root,editor:o,before:n},`${l.file}:${l.start}`)),e.missing>0&&f.jsxs("p",{className:"warn small code-missing",children:[e.missing===1?`1 ${r} isn’t`:`${e.missing} ${r}s aren’t`," in ",n?"that version of the code":"the code any more",", so ",e.missing===1?"it isn’t":"they aren’t"," shown."]}),!n&&e.blocks.length>0&&f.jsxs("label",{className:"code-editor",children:["Links open in"," ",f.jsx("select",{value:o,onChange:l=>i(l.target.value),"aria-label":"Which editor code links open in",children:Fc.map(l=>f.jsx("option",{value:l.id,children:l.name},l.id))})]})]})}function iC({mapId:e,itemId:t,change:n,since:r,stamp:o,jump:i}){const[s,l]=$.useState(n==="removed"?"before":"now"),a=L0(()=>_t.code(e,t,s),[e,t,s,o]),u=n==="changed"&&f.jsxs("div",{className:"seg code-when",role:"group","aria-label":"Which version of the code to show",children:[f.jsxs("button",{className:wu("seg-btn",s==="before"&&"on"),"aria-pressed":s==="before",onClick:()=>l("before"),children:["As it was at ",r]}),f.jsx("button",{className:wu("seg-btn",s==="now"&&"on"),"aria-pressed":s==="now",onClick:()=>l("now"),children:"Now"})]});return a===void 0?u||null:!a||!a.blocks.length&&!a.missing?u?f.jsxs(f.Fragment,{children:[u,f.jsx("p",{className:"muted small",children:"No code to show for that version."})]}):null:f.jsxs(f.Fragment,{children:[u,f.jsx(A0,{view:a,jump:i,before:s==="before",what:"cited line"})]})}function sC({mapId:e,answerId:t,stamp:n}){const r=L0(()=>_t.answerCode(e,t),[e,t,n]);return!r||!r.blocks.length&&!r.missing?null:f.jsx(A0,{view:r,what:"note"})}const lC=()=>R0("illuminate-code"),aC=()=>R0("illuminate-diff");function R0(e){const[t,n]=$.useState(()=>ti(e)==="show");return[t,r=>{Nl(e,r?"show":"hide"),n(r)}]}const jo=(...e)=>e.filter(Boolean).join(" "),dn=e=>`${Math.max(0,Math.min(1,e))*100}%`;function ku(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 D0({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,d=p=>c&&p.text.trim().toLowerCase()===r,h=t?u.elements.filter(d):u.elements;return f.jsxs("div",{className:jo("wf-region",c&&"wf-on"),children:[f.jsx("span",{className:"wf-label",children:u.label}),f.jsx("span",{className:"wf-els",children:h.map((p,y)=>f.jsx("span",{className:jo("sk",`sk-${p.kind}`,d(p)&&"sk-mark"),title:p.text,children:p.kind==="image"?`▧ ${p.text}`:p.text},y))})]},u.id)},i=u=>n(u).length?f.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 f.jsxs("div",{className:jo("wf",t&&"wf-small"),children:[i("top"),(s>0||n("main").length>0)&&f.jsxs("div",{className:"wf-mid",style:{gridTemplateColumns:l},children:[i("left"),i("main"),i("right")]}),i("bottom")]})}function O0({show:e,name:t}){var i;const[n,r]=$.useState(!1);if(e.kind==="capture"){const s=e.box,l=!!s&&!n,a=s?`${dn(s.x+s.w/2)} ${dn(s.y+s.h/2)}`:void 0;return f.jsxs("figure",{className:"screen",children:[f.jsx("div",{className:"screen-shot",style:{aspectRatio:`${e.width} / ${e.height}`},children:f.jsxs("div",{className:"screen-zoom",style:l?{transform:"scale(2.2)",transformOrigin:a}:void 0,children:[f.jsx("img",{src:Ys(e),alt:`The screen at “${t}”${e.title?`: ${e.title}`:""}`,loading:"lazy"}),s&&f.jsx("i",{className:"screen-mark","aria-hidden":"true",style:{left:dn(s.x),top:dn(s.y),width:dn(s.w),height:dn(s.h)}})]})}),f.jsxs("figcaption",{className:"muted small",children:["Screenshot of ",e.from,s&&f.jsxs(f.Fragment,{children:[" · ",f.jsx("button",{className:"linklike",onClick:()=>r(!n),children:n?"Zoom in":"Show the whole screen"})]})]})]})}if(e.kind==="wireframe")return f.jsxs("figure",{className:"screen",children:[f.jsx("div",{role:"img","aria-label":`Wireframe of ${e.page.name}, the page at “${t}”`,children:f.jsx(cC,{show:e})}),f.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 f.jsxs("figure",{className:"screen",children:[f.jsx("div",{className:"screen-image",children:f.jsx("img",{src:Ys(e),alt:`Image used at “${t}”`,loading:"lazy"})}),f.jsx("figcaption",{className:"muted small",children:e.file})]});const o=(i=e.highlight)==null?void 0:i.trim().toLowerCase();return f.jsxs("figure",{className:"screen",children:[f.jsx("div",{className:"screen-sketch",role:"img","aria-label":`Rough sketch of the screen at “${t}”`,children:e.elements.map((s,l)=>f.jsxs("span",{className:jo("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&&f.jsx("i",{className:"sk-new",children:"proposed"})]},l))}),f.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 uC({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 f.jsxs("div",{className:"thumb thumb-sketch",role:"img","aria-label":`Rough sketch of the screen at “${t}”`,children:[i.map((s,l)=>f.jsx("span",{className:jo("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&&f.jsxs("span",{className:"thumb-more",children:["+",e.elements.length-i.length," more"]})]})}if(e.kind==="wireframe")return f.jsx("div",{className:"thumb thumb-wire",role:"img","aria-label":`Wireframe of ${e.page.name}, the page at “${t}”`,children:f.jsx(D0,{show:e,small:!0})});if(e.kind==="image")return f.jsx("div",{className:"thumb thumb-image",children:f.jsx("img",{src:Ys(e),alt:`Image used at “${t}”`,loading:"lazy"})});const n=e.box;return f.jsx("div",{className:"thumb thumb-shot",children:f.jsx("img",{src:Ys(e),alt:`The screen at “${t}”`,loading:"lazy",style:n?{transform:"scale(1.8)",transformOrigin:`${dn(n.x+n.w/2)} ${dn(n.y+n.h/2)}`}:void 0})})}const dh=560;function cC({show:e}){const t=$.useRef(null),[n,r]=$.useState(1);return $.useLayoutEffect(()=>{const o=t.current;if(!o)return;const i=()=>r(Math.min(1,o.clientWidth/dh));i();const s=new ResizeObserver(i);return s.observe(o),()=>s.disconnect()},[]),f.jsx("div",{ref:t,className:"wf-fit",children:f.jsx("div",{className:"wf-fit-page",style:{width:dh,zoom:n},children:f.jsx(D0,{show:e})})})}const fh=/^\s*(```|~~~)/,dC=/^\s{0,3}#{1,6}\s+(.*?)\s*#*\s*$/,fC=/^\s*[-*+•]\s+(.*)$/,hC=/^\s*(\d{1,4})[.)]\s+(.*)$/;function pC(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(fh.test(s)){o();const d=[];for(i++;i<t.length&&!fh.test(t[i]);i++)d.push(t[i]);n.push({kind:"code",text:d.join(`
|
|
66
|
-
`)});continue}if(!s.trim()){o();continue}const l=dC.exec(s);if(l){o(),n.push({kind:"h",text:l[1]});continue}const a=fC.exec(s),u=a?null:hC.exec(s);if(a||u){o();const d=a?"ul":"ol",h=n[n.length-1],p=a?a[1]:u[2];h&&h.kind===d?h.items.push(p):n.push(d==="ul"?{kind:d,items:[p]}:{kind:d,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 mC=new RegExp("(`+)([^`]+?)\\1|\\*\\*(.+?)\\*\\*|__(.+?)__|\\*(?!\\s)(.+?)\\*|(?<![\\w])_(?!\\s)(.+?)_(?![\\w])|\\[([^\\]]+)\\]\\(([^)\\s]+)\\)","g");function Rn(e,t="i"){const n=[];let r=0,o=0;const i=s=>{s.split(`
|
|
67
|
-
`).forEach((l,a)=>{a>0&&n.push(f.jsx("br",{},`${t}-br${o++}`)),l&&n.push(l)})};for(const s of e.matchAll(mC)){i(e.slice(r,s.index));const l=`${t}-${o++}`;if(s[2]!==void 0)n.push(f.jsx("code",{children:s[2]},l));else if(s[3]!==void 0||s[4]!==void 0)n.push(f.jsx("strong",{children:Rn(s[3]??s[4],l)},l));else if(s[5]!==void 0||s[6]!==void 0)n.push(f.jsx("em",{children:Rn(s[5]??s[6],l)},l));else if(s[7]!==void 0){const a=s[8];n.push(/^https?:\/\//i.test(a)?f.jsx("a",{href:a,target:"_blank",rel:"noreferrer",children:Rn(s[7],l)},l):f.jsx("span",{children:Rn(s[7],l)},l))}r=s.index+s[0].length}return i(e.slice(r)),n}function ni({text:e,className:t}){const n=pC(e);return n.length?f.jsx("div",{className:t?`md ${t}`:"md",children:n.map((r,o)=>{const i=`b${o}`;if(r.kind==="p")return f.jsx("p",{children:Rn(r.text,i)},i);if(r.kind==="h")return f.jsx("p",{className:"md-h",children:Rn(r.text,i)},i);if(r.kind==="code")return f.jsx("pre",{children:f.jsx("code",{children:r.text})},i);const s=r.items.map((l,a)=>f.jsx("li",{children:Rn(l,`${i}-${a}`)},`${i}-${a}`));return r.kind==="ul"?f.jsx("ul",{children:s},i):f.jsx("ol",{start:r.start,children:s},i)})}):null}const gC=/^About the walkthrough step “([^”]*)”: /,yC=(e,t)=>`About the walkthrough step “${e}”: ${t}`;function vC(e){const t=gC.exec(e);return t?{question:e.slice(t[0].length),step:t[1]}:{question:e,step:null}}const ar=()=>({nodes:[],edges:[],absences:[]}),mo=e=>e.nodes.length+e.edges.length+e.absences.length,xC=e=>({mapId:e,phase:"loading",meta:null,map:null,report:null,job:null,error:null,answers:[],shown:null,selection:ar(),tour:null,peek:!1,views:[],viewIndex:-1,fixes:{},fresh:[],hidden:[],connected:!1,agent:z0}),wC=e=>e.views[e.viewIndex]??null;function yi(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 kC=e=>yi(e).flatMap(t=>t.ids);function F0(e){if(!e.map)return null;const t=new Set(yi(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 SC(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 NC(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?[]:H0(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 H0(e,t){return e.edges.filter(n=>t.has(n.from)&&t.has(n.to)).map(n=>n.id)}function hh(e,t){const n=[...t.moves.highlight,...t.added],r=e?[...new Set([...n,...H0(e,new Set(n))])]:n;return r.length||t.moves.focus?{focus:t.moves.focus??r[0]??null,highlight:r}:null}function sr(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 ph(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 EC(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:ph(r.answers,e.fixes,r.fixes??{}),agent:r.agent??e.agent}}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,peek:!1,fresh:r.answer.added,fixes:ph([r.answer],e.fixes,void 0)};return sr(i,hh(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 sr(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]}:{...ar(),[t.kind]:o&&mo(e.selection)===1?[]:[t.id]};return{...e,selection:i}}case"selectMany":return{...e,selection:t.selection};case"clearSelection":return{...e,selection:ar()};case"tour":{if(t.stop===null||!e.map)return{...e,tour:null,peek:!1};const r=Math.max(0,Math.min(t.stop,e.map.tour.length-1));return sr({...e,tour:r,selection:ar()},NC(e.map,r))}case"peek":{if(!t.open)return{...e,peek:!1};const r=e.answers[e.answers.length-1];return r?{...e,peek:!0,shown:e.shown??r.id}:e}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?sr({...e,tour:null,peek:!1,selection:{...ar(),[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 sr({...e,shown:t.answerId,tour:null,peek:!1},r?hh(e.map,r):null)}case"overview":return sr({...e,shown:null,tour:null,peek:!1,selection:ar(),fresh:[]},{focus:null,highlight:[]});case"layer":case"allLayers":{const r=t.type==="layer"?[t.answerId]:yi(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:SC(e.selection,F0(i))}}case"fixStatus":{const r=e.fixes[t.fixId];return r?{...e,fixes:{...e.fixes,[t.fixId]:{...r,status:t.status,problems:t.problems??r.problems}}}:e}case"error":return{...e,error:t.message}}}const Xr=(...e)=>e.filter(Boolean).join(" ");function et(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`${et(e,r.from)} → ${et(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 _C={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."}},CC={added:"New since",changed:"Changed since",removed:"Removed since"};function Su(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 Ke({eyebrow:e,title:t,children:n,tone:r,className:o}){return f.jsxs("section",{className:Xr("card",r&&`card-${r}`,o),children:[e&&f.jsx("div",{className:"eyebrow",children:e}),t&&f.jsx("h2",{className:"card-title",children:t}),n]})}function jC({map:e,ids:t,onPick:n}){return t.length?f.jsx("div",{className:"chips",children:t.map(({id:r,status:o})=>f.jsxs("button",{className:Xr("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:[f.jsx("span",{className:o==="confirmed"?"tick":o==="proposed"?"pmark":"qmark",children:o==="confirmed"?"✓":o==="proposed"?"+":"?"}),et(e,r)]},r))}):null}function mh({lines:e,working:t}){const n=e.slice(-8);return f.jsxs("ul",{className:"progress",children:[n.map((r,o)=>f.jsxs("li",{className:Xr(t&&o===n.length-1&&"running"),children:[f.jsx("span",{className:"ic",children:t&&o===n.length-1?"…":"✓"}),r]},`${o}-${r}`)),!n.length&&t&&f.jsxs("li",{className:"running",children:[f.jsx("span",{className:"ic",children:"…"}),"Starting"]})]})}function MC({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"?f.jsxs(Ke,{eyebrow:"Fix applied · re-checked",tone:"ok",children:[f.jsxs("ul",{className:"progress",children:[f.jsxs("li",{children:[f.jsx("span",{className:"ic",children:"✓"}),"Changed ",i.files.length," ",i.files.length===1?"file":"files",": ",i.files.map(l=>l.file).join(", ")]}),e.edgeId&&f.jsxs("li",{children:[f.jsx("span",{className:"ic",children:"✓"}),"New confirmed connection: ",et(o,e.edgeId)]}),e.closed.length>0&&f.jsxs("li",{children:[f.jsx("span",{className:"ic",children:"✓"}),"Closed: ",e.closed.length===1?"the missing connection":`${e.closed.length} missing connections`]})]}),e.undoable?f.jsx("div",{className:"btns",children:f.jsx("button",{className:"btn",onClick:r,children:"Undo this fix"})}):f.jsx("p",{className:"muted small",children:"Undo ended when illuminate stopped. Use git to reverse it."})]}):e.status==="rejected"||e.status==="undone"?f.jsxs(Ke,{eyebrow:e.status==="undone"?"Fix undone":"Fix rejected",children:[f.jsx(ni,{text:i.summary,className:"muted"}),e.status==="undone"&&f.jsx("div",{className:"btns",children:f.jsx("button",{className:"btn",onClick:t,children:"Apply it again"})})]}):f.jsxs(Ke,{eyebrow:`Proposed fix · ${i.files.length} ${i.files.length===1?"file":"files"} · nothing changed yet`,tone:"ai",children:[f.jsx(ni,{text:i.summary}),i.connects&&f.jsx("p",{className:"muted small",children:"The green dashed arrow is the connection it adds."}),f.jsx("pre",{className:"diff",children:i.diff.split(`
|
|
68
|
-
`).map((l,a)=>f.jsxs("span",{className:l.startsWith("+ ")?"add":l.startsWith("- ")?"del":l.includes(" · ")?"file":"",children:[l,`
|
|
69
|
-
`]},a))}),s.length>0?f.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&&f.jsx("ul",{className:"problems",children:e.problems.map(l=>f.jsx("li",{children:l},l))}),f.jsxs("div",{className:"btns",children:[f.jsx("button",{className:"btn primary",disabled:e.status==="applying",onClick:t,children:e.status==="applying"?"Applying…":"Approve"}),f.jsx("button",{className:"btn",onClick:n,children:"Reject"})]}),f.jsx("p",{className:"muted small",children:"Won't apply if these files change first."})]})}function $C({state:e,dispatch:t,onFix:n,onFocus:r,onOffer:o,composer:i}){const s=e.map,l=e.job,a=$.useRef(null);if($.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 f.jsx("aside",{className:"panel",children:f.jsx("div",{className:"panel-scroll",children:f.jsx(Ke,{children:f.jsx("p",{className:"muted",children:"Loading…"})})})});if(e.phase==="missing")return f.jsx("aside",{className:"panel",children:f.jsx("div",{className:"panel-scroll",children:f.jsx(Ke,{title:"No map here",children:f.jsx("p",{className:"muted",children:"This map isn't in this repo."})})})});if(!s)return f.jsx("aside",{className:"panel",children:f.jsxs("div",{className:"panel-scroll",children:[l&&f.jsx(Ke,{eyebrow:"Making your map",title:l.question,tone:"ai",children:f.jsx(mh,{lines:l.progress,working:!0})}),e.phase==="failed"&&f.jsx(Ke,{title:"The map couldn't be made",tone:"dead",children:f.jsx("p",{children:e.error})})]})});[...e.selection.nodes,...e.selection.edges,...e.selection.absences];const u=yi(e),c=u.length>0&&u.every(d=>!d.visible);return f.jsxs("aside",{className:"panel","aria-label":"Conversation about this map",children:[f.jsxs("header",{className:"panel-head",children:[f.jsx("h2",{className:"panel-title",children:"Conversation"}),u.length>0&&f.jsx("button",{className:"link-btn small",onClick:()=>t({type:"allLayers",visible:c}),children:c?"Show everything":"Show the original map"}),f.jsx("button",{className:"card-close","aria-label":"Close the conversation",title:"Close (Esc). It stays here to reopen.",onClick:()=>t(e.tour!==null?{type:"peek",open:!1}:{type:"overview"}),children:"×"})]}),f.jsxs("div",{className:"panel-scroll",ref:a,children:[e.error&&f.jsxs("div",{className:"banner banner-dead",role:"alert",children:[e.error,f.jsx("button",{className:"link-btn",onClick:()=>t({type:"error",message:null}),children:"Dismiss"})]}),e.answers.map(d=>f.jsx(bC,{answer:d,state:e,dispatch:t,onFix:n,onFocus:r,onOffer:o},d.id)),(l==null?void 0:l.kind)==="ask"&&f.jsxs("article",{className:"turn",children:[f.jsx(B0,{question:l.question}),f.jsx(Ke,{eyebrow:`${e.agent.name} is working`,tone:"ai",children:f.jsx(mh,{lines:l.progress,working:!0})})]}),!e.answers.length&&!l&&f.jsx("p",{className:"muted small thread-empty",children:"Ask anything about this map. Click a box or arrow first to ask about it."})]}),f.jsx("footer",{className:"panel-foot",children:i})]})}function B0({question:e,about:t}){const{question:n,step:r}=vC(e),o=[r&&`the step “${r}”`,t].filter(Boolean);return f.jsxs("div",{className:"you",children:[f.jsx("p",{className:"you-q",children:n}),o.length>0&&f.jsxs("span",{className:"you-about",children:["About ",o.join(", ")]})]})}function bC({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&&t.tour===null,u=[...e.selection.nodes??[],...e.selection.edges??[],...e.selection.absences??[]].map(x=>et(s,x)).join(", "),c=yi(t).find(x=>x.answerId===e.id),d=e.problems.filter(x=>x.startsWith("The proposed fix")),h=e.problems.filter(x=>!x.startsWith("The proposed fix")),p=e.refs.filter(x=>{var k;return x.status!=="unknown"&&((k=Su(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 f.jsxs("article",{className:"turn",children:[f.jsx(B0,{question:e.question,about:u||void 0}),e.offer?f.jsx(PC,{answer:e,busy:!!t.job,agentName:t.agent.name,onOffer:i}):f.jsxs("section",{className:Xr("card","reply",a&&"card-focus"),children:[f.jsxs("div",{className:"reply-meta",children:[f.jsx("span",{children:e.source==="map"?"From the map":"Looked in the code"}),y&&(a?f.jsx("span",{className:"reply-lit",children:"Lit on the map"}):f.jsx("button",{className:"link-btn small",onClick:()=>n({type:"show",answerId:e.id}),children:"Show on the map"}))]}),f.jsx(ni,{text:e.concept,className:"depth-text"}),(e.notes??[]).length>0&&f.jsx(sC,{mapId:t.mapId,answerId:e.id,stamp:t.report}),(e.screens??[]).map(x=>{const k=ku(t.report,x);return k?f.jsx(O0,{show:k,name:et(s,x)},x):null}),p.length>0&&f.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)=>f.jsxs("span",{children:[k>0&&", ",f.jsx("button",{className:"link-btn small",title:"Show it on the map",onClick:()=>o(x),children:et(s,x)})]},x))]}),c&&f.jsxs("div",{className:"reply-added",children:[f.jsxs("span",{children:["Added ",c.ids.length," to the map"]}),f.jsx("button",{className:"link-btn small",onClick:()=>n({type:"layer",answerId:e.id,visible:!c.visible}),children:c.visible?"Hide":"Show"})]}),h.length>0&&f.jsxs("details",{className:"problems-box",children:[f.jsxs("summary",{children:[h.length," thing",h.length===1?"":"s"," Claude found but couldn't confirm or show"]}),f.jsx("ul",{className:"problems",children:h.map(x=>f.jsx("li",{children:x},x))})]})]}),l&&f.jsx(MC,{fix:l,map:s,onApprove:()=>r(l.proposal.id,"approve"),onReject:()=>r(l.proposal.id,"reject"),onUndo:()=>r(l.proposal.id,"undo")}),d.length>0&&f.jsxs(Ke,{eyebrow:"The proposed fix can't be applied",tone:"dead",children:[f.jsx("ul",{className:"problems",children:d.map(x=>f.jsx("li",{children:x.replace("The proposed fix can't be applied: ","")},x))}),f.jsx("p",{className:"muted small",children:"Ask again, or ask for a smaller change."})]})]})}function PC({answer:e,busy:t,agentName:n,onOffer:r}){const o=e.offer;return o.status==="mapped"?f.jsxs(Ke,{eyebrow:"A different part of the app",children:[f.jsx("p",{className:"muted",children:"You made a new map for this."}),o.mapId&&f.jsx("div",{className:"btns",children:f.jsx("a",{className:"btn primary",href:Dt(o.mapId),children:"Open it"})})]}):o.status==="answered"?f.jsx(Ke,{eyebrow:"A different part of the app",children:f.jsx("p",{className:"muted",children:"Answered in words, below."})}):f.jsxs(Ke,{eyebrow:"A different part of the app",tone:"ai",children:[f.jsx("p",{children:"This is about a different part of the app than this map shows."}),o.existing&&f.jsxs("p",{children:["There's already a map for it: “",o.existing.question,"”."]}),f.jsxs("div",{className:"btns",children:[o.existing&&f.jsx("a",{className:"btn primary",href:Dt(o.existing.id),children:"Open that map"}),f.jsx("button",{className:o.existing?"btn":"btn primary",onClick:()=>r(e.id,"map"),children:"Make a new map for this"}),f.jsx("button",{className:"btn",disabled:t,onClick:()=>r(e.id,"words"),title:t?`${n} is still working on this map`:void 0,children:"Just answer in words"})]})]})}function IC({mapId:e,map:t,report:n,ids:r,onClose:o}){var I,O,F,U,B;const[i,s]=lC(),[l,a]=aC(),[u,c]=$.useState(null),d=f.jsx("button",{className:"card-close","aria-label":"Close",title:"Close (Esc)",onClick:o,children:"×"});if(r.length>1)return f.jsxs(Ke,{eyebrow:`Asking about ${r.length} things`,className:"card-selected",children:[d,f.jsx(jC,{map:t,ids:r.map(N=>{var T;return{id:N,status:((T=Su(n,N))==null?void 0:T.status)??"unknown"}}),onPick:()=>{}})]});const h=r[0],p=t.nodes.find(N=>N.id===h),y=t.edges.find(N=>N.id===h),x=t.absences.find(N=>N.id===h),k=Su(n,h),g=(p==null?void 0:p.evidence)??(y==null?void 0:y.evidence)??[],v=k&&"evidence"in k&&k.evidence?k.evidence:[],m=p?"Step":y?"Connection":"Missing connection",w=(k==null?void 0:k.proposal)??null,C=(O=(I=p??y)==null?void 0:I.proposed)==null?void 0:O.note,S=k&&"change"in k?k.change??null:null,_=((U=(F=n==null?void 0:n.since)==null?void 0:F.commit)==null?void 0:U.slice(0,7))??"the commit this map is compared with",j=x?(n==null?void 0:n.absences[x.id])??null:null;return f.jsxs(Ke,{eyebrow:m,title:et(t,h),tone:x?"dead":void 0,className:"card-selected",children:[d,((B=p==null?void 0:p.explain)==null?void 0:B.concept)&&f.jsx(ni,{text:p.explain.concept,className:"depth-text"}),p&&ku(n,p.id)&&f.jsx(O0,{show:ku(n,p.id),name:p.name}),w&&f.jsxs("div",{className:Xr("proposal-note",`proposal-note-${w.state}`),children:[f.jsx("strong",{children:_C[w.kind][w.state]}),C&&f.jsxs(f.Fragment,{children:[" ",C]})]}),S&&f.jsxs("div",{className:Xr("change-note",`change-note-${S.kind}`),children:[f.jsxs("div",{className:"change-head",children:[f.jsxs("span",{children:[f.jsxs("strong",{children:[CC[S.kind]," ",_,"."]}),S.kind==="changed"&&!S.diff&&" A line it cites wasn’t there then.",S.kind==="removed"&&" It was in the code then and is gone now.",S.diff&&f.jsx(TC,{diff:S.diff})]}),S.diff&&f.jsx("button",{className:"link-btn small",onClick:()=>a(!l),children:l?"Hide what changed":"Show what changed"})]}),S.diff&&l&&f.jsx("pre",{className:"diff",children:S.diff.map((N,T)=>f.jsxs("span",{className:N.startsWith("+ ")?"add":N.startsWith("- ")?"del":"",children:[N,`
|
|
70
|
-
`]},T))})]}),x&&j&&f.jsxs("p",{children:[j.found>x.matches?"This may no longer be missing: the search below now finds something.":"Nothing in the code connects these, going by this search."," ","Searched ",j.searched??"?"," ",j.searched===1?"file":"files",x.search.paths?f.jsxs(f.Fragment,{children:[" in ",f.jsx("code",{children:x.search.paths.join(", ")})]}):" (the whole repo)"," for ",f.jsx("code",{children:x.search.pattern}),": ",j.found," ",j.found===1?"match":"matches","."]}),k&&k.status==="unconfirmed"&&f.jsxs("div",{className:"warn small",children:["Couldn't confirm against the code: ",k.reasons.join("; ")]}),g.length>0&&f.jsxs("div",{className:"basis",children:[f.jsxs("div",{className:"code-toggle",children:[f.jsx("div",{className:"eyebrow",children:(S==null?void 0:S.kind)==="removed"?`In the code as it was at ${_}`:"In the code"}),f.jsx("button",{className:"link-btn small",onClick:()=>s(!i),children:i?"Hide the code":"Show the code"})]}),f.jsx("div",{className:"chips",children:g.map((N,T)=>{var b,M;const z=((b=v[T])==null?void 0:b.ok)??!1,D=((M=v[T])==null?void 0:M.foundAt)??N.line;return z?f.jsxs("button",{className:"chip cite",title:"Show this line in the code",onClick:()=>{s(!0),c(L=>({at:`${N.file}:${D}`,n:((L==null?void 0:L.n)??0)+1}))},children:[f.jsx("span",{className:"tick",children:"✓"}),N.file,":",D]},T):f.jsxs("span",{className:"chip static chip-unconfirmed",children:[f.jsx("span",{className:"qmark",children:"?"}),N.file,":",D]},T)})}),i&&(p||y)&&f.jsx(iC,{mapId:e,itemId:h,change:(S==null?void 0:S.kind)??null,since:_,stamp:n,jump:u})]})]})}function TC({diff:e}){const t=e.filter(r=>r.startsWith("+ ")).length,n=e.filter(r=>r.startsWith("- ")).length;return f.jsxs("span",{className:"diff-size",children:[t>0&&f.jsxs("span",{className:"add",children:[" +",t]}),n>0&&f.jsxs("span",{className:"del",children:[" −",n]})]})}function zC({map:e,selection:t,draft:n,busy:r,agentName:o="Claude",autoFocus:i,onDraft:s,onRemove:l,step:a,onRemoveStep:u,onSend:c}){const d=$.useRef(null),h=["nodes","edges","absences"].flatMap(p=>t[p].map(y=>({kind:p,id:y})));return $.useEffect(()=>{const p=d.current;p&&(p.style.height="auto",p.style.height=`${Math.min(p.scrollHeight,140)}px`)},[n]),$.useEffect(()=>{var p;n&&((p=d.current)==null||p.focus())},[n===""]),$.useEffect(()=>{var p;i&&((p=d.current)==null||p.focus({preventScroll:!0}))},[]),f.jsxs("form",{className:"composer",onSubmit:p=>{p.preventDefault(),!r&&n.trim()&&c()},children:[a&&f.jsxs("span",{className:"sel-chip sel-step",children:[f.jsxs("span",{className:"sel-text",title:`Walkthrough step: ${a}`,children:["▸ ",a]}),f.jsx("button",{type:"button","aria-label":`Don't ask about the step “${a}”`,onClick:u,children:"×"})]}),h.map(p=>f.jsxs("span",{className:`sel-chip sel-${p.kind}`,children:[f.jsxs("span",{className:"sel-text",title:et(e,p.id),children:[p.kind==="absences"?"✕ ":"◉ ",et(e,p.id)]}),f.jsx("button",{type:"button","aria-label":`Remove ${et(e,p.id)}`,onClick:()=>l(p.kind,p.id),children:"×"})]},`${p.kind}:${p.id}`)),f.jsx("textarea",{ref:d,id:"ask",rows:1,value:n,placeholder:r?`${o} is working…`:h.length?"Ask about what you selected…":a?"Ask about this step…":"Ask about this map…",onChange:p=>s(p.target.value),onKeyDown:p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),!r&&n.trim()&&c())},"aria-label":"Ask a question about the map"}),f.jsx("button",{type:"submit",className:"send",disabled:r||!n.trim(),"aria-label":"Send",children:"↑"})]})}function LC({map:e,agent:t,selection:n,step:r,onRemove:o}){const i=["nodes","edges","absences"].flatMap(l=>n[l].map(a=>({kind:l,id:a}))),s=q2(t,i.length,r);return f.jsxs("div",{className:"composer composer-chat",role:"note","aria-label":"Where to ask",children:[i.map(l=>f.jsxs("span",{className:`sel-chip sel-${l.kind}`,children:[f.jsxs("span",{className:"sel-text",title:et(e,l.id),children:[l.kind==="absences"?"✕ ":"◉ ",et(e,l.id)]}),f.jsx("button",{type:"button","aria-label":`Remove ${et(e,l.id)}`,onClick:()=>o(l.kind,l.id),children:"×"})]},`${l.kind}:${l.id}`)),f.jsxs("p",{className:"chat-hint",children:[f.jsx("strong",{children:s.title})," ",f.jsx("span",{className:"muted",children:s.detail})]})]})}const ha="illuminate-toured",AC=100;function gh(e){if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}}function RC(e,t,n=AC){return[...e.filter(r=>r!==t),t].slice(-n)}function DC(e,t){const[n,r]=$.useState(()=>gh(ti(ha)).includes(e));return $.useEffect(()=>{!t||n||!e||(Nl(ha,JSON.stringify(RC(gh(ti(ha)),e))),r(!0))},[e,t,n]),n}function OC({map:e,mapId:t,tour:n,onTour:r,selected:o,children:i}){const s=DC(t,n!==null),l=e.tour.length,a=l>0&&n===null;return!a&&!i?null:f.jsxs("div",{className:"dock",children:[a&&f.jsxs("section",{className:"dock-part dock-walk","aria-label":"Walkthrough",children:[f.jsx("h2",{className:"dock-title",children:"Walkthrough"}),f.jsxs("button",{className:s?"dock-start":"dock-start glow",onClick:()=>r(0),children:["Take the walkthrough ",f.jsxs("span",{className:"muted",children:[l," ",l===1?"stop":"stops"]})]})]}),i&&f.jsxs("section",{className:"dock-part dock-ask","aria-label":"Ask about the map",children:[f.jsxs("div",{className:"dock-head",children:[f.jsx("h2",{className:"dock-title",children:"Ask about the map"}),f.jsx("span",{className:"dock-hint",children:o?"Shift-click to add more":"Click a box or arrow to ask about it"})]}),i]})]})}function FC({state:e,dispatch:t}){const n=e.answers[e.answers.length-1];return n?f.jsx("div",{className:"history-corner",children:f.jsxs("button",{className:"pill-btn history-btn",onClick:()=>t(e.tour!==null?{type:"peek",open:!0}:{type:"show",answerId:n.id}),title:"Open the conversation about this map",children:[f.jsx("span",{className:"history-arrow",children:"‹"})," Conversation ",f.jsx("span",{className:"muted",children:e.answers.length})]})}):null}const lr=14,Ie=12;function HC(e,t){const n=l=>l[l.length-1],r=n(t.nodes),o=n(t.edges),i=n(t.absences),s=r!==void 0?`.react-flow__node[data-id="${CSS.escape(r)}"]`:o!==void 0?`.link-label[data-id="${CSS.escape(`e:${o}`)}"]`:i!==void 0?`.link-label[data-id="${CSS.escape(`a:${i}`)}"]`:null;return s?e.querySelector(s):null}const Nu="illuminate-bubble-size",V0=300,W0=180;function BC(){try{const e=JSON.parse(ti(Nu)??"null");if(e&&typeof e=="object"&&"w"in e&&"h"in e&&typeof e.w=="number"&&typeof e.h=="number")return{w:Math.max(V0,e.w),h:Math.max(W0,e.h)}}catch{}return null}function VC({mapId:e,map:t,report:n,selection:r,onClose:o}){const i=[...r.nodes,...r.edges,...r.absences],s=i.join(" "),l=$.useRef(null),[a,u]=$.useState(null),c=$.useRef(null),d=mi(),h=le(m=>m.transform.join(",")),[p,y]=$.useState(""),[x,k]=$.useState(BC),g=m=>{const w=l.current,C=w==null?void 0:w.querySelector(".card-selected"),S=w==null?void 0:w.parentElement;if(!w||!C||!S||!a)return;m.preventDefault();const _=m.clientX,j=m.clientY,I=w.offsetWidth,O=C.offsetHeight,F=S.clientWidth-2*Ie,U=a.side==="right"?1:-1;let B={w:I,h:O};const N=z=>{B={w:Math.round(Math.max(V0,Math.min(F,I+U*(z.clientX-_)))),h:Math.round(Math.max(W0,O+z.clientY-j))},k(B)},T=()=>{window.removeEventListener("pointermove",N),window.removeEventListener("pointerup",T),document.body.classList.remove("resizing-bubble"),Nl(Nu,JSON.stringify(B))};window.addEventListener("pointermove",N),window.addEventListener("pointerup",T),document.body.classList.add("resizing-bubble")},v=()=>{try{localStorage.removeItem(Nu)}catch{}k(null)};return $.useLayoutEffect(()=>{const m=l.current;if(!m)return;const w=new ResizeObserver(()=>y(`${m.offsetWidth}x${m.offsetHeight}`));return w.observe(m),()=>w.disconnect()},[s]),$.useLayoutEffect(()=>{const m=l.current,w=m==null?void 0:m.parentElement;if(!m||!w)return;const C=HC(w,r);if(!C){u(null);return}const S=w.getBoundingClientRect(),_=C.getBoundingClientRect(),j={left:_.left-S.left,right:_.right-S.left,top:_.top-S.top,bottom:_.bottom-S.top},I=w.querySelector(".dock"),O=I?I.getBoundingClientRect().top-S.top-Ie:S.height-Ie,F=Math.max(160,O-Ie),U=m.offsetWidth,B=Math.min(m.offsetHeight,F),N=S.width-Ie-j.right-lr,T=j.left-lr-Ie,z=N>=U||N>=T?"right":"left",D=z==="right"?j.right+lr:j.left-lr-U,b=Math.max(Ie,Math.min(D,S.width-Ie-U)),M=Math.max(Ie,Math.min(j.top,O-B)),L=Math.max(16,Math.min((j.top+j.bottom)/2-M,B-16));if(u({left:b,top:M,side:z,pointer:L,maxHeight:F}),c.current===s)return;c.current=s;const P=z==="right"?j.left:j.left-lr-U,H=z==="right"?j.right+lr+U:j.right,ee=H-P<=S.width-2*Ie,K=ee?P:j.left,Y=ee?H:j.right,V=K<Ie?Ie-K:Y>S.width-Ie?S.width-Ie-Y:0,X=j.top<Ie?Ie-j.top:j.bottom>O?Math.max(O-j.bottom,Ie-j.top):0;if(V||X){const E=d.getViewport();d.setViewport({...E,x:E.x+V,y:E.y+X},{duration:300})}},[s,h,p]),i.length?f.jsxs("div",{ref:l,className:`box-bubble box-bubble-${(a==null?void 0:a.side)??"right"}`,style:{...a?{left:a.left,top:a.top,"--bubble-max":`${a.maxHeight}px`}:{visibility:"hidden",left:0,top:0},...x?{width:x.w,"--bubble-cap":`${x.h}px`}:{}},role:"dialog","aria-label":"What you selected",children:[a&&f.jsx("i",{className:"box-bubble-pointer",style:{top:a.pointer},"aria-hidden":"true"}),f.jsx(IC,{mapId:e,map:t,report:n,ids:i,onClose:o},s),f.jsx("span",{className:"box-bubble-grip",onPointerDown:g,onDoubleClick:v,title:"Drag to resize. Double-click for the usual size.","aria-hidden":"true"})]}):null}const WC="modulepreload",UC=function(e){return"/"+e},yh={},YC=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=UC(a),a in yh)return;yh[a]=!0;const u=a.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":WC,u||(d.as="script"),d.crossOrigin="",d.href=a,l&&d.setAttribute("nonce",l),document.head.appendChild(d),u)return new Promise((h,p)=>{d.addEventListener("load",h),d.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)})},Vn=232,Dn=96,U0=e=>e.view==="journey"&&[...e.nodes,...e.edges].some(t=>!!t.branch);function Xs(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 XC=132;function Eu(e,t=!1){return e==="choice"?{w:196,h:132}:e==="action"?{w:196,h:60}:t?{w:232,h:64+XC}:{w:196,h:72}}let KC=null;const Hc=()=>KC??(KC=YC(()=>import("./elk.bundled-CUh_UDad.js").then(e=>e.e),[]).then(e=>new e.default)),Bc={"elk.algorithm":"layered","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.considerModelOrder.strategy":"NODES_AND_EDGES"};function El(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 St={top:52,side:26,bottom:26},ur=64,cs=44,GC=56,QC=140;async function Y0(e,t,n,r){const o=await e.layout({id:t,layoutOptions:{...Bc,"elk.direction":"DOWN","elk.padding":`[top=${St.top},left=${St.side},bottom=${St.bottom},right=${St.side}]`,"elk.layered.spacing.nodeNodeBetweenLayers":String(ur),"elk.spacing.nodeNode":String(cs)},children:n.map(s=>({id:s.id,width:Vn,height:Dn})),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:Vn,h:Dn};return{nodes:i,size:{w:o.width??Vn+2*St.side,h:o.height??Dn+St.top+St.bottom}}}function qC(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 ZC(e,t=[],n=new Set,r=new Set){var C;if(e.view==="journey")return U0(e)?tj(e,t,r):X0(e,t,r);const o=e.nodes.filter(S=>n.has(S.id));if(!o.length)return kh(e,t);const i=qC(e,n),s=new Set(i.nodes.map(S=>S.id)),l=await kh(i,t.filter(S=>s.has(S.from)&&s.has(S.to))),a=await Hc(),u=Object.fromEntries(Object.entries(l.areas).map(([S,_])=>[S,{..._}])),c={...l.nodes},d={},h={};for(const S of o)(h[C=S.area]??(h[C]=[])).push(S);for(const[S,_]of Object.entries(h)){const j=u[S];if(!j)continue;const I=Math.max(1,Math.floor((j.w-2*St.side+cs)/(Vn+cs))),O=Math.max(St.top-ur,...i.nodes.filter(U=>U.area===S).map(U=>{var B;return(((B=c[U.id])==null?void 0:B.y)??0)+Dn}))+ur;_.forEach((U,B)=>{c[U.id]={x:St.side+B%I*(Vn+cs),y:O+Math.floor(B/I)*(Dn+ur),w:Vn,h:Dn}});const F=Math.max(j.h,O+Math.ceil(_.length/I)*(Dn+ur)-ur+St.bottom);d[S]=F-j.h,j.h=F}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(j=>j!==S&&x[j]!==void 0).filter(j=>{const I=p[j];return I.y+I.h<=_.y+1&&I.x<_.x+_.w&&_.x<I.x+I.w}).map(j=>x[j]+(d[j]??0))),u[S].y+=x[S]}const k=El(e,t),g=new Map(e.nodes.map(S=>[S.id,S.area])),v=Math.max(0,...Object.values(u).map(S=>S.x+S.w))+QC;let m=0;for(const S of e.areas){if(u[S.id])continue;const _=e.nodes.filter(O=>O.area===S.id);if(!_.length)continue;const j=k.filter(O=>g.get(O.from)===S.id&&g.get(O.to)===S.id),I=await Y0(a,S.id,_,j);Object.assign(c,I.nodes),u[S.id]={x:v,y:m,w:I.size.w,h:I.size.h},m+=I.size.h+GC}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 vh=1900,_u=130;async function X0(e,t,n){const o=await(await Hc()).layout({id:"root",layoutOptions:{...Bc,"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:Eu(p.kind,n.has(p.id)).w,height:Eu(p.kind,n.has(p.id)).h})),edges:El(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<=vh)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/vh),u=Math.ceil(l.length/a);let c=0,d=0;const h=[];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,g=Math.min(...x.map(v=>i[v].y));h.push(c);for(const v of x)i[v]={...i[v],x:i[v].x-k,y:i[v].y-g+c};c=Math.max(...x.map(v=>i[v].y+i[v].h))+_u,d=Math.max(d,y[y.length-1].right-k)}return{areas:{},nodes:i,width:d,height:c-_u,flat:!0,rowTops:h}}const Ui=176,xh=120,wh=34,JC=14;function ej(e,t){const n=new Map(e.map(i=>[i,0]));for(const i of t)n.set(i.to,(n.get(i.to)??0)+1);const r=new Set(e),o=[];for(;r.size;){const i=e.find(s=>r.has(s)&&!n.get(s))??e.find(s=>r.has(s));r.delete(i),o.push(i);for(const s of t)s.from===i&&r.has(s.to)&&n.set(s.to,n.get(s.to)-1)}return o}async function tj(e,t,n){const r=El(e,t),o=new Map(e.nodes.map(E=>[E.id,Eu(E.kind,n.has(E.id))])),i=new Map(e.nodes.map(E=>[E.id,E.branch??null])),s=ej(e.nodes.map(E=>E.id),r),l=s.filter(E=>!i.get(E));if(!l.length)return X0(e,t,n);const a=E=>o.get(E).w,u=E=>o.get(E).h,c=new Map,d=new Map;let h=0;for(const E of l)c.set(E,h),d.set(E,0),h+=a(E)+Ui;const p=E=>c.get(E)+a(E)/2,y=E=>c.get(E)+a(E),x=[...new Set([...e.nodes,...e.edges].flatMap(E=>E.branch?[E.branch]:[]))],k=new Map;for(const E of s){const R=i.get(E);R&&k.set(R,[...k.get(R)??[],E])}const g=[],v=new Map,m=new Set(k.keys()),w=(E,R)=>{const q=k.get(E),Q=new Set(q),G=r.filter(ie=>Q.has(ie.to)&&!Q.has(ie.from));if(!R&&G.length&&!G.some(ie=>d.has(ie.from)))return null;const A=G.filter(ie=>d.has(ie.from)).map(ie=>ie.from).sort((ie,Ae)=>d.get(ie)-d.get(Ae)||p(ie)-p(Ae))[0]??null,W=A&&d.get(A)===0?l[l.indexOf(A)+1]:void 0,Z=q[0],te=A?W?(p(A)+p(W))/2:p(A)+(a(A)/2+Ui+a(Z)/2)/2:a(Z)/2,oe=[];let de=te-a(Z)/2;for(const ie of q)oe.push(de),de+=a(ie)+Ui;const me=r.filter(ie=>Q.has(ie.from)&&!Q.has(ie.to)&&d.has(ie.to)),ke=me.filter(ie=>p(ie.to)>=oe[0]).map(ie=>p(ie.to)),Me=me.filter(ie=>p(ie.to)<oe[0]).map(ie=>p(ie.to));return{name:E,ids:q,anchor:A,xs:oe,kind:Me.length?2:ke.length?0:1,reach:Math.max(0,...ke),span:[Math.min(A?p(A):oe[0],...Me)-30,Math.max(de-Ui,...ke)+30],verticals:[...A?[{x:p(A),from:d.get(A)}]:[],...me.map(ie=>({x:p(ie.to),from:d.get(ie.to)}))],minLane:A?d.get(A)+1:1,root:A?d.get(A)===0?l.indexOf(A):v.get(i.get(A))??l.length:l.length}};for(;m.size;){const R=[...m].flatMap(A=>w(A,!1)??[]).sort((A,W)=>(A.anchor?p(A.anchor):1/0)-(W.anchor?p(W.anchor):1/0)||A.kind-W.kind||A.reach-W.reach||x.indexOf(A.name)-x.indexOf(W.name))[0]??w(x.find(A=>m.has(A))??[...m][0],!0);m.delete(R.name);const q=A=>!g.some(W=>W.lane===A&&W.span[0]<R.span[1]&&R.span[0]<W.span[1]),Q=A=>R.verticals.every(W=>g.every(Z=>!(Z.lane>W.from&&Z.lane<A)||Z.boxes.every(te=>W.x<c.get(te)-12||W.x>y(te)+12)))&&g.every(W=>W.lane<=A||W.verticals.every(Z=>Z.from>=A||R.xs.every((te,oe)=>Z.x<te-12||Z.x>te+a(R.ids[oe])+12)));let G=R.minLane;for(;G<R.minLane+12&&!(q(G)&&Q(G));)G++;if(G>=R.minLane+12)for(G=R.minLane;!q(G);G++);R.ids.forEach((A,W)=>{c.set(A,R.xs[W]),d.set(A,G)}),g.push({name:R.name,lane:G,span:R.span,verticals:R.verticals,boxes:R.ids,root:R.root}),v.set(R.name,R.root)}const C=[...new Set([...d.values()])].sort((E,R)=>E-R),S=new Map,_=new Map;let j=0;for(const E of C){const R=Math.max(...[...d].filter(([,q])=>q===E).map(([q])=>u(q)));S.set(E,j),_.set(E,j+R),j+=R+xh}const I={};for(const E of e.nodes){const R=d.get(E.id);I[E.id]={x:c.get(E.id),y:S.get(R)+(_.get(R)-S.get(R)-u(E.id))/2,w:a(E.id),h:u(E.id)}}const O=new Map(e.nodes.map(E=>[E.id,E.kind])),F=(E,R,q)=>{const Q=I[E],G=O.get(E)==="choice"?Math.min(Q.h/2,Math.abs(R-(Q.x+Q.w/2))*Q.h/Q.w):0;return q==="top"?Q.y+G:Q.y+Q.h-G},U=E=>I[E].y+I[E].h/2,B=E=>d.get(E),N=E=>[...d].filter(([,R])=>R===E).map(([R])=>R).sort((R,q)=>c.get(R)-c.get(q)),T=new Map,z=new Map,D=(E,R,q,Q)=>z.set(`${E}:${R}`,[...z.get(`${E}:${R}`)??[],{link:q,key:Q}]);for(const E of r){const R=B(E.from),q=B(E.to);let Q;if(R===q){const G=N(R);Q=G.indexOf(E.to)===G.indexOf(E.from)+1?"straight":R===0?"arc":"under"}else q>R?Q="down":Q=p(E.to)>y(E.from)+24?"rejoin":p(E.to)<c.get(E.from)-24?"return":"up";T.set(E.id,Q),Q==="arc"&&(D(E.from,"t",E.id,[p(E.to)]),D(E.to,"t",E.id,[p(E.from)])),(Q==="rejoin"||Q==="up")&&D(E.to,"b",E.id,[0,R]),Q==="return"&&D(E.to,"b",E.id,[1,-R]),Q==="down"&&D(E.from,"b",E.id,[2,-q])}const b=new Map;for(const[E,R]of z){const q=E.slice(0,E.lastIndexOf(":"));R.sort((Q,G)=>Q.key.reduce((A,W,Z)=>A||W-(G.key[Z]??0),0)),R.forEach((Q,G)=>b.set(`${Q.link}:${E}`,p(q)+(G-(R.length-1)/2)*JC))}const M=(E,R,q)=>b.get(`${E}:${R}:${q}`)??p(R),L=r.filter(E=>T.get(E.id)==="arc").sort((E,R)=>Math.abs(p(E.to)-p(E.from))-Math.abs(p(R.to)-p(R.from))),P=new Map(L.map((E,R)=>[E.id,R])),H=new Map,ee={};for(const E of r){const R=I[E.from],q=I[E.to],Q=B(E.from),G=T.get(E.id);let A;if(G==="straight")A={points:[[R.x+R.w,U(E.from)],[q.x,U(E.to)]],label:0};else if(G==="arc"){const W=-58-18*P.get(E.id),Z=M(E.id,E.from,"t"),te=M(E.id,E.to,"t");A={points:[[Z,F(E.from,Z,"top")],[Z,W],[te,W],[te,F(E.to,te,"top")]],label:1}}else if(G==="under"||G==="return"){const W=H.get(Q)??0;H.set(Q,W+1);const Z=_.get(Q)+wh+16*W,te=p(E.from)+(G==="under"?6:0),oe=G==="return"?M(E.id,E.to,"b"):p(E.to)-6;A={points:[[te,R.y+R.h],[te,Z],[oe,Z],[oe,F(E.to,oe,"bottom")]],label:1}}else if(G==="down"){const W=M(E.id,E.from,"b"),Z=p(E.to),te=S.get(B(E.to))-wh;A=Math.abs(Z-W)<4?{points:[[W,F(E.from,W,"bottom")],[W,q.y]],label:0}:{points:[[W,F(E.from,W,"bottom")],[W,te],[Z,te],[Z,q.y]],label:1}}else if(G==="rejoin"){const W=M(E.id,E.to,"b"),Z=N(Q).some(oe=>oe!==E.from&&c.get(oe)<W&&y(oe)>R.x+R.w),te=S.get(Q)-xh/2;A=Z?{points:[[p(E.from),R.y],[p(E.from),te],[W,te],[W,F(E.to,W,"bottom")]],label:1}:{points:[[R.x+R.w,U(E.from)],[W,U(E.from)],[W,F(E.to,W,"bottom")]],label:W-(R.x+R.w)>=150?0:1}}else{const W=Math.min(Math.max(M(E.id,E.to,"b"),R.x+12),R.x+R.w-12);A={points:[[W,R.y],[W,F(E.to,W,"bottom")]],label:0}}ee[E.id]=A}const Y=x.map(E=>{var G;const R=g.find(A=>A.name===E);if(R)return{name:E,root:R.root};const q=(G=e.edges.find(A=>A.branch===E))==null?void 0:G.from,Q=q?i.get(q):null;return{name:E,root:q&&d.get(q)===0?l.indexOf(q):Q?v.get(Q)??l.length:l.length}}).sort((E,R)=>E.root-R.root||x.indexOf(E.name)-x.indexOf(R.name)).map(E=>E.name),V=Object.values(I),X=Object.values(ee).flatMap(E=>E.points);return{areas:{},nodes:I,width:Math.max(...V.map(E=>E.x+E.w),...X.map(E=>E[0])),height:Math.max(...V.map(E=>E.y+E.h),...X.map(E=>E[1])),flat:!0,routes:ee,branches:Y}}async function kh(e,t){const n=await Hc(),r=new Map(e.nodes.map(c=>[c.id,c.area])),o=El(e,t),i={},s={};for(const c of e.areas){const d=e.nodes.filter(y=>y.area===c.id);if(!d.length)continue;const h=o.filter(y=>r.get(y.from)===c.id&&r.get(y.to)===c.id),p=await Y0(n,c.id,d,h);Object.assign(i,p.nodes),s[c.id]=p.size}const l=new Map;for(const c of o){const d=r.get(c.from),h=r.get(c.to);d!==h&&s[d]&&s[h]&&l.set(`${d}>${h}`,{from:d,to:h})}const a=await n.layout({id:"root",layoutOptions:{...Bc,"elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"120","elk.spacing.nodeNode":"48","elk.spacing.componentComponent":"64"},children:e.areas.filter(c=>s[c.id]).map(c=>({id:c.id,width:s[c.id].w,height:s[c.id].h})),edges:[...l.values()].map((c,d)=>({id:`p${d}`,sources:[c.from],targets:[c.to]}))}),u={};for(const c of a.children??[])u[c.id]={x:c.x??0,y:c.y??0,w:c.width??0,h:c.height??0};return{areas:u,nodes:i,width:a.width??0,height:a.height??0}}function nj(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}},d=c(r).x-c(n).x,h=c(r).y-c(n).y;if(Math.abs(d)<40)return h>=0?["b","t"]:["t","b"];const p=Xs(t,r)-Xs(t,n);return p?p>0?["b","t"]:["r","b"]:d>=0?["r","l"]:["l","r"]}const o=c=>{var d;return((d=e.nodes.find(h=>h.id===c))==null?void 0:d.area)??""},i=c=>{const d=t.areas[o(c)],h=t.nodes[c];return d&&h?{x:d.x+h.x+h.w/2,y:d.y+h.y+h.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)<Vn*.75?u>=0?["b","t"]:["t","b"]:a>=0?["r","l"]:["l","r"]}function rj(e,t=[],n=[],r=[]){return JSON.stringify([e.view==="journey"?[e.nodes.map(o=>o.kind),[...r].sort(),...U0(e)?[[...e.nodes,...e.edges].map(o=>o.branch??"")]:[]]: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 nn=(...e)=>e.filter(Boolean).join(" "),Wn={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"}},_l=e=>e&&`proposal proposal-${e.kind} proposal-${e.state}`,Un={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"}},Cl=e=>e&&`change change-${e}`,Ks={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 oj(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 ij=[["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 sj({commit:e,when:t,onWhen:n}){return f.jsxs("div",{className:"change-key",children:[f.jsx("div",{className:"seg",role:"group","aria-label":"Which version of the code to show",children:ij.map(([r,o,i])=>f.jsx("button",{className:nn("seg-btn",t===r&&"on"),title:i,"aria-pressed":t===r,onClick:()=>n(r),children:o},r))}),f.jsx("span",{className:"change-key-title",children:t==="before"?`The code at ${e}`:t==="after"?"The code now":`Now, compared with ${e}`}),t==="both"&&f.jsxs("span",{className:"key-item",children:[f.jsx("i",{className:"key-swatch"}),"Same as before"]}),t==="both"&&f.jsxs("span",{className:"key-item",children:[f.jsx("i",{className:"key-swatch key-added"}),"Added"]}),f.jsxs("span",{className:"key-item",children:[f.jsx("i",{className:nn("key-swatch key-changed",t!=="both"&&"key-quiet")}),t==="before"?"Changes later":"Changed"]}),t==="both"&&f.jsxs("span",{className:"key-item",children:[f.jsx("i",{className:"key-swatch key-removed"}),"Removed (only in the before)"]}),t!=="both"&&f.jsxs("span",{className:"key-item",children:[f.jsx("i",{className:"key-swatch key-ghost"}),t==="before"?"Not there yet":"Gone"]})]})}const lj=5,jl=e=>e&&`branch branch-${e.colour}`;function aj({branches:e}){return f.jsxs("div",{className:"change-key branch-key",children:[f.jsx("span",{className:"change-key-title",children:"Ways through"}),f.jsxs("span",{className:"key-item",title:"What most people do, start to finish",children:[f.jsx("i",{className:"key-swatch"}),"Main path"]}),e.map(t=>f.jsxs("span",{className:"key-item",children:[f.jsx("i",{className:nn("key-swatch",jl(t))}),t.name]},t.name))]})}const Yi={entry:["Where it starts","▸"],store:["Saved data","▤"],external:["Outside the app","↗"],job:["Background job","◷"]},Sh=[["t",re.Top],["r",re.Right],["b",re.Bottom],["l",re.Left]];function K0(){return f.jsxs(f.Fragment,{children:[Sh.map(([e,t])=>f.jsx(Ur,{id:`s${e}`,type:"source",position:t,className:"handle",isConnectable:!1},`s${e}`)),Sh.map(([e,t])=>f.jsx(Ur,{id:`t${e}`,type:"target",position:t,className:"handle",isConnectable:!1},`t${e}`))]})}function uj({data:e}){var t,n,r;return e.journey?f.jsx(cj,{data:e}):f.jsxs("div",{className:nn("step","nopan",`kind-${e.kind}`,!e.confirmed&&"unconfirmed",_l(e.proposal),Cl(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:[f.jsx(K0,{}),(Yi[e.kind]||e.fresh||e.screen||e.proposal||e.change||e.ghost)&&f.jsxs("div",{className:"step-head",children:[e.ghost&&f.jsx("span",{className:"badge-ghost",title:Ks[e.ghost].title,children:Ks[e.ghost].label}),e.proposal&&f.jsx("span",{className:"badge-proposal",children:Wn[e.proposal.kind][e.proposal.state]}),e.change&&f.jsxs("span",{className:"badge-change",title:Un[e.change].title,children:[e.quiet==="before"?"Changes later":Un[e.change].label,e.changeSize&&!e.quiet&&f.jsxs("span",{className:"change-size",children:[" ",e.changeSize]})]}),Yi[e.kind]&&!e.proposal&&!e.change&&!e.ghost&&f.jsxs(f.Fragment,{children:[f.jsx("i",{className:"step-mark","aria-hidden":"true",children:Yi[e.kind][1]}),Yi[e.kind][0]]}),e.screen&&f.jsx("span",{className:"badge-screen",title:"Select this step to see the screen",children:"▣ Screen"}),e.fresh&&f.jsx("span",{className:"badge-new",children:"New"})]}),f.jsx("div",{className:"step-name",title:e.name,children:e.name}),f.jsxs("div",{className:"step-code",title:((t=e.proposal)==null?void 0:t.state)==="pending"?Wn[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"?f.jsx("span",{className:"pmark",children:"+"}):((r=e.proposal)==null?void 0:r.state)==="done"&&e.proposal.kind!=="add"?f.jsx("span",{className:"pmark",children:Wn[e.proposal.kind].mark}):e.change&&e.confirmed?f.jsx("span",{className:"cmark",children:Un[e.change].mark}):f.jsx("span",{className:e.confirmed?"tick":"qmark",children:e.confirmed?"✓":"?"}),f.jsx("span",{className:"step-sub",children:e.sub})]})]})}function cj({data:e}){const t=e.journey,n=e.proposal;return f.jsxs("div",{className:nn("step","jstep","nopan",`j-${t.shape}`,t.show&&"j-pictured",t.outside&&"j-outside",!e.confirmed&&"unconfirmed",_l(n),Cl(e.change),e.quiet&&"quiet",e.ghost&&"ghost",jl(t.branch),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:[f.jsx(K0,{}),t.stage&&f.jsx("div",{className:"j-stage",children:t.stage}),t.shape==="choice"&&f.jsx("svg",{className:"j-diamond",viewBox:"0 0 100 100",preserveAspectRatio:"none","aria-hidden":"true",children:f.jsx("polygon",{points:"50,1 99,50 50,99 1,50",vectorEffect:"non-scaling-stroke"})}),f.jsxs("div",{className:"j-tags",children:[n&&f.jsx("span",{className:"badge-proposal",children:Wn[n.kind][n.state]}),e.ghost&&f.jsx("span",{className:"badge-ghost",title:Ks[e.ghost].title,children:Ks[e.ghost].label}),e.change&&f.jsx("span",{className:"badge-change",title:Un[e.change].title,children:e.quiet==="before"?"Changes later":Un[e.change].label}),!e.confirmed&&f.jsx("span",{className:"j-q",title:"The checker couldn't confirm this against the code",children:"?"}),e.fresh&&f.jsx("span",{className:"badge-new",children:"New"})]}),t.show&&f.jsx(uC,{show:t.show,name:e.name}),f.jsx("div",{className:"j-name",title:e.name,children:e.name}),t.outside&&t.shape!=="choice"&&f.jsx("div",{className:"j-note",children:"Outside the app"})]})}function dj({data:e}){return f.jsx("div",{className:nn("area",e.dim&&"dim"),children:f.jsxs("div",{className:"area-label",children:[e.label,e.note&&f.jsxs("span",{className:"area-note",children:[" ",e.note]})]})})}function fj(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 Nh(e,t=18,n){let r=`M ${e[0][0]} ${e[0][1]}`;for(let a=1;a<e.length-1;a++){const[u,c]=e[a-1],[d,h]=e[a],[p,y]=e[a+1],x=Math.min(t,Math.hypot(d-u,h-c)/2),k=Math.min(t,Math.hypot(p-d,y-h)/2),g=Math.sign(d-u),v=Math.sign(h-c),m=Math.sign(p-d),w=Math.sign(y-h);r+=` L ${d-g*x} ${h-v*x} Q ${d} ${h} ${d+m*k} ${h+w*k}`}const o=e[e.length-1];r+=` L ${o[0]} ${o[1]}`;const[i,s]=n!==void 0?[e[n],e[n+1]]:[];if(i&&s)return[r,(i[0]+s[0])/2,(i[1]+s[1])/2];let l=[0,e[0][0],e[0][1]];for(let a=1;a<e.length;a++){const[u,c]=e[a-1],[d,h]=e[a];c===h&&Math.abs(d-u)>l[0]&&(l=[Math.abs(d-u),(u+d)/2,h])}return[r,l[1],l[2]]}function hj({id:e,sourceX:t,sourceY:n,targetX:r,targetY:o,sourcePosition:i,targetPosition:s,markerEnd:l,data:a}){const[u,c,d]=a!=null&&a.route?Nh(a.route.points,18,a.route.label):(a==null?void 0:a.wrapY)!==void 0&&i===re.Right?Nh([[t,n],[t+30,n],[t+30,a.wrapY],[r,a.wrapY],[r,o]]):(a==null?void 0:a.wrapY)!==void 0?Ws({sourceX:t,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:s,borderRadius:18,centerY:a.wrapY}):a!=null&&a.offset?fj(t,n,r,o,a.offset):Tc({sourceX:t,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:s});return a?f.jsxs(f.Fragment,{children:[a.selected&&f.jsx("path",{d:u,className:"edge-halo"}),f.jsx(gi,{id:e,path:u,markerEnd:l,interactionWidth:18}),f.jsx(k2,{children:f.jsxs("div",{className:nn("link-label",`link-${a.variant}`,!a.confirmed&&"unconfirmed",_l(a.proposal),Cl(a.change),a.ghost&&"ghost",jl(a.branch),a.hl&&"hl",a.dim&&"dim",a.selected&&"selected","nodrag nopan"),"data-id":e,style:{transform:`translate(-50%, -50%) translate(${c}px, ${d}px)`},onClick:h=>{var p;h.stopPropagation(),(p=a.onClick)==null||p.call(a,h.shiftKey||h.metaKey)},children:[a.variant==="absence"&&f.jsx("span",{className:"gap-q","aria-hidden":"true",children:"?"}),a.proposal&&f.jsx("span",{className:"pmark",title:a.proposal.state==="done"?Wn[a.proposal.kind].done:Wn[a.proposal.kind].title,children:a.proposal.state==="done"&&a.proposal.kind==="add"?"✓":Wn[a.proposal.kind].mark}),a.change&&f.jsx("span",{className:"cmark",title:Un[a.change].title,children:Un[a.change].mark}),f.jsx("span",{className:"link-text",children:a.label}),!a.confirmed&&a.variant==="edge"&&f.jsx("span",{className:"q",children:" ?"})]})})]}):null}const pj={step:uj,area:dj},mj={link:hj};function Eh(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 gj="440px",yj=e=>e.length>28?`${e.slice(0,26)}…`:e;function vj(e){var F,U,B,N,T,z,D,b,M,L;const t=(F=e.ghost)!=null&&F.connects&&e.map.nodes.some(P=>P.id===e.ghost.connects.from)&&e.map.nodes.some(P=>P.id===e.ghost.connects.to)?e.ghost:null,n=$.useMemo(()=>t!=null&&t.connects?[{id:t.id,from:t.connects.from,to:t.connects.to}]:[],[t]),r=$.useMemo(()=>e.map.view==="journey"?e.map.nodes.filter(P=>{var H,ee,K;return P.kind!=="action"&&P.kind!=="choice"&&((K=(ee=(H=e.report)==null?void 0:H.screens)==null?void 0:ee[P.id])==null?void 0:K.status)==="confirmed"}).map(P=>P.id):[],[e.map,e.report]),o=rj(e.map,n,e.added,r),[i,s]=$.useState(null),l=mi(),[a,u]=$.useState("both"),d=!!((B=(U=e.report)==null?void 0:U.since)!=null&&B.commit)?a:"both",h=P=>{var H,ee,K,Y,V,X;return((K=(ee=(H=e.report)==null?void 0:H.nodes[P])==null?void 0:ee.change)==null?void 0:K.kind)??((X=(V=(Y=e.report)==null?void 0:Y.edges[P])==null?void 0:V.change)==null?void 0:X.kind)??null},p=P=>d==="before"&&h(P)==="added"?"later":d==="after"&&h(P)==="removed"?"gone":null,y=P=>d==="both"||P==="changed"?P:null;$.useEffect(()=>{let P=!0;return ZC(e.map,n,new Set(e.added),new Set(r)).then(H=>P&&s({key:o,layout:H}),H=>console.error("illuminate: the map could not be laid out",H)),()=>{P=!1}},[o]);const x=(N=e.view)!=null&&N.highlight.length?new Set(e.view.highlight):null,k=$.useMemo(()=>x?new Set(Eh(e.map,[...x])):null,[x,e.map]),g=e.selection,v=$.useMemo(()=>((i==null?void 0:i.layout.branches)??[]).map((P,H)=>({name:P,colour:H%lj+1})),[i]),m=P=>P?v.find(H=>H.name===P)??null:null,w=(P,H,ee)=>{var V;if(!v.length||!ee)return null;if(P==="node")return m((V=e.map.nodes.find(X=>X.id===H))==null?void 0:V.branch);const K=e.map.edges.find(X=>X.id===H),Y=X=>{var E;return(E=e.map.nodes.find(R=>R.id===X))==null?void 0:E.branch};return m((K==null?void 0:K.branch)??Y(K==null?void 0:K.to)??Y(K==null?void 0:K.from))},C=$.useMemo(()=>{if(!i)return[];const P=i.layout,H=V=>!k||e.map.nodes.some(X=>X.area===V&&k.has(X.id)),ee=e.map.areas.flatMap(V=>{const X=P.areas[V.id];return X?[{id:`area:${V.id}`,type:"area",position:{x:X.x,y:X.y},style:{width:X.w,height:X.h},data:{label:V.label,note:null,dim:!H(V.id)},selectable:!1,draggable:!1,zIndex:0}]:[]}),K=new Map;if(P.flat){const V=X=>P.branches&&X.branch?1:0;for(const X of e.map.areas){const E=e.map.nodes.filter(R=>R.area===X.id&&P.nodes[R.id]).sort((R,q)=>V(R)-V(q)||P.nodes[R.id].x-P.nodes[q.id].x||P.nodes[R.id].y-P.nodes[q.id].y)[0];E&&K.set(E.id,X.label)}}const Y=e.map.nodes.flatMap(V=>{var q,Q,G,A,W,Z,te,oe,de,me,ke,Me,ie,Ae,tt,Pe,He,Be,ct;const X=P.nodes[V.id];if(!X)return[];const E=V.evidence[0],R=V.symbol?V.symbol.slice(V.symbol.indexOf("#")+1):E?`${E.file.split("/").pop()}:${E.line}`:"not in the code yet";return[{id:V.id,type:"step",...P.flat?{}:{parentId:`area:${V.area}`,extent:"parent"},position:{x:X.x,y:X.y},data:{name:V.name,sub:R,kind:V.kind,confirmed:!!e.report&&((q=e.report.nodes[V.id])==null?void 0:q.status)!=="unconfirmed",proposal:((G=(Q=e.report)==null?void 0:Q.nodes[V.id])==null?void 0:G.proposal)??null,screen:((Z=(W=(A=e.report)==null?void 0:A.screens)==null?void 0:W[V.id])==null?void 0:Z.status)==="confirmed",selected:g.nodes.includes(V.id),hl:!!(k!=null&&k.has(V.id)),dim:!!k&&!k.has(V.id)&&!g.nodes.includes(V.id),fresh:e.fresh.includes(V.id),change:y(((de=(oe=(te=e.report)==null?void 0:te.nodes[V.id])==null?void 0:oe.change)==null?void 0:de.kind)??null),changeSize:oj((Me=(ke=(me=e.report)==null?void 0:me.nodes[V.id])==null?void 0:ke.change)==null?void 0:Me.diff),ghost:p(V.id),quiet:d==="both"?null:d,...P.flat&&{journey:{w:X.w,h:X.h,shape:V.kind==="choice"?"choice":V.kind==="action"?"action":"screen",outside:V.kind==="external",stage:K.get(V.id)??null,show:r.includes(V.id)?((tt=(Ae=(ie=e.report)==null?void 0:ie.screens)==null?void 0:Ae[V.id])==null?void 0:tt.show)??null:null,branch:w("node",V.id,!!e.report&&((Pe=e.report.nodes[V.id])==null?void 0:Pe.status)!=="unconfirmed"&&!((He=e.report.nodes[V.id])!=null&&He.proposal)&&!y(((ct=(Be=e.report.nodes[V.id])==null?void 0:Be.change)==null?void 0:ct.kind)??null)&&!p(V.id))}},onClick:qr=>e.onSelect("nodes",V.id,qr)},draggable:!1,zIndex:1}]});return[...ee,...Y]},[i,e.map,e.report,g,k,e.fresh,e.onSelect,r,d,v]),S=$.useMemo(()=>{var R,q,Q,G;if(!i)return[];const P=A=>({type:qo.ArrowClosed,width:16,height:16,color:A}),H=A=>!!(x!=null&&x.has(A)),ee=(A,W)=>{const[Z,te]=nj(e.map,i.layout,A,W);return{sourceHandle:`s${Z}`,targetHandle:`t${te}`}},K=new Map,Y=(A,W)=>{const Z=i.layout.rowTops,te=Xs(i.layout,A),oe=Xs(i.layout,W);if(!Z||te===oe)return;const de=Math.max(te,oe),me=K.get(de)??0;return K.set(de,me+1),Z[de]-_u/2+(me%2?1:-1)*Math.ceil(me/2)*18},V=e.map.edges.map(A=>{var Me,ie,Ae,tt,Pe,He,Be;const W=!!e.report&&((Me=e.report.edges[A.id])==null?void 0:Me.status)!=="unconfirmed",Z=((Ae=(ie=e.report)==null?void 0:ie.edges[A.id])==null?void 0:Ae.proposal)??null,te=y(((He=(Pe=(tt=e.report)==null?void 0:tt.edges[A.id])==null?void 0:Pe.change)==null?void 0:He.kind)??null),oe=p(A.id)??p(A.from)??p(A.to),de=H(A.id)||!!k&&k.has(A.from)&&k.has(A.to)&&!x,me="edge",ke=w("edge",A.id,!Z&&!te&&!oe);return{id:`e:${A.id}`,source:A.from,target:A.to,...ee(A.from,A.to),type:"link",className:nn("link",`link-${me}`,!W&&"unconfirmed",_l(Z),Cl(te),oe&&"ghost",jl(ke),H(A.id)&&"hl",!!x&&!H(A.id)&&"dim",g.edges.includes(A.id)&&"selected"),markerEnd:P(oe?"var(--line)":(Z==null?void 0:Z.state)==="pending"&&Z.kind!=="remove"?"var(--ai)":te==="added"?"var(--ok)":te==="removed"?"var(--dead)":ke?`var(--branch-${ke.colour})`:H(A.id)?"var(--path)":"var(--line-strong)"),zIndex:2,data:{label:A.label,wrapY:Y(A.from,A.to),route:(Be=i.layout.routes)==null?void 0:Be[`e:${A.id}`],branch:ke,variant:me,proposal:Z,change:te,ghost:oe,confirmed:W,hl:de,dim:!!x&&!H(A.id)&&!g.edges.includes(A.id),selected:g.edges.includes(A.id),onClick:ct=>e.onSelect("edges",A.id,ct)}}}),X=A=>{var W;return((W=t==null?void 0:t.connects)==null?void 0:W.from)===A.from&&t.connects.to===A.to};for(const A of e.map.absences){if(!A.between||X(A.between))continue;const W=((q=(R=e.report)==null?void 0:R.absences[A.id])==null?void 0:q.status)==="confirmed";V.push({id:`a:${A.id}`,hidden:d==="before",source:A.between.from,target:A.between.to,...ee(A.between.from,A.between.to),type:"link",className:nn("link","link-absence",!W&&"unconfirmed",H(A.id)&&"hl",!!x&&!H(A.id)&&"dim",g.absences.includes(A.id)&&"selected"),markerEnd:P("var(--dead)"),zIndex:2,data:{label:yj(A.claim),route:(Q=i.layout.routes)==null?void 0:Q[`a:${A.id}`],variant:"absence",confirmed:W,hl:H(A.id),dim:!!x&&!H(A.id)&&!g.absences.includes(A.id),selected:g.absences.includes(A.id),onClick:Z=>e.onSelect("absences",A.id,Z)}})}t!=null&&t.connects&&V.push({id:`g:${t.id}`,source:t.connects.from,target:t.connects.to,...ee(t.connects.from,t.connects.to),type:"link",className:"link link-ghost",markerEnd:P("var(--ok)"),zIndex:3,data:{label:`+ ${t.connects.label}`,route:(G=i.layout.routes)==null?void 0:G[`x:${t.id}`],variant:"ghost",confirmed:!0,hl:!0,dim:!1,selected:!1}});const E=new Map;for(const A of V){const W=[A.source,A.target].sort().join("|");E.set(W,[...E.get(W)??[],A])}for(const A of E.values())A.length<2||A.some(W=>{var Z;return(Z=W.data)==null?void 0:Z.route})||A.forEach((W,Z)=>{W.data&&(W.data.offset=(Z-(A.length-1)/2)*44)});return V},[i,e.map,e.report,g,x,k,t,e.onSelect,d,v]),_=le(P=>P.width),j=$.useRef(0);$.useEffect(()=>{const P=j.current;if(j.current=_,!P||!_||P===_||e.touring)return;const H=l.getViewport();l.setViewport({...H,x:H.x+(_-P)/2})},[_]);const I=JSON.stringify([i==null?void 0:i.key,(T=e.view)==null?void 0:T.focus,(z=e.view)==null?void 0:z.highlight,e.touring,e.touring?_:null]),O=$.useRef(!0);return $.useEffect(()=>{if(!i)return;const P=e.view?Eh(e.map,e.view.highlight.length?e.view.highlight:e.view.focus?[e.view.focus]:[]):[];let H=0,ee=0;const K=()=>{var A;const Y=l.getNodes();if(H<2||!Y.length||!Y.every(W=>{var Z,te;return(te=(Z=l.getInternalNode(W.id))==null?void 0:Z.measured)==null?void 0:te.width})){H++<60&&(ee=requestAnimationFrame(K));return}const V=O.current?0:650;O.current=!1;const X=Object.values(i.layout.nodes),E=Object.values(i.layout.routes??{}).flatMap(W=>W.points),R=Math.max(0,Math.min(0,...X.map(W=>W.y))-Math.min(0,...E.map(W=>W[1]))),q=Math.max(0,Math.max(0,...E.map(W=>W[1]))-Math.max(0,...X.map(W=>W.y+W.h))+(E.length?16:0)),Q=(A=i.layout.branches)!=null&&A.length?56:0,G=P.length?{top:`${60+Q}px`,left:e.touring?gj:"60px",right:"60px",bottom:"150px"}:{top:`${64+R+Q}px`,left:"32px",right:"32px",bottom:`${130+q}px`};l.fitView(P.length?{nodes:P.map(W=>({id:W})),duration:V,padding:G,maxZoom:1.15}:{duration:V,padding:G,maxZoom:1.1})};return ee=requestAnimationFrame(K),()=>cancelAnimationFrame(ee)},[I]),f.jsxs(x2,{className:i!=null&&i.layout.flat?"journey":void 0,nodes:C,edges:S,nodeTypes:pj,edgeTypes:mj,onNodeClick:()=>{},onEdgeClick:(P,H)=>{H.id.startsWith("e:")&&e.onSelect("edges",H.id.slice(2),P.shiftKey||P.metaKey),H.id.startsWith("a:")&&e.onSelect("absences",H.id.slice(2),P.shiftKey||P.metaKey)},onPaneClick:e.onClear,panOnDrag:!0,elementsSelectable:!1,nodesDraggable:!1,nodesConnectable:!1,minZoom:.15,maxZoom:2,children:[f.jsx(C2,{variant:Qt.Dots,gap:22,size:1.3}),(((b=(D=e.report)==null?void 0:D.since)==null?void 0:b.commit)||v.length>0)&&f.jsx(pi,{position:"top-left",children:f.jsxs("div",{className:"map-keys",children:[((L=(M=e.report)==null?void 0:M.since)==null?void 0:L.commit)&&f.jsx(sj,{commit:e.report.since.commit.slice(0,7),when:d,onWhen:u}),v.length>0&&f.jsx(aj,{branches:v})]})})]})}function Ml(e){e!==`${location.pathname}${location.search}`&&(history.pushState(null,"",e),window.dispatchEvent(new PopStateEvent("popstate")))}function xj(){const[e,t]=$.useState(location.pathname);return $.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(),Ml(`${i.pathname}${i.search}`))};return window.addEventListener("popstate",n),document.addEventListener("click",r),()=>{window.removeEventListener("popstate",n),document.removeEventListener("click",r)}},[]),e}const wj=8e3;function G0({busy:e,agentName:t="Claude",onStopped:n,onError:r}){const[o,i]=$.useState(!1);return $.useEffect(()=>{if(!o)return;const s=setTimeout(()=>i(!1),wj),l=a=>{a.key==="Escape"&&i(!1)};return window.addEventListener("keydown",l),()=>{clearTimeout(s),window.removeEventListener("keydown",l)}},[o]),o&&!e?f.jsxs("span",{className:"stop-ask",role:"group","aria-label":"Stop illuminate?",children:[f.jsx("span",{className:"stop-ask-text",children:"Stop illuminate? Maps stay saved."}),f.jsx("button",{className:"pill-btn stop-yes",autoFocus:!0,onClick:()=>{i(!1),_t.stop().then(n,s=>r(s.message))},children:"Stop"}),f.jsx("button",{className:"pill-btn",onClick:()=>i(!1),children:"Keep running"})]}):f.jsx("button",{className:"pill-btn",disabled:e,title:e?`${t} is still working`:"Maps stay saved. Undo for applied fixes ends.",onClick:()=>i(!0),children:"Stop illuminate"})}function kj(){return f.jsxs("main",{className:"home",children:[f.jsx("h1",{children:"illuminate has stopped"}),f.jsx("p",{className:"muted lede",children:"You can close this tab."}),f.jsxs("p",{className:"muted lede",children:["Maps are saved in ",f.jsx("code",{children:".illuminate/maps"}),". Run ",f.jsx("code",{children:"illume open"})," in the repo to see them again."]})]})}function Sj({onStopped:e}){const[t,n]=$.useState(""),[r,o]=$.useState(null),[i,s]=$.useState([]),[l,a]=$.useState(""),[u,c]=$.useState(null),[d,h]=$.useState(!1),[p,y]=$.useState(z0);$.useEffect(()=>T0(()=>{},()=>{},e),[e]),$.useEffect(()=>{_t.list().then(k=>{n(k.repo),o(k.maps),s(k.making),k.agent&&y(k.agent)},k=>c(k.message))},[]);const x=async()=>{if(l.trim()){h(!0);try{const{id:k}=await _t.make(l.trim());Ml(Dt(k))}catch(k){c(k.message),h(!1)}}};return f.jsxs("main",{className:"home",children:[f.jsxs("div",{className:"home-brand",children:[f.jsx("i",{className:"brand-mark","aria-hidden":"true"}),"illuminate",t&&f.jsx("span",{className:"muted",children:t})]}),f.jsx("h1",{children:"Ask how your code works"}),f.jsx("p",{className:"muted lede",children:"Every box and arrow is checked against the code."}),Sl(p)?f.jsxs("p",{className:"home-ask chat-hint",children:[f.jsxs("strong",{children:["Ask for a new map in the ",p.name," chat beside this page"]})," ",f.jsx("span",{className:"muted",children:"for example: “Map what happens when a user signs up.”"})]}):f.jsxs("form",{className:"home-ask",onSubmit:k=>{k.preventDefault(),x()},children:[f.jsx("input",{id:"question",value:l,onChange:k=>a(k.target.value),placeholder:"What happens when a user signs up?","aria-label":"Your question",autoFocus:!0}),f.jsx("button",{className:"btn primary",disabled:d||!l.trim(),children:d?"Starting…":"Map it"})]}),u&&f.jsx("div",{className:"banner banner-dead",role:"alert",children:u}),i.length>0&&f.jsxs("section",{children:[f.jsx("h2",{className:"section-title",children:"Being made now"}),f.jsx("ul",{className:"maplist",children:i.map(k=>f.jsxs("li",{children:[f.jsx("a",{href:Dt(k.id),children:k.question}),f.jsxs("span",{className:"muted small",children:[p.name," is exploring…"]})]},k.id))})]}),f.jsxs("section",{children:[f.jsx("h2",{className:"section-title",children:"Maps in this repo"}),r===null?f.jsx("p",{className:"muted",children:"Loading…"}):r.length===0?f.jsx("p",{className:"muted",children:"None yet."}):f.jsx("ul",{className:"maplist",children:r.map(k=>f.jsxs("li",{children:[f.jsx("a",{href:Dt(k.id),children:k.question}),f.jsxs("span",{className:"muted small",children:[new Date(k.updatedAt).toLocaleString(),k.commit?` · ${k.commit.slice(0,7)}`:""]})]},k.id))})]}),f.jsx("footer",{className:"home-foot",children:f.jsx(G0,{busy:i.length>0,agentName:p.name,onStopped:e,onError:c})})]})}const _h="illuminate-panel-width",Cu=300,Q0=400,Nj=360,pa=e=>Math.round(Math.max(Cu,Math.min(e,Math.max(Cu,window.innerWidth-Nj))));function Ej(){const[e,t]=$.useState(()=>{const r=Number(localStorage.getItem(_h));return pa(r>0?r:Q0)}),n=$.useCallback(r=>{const o=pa(r);t(o),localStorage.setItem(_h,String(o))},[]);return $.useEffect(()=>{const r=()=>t(o=>pa(o));return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),[e,n]}function _j({width:e,onWidth:t}){return f.jsx("div",{className:"panel-handle",role:"separator","aria-orientation":"vertical","aria-label":"Panel width","aria-valuenow":e,"aria-valuemin":Cu,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(Q0),onKeyDown:n=>{n.key==="ArrowLeft"&&(n.preventDefault(),t(e+24)),n.key==="ArrowRight"&&(n.preventDefault(),t(e-24))}})}const Cj=(...e)=>e.filter(Boolean).join(" ");function jj({map:e,stop:t,onTour:n,onAsk:r}){var s;const o=e.tour[t];if(!o)return null;const i=t===e.tour.length-1;return f.jsxs("section",{className:"card card-focus tour-bubble","aria-label":"Walkthrough","aria-live":"polite",children:[f.jsx("button",{className:"card-close","aria-label":"Leave the walkthrough",title:"Leave the walkthrough (Esc)",onClick:()=>n(null),children:"×"}),f.jsxs("div",{className:"tour-head",children:[f.jsxs("span",{className:"eyebrow",children:["Walkthrough, stop ",t+1," of ",e.tour.length]}),f.jsx("span",{className:"dots","aria-hidden":"true",children:e.tour.map((l,a)=>f.jsx("i",{className:Cj(a===t&&"on",a<t&&"done")},l.id))})]}),f.jsx("h2",{className:"card-title",children:o.title}),f.jsx(ni,{text:o.text,className:"depth-text"}),(s=o.terms)!=null&&s.length?f.jsxs("p",{className:"muted small",children:["Terms: ",o.terms.join(", ")]}):null,f.jsxs("div",{className:"tour-nav",children:[f.jsx("button",{className:"btn",disabled:t===0,onClick:()=>n(t-1),children:"‹ Back"}),r&&f.jsx("button",{className:"btn",onClick:r,children:"Ask about this step"}),f.jsx("span",{className:"grow"}),i?f.jsx("button",{className:"btn primary",onClick:()=>n(null),children:"Done"}):f.jsx("button",{className:"btn primary",onClick:()=>n(t+1),children:"Next ›"})]}),f.jsx("div",{className:"kbd",children:"← → to step, Esc to leave"})]})}function Mj(){return Yr?f.jsx($j,{}):f.jsxs("main",{className:"home",children:[f.jsx("h1",{children:"Open illuminate from its link"}),f.jsxs("p",{className:"muted lede",children:["Use the link illuminate printed in your terminal (it ends in ",f.jsx("code",{children:"?t=…"}),")."]})]})}function $j(){const[e,t]=$.useState(!1),n=$.useCallback(()=>{window.close(),t(!0)},[]),r=xj();if(e)return f.jsx(kj,{});const o=/^\/m\/([a-z0-9-]{1,80})\/?$/.exec(r);return o?f.jsx(Tj,{mapId:o[1],onStopped:n},o[1]):f.jsx(Sj,{onStopped:n})}function bj({mapId:e,question:t,making:n}){const[r,o]=$.useState([]);$.useEffect(()=>{_t.list().then(s=>o([...s.making.map(l=>({...l,making:!0})),...s.maps.map(l=>({id:l.id,question:l.question}))]),()=>{})},[e,n]);const i=r.some(s=>s.id===e)?r:[{id:e,question:t},...r];return f.jsx("select",{className:"switcher",value:e,onChange:s=>Ml(Dt(s.target.value)),"aria-label":"Switch to another map",title:"Switch to another map in this repo",children:i.map(s=>f.jsxs("option",{value:s.id,children:[s.question||s.id,s.making?" (being made)":""]},s.id))})}function Pj({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?f.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=f.jsxs(f.Fragment,{children:[i,f.jsx(Ij,{report:e})]});return t?f.jsxs(f.Fragment,{children:[f.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]}):f.jsxs(f.Fragment,{children:[f.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 Ij({report:e}){const t=e.since;if(!t)return null;if(!t.commit)return f.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 f.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 Tj({mapId:e,onStopped:t}){var D,b,M,L,P,H,ee,K;const[n,r]=$.useReducer(EC,e,xC),[o,i]=$.useState(""),[s,l]=Ej(),a=$.useRef(!1),u=$.useCallback(()=>{_t.get(e).then(Y=>r({type:"loaded",payload:Y}),Y=>r(Y instanceof I0&&/No such map/.test(Y.message)?{type:"missing"}:{type:"error",message:Y.message}))},[e]);$.useEffect(u,[u]),$.useEffect(()=>T0(Y=>r({type:"event",event:Y}),Y=>{r({type:"connected",value:Y}),Y&&a.current===!1&&n.phase!=="loading"&&u(),a.current=Y},t,e),[]);const c=n.map&&n.tour!==null?((D=n.map.tour[n.tour])==null?void 0:D.title)??null:null;$.useEffect(()=>{const Y=n.phase==="ready"?Z2(n.agent,n.selection,c):null;if(!Y)return;const V=setTimeout(()=>void _t.selection(e,Y.selection,Y.step).catch(()=>{}),250);return()=>clearTimeout(V)},[e,n.phase,n.agent,n.selection,c]);const d=Sl(n.agent),[h,p]=$.useState(null);$.useEffect(()=>p(null),[n.tour]);const y=n.map&&n.tour!==null&&h===n.tour?((b=n.map.tour[n.tour])==null?void 0:b.title)??null:null,x=$.useCallback(Y=>{const V=Y.trim();if(!V||n.job)return;const X=y?yC(y,V):V;_t.ask(e,X,n.selection).then(()=>i(""),E=>r({type:"error",message:E.message}))},[e,n.job,n.selection,y]),k=(Y,V)=>{V==="approve"&&r({type:"fixStatus",fixId:Y,status:"applying",problems:[]}),_t[V](e,Y).catch(X=>{r(V==="approve"?{type:"fixStatus",fixId:Y,status:"failed",problems:X.problems.length?X.problems:[X.message]}:{type:"error",message:[X.message,...X.problems].join(" ")})})},g=(Y,V)=>{_t.offer(e,Y,V).then(X=>{X.id&&Ml(Dt(X.id))},X=>r({type:"error",message:X.message}))};$.useEffect(()=>{const Y=V=>{const X=V.target instanceof HTMLTextAreaElement||V.target instanceof HTMLInputElement;if(V.key==="Escape"){mo(n.selection)?r({type:"clearSelection"}):n.tour!==null&&n.peek?r({type:"peek",open:!1}):n.tour!==null?r({type:"tour",stop:null}):r({type:"overview"});return}X||n.tour===null||(V.key==="ArrowRight"&&r({type:"tour",stop:n.tour+1}),V.key==="ArrowLeft"&&r({type:"tour",stop:n.tour-1}))};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[n.tour,n.peek,n.selection]);const v=n.answers.find(Y=>Y.id===n.shown),m=v!=null&&v.fix&&["proposed","applying","failed"].includes(((M=n.fixes[v.fix.id])==null?void 0:M.status)??"")?v.fix:null,w=$.useCallback((Y,V,X)=>r({type:"select",kind:Y,id:V,additive:X}),[]),C=$.useCallback(()=>r({type:"clearSelection"}),[]),S=F0(n),_=kC(n),j=wC(n),I=!!n.map&&n.tour!==null,O=$.useMemo(()=>({...n,answers:eC(n.agent,n.answers,n.fixes)}),[n]),F=n.shown!==null&&O.answers.some(Y=>Y.id===n.shown),U=((L=n.job)==null?void 0:L.kind)==="ask"&&!d,N=(!n.map||!!n.error||!!n.job&&(n.job.kind==="make"||U)||F)&&(!I||n.peek||!!n.error||U),T=N&&!!n.map,z=n.map&&d?f.jsx(LC,{map:n.map,agent:n.agent,selection:n.selection,step:c,onRemove:(Y,V)=>r({type:"select",kind:Y,id:V,additive:!0})}):n.map?f.jsx(zC,{map:n.map,selection:n.selection,draft:o,busy:!!n.job,agentName:n.agent.name,autoFocus:T,onDraft:i,onRemove:(Y,V)=>r({type:"select",kind:Y,id:V,additive:!0}),step:y,onRemoveStep:()=>p(null),onSend:()=>x(o)}):null;return f.jsx(M0,{children:f.jsxs("div",{className:"app",children:[f.jsxs("header",{className:"topbar",children:[f.jsxs("a",{className:"brand",href:Dt(),title:"All maps in this repo",children:[f.jsx("i",{className:"brand-mark","aria-hidden":"true"}),"illuminate"]}),f.jsxs("div",{className:"topbar-map",children:[((P=n.meta)==null?void 0:P.parent)&&f.jsxs("a",{className:"crumb",href:Dt(n.meta.parent.mapId),title:`Back to the map this one came from: ${n.meta.parent.question}`,children:["← ",n.meta.parent.question]}),f.jsx(bj,{mapId:e,question:((H=n.map)==null?void 0:H.question)??((ee=n.job)==null?void 0:ee.question)??"",making:((K=n.job)==null?void 0:K.kind)==="make"})]}),f.jsx(Pj,{report:n.report}),f.jsx("a",{className:"pill-btn",href:Dt(),title:"Ask a new question and make a map for it",children:"New map"}),f.jsx(G0,{busy:!!n.job,agentName:n.agent.name,onStopped:t,onError:Y=>r({type:"error",message:Y})}),f.jsx("span",{className:n.connected?"live on":"live",title:n.connected?"Connected to illuminate":"Reconnecting to illuminate…"})]}),f.jsxs("div",{className:N?"body":"body full",style:{"--panel-w":`${s}px`},children:[f.jsx("div",{className:"canvas",children:n.map&&S?f.jsxs(f.Fragment,{children:[f.jsx(vj,{map:S,report:n.report,selection:n.selection,view:j,fresh:n.fresh,added:_,ghost:m??null,touring:I,onSelect:w,onClear:C}),!N&&f.jsx(FC,{state:O,dispatch:r}),mo(n.selection)>0&&f.jsx(VC,{mapId:e,map:S,report:n.report,selection:n.selection,onClose:C}),I&&mo(n.selection)===0&&f.jsx(jj,{map:n.map,stop:n.tour,onTour:Y=>r({type:"tour",stop:Y}),onAsk:d?void 0:()=>{var Y;p(n.tour),(Y=document.getElementById("ask"))==null||Y.focus()}}),f.jsx(OC,{map:n.map,mapId:e,tour:n.tour,onTour:Y=>r({type:"tour",stop:Y}),selected:mo(n.selection),children:T?null:z})]}):f.jsx("div",{className:"empty",children:n.phase==="making"?f.jsxs("div",{className:"pulse",children:[n.agent.name," is exploring the code…"]}):null})}),N&&f.jsx(_j,{width:s,onWidth:l}),N&&f.jsx($C,{state:O,dispatch:r,onFix:k,onFocus:Y=>r({type:"focus",id:Y}),onOffer:g,composer:T?z:null})]})]})})}Fm(document.getElementById("root")).render(f.jsx($.StrictMode,{children:f.jsx(Mj,{})}));export{zj as c,Ch as g};
|
|
71
|
-
//# sourceMappingURL=index-Booj4TYt.js.map
|