@api-doc-tor/express 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chat-proxy.d.ts +12 -0
- package/dist/chat-proxy.d.ts.map +1 -0
- package/dist/chat-proxy.js +44 -0
- package/dist/chat-proxy.js.map +1 -0
- package/dist/docs-access-express.d.ts +16 -0
- package/dist/docs-access-express.d.ts.map +1 -0
- package/dist/docs-access-express.js +187 -0
- package/dist/docs-access-express.js.map +1 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +134 -0
- package/dist/index.js.map +1 -0
- package/package.json +36 -0
- package/static/assets/index-2Nv3pxOm.css +1 -0
- package/static/assets/index-6tehJlKh.js +214 -0
- package/static/assets/index-B148KlKZ.js +247 -0
- package/static/assets/index-B7AxOqhh.js +247 -0
- package/static/assets/index-BAVM9zLs.css +1 -0
- package/static/assets/index-BD4qyClR.js +216 -0
- package/static/assets/index-BZaQe_xi.css +1 -0
- package/static/assets/index-BjWlpH_h.js +216 -0
- package/static/assets/index-BmiFV0rx.css +1 -0
- package/static/assets/index-BqIvYIJT.js +247 -0
- package/static/assets/index-BwOiuEB4.js +216 -0
- package/static/assets/index-C372jkHK.js +214 -0
- package/static/assets/index-C9S9wEor.js +217 -0
- package/static/assets/index-Cd9PPQz6.css +1 -0
- package/static/assets/index-Cf2mt1FM.css +1 -0
- package/static/assets/index-Cfn42GaL.css +1 -0
- package/static/assets/index-Ckm4kbAk.css +1 -0
- package/static/assets/index-CzGmm9SR.css +1 -0
- package/static/assets/index-D0jOSazL.js +187 -0
- package/static/assets/index-D3-lCeHu.js +214 -0
- package/static/assets/index-DDRNEd4n.js +247 -0
- package/static/assets/index-DOyViYzn.js +247 -0
- package/static/assets/index-DZsbTHIg.js +214 -0
- package/static/assets/index-DaYbWEw0.js +190 -0
- package/static/assets/index-Djqsib7P.css +1 -0
- package/static/assets/index-Ds4IYSZ4.css +1 -0
- package/static/assets/index-Dzo0Xwn5.css +1 -0
- package/static/assets/index-L47Yb4hH.js +187 -0
- package/static/assets/index-NKfaEJl0.css +1 -0
- package/static/assets/index-U9Pdo8dD.js +214 -0
- package/static/assets/index-UVEGH1D3.css +1 -0
- package/static/assets/index-mZYiGRwU.css +1 -0
- package/static/assets/index-pOjZ5m-I.js +247 -0
- package/static/assets/index-rCcLuTWw.js +216 -0
- package/static/index.html +21 -0
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
var t0=Object.defineProperty;var n0=(t,r,i)=>r in t?t0(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i;var ga=(t,r,i)=>n0(t,typeof r!="symbol"?r+"":r,i);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))s(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const d of f.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function i(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function s(u){if(u.ep)return;u.ep=!0;const f=i(u);fetch(u.href,f)}})();var r0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Xc={exports:{}},ya={},Qc={exports:{}},pt={};/**
|
|
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 Vp;function o0(){if(Vp)return pt;Vp=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),w=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.iterator;function S($){return $===null||typeof $!="object"?null:($=x&&$[x]||$["@@iterator"],typeof $=="function"?$:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,M={};function I($,H,we){this.props=$,this.context=H,this.refs=M,this.updater=we||C}I.prototype.isReactComponent={},I.prototype.setState=function($,H){if(typeof $!="object"&&typeof $!="function"&&$!=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,$,H,"setState")},I.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function A(){}A.prototype=I.prototype;function V($,H,we){this.props=$,this.context=H,this.refs=M,this.updater=we||C}var P=V.prototype=new A;P.constructor=V,j(P,I.prototype),P.isPureReactComponent=!0;var R=Array.isArray,q=Object.prototype.hasOwnProperty,B={current:null},X={key:!0,ref:!0,__self:!0,__source:!0};function fe($,H,we){var be,Te={},$e=null,Re=null;if(H!=null)for(be in H.ref!==void 0&&(Re=H.ref),H.key!==void 0&&($e=""+H.key),H)q.call(H,be)&&!X.hasOwnProperty(be)&&(Te[be]=H[be]);var _e=arguments.length-2;if(_e===1)Te.children=we;else if(1<_e){for(var Be=Array(_e),ke=0;ke<_e;ke++)Be[ke]=arguments[ke+2];Te.children=Be}if($&&$.defaultProps)for(be in _e=$.defaultProps,_e)Te[be]===void 0&&(Te[be]=_e[be]);return{$$typeof:t,type:$,key:$e,ref:Re,props:Te,_owner:B.current}}function he($,H){return{$$typeof:t,type:$.type,key:H,ref:$.ref,props:$.props,_owner:$._owner}}function Se($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function K($){var H={"=":"=0",":":"=2"};return"$"+$.replace(/[=:]/g,function(we){return H[we]})}var ce=/\/+/g;function xe($,H){return typeof $=="object"&&$!==null&&$.key!=null?K(""+$.key):H.toString(36)}function D($,H,we,be,Te){var $e=typeof $;($e==="undefined"||$e==="boolean")&&($=null);var Re=!1;if($===null)Re=!0;else switch($e){case"string":case"number":Re=!0;break;case"object":switch($.$$typeof){case t:case r:Re=!0}}if(Re)return Re=$,Te=Te(Re),$=be===""?"."+xe(Re,0):be,R(Te)?(we="",$!=null&&(we=$.replace(ce,"$&/")+"/"),D(Te,H,we,"",function(ke){return ke})):Te!=null&&(Se(Te)&&(Te=he(Te,we+(!Te.key||Re&&Re.key===Te.key?"":(""+Te.key).replace(ce,"$&/")+"/")+$)),H.push(Te)),1;if(Re=0,be=be===""?".":be+":",R($))for(var _e=0;_e<$.length;_e++){$e=$[_e];var Be=be+xe($e,_e);Re+=D($e,H,we,Be,Te)}else if(Be=S($),typeof Be=="function")for($=Be.call($),_e=0;!($e=$.next()).done;)$e=$e.value,Be=be+xe($e,_e++),Re+=D($e,H,we,Be,Te);else if($e==="object")throw H=String($),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.");return Re}function le($,H,we){if($==null)return $;var be=[],Te=0;return D($,be,"","",function($e){return H.call(we,$e,Te++)}),be}function Q($){if($._status===-1){var H=$._result;H=H(),H.then(function(we){($._status===0||$._status===-1)&&($._status=1,$._result=we)},function(we){($._status===0||$._status===-1)&&($._status=2,$._result=we)}),$._status===-1&&($._status=0,$._result=H)}if($._status===1)return $._result.default;throw $._result}var se={current:null},L={transition:null},U={ReactCurrentDispatcher:se,ReactCurrentBatchConfig:L,ReactCurrentOwner:B};function F(){throw Error("act(...) is not supported in production builds of React.")}return pt.Children={map:le,forEach:function($,H,we){le($,function(){H.apply(this,arguments)},we)},count:function($){var H=0;return le($,function(){H++}),H},toArray:function($){return le($,function(H){return H})||[]},only:function($){if(!Se($))throw Error("React.Children.only expected to receive a single React element child.");return $}},pt.Component=I,pt.Fragment=i,pt.Profiler=u,pt.PureComponent=V,pt.StrictMode=s,pt.Suspense=v,pt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=U,pt.act=F,pt.cloneElement=function($,H,we){if($==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+$+".");var be=j({},$.props),Te=$.key,$e=$.ref,Re=$._owner;if(H!=null){if(H.ref!==void 0&&($e=H.ref,Re=B.current),H.key!==void 0&&(Te=""+H.key),$.type&&$.type.defaultProps)var _e=$.type.defaultProps;for(Be in H)q.call(H,Be)&&!X.hasOwnProperty(Be)&&(be[Be]=H[Be]===void 0&&_e!==void 0?_e[Be]:H[Be])}var Be=arguments.length-2;if(Be===1)be.children=we;else if(1<Be){_e=Array(Be);for(var ke=0;ke<Be;ke++)_e[ke]=arguments[ke+2];be.children=_e}return{$$typeof:t,type:$.type,key:Te,ref:$e,props:be,_owner:Re}},pt.createContext=function($){return $={$$typeof:d,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},$.Provider={$$typeof:f,_context:$},$.Consumer=$},pt.createElement=fe,pt.createFactory=function($){var H=fe.bind(null,$);return H.type=$,H},pt.createRef=function(){return{current:null}},pt.forwardRef=function($){return{$$typeof:m,render:$}},pt.isValidElement=Se,pt.lazy=function($){return{$$typeof:b,_payload:{_status:-1,_result:$},_init:Q}},pt.memo=function($,H){return{$$typeof:w,type:$,compare:H===void 0?null:H}},pt.startTransition=function($){var H=L.transition;L.transition={};try{$()}finally{L.transition=H}},pt.unstable_act=F,pt.useCallback=function($,H){return se.current.useCallback($,H)},pt.useContext=function($){return se.current.useContext($)},pt.useDebugValue=function(){},pt.useDeferredValue=function($){return se.current.useDeferredValue($)},pt.useEffect=function($,H){return se.current.useEffect($,H)},pt.useId=function(){return se.current.useId()},pt.useImperativeHandle=function($,H,we){return se.current.useImperativeHandle($,H,we)},pt.useInsertionEffect=function($,H){return se.current.useInsertionEffect($,H)},pt.useLayoutEffect=function($,H){return se.current.useLayoutEffect($,H)},pt.useMemo=function($,H){return se.current.useMemo($,H)},pt.useReducer=function($,H,we){return se.current.useReducer($,H,we)},pt.useRef=function($){return se.current.useRef($)},pt.useState=function($){return se.current.useState($)},pt.useSyncExternalStore=function($,H,we){return se.current.useSyncExternalStore($,H,we)},pt.useTransition=function(){return se.current.useTransition()},pt.version="18.3.1",pt}var Up;function $a(){return Up||(Up=1,Qc.exports=o0()),Qc.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Kp;function i0(){if(Kp)return ya;Kp=1;var t=$a(),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,u=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function d(m,v,w){var b,x={},S=null,C=null;w!==void 0&&(S=""+w),v.key!==void 0&&(S=""+v.key),v.ref!==void 0&&(C=v.ref);for(b in v)s.call(v,b)&&!f.hasOwnProperty(b)&&(x[b]=v[b]);if(m&&m.defaultProps)for(b in v=m.defaultProps,v)x[b]===void 0&&(x[b]=v[b]);return{$$typeof:r,type:m,key:S,ref:C,props:x,_owner:u.current}}return ya.Fragment=i,ya.jsx=d,ya.jsxs=d,ya}var qp;function s0(){return qp||(qp=1,Xc.exports=i0()),Xc.exports}var k=s0(),ee=$a();const pm=vu(ee);var Vl={},Gc={exports:{}},Fn={},Jc={exports:{}},Zc={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Wp;function a0(){return Wp||(Wp=1,(function(t){function r(L,U){var F=L.length;L.push(U);e:for(;0<F;){var $=F-1>>>1,H=L[$];if(0<u(H,U))L[$]=U,L[F]=H,F=$;else break e}}function i(L){return L.length===0?null:L[0]}function s(L){if(L.length===0)return null;var U=L[0],F=L.pop();if(F!==U){L[0]=F;e:for(var $=0,H=L.length,we=H>>>1;$<we;){var be=2*($+1)-1,Te=L[be],$e=be+1,Re=L[$e];if(0>u(Te,F))$e<H&&0>u(Re,Te)?(L[$]=Re,L[$e]=F,$=$e):(L[$]=Te,L[be]=F,$=be);else if($e<H&&0>u(Re,F))L[$]=Re,L[$e]=F,$=$e;else break e}}return U}function u(L,U){var F=L.sortIndex-U.sortIndex;return F!==0?F:L.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;t.unstable_now=function(){return f.now()}}else{var d=Date,m=d.now();t.unstable_now=function(){return d.now()-m}}var v=[],w=[],b=1,x=null,S=3,C=!1,j=!1,M=!1,I=typeof setTimeout=="function"?setTimeout:null,A=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 P(L){for(var U=i(w);U!==null;){if(U.callback===null)s(w);else if(U.startTime<=L)s(w),U.sortIndex=U.expirationTime,r(v,U);else break;U=i(w)}}function R(L){if(M=!1,P(L),!j)if(i(v)!==null)j=!0,Q(q);else{var U=i(w);U!==null&&se(R,U.startTime-L)}}function q(L,U){j=!1,M&&(M=!1,A(fe),fe=-1),C=!0;var F=S;try{for(P(U),x=i(v);x!==null&&(!(x.expirationTime>U)||L&&!K());){var $=x.callback;if(typeof $=="function"){x.callback=null,S=x.priorityLevel;var H=$(x.expirationTime<=U);U=t.unstable_now(),typeof H=="function"?x.callback=H:x===i(v)&&s(v),P(U)}else s(v);x=i(v)}if(x!==null)var we=!0;else{var be=i(w);be!==null&&se(R,be.startTime-U),we=!1}return we}finally{x=null,S=F,C=!1}}var B=!1,X=null,fe=-1,he=5,Se=-1;function K(){return!(t.unstable_now()-Se<he)}function ce(){if(X!==null){var L=t.unstable_now();Se=L;var U=!0;try{U=X(!0,L)}finally{U?xe():(B=!1,X=null)}}else B=!1}var xe;if(typeof V=="function")xe=function(){V(ce)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,le=D.port2;D.port1.onmessage=ce,xe=function(){le.postMessage(null)}}else xe=function(){I(ce,0)};function Q(L){X=L,B||(B=!0,xe())}function se(L,U){fe=I(function(){L(t.unstable_now())},U)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(L){L.callback=null},t.unstable_continueExecution=function(){j||C||(j=!0,Q(q))},t.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):he=0<L?Math.floor(1e3/L):5},t.unstable_getCurrentPriorityLevel=function(){return S},t.unstable_getFirstCallbackNode=function(){return i(v)},t.unstable_next=function(L){switch(S){case 1:case 2:case 3:var U=3;break;default:U=S}var F=S;S=U;try{return L()}finally{S=F}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(L,U){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var F=S;S=L;try{return U()}finally{S=F}},t.unstable_scheduleCallback=function(L,U,F){var $=t.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?$+F:$):F=$,L){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=F+H,L={id:b++,callback:U,priorityLevel:L,startTime:F,expirationTime:H,sortIndex:-1},F>$?(L.sortIndex=F,r(w,L),i(v)===null&&L===i(w)&&(M?(A(fe),fe=-1):M=!0,se(R,F-$))):(L.sortIndex=H,r(v,L),j||C||(j=!0,Q(q))),L},t.unstable_shouldYield=K,t.unstable_wrapCallback=function(L){var U=S;return function(){var F=S;S=U;try{return L.apply(this,arguments)}finally{S=F}}}})(Zc)),Zc}var Yp;function l0(){return Yp||(Yp=1,Jc.exports=a0()),Jc.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 Xp;function u0(){if(Xp)return Fn;Xp=1;var t=$a(),r=l0();function i(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=1;o<arguments.length;o++)n+="&args[]="+encodeURIComponent(arguments[o]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,u={};function f(e,n){d(e,n),d(e+"Capture",n)}function d(e,n){for(u[e]=n,e=0;e<n.length;e++)s.add(n[e])}var m=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),v=Object.prototype.hasOwnProperty,w=/^[: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]*$/,b={},x={};function S(e){return v.call(x,e)?!0:v.call(b,e)?!1:w.test(e)?x[e]=!0:(b[e]=!0,!1)}function C(e,n,o,l){if(o!==null&&o.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return l?!1:o!==null?!o.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function j(e,n,o,l){if(n===null||typeof n>"u"||C(e,n,o,l))return!0;if(l)return!1;if(o!==null)switch(o.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function M(e,n,o,l,p,g,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=l,this.attributeNamespace=p,this.mustUseProperty=o,this.propertyName=e,this.type=n,this.sanitizeURL=g,this.removeEmptyString=E}var I={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){I[e]=new M(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];I[n]=new M(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){I[e]=new M(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){I[e]=new M(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){I[e]=new M(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){I[e]=new M(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){I[e]=new M(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){I[e]=new M(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){I[e]=new M(e,5,!1,e.toLowerCase(),null,!1,!1)});var A=/[\-:]([a-z])/g;function V(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 n=e.replace(A,V);I[n]=new M(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(A,V);I[n]=new M(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(A,V);I[n]=new M(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){I[e]=new M(e,1,!1,e.toLowerCase(),null,!1,!1)}),I.xlinkHref=new M("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){I[e]=new M(e,1,!1,e.toLowerCase(),null,!0,!0)});function P(e,n,o,l){var p=I.hasOwnProperty(n)?I[n]:null;(p!==null?p.type!==0:l||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(j(n,o,p,l)&&(o=null),l||p===null?S(n)&&(o===null?e.removeAttribute(n):e.setAttribute(n,""+o)):p.mustUseProperty?e[p.propertyName]=o===null?p.type===3?!1:"":o:(n=p.attributeName,l=p.attributeNamespace,o===null?e.removeAttribute(n):(p=p.type,o=p===3||p===4&&o===!0?"":""+o,l?e.setAttributeNS(l,n,o):e.setAttribute(n,o))))}var R=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,q=Symbol.for("react.element"),B=Symbol.for("react.portal"),X=Symbol.for("react.fragment"),fe=Symbol.for("react.strict_mode"),he=Symbol.for("react.profiler"),Se=Symbol.for("react.provider"),K=Symbol.for("react.context"),ce=Symbol.for("react.forward_ref"),xe=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),se=Symbol.for("react.offscreen"),L=Symbol.iterator;function U(e){return e===null||typeof e!="object"?null:(e=L&&e[L]||e["@@iterator"],typeof e=="function"?e:null)}var F=Object.assign,$;function H(e){if($===void 0)try{throw Error()}catch(o){var n=o.stack.trim().match(/\n( *(at )?)/);$=n&&n[1]||""}return`
|
|
34
|
+
`+$+e}var we=!1;function be(e,n){if(!e||we)return"";we=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(ye){var l=ye}Reflect.construct(e,[],n)}else{try{n.call()}catch(ye){l=ye}e.call(n.prototype)}else{try{throw Error()}catch(ye){l=ye}e()}}catch(ye){if(ye&&l&&typeof ye.stack=="string"){for(var p=ye.stack.split(`
|
|
35
|
+
`),g=l.stack.split(`
|
|
36
|
+
`),E=p.length-1,z=g.length-1;1<=E&&0<=z&&p[E]!==g[z];)z--;for(;1<=E&&0<=z;E--,z--)if(p[E]!==g[z]){if(E!==1||z!==1)do if(E--,z--,0>z||p[E]!==g[z]){var Y=`
|
|
37
|
+
`+p[E].replace(" at new "," at ");return e.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",e.displayName)),Y}while(1<=E&&0<=z);break}}}finally{we=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?H(e):""}function Te(e){switch(e.tag){case 5:return H(e.type);case 16:return H("Lazy");case 13:return H("Suspense");case 19:return H("SuspenseList");case 0:case 2:case 15:return e=be(e.type,!1),e;case 11:return e=be(e.type.render,!1),e;case 1:return e=be(e.type,!0),e;default:return""}}function $e(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 X:return"Fragment";case B:return"Portal";case he:return"Profiler";case fe:return"StrictMode";case xe:return"Suspense";case D:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case K:return(e.displayName||"Context")+".Consumer";case Se:return(e._context.displayName||"Context")+".Provider";case ce:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case le:return n=e.displayName||null,n!==null?n:$e(e.type)||"Memo";case Q:n=e._payload,e=e._init;try{return $e(e(n))}catch{}}return null}function Re(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return $e(n);case 8:return n===fe?"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 n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function _e(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Be(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function ke(e){var n=Be(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),l=""+e[n];if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var p=o.get,g=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return p.call(this)},set:function(E){l=""+E,g.call(this,E)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(E){l=""+E},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function He(e){e._valueTracker||(e._valueTracker=ke(e))}function Ae(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var o=n.getValue(),l="";return e&&(l=Be(e)?e.checked?"true":"false":e.value),e=l,e!==o?(n.setValue(e),!0):!1}function qe(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 ut(e,n){var o=n.checked;return F({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function ct(e,n){var o=n.defaultValue==null?"":n.defaultValue,l=n.checked!=null?n.checked:n.defaultChecked;o=_e(n.value!=null?n.value:o),e._wrapperState={initialChecked:l,initialValue:o,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function it(e,n){n=n.checked,n!=null&&P(e,"checked",n,!1)}function Mt(e,n){it(e,n);var o=_e(n.value),l=n.type;if(o!=null)l==="number"?(o===0&&e.value===""||e.value!=o)&&(e.value=""+o):e.value!==""+o&&(e.value=""+o);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?tn(e,n.type,o):n.hasOwnProperty("defaultValue")&&tn(e,n.type,_e(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function St(e,n,o){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var l=n.type;if(!(l!=="submit"&&l!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,o||n===e.value||(e.value=n),e.defaultValue=n}o=e.name,o!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,o!==""&&(e.name=o)}function tn(e,n,o){(n!=="number"||qe(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var Ot=Array.isArray;function bt(e,n,o,l){if(e=e.options,n){n={};for(var p=0;p<o.length;p++)n["$"+o[p]]=!0;for(o=0;o<e.length;o++)p=n.hasOwnProperty("$"+e[o].value),e[o].selected!==p&&(e[o].selected=p),p&&l&&(e[o].defaultSelected=!0)}else{for(o=""+_e(o),n=null,p=0;p<e.length;p++){if(e[p].value===o){e[p].selected=!0,l&&(e[p].defaultSelected=!0);return}n!==null||e[p].disabled||(n=e[p])}n!==null&&(n.selected=!0)}}function wn(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(i(91));return F({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function fn(e,n){var o=n.value;if(o==null){if(o=n.children,n=n.defaultValue,o!=null){if(n!=null)throw Error(i(92));if(Ot(o)){if(1<o.length)throw Error(i(93));o=o[0]}n=o}n==null&&(n=""),o=n}e._wrapperState={initialValue:_e(o)}}function gr(e,n){var o=_e(n.value),l=_e(n.defaultValue);o!=null&&(o=""+o,o!==e.value&&(e.value=o),n.defaultValue==null&&e.defaultValue!==o&&(e.defaultValue=o)),l!=null&&(e.defaultValue=""+l)}function _n(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function Nt(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 Ht(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?Nt(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Hn,tr=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,o,l,p){MSApp.execUnsafeLocalFunction(function(){return e(n,o,l,p)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for(Hn=Hn||document.createElement("div"),Hn.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=Hn.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function Sn(e,n){if(n){var o=e.firstChild;if(o&&o===e.lastChild&&o.nodeType===3){o.nodeValue=n;return}}e.textContent=n}var Pn={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},Vn=["Webkit","ms","Moz","O"];Object.keys(Pn).forEach(function(e){Vn.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),Pn[n]=Pn[e]})});function dn(e,n,o){return n==null||typeof n=="boolean"||n===""?"":o||typeof n!="number"||n===0||Pn.hasOwnProperty(e)&&Pn[e]?(""+n).trim():n+"px"}function nr(e,n){e=e.style;for(var o in n)if(n.hasOwnProperty(o)){var l=o.indexOf("--")===0,p=dn(o,n[o],l);o==="float"&&(o="cssFloat"),l?e.setProperty(o,p):e[o]=p}}var bn=F({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 Ye(e,n){if(n){if(bn[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(i(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(i(61))}if(n.style!=null&&typeof n.style!="object")throw Error(i(62))}}function Un(e,n){if(e.indexOf("-")===-1)return typeof n.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 kn=null;function rr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ve=null,Tn=null,Kn=null;function Or(e){if(e=ta(e)){if(typeof Ve!="function")throw Error(i(280));var n=e.stateNode;n&&(n=ol(n),Ve(e.stateNode,e.type,n))}}function Zr(e){Tn?Kn?Kn.push(e):Kn=[e]:Tn=e}function Rr(){if(Tn){var e=Tn,n=Kn;if(Kn=Tn=null,Or(e),n)for(e=0;e<n.length;e++)Or(n[e])}}function Io(e,n){return e(n)}function eo(){}var Nn=!1;function Mn(e,n,o){if(Nn)return e(n,o);Nn=!0;try{return Io(e,n,o)}finally{Nn=!1,(Tn!==null||Kn!==null)&&(eo(),Rr())}}function W(e,n){var o=e.stateNode;if(o===null)return null;var l=ol(o);if(l===null)return null;o=l[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(o&&typeof o!="function")throw Error(i(231,n,typeof o));return o}var Fe=!1;if(m)try{var Le={};Object.defineProperty(Le,"passive",{get:function(){Fe=!0}}),window.addEventListener("test",Le,Le),window.removeEventListener("test",Le,Le)}catch{Fe=!1}function nt(e,n,o,l,p,g,E,z,Y){var ye=Array.prototype.slice.call(arguments,3);try{n.apply(o,ye)}catch(Pe){this.onError(Pe)}}var nn=!1,Wt=null,Vt=!1,rn=null,to={onError:function(e){nn=!0,Wt=e}};function on(e,n,o,l,p,g,E,z,Y){nn=!1,Wt=null,nt.apply(to,arguments)}function qn(e,n,o,l,p,g,E,z,Y){if(on.apply(this,arguments),nn){if(nn){var ye=Wt;nn=!1,Wt=null}else throw Error(i(198));Vt||(Vt=!0,rn=ye)}}function Lt(e){var n=e,o=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(o=n.return),e=n.return;while(e)}return n.tag===3?o:null}function Wn(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function or(e){if(Lt(e)!==e)throw Error(i(188))}function In(e){var n=e.alternate;if(!n){if(n=Lt(e),n===null)throw Error(i(188));return n!==e?null:e}for(var o=e,l=n;;){var p=o.return;if(p===null)break;var g=p.alternate;if(g===null){if(l=p.return,l!==null){o=l;continue}break}if(p.child===g.child){for(g=p.child;g;){if(g===o)return or(p),e;if(g===l)return or(p),n;g=g.sibling}throw Error(i(188))}if(o.return!==l.return)o=p,l=g;else{for(var E=!1,z=p.child;z;){if(z===o){E=!0,o=p,l=g;break}if(z===l){E=!0,l=p,o=g;break}z=z.sibling}if(!E){for(z=g.child;z;){if(z===o){E=!0,o=g,l=p;break}if(z===l){E=!0,l=g,o=p;break}z=z.sibling}if(!E)throw Error(i(189))}}if(o.alternate!==l)throw Error(i(190))}if(o.tag!==3)throw Error(i(188));return o.stateNode.current===o?e:n}function ui(e){return e=In(e),e!==null?ir(e):null}function ir(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=ir(e);if(n!==null)return n;e=e.sibling}return null}var ci=r.unstable_scheduleCallback,$o=r.unstable_cancelCallback,Et=r.unstable_shouldYield,sr=r.unstable_requestPaint,gt=r.unstable_now,Bi=r.unstable_getCurrentPriorityLevel,Dr=r.unstable_ImmediatePriority,Ao=r.unstable_UserBlockingPriority,zr=r.unstable_NormalPriority,yr=r.unstable_LowPriority,fi=r.unstable_IdlePriority,ar=null,En=null;function ft(e){if(En&&typeof En.onCommitFiberRoot=="function")try{En.onCommitFiberRoot(ar,e,void 0,(e.current.flags&128)===128)}catch{}}var pn=Math.clz32?Math.clz32:no,Hi=Math.log,Oo=Math.LN2;function no(e){return e>>>=0,e===0?32:31-(Hi(e)/Oo|0)|0}var ro=64,oo=4194304;function Yn(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 yt(e,n){var o=e.pendingLanes;if(o===0)return 0;var l=0,p=e.suspendedLanes,g=e.pingedLanes,E=o&268435455;if(E!==0){var z=E&~p;z!==0?l=Yn(z):(g&=E,g!==0&&(l=Yn(g)))}else E=o&~p,E!==0?l=Yn(E):g!==0&&(l=Yn(g));if(l===0)return 0;if(n!==0&&n!==l&&(n&p)===0&&(p=l&-l,g=n&-n,p>=g||p===16&&(g&4194240)!==0))return n;if((l&4)!==0&&(l|=o&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=l;0<n;)o=31-pn(n),p=1<<o,l|=e[o],n&=~p;return l}function Lr(e,n){switch(e){case 1:case 2:case 4:return n+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 n+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 io(e,n){for(var o=e.suspendedLanes,l=e.pingedLanes,p=e.expirationTimes,g=e.pendingLanes;0<g;){var E=31-pn(g),z=1<<E,Y=p[E];Y===-1?((z&o)===0||(z&l)!==0)&&(p[E]=Lr(z,n)):Y<=n&&(e.expiredLanes|=z),g&=~z}}function lr(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Fr(){var e=ro;return ro<<=1,(ro&4194240)===0&&(ro=64),e}function so(e){for(var n=[],o=0;31>o;o++)n.push(e);return n}function ur(e,n,o){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-pn(n),e[n]=o}function di(e,n){var o=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0<o;){var p=31-pn(o),g=1<<p;n[p]=0,l[p]=-1,e[p]=-1,o&=~g}}function Ro(e,n){var o=e.entangledLanes|=n;for(e=e.entanglements;o;){var l=31-pn(o),p=1<<l;p&n|e[l]&n&&(e[l]|=n),o&=~p}}var xt=0;function Ba(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var ht,Vi,Ha,Va,hn,Br=!1,ao=[],sn=null,vr=null,xr=null,It=new Map,an=new Map,$n=[],pi="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 Ui(e,n){switch(e){case"focusin":case"focusout":sn=null;break;case"dragenter":case"dragleave":vr=null;break;case"mouseover":case"mouseout":xr=null;break;case"pointerover":case"pointerout":It.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":an.delete(n.pointerId)}}function An(e,n,o,l,p,g){return e===null||e.nativeEvent!==g?(e={blockedOn:n,domEventName:o,eventSystemFlags:l,nativeEvent:g,targetContainers:[p]},n!==null&&(n=ta(n),n!==null&&Vi(n)),e):(e.eventSystemFlags|=l,n=e.targetContainers,p!==null&&n.indexOf(p)===-1&&n.push(p),e)}function $u(e,n,o,l,p){switch(n){case"focusin":return sn=An(sn,e,n,o,l,p),!0;case"dragenter":return vr=An(vr,e,n,o,l,p),!0;case"mouseover":return xr=An(xr,e,n,o,l,p),!0;case"pointerover":var g=p.pointerId;return It.set(g,An(It.get(g)||null,e,n,o,l,p)),!0;case"gotpointercapture":return g=p.pointerId,an.set(g,An(an.get(g)||null,e,n,o,l,p)),!0}return!1}function Xn(e){var n=_i(e.target);if(n!==null){var o=Lt(n);if(o!==null){if(n=o.tag,n===13){if(n=Wn(o),n!==null){e.blockedOn=n,hn(e.priority,function(){Ha(o)});return}}else if(n===3&&o.stateNode.current.memoizedState.isDehydrated){e.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Do(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var o=zo(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(o===null){o=e.nativeEvent;var l=new o.constructor(o.type,o);kn=l,o.target.dispatchEvent(l),kn=null}else return n=ta(o),n!==null&&Vi(n),e.blockedOn=o,!1;n.shift()}return!0}function Ds(e,n,o){Do(e)&&o.delete(n)}function zs(){Br=!1,sn!==null&&Do(sn)&&(sn=null),vr!==null&&Do(vr)&&(vr=null),xr!==null&&Do(xr)&&(xr=null),It.forEach(Ds),an.forEach(Ds)}function wr(e,n){e.blockedOn===n&&(e.blockedOn=null,Br||(Br=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,zs)))}function lo(e){function n(p){return wr(p,e)}if(0<ao.length){wr(ao[0],e);for(var o=1;o<ao.length;o++){var l=ao[o];l.blockedOn===e&&(l.blockedOn=null)}}for(sn!==null&&wr(sn,e),vr!==null&&wr(vr,e),xr!==null&&wr(xr,e),It.forEach(n),an.forEach(n),o=0;o<$n.length;o++)l=$n[o],l.blockedOn===e&&(l.blockedOn=null);for(;0<$n.length&&(o=$n[0],o.blockedOn===null);)Xn(o),o.blockedOn===null&&$n.shift()}var uo=R.ReactCurrentBatchConfig,Ki=!0;function hi(e,n,o,l){var p=xt,g=uo.transition;uo.transition=null;try{xt=1,Ls(e,n,o,l)}finally{xt=p,uo.transition=g}}function Au(e,n,o,l){var p=xt,g=uo.transition;uo.transition=null;try{xt=4,Ls(e,n,o,l)}finally{xt=p,uo.transition=g}}function Ls(e,n,o,l){if(Ki){var p=zo(e,n,o,l);if(p===null)Lu(e,n,l,co,o),Ui(e,l);else if($u(p,e,n,o,l))l.stopPropagation();else if(Ui(e,l),n&4&&-1<pi.indexOf(e)){for(;p!==null;){var g=ta(p);if(g!==null&&ht(g),g=zo(e,n,o,l),g===null&&Lu(e,n,l,co,o),g===p)break;p=g}p!==null&&l.stopPropagation()}else Lu(e,n,l,null,o)}}var co=null;function zo(e,n,o,l){if(co=null,e=rr(l),e=_i(e),e!==null)if(n=Lt(e),n===null)e=null;else if(o=n.tag,o===13){if(e=Wn(n),e!==null)return e;e=null}else if(o===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null);return co=e,null}function qi(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(Bi()){case Dr:return 1;case Ao:return 4;case zr:case yr:return 16;case fi:return 536870912;default:return 16}default:return 16}}var Hr=null,Fs=null,Wi=null;function Yi(){if(Wi)return Wi;var e,n=Fs,o=n.length,l,p="value"in Hr?Hr.value:Hr.textContent,g=p.length;for(e=0;e<o&&n[e]===p[e];e++);var E=o-e;for(l=1;l<=E&&n[o-l]===p[g-l];l++);return Wi=p.slice(e,1<l?1-l:void 0)}function Lo(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function mi(){return!0}function gi(){return!1}function Qt(e){function n(o,l,p,g,E){this._reactName=o,this._targetInst=p,this.type=l,this.nativeEvent=g,this.target=E,this.currentTarget=null;for(var z in e)e.hasOwnProperty(z)&&(o=e[z],this[z]=o?o(g):g[z]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?mi:gi,this.isPropagationStopped=gi,this}return F(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=mi)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=mi)},persist:function(){},isPersistent:mi}),n}var _r={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xi=Qt(_r),yi=F({},_r,{view:0,detail:0}),Fo=Qt(yi),fo,vi,po,Bo=F({},yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ts,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!==po&&(po&&e.type==="mousemove"?(fo=e.screenX-po.screenX,vi=e.screenY-po.screenY):vi=fo=0,po=e),fo)},movementY:function(e){return"movementY"in e?e.movementY:vi}}),Qi=Qt(Bo),Gt=F({},Bo,{dataTransfer:0}),xi=Qt(Gt),wi=F({},yi,{relatedTarget:0}),Gi=Qt(wi),Ji=F({},_r,{animationName:0,elapsedTime:0,pseudoElement:0}),Ua=Qt(Ji),Ka=F({},_r,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Zi=Qt(Ka),Bs=F({},_r,{data:0}),Vr=Qt(Bs),Hs={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vs={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"},es={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Us(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=es[e])?!!n[e]:!1}function ts(){return Us}var Ou=F({},yi,{key:function(e){if(e.key){var n=Hs[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Lo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Vs[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ts,charCode:function(e){return e.type==="keypress"?Lo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Lo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ks=Qt(Ou),ns=F({},Bo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qa=Qt(ns),qs=F({},yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ts}),Ws=Qt(qs),Ru=F({},_r,{propertyName:0,elapsedTime:0,pseudoElement:0}),Wa=Qt(Ru),Du=F({},Bo,{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}),Ya=Qt(Du),Xa=[9,13,27,32],Ys=m&&"CompositionEvent"in window,Ho=null;m&&"documentMode"in document&&(Ho=document.documentMode);var Xs=m&&"TextEvent"in window&&!Ho,Qs=m&&(!Ys||Ho&&8<Ho&&11>=Ho),Gs=" ",Qa=!1;function Ga(e,n){switch(e){case"keyup":return Xa.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ja(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Sr=!1;function br(e,n){switch(e){case"compositionend":return Ja(n);case"keypress":return n.which!==32?null:(Qa=!0,Gs);case"textInput":return e=n.data,e===Gs&&Qa?null:e;default:return null}}function Rt(e,n){if(Sr)return e==="compositionend"||!Ys&&Ga(e,n)?(e=Yi(),Wi=Fs=Hr=null,Sr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Qs&&n.locale!=="ko"?null:n.data;default:return null}}var rs={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 ho(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!rs[e.type]:n==="textarea"}function Za(e,n,o,l){Zr(l),n=tl(n,"onChange"),0<n.length&&(o=new Xi("onChange","change",null,o,l),e.push({event:o,listeners:n}))}var mo=null,Vo=null;function go(e){id(e,0)}function Uo(e){var n=as(e);if(Ae(n))return e}function Ko(e,n){if(e==="change")return n}var kr=!1;if(m){var os;if(m){var a="oninput"in document;if(!a){var c=document.createElement("div");c.setAttribute("oninput","return;"),a=typeof c.oninput=="function"}os=a}else os=!1;kr=os&&(!document.documentMode||9<document.documentMode)}function h(){mo&&(mo.detachEvent("onpropertychange",y),Vo=mo=null)}function y(e){if(e.propertyName==="value"&&Uo(Vo)){var n=[];Za(n,Vo,e,rr(e)),Mn(go,n)}}function _(e,n,o){e==="focusin"?(h(),mo=n,Vo=o,mo.attachEvent("onpropertychange",y)):e==="focusout"&&h()}function N(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Uo(Vo)}function T(e,n){if(e==="click")return Uo(n)}function O(e,n){if(e==="input"||e==="change")return Uo(n)}function J(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var ue=typeof Object.is=="function"?Object.is:J;function te(e,n){if(ue(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var o=Object.keys(e),l=Object.keys(n);if(o.length!==l.length)return!1;for(l=0;l<o.length;l++){var p=o[l];if(!v.call(n,p)||!ue(e[p],n[p]))return!1}return!0}function G(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Z(e,n){var o=G(e);e=0;for(var l;o;){if(o.nodeType===3){if(l=e+o.textContent.length,e<=n&&l>=n)return{node:o,offset:n-e};e=l}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=G(o)}}function ae(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?ae(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function oe(){for(var e=window,n=qe();n instanceof e.HTMLIFrameElement;){try{var o=typeof n.contentWindow.location.href=="string"}catch{o=!1}if(o)e=n.contentWindow;else break;n=qe(e.document)}return n}function re(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function ie(e){var n=oe(),o=e.focusedElem,l=e.selectionRange;if(n!==o&&o&&o.ownerDocument&&ae(o.ownerDocument.documentElement,o)){if(l!==null&&re(o)){if(n=l.start,e=l.end,e===void 0&&(e=n),"selectionStart"in o)o.selectionStart=n,o.selectionEnd=Math.min(e,o.value.length);else if(e=(n=o.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var p=o.textContent.length,g=Math.min(l.start,p);l=l.end===void 0?g:Math.min(l.end,p),!e.extend&&g>l&&(p=l,l=g,g=p),p=Z(o,g);var E=Z(o,l);p&&E&&(e.rangeCount!==1||e.anchorNode!==p.node||e.anchorOffset!==p.offset||e.focusNode!==E.node||e.focusOffset!==E.offset)&&(n=n.createRange(),n.setStart(p.node,p.offset),e.removeAllRanges(),g>l?(e.addRange(n),e.extend(E.node,E.offset)):(n.setEnd(E.node,E.offset),e.addRange(n)))}}for(n=[],e=o;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<n.length;o++)e=n[o],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ge=m&&"documentMode"in document&&11>=document.documentMode,de=null,ve=null,Ne=null,Ce=!1;function De(e,n,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Ce||de==null||de!==qe(l)||(l=de,"selectionStart"in l&&re(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ne&&te(Ne,l)||(Ne=l,l=tl(ve,"onSelect"),0<l.length&&(n=new Xi("onSelect","select",null,n,o),e.push({event:n,listeners:l}),n.target=de)))}function Me(e,n){var o={};return o[e.toLowerCase()]=n.toLowerCase(),o["Webkit"+e]="webkit"+n,o["Moz"+e]="moz"+n,o}var Ue={animationend:Me("Animation","AnimationEnd"),animationiteration:Me("Animation","AnimationIteration"),animationstart:Me("Animation","AnimationStart"),transitionend:Me("Transition","TransitionEnd")},Oe={},We={};m&&(We=document.createElement("div").style,"AnimationEvent"in window||(delete Ue.animationend.animation,delete Ue.animationiteration.animation,delete Ue.animationstart.animation),"TransitionEvent"in window||delete Ue.transitionend.transition);function Ee(e){if(Oe[e])return Oe[e];if(!Ue[e])return e;var n=Ue[e],o;for(o in n)if(n.hasOwnProperty(o)&&o in We)return Oe[e]=n[o];return e}var rt=Ee("animationend"),ot=Ee("animationiteration"),lt=Ee("animationstart"),dt=Ee("transitionend"),mn=new Map,at="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 Ct(e,n){mn.set(e,n),f(n,[e])}for(var Ut=0;Ut<at.length;Ut++){var qo=at[Ut],ln=qo.toLowerCase(),yo=qo[0].toUpperCase()+qo.slice(1);Ct(ln,"on"+yo)}Ct(rt,"onAnimationEnd"),Ct(ot,"onAnimationIteration"),Ct(lt,"onAnimationStart"),Ct("dblclick","onDoubleClick"),Ct("focusin","onFocus"),Ct("focusout","onBlur"),Ct(dt,"onTransitionEnd"),d("onMouseEnter",["mouseout","mouseover"]),d("onMouseLeave",["mouseout","mouseover"]),d("onPointerEnter",["pointerout","pointerover"]),d("onPointerLeave",["pointerout","pointerover"]),f("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),f("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),f("onBeforeInput",["compositionend","keypress","textInput","paste"]),f("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vo="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(" "),dy=new Set("cancel close invalid load scroll toggle".split(" ").concat(vo));function od(e,n,o){var l=e.type||"unknown-event";e.currentTarget=o,qn(l,n,void 0,e),e.currentTarget=null}function id(e,n){n=(n&4)!==0;for(var o=0;o<e.length;o++){var l=e[o],p=l.event;l=l.listeners;e:{var g=void 0;if(n)for(var E=l.length-1;0<=E;E--){var z=l[E],Y=z.instance,ye=z.currentTarget;if(z=z.listener,Y!==g&&p.isPropagationStopped())break e;od(p,z,ye),g=Y}else for(E=0;E<l.length;E++){if(z=l[E],Y=z.instance,ye=z.currentTarget,z=z.listener,Y!==g&&p.isPropagationStopped())break e;od(p,z,ye),g=Y}}}if(Vt)throw e=rn,Vt=!1,rn=null,e}function jt(e,n){var o=n[Ku];o===void 0&&(o=n[Ku]=new Set);var l=e+"__bubble";o.has(l)||(sd(n,e,2,!1),o.add(l))}function zu(e,n,o){var l=0;n&&(l|=4),sd(o,e,l,n)}var el="_reactListening"+Math.random().toString(36).slice(2);function Js(e){if(!e[el]){e[el]=!0,s.forEach(function(o){o!=="selectionchange"&&(dy.has(o)||zu(o,!1,e),zu(o,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[el]||(n[el]=!0,zu("selectionchange",!1,n))}}function sd(e,n,o,l){switch(qi(n)){case 1:var p=hi;break;case 4:p=Au;break;default:p=Ls}o=p.bind(null,n,o,e),p=void 0,!Fe||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(p=!0),l?p!==void 0?e.addEventListener(n,o,{capture:!0,passive:p}):e.addEventListener(n,o,!0):p!==void 0?e.addEventListener(n,o,{passive:p}):e.addEventListener(n,o,!1)}function Lu(e,n,o,l,p){var g=l;if((n&1)===0&&(n&2)===0&&l!==null)e:for(;;){if(l===null)return;var E=l.tag;if(E===3||E===4){var z=l.stateNode.containerInfo;if(z===p||z.nodeType===8&&z.parentNode===p)break;if(E===4)for(E=l.return;E!==null;){var Y=E.tag;if((Y===3||Y===4)&&(Y=E.stateNode.containerInfo,Y===p||Y.nodeType===8&&Y.parentNode===p))return;E=E.return}for(;z!==null;){if(E=_i(z),E===null)return;if(Y=E.tag,Y===5||Y===6){l=g=E;continue e}z=z.parentNode}}l=l.return}Mn(function(){var ye=g,Pe=rr(o),Ie=[];e:{var je=mn.get(e);if(je!==void 0){var Ke=Xi,Qe=e;switch(e){case"keypress":if(Lo(o)===0)break e;case"keydown":case"keyup":Ke=Ks;break;case"focusin":Qe="focus",Ke=Gi;break;case"focusout":Qe="blur",Ke=Gi;break;case"beforeblur":case"afterblur":Ke=Gi;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ke=Qi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ke=xi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ke=Ws;break;case rt:case ot:case lt:Ke=Ua;break;case dt:Ke=Wa;break;case"scroll":Ke=Fo;break;case"wheel":Ke=Ya;break;case"copy":case"cut":case"paste":Ke=Zi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ke=qa}var Ge=(n&4)!==0,Bt=!Ge&&e==="scroll",pe=Ge?je!==null?je+"Capture":null:je;Ge=[];for(var ne=ye,me;ne!==null;){me=ne;var ze=me.stateNode;if(me.tag===5&&ze!==null&&(me=ze,pe!==null&&(ze=W(ne,pe),ze!=null&&Ge.push(Zs(ne,ze,me)))),Bt)break;ne=ne.return}0<Ge.length&&(je=new Ke(je,Qe,null,o,Pe),Ie.push({event:je,listeners:Ge}))}}if((n&7)===0){e:{if(je=e==="mouseover"||e==="pointerover",Ke=e==="mouseout"||e==="pointerout",je&&o!==kn&&(Qe=o.relatedTarget||o.fromElement)&&(_i(Qe)||Qe[xo]))break e;if((Ke||je)&&(je=Pe.window===Pe?Pe:(je=Pe.ownerDocument)?je.defaultView||je.parentWindow:window,Ke?(Qe=o.relatedTarget||o.toElement,Ke=ye,Qe=Qe?_i(Qe):null,Qe!==null&&(Bt=Lt(Qe),Qe!==Bt||Qe.tag!==5&&Qe.tag!==6)&&(Qe=null)):(Ke=null,Qe=ye),Ke!==Qe)){if(Ge=Qi,ze="onMouseLeave",pe="onMouseEnter",ne="mouse",(e==="pointerout"||e==="pointerover")&&(Ge=qa,ze="onPointerLeave",pe="onPointerEnter",ne="pointer"),Bt=Ke==null?je:as(Ke),me=Qe==null?je:as(Qe),je=new Ge(ze,ne+"leave",Ke,o,Pe),je.target=Bt,je.relatedTarget=me,ze=null,_i(Pe)===ye&&(Ge=new Ge(pe,ne+"enter",Qe,o,Pe),Ge.target=me,Ge.relatedTarget=Bt,ze=Ge),Bt=ze,Ke&&Qe)t:{for(Ge=Ke,pe=Qe,ne=0,me=Ge;me;me=is(me))ne++;for(me=0,ze=pe;ze;ze=is(ze))me++;for(;0<ne-me;)Ge=is(Ge),ne--;for(;0<me-ne;)pe=is(pe),me--;for(;ne--;){if(Ge===pe||pe!==null&&Ge===pe.alternate)break t;Ge=is(Ge),pe=is(pe)}Ge=null}else Ge=null;Ke!==null&&ad(Ie,je,Ke,Ge,!1),Qe!==null&&Bt!==null&&ad(Ie,Bt,Qe,Ge,!0)}}e:{if(je=ye?as(ye):window,Ke=je.nodeName&&je.nodeName.toLowerCase(),Ke==="select"||Ke==="input"&&je.type==="file")var Je=Ko;else if(ho(je))if(kr)Je=O;else{Je=N;var et=_}else(Ke=je.nodeName)&&Ke.toLowerCase()==="input"&&(je.type==="checkbox"||je.type==="radio")&&(Je=T);if(Je&&(Je=Je(e,ye))){Za(Ie,Je,o,Pe);break e}et&&et(e,je,ye),e==="focusout"&&(et=je._wrapperState)&&et.controlled&&je.type==="number"&&tn(je,"number",je.value)}switch(et=ye?as(ye):window,e){case"focusin":(ho(et)||et.contentEditable==="true")&&(de=et,ve=ye,Ne=null);break;case"focusout":Ne=ve=de=null;break;case"mousedown":Ce=!0;break;case"contextmenu":case"mouseup":case"dragend":Ce=!1,De(Ie,o,Pe);break;case"selectionchange":if(ge)break;case"keydown":case"keyup":De(Ie,o,Pe)}var tt;if(Ys)e:{switch(e){case"compositionstart":var st="onCompositionStart";break e;case"compositionend":st="onCompositionEnd";break e;case"compositionupdate":st="onCompositionUpdate";break e}st=void 0}else Sr?Ga(e,o)&&(st="onCompositionEnd"):e==="keydown"&&o.keyCode===229&&(st="onCompositionStart");st&&(Qs&&o.locale!=="ko"&&(Sr||st!=="onCompositionStart"?st==="onCompositionEnd"&&Sr&&(tt=Yi()):(Hr=Pe,Fs="value"in Hr?Hr.value:Hr.textContent,Sr=!0)),et=tl(ye,st),0<et.length&&(st=new Vr(st,e,null,o,Pe),Ie.push({event:st,listeners:et}),tt?st.data=tt:(tt=Ja(o),tt!==null&&(st.data=tt)))),(tt=Xs?br(e,o):Rt(e,o))&&(ye=tl(ye,"onBeforeInput"),0<ye.length&&(Pe=new Vr("onBeforeInput","beforeinput",null,o,Pe),Ie.push({event:Pe,listeners:ye}),Pe.data=tt))}id(Ie,n)})}function Zs(e,n,o){return{instance:e,listener:n,currentTarget:o}}function tl(e,n){for(var o=n+"Capture",l=[];e!==null;){var p=e,g=p.stateNode;p.tag===5&&g!==null&&(p=g,g=W(e,o),g!=null&&l.unshift(Zs(e,g,p)),g=W(e,n),g!=null&&l.push(Zs(e,g,p))),e=e.return}return l}function is(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ad(e,n,o,l,p){for(var g=n._reactName,E=[];o!==null&&o!==l;){var z=o,Y=z.alternate,ye=z.stateNode;if(Y!==null&&Y===l)break;z.tag===5&&ye!==null&&(z=ye,p?(Y=W(o,g),Y!=null&&E.unshift(Zs(o,Y,z))):p||(Y=W(o,g),Y!=null&&E.push(Zs(o,Y,z)))),o=o.return}E.length!==0&&e.push({event:n,listeners:E})}var py=/\r\n?/g,hy=/\u0000|\uFFFD/g;function ld(e){return(typeof e=="string"?e:""+e).replace(py,`
|
|
38
|
+
`).replace(hy,"")}function nl(e,n,o){if(n=ld(n),ld(e)!==n&&o)throw Error(i(425))}function rl(){}var Fu=null,Bu=null;function Hu(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Vu=typeof setTimeout=="function"?setTimeout:void 0,my=typeof clearTimeout=="function"?clearTimeout:void 0,ud=typeof Promise=="function"?Promise:void 0,gy=typeof queueMicrotask=="function"?queueMicrotask:typeof ud<"u"?function(e){return ud.resolve(null).then(e).catch(yy)}:Vu;function yy(e){setTimeout(function(){throw e})}function Uu(e,n){var o=n,l=0;do{var p=o.nextSibling;if(e.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"){if(l===0){e.removeChild(p),lo(n);return}l--}else o!=="$"&&o!=="$?"&&o!=="$!"||l++;o=p}while(o);lo(n)}function Wo(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return e}function cd(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"){if(n===0)return e;n--}else o==="/$"&&n++}e=e.previousSibling}return null}var ss=Math.random().toString(36).slice(2),Ur="__reactFiber$"+ss,ea="__reactProps$"+ss,xo="__reactContainer$"+ss,Ku="__reactEvents$"+ss,vy="__reactListeners$"+ss,xy="__reactHandles$"+ss;function _i(e){var n=e[Ur];if(n)return n;for(var o=e.parentNode;o;){if(n=o[xo]||o[Ur]){if(o=n.alternate,n.child!==null||o!==null&&o.child!==null)for(e=cd(e);e!==null;){if(o=e[Ur])return o;e=cd(e)}return n}e=o,o=e.parentNode}return null}function ta(e){return e=e[Ur]||e[xo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function as(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function ol(e){return e[ea]||null}var qu=[],ls=-1;function Yo(e){return{current:e}}function Pt(e){0>ls||(e.current=qu[ls],qu[ls]=null,ls--)}function kt(e,n){ls++,qu[ls]=e.current,e.current=n}var Xo={},gn=Yo(Xo),On=Yo(!1),Si=Xo;function us(e,n){var o=e.type.contextTypes;if(!o)return Xo;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===n)return l.__reactInternalMemoizedMaskedChildContext;var p={},g;for(g in o)p[g]=n[g];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=p),p}function Rn(e){return e=e.childContextTypes,e!=null}function il(){Pt(On),Pt(gn)}function fd(e,n,o){if(gn.current!==Xo)throw Error(i(168));kt(gn,n),kt(On,o)}function dd(e,n,o){var l=e.stateNode;if(n=n.childContextTypes,typeof l.getChildContext!="function")return o;l=l.getChildContext();for(var p in l)if(!(p in n))throw Error(i(108,Re(e)||"Unknown",p));return F({},o,l)}function sl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xo,Si=gn.current,kt(gn,e),kt(On,On.current),!0}function pd(e,n,o){var l=e.stateNode;if(!l)throw Error(i(169));o?(e=dd(e,n,Si),l.__reactInternalMemoizedMergedChildContext=e,Pt(On),Pt(gn),kt(gn,e)):Pt(On),kt(On,o)}var wo=null,al=!1,Wu=!1;function hd(e){wo===null?wo=[e]:wo.push(e)}function wy(e){al=!0,hd(e)}function Qo(){if(!Wu&&wo!==null){Wu=!0;var e=0,n=xt;try{var o=wo;for(xt=1;e<o.length;e++){var l=o[e];do l=l(!0);while(l!==null)}wo=null,al=!1}catch(p){throw wo!==null&&(wo=wo.slice(e+1)),ci(Dr,Qo),p}finally{xt=n,Wu=!1}}return null}var cs=[],fs=0,ll=null,ul=0,cr=[],fr=0,bi=null,_o=1,So="";function ki(e,n){cs[fs++]=ul,cs[fs++]=ll,ll=e,ul=n}function md(e,n,o){cr[fr++]=_o,cr[fr++]=So,cr[fr++]=bi,bi=e;var l=_o;e=So;var p=32-pn(l)-1;l&=~(1<<p),o+=1;var g=32-pn(n)+p;if(30<g){var E=p-p%5;g=(l&(1<<E)-1).toString(32),l>>=E,p-=E,_o=1<<32-pn(n)+p|o<<p|l,So=g+e}else _o=1<<g|o<<p|l,So=e}function Yu(e){e.return!==null&&(ki(e,1),md(e,1,0))}function Xu(e){for(;e===ll;)ll=cs[--fs],cs[fs]=null,ul=cs[--fs],cs[fs]=null;for(;e===bi;)bi=cr[--fr],cr[fr]=null,So=cr[--fr],cr[fr]=null,_o=cr[--fr],cr[fr]=null}var Qn=null,Gn=null,$t=!1,Nr=null;function gd(e,n){var o=mr(5,null,null,0);o.elementType="DELETED",o.stateNode=n,o.return=e,n=e.deletions,n===null?(e.deletions=[o],e.flags|=16):n.push(o)}function yd(e,n){switch(e.tag){case 5:var o=e.type;return n=n.nodeType!==1||o.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,Qn=e,Gn=Wo(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,Qn=e,Gn=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(o=bi!==null?{id:_o,overflow:So}:null,e.memoizedState={dehydrated:n,treeContext:o,retryLane:1073741824},o=mr(18,null,null,0),o.stateNode=n,o.return=e,e.child=o,Qn=e,Gn=null,!0):!1;default:return!1}}function Qu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Gu(e){if($t){var n=Gn;if(n){var o=n;if(!yd(e,n)){if(Qu(e))throw Error(i(418));n=Wo(o.nextSibling);var l=Qn;n&&yd(e,n)?gd(l,o):(e.flags=e.flags&-4097|2,$t=!1,Qn=e)}}else{if(Qu(e))throw Error(i(418));e.flags=e.flags&-4097|2,$t=!1,Qn=e}}}function vd(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Qn=e}function cl(e){if(e!==Qn)return!1;if(!$t)return vd(e),$t=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!Hu(e.type,e.memoizedProps)),n&&(n=Gn)){if(Qu(e))throw xd(),Error(i(418));for(;n;)gd(e,n),n=Wo(n.nextSibling)}if(vd(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8){var o=e.data;if(o==="/$"){if(n===0){Gn=Wo(e.nextSibling);break e}n--}else o!=="$"&&o!=="$!"&&o!=="$?"||n++}e=e.nextSibling}Gn=null}}else Gn=Qn?Wo(e.stateNode.nextSibling):null;return!0}function xd(){for(var e=Gn;e;)e=Wo(e.nextSibling)}function ds(){Gn=Qn=null,$t=!1}function Ju(e){Nr===null?Nr=[e]:Nr.push(e)}var _y=R.ReactCurrentBatchConfig;function na(e,n,o){if(e=o.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(o._owner){if(o=o._owner,o){if(o.tag!==1)throw Error(i(309));var l=o.stateNode}if(!l)throw Error(i(147,e));var p=l,g=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===g?n.ref:(n=function(E){var z=p.refs;E===null?delete z[g]:z[g]=E},n._stringRef=g,n)}if(typeof e!="string")throw Error(i(284));if(!o._owner)throw Error(i(290,e))}return e}function fl(e,n){throw e=Object.prototype.toString.call(n),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function wd(e){var n=e._init;return n(e._payload)}function _d(e){function n(pe,ne){if(e){var me=pe.deletions;me===null?(pe.deletions=[ne],pe.flags|=16):me.push(ne)}}function o(pe,ne){if(!e)return null;for(;ne!==null;)n(pe,ne),ne=ne.sibling;return null}function l(pe,ne){for(pe=new Map;ne!==null;)ne.key!==null?pe.set(ne.key,ne):pe.set(ne.index,ne),ne=ne.sibling;return pe}function p(pe,ne){return pe=oi(pe,ne),pe.index=0,pe.sibling=null,pe}function g(pe,ne,me){return pe.index=me,e?(me=pe.alternate,me!==null?(me=me.index,me<ne?(pe.flags|=2,ne):me):(pe.flags|=2,ne)):(pe.flags|=1048576,ne)}function E(pe){return e&&pe.alternate===null&&(pe.flags|=2),pe}function z(pe,ne,me,ze){return ne===null||ne.tag!==6?(ne=Vc(me,pe.mode,ze),ne.return=pe,ne):(ne=p(ne,me),ne.return=pe,ne)}function Y(pe,ne,me,ze){var Je=me.type;return Je===X?Pe(pe,ne,me.props.children,ze,me.key):ne!==null&&(ne.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===Q&&wd(Je)===ne.type)?(ze=p(ne,me.props),ze.ref=na(pe,ne,me),ze.return=pe,ze):(ze=Ol(me.type,me.key,me.props,null,pe.mode,ze),ze.ref=na(pe,ne,me),ze.return=pe,ze)}function ye(pe,ne,me,ze){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==me.containerInfo||ne.stateNode.implementation!==me.implementation?(ne=Uc(me,pe.mode,ze),ne.return=pe,ne):(ne=p(ne,me.children||[]),ne.return=pe,ne)}function Pe(pe,ne,me,ze,Je){return ne===null||ne.tag!==7?(ne=Ii(me,pe.mode,ze,Je),ne.return=pe,ne):(ne=p(ne,me),ne.return=pe,ne)}function Ie(pe,ne,me){if(typeof ne=="string"&&ne!==""||typeof ne=="number")return ne=Vc(""+ne,pe.mode,me),ne.return=pe,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case q:return me=Ol(ne.type,ne.key,ne.props,null,pe.mode,me),me.ref=na(pe,null,ne),me.return=pe,me;case B:return ne=Uc(ne,pe.mode,me),ne.return=pe,ne;case Q:var ze=ne._init;return Ie(pe,ze(ne._payload),me)}if(Ot(ne)||U(ne))return ne=Ii(ne,pe.mode,me,null),ne.return=pe,ne;fl(pe,ne)}return null}function je(pe,ne,me,ze){var Je=ne!==null?ne.key:null;if(typeof me=="string"&&me!==""||typeof me=="number")return Je!==null?null:z(pe,ne,""+me,ze);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case q:return me.key===Je?Y(pe,ne,me,ze):null;case B:return me.key===Je?ye(pe,ne,me,ze):null;case Q:return Je=me._init,je(pe,ne,Je(me._payload),ze)}if(Ot(me)||U(me))return Je!==null?null:Pe(pe,ne,me,ze,null);fl(pe,me)}return null}function Ke(pe,ne,me,ze,Je){if(typeof ze=="string"&&ze!==""||typeof ze=="number")return pe=pe.get(me)||null,z(ne,pe,""+ze,Je);if(typeof ze=="object"&&ze!==null){switch(ze.$$typeof){case q:return pe=pe.get(ze.key===null?me:ze.key)||null,Y(ne,pe,ze,Je);case B:return pe=pe.get(ze.key===null?me:ze.key)||null,ye(ne,pe,ze,Je);case Q:var et=ze._init;return Ke(pe,ne,me,et(ze._payload),Je)}if(Ot(ze)||U(ze))return pe=pe.get(me)||null,Pe(ne,pe,ze,Je,null);fl(ne,ze)}return null}function Qe(pe,ne,me,ze){for(var Je=null,et=null,tt=ne,st=ne=0,en=null;tt!==null&&st<me.length;st++){tt.index>st?(en=tt,tt=null):en=tt.sibling;var wt=je(pe,tt,me[st],ze);if(wt===null){tt===null&&(tt=en);break}e&&tt&&wt.alternate===null&&n(pe,tt),ne=g(wt,ne,st),et===null?Je=wt:et.sibling=wt,et=wt,tt=en}if(st===me.length)return o(pe,tt),$t&&ki(pe,st),Je;if(tt===null){for(;st<me.length;st++)tt=Ie(pe,me[st],ze),tt!==null&&(ne=g(tt,ne,st),et===null?Je=tt:et.sibling=tt,et=tt);return $t&&ki(pe,st),Je}for(tt=l(pe,tt);st<me.length;st++)en=Ke(tt,pe,st,me[st],ze),en!==null&&(e&&en.alternate!==null&&tt.delete(en.key===null?st:en.key),ne=g(en,ne,st),et===null?Je=en:et.sibling=en,et=en);return e&&tt.forEach(function(ii){return n(pe,ii)}),$t&&ki(pe,st),Je}function Ge(pe,ne,me,ze){var Je=U(me);if(typeof Je!="function")throw Error(i(150));if(me=Je.call(me),me==null)throw Error(i(151));for(var et=Je=null,tt=ne,st=ne=0,en=null,wt=me.next();tt!==null&&!wt.done;st++,wt=me.next()){tt.index>st?(en=tt,tt=null):en=tt.sibling;var ii=je(pe,tt,wt.value,ze);if(ii===null){tt===null&&(tt=en);break}e&&tt&&ii.alternate===null&&n(pe,tt),ne=g(ii,ne,st),et===null?Je=ii:et.sibling=ii,et=ii,tt=en}if(wt.done)return o(pe,tt),$t&&ki(pe,st),Je;if(tt===null){for(;!wt.done;st++,wt=me.next())wt=Ie(pe,wt.value,ze),wt!==null&&(ne=g(wt,ne,st),et===null?Je=wt:et.sibling=wt,et=wt);return $t&&ki(pe,st),Je}for(tt=l(pe,tt);!wt.done;st++,wt=me.next())wt=Ke(tt,pe,st,wt.value,ze),wt!==null&&(e&&wt.alternate!==null&&tt.delete(wt.key===null?st:wt.key),ne=g(wt,ne,st),et===null?Je=wt:et.sibling=wt,et=wt);return e&&tt.forEach(function(e0){return n(pe,e0)}),$t&&ki(pe,st),Je}function Bt(pe,ne,me,ze){if(typeof me=="object"&&me!==null&&me.type===X&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case q:e:{for(var Je=me.key,et=ne;et!==null;){if(et.key===Je){if(Je=me.type,Je===X){if(et.tag===7){o(pe,et.sibling),ne=p(et,me.props.children),ne.return=pe,pe=ne;break e}}else if(et.elementType===Je||typeof Je=="object"&&Je!==null&&Je.$$typeof===Q&&wd(Je)===et.type){o(pe,et.sibling),ne=p(et,me.props),ne.ref=na(pe,et,me),ne.return=pe,pe=ne;break e}o(pe,et);break}else n(pe,et);et=et.sibling}me.type===X?(ne=Ii(me.props.children,pe.mode,ze,me.key),ne.return=pe,pe=ne):(ze=Ol(me.type,me.key,me.props,null,pe.mode,ze),ze.ref=na(pe,ne,me),ze.return=pe,pe=ze)}return E(pe);case B:e:{for(et=me.key;ne!==null;){if(ne.key===et)if(ne.tag===4&&ne.stateNode.containerInfo===me.containerInfo&&ne.stateNode.implementation===me.implementation){o(pe,ne.sibling),ne=p(ne,me.children||[]),ne.return=pe,pe=ne;break e}else{o(pe,ne);break}else n(pe,ne);ne=ne.sibling}ne=Uc(me,pe.mode,ze),ne.return=pe,pe=ne}return E(pe);case Q:return et=me._init,Bt(pe,ne,et(me._payload),ze)}if(Ot(me))return Qe(pe,ne,me,ze);if(U(me))return Ge(pe,ne,me,ze);fl(pe,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,ne!==null&&ne.tag===6?(o(pe,ne.sibling),ne=p(ne,me),ne.return=pe,pe=ne):(o(pe,ne),ne=Vc(me,pe.mode,ze),ne.return=pe,pe=ne),E(pe)):o(pe,ne)}return Bt}var ps=_d(!0),Sd=_d(!1),dl=Yo(null),pl=null,hs=null,Zu=null;function ec(){Zu=hs=pl=null}function tc(e){var n=dl.current;Pt(dl),e._currentValue=n}function nc(e,n,o){for(;e!==null;){var l=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,l!==null&&(l.childLanes|=n)):l!==null&&(l.childLanes&n)!==n&&(l.childLanes|=n),e===o)break;e=e.return}}function ms(e,n){pl=e,Zu=hs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Dn=!0),e.firstContext=null)}function dr(e){var n=e._currentValue;if(Zu!==e)if(e={context:e,memoizedValue:n,next:null},hs===null){if(pl===null)throw Error(i(308));hs=e,pl.dependencies={lanes:0,firstContext:e}}else hs=hs.next=e;return n}var Ni=null;function rc(e){Ni===null?Ni=[e]:Ni.push(e)}function bd(e,n,o,l){var p=n.interleaved;return p===null?(o.next=o,rc(n)):(o.next=p.next,p.next=o),n.interleaved=o,bo(e,l)}function bo(e,n){e.lanes|=n;var o=e.alternate;for(o!==null&&(o.lanes|=n),o=e,e=e.return;e!==null;)e.childLanes|=n,o=e.alternate,o!==null&&(o.childLanes|=n),o=e,e=e.return;return o.tag===3?o.stateNode:null}var Go=!1;function oc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function kd(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function ko(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function Jo(e,n,o){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(vt&2)!==0){var p=l.pending;return p===null?n.next=n:(n.next=p.next,p.next=n),l.pending=n,bo(e,o)}return p=l.interleaved,p===null?(n.next=n,rc(l)):(n.next=p.next,p.next=n),l.interleaved=n,bo(e,o)}function hl(e,n,o){if(n=n.updateQueue,n!==null&&(n=n.shared,(o&4194240)!==0)){var l=n.lanes;l&=e.pendingLanes,o|=l,n.lanes=o,Ro(e,o)}}function Nd(e,n){var o=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var p=null,g=null;if(o=o.firstBaseUpdate,o!==null){do{var E={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};g===null?p=g=E:g=g.next=E,o=o.next}while(o!==null);g===null?p=g=n:g=g.next=n}else p=g=n;o={baseState:l.baseState,firstBaseUpdate:p,lastBaseUpdate:g,shared:l.shared,effects:l.effects},e.updateQueue=o;return}e=o.lastBaseUpdate,e===null?o.firstBaseUpdate=n:e.next=n,o.lastBaseUpdate=n}function ml(e,n,o,l){var p=e.updateQueue;Go=!1;var g=p.firstBaseUpdate,E=p.lastBaseUpdate,z=p.shared.pending;if(z!==null){p.shared.pending=null;var Y=z,ye=Y.next;Y.next=null,E===null?g=ye:E.next=ye,E=Y;var Pe=e.alternate;Pe!==null&&(Pe=Pe.updateQueue,z=Pe.lastBaseUpdate,z!==E&&(z===null?Pe.firstBaseUpdate=ye:z.next=ye,Pe.lastBaseUpdate=Y))}if(g!==null){var Ie=p.baseState;E=0,Pe=ye=Y=null,z=g;do{var je=z.lane,Ke=z.eventTime;if((l&je)===je){Pe!==null&&(Pe=Pe.next={eventTime:Ke,lane:0,tag:z.tag,payload:z.payload,callback:z.callback,next:null});e:{var Qe=e,Ge=z;switch(je=n,Ke=o,Ge.tag){case 1:if(Qe=Ge.payload,typeof Qe=="function"){Ie=Qe.call(Ke,Ie,je);break e}Ie=Qe;break e;case 3:Qe.flags=Qe.flags&-65537|128;case 0:if(Qe=Ge.payload,je=typeof Qe=="function"?Qe.call(Ke,Ie,je):Qe,je==null)break e;Ie=F({},Ie,je);break e;case 2:Go=!0}}z.callback!==null&&z.lane!==0&&(e.flags|=64,je=p.effects,je===null?p.effects=[z]:je.push(z))}else Ke={eventTime:Ke,lane:je,tag:z.tag,payload:z.payload,callback:z.callback,next:null},Pe===null?(ye=Pe=Ke,Y=Ie):Pe=Pe.next=Ke,E|=je;if(z=z.next,z===null){if(z=p.shared.pending,z===null)break;je=z,z=je.next,je.next=null,p.lastBaseUpdate=je,p.shared.pending=null}}while(!0);if(Pe===null&&(Y=Ie),p.baseState=Y,p.firstBaseUpdate=ye,p.lastBaseUpdate=Pe,n=p.shared.interleaved,n!==null){p=n;do E|=p.lane,p=p.next;while(p!==n)}else g===null&&(p.shared.lanes=0);ji|=E,e.lanes=E,e.memoizedState=Ie}}function Ed(e,n,o){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var l=e[n],p=l.callback;if(p!==null){if(l.callback=null,l=o,typeof p!="function")throw Error(i(191,p));p.call(l)}}}var ra={},Kr=Yo(ra),oa=Yo(ra),ia=Yo(ra);function Ei(e){if(e===ra)throw Error(i(174));return e}function ic(e,n){switch(kt(ia,n),kt(oa,e),kt(Kr,ra),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:Ht(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=Ht(n,e)}Pt(Kr),kt(Kr,n)}function gs(){Pt(Kr),Pt(oa),Pt(ia)}function Cd(e){Ei(ia.current);var n=Ei(Kr.current),o=Ht(n,e.type);n!==o&&(kt(oa,e),kt(Kr,o))}function sc(e){oa.current===e&&(Pt(Kr),Pt(oa))}var Dt=Yo(0);function gl(e){for(var n=e;n!==null;){if(n.tag===13){var o=n.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||o.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var ac=[];function lc(){for(var e=0;e<ac.length;e++)ac[e]._workInProgressVersionPrimary=null;ac.length=0}var yl=R.ReactCurrentDispatcher,uc=R.ReactCurrentBatchConfig,Ci=0,zt=null,Yt=null,Jt=null,vl=!1,sa=!1,aa=0,Sy=0;function yn(){throw Error(i(321))}function cc(e,n){if(n===null)return!1;for(var o=0;o<n.length&&o<e.length;o++)if(!ue(e[o],n[o]))return!1;return!0}function fc(e,n,o,l,p,g){if(Ci=g,zt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,yl.current=e===null||e.memoizedState===null?Ey:Cy,e=o(l,p),sa){g=0;do{if(sa=!1,aa=0,25<=g)throw Error(i(301));g+=1,Jt=Yt=null,n.updateQueue=null,yl.current=jy,e=o(l,p)}while(sa)}if(yl.current=_l,n=Yt!==null&&Yt.next!==null,Ci=0,Jt=Yt=zt=null,vl=!1,n)throw Error(i(300));return e}function dc(){var e=aa!==0;return aa=0,e}function qr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Jt===null?zt.memoizedState=Jt=e:Jt=Jt.next=e,Jt}function pr(){if(Yt===null){var e=zt.alternate;e=e!==null?e.memoizedState:null}else e=Yt.next;var n=Jt===null?zt.memoizedState:Jt.next;if(n!==null)Jt=n,Yt=e;else{if(e===null)throw Error(i(310));Yt=e,e={memoizedState:Yt.memoizedState,baseState:Yt.baseState,baseQueue:Yt.baseQueue,queue:Yt.queue,next:null},Jt===null?zt.memoizedState=Jt=e:Jt=Jt.next=e}return Jt}function la(e,n){return typeof n=="function"?n(e):n}function pc(e){var n=pr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var l=Yt,p=l.baseQueue,g=o.pending;if(g!==null){if(p!==null){var E=p.next;p.next=g.next,g.next=E}l.baseQueue=p=g,o.pending=null}if(p!==null){g=p.next,l=l.baseState;var z=E=null,Y=null,ye=g;do{var Pe=ye.lane;if((Ci&Pe)===Pe)Y!==null&&(Y=Y.next={lane:0,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null}),l=ye.hasEagerState?ye.eagerState:e(l,ye.action);else{var Ie={lane:Pe,action:ye.action,hasEagerState:ye.hasEagerState,eagerState:ye.eagerState,next:null};Y===null?(z=Y=Ie,E=l):Y=Y.next=Ie,zt.lanes|=Pe,ji|=Pe}ye=ye.next}while(ye!==null&&ye!==g);Y===null?E=l:Y.next=z,ue(l,n.memoizedState)||(Dn=!0),n.memoizedState=l,n.baseState=E,n.baseQueue=Y,o.lastRenderedState=l}if(e=o.interleaved,e!==null){p=e;do g=p.lane,zt.lanes|=g,ji|=g,p=p.next;while(p!==e)}else p===null&&(o.lanes=0);return[n.memoizedState,o.dispatch]}function hc(e){var n=pr(),o=n.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=e;var l=o.dispatch,p=o.pending,g=n.memoizedState;if(p!==null){o.pending=null;var E=p=p.next;do g=e(g,E.action),E=E.next;while(E!==p);ue(g,n.memoizedState)||(Dn=!0),n.memoizedState=g,n.baseQueue===null&&(n.baseState=g),o.lastRenderedState=g}return[g,l]}function jd(){}function Pd(e,n){var o=zt,l=pr(),p=n(),g=!ue(l.memoizedState,p);if(g&&(l.memoizedState=p,Dn=!0),l=l.queue,mc(Id.bind(null,o,l,e),[e]),l.getSnapshot!==n||g||Jt!==null&&Jt.memoizedState.tag&1){if(o.flags|=2048,ua(9,Md.bind(null,o,l,p,n),void 0,null),Zt===null)throw Error(i(349));(Ci&30)!==0||Td(o,n,p)}return p}function Td(e,n,o){e.flags|=16384,e={getSnapshot:n,value:o},n=zt.updateQueue,n===null?(n={lastEffect:null,stores:null},zt.updateQueue=n,n.stores=[e]):(o=n.stores,o===null?n.stores=[e]:o.push(e))}function Md(e,n,o,l){n.value=o,n.getSnapshot=l,$d(n)&&Ad(e)}function Id(e,n,o){return o(function(){$d(n)&&Ad(e)})}function $d(e){var n=e.getSnapshot;e=e.value;try{var o=n();return!ue(e,o)}catch{return!0}}function Ad(e){var n=bo(e,1);n!==null&&Pr(n,e,1,-1)}function Od(e){var n=qr();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:la,lastRenderedState:e},n.queue=e,e=e.dispatch=Ny.bind(null,zt,e),[n.memoizedState,e]}function ua(e,n,o,l){return e={tag:e,create:n,destroy:o,deps:l,next:null},n=zt.updateQueue,n===null?(n={lastEffect:null,stores:null},zt.updateQueue=n,n.lastEffect=e.next=e):(o=n.lastEffect,o===null?n.lastEffect=e.next=e:(l=o.next,o.next=e,e.next=l,n.lastEffect=e)),e}function Rd(){return pr().memoizedState}function xl(e,n,o,l){var p=qr();zt.flags|=e,p.memoizedState=ua(1|n,o,void 0,l===void 0?null:l)}function wl(e,n,o,l){var p=pr();l=l===void 0?null:l;var g=void 0;if(Yt!==null){var E=Yt.memoizedState;if(g=E.destroy,l!==null&&cc(l,E.deps)){p.memoizedState=ua(n,o,g,l);return}}zt.flags|=e,p.memoizedState=ua(1|n,o,g,l)}function Dd(e,n){return xl(8390656,8,e,n)}function mc(e,n){return wl(2048,8,e,n)}function zd(e,n){return wl(4,2,e,n)}function Ld(e,n){return wl(4,4,e,n)}function Fd(e,n){if(typeof n=="function")return e=e(),n(e),function(){n(null)};if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Bd(e,n,o){return o=o!=null?o.concat([e]):null,wl(4,4,Fd.bind(null,n,e),o)}function gc(){}function Hd(e,n){var o=pr();n=n===void 0?null:n;var l=o.memoizedState;return l!==null&&n!==null&&cc(n,l[1])?l[0]:(o.memoizedState=[e,n],e)}function Vd(e,n){var o=pr();n=n===void 0?null:n;var l=o.memoizedState;return l!==null&&n!==null&&cc(n,l[1])?l[0]:(e=e(),o.memoizedState=[e,n],e)}function Ud(e,n,o){return(Ci&21)===0?(e.baseState&&(e.baseState=!1,Dn=!0),e.memoizedState=o):(ue(o,n)||(o=Fr(),zt.lanes|=o,ji|=o,e.baseState=!0),n)}function by(e,n){var o=xt;xt=o!==0&&4>o?o:4,e(!0);var l=uc.transition;uc.transition={};try{e(!1),n()}finally{xt=o,uc.transition=l}}function Kd(){return pr().memoizedState}function ky(e,n,o){var l=ni(e);if(o={lane:l,action:o,hasEagerState:!1,eagerState:null,next:null},qd(e))Wd(n,o);else if(o=bd(e,n,o,l),o!==null){var p=jn();Pr(o,e,l,p),Yd(o,n,l)}}function Ny(e,n,o){var l=ni(e),p={lane:l,action:o,hasEagerState:!1,eagerState:null,next:null};if(qd(e))Wd(n,p);else{var g=e.alternate;if(e.lanes===0&&(g===null||g.lanes===0)&&(g=n.lastRenderedReducer,g!==null))try{var E=n.lastRenderedState,z=g(E,o);if(p.hasEagerState=!0,p.eagerState=z,ue(z,E)){var Y=n.interleaved;Y===null?(p.next=p,rc(n)):(p.next=Y.next,Y.next=p),n.interleaved=p;return}}catch{}finally{}o=bd(e,n,p,l),o!==null&&(p=jn(),Pr(o,e,l,p),Yd(o,n,l))}}function qd(e){var n=e.alternate;return e===zt||n!==null&&n===zt}function Wd(e,n){sa=vl=!0;var o=e.pending;o===null?n.next=n:(n.next=o.next,o.next=n),e.pending=n}function Yd(e,n,o){if((o&4194240)!==0){var l=n.lanes;l&=e.pendingLanes,o|=l,n.lanes=o,Ro(e,o)}}var _l={readContext:dr,useCallback:yn,useContext:yn,useEffect:yn,useImperativeHandle:yn,useInsertionEffect:yn,useLayoutEffect:yn,useMemo:yn,useReducer:yn,useRef:yn,useState:yn,useDebugValue:yn,useDeferredValue:yn,useTransition:yn,useMutableSource:yn,useSyncExternalStore:yn,useId:yn,unstable_isNewReconciler:!1},Ey={readContext:dr,useCallback:function(e,n){return qr().memoizedState=[e,n===void 0?null:n],e},useContext:dr,useEffect:Dd,useImperativeHandle:function(e,n,o){return o=o!=null?o.concat([e]):null,xl(4194308,4,Fd.bind(null,n,e),o)},useLayoutEffect:function(e,n){return xl(4194308,4,e,n)},useInsertionEffect:function(e,n){return xl(4,2,e,n)},useMemo:function(e,n){var o=qr();return n=n===void 0?null:n,e=e(),o.memoizedState=[e,n],e},useReducer:function(e,n,o){var l=qr();return n=o!==void 0?o(n):n,l.memoizedState=l.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},l.queue=e,e=e.dispatch=ky.bind(null,zt,e),[l.memoizedState,e]},useRef:function(e){var n=qr();return e={current:e},n.memoizedState=e},useState:Od,useDebugValue:gc,useDeferredValue:function(e){return qr().memoizedState=e},useTransition:function(){var e=Od(!1),n=e[0];return e=by.bind(null,e[1]),qr().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,o){var l=zt,p=qr();if($t){if(o===void 0)throw Error(i(407));o=o()}else{if(o=n(),Zt===null)throw Error(i(349));(Ci&30)!==0||Td(l,n,o)}p.memoizedState=o;var g={value:o,getSnapshot:n};return p.queue=g,Dd(Id.bind(null,l,g,e),[e]),l.flags|=2048,ua(9,Md.bind(null,l,g,o,n),void 0,null),o},useId:function(){var e=qr(),n=Zt.identifierPrefix;if($t){var o=So,l=_o;o=(l&~(1<<32-pn(l)-1)).toString(32)+o,n=":"+n+"R"+o,o=aa++,0<o&&(n+="H"+o.toString(32)),n+=":"}else o=Sy++,n=":"+n+"r"+o.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},Cy={readContext:dr,useCallback:Hd,useContext:dr,useEffect:mc,useImperativeHandle:Bd,useInsertionEffect:zd,useLayoutEffect:Ld,useMemo:Vd,useReducer:pc,useRef:Rd,useState:function(){return pc(la)},useDebugValue:gc,useDeferredValue:function(e){var n=pr();return Ud(n,Yt.memoizedState,e)},useTransition:function(){var e=pc(la)[0],n=pr().memoizedState;return[e,n]},useMutableSource:jd,useSyncExternalStore:Pd,useId:Kd,unstable_isNewReconciler:!1},jy={readContext:dr,useCallback:Hd,useContext:dr,useEffect:mc,useImperativeHandle:Bd,useInsertionEffect:zd,useLayoutEffect:Ld,useMemo:Vd,useReducer:hc,useRef:Rd,useState:function(){return hc(la)},useDebugValue:gc,useDeferredValue:function(e){var n=pr();return Yt===null?n.memoizedState=e:Ud(n,Yt.memoizedState,e)},useTransition:function(){var e=hc(la)[0],n=pr().memoizedState;return[e,n]},useMutableSource:jd,useSyncExternalStore:Pd,useId:Kd,unstable_isNewReconciler:!1};function Er(e,n){if(e&&e.defaultProps){n=F({},n),e=e.defaultProps;for(var o in e)n[o]===void 0&&(n[o]=e[o]);return n}return n}function yc(e,n,o,l){n=e.memoizedState,o=o(l,n),o=o==null?n:F({},n,o),e.memoizedState=o,e.lanes===0&&(e.updateQueue.baseState=o)}var Sl={isMounted:function(e){return(e=e._reactInternals)?Lt(e)===e:!1},enqueueSetState:function(e,n,o){e=e._reactInternals;var l=jn(),p=ni(e),g=ko(l,p);g.payload=n,o!=null&&(g.callback=o),n=Jo(e,g,p),n!==null&&(Pr(n,e,p,l),hl(n,e,p))},enqueueReplaceState:function(e,n,o){e=e._reactInternals;var l=jn(),p=ni(e),g=ko(l,p);g.tag=1,g.payload=n,o!=null&&(g.callback=o),n=Jo(e,g,p),n!==null&&(Pr(n,e,p,l),hl(n,e,p))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var o=jn(),l=ni(e),p=ko(o,l);p.tag=2,n!=null&&(p.callback=n),n=Jo(e,p,l),n!==null&&(Pr(n,e,l,o),hl(n,e,l))}};function Xd(e,n,o,l,p,g,E){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,g,E):n.prototype&&n.prototype.isPureReactComponent?!te(o,l)||!te(p,g):!0}function Qd(e,n,o){var l=!1,p=Xo,g=n.contextType;return typeof g=="object"&&g!==null?g=dr(g):(p=Rn(n)?Si:gn.current,l=n.contextTypes,g=(l=l!=null)?us(e,p):Xo),n=new n(o,g),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Sl,e.stateNode=n,n._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=p,e.__reactInternalMemoizedMaskedChildContext=g),n}function Gd(e,n,o,l){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(o,l),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(o,l),n.state!==e&&Sl.enqueueReplaceState(n,n.state,null)}function vc(e,n,o,l){var p=e.stateNode;p.props=o,p.state=e.memoizedState,p.refs={},oc(e);var g=n.contextType;typeof g=="object"&&g!==null?p.context=dr(g):(g=Rn(n)?Si:gn.current,p.context=us(e,g)),p.state=e.memoizedState,g=n.getDerivedStateFromProps,typeof g=="function"&&(yc(e,n,g,o),p.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(n=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),n!==p.state&&Sl.enqueueReplaceState(p,p.state,null),ml(e,o,p,l),p.state=e.memoizedState),typeof p.componentDidMount=="function"&&(e.flags|=4194308)}function ys(e,n){try{var o="",l=n;do o+=Te(l),l=l.return;while(l);var p=o}catch(g){p=`
|
|
39
|
+
Error generating stack: `+g.message+`
|
|
40
|
+
`+g.stack}return{value:e,source:n,stack:p,digest:null}}function xc(e,n,o){return{value:e,source:null,stack:o??null,digest:n??null}}function wc(e,n){try{console.error(n.value)}catch(o){setTimeout(function(){throw o})}}var Py=typeof WeakMap=="function"?WeakMap:Map;function Jd(e,n,o){o=ko(-1,o),o.tag=3,o.payload={element:null};var l=n.value;return o.callback=function(){Pl||(Pl=!0,Oc=l),wc(e,n)},o}function Zd(e,n,o){o=ko(-1,o),o.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var p=n.value;o.payload=function(){return l(p)},o.callback=function(){wc(e,n)}}var g=e.stateNode;return g!==null&&typeof g.componentDidCatch=="function"&&(o.callback=function(){wc(e,n),typeof l!="function"&&(ei===null?ei=new Set([this]):ei.add(this));var E=n.stack;this.componentDidCatch(n.value,{componentStack:E!==null?E:""})}),o}function ep(e,n,o){var l=e.pingCache;if(l===null){l=e.pingCache=new Py;var p=new Set;l.set(n,p)}else p=l.get(n),p===void 0&&(p=new Set,l.set(n,p));p.has(o)||(p.add(o),e=Vy.bind(null,e,n,o),n.then(e,e))}function tp(e){do{var n;if((n=e.tag===13)&&(n=e.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return e;e=e.return}while(e!==null);return null}function np(e,n,o,l,p){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,o.flags|=131072,o.flags&=-52805,o.tag===1&&(o.alternate===null?o.tag=17:(n=ko(-1,1),n.tag=2,Jo(o,n,1))),o.lanes|=1),e):(e.flags|=65536,e.lanes=p,e)}var Ty=R.ReactCurrentOwner,Dn=!1;function Cn(e,n,o,l){n.child=e===null?Sd(n,null,o,l):ps(n,e.child,o,l)}function rp(e,n,o,l,p){o=o.render;var g=n.ref;return ms(n,p),l=fc(e,n,o,l,g,p),o=dc(),e!==null&&!Dn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,No(e,n,p)):($t&&o&&Yu(n),n.flags|=1,Cn(e,n,l,p),n.child)}function op(e,n,o,l,p){if(e===null){var g=o.type;return typeof g=="function"&&!Hc(g)&&g.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(n.tag=15,n.type=g,ip(e,n,g,l,p)):(e=Ol(o.type,null,l,n,n.mode,p),e.ref=n.ref,e.return=n,n.child=e)}if(g=e.child,(e.lanes&p)===0){var E=g.memoizedProps;if(o=o.compare,o=o!==null?o:te,o(E,l)&&e.ref===n.ref)return No(e,n,p)}return n.flags|=1,e=oi(g,l),e.ref=n.ref,e.return=n,n.child=e}function ip(e,n,o,l,p){if(e!==null){var g=e.memoizedProps;if(te(g,l)&&e.ref===n.ref)if(Dn=!1,n.pendingProps=l=g,(e.lanes&p)!==0)(e.flags&131072)!==0&&(Dn=!0);else return n.lanes=e.lanes,No(e,n,p)}return _c(e,n,o,l,p)}function sp(e,n,o){var l=n.pendingProps,p=l.children,g=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},kt(xs,Jn),Jn|=o;else{if((o&1073741824)===0)return e=g!==null?g.baseLanes|o:o,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,kt(xs,Jn),Jn|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=g!==null?g.baseLanes:o,kt(xs,Jn),Jn|=l}else g!==null?(l=g.baseLanes|o,n.memoizedState=null):l=o,kt(xs,Jn),Jn|=l;return Cn(e,n,p,o),n.child}function ap(e,n){var o=n.ref;(e===null&&o!==null||e!==null&&e.ref!==o)&&(n.flags|=512,n.flags|=2097152)}function _c(e,n,o,l,p){var g=Rn(o)?Si:gn.current;return g=us(n,g),ms(n,p),o=fc(e,n,o,l,g,p),l=dc(),e!==null&&!Dn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,No(e,n,p)):($t&&l&&Yu(n),n.flags|=1,Cn(e,n,o,p),n.child)}function lp(e,n,o,l,p){if(Rn(o)){var g=!0;sl(n)}else g=!1;if(ms(n,p),n.stateNode===null)kl(e,n),Qd(n,o,l),vc(n,o,l,p),l=!0;else if(e===null){var E=n.stateNode,z=n.memoizedProps;E.props=z;var Y=E.context,ye=o.contextType;typeof ye=="object"&&ye!==null?ye=dr(ye):(ye=Rn(o)?Si:gn.current,ye=us(n,ye));var Pe=o.getDerivedStateFromProps,Ie=typeof Pe=="function"||typeof E.getSnapshotBeforeUpdate=="function";Ie||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(z!==l||Y!==ye)&&Gd(n,E,l,ye),Go=!1;var je=n.memoizedState;E.state=je,ml(n,l,E,p),Y=n.memoizedState,z!==l||je!==Y||On.current||Go?(typeof Pe=="function"&&(yc(n,o,Pe,l),Y=n.memoizedState),(z=Go||Xd(n,o,z,l,je,Y,ye))?(Ie||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(n.flags|=4194308)):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=l,n.memoizedState=Y),E.props=l,E.state=Y,E.context=ye,l=z):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),l=!1)}else{E=n.stateNode,kd(e,n),z=n.memoizedProps,ye=n.type===n.elementType?z:Er(n.type,z),E.props=ye,Ie=n.pendingProps,je=E.context,Y=o.contextType,typeof Y=="object"&&Y!==null?Y=dr(Y):(Y=Rn(o)?Si:gn.current,Y=us(n,Y));var Ke=o.getDerivedStateFromProps;(Pe=typeof Ke=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(z!==Ie||je!==Y)&&Gd(n,E,l,Y),Go=!1,je=n.memoizedState,E.state=je,ml(n,l,E,p);var Qe=n.memoizedState;z!==Ie||je!==Qe||On.current||Go?(typeof Ke=="function"&&(yc(n,o,Ke,l),Qe=n.memoizedState),(ye=Go||Xd(n,o,ye,l,je,Qe,Y)||!1)?(Pe||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(l,Qe,Y),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(l,Qe,Y)),typeof E.componentDidUpdate=="function"&&(n.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof E.componentDidUpdate!="function"||z===e.memoizedProps&&je===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||z===e.memoizedProps&&je===e.memoizedState||(n.flags|=1024),n.memoizedProps=l,n.memoizedState=Qe),E.props=l,E.state=Qe,E.context=Y,l=ye):(typeof E.componentDidUpdate!="function"||z===e.memoizedProps&&je===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||z===e.memoizedProps&&je===e.memoizedState||(n.flags|=1024),l=!1)}return Sc(e,n,o,l,g,p)}function Sc(e,n,o,l,p,g){ap(e,n);var E=(n.flags&128)!==0;if(!l&&!E)return p&&pd(n,o,!1),No(e,n,g);l=n.stateNode,Ty.current=n;var z=E&&typeof o.getDerivedStateFromError!="function"?null:l.render();return n.flags|=1,e!==null&&E?(n.child=ps(n,e.child,null,g),n.child=ps(n,null,z,g)):Cn(e,n,z,g),n.memoizedState=l.state,p&&pd(n,o,!0),n.child}function up(e){var n=e.stateNode;n.pendingContext?fd(e,n.pendingContext,n.pendingContext!==n.context):n.context&&fd(e,n.context,!1),ic(e,n.containerInfo)}function cp(e,n,o,l,p){return ds(),Ju(p),n.flags|=256,Cn(e,n,o,l),n.child}var bc={dehydrated:null,treeContext:null,retryLane:0};function kc(e){return{baseLanes:e,cachePool:null,transitions:null}}function fp(e,n,o){var l=n.pendingProps,p=Dt.current,g=!1,E=(n.flags&128)!==0,z;if((z=E)||(z=e!==null&&e.memoizedState===null?!1:(p&2)!==0),z?(g=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(p|=1),kt(Dt,p&1),e===null)return Gu(n),e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((n.mode&1)===0?n.lanes=1:e.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(E=l.children,e=l.fallback,g?(l=n.mode,g=n.child,E={mode:"hidden",children:E},(l&1)===0&&g!==null?(g.childLanes=0,g.pendingProps=E):g=Rl(E,l,0,null),e=Ii(e,l,o,null),g.return=n,e.return=n,g.sibling=e,n.child=g,n.child.memoizedState=kc(o),n.memoizedState=bc,e):Nc(n,E));if(p=e.memoizedState,p!==null&&(z=p.dehydrated,z!==null))return My(e,n,E,l,z,p,o);if(g){g=l.fallback,E=n.mode,p=e.child,z=p.sibling;var Y={mode:"hidden",children:l.children};return(E&1)===0&&n.child!==p?(l=n.child,l.childLanes=0,l.pendingProps=Y,n.deletions=null):(l=oi(p,Y),l.subtreeFlags=p.subtreeFlags&14680064),z!==null?g=oi(z,g):(g=Ii(g,E,o,null),g.flags|=2),g.return=n,l.return=n,l.sibling=g,n.child=l,l=g,g=n.child,E=e.child.memoizedState,E=E===null?kc(o):{baseLanes:E.baseLanes|o,cachePool:null,transitions:E.transitions},g.memoizedState=E,g.childLanes=e.childLanes&~o,n.memoizedState=bc,l}return g=e.child,e=g.sibling,l=oi(g,{mode:"visible",children:l.children}),(n.mode&1)===0&&(l.lanes=o),l.return=n,l.sibling=null,e!==null&&(o=n.deletions,o===null?(n.deletions=[e],n.flags|=16):o.push(e)),n.child=l,n.memoizedState=null,l}function Nc(e,n){return n=Rl({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function bl(e,n,o,l){return l!==null&&Ju(l),ps(n,e.child,null,o),e=Nc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function My(e,n,o,l,p,g,E){if(o)return n.flags&256?(n.flags&=-257,l=xc(Error(i(422))),bl(e,n,E,l)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(g=l.fallback,p=n.mode,l=Rl({mode:"visible",children:l.children},p,0,null),g=Ii(g,p,E,null),g.flags|=2,l.return=n,g.return=n,l.sibling=g,n.child=l,(n.mode&1)!==0&&ps(n,e.child,null,E),n.child.memoizedState=kc(E),n.memoizedState=bc,g);if((n.mode&1)===0)return bl(e,n,E,null);if(p.data==="$!"){if(l=p.nextSibling&&p.nextSibling.dataset,l)var z=l.dgst;return l=z,g=Error(i(419)),l=xc(g,l,void 0),bl(e,n,E,l)}if(z=(E&e.childLanes)!==0,Dn||z){if(l=Zt,l!==null){switch(E&-E){case 4:p=2;break;case 16:p=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:p=32;break;case 536870912:p=268435456;break;default:p=0}p=(p&(l.suspendedLanes|E))!==0?0:p,p!==0&&p!==g.retryLane&&(g.retryLane=p,bo(e,p),Pr(l,e,p,-1))}return Bc(),l=xc(Error(i(421))),bl(e,n,E,l)}return p.data==="$?"?(n.flags|=128,n.child=e.child,n=Uy.bind(null,e),p._reactRetry=n,null):(e=g.treeContext,Gn=Wo(p.nextSibling),Qn=n,$t=!0,Nr=null,e!==null&&(cr[fr++]=_o,cr[fr++]=So,cr[fr++]=bi,_o=e.id,So=e.overflow,bi=n),n=Nc(n,l.children),n.flags|=4096,n)}function dp(e,n,o){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n),nc(e.return,n,o)}function Ec(e,n,o,l,p){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:p}:(g.isBackwards=n,g.rendering=null,g.renderingStartTime=0,g.last=l,g.tail=o,g.tailMode=p)}function pp(e,n,o){var l=n.pendingProps,p=l.revealOrder,g=l.tail;if(Cn(e,n,l.children,o),l=Dt.current,(l&2)!==0)l=l&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&dp(e,o,n);else if(e.tag===19)dp(e,o,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}l&=1}if(kt(Dt,l),(n.mode&1)===0)n.memoizedState=null;else switch(p){case"forwards":for(o=n.child,p=null;o!==null;)e=o.alternate,e!==null&&gl(e)===null&&(p=o),o=o.sibling;o=p,o===null?(p=n.child,n.child=null):(p=o.sibling,o.sibling=null),Ec(n,!1,p,o,g);break;case"backwards":for(o=null,p=n.child,n.child=null;p!==null;){if(e=p.alternate,e!==null&&gl(e)===null){n.child=p;break}e=p.sibling,p.sibling=o,o=p,p=e}Ec(n,!0,o,null,g);break;case"together":Ec(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function kl(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function No(e,n,o){if(e!==null&&(n.dependencies=e.dependencies),ji|=n.lanes,(o&n.childLanes)===0)return null;if(e!==null&&n.child!==e.child)throw Error(i(153));if(n.child!==null){for(e=n.child,o=oi(e,e.pendingProps),n.child=o,o.return=n;e.sibling!==null;)e=e.sibling,o=o.sibling=oi(e,e.pendingProps),o.return=n;o.sibling=null}return n.child}function Iy(e,n,o){switch(n.tag){case 3:up(n),ds();break;case 5:Cd(n);break;case 1:Rn(n.type)&&sl(n);break;case 4:ic(n,n.stateNode.containerInfo);break;case 10:var l=n.type._context,p=n.memoizedProps.value;kt(dl,l._currentValue),l._currentValue=p;break;case 13:if(l=n.memoizedState,l!==null)return l.dehydrated!==null?(kt(Dt,Dt.current&1),n.flags|=128,null):(o&n.child.childLanes)!==0?fp(e,n,o):(kt(Dt,Dt.current&1),e=No(e,n,o),e!==null?e.sibling:null);kt(Dt,Dt.current&1);break;case 19:if(l=(o&n.childLanes)!==0,(e.flags&128)!==0){if(l)return pp(e,n,o);n.flags|=128}if(p=n.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),kt(Dt,Dt.current),l)break;return null;case 22:case 23:return n.lanes=0,sp(e,n,o)}return No(e,n,o)}var hp,Cc,mp,gp;hp=function(e,n){for(var o=n.child;o!==null;){if(o.tag===5||o.tag===6)e.appendChild(o.stateNode);else if(o.tag!==4&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===n)break;for(;o.sibling===null;){if(o.return===null||o.return===n)return;o=o.return}o.sibling.return=o.return,o=o.sibling}},Cc=function(){},mp=function(e,n,o,l){var p=e.memoizedProps;if(p!==l){e=n.stateNode,Ei(Kr.current);var g=null;switch(o){case"input":p=ut(e,p),l=ut(e,l),g=[];break;case"select":p=F({},p,{value:void 0}),l=F({},l,{value:void 0}),g=[];break;case"textarea":p=wn(e,p),l=wn(e,l),g=[];break;default:typeof p.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=rl)}Ye(o,l);var E;o=null;for(ye in p)if(!l.hasOwnProperty(ye)&&p.hasOwnProperty(ye)&&p[ye]!=null)if(ye==="style"){var z=p[ye];for(E in z)z.hasOwnProperty(E)&&(o||(o={}),o[E]="")}else ye!=="dangerouslySetInnerHTML"&&ye!=="children"&&ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&ye!=="autoFocus"&&(u.hasOwnProperty(ye)?g||(g=[]):(g=g||[]).push(ye,null));for(ye in l){var Y=l[ye];if(z=p!=null?p[ye]:void 0,l.hasOwnProperty(ye)&&Y!==z&&(Y!=null||z!=null))if(ye==="style")if(z){for(E in z)!z.hasOwnProperty(E)||Y&&Y.hasOwnProperty(E)||(o||(o={}),o[E]="");for(E in Y)Y.hasOwnProperty(E)&&z[E]!==Y[E]&&(o||(o={}),o[E]=Y[E])}else o||(g||(g=[]),g.push(ye,o)),o=Y;else ye==="dangerouslySetInnerHTML"?(Y=Y?Y.__html:void 0,z=z?z.__html:void 0,Y!=null&&z!==Y&&(g=g||[]).push(ye,Y)):ye==="children"?typeof Y!="string"&&typeof Y!="number"||(g=g||[]).push(ye,""+Y):ye!=="suppressContentEditableWarning"&&ye!=="suppressHydrationWarning"&&(u.hasOwnProperty(ye)?(Y!=null&&ye==="onScroll"&&jt("scroll",e),g||z===Y||(g=[])):(g=g||[]).push(ye,Y))}o&&(g=g||[]).push("style",o);var ye=g;(n.updateQueue=ye)&&(n.flags|=4)}},gp=function(e,n,o,l){o!==l&&(n.flags|=4)};function ca(e,n){if(!$t)switch(e.tailMode){case"hidden":n=e.tail;for(var o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?e.tail=null:o.sibling=null;break;case"collapsed":o=e.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function vn(e){var n=e.alternate!==null&&e.alternate.child===e.child,o=0,l=0;if(n)for(var p=e.child;p!==null;)o|=p.lanes|p.childLanes,l|=p.subtreeFlags&14680064,l|=p.flags&14680064,p.return=e,p=p.sibling;else for(p=e.child;p!==null;)o|=p.lanes|p.childLanes,l|=p.subtreeFlags,l|=p.flags,p.return=e,p=p.sibling;return e.subtreeFlags|=l,e.childLanes=o,n}function $y(e,n,o){var l=n.pendingProps;switch(Xu(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vn(n),null;case 1:return Rn(n.type)&&il(),vn(n),null;case 3:return l=n.stateNode,gs(),Pt(On),Pt(gn),lc(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(cl(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Nr!==null&&(zc(Nr),Nr=null))),Cc(e,n),vn(n),null;case 5:sc(n);var p=Ei(ia.current);if(o=n.type,e!==null&&n.stateNode!=null)mp(e,n,o,l,p),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!l){if(n.stateNode===null)throw Error(i(166));return vn(n),null}if(e=Ei(Kr.current),cl(n)){l=n.stateNode,o=n.type;var g=n.memoizedProps;switch(l[Ur]=n,l[ea]=g,e=(n.mode&1)!==0,o){case"dialog":jt("cancel",l),jt("close",l);break;case"iframe":case"object":case"embed":jt("load",l);break;case"video":case"audio":for(p=0;p<vo.length;p++)jt(vo[p],l);break;case"source":jt("error",l);break;case"img":case"image":case"link":jt("error",l),jt("load",l);break;case"details":jt("toggle",l);break;case"input":ct(l,g),jt("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!g.multiple},jt("invalid",l);break;case"textarea":fn(l,g),jt("invalid",l)}Ye(o,g),p=null;for(var E in g)if(g.hasOwnProperty(E)){var z=g[E];E==="children"?typeof z=="string"?l.textContent!==z&&(g.suppressHydrationWarning!==!0&&nl(l.textContent,z,e),p=["children",z]):typeof z=="number"&&l.textContent!==""+z&&(g.suppressHydrationWarning!==!0&&nl(l.textContent,z,e),p=["children",""+z]):u.hasOwnProperty(E)&&z!=null&&E==="onScroll"&&jt("scroll",l)}switch(o){case"input":He(l),St(l,g,!0);break;case"textarea":He(l),_n(l);break;case"select":case"option":break;default:typeof g.onClick=="function"&&(l.onclick=rl)}l=p,n.updateQueue=l,l!==null&&(n.flags|=4)}else{E=p.nodeType===9?p:p.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Nt(o)),e==="http://www.w3.org/1999/xhtml"?o==="script"?(e=E.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=E.createElement(o,{is:l.is}):(e=E.createElement(o),o==="select"&&(E=e,l.multiple?E.multiple=!0:l.size&&(E.size=l.size))):e=E.createElementNS(e,o),e[Ur]=n,e[ea]=l,hp(e,n,!1,!1),n.stateNode=e;e:{switch(E=Un(o,l),o){case"dialog":jt("cancel",e),jt("close",e),p=l;break;case"iframe":case"object":case"embed":jt("load",e),p=l;break;case"video":case"audio":for(p=0;p<vo.length;p++)jt(vo[p],e);p=l;break;case"source":jt("error",e),p=l;break;case"img":case"image":case"link":jt("error",e),jt("load",e),p=l;break;case"details":jt("toggle",e),p=l;break;case"input":ct(e,l),p=ut(e,l),jt("invalid",e);break;case"option":p=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},p=F({},l,{value:void 0}),jt("invalid",e);break;case"textarea":fn(e,l),p=wn(e,l),jt("invalid",e);break;default:p=l}Ye(o,p),z=p;for(g in z)if(z.hasOwnProperty(g)){var Y=z[g];g==="style"?nr(e,Y):g==="dangerouslySetInnerHTML"?(Y=Y?Y.__html:void 0,Y!=null&&tr(e,Y)):g==="children"?typeof Y=="string"?(o!=="textarea"||Y!=="")&&Sn(e,Y):typeof Y=="number"&&Sn(e,""+Y):g!=="suppressContentEditableWarning"&&g!=="suppressHydrationWarning"&&g!=="autoFocus"&&(u.hasOwnProperty(g)?Y!=null&&g==="onScroll"&&jt("scroll",e):Y!=null&&P(e,g,Y,E))}switch(o){case"input":He(e),St(e,l,!1);break;case"textarea":He(e),_n(e);break;case"option":l.value!=null&&e.setAttribute("value",""+_e(l.value));break;case"select":e.multiple=!!l.multiple,g=l.value,g!=null?bt(e,!!l.multiple,g,!1):l.defaultValue!=null&&bt(e,!!l.multiple,l.defaultValue,!0);break;default:typeof p.onClick=="function"&&(e.onclick=rl)}switch(o){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return vn(n),null;case 6:if(e&&n.stateNode!=null)gp(e,n,e.memoizedProps,l);else{if(typeof l!="string"&&n.stateNode===null)throw Error(i(166));if(o=Ei(ia.current),Ei(Kr.current),cl(n)){if(l=n.stateNode,o=n.memoizedProps,l[Ur]=n,(g=l.nodeValue!==o)&&(e=Qn,e!==null))switch(e.tag){case 3:nl(l.nodeValue,o,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&nl(l.nodeValue,o,(e.mode&1)!==0)}g&&(n.flags|=4)}else l=(o.nodeType===9?o:o.ownerDocument).createTextNode(l),l[Ur]=n,n.stateNode=l}return vn(n),null;case 13:if(Pt(Dt),l=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if($t&&Gn!==null&&(n.mode&1)!==0&&(n.flags&128)===0)xd(),ds(),n.flags|=98560,g=!1;else if(g=cl(n),l!==null&&l.dehydrated!==null){if(e===null){if(!g)throw Error(i(318));if(g=n.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(i(317));g[Ur]=n}else ds(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;vn(n),g=!1}else Nr!==null&&(zc(Nr),Nr=null),g=!0;if(!g)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=o,n):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(Dt.current&1)!==0?Xt===0&&(Xt=3):Bc())),n.updateQueue!==null&&(n.flags|=4),vn(n),null);case 4:return gs(),Cc(e,n),e===null&&Js(n.stateNode.containerInfo),vn(n),null;case 10:return tc(n.type._context),vn(n),null;case 17:return Rn(n.type)&&il(),vn(n),null;case 19:if(Pt(Dt),g=n.memoizedState,g===null)return vn(n),null;if(l=(n.flags&128)!==0,E=g.rendering,E===null)if(l)ca(g,!1);else{if(Xt!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(E=gl(e),E!==null){for(n.flags|=128,ca(g,!1),l=E.updateQueue,l!==null&&(n.updateQueue=l,n.flags|=4),n.subtreeFlags=0,l=o,o=n.child;o!==null;)g=o,e=l,g.flags&=14680066,E=g.alternate,E===null?(g.childLanes=0,g.lanes=e,g.child=null,g.subtreeFlags=0,g.memoizedProps=null,g.memoizedState=null,g.updateQueue=null,g.dependencies=null,g.stateNode=null):(g.childLanes=E.childLanes,g.lanes=E.lanes,g.child=E.child,g.subtreeFlags=0,g.deletions=null,g.memoizedProps=E.memoizedProps,g.memoizedState=E.memoizedState,g.updateQueue=E.updateQueue,g.type=E.type,e=E.dependencies,g.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),o=o.sibling;return kt(Dt,Dt.current&1|2),n.child}e=e.sibling}g.tail!==null&>()>ws&&(n.flags|=128,l=!0,ca(g,!1),n.lanes=4194304)}else{if(!l)if(e=gl(E),e!==null){if(n.flags|=128,l=!0,o=e.updateQueue,o!==null&&(n.updateQueue=o,n.flags|=4),ca(g,!0),g.tail===null&&g.tailMode==="hidden"&&!E.alternate&&!$t)return vn(n),null}else 2*gt()-g.renderingStartTime>ws&&o!==1073741824&&(n.flags|=128,l=!0,ca(g,!1),n.lanes=4194304);g.isBackwards?(E.sibling=n.child,n.child=E):(o=g.last,o!==null?o.sibling=E:n.child=E,g.last=E)}return g.tail!==null?(n=g.tail,g.rendering=n,g.tail=n.sibling,g.renderingStartTime=gt(),n.sibling=null,o=Dt.current,kt(Dt,l?o&1|2:o&1),n):(vn(n),null);case 22:case 23:return Fc(),l=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(n.flags|=8192),l&&(n.mode&1)!==0?(Jn&1073741824)!==0&&(vn(n),n.subtreeFlags&6&&(n.flags|=8192)):vn(n),null;case 24:return null;case 25:return null}throw Error(i(156,n.tag))}function Ay(e,n){switch(Xu(n),n.tag){case 1:return Rn(n.type)&&il(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return gs(),Pt(On),Pt(gn),lc(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return sc(n),null;case 13:if(Pt(Dt),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(i(340));ds()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Pt(Dt),null;case 4:return gs(),null;case 10:return tc(n.type._context),null;case 22:case 23:return Fc(),null;case 24:return null;default:return null}}var Nl=!1,xn=!1,Oy=typeof WeakSet=="function"?WeakSet:Set,Xe=null;function vs(e,n){var o=e.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(l){Ft(e,n,l)}else o.current=null}function jc(e,n,o){try{o()}catch(l){Ft(e,n,l)}}var yp=!1;function Ry(e,n){if(Fu=Ki,e=oe(),re(e)){if("selectionStart"in e)var o={start:e.selectionStart,end:e.selectionEnd};else e:{o=(o=e.ownerDocument)&&o.defaultView||window;var l=o.getSelection&&o.getSelection();if(l&&l.rangeCount!==0){o=l.anchorNode;var p=l.anchorOffset,g=l.focusNode;l=l.focusOffset;try{o.nodeType,g.nodeType}catch{o=null;break e}var E=0,z=-1,Y=-1,ye=0,Pe=0,Ie=e,je=null;t:for(;;){for(var Ke;Ie!==o||p!==0&&Ie.nodeType!==3||(z=E+p),Ie!==g||l!==0&&Ie.nodeType!==3||(Y=E+l),Ie.nodeType===3&&(E+=Ie.nodeValue.length),(Ke=Ie.firstChild)!==null;)je=Ie,Ie=Ke;for(;;){if(Ie===e)break t;if(je===o&&++ye===p&&(z=E),je===g&&++Pe===l&&(Y=E),(Ke=Ie.nextSibling)!==null)break;Ie=je,je=Ie.parentNode}Ie=Ke}o=z===-1||Y===-1?null:{start:z,end:Y}}else o=null}o=o||{start:0,end:0}}else o=null;for(Bu={focusedElem:e,selectionRange:o},Ki=!1,Xe=n;Xe!==null;)if(n=Xe,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Xe=e;else for(;Xe!==null;){n=Xe;try{var Qe=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(Qe!==null){var Ge=Qe.memoizedProps,Bt=Qe.memoizedState,pe=n.stateNode,ne=pe.getSnapshotBeforeUpdate(n.elementType===n.type?Ge:Er(n.type,Ge),Bt);pe.__reactInternalSnapshotBeforeUpdate=ne}break;case 3:var me=n.stateNode.containerInfo;me.nodeType===1?me.textContent="":me.nodeType===9&&me.documentElement&&me.removeChild(me.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(ze){Ft(n,n.return,ze)}if(e=n.sibling,e!==null){e.return=n.return,Xe=e;break}Xe=n.return}return Qe=yp,yp=!1,Qe}function fa(e,n,o){var l=n.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var p=l=l.next;do{if((p.tag&e)===e){var g=p.destroy;p.destroy=void 0,g!==void 0&&jc(n,o,g)}p=p.next}while(p!==l)}}function El(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var l=o.create;o.destroy=l()}o=o.next}while(o!==n)}}function Pc(e){var n=e.ref;if(n!==null){var o=e.stateNode;switch(e.tag){case 5:e=o;break;default:e=o}typeof n=="function"?n(e):n.current=e}}function vp(e){var n=e.alternate;n!==null&&(e.alternate=null,vp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[Ur],delete n[ea],delete n[Ku],delete n[vy],delete n[xy])),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 xp(e){return e.tag===5||e.tag===3||e.tag===4}function wp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xp(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 Tc(e,n,o){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?o.nodeType===8?o.parentNode.insertBefore(e,n):o.insertBefore(e,n):(o.nodeType===8?(n=o.parentNode,n.insertBefore(e,o)):(n=o,n.appendChild(e)),o=o._reactRootContainer,o!=null||n.onclick!==null||(n.onclick=rl));else if(l!==4&&(e=e.child,e!==null))for(Tc(e,n,o),e=e.sibling;e!==null;)Tc(e,n,o),e=e.sibling}function Mc(e,n,o){var l=e.tag;if(l===5||l===6)e=e.stateNode,n?o.insertBefore(e,n):o.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(Mc(e,n,o),e=e.sibling;e!==null;)Mc(e,n,o),e=e.sibling}var un=null,Cr=!1;function Zo(e,n,o){for(o=o.child;o!==null;)_p(e,n,o),o=o.sibling}function _p(e,n,o){if(En&&typeof En.onCommitFiberUnmount=="function")try{En.onCommitFiberUnmount(ar,o)}catch{}switch(o.tag){case 5:xn||vs(o,n);case 6:var l=un,p=Cr;un=null,Zo(e,n,o),un=l,Cr=p,un!==null&&(Cr?(e=un,o=o.stateNode,e.nodeType===8?e.parentNode.removeChild(o):e.removeChild(o)):un.removeChild(o.stateNode));break;case 18:un!==null&&(Cr?(e=un,o=o.stateNode,e.nodeType===8?Uu(e.parentNode,o):e.nodeType===1&&Uu(e,o),lo(e)):Uu(un,o.stateNode));break;case 4:l=un,p=Cr,un=o.stateNode.containerInfo,Cr=!0,Zo(e,n,o),un=l,Cr=p;break;case 0:case 11:case 14:case 15:if(!xn&&(l=o.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){p=l=l.next;do{var g=p,E=g.destroy;g=g.tag,E!==void 0&&((g&2)!==0||(g&4)!==0)&&jc(o,n,E),p=p.next}while(p!==l)}Zo(e,n,o);break;case 1:if(!xn&&(vs(o,n),l=o.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=o.memoizedProps,l.state=o.memoizedState,l.componentWillUnmount()}catch(z){Ft(o,n,z)}Zo(e,n,o);break;case 21:Zo(e,n,o);break;case 22:o.mode&1?(xn=(l=xn)||o.memoizedState!==null,Zo(e,n,o),xn=l):Zo(e,n,o);break;default:Zo(e,n,o)}}function Sp(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var o=e.stateNode;o===null&&(o=e.stateNode=new Oy),n.forEach(function(l){var p=Ky.bind(null,e,l);o.has(l)||(o.add(l),l.then(p,p))})}}function jr(e,n){var o=n.deletions;if(o!==null)for(var l=0;l<o.length;l++){var p=o[l];try{var g=e,E=n,z=E;e:for(;z!==null;){switch(z.tag){case 5:un=z.stateNode,Cr=!1;break e;case 3:un=z.stateNode.containerInfo,Cr=!0;break e;case 4:un=z.stateNode.containerInfo,Cr=!0;break e}z=z.return}if(un===null)throw Error(i(160));_p(g,E,p),un=null,Cr=!1;var Y=p.alternate;Y!==null&&(Y.return=null),p.return=null}catch(ye){Ft(p,n,ye)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)bp(n,e),n=n.sibling}function bp(e,n){var o=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(jr(n,e),Wr(e),l&4){try{fa(3,e,e.return),El(3,e)}catch(Ge){Ft(e,e.return,Ge)}try{fa(5,e,e.return)}catch(Ge){Ft(e,e.return,Ge)}}break;case 1:jr(n,e),Wr(e),l&512&&o!==null&&vs(o,o.return);break;case 5:if(jr(n,e),Wr(e),l&512&&o!==null&&vs(o,o.return),e.flags&32){var p=e.stateNode;try{Sn(p,"")}catch(Ge){Ft(e,e.return,Ge)}}if(l&4&&(p=e.stateNode,p!=null)){var g=e.memoizedProps,E=o!==null?o.memoizedProps:g,z=e.type,Y=e.updateQueue;if(e.updateQueue=null,Y!==null)try{z==="input"&&g.type==="radio"&&g.name!=null&&it(p,g),Un(z,E);var ye=Un(z,g);for(E=0;E<Y.length;E+=2){var Pe=Y[E],Ie=Y[E+1];Pe==="style"?nr(p,Ie):Pe==="dangerouslySetInnerHTML"?tr(p,Ie):Pe==="children"?Sn(p,Ie):P(p,Pe,Ie,ye)}switch(z){case"input":Mt(p,g);break;case"textarea":gr(p,g);break;case"select":var je=p._wrapperState.wasMultiple;p._wrapperState.wasMultiple=!!g.multiple;var Ke=g.value;Ke!=null?bt(p,!!g.multiple,Ke,!1):je!==!!g.multiple&&(g.defaultValue!=null?bt(p,!!g.multiple,g.defaultValue,!0):bt(p,!!g.multiple,g.multiple?[]:"",!1))}p[ea]=g}catch(Ge){Ft(e,e.return,Ge)}}break;case 6:if(jr(n,e),Wr(e),l&4){if(e.stateNode===null)throw Error(i(162));p=e.stateNode,g=e.memoizedProps;try{p.nodeValue=g}catch(Ge){Ft(e,e.return,Ge)}}break;case 3:if(jr(n,e),Wr(e),l&4&&o!==null&&o.memoizedState.isDehydrated)try{lo(n.containerInfo)}catch(Ge){Ft(e,e.return,Ge)}break;case 4:jr(n,e),Wr(e);break;case 13:jr(n,e),Wr(e),p=e.child,p.flags&8192&&(g=p.memoizedState!==null,p.stateNode.isHidden=g,!g||p.alternate!==null&&p.alternate.memoizedState!==null||(Ac=gt())),l&4&&Sp(e);break;case 22:if(Pe=o!==null&&o.memoizedState!==null,e.mode&1?(xn=(ye=xn)||Pe,jr(n,e),xn=ye):jr(n,e),Wr(e),l&8192){if(ye=e.memoizedState!==null,(e.stateNode.isHidden=ye)&&!Pe&&(e.mode&1)!==0)for(Xe=e,Pe=e.child;Pe!==null;){for(Ie=Xe=Pe;Xe!==null;){switch(je=Xe,Ke=je.child,je.tag){case 0:case 11:case 14:case 15:fa(4,je,je.return);break;case 1:vs(je,je.return);var Qe=je.stateNode;if(typeof Qe.componentWillUnmount=="function"){l=je,o=je.return;try{n=l,Qe.props=n.memoizedProps,Qe.state=n.memoizedState,Qe.componentWillUnmount()}catch(Ge){Ft(l,o,Ge)}}break;case 5:vs(je,je.return);break;case 22:if(je.memoizedState!==null){Ep(Ie);continue}}Ke!==null?(Ke.return=je,Xe=Ke):Ep(Ie)}Pe=Pe.sibling}e:for(Pe=null,Ie=e;;){if(Ie.tag===5){if(Pe===null){Pe=Ie;try{p=Ie.stateNode,ye?(g=p.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none"):(z=Ie.stateNode,Y=Ie.memoizedProps.style,E=Y!=null&&Y.hasOwnProperty("display")?Y.display:null,z.style.display=dn("display",E))}catch(Ge){Ft(e,e.return,Ge)}}}else if(Ie.tag===6){if(Pe===null)try{Ie.stateNode.nodeValue=ye?"":Ie.memoizedProps}catch(Ge){Ft(e,e.return,Ge)}}else if((Ie.tag!==22&&Ie.tag!==23||Ie.memoizedState===null||Ie===e)&&Ie.child!==null){Ie.child.return=Ie,Ie=Ie.child;continue}if(Ie===e)break e;for(;Ie.sibling===null;){if(Ie.return===null||Ie.return===e)break e;Pe===Ie&&(Pe=null),Ie=Ie.return}Pe===Ie&&(Pe=null),Ie.sibling.return=Ie.return,Ie=Ie.sibling}}break;case 19:jr(n,e),Wr(e),l&4&&Sp(e);break;case 21:break;default:jr(n,e),Wr(e)}}function Wr(e){var n=e.flags;if(n&2){try{e:{for(var o=e.return;o!==null;){if(xp(o)){var l=o;break e}o=o.return}throw Error(i(160))}switch(l.tag){case 5:var p=l.stateNode;l.flags&32&&(Sn(p,""),l.flags&=-33);var g=wp(e);Mc(e,g,p);break;case 3:case 4:var E=l.stateNode.containerInfo,z=wp(e);Tc(e,z,E);break;default:throw Error(i(161))}}catch(Y){Ft(e,e.return,Y)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Dy(e,n,o){Xe=e,kp(e)}function kp(e,n,o){for(var l=(e.mode&1)!==0;Xe!==null;){var p=Xe,g=p.child;if(p.tag===22&&l){var E=p.memoizedState!==null||Nl;if(!E){var z=p.alternate,Y=z!==null&&z.memoizedState!==null||xn;z=Nl;var ye=xn;if(Nl=E,(xn=Y)&&!ye)for(Xe=p;Xe!==null;)E=Xe,Y=E.child,E.tag===22&&E.memoizedState!==null?Cp(p):Y!==null?(Y.return=E,Xe=Y):Cp(p);for(;g!==null;)Xe=g,kp(g),g=g.sibling;Xe=p,Nl=z,xn=ye}Np(e)}else(p.subtreeFlags&8772)!==0&&g!==null?(g.return=p,Xe=g):Np(e)}}function Np(e){for(;Xe!==null;){var n=Xe;if((n.flags&8772)!==0){var o=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:xn||El(5,n);break;case 1:var l=n.stateNode;if(n.flags&4&&!xn)if(o===null)l.componentDidMount();else{var p=n.elementType===n.type?o.memoizedProps:Er(n.type,o.memoizedProps);l.componentDidUpdate(p,o.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var g=n.updateQueue;g!==null&&Ed(n,g,l);break;case 3:var E=n.updateQueue;if(E!==null){if(o=null,n.child!==null)switch(n.child.tag){case 5:o=n.child.stateNode;break;case 1:o=n.child.stateNode}Ed(n,E,o)}break;case 5:var z=n.stateNode;if(o===null&&n.flags&4){o=z;var Y=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":Y.autoFocus&&o.focus();break;case"img":Y.src&&(o.src=Y.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var ye=n.alternate;if(ye!==null){var Pe=ye.memoizedState;if(Pe!==null){var Ie=Pe.dehydrated;Ie!==null&&lo(Ie)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}xn||n.flags&512&&Pc(n)}catch(je){Ft(n,n.return,je)}}if(n===e){Xe=null;break}if(o=n.sibling,o!==null){o.return=n.return,Xe=o;break}Xe=n.return}}function Ep(e){for(;Xe!==null;){var n=Xe;if(n===e){Xe=null;break}var o=n.sibling;if(o!==null){o.return=n.return,Xe=o;break}Xe=n.return}}function Cp(e){for(;Xe!==null;){var n=Xe;try{switch(n.tag){case 0:case 11:case 15:var o=n.return;try{El(4,n)}catch(Y){Ft(n,o,Y)}break;case 1:var l=n.stateNode;if(typeof l.componentDidMount=="function"){var p=n.return;try{l.componentDidMount()}catch(Y){Ft(n,p,Y)}}var g=n.return;try{Pc(n)}catch(Y){Ft(n,g,Y)}break;case 5:var E=n.return;try{Pc(n)}catch(Y){Ft(n,E,Y)}}}catch(Y){Ft(n,n.return,Y)}if(n===e){Xe=null;break}var z=n.sibling;if(z!==null){z.return=n.return,Xe=z;break}Xe=n.return}}var zy=Math.ceil,Cl=R.ReactCurrentDispatcher,Ic=R.ReactCurrentOwner,hr=R.ReactCurrentBatchConfig,vt=0,Zt=null,Kt=null,cn=0,Jn=0,xs=Yo(0),Xt=0,da=null,ji=0,jl=0,$c=0,pa=null,zn=null,Ac=0,ws=1/0,Eo=null,Pl=!1,Oc=null,ei=null,Tl=!1,ti=null,Ml=0,ha=0,Rc=null,Il=-1,$l=0;function jn(){return(vt&6)!==0?gt():Il!==-1?Il:Il=gt()}function ni(e){return(e.mode&1)===0?1:(vt&2)!==0&&cn!==0?cn&-cn:_y.transition!==null?($l===0&&($l=Fr()),$l):(e=xt,e!==0||(e=window.event,e=e===void 0?16:qi(e.type)),e)}function Pr(e,n,o,l){if(50<ha)throw ha=0,Rc=null,Error(i(185));ur(e,o,l),((vt&2)===0||e!==Zt)&&(e===Zt&&((vt&2)===0&&(jl|=o),Xt===4&&ri(e,cn)),Ln(e,l),o===1&&vt===0&&(n.mode&1)===0&&(ws=gt()+500,al&&Qo()))}function Ln(e,n){var o=e.callbackNode;io(e,n);var l=yt(e,e===Zt?cn:0);if(l===0)o!==null&&$o(o),e.callbackNode=null,e.callbackPriority=0;else if(n=l&-l,e.callbackPriority!==n){if(o!=null&&$o(o),n===1)e.tag===0?wy(Pp.bind(null,e)):hd(Pp.bind(null,e)),gy(function(){(vt&6)===0&&Qo()}),o=null;else{switch(Ba(l)){case 1:o=Dr;break;case 4:o=Ao;break;case 16:o=zr;break;case 536870912:o=fi;break;default:o=zr}o=Dp(o,jp.bind(null,e))}e.callbackPriority=n,e.callbackNode=o}}function jp(e,n){if(Il=-1,$l=0,(vt&6)!==0)throw Error(i(327));var o=e.callbackNode;if(_s()&&e.callbackNode!==o)return null;var l=yt(e,e===Zt?cn:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||n)n=Al(e,l);else{n=l;var p=vt;vt|=2;var g=Mp();(Zt!==e||cn!==n)&&(Eo=null,ws=gt()+500,Ti(e,n));do try{By();break}catch(z){Tp(e,z)}while(!0);ec(),Cl.current=g,vt=p,Kt!==null?n=0:(Zt=null,cn=0,n=Xt)}if(n!==0){if(n===2&&(p=lr(e),p!==0&&(l=p,n=Dc(e,p))),n===1)throw o=da,Ti(e,0),ri(e,l),Ln(e,gt()),o;if(n===6)ri(e,l);else{if(p=e.current.alternate,(l&30)===0&&!Ly(p)&&(n=Al(e,l),n===2&&(g=lr(e),g!==0&&(l=g,n=Dc(e,g))),n===1))throw o=da,Ti(e,0),ri(e,l),Ln(e,gt()),o;switch(e.finishedWork=p,e.finishedLanes=l,n){case 0:case 1:throw Error(i(345));case 2:Mi(e,zn,Eo);break;case 3:if(ri(e,l),(l&130023424)===l&&(n=Ac+500-gt(),10<n)){if(yt(e,0)!==0)break;if(p=e.suspendedLanes,(p&l)!==l){jn(),e.pingedLanes|=e.suspendedLanes&p;break}e.timeoutHandle=Vu(Mi.bind(null,e,zn,Eo),n);break}Mi(e,zn,Eo);break;case 4:if(ri(e,l),(l&4194240)===l)break;for(n=e.eventTimes,p=-1;0<l;){var E=31-pn(l);g=1<<E,E=n[E],E>p&&(p=E),l&=~g}if(l=p,l=gt()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*zy(l/1960))-l,10<l){e.timeoutHandle=Vu(Mi.bind(null,e,zn,Eo),l);break}Mi(e,zn,Eo);break;case 5:Mi(e,zn,Eo);break;default:throw Error(i(329))}}}return Ln(e,gt()),e.callbackNode===o?jp.bind(null,e):null}function Dc(e,n){var o=pa;return e.current.memoizedState.isDehydrated&&(Ti(e,n).flags|=256),e=Al(e,n),e!==2&&(n=zn,zn=o,n!==null&&zc(n)),e}function zc(e){zn===null?zn=e:zn.push.apply(zn,e)}function Ly(e){for(var n=e;;){if(n.flags&16384){var o=n.updateQueue;if(o!==null&&(o=o.stores,o!==null))for(var l=0;l<o.length;l++){var p=o[l],g=p.getSnapshot;p=p.value;try{if(!ue(g(),p))return!1}catch{return!1}}}if(o=n.child,n.subtreeFlags&16384&&o!==null)o.return=n,n=o;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function ri(e,n){for(n&=~$c,n&=~jl,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var o=31-pn(n),l=1<<o;e[o]=-1,n&=~l}}function Pp(e){if((vt&6)!==0)throw Error(i(327));_s();var n=yt(e,0);if((n&1)===0)return Ln(e,gt()),null;var o=Al(e,n);if(e.tag!==0&&o===2){var l=lr(e);l!==0&&(n=l,o=Dc(e,l))}if(o===1)throw o=da,Ti(e,0),ri(e,n),Ln(e,gt()),o;if(o===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,Mi(e,zn,Eo),Ln(e,gt()),null}function Lc(e,n){var o=vt;vt|=1;try{return e(n)}finally{vt=o,vt===0&&(ws=gt()+500,al&&Qo())}}function Pi(e){ti!==null&&ti.tag===0&&(vt&6)===0&&_s();var n=vt;vt|=1;var o=hr.transition,l=xt;try{if(hr.transition=null,xt=1,e)return e()}finally{xt=l,hr.transition=o,vt=n,(vt&6)===0&&Qo()}}function Fc(){Jn=xs.current,Pt(xs)}function Ti(e,n){e.finishedWork=null,e.finishedLanes=0;var o=e.timeoutHandle;if(o!==-1&&(e.timeoutHandle=-1,my(o)),Kt!==null)for(o=Kt.return;o!==null;){var l=o;switch(Xu(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&il();break;case 3:gs(),Pt(On),Pt(gn),lc();break;case 5:sc(l);break;case 4:gs();break;case 13:Pt(Dt);break;case 19:Pt(Dt);break;case 10:tc(l.type._context);break;case 22:case 23:Fc()}o=o.return}if(Zt=e,Kt=e=oi(e.current,null),cn=Jn=n,Xt=0,da=null,$c=jl=ji=0,zn=pa=null,Ni!==null){for(n=0;n<Ni.length;n++)if(o=Ni[n],l=o.interleaved,l!==null){o.interleaved=null;var p=l.next,g=o.pending;if(g!==null){var E=g.next;g.next=p,l.next=E}o.pending=l}Ni=null}return e}function Tp(e,n){do{var o=Kt;try{if(ec(),yl.current=_l,vl){for(var l=zt.memoizedState;l!==null;){var p=l.queue;p!==null&&(p.pending=null),l=l.next}vl=!1}if(Ci=0,Jt=Yt=zt=null,sa=!1,aa=0,Ic.current=null,o===null||o.return===null){Xt=1,da=n,Kt=null;break}e:{var g=e,E=o.return,z=o,Y=n;if(n=cn,z.flags|=32768,Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var ye=Y,Pe=z,Ie=Pe.tag;if((Pe.mode&1)===0&&(Ie===0||Ie===11||Ie===15)){var je=Pe.alternate;je?(Pe.updateQueue=je.updateQueue,Pe.memoizedState=je.memoizedState,Pe.lanes=je.lanes):(Pe.updateQueue=null,Pe.memoizedState=null)}var Ke=tp(E);if(Ke!==null){Ke.flags&=-257,np(Ke,E,z,g,n),Ke.mode&1&&ep(g,ye,n),n=Ke,Y=ye;var Qe=n.updateQueue;if(Qe===null){var Ge=new Set;Ge.add(Y),n.updateQueue=Ge}else Qe.add(Y);break e}else{if((n&1)===0){ep(g,ye,n),Bc();break e}Y=Error(i(426))}}else if($t&&z.mode&1){var Bt=tp(E);if(Bt!==null){(Bt.flags&65536)===0&&(Bt.flags|=256),np(Bt,E,z,g,n),Ju(ys(Y,z));break e}}g=Y=ys(Y,z),Xt!==4&&(Xt=2),pa===null?pa=[g]:pa.push(g),g=E;do{switch(g.tag){case 3:g.flags|=65536,n&=-n,g.lanes|=n;var pe=Jd(g,Y,n);Nd(g,pe);break e;case 1:z=Y;var ne=g.type,me=g.stateNode;if((g.flags&128)===0&&(typeof ne.getDerivedStateFromError=="function"||me!==null&&typeof me.componentDidCatch=="function"&&(ei===null||!ei.has(me)))){g.flags|=65536,n&=-n,g.lanes|=n;var ze=Zd(g,z,n);Nd(g,ze);break e}}g=g.return}while(g!==null)}$p(o)}catch(Je){n=Je,Kt===o&&o!==null&&(Kt=o=o.return);continue}break}while(!0)}function Mp(){var e=Cl.current;return Cl.current=_l,e===null?_l:e}function Bc(){(Xt===0||Xt===3||Xt===2)&&(Xt=4),Zt===null||(ji&268435455)===0&&(jl&268435455)===0||ri(Zt,cn)}function Al(e,n){var o=vt;vt|=2;var l=Mp();(Zt!==e||cn!==n)&&(Eo=null,Ti(e,n));do try{Fy();break}catch(p){Tp(e,p)}while(!0);if(ec(),vt=o,Cl.current=l,Kt!==null)throw Error(i(261));return Zt=null,cn=0,Xt}function Fy(){for(;Kt!==null;)Ip(Kt)}function By(){for(;Kt!==null&&!Et();)Ip(Kt)}function Ip(e){var n=Rp(e.alternate,e,Jn);e.memoizedProps=e.pendingProps,n===null?$p(e):Kt=n,Ic.current=null}function $p(e){var n=e;do{var o=n.alternate;if(e=n.return,(n.flags&32768)===0){if(o=$y(o,n,Jn),o!==null){Kt=o;return}}else{if(o=Ay(o,n),o!==null){o.flags&=32767,Kt=o;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Xt=6,Kt=null;return}}if(n=n.sibling,n!==null){Kt=n;return}Kt=n=e}while(n!==null);Xt===0&&(Xt=5)}function Mi(e,n,o){var l=xt,p=hr.transition;try{hr.transition=null,xt=1,Hy(e,n,o,l)}finally{hr.transition=p,xt=l}return null}function Hy(e,n,o,l){do _s();while(ti!==null);if((vt&6)!==0)throw Error(i(327));o=e.finishedWork;var p=e.finishedLanes;if(o===null)return null;if(e.finishedWork=null,e.finishedLanes=0,o===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0;var g=o.lanes|o.childLanes;if(di(e,g),e===Zt&&(Kt=Zt=null,cn=0),(o.subtreeFlags&2064)===0&&(o.flags&2064)===0||Tl||(Tl=!0,Dp(zr,function(){return _s(),null})),g=(o.flags&15990)!==0,(o.subtreeFlags&15990)!==0||g){g=hr.transition,hr.transition=null;var E=xt;xt=1;var z=vt;vt|=4,Ic.current=null,Ry(e,o),bp(o,e),ie(Bu),Ki=!!Fu,Bu=Fu=null,e.current=o,Dy(o),sr(),vt=z,xt=E,hr.transition=g}else e.current=o;if(Tl&&(Tl=!1,ti=e,Ml=p),g=e.pendingLanes,g===0&&(ei=null),ft(o.stateNode),Ln(e,gt()),n!==null)for(l=e.onRecoverableError,o=0;o<n.length;o++)p=n[o],l(p.value,{componentStack:p.stack,digest:p.digest});if(Pl)throw Pl=!1,e=Oc,Oc=null,e;return(Ml&1)!==0&&e.tag!==0&&_s(),g=e.pendingLanes,(g&1)!==0?e===Rc?ha++:(ha=0,Rc=e):ha=0,Qo(),null}function _s(){if(ti!==null){var e=Ba(Ml),n=hr.transition,o=xt;try{if(hr.transition=null,xt=16>e?16:e,ti===null)var l=!1;else{if(e=ti,ti=null,Ml=0,(vt&6)!==0)throw Error(i(331));var p=vt;for(vt|=4,Xe=e.current;Xe!==null;){var g=Xe,E=g.child;if((Xe.flags&16)!==0){var z=g.deletions;if(z!==null){for(var Y=0;Y<z.length;Y++){var ye=z[Y];for(Xe=ye;Xe!==null;){var Pe=Xe;switch(Pe.tag){case 0:case 11:case 15:fa(8,Pe,g)}var Ie=Pe.child;if(Ie!==null)Ie.return=Pe,Xe=Ie;else for(;Xe!==null;){Pe=Xe;var je=Pe.sibling,Ke=Pe.return;if(vp(Pe),Pe===ye){Xe=null;break}if(je!==null){je.return=Ke,Xe=je;break}Xe=Ke}}}var Qe=g.alternate;if(Qe!==null){var Ge=Qe.child;if(Ge!==null){Qe.child=null;do{var Bt=Ge.sibling;Ge.sibling=null,Ge=Bt}while(Ge!==null)}}Xe=g}}if((g.subtreeFlags&2064)!==0&&E!==null)E.return=g,Xe=E;else e:for(;Xe!==null;){if(g=Xe,(g.flags&2048)!==0)switch(g.tag){case 0:case 11:case 15:fa(9,g,g.return)}var pe=g.sibling;if(pe!==null){pe.return=g.return,Xe=pe;break e}Xe=g.return}}var ne=e.current;for(Xe=ne;Xe!==null;){E=Xe;var me=E.child;if((E.subtreeFlags&2064)!==0&&me!==null)me.return=E,Xe=me;else e:for(E=ne;Xe!==null;){if(z=Xe,(z.flags&2048)!==0)try{switch(z.tag){case 0:case 11:case 15:El(9,z)}}catch(Je){Ft(z,z.return,Je)}if(z===E){Xe=null;break e}var ze=z.sibling;if(ze!==null){ze.return=z.return,Xe=ze;break e}Xe=z.return}}if(vt=p,Qo(),En&&typeof En.onPostCommitFiberRoot=="function")try{En.onPostCommitFiberRoot(ar,e)}catch{}l=!0}return l}finally{xt=o,hr.transition=n}}return!1}function Ap(e,n,o){n=ys(o,n),n=Jd(e,n,1),e=Jo(e,n,1),n=jn(),e!==null&&(ur(e,1,n),Ln(e,n))}function Ft(e,n,o){if(e.tag===3)Ap(e,e,o);else for(;n!==null;){if(n.tag===3){Ap(n,e,o);break}else if(n.tag===1){var l=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ei===null||!ei.has(l))){e=ys(o,e),e=Zd(n,e,1),n=Jo(n,e,1),e=jn(),n!==null&&(ur(n,1,e),Ln(n,e));break}}n=n.return}}function Vy(e,n,o){var l=e.pingCache;l!==null&&l.delete(n),n=jn(),e.pingedLanes|=e.suspendedLanes&o,Zt===e&&(cn&o)===o&&(Xt===4||Xt===3&&(cn&130023424)===cn&&500>gt()-Ac?Ti(e,0):$c|=o),Ln(e,n)}function Op(e,n){n===0&&((e.mode&1)===0?n=1:(n=oo,oo<<=1,(oo&130023424)===0&&(oo=4194304)));var o=jn();e=bo(e,n),e!==null&&(ur(e,n,o),Ln(e,o))}function Uy(e){var n=e.memoizedState,o=0;n!==null&&(o=n.retryLane),Op(e,o)}function Ky(e,n){var o=0;switch(e.tag){case 13:var l=e.stateNode,p=e.memoizedState;p!==null&&(o=p.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(i(314))}l!==null&&l.delete(n),Op(e,o)}var Rp;Rp=function(e,n,o){if(e!==null)if(e.memoizedProps!==n.pendingProps||On.current)Dn=!0;else{if((e.lanes&o)===0&&(n.flags&128)===0)return Dn=!1,Iy(e,n,o);Dn=(e.flags&131072)!==0}else Dn=!1,$t&&(n.flags&1048576)!==0&&md(n,ul,n.index);switch(n.lanes=0,n.tag){case 2:var l=n.type;kl(e,n),e=n.pendingProps;var p=us(n,gn.current);ms(n,o),p=fc(null,n,l,e,p,o);var g=dc();return n.flags|=1,typeof p=="object"&&p!==null&&typeof p.render=="function"&&p.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,Rn(l)?(g=!0,sl(n)):g=!1,n.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,oc(n),p.updater=Sl,n.stateNode=p,p._reactInternals=n,vc(n,l,e,o),n=Sc(null,n,l,!0,g,o)):(n.tag=0,$t&&g&&Yu(n),Cn(null,n,p,o),n=n.child),n;case 16:l=n.elementType;e:{switch(kl(e,n),e=n.pendingProps,p=l._init,l=p(l._payload),n.type=l,p=n.tag=Wy(l),e=Er(l,e),p){case 0:n=_c(null,n,l,e,o);break e;case 1:n=lp(null,n,l,e,o);break e;case 11:n=rp(null,n,l,e,o);break e;case 14:n=op(null,n,l,Er(l.type,e),o);break e}throw Error(i(306,l,""))}return n;case 0:return l=n.type,p=n.pendingProps,p=n.elementType===l?p:Er(l,p),_c(e,n,l,p,o);case 1:return l=n.type,p=n.pendingProps,p=n.elementType===l?p:Er(l,p),lp(e,n,l,p,o);case 3:e:{if(up(n),e===null)throw Error(i(387));l=n.pendingProps,g=n.memoizedState,p=g.element,kd(e,n),ml(n,l,null,o);var E=n.memoizedState;if(l=E.element,g.isDehydrated)if(g={element:l,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},n.updateQueue.baseState=g,n.memoizedState=g,n.flags&256){p=ys(Error(i(423)),n),n=cp(e,n,l,o,p);break e}else if(l!==p){p=ys(Error(i(424)),n),n=cp(e,n,l,o,p);break e}else for(Gn=Wo(n.stateNode.containerInfo.firstChild),Qn=n,$t=!0,Nr=null,o=Sd(n,null,l,o),n.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(ds(),l===p){n=No(e,n,o);break e}Cn(e,n,l,o)}n=n.child}return n;case 5:return Cd(n),e===null&&Gu(n),l=n.type,p=n.pendingProps,g=e!==null?e.memoizedProps:null,E=p.children,Hu(l,p)?E=null:g!==null&&Hu(l,g)&&(n.flags|=32),ap(e,n),Cn(e,n,E,o),n.child;case 6:return e===null&&Gu(n),null;case 13:return fp(e,n,o);case 4:return ic(n,n.stateNode.containerInfo),l=n.pendingProps,e===null?n.child=ps(n,null,l,o):Cn(e,n,l,o),n.child;case 11:return l=n.type,p=n.pendingProps,p=n.elementType===l?p:Er(l,p),rp(e,n,l,p,o);case 7:return Cn(e,n,n.pendingProps,o),n.child;case 8:return Cn(e,n,n.pendingProps.children,o),n.child;case 12:return Cn(e,n,n.pendingProps.children,o),n.child;case 10:e:{if(l=n.type._context,p=n.pendingProps,g=n.memoizedProps,E=p.value,kt(dl,l._currentValue),l._currentValue=E,g!==null)if(ue(g.value,E)){if(g.children===p.children&&!On.current){n=No(e,n,o);break e}}else for(g=n.child,g!==null&&(g.return=n);g!==null;){var z=g.dependencies;if(z!==null){E=g.child;for(var Y=z.firstContext;Y!==null;){if(Y.context===l){if(g.tag===1){Y=ko(-1,o&-o),Y.tag=2;var ye=g.updateQueue;if(ye!==null){ye=ye.shared;var Pe=ye.pending;Pe===null?Y.next=Y:(Y.next=Pe.next,Pe.next=Y),ye.pending=Y}}g.lanes|=o,Y=g.alternate,Y!==null&&(Y.lanes|=o),nc(g.return,o,n),z.lanes|=o;break}Y=Y.next}}else if(g.tag===10)E=g.type===n.type?null:g.child;else if(g.tag===18){if(E=g.return,E===null)throw Error(i(341));E.lanes|=o,z=E.alternate,z!==null&&(z.lanes|=o),nc(E,o,n),E=g.sibling}else E=g.child;if(E!==null)E.return=g;else for(E=g;E!==null;){if(E===n){E=null;break}if(g=E.sibling,g!==null){g.return=E.return,E=g;break}E=E.return}g=E}Cn(e,n,p.children,o),n=n.child}return n;case 9:return p=n.type,l=n.pendingProps.children,ms(n,o),p=dr(p),l=l(p),n.flags|=1,Cn(e,n,l,o),n.child;case 14:return l=n.type,p=Er(l,n.pendingProps),p=Er(l.type,p),op(e,n,l,p,o);case 15:return ip(e,n,n.type,n.pendingProps,o);case 17:return l=n.type,p=n.pendingProps,p=n.elementType===l?p:Er(l,p),kl(e,n),n.tag=1,Rn(l)?(e=!0,sl(n)):e=!1,ms(n,o),Qd(n,l,p),vc(n,l,p,o),Sc(null,n,l,!0,e,o);case 19:return pp(e,n,o);case 22:return sp(e,n,o)}throw Error(i(156,n.tag))};function Dp(e,n){return ci(e,n)}function qy(e,n,o,l){this.tag=e,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mr(e,n,o,l){return new qy(e,n,o,l)}function Hc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Wy(e){if(typeof e=="function")return Hc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ce)return 11;if(e===le)return 14}return 2}function oi(e,n){var o=e.alternate;return o===null?(o=mr(e.tag,n,e.key,e.mode),o.elementType=e.elementType,o.type=e.type,o.stateNode=e.stateNode,o.alternate=e,e.alternate=o):(o.pendingProps=n,o.type=e.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=e.flags&14680064,o.childLanes=e.childLanes,o.lanes=e.lanes,o.child=e.child,o.memoizedProps=e.memoizedProps,o.memoizedState=e.memoizedState,o.updateQueue=e.updateQueue,n=e.dependencies,o.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},o.sibling=e.sibling,o.index=e.index,o.ref=e.ref,o}function Ol(e,n,o,l,p,g){var E=2;if(l=e,typeof e=="function")Hc(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case X:return Ii(o.children,p,g,n);case fe:E=8,p|=8;break;case he:return e=mr(12,o,n,p|2),e.elementType=he,e.lanes=g,e;case xe:return e=mr(13,o,n,p),e.elementType=xe,e.lanes=g,e;case D:return e=mr(19,o,n,p),e.elementType=D,e.lanes=g,e;case se:return Rl(o,p,g,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Se:E=10;break e;case K:E=9;break e;case ce:E=11;break e;case le:E=14;break e;case Q:E=16,l=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return n=mr(E,o,n,p),n.elementType=e,n.type=l,n.lanes=g,n}function Ii(e,n,o,l){return e=mr(7,e,l,n),e.lanes=o,e}function Rl(e,n,o,l){return e=mr(22,e,l,n),e.elementType=se,e.lanes=o,e.stateNode={isHidden:!1},e}function Vc(e,n,o){return e=mr(6,e,null,n),e.lanes=o,e}function Uc(e,n,o){return n=mr(4,e.children!==null?e.children:[],e.key,n),n.lanes=o,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Yy(e,n,o,l,p){this.tag=n,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=so(0),this.expirationTimes=so(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=so(0),this.identifierPrefix=l,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function Kc(e,n,o,l,p,g,E,z,Y){return e=new Yy(e,n,o,z,Y),n===1?(n=1,g===!0&&(n|=8)):n=0,g=mr(3,null,null,n),e.current=g,g.stateNode=e,g.memoizedState={element:l,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},oc(g),e}function Xy(e,n,o){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:B,key:l==null?null:""+l,children:e,containerInfo:n,implementation:o}}function zp(e){if(!e)return Xo;e=e._reactInternals;e:{if(Lt(e)!==e||e.tag!==1)throw Error(i(170));var n=e;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(Rn(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(i(171))}if(e.tag===1){var o=e.type;if(Rn(o))return dd(e,o,n)}return n}function Lp(e,n,o,l,p,g,E,z,Y){return e=Kc(o,l,!0,e,p,g,E,z,Y),e.context=zp(null),o=e.current,l=jn(),p=ni(o),g=ko(l,p),g.callback=n??null,Jo(o,g,p),e.current.lanes=p,ur(e,p,l),Ln(e,l),e}function Dl(e,n,o,l){var p=n.current,g=jn(),E=ni(p);return o=zp(o),n.context===null?n.context=o:n.pendingContext=o,n=ko(g,E),n.payload={element:e},l=l===void 0?null:l,l!==null&&(n.callback=l),e=Jo(p,n,E),e!==null&&(Pr(e,p,E,g),hl(e,p,E)),E}function zl(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 Fp(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var o=e.retryLane;e.retryLane=o!==0&&o<n?o:n}}function qc(e,n){Fp(e,n),(e=e.alternate)&&Fp(e,n)}function Qy(){return null}var Bp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Wc(e){this._internalRoot=e}Ll.prototype.render=Wc.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(i(409));Dl(e,n,null,null)},Ll.prototype.unmount=Wc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Pi(function(){Dl(null,e,null,null)}),n[xo]=null}};function Ll(e){this._internalRoot=e}Ll.prototype.unstable_scheduleHydration=function(e){if(e){var n=Va();e={blockedOn:null,target:e,priority:n};for(var o=0;o<$n.length&&n!==0&&n<$n[o].priority;o++);$n.splice(o,0,e),o===0&&Xn(e)}};function Yc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Fl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Hp(){}function Gy(e,n,o,l,p){if(p){if(typeof l=="function"){var g=l;l=function(){var ye=zl(E);g.call(ye)}}var E=Lp(n,l,e,0,null,!1,!1,"",Hp);return e._reactRootContainer=E,e[xo]=E.current,Js(e.nodeType===8?e.parentNode:e),Pi(),E}for(;p=e.lastChild;)e.removeChild(p);if(typeof l=="function"){var z=l;l=function(){var ye=zl(Y);z.call(ye)}}var Y=Kc(e,0,!1,null,null,!1,!1,"",Hp);return e._reactRootContainer=Y,e[xo]=Y.current,Js(e.nodeType===8?e.parentNode:e),Pi(function(){Dl(n,Y,o,l)}),Y}function Bl(e,n,o,l,p){var g=o._reactRootContainer;if(g){var E=g;if(typeof p=="function"){var z=p;p=function(){var Y=zl(E);z.call(Y)}}Dl(n,E,e,p)}else E=Gy(o,n,e,p,l);return zl(E)}ht=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var o=Yn(n.pendingLanes);o!==0&&(Ro(n,o|1),Ln(n,gt()),(vt&6)===0&&(ws=gt()+500,Qo()))}break;case 13:Pi(function(){var l=bo(e,1);if(l!==null){var p=jn();Pr(l,e,1,p)}}),qc(e,1)}},Vi=function(e){if(e.tag===13){var n=bo(e,134217728);if(n!==null){var o=jn();Pr(n,e,134217728,o)}qc(e,134217728)}},Ha=function(e){if(e.tag===13){var n=ni(e),o=bo(e,n);if(o!==null){var l=jn();Pr(o,e,n,l)}qc(e,n)}},Va=function(){return xt},hn=function(e,n){var o=xt;try{return xt=e,n()}finally{xt=o}},Ve=function(e,n,o){switch(n){case"input":if(Mt(e,o),n=o.name,o.type==="radio"&&n!=null){for(o=e;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<o.length;n++){var l=o[n];if(l!==e&&l.form===e.form){var p=ol(l);if(!p)throw Error(i(90));Ae(l),Mt(l,p)}}}break;case"textarea":gr(e,o);break;case"select":n=o.value,n!=null&&bt(e,!!o.multiple,n,!1)}},Io=Lc,eo=Pi;var Jy={usingClientEntryPoint:!1,Events:[ta,as,ol,Zr,Rr,Lc]},ma={findFiberByHostInstance:_i,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Zy={bundleType:ma.bundleType,version:ma.version,rendererPackageName:ma.rendererPackageName,rendererConfig:ma.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:R.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=ui(e),e===null?null:e.stateNode},findFiberByHostInstance:ma.findFiberByHostInstance||Qy,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 Hl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hl.isDisabled&&Hl.supportsFiber)try{ar=Hl.inject(Zy),En=Hl}catch{}}return Fn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Jy,Fn.createPortal=function(e,n){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Yc(n))throw Error(i(200));return Xy(e,n,null,o)},Fn.createRoot=function(e,n){if(!Yc(e))throw Error(i(299));var o=!1,l="",p=Bp;return n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(p=n.onRecoverableError)),n=Kc(e,1,!1,null,null,o,!1,l,p),e[xo]=n.current,Js(e.nodeType===8?e.parentNode:e),new Wc(n)},Fn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=ui(n),e=e===null?null:e.stateNode,e},Fn.flushSync=function(e){return Pi(e)},Fn.hydrate=function(e,n,o){if(!Fl(n))throw Error(i(200));return Bl(null,e,n,!0,o)},Fn.hydrateRoot=function(e,n,o){if(!Yc(e))throw Error(i(405));var l=o!=null&&o.hydratedSources||null,p=!1,g="",E=Bp;if(o!=null&&(o.unstable_strictMode===!0&&(p=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),n=Lp(n,null,e,1,o??null,p,!1,g,E),e[xo]=n.current,Js(e),l)for(e=0;e<l.length;e++)o=l[e],p=o._getVersion,p=p(o._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[o,p]:n.mutableSourceEagerHydrationData.push(o,p);return new Ll(n)},Fn.render=function(e,n,o){if(!Fl(n))throw Error(i(200));return Bl(null,e,n,!1,o)},Fn.unmountComponentAtNode=function(e){if(!Fl(e))throw Error(i(40));return e._reactRootContainer?(Pi(function(){Bl(null,null,e,!1,function(){e._reactRootContainer=null,e[xo]=null})}),!0):!1},Fn.unstable_batchedUpdates=Lc,Fn.unstable_renderSubtreeIntoContainer=function(e,n,o,l){if(!Fl(o))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return Bl(e,n,o,!1,l)},Fn.version="18.3.1-next-f1338f8080-20240426",Fn}var Qp;function hm(){if(Qp)return Gc.exports;Qp=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Gc.exports=u0(),Gc.exports}var Gp;function c0(){if(Gp)return Vl;Gp=1;var t=hm();return Vl.createRoot=t.createRoot,Vl.hydrateRoot=t.hydrateRoot,Vl}var f0=c0();const d0=vu(f0),p0=["get","post","put","patch","delete","options","head","trace"];function Jp(t){return t.replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_|_$/g,"").replace(/_+/g,"_")}function xu(t,r,i,s){if(i)return Jp(i).replace(/^[0-9]/,"_$&")||`op_${s}`;const u=Jp(r.replace(/[{}]/g,""));return`${t}_${u}`||`op_${s}`}function wu(t){var s;return`${(((s=t.info)==null?void 0:s.title)??"Api").replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).filter(Boolean).map(u=>u.charAt(0).toUpperCase()+u.slice(1).toLowerCase()).join("")||"Api"}Client`}function _u(t){return(t.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join("")||"Api")+"Service"}function Gr(t){const r=[];if(!t.paths)return r;for(const[i,s]of Object.entries(t.paths)){if(!s||typeof s!="object"||"$ref"in s)continue;const u=s;for(const f of p0){const d=u[f];d&&typeof d=="object"&&r.push({method:f,path:i,operationId:d.operationId,tags:d.tags})}}return r}function h0(t,r,i,s="baseUrl"){var f,d;const u=r.toUpperCase();return`const ${s} = "${((d=(f=t.servers)==null?void 0:f[0])==null?void 0:d.url)??"http://localhost:3000"}";
|
|
41
|
+
/** @returns {Promise<unknown>} */
|
|
42
|
+
const res = await fetch(\`${s}${i}\`, {
|
|
43
|
+
method: "${u}",
|
|
44
|
+
headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
|
|
45
|
+
${u==="GET"||u==="HEAD"?"":"body: JSON.stringify({}),"}
|
|
46
|
+
});
|
|
47
|
+
const data = await res.json();
|
|
48
|
+
`}function mm(t,r){const i=t.map((s,u)=>` /**
|
|
49
|
+
* @param {{ headers?: Record<string, string> }} [options]
|
|
50
|
+
* @returns {Promise<unknown>}
|
|
51
|
+
*/
|
|
52
|
+
async ${xu(s.method,s.path,s.operationId,u)}(options) {
|
|
53
|
+
const res = await fetch(\`\${this.baseUrl}${s.path}\`, {
|
|
54
|
+
method: "${s.method.toUpperCase()}",
|
|
55
|
+
headers: { ...this.defaultHeaders, ...options?.headers },
|
|
56
|
+
});
|
|
57
|
+
return res.json();
|
|
58
|
+
}`);return`export class ${r} {
|
|
59
|
+
/**
|
|
60
|
+
* @param {string} baseUrl
|
|
61
|
+
* @param {Record<string, string>} [defaultHeaders]
|
|
62
|
+
*/
|
|
63
|
+
constructor(baseUrl, defaultHeaders = {}) {
|
|
64
|
+
this.baseUrl = baseUrl;
|
|
65
|
+
this.defaultHeaders = defaultHeaders;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
${i.join(`
|
|
69
|
+
|
|
70
|
+
`)}
|
|
71
|
+
}
|
|
72
|
+
`}function m0(t){return mm(Gr(t),wu(t))}function g0(t,r){const i=_u(r),s=Gr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return mm(s,i)}function y0(t,r,i){var f,d;const s=((d=(f=t.servers)==null?void 0:f[0])==null?void 0:d.url)??"http://localhost:3000",u=r.toUpperCase();return`<?php
|
|
73
|
+
$baseUrl = '${s}';
|
|
74
|
+
$url = $baseUrl . '${i}';
|
|
75
|
+
$opts = [
|
|
76
|
+
'http' => [
|
|
77
|
+
'method' => '${u}',
|
|
78
|
+
'header' => "Content-Type: application/json\\r\\nAuthorization: Bearer {$token}\\r\\n",
|
|
79
|
+
${u==="GET"||u==="HEAD"?"":"'content' => json_encode([]),"}
|
|
80
|
+
],
|
|
81
|
+
];
|
|
82
|
+
$context = stream_context_create($opts);
|
|
83
|
+
$response = file_get_contents($url, false, $context);
|
|
84
|
+
$data = json_decode($response, true);
|
|
85
|
+
`}function gm(t,r){const i=t.map((s,u)=>` public function ${xu(s.method,s.path,s.operationId,u)}(array $extraHeaders = []): array
|
|
86
|
+
{
|
|
87
|
+
$url = $this->baseUrl . '${s.path}';
|
|
88
|
+
$headers = array_merge($this->defaultHeaders, $extraHeaders);
|
|
89
|
+
$opts = [
|
|
90
|
+
'http' => [
|
|
91
|
+
'method' => '${s.method.toUpperCase()}',
|
|
92
|
+
'header' => $this->formatHeaders($headers),
|
|
93
|
+
],
|
|
94
|
+
];
|
|
95
|
+
$ctx = stream_context_create($opts);
|
|
96
|
+
$raw = file_get_contents($url, false, $ctx);
|
|
97
|
+
return json_decode($raw ?: '[]', true) ?: [];
|
|
98
|
+
}`);return`<?php
|
|
99
|
+
|
|
100
|
+
declare(strict_types=1);
|
|
101
|
+
|
|
102
|
+
final class ${r}
|
|
103
|
+
{
|
|
104
|
+
public function __construct(
|
|
105
|
+
private string $baseUrl,
|
|
106
|
+
/** @var array<string, string> */
|
|
107
|
+
private array $defaultHeaders = [],
|
|
108
|
+
) {
|
|
109
|
+
$this->baseUrl = rtrim($baseUrl, '/');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** @param array<string, string> $headers */
|
|
113
|
+
private function formatHeaders(array $headers): string
|
|
114
|
+
{
|
|
115
|
+
$lines = [];
|
|
116
|
+
foreach ($headers as $k => $v) {
|
|
117
|
+
$lines[] = $k . ': ' . $v;
|
|
118
|
+
}
|
|
119
|
+
return implode("\\r\\n", $lines) . "\\r\\n";
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
${i.join(`
|
|
123
|
+
|
|
124
|
+
`)}
|
|
125
|
+
}
|
|
126
|
+
`}function v0(t){return gm(Gr(t),wu(t))}function x0(t,r){const i=_u(r),s=Gr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return gm(s,i)}function w0(t,r,i){var d,m;const s=((m=(d=t.servers)==null?void 0:d[0])==null?void 0:m.url)??"http://localhost:3000",u=r.toLowerCase();return`import httpx
|
|
127
|
+
|
|
128
|
+
base_url = "${s}"
|
|
129
|
+
url = f"{base_url}${i}"
|
|
130
|
+
headers = {"Authorization": f"Bearer {token}"}
|
|
131
|
+
with httpx.Client() as client:
|
|
132
|
+
response = client.${u}(url, headers=headers${u==="get"||u==="head"?"":", json={}"})
|
|
133
|
+
data = response.json()
|
|
134
|
+
`}function ym(t,r){const i=t.map((s,u)=>{const f=xu(s.method,s.path,s.operationId,u),d=s.method.toLowerCase(),m=d==="get"||d==="head"?"":", json={}";return` def ${f}(self, headers: dict | None = None) -> dict:
|
|
135
|
+
h = {**self.default_headers, **(headers or {})}
|
|
136
|
+
r = self._client.${d}(f"{self.base_url}${s.path}", headers=h${m})
|
|
137
|
+
return r.json()`});return`from __future__ import annotations
|
|
138
|
+
import httpx
|
|
139
|
+
|
|
140
|
+
class ${r}:
|
|
141
|
+
def __init__(self, base_url: str, default_headers: dict | None = None) -> None:
|
|
142
|
+
self.base_url = base_url.rstrip("/")
|
|
143
|
+
self.default_headers = default_headers or {}
|
|
144
|
+
self._client = httpx.Client()
|
|
145
|
+
|
|
146
|
+
def close(self) -> None:
|
|
147
|
+
self._client.close()
|
|
148
|
+
|
|
149
|
+
${i.join(`
|
|
150
|
+
|
|
151
|
+
`)}
|
|
152
|
+
`}function _0(t){return ym(Gr(t),wu(t))}function S0(t,r){const i=_u(r),s=Gr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return ym(s,i)}function b0(t){const r=t.split("/");return(r[r.length-1]??"Unknown").replace(/[^a-zA-Z0-9_]/g,"_")}function yf(t){if(!t)return"unknown";if("$ref"in t&&t.$ref)return b0(t.$ref);const r=t;return r.type==="string"?"string":r.type==="number"||r.type==="integer"?"number":r.type==="boolean"?"boolean":r.type==="array"&&r.items?`${yf(r.items)}[]`:r.type==="object"&&r.properties?`{
|
|
153
|
+
${Object.entries(r.properties).map(([s,u])=>` ${JSON.stringify(s)}?: ${yf(u)};`).join(`
|
|
154
|
+
`)}
|
|
155
|
+
}`:"Record<string, unknown>"}function k0(t,r,i,s="baseUrl"){var w,b,x,S,C,j;const u=(b=(w=t.paths)==null?void 0:w[i])==null?void 0:b[r],f=u==null?void 0:u.requestBody;let d;if((S=(x=f==null?void 0:f.content)==null?void 0:x["application/json"])!=null&&S.schema){const M=f.content["application/json"].schema;M&&!("$ref"in M)&&(d=M)}const m=d?yf(d):"Record<string, unknown>",v=r.toUpperCase();return`const ${s} = "${((j=(C=t.servers)==null?void 0:C[0])==null?void 0:j.url)??"http://localhost:3000"}";
|
|
156
|
+
const res = await fetch(\`${s}${i}\`, {
|
|
157
|
+
method: "${v}",
|
|
158
|
+
headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
|
|
159
|
+
${v==="GET"||v==="HEAD"?"":`body: JSON.stringify({} as ${m}),`}
|
|
160
|
+
});
|
|
161
|
+
const data = await res.json() as unknown;
|
|
162
|
+
`}function vm(t,r){const i=t.map((s,u)=>` async ${xu(s.method,s.path,s.operationId,u)}(options?: { headers?: Record<string, string> }): Promise<unknown> {
|
|
163
|
+
const res = await fetch(\`\${this.baseUrl}${s.path}\`, {
|
|
164
|
+
method: "${s.method.toUpperCase()}",
|
|
165
|
+
headers: { ...this.defaultHeaders, ...options?.headers },
|
|
166
|
+
});
|
|
167
|
+
return res.json();
|
|
168
|
+
}`);return`export class ${r} {
|
|
169
|
+
constructor(
|
|
170
|
+
private baseUrl: string,
|
|
171
|
+
private defaultHeaders: Record<string, string> = {},
|
|
172
|
+
) {}
|
|
173
|
+
|
|
174
|
+
${i.join(`
|
|
175
|
+
|
|
176
|
+
`)}
|
|
177
|
+
}
|
|
178
|
+
`}function N0(t){const r=Gr(t),i=wu(t);return vm(r,i)}function E0(t,r){const i=_u(r),s=Gr(t).filter(u=>{var f;return(f=u.tags)==null?void 0:f.includes(r)});return vm(s,i)}function C0(t,r,i,s){switch(r){case"typescript":return k0(t,i,s);case"javascript":return h0(t,i,s);case"python":return w0(t,i,s);case"php":return y0(t,i,s);default:{const u=r;throw new Error(`Unsupported language: ${u}`)}}}function j0(t,r,i){switch(r){case"typescript":return E0(t,i);case"javascript":return g0(t,i);case"python":return S0(t,i);case"php":return x0(t,i);default:{const s=r;throw new Error(`Unsupported language: ${s}`)}}}function P0(t,r,i){if(i===null)switch(r){case"typescript":return N0(t);case"javascript":return m0(t);case"python":return _0(t);case"php":return v0(t);default:{const s=r;throw new Error(`Unsupported language: ${s}`)}}return j0(t,r,i)}function T0(t){const r=new Set;for(const i of Gr(t))for(const s of i.tags??[])r.add(s);return r.size===0&&r.add("default"),[...r].sort()}function ks(t,r){var i,s,u;return r!=null&&r.trim()?r.replace(/\/$/,""):((u=(s=(i=t.servers)==null?void 0:i[0])==null?void 0:s.url)==null?void 0:u.replace(/\/$/,""))??window.location.origin}function M0(t){var i;const r=(i=t.components)==null?void 0:i.securitySchemes;return r?Object.keys(r):[]}function Af(t,r){if(!r.startsWith("$"))return;let i=t;const s=r.slice(1);if(s.startsWith(".")){for(const u of s.slice(1).split("."))if(i&&typeof i=="object"&&u in i)i=i[u];else return;return i}return i}var Zl={exports:{}},I0=Zl.exports,Zp;function $0(){return Zp||(Zp=1,(function(t,r){((i,s)=>{t.exports=s()})(I0,function(){var i=function(a,c){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(h,y){h.__proto__=y}:function(h,y){for(var _ in y)Object.prototype.hasOwnProperty.call(y,_)&&(h[_]=y[_])}))(a,c)},s=function(){return(s=Object.assign||function(a){for(var c,h=1,y=arguments.length;h<y;h++)for(var _ in c=arguments[h])Object.prototype.hasOwnProperty.call(c,_)&&(a[_]=c[_]);return a}).apply(this,arguments)};function u(a,c,h){for(var y,_=0,N=c.length;_<N;_++)!y&&_ in c||((y=y||Array.prototype.slice.call(c,0,_))[_]=c[_]);return a.concat(y||Array.prototype.slice.call(c))}var f=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:r0,d=Object.keys,m=Array.isArray;function v(a,c){return typeof c=="object"&&d(c).forEach(function(h){a[h]=c[h]}),a}typeof Promise>"u"||f.Promise||(f.Promise=Promise);var w=Object.getPrototypeOf,b={}.hasOwnProperty;function x(a,c){return b.call(a,c)}function S(a,c){typeof c=="function"&&(c=c(w(a))),(typeof Reflect>"u"?d:Reflect.ownKeys)(c).forEach(function(h){j(a,h,c[h])})}var C=Object.defineProperty;function j(a,c,h,y){C(a,c,v(h&&x(h,"get")&&typeof h.get=="function"?{get:h.get,set:h.set,configurable:!0}:{value:h,configurable:!0,writable:!0},y))}function M(a){return{from:function(c){return a.prototype=Object.create(c.prototype),j(a.prototype,"constructor",a),{extend:S.bind(null,a.prototype)}}}}var I=Object.getOwnPropertyDescriptor,A=[].slice;function V(a,c,h){return A.call(a,c,h)}function P(a,c){return c(a)}function R(a){if(!a)throw new Error("Assertion Failed")}function q(a){f.setImmediate?setImmediate(a):setTimeout(a,0)}function B(a,c){if(typeof c=="string"&&x(a,c))return a[c];if(!c)return a;if(typeof c!="string"){for(var h=[],y=0,_=c.length;y<_;++y){var N=B(a,c[y]);h.push(N)}return h}var T,O=c.indexOf(".");return O===-1||(T=a[c.substr(0,O)])==null?void 0:B(T,c.substr(O+1))}function X(a,c,h){if(a&&c!==void 0&&!("isFrozen"in Object&&Object.isFrozen(a)))if(typeof c!="string"&&"length"in c){R(typeof h!="string"&&"length"in h);for(var y=0,_=c.length;y<_;++y)X(a,c[y],h[y])}else{var N,T,O=c.indexOf(".");O!==-1?(N=c.substr(0,O),(O=c.substr(O+1))===""?h===void 0?m(a)&&!isNaN(parseInt(N))?a.splice(N,1):delete a[N]:a[N]=h:X(T=(T=a[N])&&x(a,N)?T:a[N]={},O,h)):h===void 0?m(a)&&!isNaN(parseInt(c))?a.splice(c,1):delete a[c]:a[c]=h}}function fe(a){var c,h={};for(c in a)x(a,c)&&(h[c]=a[c]);return h}var he=[].concat;function Se(a){return he.apply([],a)}var H="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Se([8,16,32,64].map(function(a){return["Int","Uint","Float"].map(function(c){return c+a+"Array"})}))).filter(function(a){return f[a]}),K=new Set(H.map(function(a){return f[a]})),ce=null;function xe(a){return ce=new WeakMap,a=(function c(h){if(!h||typeof h!="object")return h;var y=ce.get(h);if(y)return y;if(m(h)){y=[],ce.set(h,y);for(var _=0,N=h.length;_<N;++_)y.push(c(h[_]))}else if(K.has(h.constructor))y=h;else{var T,O=w(h);for(T in y=O===Object.prototype?{}:Object.create(O),ce.set(h,y),h)x(h,T)&&(y[T]=c(h[T]))}return y})(a),ce=null,a}var D={}.toString;function le(a){return D.call(a).slice(8,-1)}var Q=typeof Symbol<"u"?Symbol.iterator:"@@iterator",se=typeof Q=="symbol"?function(a){var c;return a!=null&&(c=a[Q])&&c.apply(a)}:function(){return null};function L(a,c){c=a.indexOf(c),0<=c&&a.splice(c,1)}var U={};function F(a){var c,h,y,_;if(arguments.length===1){if(m(a))return a.slice();if(this===U&&typeof a=="string")return[a];if(_=se(a))for(h=[];!(y=_.next()).done;)h.push(y.value);else{if(a==null)return[a];if(typeof(c=a.length)!="number")return[a];for(h=new Array(c);c--;)h[c]=a[c]}}else for(c=arguments.length,h=new Array(c);c--;)h[c]=arguments[c];return h}var $=typeof Symbol<"u"?function(a){return a[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},H=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Nt=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(H),we={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function be(a,c){this.name=a,this.message=c}function Te(a,c){return a+". Errors: "+Object.keys(c).map(function(h){return c[h].toString()}).filter(function(h,y,_){return _.indexOf(h)===y}).join(`
|
|
179
|
+
`)}function $e(a,c,h,y){this.failures=c,this.failedKeys=y,this.successCount=h,this.message=Te(a,c)}function Re(a,c){this.name="BulkError",this.failures=Object.keys(c).map(function(h){return c[h]}),this.failuresByPos=c,this.message=Te(a,this.failures)}M(be).from(Error).extend({toString:function(){return this.name+": "+this.message}}),M($e).from(be),M(Re).from(be);var _e=Nt.reduce(function(a,c){return a[c]=c+"Error",a},{}),Be=be,ke=Nt.reduce(function(a,c){var h=c+"Error";function y(_,N){this.name=h,_?typeof _=="string"?(this.message="".concat(_).concat(N?`
|
|
180
|
+
`+N:""),this.inner=N||null):typeof _=="object"&&(this.message="".concat(_.name," ").concat(_.message),this.inner=_):(this.message=we[c]||h,this.inner=null)}return M(y).from(Be),a[c]=y,a},{}),He=(ke.Syntax=SyntaxError,ke.Type=TypeError,ke.Range=RangeError,H.reduce(function(a,c){return a[c+"Error"]=ke[c],a},{}));H=Nt.reduce(function(a,c){return["Syntax","Type","Range"].indexOf(c)===-1&&(a[c+"Error"]=ke[c]),a},{});function Ae(){}function qe(a){return a}function ut(a,c){return a==null||a===qe?c:function(h){return c(a(h))}}function ct(a,c){return function(){a.apply(this,arguments),c.apply(this,arguments)}}function it(a,c){return a===Ae?c:function(){var h=a.apply(this,arguments),y=(h!==void 0&&(arguments[0]=h),this.onsuccess),_=this.onerror,N=(this.onsuccess=null,this.onerror=null,c.apply(this,arguments));return y&&(this.onsuccess=this.onsuccess?ct(y,this.onsuccess):y),_&&(this.onerror=this.onerror?ct(_,this.onerror):_),N!==void 0?N:h}}function Mt(a,c){return a===Ae?c:function(){a.apply(this,arguments);var h=this.onsuccess,y=this.onerror;this.onsuccess=this.onerror=null,c.apply(this,arguments),h&&(this.onsuccess=this.onsuccess?ct(h,this.onsuccess):h),y&&(this.onerror=this.onerror?ct(y,this.onerror):y)}}function St(a,c){return a===Ae?c:function(_){var y=a.apply(this,arguments),_=(v(_,y),this.onsuccess),N=this.onerror,T=(this.onsuccess=null,this.onerror=null,c.apply(this,arguments));return _&&(this.onsuccess=this.onsuccess?ct(_,this.onsuccess):_),N&&(this.onerror=this.onerror?ct(N,this.onerror):N),y===void 0?T===void 0?void 0:T:v(y,T)}}function tn(a,c){return a===Ae?c:function(){return c.apply(this,arguments)!==!1&&a.apply(this,arguments)}}function Ot(a,c){return a===Ae?c:function(){var h=a.apply(this,arguments);if(h&&typeof h.then=="function"){for(var y=this,_=arguments.length,N=new Array(_);_--;)N[_]=arguments[_];return h.then(function(){return c.apply(y,N)})}return c.apply(this,arguments)}}H.ModifyError=$e,H.DexieError=be,H.BulkError=Re;var bt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function wn(a){bt=a}var fn={},gr=100,_n=typeof Promise>"u"?[]:(Nt=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[_n=crypto.subtle.digest("SHA-512",new Uint8Array([0])),w(_n),Nt]:[Nt,w(Nt),Nt]),Nt=_n[0],ho=_n[1],ho=ho&&ho.then,Ht=Nt&&Nt.constructor,Hn=!!_n[2],tr=function(a,c){Un.push([a,c]),Pn&&(queueMicrotask(eo),Pn=!1)},Sn=!0,Pn=!0,Vn=[],dn=[],nr=qe,bn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Ae,pgp:!1,env:{},finalize:Ae},Ye=bn,Un=[],kn=0,rr=[];function Ve(a){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var c=this._PSD=Ye;if(typeof a!="function"){if(a!==fn)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&Or(this,this._value)}else this._state=null,this._value=null,++c.ref,(function h(y,_){try{_(function(N){if(y._state===null){if(N===y)throw new TypeError("A promise cannot be resolved with itself.");var T=y._lib&&Nn();N&&typeof N.then=="function"?h(y,function(O,J){N instanceof Ve?N._then(O,J):N.then(O,J)}):(y._state=!0,y._value=N,Zr(y)),T&&Mn()}},Or.bind(null,y))}catch(N){Or(y,N)}})(this,a)}var Tn={get:function(){var a=Ye,c=rn;function h(y,_){var N=this,T=!a.global&&(a!==Ye||c!==rn),O=T&&!Lt(),J=new Ve(function(ue,te){Rr(N,new Kn(ci(y,a,T,O),ci(_,a,T,O),ue,te,a))});return this._consoleTask&&(J._consoleTask=this._consoleTask),J}return h.prototype=fn,h},set:function(a){j(this,"then",a&&a.prototype===fn?Tn:{get:function(){return a},set:Tn.set})}};function Kn(a,c,h,y,_){this.onFulfilled=typeof a=="function"?a:null,this.onRejected=typeof c=="function"?c:null,this.resolve=h,this.reject=y,this.psd=_}function Or(a,c){var h,y;dn.push(c),a._state===null&&(h=a._lib&&Nn(),c=nr(c),a._state=!1,a._value=c,y=a,Vn.some(function(_){return _._value===y._value})||Vn.push(y),Zr(a),h)&&Mn()}function Zr(a){var c=a._listeners;a._listeners=[];for(var h=0,y=c.length;h<y;++h)Rr(a,c[h]);var _=a._PSD;--_.ref||_.finalize(),kn===0&&(++kn,tr(function(){--kn==0&&W()},[]))}function Rr(a,c){if(a._state===null)a._listeners.push(c);else{var h=a._state?c.onFulfilled:c.onRejected;if(h===null)return(a._state?c.resolve:c.reject)(a._value);++c.psd.ref,++kn,tr(Io,[h,a,c])}}function Io(a,c,h){try{var y,_=c._value;!c._state&&dn.length&&(dn=[]),y=bt&&c._consoleTask?c._consoleTask.run(function(){return a(_)}):a(_),c._state||dn.indexOf(_)!==-1||(N=>{for(var T=Vn.length;T;)if(Vn[--T]._value===N._value)return Vn.splice(T,1)})(c),h.resolve(y)}catch(N){h.reject(N)}finally{--kn==0&&W(),--h.psd.ref||h.psd.finalize()}}function eo(){ir(bn,function(){Nn()&&Mn()})}function Nn(){var a=Sn;return Pn=Sn=!1,a}function Mn(){var a,c,h;do for(;0<Un.length;)for(a=Un,Un=[],h=a.length,c=0;c<h;++c){var y=a[c];y[0].apply(null,y[1])}while(0<Un.length);Pn=Sn=!0}function W(){for(var a=Vn,c=(Vn=[],a.forEach(function(y){y._PSD.onunhandled.call(null,y._value,y)}),rr.slice(0)),h=c.length;h;)c[--h]()}function Fe(a){return new Ve(fn,!1,a)}function Le(a,c){var h=Ye;return function(){var y=Nn(),_=Ye;try{return In(h,!0),a.apply(this,arguments)}catch(N){c&&c(N)}finally{In(_,!1),y&&Mn()}}}S(Ve.prototype,{then:Tn,_then:function(a,c){Rr(this,new Kn(null,null,a,c,Ye))},catch:function(a){var c,h;return arguments.length===1?this.then(null,a):(c=a,h=arguments[1],typeof c=="function"?this.then(null,function(y){return(y instanceof c?h:Fe)(y)}):this.then(null,function(y){return(y&&y.name===c?h:Fe)(y)}))},finally:function(a){return this.then(function(c){return Ve.resolve(a()).then(function(){return c})},function(c){return Ve.resolve(a()).then(function(){return Fe(c)})})},timeout:function(a,c){var h=this;return a<1/0?new Ve(function(y,_){var N=setTimeout(function(){return _(new ke.Timeout(c))},a);h.then(y,_).finally(clearTimeout.bind(null,N))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&j(Ve.prototype,Symbol.toStringTag,"Dexie.Promise"),bn.env=ui(),S(Ve,{all:function(){var a=F.apply(null,arguments).map(Wn);return new Ve(function(c,h){a.length===0&&c([]);var y=a.length;a.forEach(function(_,N){return Ve.resolve(_).then(function(T){a[N]=T,--y||c(a)},h)})})},resolve:function(a){return a instanceof Ve?a:a&&typeof a.then=="function"?new Ve(function(c,h){a.then(c,h)}):new Ve(fn,!0,a)},reject:Fe,race:function(){var a=F.apply(null,arguments).map(Wn);return new Ve(function(c,h){a.map(function(y){return Ve.resolve(y).then(c,h)})})},PSD:{get:function(){return Ye},set:function(a){return Ye=a}},totalEchoes:{get:function(){return rn}},newPSD:on,usePSD:ir,scheduler:{get:function(){return tr},set:function(a){tr=a}},rejectionMapper:{get:function(){return nr},set:function(a){nr=a}},follow:function(a,c){return new Ve(function(h,y){return on(function(_,N){var T=Ye;T.unhandleds=[],T.onunhandled=N,T.finalize=ct(function(){var O,J=this;O=function(){J.unhandleds.length===0?_():N(J.unhandleds[0])},rr.push(function ue(){O(),rr.splice(rr.indexOf(ue),1)}),++kn,tr(function(){--kn==0&&W()},[])},T.finalize),a()},c,h,y)})}}),Ht&&(Ht.allSettled&&j(Ve,"allSettled",function(){var a=F.apply(null,arguments).map(Wn);return new Ve(function(c){a.length===0&&c([]);var h=a.length,y=new Array(h);a.forEach(function(_,N){return Ve.resolve(_).then(function(T){return y[N]={status:"fulfilled",value:T}},function(T){return y[N]={status:"rejected",reason:T}}).then(function(){return--h||c(y)})})})}),Ht.any&&typeof AggregateError<"u"&&j(Ve,"any",function(){var a=F.apply(null,arguments).map(Wn);return new Ve(function(c,h){a.length===0&&h(new AggregateError([]));var y=a.length,_=new Array(y);a.forEach(function(N,T){return Ve.resolve(N).then(function(O){return c(O)},function(O){_[T]=O,--y||h(new AggregateError(_))})})})}),Ht.withResolvers)&&(Ve.withResolvers=Ht.withResolvers);var nt={awaits:0,echoes:0,id:0},nn=0,Wt=[],Vt=0,rn=0,to=0;function on(a,T,h,y){var _=Ye,N=Object.create(_),T=(N.parent=_,N.ref=0,N.global=!1,N.id=++to,bn.env,N.env=Hn?{Promise:Ve,PromiseProp:{value:Ve,configurable:!0,writable:!0},all:Ve.all,race:Ve.race,allSettled:Ve.allSettled,any:Ve.any,resolve:Ve.resolve,reject:Ve.reject}:{},T&&v(N,T),++_.ref,N.finalize=function(){--this.parent.ref||this.parent.finalize()},ir(N,a,h,y));return N.ref===0&&N.finalize(),T}function qn(){return nt.id||(nt.id=++nn),++nt.awaits,nt.echoes+=gr,nt.id}function Lt(){return!!nt.awaits&&(--nt.awaits==0&&(nt.id=0),nt.echoes=nt.awaits*gr,!0)}function Wn(a){return nt.echoes&&a&&a.constructor===Ht?(qn(),a.then(function(c){return Lt(),c},function(c){return Lt(),Et(c)})):a}function or(){var a=Wt[Wt.length-1];Wt.pop(),In(a,!1)}function In(a,c){var h,y,_=Ye;(c?!nt.echoes||Vt++&&a===Ye:!Vt||--Vt&&a===Ye)||queueMicrotask(c?(function(N){++rn,nt.echoes&&--nt.echoes!=0||(nt.echoes=nt.awaits=nt.id=0),Wt.push(Ye),In(N,!0)}).bind(null,a):or),a!==Ye&&(Ye=a,_===bn&&(bn.env=ui()),Hn)&&(h=bn.env.Promise,y=a.env,_.global||a.global)&&(Object.defineProperty(f,"Promise",y.PromiseProp),h.all=y.all,h.race=y.race,h.resolve=y.resolve,h.reject=y.reject,y.allSettled&&(h.allSettled=y.allSettled),y.any)&&(h.any=y.any)}function ui(){var a=f.Promise;return Hn?{Promise:a,PromiseProp:Object.getOwnPropertyDescriptor(f,"Promise"),all:a.all,race:a.race,allSettled:a.allSettled,any:a.any,resolve:a.resolve,reject:a.reject}:{}}function ir(a,c,h,y,_){var N=Ye;try{return In(a,!0),c(h,y,_)}finally{In(N,!1)}}function ci(a,c,h,y){return typeof a!="function"?a:function(){var _=Ye;h&&qn(),In(c,!0);try{return a.apply(this,arguments)}finally{In(_,!1),y&&queueMicrotask(Lt)}}}function $o(a){Promise===Ht&&nt.echoes===0?Vt===0?a():enqueueNativeMicroTask(a):setTimeout(a,0)}(""+ho).indexOf("[native code]")===-1&&(qn=Lt=Ae);var Et=Ve.reject,sr="",gt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Bi="String expected.",Dr="__dbnames",Ao="readonly",zr="readwrite";function yr(a,c){return a?c?function(){return a.apply(this,arguments)&&c.apply(this,arguments)}:a:c}var fi={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function ar(a){return typeof a!="string"||/\./.test(a)?function(c){return c}:function(c){return c[a]===void 0&&a in c&&delete(c=xe(c))[a],c}}function En(){throw ke.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function ft(a,c){try{var h=pn(a),y=pn(c);if(h!==y)return h==="Array"?1:y==="Array"?-1:h==="binary"?1:y==="binary"?-1:h==="string"?1:y==="string"?-1:h==="Date"?1:y!=="Date"?NaN:-1;switch(h){case"number":case"Date":case"string":return c<a?1:a<c?-1:0;case"binary":for(var _=Hi(a),N=Hi(c),T=_.length,O=N.length,J=T<O?T:O,ue=0;ue<J;++ue)if(_[ue]!==N[ue])return _[ue]<N[ue]?-1:1;return T===O?0:T<O?-1:1;case"Array":for(var te=a,G=c,Z=te.length,ae=G.length,oe=Z<ae?Z:ae,re=0;re<oe;++re){var ie=ft(te[re],G[re]);if(ie!==0)return ie}return Z===ae?0:Z<ae?-1:1}}catch{}return NaN}function pn(a){var c=typeof a;return c=="object"&&(ArrayBuffer.isView(a)||(c=le(a))==="ArrayBuffer")?"binary":c}function Hi(a){return a instanceof Uint8Array?a:ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):new Uint8Array(a)}function Oo(a,c,h){var y=a.schema.yProps;return y?(c&&0<h.numFailures&&(c=c.filter(function(_,N){return!h.failures[N]})),Promise.all(y.map(function(_){return _=_.updatesTable,c?a.db.table(_).where("k").anyOf(c).delete():a.db.table(_).clear()})).then(function(){return h})):h}ro.prototype.execute=function(a){var c=this["@@propmod"];if(c.add!==void 0){var h=c.add;if(m(h))return u(u([],m(a)?a:[],!0),h).sort();if(typeof h=="number")return(Number(a)||0)+h;if(typeof h=="bigint")try{return BigInt(a)+h}catch{return BigInt(0)+h}throw new TypeError("Invalid term ".concat(h))}if(c.remove!==void 0){var y=c.remove;if(m(y))return m(a)?a.filter(function(_){return!y.includes(_)}).sort():[];if(typeof y=="number")return Number(a)-y;if(typeof y=="bigint")try{return BigInt(a)-y}catch{return BigInt(0)-y}throw new TypeError("Invalid subtrahend ".concat(y))}return h=(h=c.replacePrefix)==null?void 0:h[0],h&&typeof a=="string"&&a.startsWith(h)?c.replacePrefix[1]+a.substring(h.length):a};var no=ro;function ro(a){this["@@propmod"]=a}function oo(a,c){for(var h=d(c),y=h.length,_=!1,N=0;N<y;++N){var T=h[N],O=c[T],J=B(a,T);O instanceof no?(X(a,T,O.execute(J)),_=!0):J!==O&&(X(a,T,O),_=!0)}return _}yt.prototype._trans=function(a,c,h){var y=this._tx||Ye.trans,_=this.name,N=bt&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(a==="readonly"?"read":"write"," ").concat(this.name));function T(ue,te,G){if(G.schema[_])return c(G.idbtrans,G);throw new ke.NotFound("Table "+_+" not part of transaction")}var O=Nn();try{var J=y&&y.db._novip===this.db._novip?y===Ye.trans?y._promise(a,T,h):on(function(){return y._promise(a,T,h)},{trans:y,transless:Ye.transless||Ye}):(function ue(te,G,Z,ae){if(te.idbdb&&(te._state.openComplete||Ye.letThrough||te._vip)){var oe=te._createTransaction(G,Z,te._dbSchema);try{oe.create(),te._state.PR1398_maxLoop=3}catch(re){return re.name===_e.InvalidState&&te.isOpen()&&0<--te._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),te.close({disableAutoOpen:!1}),te.open().then(function(){return ue(te,G,Z,ae)})):Et(re)}return oe._promise(G,function(re,ie){return on(function(){return Ye.trans=oe,ae(re,ie,oe)})}).then(function(re){if(G==="readwrite")try{oe.idbtrans.commit()}catch{}return G==="readonly"?re:oe._completion.then(function(){return re})})}if(te._state.openComplete)return Et(new ke.DatabaseClosed(te._state.dbOpenError));if(!te._state.isBeingOpened){if(!te._state.autoOpen)return Et(new ke.DatabaseClosed);te.open().catch(Ae)}return te._state.dbReadyPromise.then(function(){return ue(te,G,Z,ae)})})(this.db,a,[this.name],T);return N&&(J._consoleTask=N,J=J.catch(function(ue){return console.trace(ue),Et(ue)})),J}finally{O&&Mn()}},yt.prototype.get=function(a,c){var h=this;return a&&a.constructor===Object?this.where(a).first(c):a==null?Et(new ke.Type("Invalid argument to Table.get()")):this._trans("readonly",function(y){return h.core.get({trans:y,key:a}).then(function(_){return h.hook.reading.fire(_)})}).then(c)},yt.prototype.where=function(a){if(typeof a=="string")return new this.db.WhereClause(this,a);if(m(a))return new this.db.WhereClause(this,"[".concat(a.join("+"),"]"));var c=d(a);if(c.length===1)return this.where(c[0]).equals(a[c[0]]);var h=this.schema.indexes.concat(this.schema.primKey).filter(function(O){if(O.compound&&c.every(function(ue){return 0<=O.keyPath.indexOf(ue)})){for(var J=0;J<c.length;++J)if(c.indexOf(O.keyPath[J])===-1)return!1;return!0}return!1}).sort(function(O,J){return O.keyPath.length-J.keyPath.length})[0];if(h&&this.db._maxKey!==sr)return T=h.keyPath.slice(0,c.length),this.where(T).equals(T.map(function(O){return a[O]}));!h&&bt&&console.warn("The query ".concat(JSON.stringify(a)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(c.join("+"),"]"));var y=this.schema.idxByName;function _(O,J){return ft(O,J)===0}var T=c.reduce(function(te,J){var ue=te[0],te=te[1],G=y[J],Z=a[J];return[ue||G,ue||!G?yr(te,G&&G.multi?function(ae){return ae=B(ae,J),m(ae)&&ae.some(function(oe){return _(Z,oe)})}:function(ae){return _(Z,B(ae,J))}):te]},[null,null]),N=T[0],T=T[1];return N?this.where(N.name).equals(a[N.keyPath]).filter(T):h?this.filter(T):this.where(c).equals("")},yt.prototype.filter=function(a){return this.toCollection().and(a)},yt.prototype.count=function(a){return this.toCollection().count(a)},yt.prototype.offset=function(a){return this.toCollection().offset(a)},yt.prototype.limit=function(a){return this.toCollection().limit(a)},yt.prototype.each=function(a){return this.toCollection().each(a)},yt.prototype.toArray=function(a){return this.toCollection().toArray(a)},yt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},yt.prototype.orderBy=function(a){return new this.db.Collection(new this.db.WhereClause(this,m(a)?"[".concat(a.join("+"),"]"):a))},yt.prototype.reverse=function(){return this.toCollection().reverse()},yt.prototype.mapToClass=function(a){for(var c=this.db,h=this.name,y=((this.schema.mappedClass=a).prototype instanceof En&&(a=(T=>{var O=te,J=T;if(typeof J!="function"&&J!==null)throw new TypeError("Class extends value "+String(J)+" is not a constructor or null");function ue(){this.constructor=O}function te(){return T!==null&&T.apply(this,arguments)||this}return i(O,J),O.prototype=J===null?Object.create(J):(ue.prototype=J.prototype,new ue),Object.defineProperty(te.prototype,"db",{get:function(){return c},enumerable:!1,configurable:!0}),te.prototype.table=function(){return h},te})(a)),new Set),_=a.prototype;_;_=w(_))Object.getOwnPropertyNames(_).forEach(function(T){return y.add(T)});function N(T){if(!T)return T;var O,J=Object.create(a.prototype);for(O in T)if(!y.has(O))try{J[O]=T[O]}catch{}return J}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=N,this.hook("reading",N),a},yt.prototype.defineClass=function(){return this.mapToClass(function(a){v(this,a)})},yt.prototype.add=function(a,c){var h=this,y=this.schema.primKey,_=y.auto,N=y.keyPath,T=a;return N&&_&&(T=ar(N)(a)),this._trans("readwrite",function(O){return h.core.mutate({trans:O,type:"add",keys:c!=null?[c]:null,values:[T]})}).then(function(O){return O.numFailures?Ve.reject(O.failures[0]):O.lastResult}).then(function(O){if(N)try{X(a,N,O)}catch{}return O})},yt.prototype.upsert=function(a,c){var h=this,y=this.schema.primKey.keyPath;return this._trans("readwrite",function(_){return h.core.get({trans:_,key:a}).then(function(N){var T=N??{};return oo(T,c),y&&X(T,y,a),h.core.mutate({trans:_,type:"put",values:[T],keys:[a],upsert:!0,updates:{keys:[a],changeSpecs:[c]}}).then(function(O){return O.numFailures?Ve.reject(O.failures[0]):!!N})})})},yt.prototype.update=function(a,c){return typeof a!="object"||m(a)?this.where(":id").equals(a).modify(c):(a=B(a,this.schema.primKey.keyPath))===void 0?Et(new ke.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(a).modify(c)},yt.prototype.put=function(a,c){var h=this,y=this.schema.primKey,_=y.auto,N=y.keyPath,T=a;return N&&_&&(T=ar(N)(a)),this._trans("readwrite",function(O){return h.core.mutate({trans:O,type:"put",values:[T],keys:c!=null?[c]:null})}).then(function(O){return O.numFailures?Ve.reject(O.failures[0]):O.lastResult}).then(function(O){if(N)try{X(a,N,O)}catch{}return O})},yt.prototype.delete=function(a){var c=this;return this._trans("readwrite",function(h){return c.core.mutate({trans:h,type:"delete",keys:[a]}).then(function(y){return Oo(c,[a],y)}).then(function(y){return y.numFailures?Ve.reject(y.failures[0]):void 0})})},yt.prototype.clear=function(){var a=this;return this._trans("readwrite",function(c){return a.core.mutate({trans:c,type:"deleteRange",range:fi}).then(function(h){return Oo(a,null,h)})}).then(function(c){return c.numFailures?Ve.reject(c.failures[0]):void 0})},yt.prototype.bulkGet=function(a){var c=this;return this._trans("readonly",function(h){return c.core.getMany({keys:a,trans:h}).then(function(y){return y.map(function(_){return c.hook.reading.fire(_)})})})},yt.prototype.bulkAdd=function(a,c,h){var y=this,_=Array.isArray(c)?c:void 0,N=(h=h||(_?void 0:c))?h.allKeys:void 0;return this._trans("readwrite",function(T){var O=y.schema.primKey,ue=O.auto,O=O.keyPath;if(O&&_)throw new ke.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(_&&_.length!==a.length)throw new ke.InvalidArgument("Arguments objects and keys must have the same length");var J=a.length,ue=O&&ue?a.map(ar(O)):a;return y.core.mutate({trans:T,type:"add",keys:_,values:ue,wantResults:N}).then(function(te){var G=te.numFailures,Z=te.failures;if(G===0)return N?te.results:te.lastResult;throw new Re("".concat(y.name,".bulkAdd(): ").concat(G," of ").concat(J," operations failed"),Z)})})},yt.prototype.bulkPut=function(a,c,h){var y=this,_=Array.isArray(c)?c:void 0,N=(h=h||(_?void 0:c))?h.allKeys:void 0;return this._trans("readwrite",function(T){var O=y.schema.primKey,ue=O.auto,O=O.keyPath;if(O&&_)throw new ke.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(_&&_.length!==a.length)throw new ke.InvalidArgument("Arguments objects and keys must have the same length");var J=a.length,ue=O&&ue?a.map(ar(O)):a;return y.core.mutate({trans:T,type:"put",keys:_,values:ue,wantResults:N}).then(function(te){var G=te.numFailures,Z=te.failures;if(G===0)return N?te.results:te.lastResult;throw new Re("".concat(y.name,".bulkPut(): ").concat(G," of ").concat(J," operations failed"),Z)})})},yt.prototype.bulkUpdate=function(a){var c=this,h=this.core,y=a.map(function(T){return T.key}),_=a.map(function(T){return T.changes}),N=[];return this._trans("readwrite",function(T){return h.getMany({trans:T,keys:y,cache:"clone"}).then(function(O){var J=[],ue=[],te=(a.forEach(function(G,Z){var ae=G.key,oe=G.changes,re=O[Z];if(re){for(var ie=0,ge=Object.keys(oe);ie<ge.length;ie++){var de=ge[ie],ve=oe[de];if(de===c.schema.primKey.keyPath){if(ft(ve,ae)!==0)throw new ke.Constraint("Cannot update primary key in bulkUpdate()")}else X(re,de,ve)}N.push(Z),J.push(ae),ue.push(re)}}),J.length);return h.mutate({trans:T,type:"put",keys:J,values:ue,updates:{keys:y,changeSpecs:_}}).then(function(G){var Z=G.numFailures,ae=G.failures;if(Z===0)return te;for(var oe=0,re=Object.keys(ae);oe<re.length;oe++){var ie,ge=re[oe],de=N[Number(ge)];de!=null&&(ie=ae[ge],delete ae[ge],ae[de]=ie)}throw new Re("".concat(c.name,".bulkUpdate(): ").concat(Z," of ").concat(te," operations failed"),ae)})})})},yt.prototype.bulkDelete=function(a){var c=this,h=a.length;return this._trans("readwrite",function(y){return c.core.mutate({trans:y,type:"delete",keys:a}).then(function(_){return Oo(c,a,_)})}).then(function(y){var _=y.numFailures,N=y.failures;if(_===0)return y.lastResult;throw new Re("".concat(c.name,".bulkDelete(): ").concat(_," of ").concat(h," operations failed"),N)})};var Yn=yt;function yt(){}function Lr(a){function c(T,O){if(O){for(var J=arguments.length,ue=new Array(J-1);--J;)ue[J-1]=arguments[J];return h[T].subscribe.apply(null,ue),a}if(typeof T=="string")return h[T]}var h={};c.addEventType=N;for(var y=1,_=arguments.length;y<_;++y)N(arguments[y]);return c;function N(T,O,J){var ue,te;if(typeof T!="object")return O=O||tn,te={subscribers:[],fire:J=J||Ae,subscribe:function(G){te.subscribers.indexOf(G)===-1&&(te.subscribers.push(G),te.fire=O(te.fire,G))},unsubscribe:function(G){te.subscribers=te.subscribers.filter(function(Z){return Z!==G}),te.fire=te.subscribers.reduce(O,J)}},h[T]=c[T]=te;d(ue=T).forEach(function(G){var Z=ue[G];if(m(Z))N(G,ue[G][0],ue[G][1]);else{if(Z!=="asap")throw new ke.InvalidArgument("Invalid event config");var ae=N(G,qe,function(){for(var oe=arguments.length,re=new Array(oe);oe--;)re[oe]=arguments[oe];ae.subscribers.forEach(function(ie){q(function(){ie.apply(null,re)})})})}})}}function io(a,c){return M(c).from({prototype:a}),c}function lr(a,c){return!(a.filter||a.algorithm||a.or)&&(c?a.justLimit:!a.replayFilter)}function Fr(a,c){a.filter=yr(a.filter,c)}function so(a,c,h){var y=a.replayFilter;a.replayFilter=y?function(){return yr(y(),c())}:c,a.justLimit=h&&!y}function ur(a,c){if(a.isPrimKey)return c.primaryKey;var h=c.getIndexByKeyPath(a.index);if(h)return h;throw new ke.Schema("KeyPath "+a.index+" on object store "+c.name+" is not indexed")}function di(a,c,h){var y=ur(a,c.schema);return c.openCursor({trans:h,values:!a.keysOnly,reverse:a.dir==="prev",unique:!!a.unique,query:{index:y,range:a.range}})}function Ro(a,c,h,y){var _,N,T=a.replayFilter?yr(a.filter,a.replayFilter()):a.filter;return a.or?(_={},N=function(O,J,ue){var te,G;T&&!T(J,ue,function(Z){return J.stop(Z)},function(Z){return J.fail(Z)})||((G=""+(te=J.primaryKey))=="[object ArrayBuffer]"&&(G=""+new Uint8Array(te)),x(_,G))||(_[G]=!0,c(O,J,ue))},Promise.all([a.or._iterate(N,h),xt(di(a,y,h),a.algorithm,N,!a.keysOnly&&a.valueMapper)])):xt(di(a,y,h),yr(a.algorithm,T),c,!a.keysOnly&&a.valueMapper)}function xt(a,c,h,y){var _=Le(y?function(N,T,O){return h(y(N),T,O)}:h);return a.then(function(N){if(N)return N.start(function(){var T=function(){return N.continue()};c&&!c(N,function(O){return T=O},function(O){N.stop(O),T=Ae},function(O){N.fail(O),T=Ae})||_(N.value,N,function(O){return T=O}),T()})})}ht.prototype._read=function(a,c){var h=this._ctx;return h.error?h.table._trans(null,Et.bind(null,h.error)):h.table._trans("readonly",a).then(c)},ht.prototype._write=function(a){var c=this._ctx;return c.error?c.table._trans(null,Et.bind(null,c.error)):c.table._trans("readwrite",a,"locked")},ht.prototype._addAlgorithm=function(a){var c=this._ctx;c.algorithm=yr(c.algorithm,a)},ht.prototype._iterate=function(a,c){return Ro(this._ctx,a,c,this._ctx.table.core)},ht.prototype.clone=function(a){var c=Object.create(this.constructor.prototype),h=Object.create(this._ctx);return a&&v(h,a),c._ctx=h,c},ht.prototype.raw=function(){return this._ctx.valueMapper=null,this},ht.prototype.each=function(a){var c=this._ctx;return this._read(function(h){return Ro(c,a,h,c.table.core)})},ht.prototype.count=function(a){var c=this;return this._read(function(h){var y,_=c._ctx,N=_.table.core;return lr(_,!0)?N.count({trans:h,query:{index:ur(_,N.schema),range:_.range}}).then(function(T){return Math.min(T,_.limit)}):(y=0,Ro(_,function(){return++y,!1},h,N).then(function(){return y}))}).then(a)},ht.prototype.sortBy=function(a,c){var h=a.split(".").reverse(),y=h[0],_=h.length-1;function N(J,ue){return ue?N(J[h[ue]],ue-1):J[y]}var T=this._ctx.dir==="next"?1:-1;function O(J,ue){return ft(N(J,_),N(ue,_))*T}return this.toArray(function(J){return J.sort(O)}).then(c)},ht.prototype.toArray=function(a){var c=this;return this._read(function(h){var y,_,N,T=c._ctx;return lr(T,!0)&&0<T.limit?(y=T.valueMapper,_=ur(T,T.table.core.schema),T.table.core.query({trans:h,limit:T.limit,values:!0,direction:T.dir==="prev"?"prev":void 0,query:{index:_,range:T.range}}).then(function(O){return O=O.result,y?O.map(y):O})):(N=[],Ro(T,function(O){return N.push(O)},h,T.table.core).then(function(){return N}))},a)},ht.prototype.offset=function(a){var c=this._ctx;return a<=0||(c.offset+=a,lr(c)?so(c,function(){var h=a;return function(y,_){return h===0||(h===1?--h:_(function(){y.advance(h),h=0}),!1)}}):so(c,function(){var h=a;return function(){return--h<0}})),this},ht.prototype.limit=function(a){return this._ctx.limit=Math.min(this._ctx.limit,a),so(this._ctx,function(){var c=a;return function(h,y,_){return--c<=0&&y(_),0<=c}},!0),this},ht.prototype.until=function(a,c){return Fr(this._ctx,function(h,y,_){return!a(h.value)||(y(_),c)}),this},ht.prototype.first=function(a){return this.limit(1).toArray(function(c){return c[0]}).then(a)},ht.prototype.last=function(a){return this.reverse().first(a)},ht.prototype.filter=function(a){var c;return Fr(this._ctx,function(h){return a(h.value)}),(c=this._ctx).isMatch=yr(c.isMatch,a),this},ht.prototype.and=function(a){return this.filter(a)},ht.prototype.or=function(a){return new this.db.WhereClause(this._ctx.table,a,this)},ht.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},ht.prototype.desc=function(){return this.reverse()},ht.prototype.eachKey=function(a){var c=this._ctx;return c.keysOnly=!c.isMatch,this.each(function(h,y){a(y.key,y)})},ht.prototype.eachUniqueKey=function(a){return this._ctx.unique="unique",this.eachKey(a)},ht.prototype.eachPrimaryKey=function(a){var c=this._ctx;return c.keysOnly=!c.isMatch,this.each(function(h,y){a(y.primaryKey,y)})},ht.prototype.keys=function(a){var c=this._ctx,h=(c.keysOnly=!c.isMatch,[]);return this.each(function(y,_){h.push(_.key)}).then(function(){return h}).then(a)},ht.prototype.primaryKeys=function(a){var c=this._ctx;if(lr(c,!0)&&0<c.limit)return this._read(function(y){var _=ur(c,c.table.core.schema);return c.table.core.query({trans:y,values:!1,limit:c.limit,direction:c.dir==="prev"?"prev":void 0,query:{index:_,range:c.range}})}).then(function(y){return y.result}).then(a);c.keysOnly=!c.isMatch;var h=[];return this.each(function(y,_){h.push(_.primaryKey)}).then(function(){return h}).then(a)},ht.prototype.uniqueKeys=function(a){return this._ctx.unique="unique",this.keys(a)},ht.prototype.firstKey=function(a){return this.limit(1).keys(function(c){return c[0]}).then(a)},ht.prototype.lastKey=function(a){return this.reverse().firstKey(a)},ht.prototype.distinct=function(){var a,c=this._ctx,c=c.index&&c.table.schema.idxByName[c.index];return c&&c.multi&&(a={},Fr(this._ctx,function(y){var y=y.primaryKey.toString(),_=x(a,y);return a[y]=!0,!_})),this},ht.prototype.modify=function(a){var c=this,h=this._ctx;return this._write(function(y){function _(re,ie){var ge=ie.failures;Z+=re-ie.numFailures;for(var de=0,ve=d(ge);de<ve.length;de++){var Ne=ve[de];G.push(ge[Ne])}}var N=typeof a=="function"?a:function(re){return oo(re,a)},T=h.table.core,te=T.schema.primaryKey,O=te.outbound,J=te.extractKey,ue=200,te=c.db._options.modifyChunkSize,G=(te&&(ue=typeof te=="object"?te[T.name]||te["*"]||200:te),[]),Z=0,ae=[],oe=a===Vi;return c.clone().primaryKeys().then(function(re){function ie(de){var ve=Math.min(ue,re.length-de),Ne=re.slice(de,de+ve);return(oe?Promise.resolve([]):T.getMany({trans:y,keys:Ne,cache:"immutable"})).then(function(Ce){var De=[],Me=[],Ue=O?[]:null,Oe=oe?Ne:[];if(!oe)for(var We=0;We<ve;++We){var Ee=Ce[We],rt={value:xe(Ee),primKey:re[de+We]};N.call(rt,rt.value,rt)!==!1&&(rt.value==null?Oe.push(re[de+We]):O||ft(J(Ee),J(rt.value))===0?(Me.push(rt.value),O&&Ue.push(re[de+We])):(Oe.push(re[de+We]),De.push(rt.value)))}return Promise.resolve(0<De.length&&T.mutate({trans:y,type:"add",values:De}).then(function(ot){for(var lt in ot.failures)Oe.splice(parseInt(lt),1);_(De.length,ot)})).then(function(){return(0<Me.length||ge&&typeof a=="object")&&T.mutate({trans:y,type:"put",keys:Ue,values:Me,criteria:ge,changeSpec:typeof a!="function"&&a,isAdditionalChunk:0<de}).then(function(ot){return _(Me.length,ot)})}).then(function(){return(0<Oe.length||ge&&oe)&&T.mutate({trans:y,type:"delete",keys:Oe,criteria:ge,isAdditionalChunk:0<de}).then(function(ot){return Oo(h.table,Oe,ot)}).then(function(ot){return _(Oe.length,ot)})}).then(function(){return re.length>de+ve&&ie(de+ue)})})}var ge=lr(h)&&h.limit===1/0&&(typeof a!="function"||oe)&&{index:h.index,range:h.range};return ie(0).then(function(){if(0<G.length)throw new $e("Error modifying one or more objects",G,Z,ae);return re.length})})})},ht.prototype.delete=function(){var a=this._ctx,c=a.range;return!lr(a)||a.table.schema.yProps||!a.isPrimKey&&c.type!==3?this.modify(Vi):this._write(function(h){var y=a.table.core.schema.primaryKey,_=c;return a.table.core.count({trans:h,query:{index:y,range:_}}).then(function(N){return a.table.core.mutate({trans:h,type:"deleteRange",range:_}).then(function(J){var O=J.failures,J=J.numFailures;if(J)throw new $e("Could not delete some values",Object.keys(O).map(function(ue){return O[ue]}),N-J);return N-J})})})};var Ba=ht;function ht(){}var Vi=function(a,c){return c.value=null};function Ha(a,c){return a<c?-1:a===c?0:1}function Va(a,c){return c<a?-1:a===c?0:1}function hn(a,c,h){return a=a instanceof xr?new a.Collection(a):a,a._ctx.error=new(h||TypeError)(c),a}function Br(a){return new a.Collection(a,function(){return vr("")}).limit(0)}function ao(ae,c,h,y){var _,N,T,O,J,ue,te,G=h.length;if(!h.every(function(re){return typeof re=="string"}))return hn(ae,Bi);function Z(re){_=re==="next"?function(ge){return ge.toUpperCase()}:function(ge){return ge.toLowerCase()},N=re==="next"?function(ge){return ge.toLowerCase()}:function(ge){return ge.toUpperCase()},T=re==="next"?Ha:Va;var ie=h.map(function(ge){return{lower:N(ge),upper:_(ge)}}).sort(function(ge,de){return T(ge.lower,de.lower)});O=ie.map(function(ge){return ge.upper}),J=ie.map(function(ge){return ge.lower}),te=(ue=re)==="next"?"":y}Z("next");var ae=new ae.Collection(ae,function(){return sn(O[0],J[G-1]+y)}),oe=(ae._ondirectionchange=function(re){Z(re)},0);return ae._addAlgorithm(function(re,ie,ge){var de=re.key;if(typeof de=="string"){var ve=N(de);if(c(ve,J,oe))return!0;for(var Ne=null,Ce=oe;Ce<G;++Ce){var De=((Me,Ue,Oe,We,Ee,rt)=>{for(var ot=Math.min(Me.length,We.length),lt=-1,dt=0;dt<ot;++dt){var mn=Ue[dt];if(mn!==We[dt])return Ee(Me[dt],Oe[dt])<0?Me.substr(0,dt)+Oe[dt]+Oe.substr(dt+1):Ee(Me[dt],We[dt])<0?Me.substr(0,dt)+We[dt]+Oe.substr(dt+1):0<=lt?Me.substr(0,lt)+Ue[lt]+Oe.substr(lt+1):null;Ee(Me[dt],mn)<0&&(lt=dt)}return ot<We.length&&rt==="next"?Me+Oe.substr(Me.length):ot<Me.length&&rt==="prev"?Me.substr(0,Oe.length):lt<0?null:Me.substr(0,lt)+We[lt]+Oe.substr(lt+1)})(de,ve,O[Ce],J[Ce],T,ue);De===null&&Ne===null?oe=Ce+1:(Ne===null||0<T(Ne,De))&&(Ne=De)}ie(Ne!==null?function(){re.continue(Ne+te)}:ge)}return!1}),ae}function sn(a,c,h,y){return{type:2,lower:a,upper:c,lowerOpen:h,upperOpen:y}}function vr(a){return{type:1,lower:a,upper:a}}Object.defineProperty(It.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),It.prototype.between=function(a,c,h,y){h=h!==!1,y=y===!0;try{return 0<this._cmp(a,c)||this._cmp(a,c)===0&&(h||y)&&(!h||!y)?Br(this):new this.Collection(this,function(){return sn(a,c,!h,!y)})}catch{return hn(this,gt)}},It.prototype.equals=function(a){return a==null?hn(this,gt):new this.Collection(this,function(){return vr(a)})},It.prototype.above=function(a){return a==null?hn(this,gt):new this.Collection(this,function(){return sn(a,void 0,!0)})},It.prototype.aboveOrEqual=function(a){return a==null?hn(this,gt):new this.Collection(this,function(){return sn(a,void 0,!1)})},It.prototype.below=function(a){return a==null?hn(this,gt):new this.Collection(this,function(){return sn(void 0,a,!1,!0)})},It.prototype.belowOrEqual=function(a){return a==null?hn(this,gt):new this.Collection(this,function(){return sn(void 0,a)})},It.prototype.startsWith=function(a){return typeof a!="string"?hn(this,Bi):this.between(a,a+sr,!0,!0)},It.prototype.startsWithIgnoreCase=function(a){return a===""?this.startsWith(a):ao(this,function(c,h){return c.indexOf(h[0])===0},[a],sr)},It.prototype.equalsIgnoreCase=function(a){return ao(this,function(c,h){return c===h[0]},[a],"")},It.prototype.anyOfIgnoreCase=function(){var a=F.apply(U,arguments);return a.length===0?Br(this):ao(this,function(c,h){return h.indexOf(c)!==-1},a,"")},It.prototype.startsWithAnyOfIgnoreCase=function(){var a=F.apply(U,arguments);return a.length===0?Br(this):ao(this,function(c,h){return h.some(function(y){return c.indexOf(y)===0})},a,sr)},It.prototype.anyOf=function(){var a,c,h=this,y=F.apply(U,arguments),_=this._cmp;try{y.sort(_)}catch{return hn(this,gt)}return y.length===0?Br(this):((a=new this.Collection(this,function(){return sn(y[0],y[y.length-1])}))._ondirectionchange=function(N){_=N==="next"?h._ascending:h._descending,y.sort(_)},c=0,a._addAlgorithm(function(N,T,O){for(var J=N.key;0<_(J,y[c]);)if(++c===y.length)return T(O),!1;return _(J,y[c])===0||(T(function(){N.continue(y[c])}),!1)}),a)},It.prototype.notEqual=function(a){return this.inAnyRange([[-1/0,a],[a,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},It.prototype.noneOf=function(){var a=F.apply(U,arguments);if(a.length===0)return new this.Collection(this);try{a.sort(this._ascending)}catch{return hn(this,gt)}var c=a.reduce(function(h,y){return h?h.concat([[h[h.length-1][1],y]]):[[-1/0,y]]},null);return c.push([a[a.length-1],this.db._maxKey]),this.inAnyRange(c,{includeLowers:!1,includeUppers:!1})},It.prototype.inAnyRange=function(a,ge){var h=this,y=this._cmp,_=this._ascending,N=this._descending,T=this._min,O=this._max;if(a.length===0)return Br(this);if(!a.every(function(de){return de[0]!==void 0&&de[1]!==void 0&&_(de[0],de[1])<=0}))return hn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",ke.InvalidArgument);var J=!ge||ge.includeLowers!==!1,ue=ge&&ge.includeUppers===!0,te,G=_;function Z(de,ve){return G(de[0],ve[0])}try{(te=a.reduce(function(de,ve){for(var Ne=0,Ce=de.length;Ne<Ce;++Ne){var De=de[Ne];if(y(ve[0],De[1])<0&&0<y(ve[1],De[0])){De[0]=T(De[0],ve[0]),De[1]=O(De[1],ve[1]);break}}return Ne===Ce&&de.push(ve),de},[])).sort(Z)}catch{return hn(this,gt)}var ae=0,oe=ue?function(de){return 0<_(de,te[ae][1])}:function(de){return 0<=_(de,te[ae][1])},re=J?function(de){return 0<N(de,te[ae][0])}:function(de){return 0<=N(de,te[ae][0])},ie=oe,ge=new this.Collection(this,function(){return sn(te[0][0],te[te.length-1][1],!J,!ue)});return ge._ondirectionchange=function(de){G=de==="next"?(ie=oe,_):(ie=re,N),te.sort(Z)},ge._addAlgorithm(function(de,ve,Ne){for(var Ce,De=de.key;ie(De);)if(++ae===te.length)return ve(Ne),!1;return!oe(Ce=De)&&!re(Ce)||(h._cmp(De,te[ae][1])===0||h._cmp(De,te[ae][0])===0||ve(function(){G===_?de.continue(te[ae][0]):de.continue(te[ae][1])}),!1)}),ge},It.prototype.startsWithAnyOf=function(){var a=F.apply(U,arguments);return a.every(function(c){return typeof c=="string"})?a.length===0?Br(this):this.inAnyRange(a.map(function(c){return[c,c+sr]})):hn(this,"startsWithAnyOf() only works with strings")};var xr=It;function It(){}function an(a){return Le(function(c){return $n(c),a(c.target.error),!1})}function $n(a){a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault()}var pi="storagemutated",Ui="x-storagemutated-1",An=Lr(null,pi),$u=(Xn.prototype._lock=function(){return R(!Ye.global),++this._reculock,this._reculock!==1||Ye.global||(Ye.lockOwnerFor=this),this},Xn.prototype._unlock=function(){if(R(!Ye.global),--this._reculock==0)for(Ye.global||(Ye.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var a=this._blockedFuncs.shift();try{ir(a[1],a[0])}catch{}}return this},Xn.prototype._locked=function(){return this._reculock&&Ye.lockOwnerFor!==this},Xn.prototype.create=function(a){var c=this;if(this.mode){var h=this.db.idbdb,y=this.db._state.dbOpenError;if(R(!this.idbtrans),!a&&!h)switch(y&&y.name){case"DatabaseClosedError":throw new ke.DatabaseClosed(y);case"MissingAPIError":throw new ke.MissingAPI(y.message,y);default:throw new ke.OpenFailed(y)}if(!this.active)throw new ke.TransactionInactive;R(this._completion._state===null),(a=this.idbtrans=a||(this.db.core||h).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Le(function(_){$n(_),c._reject(a.error)}),a.onabort=Le(function(_){$n(_),c.active&&c._reject(new ke.Abort(a.error)),c.active=!1,c.on("abort").fire(_)}),a.oncomplete=Le(function(){c.active=!1,c._resolve(),"mutatedParts"in a&&An.storagemutated.fire(a.mutatedParts)})}return this},Xn.prototype._promise=function(a,c,h){var y,_=this;return a==="readwrite"&&this.mode!=="readwrite"?Et(new ke.ReadOnly("Transaction is readonly")):this.active?this._locked()?new Ve(function(N,T){_._blockedFuncs.push([function(){_._promise(a,c,h).then(N,T)},Ye])}):h?on(function(){var N=new Ve(function(T,O){_._lock();var J=c(T,O,_);J&&J.then&&J.then(T,O)});return N.finally(function(){return _._unlock()}),N._lib=!0,N}):((y=new Ve(function(N,T){var O=c(N,T,_);O&&O.then&&O.then(N,T)}))._lib=!0,y):Et(new ke.TransactionInactive)},Xn.prototype._root=function(){return this.parent?this.parent._root():this},Xn.prototype.waitFor=function(a){var c,h=this._root(),y=Ve.resolve(a),_=(h._waitingFor?h._waitingFor=h._waitingFor.then(function(){return y}):(h._waitingFor=y,h._waitingQueue=[],c=h.idbtrans.objectStore(h.storeNames[0]),(function N(){for(++h._spinCount;h._waitingQueue.length;)h._waitingQueue.shift()();h._waitingFor&&(c.get(-1/0).onsuccess=N)})()),h._waitingFor);return new Ve(function(N,T){y.then(function(O){return h._waitingQueue.push(Le(N.bind(null,O)))},function(O){return h._waitingQueue.push(Le(T.bind(null,O)))}).finally(function(){h._waitingFor===_&&(h._waitingFor=null)})})},Xn.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new ke.Abort))},Xn.prototype.table=function(a){var c=this._memoizedTables||(this._memoizedTables={});if(x(c,a))return c[a];var h=this.schema[a];if(h)return(h=new this.db.Table(a,h,this)).core=this.db.core.table(a),c[a]=h;throw new ke.NotFound("Table "+a+" not part of transaction")},Xn);function Xn(){}function Do(a,c,h,y,_,N,T,O){return{name:a,keyPath:c,unique:h,multi:y,auto:_,compound:N,src:(h&&!T?"&":"")+(y?"*":"")+(_?"++":"")+Ds(c),type:O}}function Ds(a){return typeof a=="string"?a:a?"["+[].join.call(a,"+")+"]":""}function zs(a,c,h){return{name:a,primKey:c,indexes:h,mappedClass:null,idxByName:(y=function(_){return[_.name,_]},h.reduce(function(_,N,T){return N=y(N,T),N&&(_[N[0]]=N[1]),_},{}))};var y}var wr=function(a){try{return a.only([[]]),wr=function(){return[[]]},[[]]}catch{return wr=function(){return sr},sr}};function lo(a){return a==null?function(){}:typeof a=="string"?(c=a).split(".").length===1?function(h){return h[c]}:function(h){return B(h,c)}:function(h){return B(h,a)};var c}function uo(a){return[].slice.call(a)}var Ki=0;function hi(a){return a==null?":id":typeof a=="string"?a:"[".concat(a.join("+"),"]")}function Au(a,c,T){function y(ie){if(ie.type===3)return null;if(ie.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var ae=ie.lower,oe=ie.upper,re=ie.lowerOpen,ie=ie.upperOpen;return ae===void 0?oe===void 0?null:c.upperBound(oe,!!ie):oe===void 0?c.lowerBound(ae,!!re):c.bound(ae,oe,!!re,!!ie)}function _(Z){var ae,oe,re=Z.name;return{name:re,schema:Z,mutate:function(ie){var ge=ie.trans,de=ie.type,ve=ie.keys,Ne=ie.values,Ce=ie.range;return new Promise(function(De,Me){De=Le(De);var Ue=ge.objectStore(re),Oe=Ue.keyPath==null,We=de==="put"||de==="add";if(!We&&de!=="delete"&&de!=="deleteRange")throw new Error("Invalid operation type: "+de);var Ee,rt=(ve||Ne||{length:1}).length;if(ve&&Ne&&ve.length!==Ne.length)throw new Error("Given keys array must have same length as given values array.");if(rt===0)return De({numFailures:0,failures:{},results:[],lastResult:void 0});function ot(ln){++mn,$n(ln)}var lt=[],dt=[],mn=0;if(de==="deleteRange"){if(Ce.type===4)return De({numFailures:mn,failures:dt,results:[],lastResult:void 0});Ce.type===3?lt.push(Ee=Ue.clear()):lt.push(Ee=Ue.delete(y(Ce)))}else{var Oe=We?Oe?[Ne,ve]:[Ne,null]:[ve,null],at=Oe[0],Ct=Oe[1];if(We)for(var Ut=0;Ut<rt;++Ut)lt.push(Ee=Ct&&Ct[Ut]!==void 0?Ue[de](at[Ut],Ct[Ut]):Ue[de](at[Ut])),Ee.onerror=ot;else for(Ut=0;Ut<rt;++Ut)lt.push(Ee=Ue[de](at[Ut])),Ee.onerror=ot}function qo(ln){ln=ln.target.result,lt.forEach(function(yo,vo){return yo.error!=null&&(dt[vo]=yo.error)}),De({numFailures:mn,failures:dt,results:de==="delete"?ve:lt.map(function(yo){return yo.result}),lastResult:ln})}Ee.onerror=function(ln){ot(ln),qo(ln)},Ee.onsuccess=qo})},getMany:function(ie){var ge=ie.trans,de=ie.keys;return new Promise(function(ve,Ne){ve=Le(ve);for(var Ce,De=ge.objectStore(re),Me=de.length,Ue=new Array(Me),Oe=0,We=0,Ee=function(lt){lt=lt.target,Ue[lt._pos]=lt.result,++We===Oe&&ve(Ue)},rt=an(Ne),ot=0;ot<Me;++ot)de[ot]!=null&&((Ce=De.get(de[ot]))._pos=ot,Ce.onsuccess=Ee,Ce.onerror=rt,++Oe);Oe===0&&ve(Ue)})},get:function(ie){var ge=ie.trans,de=ie.key;return new Promise(function(ve,Ne){ve=Le(ve);var Ce=ge.objectStore(re).get(de);Ce.onsuccess=function(De){return ve(De.target.result)},Ce.onerror=an(Ne)})},query:(ae=J,oe=ue,function(ie){return new Promise(function(ge,de){ge=Le(ge);var ve,Ne,Ce,De,rt=ie.trans,Me=ie.values,Ue=ie.limit,Ee=ie.query,Oe=(Oe=ie.direction)!=null?Oe:"next",We=Ue===1/0?void 0:Ue,ot=Ee.index,Ee=Ee.range,rt=rt.objectStore(re),rt=ot.isPrimaryKey?rt:rt.index(ot.name),ot=y(Ee);if(Ue===0)return ge({result:[]});oe?(Ee={query:ot,count:We,direction:Oe},(ve=Me?rt.getAll(Ee):rt.getAllKeys(Ee)).onsuccess=function(lt){return ge({result:lt.target.result})},ve.onerror=an(de)):ae&&Oe==="next"?((ve=Me?rt.getAll(ot,We):rt.getAllKeys(ot,We)).onsuccess=function(lt){return ge({result:lt.target.result})},ve.onerror=an(de)):(Ne=0,Ce=!Me&&"openKeyCursor"in rt?rt.openKeyCursor(ot,Oe):rt.openCursor(ot,Oe),De=[],Ce.onsuccess=function(){var lt=Ce.result;return!lt||(De.push(Me?lt.value:lt.primaryKey),++Ne===Ue)?ge({result:De}):void lt.continue()},Ce.onerror=an(de))})}),openCursor:function(ie){var ge=ie.trans,de=ie.values,ve=ie.query,Ne=ie.reverse,Ce=ie.unique;return new Promise(function(De,Me){De=Le(De);var We=ve.index,Ue=ve.range,Oe=ge.objectStore(re),Oe=We.isPrimaryKey?Oe:Oe.index(We.name),We=Ne?Ce?"prevunique":"prev":Ce?"nextunique":"next",Ee=!de&&"openKeyCursor"in Oe?Oe.openKeyCursor(y(Ue),We):Oe.openCursor(y(Ue),We);Ee.onerror=an(Me),Ee.onsuccess=Le(function(rt){var ot,lt,dt,mn,at=Ee.result;at?(at.___id=++Ki,at.done=!1,ot=at.continue.bind(at),lt=(lt=at.continuePrimaryKey)&<.bind(at),dt=at.advance.bind(at),mn=function(){throw new Error("Cursor not stopped")},at.trans=ge,at.stop=at.continue=at.continuePrimaryKey=at.advance=function(){throw new Error("Cursor not started")},at.fail=Le(Me),at.next=function(){var Ct=this,Ut=1;return this.start(function(){return Ut--?Ct.continue():Ct.stop()}).then(function(){return Ct})},at.start=function(Ct){function Ut(){if(Ee.result)try{Ct()}catch(ln){at.fail(ln)}else at.done=!0,at.start=function(){throw new Error("Cursor behind last entry")},at.stop()}var qo=new Promise(function(ln,yo){ln=Le(ln),Ee.onerror=an(yo),at.fail=yo,at.stop=function(vo){at.stop=at.continue=at.continuePrimaryKey=at.advance=mn,ln(vo)}});return Ee.onsuccess=Le(function(ln){Ee.onsuccess=Ut,Ut()}),at.continue=ot,at.continuePrimaryKey=lt,at.advance=dt,Ut(),qo},De(at)):De(null)},Me)})},count:function(ie){var ge=ie.query,de=ie.trans,ve=ge.index,Ne=ge.range;return new Promise(function(Ce,De){var Me=de.objectStore(re),Me=ve.isPrimaryKey?Me:Me.index(ve.name),Ue=y(Ne),Ue=Ue?Me.count(Ue):Me.count();Ue.onsuccess=Le(function(Oe){return Ce(Oe.target.result)}),Ue.onerror=an(De)})}}}N=T,O=uo((T=a).objectStoreNames),te=0<O.length?N.objectStore(O[0]):{};var N,T={schema:{name:T.name,tables:O.map(function(Z){return N.objectStore(Z)}).map(function(Z){var ae=Z.keyPath,oe=Z.autoIncrement,ie=m(ae),re={},ie={name:Z.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:ae==null,compound:ie,keyPath:ae,autoIncrement:oe,unique:!0,extractKey:lo(ae)},indexes:uo(Z.indexNames).map(function(ge){return Z.index(ge)}).map(function(Ne){var Ce=Ne.name,de=Ne.unique,ve=Ne.multiEntry,Ne=Ne.keyPath,Ce={name:Ce,compound:m(Ne),keyPath:Ne,unique:de,multiEntry:ve,extractKey:lo(Ne)};return re[hi(Ne)]=Ce}),getIndexByKeyPath:function(ge){return re[hi(ge)]}};return re[":id"]=ie.primaryKey,ae!=null&&(re[hi(ae)]=ie.primaryKey),ie})},hasGetAll:0<O.length&&"getAll"in te&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:"getAllRecords"in te},O=T.schema,J=T.hasGetAll,ue=T.hasIdb3Features,te=O.tables.map(_),G={};return te.forEach(function(Z){return G[Z.name]=Z}),{stack:"dbcore",transaction:a.transaction.bind(a),table:function(Z){if(G[Z])return G[Z];throw new Error("Table '".concat(Z,"' not found"))},MIN_KEY:-1/0,MAX_KEY:wr(c),schema:O}}function Ls(a,c,h,y){return h=h.IDBKeyRange,c=Au(c,h,y),{dbcore:a.dbcore.reduce(function(_,N){return N=N.create,s(s({},_),N(_))},c)}}function co(a,c){var h=c.db,h=Ls(a._middlewares,h,a._deps,c);a.core=h.dbcore,a.tables.forEach(function(y){var _=y.name;a.core.schema.tables.some(function(N){return N.name===_})&&(y.core=a.core.table(_),a[_]instanceof a.Table)&&(a[_].core=y.core)})}function zo(a,c,h,y){h.forEach(function(_){var N=y[_];c.forEach(function(T){var O=(function J(ue,te){return I(ue,te)||(ue=w(ue))&&J(ue,te)})(T,_);(!O||"value"in O&&O.value===void 0)&&(T===a.Transaction.prototype||T instanceof a.Transaction?j(T,_,{get:function(){return this.table(_)},set:function(J){C(this,_,{value:J,writable:!0,configurable:!0,enumerable:!0})}}):T[_]=new a.Table(_,N))})})}function qi(a,c){c.forEach(function(h){for(var y in h)h[y]instanceof a.Table&&delete h[y]})}function Hr(a,c){return a._cfg.version-c._cfg.version}function Fs(a,c,h,y){var _=a._dbSchema,N=(h.objectStoreNames.contains("$meta")&&!_.$meta&&(_.$meta=zs("$meta",Xi("")[0],[]),a._storeNames.push("$meta")),a._createTransaction("readwrite",a._storeNames,_)),T=(N.create(h),N._completion.catch(y),N._reject.bind(N)),O=Ye.transless||Ye;on(function(){if(Ye.trans=N,Ye.transless=O,c!==0)return co(a,h),ue=c,((J=N).storeNames.includes("$meta")?J.table("$meta").get("version").then(function(te){return te??ue}):Ve.resolve(ue)).then(function(ie){var G=a,Z=ie,ae=N,oe=h,re=[],ie=G._versions,ge=G._dbSchema=Qt(0,G.idbdb,oe);return(ie=ie.filter(function(de){return de._cfg.version>=Z})).length===0?Ve.resolve():(ie.forEach(function(de){re.push(function(){var ve,Ne,Ce,De=ge,Me=de._cfg.dbschema,Ue=(_r(G,De,oe),_r(G,Me,oe),ge=G._dbSchema=Me,Yi(De,Me)),Oe=(Ue.add.forEach(function(We){Lo(oe,We[0],We[1].primKey,We[1].indexes)}),Ue.change.forEach(function(We){if(We.recreate)throw new ke.Upgrade("Not yet support for changing primary key");var Ee=oe.objectStore(We.name);We.add.forEach(function(rt){return gi(Ee,rt)}),We.change.forEach(function(rt){Ee.deleteIndex(rt.name),gi(Ee,rt)}),We.del.forEach(function(rt){return Ee.deleteIndex(rt)})}),de._cfg.contentUpgrade);if(Oe&&de._cfg.version>Z)return co(G,oe),ae._memoizedTables={},ve=fe(Me),Ue.del.forEach(function(We){ve[We]=De[We]}),qi(G,[G.Transaction.prototype]),zo(G,[G.Transaction.prototype],d(ve),ve),ae.schema=ve,(Ne=$(Oe))&&qn(),Me=Ve.follow(function(){var We;(Ce=Oe(ae))&&Ne&&(We=Lt.bind(null,null),Ce.then(We,We))}),Ce&&typeof Ce.then=="function"?Ve.resolve(Ce):Me.then(function(){return Ce})}),re.push(function(ve){var Ne,Ce,De=de._cfg.dbschema;Ne=De,Ce=ve,[].slice.call(Ce.db.objectStoreNames).forEach(function(Me){return Ne[Me]==null&&Ce.db.deleteObjectStore(Me)}),qi(G,[G.Transaction.prototype]),zo(G,[G.Transaction.prototype],G._storeNames,G._dbSchema),ae.schema=G._dbSchema}),re.push(function(ve){G.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(G.idbdb.version/10)===de._cfg.version?(G.idbdb.deleteObjectStore("$meta"),delete G._dbSchema.$meta,G._storeNames=G._storeNames.filter(function(Ne){return Ne!=="$meta"})):ve.objectStore("$meta").put(de._cfg.version,"version"))})}),(function de(){return re.length?Ve.resolve(re.shift()(ae.idbtrans)).then(de):Ve.resolve()})().then(function(){mi(ge,oe)}))}).catch(T);var J,ue;d(_).forEach(function(te){Lo(h,te,_[te].primKey,_[te].indexes)}),co(a,h),Ve.follow(function(){return a.on.populate.fire(N)}).catch(T)})}function Wi(a,c){mi(a._dbSchema,c),c.db.version%10!=0||c.objectStoreNames.contains("$meta")||c.db.createObjectStore("$meta").add(Math.ceil(c.db.version/10-1),"version");var h=Qt(0,a.idbdb,c);_r(a,a._dbSchema,c);for(var y=0,_=Yi(h,a._dbSchema).change;y<_.length;y++){var N=(T=>{if(T.change.length||T.recreate)return console.warn("Unable to patch indexes of table ".concat(T.name," because it has changes on the type of index or primary key.")),{value:void 0};var O=c.objectStore(T.name);T.add.forEach(function(J){bt&&console.debug("Dexie upgrade patch: Creating missing index ".concat(T.name,".").concat(J.src)),gi(O,J)})})(_[y]);if(typeof N=="object")return N.value}}function Yi(a,c){var h,y={del:[],add:[],change:[]};for(h in a)c[h]||y.del.push(h);for(h in c){var _=a[h],N=c[h];if(_){var T={name:h,def:N,recreate:!1,del:[],add:[],change:[]};if(""+(_.primKey.keyPath||"")!=""+(N.primKey.keyPath||"")||_.primKey.auto!==N.primKey.auto)T.recreate=!0,y.change.push(T);else{var O=_.idxByName,J=N.idxByName,ue=void 0;for(ue in O)J[ue]||T.del.push(ue);for(ue in J){var te=O[ue],G=J[ue];te?te.src!==G.src&&T.change.push(G):T.add.push(G)}(0<T.del.length||0<T.add.length||0<T.change.length)&&y.change.push(T)}}else y.add.push([h,N])}return y}function Lo(a,c,h,y){var _=a.db.createObjectStore(c,h.keyPath?{keyPath:h.keyPath,autoIncrement:h.auto}:{autoIncrement:h.auto});y.forEach(function(N){return gi(_,N)})}function mi(a,c){d(a).forEach(function(h){c.db.objectStoreNames.contains(h)||(bt&&console.debug("Dexie: Creating missing table",h),Lo(c,h,a[h].primKey,a[h].indexes))})}function gi(a,c){a.createIndex(c.name,c.keyPath,{unique:c.unique,multiEntry:c.multi})}function Qt(a,c,h){var y={};return V(c.objectStoreNames,0).forEach(function(_){for(var N=h.objectStore(_),T=Do(Ds(ue=N.keyPath),ue||"",!0,!1,!!N.autoIncrement,ue&&typeof ue!="string",!0),O=[],J=0;J<N.indexNames.length;++J){var te=N.index(N.indexNames[J]),ue=te.keyPath,te=Do(te.name,ue,!!te.unique,!!te.multiEntry,!1,ue&&typeof ue!="string",!1);O.push(te)}y[_]=zs(_,T,O)}),y}function _r(a,c,h){for(var y=h.db.objectStoreNames,_=0;_<y.length;++_){var N=y[_],T=h.objectStore(N);a._hasGetAll="getAll"in T;for(var O=0;O<T.indexNames.length;++O){var J,ue=T.indexNames[O],te=T.index(ue).keyPath,te=typeof te=="string"?te:"["+V(te).join("+")+"]";c[N]&&(J=c[N].idxByName[te])&&(J.name=ue,delete c[N].idxByName[te],c[N].idxByName[ue]=J)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&f.WorkerGlobalScope&&f instanceof f.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(a._hasGetAll=!1)}function Xi(a){return a.split(",").map(function(c,h){var _=c.split(":"),y=(y=_[1])==null?void 0:y.trim(),_=(c=_[0].trim()).replace(/([&*]|\+\+)/g,""),N=/^\[/.test(_)?_.match(/^\[(.*)\]$/)[1].split("+"):_;return Do(_,N||null,/\&/.test(c),/\*/.test(c),/\+\+/.test(c),m(N),h===0,y)})}Fo.prototype._createTableSchema=zs,Fo.prototype._parseIndexSyntax=Xi,Fo.prototype._parseStoresSpec=function(a,c){var h=this;d(a).forEach(function(y){if(a[y]!==null){var _=h._parseIndexSyntax(a[y]),N=_.shift();if(!N)throw new ke.Schema("Invalid schema for table "+y+": "+a[y]);if(N.unique=!0,N.multi)throw new ke.Schema("Primary key cannot be multiEntry*");_.forEach(function(T){if(T.auto)throw new ke.Schema("Only primary key can be marked as autoIncrement (++)");if(!T.keyPath)throw new ke.Schema("Index must have a name and cannot be an empty string")}),N=h._createTableSchema(y,N,_),c[y]=N}})},Fo.prototype.stores=function(h){var c=this.db,h=(this._cfg.storesSource=this._cfg.storesSource?v(this._cfg.storesSource,h):h,c._versions),y={},_={};return h.forEach(function(N){v(y,N._cfg.storesSource),_=N._cfg.dbschema={},N._parseStoresSpec(y,_)}),c._dbSchema=_,qi(c,[c._allTables,c,c.Transaction.prototype]),zo(c,[c._allTables,c,c.Transaction.prototype,this._cfg.tables],d(_),_),c._storeNames=d(_),this},Fo.prototype.upgrade=function(a){return this._cfg.contentUpgrade=Ot(this._cfg.contentUpgrade||Ae,a),this};var yi=Fo;function Fo(){}var fo=(()=>{var a,c,h;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(a=new Set,c=new FinalizationRegistry(function(y){a.delete(y)}),{toArray:function(){return Array.from(a).map(function(y){return y.deref()}).filter(function(y){return y!==void 0})},add:function(y){var _=new WeakRef(y._novip);a.add(_),c.register(y._novip,_,_),a.size>y._options.maxConnections&&(_=a.values().next().value,a.delete(_),c.unregister(_))},remove:function(y){if(y)for(var _=a.values(),N=_.next();!N.done;){var T=N.value;if(T.deref()===y._novip)return a.delete(T),void c.unregister(T);N=_.next()}}}):(h=[],{toArray:function(){return h},add:function(y){h.push(y._novip)},remove:function(y){y&&(y=h.indexOf(y._novip))!==-1&&h.splice(y,1)}})})();function vi(a,c){var h=a._dbNamesDB;return h||(h=a._dbNamesDB=new br(Dr,{addons:[],indexedDB:a,IDBKeyRange:c})).version(1).stores({dbnames:"name"}),h.table("dbnames")}function po(a){return a&&typeof a.databases=="function"}function Bo(a){return on(function(){return Ye.letThrough=!0,a()})}function Qi(a){return!("from"in a)}var Gt=function(a,c){var h;if(!this)return h=new Gt,a&&"d"in a&&v(h,a),h;v(this,arguments.length?{d:1,from:a,to:1<arguments.length?c:a}:{d:0})};function xi(a,c,h){var y=ft(c,h);if(!isNaN(y)){if(0<y)throw RangeError();if(Qi(a))return v(a,{from:c,to:h,d:1});var y=a.l,_=a.r;if(ft(h,a.from)<0)return y?xi(y,c,h):a.l={from:c,to:h,d:1,l:null,r:null},Ua(a);if(0<ft(c,a.to))return _?xi(_,c,h):a.r={from:c,to:h,d:1,l:null,r:null},Ua(a);ft(c,a.from)<0&&(a.from=c,a.l=null,a.d=_?_.d+1:1),0<ft(h,a.to)&&(a.to=h,a.r=null,a.d=a.l?a.l.d+1:1),c=!a.r,y&&!a.l&&wi(a,y),_&&c&&wi(a,_)}}function wi(a,c){Qi(c)||(function h(y,_){var N=_.from,T=_.l,O=_.r;xi(y,N,_.to),T&&h(y,T),O&&h(y,O)})(a,c)}function Gi(a,c){var h=Ji(c),y=h.next();if(!y.done)for(var _=y.value,N=Ji(a),T=N.next(_.from),O=T.value;!y.done&&!T.done;){if(ft(O.from,_.to)<=0&&0<=ft(O.to,_.from))return!0;ft(_.from,O.from)<0?_=(y=h.next(O.from)).value:O=(T=N.next(_.from)).value}return!1}function Ji(a){var c=Qi(a)?null:{s:0,n:a};return{next:function(h){for(var y=0<arguments.length;c;)switch(c.s){case 0:if(c.s=1,y)for(;c.n.l&&ft(h,c.n.from)<0;)c={up:c,n:c.n.l,s:1};else for(;c.n.l;)c={up:c,n:c.n.l,s:1};case 1:if(c.s=2,!y||ft(h,c.n.to)<=0)return{value:c.n,done:!1};case 2:if(c.n.r){c.s=3,c={up:c,n:c.n.r,s:0};continue}case 3:c=c.up}return{done:!0}}}}function Ua(a){var c,h,y,_=(((_=a.r)==null?void 0:_.d)||0)-(((_=a.l)==null?void 0:_.d)||0),_=1<_?"r":_<-1?"l":"";_&&(c=_=="r"?"l":"r",h=s({},a),y=a[_],a.from=y.from,a.to=y.to,a[_]=y[_],h[_]=y[c],(a[c]=h).d=Ka(h)),a.d=Ka(a)}function Ka(h){var c=h.r,h=h.l;return(c?h?Math.max(c.d,h.d):c.d:h?h.d:0)+1}function Zi(a,c){return d(c).forEach(function(h){a[h]?wi(a[h],c[h]):a[h]=(function y(_){var N,T,O={};for(N in _)x(_,N)&&(T=_[N],O[N]=!T||typeof T!="object"||K.has(T.constructor)?T:y(T));return O})(c[h])}),a}function Bs(a,c){return a.all||c.all||Object.keys(a).some(function(h){return c[h]&&Gi(c[h],a[h])})}S(Gt.prototype,((Nt={add:function(a){return wi(this,a),this},addKey:function(a){return xi(this,a,a),this},addKeys:function(a){var c=this;return a.forEach(function(h){return xi(c,h,h)}),this},hasKey:function(a){var c=Ji(this).next(a).value;return c&&ft(c.from,a)<=0&&0<=ft(c.to,a)}})[Q]=function(){return Ji(this)},Nt));var Vr={},Hs={},Vs=!1;function es(a){Zi(Hs,a),Vs||(Vs=!0,setTimeout(function(){Vs=!1,Us(Hs,!(Hs={}))},0))}function Us(a,c){c===void 0&&(c=!1);var h=new Set;if(a.all)for(var y=0,_=Object.values(Vr);y<_.length;y++)ts(O=_[y],a,h,c);else for(var N in a){var T,O,N=/^idb\:\/\/(.*)\/(.*)\//.exec(N);N&&(T=N[1],N=N[2],O=Vr["idb://".concat(T,"/").concat(N)])&&ts(O,a,h,c)}h.forEach(function(J){return J()})}function ts(a,c,h,y){for(var _=[],N=0,T=Object.entries(a.queries.query);N<T.length;N++){for(var O=T[N],J=O[0],ue=[],te=0,G=O[1];te<G.length;te++){var Z=G[te];Bs(c,Z.obsSet)?Z.subscribers.forEach(function(ie){return h.add(ie)}):y&&ue.push(Z)}y&&_.push([J,ue])}if(y)for(var ae=0,oe=_;ae<oe.length;ae++){var re=oe[ae],J=re[0],ue=re[1];a.queries.query[J]=ue}}function Ou(a){var c=a._state,h=a._deps.indexedDB;if(c.isBeingOpened||a.idbdb)return c.dbReadyPromise.then(function(){return c.dbOpenError?Et(c.dbOpenError):a});c.isBeingOpened=!0,c.dbOpenError=null,c.openComplete=!1;var y=c.openCanceller,_=Math.round(10*a.verno),N=!1;function T(){if(c.openCanceller!==y)throw new ke.DatabaseClosed("db.open() was cancelled")}function O(){return new Ve(function(Z,ae){if(T(),!h)throw new ke.MissingAPI;var oe=a.name,re=c.autoSchema||!_?h.open(oe):h.open(oe,_);if(!re)throw new ke.MissingAPI;re.onerror=an(ae),re.onblocked=Le(a._fireOnBlocked),re.onupgradeneeded=Le(function(ie){var ge;te=re.transaction,c.autoSchema&&!a._options.allowEmptyDB?(re.onerror=$n,te.abort(),re.result.close(),(ge=h.deleteDatabase(oe)).onsuccess=ge.onerror=Le(function(){ae(new ke.NoSuchDatabase("Database ".concat(oe," doesnt exist")))})):(te.onerror=an(ae),ge=ie.oldVersion>Math.pow(2,62)?0:ie.oldVersion,G=ge<1,a.idbdb=re.result,N&&Wi(a,te),Fs(a,ge/10,te,ae))},ae),re.onsuccess=Le(function(){te=null;var ie,ge,de,ve,Ne,Ce,De=a.idbdb=re.result,Me=V(De.objectStoreNames);if(0<Me.length)try{var Ue=De.transaction((Ne=Me).length===1?Ne[0]:Ne,"readonly");if(c.autoSchema)Ce=De,ve=Ue,(de=a).verno=Ce.version/10,ve=de._dbSchema=Qt(0,Ce,ve),de._storeNames=V(Ce.objectStoreNames,0),zo(de,[de._allTables],d(ve),ve);else if(_r(a,a._dbSchema,Ue),ge=Ue,((ge=Yi(Qt(0,(ie=a).idbdb,ge),ie._dbSchema)).add.length||ge.change.some(function(Oe){return Oe.add.length||Oe.change.length}))&&!N)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),De.close(),_=De.version+1,N=!0,Z(O());co(a,Ue)}catch{}fo.add(a),De.onversionchange=Le(function(Oe){c.vcFired=!0,a.on("versionchange").fire(Oe)}),De.onclose=Le(function(){a.close({disableAutoOpen:!1})}),G&&(Me=a._deps,Ne=oe,po(Ce=Me.indexedDB)||Ne===Dr||vi(Ce,Me.IDBKeyRange).put({name:Ne}).catch(Ae)),Z()},ae)}).catch(function(Z){switch(Z==null?void 0:Z.name){case"UnknownError":if(0<c.PR1398_maxLoop)return c.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),O();break;case"VersionError":if(0<_)return _=0,O()}return Ve.reject(Z)})}var J,ue=c.dbReadyResolve,te=null,G=!1;return Ve.race([y,(typeof navigator>"u"?Ve.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(Z){function ae(){return indexedDB.databases().finally(Z)}J=setInterval(ae,100),ae()}).finally(function(){return clearInterval(J)}):Promise.resolve()).then(O)]).then(function(){return T(),c.onReadyBeingFired=[],Ve.resolve(Bo(function(){return a.on.ready.fire(a.vip)})).then(function Z(){var ae;if(0<c.onReadyBeingFired.length)return ae=c.onReadyBeingFired.reduce(Ot,Ae),c.onReadyBeingFired=[],Ve.resolve(Bo(function(){return ae(a.vip)})).then(Z)})}).finally(function(){c.openCanceller===y&&(c.onReadyBeingFired=null,c.isBeingOpened=!1)}).catch(function(Z){c.dbOpenError=Z;try{te&&te.abort()}catch{}return y===c.openCanceller&&a._close(),Et(Z)}).finally(function(){c.openComplete=!0,ue()}).then(function(){var Z;return G&&(Z={},a.tables.forEach(function(ae){ae.schema.indexes.forEach(function(oe){oe.name&&(Z["idb://".concat(a.name,"/").concat(ae.name,"/").concat(oe.name)]=new Gt(-1/0,[[[]]]))}),Z["idb://".concat(a.name,"/").concat(ae.name,"/")]=Z["idb://".concat(a.name,"/").concat(ae.name,"/:dels")]=new Gt(-1/0,[[[]]])}),An(pi).fire(Z),Us(Z,!0)),a})}function Ks(a){function c(N){return a.next(N)}var h=_(c),y=_(function(N){return a.throw(N)});function _(N){return function(O){var O=N(O),J=O.value;return O.done?J:J&&typeof J.then=="function"?J.then(h,y):m(J)?Promise.all(J).then(h,y):h(J)}}return _(c)()}function ns(a,c,h){for(var y=m(a)?a.slice():[a],_=0;_<h;++_)y.push(c);return y}var qa={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(a){return s(s({},a),{table:function(y){var h=a.table(y),y=h.schema,_={},N=[];function T(Z,ae,oe){var de=hi(Z),re=_[de]=_[de]||[],ie=Z==null?0:typeof Z=="string"?1:Z.length,ge=0<ae,de=s(s({},oe),{name:ge?"".concat(de,"(virtual-from:").concat(oe.name,")"):oe.name,lowLevelIndex:oe,isVirtual:ge,keyTail:ae,keyLength:ie,extractKey:lo(Z),unique:!ge&&oe.unique});return re.push(de),de.isPrimaryKey||N.push(de),1<ie&&T(ie===2?Z[0]:Z.slice(0,ie-1),ae+1,oe),re.sort(function(ve,Ne){return ve.keyTail-Ne.keyTail}),de}var O=T(y.primaryKey.keyPath,0,y.primaryKey);_[":id"]=[O];for(var J=0,ue=y.indexes;J<ue.length;J++){var te=ue[J];T(te.keyPath,0,te)}function G(Z){var ae,oe=Z.query.index;return oe.isVirtual?s(s({},Z),{query:{index:oe.lowLevelIndex,range:(ae=Z.query.range,oe=oe.keyTail,{type:ae.type===1?2:ae.type,lower:ns(ae.lower,ae.lowerOpen?a.MAX_KEY:a.MIN_KEY,oe),lowerOpen:!0,upper:ns(ae.upper,ae.upperOpen?a.MIN_KEY:a.MAX_KEY,oe),upperOpen:!0})}}):Z}return s(s({},h),{schema:s(s({},y),{primaryKey:O,indexes:N,getIndexByKeyPath:function(Z){return(Z=_[hi(Z)])&&Z[0]}}),count:function(Z){return h.count(G(Z))},query:function(Z){return h.query(G(Z))},openCursor:function(Z){var ae=Z.query.index,oe=ae.keyTail,re=ae.keyLength;return ae.isVirtual?h.openCursor(G(Z)).then(function(ge){return ge&&ie(ge)}):h.openCursor(Z);function ie(ge){return Object.create(ge,{continue:{value:function(de){de!=null?ge.continue(ns(de,Z.reverse?a.MAX_KEY:a.MIN_KEY,oe)):Z.unique?ge.continue(ge.key.slice(0,re).concat(Z.reverse?a.MIN_KEY:a.MAX_KEY,oe)):ge.continue()}},continuePrimaryKey:{value:function(de,ve){ge.continuePrimaryKey(ns(de,a.MAX_KEY,oe),ve)}},primaryKey:{get:function(){return ge.primaryKey}},key:{get:function(){var de=ge.key;return re===1?de[0]:de.slice(0,re)}},value:{get:function(){return ge.value}}})}}})}})}};function qs(a,c,h,y){return h=h||{},y=y||"",d(a).forEach(function(_){var N,T,O;x(c,_)?(N=a[_],T=c[_],typeof N=="object"&&typeof T=="object"&&N&&T?(O=le(N))!==le(T)?h[y+_]=c[_]:O==="Object"?qs(N,T,h,y+_+"."):N!==T&&(h[y+_]=c[_]):N!==T&&(h[y+_]=c[_])):h[y+_]=void 0}),d(c).forEach(function(_){x(a,_)||(h[y+_]=c[_])}),h}function Ws(a,c){return c.type==="delete"?c.keys:c.keys||c.values.map(a.extractKey)}var Ru={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(a){return s(s({},a),{table:function(c){var h=a.table(c),y=h.schema.primaryKey;return s(s({},h),{mutate:function(_){var N=Ye.trans,T=N.table(c).hook,O=T.deleting,J=T.creating,ue=T.updating;switch(_.type){case"add":if(J.fire===Ae)break;return N._promise("readwrite",function(){return te(_)},!0);case"put":if(J.fire===Ae&&ue.fire===Ae)break;return N._promise("readwrite",function(){return te(_)},!0);case"delete":if(O.fire===Ae)break;return N._promise("readwrite",function(){return te(_)},!0);case"deleteRange":if(O.fire===Ae)break;return N._promise("readwrite",function(){return(function G(Z,ae,oe){return h.query({trans:Z,values:!1,query:{index:y,range:ae},limit:oe}).then(function(re){var ie=re.result;return te({type:"delete",keys:ie,trans:Z}).then(function(ge){return 0<ge.numFailures?Promise.reject(ge.failures[0]):ie.length<oe?{failures:[],numFailures:0,lastResult:void 0}:G(Z,s(s({},ae),{lower:ie[ie.length-1],lowerOpen:!0}),oe)})})})(_.trans,_.range,1e4)},!0)}return h.mutate(_);function te(G){var Z,ae,oe,re=Ye.trans,ie=G.keys||Ws(y,G);if(ie)return(G=G.type==="add"||G.type==="put"?s(s({},G),{keys:ie}):s({},G)).type!=="delete"&&(G.values=u([],G.values)),G.keys&&(G.keys=u([],G.keys)),Z=h,oe=ie,((ae=G).type==="add"?Promise.resolve([]):Z.getMany({trans:ae.trans,keys:oe,cache:"immutable"})).then(function(ge){var de=ie.map(function(ve,Ne){var Ce,De,Me,Ue=ge[Ne],Oe={onerror:null,onsuccess:null};return G.type==="delete"?O.fire.call(Oe,ve,Ue,re):G.type==="add"||Ue===void 0?(Ce=J.fire.call(Oe,ve,G.values[Ne],re),ve==null&&Ce!=null&&(G.keys[Ne]=ve=Ce,y.outbound||X(G.values[Ne],y.keyPath,ve))):(Ce=qs(Ue,G.values[Ne]),(De=ue.fire.call(Oe,Ce,ve,Ue,re))&&(Me=G.values[Ne],Object.keys(De).forEach(function(We){x(Me,We)?Me[We]=De[We]:X(Me,We,De[We])}))),Oe});return h.mutate(G).then(function(ve){for(var Ne=ve.failures,Ce=ve.results,De=ve.numFailures,ve=ve.lastResult,Me=0;Me<ie.length;++Me){var Ue=(Ce||ie)[Me],Oe=de[Me];Ue==null?Oe.onerror&&Oe.onerror(Ne[Me]):Oe.onsuccess&&Oe.onsuccess(G.type==="put"&&ge[Me]?G.values[Me]:Ue)}return{failures:Ne,results:Ce,numFailures:De,lastResult:ve}}).catch(function(ve){return de.forEach(function(Ne){return Ne.onerror&&Ne.onerror(ve)}),Promise.reject(ve)})});throw new Error("Keys missing")}}})}})}};function Wa(a,c,h){try{if(!c||c.keys.length<a.length)return null;for(var y=[],_=0,N=0;_<c.keys.length&&N<a.length;++_)ft(c.keys[_],a[N])===0&&(y.push(h?xe(c.values[_]):c.values[_]),++N);return y.length===a.length?y:null}catch{return null}}var Du={stack:"dbcore",level:-1,create:function(a){return{table:function(c){var h=a.table(c);return s(s({},h),{getMany:function(y){var _;return y.cache?(_=Wa(y.keys,y.trans._cache,y.cache==="clone"))?Ve.resolve(_):h.getMany(y).then(function(N){return y.trans._cache={keys:y.keys,values:y.cache==="clone"?xe(N):N},N}):h.getMany(y)},mutate:function(y){return y.type!=="add"&&(y.trans._cache=null),h.mutate(y)}})}}}};function Ya(a,c){return a.trans.mode==="readonly"&&!!a.subscr&&!a.trans.explicit&&a.trans.db._options.cache!=="disabled"&&!c.schema.primaryKey.outbound}function Xa(a,c){switch(a){case"query":return c.values&&!c.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Ys={stack:"dbcore",level:0,name:"Observability",create:function(a){var c=a.schema.name,h=new Gt(a.MIN_KEY,a.MAX_KEY);return s(s({},a),{transaction:function(y,_,N){if(Ye.subscr&&_!=="readonly")throw new ke.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(Ye.querier));return a.transaction(y,_,N)},table:function(y){function _(ie){var re,ie=ie.query;return[re=ie.index,new Gt((re=(ie=ie.range).lower)!=null?re:a.MIN_KEY,(re=ie.upper)!=null?re:a.MAX_KEY)]}var N=a.table(y),T=N.schema,O=T.primaryKey,J=T.indexes,ue=O.extractKey,te=O.outbound,G=O.autoIncrement&&J.filter(function(oe){return oe.compound&&oe.keyPath.includes(O.keyPath)}),Z=s(s({},N),{mutate:function(oe){function re(Ee){return Ee="idb://".concat(c,"/").concat(y,"/").concat(Ee),Ne[Ee]||(Ne[Ee]=new Gt)}var ie,ge,de,ve=oe.trans,Ne=oe.mutatedParts||(oe.mutatedParts={}),Ce=re(""),De=re(":dels"),Me=oe.type,Oe=oe.type==="deleteRange"?[oe.range]:oe.type==="delete"?[oe.keys]:oe.values.length<50?[Ws(O,oe).filter(function(Ee){return Ee}),oe.values]:[],Ue=Oe[0],Oe=Oe[1],We=oe.trans._cache;return m(Ue)?(Ce.addKeys(Ue),(Me=Me==="delete"||Ue.length===Oe.length?Wa(Ue,We):null)||De.addKeys(Ue),(Me||Oe)&&(ie=re,ge=Me,de=Oe,T.indexes.forEach(function(Ee){var rt=ie(Ee.name||"");function ot(dt){return dt!=null?Ee.extractKey(dt):null}function lt(dt){Ee.multiEntry&&m(dt)?dt.forEach(function(mn){return rt.addKey(mn)}):rt.addKey(dt)}(ge||de).forEach(function(dt,Ct){var at=ge&&ot(ge[Ct]),Ct=de&&ot(de[Ct]);ft(at,Ct)!==0&&(at!=null&<(at),Ct!=null)&<(Ct)})}))):Ue?(Oe={from:(We=Ue.lower)!=null?We:a.MIN_KEY,to:(Me=Ue.upper)!=null?Me:a.MAX_KEY},De.add(Oe),Ce.add(Oe)):(Ce.add(h),De.add(h),T.indexes.forEach(function(Ee){return re(Ee.name).add(h)})),N.mutate(oe).then(function(Ee){return!Ue||oe.type!=="add"&&oe.type!=="put"||(Ce.addKeys(Ee.results),G&&G.forEach(function(rt){for(var ot=oe.values.map(function(at){return rt.extractKey(at)}),lt=rt.keyPath.findIndex(function(at){return at===O.keyPath}),dt=0,mn=Ee.results.length;dt<mn;++dt)ot[dt][lt]=Ee.results[dt];re(rt.name).addKeys(ot)})),ve.mutatedParts=Zi(ve.mutatedParts||{},Ne),Ee})}}),ae={get:function(oe){return[O,new Gt(oe.key)]},getMany:function(oe){return[O,new Gt().addKeys(oe.keys)]},count:_,query:_,openCursor:_};return d(ae).forEach(function(oe){Z[oe]=function(re){var ie=Ye.subscr,ge=!!ie,de=Ya(Ye,N)&&Xa(oe,re)?re.obsSet={}:ie;if(ge){var ve,ie=function(Oe){return Oe="idb://".concat(c,"/").concat(y,"/").concat(Oe),de[Oe]||(de[Oe]=new Gt)},Ne=ie(""),Ce=ie(":dels"),ge=ae[oe](re),De=ge[0],ge=ge[1];if((oe==="query"&&De.isPrimaryKey&&!re.values?Ce:ie(De.name||"")).add(ge),!De.isPrimaryKey){if(oe!=="count")return ve=oe==="query"&&te&&re.values&&N.query(s(s({},re),{values:!1})),N[oe].apply(this,arguments).then(function(Oe){if(oe==="query"){if(te&&re.values)return ve.then(function(ot){return ot=ot.result,Ne.addKeys(ot),Oe});var We=re.values?Oe.result.map(ue):Oe.result;(re.values?Ne:Ce).addKeys(We)}else{var Ee,rt;if(oe==="openCursor")return rt=re.values,(Ee=Oe)&&Object.create(Ee,{key:{get:function(){return Ce.addKey(Ee.primaryKey),Ee.key}},primaryKey:{get:function(){var ot=Ee.primaryKey;return Ce.addKey(ot),ot}},value:{get:function(){return rt&&Ne.addKey(Ee.primaryKey),Ee.value}}})}return Oe});Ce.add(h)}}return N[oe].apply(this,arguments)}}),Z}})}};function Ho(a,c,h){var y;return h.numFailures===0?c:c.type==="deleteRange"||(y=c.keys?c.keys.length:"values"in c&&c.values?c.values.length:1,h.numFailures===y)?null:(y=s({},c),m(y.keys)&&(y.keys=y.keys.filter(function(_,N){return!(N in h.failures)})),"values"in y&&m(y.values)&&(y.values=y.values.filter(function(_,N){return!(N in h.failures)})),y)}function Xs(a,c){return h=a,((y=c).lower===void 0||(y.lowerOpen?0<ft(h,y.lower):0<=ft(h,y.lower)))&&(h=a,(y=c).upper===void 0||(y.upperOpen?ft(h,y.upper)<0:ft(h,y.upper)<=0));var h,y}function Qs(a,c,h,y,_,N){var T,O,J,ue,te,G,Z;return!h||h.length===0||(T=c.query.index,O=T.multiEntry,J=c.query.range,ue=y.schema.primaryKey.extractKey,te=T.extractKey,G=(T.lowLevelIndex||T).extractKey,(y=h.reduce(function(ae,oe){var re=ae,ie=[];if(oe.type==="add"||oe.type==="put")for(var ge=new Gt,de=oe.values.length-1;0<=de;--de){var ve,Ne=oe.values[de],Ce=ue(Ne);!ge.hasKey(Ce)&&(ve=te(Ne),O&&m(ve)?ve.some(function(We){return Xs(We,J)}):Xs(ve,J))&&(ge.addKey(Ce),ie.push(Ne))}switch(oe.type){case"add":var De=new Gt().addKeys(c.values?ae.map(function(Ee){return ue(Ee)}):ae),re=ae.concat(c.values?ie.filter(function(Ee){return Ee=ue(Ee),!De.hasKey(Ee)&&(De.addKey(Ee),!0)}):ie.map(function(Ee){return ue(Ee)}).filter(function(Ee){return!De.hasKey(Ee)&&(De.addKey(Ee),!0)}));break;case"put":var Me=new Gt().addKeys(oe.values.map(function(Ee){return ue(Ee)}));re=ae.filter(function(Ee){return!Me.hasKey(c.values?ue(Ee):Ee)}).concat(c.values?ie:ie.map(function(Ee){return ue(Ee)}));break;case"delete":var Ue=new Gt().addKeys(oe.keys);re=ae.filter(function(Ee){return!Ue.hasKey(c.values?ue(Ee):Ee)});break;case"deleteRange":var Oe=oe.range;re=ae.filter(function(Ee){return!Xs(ue(Ee),Oe)})}return re},a))===a)?a:(Z=function(ae,oe){return ft(G(ae),G(oe))||ft(ue(ae),ue(oe))},y.sort(c.direction==="prev"||c.direction==="prevunique"?function(ae,oe){return Z(oe,ae)}:Z),c.limit&&c.limit<1/0&&(y.length>c.limit?y.length=c.limit:a.length===c.limit&&y.length<c.limit&&(_.dirty=!0)),N?Object.freeze(y):y)}function Gs(a,c){return ft(a.lower,c.lower)===0&&ft(a.upper,c.upper)===0&&!!a.lowerOpen==!!c.lowerOpen&&!!a.upperOpen==!!c.upperOpen}function Qa(a,c){return((h,y,_,N)=>{if(h===void 0)return y!==void 0?-1:0;if(y===void 0)return 1;if((h=ft(h,y))===0){if(_&&N)return 0;if(_)return 1;if(N)return-1}return h})(a.lower,c.lower,a.lowerOpen,c.lowerOpen)<=0&&0<=((h,y,_,N)=>{if(h===void 0)return y!==void 0?1:0;if(y===void 0)return-1;if((h=ft(h,y))===0){if(_&&N)return 0;if(_)return-1;if(N)return 1}return h})(a.upper,c.upper,a.upperOpen,c.upperOpen)}function Ga(a,c,h,y){a.subscribers.add(h),y.addEventListener("abort",function(){var _,N;a.subscribers.delete(h),a.subscribers.size===0&&(_=a,N=c,setTimeout(function(){_.subscribers.size===0&&L(N,_)},3e3))})}var Ja={stack:"dbcore",level:0,name:"Cache",create:function(a){var c=a.schema.name;return s(s({},a),{transaction:function(h,y,_){var N,T,O=a.transaction(h,y,_);return y==="readwrite"&&(_=(N=new AbortController).signal,O.addEventListener("abort",(T=function(J){return function(){if(N.abort(),y==="readwrite"){for(var ue=new Set,te=0,G=h;te<G.length;te++){var Z=G[te],ae=Vr["idb://".concat(c,"/").concat(Z)];if(ae){var oe=a.table(Z),re=ae.optimisticOps.filter(function(Ee){return Ee.trans===O});if(O._explicit&&J&&O.mutatedParts)for(var ie=0,ge=Object.values(ae.queries.query);ie<ge.length;ie++)for(var de=0,ve=(De=ge[ie]).slice();de<ve.length;de++)Bs((Me=ve[de]).obsSet,O.mutatedParts)&&(L(De,Me),Me.subscribers.forEach(function(Ee){return ue.add(Ee)}));else if(0<re.length){ae.optimisticOps=ae.optimisticOps.filter(function(Ee){return Ee.trans!==O});for(var Ne=0,Ce=Object.values(ae.queries.query);Ne<Ce.length;Ne++)for(var De,Me,Ue,Oe=0,We=(De=Ce[Ne]).slice();Oe<We.length;Oe++)(Me=We[Oe]).res!=null&&O.mutatedParts&&(J&&!Me.dirty?(Ue=Object.isFrozen(Me.res),Ue=Qs(Me.res,Me.req,re,oe,Me,Ue),Me.dirty?(L(De,Me),Me.subscribers.forEach(function(Ee){return ue.add(Ee)})):Ue!==Me.res&&(Me.res=Ue,Me.promise=Ve.resolve({result:Ue}))):(Me.dirty&&L(De,Me),Me.subscribers.forEach(function(Ee){return ue.add(Ee)})))}}}ue.forEach(function(Ee){return Ee()})}}})(!1),{signal:_}),O.addEventListener("error",T(!1),{signal:_}),O.addEventListener("complete",T(!0),{signal:_})),O},table:function(h){var y=a.table(h),_=y.schema.primaryKey;return s(s({},y),{mutate:function(N){var T,O=Ye.trans;return!_.outbound&&O.db._options.cache!=="disabled"&&!O.explicit&&O.idbtrans.mode==="readwrite"&&(T=Vr["idb://".concat(c,"/").concat(h)])?(O=y.mutate(N),N.type!=="add"&&N.type!=="put"||!(50<=N.values.length||Ws(_,N).some(function(J){return J==null}))?(T.optimisticOps.push(N),N.mutatedParts&&es(N.mutatedParts),O.then(function(J){0<J.numFailures&&(L(T.optimisticOps,N),(J=Ho(0,N,J))&&T.optimisticOps.push(J),N.mutatedParts)&&es(N.mutatedParts)}),O.catch(function(){L(T.optimisticOps,N),N.mutatedParts&&es(N.mutatedParts)})):O.then(function(J){var ue=Ho(0,s(s({},N),{values:N.values.map(function(te,G){var Z;return J.failures[G]?te:(X(Z=(Z=_.keyPath)!=null&&Z.includes(".")?xe(te):s({},te),_.keyPath,J.results[G]),Z)})}),J);T.optimisticOps.push(ue),queueMicrotask(function(){return N.mutatedParts&&es(N.mutatedParts)})}),O):y.mutate(N)},query:function(N){var T,O,J,ue,te,G,Z;return Ya(Ye,y)&&Xa("query",N)?(T=((J=Ye.trans)==null?void 0:J.db._options.cache)==="immutable",O=(J=Ye).requery,J=J.signal,G=((ae,oe,re,ie)=>{var ge=Vr["idb://".concat(ae,"/").concat(oe)];if(!ge)return[];if(!(ae=ge.queries[re]))return[null,!1,ge,null];var de=ae[(ie.query?ie.query.index.name:null)||""];if(!de)return[null,!1,ge,null];switch(re){case"query":var ve=(Ne=ie.direction)!=null?Ne:"next",Ne=de.find(function(Ce){var De;return Ce.req.limit===ie.limit&&Ce.req.values===ie.values&&((De=Ce.req.direction)!=null?De:"next")===ve&&Gs(Ce.req.query.range,ie.query.range)});return Ne?[Ne,!0,ge,de]:[de.find(function(Ce){var De;return("limit"in Ce.req?Ce.req.limit:1/0)>=ie.limit&&((De=Ce.req.direction)!=null?De:"next")===ve&&(!ie.values||Ce.req.values)&&Qa(Ce.req.query.range,ie.query.range)}),!1,ge,de];case"count":return Ne=de.find(function(Ce){return Gs(Ce.req.query.range,ie.query.range)}),[Ne,!!Ne,ge,de]}})(c,h,"query",N),Z=G[0],ue=G[2],te=G[3],Z&&G[1]?Z.obsSet=N.obsSet:(G=y.query(N).then(function(ae){var oe=ae.result;if(Z&&(Z.res=oe),T){for(var re=0,ie=oe.length;re<ie;++re)Object.freeze(oe[re]);Object.freeze(oe)}else ae.result=xe(oe);return ae}).catch(function(ae){return te&&Z&&L(te,Z),Promise.reject(ae)}),Z={obsSet:N.obsSet,promise:G,subscribers:new Set,type:"query",req:N,dirty:!1},te?te.push(Z):(te=[Z],(ue=ue||(Vr["idb://".concat(c,"/").concat(h)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[N.query.index.name||""]=te)),Ga(Z,te,O,J),Z.promise.then(function(ae){return{result:Qs(ae.result,N,ue==null?void 0:ue.optimisticOps,y,Z,T)}})):y.query(N)}})}})}};function Sr(a,c){return new Proxy(a,{get:function(h,y,_){return y==="db"?c:Reflect.get(h,y,_)}})}Rt.prototype.version=function(a){if(isNaN(a)||a<.1)throw new ke.Type("Given version is not a positive number");if(a=Math.round(10*a)/10,this.idbdb||this._state.isBeingOpened)throw new ke.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,a);var c=this._versions,h=c.filter(function(y){return y._cfg.version===a})[0];return h||(h=new this.Version(a),c.push(h),c.sort(Hr),h.stores({}),this._state.autoSchema=!1),h},Rt.prototype._whenReady=function(a){var c=this;return this.idbdb&&(this._state.openComplete||Ye.letThrough||this._vip)?a():new Ve(function(h,y){if(c._state.openComplete)return y(new ke.DatabaseClosed(c._state.dbOpenError));if(!c._state.isBeingOpened){if(!c._state.autoOpen)return void y(new ke.DatabaseClosed);c.open().catch(Ae)}c._state.dbReadyPromise.then(h,y)}).then(a)},Rt.prototype.use=function(_){var c=_.stack,h=_.create,y=_.level,_=_.name,N=(_&&this.unuse({stack:c,name:_}),this._middlewares[c]||(this._middlewares[c]=[]));return N.push({stack:c,create:h,level:y??10,name:_}),N.sort(function(T,O){return T.level-O.level}),this},Rt.prototype.unuse=function(a){var c=a.stack,h=a.name,y=a.create;return c&&this._middlewares[c]&&(this._middlewares[c]=this._middlewares[c].filter(function(_){return y?_.create!==y:!!h&&_.name!==h})),this},Rt.prototype.open=function(){var a=this;return ir(bn,function(){return Ou(a)})},Rt.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var a=this._state;if(fo.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}a.isBeingOpened||(a.dbReadyPromise=new Ve(function(c){a.dbReadyResolve=c}),a.openCanceller=new Ve(function(c,h){a.cancelOpen=h}))},Rt.prototype.close=function(c){var c=(c===void 0?{disableAutoOpen:!0}:c).disableAutoOpen,h=this._state;c?(h.isBeingOpened&&h.cancelOpen(new ke.DatabaseClosed),this._close(),h.autoOpen=!1,h.dbOpenError=new ke.DatabaseClosed):(this._close(),h.autoOpen=this._options.autoOpen||h.isBeingOpened,h.openComplete=!1,h.dbOpenError=null)},Rt.prototype.delete=function(a){var c=this,h=(a===void 0&&(a={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),y=this._state;return new Ve(function(_,N){function T(){c.close(a);var O=c._deps.indexedDB.deleteDatabase(c.name);O.onsuccess=Le(function(){var J,ue,te;J=c._deps,ue=c.name,po(te=J.indexedDB)||ue===Dr||vi(te,J.IDBKeyRange).delete(ue).catch(Ae),_()}),O.onerror=an(N),O.onblocked=c._fireOnBlocked}if(h)throw new ke.InvalidArgument("Invalid closeOptions argument to db.delete()");y.isBeingOpened?y.dbReadyPromise.then(T):T()})},Rt.prototype.backendDB=function(){return this.idbdb},Rt.prototype.isOpen=function(){return this.idbdb!==null},Rt.prototype.hasBeenClosed=function(){var a=this._state.dbOpenError;return a&&a.name==="DatabaseClosed"},Rt.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Rt.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Rt.prototype,"tables",{get:function(){var a=this;return d(this._allTables).map(function(c){return a._allTables[c]})},enumerable:!1,configurable:!0}),Rt.prototype.transaction=function(){var a=(function(c,h,y){var _=arguments.length;if(_<2)throw new ke.InvalidArgument("Too few arguments");for(var N=new Array(_-1);--_;)N[_-1]=arguments[_];return y=N.pop(),[c,Se(N),y]}).apply(this,arguments);return this._transaction.apply(this,a)},Rt.prototype._transaction=function(a,c,h){var y,_,N=this,T=Ye.trans,O=(T&&T.db===this&&a.indexOf("!")===-1||(T=null),a.indexOf("?")!==-1);a=a.replace("!","").replace("?","");try{if(_=c.map(function(ue){if(ue=ue instanceof N.Table?ue.name:ue,typeof ue!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return ue}),a=="r"||a===Ao)y=Ao;else{if(a!="rw"&&a!=zr)throw new ke.InvalidArgument("Invalid transaction mode: "+a);y=zr}if(T){if(T.mode===Ao&&y===zr){if(!O)throw new ke.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");T=null}T&&_.forEach(function(ue){if(T&&T.storeNames.indexOf(ue)===-1){if(!O)throw new ke.SubTransaction("Table "+ue+" not included in parent transaction.");T=null}}),O&&T&&!T.active&&(T=null)}}catch(ue){return T?T._promise(null,function(te,G){G(ue)}):Et(ue)}var J=(function ue(te,G,Z,ae,oe){return Ve.resolve().then(function(){var de=Ye.transless||Ye,re=te._createTransaction(G,Z,te._dbSchema,ae),de=(re.explicit=!0,{trans:re,transless:de});if(ae)re.idbtrans=ae.idbtrans;else try{re.create(),re.idbtrans._explicit=!0,te._state.PR1398_maxLoop=3}catch(ve){return ve.name===_e.InvalidState&&te.isOpen()&&0<--te._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),te.close({disableAutoOpen:!1}),te.open().then(function(){return ue(te,G,Z,null,oe)})):Et(ve)}var ie,ge=$(oe),de=(ge&&qn(),Ve.follow(function(){var ve;(ie=oe.call(re,re))&&(ge?(ve=Lt.bind(null,null),ie.then(ve,ve)):typeof ie.next=="function"&&typeof ie.throw=="function"&&(ie=Ks(ie)))},de));return(ie&&typeof ie.then=="function"?Ve.resolve(ie).then(function(ve){return re.active?ve:Et(new ke.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):de.then(function(){return ie})).then(function(ve){return ae&&re._resolve(),re._completion.then(function(){return ve})}).catch(function(ve){return re._reject(ve),Et(ve)})})}).bind(null,this,y,_,T,h);return T?T._promise(y,J,"lock"):Ye.trans?ir(Ye.transless,function(){return N._whenReady(J)}):this._whenReady(J)},Rt.prototype.table=function(a){if(x(this._allTables,a))return this._allTables[a];throw new ke.InvalidTable("Table ".concat(a," does not exist"))};var br=Rt;function Rt(a,c){var h,y,_,N,T,O=this,J=(this._middlewares={},this.verno=0,Rt.dependencies),J=(this._options=c=s({addons:Rt.addons,autoOpen:!0,indexedDB:J.indexedDB,IDBKeyRange:J.IDBKeyRange,cache:"cloned",maxConnections:1e3},c),this._deps={indexedDB:c.indexedDB,IDBKeyRange:c.IDBKeyRange},c.addons),ue=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Ae,dbReadyPromise:null,cancelOpen:Ae,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:c.autoOpen}),te=(ue.dbReadyPromise=new Ve(function(G){ue.dbReadyResolve=G}),ue.openCanceller=new Ve(function(G,Z){ue.cancelOpen=Z}),this._state=ue,this.name=a,this.on=Lr(this,"populate","blocked","versionchange","close",{ready:[Ot,Ae]}),this.once=function(G,Z){var ae=function(){for(var oe=[],re=0;re<arguments.length;re++)oe[re]=arguments[re];O.on(G).unsubscribe(ae),Z.apply(O,oe)};return O.on(G,ae)},this.on.ready.subscribe=P(this.on.ready.subscribe,function(G){return function(Z,ae){Rt.vip(function(){var oe,re=O._state;re.openComplete?(re.dbOpenError||Ve.resolve().then(Z),ae&&G(Z)):re.onReadyBeingFired?(re.onReadyBeingFired.push(Z),ae&&G(Z)):(G(Z),oe=O,ae||G(function ie(){oe.on.ready.unsubscribe(Z),oe.on.ready.unsubscribe(ie)}))})}}),this.Collection=(h=this,io(Ba.prototype,function(ie,re){this.db=h;var ae=fi,oe=null;if(re)try{ae=re()}catch(de){oe=de}var re=ie._ctx,ie=re.table,ge=ie.hook.reading.fire;this._ctx={table:ie,index:re.index,isPrimKey:!re.index||ie.schema.primKey.keyPath&&re.index===ie.schema.primKey.name,range:ae,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:oe,or:re.or,valueMapper:ge!==qe?ge:null}})),this.Table=(y=this,io(Yn.prototype,function(G,Z,ae){this.db=y,this._tx=ae,this.name=G,this.schema=Z,this.hook=y._allTables[G]?y._allTables[G].hook:Lr(null,{creating:[it,Ae],reading:[ut,qe],updating:[St,Ae],deleting:[Mt,Ae]})})),this.Transaction=(_=this,io($u.prototype,function(G,Z,ae,oe,re){var ie=this;G!=="readonly"&&Z.forEach(function(ge){ge=(ge=ae[ge])==null?void 0:ge.yProps,ge&&(Z=Z.concat(ge.map(function(de){return de.updatesTable})))}),this.db=_,this.mode=G,this.storeNames=Z,this.schema=ae,this.chromeTransactionDurability=oe,this.idbtrans=null,this.on=Lr(this,"complete","error","abort"),this.parent=re||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new Ve(function(ge,de){ie._resolve=ge,ie._reject=de}),this._completion.then(function(){ie.active=!1,ie.on.complete.fire()},function(ge){var de=ie.active;return ie.active=!1,ie.on.error.fire(ge),ie.parent?ie.parent._reject(ge):de&&ie.idbtrans&&ie.idbtrans.abort(),Et(ge)})})),this.Version=(N=this,io(yi.prototype,function(G){this.db=N,this._cfg={version:G,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(T=this,io(xr.prototype,function(G,Z,ae){if(this.db=T,this._ctx={table:G,index:Z===":id"?null:Z,or:ae},this._cmp=this._ascending=ft,this._descending=function(oe,re){return ft(re,oe)},this._max=function(oe,re){return 0<ft(oe,re)?oe:re},this._min=function(oe,re){return ft(oe,re)<0?oe:re},this._IDBKeyRange=T._deps.IDBKeyRange,!this._IDBKeyRange)throw new ke.MissingAPI})),this.on("versionchange",function(G){0<G.newVersion?console.warn("Another connection wants to upgrade database '".concat(O.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(O.name,"'. Closing db now to resume the delete request.")),O.close({disableAutoOpen:!1})}),this.on("blocked",function(G){!G.newVersion||G.newVersion<G.oldVersion?console.warn("Dexie.delete('".concat(O.name,"') was blocked")):console.warn("Upgrade '".concat(O.name,"' blocked by other connection holding version ").concat(G.oldVersion/10))}),this._maxKey=wr(c.IDBKeyRange),this._createTransaction=function(G,Z,ae,oe){return new O.Transaction(G,Z,ae,O._options.chromeTransactionDurability,oe)},this._fireOnBlocked=function(G){O.on("blocked").fire(G),fo.toArray().filter(function(Z){return Z.name===O.name&&Z!==O&&!Z._state.vcFired}).map(function(Z){return Z.on("versionchange").fire(G)})},this.use(Du),this.use(Ja),this.use(Ys),this.use(qa),this.use(Ru),new Proxy(this,{get:function(G,Z,ae){var oe;return Z==="_vip"||(Z==="table"?function(re){return Sr(O.table(re),te)}:(oe=Reflect.get(G,Z,ae))instanceof Yn?Sr(oe,te):Z==="tables"?oe.map(function(re){return Sr(re,te)}):Z==="_createTransaction"?function(){return Sr(oe.apply(this,arguments),te)}:oe)}}));this.vip=te,J.forEach(function(G){return G(O)})}var rs,ho=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Za=(mo.prototype.subscribe=function(a,c,h){return this._subscribe(a&&typeof a!="function"?a:{next:a,error:c,complete:h})},mo.prototype[ho]=function(){return this},mo);function mo(a){this._subscribe=a}try{rs={indexedDB:f.indexedDB||f.mozIndexedDB||f.webkitIndexedDB||f.msIndexedDB,IDBKeyRange:f.IDBKeyRange||f.webkitIDBKeyRange}}catch{rs={indexedDB:null,IDBKeyRange:null}}function Vo(a){var c,h=!1,y=new Za(function(_){var N=$(a),T,O=!1,J={},ue={},te={get closed(){return O},unsubscribe:function(){O||(O=!0,T&&T.abort(),G&&An.storagemutated.unsubscribe(oe))}},G=(_.start&&_.start(te),!1),Z=function(){return $o(re)};function ae(){return Bs(ue,J)}var oe=function(ie){Zi(J,ie),ae()&&Z()},re=function(){var ie,ge,de;!O&&rs.indexedDB&&(J={},ie={},T&&T.abort(),T=new AbortController,de=(ve=>{var Ne=Nn();try{N&&qn();var Ce=on(a,ve);return Ce=N?Ce.finally(Lt):Ce}finally{Ne&&Mn()}})(ge={subscr:ie,signal:T.signal,requery:Z,querier:a,trans:null}),G||(An(pi,oe),G=!0),Promise.resolve(de).then(function(ve){h=!0,c=ve,O||ge.signal.aborted||(ae()||(ue=ie,ae())?Z():(J={},$o(function(){return!O&&_.next&&_.next(ve)})))},function(ve){h=!1,["DatabaseClosedError","AbortError"].includes(ve==null?void 0:ve.name)||O||$o(function(){O||_.error&&_.error(ve)})}))};return setTimeout(Z,0),te});return y.hasValue=function(){return h},y.getValue=function(){return c},y}var go=br;function Uo(a){var c=kr;try{kr=!0,An.storagemutated.fire(a),Us(a,!0)}finally{kr=c}}S(go,s(s({},H),{delete:function(a){return new go(a,{addons:[]}).delete()},exists:function(a){return new go(a,{addons:[]}).open().then(function(c){return c.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(a){try{return c=go.dependencies,h=c.indexedDB,c=c.IDBKeyRange,(po(h)?Promise.resolve(h.databases()).then(function(y){return y.map(function(_){return _.name}).filter(function(_){return _!==Dr})}):vi(h,c).toCollection().primaryKeys()).then(a)}catch{return Et(new ke.MissingAPI)}var c,h},defineClass:function(){return function(a){v(this,a)}},ignoreTransaction:function(a){return Ye.trans?ir(Ye.transless||bn,a):a()},vip:Bo,async:function(a){return function(){try{var c=Ks(a.apply(this,arguments));return c&&typeof c.then=="function"?c:Ve.resolve(c)}catch(h){return Et(h)}}},spawn:function(a,c,h){try{var y=Ks(a.apply(h,c||[]));return y&&typeof y.then=="function"?y:Ve.resolve(y)}catch(_){return Et(_)}},currentTransaction:{get:function(){return Ye.trans||null}},waitFor:function(a,c){return a=Ve.resolve(typeof a=="function"?go.ignoreTransaction(a):a).timeout(c||6e4),Ye.trans?Ye.trans.waitFor(a):a},Promise:Ve,debug:{get:function(){return bt},set:function(a){wn(a)}},derive:M,extend:v,props:S,override:P,Events:Lr,on:An,liveQuery:Vo,extendObservabilitySet:Zi,getByKeyPath:B,setByKeyPath:X,delByKeyPath:function(a,c){typeof c=="string"?X(a,c,void 0):"length"in c&&[].map.call(c,function(h){X(a,h,void 0)})},shallowClone:fe,deepClone:xe,getObjectDiff:qs,cmp:ft,asap:q,minKey:-1/0,addons:[],connections:{get:fo.toArray},errnames:_e,dependencies:rs,cache:Vr,semVer:"4.4.2",version:"4.4.2".split(".").map(function(a){return parseInt(a)}).reduce(function(a,c,h){return a+c/Math.pow(10,2*h)})})),go.maxKey=wr(go.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(An(pi,function(a){kr||(a=new CustomEvent(Ui,{detail:a}),kr=!0,dispatchEvent(a),kr=!1)}),addEventListener(Ui,function(a){a=a.detail,kr||Uo(a)}));var Ko,kr=!1,os=function(){};return typeof BroadcastChannel<"u"&&((os=function(){(Ko=new BroadcastChannel(Ui)).onmessage=function(a){return a.data&&Uo(a.data)}})(),typeof Ko.unref=="function"&&Ko.unref(),An(pi,function(a){kr||Ko.postMessage(a)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(a){if(!br.disableBfCache&&a.persisted){bt&&console.debug("Dexie: handling persisted pagehide"),Ko!=null&&Ko.close();for(var c=0,h=fo.toArray();c<h.length;c++)h[c].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(a){!br.disableBfCache&&a.persisted&&(bt&&console.debug("Dexie: handling persisted pageshow"),os(),Uo({all:new Gt(-1/0,[[]])}))})),Ve.rejectionMapper=function(a,c){return!a||a instanceof be||a instanceof TypeError||a instanceof SyntaxError||!a.name||!He[a.name]?a:(c=new He[a.name](c||a.message,a),"stack"in a&&j(c,"stack",{get:function(){return this.inner.stack}}),c)},wn(bt),s(br,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:br,Entity:En,PropModification:no,RangeSet:Gt,add:function(a){return new no({add:a})},cmp:ft,default:br,liveQuery:Vo,mergeRanges:wi,rangesOverlap:Gi,remove:function(a){return new no({remove:a})},replacePrefix:function(a,c){return new no({replacePrefix:[a,c]})}}),{default:br}),br})})(Zl)),Zl.exports}var A0=$0();const vf=vu(A0),eh=Symbol.for("Dexie"),su=globalThis[eh]||(globalThis[eh]=vf);if(vf.semVer!==su.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${vf.semVer} and ${su.semVer}`);const{liveQuery:Nk,mergeRanges:Ek,rangesOverlap:Ck,RangeSet:jk,cmp:Pk,Entity:Tk,PropModification:Mk,replacePrefix:Ik,add:$k,remove:Ak,DexieYProvider:Ok}=su;class O0 extends su{constructor(){super("api-doc-tor");ga(this,"flows");ga(this,"testSuites");ga(this,"environments");ga(this,"kv");this.version(1).stores({flows:"++id, name",testSuites:"++id, name",environments:"++id, name",kv:"key"})}}const _t=new O0;async function R0(){const[t,r,i]=await Promise.all([_t.flows.toArray(),_t.testSuites.toArray(),_t.environments.toArray()]),s=await _t.kv.get("authTokens");let u;try{u=s!=null&&s.value?JSON.parse(s.value):void 0}catch{u=void 0}return{formatVersion:1,exportedAt:new Date().toISOString(),flows:t,testSuites:r,environments:i,authTokens:u}}async function xm(t){await _t.transaction("rw",_t.flows,_t.testSuites,_t.environments,_t.kv,async()=>{await _t.flows.clear(),await _t.testSuites.clear(),await _t.environments.clear();for(const r of t.flows)await _t.flows.add({name:r.name,steps:r.steps,graph:r.graph});for(const r of t.testSuites)await _t.testSuites.add({name:r.name,cases:r.cases});for(const r of t.environments)await _t.environments.add({name:r.name,baseUrl:r.baseUrl,vars:r.vars??{}});t.authTokens&&await _t.kv.put({key:"authTokens",value:JSON.stringify(t.authTokens)})})}async function D0(t){if(t.formatVersion!==1)return!1;const[r,i]=await Promise.all([_t.flows.count(),_t.testSuites.count()]);return r>0||i>0?!1:(await xm(t),!0)}function z0(t,r,i){var d,m;const s=[],u=r===t.expectStatus;if(s.push(`HTTP ${r} ${u?"✓":`✗ (esperado ${t.expectStatus})`}`),!u)return{pass:!1,lines:s};if((d=t.contains)!=null&&d.trim()){const v=i.includes(t.contains);if(s.push(`Contiene texto "${t.contains}": ${v?"✓":"✗"}`),!v)return{pass:!1,lines:s}}const f=(m=t.jsonPath)==null?void 0:m.trim();if(f){let v;try{v=JSON.parse(i)}catch{return s.push("Body no es JSON válido: ✗"),{pass:!1,lines:s}}const w=Af(v,f),b=t.expectJsonValue;if(b!==void 0&&b!==""){const x=w==null?String(w):typeof w=="object"?JSON.stringify(w):String(w),S=b.trim(),C=x===S||String(w)===S;if(s.push(`JSON path ${f} → ${x} vs "${S}": ${C?"✓":"✗"}`),!C)return{pass:!1,lines:s}}else{const x=w!=null;if(s.push(`JSON path ${f} existe: ${x?"✓":"✗"}`),!x)return{pass:!1,lines:s}}}return{pass:!0,lines:s}}function qt(t){if(typeof t=="string"||typeof t=="number")return""+t;let r="";if(Array.isArray(t))for(let i=0,s;i<t.length;i++)(s=qt(t[i]))!==""&&(r+=(r&&" ")+s);else for(let i in t)t[i]&&(r+=(r&&" ")+i);return r}var L0={value:()=>{}};function Su(){for(var t=0,r=arguments.length,i={},s;t<r;++t){if(!(s=arguments[t]+"")||s in i||/[\s.]/.test(s))throw new Error("illegal type: "+s);i[s]=[]}return new eu(i)}function eu(t){this._=t}function F0(t,r){return t.trim().split(/^|\s+/).map(function(i){var s="",u=i.indexOf(".");if(u>=0&&(s=i.slice(u+1),i=i.slice(0,u)),i&&!r.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:s}})}eu.prototype=Su.prototype={constructor:eu,on:function(t,r){var i=this._,s=F0(t+"",i),u,f=-1,d=s.length;if(arguments.length<2){for(;++f<d;)if((u=(t=s[f]).type)&&(u=B0(i[u],t.name)))return u;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++f<d;)if(u=(t=s[f]).type)i[u]=th(i[u],t.name,r);else if(r==null)for(u in i)i[u]=th(i[u],t.name,null);return this},copy:function(){var t={},r=this._;for(var i in r)t[i]=r[i].slice();return new eu(t)},call:function(t,r){if((u=arguments.length-2)>0)for(var i=new Array(u),s=0,u,f;s<u;++s)i[s]=arguments[s+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(f=this._[t],s=0,u=f.length;s<u;++s)f[s].value.apply(r,i)},apply:function(t,r,i){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var s=this._[t],u=0,f=s.length;u<f;++u)s[u].value.apply(r,i)}};function B0(t,r){for(var i=0,s=t.length,u;i<s;++i)if((u=t[i]).name===r)return u.value}function th(t,r,i){for(var s=0,u=t.length;s<u;++s)if(t[s].name===r){t[s]=L0,t=t.slice(0,s).concat(t.slice(s+1));break}return i!=null&&t.push({name:r,value:i}),t}var xf="http://www.w3.org/1999/xhtml";const nh={svg:"http://www.w3.org/2000/svg",xhtml:xf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function bu(t){var r=t+="",i=r.indexOf(":");return i>=0&&(r=t.slice(0,i))!=="xmlns"&&(t=t.slice(i+1)),nh.hasOwnProperty(r)?{space:nh[r],local:t}:t}function H0(t){return function(){var r=this.ownerDocument,i=this.namespaceURI;return i===xf&&r.documentElement.namespaceURI===xf?r.createElement(t):r.createElementNS(i,t)}}function V0(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function wm(t){var r=bu(t);return(r.local?V0:H0)(r)}function U0(){}function Of(t){return t==null?U0:function(){return this.querySelector(t)}}function K0(t){typeof t!="function"&&(t=Of(t));for(var r=this._groups,i=r.length,s=new Array(i),u=0;u<i;++u)for(var f=r[u],d=f.length,m=s[u]=new Array(d),v,w,b=0;b<d;++b)(v=f[b])&&(w=t.call(v,v.__data__,b,f))&&("__data__"in v&&(w.__data__=v.__data__),m[b]=w);return new er(s,this._parents)}function q0(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function W0(){return[]}function _m(t){return t==null?W0:function(){return this.querySelectorAll(t)}}function Y0(t){return function(){return q0(t.apply(this,arguments))}}function X0(t){typeof t=="function"?t=Y0(t):t=_m(t);for(var r=this._groups,i=r.length,s=[],u=[],f=0;f<i;++f)for(var d=r[f],m=d.length,v,w=0;w<m;++w)(v=d[w])&&(s.push(t.call(v,v.__data__,w,d)),u.push(v));return new er(s,u)}function Sm(t){return function(){return this.matches(t)}}function bm(t){return function(r){return r.matches(t)}}var Q0=Array.prototype.find;function G0(t){return function(){return Q0.call(this.children,t)}}function J0(){return this.firstElementChild}function Z0(t){return this.select(t==null?J0:G0(typeof t=="function"?t:bm(t)))}var ev=Array.prototype.filter;function tv(){return Array.from(this.children)}function nv(t){return function(){return ev.call(this.children,t)}}function rv(t){return this.selectAll(t==null?tv:nv(typeof t=="function"?t:bm(t)))}function ov(t){typeof t!="function"&&(t=Sm(t));for(var r=this._groups,i=r.length,s=new Array(i),u=0;u<i;++u)for(var f=r[u],d=f.length,m=s[u]=[],v,w=0;w<d;++w)(v=f[w])&&t.call(v,v.__data__,w,f)&&m.push(v);return new er(s,this._parents)}function km(t){return new Array(t.length)}function iv(){return new er(this._enter||this._groups.map(km),this._parents)}function au(t,r){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=r}au.prototype={constructor:au,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,r){return this._parent.insertBefore(t,r)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function sv(t){return function(){return t}}function av(t,r,i,s,u,f){for(var d=0,m,v=r.length,w=f.length;d<w;++d)(m=r[d])?(m.__data__=f[d],s[d]=m):i[d]=new au(t,f[d]);for(;d<v;++d)(m=r[d])&&(u[d]=m)}function lv(t,r,i,s,u,f,d){var m,v,w=new Map,b=r.length,x=f.length,S=new Array(b),C;for(m=0;m<b;++m)(v=r[m])&&(S[m]=C=d.call(v,v.__data__,m,r)+"",w.has(C)?u[m]=v:w.set(C,v));for(m=0;m<x;++m)C=d.call(t,f[m],m,f)+"",(v=w.get(C))?(s[m]=v,v.__data__=f[m],w.delete(C)):i[m]=new au(t,f[m]);for(m=0;m<b;++m)(v=r[m])&&w.get(S[m])===v&&(u[m]=v)}function uv(t){return t.__data__}function cv(t,r){if(!arguments.length)return Array.from(this,uv);var i=r?lv:av,s=this._parents,u=this._groups;typeof t!="function"&&(t=sv(t));for(var f=u.length,d=new Array(f),m=new Array(f),v=new Array(f),w=0;w<f;++w){var b=s[w],x=u[w],S=x.length,C=fv(t.call(b,b&&b.__data__,w,s)),j=C.length,M=m[w]=new Array(j),I=d[w]=new Array(j),A=v[w]=new Array(S);i(b,x,M,I,A,C,r);for(var V=0,P=0,R,q;V<j;++V)if(R=M[V]){for(V>=P&&(P=V+1);!(q=I[P])&&++P<j;);R._next=q||null}}return d=new er(d,s),d._enter=m,d._exit=v,d}function fv(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function dv(){return new er(this._exit||this._groups.map(km),this._parents)}function pv(t,r,i){var s=this.enter(),u=this,f=this.exit();return typeof t=="function"?(s=t(s),s&&(s=s.selection())):s=s.append(t+""),r!=null&&(u=r(u),u&&(u=u.selection())),i==null?f.remove():i(f),s&&u?s.merge(u).order():u}function hv(t){for(var r=t.selection?t.selection():t,i=this._groups,s=r._groups,u=i.length,f=s.length,d=Math.min(u,f),m=new Array(u),v=0;v<d;++v)for(var w=i[v],b=s[v],x=w.length,S=m[v]=new Array(x),C,j=0;j<x;++j)(C=w[j]||b[j])&&(S[j]=C);for(;v<u;++v)m[v]=i[v];return new er(m,this._parents)}function mv(){for(var t=this._groups,r=-1,i=t.length;++r<i;)for(var s=t[r],u=s.length-1,f=s[u],d;--u>=0;)(d=s[u])&&(f&&d.compareDocumentPosition(f)^4&&f.parentNode.insertBefore(d,f),f=d);return this}function gv(t){t||(t=yv);function r(x,S){return x&&S?t(x.__data__,S.__data__):!x-!S}for(var i=this._groups,s=i.length,u=new Array(s),f=0;f<s;++f){for(var d=i[f],m=d.length,v=u[f]=new Array(m),w,b=0;b<m;++b)(w=d[b])&&(v[b]=w);v.sort(r)}return new er(u,this._parents).order()}function yv(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function vv(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function xv(){return Array.from(this)}function wv(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var s=t[r],u=0,f=s.length;u<f;++u){var d=s[u];if(d)return d}return null}function _v(){let t=0;for(const r of this)++t;return t}function Sv(){return!this.node()}function bv(t){for(var r=this._groups,i=0,s=r.length;i<s;++i)for(var u=r[i],f=0,d=u.length,m;f<d;++f)(m=u[f])&&t.call(m,m.__data__,f,u);return this}function kv(t){return function(){this.removeAttribute(t)}}function Nv(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ev(t,r){return function(){this.setAttribute(t,r)}}function Cv(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function jv(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttribute(t):this.setAttribute(t,i)}}function Pv(t,r){return function(){var i=r.apply(this,arguments);i==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,i)}}function Tv(t,r){var i=bu(t);if(arguments.length<2){var s=this.node();return i.local?s.getAttributeNS(i.space,i.local):s.getAttribute(i)}return this.each((r==null?i.local?Nv:kv:typeof r=="function"?i.local?Pv:jv:i.local?Cv:Ev)(i,r))}function Nm(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Mv(t){return function(){this.style.removeProperty(t)}}function Iv(t,r,i){return function(){this.style.setProperty(t,r,i)}}function $v(t,r,i){return function(){var s=r.apply(this,arguments);s==null?this.style.removeProperty(t):this.style.setProperty(t,s,i)}}function Av(t,r,i){return arguments.length>1?this.each((r==null?Mv:typeof r=="function"?$v:Iv)(t,r,i??"")):Ps(this.node(),t)}function Ps(t,r){return t.style.getPropertyValue(r)||Nm(t).getComputedStyle(t,null).getPropertyValue(r)}function Ov(t){return function(){delete this[t]}}function Rv(t,r){return function(){this[t]=r}}function Dv(t,r){return function(){var i=r.apply(this,arguments);i==null?delete this[t]:this[t]=i}}function zv(t,r){return arguments.length>1?this.each((r==null?Ov:typeof r=="function"?Dv:Rv)(t,r)):this.node()[t]}function Em(t){return t.trim().split(/^|\s+/)}function Rf(t){return t.classList||new Cm(t)}function Cm(t){this._node=t,this._names=Em(t.getAttribute("class")||"")}Cm.prototype={add:function(t){var r=this._names.indexOf(t);r<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var r=this._names.indexOf(t);r>=0&&(this._names.splice(r,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function jm(t,r){for(var i=Rf(t),s=-1,u=r.length;++s<u;)i.add(r[s])}function Pm(t,r){for(var i=Rf(t),s=-1,u=r.length;++s<u;)i.remove(r[s])}function Lv(t){return function(){jm(this,t)}}function Fv(t){return function(){Pm(this,t)}}function Bv(t,r){return function(){(r.apply(this,arguments)?jm:Pm)(this,t)}}function Hv(t,r){var i=Em(t+"");if(arguments.length<2){for(var s=Rf(this.node()),u=-1,f=i.length;++u<f;)if(!s.contains(i[u]))return!1;return!0}return this.each((typeof r=="function"?Bv:r?Lv:Fv)(i,r))}function Vv(){this.textContent=""}function Uv(t){return function(){this.textContent=t}}function Kv(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function qv(t){return arguments.length?this.each(t==null?Vv:(typeof t=="function"?Kv:Uv)(t)):this.node().textContent}function Wv(){this.innerHTML=""}function Yv(t){return function(){this.innerHTML=t}}function Xv(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function Qv(t){return arguments.length?this.each(t==null?Wv:(typeof t=="function"?Xv:Yv)(t)):this.node().innerHTML}function Gv(){this.nextSibling&&this.parentNode.appendChild(this)}function Jv(){return this.each(Gv)}function Zv(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ex(){return this.each(Zv)}function tx(t){var r=typeof t=="function"?t:wm(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function nx(){return null}function rx(t,r){var i=typeof t=="function"?t:wm(t),s=r==null?nx:typeof r=="function"?r:Of(r);return this.select(function(){return this.insertBefore(i.apply(this,arguments),s.apply(this,arguments)||null)})}function ox(){var t=this.parentNode;t&&t.removeChild(this)}function ix(){return this.each(ox)}function sx(){var t=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function ax(){var t=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function lx(t){return this.select(t?ax:sx)}function ux(t){return arguments.length?this.property("__data__",t):this.node().__data__}function cx(t){return function(r){t.call(this,r,this.__data__)}}function fx(t){return t.trim().split(/^|\s+/).map(function(r){var i="",s=r.indexOf(".");return s>=0&&(i=r.slice(s+1),r=r.slice(0,s)),{type:r,name:i}})}function dx(t){return function(){var r=this.__on;if(r){for(var i=0,s=-1,u=r.length,f;i<u;++i)f=r[i],(!t.type||f.type===t.type)&&f.name===t.name?this.removeEventListener(f.type,f.listener,f.options):r[++s]=f;++s?r.length=s:delete this.__on}}}function px(t,r,i){return function(){var s=this.__on,u,f=cx(r);if(s){for(var d=0,m=s.length;d<m;++d)if((u=s[d]).type===t.type&&u.name===t.name){this.removeEventListener(u.type,u.listener,u.options),this.addEventListener(u.type,u.listener=f,u.options=i),u.value=r;return}}this.addEventListener(t.type,f,i),u={type:t.type,name:t.name,value:r,listener:f,options:i},s?s.push(u):this.__on=[u]}}function hx(t,r,i){var s=fx(t+""),u,f=s.length,d;if(arguments.length<2){var m=this.node().__on;if(m){for(var v=0,w=m.length,b;v<w;++v)for(u=0,b=m[v];u<f;++u)if((d=s[u]).type===b.type&&d.name===b.name)return b.value}return}for(m=r?px:dx,u=0;u<f;++u)this.each(m(s[u],r,i));return this}function Tm(t,r,i){var s=Nm(t),u=s.CustomEvent;typeof u=="function"?u=new u(r,i):(u=s.document.createEvent("Event"),i?(u.initEvent(r,i.bubbles,i.cancelable),u.detail=i.detail):u.initEvent(r,!1,!1)),t.dispatchEvent(u)}function mx(t,r){return function(){return Tm(this,t,r)}}function gx(t,r){return function(){return Tm(this,t,r.apply(this,arguments))}}function yx(t,r){return this.each((typeof r=="function"?gx:mx)(t,r))}function*vx(){for(var t=this._groups,r=0,i=t.length;r<i;++r)for(var s=t[r],u=0,f=s.length,d;u<f;++u)(d=s[u])&&(yield d)}var Mm=[null];function er(t,r){this._groups=t,this._parents=r}function Aa(){return new er([[document.documentElement]],Mm)}function xx(){return this}er.prototype=Aa.prototype={constructor:er,select:K0,selectAll:X0,selectChild:Z0,selectChildren:rv,filter:ov,data:cv,enter:iv,exit:dv,join:pv,merge:hv,selection:xx,order:mv,sort:gv,call:vv,nodes:xv,node:wv,size:_v,empty:Sv,each:bv,attr:Tv,style:Av,property:zv,classed:Hv,text:qv,html:Qv,raise:Jv,lower:ex,append:tx,insert:rx,remove:ix,clone:lx,datum:ux,on:hx,dispatch:yx,[Symbol.iterator]:vx};function Zn(t){return typeof t=="string"?new er([[document.querySelector(t)]],[document.documentElement]):new er([[t]],Mm)}function wx(t){let r;for(;r=t.sourceEvent;)t=r;return t}function Tr(t,r){if(t=wx(t),r===void 0&&(r=t.currentTarget),r){var i=r.ownerSVGElement||r;if(i.createSVGPoint){var s=i.createSVGPoint();return s.x=t.clientX,s.y=t.clientY,s=s.matrixTransform(r.getScreenCTM().inverse()),[s.x,s.y]}if(r.getBoundingClientRect){var u=r.getBoundingClientRect();return[t.clientX-u.left-r.clientLeft,t.clientY-u.top-r.clientTop]}}return[t.pageX,t.pageY]}const _x={passive:!1},ka={capture:!0,passive:!1};function ef(t){t.stopImmediatePropagation()}function Cs(t){t.preventDefault(),t.stopImmediatePropagation()}function Im(t){var r=t.document.documentElement,i=Zn(t).on("dragstart.drag",Cs,ka);"onselectstart"in r?i.on("selectstart.drag",Cs,ka):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function $m(t,r){var i=t.document.documentElement,s=Zn(t).on("dragstart.drag",null);r&&(s.on("click.drag",Cs,ka),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in i?s.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const Ul=t=>()=>t;function wf(t,{sourceEvent:r,subject:i,target:s,identifier:u,active:f,x:d,y:m,dx:v,dy:w,dispatch:b}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:u,enumerable:!0,configurable:!0},active:{value:f,enumerable:!0,configurable:!0},x:{value:d,enumerable:!0,configurable:!0},y:{value:m,enumerable:!0,configurable:!0},dx:{value:v,enumerable:!0,configurable:!0},dy:{value:w,enumerable:!0,configurable:!0},_:{value:b}})}wf.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function Sx(t){return!t.ctrlKey&&!t.button}function bx(){return this.parentNode}function kx(t,r){return r??{x:t.x,y:t.y}}function Nx(){return navigator.maxTouchPoints||"ontouchstart"in this}function Am(){var t=Sx,r=bx,i=kx,s=Nx,u={},f=Su("start","drag","end"),d=0,m,v,w,b,x=0;function S(R){R.on("mousedown.drag",C).filter(s).on("touchstart.drag",I).on("touchmove.drag",A,_x).on("touchend.drag touchcancel.drag",V).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function C(R,q){if(!(b||!t.call(this,R,q))){var B=P(this,r.call(this,R,q),R,q,"mouse");B&&(Zn(R.view).on("mousemove.drag",j,ka).on("mouseup.drag",M,ka),Im(R.view),ef(R),w=!1,m=R.clientX,v=R.clientY,B("start",R))}}function j(R){if(Cs(R),!w){var q=R.clientX-m,B=R.clientY-v;w=q*q+B*B>x}u.mouse("drag",R)}function M(R){Zn(R.view).on("mousemove.drag mouseup.drag",null),$m(R.view,w),Cs(R),u.mouse("end",R)}function I(R,q){if(t.call(this,R,q)){var B=R.changedTouches,X=r.call(this,R,q),fe=B.length,he,Se;for(he=0;he<fe;++he)(Se=P(this,X,R,q,B[he].identifier,B[he]))&&(ef(R),Se("start",R,B[he]))}}function A(R){var q=R.changedTouches,B=q.length,X,fe;for(X=0;X<B;++X)(fe=u[q[X].identifier])&&(Cs(R),fe("drag",R,q[X]))}function V(R){var q=R.changedTouches,B=q.length,X,fe;for(b&&clearTimeout(b),b=setTimeout(function(){b=null},500),X=0;X<B;++X)(fe=u[q[X].identifier])&&(ef(R),fe("end",R,q[X]))}function P(R,q,B,X,fe,he){var Se=f.copy(),K=Tr(he||B,q),ce,xe,D;if((D=i.call(R,new wf("beforestart",{sourceEvent:B,target:S,identifier:fe,active:d,x:K[0],y:K[1],dx:0,dy:0,dispatch:Se}),X))!=null)return ce=D.x-K[0]||0,xe=D.y-K[1]||0,function le(Q,se,L){var U=K,F;switch(Q){case"start":u[fe]=le,F=d++;break;case"end":delete u[fe],--d;case"drag":K=Tr(L||se,q),F=d;break}Se.call(Q,R,new wf(Q,{sourceEvent:se,subject:D,target:S,identifier:fe,active:F,x:K[0]+ce,y:K[1]+xe,dx:K[0]-U[0],dy:K[1]-U[1],dispatch:Se}),X)}}return S.filter=function(R){return arguments.length?(t=typeof R=="function"?R:Ul(!!R),S):t},S.container=function(R){return arguments.length?(r=typeof R=="function"?R:Ul(R),S):r},S.subject=function(R){return arguments.length?(i=typeof R=="function"?R:Ul(R),S):i},S.touchable=function(R){return arguments.length?(s=typeof R=="function"?R:Ul(!!R),S):s},S.on=function(){var R=f.on.apply(f,arguments);return R===f?S:R},S.clickDistance=function(R){return arguments.length?(x=(R=+R)*R,S):Math.sqrt(x)},S}function Df(t,r,i){t.prototype=r.prototype=i,i.constructor=t}function Om(t,r){var i=Object.create(t.prototype);for(var s in r)i[s]=r[s];return i}function Oa(){}var Na=.7,lu=1/Na,js="\\s*([+-]?\\d+)\\s*",Ea="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ex=/^#([0-9a-f]{3,8})$/,Cx=new RegExp(`^rgb\\(${js},${js},${js}\\)$`),jx=new RegExp(`^rgb\\(${Xr},${Xr},${Xr}\\)$`),Px=new RegExp(`^rgba\\(${js},${js},${js},${Ea}\\)$`),Tx=new RegExp(`^rgba\\(${Xr},${Xr},${Xr},${Ea}\\)$`),Mx=new RegExp(`^hsl\\(${Ea},${Xr},${Xr}\\)$`),Ix=new RegExp(`^hsla\\(${Ea},${Xr},${Xr},${Ea}\\)$`),rh={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};Df(Oa,Di,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:oh,formatHex:oh,formatHex8:$x,formatHsl:Ax,formatRgb:ih,toString:ih});function oh(){return this.rgb().formatHex()}function $x(){return this.rgb().formatHex8()}function Ax(){return Rm(this).formatHsl()}function ih(){return this.rgb().formatRgb()}function Di(t){var r,i;return t=(t+"").trim().toLowerCase(),(r=Ex.exec(t))?(i=r[1].length,r=parseInt(r[1],16),i===6?sh(r):i===3?new Bn(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):i===8?Kl(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):i===4?Kl(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=Cx.exec(t))?new Bn(r[1],r[2],r[3],1):(r=jx.exec(t))?new Bn(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=Px.exec(t))?Kl(r[1],r[2],r[3],r[4]):(r=Tx.exec(t))?Kl(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=Mx.exec(t))?uh(r[1],r[2]/100,r[3]/100,1):(r=Ix.exec(t))?uh(r[1],r[2]/100,r[3]/100,r[4]):rh.hasOwnProperty(t)?sh(rh[t]):t==="transparent"?new Bn(NaN,NaN,NaN,0):null}function sh(t){return new Bn(t>>16&255,t>>8&255,t&255,1)}function Kl(t,r,i,s){return s<=0&&(t=r=i=NaN),new Bn(t,r,i,s)}function Ox(t){return t instanceof Oa||(t=Di(t)),t?(t=t.rgb(),new Bn(t.r,t.g,t.b,t.opacity)):new Bn}function _f(t,r,i,s){return arguments.length===1?Ox(t):new Bn(t,r,i,s??1)}function Bn(t,r,i,s){this.r=+t,this.g=+r,this.b=+i,this.opacity=+s}Df(Bn,_f,Om(Oa,{brighter(t){return t=t==null?lu:Math.pow(lu,t),new Bn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Na:Math.pow(Na,t),new Bn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Bn(Oi(this.r),Oi(this.g),Oi(this.b),uu(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:ah,formatHex:ah,formatHex8:Rx,formatRgb:lh,toString:lh}));function ah(){return`#${Ai(this.r)}${Ai(this.g)}${Ai(this.b)}`}function Rx(){return`#${Ai(this.r)}${Ai(this.g)}${Ai(this.b)}${Ai((isNaN(this.opacity)?1:this.opacity)*255)}`}function lh(){const t=uu(this.opacity);return`${t===1?"rgb(":"rgba("}${Oi(this.r)}, ${Oi(this.g)}, ${Oi(this.b)}${t===1?")":`, ${t})`}`}function uu(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Oi(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ai(t){return t=Oi(t),(t<16?"0":"")+t.toString(16)}function uh(t,r,i,s){return s<=0?t=r=i=NaN:i<=0||i>=1?t=r=NaN:r<=0&&(t=NaN),new Mr(t,r,i,s)}function Rm(t){if(t instanceof Mr)return new Mr(t.h,t.s,t.l,t.opacity);if(t instanceof Oa||(t=Di(t)),!t)return new Mr;if(t instanceof Mr)return t;t=t.rgb();var r=t.r/255,i=t.g/255,s=t.b/255,u=Math.min(r,i,s),f=Math.max(r,i,s),d=NaN,m=f-u,v=(f+u)/2;return m?(r===f?d=(i-s)/m+(i<s)*6:i===f?d=(s-r)/m+2:d=(r-i)/m+4,m/=v<.5?f+u:2-f-u,d*=60):m=v>0&&v<1?0:d,new Mr(d,m,v,t.opacity)}function Dx(t,r,i,s){return arguments.length===1?Rm(t):new Mr(t,r,i,s??1)}function Mr(t,r,i,s){this.h=+t,this.s=+r,this.l=+i,this.opacity=+s}Df(Mr,Dx,Om(Oa,{brighter(t){return t=t==null?lu:Math.pow(lu,t),new Mr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Na:Math.pow(Na,t),new Mr(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,r=isNaN(t)||isNaN(this.s)?0:this.s,i=this.l,s=i+(i<.5?i:1-i)*r,u=2*i-s;return new Bn(tf(t>=240?t-240:t+120,u,s),tf(t,u,s),tf(t<120?t+240:t-120,u,s),this.opacity)},clamp(){return new Mr(ch(this.h),ql(this.s),ql(this.l),uu(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 t=uu(this.opacity);return`${t===1?"hsl(":"hsla("}${ch(this.h)}, ${ql(this.s)*100}%, ${ql(this.l)*100}%${t===1?")":`, ${t})`}`}}));function ch(t){return t=(t||0)%360,t<0?t+360:t}function ql(t){return Math.max(0,Math.min(1,t||0))}function tf(t,r,i){return(t<60?r+(i-r)*t/60:t<180?i:t<240?r+(i-r)*(240-t)/60:r)*255}const zf=t=>()=>t;function zx(t,r){return function(i){return t+i*r}}function Lx(t,r,i){return t=Math.pow(t,i),r=Math.pow(r,i)-t,i=1/i,function(s){return Math.pow(t+s*r,i)}}function Fx(t){return(t=+t)==1?Dm:function(r,i){return i-r?Lx(r,i,t):zf(isNaN(r)?i:r)}}function Dm(t,r){var i=r-t;return i?zx(t,i):zf(isNaN(t)?r:t)}const cu=(function t(r){var i=Fx(r);function s(u,f){var d=i((u=_f(u)).r,(f=_f(f)).r),m=i(u.g,f.g),v=i(u.b,f.b),w=Dm(u.opacity,f.opacity);return function(b){return u.r=d(b),u.g=m(b),u.b=v(b),u.opacity=w(b),u+""}}return s.gamma=t,s})(1);function Bx(t,r){r||(r=[]);var i=t?Math.min(r.length,t.length):0,s=r.slice(),u;return function(f){for(u=0;u<i;++u)s[u]=t[u]*(1-f)+r[u]*f;return s}}function Hx(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Vx(t,r){var i=r?r.length:0,s=t?Math.min(i,t.length):0,u=new Array(s),f=new Array(i),d;for(d=0;d<s;++d)u[d]=Sa(t[d],r[d]);for(;d<i;++d)f[d]=r[d];return function(m){for(d=0;d<s;++d)f[d]=u[d](m);return f}}function Ux(t,r){var i=new Date;return t=+t,r=+r,function(s){return i.setTime(t*(1-s)+r*s),i}}function Yr(t,r){return t=+t,r=+r,function(i){return t*(1-i)+r*i}}function Kx(t,r){var i={},s={},u;(t===null||typeof t!="object")&&(t={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in t?i[u]=Sa(t[u],r[u]):s[u]=r[u];return function(f){for(u in i)s[u]=i[u](f);return s}}var Sf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,nf=new RegExp(Sf.source,"g");function qx(t){return function(){return t}}function Wx(t){return function(r){return t(r)+""}}function zm(t,r){var i=Sf.lastIndex=nf.lastIndex=0,s,u,f,d=-1,m=[],v=[];for(t=t+"",r=r+"";(s=Sf.exec(t))&&(u=nf.exec(r));)(f=u.index)>i&&(f=r.slice(i,f),m[d]?m[d]+=f:m[++d]=f),(s=s[0])===(u=u[0])?m[d]?m[d]+=u:m[++d]=u:(m[++d]=null,v.push({i:d,x:Yr(s,u)})),i=nf.lastIndex;return i<r.length&&(f=r.slice(i),m[d]?m[d]+=f:m[++d]=f),m.length<2?v[0]?Wx(v[0].x):qx(r):(r=v.length,function(w){for(var b=0,x;b<r;++b)m[(x=v[b]).i]=x.x(w);return m.join("")})}function Sa(t,r){var i=typeof r,s;return r==null||i==="boolean"?zf(r):(i==="number"?Yr:i==="string"?(s=Di(r))?(r=s,cu):zm:r instanceof Di?cu:r instanceof Date?Ux:Hx(r)?Bx:Array.isArray(r)?Vx:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Kx:Yr)(t,r)}var fh=180/Math.PI,bf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Lm(t,r,i,s,u,f){var d,m,v;return(d=Math.sqrt(t*t+r*r))&&(t/=d,r/=d),(v=t*i+r*s)&&(i-=t*v,s-=r*v),(m=Math.sqrt(i*i+s*s))&&(i/=m,s/=m,v/=m),t*s<r*i&&(t=-t,r=-r,v=-v,d=-d),{translateX:u,translateY:f,rotate:Math.atan2(r,t)*fh,skewX:Math.atan(v)*fh,scaleX:d,scaleY:m}}var Wl;function Yx(t){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return r.isIdentity?bf:Lm(r.a,r.b,r.c,r.d,r.e,r.f)}function Xx(t){return t==null||(Wl||(Wl=document.createElementNS("http://www.w3.org/2000/svg","g")),Wl.setAttribute("transform",t),!(t=Wl.transform.baseVal.consolidate()))?bf:(t=t.matrix,Lm(t.a,t.b,t.c,t.d,t.e,t.f))}function Fm(t,r,i,s){function u(w){return w.length?w.pop()+" ":""}function f(w,b,x,S,C,j){if(w!==x||b!==S){var M=C.push("translate(",null,r,null,i);j.push({i:M-4,x:Yr(w,x)},{i:M-2,x:Yr(b,S)})}else(x||S)&&C.push("translate("+x+r+S+i)}function d(w,b,x,S){w!==b?(w-b>180?b+=360:b-w>180&&(w+=360),S.push({i:x.push(u(x)+"rotate(",null,s)-2,x:Yr(w,b)})):b&&x.push(u(x)+"rotate("+b+s)}function m(w,b,x,S){w!==b?S.push({i:x.push(u(x)+"skewX(",null,s)-2,x:Yr(w,b)}):b&&x.push(u(x)+"skewX("+b+s)}function v(w,b,x,S,C,j){if(w!==x||b!==S){var M=C.push(u(C)+"scale(",null,",",null,")");j.push({i:M-4,x:Yr(w,x)},{i:M-2,x:Yr(b,S)})}else(x!==1||S!==1)&&C.push(u(C)+"scale("+x+","+S+")")}return function(w,b){var x=[],S=[];return w=t(w),b=t(b),f(w.translateX,w.translateY,b.translateX,b.translateY,x,S),d(w.rotate,b.rotate,x,S),m(w.skewX,b.skewX,x,S),v(w.scaleX,w.scaleY,b.scaleX,b.scaleY,x,S),w=b=null,function(C){for(var j=-1,M=S.length,I;++j<M;)x[(I=S[j]).i]=I.x(C);return x.join("")}}}var Qx=Fm(Yx,"px, ","px)","deg)"),Gx=Fm(Xx,", ",")",")"),Jx=1e-12;function dh(t){return((t=Math.exp(t))+1/t)/2}function Zx(t){return((t=Math.exp(t))-1/t)/2}function ew(t){return((t=Math.exp(2*t))-1)/(t+1)}const tu=(function t(r,i,s){function u(f,d){var m=f[0],v=f[1],w=f[2],b=d[0],x=d[1],S=d[2],C=b-m,j=x-v,M=C*C+j*j,I,A;if(M<Jx)A=Math.log(S/w)/r,I=function(X){return[m+X*C,v+X*j,w*Math.exp(r*X*A)]};else{var V=Math.sqrt(M),P=(S*S-w*w+s*M)/(2*w*i*V),R=(S*S-w*w-s*M)/(2*S*i*V),q=Math.log(Math.sqrt(P*P+1)-P),B=Math.log(Math.sqrt(R*R+1)-R);A=(B-q)/r,I=function(X){var fe=X*A,he=dh(q),Se=w/(i*V)*(he*ew(r*fe+q)-Zx(q));return[m+Se*C,v+Se*j,w*he/dh(r*fe+q)]}}return I.duration=A*1e3*r/Math.SQRT2,I}return u.rho=function(f){var d=Math.max(.001,+f),m=d*d,v=m*m;return t(d,m,v)},u})(Math.SQRT2,2,4);var Ts=0,wa=0,va=0,Bm=1e3,fu,_a,du=0,zi=0,ku=0,Ca=typeof performance=="object"&&performance.now?performance:Date,Hm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Lf(){return zi||(Hm(tw),zi=Ca.now()+ku)}function tw(){zi=0}function pu(){this._call=this._time=this._next=null}pu.prototype=Vm.prototype={constructor:pu,restart:function(t,r,i){if(typeof t!="function")throw new TypeError("callback is not a function");i=(i==null?Lf():+i)+(r==null?0:+r),!this._next&&_a!==this&&(_a?_a._next=this:fu=this,_a=this),this._call=t,this._time=i,kf()},stop:function(){this._call&&(this._call=null,this._time=1/0,kf())}};function Vm(t,r,i){var s=new pu;return s.restart(t,r,i),s}function nw(){Lf(),++Ts;for(var t=fu,r;t;)(r=zi-t._time)>=0&&t._call.call(void 0,r),t=t._next;--Ts}function ph(){zi=(du=Ca.now())+ku,Ts=wa=0;try{nw()}finally{Ts=0,ow(),zi=0}}function rw(){var t=Ca.now(),r=t-du;r>Bm&&(ku-=r,du=t)}function ow(){for(var t,r=fu,i,s=1/0;r;)r._call?(s>r._time&&(s=r._time),t=r,r=r._next):(i=r._next,r._next=null,r=t?t._next=i:fu=i);_a=t,kf(s)}function kf(t){if(!Ts){wa&&(wa=clearTimeout(wa));var r=t-zi;r>24?(t<1/0&&(wa=setTimeout(ph,t-Ca.now()-ku)),va&&(va=clearInterval(va))):(va||(du=Ca.now(),va=setInterval(rw,Bm)),Ts=1,Hm(ph))}}function hh(t,r,i){var s=new pu;return r=r==null?0:+r,s.restart(u=>{s.stop(),t(u+r)},r,i),s}var iw=Su("start","end","cancel","interrupt"),sw=[],Um=0,mh=1,Nf=2,nu=3,gh=4,Ef=5,ru=6;function Nu(t,r,i,s,u,f){var d=t.__transition;if(!d)t.__transition={};else if(i in d)return;aw(t,i,{name:r,index:s,group:u,on:iw,tween:sw,time:f.time,delay:f.delay,duration:f.duration,ease:f.ease,timer:null,state:Um})}function Ff(t,r){var i=Ar(t,r);if(i.state>Um)throw new Error("too late; already scheduled");return i}function Jr(t,r){var i=Ar(t,r);if(i.state>nu)throw new Error("too late; already running");return i}function Ar(t,r){var i=t.__transition;if(!i||!(i=i[r]))throw new Error("transition not found");return i}function aw(t,r,i){var s=t.__transition,u;s[r]=i,i.timer=Vm(f,0,i.time);function f(w){i.state=mh,i.timer.restart(d,i.delay,i.time),i.delay<=w&&d(w-i.delay)}function d(w){var b,x,S,C;if(i.state!==mh)return v();for(b in s)if(C=s[b],C.name===i.name){if(C.state===nu)return hh(d);C.state===gh?(C.state=ru,C.timer.stop(),C.on.call("interrupt",t,t.__data__,C.index,C.group),delete s[b]):+b<r&&(C.state=ru,C.timer.stop(),C.on.call("cancel",t,t.__data__,C.index,C.group),delete s[b])}if(hh(function(){i.state===nu&&(i.state=gh,i.timer.restart(m,i.delay,i.time),m(w))}),i.state=Nf,i.on.call("start",t,t.__data__,i.index,i.group),i.state===Nf){for(i.state=nu,u=new Array(S=i.tween.length),b=0,x=-1;b<S;++b)(C=i.tween[b].value.call(t,t.__data__,i.index,i.group))&&(u[++x]=C);u.length=x+1}}function m(w){for(var b=w<i.duration?i.ease.call(null,w/i.duration):(i.timer.restart(v),i.state=Ef,1),x=-1,S=u.length;++x<S;)u[x].call(t,b);i.state===Ef&&(i.on.call("end",t,t.__data__,i.index,i.group),v())}function v(){i.state=ru,i.timer.stop(),delete s[r];for(var w in s)return;delete t.__transition}}function ou(t,r){var i=t.__transition,s,u,f=!0,d;if(i){r=r==null?null:r+"";for(d in i){if((s=i[d]).name!==r){f=!1;continue}u=s.state>Nf&&s.state<Ef,s.state=ru,s.timer.stop(),s.on.call(u?"interrupt":"cancel",t,t.__data__,s.index,s.group),delete i[d]}f&&delete t.__transition}}function lw(t){return this.each(function(){ou(this,t)})}function uw(t,r){var i,s;return function(){var u=Jr(this,t),f=u.tween;if(f!==i){s=i=f;for(var d=0,m=s.length;d<m;++d)if(s[d].name===r){s=s.slice(),s.splice(d,1);break}}u.tween=s}}function cw(t,r,i){var s,u;if(typeof i!="function")throw new Error;return function(){var f=Jr(this,t),d=f.tween;if(d!==s){u=(s=d).slice();for(var m={name:r,value:i},v=0,w=u.length;v<w;++v)if(u[v].name===r){u[v]=m;break}v===w&&u.push(m)}f.tween=u}}function fw(t,r){var i=this._id;if(t+="",arguments.length<2){for(var s=Ar(this.node(),i).tween,u=0,f=s.length,d;u<f;++u)if((d=s[u]).name===t)return d.value;return null}return this.each((r==null?uw:cw)(i,t,r))}function Bf(t,r,i){var s=t._id;return t.each(function(){var u=Jr(this,s);(u.value||(u.value={}))[r]=i.apply(this,arguments)}),function(u){return Ar(u,s).value[r]}}function Km(t,r){var i;return(typeof r=="number"?Yr:r instanceof Di?cu:(i=Di(r))?(r=i,cu):zm)(t,r)}function dw(t){return function(){this.removeAttribute(t)}}function pw(t){return function(){this.removeAttributeNS(t.space,t.local)}}function hw(t,r,i){var s,u=i+"",f;return function(){var d=this.getAttribute(t);return d===u?null:d===s?f:f=r(s=d,i)}}function mw(t,r,i){var s,u=i+"",f;return function(){var d=this.getAttributeNS(t.space,t.local);return d===u?null:d===s?f:f=r(s=d,i)}}function gw(t,r,i){var s,u,f;return function(){var d,m=i(this),v;return m==null?void this.removeAttribute(t):(d=this.getAttribute(t),v=m+"",d===v?null:d===s&&v===u?f:(u=v,f=r(s=d,m)))}}function yw(t,r,i){var s,u,f;return function(){var d,m=i(this),v;return m==null?void this.removeAttributeNS(t.space,t.local):(d=this.getAttributeNS(t.space,t.local),v=m+"",d===v?null:d===s&&v===u?f:(u=v,f=r(s=d,m)))}}function vw(t,r){var i=bu(t),s=i==="transform"?Gx:Km;return this.attrTween(t,typeof r=="function"?(i.local?yw:gw)(i,s,Bf(this,"attr."+t,r)):r==null?(i.local?pw:dw)(i):(i.local?mw:hw)(i,s,r))}function xw(t,r){return function(i){this.setAttribute(t,r.call(this,i))}}function ww(t,r){return function(i){this.setAttributeNS(t.space,t.local,r.call(this,i))}}function _w(t,r){var i,s;function u(){var f=r.apply(this,arguments);return f!==s&&(i=(s=f)&&ww(t,f)),i}return u._value=r,u}function Sw(t,r){var i,s;function u(){var f=r.apply(this,arguments);return f!==s&&(i=(s=f)&&xw(t,f)),i}return u._value=r,u}function bw(t,r){var i="attr."+t;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(r==null)return this.tween(i,null);if(typeof r!="function")throw new Error;var s=bu(t);return this.tween(i,(s.local?_w:Sw)(s,r))}function kw(t,r){return function(){Ff(this,t).delay=+r.apply(this,arguments)}}function Nw(t,r){return r=+r,function(){Ff(this,t).delay=r}}function Ew(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?kw:Nw)(r,t)):Ar(this.node(),r).delay}function Cw(t,r){return function(){Jr(this,t).duration=+r.apply(this,arguments)}}function jw(t,r){return r=+r,function(){Jr(this,t).duration=r}}function Pw(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?Cw:jw)(r,t)):Ar(this.node(),r).duration}function Tw(t,r){if(typeof r!="function")throw new Error;return function(){Jr(this,t).ease=r}}function Mw(t){var r=this._id;return arguments.length?this.each(Tw(r,t)):Ar(this.node(),r).ease}function Iw(t,r){return function(){var i=r.apply(this,arguments);if(typeof i!="function")throw new Error;Jr(this,t).ease=i}}function $w(t){if(typeof t!="function")throw new Error;return this.each(Iw(this._id,t))}function Aw(t){typeof t!="function"&&(t=Sm(t));for(var r=this._groups,i=r.length,s=new Array(i),u=0;u<i;++u)for(var f=r[u],d=f.length,m=s[u]=[],v,w=0;w<d;++w)(v=f[w])&&t.call(v,v.__data__,w,f)&&m.push(v);return new To(s,this._parents,this._name,this._id)}function Ow(t){if(t._id!==this._id)throw new Error;for(var r=this._groups,i=t._groups,s=r.length,u=i.length,f=Math.min(s,u),d=new Array(s),m=0;m<f;++m)for(var v=r[m],w=i[m],b=v.length,x=d[m]=new Array(b),S,C=0;C<b;++C)(S=v[C]||w[C])&&(x[C]=S);for(;m<s;++m)d[m]=r[m];return new To(d,this._parents,this._name,this._id)}function Rw(t){return(t+"").trim().split(/^|\s+/).every(function(r){var i=r.indexOf(".");return i>=0&&(r=r.slice(0,i)),!r||r==="start"})}function Dw(t,r,i){var s,u,f=Rw(r)?Ff:Jr;return function(){var d=f(this,t),m=d.on;m!==s&&(u=(s=m).copy()).on(r,i),d.on=u}}function zw(t,r){var i=this._id;return arguments.length<2?Ar(this.node(),i).on.on(t):this.each(Dw(i,t,r))}function Lw(t){return function(){var r=this.parentNode;for(var i in this.__transition)if(+i!==t)return;r&&r.removeChild(this)}}function Fw(){return this.on("end.remove",Lw(this._id))}function Bw(t){var r=this._name,i=this._id;typeof t!="function"&&(t=Of(t));for(var s=this._groups,u=s.length,f=new Array(u),d=0;d<u;++d)for(var m=s[d],v=m.length,w=f[d]=new Array(v),b,x,S=0;S<v;++S)(b=m[S])&&(x=t.call(b,b.__data__,S,m))&&("__data__"in b&&(x.__data__=b.__data__),w[S]=x,Nu(w[S],r,i,S,w,Ar(b,i)));return new To(f,this._parents,r,i)}function Hw(t){var r=this._name,i=this._id;typeof t!="function"&&(t=_m(t));for(var s=this._groups,u=s.length,f=[],d=[],m=0;m<u;++m)for(var v=s[m],w=v.length,b,x=0;x<w;++x)if(b=v[x]){for(var S=t.call(b,b.__data__,x,v),C,j=Ar(b,i),M=0,I=S.length;M<I;++M)(C=S[M])&&Nu(C,r,i,M,S,j);f.push(S),d.push(b)}return new To(f,d,r,i)}var Vw=Aa.prototype.constructor;function Uw(){return new Vw(this._groups,this._parents)}function Kw(t,r){var i,s,u;return function(){var f=Ps(this,t),d=(this.style.removeProperty(t),Ps(this,t));return f===d?null:f===i&&d===s?u:u=r(i=f,s=d)}}function qm(t){return function(){this.style.removeProperty(t)}}function qw(t,r,i){var s,u=i+"",f;return function(){var d=Ps(this,t);return d===u?null:d===s?f:f=r(s=d,i)}}function Ww(t,r,i){var s,u,f;return function(){var d=Ps(this,t),m=i(this),v=m+"";return m==null&&(v=m=(this.style.removeProperty(t),Ps(this,t))),d===v?null:d===s&&v===u?f:(u=v,f=r(s=d,m))}}function Yw(t,r){var i,s,u,f="style."+r,d="end."+f,m;return function(){var v=Jr(this,t),w=v.on,b=v.value[f]==null?m||(m=qm(r)):void 0;(w!==i||u!==b)&&(s=(i=w).copy()).on(d,u=b),v.on=s}}function Xw(t,r,i){var s=(t+="")=="transform"?Qx:Km;return r==null?this.styleTween(t,Kw(t,s)).on("end.style."+t,qm(t)):typeof r=="function"?this.styleTween(t,Ww(t,s,Bf(this,"style."+t,r))).each(Yw(this._id,t)):this.styleTween(t,qw(t,s,r),i).on("end.style."+t,null)}function Qw(t,r,i){return function(s){this.style.setProperty(t,r.call(this,s),i)}}function Gw(t,r,i){var s,u;function f(){var d=r.apply(this,arguments);return d!==u&&(s=(u=d)&&Qw(t,d,i)),s}return f._value=r,f}function Jw(t,r,i){var s="style."+(t+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(r==null)return this.tween(s,null);if(typeof r!="function")throw new Error;return this.tween(s,Gw(t,r,i??""))}function Zw(t){return function(){this.textContent=t}}function e1(t){return function(){var r=t(this);this.textContent=r??""}}function t1(t){return this.tween("text",typeof t=="function"?e1(Bf(this,"text",t)):Zw(t==null?"":t+""))}function n1(t){return function(r){this.textContent=t.call(this,r)}}function r1(t){var r,i;function s(){var u=t.apply(this,arguments);return u!==i&&(r=(i=u)&&n1(u)),r}return s._value=t,s}function o1(t){var r="text";if(arguments.length<1)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,r1(t))}function i1(){for(var t=this._name,r=this._id,i=Wm(),s=this._groups,u=s.length,f=0;f<u;++f)for(var d=s[f],m=d.length,v,w=0;w<m;++w)if(v=d[w]){var b=Ar(v,r);Nu(v,t,i,w,d,{time:b.time+b.delay+b.duration,delay:0,duration:b.duration,ease:b.ease})}return new To(s,this._parents,t,i)}function s1(){var t,r,i=this,s=i._id,u=i.size();return new Promise(function(f,d){var m={value:d},v={value:function(){--u===0&&f()}};i.each(function(){var w=Jr(this,s),b=w.on;b!==t&&(r=(t=b).copy(),r._.cancel.push(m),r._.interrupt.push(m),r._.end.push(v)),w.on=r}),u===0&&f()})}var a1=0;function To(t,r,i,s){this._groups=t,this._parents=r,this._name=i,this._id=s}function Wm(){return++a1}var Co=Aa.prototype;To.prototype={constructor:To,select:Bw,selectAll:Hw,selectChild:Co.selectChild,selectChildren:Co.selectChildren,filter:Aw,merge:Ow,selection:Uw,transition:i1,call:Co.call,nodes:Co.nodes,node:Co.node,size:Co.size,empty:Co.empty,each:Co.each,on:zw,attr:vw,attrTween:bw,style:Xw,styleTween:Jw,text:t1,textTween:o1,remove:Fw,tween:fw,delay:Ew,duration:Pw,ease:Mw,easeVarying:$w,end:s1,[Symbol.iterator]:Co[Symbol.iterator]};function l1(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var u1={time:null,delay:0,duration:250,ease:l1};function c1(t,r){for(var i;!(i=t.__transition)||!(i=i[r]);)if(!(t=t.parentNode))throw new Error(`transition ${r} not found`);return i}function f1(t){var r,i;t instanceof To?(r=t._id,t=t._name):(r=Wm(),(i=u1).time=Lf(),t=t==null?null:t+"");for(var s=this._groups,u=s.length,f=0;f<u;++f)for(var d=s[f],m=d.length,v,w=0;w<m;++w)(v=d[w])&&Nu(v,t,r,w,d,i||c1(v,r));return new To(s,this._parents,t,r)}Aa.prototype.interrupt=lw;Aa.prototype.transition=f1;const Yl=t=>()=>t;function d1(t,{sourceEvent:r,target:i,transform:s,dispatch:u}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:u}})}function jo(t,r,i){this.k=t,this.x=r,this.y=i}jo.prototype={constructor:jo,scale:function(t){return t===1?this:new jo(this.k*t,this.x,this.y)},translate:function(t,r){return t===0&r===0?this:new jo(this.k,this.x+this.k*t,this.y+this.k*r)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Eu=new jo(1,0,0);Ym.prototype=jo.prototype;function Ym(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Eu;return t.__zoom}function rf(t){t.stopImmediatePropagation()}function xa(t){t.preventDefault(),t.stopImmediatePropagation()}function p1(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function h1(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function yh(){return this.__zoom||Eu}function m1(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function g1(){return navigator.maxTouchPoints||"ontouchstart"in this}function y1(t,r,i){var s=t.invertX(r[0][0])-i[0][0],u=t.invertX(r[1][0])-i[1][0],f=t.invertY(r[0][1])-i[0][1],d=t.invertY(r[1][1])-i[1][1];return t.translate(u>s?(s+u)/2:Math.min(0,s)||Math.max(0,u),d>f?(f+d)/2:Math.min(0,f)||Math.max(0,d))}function Xm(){var t=p1,r=h1,i=y1,s=m1,u=g1,f=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],m=250,v=tu,w=Su("start","zoom","end"),b,x,S,C=500,j=150,M=0,I=10;function A(D){D.property("__zoom",yh).on("wheel.zoom",fe,{passive:!1}).on("mousedown.zoom",he).on("dblclick.zoom",Se).filter(u).on("touchstart.zoom",K).on("touchmove.zoom",ce).on("touchend.zoom touchcancel.zoom",xe).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}A.transform=function(D,le,Q,se){var L=D.selection?D.selection():D;L.property("__zoom",yh),D!==L?q(D,le,Q,se):L.interrupt().each(function(){B(this,arguments).event(se).start().zoom(null,typeof le=="function"?le.apply(this,arguments):le).end()})},A.scaleBy=function(D,le,Q,se){A.scaleTo(D,function(){var L=this.__zoom.k,U=typeof le=="function"?le.apply(this,arguments):le;return L*U},Q,se)},A.scaleTo=function(D,le,Q,se){A.transform(D,function(){var L=r.apply(this,arguments),U=this.__zoom,F=Q==null?R(L):typeof Q=="function"?Q.apply(this,arguments):Q,$=U.invert(F),H=typeof le=="function"?le.apply(this,arguments):le;return i(P(V(U,H),F,$),L,d)},Q,se)},A.translateBy=function(D,le,Q,se){A.transform(D,function(){return i(this.__zoom.translate(typeof le=="function"?le.apply(this,arguments):le,typeof Q=="function"?Q.apply(this,arguments):Q),r.apply(this,arguments),d)},null,se)},A.translateTo=function(D,le,Q,se,L){A.transform(D,function(){var U=r.apply(this,arguments),F=this.__zoom,$=se==null?R(U):typeof se=="function"?se.apply(this,arguments):se;return i(Eu.translate($[0],$[1]).scale(F.k).translate(typeof le=="function"?-le.apply(this,arguments):-le,typeof Q=="function"?-Q.apply(this,arguments):-Q),U,d)},se,L)};function V(D,le){return le=Math.max(f[0],Math.min(f[1],le)),le===D.k?D:new jo(le,D.x,D.y)}function P(D,le,Q){var se=le[0]-Q[0]*D.k,L=le[1]-Q[1]*D.k;return se===D.x&&L===D.y?D:new jo(D.k,se,L)}function R(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function q(D,le,Q,se){D.on("start.zoom",function(){B(this,arguments).event(se).start()}).on("interrupt.zoom end.zoom",function(){B(this,arguments).event(se).end()}).tween("zoom",function(){var L=this,U=arguments,F=B(L,U).event(se),$=r.apply(L,U),H=Q==null?R($):typeof Q=="function"?Q.apply(L,U):Q,we=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),be=L.__zoom,Te=typeof le=="function"?le.apply(L,U):le,$e=v(be.invert(H).concat(we/be.k),Te.invert(H).concat(we/Te.k));return function(Re){if(Re===1)Re=Te;else{var _e=$e(Re),Be=we/_e[2];Re=new jo(Be,H[0]-_e[0]*Be,H[1]-_e[1]*Be)}F.zoom(null,Re)}})}function B(D,le,Q){return!Q&&D.__zooming||new X(D,le)}function X(D,le){this.that=D,this.args=le,this.active=0,this.sourceEvent=null,this.extent=r.apply(D,le),this.taps=0}X.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,le){return this.mouse&&D!=="mouse"&&(this.mouse[1]=le.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=le.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=le.invert(this.touch1[0])),this.that.__zoom=le,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var le=Zn(this.that).datum();w.call(D,this.that,new d1(D,{sourceEvent:this.sourceEvent,target:A,transform:this.that.__zoom,dispatch:w}),le)}};function fe(D,...le){if(!t.apply(this,arguments))return;var Q=B(this,le).event(D),se=this.__zoom,L=Math.max(f[0],Math.min(f[1],se.k*Math.pow(2,s.apply(this,arguments)))),U=Tr(D);if(Q.wheel)(Q.mouse[0][0]!==U[0]||Q.mouse[0][1]!==U[1])&&(Q.mouse[1]=se.invert(Q.mouse[0]=U)),clearTimeout(Q.wheel);else{if(se.k===L)return;Q.mouse=[U,se.invert(U)],ou(this),Q.start()}xa(D),Q.wheel=setTimeout(F,j),Q.zoom("mouse",i(P(V(se,L),Q.mouse[0],Q.mouse[1]),Q.extent,d));function F(){Q.wheel=null,Q.end()}}function he(D,...le){if(S||!t.apply(this,arguments))return;var Q=D.currentTarget,se=B(this,le,!0).event(D),L=Zn(D.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",we,!0),U=Tr(D,Q),F=D.clientX,$=D.clientY;Im(D.view),rf(D),se.mouse=[U,this.__zoom.invert(U)],ou(this),se.start();function H(be){if(xa(be),!se.moved){var Te=be.clientX-F,$e=be.clientY-$;se.moved=Te*Te+$e*$e>M}se.event(be).zoom("mouse",i(P(se.that.__zoom,se.mouse[0]=Tr(be,Q),se.mouse[1]),se.extent,d))}function we(be){L.on("mousemove.zoom mouseup.zoom",null),$m(be.view,se.moved),xa(be),se.event(be).end()}}function Se(D,...le){if(t.apply(this,arguments)){var Q=this.__zoom,se=Tr(D.changedTouches?D.changedTouches[0]:D,this),L=Q.invert(se),U=Q.k*(D.shiftKey?.5:2),F=i(P(V(Q,U),se,L),r.apply(this,le),d);xa(D),m>0?Zn(this).transition().duration(m).call(q,F,se,D):Zn(this).call(A.transform,F,se,D)}}function K(D,...le){if(t.apply(this,arguments)){var Q=D.touches,se=Q.length,L=B(this,le,D.changedTouches.length===se).event(D),U,F,$,H;for(rf(D),F=0;F<se;++F)$=Q[F],H=Tr($,this),H=[H,this.__zoom.invert(H),$.identifier],L.touch0?!L.touch1&&L.touch0[2]!==H[2]&&(L.touch1=H,L.taps=0):(L.touch0=H,U=!0,L.taps=1+!!b);b&&(b=clearTimeout(b)),U&&(L.taps<2&&(x=H[0],b=setTimeout(function(){b=null},C)),ou(this),L.start())}}function ce(D,...le){if(this.__zooming){var Q=B(this,le).event(D),se=D.changedTouches,L=se.length,U,F,$,H;for(xa(D),U=0;U<L;++U)F=se[U],$=Tr(F,this),Q.touch0&&Q.touch0[2]===F.identifier?Q.touch0[0]=$:Q.touch1&&Q.touch1[2]===F.identifier&&(Q.touch1[0]=$);if(F=Q.that.__zoom,Q.touch1){var we=Q.touch0[0],be=Q.touch0[1],Te=Q.touch1[0],$e=Q.touch1[1],Re=(Re=Te[0]-we[0])*Re+(Re=Te[1]-we[1])*Re,_e=(_e=$e[0]-be[0])*_e+(_e=$e[1]-be[1])*_e;F=V(F,Math.sqrt(Re/_e)),$=[(we[0]+Te[0])/2,(we[1]+Te[1])/2],H=[(be[0]+$e[0])/2,(be[1]+$e[1])/2]}else if(Q.touch0)$=Q.touch0[0],H=Q.touch0[1];else return;Q.zoom("touch",i(P(F,$,H),Q.extent,d))}}function xe(D,...le){if(this.__zooming){var Q=B(this,le).event(D),se=D.changedTouches,L=se.length,U,F;for(rf(D),S&&clearTimeout(S),S=setTimeout(function(){S=null},C),U=0;U<L;++U)F=se[U],Q.touch0&&Q.touch0[2]===F.identifier?delete Q.touch0:Q.touch1&&Q.touch1[2]===F.identifier&&delete Q.touch1;if(Q.touch1&&!Q.touch0&&(Q.touch0=Q.touch1,delete Q.touch1),Q.touch0)Q.touch0[1]=this.__zoom.invert(Q.touch0[0]);else if(Q.end(),Q.taps===2&&(F=Tr(F,this),Math.hypot(x[0]-F[0],x[1]-F[1])<I)){var $=Zn(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return A.wheelDelta=function(D){return arguments.length?(s=typeof D=="function"?D:Yl(+D),A):s},A.filter=function(D){return arguments.length?(t=typeof D=="function"?D:Yl(!!D),A):t},A.touchable=function(D){return arguments.length?(u=typeof D=="function"?D:Yl(!!D),A):u},A.extent=function(D){return arguments.length?(r=typeof D=="function"?D:Yl([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),A):r},A.scaleExtent=function(D){return arguments.length?(f[0]=+D[0],f[1]=+D[1],A):[f[0],f[1]]},A.translateExtent=function(D){return arguments.length?(d[0][0]=+D[0][0],d[1][0]=+D[1][0],d[0][1]=+D[0][1],d[1][1]=+D[1][1],A):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},A.constrain=function(D){return arguments.length?(i=D,A):i},A.duration=function(D){return arguments.length?(m=+D,A):m},A.interpolate=function(D){return arguments.length?(v=D,A):v},A.on=function(){var D=w.on.apply(w,arguments);return D===w?A:D},A.clickDistance=function(D){return arguments.length?(M=(D=+D)*D,A):Math.sqrt(M)},A.tapDistance=function(D){return arguments.length?(I=+D,A):I},A}const Qr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:r,sourceHandle:i,targetHandle:s})=>`Couldn't create edge for ${t} handle id: "${t==="source"?i:s}", edge id: ${r}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/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."},ja=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Qm=["Enter"," ","Escape"],Gm={"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:t,x:r,y:i})=>`Moved selected node ${t}. New position, x: ${r}, y: ${i}`,"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 Ms;(function(t){t.Strict="strict",t.Loose="loose"})(Ms||(Ms={}));var Ri;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Ri||(Ri={}));var Pa;(function(t){t.Partial="partial",t.Full="full"})(Pa||(Pa={}));const Jm={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var li;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(li||(li={}));var hu;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(hu||(hu={}));var Ze;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(Ze||(Ze={}));const vh={[Ze.Left]:Ze.Right,[Ze.Right]:Ze.Left,[Ze.Top]:Ze.Bottom,[Ze.Bottom]:Ze.Top};function Zm(t){return t===null?null:t?"valid":"invalid"}const eg=t=>"id"in t&&"source"in t&&"target"in t,v1=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Hf=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),Ra=(t,r=[0,0])=>{const{width:i,height:s}=Mo(t),u=t.origin??r,f=i*u[0],d=s*u[1];return{x:t.position.x-f,y:t.position.y-d}},x1=(t,r={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const i=t.reduce((s,u)=>{const f=typeof u=="string";let d=!r.nodeLookup&&!f?u:void 0;r.nodeLookup&&(d=f?r.nodeLookup.get(u):Hf(u)?u:r.nodeLookup.get(u.id));const m=d?mu(d,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Cu(s,m)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ju(i)},Da=(t,r={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return t.forEach(u=>{(r.filter===void 0||r.filter(u))&&(i=Cu(i,mu(u)),s=!0)}),s?ju(i):{x:0,y:0,width:0,height:0}},Vf=(t,r,[i,s,u]=[0,0,1],f=!1,d=!1)=>{const m={...La(r,[i,s,u]),width:r.width/u,height:r.height/u},v=[];for(const w of t.values()){const{measured:b,selectable:x=!0,hidden:S=!1}=w;if(d&&!x||S)continue;const C=b.width??w.width??w.initialWidth??null,j=b.height??w.height??w.initialHeight??null,M=Ta(m,$s(w)),I=(C??0)*(j??0),A=f&&M>0;(!w.internals.handleBounds||A||M>=I||w.dragging)&&v.push(w)}return v},w1=(t,r)=>{const i=new Set;return t.forEach(s=>{i.add(s.id)}),r.filter(s=>i.has(s.source)||i.has(s.target))};function _1(t,r){const i=new Map,s=r!=null&&r.nodes?new Set(r.nodes.map(u=>u.id)):null;return t.forEach(u=>{u.measured.width&&u.measured.height&&((r==null?void 0:r.includeHiddenNodes)||!u.hidden)&&(!s||s.has(u.id))&&i.set(u.id,u)}),i}async function S1({nodes:t,width:r,height:i,panZoom:s,minZoom:u,maxZoom:f},d){if(t.size===0)return Promise.resolve(!0);const m=_1(t,d),v=Da(m),w=Uf(v,r,i,(d==null?void 0:d.minZoom)??u,(d==null?void 0:d.maxZoom)??f,(d==null?void 0:d.padding)??.1);return await s.setViewport(w,{duration:d==null?void 0:d.duration,ease:d==null?void 0:d.ease,interpolate:d==null?void 0:d.interpolate}),Promise.resolve(!0)}function tg({nodeId:t,nextPosition:r,nodeLookup:i,nodeOrigin:s=[0,0],nodeExtent:u,onError:f}){const d=i.get(t),m=d.parentId?i.get(d.parentId):void 0,{x:v,y:w}=m?m.internals.positionAbsolute:{x:0,y:0},b=d.origin??s;let x=d.extent||u;if(d.extent==="parent"&&!d.expandParent)if(!m)f==null||f("005",Qr.error005());else{const C=m.measured.width,j=m.measured.height;C&&j&&(x=[[v,w],[v+C,w+j]])}else m&&As(d.extent)&&(x=[[d.extent[0][0]+v,d.extent[0][1]+w],[d.extent[1][0]+v,d.extent[1][1]+w]]);const S=As(x)?Li(r,x,d.measured):r;return(d.measured.width===void 0||d.measured.height===void 0)&&(f==null||f("015",Qr.error015())),{position:{x:S.x-v+(d.measured.width??0)*b[0],y:S.y-w+(d.measured.height??0)*b[1]},positionAbsolute:S}}async function b1({nodesToRemove:t=[],edgesToRemove:r=[],nodes:i,edges:s,onBeforeDelete:u}){const f=new Set(t.map(S=>S.id)),d=[];for(const S of i){if(S.deletable===!1)continue;const C=f.has(S.id),j=!C&&S.parentId&&d.find(M=>M.id===S.parentId);(C||j)&&d.push(S)}const m=new Set(r.map(S=>S.id)),v=s.filter(S=>S.deletable!==!1),b=w1(d,v);for(const S of v)m.has(S.id)&&!b.find(j=>j.id===S.id)&&b.push(S);if(!u)return{edges:b,nodes:d};const x=await u({nodes:d,edges:b});return typeof x=="boolean"?x?{edges:b,nodes:d}:{edges:[],nodes:[]}:x}const Is=(t,r=0,i=1)=>Math.min(Math.max(t,r),i),Li=(t={x:0,y:0},r,i)=>({x:Is(t.x,r[0][0],r[1][0]-((i==null?void 0:i.width)??0)),y:Is(t.y,r[0][1],r[1][1]-((i==null?void 0:i.height)??0))});function ng(t,r,i){const{width:s,height:u}=Mo(i),{x:f,y:d}=i.internals.positionAbsolute;return Li(t,[[f,d],[f+s,d+u]],r)}const xh=(t,r,i)=>t<r?Is(Math.abs(t-r),1,r)/r:t>i?-Is(Math.abs(t-i),1,r)/r:0,rg=(t,r,i=15,s=40)=>{const u=xh(t.x,s,r.width-s)*i,f=xh(t.y,s,r.height-s)*i;return[u,f]},Cu=(t,r)=>({x:Math.min(t.x,r.x),y:Math.min(t.y,r.y),x2:Math.max(t.x2,r.x2),y2:Math.max(t.y2,r.y2)}),Cf=({x:t,y:r,width:i,height:s})=>({x:t,y:r,x2:t+i,y2:r+s}),ju=({x:t,y:r,x2:i,y2:s})=>({x:t,y:r,width:i-t,height:s-r}),$s=(t,r=[0,0])=>{var u,f;const{x:i,y:s}=Hf(t)?t.internals.positionAbsolute:Ra(t,r);return{x:i,y:s,width:((u=t.measured)==null?void 0:u.width)??t.width??t.initialWidth??0,height:((f=t.measured)==null?void 0:f.height)??t.height??t.initialHeight??0}},mu=(t,r=[0,0])=>{var u,f;const{x:i,y:s}=Hf(t)?t.internals.positionAbsolute:Ra(t,r);return{x:i,y:s,x2:i+(((u=t.measured)==null?void 0:u.width)??t.width??t.initialWidth??0),y2:s+(((f=t.measured)==null?void 0:f.height)??t.height??t.initialHeight??0)}},og=(t,r)=>ju(Cu(Cf(t),Cf(r))),Ta=(t,r)=>{const i=Math.max(0,Math.min(t.x+t.width,r.x+r.width)-Math.max(t.x,r.x)),s=Math.max(0,Math.min(t.y+t.height,r.y+r.height)-Math.max(t.y,r.y));return Math.ceil(i*s)},wh=t=>Ir(t.width)&&Ir(t.height)&&Ir(t.x)&&Ir(t.y),Ir=t=>!isNaN(t)&&isFinite(t),k1=(t,r)=>{},za=(t,r=[1,1])=>({x:r[0]*Math.round(t.x/r[0]),y:r[1]*Math.round(t.y/r[1])}),La=({x:t,y:r},[i,s,u],f=!1,d=[1,1])=>{const m={x:(t-i)/u,y:(r-s)/u};return f?za(m,d):m},gu=({x:t,y:r},[i,s,u])=>({x:t*u+i,y:r*u+s});function Ss(t,r){if(typeof t=="number")return Math.floor((r-r/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(i)}if(typeof t=="string"&&t.endsWith("%")){const i=parseFloat(t);if(!Number.isNaN(i))return Math.floor(r*i*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function N1(t,r,i){if(typeof t=="string"||typeof t=="number"){const s=Ss(t,i),u=Ss(t,r);return{top:s,right:u,bottom:s,left:u,x:u*2,y:s*2}}if(typeof t=="object"){const s=Ss(t.top??t.y??0,i),u=Ss(t.bottom??t.y??0,i),f=Ss(t.left??t.x??0,r),d=Ss(t.right??t.x??0,r);return{top:s,right:d,bottom:u,left:f,x:f+d,y:s+u}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function E1(t,r,i,s,u,f){const{x:d,y:m}=gu(t,[r,i,s]),{x:v,y:w}=gu({x:t.x+t.width,y:t.y+t.height},[r,i,s]),b=u-v,x=f-w;return{left:Math.floor(d),top:Math.floor(m),right:Math.floor(b),bottom:Math.floor(x)}}const Uf=(t,r,i,s,u,f)=>{const d=N1(f,r,i),m=(r-d.x)/t.width,v=(i-d.y)/t.height,w=Math.min(m,v),b=Is(w,s,u),x=t.x+t.width/2,S=t.y+t.height/2,C=r/2-x*b,j=i/2-S*b,M=E1(t,C,j,b,r,i),I={left:Math.min(M.left-d.left,0),top:Math.min(M.top-d.top,0),right:Math.min(M.right-d.right,0),bottom:Math.min(M.bottom-d.bottom,0)};return{x:C-I.left+I.right,y:j-I.top+I.bottom,zoom:b}},Ma=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function As(t){return t!=null&&t!=="parent"}function Mo(t){var r,i;return{width:((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth??0,height:((i=t.measured)==null?void 0:i.height)??t.height??t.initialHeight??0}}function ig(t){var r,i;return(((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth)!==void 0&&(((i=t.measured)==null?void 0:i.height)??t.height??t.initialHeight)!==void 0}function sg(t,r={width:0,height:0},i,s,u){const f={...t},d=s.get(i);if(d){const m=d.origin||u;f.x+=d.internals.positionAbsolute.x-(r.width??0)*m[0],f.y+=d.internals.positionAbsolute.y-(r.height??0)*m[1]}return f}function _h(t,r){if(t.size!==r.size)return!1;for(const i of t)if(!r.has(i))return!1;return!0}function C1(){let t,r;return{promise:new Promise((s,u)=>{t=s,r=u}),resolve:t,reject:r}}function j1(t){return{...Gm,...t||{}}}function ba(t,{snapGrid:r=[0,0],snapToGrid:i=!1,transform:s,containerBounds:u}){const{x:f,y:d}=$r(t),m=La({x:f-((u==null?void 0:u.left)??0),y:d-((u==null?void 0:u.top)??0)},s),{x:v,y:w}=i?za(m,r):m;return{xSnapped:v,ySnapped:w,...m}}const Kf=t=>({width:t.offsetWidth,height:t.offsetHeight}),ag=t=>{var r;return((r=t==null?void 0:t.getRootNode)==null?void 0:r.call(t))||(window==null?void 0:window.document)},P1=["INPUT","SELECT","TEXTAREA"];function lg(t){var s,u;const r=((u=(s=t.composedPath)==null?void 0:s.call(t))==null?void 0:u[0])||t.target;return(r==null?void 0:r.nodeType)!==1?!1:P1.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const ug=t=>"clientX"in t,$r=(t,r)=>{var f,d;const i=ug(t),s=i?t.clientX:(f=t.touches)==null?void 0:f[0].clientX,u=i?t.clientY:(d=t.touches)==null?void 0:d[0].clientY;return{x:s-((r==null?void 0:r.left)??0),y:u-((r==null?void 0:r.top)??0)}},Sh=(t,r,i,s,u)=>{const f=r.querySelectorAll(`.${t}`);return!f||!f.length?null:Array.from(f).map(d=>{const m=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),type:t,nodeId:u,position:d.getAttribute("data-handlepos"),x:(m.left-i.left)/s,y:(m.top-i.top)/s,...Kf(d)}})};function cg({sourceX:t,sourceY:r,targetX:i,targetY:s,sourceControlX:u,sourceControlY:f,targetControlX:d,targetControlY:m}){const v=t*.125+u*.375+d*.375+i*.125,w=r*.125+f*.375+m*.375+s*.125,b=Math.abs(v-t),x=Math.abs(w-r);return[v,w,b,x]}function Xl(t,r){return t>=0?.5*t:r*25*Math.sqrt(-t)}function bh({pos:t,x1:r,y1:i,x2:s,y2:u,c:f}){switch(t){case Ze.Left:return[r-Xl(r-s,f),i];case Ze.Right:return[r+Xl(s-r,f),i];case Ze.Top:return[r,i-Xl(i-u,f)];case Ze.Bottom:return[r,i+Xl(u-i,f)]}}function fg({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:s,targetY:u,targetPosition:f=Ze.Top,curvature:d=.25}){const[m,v]=bh({pos:i,x1:t,y1:r,x2:s,y2:u,c:d}),[w,b]=bh({pos:f,x1:s,y1:u,x2:t,y2:r,c:d}),[x,S,C,j]=cg({sourceX:t,sourceY:r,targetX:s,targetY:u,sourceControlX:m,sourceControlY:v,targetControlX:w,targetControlY:b});return[`M${t},${r} C${m},${v} ${w},${b} ${s},${u}`,x,S,C,j]}function dg({sourceX:t,sourceY:r,targetX:i,targetY:s}){const u=Math.abs(i-t)/2,f=i<t?i+u:i-u,d=Math.abs(s-r)/2,m=s<r?s+d:s-d;return[f,m,u,d]}function T1({sourceNode:t,targetNode:r,selected:i=!1,zIndex:s=0,elevateOnSelect:u=!1,zIndexMode:f="basic"}){if(f==="manual")return s;const d=u&&i?s+1e3:s,m=Math.max(t.parentId||u&&t.selected?t.internals.z:0,r.parentId||u&&r.selected?r.internals.z:0);return d+m}function M1({sourceNode:t,targetNode:r,width:i,height:s,transform:u}){const f=Cu(mu(t),mu(r));f.x===f.x2&&(f.x2+=1),f.y===f.y2&&(f.y2+=1);const d={x:-u[0]/u[2],y:-u[1]/u[2],width:i/u[2],height:s/u[2]};return Ta(d,ju(f))>0}const I1=({source:t,sourceHandle:r,target:i,targetHandle:s})=>`xy-edge__${t}${r||""}-${i}${s||""}`,$1=(t,r)=>r.some(i=>i.source===t.source&&i.target===t.target&&(i.sourceHandle===t.sourceHandle||!i.sourceHandle&&!t.sourceHandle)&&(i.targetHandle===t.targetHandle||!i.targetHandle&&!t.targetHandle)),pg=(t,r,i={})=>{if(!t.source||!t.target)return r;const s=i.getEdgeId||I1;let u;return eg(t)?u={...t}:u={...t,id:s(t)},$1(u,r)?r:(u.sourceHandle===null&&delete u.sourceHandle,u.targetHandle===null&&delete u.targetHandle,r.concat(u))};function hg({sourceX:t,sourceY:r,targetX:i,targetY:s}){const[u,f,d,m]=dg({sourceX:t,sourceY:r,targetX:i,targetY:s});return[`M ${t},${r}L ${i},${s}`,u,f,d,m]}const kh={[Ze.Left]:{x:-1,y:0},[Ze.Right]:{x:1,y:0},[Ze.Top]:{x:0,y:-1},[Ze.Bottom]:{x:0,y:1}},A1=({source:t,sourcePosition:r=Ze.Bottom,target:i})=>r===Ze.Left||r===Ze.Right?t.x<i.x?{x:1,y:0}:{x:-1,y:0}:t.y<i.y?{x:0,y:1}:{x:0,y:-1},Nh=(t,r)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));function O1({source:t,sourcePosition:r=Ze.Bottom,target:i,targetPosition:s=Ze.Top,center:u,offset:f,stepPosition:d}){const m=kh[r],v=kh[s],w={x:t.x+m.x*f,y:t.y+m.y*f},b={x:i.x+v.x*f,y:i.y+v.y*f},x=A1({source:w,sourcePosition:r,target:b}),S=x.x!==0?"x":"y",C=x[S];let j=[],M,I;const A={x:0,y:0},V={x:0,y:0},[,,P,R]=dg({sourceX:t.x,sourceY:t.y,targetX:i.x,targetY:i.y});if(m[S]*v[S]===-1){S==="x"?(M=u.x??w.x+(b.x-w.x)*d,I=u.y??(w.y+b.y)/2):(M=u.x??(w.x+b.x)/2,I=u.y??w.y+(b.y-w.y)*d);const fe=[{x:M,y:w.y},{x:M,y:b.y}],he=[{x:w.x,y:I},{x:b.x,y:I}];m[S]===C?j=S==="x"?fe:he:j=S==="x"?he:fe}else{const fe=[{x:w.x,y:b.y}],he=[{x:b.x,y:w.y}];if(S==="x"?j=m.x===C?he:fe:j=m.y===C?fe:he,r===s){const D=Math.abs(t[S]-i[S]);if(D<=f){const le=Math.min(f-1,f-D);m[S]===C?A[S]=(w[S]>t[S]?-1:1)*le:V[S]=(b[S]>i[S]?-1:1)*le}}if(r!==s){const D=S==="x"?"y":"x",le=m[S]===v[D],Q=w[D]>b[D],se=w[D]<b[D];(m[S]===1&&(!le&&Q||le&&se)||m[S]!==1&&(!le&&se||le&&Q))&&(j=S==="x"?fe:he)}const Se={x:w.x+A.x,y:w.y+A.y},K={x:b.x+V.x,y:b.y+V.y},ce=Math.max(Math.abs(Se.x-j[0].x),Math.abs(K.x-j[0].x)),xe=Math.max(Math.abs(Se.y-j[0].y),Math.abs(K.y-j[0].y));ce>=xe?(M=(Se.x+K.x)/2,I=j[0].y):(M=j[0].x,I=(Se.y+K.y)/2)}const q={x:w.x+A.x,y:w.y+A.y},B={x:b.x+V.x,y:b.y+V.y};return[[t,...q.x!==j[0].x||q.y!==j[0].y?[q]:[],...j,...B.x!==j[j.length-1].x||B.y!==j[j.length-1].y?[B]:[],i],M,I,P,R]}function R1(t,r,i,s){const u=Math.min(Nh(t,r)/2,Nh(r,i)/2,s),{x:f,y:d}=r;if(t.x===f&&f===i.x||t.y===d&&d===i.y)return`L${f} ${d}`;if(t.y===d){const w=t.x<i.x?-1:1,b=t.y<i.y?1:-1;return`L ${f+u*w},${d}Q ${f},${d} ${f},${d+u*b}`}const m=t.x<i.x?1:-1,v=t.y<i.y?-1:1;return`L ${f},${d+u*v}Q ${f},${d} ${f+u*m},${d}`}function jf({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:s,targetY:u,targetPosition:f=Ze.Top,borderRadius:d=5,centerX:m,centerY:v,offset:w=20,stepPosition:b=.5}){const[x,S,C,j,M]=O1({source:{x:t,y:r},sourcePosition:i,target:{x:s,y:u},targetPosition:f,center:{x:m,y:v},offset:w,stepPosition:b});let I=`M${x[0].x} ${x[0].y}`;for(let A=1;A<x.length-1;A++)I+=R1(x[A-1],x[A],x[A+1],d);return I+=`L${x[x.length-1].x} ${x[x.length-1].y}`,[I,S,C,j,M]}function Eh(t){var r;return t&&!!(t.internals.handleBounds||(r=t.handles)!=null&&r.length)&&!!(t.measured.width||t.width||t.initialWidth)}function D1(t){var x;const{sourceNode:r,targetNode:i}=t;if(!Eh(r)||!Eh(i))return null;const s=r.internals.handleBounds||Ch(r.handles),u=i.internals.handleBounds||Ch(i.handles),f=jh((s==null?void 0:s.source)??[],t.sourceHandle),d=jh(t.connectionMode===Ms.Strict?(u==null?void 0:u.target)??[]:((u==null?void 0:u.target)??[]).concat((u==null?void 0:u.source)??[]),t.targetHandle);if(!f||!d)return(x=t.onError)==null||x.call(t,"008",Qr.error008(f?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const m=(f==null?void 0:f.position)||Ze.Bottom,v=(d==null?void 0:d.position)||Ze.Top,w=Fi(r,f,m),b=Fi(i,d,v);return{sourceX:w.x,sourceY:w.y,targetX:b.x,targetY:b.y,sourcePosition:m,targetPosition:v}}function Ch(t){if(!t)return null;const r=[],i=[];for(const s of t)s.width=s.width??1,s.height=s.height??1,s.type==="source"?r.push(s):s.type==="target"&&i.push(s);return{source:r,target:i}}function Fi(t,r,i=Ze.Left,s=!1){const u=((r==null?void 0:r.x)??0)+t.internals.positionAbsolute.x,f=((r==null?void 0:r.y)??0)+t.internals.positionAbsolute.y,{width:d,height:m}=r??Mo(t);if(s)return{x:u+d/2,y:f+m/2};switch((r==null?void 0:r.position)??i){case Ze.Top:return{x:u+d/2,y:f};case Ze.Right:return{x:u+d,y:f+m/2};case Ze.Bottom:return{x:u+d/2,y:f+m};case Ze.Left:return{x:u,y:f+m/2}}}function jh(t,r){return t&&(r?t.find(i=>i.id===r):t[0])||null}function Pf(t,r){return t?typeof t=="string"?t:`${r?`${r}__`:""}${Object.keys(t).sort().map(s=>`${s}=${t[s]}`).join("&")}`:""}function z1(t,{id:r,defaultColor:i,defaultMarkerStart:s,defaultMarkerEnd:u}){const f=new Set;return t.reduce((d,m)=>([m.markerStart||s,m.markerEnd||u].forEach(v=>{if(v&&typeof v=="object"){const w=Pf(v,r);f.has(w)||(d.push({id:w,color:v.color||i,...v}),f.add(w))}}),d),[]).sort((d,m)=>d.id.localeCompare(m.id))}const mg=1e3,L1=10,qf={nodeOrigin:[0,0],nodeExtent:ja,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},F1={...qf,checkEquality:!0};function Wf(t,r){const i={...t};for(const s in r)r[s]!==void 0&&(i[s]=r[s]);return i}function B1(t,r,i){const s=Wf(qf,i);for(const u of t.values())if(u.parentId)Xf(u,t,r,s);else{const f=Ra(u,s.nodeOrigin),d=As(u.extent)?u.extent:s.nodeExtent,m=Li(f,d,Mo(u));u.internals.positionAbsolute=m}}function H1(t,r){if(!t.handles)return t.measured?r==null?void 0:r.internals.handleBounds:void 0;const i=[],s=[];for(const u of t.handles){const f={id:u.id,width:u.width??1,height:u.height??1,nodeId:t.id,x:u.x,y:u.y,position:u.position,type:u.type};u.type==="source"?i.push(f):u.type==="target"&&s.push(f)}return{source:i,target:s}}function Yf(t){return t==="manual"}function Tf(t,r,i,s={}){var b,x;const u=Wf(F1,s),f={i:0},d=new Map(r),m=u!=null&&u.elevateNodesOnSelect&&!Yf(u.zIndexMode)?mg:0;let v=t.length>0,w=!1;r.clear(),i.clear();for(const S of t){let C=d.get(S.id);if(u.checkEquality&&S===(C==null?void 0:C.internals.userNode))r.set(S.id,C);else{const j=Ra(S,u.nodeOrigin),M=As(S.extent)?S.extent:u.nodeExtent,I=Li(j,M,Mo(S));C={...u.defaults,...S,measured:{width:(b=S.measured)==null?void 0:b.width,height:(x=S.measured)==null?void 0:x.height},internals:{positionAbsolute:I,handleBounds:H1(S,C),z:gg(S,m,u.zIndexMode),userNode:S}},r.set(S.id,C)}(C.measured===void 0||C.measured.width===void 0||C.measured.height===void 0)&&!C.hidden&&(v=!1),S.parentId&&Xf(C,r,i,s,f),w||(w=S.selected??!1)}return{nodesInitialized:v,hasSelectedNodes:w}}function V1(t,r){if(!t.parentId)return;const i=r.get(t.parentId);i?i.set(t.id,t):r.set(t.parentId,new Map([[t.id,t]]))}function Xf(t,r,i,s,u){const{elevateNodesOnSelect:f,nodeOrigin:d,nodeExtent:m,zIndexMode:v}=Wf(qf,s),w=t.parentId,b=r.get(w);if(!b){console.warn(`Parent node ${w} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}V1(t,i),u&&!b.parentId&&b.internals.rootParentIndex===void 0&&v==="auto"&&(b.internals.rootParentIndex=++u.i,b.internals.z=b.internals.z+u.i*L1),u&&b.internals.rootParentIndex!==void 0&&(u.i=b.internals.rootParentIndex);const x=f&&!Yf(v)?mg:0,{x:S,y:C,z:j}=U1(t,b,d,m,x,v),{positionAbsolute:M}=t.internals,I=S!==M.x||C!==M.y;(I||j!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:I?{x:S,y:C}:M,z:j}})}function gg(t,r,i){const s=Ir(t.zIndex)?t.zIndex:0;return Yf(i)?s:s+(t.selected?r:0)}function U1(t,r,i,s,u,f){const{x:d,y:m}=r.internals.positionAbsolute,v=Mo(t),w=Ra(t,i),b=As(t.extent)?Li(w,t.extent,v):w;let x=Li({x:d+b.x,y:m+b.y},s,v);t.extent==="parent"&&(x=ng(x,v,r));const S=gg(t,u,f),C=r.internals.z??0;return{x:x.x,y:x.y,z:C>=S?C+1:S}}function Qf(t,r,i,s=[0,0]){var d;const u=[],f=new Map;for(const m of t){const v=r.get(m.parentId);if(!v)continue;const w=((d=f.get(m.parentId))==null?void 0:d.expandedRect)??$s(v),b=og(w,m.rect);f.set(m.parentId,{expandedRect:b,parent:v})}return f.size>0&&f.forEach(({expandedRect:m,parent:v},w)=>{var P;const b=v.internals.positionAbsolute,x=Mo(v),S=v.origin??s,C=m.x<b.x?Math.round(Math.abs(b.x-m.x)):0,j=m.y<b.y?Math.round(Math.abs(b.y-m.y)):0,M=Math.max(x.width,Math.round(m.width)),I=Math.max(x.height,Math.round(m.height)),A=(M-x.width)*S[0],V=(I-x.height)*S[1];(C>0||j>0||A||V)&&(u.push({id:w,type:"position",position:{x:v.position.x-C+A,y:v.position.y-j+V}}),(P=i.get(w))==null||P.forEach(R=>{t.some(q=>q.id===R.id)||u.push({id:R.id,type:"position",position:{x:R.position.x+C,y:R.position.y+j}})})),(x.width<m.width||x.height<m.height||C||j)&&u.push({id:w,type:"dimensions",setAttributes:!0,dimensions:{width:M+(C?S[0]*C-A:0),height:I+(j?S[1]*j-V:0)}})}),u}function K1(t,r,i,s,u,f,d){const m=s==null?void 0:s.querySelector(".xyflow__viewport");let v=!1;if(!m)return{changes:[],updatedInternals:v};const w=[],b=window.getComputedStyle(m),{m22:x}=new window.DOMMatrixReadOnly(b.transform),S=[];for(const C of t.values()){const j=r.get(C.id);if(!j)continue;if(j.hidden){r.set(j.id,{...j,internals:{...j.internals,handleBounds:void 0}}),v=!0;continue}const M=Kf(C.nodeElement),I=j.measured.width!==M.width||j.measured.height!==M.height;if(!!(M.width&&M.height&&(I||!j.internals.handleBounds||C.force))){const V=C.nodeElement.getBoundingClientRect(),P=As(j.extent)?j.extent:f;let{positionAbsolute:R}=j.internals;j.parentId&&j.extent==="parent"?R=ng(R,M,r.get(j.parentId)):P&&(R=Li(R,P,M));const q={...j,measured:M,internals:{...j.internals,positionAbsolute:R,handleBounds:{source:Sh("source",C.nodeElement,V,x,j.id),target:Sh("target",C.nodeElement,V,x,j.id)}}};r.set(j.id,q),j.parentId&&Xf(q,r,i,{nodeOrigin:u,zIndexMode:d}),v=!0,I&&(w.push({id:j.id,type:"dimensions",dimensions:M}),j.expandParent&&j.parentId&&S.push({id:j.id,parentId:j.parentId,rect:$s(q,u)}))}}if(S.length>0){const C=Qf(S,r,i,u);w.push(...C)}return{changes:w,updatedInternals:v}}async function q1({delta:t,panZoom:r,transform:i,translateExtent:s,width:u,height:f}){if(!r||!t.x&&!t.y)return Promise.resolve(!1);const d=await r.setViewportConstrained({x:i[0]+t.x,y:i[1]+t.y,zoom:i[2]},[[0,0],[u,f]],s),m=!!d&&(d.x!==i[0]||d.y!==i[1]||d.k!==i[2]);return Promise.resolve(m)}function Ph(t,r,i,s,u,f){let d=u;const m=s.get(d)||new Map;s.set(d,m.set(i,r)),d=`${u}-${t}`;const v=s.get(d)||new Map;if(s.set(d,v.set(i,r)),f){d=`${u}-${t}-${f}`;const w=s.get(d)||new Map;s.set(d,w.set(i,r))}}function yg(t,r,i){t.clear(),r.clear();for(const s of i){const{source:u,target:f,sourceHandle:d=null,targetHandle:m=null}=s,v={edgeId:s.id,source:u,target:f,sourceHandle:d,targetHandle:m},w=`${u}-${d}--${f}-${m}`,b=`${f}-${m}--${u}-${d}`;Ph("source",v,b,t,u,d),Ph("target",v,w,t,f,m),r.set(s.id,s)}}function vg(t,r){if(!t.parentId)return!1;const i=r.get(t.parentId);return i?i.selected?!0:vg(i,r):!1}function Th(t,r,i){var u;let s=t;do{if((u=s==null?void 0:s.matches)!=null&&u.call(s,r))return!0;if(s===i)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function W1(t,r,i,s){const u=new Map;for(const[f,d]of t)if((d.selected||d.id===s)&&(!d.parentId||!vg(d,t))&&(d.draggable||r&&typeof d.draggable>"u")){const m=t.get(f);m&&u.set(f,{id:f,position:m.position||{x:0,y:0},distance:{x:i.x-m.internals.positionAbsolute.x,y:i.y-m.internals.positionAbsolute.y},extent:m.extent,parentId:m.parentId,origin:m.origin,expandParent:m.expandParent,internals:{positionAbsolute:m.internals.positionAbsolute||{x:0,y:0}},measured:{width:m.measured.width??0,height:m.measured.height??0}})}return u}function of({nodeId:t,dragItems:r,nodeLookup:i,dragging:s=!0}){var d,m,v;const u=[];for(const[w,b]of r){const x=(d=i.get(w))==null?void 0:d.internals.userNode;x&&u.push({...x,position:b.position,dragging:s})}if(!t)return[u[0],u];const f=(m=i.get(t))==null?void 0:m.internals.userNode;return[f?{...f,position:((v=r.get(t))==null?void 0:v.position)||f.position,dragging:s}:u[0],u]}function Y1({dragItems:t,snapGrid:r,x:i,y:s}){const u=t.values().next().value;if(!u)return null;const f={x:i-u.distance.x,y:s-u.distance.y},d=za(f,r);return{x:d.x-f.x,y:d.y-f.y}}function X1({onNodeMouseDown:t,getStoreItems:r,onDragStart:i,onDrag:s,onDragStop:u}){let f={x:null,y:null},d=0,m=new Map,v=!1,w={x:0,y:0},b=null,x=!1,S=null,C=!1,j=!1,M=null;function I({noDragClassName:V,handleSelector:P,domNode:R,isSelectable:q,nodeId:B,nodeClickDistance:X=0}){S=Zn(R);function fe({x:ce,y:xe}){const{nodeLookup:D,nodeExtent:le,snapGrid:Q,snapToGrid:se,nodeOrigin:L,onNodeDrag:U,onSelectionDrag:F,onError:$,updateNodePositions:H}=r();f={x:ce,y:xe};let we=!1;const be=m.size>1,Te=be&&le?Cf(Da(m)):null,$e=be&&se?Y1({dragItems:m,snapGrid:Q,x:ce,y:xe}):null;for(const[Re,_e]of m){if(!D.has(Re))continue;let Be={x:ce-_e.distance.x,y:xe-_e.distance.y};se&&(Be=$e?{x:Math.round(Be.x+$e.x),y:Math.round(Be.y+$e.y)}:za(Be,Q));let ke=null;if(be&&le&&!_e.extent&&Te){const{positionAbsolute:qe}=_e.internals,ut=qe.x-Te.x+le[0][0],ct=qe.x+_e.measured.width-Te.x2+le[1][0],it=qe.y-Te.y+le[0][1],Mt=qe.y+_e.measured.height-Te.y2+le[1][1];ke=[[ut,it],[ct,Mt]]}const{position:He,positionAbsolute:Ae}=tg({nodeId:Re,nextPosition:Be,nodeLookup:D,nodeExtent:ke||le,nodeOrigin:L,onError:$});we=we||_e.position.x!==He.x||_e.position.y!==He.y,_e.position=He,_e.internals.positionAbsolute=Ae}if(j=j||we,!!we&&(H(m,!0),M&&(s||U||!B&&F))){const[Re,_e]=of({nodeId:B,dragItems:m,nodeLookup:D});s==null||s(M,m,Re,_e),U==null||U(M,Re,_e),B||F==null||F(M,_e)}}async function he(){if(!b)return;const{transform:ce,panBy:xe,autoPanSpeed:D,autoPanOnNodeDrag:le}=r();if(!le){v=!1,cancelAnimationFrame(d);return}const[Q,se]=rg(w,b,D);(Q!==0||se!==0)&&(f.x=(f.x??0)-Q/ce[2],f.y=(f.y??0)-se/ce[2],await xe({x:Q,y:se})&&fe(f)),d=requestAnimationFrame(he)}function Se(ce){var be;const{nodeLookup:xe,multiSelectionActive:D,nodesDraggable:le,transform:Q,snapGrid:se,snapToGrid:L,selectNodesOnDrag:U,onNodeDragStart:F,onSelectionDragStart:$,unselectNodesAndEdges:H}=r();x=!0,(!U||!q)&&!D&&B&&((be=xe.get(B))!=null&&be.selected||H()),q&&U&&B&&(t==null||t(B));const we=ba(ce.sourceEvent,{transform:Q,snapGrid:se,snapToGrid:L,containerBounds:b});if(f=we,m=W1(xe,le,we,B),m.size>0&&(i||F||!B&&$)){const[Te,$e]=of({nodeId:B,dragItems:m,nodeLookup:xe});i==null||i(ce.sourceEvent,m,Te,$e),F==null||F(ce.sourceEvent,Te,$e),B||$==null||$(ce.sourceEvent,$e)}}const K=Am().clickDistance(X).on("start",ce=>{const{domNode:xe,nodeDragThreshold:D,transform:le,snapGrid:Q,snapToGrid:se}=r();b=(xe==null?void 0:xe.getBoundingClientRect())||null,C=!1,j=!1,M=ce.sourceEvent,D===0&&Se(ce),f=ba(ce.sourceEvent,{transform:le,snapGrid:Q,snapToGrid:se,containerBounds:b}),w=$r(ce.sourceEvent,b)}).on("drag",ce=>{const{autoPanOnNodeDrag:xe,transform:D,snapGrid:le,snapToGrid:Q,nodeDragThreshold:se,nodeLookup:L}=r(),U=ba(ce.sourceEvent,{transform:D,snapGrid:le,snapToGrid:Q,containerBounds:b});if(M=ce.sourceEvent,(ce.sourceEvent.type==="touchmove"&&ce.sourceEvent.touches.length>1||B&&!L.has(B))&&(C=!0),!C){if(!v&&xe&&x&&(v=!0,he()),!x){const F=$r(ce.sourceEvent,b),$=F.x-w.x,H=F.y-w.y;Math.sqrt($*$+H*H)>se&&Se(ce)}(f.x!==U.xSnapped||f.y!==U.ySnapped)&&m&&x&&(w=$r(ce.sourceEvent,b),fe(U))}}).on("end",ce=>{if(!(!x||C)&&(v=!1,x=!1,cancelAnimationFrame(d),m.size>0)){const{nodeLookup:xe,updateNodePositions:D,onNodeDragStop:le,onSelectionDragStop:Q}=r();if(j&&(D(m,!1),j=!1),u||le||!B&&Q){const[se,L]=of({nodeId:B,dragItems:m,nodeLookup:xe,dragging:!1});u==null||u(ce.sourceEvent,m,se,L),le==null||le(ce.sourceEvent,se,L),B||Q==null||Q(ce.sourceEvent,L)}}}).filter(ce=>{const xe=ce.target;return!ce.button&&(!V||!Th(xe,`.${V}`,R))&&(!P||Th(xe,P,R))});S.call(K)}function A(){S==null||S.on(".drag",null)}return{update:I,destroy:A}}function Q1(t,r,i){const s=[],u={x:t.x-i,y:t.y-i,width:i*2,height:i*2};for(const f of r.values())Ta(u,$s(f))>0&&s.push(f);return s}const G1=250;function J1(t,r,i,s){var m,v;let u=[],f=1/0;const d=Q1(t,i,r+G1);for(const w of d){const b=[...((m=w.internals.handleBounds)==null?void 0:m.source)??[],...((v=w.internals.handleBounds)==null?void 0:v.target)??[]];for(const x of b){if(s.nodeId===x.nodeId&&s.type===x.type&&s.id===x.id)continue;const{x:S,y:C}=Fi(w,x,x.position,!0),j=Math.sqrt(Math.pow(S-t.x,2)+Math.pow(C-t.y,2));j>r||(j<f?(u=[{...x,x:S,y:C}],f=j):j===f&&u.push({...x,x:S,y:C}))}}if(!u.length)return null;if(u.length>1){const w=s.type==="source"?"target":"source";return u.find(b=>b.type===w)??u[0]}return u[0]}function xg(t,r,i,s,u,f=!1){var w,b,x;const d=s.get(t);if(!d)return null;const m=u==="strict"?(w=d.internals.handleBounds)==null?void 0:w[r]:[...((b=d.internals.handleBounds)==null?void 0:b.source)??[],...((x=d.internals.handleBounds)==null?void 0:x.target)??[]],v=(i?m==null?void 0:m.find(S=>S.id===i):m==null?void 0:m[0])??null;return v&&f?{...v,...Fi(d,v,v.position,!0)}:v}function wg(t,r){return t||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function Z1(t,r){let i=null;return r?i=!0:t&&!r&&(i=!1),i}const _g=()=>!0;function e_(t,{connectionMode:r,connectionRadius:i,handleId:s,nodeId:u,edgeUpdaterType:f,isTarget:d,domNode:m,nodeLookup:v,lib:w,autoPanOnConnect:b,flowId:x,panBy:S,cancelConnection:C,onConnectStart:j,onConnect:M,onConnectEnd:I,isValidConnection:A=_g,onReconnectEnd:V,updateConnection:P,getTransform:R,getFromHandle:q,autoPanSpeed:B,dragThreshold:X=1,handleDomNode:fe}){const he=ag(t.target);let Se=0,K;const{x:ce,y:xe}=$r(t),D=wg(f,fe),le=m==null?void 0:m.getBoundingClientRect();let Q=!1;if(!le||!D)return;const se=xg(u,D,s,v,r);if(!se)return;let L=$r(t,le),U=!1,F=null,$=!1,H=null;function we(){if(!b||!le)return;const[He,Ae]=rg(L,le,B);S({x:He,y:Ae}),Se=requestAnimationFrame(we)}const be={...se,nodeId:u,type:D,position:se.position},Te=v.get(u);let Re={inProgress:!0,isValid:null,from:Fi(Te,be,Ze.Left,!0),fromHandle:be,fromPosition:be.position,fromNode:Te,to:L,toHandle:null,toPosition:vh[be.position],toNode:null,pointer:L};function _e(){Q=!0,P(Re),j==null||j(t,{nodeId:u,handleId:s,handleType:D})}X===0&&_e();function Be(He){if(!Q){const{x:Mt,y:St}=$r(He),tn=Mt-ce,Ot=St-xe;if(!(tn*tn+Ot*Ot>X*X))return;_e()}if(!q()||!be){ke(He);return}const Ae=R();L=$r(He,le),K=J1(La(L,Ae,!1,[1,1]),i,v,be),U||(we(),U=!0);const qe=Sg(He,{handle:K,connectionMode:r,fromNodeId:u,fromHandleId:s,fromType:d?"target":"source",isValidConnection:A,doc:he,lib:w,flowId:x,nodeLookup:v});H=qe.handleDomNode,F=qe.connection,$=Z1(!!K,qe.isValid);const ut=v.get(u),ct=ut?Fi(ut,be,Ze.Left,!0):Re.from,it={...Re,from:ct,isValid:$,to:qe.toHandle&&$?gu({x:qe.toHandle.x,y:qe.toHandle.y},Ae):L,toHandle:qe.toHandle,toPosition:$&&qe.toHandle?qe.toHandle.position:vh[be.position],toNode:qe.toHandle?v.get(qe.toHandle.nodeId):null,pointer:L};P(it),Re=it}function ke(He){if(!("touches"in He&&He.touches.length>0)){if(Q){(K||H)&&F&&$&&(M==null||M(F));const{inProgress:Ae,...qe}=Re,ut={...qe,toPosition:Re.toHandle?Re.toPosition:null};I==null||I(He,ut),f&&(V==null||V(He,ut))}C(),cancelAnimationFrame(Se),U=!1,$=!1,F=null,H=null,he.removeEventListener("mousemove",Be),he.removeEventListener("mouseup",ke),he.removeEventListener("touchmove",Be),he.removeEventListener("touchend",ke)}}he.addEventListener("mousemove",Be),he.addEventListener("mouseup",ke),he.addEventListener("touchmove",Be),he.addEventListener("touchend",ke)}function Sg(t,{handle:r,connectionMode:i,fromNodeId:s,fromHandleId:u,fromType:f,doc:d,lib:m,flowId:v,isValidConnection:w=_g,nodeLookup:b}){const x=f==="target",S=r?d.querySelector(`.${m}-flow__handle[data-id="${v}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x:C,y:j}=$r(t),M=d.elementFromPoint(C,j),I=M!=null&&M.classList.contains(`${m}-flow__handle`)?M:S,A={handleDomNode:I,isValid:!1,connection:null,toHandle:null};if(I){const V=wg(void 0,I),P=I.getAttribute("data-nodeid"),R=I.getAttribute("data-handleid"),q=I.classList.contains("connectable"),B=I.classList.contains("connectableend");if(!P||!V)return A;const X={source:x?P:s,sourceHandle:x?R:u,target:x?s:P,targetHandle:x?u:R};A.connection=X;const he=q&&B&&(i===Ms.Strict?x&&V==="source"||!x&&V==="target":P!==s||R!==u);A.isValid=he&&w(X),A.toHandle=xg(P,V,R,b,i,!0)}return A}const Mf={onPointerDown:e_,isValid:Sg};function t_({domNode:t,panZoom:r,getTransform:i,getViewScale:s}){const u=Zn(t);function f({translateExtent:m,width:v,height:w,zoomStep:b=1,pannable:x=!0,zoomable:S=!0,inversePan:C=!1}){const j=P=>{if(P.sourceEvent.type!=="wheel"||!r)return;const R=i(),q=P.sourceEvent.ctrlKey&&Ma()?10:1,B=-P.sourceEvent.deltaY*(P.sourceEvent.deltaMode===1?.05:P.sourceEvent.deltaMode?1:.002)*b,X=R[2]*Math.pow(2,B*q);r.scaleTo(X)};let M=[0,0];const I=P=>{(P.sourceEvent.type==="mousedown"||P.sourceEvent.type==="touchstart")&&(M=[P.sourceEvent.clientX??P.sourceEvent.touches[0].clientX,P.sourceEvent.clientY??P.sourceEvent.touches[0].clientY])},A=P=>{const R=i();if(P.sourceEvent.type!=="mousemove"&&P.sourceEvent.type!=="touchmove"||!r)return;const q=[P.sourceEvent.clientX??P.sourceEvent.touches[0].clientX,P.sourceEvent.clientY??P.sourceEvent.touches[0].clientY],B=[q[0]-M[0],q[1]-M[1]];M=q;const X=s()*Math.max(R[2],Math.log(R[2]))*(C?-1:1),fe={x:R[0]-B[0]*X,y:R[1]-B[1]*X},he=[[0,0],[v,w]];r.setViewportConstrained({x:fe.x,y:fe.y,zoom:R[2]},he,m)},V=Xm().on("start",I).on("zoom",x?A:null).on("zoom.wheel",S?j:null);u.call(V,{})}function d(){u.on("zoom",null)}return{update:f,destroy:d,pointer:Tr}}const Pu=t=>({x:t.x,y:t.y,zoom:t.k}),sf=({x:t,y:r,zoom:i})=>Eu.translate(t,r).scale(i),Ns=(t,r)=>t.target.closest(`.${r}`),bg=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),n_=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,af=(t,r=0,i=n_,s=()=>{})=>{const u=typeof r=="number"&&r>0;return u||s(),u?t.transition().duration(r).ease(i).on("end",s):t},kg=t=>{const r=t.ctrlKey&&Ma()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function r_({zoomPanValues:t,noWheelClassName:r,d3Selection:i,d3Zoom:s,panOnScrollMode:u,panOnScrollSpeed:f,zoomOnPinch:d,onPanZoomStart:m,onPanZoom:v,onPanZoomEnd:w}){return b=>{if(Ns(b,r))return b.ctrlKey&&b.preventDefault(),!1;b.preventDefault(),b.stopImmediatePropagation();const x=i.property("__zoom").k||1;if(b.ctrlKey&&d){const I=Tr(b),A=kg(b),V=x*Math.pow(2,A);s.scaleTo(i,V,I,b);return}const S=b.deltaMode===1?20:1;let C=u===Ri.Vertical?0:b.deltaX*S,j=u===Ri.Horizontal?0:b.deltaY*S;!Ma()&&b.shiftKey&&u!==Ri.Vertical&&(C=b.deltaY*S,j=0),s.translateBy(i,-(C/x)*f,-(j/x)*f,{internal:!0});const M=Pu(i.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(v==null||v(b,M),t.panScrollTimeout=setTimeout(()=>{w==null||w(b,M),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,m==null||m(b,M))}}function o_({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:i}){return function(s,u){const f=s.type==="wheel",d=!r&&f&&!s.ctrlKey,m=Ns(s,t);if(s.ctrlKey&&f&&m&&s.preventDefault(),d||m)return null;s.preventDefault(),i.call(this,s,u)}}function i_({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:i}){return s=>{var f,d,m;if((f=s.sourceEvent)!=null&&f.internal)return;const u=Pu(s.transform);t.mouseButton=((d=s.sourceEvent)==null?void 0:d.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=u,((m=s.sourceEvent)==null?void 0:m.type)==="mousedown"&&r(!0),i&&(i==null||i(s.sourceEvent,u))}}function s_({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:i,onTransformChange:s,onPanZoom:u}){return f=>{var d,m;t.usedRightMouseButton=!!(i&&bg(r,t.mouseButton??0)),(d=f.sourceEvent)!=null&&d.sync||s([f.transform.x,f.transform.y,f.transform.k]),u&&!((m=f.sourceEvent)!=null&&m.internal)&&(u==null||u(f.sourceEvent,Pu(f.transform)))}}function a_({zoomPanValues:t,panOnDrag:r,panOnScroll:i,onDraggingChange:s,onPanZoomEnd:u,onPaneContextMenu:f}){return d=>{var m;if(!((m=d.sourceEvent)!=null&&m.internal)&&(t.isZoomingOrPanning=!1,f&&bg(r,t.mouseButton??0)&&!t.usedRightMouseButton&&d.sourceEvent&&f(d.sourceEvent),t.usedRightMouseButton=!1,s(!1),u)){const v=Pu(d.transform);t.prevViewport=v,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{u==null||u(d.sourceEvent,v)},i?150:0)}}}function l_({zoomActivationKeyPressed:t,zoomOnScroll:r,zoomOnPinch:i,panOnDrag:s,panOnScroll:u,zoomOnDoubleClick:f,userSelectionActive:d,noWheelClassName:m,noPanClassName:v,lib:w,connectionInProgress:b}){return x=>{var I;const S=t||r,C=i&&x.ctrlKey,j=x.type==="wheel";if(x.button===1&&x.type==="mousedown"&&(Ns(x,`${w}-flow__node`)||Ns(x,`${w}-flow__edge`)))return!0;if(!s&&!S&&!u&&!f&&!i||d||b&&!j||Ns(x,m)&&j||Ns(x,v)&&(!j||u&&j&&!t)||!i&&x.ctrlKey&&j)return!1;if(!i&&x.type==="touchstart"&&((I=x.touches)==null?void 0:I.length)>1)return x.preventDefault(),!1;if(!S&&!u&&!C&&j||!s&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(s)&&!s.includes(x.button)&&x.type==="mousedown")return!1;const M=Array.isArray(s)&&s.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||j)&&M}}function u_({domNode:t,minZoom:r,maxZoom:i,translateExtent:s,viewport:u,onPanZoom:f,onPanZoomStart:d,onPanZoomEnd:m,onDraggingChange:v}){const w={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},b=t.getBoundingClientRect(),x=Xm().scaleExtent([r,i]).translateExtent(s),S=Zn(t).call(x);V({x:u.x,y:u.y,zoom:Is(u.zoom,r,i)},[[0,0],[b.width,b.height]],s);const C=S.on("wheel.zoom"),j=S.on("dblclick.zoom");x.wheelDelta(kg);function M(K,ce){return S?new Promise(xe=>{x==null||x.interpolate((ce==null?void 0:ce.interpolate)==="linear"?Sa:tu).transform(af(S,ce==null?void 0:ce.duration,ce==null?void 0:ce.ease,()=>xe(!0)),K)}):Promise.resolve(!1)}function I({noWheelClassName:K,noPanClassName:ce,onPaneContextMenu:xe,userSelectionActive:D,panOnScroll:le,panOnDrag:Q,panOnScrollMode:se,panOnScrollSpeed:L,preventScrolling:U,zoomOnPinch:F,zoomOnScroll:$,zoomOnDoubleClick:H,zoomActivationKeyPressed:we,lib:be,onTransformChange:Te,connectionInProgress:$e,paneClickDistance:Re,selectionOnDrag:_e}){D&&!w.isZoomingOrPanning&&A();const Be=le&&!we&&!D;x.clickDistance(_e?1/0:!Ir(Re)||Re<0?0:Re);const ke=Be?r_({zoomPanValues:w,noWheelClassName:K,d3Selection:S,d3Zoom:x,panOnScrollMode:se,panOnScrollSpeed:L,zoomOnPinch:F,onPanZoomStart:d,onPanZoom:f,onPanZoomEnd:m}):o_({noWheelClassName:K,preventScrolling:U,d3ZoomHandler:C});if(S.on("wheel.zoom",ke,{passive:!1}),!D){const Ae=i_({zoomPanValues:w,onDraggingChange:v,onPanZoomStart:d});x.on("start",Ae);const qe=s_({zoomPanValues:w,panOnDrag:Q,onPaneContextMenu:!!xe,onPanZoom:f,onTransformChange:Te});x.on("zoom",qe);const ut=a_({zoomPanValues:w,panOnDrag:Q,panOnScroll:le,onPaneContextMenu:xe,onPanZoomEnd:m,onDraggingChange:v});x.on("end",ut)}const He=l_({zoomActivationKeyPressed:we,panOnDrag:Q,zoomOnScroll:$,panOnScroll:le,zoomOnDoubleClick:H,zoomOnPinch:F,userSelectionActive:D,noPanClassName:ce,noWheelClassName:K,lib:be,connectionInProgress:$e});x.filter(He),H?S.on("dblclick.zoom",j):S.on("dblclick.zoom",null)}function A(){x.on("zoom",null)}async function V(K,ce,xe){const D=sf(K),le=x==null?void 0:x.constrain()(D,ce,xe);return le&&await M(le),new Promise(Q=>Q(le))}async function P(K,ce){const xe=sf(K);return await M(xe,ce),new Promise(D=>D(xe))}function R(K){if(S){const ce=sf(K),xe=S.property("__zoom");(xe.k!==K.zoom||xe.x!==K.x||xe.y!==K.y)&&(x==null||x.transform(S,ce,null,{sync:!0}))}}function q(){const K=S?Ym(S.node()):{x:0,y:0,k:1};return{x:K.x,y:K.y,zoom:K.k}}function B(K,ce){return S?new Promise(xe=>{x==null||x.interpolate((ce==null?void 0:ce.interpolate)==="linear"?Sa:tu).scaleTo(af(S,ce==null?void 0:ce.duration,ce==null?void 0:ce.ease,()=>xe(!0)),K)}):Promise.resolve(!1)}function X(K,ce){return S?new Promise(xe=>{x==null||x.interpolate((ce==null?void 0:ce.interpolate)==="linear"?Sa:tu).scaleBy(af(S,ce==null?void 0:ce.duration,ce==null?void 0:ce.ease,()=>xe(!0)),K)}):Promise.resolve(!1)}function fe(K){x==null||x.scaleExtent(K)}function he(K){x==null||x.translateExtent(K)}function Se(K){const ce=!Ir(K)||K<0?0:K;x==null||x.clickDistance(ce)}return{update:I,destroy:A,setViewport:P,setViewportConstrained:V,getViewport:q,scaleTo:B,scaleBy:X,setScaleExtent:fe,setTranslateExtent:he,syncViewport:R,setClickDistance:Se}}var Os;(function(t){t.Line="line",t.Handle="handle"})(Os||(Os={}));function c_({width:t,prevWidth:r,height:i,prevHeight:s,affectsX:u,affectsY:f}){const d=t-r,m=i-s,v=[d>0?1:d<0?-1:0,m>0?1:m<0?-1:0];return d&&u&&(v[0]=v[0]*-1),m&&f&&(v[1]=v[1]*-1),v}function Mh(t){const r=t.includes("right")||t.includes("left"),i=t.includes("bottom")||t.includes("top"),s=t.includes("left"),u=t.includes("top");return{isHorizontal:r,isVertical:i,affectsX:s,affectsY:u}}function si(t,r){return Math.max(0,r-t)}function ai(t,r){return Math.max(0,t-r)}function Ql(t,r,i){return Math.max(0,r-t,t-i)}function Ih(t,r){return t?!r:r}function f_(t,r,i,s,u,f,d,m){let{affectsX:v,affectsY:w}=r;const{isHorizontal:b,isVertical:x}=r,S=b&&x,{xSnapped:C,ySnapped:j}=i,{minWidth:M,maxWidth:I,minHeight:A,maxHeight:V}=s,{x:P,y:R,width:q,height:B,aspectRatio:X}=t;let fe=Math.floor(b?C-t.pointerX:0),he=Math.floor(x?j-t.pointerY:0);const Se=q+(v?-fe:fe),K=B+(w?-he:he),ce=-f[0]*q,xe=-f[1]*B;let D=Ql(Se,M,I),le=Ql(K,A,V);if(d){let L=0,U=0;v&&fe<0?L=si(P+fe+ce,d[0][0]):!v&&fe>0&&(L=ai(P+Se+ce,d[1][0])),w&&he<0?U=si(R+he+xe,d[0][1]):!w&&he>0&&(U=ai(R+K+xe,d[1][1])),D=Math.max(D,L),le=Math.max(le,U)}if(m){let L=0,U=0;v&&fe>0?L=ai(P+fe,m[0][0]):!v&&fe<0&&(L=si(P+Se,m[1][0])),w&&he>0?U=ai(R+he,m[0][1]):!w&&he<0&&(U=si(R+K,m[1][1])),D=Math.max(D,L),le=Math.max(le,U)}if(u){if(b){const L=Ql(Se/X,A,V)*X;if(D=Math.max(D,L),d){let U=0;!v&&!w||v&&!w&&S?U=ai(R+xe+Se/X,d[1][1])*X:U=si(R+xe+(v?fe:-fe)/X,d[0][1])*X,D=Math.max(D,U)}if(m){let U=0;!v&&!w||v&&!w&&S?U=si(R+Se/X,m[1][1])*X:U=ai(R+(v?fe:-fe)/X,m[0][1])*X,D=Math.max(D,U)}}if(x){const L=Ql(K*X,M,I)/X;if(le=Math.max(le,L),d){let U=0;!v&&!w||w&&!v&&S?U=ai(P+K*X+ce,d[1][0])/X:U=si(P+(w?he:-he)*X+ce,d[0][0])/X,le=Math.max(le,U)}if(m){let U=0;!v&&!w||w&&!v&&S?U=si(P+K*X,m[1][0])/X:U=ai(P+(w?he:-he)*X,m[0][0])/X,le=Math.max(le,U)}}}he=he+(he<0?le:-le),fe=fe+(fe<0?D:-D),u&&(S?Se>K*X?he=(Ih(v,w)?-fe:fe)/X:fe=(Ih(v,w)?-he:he)*X:b?(he=fe/X,w=v):(fe=he*X,v=w));const Q=v?P+fe:P,se=w?R+he:R;return{width:q+(v?-fe:fe),height:B+(w?-he:he),x:f[0]*fe*(v?-1:1)+Q,y:f[1]*he*(w?-1:1)+se}}const Ng={width:0,height:0,x:0,y:0},d_={...Ng,pointerX:0,pointerY:0,aspectRatio:1};function p_(t){return[[0,0],[t.measured.width,t.measured.height]]}function h_(t,r,i){const s=r.position.x+t.position.x,u=r.position.y+t.position.y,f=t.measured.width??0,d=t.measured.height??0,m=i[0]*f,v=i[1]*d;return[[s-m,u-v],[s+f-m,u+d-v]]}function m_({domNode:t,nodeId:r,getStoreItems:i,onChange:s,onEnd:u}){const f=Zn(t);let d={controlDirection:Mh("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function m({controlPosition:w,boundaries:b,keepAspectRatio:x,resizeDirection:S,onResizeStart:C,onResize:j,onResizeEnd:M,shouldResize:I}){let A={...Ng},V={...d_};d={boundaries:b,resizeDirection:S,keepAspectRatio:x,controlDirection:Mh(w)};let P,R=null,q=[],B,X,fe,he=!1;const Se=Am().on("start",K=>{const{nodeLookup:ce,transform:xe,snapGrid:D,snapToGrid:le,nodeOrigin:Q,paneDomNode:se}=i();if(P=ce.get(r),!P)return;R=(se==null?void 0:se.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:U}=ba(K.sourceEvent,{transform:xe,snapGrid:D,snapToGrid:le,containerBounds:R});A={width:P.measured.width??0,height:P.measured.height??0,x:P.position.x??0,y:P.position.y??0},V={...A,pointerX:L,pointerY:U,aspectRatio:A.width/A.height},B=void 0,P.parentId&&(P.extent==="parent"||P.expandParent)&&(B=ce.get(P.parentId),X=B&&P.extent==="parent"?p_(B):void 0),q=[],fe=void 0;for(const[F,$]of ce)if($.parentId===r&&(q.push({id:F,position:{...$.position},extent:$.extent}),$.extent==="parent"||$.expandParent)){const H=h_($,P,$.origin??Q);fe?fe=[[Math.min(H[0][0],fe[0][0]),Math.min(H[0][1],fe[0][1])],[Math.max(H[1][0],fe[1][0]),Math.max(H[1][1],fe[1][1])]]:fe=H}C==null||C(K,{...A})}).on("drag",K=>{const{transform:ce,snapGrid:xe,snapToGrid:D,nodeOrigin:le}=i(),Q=ba(K.sourceEvent,{transform:ce,snapGrid:xe,snapToGrid:D,containerBounds:R}),se=[];if(!P)return;const{x:L,y:U,width:F,height:$}=A,H={},we=P.origin??le,{width:be,height:Te,x:$e,y:Re}=f_(V,d.controlDirection,Q,d.boundaries,d.keepAspectRatio,we,X,fe),_e=be!==F,Be=Te!==$,ke=$e!==L&&_e,He=Re!==U&&Be;if(!ke&&!He&&!_e&&!Be)return;if((ke||He||we[0]===1||we[1]===1)&&(H.x=ke?$e:A.x,H.y=He?Re:A.y,A.x=H.x,A.y=H.y,q.length>0)){const ct=$e-L,it=Re-U;for(const Mt of q)Mt.position={x:Mt.position.x-ct+we[0]*(be-F),y:Mt.position.y-it+we[1]*(Te-$)},se.push(Mt)}if((_e||Be)&&(H.width=_e&&(!d.resizeDirection||d.resizeDirection==="horizontal")?be:A.width,H.height=Be&&(!d.resizeDirection||d.resizeDirection==="vertical")?Te:A.height,A.width=H.width,A.height=H.height),B&&P.expandParent){const ct=we[0]*(H.width??0);H.x&&H.x<ct&&(A.x=ct,V.x=V.x-(H.x-ct));const it=we[1]*(H.height??0);H.y&&H.y<it&&(A.y=it,V.y=V.y-(H.y-it))}const Ae=c_({width:A.width,prevWidth:F,height:A.height,prevHeight:$,affectsX:d.controlDirection.affectsX,affectsY:d.controlDirection.affectsY}),qe={...A,direction:Ae};(I==null?void 0:I(K,qe))!==!1&&(he=!0,j==null||j(K,qe),s(H,se))}).on("end",K=>{he&&(M==null||M(K,{...A}),u==null||u({...A}),he=!1)});f.call(Se)}function v(){f.on(".drag",null)}return{update:m,destroy:v}}var lf={exports:{}},uf={},cf={exports:{}},ff={};/**
|
|
181
|
+
* @license React
|
|
182
|
+
* use-sync-external-store-shim.production.js
|
|
183
|
+
*
|
|
184
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
185
|
+
*
|
|
186
|
+
* This source code is licensed under the MIT license found in the
|
|
187
|
+
* LICENSE file in the root directory of this source tree.
|
|
188
|
+
*/var $h;function g_(){if($h)return ff;$h=1;var t=$a();function r(x,S){return x===S&&(x!==0||1/x===1/S)||x!==x&&S!==S}var i=typeof Object.is=="function"?Object.is:r,s=t.useState,u=t.useEffect,f=t.useLayoutEffect,d=t.useDebugValue;function m(x,S){var C=S(),j=s({inst:{value:C,getSnapshot:S}}),M=j[0].inst,I=j[1];return f(function(){M.value=C,M.getSnapshot=S,v(M)&&I({inst:M})},[x,C,S]),u(function(){return v(M)&&I({inst:M}),x(function(){v(M)&&I({inst:M})})},[x]),d(C),C}function v(x){var S=x.getSnapshot;x=x.value;try{var C=S();return!i(x,C)}catch{return!0}}function w(x,S){return S()}var b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?w:m;return ff.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:b,ff}var Ah;function y_(){return Ah||(Ah=1,cf.exports=g_()),cf.exports}/**
|
|
189
|
+
* @license React
|
|
190
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
191
|
+
*
|
|
192
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
193
|
+
*
|
|
194
|
+
* This source code is licensed under the MIT license found in the
|
|
195
|
+
* LICENSE file in the root directory of this source tree.
|
|
196
|
+
*/var Oh;function v_(){if(Oh)return uf;Oh=1;var t=$a(),r=y_();function i(w,b){return w===b&&(w!==0||1/w===1/b)||w!==w&&b!==b}var s=typeof Object.is=="function"?Object.is:i,u=r.useSyncExternalStore,f=t.useRef,d=t.useEffect,m=t.useMemo,v=t.useDebugValue;return uf.useSyncExternalStoreWithSelector=function(w,b,x,S,C){var j=f(null);if(j.current===null){var M={hasValue:!1,value:null};j.current=M}else M=j.current;j=m(function(){function A(B){if(!V){if(V=!0,P=B,B=S(B),C!==void 0&&M.hasValue){var X=M.value;if(C(X,B))return R=X}return R=B}if(X=R,s(P,B))return X;var fe=S(B);return C!==void 0&&C(X,fe)?(P=B,X):(P=B,R=fe)}var V=!1,P,R,q=x===void 0?null:x;return[function(){return A(b())},q===null?void 0:function(){return A(q())}]},[b,x,S,C]);var I=u(w,j[0],j[1]);return d(function(){M.hasValue=!0,M.value=I},[I]),v(I),I},uf}var Rh;function x_(){return Rh||(Rh=1,lf.exports=v_()),lf.exports}var w_=x_();const __=vu(w_),S_={},Dh=t=>{let r;const i=new Set,s=(b,x)=>{const S=typeof b=="function"?b(r):b;if(!Object.is(S,r)){const C=r;r=x??(typeof S!="object"||S===null)?S:Object.assign({},r,S),i.forEach(j=>j(r,C))}},u=()=>r,v={setState:s,getState:u,getInitialState:()=>w,subscribe:b=>(i.add(b),()=>i.delete(b)),destroy:()=>{(S_?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),i.clear()}},w=r=t(s,u,v);return v},b_=t=>t?Dh(t):Dh,{useDebugValue:k_}=pm,{useSyncExternalStoreWithSelector:N_}=__,E_=t=>t;function Eg(t,r=E_,i){const s=N_(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,i);return k_(s),s}const zh=(t,r)=>{const i=b_(t),s=(u,f=r)=>Eg(i,u,f);return Object.assign(s,i),s},C_=(t,r)=>t?zh(t,r):zh;function At(t,r){if(Object.is(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(const[s,u]of t)if(!Object.is(u,r.get(s)))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(const s of t)if(!r.has(s))return!1;return!0}const i=Object.keys(t);if(i.length!==Object.keys(r).length)return!1;for(const s of i)if(!Object.prototype.hasOwnProperty.call(r,s)||!Object.is(t[s],r[s]))return!1;return!0}hm();const Tu=ee.createContext(null),j_=Tu.Provider,Cg=Qr.error001();function mt(t,r){const i=ee.useContext(Tu);if(i===null)throw new Error(Cg);return Eg(i,t,r)}function Tt(){const t=ee.useContext(Tu);if(t===null)throw new Error(Cg);return ee.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const Lh={display:"none"},P_={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},jg="react-flow__node-desc",Pg="react-flow__edge-desc",T_="react-flow__aria-live",M_=t=>t.ariaLiveMessage,I_=t=>t.ariaLabelConfig;function $_({rfId:t}){const r=mt(M_);return k.jsx("div",{id:`${T_}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:P_,children:r})}function A_({rfId:t,disableKeyboardA11y:r}){const i=mt(I_);return k.jsxs(k.Fragment,{children:[k.jsx("div",{id:`${jg}-${t}`,style:Lh,children:r?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),k.jsx("div",{id:`${Pg}-${t}`,style:Lh,children:i["edge.a11yDescription.default"]}),!r&&k.jsx($_,{rfId:t})]})}const Fa=ee.forwardRef(({position:t="top-left",children:r,className:i,style:s,...u},f)=>{const d=`${t}`.split("-");return k.jsx("div",{className:qt(["react-flow__panel",i,...d]),style:s,ref:f,...u,children:r})});Fa.displayName="Panel";function O_({proOptions:t,position:r="bottom-right"}){return t!=null&&t.hideAttribution?null:k.jsx(Fa,{position:r,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:k.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const R_=t=>{const r=[],i=[];for(const[,s]of t.nodeLookup)s.selected&&r.push(s.internals.userNode);for(const[,s]of t.edgeLookup)s.selected&&i.push(s);return{selectedNodes:r,selectedEdges:i}},Gl=t=>t.id;function D_(t,r){return At(t.selectedNodes.map(Gl),r.selectedNodes.map(Gl))&&At(t.selectedEdges.map(Gl),r.selectedEdges.map(Gl))}function z_({onSelectionChange:t}){const r=Tt(),{selectedNodes:i,selectedEdges:s}=mt(R_,D_);return ee.useEffect(()=>{const u={nodes:i,edges:s};t==null||t(u),r.getState().onSelectionChangeHandlers.forEach(f=>f(u))},[i,s,t]),null}const L_=t=>!!t.onSelectionChangeHandlers;function F_({onSelectionChange:t}){const r=mt(L_);return t||r?k.jsx(z_,{onSelectionChange:t}):null}const If=typeof window<"u"?ee.useLayoutEffect:ee.useEffect,Tg=[0,0],B_={x:0,y:0,zoom:1},H_=["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"],Fh=[...H_,"rfId"],V_=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),Bh={translateExtent:ja,nodeOrigin:Tg,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function U_(t){const{setNodes:r,setEdges:i,setMinZoom:s,setMaxZoom:u,setTranslateExtent:f,setNodeExtent:d,reset:m,setDefaultNodesAndEdges:v}=mt(V_,At),w=Tt();If(()=>(v(t.defaultNodes,t.defaultEdges),()=>{b.current=Bh,m()}),[]);const b=ee.useRef(Bh);return If(()=>{for(const x of Fh){const S=t[x],C=b.current[x];S!==C&&(typeof t[x]>"u"||(x==="nodes"?r(S):x==="edges"?i(S):x==="minZoom"?s(S):x==="maxZoom"?u(S):x==="translateExtent"?f(S):x==="nodeExtent"?d(S):x==="ariaLabelConfig"?w.setState({ariaLabelConfig:j1(S)}):x==="fitView"?w.setState({fitViewQueued:S}):x==="fitViewOptions"?w.setState({fitViewOptions:S}):w.setState({[x]:S})))}b.current=t},Fh.map(x=>t[x])),null}function Hh(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function K_(t){var s;const[r,i]=ee.useState(t==="system"?null:t);return ee.useEffect(()=>{if(t!=="system"){i(t);return}const u=Hh(),f=()=>i(u!=null&&u.matches?"dark":"light");return f(),u==null||u.addEventListener("change",f),()=>{u==null||u.removeEventListener("change",f)}},[t]),r!==null?r:(s=Hh())!=null&&s.matches?"dark":"light"}const Vh=typeof document<"u"?document:null;function Ia(t=null,r={target:Vh,actInsideInputWithModifier:!0}){const[i,s]=ee.useState(!1),u=ee.useRef(!1),f=ee.useRef(new Set([])),[d,m]=ee.useMemo(()=>{if(t!==null){const w=(Array.isArray(t)?t:[t]).filter(x=>typeof x=="string").map(x=>x.replace("+",`
|
|
197
|
+
`).replace(`
|
|
198
|
+
|
|
199
|
+
`,`
|
|
200
|
+
+`).split(`
|
|
201
|
+
`)),b=w.reduce((x,S)=>x.concat(...S),[]);return[w,b]}return[[],[]]},[t]);return ee.useEffect(()=>{const v=(r==null?void 0:r.target)??Vh,w=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(t!==null){const b=C=>{var I,A;if(u.current=C.ctrlKey||C.metaKey||C.shiftKey||C.altKey,(!u.current||u.current&&!w)&&lg(C))return!1;const M=Kh(C.code,m);if(f.current.add(C[M]),Uh(d,f.current,!1)){const V=((A=(I=C.composedPath)==null?void 0:I.call(C))==null?void 0:A[0])||C.target,P=(V==null?void 0:V.nodeName)==="BUTTON"||(V==null?void 0:V.nodeName)==="A";r.preventDefault!==!1&&(u.current||!P)&&C.preventDefault(),s(!0)}},x=C=>{const j=Kh(C.code,m);Uh(d,f.current,!0)?(s(!1),f.current.clear()):f.current.delete(C[j]),C.key==="Meta"&&f.current.clear(),u.current=!1},S=()=>{f.current.clear(),s(!1)};return v==null||v.addEventListener("keydown",b),v==null||v.addEventListener("keyup",x),window.addEventListener("blur",S),window.addEventListener("contextmenu",S),()=>{v==null||v.removeEventListener("keydown",b),v==null||v.removeEventListener("keyup",x),window.removeEventListener("blur",S),window.removeEventListener("contextmenu",S)}}},[t,s]),i}function Uh(t,r,i){return t.filter(s=>i||s.length===r.size).some(s=>s.every(u=>r.has(u)))}function Kh(t,r){return r.includes(t)?"code":"key"}const q_=()=>{const t=Tt();return ee.useMemo(()=>({zoomIn:r=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1.2,r):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:i}=t.getState();return i?i.scaleBy(1/1.2,r):Promise.resolve(!1)},zoomTo:(r,i)=>{const{panZoom:s}=t.getState();return s?s.scaleTo(r,i):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(r,i)=>{const{transform:[s,u,f],panZoom:d}=t.getState();return d?(await d.setViewport({x:r.x??s,y:r.y??u,zoom:r.zoom??f},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,i,s]=t.getState().transform;return{x:r,y:i,zoom:s}},setCenter:async(r,i,s)=>t.getState().setCenter(r,i,s),fitBounds:async(r,i)=>{const{width:s,height:u,minZoom:f,maxZoom:d,panZoom:m}=t.getState(),v=Uf(r,s,u,f,d,(i==null?void 0:i.padding)??.1);return m?(await m.setViewport(v,{duration:i==null?void 0:i.duration,ease:i==null?void 0:i.ease,interpolate:i==null?void 0:i.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,i={})=>{const{transform:s,snapGrid:u,snapToGrid:f,domNode:d}=t.getState();if(!d)return r;const{x:m,y:v}=d.getBoundingClientRect(),w={x:r.x-m,y:r.y-v},b=i.snapGrid??u,x=i.snapToGrid??f;return La(w,s,x,b)},flowToScreenPosition:r=>{const{transform:i,domNode:s}=t.getState();if(!s)return r;const{x:u,y:f}=s.getBoundingClientRect(),d=gu(r,i);return{x:d.x+u,y:d.y+f}}}),[])};function Mg(t,r){const i=[],s=new Map,u=[];for(const f of t)if(f.type==="add"){u.push(f);continue}else if(f.type==="remove"||f.type==="replace")s.set(f.id,[f]);else{const d=s.get(f.id);d?d.push(f):s.set(f.id,[f])}for(const f of r){const d=s.get(f.id);if(!d){i.push(f);continue}if(d[0].type==="remove")continue;if(d[0].type==="replace"){i.push({...d[0].item});continue}const m={...f};for(const v of d)W_(v,m);i.push(m)}return u.length&&u.forEach(f=>{f.index!==void 0?i.splice(f.index,0,{...f.item}):i.push({...f.item})}),i}function W_(t,r){switch(t.type){case"select":{r.selected=t.selected;break}case"position":{typeof t.position<"u"&&(r.position=t.position),typeof t.dragging<"u"&&(r.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(r.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(r.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(r.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(r.resizing=t.resizing);break}}}function Ig(t,r){return Mg(t,r)}function $g(t,r){return Mg(t,r)}function $i(t,r){return{id:t,type:"select",selected:r}}function Es(t,r=new Set,i=!1){const s=[];for(const[u,f]of t){const d=r.has(u);!(f.selected===void 0&&!d)&&f.selected!==d&&(i&&(f.selected=d),s.push($i(f.id,d)))}return s}function qh({items:t=[],lookup:r}){var u;const i=[],s=new Map(t.map(f=>[f.id,f]));for(const[f,d]of t.entries()){const m=r.get(d.id),v=((u=m==null?void 0:m.internals)==null?void 0:u.userNode)??m;v!==void 0&&v!==d&&i.push({id:d.id,item:d,type:"replace"}),v===void 0&&i.push({item:d,type:"add",index:f})}for(const[f]of r)s.get(f)===void 0&&i.push({id:f,type:"remove"});return i}function Wh(t){return{id:t.id,type:"remove"}}const Yh=t=>v1(t),Y_=t=>eg(t);function Ag(t){return ee.forwardRef(t)}function Xh(t){const[r,i]=ee.useState(BigInt(0)),[s]=ee.useState(()=>X_(()=>i(u=>u+BigInt(1))));return If(()=>{const u=s.get();u.length&&(t(u),s.reset())},[r]),s}function X_(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:i=>{r.push(i),t()}}}const Og=ee.createContext(null);function Q_({children:t}){const r=Tt(),i=ee.useCallback(m=>{const{nodes:v=[],setNodes:w,hasDefaultNodes:b,onNodesChange:x,nodeLookup:S,fitViewQueued:C,onNodesChangeMiddlewareMap:j}=r.getState();let M=v;for(const A of m)M=typeof A=="function"?A(M):A;let I=qh({items:M,lookup:S});for(const A of j.values())I=A(I);b&&w(M),I.length>0?x==null||x(I):C&&window.requestAnimationFrame(()=>{const{fitViewQueued:A,nodes:V,setNodes:P}=r.getState();A&&P(V)})},[]),s=Xh(i),u=ee.useCallback(m=>{const{edges:v=[],setEdges:w,hasDefaultEdges:b,onEdgesChange:x,edgeLookup:S}=r.getState();let C=v;for(const j of m)C=typeof j=="function"?j(C):j;b?w(C):x&&x(qh({items:C,lookup:S}))},[]),f=Xh(u),d=ee.useMemo(()=>({nodeQueue:s,edgeQueue:f}),[]);return k.jsx(Og.Provider,{value:d,children:t})}function G_(){const t=ee.useContext(Og);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const J_=t=>!!t.panZoom;function Gf(){const t=q_(),r=Tt(),i=G_(),s=mt(J_),u=ee.useMemo(()=>{const f=x=>r.getState().nodeLookup.get(x),d=x=>{i.nodeQueue.push(x)},m=x=>{i.edgeQueue.push(x)},v=x=>{var A,V;const{nodeLookup:S,nodeOrigin:C}=r.getState(),j=Yh(x)?x:S.get(x.id),M=j.parentId?sg(j.position,j.measured,j.parentId,S,C):j.position,I={...j,position:M,width:((A=j.measured)==null?void 0:A.width)??j.width,height:((V=j.measured)==null?void 0:V.height)??j.height};return $s(I)},w=(x,S,C={replace:!1})=>{d(j=>j.map(M=>{if(M.id===x){const I=typeof S=="function"?S(M):S;return C.replace&&Yh(I)?I:{...M,...I}}return M}))},b=(x,S,C={replace:!1})=>{m(j=>j.map(M=>{if(M.id===x){const I=typeof S=="function"?S(M):S;return C.replace&&Y_(I)?I:{...M,...I}}return M}))};return{getNodes:()=>r.getState().nodes.map(x=>({...x})),getNode:x=>{var S;return(S=f(x))==null?void 0:S.internals.userNode},getInternalNode:f,getEdges:()=>{const{edges:x=[]}=r.getState();return x.map(S=>({...S}))},getEdge:x=>r.getState().edgeLookup.get(x),setNodes:d,setEdges:m,addNodes:x=>{const S=Array.isArray(x)?x:[x];i.nodeQueue.push(C=>[...C,...S])},addEdges:x=>{const S=Array.isArray(x)?x:[x];i.edgeQueue.push(C=>[...C,...S])},toObject:()=>{const{nodes:x=[],edges:S=[],transform:C}=r.getState(),[j,M,I]=C;return{nodes:x.map(A=>({...A})),edges:S.map(A=>({...A})),viewport:{x:j,y:M,zoom:I}}},deleteElements:async({nodes:x=[],edges:S=[]})=>{const{nodes:C,edges:j,onNodesDelete:M,onEdgesDelete:I,triggerNodeChanges:A,triggerEdgeChanges:V,onDelete:P,onBeforeDelete:R}=r.getState(),{nodes:q,edges:B}=await b1({nodesToRemove:x,edgesToRemove:S,nodes:C,edges:j,onBeforeDelete:R}),X=B.length>0,fe=q.length>0;if(X){const he=B.map(Wh);I==null||I(B),V(he)}if(fe){const he=q.map(Wh);M==null||M(q),A(he)}return(fe||X)&&(P==null||P({nodes:q,edges:B})),{deletedNodes:q,deletedEdges:B}},getIntersectingNodes:(x,S=!0,C)=>{const j=wh(x),M=j?x:v(x),I=C!==void 0;return M?(C||r.getState().nodes).filter(A=>{const V=r.getState().nodeLookup.get(A.id);if(V&&!j&&(A.id===x.id||!V.internals.positionAbsolute))return!1;const P=$s(I?A:V),R=Ta(P,M);return S&&R>0||R>=P.width*P.height||R>=M.width*M.height}):[]},isNodeIntersecting:(x,S,C=!0)=>{const M=wh(x)?x:v(x);if(!M)return!1;const I=Ta(M,S);return C&&I>0||I>=S.width*S.height||I>=M.width*M.height},updateNode:w,updateNodeData:(x,S,C={replace:!1})=>{w(x,j=>{const M=typeof S=="function"?S(j):S;return C.replace?{...j,data:M}:{...j,data:{...j.data,...M}}},C)},updateEdge:b,updateEdgeData:(x,S,C={replace:!1})=>{b(x,j=>{const M=typeof S=="function"?S(j):S;return C.replace?{...j,data:M}:{...j,data:{...j.data,...M}}},C)},getNodesBounds:x=>{const{nodeLookup:S,nodeOrigin:C}=r.getState();return x1(x,{nodeLookup:S,nodeOrigin:C})},getHandleConnections:({type:x,id:S,nodeId:C})=>{var j;return Array.from(((j=r.getState().connectionLookup.get(`${C}-${x}${S?`-${S}`:""}`))==null?void 0:j.values())??[])},getNodeConnections:({type:x,handleId:S,nodeId:C})=>{var j;return Array.from(((j=r.getState().connectionLookup.get(`${C}${x?S?`-${x}-${S}`:`-${x}`:""}`))==null?void 0:j.values())??[])},fitView:async x=>{const S=r.getState().fitViewResolver??C1();return r.setState({fitViewQueued:!0,fitViewOptions:x,fitViewResolver:S}),i.nodeQueue.push(C=>[...C]),S.promise}}},[]);return ee.useMemo(()=>({...u,...t,viewportInitialized:s}),[s])}const Qh=t=>t.selected,Z_=typeof window<"u"?window:void 0;function eS({deleteKeyCode:t,multiSelectionKeyCode:r}){const i=Tt(),{deleteElements:s}=Gf(),u=Ia(t,{actInsideInputWithModifier:!1}),f=Ia(r,{target:Z_});ee.useEffect(()=>{if(u){const{edges:d,nodes:m}=i.getState();s({nodes:m.filter(Qh),edges:d.filter(Qh)}),i.setState({nodesSelectionActive:!1})}},[u]),ee.useEffect(()=>{i.setState({multiSelectionActive:f})},[f])}function tS(t){const r=Tt();ee.useEffect(()=>{const i=()=>{var u,f,d,m;if(!t.current||!(((f=(u=t.current).checkVisibility)==null?void 0:f.call(u))??!0))return!1;const s=Kf(t.current);(s.height===0||s.width===0)&&((m=(d=r.getState()).onError)==null||m.call(d,"004",Qr.error004())),r.setState({width:s.width||500,height:s.height||500})};if(t.current){i(),window.addEventListener("resize",i);const s=new ResizeObserver(()=>i());return s.observe(t.current),()=>{window.removeEventListener("resize",i),s&&t.current&&s.unobserve(t.current)}}},[])}const Mu={position:"absolute",width:"100%",height:"100%",top:0,left:0},nS=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function rS({onPaneContextMenu:t,zoomOnScroll:r=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:u=.5,panOnScrollMode:f=Ri.Free,zoomOnDoubleClick:d=!0,panOnDrag:m=!0,defaultViewport:v,translateExtent:w,minZoom:b,maxZoom:x,zoomActivationKeyCode:S,preventScrolling:C=!0,children:j,noWheelClassName:M,noPanClassName:I,onViewportChange:A,isControlledViewport:V,paneClickDistance:P,selectionOnDrag:R}){const q=Tt(),B=ee.useRef(null),{userSelectionActive:X,lib:fe,connectionInProgress:he}=mt(nS,At),Se=Ia(S),K=ee.useRef();tS(B);const ce=ee.useCallback(xe=>{A==null||A({x:xe[0],y:xe[1],zoom:xe[2]}),V||q.setState({transform:xe})},[A,V]);return ee.useEffect(()=>{if(B.current){K.current=u_({domNode:B.current,minZoom:b,maxZoom:x,translateExtent:w,viewport:v,onDraggingChange:Q=>q.setState(se=>se.paneDragging===Q?se:{paneDragging:Q}),onPanZoomStart:(Q,se)=>{const{onViewportChangeStart:L,onMoveStart:U}=q.getState();U==null||U(Q,se),L==null||L(se)},onPanZoom:(Q,se)=>{const{onViewportChange:L,onMove:U}=q.getState();U==null||U(Q,se),L==null||L(se)},onPanZoomEnd:(Q,se)=>{const{onViewportChangeEnd:L,onMoveEnd:U}=q.getState();U==null||U(Q,se),L==null||L(se)}});const{x:xe,y:D,zoom:le}=K.current.getViewport();return q.setState({panZoom:K.current,transform:[xe,D,le],domNode:B.current.closest(".react-flow")}),()=>{var Q;(Q=K.current)==null||Q.destroy()}}},[]),ee.useEffect(()=>{var xe;(xe=K.current)==null||xe.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:i,panOnScroll:s,panOnScrollSpeed:u,panOnScrollMode:f,zoomOnDoubleClick:d,panOnDrag:m,zoomActivationKeyPressed:Se,preventScrolling:C,noPanClassName:I,userSelectionActive:X,noWheelClassName:M,lib:fe,onTransformChange:ce,connectionInProgress:he,selectionOnDrag:R,paneClickDistance:P})},[t,r,i,s,u,f,d,m,Se,C,I,X,M,fe,ce,he,R,P]),k.jsx("div",{className:"react-flow__renderer",ref:B,style:Mu,children:j})}const oS=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function iS(){const{userSelectionActive:t,userSelectionRect:r}=mt(oS,At);return t&&r?k.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:r.width,height:r.height,transform:`translate(${r.x}px, ${r.y}px)`}}):null}const df=(t,r)=>i=>{i.target===r.current&&(t==null||t(i))},sS=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function aS({isSelecting:t,selectionKeyPressed:r,selectionMode:i=Pa.Full,panOnDrag:s,paneClickDistance:u,selectionOnDrag:f,onSelectionStart:d,onSelectionEnd:m,onPaneClick:v,onPaneContextMenu:w,onPaneScroll:b,onPaneMouseEnter:x,onPaneMouseMove:S,onPaneMouseLeave:C,children:j}){const M=Tt(),{userSelectionActive:I,elementsSelectable:A,dragging:V,connectionInProgress:P}=mt(sS,At),R=A&&(t||I),q=ee.useRef(null),B=ee.useRef(),X=ee.useRef(new Set),fe=ee.useRef(new Set),he=ee.useRef(!1),Se=L=>{if(he.current||P){he.current=!1;return}v==null||v(L),M.getState().resetSelectedElements(),M.setState({nodesSelectionActive:!1})},K=L=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){L.preventDefault();return}w==null||w(L)},ce=b?L=>b(L):void 0,xe=L=>{he.current&&(L.stopPropagation(),he.current=!1)},D=L=>{var Te,$e;const{domNode:U}=M.getState();if(B.current=U==null?void 0:U.getBoundingClientRect(),!B.current)return;const F=L.target===q.current;if(!F&&!!L.target.closest(".nokey")||!t||!(f&&F||r)||L.button!==0||!L.isPrimary)return;($e=(Te=L.target)==null?void 0:Te.setPointerCapture)==null||$e.call(Te,L.pointerId),he.current=!1;const{x:we,y:be}=$r(L.nativeEvent,B.current);M.setState({userSelectionRect:{width:0,height:0,startX:we,startY:be,x:we,y:be}}),F||(L.stopPropagation(),L.preventDefault())},le=L=>{const{userSelectionRect:U,transform:F,nodeLookup:$,edgeLookup:H,connectionLookup:we,triggerNodeChanges:be,triggerEdgeChanges:Te,defaultEdgeOptions:$e,resetSelectedElements:Re}=M.getState();if(!B.current||!U)return;const{x:_e,y:Be}=$r(L.nativeEvent,B.current),{startX:ke,startY:He}=U;if(!he.current){const it=r?0:u;if(Math.hypot(_e-ke,Be-He)<=it)return;Re(),d==null||d(L)}he.current=!0;const Ae={startX:ke,startY:He,x:_e<ke?_e:ke,y:Be<He?Be:He,width:Math.abs(_e-ke),height:Math.abs(Be-He)},qe=X.current,ut=fe.current;X.current=new Set(Vf($,Ae,F,i===Pa.Partial,!0).map(it=>it.id)),fe.current=new Set;const ct=($e==null?void 0:$e.selectable)??!0;for(const it of X.current){const Mt=we.get(it);if(Mt)for(const{edgeId:St}of Mt.values()){const tn=H.get(St);tn&&(tn.selectable??ct)&&fe.current.add(St)}}if(!_h(qe,X.current)){const it=Es($,X.current,!0);be(it)}if(!_h(ut,fe.current)){const it=Es(H,fe.current);Te(it)}M.setState({userSelectionRect:Ae,userSelectionActive:!0,nodesSelectionActive:!1})},Q=L=>{var U,F;L.button===0&&((F=(U=L.target)==null?void 0:U.releasePointerCapture)==null||F.call(U,L.pointerId),!I&&L.target===q.current&&M.getState().userSelectionRect&&(Se==null||Se(L)),M.setState({userSelectionActive:!1,userSelectionRect:null}),he.current&&(m==null||m(L),M.setState({nodesSelectionActive:X.current.size>0})))},se=s===!0||Array.isArray(s)&&s.includes(0);return k.jsxs("div",{className:qt(["react-flow__pane",{draggable:se,dragging:V,selection:t}]),onClick:R?void 0:df(Se,q),onContextMenu:df(K,q),onWheel:df(ce,q),onPointerEnter:R?void 0:x,onPointerMove:R?le:S,onPointerUp:R?Q:void 0,onPointerDownCapture:R?D:void 0,onClickCapture:R?xe:void 0,onPointerLeave:C,ref:q,style:Mu,children:[j,k.jsx(iS,{})]})}function $f({id:t,store:r,unselect:i=!1,nodeRef:s}){const{addSelectedNodes:u,unselectNodesAndEdges:f,multiSelectionActive:d,nodeLookup:m,onError:v}=r.getState(),w=m.get(t);if(!w){v==null||v("012",Qr.error012(t));return}r.setState({nodesSelectionActive:!1}),w.selected?(i||w.selected&&d)&&(f({nodes:[w],edges:[]}),requestAnimationFrame(()=>{var b;return(b=s==null?void 0:s.current)==null?void 0:b.blur()})):u([t])}function Rg({nodeRef:t,disabled:r=!1,noDragClassName:i,handleSelector:s,nodeId:u,isSelectable:f,nodeClickDistance:d}){const m=Tt(),[v,w]=ee.useState(!1),b=ee.useRef();return ee.useEffect(()=>{b.current=X1({getStoreItems:()=>m.getState(),onNodeMouseDown:x=>{$f({id:x,store:m,nodeRef:t})},onDragStart:()=>{w(!0)},onDragStop:()=>{w(!1)}})},[]),ee.useEffect(()=>{if(!(r||!t.current||!b.current))return b.current.update({noDragClassName:i,handleSelector:s,domNode:t.current,isSelectable:f,nodeId:u,nodeClickDistance:d}),()=>{var x;(x=b.current)==null||x.destroy()}},[i,s,r,f,t,u,d]),v}const lS=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function Dg(){const t=Tt();return ee.useCallback(i=>{const{nodeExtent:s,snapToGrid:u,snapGrid:f,nodesDraggable:d,onError:m,updateNodePositions:v,nodeLookup:w,nodeOrigin:b}=t.getState(),x=new Map,S=lS(d),C=u?f[0]:5,j=u?f[1]:5,M=i.direction.x*C*i.factor,I=i.direction.y*j*i.factor;for(const[,A]of w){if(!S(A))continue;let V={x:A.internals.positionAbsolute.x+M,y:A.internals.positionAbsolute.y+I};u&&(V=za(V,f));const{position:P,positionAbsolute:R}=tg({nodeId:A.id,nextPosition:V,nodeLookup:w,nodeExtent:s,nodeOrigin:b,onError:m});A.position=P,A.internals.positionAbsolute=R,x.set(A.id,A)}v(x)},[])}const Jf=ee.createContext(null),uS=Jf.Provider;Jf.Consumer;const zg=()=>ee.useContext(Jf),cS=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),fS=(t,r,i)=>s=>{const{connectionClickStartHandle:u,connectionMode:f,connection:d}=s,{fromHandle:m,toHandle:v,isValid:w}=d,b=(v==null?void 0:v.nodeId)===t&&(v==null?void 0:v.id)===r&&(v==null?void 0:v.type)===i;return{connectingFrom:(m==null?void 0:m.nodeId)===t&&(m==null?void 0:m.id)===r&&(m==null?void 0:m.type)===i,connectingTo:b,clickConnecting:(u==null?void 0:u.nodeId)===t&&(u==null?void 0:u.id)===r&&(u==null?void 0:u.type)===i,isPossibleEndHandle:f===Ms.Strict?(m==null?void 0:m.type)!==i:t!==(m==null?void 0:m.nodeId)||r!==(m==null?void 0:m.id),connectionInProcess:!!m,clickConnectionInProcess:!!u,valid:b&&w}};function dS({type:t="source",position:r=Ze.Top,isValidConnection:i,isConnectable:s=!0,isConnectableStart:u=!0,isConnectableEnd:f=!0,id:d,onConnect:m,children:v,className:w,onMouseDown:b,onTouchStart:x,...S},C){var le,Q;const j=d||null,M=t==="target",I=Tt(),A=zg(),{connectOnClick:V,noPanClassName:P,rfId:R}=mt(cS,At),{connectingFrom:q,connectingTo:B,clickConnecting:X,isPossibleEndHandle:fe,connectionInProcess:he,clickConnectionInProcess:Se,valid:K}=mt(fS(A,j,t),At);A||(Q=(le=I.getState()).onError)==null||Q.call(le,"010",Qr.error010());const ce=se=>{const{defaultEdgeOptions:L,onConnect:U,hasDefaultEdges:F}=I.getState(),$={...L,...se};if(F){const{edges:H,setEdges:we}=I.getState();we(pg($,H))}U==null||U($),m==null||m($)},xe=se=>{if(!A)return;const L=ug(se.nativeEvent);if(u&&(L&&se.button===0||!L)){const U=I.getState();Mf.onPointerDown(se.nativeEvent,{handleDomNode:se.currentTarget,autoPanOnConnect:U.autoPanOnConnect,connectionMode:U.connectionMode,connectionRadius:U.connectionRadius,domNode:U.domNode,nodeLookup:U.nodeLookup,lib:U.lib,isTarget:M,handleId:j,nodeId:A,flowId:U.rfId,panBy:U.panBy,cancelConnection:U.cancelConnection,onConnectStart:U.onConnectStart,onConnectEnd:(...F)=>{var $,H;return(H=($=I.getState()).onConnectEnd)==null?void 0:H.call($,...F)},updateConnection:U.updateConnection,onConnect:ce,isValidConnection:i||((...F)=>{var $,H;return((H=($=I.getState()).isValidConnection)==null?void 0:H.call($,...F))??!0}),getTransform:()=>I.getState().transform,getFromHandle:()=>I.getState().connection.fromHandle,autoPanSpeed:U.autoPanSpeed,dragThreshold:U.connectionDragThreshold})}L?b==null||b(se):x==null||x(se)},D=se=>{const{onClickConnectStart:L,onClickConnectEnd:U,connectionClickStartHandle:F,connectionMode:$,isValidConnection:H,lib:we,rfId:be,nodeLookup:Te,connection:$e}=I.getState();if(!A||!F&&!u)return;if(!F){L==null||L(se.nativeEvent,{nodeId:A,handleId:j,handleType:t}),I.setState({connectionClickStartHandle:{nodeId:A,type:t,id:j}});return}const Re=ag(se.target),_e=i||H,{connection:Be,isValid:ke}=Mf.isValid(se.nativeEvent,{handle:{nodeId:A,id:j,type:t},connectionMode:$,fromNodeId:F.nodeId,fromHandleId:F.id||null,fromType:F.type,isValidConnection:_e,flowId:be,doc:Re,lib:we,nodeLookup:Te});ke&&Be&&ce(Be);const He=structuredClone($e);delete He.inProgress,He.toPosition=He.toHandle?He.toHandle.position:null,U==null||U(se,He),I.setState({connectionClickStartHandle:null})};return k.jsx("div",{"data-handleid":j,"data-nodeid":A,"data-handlepos":r,"data-id":`${R}-${A}-${j}-${t}`,className:qt(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",P,w,{source:!M,target:M,connectable:s,connectablestart:u,connectableend:f,clickconnecting:X,connectingfrom:q,connectingto:B,valid:K,connectionindicator:s&&(!he||fe)&&(he||Se?f:u)}]),onMouseDown:xe,onTouchStart:xe,onClick:V?D:void 0,ref:C,...S,children:v})}const Rs=ee.memo(Ag(dS));function pS({data:t,isConnectable:r,sourcePosition:i=Ze.Bottom}){return k.jsxs(k.Fragment,{children:[t==null?void 0:t.label,k.jsx(Rs,{type:"source",position:i,isConnectable:r})]})}function hS({data:t,isConnectable:r,targetPosition:i=Ze.Top,sourcePosition:s=Ze.Bottom}){return k.jsxs(k.Fragment,{children:[k.jsx(Rs,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label,k.jsx(Rs,{type:"source",position:s,isConnectable:r})]})}function mS(){return null}function gS({data:t,isConnectable:r,targetPosition:i=Ze.Top}){return k.jsxs(k.Fragment,{children:[k.jsx(Rs,{type:"target",position:i,isConnectable:r}),t==null?void 0:t.label]})}const yu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Gh={input:pS,default:hS,output:gS,group:mS};function yS(t){var r,i,s,u;return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??((r=t.style)==null?void 0:r.width),height:t.height??t.initialHeight??((i=t.style)==null?void 0:i.height)}:{width:t.width??((s=t.style)==null?void 0:s.width),height:t.height??((u=t.style)==null?void 0:u.height)}}const vS=t=>{const{width:r,height:i,x:s,y:u}=Da(t.nodeLookup,{filter:f=>!!f.selected});return{width:Ir(r)?r:null,height:Ir(i)?i:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${s}px,${u}px)`}};function xS({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:i}){const s=Tt(),{width:u,height:f,transformString:d,userSelectionActive:m}=mt(vS,At),v=Dg(),w=ee.useRef(null);ee.useEffect(()=>{var C;i||(C=w.current)==null||C.focus({preventScroll:!0})},[i]);const b=!m&&u!==null&&f!==null;if(Rg({nodeRef:w,disabled:!b}),!b)return null;const x=t?C=>{const j=s.getState().nodes.filter(M=>M.selected);t(C,j)}:void 0,S=C=>{Object.prototype.hasOwnProperty.call(yu,C.key)&&(C.preventDefault(),v({direction:yu[C.key],factor:C.shiftKey?4:1}))};return k.jsx("div",{className:qt(["react-flow__nodesselection","react-flow__container",r]),style:{transform:d},children:k.jsx("div",{ref:w,className:"react-flow__nodesselection-rect",onContextMenu:x,tabIndex:i?void 0:-1,onKeyDown:i?void 0:S,style:{width:u,height:f}})})}const Jh=typeof window<"u"?window:void 0,wS=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function Lg({children:t,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:u,onPaneContextMenu:f,onPaneScroll:d,paneClickDistance:m,deleteKeyCode:v,selectionKeyCode:w,selectionOnDrag:b,selectionMode:x,onSelectionStart:S,onSelectionEnd:C,multiSelectionKeyCode:j,panActivationKeyCode:M,zoomActivationKeyCode:I,elementsSelectable:A,zoomOnScroll:V,zoomOnPinch:P,panOnScroll:R,panOnScrollSpeed:q,panOnScrollMode:B,zoomOnDoubleClick:X,panOnDrag:fe,defaultViewport:he,translateExtent:Se,minZoom:K,maxZoom:ce,preventScrolling:xe,onSelectionContextMenu:D,noWheelClassName:le,noPanClassName:Q,disableKeyboardA11y:se,onViewportChange:L,isControlledViewport:U}){const{nodesSelectionActive:F,userSelectionActive:$}=mt(wS,At),H=Ia(w,{target:Jh}),we=Ia(M,{target:Jh}),be=we||fe,Te=we||R,$e=b&&be!==!0,Re=H||$||$e;return eS({deleteKeyCode:v,multiSelectionKeyCode:j}),k.jsx(rS,{onPaneContextMenu:f,elementsSelectable:A,zoomOnScroll:V,zoomOnPinch:P,panOnScroll:Te,panOnScrollSpeed:q,panOnScrollMode:B,zoomOnDoubleClick:X,panOnDrag:!H&&be,defaultViewport:he,translateExtent:Se,minZoom:K,maxZoom:ce,zoomActivationKeyCode:I,preventScrolling:xe,noWheelClassName:le,noPanClassName:Q,onViewportChange:L,isControlledViewport:U,paneClickDistance:m,selectionOnDrag:$e,children:k.jsxs(aS,{onSelectionStart:S,onSelectionEnd:C,onPaneClick:r,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:u,onPaneContextMenu:f,onPaneScroll:d,panOnDrag:be,isSelecting:!!Re,selectionMode:x,selectionKeyPressed:H,paneClickDistance:m,selectionOnDrag:$e,children:[t,F&&k.jsx(xS,{onSelectionContextMenu:D,noPanClassName:Q,disableKeyboardA11y:se})]})})}Lg.displayName="FlowRenderer";const _S=ee.memo(Lg),SS=t=>r=>t?Vf(r.nodeLookup,{x:0,y:0,width:r.width,height:r.height},r.transform,!0).map(i=>i.id):Array.from(r.nodeLookup.keys());function bS(t){return mt(ee.useCallback(SS(t),[t]),At)}const kS=t=>t.updateNodeInternals;function NS(){const t=mt(kS),[r]=ee.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const s=new Map;i.forEach(u=>{const f=u.target.getAttribute("data-id");s.set(f,{id:f,nodeElement:u.target,force:!0})}),t(s)}));return ee.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function ES({node:t,nodeType:r,hasDimensions:i,resizeObserver:s}){const u=Tt(),f=ee.useRef(null),d=ee.useRef(null),m=ee.useRef(t.sourcePosition),v=ee.useRef(t.targetPosition),w=ee.useRef(r),b=i&&!!t.internals.handleBounds;return ee.useEffect(()=>{f.current&&!t.hidden&&(!b||d.current!==f.current)&&(d.current&&(s==null||s.unobserve(d.current)),s==null||s.observe(f.current),d.current=f.current)},[b,t.hidden]),ee.useEffect(()=>()=>{d.current&&(s==null||s.unobserve(d.current),d.current=null)},[]),ee.useEffect(()=>{if(f.current){const x=w.current!==r,S=m.current!==t.sourcePosition,C=v.current!==t.targetPosition;(x||S||C)&&(w.current=r,m.current=t.sourcePosition,v.current=t.targetPosition,u.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:f.current,force:!0}]])))}},[t.id,r,t.sourcePosition,t.targetPosition]),f}function CS({id:t,onClick:r,onMouseEnter:i,onMouseMove:s,onMouseLeave:u,onContextMenu:f,onDoubleClick:d,nodesDraggable:m,elementsSelectable:v,nodesConnectable:w,nodesFocusable:b,resizeObserver:x,noDragClassName:S,noPanClassName:C,disableKeyboardA11y:j,rfId:M,nodeTypes:I,nodeClickDistance:A,onError:V}){const{node:P,internals:R,isParent:q}=mt(_e=>{const Be=_e.nodeLookup.get(t),ke=_e.parentLookup.has(t);return{node:Be,internals:Be.internals,isParent:ke}},At);let B=P.type||"default",X=(I==null?void 0:I[B])||Gh[B];X===void 0&&(V==null||V("003",Qr.error003(B)),B="default",X=(I==null?void 0:I.default)||Gh.default);const fe=!!(P.draggable||m&&typeof P.draggable>"u"),he=!!(P.selectable||v&&typeof P.selectable>"u"),Se=!!(P.connectable||w&&typeof P.connectable>"u"),K=!!(P.focusable||b&&typeof P.focusable>"u"),ce=Tt(),xe=ig(P),D=ES({node:P,nodeType:B,hasDimensions:xe,resizeObserver:x}),le=Rg({nodeRef:D,disabled:P.hidden||!fe,noDragClassName:S,handleSelector:P.dragHandle,nodeId:t,isSelectable:he,nodeClickDistance:A}),Q=Dg();if(P.hidden)return null;const se=Mo(P),L=yS(P),U=he||fe||r||i||s||u,F=i?_e=>i(_e,{...R.userNode}):void 0,$=s?_e=>s(_e,{...R.userNode}):void 0,H=u?_e=>u(_e,{...R.userNode}):void 0,we=f?_e=>f(_e,{...R.userNode}):void 0,be=d?_e=>d(_e,{...R.userNode}):void 0,Te=_e=>{const{selectNodesOnDrag:Be,nodeDragThreshold:ke}=ce.getState();he&&(!Be||!fe||ke>0)&&$f({id:t,store:ce,nodeRef:D}),r&&r(_e,{...R.userNode})},$e=_e=>{if(!(lg(_e.nativeEvent)||j)){if(Qm.includes(_e.key)&&he){const Be=_e.key==="Escape";$f({id:t,store:ce,unselect:Be,nodeRef:D})}else if(fe&&P.selected&&Object.prototype.hasOwnProperty.call(yu,_e.key)){_e.preventDefault();const{ariaLabelConfig:Be}=ce.getState();ce.setState({ariaLiveMessage:Be["node.a11yDescription.ariaLiveMessage"]({direction:_e.key.replace("Arrow","").toLowerCase(),x:~~R.positionAbsolute.x,y:~~R.positionAbsolute.y})}),Q({direction:yu[_e.key],factor:_e.shiftKey?4:1})}}},Re=()=>{var ut;if(j||!((ut=D.current)!=null&&ut.matches(":focus-visible")))return;const{transform:_e,width:Be,height:ke,autoPanOnNodeFocus:He,setCenter:Ae}=ce.getState();if(!He)return;Vf(new Map([[t,P]]),{x:0,y:0,width:Be,height:ke},_e,!0).length>0||Ae(P.position.x+se.width/2,P.position.y+se.height/2,{zoom:_e[2]})};return k.jsx("div",{className:qt(["react-flow__node",`react-flow__node-${B}`,{[C]:fe},P.className,{selected:P.selected,selectable:he,parent:q,draggable:fe,dragging:le}]),ref:D,style:{zIndex:R.z,transform:`translate(${R.positionAbsolute.x}px,${R.positionAbsolute.y}px)`,pointerEvents:U?"all":"none",visibility:xe?"visible":"hidden",...P.style,...L},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:F,onMouseMove:$,onMouseLeave:H,onContextMenu:we,onClick:Te,onDoubleClick:be,onKeyDown:K?$e:void 0,tabIndex:K?0:void 0,onFocus:K?Re:void 0,role:P.ariaRole??(K?"group":void 0),"aria-roledescription":"node","aria-describedby":j?void 0:`${jg}-${M}`,"aria-label":P.ariaLabel,...P.domAttributes,children:k.jsx(uS,{value:t,children:k.jsx(X,{id:t,data:P.data,type:B,positionAbsoluteX:R.positionAbsolute.x,positionAbsoluteY:R.positionAbsolute.y,selected:P.selected??!1,selectable:he,draggable:fe,deletable:P.deletable??!0,isConnectable:Se,sourcePosition:P.sourcePosition,targetPosition:P.targetPosition,dragging:le,dragHandle:P.dragHandle,zIndex:R.z,parentId:P.parentId,...se})})})}var jS=ee.memo(CS);const PS=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function Fg(t){const{nodesDraggable:r,nodesConnectable:i,nodesFocusable:s,elementsSelectable:u,onError:f}=mt(PS,At),d=bS(t.onlyRenderVisibleElements),m=NS();return k.jsx("div",{className:"react-flow__nodes",style:Mu,children:d.map(v=>k.jsx(jS,{id:v,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:m,nodesDraggable:r,nodesConnectable:i,nodesFocusable:s,elementsSelectable:u,nodeClickDistance:t.nodeClickDistance,onError:f},v))})}Fg.displayName="NodeRenderer";const TS=ee.memo(Fg);function MS(t){return mt(ee.useCallback(i=>{if(!t)return i.edges.map(u=>u.id);const s=[];if(i.width&&i.height)for(const u of i.edges){const f=i.nodeLookup.get(u.source),d=i.nodeLookup.get(u.target);f&&d&&M1({sourceNode:f,targetNode:d,width:i.width,height:i.height,transform:i.transform})&&s.push(u.id)}return s},[t]),At)}const IS=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t}};return k.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},$S=({color:t="none",strokeWidth:r=1})=>{const i={strokeWidth:r,...t&&{stroke:t,fill:t}};return k.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Zh={[hu.Arrow]:IS,[hu.ArrowClosed]:$S};function AS(t){const r=Tt();return ee.useMemo(()=>{var u,f;return Object.prototype.hasOwnProperty.call(Zh,t)?Zh[t]:((f=(u=r.getState()).onError)==null||f.call(u,"009",Qr.error009(t)),null)},[t])}const OS=({id:t,type:r,color:i,width:s=12.5,height:u=12.5,markerUnits:f="strokeWidth",strokeWidth:d,orient:m="auto-start-reverse"})=>{const v=AS(r);return v?k.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${s}`,markerHeight:`${u}`,viewBox:"-10 -10 20 20",markerUnits:f,orient:m,refX:"0",refY:"0",children:k.jsx(v,{color:i,strokeWidth:d})}):null},Bg=({defaultColor:t,rfId:r})=>{const i=mt(f=>f.edges),s=mt(f=>f.defaultEdgeOptions),u=ee.useMemo(()=>z1(i,{id:r,defaultColor:t,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[i,s,r,t]);return u.length?k.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:k.jsx("defs",{children:u.map(f=>k.jsx(OS,{id:f.id,type:f.type,color:f.color,width:f.width,height:f.height,markerUnits:f.markerUnits,strokeWidth:f.strokeWidth,orient:f.orient},f.id))})}):null};Bg.displayName="MarkerDefinitions";var RS=ee.memo(Bg);function Hg({x:t,y:r,label:i,labelStyle:s,labelShowBg:u=!0,labelBgStyle:f,labelBgPadding:d=[2,4],labelBgBorderRadius:m=2,children:v,className:w,...b}){const[x,S]=ee.useState({x:1,y:0,width:0,height:0}),C=qt(["react-flow__edge-textwrapper",w]),j=ee.useRef(null);return ee.useEffect(()=>{if(j.current){const M=j.current.getBBox();S({x:M.x,y:M.y,width:M.width,height:M.height})}},[i]),i?k.jsxs("g",{transform:`translate(${t-x.width/2} ${r-x.height/2})`,className:C,visibility:x.width?"visible":"hidden",...b,children:[u&&k.jsx("rect",{width:x.width+2*d[0],x:-d[0],y:-d[1],height:x.height+2*d[1],className:"react-flow__edge-textbg",style:f,rx:m,ry:m}),k.jsx("text",{className:"react-flow__edge-text",y:x.height/2,dy:"0.3em",ref:j,style:s,children:i}),v]}):null}Hg.displayName="EdgeText";const DS=ee.memo(Hg);function Iu({path:t,labelX:r,labelY:i,label:s,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:v,interactionWidth:w=20,...b}){return k.jsxs(k.Fragment,{children:[k.jsx("path",{...b,d:t,fill:"none",className:qt(["react-flow__edge-path",b.className])}),w?k.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:w,className:"react-flow__edge-interaction"}):null,s&&Ir(r)&&Ir(i)?k.jsx(DS,{x:r,y:i,label:s,labelStyle:u,labelShowBg:f,labelBgStyle:d,labelBgPadding:m,labelBgBorderRadius:v}):null]})}function em({pos:t,x1:r,y1:i,x2:s,y2:u}){return t===Ze.Left||t===Ze.Right?[.5*(r+s),i]:[r,.5*(i+u)]}function Vg({sourceX:t,sourceY:r,sourcePosition:i=Ze.Bottom,targetX:s,targetY:u,targetPosition:f=Ze.Top}){const[d,m]=em({pos:i,x1:t,y1:r,x2:s,y2:u}),[v,w]=em({pos:f,x1:s,y1:u,x2:t,y2:r}),[b,x,S,C]=cg({sourceX:t,sourceY:r,targetX:s,targetY:u,sourceControlX:d,sourceControlY:m,targetControlX:v,targetControlY:w});return[`M${t},${r} C${d},${m} ${v},${w} ${s},${u}`,b,x,S,C]}function Ug(t){return ee.memo(({id:r,sourceX:i,sourceY:s,targetX:u,targetY:f,sourcePosition:d,targetPosition:m,label:v,labelStyle:w,labelShowBg:b,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:M,markerStart:I,interactionWidth:A})=>{const[V,P,R]=Vg({sourceX:i,sourceY:s,sourcePosition:d,targetX:u,targetY:f,targetPosition:m}),q=t.isInternal?void 0:r;return k.jsx(Iu,{id:q,path:V,labelX:P,labelY:R,label:v,labelStyle:w,labelShowBg:b,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:M,markerStart:I,interactionWidth:A})})}const zS=Ug({isInternal:!1}),Kg=Ug({isInternal:!0});zS.displayName="SimpleBezierEdge";Kg.displayName="SimpleBezierEdgeInternal";function qg(t){return ee.memo(({id:r,sourceX:i,sourceY:s,targetX:u,targetY:f,label:d,labelStyle:m,labelShowBg:v,labelBgStyle:w,labelBgPadding:b,labelBgBorderRadius:x,style:S,sourcePosition:C=Ze.Bottom,targetPosition:j=Ze.Top,markerEnd:M,markerStart:I,pathOptions:A,interactionWidth:V})=>{const[P,R,q]=jf({sourceX:i,sourceY:s,sourcePosition:C,targetX:u,targetY:f,targetPosition:j,borderRadius:A==null?void 0:A.borderRadius,offset:A==null?void 0:A.offset,stepPosition:A==null?void 0:A.stepPosition}),B=t.isInternal?void 0:r;return k.jsx(Iu,{id:B,path:P,labelX:R,labelY:q,label:d,labelStyle:m,labelShowBg:v,labelBgStyle:w,labelBgPadding:b,labelBgBorderRadius:x,style:S,markerEnd:M,markerStart:I,interactionWidth:V})})}const Wg=qg({isInternal:!1}),Yg=qg({isInternal:!0});Wg.displayName="SmoothStepEdge";Yg.displayName="SmoothStepEdgeInternal";function Xg(t){return ee.memo(({id:r,...i})=>{var u;const s=t.isInternal?void 0:r;return k.jsx(Wg,{...i,id:s,pathOptions:ee.useMemo(()=>{var f;return{borderRadius:0,offset:(f=i.pathOptions)==null?void 0:f.offset}},[(u=i.pathOptions)==null?void 0:u.offset])})})}const LS=Xg({isInternal:!1}),Qg=Xg({isInternal:!0});LS.displayName="StepEdge";Qg.displayName="StepEdgeInternal";function Gg(t){return ee.memo(({id:r,sourceX:i,sourceY:s,targetX:u,targetY:f,label:d,labelStyle:m,labelShowBg:v,labelBgStyle:w,labelBgPadding:b,labelBgBorderRadius:x,style:S,markerEnd:C,markerStart:j,interactionWidth:M})=>{const[I,A,V]=hg({sourceX:i,sourceY:s,targetX:u,targetY:f}),P=t.isInternal?void 0:r;return k.jsx(Iu,{id:P,path:I,labelX:A,labelY:V,label:d,labelStyle:m,labelShowBg:v,labelBgStyle:w,labelBgPadding:b,labelBgBorderRadius:x,style:S,markerEnd:C,markerStart:j,interactionWidth:M})})}const FS=Gg({isInternal:!1}),Jg=Gg({isInternal:!0});FS.displayName="StraightEdge";Jg.displayName="StraightEdgeInternal";function Zg(t){return ee.memo(({id:r,sourceX:i,sourceY:s,targetX:u,targetY:f,sourcePosition:d=Ze.Bottom,targetPosition:m=Ze.Top,label:v,labelStyle:w,labelShowBg:b,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:M,markerStart:I,pathOptions:A,interactionWidth:V})=>{const[P,R,q]=fg({sourceX:i,sourceY:s,sourcePosition:d,targetX:u,targetY:f,targetPosition:m,curvature:A==null?void 0:A.curvature}),B=t.isInternal?void 0:r;return k.jsx(Iu,{id:B,path:P,labelX:R,labelY:q,label:v,labelStyle:w,labelShowBg:b,labelBgStyle:x,labelBgPadding:S,labelBgBorderRadius:C,style:j,markerEnd:M,markerStart:I,interactionWidth:V})})}const BS=Zg({isInternal:!1}),ey=Zg({isInternal:!0});BS.displayName="BezierEdge";ey.displayName="BezierEdgeInternal";const tm={default:ey,straight:Jg,step:Qg,smoothstep:Yg,simplebezier:Kg},nm={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},HS=(t,r,i)=>i===Ze.Left?t-r:i===Ze.Right?t+r:t,VS=(t,r,i)=>i===Ze.Top?t-r:i===Ze.Bottom?t+r:t,rm="react-flow__edgeupdater";function om({position:t,centerX:r,centerY:i,radius:s=10,onMouseDown:u,onMouseEnter:f,onMouseOut:d,type:m}){return k.jsx("circle",{onMouseDown:u,onMouseEnter:f,onMouseOut:d,className:qt([rm,`${rm}-${m}`]),cx:HS(r,s,t),cy:VS(i,s,t),r:s,stroke:"transparent",fill:"transparent"})}function US({isReconnectable:t,reconnectRadius:r,edge:i,sourceX:s,sourceY:u,targetX:f,targetY:d,sourcePosition:m,targetPosition:v,onReconnect:w,onReconnectStart:b,onReconnectEnd:x,setReconnecting:S,setUpdateHover:C}){const j=Tt(),M=(R,q)=>{if(R.button!==0)return;const{autoPanOnConnect:B,domNode:X,connectionMode:fe,connectionRadius:he,lib:Se,onConnectStart:K,cancelConnection:ce,nodeLookup:xe,rfId:D,panBy:le,updateConnection:Q}=j.getState(),se=q.type==="target",L=($,H)=>{S(!1),x==null||x($,i,q.type,H)},U=$=>w==null?void 0:w(i,$),F=($,H)=>{S(!0),b==null||b(R,i,q.type),K==null||K($,H)};Mf.onPointerDown(R.nativeEvent,{autoPanOnConnect:B,connectionMode:fe,connectionRadius:he,domNode:X,handleId:q.id,nodeId:q.nodeId,nodeLookup:xe,isTarget:se,edgeUpdaterType:q.type,lib:Se,flowId:D,cancelConnection:ce,panBy:le,isValidConnection:(...$)=>{var H,we;return((we=(H=j.getState()).isValidConnection)==null?void 0:we.call(H,...$))??!0},onConnect:U,onConnectStart:F,onConnectEnd:(...$)=>{var H,we;return(we=(H=j.getState()).onConnectEnd)==null?void 0:we.call(H,...$)},onReconnectEnd:L,updateConnection:Q,getTransform:()=>j.getState().transform,getFromHandle:()=>j.getState().connection.fromHandle,dragThreshold:j.getState().connectionDragThreshold,handleDomNode:R.currentTarget})},I=R=>M(R,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),A=R=>M(R,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),V=()=>C(!0),P=()=>C(!1);return k.jsxs(k.Fragment,{children:[(t===!0||t==="source")&&k.jsx(om,{position:m,centerX:s,centerY:u,radius:r,onMouseDown:I,onMouseEnter:V,onMouseOut:P,type:"source"}),(t===!0||t==="target")&&k.jsx(om,{position:v,centerX:f,centerY:d,radius:r,onMouseDown:A,onMouseEnter:V,onMouseOut:P,type:"target"})]})}function KS({id:t,edgesFocusable:r,edgesReconnectable:i,elementsSelectable:s,onClick:u,onDoubleClick:f,onContextMenu:d,onMouseEnter:m,onMouseMove:v,onMouseLeave:w,reconnectRadius:b,onReconnect:x,onReconnectStart:S,onReconnectEnd:C,rfId:j,edgeTypes:M,noPanClassName:I,onError:A,disableKeyboardA11y:V}){let P=mt(Ae=>Ae.edgeLookup.get(t));const R=mt(Ae=>Ae.defaultEdgeOptions);P=R?{...R,...P}:P;let q=P.type||"default",B=(M==null?void 0:M[q])||tm[q];B===void 0&&(A==null||A("011",Qr.error011(q)),q="default",B=(M==null?void 0:M.default)||tm.default);const X=!!(P.focusable||r&&typeof P.focusable>"u"),fe=typeof x<"u"&&(P.reconnectable||i&&typeof P.reconnectable>"u"),he=!!(P.selectable||s&&typeof P.selectable>"u"),Se=ee.useRef(null),[K,ce]=ee.useState(!1),[xe,D]=ee.useState(!1),le=Tt(),{zIndex:Q,sourceX:se,sourceY:L,targetX:U,targetY:F,sourcePosition:$,targetPosition:H}=mt(ee.useCallback(Ae=>{const qe=Ae.nodeLookup.get(P.source),ut=Ae.nodeLookup.get(P.target);if(!qe||!ut)return{zIndex:P.zIndex,...nm};const ct=D1({id:t,sourceNode:qe,targetNode:ut,sourceHandle:P.sourceHandle||null,targetHandle:P.targetHandle||null,connectionMode:Ae.connectionMode,onError:A});return{zIndex:T1({selected:P.selected,zIndex:P.zIndex,sourceNode:qe,targetNode:ut,elevateOnSelect:Ae.elevateEdgesOnSelect,zIndexMode:Ae.zIndexMode}),...ct||nm}},[P.source,P.target,P.sourceHandle,P.targetHandle,P.selected,P.zIndex]),At),we=ee.useMemo(()=>P.markerStart?`url('#${Pf(P.markerStart,j)}')`:void 0,[P.markerStart,j]),be=ee.useMemo(()=>P.markerEnd?`url('#${Pf(P.markerEnd,j)}')`:void 0,[P.markerEnd,j]);if(P.hidden||se===null||L===null||U===null||F===null)return null;const Te=Ae=>{var it;const{addSelectedEdges:qe,unselectNodesAndEdges:ut,multiSelectionActive:ct}=le.getState();he&&(le.setState({nodesSelectionActive:!1}),P.selected&&ct?(ut({nodes:[],edges:[P]}),(it=Se.current)==null||it.blur()):qe([t])),u&&u(Ae,P)},$e=f?Ae=>{f(Ae,{...P})}:void 0,Re=d?Ae=>{d(Ae,{...P})}:void 0,_e=m?Ae=>{m(Ae,{...P})}:void 0,Be=v?Ae=>{v(Ae,{...P})}:void 0,ke=w?Ae=>{w(Ae,{...P})}:void 0,He=Ae=>{var qe;if(!V&&Qm.includes(Ae.key)&&he){const{unselectNodesAndEdges:ut,addSelectedEdges:ct}=le.getState();Ae.key==="Escape"?((qe=Se.current)==null||qe.blur(),ut({edges:[P]})):ct([t])}};return k.jsx("svg",{style:{zIndex:Q},children:k.jsxs("g",{className:qt(["react-flow__edge",`react-flow__edge-${q}`,P.className,I,{selected:P.selected,animated:P.animated,inactive:!he&&!u,updating:K,selectable:he}]),onClick:Te,onDoubleClick:$e,onContextMenu:Re,onMouseEnter:_e,onMouseMove:Be,onMouseLeave:ke,onKeyDown:X?He:void 0,tabIndex:X?0:void 0,role:P.ariaRole??(X?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":P.ariaLabel===null?void 0:P.ariaLabel||`Edge from ${P.source} to ${P.target}`,"aria-describedby":X?`${Pg}-${j}`:void 0,ref:Se,...P.domAttributes,children:[!xe&&k.jsx(B,{id:t,source:P.source,target:P.target,type:P.type,selected:P.selected,animated:P.animated,selectable:he,deletable:P.deletable??!0,label:P.label,labelStyle:P.labelStyle,labelShowBg:P.labelShowBg,labelBgStyle:P.labelBgStyle,labelBgPadding:P.labelBgPadding,labelBgBorderRadius:P.labelBgBorderRadius,sourceX:se,sourceY:L,targetX:U,targetY:F,sourcePosition:$,targetPosition:H,data:P.data,style:P.style,sourceHandleId:P.sourceHandle,targetHandleId:P.targetHandle,markerStart:we,markerEnd:be,pathOptions:"pathOptions"in P?P.pathOptions:void 0,interactionWidth:P.interactionWidth}),fe&&k.jsx(US,{edge:P,isReconnectable:fe,reconnectRadius:b,onReconnect:x,onReconnectStart:S,onReconnectEnd:C,sourceX:se,sourceY:L,targetX:U,targetY:F,sourcePosition:$,targetPosition:H,setUpdateHover:ce,setReconnecting:D})]})})}var qS=ee.memo(KS);const WS=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function ty({defaultMarkerColor:t,onlyRenderVisibleElements:r,rfId:i,edgeTypes:s,noPanClassName:u,onReconnect:f,onEdgeContextMenu:d,onEdgeMouseEnter:m,onEdgeMouseMove:v,onEdgeMouseLeave:w,onEdgeClick:b,reconnectRadius:x,onEdgeDoubleClick:S,onReconnectStart:C,onReconnectEnd:j,disableKeyboardA11y:M}){const{edgesFocusable:I,edgesReconnectable:A,elementsSelectable:V,onError:P}=mt(WS,At),R=MS(r);return k.jsxs("div",{className:"react-flow__edges",children:[k.jsx(RS,{defaultColor:t,rfId:i}),R.map(q=>k.jsx(qS,{id:q,edgesFocusable:I,edgesReconnectable:A,elementsSelectable:V,noPanClassName:u,onReconnect:f,onContextMenu:d,onMouseEnter:m,onMouseMove:v,onMouseLeave:w,onClick:b,reconnectRadius:x,onDoubleClick:S,onReconnectStart:C,onReconnectEnd:j,rfId:i,onError:P,edgeTypes:s,disableKeyboardA11y:M},q))]})}ty.displayName="EdgeRenderer";const YS=ee.memo(ty),XS=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function QS({children:t}){const r=mt(XS);return k.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function GS(t){const r=Gf(),i=ee.useRef(!1);ee.useEffect(()=>{!i.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),i.current=!0)},[t,r.viewportInitialized])}const JS=t=>{var r;return(r=t.panZoom)==null?void 0:r.syncViewport};function ZS(t){const r=mt(JS),i=Tt();return ee.useEffect(()=>{t&&(r==null||r(t),i.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function eb(t){return t.connection.inProgress?{...t.connection,to:La(t.connection.to,t.transform)}:{...t.connection}}function tb(t){return eb}function nb(t){const r=tb();return mt(r,At)}const rb=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function ob({containerStyle:t,style:r,type:i,component:s}){const{nodesConnectable:u,width:f,height:d,isValid:m,inProgress:v}=mt(rb,At);return!(f&&u&&v)?null:k.jsx("svg",{style:t,width:f,height:d,className:"react-flow__connectionline react-flow__container",children:k.jsx("g",{className:qt(["react-flow__connection",Zm(m)]),children:k.jsx(ny,{style:r,type:i,CustomComponent:s,isValid:m})})})}const ny=({style:t,type:r=li.Bezier,CustomComponent:i,isValid:s})=>{const{inProgress:u,from:f,fromNode:d,fromHandle:m,fromPosition:v,to:w,toNode:b,toHandle:x,toPosition:S,pointer:C}=nb();if(!u)return;if(i)return k.jsx(i,{connectionLineType:r,connectionLineStyle:t,fromNode:d,fromHandle:m,fromX:f.x,fromY:f.y,toX:w.x,toY:w.y,fromPosition:v,toPosition:S,connectionStatus:Zm(s),toNode:b,toHandle:x,pointer:C});let j="";const M={sourceX:f.x,sourceY:f.y,sourcePosition:v,targetX:w.x,targetY:w.y,targetPosition:S};switch(r){case li.Bezier:[j]=fg(M);break;case li.SimpleBezier:[j]=Vg(M);break;case li.Step:[j]=jf({...M,borderRadius:0});break;case li.SmoothStep:[j]=jf(M);break;default:[j]=hg(M)}return k.jsx("path",{d:j,fill:"none",className:"react-flow__connection-path",style:t})};ny.displayName="ConnectionLine";const ib={};function im(t=ib){ee.useRef(t),Tt(),ee.useEffect(()=>{},[t])}function sb(){Tt(),ee.useRef(!1),ee.useEffect(()=>{},[])}function ry({nodeTypes:t,edgeTypes:r,onInit:i,onNodeClick:s,onEdgeClick:u,onNodeDoubleClick:f,onEdgeDoubleClick:d,onNodeMouseEnter:m,onNodeMouseMove:v,onNodeMouseLeave:w,onNodeContextMenu:b,onSelectionContextMenu:x,onSelectionStart:S,onSelectionEnd:C,connectionLineType:j,connectionLineStyle:M,connectionLineComponent:I,connectionLineContainerStyle:A,selectionKeyCode:V,selectionOnDrag:P,selectionMode:R,multiSelectionKeyCode:q,panActivationKeyCode:B,zoomActivationKeyCode:X,deleteKeyCode:fe,onlyRenderVisibleElements:he,elementsSelectable:Se,defaultViewport:K,translateExtent:ce,minZoom:xe,maxZoom:D,preventScrolling:le,defaultMarkerColor:Q,zoomOnScroll:se,zoomOnPinch:L,panOnScroll:U,panOnScrollSpeed:F,panOnScrollMode:$,zoomOnDoubleClick:H,panOnDrag:we,onPaneClick:be,onPaneMouseEnter:Te,onPaneMouseMove:$e,onPaneMouseLeave:Re,onPaneScroll:_e,onPaneContextMenu:Be,paneClickDistance:ke,nodeClickDistance:He,onEdgeContextMenu:Ae,onEdgeMouseEnter:qe,onEdgeMouseMove:ut,onEdgeMouseLeave:ct,reconnectRadius:it,onReconnect:Mt,onReconnectStart:St,onReconnectEnd:tn,noDragClassName:Ot,noWheelClassName:bt,noPanClassName:wn,disableKeyboardA11y:fn,nodeExtent:gr,rfId:_n,viewport:Nt,onViewportChange:Ht}){return im(t),im(r),sb(),GS(i),ZS(Nt),k.jsx(_S,{onPaneClick:be,onPaneMouseEnter:Te,onPaneMouseMove:$e,onPaneMouseLeave:Re,onPaneContextMenu:Be,onPaneScroll:_e,paneClickDistance:ke,deleteKeyCode:fe,selectionKeyCode:V,selectionOnDrag:P,selectionMode:R,onSelectionStart:S,onSelectionEnd:C,multiSelectionKeyCode:q,panActivationKeyCode:B,zoomActivationKeyCode:X,elementsSelectable:Se,zoomOnScroll:se,zoomOnPinch:L,zoomOnDoubleClick:H,panOnScroll:U,panOnScrollSpeed:F,panOnScrollMode:$,panOnDrag:we,defaultViewport:K,translateExtent:ce,minZoom:xe,maxZoom:D,onSelectionContextMenu:x,preventScrolling:le,noDragClassName:Ot,noWheelClassName:bt,noPanClassName:wn,disableKeyboardA11y:fn,onViewportChange:Ht,isControlledViewport:!!Nt,children:k.jsxs(QS,{children:[k.jsx(YS,{edgeTypes:r,onEdgeClick:u,onEdgeDoubleClick:d,onReconnect:Mt,onReconnectStart:St,onReconnectEnd:tn,onlyRenderVisibleElements:he,onEdgeContextMenu:Ae,onEdgeMouseEnter:qe,onEdgeMouseMove:ut,onEdgeMouseLeave:ct,reconnectRadius:it,defaultMarkerColor:Q,noPanClassName:wn,disableKeyboardA11y:fn,rfId:_n}),k.jsx(ob,{style:M,type:j,component:I,containerStyle:A}),k.jsx("div",{className:"react-flow__edgelabel-renderer"}),k.jsx(TS,{nodeTypes:t,onNodeClick:s,onNodeDoubleClick:f,onNodeMouseEnter:m,onNodeMouseMove:v,onNodeMouseLeave:w,onNodeContextMenu:b,nodeClickDistance:He,onlyRenderVisibleElements:he,noPanClassName:wn,noDragClassName:Ot,disableKeyboardA11y:fn,nodeExtent:gr,rfId:_n}),k.jsx("div",{className:"react-flow__viewport-portal"})]})})}ry.displayName="GraphView";const ab=ee.memo(ry),sm=({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:u,height:f,fitView:d,fitViewOptions:m,minZoom:v=.5,maxZoom:w=2,nodeOrigin:b,nodeExtent:x,zIndexMode:S="basic"}={})=>{const C=new Map,j=new Map,M=new Map,I=new Map,A=s??r??[],V=i??t??[],P=b??[0,0],R=x??ja;yg(M,I,A);const{nodesInitialized:q}=Tf(V,C,j,{nodeOrigin:P,nodeExtent:R,zIndexMode:S});let B=[0,0,1];if(d&&u&&f){const X=Da(C,{filter:K=>!!((K.width||K.initialWidth)&&(K.height||K.initialHeight))}),{x:fe,y:he,zoom:Se}=Uf(X,u,f,v,w,(m==null?void 0:m.padding)??.1);B=[fe,he,Se]}return{rfId:"1",width:u??0,height:f??0,transform:B,nodes:V,nodesInitialized:q,nodeLookup:C,parentLookup:j,edges:A,edgeLookup:I,connectionLookup:M,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:v,maxZoom:w,translateExtent:ja,nodeExtent:R,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ms.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:P,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:d??!1,fitViewOptions:m,fitViewResolver:null,connection:{...Jm},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:k1,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Gm,zIndexMode:S,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},lb=({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:u,height:f,fitView:d,fitViewOptions:m,minZoom:v,maxZoom:w,nodeOrigin:b,nodeExtent:x,zIndexMode:S})=>C_((C,j)=>{async function M(){const{nodeLookup:I,panZoom:A,fitViewOptions:V,fitViewResolver:P,width:R,height:q,minZoom:B,maxZoom:X}=j();A&&(await S1({nodes:I,width:R,height:q,panZoom:A,minZoom:B,maxZoom:X},V),P==null||P.resolve(!0),C({fitViewResolver:null}))}return{...sm({nodes:t,edges:r,width:u,height:f,fitView:d,fitViewOptions:m,minZoom:v,maxZoom:w,nodeOrigin:b,nodeExtent:x,defaultNodes:i,defaultEdges:s,zIndexMode:S}),setNodes:I=>{const{nodeLookup:A,parentLookup:V,nodeOrigin:P,elevateNodesOnSelect:R,fitViewQueued:q,zIndexMode:B,nodesSelectionActive:X}=j(),{nodesInitialized:fe,hasSelectedNodes:he}=Tf(I,A,V,{nodeOrigin:P,nodeExtent:x,elevateNodesOnSelect:R,checkEquality:!0,zIndexMode:B}),Se=X&&he;q&&fe?(M(),C({nodes:I,nodesInitialized:fe,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:Se})):C({nodes:I,nodesInitialized:fe,nodesSelectionActive:Se})},setEdges:I=>{const{connectionLookup:A,edgeLookup:V}=j();yg(A,V,I),C({edges:I})},setDefaultNodesAndEdges:(I,A)=>{if(I){const{setNodes:V}=j();V(I),C({hasDefaultNodes:!0})}if(A){const{setEdges:V}=j();V(A),C({hasDefaultEdges:!0})}},updateNodeInternals:I=>{const{triggerNodeChanges:A,nodeLookup:V,parentLookup:P,domNode:R,nodeOrigin:q,nodeExtent:B,debug:X,fitViewQueued:fe,zIndexMode:he}=j(),{changes:Se,updatedInternals:K}=K1(I,V,P,R,q,B,he);K&&(B1(V,P,{nodeOrigin:q,nodeExtent:B,zIndexMode:he}),fe?(M(),C({fitViewQueued:!1,fitViewOptions:void 0})):C({}),(Se==null?void 0:Se.length)>0&&(X&&console.log("React Flow: trigger node changes",Se),A==null||A(Se)))},updateNodePositions:(I,A=!1)=>{const V=[];let P=[];const{nodeLookup:R,triggerNodeChanges:q,connection:B,updateConnection:X,onNodesChangeMiddlewareMap:fe}=j();for(const[he,Se]of I){const K=R.get(he),ce=!!(K!=null&&K.expandParent&&(K!=null&&K.parentId)&&(Se!=null&&Se.position)),xe={id:he,type:"position",position:ce?{x:Math.max(0,Se.position.x),y:Math.max(0,Se.position.y)}:Se.position,dragging:A};if(K&&B.inProgress&&B.fromNode.id===K.id){const D=Fi(K,B.fromHandle,Ze.Left,!0);X({...B,from:D})}ce&&K.parentId&&V.push({id:he,parentId:K.parentId,rect:{...Se.internals.positionAbsolute,width:Se.measured.width??0,height:Se.measured.height??0}}),P.push(xe)}if(V.length>0){const{parentLookup:he,nodeOrigin:Se}=j(),K=Qf(V,R,he,Se);P.push(...K)}for(const he of fe.values())P=he(P);q(P)},triggerNodeChanges:I=>{const{onNodesChange:A,setNodes:V,nodes:P,hasDefaultNodes:R,debug:q}=j();if(I!=null&&I.length){if(R){const B=Ig(I,P);V(B)}q&&console.log("React Flow: trigger node changes",I),A==null||A(I)}},triggerEdgeChanges:I=>{const{onEdgesChange:A,setEdges:V,edges:P,hasDefaultEdges:R,debug:q}=j();if(I!=null&&I.length){if(R){const B=$g(I,P);V(B)}q&&console.log("React Flow: trigger edge changes",I),A==null||A(I)}},addSelectedNodes:I=>{const{multiSelectionActive:A,edgeLookup:V,nodeLookup:P,triggerNodeChanges:R,triggerEdgeChanges:q}=j();if(A){const B=I.map(X=>$i(X,!0));R(B);return}R(Es(P,new Set([...I]),!0)),q(Es(V))},addSelectedEdges:I=>{const{multiSelectionActive:A,edgeLookup:V,nodeLookup:P,triggerNodeChanges:R,triggerEdgeChanges:q}=j();if(A){const B=I.map(X=>$i(X,!0));q(B);return}q(Es(V,new Set([...I]))),R(Es(P,new Set,!0))},unselectNodesAndEdges:({nodes:I,edges:A}={})=>{const{edges:V,nodes:P,nodeLookup:R,triggerNodeChanges:q,triggerEdgeChanges:B}=j(),X=I||P,fe=A||V,he=[];for(const K of X){if(!K.selected)continue;const ce=R.get(K.id);ce&&(ce.selected=!1),he.push($i(K.id,!1))}const Se=[];for(const K of fe)K.selected&&Se.push($i(K.id,!1));q(he),B(Se)},setMinZoom:I=>{const{panZoom:A,maxZoom:V}=j();A==null||A.setScaleExtent([I,V]),C({minZoom:I})},setMaxZoom:I=>{const{panZoom:A,minZoom:V}=j();A==null||A.setScaleExtent([V,I]),C({maxZoom:I})},setTranslateExtent:I=>{var A;(A=j().panZoom)==null||A.setTranslateExtent(I),C({translateExtent:I})},resetSelectedElements:()=>{const{edges:I,nodes:A,triggerNodeChanges:V,triggerEdgeChanges:P,elementsSelectable:R}=j();if(!R)return;const q=A.reduce((X,fe)=>fe.selected?[...X,$i(fe.id,!1)]:X,[]),B=I.reduce((X,fe)=>fe.selected?[...X,$i(fe.id,!1)]:X,[]);V(q),P(B)},setNodeExtent:I=>{const{nodes:A,nodeLookup:V,parentLookup:P,nodeOrigin:R,elevateNodesOnSelect:q,nodeExtent:B,zIndexMode:X}=j();I[0][0]===B[0][0]&&I[0][1]===B[0][1]&&I[1][0]===B[1][0]&&I[1][1]===B[1][1]||(Tf(A,V,P,{nodeOrigin:R,nodeExtent:I,elevateNodesOnSelect:q,checkEquality:!1,zIndexMode:X}),C({nodeExtent:I}))},panBy:I=>{const{transform:A,width:V,height:P,panZoom:R,translateExtent:q}=j();return q1({delta:I,panZoom:R,transform:A,translateExtent:q,width:V,height:P})},setCenter:async(I,A,V)=>{const{width:P,height:R,maxZoom:q,panZoom:B}=j();if(!B)return Promise.resolve(!1);const X=typeof(V==null?void 0:V.zoom)<"u"?V.zoom:q;return await B.setViewport({x:P/2-I*X,y:R/2-A*X,zoom:X},{duration:V==null?void 0:V.duration,ease:V==null?void 0:V.ease,interpolate:V==null?void 0:V.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{C({connection:{...Jm}})},updateConnection:I=>{C({connection:I})},reset:()=>C({...sm()})}},Object.is);function ub({initialNodes:t,initialEdges:r,defaultNodes:i,defaultEdges:s,initialWidth:u,initialHeight:f,initialMinZoom:d,initialMaxZoom:m,initialFitViewOptions:v,fitView:w,nodeOrigin:b,nodeExtent:x,zIndexMode:S,children:C}){const[j]=ee.useState(()=>lb({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,width:u,height:f,fitView:w,minZoom:d,maxZoom:m,fitViewOptions:v,nodeOrigin:b,nodeExtent:x,zIndexMode:S}));return k.jsx(j_,{value:j,children:k.jsx(Q_,{children:C})})}function cb({children:t,nodes:r,edges:i,defaultNodes:s,defaultEdges:u,width:f,height:d,fitView:m,fitViewOptions:v,minZoom:w,maxZoom:b,nodeOrigin:x,nodeExtent:S,zIndexMode:C}){return ee.useContext(Tu)?k.jsx(k.Fragment,{children:t}):k.jsx(ub,{initialNodes:r,initialEdges:i,defaultNodes:s,defaultEdges:u,initialWidth:f,initialHeight:d,fitView:m,initialFitViewOptions:v,initialMinZoom:w,initialMaxZoom:b,nodeOrigin:x,nodeExtent:S,zIndexMode:C,children:t})}const fb={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function db({nodes:t,edges:r,defaultNodes:i,defaultEdges:s,className:u,nodeTypes:f,edgeTypes:d,onNodeClick:m,onEdgeClick:v,onInit:w,onMove:b,onMoveStart:x,onMoveEnd:S,onConnect:C,onConnectStart:j,onConnectEnd:M,onClickConnectStart:I,onClickConnectEnd:A,onNodeMouseEnter:V,onNodeMouseMove:P,onNodeMouseLeave:R,onNodeContextMenu:q,onNodeDoubleClick:B,onNodeDragStart:X,onNodeDrag:fe,onNodeDragStop:he,onNodesDelete:Se,onEdgesDelete:K,onDelete:ce,onSelectionChange:xe,onSelectionDragStart:D,onSelectionDrag:le,onSelectionDragStop:Q,onSelectionContextMenu:se,onSelectionStart:L,onSelectionEnd:U,onBeforeDelete:F,connectionMode:$,connectionLineType:H=li.Bezier,connectionLineStyle:we,connectionLineComponent:be,connectionLineContainerStyle:Te,deleteKeyCode:$e="Backspace",selectionKeyCode:Re="Shift",selectionOnDrag:_e=!1,selectionMode:Be=Pa.Full,panActivationKeyCode:ke="Space",multiSelectionKeyCode:He=Ma()?"Meta":"Control",zoomActivationKeyCode:Ae=Ma()?"Meta":"Control",snapToGrid:qe,snapGrid:ut,onlyRenderVisibleElements:ct=!1,selectNodesOnDrag:it,nodesDraggable:Mt,autoPanOnNodeFocus:St,nodesConnectable:tn,nodesFocusable:Ot,nodeOrigin:bt=Tg,edgesFocusable:wn,edgesReconnectable:fn,elementsSelectable:gr=!0,defaultViewport:_n=B_,minZoom:Nt=.5,maxZoom:Ht=2,translateExtent:Hn=ja,preventScrolling:tr=!0,nodeExtent:Sn,defaultMarkerColor:Pn="#b1b1b7",zoomOnScroll:Vn=!0,zoomOnPinch:dn=!0,panOnScroll:nr=!1,panOnScrollSpeed:bn=.5,panOnScrollMode:Ye=Ri.Free,zoomOnDoubleClick:Un=!0,panOnDrag:kn=!0,onPaneClick:rr,onPaneMouseEnter:Ve,onPaneMouseMove:Tn,onPaneMouseLeave:Kn,onPaneScroll:Or,onPaneContextMenu:Zr,paneClickDistance:Rr=1,nodeClickDistance:Io=0,children:eo,onReconnect:Nn,onReconnectStart:Mn,onReconnectEnd:W,onEdgeContextMenu:Fe,onEdgeDoubleClick:Le,onEdgeMouseEnter:nt,onEdgeMouseMove:nn,onEdgeMouseLeave:Wt,reconnectRadius:Vt=10,onNodesChange:rn,onEdgesChange:to,noDragClassName:on="nodrag",noWheelClassName:qn="nowheel",noPanClassName:Lt="nopan",fitView:Wn,fitViewOptions:or,connectOnClick:In,attributionPosition:ui,proOptions:ir,defaultEdgeOptions:ci,elevateNodesOnSelect:$o=!0,elevateEdgesOnSelect:Et=!1,disableKeyboardA11y:sr=!1,autoPanOnConnect:gt,autoPanOnNodeDrag:Bi,autoPanSpeed:Dr,connectionRadius:Ao,isValidConnection:zr,onError:yr,style:fi,id:ar,nodeDragThreshold:En,connectionDragThreshold:ft,viewport:pn,onViewportChange:Hi,width:Oo,height:no,colorMode:ro="light",debug:oo,onScroll:Yn,ariaLabelConfig:yt,zIndexMode:Lr="basic",...io},lr){const Fr=ar||"1",so=K_(ro),ur=ee.useCallback(di=>{di.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Yn==null||Yn(di)},[Yn]);return k.jsx("div",{"data-testid":"rf__wrapper",...io,onScroll:ur,style:{...fi,...fb},ref:lr,className:qt(["react-flow",u,so]),id:ar,role:"application",children:k.jsxs(cb,{nodes:t,edges:r,width:Oo,height:no,fitView:Wn,fitViewOptions:or,minZoom:Nt,maxZoom:Ht,nodeOrigin:bt,nodeExtent:Sn,zIndexMode:Lr,children:[k.jsx(U_,{nodes:t,edges:r,defaultNodes:i,defaultEdges:s,onConnect:C,onConnectStart:j,onConnectEnd:M,onClickConnectStart:I,onClickConnectEnd:A,nodesDraggable:Mt,autoPanOnNodeFocus:St,nodesConnectable:tn,nodesFocusable:Ot,edgesFocusable:wn,edgesReconnectable:fn,elementsSelectable:gr,elevateNodesOnSelect:$o,elevateEdgesOnSelect:Et,minZoom:Nt,maxZoom:Ht,nodeExtent:Sn,onNodesChange:rn,onEdgesChange:to,snapToGrid:qe,snapGrid:ut,connectionMode:$,translateExtent:Hn,connectOnClick:In,defaultEdgeOptions:ci,fitView:Wn,fitViewOptions:or,onNodesDelete:Se,onEdgesDelete:K,onDelete:ce,onNodeDragStart:X,onNodeDrag:fe,onNodeDragStop:he,onSelectionDrag:le,onSelectionDragStart:D,onSelectionDragStop:Q,onMove:b,onMoveStart:x,onMoveEnd:S,noPanClassName:Lt,nodeOrigin:bt,rfId:Fr,autoPanOnConnect:gt,autoPanOnNodeDrag:Bi,autoPanSpeed:Dr,onError:yr,connectionRadius:Ao,isValidConnection:zr,selectNodesOnDrag:it,nodeDragThreshold:En,connectionDragThreshold:ft,onBeforeDelete:F,debug:oo,ariaLabelConfig:yt,zIndexMode:Lr}),k.jsx(ab,{onInit:w,onNodeClick:m,onEdgeClick:v,onNodeMouseEnter:V,onNodeMouseMove:P,onNodeMouseLeave:R,onNodeContextMenu:q,onNodeDoubleClick:B,nodeTypes:f,edgeTypes:d,connectionLineType:H,connectionLineStyle:we,connectionLineComponent:be,connectionLineContainerStyle:Te,selectionKeyCode:Re,selectionOnDrag:_e,selectionMode:Be,deleteKeyCode:$e,multiSelectionKeyCode:He,panActivationKeyCode:ke,zoomActivationKeyCode:Ae,onlyRenderVisibleElements:ct,defaultViewport:_n,translateExtent:Hn,minZoom:Nt,maxZoom:Ht,preventScrolling:tr,zoomOnScroll:Vn,zoomOnPinch:dn,zoomOnDoubleClick:Un,panOnScroll:nr,panOnScrollSpeed:bn,panOnScrollMode:Ye,panOnDrag:kn,onPaneClick:rr,onPaneMouseEnter:Ve,onPaneMouseMove:Tn,onPaneMouseLeave:Kn,onPaneScroll:Or,onPaneContextMenu:Zr,paneClickDistance:Rr,nodeClickDistance:Io,onSelectionContextMenu:se,onSelectionStart:L,onSelectionEnd:U,onReconnect:Nn,onReconnectStart:Mn,onReconnectEnd:W,onEdgeContextMenu:Fe,onEdgeDoubleClick:Le,onEdgeMouseEnter:nt,onEdgeMouseMove:nn,onEdgeMouseLeave:Wt,reconnectRadius:Vt,defaultMarkerColor:Pn,noDragClassName:on,noWheelClassName:qn,noPanClassName:Lt,rfId:Fr,disableKeyboardA11y:sr,nodeExtent:Sn,viewport:pn,onViewportChange:Hi}),k.jsx(F_,{onSelectionChange:xe}),eo,k.jsx(O_,{proOptions:ir,position:ui}),k.jsx(A_,{rfId:Fr,disableKeyboardA11y:sr})]})})}var pb=Ag(db);function hb(){const t=Tt();return ee.useCallback(r=>{const{domNode:i,updateNodeInternals:s}=t.getState(),u=Array.isArray(r)?r:[r],f=new Map;u.forEach(d=>{const m=i==null?void 0:i.querySelector(`.react-flow__node[data-id="${d}"]`);m&&f.set(d,{id:d,nodeElement:m,force:!0})}),requestAnimationFrame(()=>s(f,{triggerFitView:!1}))},[])}function mb(t){const[r,i]=ee.useState(t),s=ee.useCallback(u=>i(f=>Ig(u,f)),[]);return[r,i,s]}function gb(t){const[r,i]=ee.useState(t),s=ee.useCallback(u=>i(f=>$g(u,f)),[]);return[r,i,s]}function yb({dimensions:t,lineWidth:r,variant:i,className:s}){return k.jsx("path",{strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:qt(["react-flow__background-pattern",i,s])})}function vb({radius:t,className:r}){return k.jsx("circle",{cx:t,cy:t,r:t,className:qt(["react-flow__background-pattern","dots",r])})}var Po;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Po||(Po={}));const xb={[Po.Dots]:1,[Po.Lines]:1,[Po.Cross]:6},wb=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function oy({id:t,variant:r=Po.Dots,gap:i=20,size:s,lineWidth:u=1,offset:f=0,color:d,bgColor:m,style:v,className:w,patternClassName:b}){const x=ee.useRef(null),{transform:S,patternId:C}=mt(wb,At),j=s||xb[r],M=r===Po.Dots,I=r===Po.Cross,A=Array.isArray(i)?i:[i,i],V=[A[0]*S[2]||1,A[1]*S[2]||1],P=j*S[2],R=Array.isArray(f)?f:[f,f],q=I?[P,P]:V,B=[R[0]*S[2]||1+q[0]/2,R[1]*S[2]||1+q[1]/2],X=`${C}${t||""}`;return k.jsxs("svg",{className:qt(["react-flow__background",w]),style:{...v,...Mu,"--xy-background-color-props":m,"--xy-background-pattern-color-props":d},ref:x,"data-testid":"rf__background",children:[k.jsx("pattern",{id:X,x:S[0]%V[0],y:S[1]%V[1],width:V[0],height:V[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${B[0]},-${B[1]})`,children:M?k.jsx(vb,{radius:P/2,className:b}):k.jsx(yb,{dimensions:q,lineWidth:u,variant:r,className:b})}),k.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${X})`})]})}oy.displayName="Background";const _b=ee.memo(oy);function Sb(){return k.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:k.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function bb(){return k.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:k.jsx("path",{d:"M0 0h32v4.2H0z"})})}function kb(){return k.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:k.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 Nb(){return k.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:k.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 Eb(){return k.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:k.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 Jl({children:t,className:r,...i}){return k.jsx("button",{type:"button",className:qt(["react-flow__controls-button",r]),...i,children:t})}const Cb=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function iy({style:t,showZoom:r=!0,showFitView:i=!0,showInteractive:s=!0,fitViewOptions:u,onZoomIn:f,onZoomOut:d,onFitView:m,onInteractiveChange:v,className:w,children:b,position:x="bottom-left",orientation:S="vertical","aria-label":C}){const j=Tt(),{isInteractive:M,minZoomReached:I,maxZoomReached:A,ariaLabelConfig:V}=mt(Cb,At),{zoomIn:P,zoomOut:R,fitView:q}=Gf(),B=()=>{P(),f==null||f()},X=()=>{R(),d==null||d()},fe=()=>{q(u),m==null||m()},he=()=>{j.setState({nodesDraggable:!M,nodesConnectable:!M,elementsSelectable:!M}),v==null||v(!M)},Se=S==="horizontal"?"horizontal":"vertical";return k.jsxs(Fa,{className:qt(["react-flow__controls",Se,w]),position:x,style:t,"data-testid":"rf__controls","aria-label":C??V["controls.ariaLabel"],children:[r&&k.jsxs(k.Fragment,{children:[k.jsx(Jl,{onClick:B,className:"react-flow__controls-zoomin",title:V["controls.zoomIn.ariaLabel"],"aria-label":V["controls.zoomIn.ariaLabel"],disabled:A,children:k.jsx(Sb,{})}),k.jsx(Jl,{onClick:X,className:"react-flow__controls-zoomout",title:V["controls.zoomOut.ariaLabel"],"aria-label":V["controls.zoomOut.ariaLabel"],disabled:I,children:k.jsx(bb,{})})]}),i&&k.jsx(Jl,{className:"react-flow__controls-fitview",onClick:fe,title:V["controls.fitView.ariaLabel"],"aria-label":V["controls.fitView.ariaLabel"],children:k.jsx(kb,{})}),s&&k.jsx(Jl,{className:"react-flow__controls-interactive",onClick:he,title:V["controls.interactive.ariaLabel"],"aria-label":V["controls.interactive.ariaLabel"],children:M?k.jsx(Eb,{}):k.jsx(Nb,{})}),b]})}iy.displayName="Controls";const jb=ee.memo(iy);function Pb({id:t,x:r,y:i,width:s,height:u,style:f,color:d,strokeColor:m,strokeWidth:v,className:w,borderRadius:b,shapeRendering:x,selected:S,onClick:C}){const{background:j,backgroundColor:M}=f||{},I=d||j||M;return k.jsx("rect",{className:qt(["react-flow__minimap-node",{selected:S},w]),x:r,y:i,rx:b,ry:b,width:s,height:u,style:{fill:I,stroke:m,strokeWidth:v},shapeRendering:x,onClick:C?A=>C(A,t):void 0})}const Tb=ee.memo(Pb),Mb=t=>t.nodes.map(r=>r.id),pf=t=>t instanceof Function?t:()=>t;function Ib({nodeStrokeColor:t,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:u,nodeComponent:f=Tb,onClick:d}){const m=mt(Mb,At),v=pf(r),w=pf(t),b=pf(i),x=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return k.jsx(k.Fragment,{children:m.map(S=>k.jsx(Ab,{id:S,nodeColorFunc:v,nodeStrokeColorFunc:w,nodeClassNameFunc:b,nodeBorderRadius:s,nodeStrokeWidth:u,NodeComponent:f,onClick:d,shapeRendering:x},S))})}function $b({id:t,nodeColorFunc:r,nodeStrokeColorFunc:i,nodeClassNameFunc:s,nodeBorderRadius:u,nodeStrokeWidth:f,shapeRendering:d,NodeComponent:m,onClick:v}){const{node:w,x:b,y:x,width:S,height:C}=mt(j=>{const M=j.nodeLookup.get(t);if(!M)return{node:void 0,x:0,y:0,width:0,height:0};const I=M.internals.userNode,{x:A,y:V}=M.internals.positionAbsolute,{width:P,height:R}=Mo(I);return{node:I,x:A,y:V,width:P,height:R}},At);return!w||w.hidden||!ig(w)?null:k.jsx(m,{x:b,y:x,width:S,height:C,style:w.style,selected:!!w.selected,className:s(w),color:r(w),borderRadius:u,strokeColor:i(w),strokeWidth:f,shapeRendering:d,onClick:v,id:w.id})}const Ab=ee.memo($b);var Ob=ee.memo(Ib);const Rb=200,Db=150,zb=t=>!t.hidden,Lb=t=>{const r={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:r,boundingRect:t.nodeLookup.size>0?og(Da(t.nodeLookup,{filter:zb}),r):r,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},Fb="react-flow__minimap-desc";function sy({style:t,className:r,nodeStrokeColor:i,nodeColor:s,nodeClassName:u="",nodeBorderRadius:f=5,nodeStrokeWidth:d,nodeComponent:m,bgColor:v,maskColor:w,maskStrokeColor:b,maskStrokeWidth:x,position:S="bottom-right",onClick:C,onNodeClick:j,pannable:M=!1,zoomable:I=!1,ariaLabel:A,inversePan:V,zoomStep:P=1,offsetScale:R=5}){const q=Tt(),B=ee.useRef(null),{boundingRect:X,viewBB:fe,rfId:he,panZoom:Se,translateExtent:K,flowWidth:ce,flowHeight:xe,ariaLabelConfig:D}=mt(Lb,At),le=(t==null?void 0:t.width)??Rb,Q=(t==null?void 0:t.height)??Db,se=X.width/le,L=X.height/Q,U=Math.max(se,L),F=U*le,$=U*Q,H=R*U,we=X.x-(F-X.width)/2-H,be=X.y-($-X.height)/2-H,Te=F+H*2,$e=$+H*2,Re=`${Fb}-${he}`,_e=ee.useRef(0),Be=ee.useRef();_e.current=U,ee.useEffect(()=>{if(B.current&&Se)return Be.current=t_({domNode:B.current,panZoom:Se,getTransform:()=>q.getState().transform,getViewScale:()=>_e.current}),()=>{var qe;(qe=Be.current)==null||qe.destroy()}},[Se]),ee.useEffect(()=>{var qe;(qe=Be.current)==null||qe.update({translateExtent:K,width:ce,height:xe,inversePan:V,pannable:M,zoomStep:P,zoomable:I})},[M,I,V,P,K,ce,xe]);const ke=C?qe=>{var it;const[ut,ct]=((it=Be.current)==null?void 0:it.pointer(qe))||[0,0];C(qe,{x:ut,y:ct})}:void 0,He=j?ee.useCallback((qe,ut)=>{const ct=q.getState().nodeLookup.get(ut).internals.userNode;j(qe,ct)},[]):void 0,Ae=A??D["minimap.ariaLabel"];return k.jsx(Fa,{position:S,style:{...t,"--xy-minimap-background-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-background-color-props":typeof w=="string"?w:void 0,"--xy-minimap-mask-stroke-color-props":typeof b=="string"?b:void 0,"--xy-minimap-mask-stroke-width-props":typeof x=="number"?x*U:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof d=="number"?d:void 0},className:qt(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:k.jsxs("svg",{width:le,height:Q,viewBox:`${we} ${be} ${Te} ${$e}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Re,ref:B,onClick:ke,children:[Ae&&k.jsx("title",{id:Re,children:Ae}),k.jsx(Ob,{onClick:He,nodeColor:s,nodeStrokeColor:i,nodeBorderRadius:f,nodeClassName:u,nodeStrokeWidth:d,nodeComponent:m}),k.jsx("path",{className:"react-flow__minimap-mask",d:`M${we-H},${be-H}h${Te+H*2}v${$e+H*2}h${-Te-H*2}z
|
|
202
|
+
M${fe.x},${fe.y}h${fe.width}v${fe.height}h${-fe.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}sy.displayName="MiniMap";const Bb=ee.memo(sy),Hb=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,Vb={[Os.Line]:"right",[Os.Handle]:"bottom-right"};function Ub({nodeId:t,position:r,variant:i=Os.Handle,className:s,style:u=void 0,children:f,color:d,minWidth:m=10,minHeight:v=10,maxWidth:w=Number.MAX_VALUE,maxHeight:b=Number.MAX_VALUE,keepAspectRatio:x=!1,resizeDirection:S,autoScale:C=!0,shouldResize:j,onResizeStart:M,onResize:I,onResizeEnd:A}){const V=zg(),P=typeof t=="string"?t:V,R=Tt(),q=ee.useRef(null),B=i===Os.Handle,X=mt(ee.useCallback(Hb(B&&C),[B,C]),At),fe=ee.useRef(null),he=r??Vb[i];ee.useEffect(()=>{if(!(!q.current||!P))return fe.current||(fe.current=m_({domNode:q.current,nodeId:P,getStoreItems:()=>{const{nodeLookup:K,transform:ce,snapGrid:xe,snapToGrid:D,nodeOrigin:le,domNode:Q}=R.getState();return{nodeLookup:K,transform:ce,snapGrid:xe,snapToGrid:D,nodeOrigin:le,paneDomNode:Q}},onChange:(K,ce)=>{const{triggerNodeChanges:xe,nodeLookup:D,parentLookup:le,nodeOrigin:Q}=R.getState(),se=[],L={x:K.x,y:K.y},U=D.get(P);if(U&&U.expandParent&&U.parentId){const F=U.origin??Q,$=K.width??U.measured.width??0,H=K.height??U.measured.height??0,we={id:U.id,parentId:U.parentId,rect:{width:$,height:H,...sg({x:K.x??U.position.x,y:K.y??U.position.y},{width:$,height:H},U.parentId,D,F)}},be=Qf([we],D,le,Q);se.push(...be),L.x=K.x?Math.max(F[0]*$,K.x):void 0,L.y=K.y?Math.max(F[1]*H,K.y):void 0}if(L.x!==void 0&&L.y!==void 0){const F={id:P,type:"position",position:{...L}};se.push(F)}if(K.width!==void 0&&K.height!==void 0){const $={id:P,type:"dimensions",resizing:!0,setAttributes:S?S==="horizontal"?"width":"height":!0,dimensions:{width:K.width,height:K.height}};se.push($)}for(const F of ce){const $={...F,type:"position"};se.push($)}xe(se)},onEnd:({width:K,height:ce})=>{const xe={id:P,type:"dimensions",resizing:!1,dimensions:{width:K,height:ce}};R.getState().triggerNodeChanges([xe])}})),fe.current.update({controlPosition:he,boundaries:{minWidth:m,minHeight:v,maxWidth:w,maxHeight:b},keepAspectRatio:x,resizeDirection:S,onResizeStart:M,onResize:I,onResizeEnd:A,shouldResize:j}),()=>{var K;(K=fe.current)==null||K.destroy()}},[he,m,v,w,b,x,M,I,A,j]);const Se=he.split("-");return k.jsx("div",{className:qt(["react-flow__resize-control","nodrag",...Se,i,s]),ref:q,style:{...u,scale:X,...d&&{[B?"backgroundColor":"borderColor"]:d}},children:f})}ee.memo(Ub);function Zf(t,r,i){var f,d;const s=r.toLowerCase(),u=(d=(f=t.paths)==null?void 0:f[i])==null?void 0:d[s];return(u==null?void 0:u.summary)??(u==null?void 0:u.operationId)??`${r.toUpperCase()} ${i}`}function ed(t,r,i){var m,v,w,b;const s=r.toLowerCase(),u=(v=(m=t.paths)==null?void 0:m[i])==null?void 0:v[s];if(!(u!=null&&u.requestBody))return"— sin body";const d=(b=(w=u.requestBody.content)==null?void 0:w["application/json"])==null?void 0:b.schema;return d&&"$ref"in d?`body: ${d.$ref}`:"body: JSON"}function td(t,r,i){var m,v,w,b,x,S;const s=r.toLowerCase(),u=(v=(m=t.paths)==null?void 0:m[i])==null?void 0:v[s],f=((w=u==null?void 0:u.responses)==null?void 0:w["200"])??((b=u==null?void 0:u.responses)==null?void 0:b["201"]);if(!f)return"—";const d=typeof f=="object"&&f&&"content"in f?(S=(x=f.content)==null?void 0:x["application/json"])==null?void 0:S.schema:void 0;return d&&"$ref"in d?String(d.$ref):"JSON"}const iu=()=>({sourceJsonPath:"$",variableName:"v",useInTarget:"vars_only",targetKey:""});function hf(t,r){return`${t.toLowerCase()} ${r}`}function Kb(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}const ay=ee.createContext(null);function qb(t){const{id:r,selected:i}=t,s=t.data,u=ee.useContext(ay),f=hb();return ee.useEffect(()=>{f(r)},[s.path,s.method,r,f]),k.jsxs("div",{className:`rounded-xl border bg-surface-950/90 px-3 py-2 min-w-[200px] max-w-[280px] shadow-lg ${i?"border-accent ring-2 ring-accent/40":"border-surface-600"}`,children:[k.jsx(Rs,{type:"target",position:Ze.Left,id:"in",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-teal-500"}),k.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[k.jsx("span",{className:"text-[10px] uppercase font-bold text-accent tracking-wide",children:s.method}),k.jsx("span",{className:"text-[10px] text-slate-500 truncate",title:s.summary,children:s.summary})]}),u?k.jsxs("label",{className:"block text-[10px] text-slate-500 mb-1",children:["Endpoint",k.jsx("select",{className:"mt-0.5 w-full bg-surface-900 border border-surface-600 rounded px-1.5 py-1 text-[11px] font-mono",value:hf(s.method,s.path),onChange:d=>{const{method:m,path:v}=Kb(d.target.value);u.updateNodeData(r,{method:m,path:v,summary:Zf(u.doc,m,v),reqHint:ed(u.doc,m,v),resHint:td(u.doc,m,v)})},children:u.ops.map(d=>k.jsxs("option",{value:hf(d.method,d.path),children:[d.method.toUpperCase()," ",d.path]},hf(d.method,d.path)))})]}):k.jsx("p",{className:"font-mono text-[11px] text-slate-300 truncate",children:s.path}),k.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-1 text-[9px] text-slate-500 leading-tight",children:[k.jsxs("div",{children:[k.jsx("span",{className:"text-slate-600",children:"req"})," ",s.reqHint]}),k.jsxs("div",{children:[k.jsx("span",{className:"text-slate-600",children:"res"})," ",s.resHint]})]}),k.jsx(Rs,{type:"source",position:Ze.Right,id:"out",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-amber-500"})]})}const Wb={apiOp:qb};function Yb(t,r){const i=r.nodes.map(u=>({id:u.id,type:"apiOp",position:{x:u.x,y:u.y},data:{method:u.method.toLowerCase(),path:u.path,summary:Zf(t,u.method,u.path),reqHint:ed(t,u.method,u.path),resHint:td(t,u.method,u.path)}})),s=r.edges.map(u=>({id:u.id,source:u.source,target:u.target,sourceHandle:"out",targetHandle:"in",data:{mapping:{...u.mapping}},label:u.mapping.variableName,style:{stroke:"rgb(148 163 184 / 0.9)",strokeWidth:2}}));return{nodes:i,edges:s}}function Xb(t,r){return{nodes:t.map(i=>({id:i.id,method:i.data.method,path:i.data.path,x:i.position.x,y:i.position.y})),edges:r.map(i=>{var s;return{id:i.id,source:i.source,target:i.target,mapping:((s=i.data)==null?void 0:s.mapping)??iu()}})}}const Qb=[{value:"vars_only",label:"Solo variable ({nombre} en la ruta)"},{value:"path_param",label:"Path param {clave}"},{value:"header",label:"Header"},{value:"query",label:"Query string"}];function Gb({doc:t,ops:r,graph:i,onGraphChange:s}){var P,R,q,B,X,fe,he,Se;const u=ee.useMemo(()=>Yb(t,i),[t,i]),[f,d,m]=mb(u.nodes),[v,w,b]=gb(u.edges),[x,S]=ee.useState(null);ee.useEffect(()=>{s(Xb(f,v))},[f,v,s]);const C=ee.useCallback((K,ce)=>{d(xe=>xe.map(D=>D.id===K?{...D,data:{...D.data,...ce}}:D))},[d]),j=ee.useMemo(()=>({doc:t,ops:r,updateNodeData:C}),[t,r,C]),M=ee.useCallback(K=>{K.sourceHandle!=="out"||K.targetHandle!=="in"||w(ce=>pg({...K,id:`e-${K.source}-${K.target}-${crypto.randomUUID().slice(0,8)}`,sourceHandle:"out",targetHandle:"in",data:{mapping:iu()},label:iu().variableName,style:{stroke:"rgb(148 163 184 / 0.9)",strokeWidth:2}},ce))},[w]),I=v.find(K=>K.id===x),A=K=>{x&&w(ce=>ce.map(xe=>{var le;if(xe.id!==x)return xe;const D={...((le=xe.data)==null?void 0:le.mapping)??iu(),...K};return{...xe,data:{mapping:D},label:D.variableName}}))},V=()=>{const K=f.reduce((se,L)=>L.position.x>se?L.position.x:se,0),ce=r[0];if(!ce)return;const xe=crypto.randomUUID(),D=K>0?K+40:80,Q={id:xe,type:"apiOp",position:{x:D,y:120},data:{method:ce.method.toLowerCase(),path:ce.path,summary:Zf(t,ce.method,ce.path),reqHint:ed(t,ce.method,ce.path),resHint:td(t,ce.method,ce.path)}};d(se=>[...se,Q])};return k.jsx(ay.Provider,{value:j,children:k.jsxs("div",{className:"space-y-3",children:[k.jsx("div",{className:"h-[min(520px,70vh)] w-full rounded-xl border border-surface-700 bg-surface-950",children:k.jsxs(pb,{nodes:f,edges:v,onNodesChange:m,onEdgesChange:b,onConnect:M,nodeTypes:Wb,onEdgeClick:(K,ce)=>S(ce.id),onPaneClick:()=>S(null),fitView:!0,minZoom:.4,maxZoom:1.5,proOptions:{hideAttribution:!0},isValidConnection:K=>K.sourceHandle==="out"&&K.targetHandle==="in",children:[k.jsx(_b,{variant:Po.Dots,gap:16,size:1,color:"rgb(51 65 85 / 0.5)"}),k.jsx(jb,{className:"!bg-surface-900 !border-surface-600 !shadow-lg"}),k.jsx(Bb,{className:"!bg-surface-900/95 !border-surface-600",nodeColor:()=>"rgb(45 212 191 / 0.5)"}),k.jsx(Fa,{position:"top-left",children:k.jsx("button",{type:"button",onClick:V,className:"text-xs px-3 py-2 rounded-lg bg-accent/90 text-surface-950 font-medium shadow",children:"+ Nodo (endpoint)"})})]})}),k.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[k.jsx("h4",{className:"text-xs font-semibold text-slate-300",children:"Cable seleccionado (respuesta → request)"}),I?k.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs",children:[k.jsxs("label",{className:"text-slate-500",children:["JSON path en la respuesta",k.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((P=I.data)==null?void 0:P.mapping.sourceJsonPath)??"$",onChange:K=>A({sourceJsonPath:K.target.value}),placeholder:"$.access_token"})]}),k.jsxs("label",{className:"text-slate-500",children:["Nombre de variable",k.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((R=I.data)==null?void 0:R.mapping.variableName)??"",onChange:K=>A({variableName:K.target.value}),placeholder:"token"})]}),k.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Cómo se usa en el request del nodo destino",k.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((q=I.data)==null?void 0:q.mapping.useInTarget)??"vars_only",onChange:K=>A({useInTarget:K.target.value}),children:Qb.map(K=>k.jsx("option",{value:K.value,children:K.label},K.value))})]}),(((B=I.data)==null?void 0:B.mapping.useInTarget)==="path_param"||((X=I.data)==null?void 0:X.mapping.useInTarget)==="header"||((fe=I.data)==null?void 0:fe.mapping.useInTarget)==="query")&&k.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Clave (nombre del param / header / query)",k.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((he=I.data)==null?void 0:he.mapping.targetKey)??"",onChange:K=>A({targetKey:K.target.value}),placeholder:"id / Authorization / q"})]}),k.jsxs("p",{className:"sm:col-span-2 text-[11px] text-slate-500 leading-relaxed",children:["El valor extraído se guarda en la variable y, según la opción, se inyecta en la ruta"," ",k.jsx("code",{className:"text-accent",children:"{clave}"}),", en un header, o en query. Con «solo variable», usa"," ",k.jsx("code",{className:"text-accent",children:"{"+(((Se=I.data)==null?void 0:Se.mapping.variableName)||"var")+"}"})," ","en la ruta del endpoint destino."]})]}):k.jsx("p",{className:"text-xs text-slate-500",children:"Conecta la salida derecha (res) de un nodo con la entrada izquierda (req) de otro. Haz clic en un cable para definir el mapeo."})]})]})})}function ly(t,r){const i=new Map(t.map(v=>[v.id,v])),s=new Set(t.map(v=>v.id)),u=new Map,f=new Map;for(const v of s)u.set(v,0),f.set(v,[]);for(const v of r)!s.has(v.source)||!s.has(v.target)||(u.set(v.target,(u.get(v.target)??0)+1),f.get(v.source).push(v.target));const d=[];for(const[v,w]of u)w===0&&d.push(v);d.sort((v,w)=>i.get(v).x-i.get(w).x||i.get(v).y-i.get(w).y);const m=[];for(;d.length;){const v=d.shift();m.push(v);for(const w of f.get(v)??[]){const b=(u.get(w)??0)-1;u.set(w,b),b===0&&(d.push(w),d.sort((x,S)=>i.get(x).x-i.get(S).x||i.get(x).y-i.get(S).y))}}if(m.length<t.length){const v=t.filter(w=>!m.includes(w.id)).sort((w,b)=>w.x-b.x||w.y-b.y);return[...m.map(w=>i.get(w)),...v]}return m.map(v=>i.get(v))}async function am(t,r,i){var v;const{nodes:s,edges:u}=t;if(s.length===0)return"Sin nodos en el flujo.";const f=ly(s,u),d={};let m="";for(let w=0;w<f.length;w++){const b=f[w];let x=b.path;const S={...i()},C=u.filter(q=>q.target===b.id);for(const q of C){const{mapping:B}=q,X=d[B.variableName];if(X!==void 0)switch(B.useInTarget){case"path_param":B.targetKey&&(x=x.split(`{${B.targetKey}}`).join(X));break;case"header":if(B.targetKey){const fe=B.targetKey;S[fe]=fe.toLowerCase()==="authorization"&&!X.startsWith("Bearer ")?`Bearer ${X}`:X}break;case"query":{const fe=x.includes("?")?"&":"?";x=`${x}${fe}${encodeURIComponent(B.targetKey)}=${encodeURIComponent(X)}`;break}case"vars_only":default:x=x.split(`{${B.variableName}}`).join(X);break}}for(const[q,B]of Object.entries(d))x=x.split(`{${q}}`).join(B);const j=`${r.replace(/\/$/,"")}${x}`,M={method:b.method.toUpperCase(),headers:S},I=b.method.toLowerCase();I!=="get"&&I!=="head"&&(M.body="{}");const A=await fetch(j,{...M,credentials:"include"});let V={};const P=await A.text();try{V=P?JSON.parse(P):{}}catch{V={_raw:P}}m+=`▸ ${b.method.toUpperCase()} ${b.path} → ${A.status}
|
|
203
|
+
${JSON.stringify(V,null,2)}
|
|
204
|
+
|
|
205
|
+
`;const R=u.filter(q=>q.source===b.id);for(const q of R){const B=((v=q.mapping.sourceJsonPath)==null?void 0:v.trim())||"$",X=Af(V,B);X!=null&&(d[q.mapping.variableName]=typeof X=="object"?JSON.stringify(X):String(X))}}return m+=`
|
|
206
|
+
Variables finales: ${JSON.stringify(d,null,2)}`,m}function Jb(t){const r=ly(t.nodes,t.edges);return r.map((i,s)=>{const u=r[s+1];if(!u)return{method:i.method,path:i.path};const f=t.edges.find(d=>d.source===i.id&&d.target===u.id);return f?{method:i.method,path:i.path,extract:{varName:f.mapping.variableName,jsonPath:f.mapping.sourceJsonPath||"$"}}:{method:i.method,path:i.path}})}function Zb(t){var s;const r=t.map((u,f)=>({id:`n-${f}`,method:u.method,path:u.path,x:40+f*300,y:120})),i=[];for(let u=0;u<t.length-1;u++){const f=(s=t[u])==null?void 0:s.extract;f!=null&&f.jsonPath&&i.push({id:`e-${u}`,source:`n-${u}`,target:`n-${u+1}`,mapping:{sourceJsonPath:f.jsonPath,variableName:f.varName,useInTarget:"vars_only",targetKey:""}})}return{nodes:r,edges:i}}const uy=ee.createContext({productName:null,logoDataUrl:null});function ek({value:t,children:r}){return k.jsx(uy.Provider,{value:t,children:r})}function tk(){return ee.useContext(uy)}function nk({data:t,defaultOpenDepth:r=3}){return k.jsx("div",{className:"json-tree text-[11px] font-mono leading-relaxed text-left overflow-auto max-h-80 rounded-lg border border-surface-700 bg-surface-950/80 p-2",children:k.jsx(nd,{value:t,depth:0,defaultOpenDepth:r})})}function nd({value:t,depth:r,defaultOpenDepth:i,name:s}){return t===null||typeof t!="object"?k.jsx(rk,{name:s,value:t}):Array.isArray(t)?k.jsx(ok,{name:s,value:t,depth:r,defaultOpenDepth:i}):k.jsx(ik,{name:s,value:t,depth:r,defaultOpenDepth:i})}function rk({name:t,value:r}){return k.jsxs("div",{className:"pl-1 break-all",children:[t!=null&&k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),k.jsx("span",{className:"text-slate-500",children:": "})]}),k.jsx("span",{className:"text-emerald-200/95",children:JSON.stringify(r)})]})}function ok({name:t,value:r,depth:i,defaultOpenDepth:s}){const u=i<s,[f,d]=ee.useState(u);return r.length===0?k.jsxs("div",{className:"pl-1",children:[t!=null&&k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),k.jsx("span",{className:"text-slate-500",children:": "})]}),k.jsx("span",{className:"text-slate-500",children:"[]"})]}):k.jsxs("div",{className:"pl-1",children:[t!=null&&k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),k.jsx("span",{className:"text-slate-500",children:": "})]}),k.jsx("button",{type:"button","aria-expanded":f,onClick:()=>d(!f),className:"inline align-middle text-slate-400 hover:text-slate-200 mr-1 select-none w-4",children:f?"▼":"▶"}),k.jsx("span",{className:"text-slate-500",children:"["}),k.jsx("span",{className:"text-slate-600 text-[10px] ml-1",children:r.length}),f&&k.jsx("ul",{className:"list-none my-0.5 ml-4 border-l border-surface-600 pl-2 space-y-0.5",children:r.map((m,v)=>k.jsxs("li",{children:[k.jsx("span",{className:"text-violet-400/90 mr-1",children:v}),k.jsx(nd,{value:m,depth:i+1,defaultOpenDepth:s})]},v))}),!f&&k.jsx("span",{className:"text-slate-600",children:" … "}),k.jsx("span",{className:"text-slate-500",children:"]"})]})}function ik({name:t,value:r,depth:i,defaultOpenDepth:s}){const u=Object.keys(r),f=i<s,[d,m]=ee.useState(f);return u.length===0?k.jsxs("div",{className:"pl-1",children:[t!=null&&k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),k.jsx("span",{className:"text-slate-500",children:": "})]}),k.jsx("span",{className:"text-slate-500",children:"{}"})]}):k.jsxs("div",{className:"pl-1",children:[t!=null&&k.jsxs(k.Fragment,{children:[k.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),k.jsx("span",{className:"text-slate-500",children:": "})]}),k.jsx("button",{type:"button","aria-expanded":d,onClick:()=>m(!d),className:"inline align-middle text-slate-400 hover:text-slate-200 mr-1 select-none w-4",children:d?"▼":"▶"}),k.jsx("span",{className:"text-slate-500",children:"{"}),k.jsx("span",{className:"text-slate-600 text-[10px] ml-1",children:u.length}),d&&k.jsx("ul",{className:"list-none my-0.5 ml-4 border-l border-surface-600 pl-2 space-y-0.5",children:u.map(v=>k.jsx("li",{children:k.jsx(nd,{name:v,value:r[v],depth:i+1,defaultOpenDepth:s})},v))}),!d&&k.jsx("span",{className:"text-slate-600",children:" … "}),k.jsx("span",{className:"text-slate-500",children:"}"})]})}function rd(t,r){if(!r.startsWith("#/"))return;const i=r.slice(2).split("/");let s=t;for(const u of i)if(s&&typeof s=="object"&&u in s)s=s[u];else return;return s}function sk(t,r){return"$ref"in r?rd(t,r.$ref):r}function lm(t,r){return"$ref"in r?rd(t,r.$ref):r}function ak(t,r,i){var w;const s=(w=t.paths)==null?void 0:w[i],u=s==null?void 0:s[r.toLowerCase()];if(!u)return[];const f=(s==null?void 0:s.parameters)??[],d=u.parameters??[],m=new Set,v=[];for(const b of[...f,...d]){const x=sk(t,b);if(!x||!["query","path","header","cookie"].includes(x.in))continue;const S=`${x.in}:${x.name}`;m.has(S)||(m.add(S),v.push({name:x.name,in:x.in,required:!!x.required,description:typeof x.description=="string"?x.description:void 0}))}return v}function um(t,r,i){var v,w,b,x;const s=(w=(v=t.paths)==null?void 0:v[i])==null?void 0:w[r.toLowerCase()];if(!(s!=null&&s.requestBody))return null;const u=s.requestBody,f="$ref"in u?rd(t,u.$ref):u;if(!((x=(b=f==null?void 0:f.content)==null?void 0:b["application/json"])!=null&&x.schema))return null;const d=f.content["application/json"].schema,m=lm(t,d);if(!m)return null;if(m.type==="object"&&m.properties&&Object.keys(m.properties).length>0){const S=new Set(m.required??[]);return Object.keys(m.properties).map(C=>{const j=m.properties[C],M=j&&"$ref"in j?lm(t,j):j;return{key:C,required:S.has(C),description:M==null?void 0:M.description,format:M==null?void 0:M.format,type:M==null?void 0:M.type}})}return null}function lk(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function uk(t,r){let i=t;for(const[s,u]of Object.entries(r))i=i.replace(new RegExp(`\\{${lk(s)}\\}`,"g"),encodeURIComponent(u));return i}function ck(t,r){const i=new URLSearchParams;for(const u of r){if(u.in!=="query")continue;const f=t[u.name];f!==void 0&&f!==""&&i.set(u.name,f)}const s=i.toString();return s?`?${s}`:""}function cy(t,r){var s;if(!(t!=null&&t.length))return{};const i={};for(const u of t){const f=((s=r[u.key])==null?void 0:s.trim())??"";if(f==="")continue;const d=u.type;if(d==="integer"||d==="number"){const m=Number(f);i[u.key]=Number.isFinite(m)?m:f}else if(d==="boolean")i[u.key]=f==="true"||f==="1";else try{i[u.key]=JSON.parse(f)}catch{i[u.key]=f}}return i}function cm(t,r){const i=cy(t,r);return JSON.stringify(i,null,2)}function fk(t,r){if(!(t!=null&&t.length))return{};try{const i=JSON.parse(r||"{}"),s={};for(const u of t)if(u.key in i&&i[u.key]!==void 0){const f=i[u.key];s[u.key]=typeof f=="string"?f:JSON.stringify(f)}else s[u.key]="";return s}catch{return Object.fromEntries(t.map(i=>[i.key,""]))}}function dk(t){return/\{[^/}]+\}/.test(t)}function pk(t,r,i,s,u){var m,v;const f={...t};for(const w of r){const b=(m=i[w.name])==null?void 0:m.trim();b&&(f[w.name]=b)}const d=[];for(const w of s){const b=(v=u[w.name])==null?void 0:v.trim();b&&d.push(`${w.name}=${b}`)}return d.length&&(f.Cookie=f.Cookie?`${f.Cookie}; ${d.join("; ")}`:d.join("; ")),f}function hk({doc:t,selectedOp:r,baseUrl:i,buildHeaders:s}){const[u,f]=ee.useState({}),[d,m]=ee.useState({}),[v,w]=ee.useState({}),[b,x]=ee.useState({}),[S,C]=ee.useState({}),[j,M]=ee.useState("{}"),[I,A]=ee.useState("raw"),[V,P]=ee.useState(null),[R,q]=ee.useState(null),B=ee.useMemo(()=>ak(t,r.method,r.path),[t,r.method,r.path]),X=ee.useMemo(()=>B.filter(F=>F.in==="path"),[B]),fe=ee.useMemo(()=>B.filter(F=>F.in==="query"),[B]),he=ee.useMemo(()=>B.filter(F=>F.in==="header"),[B]),Se=ee.useMemo(()=>B.filter(F=>F.in==="cookie"),[B]),K=ee.useMemo(()=>um(t,r.method,r.path),[t,r.method,r.path]),ce=r.method.toLowerCase(),xe=ce!=="get"&&ce!=="head";ee.useEffect(()=>{f({}),m({}),w({}),x({}),q(null),P(null);const F=um(t,r.method,r.path);F!=null&&F.length?(C(Object.fromEntries(F.map($=>[$.key,""]))),A("fields"),M(cm(F,{}))):(C({}),A("raw"),M("{}"))},[t,r.method,r.path]);const D=ee.useCallback((F,$)=>{C(H=>({...H,[F]:$}))},[]),le=ee.useCallback(()=>{K!=null&&K.length&&M(cm(K,S)),A("raw")},[K,S]),Q=ee.useCallback(()=>{K!=null&&K.length&&C(fk(K,j)),A("fields")},[K,j]),se=async()=>{var $e,Re,_e,Be,ke;q(null);const F=ks(t,i);for(const He of X)if(He.required&&!(($e=u[He.name])!=null&&$e.trim())){q(`Parámetro de ruta obligatorio: ${He.name}`);return}for(const He of fe)if(He.required&&!((Re=d[He.name])!=null&&Re.trim())){q(`Query obligatorio: ${He.name}`);return}for(const He of he)if(He.required&&!((_e=v[He.name])!=null&&_e.trim())){q(`Header obligatorio: ${He.name}`);return}for(const He of Se)if(He.required&&!((Be=b[He.name])!=null&&Be.trim())){q(`Cookie obligatorio: ${He.name}`);return}let $=uk(r.path,u);if(dk($)){q("Quedan placeholders `{…}` en la ruta sin valor.");return}const H=ck(d,B),we=`${F}${$}${H}`,be=pk(s(),he,v,Se,b),Te={method:r.method.toUpperCase(),headers:be,credentials:"include"};if(xe)if(I==="fields"&&(K!=null&&K.length)){for(const Ae of K)if(Ae.required&&!((ke=S[Ae.key])!=null&&ke.trim())){q(`Campo de body obligatorio: ${Ae.key}`);return}const He=cy(K,S);Te.body=JSON.stringify(He)}else{const He=j.trim()||"{}";Te.body=He}try{const He=await fetch(we,Te),Ae=await He.text();let qe=null;try{qe=Ae?JSON.parse(Ae):null}catch{qe=null}P({status:He.status,statusText:He.statusText,bodyText:Ae,json:qe})}catch(He){P(null),q(He instanceof Error?He.message:String(He))}},L=(F,$,H)=>k.jsxs("label",{className:"block text-xs",children:[k.jsxs("span",{className:"text-slate-400",children:[F.name,F.required?k.jsx("span",{className:"text-rose-400/90",children:" *"}):null,F.in!=="path"?k.jsxs("span",{className:"text-slate-600 ml-1",children:["(",F.in,")"]}):null]}),k.jsx("input",{type:"text",className:"mt-0.5 w-full bg-surface-900 border border-surface-600 rounded-lg px-2 py-1.5 font-mono text-[11px] text-slate-200",value:$[F.name]??"",onChange:we=>H(be=>({...be,[F.name]:we.target.value})),placeholder:F.description||(F.in==="path"?`{${F.name}}`:""),autoComplete:"off"})]},`${F.in}:${F.name}`),U=F=>k.jsxs("label",{className:"block text-xs",children:[k.jsxs("span",{className:"text-slate-400",children:[F.key,F.required?k.jsx("span",{className:"text-rose-400/90",children:" *"}):null,F.type?k.jsxs("span",{className:"text-slate-600 ml-1",children:["(",F.type,")"]}):null]}),k.jsx("input",{type:"text",className:"mt-0.5 w-full bg-surface-900 border border-surface-600 rounded-lg px-2 py-1.5 font-mono text-[11px] text-slate-200",value:S[F.key]??"",onChange:$=>D(F.key,$.target.value),placeholder:F.description||"valor o JSON para objetos anidados",autoComplete:"off"})]},F.key);return k.jsxs("section",{className:"space-y-3",children:[k.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Probar"}),(X.length>0||fe.length>0||he.length>0||Se.length>0)&&k.jsxs("div",{className:"space-y-2 rounded-lg border border-surface-700 bg-surface-900/40 p-3",children:[k.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Parámetros"}),k.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[X.map(F=>L(F,u,f)),fe.map(F=>L(F,d,m)),he.map(F=>L(F,v,w)),Se.map(F=>L(F,b,x))]})]}),xe&&k.jsxs("div",{className:"space-y-2",children:[k.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[k.jsx("span",{className:"text-xs text-slate-400",children:"Body"}),K!=null&&K.length?k.jsxs("div",{className:"flex rounded-lg border border-surface-600 overflow-hidden text-xs",children:[k.jsx("button",{type:"button",className:`px-3 py-1 ${I==="fields"?"bg-accent/25 text-accent":"bg-surface-800 text-slate-400"}`,onClick:Q,children:"Campos"}),k.jsx("button",{type:"button",className:`px-3 py-1 ${I==="raw"?"bg-accent/25 text-accent":"bg-surface-800 text-slate-400"}`,onClick:le,children:"JSON raw"})]}):k.jsx("span",{className:"text-[10px] text-slate-500",children:"(solo JSON — sin propiedades `object` en el spec)"})]}),I==="fields"&&(K!=null&&K.length)?k.jsx("div",{className:"grid gap-2 sm:grid-cols-2 rounded-lg border border-surface-700 bg-surface-900/40 p-3",children:K.map(F=>U(F))}):k.jsx("textarea",{className:"w-full h-28 bg-surface-900 border border-surface-600 rounded-lg p-3 font-mono text-xs",value:j,onChange:F=>M(F.target.value),placeholder:'{"key": "value"}',spellCheck:!1})]}),R&&k.jsx("p",{className:"text-xs text-rose-400/95 bg-rose-950/30 border border-rose-800/50 rounded-lg px-2 py-1.5",children:R}),k.jsx("button",{type:"button",onClick:()=>void se(),className:"px-4 py-2 rounded-lg bg-accent text-surface-950 font-medium text-sm",children:"Ejecutar"}),k.jsxs("div",{className:"space-y-2",children:[k.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Respuesta"}),V?k.jsxs(k.Fragment,{children:[k.jsxs("div",{className:"text-xs font-mono text-slate-300 bg-surface-900/80 border border-surface-700 rounded-lg px-3 py-2",children:[k.jsx("span",{className:V.status>=200&&V.status<300?"text-emerald-400":V.status>=400?"text-rose-400":"text-amber-300",children:V.status})," ",V.statusText]}),V.json!==null?k.jsx(nk,{data:V.json,defaultOpenDepth:3}):k.jsx("pre",{className:"text-xs bg-surface-900 border border-surface-700 rounded-lg p-3 overflow-auto max-h-64 text-emerald-300/90 whitespace-pre-wrap font-mono",children:V.bodyText||"—"})]}):k.jsx("p",{className:"text-xs text-slate-500",children:"—"})]})]})}const fy=[{value:200,label:"200 OK"},{value:201,label:"201 Created"},{value:202,label:"202 Accepted"},{value:204,label:"204 No Content"},{value:400,label:"400 Bad Request"},{value:401,label:"401 Unauthorized"},{value:403,label:"403 Forbidden"},{value:404,label:"404 Not Found"},{value:409,label:"409 Conflict"},{value:422,label:"422 Unprocessable"},{value:429,label:"429 Too Many Requests"},{value:500,label:"500 Server Error"},{value:502,label:"502 Bad Gateway"},{value:503,label:"503 Unavailable"}];function fm(t){return fy.some(r=>r.value===t)}const mf=[{id:"typescript",label:"TypeScript"},{id:"javascript",label:"JavaScript"},{id:"python",label:"Python"},{id:"php",label:"PHP"}];function gf(t,r){return`${t.toLowerCase()} ${r}`}function mk(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}async function dm(t){await navigator.clipboard.writeText(t)}function gk(){var Mn;const t=tk(),[r,i]=ee.useState(null),[s,u]=ee.useState(null),[f,d]=ee.useState("explore"),[m,v]=ee.useState(""),[w,b]=ee.useState(null),[x,S]=ee.useState(null),[C,j]=ee.useState("typescript"),[M,I]=ee.useState(""),[A,V]=ee.useState(""),[P,R]=ee.useState("X-Api-Key"),[q,B]=ee.useState({nodes:[],edges:[]}),[X,fe]=ee.useState(0),[he,Se]=ee.useState("Mi flujo"),[K,ce]=ee.useState([]),[xe,D]=ee.useState(""),[le,Q]=ee.useState({name:"Suite 1",cases:[]}),[se,L]=ee.useState([]),[U,F]=ee.useState(""),[$,H]=ee.useState(""),[we,be]=ee.useState(null),[Te,$e]=ee.useState(null),[Re,_e]=ee.useState(null),Be=(W,Fe)=>{try{const Le=sessionStorage.getItem(W);if(Le==="1")return!0;if(Le==="0")return!1}catch{}return Fe},[ke,He]=ee.useState(()=>Be("adt-collapse-main",!1)),[Ae,qe]=ee.useState(()=>Be("adt-collapse-explore",!1)),ut="/docs/openapi.json",ct="/docs/preset.json",it=ee.useCallback(async()=>{const[W,Fe]=await Promise.all([_t.flows.toArray(),_t.testSuites.toArray()]);ce(W.sort((Le,nt)=>(Le.name??"").localeCompare(nt.name??""))),L(Fe.sort((Le,nt)=>(Le.name??"").localeCompare(nt.name??"")))},[]);ee.useEffect(()=>{var Fe,Le;if(!r)return;const W=((Fe=t.productName)==null?void 0:Fe.trim())||((Le=r.info.title)==null?void 0:Le.trim())||"API";document.title=W},[r,t.productName]),ee.useEffect(()=>{fetch(ut,{credentials:"include"}).then(async W=>{if(W.status===401){let Fe="/docs/__auth/login";try{const Le=await W.json();Le.loginPath&&(Fe=Le.loginPath)}catch{}return window.location.href=Fe,null}if(!W.ok)throw new Error(`${W.status} ${W.statusText}`);return W.json()}).then(W=>{W&&(i(W),v(ks(W)),u(null))}).catch(W=>u(W.message))},[ut]),ee.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-main",ke?"1":"0")}catch{}},[ke]),ee.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-explore",Ae?"1":"0")}catch{}},[Ae]),ee.useEffect(()=>{(async()=>{try{const W=await fetch("/docs/__auth/session",{credentials:"include"});if(W.ok){const Fe=await W.json();_e({username:Fe.username})}else _e(null)}catch{_e(null)}})()},[]),ee.useEffect(()=>{if(!r)return;let W=!1;return(async()=>{try{const Fe=await fetch(ct,{credentials:"include"});if(!Fe.ok||W)return;const Le=await Fe.json(),nt=await D0(Le);!W&&nt&&await it()}catch{}})(),()=>{W=!0}},[r,ct,it]),ee.useEffect(()=>{it(),_t.kv.get("bearer").then(W=>W&&I(W.value)),_t.kv.get("apiKey").then(W=>W&&V(W.value))},[it]);const Mt=ee.useMemo(()=>r?T0(r):[],[r]),St=ee.useMemo(()=>r?Gr(r):[],[r]),tn=ee.useMemo(()=>w?St.filter(W=>(W.tags??["default"]).includes(w)):St,[St,w]);ee.useEffect(()=>{if(St.length&&!$){const W=St[0];H(gf(W.method,W.path))}},[St,$]),ee.useEffect(()=>{if(St.length===0||q.nodes.length>0||f!=="flows"||we!=null)return;const W=St[0];B({nodes:[{id:crypto.randomUUID(),method:W.method.toLowerCase(),path:W.path,x:80,y:120}],edges:[]}),fe(Fe=>Fe+1)},[St,q.nodes.length,f,we]);const Ot=ee.useCallback(()=>{const W={"Content-Type":"application/json"};return M.trim()&&(W.Authorization=`Bearer ${M.trim()}`),A.trim()&&(W[P]=A.trim()),W},[M,A,P]),bt=ee.useMemo(()=>{if(!r||!x)return null;const W={};for(const{id:Fe}of mf)W[Fe]=C0(r,Fe,x.method,x.path);return W},[r,x]),wn=ee.useMemo(()=>r?P0(r,C,w):"",[r,C,w]),fn=async W=>{var nn;if(!r)return"";const Fe={};let Le="";const nt=ks(r,m);for(let Wt=0;Wt<W.length;Wt++){const Vt=W[Wt];let rn=Vt.path;for(const[or,In]of Object.entries(Fe))rn=rn.replace(`{${or}}`,In);const to=`${nt}${rn}`,on={method:Vt.method.toUpperCase(),headers:Ot()},qn=Vt.method.toLowerCase();qn!=="get"&&qn!=="head"&&(on.body="{}");const Lt=await fetch(to,{...on,credentials:"include"}),Wn=await Lt.json().catch(()=>({}));if(Le+=`Paso ${Wt+1}: ${Lt.status}
|
|
207
|
+
${JSON.stringify(Wn,null,2)}
|
|
208
|
+
|
|
209
|
+
`,(nn=Vt.extract)!=null&&nn.jsonPath){const or=Af(Wn,Vt.extract.jsonPath);or!==void 0&&(Fe[Vt.extract.varName]=String(or))}}return Le},gr=async()=>{if(!r)return;const W=ks(r,m);if(q.nodes.length===0){D("Añade al menos un nodo al flujo.");return}const Fe=await am(q,W,Ot);D(Fe)},_n=async W=>{if(!r)return;const Fe=ks(r,m),Le=W.graph&&W.graph.nodes.length>0?await am(W.graph,Fe,Ot):await fn(W.steps);D(Le),d("flows")},Nt=W=>{Se(W.name),B(W.graph&&W.graph.nodes.length>0?W.graph:Zb(W.steps.length?W.steps:[{method:"get",path:"/"}])),fe(Fe=>Fe+1),be(W.id??null),d("flows")},Ht=()=>{be(null),Se("Nuevo flujo"),St[0]?B({nodes:[{id:crypto.randomUUID(),method:St[0].method.toLowerCase(),path:St[0].path,x:80,y:120}],edges:[]}):B({nodes:[],edges:[]}),fe(W=>W+1)},Hn=ee.useCallback(W=>{B(W)},[]),tr=async()=>{const W=Jb(q);if(we!=null)await _t.flows.update(we,{name:he,steps:W,graph:q});else{const Fe=await _t.flows.add({name:he,steps:W,graph:q});be(Fe)}await it()},Sn=async W=>{W!==void 0&&(W===we&&(be(null),Ht()),await _t.flows.delete(W),await it())},Pn=()=>{if(!$)return;const{method:W,path:Fe}=mk($),Le={id:crypto.randomUUID(),method:W,path:Fe,expectStatus:200,contains:void 0,jsonPath:void 0,expectJsonValue:void 0};Q(nt=>({...nt,cases:[...nt.cases,Le]}))},Vn=W=>{Q(Fe=>({...Fe,cases:Fe.cases.filter(Le=>Le.id!==W)}))},dn=(W,Fe)=>{Q(Le=>({...Le,cases:Le.cases.map(nt=>nt.id===W?{...nt,...Fe}:nt)}))},nr=async W=>{if(!r)return"";const Fe=ks(r,m);let Le="";for(const nt of W){const nn=`${Fe}${nt.path}`,Wt=await fetch(nn,{method:nt.method.toUpperCase(),headers:Ot(),credentials:"include"}),Vt=await Wt.text(),rn=z0(nt,Wt.status,Vt),to=`${rn.pass?"PASS":"FAIL"} ${nt.method.toUpperCase()} ${nt.path}`;Le+=`${to}
|
|
210
|
+
${rn.lines.map(on=>` ${on}`).join(`
|
|
211
|
+
`)}
|
|
212
|
+
|
|
213
|
+
`}return Le},bn=async()=>{const W=await nr(le.cases);F(W)},Ye=async()=>{if(!r||se.length===0)return;let W="";for(const Fe of se)W+=`━━━ ${Fe.name} (${Fe.cases.length} casos) ━━━
|
|
214
|
+
`,W+=await nr(Fe.cases);F(W),d("tests")},Un=async W=>{const Fe=await nr(W.cases);F(Fe),d("tests")},kn=W=>{Q({name:W.name,cases:W.cases.map(Fe=>({...Fe,id:Fe.id&&Fe.id.length>0?Fe.id:crypto.randomUUID()}))}),$e(W.id??null),d("tests")},rr=()=>{$e(null),Q({name:"Nueva suite",cases:[]})},Ve=async()=>{if(Te!=null)await _t.testSuites.update(Te,{name:le.name,cases:le.cases});else{const W=await _t.testSuites.add({name:le.name,cases:le.cases});$e(W)}await it()},Tn=async W=>{W!==void 0&&(W===Te&&($e(null),Q({name:"Nueva suite",cases:[]})),await _t.testSuites.delete(W),await it())},Kn=async()=>{await _t.kv.put({key:"bearer",value:M}),await _t.kv.put({key:"apiKey",value:A})},Or=async()=>{const W=await R0(),Fe=new Blob([JSON.stringify(W,null,2)],{type:"application/json"}),Le=document.createElement("a");Le.href=URL.createObjectURL(Fe),Le.download="api-doc-tor-export.json",Le.click()},Zr=async W=>{var nn;const Fe=(nn=W.target.files)==null?void 0:nn[0];if(!Fe)return;const Le=await Fe.text(),nt=JSON.parse(Le);await xm(nt),await it()},Rr=async()=>{await fetch("/docs/__auth/logout",{method:"POST",credentials:"include"}),window.location.href="/docs/__auth/login"},Io=()=>{x&&(B(W=>{const Fe=W.nodes[W.nodes.length-1],Le=Fe?Fe.x+280:80,nt=(Fe==null?void 0:Fe.y)??120;return{nodes:[...W.nodes,{id:crypto.randomUUID(),method:x.method.toLowerCase(),path:x.path,x:Le,y:nt}],edges:W.edges}}),fe(W=>W+1),d("flows"))};if(s)return k.jsx("div",{className:"min-h-screen flex items-center justify-center p-8",children:k.jsxs("div",{className:"max-w-lg rounded-2xl border border-red-500/30 bg-surface-900 p-6 text-red-200",children:[k.jsx("h1",{className:"font-display text-xl font-bold mb-2",children:"No se pudo cargar OpenAPI"}),k.jsx("p",{className:"text-sm opacity-90",children:s}),k.jsxs("p",{className:"text-xs mt-4 text-slate-500",children:["URL intentada: ",ut]})]})});if(!r)return k.jsx("div",{className:"min-h-screen flex items-center justify-center",children:k.jsx("p",{className:"text-slate-400 animate-pulse",children:"Cargando especificación…"})});const eo=w===null?"Todos los endpoints (cliente único con todas las operaciones)":`Tag «${w}» (solo operaciones de este grupo)`,Nn=((Mn=t.productName)==null?void 0:Mn.trim())||r.info.title;return k.jsxs("div",{className:"min-h-screen flex flex-col bg-surface-950",children:[k.jsxs("div",{className:"flex flex-1 flex-col md:flex-row min-h-0",children:[k.jsxs("aside",{className:`w-full border-b md:border-b-0 md:border-r border-surface-700 bg-surface-900/80 shrink-0 transition-[width] duration-200 ease-out flex flex-col ${ke?"md:w-12 md:min-w-[3rem]":"md:w-64"}`,children:[k.jsxs("div",{className:ke?"max-md:block md:hidden":"block",children:[k.jsxs("div",{className:"p-4 border-b border-surface-700 flex justify-between items-start gap-2",children:[k.jsxs("div",{className:"min-w-0",children:[t.logoDataUrl?k.jsx("img",{src:t.logoDataUrl,alt:"",className:"h-9 max-w-[200px] object-contain object-left mb-2"}):null,k.jsx("h1",{className:"font-display text-lg font-bold text-white tracking-tight",children:Nn}),k.jsx("p",{className:"text-xs text-slate-500 mt-1",children:Nn===r.info.title?`v${r.info.version}`:`${r.info.title} · v${r.info.version}`})]}),k.jsx("button",{type:"button",className:"hidden md:flex shrink-0 w-8 h-8 rounded-lg border border-surface-600 bg-surface-800 text-slate-300 hover:bg-surface-700 items-center justify-center text-lg leading-none",onClick:()=>He(!0),"aria-label":"Ocultar menú lateral",title:"Ocultar menú",children:"‹"})]}),k.jsx("nav",{className:"p-2 flex flex-row md:flex-col gap-1 overflow-x-auto",children:[["explore","Explorar"],["flows",`Flujos (${K.length})`],["tests",`Tests (${se.length})`],["auth","Auth"]].map(([W,Fe])=>k.jsx("button",{type:"button",onClick:()=>d(W),className:`text-left px-3 py-2 rounded-lg text-sm transition ${f===W?"bg-accent/20 text-accent":"text-slate-400 hover:bg-surface-800"}`,children:Fe},W))}),Re?k.jsxs("div",{className:"px-3 py-2 border-t border-surface-700 flex items-center justify-between gap-2 text-xs",children:[k.jsx("span",{className:"text-slate-400 truncate",title:Re.username,children:Re.username}),k.jsx("button",{type:"button",className:"shrink-0 text-accent hover:underline",onClick:()=>void Rr(),children:"Salir"})]}):null,k.jsxs("div",{className:"p-3 border-t border-surface-700 space-y-2",children:[k.jsx("button",{type:"button",onClick:Or,className:"w-full text-xs py-2 rounded-lg bg-surface-800 hover:bg-surface-700",children:"Exportar estado"}),k.jsxs("label",{className:"block w-full text-xs py-2 rounded-lg bg-surface-800 hover:bg-surface-700 text-center cursor-pointer",children:["Importar JSON",k.jsx("input",{type:"file",accept:"application/json",className:"hidden",onChange:Zr})]})]})]}),ke?k.jsx("div",{className:"max-md:hidden md:flex flex-1 flex-col items-center py-4 px-1 gap-2 min-h-[120px]",children:k.jsx("button",{type:"button",className:"w-9 h-9 rounded-lg border border-surface-600 bg-surface-800 text-slate-200 hover:bg-surface-700 flex items-center justify-center text-lg font-semibold leading-none",onClick:()=>He(!1),"aria-label":"Mostrar menú lateral",title:"Mostrar menú",children:"›"})}):null]}),k.jsxs("main",{className:"flex-1 flex flex-col min-h-0",children:[k.jsx("header",{className:"border-b border-surface-700 px-4 py-3 flex flex-wrap gap-3 items-center bg-surface-900/50",children:k.jsxs("label",{className:"text-xs text-slate-500",children:["Base URL",k.jsx("input",{className:"ml-2 bg-surface-800 border border-surface-600 rounded px-2 py-1 text-sm w-64",value:m,onChange:W=>v(W.target.value)})]})}),f==="explore"&&k.jsxs("div",{className:"flex-1 flex flex-col lg:flex-row min-h-0",children:[k.jsxs("div",{className:`shrink-0 border-b lg:border-b-0 lg:border-r border-surface-700 overflow-auto transition-[width] duration-200 ease-out ${Ae?"lg:w-12 lg:min-w-[3rem] max-h-16 lg:max-h-none":"lg:w-72 max-h-64 lg:max-h-none"}`,children:[k.jsxs("div",{className:Ae?"max-lg:block lg:hidden":"block",children:[k.jsxs("div",{className:"p-2 flex items-start justify-between gap-2 border-b border-surface-700 lg:border-b-0",children:[k.jsx("p",{className:"text-xs uppercase tracking-wider text-slate-500 shrink-0",children:"Tags"}),k.jsx("button",{type:"button",className:"hidden lg:flex shrink-0 w-7 h-7 rounded-md border border-surface-600 bg-surface-800 text-slate-300 hover:bg-surface-700 items-center justify-center text-sm leading-none",onClick:()=>qe(!0),"aria-label":"Ocultar lista de endpoints",title:"Ocultar endpoints",children:"‹"})]}),k.jsx("div",{className:"p-2 pt-1",children:k.jsxs("div",{className:"flex flex-wrap gap-1",children:[k.jsx("button",{type:"button",onClick:()=>b(null),className:`text-xs px-2 py-1 rounded ${w===null?"bg-accent/30":"bg-surface-800"}`,children:"Todos"}),Mt.map(W=>k.jsx("button",{type:"button",onClick:()=>b(W),className:`text-xs px-2 py-1 rounded ${w===W?"bg-accent/30":"bg-surface-800"}`,children:W},W))]})}),k.jsx("ul",{className:"text-sm",children:tn.map(W=>k.jsx("li",{children:k.jsxs("button",{type:"button",onClick:()=>S({method:W.method,path:W.path}),className:`w-full text-left px-3 py-2 hover:bg-surface-800 flex gap-2 ${(x==null?void 0:x.method)===W.method&&x.path===W.path?"bg-surface-800 border-l-2 border-accent":""}`,children:[k.jsx("span",{className:"uppercase text-accent text-xs w-12 shrink-0",children:W.method}),k.jsx("span",{className:"truncate text-slate-300",children:W.path})]})},`${W.method}:${W.path}`))})]}),Ae?k.jsx("div",{className:"max-lg:hidden lg:flex flex-col items-center py-3 px-1 min-h-[80px]",children:k.jsx("button",{type:"button",className:"w-9 h-9 rounded-lg border border-surface-600 bg-surface-800 text-slate-200 hover:bg-surface-700 flex items-center justify-center text-lg font-semibold leading-none",onClick:()=>qe(!1),"aria-label":"Mostrar lista de endpoints",title:"Mostrar endpoints",children:"›"})}):null]}),k.jsx("div",{className:"flex-1 p-4 overflow-auto space-y-6",children:x?k.jsxs(k.Fragment,{children:[k.jsxs("div",{children:[k.jsxs("h2",{className:"font-display font-semibold text-white text-lg",children:[x.method.toUpperCase()," ",x.path]}),k.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["Filtro de exportación de servicio: ",eo]})]}),r?k.jsx(hk,{doc:r,selectedOp:x,baseUrl:m,buildHeaders:Ot}):null,k.jsxs("section",{className:"space-y-3",children:[k.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Snippets por lenguaje"}),k.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:bt&&mf.map(({id:W,label:Fe})=>k.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/60 overflow-hidden",children:[k.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-surface-700 bg-surface-800/50",children:[k.jsx("span",{className:"text-xs font-medium text-accent",children:Fe}),k.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-surface-600",onClick:()=>void dm(bt[W]),children:"Copiar"})]}),k.jsx("pre",{className:"text-[11px] p-3 overflow-auto max-h-56 text-slate-300 font-mono whitespace-pre-wrap",children:bt[W]})]},W))})]}),k.jsxs("section",{className:"space-y-3 rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[k.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Cliente / servicio generado"}),k.jsx("p",{className:"text-xs text-slate-500",children:eo}),k.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[k.jsxs("label",{className:"text-xs text-slate-400",children:["Lenguaje del archivo",k.jsx("select",{className:"ml-2 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:C,onChange:W=>j(W.target.value),children:mf.map(({id:W,label:Fe})=>k.jsx("option",{value:W,children:Fe},W))})]}),k.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg bg-surface-700 hover:bg-surface-600",onClick:()=>void dm(wn),children:"Copiar servicio"})]}),k.jsx("pre",{className:"text-[11px] bg-surface-950 border border-surface-700 rounded-lg p-3 overflow-auto max-h-96 text-slate-200 font-mono whitespace-pre-wrap",children:wn})]}),k.jsx("div",{className:"flex flex-wrap gap-2 pt-2 border-t border-surface-800",children:k.jsx("button",{type:"button",className:"text-xs px-3 py-2 rounded-lg bg-surface-800 hover:bg-surface-700",onClick:Io,children:"Añadir operación actual a un flujo (ve a Flujos)"})})]}):k.jsx("p",{className:"text-slate-500",children:"Selecciona una operación en la lista."})})]}),f==="flows"&&k.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[k.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4",children:[k.jsx("h3",{className:"text-sm font-semibold text-white mb-3",children:"Flujos guardados"}),K.length===0?k.jsx("p",{className:"text-sm text-slate-500",children:"Aún no hay flujos. Crea uno en el editor y guarda."}):k.jsx("ul",{className:"space-y-2",children:K.map(W=>{var Fe,Le;return k.jsxs("li",{className:"flex flex-wrap items-center gap-2 justify-between rounded-lg border border-surface-700 bg-surface-950/50 px-3 py-2",children:[k.jsxs("div",{children:[k.jsx("span",{className:"text-sm text-slate-200 font-medium",children:W.name}),k.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[(((Le=(Fe=W.graph)==null?void 0:Fe.nodes)==null?void 0:Le.length)??W.steps.length)||0," nodo(s)"]})]}),k.jsxs("div",{className:"flex flex-wrap gap-2",children:[k.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded-lg bg-emerald-600/30 text-emerald-300 hover:bg-emerald-600/50",title:"Ejecutar sin cargar el editor",onClick:()=>void _n(W),children:"Play"}),k.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent hover:bg-accent/30",onClick:()=>Nt(W),children:"Editar"}),k.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-red-900/40 text-slate-300",onClick:()=>void Sn(W.id),children:"Eliminar"})]})]},W.id!=null?`flow-${W.id}`:`flow-${W.name}`)})})]}),k.jsxs("section",{className:"space-y-4 max-w-6xl",children:[k.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[k.jsx("h3",{className:"text-sm font-semibold text-white",children:"Editor de flujo (nodos y cables)"}),k.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg border border-surface-600 text-slate-300 hover:bg-surface-800",onClick:Ht,children:"Nuevo flujo"})]}),we!=null&&k.jsxs("p",{className:"text-xs text-accent",children:["Editando flujo guardado (#",we,")"]}),k.jsxs("p",{className:"text-sm text-slate-400",children:["Cada nodo es un endpoint del spec. Conecta ",k.jsx("strong",{className:"text-slate-300",children:"res → req"})," ","y define qué campo de la respuesta pasa al siguiente request (JSON path, variable, header, query o ",k.jsx("code",{className:"text-accent",children:"{variable}"})," en la ruta)."]}),k.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm w-full max-w-md",value:he,onChange:W=>Se(W.target.value),placeholder:"Nombre del flujo"}),k.jsx(Gb,{doc:r,ops:St,graph:q,onGraphChange:Hn},X),k.jsxs("div",{className:"flex flex-wrap gap-2",children:[k.jsx("button",{type:"button",className:"px-3 py-2 rounded-lg bg-emerald-600 text-white text-sm font-medium hover:bg-emerald-500",onClick:()=>void gr(),children:"Play (grafo)"}),k.jsx("button",{type:"button",className:"px-3 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void tr(),children:we!=null?"Guardar cambios":"Guardar flujo"})]}),k.jsx("pre",{className:"text-xs bg-surface-950 border border-surface-700 rounded-lg p-3 max-h-64 overflow-auto whitespace-pre-wrap",children:xe||"Resultado de la ejecución aquí."})]})]}),f==="tests"&&k.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[k.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[k.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[k.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suites guardadas"}),se.length>0&&k.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg bg-emerald-600/80 text-white hover:bg-emerald-500",onClick:()=>void Ye(),children:"Ejecutar todas las suites"})]}),se.length===0?k.jsx("p",{className:"text-sm text-slate-500",children:"Ninguna suite guardada."}):k.jsx("ul",{className:"space-y-2",children:se.map(W=>k.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-surface-700 bg-surface-950/50 px-3 py-2",children:[k.jsxs("div",{children:[k.jsx("span",{className:"text-sm text-slate-200 font-medium",children:W.name}),k.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[W.cases.length," caso(s)"]})]}),k.jsxs("div",{className:"flex flex-wrap gap-2",children:[k.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded-lg bg-emerald-600/30 text-emerald-300 hover:bg-emerald-600/50",onClick:()=>void Un(W),children:"Play"}),k.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent",onClick:()=>kn(W),children:"Editar"}),k.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-red-900/40",onClick:()=>void Tn(W.id),children:"Eliminar"})]})]},W.id!=null?`suite-${W.id}`:`suite-${W.name}`))})]}),k.jsxs("section",{className:"space-y-4",children:[k.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[k.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suite en edición"}),k.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg border border-surface-600 text-slate-300 hover:bg-surface-800",onClick:rr,children:"Nueva suite"})]}),Te!=null&&k.jsxs("p",{className:"text-xs text-accent",children:["Editando suite guardada (#",Te,")"]}),k.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm max-w-md",value:le.name,onChange:W=>Q(Fe=>({...Fe,name:W.target.value})),placeholder:"Nombre de la suite"}),k.jsxs("div",{className:"flex flex-wrap gap-2 items-end rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[k.jsxs("label",{className:"text-xs text-slate-400 flex-1 min-w-[200px]",children:["Añadir endpoint del spec",k.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm font-mono",value:$,onChange:W=>H(W.target.value),children:St.map(W=>k.jsxs("option",{value:gf(W.method,W.path),children:[W.method.toUpperCase()," ",W.path]},gf(W.method,W.path)))})]}),k.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-800 text-sm hover:bg-surface-700",onClick:Pn,children:"Añadir a la suite"})]}),k.jsx("ul",{className:"space-y-4",children:le.cases.map(W=>{const Fe=fm(W.expectStatus)?String(W.expectStatus):"custom";return k.jsxs("li",{className:"rounded-xl border border-surface-700 bg-surface-950/40 p-4 space-y-3 text-sm",children:[k.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[k.jsxs("span",{className:"font-mono text-xs text-accent",children:[W.method.toUpperCase()," ",W.path]}),k.jsx("button",{type:"button",className:"text-xs text-red-400 hover:underline shrink-0",onClick:()=>Vn(W.id),children:"Quitar"})]}),k.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[k.jsxs("label",{className:"text-xs text-slate-400 block",children:["Código HTTP esperado",k.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[k.jsxs("select",{className:"bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm max-w-[200px]",value:Fe,onChange:Le=>{const nt=Le.target.value;if(nt==="custom"){dn(W.id,{expectStatus:fm(W.expectStatus)?1e3:W.expectStatus});return}dn(W.id,{expectStatus:Number(nt)})},children:[fy.map(Le=>k.jsx("option",{value:String(Le.value),children:Le.label},Le.value)),k.jsx("option",{value:"custom",children:"Otro…"})]}),Fe==="custom"&&k.jsx("input",{type:"number",className:"w-20 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:W.expectStatus,onChange:Le=>dn(W.id,{expectStatus:Number(Le.target.value)||0})})]})]}),k.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["El body contiene (opcional)",k.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono text-xs",placeholder:'ej. "ok"',value:W.contains??"",onChange:Le=>dn(W.id,{contains:Le.target.value||void 0})})]}),k.jsxs("label",{className:"text-xs text-slate-400 block",children:["JSON path (opcional)",k.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono text-xs",placeholder:"$.data.id",value:W.jsonPath??"",onChange:Le=>dn(W.id,{jsonPath:Le.target.value||void 0})})]}),k.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["Valor esperado en JSON path (opcional)",k.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono text-xs",placeholder:"Vacío = solo comprobar que existe",value:W.expectJsonValue??"",onChange:Le=>dn(W.id,{expectJsonValue:Le.target.value||void 0})})]})]})]},W.id)})}),k.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[k.jsx("button",{type:"button",className:"px-5 py-2.5 rounded-lg bg-emerald-600 text-white text-sm font-semibold hover:bg-emerald-500 shadow-lg shadow-emerald-900/30",onClick:()=>void bn(),children:"Correr todos los casos (suite actual)"}),k.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void Ve(),children:Te!=null?"Guardar cambios":"Guardar suite"})]}),k.jsx("pre",{className:"text-xs bg-surface-950 border border-surface-700 rounded-lg p-3 whitespace-pre-wrap min-h-[4rem]",children:U||"—"})]})]}),f==="auth"&&k.jsxs("div",{className:"p-4 space-y-4 max-w-lg",children:[k.jsxs("p",{className:"text-sm text-slate-400",children:["Esquemas en el spec: ",M0(r).join(", ")||"ninguno"]}),k.jsxs("label",{className:"block text-sm",children:["Bearer token",k.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:M,onChange:W=>I(W.target.value),placeholder:"eyJ..."})]}),k.jsxs("label",{className:"block text-sm",children:["API key header",k.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:P,onChange:W=>R(W.target.value)})]}),k.jsxs("label",{className:"block text-sm",children:["API key",k.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:A,onChange:W=>V(W.target.value),type:"password",autoComplete:"off"})]}),k.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void Kn(),children:"Recordar en este navegador"})]})]})]}),k.jsx("footer",{className:"border-t border-surface-700 px-3 py-2.5 text-center text-[11px] text-slate-600 bg-surface-950 shrink-0",children:"made with ♥ by andres arcila"})]})}const yk={surface950:"#0c0f14",surface900:"#12171f",surface800:"#1a2230",surface700:"#243044",accent:"#38bdf8",accentDim:"#0ea5e9"};function bs(t){const r=t.trim(),i=/^#?([0-9a-f]{6})$/i.exec(r);if(!i)return"12 15 20";const s=parseInt(i[1],16);return`${s>>16&255} ${s>>8&255} ${s&255}`}function vk(t){return{...yk,...t}}function xk(t){var s,u;const r=(s=t.logoBase64)==null?void 0:s.trim();return r?r.startsWith("data:")?r:`data:${((u=t.logoMimeType)==null?void 0:u.trim())||"image/png"};base64,${r}`:null}function wk(t){var i;const r=vk(t==null?void 0:t.colors);return{productName:((i=t==null?void 0:t.productName)==null?void 0:i.trim())||null,logoDataUrl:t?xk(t):null,colors:r,colorsRgb:{surface950:bs(r.surface950),surface900:bs(r.surface900),surface800:bs(r.surface800),surface700:bs(r.surface700),accent:bs(r.accent),accentDim:bs(r.accentDim)}}}const _k={credentials:"include"};function Sk(t){const r=document.documentElement;r.style.setProperty("--surface-950",t.surface950),r.style.setProperty("--surface-900",t.surface900),r.style.setProperty("--surface-800",t.surface800),r.style.setProperty("--surface-700",t.surface700),r.style.setProperty("--accent",t.accent),r.style.setProperty("--accent-dim",t.accentDim)}async function bk(){const t=wk(void 0);try{const r=await fetch("/docs/ui-config.json",_k);return r.status===401?{...t,docsAuthRequired:!0}:r.ok?await r.json():t}catch{return t}}(async()=>{const t=await bk();Sk(t.colorsRgb),d0.createRoot(document.getElementById("root")).render(k.jsx(pm.StrictMode,{children:k.jsx(ek,{value:{productName:t.productName,logoDataUrl:t.logoDataUrl},children:k.jsx(gk,{})})}))})();
|