@api-doc-tor/express 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
var Ny=Object.defineProperty;var Ey=(t,r,o)=>r in t?Ny(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o;var Ds=(t,r,o)=>Ey(t,typeof r!="symbol"?r+"":r,o);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const f of c.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&i(f)}).observe(document,{childList:!0,subtree:!0});function o(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function i(l){if(l.ep)return;l.ep=!0;const c=o(l);fetch(l.href,c)}})();var jy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var nd={exports:{}},ba={},rd={exports:{}},yt={};/**
|
|
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 Zp;function Cy(){if(Zp)return yt;Zp=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),v=Symbol.iterator;function k(O){return O===null||typeof O!="object"?null:(O=v&&O[v]||O["@@iterator"],typeof O=="function"?O:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,I={};function A(O,K,ke){this.props=O,this.context=K,this.refs=I,this.updater=ke||j}A.prototype.isReactComponent={},A.prototype.setState=function(O,K){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,K,"setState")},A.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function T(){}T.prototype=A.prototype;function V(O,K,ke){this.props=O,this.context=K,this.refs=I,this.updater=ke||j}var P=V.prototype=new T;P.constructor=V,C(P,A.prototype),P.isPureReactComponent=!0;var M=Array.isArray,B=Object.prototype.hasOwnProperty,U={current:null},W={key:!0,ref:!0,__self:!0,__source:!0};function Z(O,K,ke){var Ne,Ae={},Oe=null,Re=null;if(K!=null)for(Ne in K.ref!==void 0&&(Re=K.ref),K.key!==void 0&&(Oe=""+K.key),K)B.call(K,Ne)&&!W.hasOwnProperty(Ne)&&(Ae[Ne]=K[Ne]);var _e=arguments.length-2;if(_e===1)Ae.children=ke;else if(1<_e){for(var ze=Array(_e),Ee=0;Ee<_e;Ee++)ze[Ee]=arguments[Ee+2];Ae.children=ze}if(O&&O.defaultProps)for(Ne in _e=O.defaultProps,_e)Ae[Ne]===void 0&&(Ae[Ne]=_e[Ne]);return{$$typeof:t,type:O,key:Oe,ref:Re,props:Ae,_owner:U.current}}function fe(O,K){return{$$typeof:t,type:O.type,key:K,ref:O.ref,props:O.props,_owner:O._owner}}function Se(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function X(O){var K={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(ke){return K[ke]})}var de=/\/+/g;function be(O,K){return typeof O=="object"&&O!==null&&O.key!=null?X(""+O.key):K.toString(36)}function z(O,K,ke,Ne,Ae){var Oe=typeof O;(Oe==="undefined"||Oe==="boolean")&&(O=null);var Re=!1;if(O===null)Re=!0;else switch(Oe){case"string":case"number":Re=!0;break;case"object":switch(O.$$typeof){case t:case r:Re=!0}}if(Re)return Re=O,Ae=Ae(Re),O=Ne===""?"."+be(Re,0):Ne,M(Ae)?(ke="",O!=null&&(ke=O.replace(de,"$&/")+"/"),z(Ae,K,ke,"",function(Ee){return Ee})):Ae!=null&&(Se(Ae)&&(Ae=fe(Ae,ke+(!Ae.key||Re&&Re.key===Ae.key?"":(""+Ae.key).replace(de,"$&/")+"/")+O)),K.push(Ae)),1;if(Re=0,Ne=Ne===""?".":Ne+":",M(O))for(var _e=0;_e<O.length;_e++){Oe=O[_e];var ze=Ne+be(Oe,_e);Re+=z(Oe,K,ke,ze,Ae)}else if(ze=k(O),typeof ze=="function")for(O=ze.call(O),_e=0;!(Oe=O.next()).done;)Oe=Oe.value,ze=Ne+be(Oe,_e++),Re+=z(Oe,K,ke,ze,Ae);else if(Oe==="object")throw K=String(O),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.");return Re}function ue(O,K,ke){if(O==null)return O;var Ne=[],Ae=0;return z(O,Ne,"","",function(Oe){return K.call(ke,Oe,Ae++)}),Ne}function Q(O){if(O._status===-1){var K=O._result;K=K(),K.then(function(ke){(O._status===0||O._status===-1)&&(O._status=1,O._result=ke)},function(ke){(O._status===0||O._status===-1)&&(O._status=2,O._result=ke)}),O._status===-1&&(O._status=0,O._result=K)}if(O._status===1)return O._result.default;throw O._result}var ie={current:null},H={transition:null},q={ReactCurrentDispatcher:ie,ReactCurrentBatchConfig:H,ReactCurrentOwner:U};function J(){throw Error("act(...) is not supported in production builds of React.")}return yt.Children={map:ue,forEach:function(O,K,ke){ue(O,function(){K.apply(this,arguments)},ke)},count:function(O){var K=0;return ue(O,function(){K++}),K},toArray:function(O){return ue(O,function(K){return K})||[]},only:function(O){if(!Se(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},yt.Component=A,yt.Fragment=o,yt.Profiler=l,yt.PureComponent=V,yt.StrictMode=i,yt.Suspense=y,yt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,yt.act=J,yt.cloneElement=function(O,K,ke){if(O==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+O+".");var Ne=C({},O.props),Ae=O.key,Oe=O.ref,Re=O._owner;if(K!=null){if(K.ref!==void 0&&(Oe=K.ref,Re=U.current),K.key!==void 0&&(Ae=""+K.key),O.type&&O.type.defaultProps)var _e=O.type.defaultProps;for(ze in K)B.call(K,ze)&&!W.hasOwnProperty(ze)&&(Ne[ze]=K[ze]===void 0&&_e!==void 0?_e[ze]:K[ze])}var ze=arguments.length-2;if(ze===1)Ne.children=ke;else if(1<ze){_e=Array(ze);for(var Ee=0;Ee<ze;Ee++)_e[Ee]=arguments[Ee+2];Ne.children=_e}return{$$typeof:t,type:O.type,key:Ae,ref:Oe,props:Ne,_owner:Re}},yt.createContext=function(O){return O={$$typeof:f,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},O.Provider={$$typeof:c,_context:O},O.Consumer=O},yt.createElement=Z,yt.createFactory=function(O){var K=Z.bind(null,O);return K.type=O,K},yt.createRef=function(){return{current:null}},yt.forwardRef=function(O){return{$$typeof:m,render:O}},yt.isValidElement=Se,yt.lazy=function(O){return{$$typeof:_,_payload:{_status:-1,_result:O},_init:Q}},yt.memo=function(O,K){return{$$typeof:b,type:O,compare:K===void 0?null:K}},yt.startTransition=function(O){var K=H.transition;H.transition={};try{O()}finally{H.transition=K}},yt.unstable_act=J,yt.useCallback=function(O,K){return ie.current.useCallback(O,K)},yt.useContext=function(O){return ie.current.useContext(O)},yt.useDebugValue=function(){},yt.useDeferredValue=function(O){return ie.current.useDeferredValue(O)},yt.useEffect=function(O,K){return ie.current.useEffect(O,K)},yt.useId=function(){return ie.current.useId()},yt.useImperativeHandle=function(O,K,ke){return ie.current.useImperativeHandle(O,K,ke)},yt.useInsertionEffect=function(O,K){return ie.current.useInsertionEffect(O,K)},yt.useLayoutEffect=function(O,K){return ie.current.useLayoutEffect(O,K)},yt.useMemo=function(O,K){return ie.current.useMemo(O,K)},yt.useReducer=function(O,K,ke){return ie.current.useReducer(O,K,ke)},yt.useRef=function(O){return ie.current.useRef(O)},yt.useState=function(O){return ie.current.useState(O)},yt.useSyncExternalStore=function(O,K,ke){return ie.current.useSyncExternalStore(O,K,ke)},yt.useTransition=function(){return ie.current.useTransition()},yt.version="18.3.1",yt}var eh;function La(){return eh||(eh=1,rd.exports=Cy()),rd.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 th;function Py(){if(th)return ba;th=1;var t=La(),r=Symbol.for("react.element"),o=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,l=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function f(m,y,b){var _,v={},k=null,j=null;b!==void 0&&(k=""+b),y.key!==void 0&&(k=""+y.key),y.ref!==void 0&&(j=y.ref);for(_ in y)i.call(y,_)&&!c.hasOwnProperty(_)&&(v[_]=y[_]);if(m&&m.defaultProps)for(_ in y=m.defaultProps,y)v[_]===void 0&&(v[_]=y[_]);return{$$typeof:r,type:m,key:k,ref:j,props:v,_owner:l.current}}return ba.Fragment=o,ba.jsx=f,ba.jsxs=f,ba}var nh;function My(){return nh||(nh=1,nd.exports=Py()),nd.exports}var h=My(),D=La();const Cm=Nu(D);var Kl={},od={exports:{}},Jn={},sd={exports:{}},id={};/**
|
|
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 rh;function Ty(){return rh||(rh=1,(function(t){function r(H,q){var J=H.length;H.push(q);e:for(;0<J;){var O=J-1>>>1,K=H[O];if(0<l(K,q))H[O]=q,H[J]=K,J=O;else break e}}function o(H){return H.length===0?null:H[0]}function i(H){if(H.length===0)return null;var q=H[0],J=H.pop();if(J!==q){H[0]=J;e:for(var O=0,K=H.length,ke=K>>>1;O<ke;){var Ne=2*(O+1)-1,Ae=H[Ne],Oe=Ne+1,Re=H[Oe];if(0>l(Ae,J))Oe<K&&0>l(Re,Ae)?(H[O]=Re,H[Oe]=J,O=Oe):(H[O]=Ae,H[Ne]=J,O=Ne);else if(Oe<K&&0>l(Re,J))H[O]=Re,H[Oe]=J,O=Oe;else break e}}return q}function l(H,q){var J=H.sortIndex-q.sortIndex;return J!==0?J:H.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var f=Date,m=f.now();t.unstable_now=function(){return f.now()-m}}var y=[],b=[],_=1,v=null,k=3,j=!1,C=!1,I=!1,A=typeof setTimeout=="function"?setTimeout:null,T=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(H){for(var q=o(b);q!==null;){if(q.callback===null)i(b);else if(q.startTime<=H)i(b),q.sortIndex=q.expirationTime,r(y,q);else break;q=o(b)}}function M(H){if(I=!1,P(H),!C)if(o(y)!==null)C=!0,Q(B);else{var q=o(b);q!==null&&ie(M,q.startTime-H)}}function B(H,q){C=!1,I&&(I=!1,T(Z),Z=-1),j=!0;var J=k;try{for(P(q),v=o(y);v!==null&&(!(v.expirationTime>q)||H&&!X());){var O=v.callback;if(typeof O=="function"){v.callback=null,k=v.priorityLevel;var K=O(v.expirationTime<=q);q=t.unstable_now(),typeof K=="function"?v.callback=K:v===o(y)&&i(y),P(q)}else i(y);v=o(y)}if(v!==null)var ke=!0;else{var Ne=o(b);Ne!==null&&ie(M,Ne.startTime-q),ke=!1}return ke}finally{v=null,k=J,j=!1}}var U=!1,W=null,Z=-1,fe=5,Se=-1;function X(){return!(t.unstable_now()-Se<fe)}function de(){if(W!==null){var H=t.unstable_now();Se=H;var q=!0;try{q=W(!0,H)}finally{q?be():(U=!1,W=null)}}else U=!1}var be;if(typeof V=="function")be=function(){V(de)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,ue=z.port2;z.port1.onmessage=de,be=function(){ue.postMessage(null)}}else be=function(){A(de,0)};function Q(H){W=H,U||(U=!0,be())}function ie(H,q){Z=A(function(){H(t.unstable_now())},q)}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(H){H.callback=null},t.unstable_continueExecution=function(){C||j||(C=!0,Q(B))},t.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):fe=0<H?Math.floor(1e3/H):5},t.unstable_getCurrentPriorityLevel=function(){return k},t.unstable_getFirstCallbackNode=function(){return o(y)},t.unstable_next=function(H){switch(k){case 1:case 2:case 3:var q=3;break;default:q=k}var J=k;k=q;try{return H()}finally{k=J}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(H,q){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var J=k;k=H;try{return q()}finally{k=J}},t.unstable_scheduleCallback=function(H,q,J){var O=t.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?O+J:O):J=O,H){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=J+K,H={id:_++,callback:q,priorityLevel:H,startTime:J,expirationTime:K,sortIndex:-1},J>O?(H.sortIndex=J,r(b,H),o(y)===null&&H===o(b)&&(I?(T(Z),Z=-1):I=!0,ie(M,J-O))):(H.sortIndex=K,r(y,H),C||j||(C=!0,Q(B))),H},t.unstable_shouldYield=X,t.unstable_wrapCallback=function(H){var q=k;return function(){var J=k;k=q;try{return H.apply(this,arguments)}finally{k=J}}}})(id)),id}var oh;function Iy(){return oh||(oh=1,sd.exports=Ty()),sd.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 sh;function $y(){if(sh)return Jn;sh=1;var t=La(),r=Iy();function o(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,s=1;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s]);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 i=new Set,l={};function c(e,n){f(e,n),f(e+"Capture",n)}function f(e,n){for(l[e]=n,e=0;e<n.length;e++)i.add(n[e])}var m=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),y=Object.prototype.hasOwnProperty,b=/^[: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]*$/,_={},v={};function k(e){return y.call(v,e)?!0:y.call(_,e)?!1:b.test(e)?v[e]=!0:(_[e]=!0,!1)}function j(e,n,s,u){if(s!==null&&s.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return u?!1:s!==null?!s.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function C(e,n,s,u){if(n===null||typeof n>"u"||j(e,n,s,u))return!0;if(u)return!1;if(s!==null)switch(s.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 I(e,n,s,u,p,x,E){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=u,this.attributeNamespace=p,this.mustUseProperty=s,this.propertyName=e,this.type=n,this.sanitizeURL=x,this.removeEmptyString=E}var A={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){A[e]=new I(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];A[n]=new I(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){A[e]=new I(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){A[e]=new I(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){A[e]=new I(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){A[e]=new I(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){A[e]=new I(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){A[e]=new I(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){A[e]=new I(e,5,!1,e.toLowerCase(),null,!1,!1)});var T=/[\-:]([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(T,V);A[n]=new I(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(T,V);A[n]=new I(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(T,V);A[n]=new I(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){A[e]=new I(e,1,!1,e.toLowerCase(),null,!1,!1)}),A.xlinkHref=new I("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){A[e]=new I(e,1,!1,e.toLowerCase(),null,!0,!0)});function P(e,n,s,u){var p=A.hasOwnProperty(n)?A[n]:null;(p!==null?p.type!==0:u||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(C(n,s,p,u)&&(s=null),u||p===null?k(n)&&(s===null?e.removeAttribute(n):e.setAttribute(n,""+s)):p.mustUseProperty?e[p.propertyName]=s===null?p.type===3?!1:"":s:(n=p.attributeName,u=p.attributeNamespace,s===null?e.removeAttribute(n):(p=p.type,s=p===3||p===4&&s===!0?"":""+s,u?e.setAttributeNS(u,n,s):e.setAttribute(n,s))))}var M=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,B=Symbol.for("react.element"),U=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),Z=Symbol.for("react.strict_mode"),fe=Symbol.for("react.profiler"),Se=Symbol.for("react.provider"),X=Symbol.for("react.context"),de=Symbol.for("react.forward_ref"),be=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),ue=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),ie=Symbol.for("react.offscreen"),H=Symbol.iterator;function q(e){return e===null||typeof e!="object"?null:(e=H&&e[H]||e["@@iterator"],typeof e=="function"?e:null)}var J=Object.assign,O;function K(e){if(O===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);O=n&&n[1]||""}return`
|
|
34
|
+
`+O+e}var ke=!1;function Ne(e,n){if(!e||ke)return"";ke=!0;var s=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(xe){var u=xe}Reflect.construct(e,[],n)}else{try{n.call()}catch(xe){u=xe}e.call(n.prototype)}else{try{throw Error()}catch(xe){u=xe}e()}}catch(xe){if(xe&&u&&typeof xe.stack=="string"){for(var p=xe.stack.split(`
|
|
35
|
+
`),x=u.stack.split(`
|
|
36
|
+
`),E=p.length-1,F=x.length-1;1<=E&&0<=F&&p[E]!==x[F];)F--;for(;1<=E&&0<=F;E--,F--)if(p[E]!==x[F]){if(E!==1||F!==1)do if(E--,F--,0>F||p[E]!==x[F]){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<=F);break}}}finally{ke=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?K(e):""}function Ae(e){switch(e.tag){case 5:return K(e.type);case 16:return K("Lazy");case 13:return K("Suspense");case 19:return K("SuspenseList");case 0:case 2:case 15:return e=Ne(e.type,!1),e;case 11:return e=Ne(e.type.render,!1),e;case 1:return e=Ne(e.type,!0),e;default:return""}}function Oe(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 W:return"Fragment";case U:return"Portal";case fe:return"Profiler";case Z:return"StrictMode";case be:return"Suspense";case z:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case X:return(e.displayName||"Context")+".Consumer";case Se:return(e._context.displayName||"Context")+".Provider";case de:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ue:return n=e.displayName||null,n!==null?n:Oe(e.type)||"Memo";case Q:n=e._payload,e=e._init;try{return Oe(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 Oe(n);case 8:return n===Z?"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 ze(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ee(e){var n=ze(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),u=""+e[n];if(!e.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var p=s.get,x=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return p.call(this)},set:function(E){u=""+E,x.call(this,E)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return u},setValue:function(E){u=""+E},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Ze(e){e._valueTracker||(e._valueTracker=Ee(e))}function He(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var s=n.getValue(),u="";return e&&(u=ze(e)?e.checked?"true":"false":e.value),e=u,e!==s?(n.setValue(e),!0):!1}function Ke(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 ct(e,n){var s=n.checked;return J({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function dt(e,n){var s=n.defaultValue==null?"":n.defaultValue,u=n.checked!=null?n.checked:n.defaultChecked;s=_e(n.value!=null?n.value:s),e._wrapperState={initialChecked:u,initialValue:s,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function we(e,n){n=n.checked,n!=null&&P(e,"checked",n,!1)}function tt(e,n){we(e,n);var s=_e(n.value),u=n.type;if(s!=null)u==="number"?(s===0&&e.value===""||e.value!=s)&&(e.value=""+s):e.value!==""+s&&(e.value=""+s);else if(u==="submit"||u==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?Ct(e,n.type,s):n.hasOwnProperty("defaultValue")&&Ct(e,n.type,_e(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function _t(e,n,s){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var u=n.type;if(!(u!=="submit"&&u!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,s||n===e.value||(e.value=n),e.defaultValue=n}s=e.name,s!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,s!==""&&(e.name=s)}function Ct(e,n,s){(n!=="number"||Ke(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var xt=Array.isArray;function vt(e,n,s,u){if(e=e.options,n){n={};for(var p=0;p<s.length;p++)n["$"+s[p]]=!0;for(s=0;s<e.length;s++)p=n.hasOwnProperty("$"+e[s].value),e[s].selected!==p&&(e[s].selected=p),p&&u&&(e[s].defaultSelected=!0)}else{for(s=""+_e(s),n=null,p=0;p<e.length;p++){if(e[p].value===s){e[p].selected=!0,u&&(e[p].defaultSelected=!0);return}n!==null||e[p].disabled||(n=e[p])}n!==null&&(n.selected=!0)}}function It(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(o(91));return J({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function _n(e,n){var s=n.value;if(s==null){if(s=n.children,n=n.defaultValue,s!=null){if(n!=null)throw Error(o(92));if(xt(s)){if(1<s.length)throw Error(o(93));s=s[0]}n=s}n==null&&(n=""),s=n}e._wrapperState={initialValue:_e(s)}}function fr(e,n){var s=_e(n.value),u=_e(n.defaultValue);s!=null&&(s=""+s,s!==e.value&&(e.value=s),n.defaultValue==null&&e.defaultValue!==s&&(e.defaultValue=s)),u!=null&&(e.defaultValue=""+u)}function sn(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function Pt(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 tn(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?Pt(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var an,pr=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,s,u,p){MSApp.execUnsafeLocalFunction(function(){return e(n,s,u,p)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for(an=an||document.createElement("div"),an.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=an.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function Tn(e,n){if(n){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=n;return}}e.textContent=n}var In={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},hn=["Webkit","ms","Moz","O"];Object.keys(In).forEach(function(e){hn.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),In[n]=In[e]})});function hr(e,n,s){return n==null||typeof n=="boolean"||n===""?"":s||typeof n!="number"||n===0||In.hasOwnProperty(e)&&In[e]?(""+n).trim():n+"px"}function Rn(e,n){e=e.style;for(var s in n)if(n.hasOwnProperty(s)){var u=s.indexOf("--")===0,p=hr(s,n[s],u);s==="float"&&(s="cssFloat"),u?e.setProperty(s,p):e[s]=p}}var Sn=J({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 We(e,n){if(n){if(Sn[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(o(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(o(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(o(61))}if(n.style!=null&&typeof n.style!="object")throw Error(o(62))}}function Ln(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 mn=null;function Gt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ve=null,Dn=null,Et=null;function Qr(e){if(e=ia(e)){if(typeof Ve!="function")throw Error(o(280));var n=e.stateNode;n&&(n=il(n),Ve(e.stateNode,e.type,n))}}function fo(e){Dn?Et?Et.push(e):Et=[e]:Dn=e}function er(){if(Dn){var e=Dn,n=Et;if(Et=Dn=null,Qr(e),n)for(e=0;e<n.length;e++)Qr(n[e])}}function mr(e,n){return e(n)}function Fo(){}var zn=!1;function Bn(e,n,s){if(zn)return e(n,s);zn=!0;try{return mr(e,n,s)}finally{zn=!1,(Dn!==null||Et!==null)&&(Fo(),er())}}function $n(e,n){var s=e.stateNode;if(s===null)return null;var u=il(s);if(u===null)return null;s=u[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":(u=!u.disabled)||(e=e.type,u=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!u;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(o(231,n,typeof s));return s}var tr=!1;if(m)try{var lt={};Object.defineProperty(lt,"passive",{get:function(){tr=!0}}),window.addEventListener("test",lt,lt),window.removeEventListener("test",lt,lt)}catch{tr=!1}function Dt(e,n,s,u,p,x,E,F,Y){var xe=Array.prototype.slice.call(arguments,3);try{n.apply(s,xe)}catch(Te){this.onError(Te)}}var Pr=!1,nr=null,rr=!1,gr=null,Ho={onError:function(e){Pr=!0,nr=e}};function Fn(e,n,s,u,p,x,E,F,Y){Pr=!1,nr=null,Dt.apply(Ho,arguments)}function yr(e,n,s,u,p,x,E,F,Y){if(Fn.apply(this,arguments),Pr){if(Pr){var xe=nr;Pr=!1,nr=null}else throw Error(o(198));rr||(rr=!0,gr=xe)}}function Wt(e){var n=e,s=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(s=n.return),e=n.return;while(e)}return n.tag===3?s:null}function xr(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 po(e){if(Wt(e)!==e)throw Error(o(188))}function nn(e){var n=e.alternate;if(!n){if(n=Wt(e),n===null)throw Error(o(188));return n!==e?null:e}for(var s=e,u=n;;){var p=s.return;if(p===null)break;var x=p.alternate;if(x===null){if(u=p.return,u!==null){s=u;continue}break}if(p.child===x.child){for(x=p.child;x;){if(x===s)return po(p),e;if(x===u)return po(p),n;x=x.sibling}throw Error(o(188))}if(s.return!==u.return)s=p,u=x;else{for(var E=!1,F=p.child;F;){if(F===s){E=!0,s=p,u=x;break}if(F===u){E=!0,u=p,s=x;break}F=F.sibling}if(!E){for(F=x.child;F;){if(F===s){E=!0,s=x,u=p;break}if(F===u){E=!0,u=x,s=p;break}F=F.sibling}if(!E)throw Error(o(189))}}if(s.alternate!==u)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?e:n}function Mr(e){return e=nn(e),e!==null?Hn(e):null}function Hn(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=Hn(e);if(n!==null)return n;e=e.sibling}return null}var ho=r.unstable_scheduleCallback,Gr=r.unstable_cancelCallback,Mt=r.unstable_shouldYield,Vn=r.unstable_requestPaint,wt=r.unstable_now,Vo=r.unstable_getCurrentPriorityLevel,vr=r.unstable_ImmediatePriority,Tr=r.unstable_UserBlockingPriority,wr=r.unstable_NormalPriority,or=r.unstable_LowPriority,mo=r.unstable_IdlePriority,Un=null,gn=null;function ht(e){if(gn&&typeof gn.onCommitFiberRoot=="function")try{gn.onCommitFiberRoot(Un,e,void 0,(e.current.flags&128)===128)}catch{}}var ln=Math.clz32?Math.clz32:br,Uo=Math.log,Jr=Math.LN2;function br(e){return e>>>=0,e===0?32:31-(Uo(e)/Jr|0)|0}var sr=64,kr=4194304;function L(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 me(e,n){var s=e.pendingLanes;if(s===0)return 0;var u=0,p=e.suspendedLanes,x=e.pingedLanes,E=s&268435455;if(E!==0){var F=E&~p;F!==0?u=L(F):(x&=E,x!==0&&(u=L(x)))}else E=s&~p,E!==0?u=L(E):x!==0&&(u=L(x));if(u===0)return 0;if(n!==0&&n!==u&&(n&p)===0&&(p=u&-u,x=n&-n,p>=x||p===16&&(x&4194240)!==0))return n;if((u&4)!==0&&(u|=s&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=u;0<n;)s=31-ln(n),p=1<<s,u|=e[s],n&=~p;return u}function Fe(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 Je(e,n){for(var s=e.suspendedLanes,u=e.pingedLanes,p=e.expirationTimes,x=e.pendingLanes;0<x;){var E=31-ln(x),F=1<<E,Y=p[E];Y===-1?((F&s)===0||(F&u)!==0)&&(p[E]=Fe(F,n)):Y<=n&&(e.expiredLanes|=F),x&=~F}}function jt(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function $t(){var e=sr;return sr<<=1,(sr&4194240)===0&&(sr=64),e}function Yt(e){for(var n=[],s=0;31>s;s++)n.push(e);return n}function Ht(e,n,s){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-ln(n),e[n]=s}function Xt(e,n){var s=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 u=e.eventTimes;for(e=e.expirationTimes;0<s;){var p=31-ln(s),x=1<<p;n[p]=0,u[p]=-1,e[p]=-1,s&=~x}}function yn(e,n){var s=e.entangledLanes|=n;for(e=e.entanglements;s;){var u=31-ln(s),p=1<<u;p&n|e[u]&n&&(e[u]|=n),s&=~p}}var bt=0;function ys(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var gt,Ir,Ws,Ka,Nn,Zr=!1,go=[],xn=null,$r=null,Ar=null,zt=new Map,vn=new Map,Kn=[],xs="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 Ys(e,n){switch(e){case"focusin":case"focusout":xn=null;break;case"dragenter":case"dragleave":$r=null;break;case"mouseover":case"mouseout":Ar=null;break;case"pointerover":case"pointerout":zt.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":vn.delete(n.pointerId)}}function qn(e,n,s,u,p,x){return e===null||e.nativeEvent!==x?(e={blockedOn:n,domEventName:s,eventSystemFlags:u,nativeEvent:x,targetContainers:[p]},n!==null&&(n=ia(n),n!==null&&Ir(n)),e):(e.eventSystemFlags|=u,n=e.targetContainers,p!==null&&n.indexOf(p)===-1&&n.push(p),e)}function Bu(e,n,s,u,p){switch(n){case"focusin":return xn=qn(xn,e,n,s,u,p),!0;case"dragenter":return $r=qn($r,e,n,s,u,p),!0;case"mouseover":return Ar=qn(Ar,e,n,s,u,p),!0;case"pointerover":var x=p.pointerId;return zt.set(x,qn(zt.get(x)||null,e,n,s,u,p)),!0;case"gotpointercapture":return x=p.pointerId,vn.set(x,qn(vn.get(x)||null,e,n,s,u,p)),!0}return!1}function ir(e){var n=Es(e.target);if(n!==null){var s=Wt(n);if(s!==null){if(n=s.tag,n===13){if(n=xr(s),n!==null){e.blockedOn=n,Nn(e.priority,function(){Ws(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ko(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var s=qo(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(s===null){s=e.nativeEvent;var u=new s.constructor(s.type,s);mn=u,s.target.dispatchEvent(u),mn=null}else return n=ia(s),n!==null&&Ir(n),e.blockedOn=s,!1;n.shift()}return!0}function Hi(e,n,s){Ko(e)&&s.delete(n)}function Vi(){Zr=!1,xn!==null&&Ko(xn)&&(xn=null),$r!==null&&Ko($r)&&($r=null),Ar!==null&&Ko(Ar)&&(Ar=null),zt.forEach(Hi),vn.forEach(Hi)}function Or(e,n){e.blockedOn===n&&(e.blockedOn=null,Zr||(Zr=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,Vi)))}function yo(e){function n(p){return Or(p,e)}if(0<go.length){Or(go[0],e);for(var s=1;s<go.length;s++){var u=go[s];u.blockedOn===e&&(u.blockedOn=null)}}for(xn!==null&&Or(xn,e),$r!==null&&Or($r,e),Ar!==null&&Or(Ar,e),zt.forEach(n),vn.forEach(n),s=0;s<Kn.length;s++)u=Kn[s],u.blockedOn===e&&(u.blockedOn=null);for(;0<Kn.length&&(s=Kn[0],s.blockedOn===null);)ir(s),s.blockedOn===null&&Kn.shift()}var xo=M.ReactCurrentBatchConfig,Xs=!0;function vs(e,n,s,u){var p=bt,x=xo.transition;xo.transition=null;try{bt=1,Ui(e,n,s,u)}finally{bt=p,xo.transition=x}}function Fu(e,n,s,u){var p=bt,x=xo.transition;xo.transition=null;try{bt=4,Ui(e,n,s,u)}finally{bt=p,xo.transition=x}}function Ui(e,n,s,u){if(Xs){var p=qo(e,n,s,u);if(p===null)qu(e,n,u,vo,s),Ys(e,u);else if(Bu(p,e,n,s,u))u.stopPropagation();else if(Ys(e,u),n&4&&-1<xs.indexOf(e)){for(;p!==null;){var x=ia(p);if(x!==null&>(x),x=qo(e,n,s,u),x===null&&qu(e,n,u,vo,s),x===p)break;p=x}p!==null&&u.stopPropagation()}else qu(e,n,u,null,s)}}var vo=null;function qo(e,n,s,u){if(vo=null,e=Gt(u),e=Es(e),e!==null)if(n=Wt(e),n===null)e=null;else if(s=n.tag,s===13){if(e=xr(n),e!==null)return e;e=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null);return vo=e,null}function Qs(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(Vo()){case vr:return 1;case Tr:return 4;case wr:case or:return 16;case mo:return 536870912;default:return 16}default:return 16}}var eo=null,Ki=null,Gs=null;function Js(){if(Gs)return Gs;var e,n=Ki,s=n.length,u,p="value"in eo?eo.value:eo.textContent,x=p.length;for(e=0;e<s&&n[e]===p[e];e++);var E=s-e;for(u=1;u<=E&&n[s-u]===p[x-u];u++);return Gs=p.slice(e,1<u?1-u:void 0)}function Wo(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 ws(){return!0}function bs(){return!1}function un(e){function n(s,u,p,x,E){this._reactName=s,this._targetInst=p,this.type=u,this.nativeEvent=x,this.target=E,this.currentTarget=null;for(var F in e)e.hasOwnProperty(F)&&(s=e[F],this[F]=s?s(x):x[F]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?ws:bs,this.isPropagationStopped=bs,this}return J(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=ws)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=ws)},persist:function(){},isPersistent:ws}),n}var Rr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zs=un(Rr),ks=J({},Rr,{view:0,detail:0}),Yo=un(ks),wo,_s,bo,Xo=J({},ks,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:si,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!==bo&&(bo&&e.type==="mousemove"?(wo=e.screenX-bo.screenX,_s=e.screenY-bo.screenY):_s=wo=0,bo=e),wo)},movementY:function(e){return"movementY"in e?e.movementY:_s}}),ei=un(Xo),cn=J({},Xo,{dataTransfer:0}),Ss=un(cn),Ns=J({},ks,{relatedTarget:0}),ti=un(Ns),ni=J({},Rr,{animationName:0,elapsedTime:0,pseudoElement:0}),qa=un(ni),Wa=J({},Rr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ri=un(Wa),qi=J({},Rr,{data:0}),to=un(qi),Wi={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yi={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"},oi={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Xi(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=oi[e])?!!n[e]:!1}function si(){return Xi}var Hu=J({},ks,{key:function(e){if(e.key){var n=Wi[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Wo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Yi[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:si,charCode:function(e){return e.type==="keypress"?Wo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Wo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Qi=un(Hu),ii=J({},Xo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ya=un(ii),Gi=J({},ks,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:si}),Ji=un(Gi),Vu=J({},Rr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xa=un(Vu),Uu=J({},Xo,{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}),Qa=un(Uu),Ga=[9,13,27,32],Zi=m&&"CompositionEvent"in window,Qo=null;m&&"documentMode"in document&&(Qo=document.documentMode);var ea=m&&"TextEvent"in window&&!Qo,ta=m&&(!Zi||Qo&&8<Qo&&11>=Qo),na=" ",Ja=!1;function Za(e,n){switch(e){case"keyup":return Ga.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function el(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Lr=!1;function Dr(e,n){switch(e){case"compositionend":return el(n);case"keypress":return n.which!==32?null:(Ja=!0,na);case"textInput":return e=n.data,e===na&&Ja?null:e;default:return null}}function Vt(e,n){if(Lr)return e==="compositionend"||!Zi&&Za(e,n)?(e=Js(),Gs=Ki=eo=null,Lr=!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 ta&&n.locale!=="ko"?null:n.data;default:return null}}var ai={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 ko(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!ai[e.type]:n==="textarea"}function tl(e,n,s,u){fo(u),n=rl(n,"onChange"),0<n.length&&(s=new Zs("onChange","change",null,s,u),e.push({event:s,listeners:n}))}var _o=null,Go=null;function So(e){mf(e,0)}function Jo(e){var n=di(e);if(He(n))return e}function Zo(e,n){if(e==="change")return n}var zr=!1;if(m){var li;if(m){var a="oninput"in document;if(!a){var d=document.createElement("div");d.setAttribute("oninput","return;"),a=typeof d.oninput=="function"}li=a}else li=!1;zr=li&&(!document.documentMode||9<document.documentMode)}function g(){_o&&(_o.detachEvent("onpropertychange",w),Go=_o=null)}function w(e){if(e.propertyName==="value"&&Jo(Go)){var n=[];tl(n,Go,e,Gt(e)),Bn(So,n)}}function S(e,n,s){e==="focusin"?(g(),_o=n,Go=s,_o.attachEvent("onpropertychange",w)):e==="focusout"&&g()}function N(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Jo(Go)}function $(e,n){if(e==="click")return Jo(n)}function R(e,n){if(e==="input"||e==="change")return Jo(n)}function ee(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var ce=typeof Object.is=="function"?Object.is:ee;function ne(e,n){if(ce(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var s=Object.keys(e),u=Object.keys(n);if(s.length!==u.length)return!1;for(u=0;u<s.length;u++){var p=s[u];if(!y.call(n,p)||!ce(e[p],n[p]))return!1}return!0}function G(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function te(e,n){var s=G(e);e=0;for(var u;s;){if(s.nodeType===3){if(u=e+s.textContent.length,e<=n&&u>=n)return{node:s,offset:n-e};e=u}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=G(s)}}function le(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?le(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function se(){for(var e=window,n=Ke();n instanceof e.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)e=n.contentWindow;else break;n=Ke(e.document)}return n}function oe(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 ae(e){var n=se(),s=e.focusedElem,u=e.selectionRange;if(n!==s&&s&&s.ownerDocument&&le(s.ownerDocument.documentElement,s)){if(u!==null&&oe(s)){if(n=u.start,e=u.end,e===void 0&&(e=n),"selectionStart"in s)s.selectionStart=n,s.selectionEnd=Math.min(e,s.value.length);else if(e=(n=s.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var p=s.textContent.length,x=Math.min(u.start,p);u=u.end===void 0?x:Math.min(u.end,p),!e.extend&&x>u&&(p=u,u=x,x=p),p=te(s,x);var E=te(s,u);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(),x>u?(e.addRange(n),e.extend(E.node,E.offset)):(n.setEnd(E.node,E.offset),e.addRange(n)))}}for(n=[],e=s;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<n.length;s++)e=n[s],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ye=m&&"documentMode"in document&&11>=document.documentMode,pe=null,ve=null,je=null,Pe=!1;function De(e,n,s){var u=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Pe||pe==null||pe!==Ke(u)||(u=pe,"selectionStart"in u&&oe(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),je&&ne(je,u)||(je=u,u=rl(ve,"onSelect"),0<u.length&&(n=new Zs("onSelect","select",null,n,s),e.push({event:n,listeners:u}),n.target=pe)))}function Ie(e,n){var s={};return s[e.toLowerCase()]=n.toLowerCase(),s["Webkit"+e]="webkit"+n,s["Moz"+e]="moz"+n,s}var Ue={animationend:Ie("Animation","AnimationEnd"),animationiteration:Ie("Animation","AnimationIteration"),animationstart:Ie("Animation","AnimationStart"),transitionend:Ie("Transition","TransitionEnd")},Le={},Ye={};m&&(Ye=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 Ce(e){if(Le[e])return Le[e];if(!Ue[e])return e;var n=Ue[e],s;for(s in n)if(n.hasOwnProperty(s)&&s in Ye)return Le[e]=n[s];return e}var it=Ce("animationend"),at=Ce("animationiteration"),pt=Ce("animationstart"),mt=Ce("transitionend"),En=new Map,ft="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 At(e,n){En.set(e,n),c(n,[e])}for(var Jt=0;Jt<ft.length;Jt++){var es=ft[Jt],wn=es.toLowerCase(),No=es[0].toUpperCase()+es.slice(1);At(wn,"on"+No)}At(it,"onAnimationEnd"),At(at,"onAnimationIteration"),At(pt,"onAnimationStart"),At("dblclick","onDoubleClick"),At("focusin","onFocus"),At("focusout","onBlur"),At(mt,"onTransitionEnd"),f("onMouseEnter",["mouseout","mouseover"]),f("onMouseLeave",["mouseout","mouseover"]),f("onPointerEnter",["pointerout","pointerover"]),f("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Eo="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(" "),Rg=new Set("cancel close invalid load scroll toggle".split(" ").concat(Eo));function hf(e,n,s){var u=e.type||"unknown-event";e.currentTarget=s,yr(u,n,void 0,e),e.currentTarget=null}function mf(e,n){n=(n&4)!==0;for(var s=0;s<e.length;s++){var u=e[s],p=u.event;u=u.listeners;e:{var x=void 0;if(n)for(var E=u.length-1;0<=E;E--){var F=u[E],Y=F.instance,xe=F.currentTarget;if(F=F.listener,Y!==x&&p.isPropagationStopped())break e;hf(p,F,xe),x=Y}else for(E=0;E<u.length;E++){if(F=u[E],Y=F.instance,xe=F.currentTarget,F=F.listener,Y!==x&&p.isPropagationStopped())break e;hf(p,F,xe),x=Y}}}if(rr)throw e=gr,rr=!1,gr=null,e}function Ot(e,n){var s=n[Ju];s===void 0&&(s=n[Ju]=new Set);var u=e+"__bubble";s.has(u)||(gf(n,e,2,!1),s.add(u))}function Ku(e,n,s){var u=0;n&&(u|=4),gf(s,e,u,n)}var nl="_reactListening"+Math.random().toString(36).slice(2);function ra(e){if(!e[nl]){e[nl]=!0,i.forEach(function(s){s!=="selectionchange"&&(Rg.has(s)||Ku(s,!1,e),Ku(s,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[nl]||(n[nl]=!0,Ku("selectionchange",!1,n))}}function gf(e,n,s,u){switch(Qs(n)){case 1:var p=vs;break;case 4:p=Fu;break;default:p=Ui}s=p.bind(null,n,s,e),p=void 0,!tr||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(p=!0),u?p!==void 0?e.addEventListener(n,s,{capture:!0,passive:p}):e.addEventListener(n,s,!0):p!==void 0?e.addEventListener(n,s,{passive:p}):e.addEventListener(n,s,!1)}function qu(e,n,s,u,p){var x=u;if((n&1)===0&&(n&2)===0&&u!==null)e:for(;;){if(u===null)return;var E=u.tag;if(E===3||E===4){var F=u.stateNode.containerInfo;if(F===p||F.nodeType===8&&F.parentNode===p)break;if(E===4)for(E=u.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(;F!==null;){if(E=Es(F),E===null)return;if(Y=E.tag,Y===5||Y===6){u=x=E;continue e}F=F.parentNode}}u=u.return}Bn(function(){var xe=x,Te=Gt(s),$e=[];e:{var Me=En.get(e);if(Me!==void 0){var qe=Zs,Qe=e;switch(e){case"keypress":if(Wo(s)===0)break e;case"keydown":case"keyup":qe=Qi;break;case"focusin":Qe="focus",qe=ti;break;case"focusout":Qe="blur",qe=ti;break;case"beforeblur":case"afterblur":qe=ti;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":qe=ei;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":qe=Ss;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":qe=Ji;break;case it:case at:case pt:qe=qa;break;case mt:qe=Xa;break;case"scroll":qe=Yo;break;case"wheel":qe=Qa;break;case"copy":case"cut":case"paste":qe=ri;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":qe=Ya}var Ge=(n&4)!==0,Qt=!Ge&&e==="scroll",he=Ge?Me!==null?Me+"Capture":null:Me;Ge=[];for(var re=xe,ge;re!==null;){ge=re;var Be=ge.stateNode;if(ge.tag===5&&Be!==null&&(ge=Be,he!==null&&(Be=$n(re,he),Be!=null&&Ge.push(oa(re,Be,ge)))),Qt)break;re=re.return}0<Ge.length&&(Me=new qe(Me,Qe,null,s,Te),$e.push({event:Me,listeners:Ge}))}}if((n&7)===0){e:{if(Me=e==="mouseover"||e==="pointerover",qe=e==="mouseout"||e==="pointerout",Me&&s!==mn&&(Qe=s.relatedTarget||s.fromElement)&&(Es(Qe)||Qe[jo]))break e;if((qe||Me)&&(Me=Te.window===Te?Te:(Me=Te.ownerDocument)?Me.defaultView||Me.parentWindow:window,qe?(Qe=s.relatedTarget||s.toElement,qe=xe,Qe=Qe?Es(Qe):null,Qe!==null&&(Qt=Wt(Qe),Qe!==Qt||Qe.tag!==5&&Qe.tag!==6)&&(Qe=null)):(qe=null,Qe=xe),qe!==Qe)){if(Ge=ei,Be="onMouseLeave",he="onMouseEnter",re="mouse",(e==="pointerout"||e==="pointerover")&&(Ge=Ya,Be="onPointerLeave",he="onPointerEnter",re="pointer"),Qt=qe==null?Me:di(qe),ge=Qe==null?Me:di(Qe),Me=new Ge(Be,re+"leave",qe,s,Te),Me.target=Qt,Me.relatedTarget=ge,Be=null,Es(Te)===xe&&(Ge=new Ge(he,re+"enter",Qe,s,Te),Ge.target=ge,Ge.relatedTarget=Qt,Be=Ge),Qt=Be,qe&&Qe)t:{for(Ge=qe,he=Qe,re=0,ge=Ge;ge;ge=ui(ge))re++;for(ge=0,Be=he;Be;Be=ui(Be))ge++;for(;0<re-ge;)Ge=ui(Ge),re--;for(;0<ge-re;)he=ui(he),ge--;for(;re--;){if(Ge===he||he!==null&&Ge===he.alternate)break t;Ge=ui(Ge),he=ui(he)}Ge=null}else Ge=null;qe!==null&&yf($e,Me,qe,Ge,!1),Qe!==null&&Qt!==null&&yf($e,Qt,Qe,Ge,!0)}}e:{if(Me=xe?di(xe):window,qe=Me.nodeName&&Me.nodeName.toLowerCase(),qe==="select"||qe==="input"&&Me.type==="file")var et=Zo;else if(ko(Me))if(zr)et=R;else{et=N;var ot=S}else(qe=Me.nodeName)&&qe.toLowerCase()==="input"&&(Me.type==="checkbox"||Me.type==="radio")&&(et=$);if(et&&(et=et(e,xe))){tl($e,et,s,Te);break e}ot&&ot(e,Me,xe),e==="focusout"&&(ot=Me._wrapperState)&&ot.controlled&&Me.type==="number"&&Ct(Me,"number",Me.value)}switch(ot=xe?di(xe):window,e){case"focusin":(ko(ot)||ot.contentEditable==="true")&&(pe=ot,ve=xe,je=null);break;case"focusout":je=ve=pe=null;break;case"mousedown":Pe=!0;break;case"contextmenu":case"mouseup":case"dragend":Pe=!1,De($e,s,Te);break;case"selectionchange":if(ye)break;case"keydown":case"keyup":De($e,s,Te)}var st;if(Zi)e:{switch(e){case"compositionstart":var ut="onCompositionStart";break e;case"compositionend":ut="onCompositionEnd";break e;case"compositionupdate":ut="onCompositionUpdate";break e}ut=void 0}else Lr?Za(e,s)&&(ut="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(ut="onCompositionStart");ut&&(ta&&s.locale!=="ko"&&(Lr||ut!=="onCompositionStart"?ut==="onCompositionEnd"&&Lr&&(st=Js()):(eo=Te,Ki="value"in eo?eo.value:eo.textContent,Lr=!0)),ot=rl(xe,ut),0<ot.length&&(ut=new to(ut,e,null,s,Te),$e.push({event:ut,listeners:ot}),st?ut.data=st:(st=el(s),st!==null&&(ut.data=st)))),(st=ea?Dr(e,s):Vt(e,s))&&(xe=rl(xe,"onBeforeInput"),0<xe.length&&(Te=new to("onBeforeInput","beforeinput",null,s,Te),$e.push({event:Te,listeners:xe}),Te.data=st))}mf($e,n)})}function oa(e,n,s){return{instance:e,listener:n,currentTarget:s}}function rl(e,n){for(var s=n+"Capture",u=[];e!==null;){var p=e,x=p.stateNode;p.tag===5&&x!==null&&(p=x,x=$n(e,s),x!=null&&u.unshift(oa(e,x,p)),x=$n(e,n),x!=null&&u.push(oa(e,x,p))),e=e.return}return u}function ui(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function yf(e,n,s,u,p){for(var x=n._reactName,E=[];s!==null&&s!==u;){var F=s,Y=F.alternate,xe=F.stateNode;if(Y!==null&&Y===u)break;F.tag===5&&xe!==null&&(F=xe,p?(Y=$n(s,x),Y!=null&&E.unshift(oa(s,Y,F))):p||(Y=$n(s,x),Y!=null&&E.push(oa(s,Y,F)))),s=s.return}E.length!==0&&e.push({event:n,listeners:E})}var Lg=/\r\n?/g,Dg=/\u0000|\uFFFD/g;function xf(e){return(typeof e=="string"?e:""+e).replace(Lg,`
|
|
38
|
+
`).replace(Dg,"")}function ol(e,n,s){if(n=xf(n),xf(e)!==n&&s)throw Error(o(425))}function sl(){}var Wu=null,Yu=null;function Xu(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 Qu=typeof setTimeout=="function"?setTimeout:void 0,zg=typeof clearTimeout=="function"?clearTimeout:void 0,vf=typeof Promise=="function"?Promise:void 0,Bg=typeof queueMicrotask=="function"?queueMicrotask:typeof vf<"u"?function(e){return vf.resolve(null).then(e).catch(Fg)}:Qu;function Fg(e){setTimeout(function(){throw e})}function Gu(e,n){var s=n,u=0;do{var p=s.nextSibling;if(e.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"){if(u===0){e.removeChild(p),yo(n);return}u--}else s!=="$"&&s!=="$?"&&s!=="$!"||u++;s=p}while(s);yo(n)}function ts(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 wf(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"){if(n===0)return e;n--}else s==="/$"&&n++}e=e.previousSibling}return null}var ci=Math.random().toString(36).slice(2),no="__reactFiber$"+ci,sa="__reactProps$"+ci,jo="__reactContainer$"+ci,Ju="__reactEvents$"+ci,Hg="__reactListeners$"+ci,Vg="__reactHandles$"+ci;function Es(e){var n=e[no];if(n)return n;for(var s=e.parentNode;s;){if(n=s[jo]||s[no]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(e=wf(e);e!==null;){if(s=e[no])return s;e=wf(e)}return n}e=s,s=e.parentNode}return null}function ia(e){return e=e[no]||e[jo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function di(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function il(e){return e[sa]||null}var Zu=[],fi=-1;function ns(e){return{current:e}}function Rt(e){0>fi||(e.current=Zu[fi],Zu[fi]=null,fi--)}function Tt(e,n){fi++,Zu[fi]=e.current,e.current=n}var rs={},jn=ns(rs),Wn=ns(!1),js=rs;function pi(e,n){var s=e.type.contextTypes;if(!s)return rs;var u=e.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===n)return u.__reactInternalMemoizedMaskedChildContext;var p={},x;for(x in s)p[x]=n[x];return u&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=p),p}function Yn(e){return e=e.childContextTypes,e!=null}function al(){Rt(Wn),Rt(jn)}function bf(e,n,s){if(jn.current!==rs)throw Error(o(168));Tt(jn,n),Tt(Wn,s)}function kf(e,n,s){var u=e.stateNode;if(n=n.childContextTypes,typeof u.getChildContext!="function")return s;u=u.getChildContext();for(var p in u)if(!(p in n))throw Error(o(108,Re(e)||"Unknown",p));return J({},s,u)}function ll(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||rs,js=jn.current,Tt(jn,e),Tt(Wn,Wn.current),!0}function _f(e,n,s){var u=e.stateNode;if(!u)throw Error(o(169));s?(e=kf(e,n,js),u.__reactInternalMemoizedMergedChildContext=e,Rt(Wn),Rt(jn),Tt(jn,e)):Rt(Wn),Tt(Wn,s)}var Co=null,ul=!1,ec=!1;function Sf(e){Co===null?Co=[e]:Co.push(e)}function Ug(e){ul=!0,Sf(e)}function os(){if(!ec&&Co!==null){ec=!0;var e=0,n=bt;try{var s=Co;for(bt=1;e<s.length;e++){var u=s[e];do u=u(!0);while(u!==null)}Co=null,ul=!1}catch(p){throw Co!==null&&(Co=Co.slice(e+1)),ho(vr,os),p}finally{bt=n,ec=!1}}return null}var hi=[],mi=0,cl=null,dl=0,_r=[],Sr=0,Cs=null,Po=1,Mo="";function Ps(e,n){hi[mi++]=dl,hi[mi++]=cl,cl=e,dl=n}function Nf(e,n,s){_r[Sr++]=Po,_r[Sr++]=Mo,_r[Sr++]=Cs,Cs=e;var u=Po;e=Mo;var p=32-ln(u)-1;u&=~(1<<p),s+=1;var x=32-ln(n)+p;if(30<x){var E=p-p%5;x=(u&(1<<E)-1).toString(32),u>>=E,p-=E,Po=1<<32-ln(n)+p|s<<p|u,Mo=x+e}else Po=1<<x|s<<p|u,Mo=e}function tc(e){e.return!==null&&(Ps(e,1),Nf(e,1,0))}function nc(e){for(;e===cl;)cl=hi[--mi],hi[mi]=null,dl=hi[--mi],hi[mi]=null;for(;e===Cs;)Cs=_r[--Sr],_r[Sr]=null,Mo=_r[--Sr],_r[Sr]=null,Po=_r[--Sr],_r[Sr]=null}var ar=null,lr=null,Bt=!1,Br=null;function Ef(e,n){var s=Cr(5,null,null,0);s.elementType="DELETED",s.stateNode=n,s.return=e,n=e.deletions,n===null?(e.deletions=[s],e.flags|=16):n.push(s)}function jf(e,n){switch(e.tag){case 5:var s=e.type;return n=n.nodeType!==1||s.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,ar=e,lr=ts(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,ar=e,lr=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(s=Cs!==null?{id:Po,overflow:Mo}:null,e.memoizedState={dehydrated:n,treeContext:s,retryLane:1073741824},s=Cr(18,null,null,0),s.stateNode=n,s.return=e,e.child=s,ar=e,lr=null,!0):!1;default:return!1}}function rc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function oc(e){if(Bt){var n=lr;if(n){var s=n;if(!jf(e,n)){if(rc(e))throw Error(o(418));n=ts(s.nextSibling);var u=ar;n&&jf(e,n)?Ef(u,s):(e.flags=e.flags&-4097|2,Bt=!1,ar=e)}}else{if(rc(e))throw Error(o(418));e.flags=e.flags&-4097|2,Bt=!1,ar=e}}}function Cf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ar=e}function fl(e){if(e!==ar)return!1;if(!Bt)return Cf(e),Bt=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!Xu(e.type,e.memoizedProps)),n&&(n=lr)){if(rc(e))throw Pf(),Error(o(418));for(;n;)Ef(e,n),n=ts(n.nextSibling)}if(Cf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"){if(n===0){lr=ts(e.nextSibling);break e}n--}else s!=="$"&&s!=="$!"&&s!=="$?"||n++}e=e.nextSibling}lr=null}}else lr=ar?ts(e.stateNode.nextSibling):null;return!0}function Pf(){for(var e=lr;e;)e=ts(e.nextSibling)}function gi(){lr=ar=null,Bt=!1}function sc(e){Br===null?Br=[e]:Br.push(e)}var Kg=M.ReactCurrentBatchConfig;function aa(e,n,s){if(e=s.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(s._owner){if(s=s._owner,s){if(s.tag!==1)throw Error(o(309));var u=s.stateNode}if(!u)throw Error(o(147,e));var p=u,x=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===x?n.ref:(n=function(E){var F=p.refs;E===null?delete F[x]:F[x]=E},n._stringRef=x,n)}if(typeof e!="string")throw Error(o(284));if(!s._owner)throw Error(o(290,e))}return e}function pl(e,n){throw e=Object.prototype.toString.call(n),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function Mf(e){var n=e._init;return n(e._payload)}function Tf(e){function n(he,re){if(e){var ge=he.deletions;ge===null?(he.deletions=[re],he.flags|=16):ge.push(re)}}function s(he,re){if(!e)return null;for(;re!==null;)n(he,re),re=re.sibling;return null}function u(he,re){for(he=new Map;re!==null;)re.key!==null?he.set(re.key,re):he.set(re.index,re),re=re.sibling;return he}function p(he,re){return he=fs(he,re),he.index=0,he.sibling=null,he}function x(he,re,ge){return he.index=ge,e?(ge=he.alternate,ge!==null?(ge=ge.index,ge<re?(he.flags|=2,re):ge):(he.flags|=2,re)):(he.flags|=1048576,re)}function E(he){return e&&he.alternate===null&&(he.flags|=2),he}function F(he,re,ge,Be){return re===null||re.tag!==6?(re=Qc(ge,he.mode,Be),re.return=he,re):(re=p(re,ge),re.return=he,re)}function Y(he,re,ge,Be){var et=ge.type;return et===W?Te(he,re,ge.props.children,Be,ge.key):re!==null&&(re.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===Q&&Mf(et)===re.type)?(Be=p(re,ge.props),Be.ref=aa(he,re,ge),Be.return=he,Be):(Be=Ll(ge.type,ge.key,ge.props,null,he.mode,Be),Be.ref=aa(he,re,ge),Be.return=he,Be)}function xe(he,re,ge,Be){return re===null||re.tag!==4||re.stateNode.containerInfo!==ge.containerInfo||re.stateNode.implementation!==ge.implementation?(re=Gc(ge,he.mode,Be),re.return=he,re):(re=p(re,ge.children||[]),re.return=he,re)}function Te(he,re,ge,Be,et){return re===null||re.tag!==7?(re=Ls(ge,he.mode,Be,et),re.return=he,re):(re=p(re,ge),re.return=he,re)}function $e(he,re,ge){if(typeof re=="string"&&re!==""||typeof re=="number")return re=Qc(""+re,he.mode,ge),re.return=he,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case B:return ge=Ll(re.type,re.key,re.props,null,he.mode,ge),ge.ref=aa(he,null,re),ge.return=he,ge;case U:return re=Gc(re,he.mode,ge),re.return=he,re;case Q:var Be=re._init;return $e(he,Be(re._payload),ge)}if(xt(re)||q(re))return re=Ls(re,he.mode,ge,null),re.return=he,re;pl(he,re)}return null}function Me(he,re,ge,Be){var et=re!==null?re.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number")return et!==null?null:F(he,re,""+ge,Be);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case B:return ge.key===et?Y(he,re,ge,Be):null;case U:return ge.key===et?xe(he,re,ge,Be):null;case Q:return et=ge._init,Me(he,re,et(ge._payload),Be)}if(xt(ge)||q(ge))return et!==null?null:Te(he,re,ge,Be,null);pl(he,ge)}return null}function qe(he,re,ge,Be,et){if(typeof Be=="string"&&Be!==""||typeof Be=="number")return he=he.get(ge)||null,F(re,he,""+Be,et);if(typeof Be=="object"&&Be!==null){switch(Be.$$typeof){case B:return he=he.get(Be.key===null?ge:Be.key)||null,Y(re,he,Be,et);case U:return he=he.get(Be.key===null?ge:Be.key)||null,xe(re,he,Be,et);case Q:var ot=Be._init;return qe(he,re,ge,ot(Be._payload),et)}if(xt(Be)||q(Be))return he=he.get(ge)||null,Te(re,he,Be,et,null);pl(re,Be)}return null}function Qe(he,re,ge,Be){for(var et=null,ot=null,st=re,ut=re=0,pn=null;st!==null&&ut<ge.length;ut++){st.index>ut?(pn=st,st=null):pn=st.sibling;var Nt=Me(he,st,ge[ut],Be);if(Nt===null){st===null&&(st=pn);break}e&&st&&Nt.alternate===null&&n(he,st),re=x(Nt,re,ut),ot===null?et=Nt:ot.sibling=Nt,ot=Nt,st=pn}if(ut===ge.length)return s(he,st),Bt&&Ps(he,ut),et;if(st===null){for(;ut<ge.length;ut++)st=$e(he,ge[ut],Be),st!==null&&(re=x(st,re,ut),ot===null?et=st:ot.sibling=st,ot=st);return Bt&&Ps(he,ut),et}for(st=u(he,st);ut<ge.length;ut++)pn=qe(st,he,ut,ge[ut],Be),pn!==null&&(e&&pn.alternate!==null&&st.delete(pn.key===null?ut:pn.key),re=x(pn,re,ut),ot===null?et=pn:ot.sibling=pn,ot=pn);return e&&st.forEach(function(ps){return n(he,ps)}),Bt&&Ps(he,ut),et}function Ge(he,re,ge,Be){var et=q(ge);if(typeof et!="function")throw Error(o(150));if(ge=et.call(ge),ge==null)throw Error(o(151));for(var ot=et=null,st=re,ut=re=0,pn=null,Nt=ge.next();st!==null&&!Nt.done;ut++,Nt=ge.next()){st.index>ut?(pn=st,st=null):pn=st.sibling;var ps=Me(he,st,Nt.value,Be);if(ps===null){st===null&&(st=pn);break}e&&st&&ps.alternate===null&&n(he,st),re=x(ps,re,ut),ot===null?et=ps:ot.sibling=ps,ot=ps,st=pn}if(Nt.done)return s(he,st),Bt&&Ps(he,ut),et;if(st===null){for(;!Nt.done;ut++,Nt=ge.next())Nt=$e(he,Nt.value,Be),Nt!==null&&(re=x(Nt,re,ut),ot===null?et=Nt:ot.sibling=Nt,ot=Nt);return Bt&&Ps(he,ut),et}for(st=u(he,st);!Nt.done;ut++,Nt=ge.next())Nt=qe(st,he,ut,Nt.value,Be),Nt!==null&&(e&&Nt.alternate!==null&&st.delete(Nt.key===null?ut:Nt.key),re=x(Nt,re,ut),ot===null?et=Nt:ot.sibling=Nt,ot=Nt);return e&&st.forEach(function(Sy){return n(he,Sy)}),Bt&&Ps(he,ut),et}function Qt(he,re,ge,Be){if(typeof ge=="object"&&ge!==null&&ge.type===W&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case B:e:{for(var et=ge.key,ot=re;ot!==null;){if(ot.key===et){if(et=ge.type,et===W){if(ot.tag===7){s(he,ot.sibling),re=p(ot,ge.props.children),re.return=he,he=re;break e}}else if(ot.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===Q&&Mf(et)===ot.type){s(he,ot.sibling),re=p(ot,ge.props),re.ref=aa(he,ot,ge),re.return=he,he=re;break e}s(he,ot);break}else n(he,ot);ot=ot.sibling}ge.type===W?(re=Ls(ge.props.children,he.mode,Be,ge.key),re.return=he,he=re):(Be=Ll(ge.type,ge.key,ge.props,null,he.mode,Be),Be.ref=aa(he,re,ge),Be.return=he,he=Be)}return E(he);case U:e:{for(ot=ge.key;re!==null;){if(re.key===ot)if(re.tag===4&&re.stateNode.containerInfo===ge.containerInfo&&re.stateNode.implementation===ge.implementation){s(he,re.sibling),re=p(re,ge.children||[]),re.return=he,he=re;break e}else{s(he,re);break}else n(he,re);re=re.sibling}re=Gc(ge,he.mode,Be),re.return=he,he=re}return E(he);case Q:return ot=ge._init,Qt(he,re,ot(ge._payload),Be)}if(xt(ge))return Qe(he,re,ge,Be);if(q(ge))return Ge(he,re,ge,Be);pl(he,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"?(ge=""+ge,re!==null&&re.tag===6?(s(he,re.sibling),re=p(re,ge),re.return=he,he=re):(s(he,re),re=Qc(ge,he.mode,Be),re.return=he,he=re),E(he)):s(he,re)}return Qt}var yi=Tf(!0),If=Tf(!1),hl=ns(null),ml=null,xi=null,ic=null;function ac(){ic=xi=ml=null}function lc(e){var n=hl.current;Rt(hl),e._currentValue=n}function uc(e,n,s){for(;e!==null;){var u=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,u!==null&&(u.childLanes|=n)):u!==null&&(u.childLanes&n)!==n&&(u.childLanes|=n),e===s)break;e=e.return}}function vi(e,n){ml=e,ic=xi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Xn=!0),e.firstContext=null)}function Nr(e){var n=e._currentValue;if(ic!==e)if(e={context:e,memoizedValue:n,next:null},xi===null){if(ml===null)throw Error(o(308));xi=e,ml.dependencies={lanes:0,firstContext:e}}else xi=xi.next=e;return n}var Ms=null;function cc(e){Ms===null?Ms=[e]:Ms.push(e)}function $f(e,n,s,u){var p=n.interleaved;return p===null?(s.next=s,cc(n)):(s.next=p.next,p.next=s),n.interleaved=s,To(e,u)}function To(e,n){e.lanes|=n;var s=e.alternate;for(s!==null&&(s.lanes|=n),s=e,e=e.return;e!==null;)e.childLanes|=n,s=e.alternate,s!==null&&(s.childLanes|=n),s=e,e=e.return;return s.tag===3?s.stateNode:null}var ss=!1;function dc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Af(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 Io(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function is(e,n,s){var u=e.updateQueue;if(u===null)return null;if(u=u.shared,(St&2)!==0){var p=u.pending;return p===null?n.next=n:(n.next=p.next,p.next=n),u.pending=n,To(e,s)}return p=u.interleaved,p===null?(n.next=n,cc(u)):(n.next=p.next,p.next=n),u.interleaved=n,To(e,s)}function gl(e,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194240)!==0)){var u=n.lanes;u&=e.pendingLanes,s|=u,n.lanes=s,yn(e,s)}}function Of(e,n){var s=e.updateQueue,u=e.alternate;if(u!==null&&(u=u.updateQueue,s===u)){var p=null,x=null;if(s=s.firstBaseUpdate,s!==null){do{var E={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};x===null?p=x=E:x=x.next=E,s=s.next}while(s!==null);x===null?p=x=n:x=x.next=n}else p=x=n;s={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:x,shared:u.shared,effects:u.effects},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=n:e.next=n,s.lastBaseUpdate=n}function yl(e,n,s,u){var p=e.updateQueue;ss=!1;var x=p.firstBaseUpdate,E=p.lastBaseUpdate,F=p.shared.pending;if(F!==null){p.shared.pending=null;var Y=F,xe=Y.next;Y.next=null,E===null?x=xe:E.next=xe,E=Y;var Te=e.alternate;Te!==null&&(Te=Te.updateQueue,F=Te.lastBaseUpdate,F!==E&&(F===null?Te.firstBaseUpdate=xe:F.next=xe,Te.lastBaseUpdate=Y))}if(x!==null){var $e=p.baseState;E=0,Te=xe=Y=null,F=x;do{var Me=F.lane,qe=F.eventTime;if((u&Me)===Me){Te!==null&&(Te=Te.next={eventTime:qe,lane:0,tag:F.tag,payload:F.payload,callback:F.callback,next:null});e:{var Qe=e,Ge=F;switch(Me=n,qe=s,Ge.tag){case 1:if(Qe=Ge.payload,typeof Qe=="function"){$e=Qe.call(qe,$e,Me);break e}$e=Qe;break e;case 3:Qe.flags=Qe.flags&-65537|128;case 0:if(Qe=Ge.payload,Me=typeof Qe=="function"?Qe.call(qe,$e,Me):Qe,Me==null)break e;$e=J({},$e,Me);break e;case 2:ss=!0}}F.callback!==null&&F.lane!==0&&(e.flags|=64,Me=p.effects,Me===null?p.effects=[F]:Me.push(F))}else qe={eventTime:qe,lane:Me,tag:F.tag,payload:F.payload,callback:F.callback,next:null},Te===null?(xe=Te=qe,Y=$e):Te=Te.next=qe,E|=Me;if(F=F.next,F===null){if(F=p.shared.pending,F===null)break;Me=F,F=Me.next,Me.next=null,p.lastBaseUpdate=Me,p.shared.pending=null}}while(!0);if(Te===null&&(Y=$e),p.baseState=Y,p.firstBaseUpdate=xe,p.lastBaseUpdate=Te,n=p.shared.interleaved,n!==null){p=n;do E|=p.lane,p=p.next;while(p!==n)}else x===null&&(p.shared.lanes=0);$s|=E,e.lanes=E,e.memoizedState=$e}}function Rf(e,n,s){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var u=e[n],p=u.callback;if(p!==null){if(u.callback=null,u=s,typeof p!="function")throw Error(o(191,p));p.call(u)}}}var la={},ro=ns(la),ua=ns(la),ca=ns(la);function Ts(e){if(e===la)throw Error(o(174));return e}function fc(e,n){switch(Tt(ca,n),Tt(ua,e),Tt(ro,la),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:tn(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=tn(n,e)}Rt(ro),Tt(ro,n)}function wi(){Rt(ro),Rt(ua),Rt(ca)}function Lf(e){Ts(ca.current);var n=Ts(ro.current),s=tn(n,e.type);n!==s&&(Tt(ua,e),Tt(ro,s))}function pc(e){ua.current===e&&(Rt(ro),Rt(ua))}var Ut=ns(0);function xl(e){for(var n=e;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.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 hc=[];function mc(){for(var e=0;e<hc.length;e++)hc[e]._workInProgressVersionPrimary=null;hc.length=0}var vl=M.ReactCurrentDispatcher,gc=M.ReactCurrentBatchConfig,Is=0,Kt=null,rn=null,dn=null,wl=!1,da=!1,fa=0,qg=0;function Cn(){throw Error(o(321))}function yc(e,n){if(n===null)return!1;for(var s=0;s<n.length&&s<e.length;s++)if(!ce(e[s],n[s]))return!1;return!0}function xc(e,n,s,u,p,x){if(Is=x,Kt=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,vl.current=e===null||e.memoizedState===null?Qg:Gg,e=s(u,p),da){x=0;do{if(da=!1,fa=0,25<=x)throw Error(o(301));x+=1,dn=rn=null,n.updateQueue=null,vl.current=Jg,e=s(u,p)}while(da)}if(vl.current=_l,n=rn!==null&&rn.next!==null,Is=0,dn=rn=Kt=null,wl=!1,n)throw Error(o(300));return e}function vc(){var e=fa!==0;return fa=0,e}function oo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dn===null?Kt.memoizedState=dn=e:dn=dn.next=e,dn}function Er(){if(rn===null){var e=Kt.alternate;e=e!==null?e.memoizedState:null}else e=rn.next;var n=dn===null?Kt.memoizedState:dn.next;if(n!==null)dn=n,rn=e;else{if(e===null)throw Error(o(310));rn=e,e={memoizedState:rn.memoizedState,baseState:rn.baseState,baseQueue:rn.baseQueue,queue:rn.queue,next:null},dn===null?Kt.memoizedState=dn=e:dn=dn.next=e}return dn}function pa(e,n){return typeof n=="function"?n(e):n}function wc(e){var n=Er(),s=n.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var u=rn,p=u.baseQueue,x=s.pending;if(x!==null){if(p!==null){var E=p.next;p.next=x.next,x.next=E}u.baseQueue=p=x,s.pending=null}if(p!==null){x=p.next,u=u.baseState;var F=E=null,Y=null,xe=x;do{var Te=xe.lane;if((Is&Te)===Te)Y!==null&&(Y=Y.next={lane:0,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null}),u=xe.hasEagerState?xe.eagerState:e(u,xe.action);else{var $e={lane:Te,action:xe.action,hasEagerState:xe.hasEagerState,eagerState:xe.eagerState,next:null};Y===null?(F=Y=$e,E=u):Y=Y.next=$e,Kt.lanes|=Te,$s|=Te}xe=xe.next}while(xe!==null&&xe!==x);Y===null?E=u:Y.next=F,ce(u,n.memoizedState)||(Xn=!0),n.memoizedState=u,n.baseState=E,n.baseQueue=Y,s.lastRenderedState=u}if(e=s.interleaved,e!==null){p=e;do x=p.lane,Kt.lanes|=x,$s|=x,p=p.next;while(p!==e)}else p===null&&(s.lanes=0);return[n.memoizedState,s.dispatch]}function bc(e){var n=Er(),s=n.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var u=s.dispatch,p=s.pending,x=n.memoizedState;if(p!==null){s.pending=null;var E=p=p.next;do x=e(x,E.action),E=E.next;while(E!==p);ce(x,n.memoizedState)||(Xn=!0),n.memoizedState=x,n.baseQueue===null&&(n.baseState=x),s.lastRenderedState=x}return[x,u]}function Df(){}function zf(e,n){var s=Kt,u=Er(),p=n(),x=!ce(u.memoizedState,p);if(x&&(u.memoizedState=p,Xn=!0),u=u.queue,kc(Hf.bind(null,s,u,e),[e]),u.getSnapshot!==n||x||dn!==null&&dn.memoizedState.tag&1){if(s.flags|=2048,ha(9,Ff.bind(null,s,u,p,n),void 0,null),fn===null)throw Error(o(349));(Is&30)!==0||Bf(s,n,p)}return p}function Bf(e,n,s){e.flags|=16384,e={getSnapshot:n,value:s},n=Kt.updateQueue,n===null?(n={lastEffect:null,stores:null},Kt.updateQueue=n,n.stores=[e]):(s=n.stores,s===null?n.stores=[e]:s.push(e))}function Ff(e,n,s,u){n.value=s,n.getSnapshot=u,Vf(n)&&Uf(e)}function Hf(e,n,s){return s(function(){Vf(n)&&Uf(e)})}function Vf(e){var n=e.getSnapshot;e=e.value;try{var s=n();return!ce(e,s)}catch{return!0}}function Uf(e){var n=To(e,1);n!==null&&Ur(n,e,1,-1)}function Kf(e){var n=oo();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:pa,lastRenderedState:e},n.queue=e,e=e.dispatch=Xg.bind(null,Kt,e),[n.memoizedState,e]}function ha(e,n,s,u){return e={tag:e,create:n,destroy:s,deps:u,next:null},n=Kt.updateQueue,n===null?(n={lastEffect:null,stores:null},Kt.updateQueue=n,n.lastEffect=e.next=e):(s=n.lastEffect,s===null?n.lastEffect=e.next=e:(u=s.next,s.next=e,e.next=u,n.lastEffect=e)),e}function qf(){return Er().memoizedState}function bl(e,n,s,u){var p=oo();Kt.flags|=e,p.memoizedState=ha(1|n,s,void 0,u===void 0?null:u)}function kl(e,n,s,u){var p=Er();u=u===void 0?null:u;var x=void 0;if(rn!==null){var E=rn.memoizedState;if(x=E.destroy,u!==null&&yc(u,E.deps)){p.memoizedState=ha(n,s,x,u);return}}Kt.flags|=e,p.memoizedState=ha(1|n,s,x,u)}function Wf(e,n){return bl(8390656,8,e,n)}function kc(e,n){return kl(2048,8,e,n)}function Yf(e,n){return kl(4,2,e,n)}function Xf(e,n){return kl(4,4,e,n)}function Qf(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 Gf(e,n,s){return s=s!=null?s.concat([e]):null,kl(4,4,Qf.bind(null,n,e),s)}function _c(){}function Jf(e,n){var s=Er();n=n===void 0?null:n;var u=s.memoizedState;return u!==null&&n!==null&&yc(n,u[1])?u[0]:(s.memoizedState=[e,n],e)}function Zf(e,n){var s=Er();n=n===void 0?null:n;var u=s.memoizedState;return u!==null&&n!==null&&yc(n,u[1])?u[0]:(e=e(),s.memoizedState=[e,n],e)}function ep(e,n,s){return(Is&21)===0?(e.baseState&&(e.baseState=!1,Xn=!0),e.memoizedState=s):(ce(s,n)||(s=$t(),Kt.lanes|=s,$s|=s,e.baseState=!0),n)}function Wg(e,n){var s=bt;bt=s!==0&&4>s?s:4,e(!0);var u=gc.transition;gc.transition={};try{e(!1),n()}finally{bt=s,gc.transition=u}}function tp(){return Er().memoizedState}function Yg(e,n,s){var u=cs(e);if(s={lane:u,action:s,hasEagerState:!1,eagerState:null,next:null},np(e))rp(n,s);else if(s=$f(e,n,s,u),s!==null){var p=On();Ur(s,e,u,p),op(s,n,u)}}function Xg(e,n,s){var u=cs(e),p={lane:u,action:s,hasEagerState:!1,eagerState:null,next:null};if(np(e))rp(n,p);else{var x=e.alternate;if(e.lanes===0&&(x===null||x.lanes===0)&&(x=n.lastRenderedReducer,x!==null))try{var E=n.lastRenderedState,F=x(E,s);if(p.hasEagerState=!0,p.eagerState=F,ce(F,E)){var Y=n.interleaved;Y===null?(p.next=p,cc(n)):(p.next=Y.next,Y.next=p),n.interleaved=p;return}}catch{}finally{}s=$f(e,n,p,u),s!==null&&(p=On(),Ur(s,e,u,p),op(s,n,u))}}function np(e){var n=e.alternate;return e===Kt||n!==null&&n===Kt}function rp(e,n){da=wl=!0;var s=e.pending;s===null?n.next=n:(n.next=s.next,s.next=n),e.pending=n}function op(e,n,s){if((s&4194240)!==0){var u=n.lanes;u&=e.pendingLanes,s|=u,n.lanes=s,yn(e,s)}}var _l={readContext:Nr,useCallback:Cn,useContext:Cn,useEffect:Cn,useImperativeHandle:Cn,useInsertionEffect:Cn,useLayoutEffect:Cn,useMemo:Cn,useReducer:Cn,useRef:Cn,useState:Cn,useDebugValue:Cn,useDeferredValue:Cn,useTransition:Cn,useMutableSource:Cn,useSyncExternalStore:Cn,useId:Cn,unstable_isNewReconciler:!1},Qg={readContext:Nr,useCallback:function(e,n){return oo().memoizedState=[e,n===void 0?null:n],e},useContext:Nr,useEffect:Wf,useImperativeHandle:function(e,n,s){return s=s!=null?s.concat([e]):null,bl(4194308,4,Qf.bind(null,n,e),s)},useLayoutEffect:function(e,n){return bl(4194308,4,e,n)},useInsertionEffect:function(e,n){return bl(4,2,e,n)},useMemo:function(e,n){var s=oo();return n=n===void 0?null:n,e=e(),s.memoizedState=[e,n],e},useReducer:function(e,n,s){var u=oo();return n=s!==void 0?s(n):n,u.memoizedState=u.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},u.queue=e,e=e.dispatch=Yg.bind(null,Kt,e),[u.memoizedState,e]},useRef:function(e){var n=oo();return e={current:e},n.memoizedState=e},useState:Kf,useDebugValue:_c,useDeferredValue:function(e){return oo().memoizedState=e},useTransition:function(){var e=Kf(!1),n=e[0];return e=Wg.bind(null,e[1]),oo().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,s){var u=Kt,p=oo();if(Bt){if(s===void 0)throw Error(o(407));s=s()}else{if(s=n(),fn===null)throw Error(o(349));(Is&30)!==0||Bf(u,n,s)}p.memoizedState=s;var x={value:s,getSnapshot:n};return p.queue=x,Wf(Hf.bind(null,u,x,e),[e]),u.flags|=2048,ha(9,Ff.bind(null,u,x,s,n),void 0,null),s},useId:function(){var e=oo(),n=fn.identifierPrefix;if(Bt){var s=Mo,u=Po;s=(u&~(1<<32-ln(u)-1)).toString(32)+s,n=":"+n+"R"+s,s=fa++,0<s&&(n+="H"+s.toString(32)),n+=":"}else s=qg++,n=":"+n+"r"+s.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},Gg={readContext:Nr,useCallback:Jf,useContext:Nr,useEffect:kc,useImperativeHandle:Gf,useInsertionEffect:Yf,useLayoutEffect:Xf,useMemo:Zf,useReducer:wc,useRef:qf,useState:function(){return wc(pa)},useDebugValue:_c,useDeferredValue:function(e){var n=Er();return ep(n,rn.memoizedState,e)},useTransition:function(){var e=wc(pa)[0],n=Er().memoizedState;return[e,n]},useMutableSource:Df,useSyncExternalStore:zf,useId:tp,unstable_isNewReconciler:!1},Jg={readContext:Nr,useCallback:Jf,useContext:Nr,useEffect:kc,useImperativeHandle:Gf,useInsertionEffect:Yf,useLayoutEffect:Xf,useMemo:Zf,useReducer:bc,useRef:qf,useState:function(){return bc(pa)},useDebugValue:_c,useDeferredValue:function(e){var n=Er();return rn===null?n.memoizedState=e:ep(n,rn.memoizedState,e)},useTransition:function(){var e=bc(pa)[0],n=Er().memoizedState;return[e,n]},useMutableSource:Df,useSyncExternalStore:zf,useId:tp,unstable_isNewReconciler:!1};function Fr(e,n){if(e&&e.defaultProps){n=J({},n),e=e.defaultProps;for(var s in e)n[s]===void 0&&(n[s]=e[s]);return n}return n}function Sc(e,n,s,u){n=e.memoizedState,s=s(u,n),s=s==null?n:J({},n,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Sl={isMounted:function(e){return(e=e._reactInternals)?Wt(e)===e:!1},enqueueSetState:function(e,n,s){e=e._reactInternals;var u=On(),p=cs(e),x=Io(u,p);x.payload=n,s!=null&&(x.callback=s),n=is(e,x,p),n!==null&&(Ur(n,e,p,u),gl(n,e,p))},enqueueReplaceState:function(e,n,s){e=e._reactInternals;var u=On(),p=cs(e),x=Io(u,p);x.tag=1,x.payload=n,s!=null&&(x.callback=s),n=is(e,x,p),n!==null&&(Ur(n,e,p,u),gl(n,e,p))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var s=On(),u=cs(e),p=Io(s,u);p.tag=2,n!=null&&(p.callback=n),n=is(e,p,u),n!==null&&(Ur(n,e,u,s),gl(n,e,u))}};function sp(e,n,s,u,p,x,E){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(u,x,E):n.prototype&&n.prototype.isPureReactComponent?!ne(s,u)||!ne(p,x):!0}function ip(e,n,s){var u=!1,p=rs,x=n.contextType;return typeof x=="object"&&x!==null?x=Nr(x):(p=Yn(n)?js:jn.current,u=n.contextTypes,x=(u=u!=null)?pi(e,p):rs),n=new n(s,x),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Sl,e.stateNode=n,n._reactInternals=e,u&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=p,e.__reactInternalMemoizedMaskedChildContext=x),n}function ap(e,n,s,u){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,u),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,u),n.state!==e&&Sl.enqueueReplaceState(n,n.state,null)}function Nc(e,n,s,u){var p=e.stateNode;p.props=s,p.state=e.memoizedState,p.refs={},dc(e);var x=n.contextType;typeof x=="object"&&x!==null?p.context=Nr(x):(x=Yn(n)?js:jn.current,p.context=pi(e,x)),p.state=e.memoizedState,x=n.getDerivedStateFromProps,typeof x=="function"&&(Sc(e,n,x,s),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),yl(e,s,p,u),p.state=e.memoizedState),typeof p.componentDidMount=="function"&&(e.flags|=4194308)}function bi(e,n){try{var s="",u=n;do s+=Ae(u),u=u.return;while(u);var p=s}catch(x){p=`
|
|
39
|
+
Error generating stack: `+x.message+`
|
|
40
|
+
`+x.stack}return{value:e,source:n,stack:p,digest:null}}function Ec(e,n,s){return{value:e,source:null,stack:s??null,digest:n??null}}function jc(e,n){try{console.error(n.value)}catch(s){setTimeout(function(){throw s})}}var Zg=typeof WeakMap=="function"?WeakMap:Map;function lp(e,n,s){s=Io(-1,s),s.tag=3,s.payload={element:null};var u=n.value;return s.callback=function(){Tl||(Tl=!0,Hc=u),jc(e,n)},s}function up(e,n,s){s=Io(-1,s),s.tag=3;var u=e.type.getDerivedStateFromError;if(typeof u=="function"){var p=n.value;s.payload=function(){return u(p)},s.callback=function(){jc(e,n)}}var x=e.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(s.callback=function(){jc(e,n),typeof u!="function"&&(ls===null?ls=new Set([this]):ls.add(this));var E=n.stack;this.componentDidCatch(n.value,{componentStack:E!==null?E:""})}),s}function cp(e,n,s){var u=e.pingCache;if(u===null){u=e.pingCache=new Zg;var p=new Set;u.set(n,p)}else p=u.get(n),p===void 0&&(p=new Set,u.set(n,p));p.has(s)||(p.add(s),e=py.bind(null,e,n,s),n.then(e,e))}function dp(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 fp(e,n,s,u,p){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(n=Io(-1,1),n.tag=2,is(s,n,1))),s.lanes|=1),e):(e.flags|=65536,e.lanes=p,e)}var ey=M.ReactCurrentOwner,Xn=!1;function An(e,n,s,u){n.child=e===null?If(n,null,s,u):yi(n,e.child,s,u)}function pp(e,n,s,u,p){s=s.render;var x=n.ref;return vi(n,p),u=xc(e,n,s,u,x,p),s=vc(),e!==null&&!Xn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,$o(e,n,p)):(Bt&&s&&tc(n),n.flags|=1,An(e,n,u,p),n.child)}function hp(e,n,s,u,p){if(e===null){var x=s.type;return typeof x=="function"&&!Xc(x)&&x.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(n.tag=15,n.type=x,mp(e,n,x,u,p)):(e=Ll(s.type,null,u,n,n.mode,p),e.ref=n.ref,e.return=n,n.child=e)}if(x=e.child,(e.lanes&p)===0){var E=x.memoizedProps;if(s=s.compare,s=s!==null?s:ne,s(E,u)&&e.ref===n.ref)return $o(e,n,p)}return n.flags|=1,e=fs(x,u),e.ref=n.ref,e.return=n,n.child=e}function mp(e,n,s,u,p){if(e!==null){var x=e.memoizedProps;if(ne(x,u)&&e.ref===n.ref)if(Xn=!1,n.pendingProps=u=x,(e.lanes&p)!==0)(e.flags&131072)!==0&&(Xn=!0);else return n.lanes=e.lanes,$o(e,n,p)}return Cc(e,n,s,u,p)}function gp(e,n,s){var u=n.pendingProps,p=u.children,x=e!==null?e.memoizedState:null;if(u.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Tt(_i,ur),ur|=s;else{if((s&1073741824)===0)return e=x!==null?x.baseLanes|s:s,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,Tt(_i,ur),ur|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=x!==null?x.baseLanes:s,Tt(_i,ur),ur|=u}else x!==null?(u=x.baseLanes|s,n.memoizedState=null):u=s,Tt(_i,ur),ur|=u;return An(e,n,p,s),n.child}function yp(e,n){var s=n.ref;(e===null&&s!==null||e!==null&&e.ref!==s)&&(n.flags|=512,n.flags|=2097152)}function Cc(e,n,s,u,p){var x=Yn(s)?js:jn.current;return x=pi(n,x),vi(n,p),s=xc(e,n,s,u,x,p),u=vc(),e!==null&&!Xn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,$o(e,n,p)):(Bt&&u&&tc(n),n.flags|=1,An(e,n,s,p),n.child)}function xp(e,n,s,u,p){if(Yn(s)){var x=!0;ll(n)}else x=!1;if(vi(n,p),n.stateNode===null)El(e,n),ip(n,s,u),Nc(n,s,u,p),u=!0;else if(e===null){var E=n.stateNode,F=n.memoizedProps;E.props=F;var Y=E.context,xe=s.contextType;typeof xe=="object"&&xe!==null?xe=Nr(xe):(xe=Yn(s)?js:jn.current,xe=pi(n,xe));var Te=s.getDerivedStateFromProps,$e=typeof Te=="function"||typeof E.getSnapshotBeforeUpdate=="function";$e||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(F!==u||Y!==xe)&&ap(n,E,u,xe),ss=!1;var Me=n.memoizedState;E.state=Me,yl(n,u,E,p),Y=n.memoizedState,F!==u||Me!==Y||Wn.current||ss?(typeof Te=="function"&&(Sc(n,s,Te,u),Y=n.memoizedState),(F=ss||sp(n,s,F,u,Me,Y,xe))?($e||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=u,n.memoizedState=Y),E.props=u,E.state=Y,E.context=xe,u=F):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),u=!1)}else{E=n.stateNode,Af(e,n),F=n.memoizedProps,xe=n.type===n.elementType?F:Fr(n.type,F),E.props=xe,$e=n.pendingProps,Me=E.context,Y=s.contextType,typeof Y=="object"&&Y!==null?Y=Nr(Y):(Y=Yn(s)?js:jn.current,Y=pi(n,Y));var qe=s.getDerivedStateFromProps;(Te=typeof qe=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(F!==$e||Me!==Y)&&ap(n,E,u,Y),ss=!1,Me=n.memoizedState,E.state=Me,yl(n,u,E,p);var Qe=n.memoizedState;F!==$e||Me!==Qe||Wn.current||ss?(typeof qe=="function"&&(Sc(n,s,qe,u),Qe=n.memoizedState),(xe=ss||sp(n,s,xe,u,Me,Qe,Y)||!1)?(Te||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(u,Qe,Y),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(u,Qe,Y)),typeof E.componentDidUpdate=="function"&&(n.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof E.componentDidUpdate!="function"||F===e.memoizedProps&&Me===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||F===e.memoizedProps&&Me===e.memoizedState||(n.flags|=1024),n.memoizedProps=u,n.memoizedState=Qe),E.props=u,E.state=Qe,E.context=Y,u=xe):(typeof E.componentDidUpdate!="function"||F===e.memoizedProps&&Me===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||F===e.memoizedProps&&Me===e.memoizedState||(n.flags|=1024),u=!1)}return Pc(e,n,s,u,x,p)}function Pc(e,n,s,u,p,x){yp(e,n);var E=(n.flags&128)!==0;if(!u&&!E)return p&&_f(n,s,!1),$o(e,n,x);u=n.stateNode,ey.current=n;var F=E&&typeof s.getDerivedStateFromError!="function"?null:u.render();return n.flags|=1,e!==null&&E?(n.child=yi(n,e.child,null,x),n.child=yi(n,null,F,x)):An(e,n,F,x),n.memoizedState=u.state,p&&_f(n,s,!0),n.child}function vp(e){var n=e.stateNode;n.pendingContext?bf(e,n.pendingContext,n.pendingContext!==n.context):n.context&&bf(e,n.context,!1),fc(e,n.containerInfo)}function wp(e,n,s,u,p){return gi(),sc(p),n.flags|=256,An(e,n,s,u),n.child}var Mc={dehydrated:null,treeContext:null,retryLane:0};function Tc(e){return{baseLanes:e,cachePool:null,transitions:null}}function bp(e,n,s){var u=n.pendingProps,p=Ut.current,x=!1,E=(n.flags&128)!==0,F;if((F=E)||(F=e!==null&&e.memoizedState===null?!1:(p&2)!==0),F?(x=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(p|=1),Tt(Ut,p&1),e===null)return oc(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=u.children,e=u.fallback,x?(u=n.mode,x=n.child,E={mode:"hidden",children:E},(u&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=E):x=Dl(E,u,0,null),e=Ls(e,u,s,null),x.return=n,e.return=n,x.sibling=e,n.child=x,n.child.memoizedState=Tc(s),n.memoizedState=Mc,e):Ic(n,E));if(p=e.memoizedState,p!==null&&(F=p.dehydrated,F!==null))return ty(e,n,E,u,F,p,s);if(x){x=u.fallback,E=n.mode,p=e.child,F=p.sibling;var Y={mode:"hidden",children:u.children};return(E&1)===0&&n.child!==p?(u=n.child,u.childLanes=0,u.pendingProps=Y,n.deletions=null):(u=fs(p,Y),u.subtreeFlags=p.subtreeFlags&14680064),F!==null?x=fs(F,x):(x=Ls(x,E,s,null),x.flags|=2),x.return=n,u.return=n,u.sibling=x,n.child=u,u=x,x=n.child,E=e.child.memoizedState,E=E===null?Tc(s):{baseLanes:E.baseLanes|s,cachePool:null,transitions:E.transitions},x.memoizedState=E,x.childLanes=e.childLanes&~s,n.memoizedState=Mc,u}return x=e.child,e=x.sibling,u=fs(x,{mode:"visible",children:u.children}),(n.mode&1)===0&&(u.lanes=s),u.return=n,u.sibling=null,e!==null&&(s=n.deletions,s===null?(n.deletions=[e],n.flags|=16):s.push(e)),n.child=u,n.memoizedState=null,u}function Ic(e,n){return n=Dl({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function Nl(e,n,s,u){return u!==null&&sc(u),yi(n,e.child,null,s),e=Ic(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function ty(e,n,s,u,p,x,E){if(s)return n.flags&256?(n.flags&=-257,u=Ec(Error(o(422))),Nl(e,n,E,u)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(x=u.fallback,p=n.mode,u=Dl({mode:"visible",children:u.children},p,0,null),x=Ls(x,p,E,null),x.flags|=2,u.return=n,x.return=n,u.sibling=x,n.child=u,(n.mode&1)!==0&&yi(n,e.child,null,E),n.child.memoizedState=Tc(E),n.memoizedState=Mc,x);if((n.mode&1)===0)return Nl(e,n,E,null);if(p.data==="$!"){if(u=p.nextSibling&&p.nextSibling.dataset,u)var F=u.dgst;return u=F,x=Error(o(419)),u=Ec(x,u,void 0),Nl(e,n,E,u)}if(F=(E&e.childLanes)!==0,Xn||F){if(u=fn,u!==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&(u.suspendedLanes|E))!==0?0:p,p!==0&&p!==x.retryLane&&(x.retryLane=p,To(e,p),Ur(u,e,p,-1))}return Yc(),u=Ec(Error(o(421))),Nl(e,n,E,u)}return p.data==="$?"?(n.flags|=128,n.child=e.child,n=hy.bind(null,e),p._reactRetry=n,null):(e=x.treeContext,lr=ts(p.nextSibling),ar=n,Bt=!0,Br=null,e!==null&&(_r[Sr++]=Po,_r[Sr++]=Mo,_r[Sr++]=Cs,Po=e.id,Mo=e.overflow,Cs=n),n=Ic(n,u.children),n.flags|=4096,n)}function kp(e,n,s){e.lanes|=n;var u=e.alternate;u!==null&&(u.lanes|=n),uc(e.return,n,s)}function $c(e,n,s,u,p){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:u,tail:s,tailMode:p}:(x.isBackwards=n,x.rendering=null,x.renderingStartTime=0,x.last=u,x.tail=s,x.tailMode=p)}function _p(e,n,s){var u=n.pendingProps,p=u.revealOrder,x=u.tail;if(An(e,n,u.children,s),u=Ut.current,(u&2)!==0)u=u&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&&kp(e,s,n);else if(e.tag===19)kp(e,s,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}u&=1}if(Tt(Ut,u),(n.mode&1)===0)n.memoizedState=null;else switch(p){case"forwards":for(s=n.child,p=null;s!==null;)e=s.alternate,e!==null&&xl(e)===null&&(p=s),s=s.sibling;s=p,s===null?(p=n.child,n.child=null):(p=s.sibling,s.sibling=null),$c(n,!1,p,s,x);break;case"backwards":for(s=null,p=n.child,n.child=null;p!==null;){if(e=p.alternate,e!==null&&xl(e)===null){n.child=p;break}e=p.sibling,p.sibling=s,s=p,p=e}$c(n,!0,s,null,x);break;case"together":$c(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function El(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function $o(e,n,s){if(e!==null&&(n.dependencies=e.dependencies),$s|=n.lanes,(s&n.childLanes)===0)return null;if(e!==null&&n.child!==e.child)throw Error(o(153));if(n.child!==null){for(e=n.child,s=fs(e,e.pendingProps),n.child=s,s.return=n;e.sibling!==null;)e=e.sibling,s=s.sibling=fs(e,e.pendingProps),s.return=n;s.sibling=null}return n.child}function ny(e,n,s){switch(n.tag){case 3:vp(n),gi();break;case 5:Lf(n);break;case 1:Yn(n.type)&&ll(n);break;case 4:fc(n,n.stateNode.containerInfo);break;case 10:var u=n.type._context,p=n.memoizedProps.value;Tt(hl,u._currentValue),u._currentValue=p;break;case 13:if(u=n.memoizedState,u!==null)return u.dehydrated!==null?(Tt(Ut,Ut.current&1),n.flags|=128,null):(s&n.child.childLanes)!==0?bp(e,n,s):(Tt(Ut,Ut.current&1),e=$o(e,n,s),e!==null?e.sibling:null);Tt(Ut,Ut.current&1);break;case 19:if(u=(s&n.childLanes)!==0,(e.flags&128)!==0){if(u)return _p(e,n,s);n.flags|=128}if(p=n.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),Tt(Ut,Ut.current),u)break;return null;case 22:case 23:return n.lanes=0,gp(e,n,s)}return $o(e,n,s)}var Sp,Ac,Np,Ep;Sp=function(e,n){for(var s=n.child;s!==null;){if(s.tag===5||s.tag===6)e.appendChild(s.stateNode);else if(s.tag!==4&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return;s=s.return}s.sibling.return=s.return,s=s.sibling}},Ac=function(){},Np=function(e,n,s,u){var p=e.memoizedProps;if(p!==u){e=n.stateNode,Ts(ro.current);var x=null;switch(s){case"input":p=ct(e,p),u=ct(e,u),x=[];break;case"select":p=J({},p,{value:void 0}),u=J({},u,{value:void 0}),x=[];break;case"textarea":p=It(e,p),u=It(e,u),x=[];break;default:typeof p.onClick!="function"&&typeof u.onClick=="function"&&(e.onclick=sl)}We(s,u);var E;s=null;for(xe in p)if(!u.hasOwnProperty(xe)&&p.hasOwnProperty(xe)&&p[xe]!=null)if(xe==="style"){var F=p[xe];for(E in F)F.hasOwnProperty(E)&&(s||(s={}),s[E]="")}else xe!=="dangerouslySetInnerHTML"&&xe!=="children"&&xe!=="suppressContentEditableWarning"&&xe!=="suppressHydrationWarning"&&xe!=="autoFocus"&&(l.hasOwnProperty(xe)?x||(x=[]):(x=x||[]).push(xe,null));for(xe in u){var Y=u[xe];if(F=p!=null?p[xe]:void 0,u.hasOwnProperty(xe)&&Y!==F&&(Y!=null||F!=null))if(xe==="style")if(F){for(E in F)!F.hasOwnProperty(E)||Y&&Y.hasOwnProperty(E)||(s||(s={}),s[E]="");for(E in Y)Y.hasOwnProperty(E)&&F[E]!==Y[E]&&(s||(s={}),s[E]=Y[E])}else s||(x||(x=[]),x.push(xe,s)),s=Y;else xe==="dangerouslySetInnerHTML"?(Y=Y?Y.__html:void 0,F=F?F.__html:void 0,Y!=null&&F!==Y&&(x=x||[]).push(xe,Y)):xe==="children"?typeof Y!="string"&&typeof Y!="number"||(x=x||[]).push(xe,""+Y):xe!=="suppressContentEditableWarning"&&xe!=="suppressHydrationWarning"&&(l.hasOwnProperty(xe)?(Y!=null&&xe==="onScroll"&&Ot("scroll",e),x||F===Y||(x=[])):(x=x||[]).push(xe,Y))}s&&(x=x||[]).push("style",s);var xe=x;(n.updateQueue=xe)&&(n.flags|=4)}},Ep=function(e,n,s,u){s!==u&&(n.flags|=4)};function ma(e,n){if(!Bt)switch(e.tailMode){case"hidden":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:u.sibling=null}}function Pn(e){var n=e.alternate!==null&&e.alternate.child===e.child,s=0,u=0;if(n)for(var p=e.child;p!==null;)s|=p.lanes|p.childLanes,u|=p.subtreeFlags&14680064,u|=p.flags&14680064,p.return=e,p=p.sibling;else for(p=e.child;p!==null;)s|=p.lanes|p.childLanes,u|=p.subtreeFlags,u|=p.flags,p.return=e,p=p.sibling;return e.subtreeFlags|=u,e.childLanes=s,n}function ry(e,n,s){var u=n.pendingProps;switch(nc(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pn(n),null;case 1:return Yn(n.type)&&al(),Pn(n),null;case 3:return u=n.stateNode,wi(),Rt(Wn),Rt(jn),mc(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(e===null||e.child===null)&&(fl(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Br!==null&&(Kc(Br),Br=null))),Ac(e,n),Pn(n),null;case 5:pc(n);var p=Ts(ca.current);if(s=n.type,e!==null&&n.stateNode!=null)Np(e,n,s,u,p),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!u){if(n.stateNode===null)throw Error(o(166));return Pn(n),null}if(e=Ts(ro.current),fl(n)){u=n.stateNode,s=n.type;var x=n.memoizedProps;switch(u[no]=n,u[sa]=x,e=(n.mode&1)!==0,s){case"dialog":Ot("cancel",u),Ot("close",u);break;case"iframe":case"object":case"embed":Ot("load",u);break;case"video":case"audio":for(p=0;p<Eo.length;p++)Ot(Eo[p],u);break;case"source":Ot("error",u);break;case"img":case"image":case"link":Ot("error",u),Ot("load",u);break;case"details":Ot("toggle",u);break;case"input":dt(u,x),Ot("invalid",u);break;case"select":u._wrapperState={wasMultiple:!!x.multiple},Ot("invalid",u);break;case"textarea":_n(u,x),Ot("invalid",u)}We(s,x),p=null;for(var E in x)if(x.hasOwnProperty(E)){var F=x[E];E==="children"?typeof F=="string"?u.textContent!==F&&(x.suppressHydrationWarning!==!0&&ol(u.textContent,F,e),p=["children",F]):typeof F=="number"&&u.textContent!==""+F&&(x.suppressHydrationWarning!==!0&&ol(u.textContent,F,e),p=["children",""+F]):l.hasOwnProperty(E)&&F!=null&&E==="onScroll"&&Ot("scroll",u)}switch(s){case"input":Ze(u),_t(u,x,!0);break;case"textarea":Ze(u),sn(u);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(u.onclick=sl)}u=p,n.updateQueue=u,u!==null&&(n.flags|=4)}else{E=p.nodeType===9?p:p.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Pt(s)),e==="http://www.w3.org/1999/xhtml"?s==="script"?(e=E.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof u.is=="string"?e=E.createElement(s,{is:u.is}):(e=E.createElement(s),s==="select"&&(E=e,u.multiple?E.multiple=!0:u.size&&(E.size=u.size))):e=E.createElementNS(e,s),e[no]=n,e[sa]=u,Sp(e,n,!1,!1),n.stateNode=e;e:{switch(E=Ln(s,u),s){case"dialog":Ot("cancel",e),Ot("close",e),p=u;break;case"iframe":case"object":case"embed":Ot("load",e),p=u;break;case"video":case"audio":for(p=0;p<Eo.length;p++)Ot(Eo[p],e);p=u;break;case"source":Ot("error",e),p=u;break;case"img":case"image":case"link":Ot("error",e),Ot("load",e),p=u;break;case"details":Ot("toggle",e),p=u;break;case"input":dt(e,u),p=ct(e,u),Ot("invalid",e);break;case"option":p=u;break;case"select":e._wrapperState={wasMultiple:!!u.multiple},p=J({},u,{value:void 0}),Ot("invalid",e);break;case"textarea":_n(e,u),p=It(e,u),Ot("invalid",e);break;default:p=u}We(s,p),F=p;for(x in F)if(F.hasOwnProperty(x)){var Y=F[x];x==="style"?Rn(e,Y):x==="dangerouslySetInnerHTML"?(Y=Y?Y.__html:void 0,Y!=null&&pr(e,Y)):x==="children"?typeof Y=="string"?(s!=="textarea"||Y!=="")&&Tn(e,Y):typeof Y=="number"&&Tn(e,""+Y):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(l.hasOwnProperty(x)?Y!=null&&x==="onScroll"&&Ot("scroll",e):Y!=null&&P(e,x,Y,E))}switch(s){case"input":Ze(e),_t(e,u,!1);break;case"textarea":Ze(e),sn(e);break;case"option":u.value!=null&&e.setAttribute("value",""+_e(u.value));break;case"select":e.multiple=!!u.multiple,x=u.value,x!=null?vt(e,!!u.multiple,x,!1):u.defaultValue!=null&&vt(e,!!u.multiple,u.defaultValue,!0);break;default:typeof p.onClick=="function"&&(e.onclick=sl)}switch(s){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}}u&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return Pn(n),null;case 6:if(e&&n.stateNode!=null)Ep(e,n,e.memoizedProps,u);else{if(typeof u!="string"&&n.stateNode===null)throw Error(o(166));if(s=Ts(ca.current),Ts(ro.current),fl(n)){if(u=n.stateNode,s=n.memoizedProps,u[no]=n,(x=u.nodeValue!==s)&&(e=ar,e!==null))switch(e.tag){case 3:ol(u.nodeValue,s,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ol(u.nodeValue,s,(e.mode&1)!==0)}x&&(n.flags|=4)}else u=(s.nodeType===9?s:s.ownerDocument).createTextNode(u),u[no]=n,n.stateNode=u}return Pn(n),null;case 13:if(Rt(Ut),u=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Bt&&lr!==null&&(n.mode&1)!==0&&(n.flags&128)===0)Pf(),gi(),n.flags|=98560,x=!1;else if(x=fl(n),u!==null&&u.dehydrated!==null){if(e===null){if(!x)throw Error(o(318));if(x=n.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(o(317));x[no]=n}else gi(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Pn(n),x=!1}else Br!==null&&(Kc(Br),Br=null),x=!0;if(!x)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=s,n):(u=u!==null,u!==(e!==null&&e.memoizedState!==null)&&u&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(Ut.current&1)!==0?on===0&&(on=3):Yc())),n.updateQueue!==null&&(n.flags|=4),Pn(n),null);case 4:return wi(),Ac(e,n),e===null&&ra(n.stateNode.containerInfo),Pn(n),null;case 10:return lc(n.type._context),Pn(n),null;case 17:return Yn(n.type)&&al(),Pn(n),null;case 19:if(Rt(Ut),x=n.memoizedState,x===null)return Pn(n),null;if(u=(n.flags&128)!==0,E=x.rendering,E===null)if(u)ma(x,!1);else{if(on!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(E=xl(e),E!==null){for(n.flags|=128,ma(x,!1),u=E.updateQueue,u!==null&&(n.updateQueue=u,n.flags|=4),n.subtreeFlags=0,u=s,s=n.child;s!==null;)x=s,e=u,x.flags&=14680066,E=x.alternate,E===null?(x.childLanes=0,x.lanes=e,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=E.childLanes,x.lanes=E.lanes,x.child=E.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=E.memoizedProps,x.memoizedState=E.memoizedState,x.updateQueue=E.updateQueue,x.type=E.type,e=E.dependencies,x.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),s=s.sibling;return Tt(Ut,Ut.current&1|2),n.child}e=e.sibling}x.tail!==null&&wt()>Si&&(n.flags|=128,u=!0,ma(x,!1),n.lanes=4194304)}else{if(!u)if(e=xl(E),e!==null){if(n.flags|=128,u=!0,s=e.updateQueue,s!==null&&(n.updateQueue=s,n.flags|=4),ma(x,!0),x.tail===null&&x.tailMode==="hidden"&&!E.alternate&&!Bt)return Pn(n),null}else 2*wt()-x.renderingStartTime>Si&&s!==1073741824&&(n.flags|=128,u=!0,ma(x,!1),n.lanes=4194304);x.isBackwards?(E.sibling=n.child,n.child=E):(s=x.last,s!==null?s.sibling=E:n.child=E,x.last=E)}return x.tail!==null?(n=x.tail,x.rendering=n,x.tail=n.sibling,x.renderingStartTime=wt(),n.sibling=null,s=Ut.current,Tt(Ut,u?s&1|2:s&1),n):(Pn(n),null);case 22:case 23:return Wc(),u=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==u&&(n.flags|=8192),u&&(n.mode&1)!==0?(ur&1073741824)!==0&&(Pn(n),n.subtreeFlags&6&&(n.flags|=8192)):Pn(n),null;case 24:return null;case 25:return null}throw Error(o(156,n.tag))}function oy(e,n){switch(nc(n),n.tag){case 1:return Yn(n.type)&&al(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return wi(),Rt(Wn),Rt(jn),mc(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return pc(n),null;case 13:if(Rt(Ut),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(o(340));gi()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return Rt(Ut),null;case 4:return wi(),null;case 10:return lc(n.type._context),null;case 22:case 23:return Wc(),null;case 24:return null;default:return null}}var jl=!1,Mn=!1,sy=typeof WeakSet=="function"?WeakSet:Set,Xe=null;function ki(e,n){var s=e.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(u){qt(e,n,u)}else s.current=null}function Oc(e,n,s){try{s()}catch(u){qt(e,n,u)}}var jp=!1;function iy(e,n){if(Wu=Xs,e=se(),oe(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var u=s.getSelection&&s.getSelection();if(u&&u.rangeCount!==0){s=u.anchorNode;var p=u.anchorOffset,x=u.focusNode;u=u.focusOffset;try{s.nodeType,x.nodeType}catch{s=null;break e}var E=0,F=-1,Y=-1,xe=0,Te=0,$e=e,Me=null;t:for(;;){for(var qe;$e!==s||p!==0&&$e.nodeType!==3||(F=E+p),$e!==x||u!==0&&$e.nodeType!==3||(Y=E+u),$e.nodeType===3&&(E+=$e.nodeValue.length),(qe=$e.firstChild)!==null;)Me=$e,$e=qe;for(;;){if($e===e)break t;if(Me===s&&++xe===p&&(F=E),Me===x&&++Te===u&&(Y=E),(qe=$e.nextSibling)!==null)break;$e=Me,Me=$e.parentNode}$e=qe}s=F===-1||Y===-1?null:{start:F,end:Y}}else s=null}s=s||{start:0,end:0}}else s=null;for(Yu={focusedElem:e,selectionRange:s},Xs=!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,Qt=Qe.memoizedState,he=n.stateNode,re=he.getSnapshotBeforeUpdate(n.elementType===n.type?Ge:Fr(n.type,Ge),Qt);he.__reactInternalSnapshotBeforeUpdate=re}break;case 3:var ge=n.stateNode.containerInfo;ge.nodeType===1?ge.textContent="":ge.nodeType===9&&ge.documentElement&&ge.removeChild(ge.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(Be){qt(n,n.return,Be)}if(e=n.sibling,e!==null){e.return=n.return,Xe=e;break}Xe=n.return}return Qe=jp,jp=!1,Qe}function ga(e,n,s){var u=n.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var p=u=u.next;do{if((p.tag&e)===e){var x=p.destroy;p.destroy=void 0,x!==void 0&&Oc(n,s,x)}p=p.next}while(p!==u)}}function Cl(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var u=s.create;s.destroy=u()}s=s.next}while(s!==n)}}function Rc(e){var n=e.ref;if(n!==null){var s=e.stateNode;switch(e.tag){case 5:e=s;break;default:e=s}typeof n=="function"?n(e):n.current=e}}function Cp(e){var n=e.alternate;n!==null&&(e.alternate=null,Cp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[no],delete n[sa],delete n[Ju],delete n[Hg],delete n[Vg])),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 Pp(e){return e.tag===5||e.tag===3||e.tag===4}function Mp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Pp(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 Lc(e,n,s){var u=e.tag;if(u===5||u===6)e=e.stateNode,n?s.nodeType===8?s.parentNode.insertBefore(e,n):s.insertBefore(e,n):(s.nodeType===8?(n=s.parentNode,n.insertBefore(e,s)):(n=s,n.appendChild(e)),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=sl));else if(u!==4&&(e=e.child,e!==null))for(Lc(e,n,s),e=e.sibling;e!==null;)Lc(e,n,s),e=e.sibling}function Dc(e,n,s){var u=e.tag;if(u===5||u===6)e=e.stateNode,n?s.insertBefore(e,n):s.appendChild(e);else if(u!==4&&(e=e.child,e!==null))for(Dc(e,n,s),e=e.sibling;e!==null;)Dc(e,n,s),e=e.sibling}var bn=null,Hr=!1;function as(e,n,s){for(s=s.child;s!==null;)Tp(e,n,s),s=s.sibling}function Tp(e,n,s){if(gn&&typeof gn.onCommitFiberUnmount=="function")try{gn.onCommitFiberUnmount(Un,s)}catch{}switch(s.tag){case 5:Mn||ki(s,n);case 6:var u=bn,p=Hr;bn=null,as(e,n,s),bn=u,Hr=p,bn!==null&&(Hr?(e=bn,s=s.stateNode,e.nodeType===8?e.parentNode.removeChild(s):e.removeChild(s)):bn.removeChild(s.stateNode));break;case 18:bn!==null&&(Hr?(e=bn,s=s.stateNode,e.nodeType===8?Gu(e.parentNode,s):e.nodeType===1&&Gu(e,s),yo(e)):Gu(bn,s.stateNode));break;case 4:u=bn,p=Hr,bn=s.stateNode.containerInfo,Hr=!0,as(e,n,s),bn=u,Hr=p;break;case 0:case 11:case 14:case 15:if(!Mn&&(u=s.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){p=u=u.next;do{var x=p,E=x.destroy;x=x.tag,E!==void 0&&((x&2)!==0||(x&4)!==0)&&Oc(s,n,E),p=p.next}while(p!==u)}as(e,n,s);break;case 1:if(!Mn&&(ki(s,n),u=s.stateNode,typeof u.componentWillUnmount=="function"))try{u.props=s.memoizedProps,u.state=s.memoizedState,u.componentWillUnmount()}catch(F){qt(s,n,F)}as(e,n,s);break;case 21:as(e,n,s);break;case 22:s.mode&1?(Mn=(u=Mn)||s.memoizedState!==null,as(e,n,s),Mn=u):as(e,n,s);break;default:as(e,n,s)}}function Ip(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var s=e.stateNode;s===null&&(s=e.stateNode=new sy),n.forEach(function(u){var p=my.bind(null,e,u);s.has(u)||(s.add(u),u.then(p,p))})}}function Vr(e,n){var s=n.deletions;if(s!==null)for(var u=0;u<s.length;u++){var p=s[u];try{var x=e,E=n,F=E;e:for(;F!==null;){switch(F.tag){case 5:bn=F.stateNode,Hr=!1;break e;case 3:bn=F.stateNode.containerInfo,Hr=!0;break e;case 4:bn=F.stateNode.containerInfo,Hr=!0;break e}F=F.return}if(bn===null)throw Error(o(160));Tp(x,E,p),bn=null,Hr=!1;var Y=p.alternate;Y!==null&&(Y.return=null),p.return=null}catch(xe){qt(p,n,xe)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)$p(n,e),n=n.sibling}function $p(e,n){var s=e.alternate,u=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Vr(n,e),so(e),u&4){try{ga(3,e,e.return),Cl(3,e)}catch(Ge){qt(e,e.return,Ge)}try{ga(5,e,e.return)}catch(Ge){qt(e,e.return,Ge)}}break;case 1:Vr(n,e),so(e),u&512&&s!==null&&ki(s,s.return);break;case 5:if(Vr(n,e),so(e),u&512&&s!==null&&ki(s,s.return),e.flags&32){var p=e.stateNode;try{Tn(p,"")}catch(Ge){qt(e,e.return,Ge)}}if(u&4&&(p=e.stateNode,p!=null)){var x=e.memoizedProps,E=s!==null?s.memoizedProps:x,F=e.type,Y=e.updateQueue;if(e.updateQueue=null,Y!==null)try{F==="input"&&x.type==="radio"&&x.name!=null&&we(p,x),Ln(F,E);var xe=Ln(F,x);for(E=0;E<Y.length;E+=2){var Te=Y[E],$e=Y[E+1];Te==="style"?Rn(p,$e):Te==="dangerouslySetInnerHTML"?pr(p,$e):Te==="children"?Tn(p,$e):P(p,Te,$e,xe)}switch(F){case"input":tt(p,x);break;case"textarea":fr(p,x);break;case"select":var Me=p._wrapperState.wasMultiple;p._wrapperState.wasMultiple=!!x.multiple;var qe=x.value;qe!=null?vt(p,!!x.multiple,qe,!1):Me!==!!x.multiple&&(x.defaultValue!=null?vt(p,!!x.multiple,x.defaultValue,!0):vt(p,!!x.multiple,x.multiple?[]:"",!1))}p[sa]=x}catch(Ge){qt(e,e.return,Ge)}}break;case 6:if(Vr(n,e),so(e),u&4){if(e.stateNode===null)throw Error(o(162));p=e.stateNode,x=e.memoizedProps;try{p.nodeValue=x}catch(Ge){qt(e,e.return,Ge)}}break;case 3:if(Vr(n,e),so(e),u&4&&s!==null&&s.memoizedState.isDehydrated)try{yo(n.containerInfo)}catch(Ge){qt(e,e.return,Ge)}break;case 4:Vr(n,e),so(e);break;case 13:Vr(n,e),so(e),p=e.child,p.flags&8192&&(x=p.memoizedState!==null,p.stateNode.isHidden=x,!x||p.alternate!==null&&p.alternate.memoizedState!==null||(Fc=wt())),u&4&&Ip(e);break;case 22:if(Te=s!==null&&s.memoizedState!==null,e.mode&1?(Mn=(xe=Mn)||Te,Vr(n,e),Mn=xe):Vr(n,e),so(e),u&8192){if(xe=e.memoizedState!==null,(e.stateNode.isHidden=xe)&&!Te&&(e.mode&1)!==0)for(Xe=e,Te=e.child;Te!==null;){for($e=Xe=Te;Xe!==null;){switch(Me=Xe,qe=Me.child,Me.tag){case 0:case 11:case 14:case 15:ga(4,Me,Me.return);break;case 1:ki(Me,Me.return);var Qe=Me.stateNode;if(typeof Qe.componentWillUnmount=="function"){u=Me,s=Me.return;try{n=u,Qe.props=n.memoizedProps,Qe.state=n.memoizedState,Qe.componentWillUnmount()}catch(Ge){qt(u,s,Ge)}}break;case 5:ki(Me,Me.return);break;case 22:if(Me.memoizedState!==null){Rp($e);continue}}qe!==null?(qe.return=Me,Xe=qe):Rp($e)}Te=Te.sibling}e:for(Te=null,$e=e;;){if($e.tag===5){if(Te===null){Te=$e;try{p=$e.stateNode,xe?(x=p.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(F=$e.stateNode,Y=$e.memoizedProps.style,E=Y!=null&&Y.hasOwnProperty("display")?Y.display:null,F.style.display=hr("display",E))}catch(Ge){qt(e,e.return,Ge)}}}else if($e.tag===6){if(Te===null)try{$e.stateNode.nodeValue=xe?"":$e.memoizedProps}catch(Ge){qt(e,e.return,Ge)}}else if(($e.tag!==22&&$e.tag!==23||$e.memoizedState===null||$e===e)&&$e.child!==null){$e.child.return=$e,$e=$e.child;continue}if($e===e)break e;for(;$e.sibling===null;){if($e.return===null||$e.return===e)break e;Te===$e&&(Te=null),$e=$e.return}Te===$e&&(Te=null),$e.sibling.return=$e.return,$e=$e.sibling}}break;case 19:Vr(n,e),so(e),u&4&&Ip(e);break;case 21:break;default:Vr(n,e),so(e)}}function so(e){var n=e.flags;if(n&2){try{e:{for(var s=e.return;s!==null;){if(Pp(s)){var u=s;break e}s=s.return}throw Error(o(160))}switch(u.tag){case 5:var p=u.stateNode;u.flags&32&&(Tn(p,""),u.flags&=-33);var x=Mp(e);Dc(e,x,p);break;case 3:case 4:var E=u.stateNode.containerInfo,F=Mp(e);Lc(e,F,E);break;default:throw Error(o(161))}}catch(Y){qt(e,e.return,Y)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function ay(e,n,s){Xe=e,Ap(e)}function Ap(e,n,s){for(var u=(e.mode&1)!==0;Xe!==null;){var p=Xe,x=p.child;if(p.tag===22&&u){var E=p.memoizedState!==null||jl;if(!E){var F=p.alternate,Y=F!==null&&F.memoizedState!==null||Mn;F=jl;var xe=Mn;if(jl=E,(Mn=Y)&&!xe)for(Xe=p;Xe!==null;)E=Xe,Y=E.child,E.tag===22&&E.memoizedState!==null?Lp(p):Y!==null?(Y.return=E,Xe=Y):Lp(p);for(;x!==null;)Xe=x,Ap(x),x=x.sibling;Xe=p,jl=F,Mn=xe}Op(e)}else(p.subtreeFlags&8772)!==0&&x!==null?(x.return=p,Xe=x):Op(e)}}function Op(e){for(;Xe!==null;){var n=Xe;if((n.flags&8772)!==0){var s=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:Mn||Cl(5,n);break;case 1:var u=n.stateNode;if(n.flags&4&&!Mn)if(s===null)u.componentDidMount();else{var p=n.elementType===n.type?s.memoizedProps:Fr(n.type,s.memoizedProps);u.componentDidUpdate(p,s.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var x=n.updateQueue;x!==null&&Rf(n,x,u);break;case 3:var E=n.updateQueue;if(E!==null){if(s=null,n.child!==null)switch(n.child.tag){case 5:s=n.child.stateNode;break;case 1:s=n.child.stateNode}Rf(n,E,s)}break;case 5:var F=n.stateNode;if(s===null&&n.flags&4){s=F;var Y=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":Y.autoFocus&&s.focus();break;case"img":Y.src&&(s.src=Y.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var xe=n.alternate;if(xe!==null){var Te=xe.memoizedState;if(Te!==null){var $e=Te.dehydrated;$e!==null&&yo($e)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}Mn||n.flags&512&&Rc(n)}catch(Me){qt(n,n.return,Me)}}if(n===e){Xe=null;break}if(s=n.sibling,s!==null){s.return=n.return,Xe=s;break}Xe=n.return}}function Rp(e){for(;Xe!==null;){var n=Xe;if(n===e){Xe=null;break}var s=n.sibling;if(s!==null){s.return=n.return,Xe=s;break}Xe=n.return}}function Lp(e){for(;Xe!==null;){var n=Xe;try{switch(n.tag){case 0:case 11:case 15:var s=n.return;try{Cl(4,n)}catch(Y){qt(n,s,Y)}break;case 1:var u=n.stateNode;if(typeof u.componentDidMount=="function"){var p=n.return;try{u.componentDidMount()}catch(Y){qt(n,p,Y)}}var x=n.return;try{Rc(n)}catch(Y){qt(n,x,Y)}break;case 5:var E=n.return;try{Rc(n)}catch(Y){qt(n,E,Y)}}}catch(Y){qt(n,n.return,Y)}if(n===e){Xe=null;break}var F=n.sibling;if(F!==null){F.return=n.return,Xe=F;break}Xe=n.return}}var ly=Math.ceil,Pl=M.ReactCurrentDispatcher,zc=M.ReactCurrentOwner,jr=M.ReactCurrentBatchConfig,St=0,fn=null,Zt=null,kn=0,ur=0,_i=ns(0),on=0,ya=null,$s=0,Ml=0,Bc=0,xa=null,Qn=null,Fc=0,Si=1/0,Ao=null,Tl=!1,Hc=null,ls=null,Il=!1,us=null,$l=0,va=0,Vc=null,Al=-1,Ol=0;function On(){return(St&6)!==0?wt():Al!==-1?Al:Al=wt()}function cs(e){return(e.mode&1)===0?1:(St&2)!==0&&kn!==0?kn&-kn:Kg.transition!==null?(Ol===0&&(Ol=$t()),Ol):(e=bt,e!==0||(e=window.event,e=e===void 0?16:Qs(e.type)),e)}function Ur(e,n,s,u){if(50<va)throw va=0,Vc=null,Error(o(185));Ht(e,s,u),((St&2)===0||e!==fn)&&(e===fn&&((St&2)===0&&(Ml|=s),on===4&&ds(e,kn)),Gn(e,u),s===1&&St===0&&(n.mode&1)===0&&(Si=wt()+500,ul&&os()))}function Gn(e,n){var s=e.callbackNode;Je(e,n);var u=me(e,e===fn?kn:0);if(u===0)s!==null&&Gr(s),e.callbackNode=null,e.callbackPriority=0;else if(n=u&-u,e.callbackPriority!==n){if(s!=null&&Gr(s),n===1)e.tag===0?Ug(zp.bind(null,e)):Sf(zp.bind(null,e)),Bg(function(){(St&6)===0&&os()}),s=null;else{switch(ys(u)){case 1:s=vr;break;case 4:s=Tr;break;case 16:s=wr;break;case 536870912:s=mo;break;default:s=wr}s=Wp(s,Dp.bind(null,e))}e.callbackPriority=n,e.callbackNode=s}}function Dp(e,n){if(Al=-1,Ol=0,(St&6)!==0)throw Error(o(327));var s=e.callbackNode;if(Ni()&&e.callbackNode!==s)return null;var u=me(e,e===fn?kn:0);if(u===0)return null;if((u&30)!==0||(u&e.expiredLanes)!==0||n)n=Rl(e,u);else{n=u;var p=St;St|=2;var x=Fp();(fn!==e||kn!==n)&&(Ao=null,Si=wt()+500,Os(e,n));do try{dy();break}catch(F){Bp(e,F)}while(!0);ac(),Pl.current=x,St=p,Zt!==null?n=0:(fn=null,kn=0,n=on)}if(n!==0){if(n===2&&(p=jt(e),p!==0&&(u=p,n=Uc(e,p))),n===1)throw s=ya,Os(e,0),ds(e,u),Gn(e,wt()),s;if(n===6)ds(e,u);else{if(p=e.current.alternate,(u&30)===0&&!uy(p)&&(n=Rl(e,u),n===2&&(x=jt(e),x!==0&&(u=x,n=Uc(e,x))),n===1))throw s=ya,Os(e,0),ds(e,u),Gn(e,wt()),s;switch(e.finishedWork=p,e.finishedLanes=u,n){case 0:case 1:throw Error(o(345));case 2:Rs(e,Qn,Ao);break;case 3:if(ds(e,u),(u&130023424)===u&&(n=Fc+500-wt(),10<n)){if(me(e,0)!==0)break;if(p=e.suspendedLanes,(p&u)!==u){On(),e.pingedLanes|=e.suspendedLanes&p;break}e.timeoutHandle=Qu(Rs.bind(null,e,Qn,Ao),n);break}Rs(e,Qn,Ao);break;case 4:if(ds(e,u),(u&4194240)===u)break;for(n=e.eventTimes,p=-1;0<u;){var E=31-ln(u);x=1<<E,E=n[E],E>p&&(p=E),u&=~x}if(u=p,u=wt()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*ly(u/1960))-u,10<u){e.timeoutHandle=Qu(Rs.bind(null,e,Qn,Ao),u);break}Rs(e,Qn,Ao);break;case 5:Rs(e,Qn,Ao);break;default:throw Error(o(329))}}}return Gn(e,wt()),e.callbackNode===s?Dp.bind(null,e):null}function Uc(e,n){var s=xa;return e.current.memoizedState.isDehydrated&&(Os(e,n).flags|=256),e=Rl(e,n),e!==2&&(n=Qn,Qn=s,n!==null&&Kc(n)),e}function Kc(e){Qn===null?Qn=e:Qn.push.apply(Qn,e)}function uy(e){for(var n=e;;){if(n.flags&16384){var s=n.updateQueue;if(s!==null&&(s=s.stores,s!==null))for(var u=0;u<s.length;u++){var p=s[u],x=p.getSnapshot;p=p.value;try{if(!ce(x(),p))return!1}catch{return!1}}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;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 ds(e,n){for(n&=~Bc,n&=~Ml,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var s=31-ln(n),u=1<<s;e[s]=-1,n&=~u}}function zp(e){if((St&6)!==0)throw Error(o(327));Ni();var n=me(e,0);if((n&1)===0)return Gn(e,wt()),null;var s=Rl(e,n);if(e.tag!==0&&s===2){var u=jt(e);u!==0&&(n=u,s=Uc(e,u))}if(s===1)throw s=ya,Os(e,0),ds(e,n),Gn(e,wt()),s;if(s===6)throw Error(o(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,Rs(e,Qn,Ao),Gn(e,wt()),null}function qc(e,n){var s=St;St|=1;try{return e(n)}finally{St=s,St===0&&(Si=wt()+500,ul&&os())}}function As(e){us!==null&&us.tag===0&&(St&6)===0&&Ni();var n=St;St|=1;var s=jr.transition,u=bt;try{if(jr.transition=null,bt=1,e)return e()}finally{bt=u,jr.transition=s,St=n,(St&6)===0&&os()}}function Wc(){ur=_i.current,Rt(_i)}function Os(e,n){e.finishedWork=null,e.finishedLanes=0;var s=e.timeoutHandle;if(s!==-1&&(e.timeoutHandle=-1,zg(s)),Zt!==null)for(s=Zt.return;s!==null;){var u=s;switch(nc(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&al();break;case 3:wi(),Rt(Wn),Rt(jn),mc();break;case 5:pc(u);break;case 4:wi();break;case 13:Rt(Ut);break;case 19:Rt(Ut);break;case 10:lc(u.type._context);break;case 22:case 23:Wc()}s=s.return}if(fn=e,Zt=e=fs(e.current,null),kn=ur=n,on=0,ya=null,Bc=Ml=$s=0,Qn=xa=null,Ms!==null){for(n=0;n<Ms.length;n++)if(s=Ms[n],u=s.interleaved,u!==null){s.interleaved=null;var p=u.next,x=s.pending;if(x!==null){var E=x.next;x.next=p,u.next=E}s.pending=u}Ms=null}return e}function Bp(e,n){do{var s=Zt;try{if(ac(),vl.current=_l,wl){for(var u=Kt.memoizedState;u!==null;){var p=u.queue;p!==null&&(p.pending=null),u=u.next}wl=!1}if(Is=0,dn=rn=Kt=null,da=!1,fa=0,zc.current=null,s===null||s.return===null){on=1,ya=n,Zt=null;break}e:{var x=e,E=s.return,F=s,Y=n;if(n=kn,F.flags|=32768,Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var xe=Y,Te=F,$e=Te.tag;if((Te.mode&1)===0&&($e===0||$e===11||$e===15)){var Me=Te.alternate;Me?(Te.updateQueue=Me.updateQueue,Te.memoizedState=Me.memoizedState,Te.lanes=Me.lanes):(Te.updateQueue=null,Te.memoizedState=null)}var qe=dp(E);if(qe!==null){qe.flags&=-257,fp(qe,E,F,x,n),qe.mode&1&&cp(x,xe,n),n=qe,Y=xe;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){cp(x,xe,n),Yc();break e}Y=Error(o(426))}}else if(Bt&&F.mode&1){var Qt=dp(E);if(Qt!==null){(Qt.flags&65536)===0&&(Qt.flags|=256),fp(Qt,E,F,x,n),sc(bi(Y,F));break e}}x=Y=bi(Y,F),on!==4&&(on=2),xa===null?xa=[x]:xa.push(x),x=E;do{switch(x.tag){case 3:x.flags|=65536,n&=-n,x.lanes|=n;var he=lp(x,Y,n);Of(x,he);break e;case 1:F=Y;var re=x.type,ge=x.stateNode;if((x.flags&128)===0&&(typeof re.getDerivedStateFromError=="function"||ge!==null&&typeof ge.componentDidCatch=="function"&&(ls===null||!ls.has(ge)))){x.flags|=65536,n&=-n,x.lanes|=n;var Be=up(x,F,n);Of(x,Be);break e}}x=x.return}while(x!==null)}Vp(s)}catch(et){n=et,Zt===s&&s!==null&&(Zt=s=s.return);continue}break}while(!0)}function Fp(){var e=Pl.current;return Pl.current=_l,e===null?_l:e}function Yc(){(on===0||on===3||on===2)&&(on=4),fn===null||($s&268435455)===0&&(Ml&268435455)===0||ds(fn,kn)}function Rl(e,n){var s=St;St|=2;var u=Fp();(fn!==e||kn!==n)&&(Ao=null,Os(e,n));do try{cy();break}catch(p){Bp(e,p)}while(!0);if(ac(),St=s,Pl.current=u,Zt!==null)throw Error(o(261));return fn=null,kn=0,on}function cy(){for(;Zt!==null;)Hp(Zt)}function dy(){for(;Zt!==null&&!Mt();)Hp(Zt)}function Hp(e){var n=qp(e.alternate,e,ur);e.memoizedProps=e.pendingProps,n===null?Vp(e):Zt=n,zc.current=null}function Vp(e){var n=e;do{var s=n.alternate;if(e=n.return,(n.flags&32768)===0){if(s=ry(s,n,ur),s!==null){Zt=s;return}}else{if(s=oy(s,n),s!==null){s.flags&=32767,Zt=s;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{on=6,Zt=null;return}}if(n=n.sibling,n!==null){Zt=n;return}Zt=n=e}while(n!==null);on===0&&(on=5)}function Rs(e,n,s){var u=bt,p=jr.transition;try{jr.transition=null,bt=1,fy(e,n,s,u)}finally{jr.transition=p,bt=u}return null}function fy(e,n,s,u){do Ni();while(us!==null);if((St&6)!==0)throw Error(o(327));s=e.finishedWork;var p=e.finishedLanes;if(s===null)return null;if(e.finishedWork=null,e.finishedLanes=0,s===e.current)throw Error(o(177));e.callbackNode=null,e.callbackPriority=0;var x=s.lanes|s.childLanes;if(Xt(e,x),e===fn&&(Zt=fn=null,kn=0),(s.subtreeFlags&2064)===0&&(s.flags&2064)===0||Il||(Il=!0,Wp(wr,function(){return Ni(),null})),x=(s.flags&15990)!==0,(s.subtreeFlags&15990)!==0||x){x=jr.transition,jr.transition=null;var E=bt;bt=1;var F=St;St|=4,zc.current=null,iy(e,s),$p(s,e),ae(Yu),Xs=!!Wu,Yu=Wu=null,e.current=s,ay(s),Vn(),St=F,bt=E,jr.transition=x}else e.current=s;if(Il&&(Il=!1,us=e,$l=p),x=e.pendingLanes,x===0&&(ls=null),ht(s.stateNode),Gn(e,wt()),n!==null)for(u=e.onRecoverableError,s=0;s<n.length;s++)p=n[s],u(p.value,{componentStack:p.stack,digest:p.digest});if(Tl)throw Tl=!1,e=Hc,Hc=null,e;return($l&1)!==0&&e.tag!==0&&Ni(),x=e.pendingLanes,(x&1)!==0?e===Vc?va++:(va=0,Vc=e):va=0,os(),null}function Ni(){if(us!==null){var e=ys($l),n=jr.transition,s=bt;try{if(jr.transition=null,bt=16>e?16:e,us===null)var u=!1;else{if(e=us,us=null,$l=0,(St&6)!==0)throw Error(o(331));var p=St;for(St|=4,Xe=e.current;Xe!==null;){var x=Xe,E=x.child;if((Xe.flags&16)!==0){var F=x.deletions;if(F!==null){for(var Y=0;Y<F.length;Y++){var xe=F[Y];for(Xe=xe;Xe!==null;){var Te=Xe;switch(Te.tag){case 0:case 11:case 15:ga(8,Te,x)}var $e=Te.child;if($e!==null)$e.return=Te,Xe=$e;else for(;Xe!==null;){Te=Xe;var Me=Te.sibling,qe=Te.return;if(Cp(Te),Te===xe){Xe=null;break}if(Me!==null){Me.return=qe,Xe=Me;break}Xe=qe}}}var Qe=x.alternate;if(Qe!==null){var Ge=Qe.child;if(Ge!==null){Qe.child=null;do{var Qt=Ge.sibling;Ge.sibling=null,Ge=Qt}while(Ge!==null)}}Xe=x}}if((x.subtreeFlags&2064)!==0&&E!==null)E.return=x,Xe=E;else e:for(;Xe!==null;){if(x=Xe,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:ga(9,x,x.return)}var he=x.sibling;if(he!==null){he.return=x.return,Xe=he;break e}Xe=x.return}}var re=e.current;for(Xe=re;Xe!==null;){E=Xe;var ge=E.child;if((E.subtreeFlags&2064)!==0&&ge!==null)ge.return=E,Xe=ge;else e:for(E=re;Xe!==null;){if(F=Xe,(F.flags&2048)!==0)try{switch(F.tag){case 0:case 11:case 15:Cl(9,F)}}catch(et){qt(F,F.return,et)}if(F===E){Xe=null;break e}var Be=F.sibling;if(Be!==null){Be.return=F.return,Xe=Be;break e}Xe=F.return}}if(St=p,os(),gn&&typeof gn.onPostCommitFiberRoot=="function")try{gn.onPostCommitFiberRoot(Un,e)}catch{}u=!0}return u}finally{bt=s,jr.transition=n}}return!1}function Up(e,n,s){n=bi(s,n),n=lp(e,n,1),e=is(e,n,1),n=On(),e!==null&&(Ht(e,1,n),Gn(e,n))}function qt(e,n,s){if(e.tag===3)Up(e,e,s);else for(;n!==null;){if(n.tag===3){Up(n,e,s);break}else if(n.tag===1){var u=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(ls===null||!ls.has(u))){e=bi(s,e),e=up(n,e,1),n=is(n,e,1),e=On(),n!==null&&(Ht(n,1,e),Gn(n,e));break}}n=n.return}}function py(e,n,s){var u=e.pingCache;u!==null&&u.delete(n),n=On(),e.pingedLanes|=e.suspendedLanes&s,fn===e&&(kn&s)===s&&(on===4||on===3&&(kn&130023424)===kn&&500>wt()-Fc?Os(e,0):Bc|=s),Gn(e,n)}function Kp(e,n){n===0&&((e.mode&1)===0?n=1:(n=kr,kr<<=1,(kr&130023424)===0&&(kr=4194304)));var s=On();e=To(e,n),e!==null&&(Ht(e,n,s),Gn(e,s))}function hy(e){var n=e.memoizedState,s=0;n!==null&&(s=n.retryLane),Kp(e,s)}function my(e,n){var s=0;switch(e.tag){case 13:var u=e.stateNode,p=e.memoizedState;p!==null&&(s=p.retryLane);break;case 19:u=e.stateNode;break;default:throw Error(o(314))}u!==null&&u.delete(n),Kp(e,s)}var qp;qp=function(e,n,s){if(e!==null)if(e.memoizedProps!==n.pendingProps||Wn.current)Xn=!0;else{if((e.lanes&s)===0&&(n.flags&128)===0)return Xn=!1,ny(e,n,s);Xn=(e.flags&131072)!==0}else Xn=!1,Bt&&(n.flags&1048576)!==0&&Nf(n,dl,n.index);switch(n.lanes=0,n.tag){case 2:var u=n.type;El(e,n),e=n.pendingProps;var p=pi(n,jn.current);vi(n,s),p=xc(null,n,u,e,p,s);var x=vc();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,Yn(u)?(x=!0,ll(n)):x=!1,n.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,dc(n),p.updater=Sl,n.stateNode=p,p._reactInternals=n,Nc(n,u,e,s),n=Pc(null,n,u,!0,x,s)):(n.tag=0,Bt&&x&&tc(n),An(null,n,p,s),n=n.child),n;case 16:u=n.elementType;e:{switch(El(e,n),e=n.pendingProps,p=u._init,u=p(u._payload),n.type=u,p=n.tag=yy(u),e=Fr(u,e),p){case 0:n=Cc(null,n,u,e,s);break e;case 1:n=xp(null,n,u,e,s);break e;case 11:n=pp(null,n,u,e,s);break e;case 14:n=hp(null,n,u,Fr(u.type,e),s);break e}throw Error(o(306,u,""))}return n;case 0:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Fr(u,p),Cc(e,n,u,p,s);case 1:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Fr(u,p),xp(e,n,u,p,s);case 3:e:{if(vp(n),e===null)throw Error(o(387));u=n.pendingProps,x=n.memoizedState,p=x.element,Af(e,n),yl(n,u,null,s);var E=n.memoizedState;if(u=E.element,x.isDehydrated)if(x={element:u,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},n.updateQueue.baseState=x,n.memoizedState=x,n.flags&256){p=bi(Error(o(423)),n),n=wp(e,n,u,s,p);break e}else if(u!==p){p=bi(Error(o(424)),n),n=wp(e,n,u,s,p);break e}else for(lr=ts(n.stateNode.containerInfo.firstChild),ar=n,Bt=!0,Br=null,s=If(n,null,u,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(gi(),u===p){n=$o(e,n,s);break e}An(e,n,u,s)}n=n.child}return n;case 5:return Lf(n),e===null&&oc(n),u=n.type,p=n.pendingProps,x=e!==null?e.memoizedProps:null,E=p.children,Xu(u,p)?E=null:x!==null&&Xu(u,x)&&(n.flags|=32),yp(e,n),An(e,n,E,s),n.child;case 6:return e===null&&oc(n),null;case 13:return bp(e,n,s);case 4:return fc(n,n.stateNode.containerInfo),u=n.pendingProps,e===null?n.child=yi(n,null,u,s):An(e,n,u,s),n.child;case 11:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Fr(u,p),pp(e,n,u,p,s);case 7:return An(e,n,n.pendingProps,s),n.child;case 8:return An(e,n,n.pendingProps.children,s),n.child;case 12:return An(e,n,n.pendingProps.children,s),n.child;case 10:e:{if(u=n.type._context,p=n.pendingProps,x=n.memoizedProps,E=p.value,Tt(hl,u._currentValue),u._currentValue=E,x!==null)if(ce(x.value,E)){if(x.children===p.children&&!Wn.current){n=$o(e,n,s);break e}}else for(x=n.child,x!==null&&(x.return=n);x!==null;){var F=x.dependencies;if(F!==null){E=x.child;for(var Y=F.firstContext;Y!==null;){if(Y.context===u){if(x.tag===1){Y=Io(-1,s&-s),Y.tag=2;var xe=x.updateQueue;if(xe!==null){xe=xe.shared;var Te=xe.pending;Te===null?Y.next=Y:(Y.next=Te.next,Te.next=Y),xe.pending=Y}}x.lanes|=s,Y=x.alternate,Y!==null&&(Y.lanes|=s),uc(x.return,s,n),F.lanes|=s;break}Y=Y.next}}else if(x.tag===10)E=x.type===n.type?null:x.child;else if(x.tag===18){if(E=x.return,E===null)throw Error(o(341));E.lanes|=s,F=E.alternate,F!==null&&(F.lanes|=s),uc(E,s,n),E=x.sibling}else E=x.child;if(E!==null)E.return=x;else for(E=x;E!==null;){if(E===n){E=null;break}if(x=E.sibling,x!==null){x.return=E.return,E=x;break}E=E.return}x=E}An(e,n,p.children,s),n=n.child}return n;case 9:return p=n.type,u=n.pendingProps.children,vi(n,s),p=Nr(p),u=u(p),n.flags|=1,An(e,n,u,s),n.child;case 14:return u=n.type,p=Fr(u,n.pendingProps),p=Fr(u.type,p),hp(e,n,u,p,s);case 15:return mp(e,n,n.type,n.pendingProps,s);case 17:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Fr(u,p),El(e,n),n.tag=1,Yn(u)?(e=!0,ll(n)):e=!1,vi(n,s),ip(n,u,p),Nc(n,u,p,s),Pc(null,n,u,!0,e,s);case 19:return _p(e,n,s);case 22:return gp(e,n,s)}throw Error(o(156,n.tag))};function Wp(e,n){return ho(e,n)}function gy(e,n,s,u){this.tag=e,this.key=s,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=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Cr(e,n,s,u){return new gy(e,n,s,u)}function Xc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function yy(e){if(typeof e=="function")return Xc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===de)return 11;if(e===ue)return 14}return 2}function fs(e,n){var s=e.alternate;return s===null?(s=Cr(e.tag,n,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=n,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&14680064,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,n=e.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s}function Ll(e,n,s,u,p,x){var E=2;if(u=e,typeof e=="function")Xc(e)&&(E=1);else if(typeof e=="string")E=5;else e:switch(e){case W:return Ls(s.children,p,x,n);case Z:E=8,p|=8;break;case fe:return e=Cr(12,s,n,p|2),e.elementType=fe,e.lanes=x,e;case be:return e=Cr(13,s,n,p),e.elementType=be,e.lanes=x,e;case z:return e=Cr(19,s,n,p),e.elementType=z,e.lanes=x,e;case ie:return Dl(s,p,x,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Se:E=10;break e;case X:E=9;break e;case de:E=11;break e;case ue:E=14;break e;case Q:E=16,u=null;break e}throw Error(o(130,e==null?e:typeof e,""))}return n=Cr(E,s,n,p),n.elementType=e,n.type=u,n.lanes=x,n}function Ls(e,n,s,u){return e=Cr(7,e,u,n),e.lanes=s,e}function Dl(e,n,s,u){return e=Cr(22,e,u,n),e.elementType=ie,e.lanes=s,e.stateNode={isHidden:!1},e}function Qc(e,n,s){return e=Cr(6,e,null,n),e.lanes=s,e}function Gc(e,n,s){return n=Cr(4,e.children!==null?e.children:[],e.key,n),n.lanes=s,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function xy(e,n,s,u,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=Yt(0),this.expirationTimes=Yt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yt(0),this.identifierPrefix=u,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function Jc(e,n,s,u,p,x,E,F,Y){return e=new xy(e,n,s,F,Y),n===1?(n=1,x===!0&&(n|=8)):n=0,x=Cr(3,null,null,n),e.current=x,x.stateNode=e,x.memoizedState={element:u,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},dc(x),e}function vy(e,n,s){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:U,key:u==null?null:""+u,children:e,containerInfo:n,implementation:s}}function Yp(e){if(!e)return rs;e=e._reactInternals;e:{if(Wt(e)!==e||e.tag!==1)throw Error(o(170));var n=e;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(Yn(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(o(171))}if(e.tag===1){var s=e.type;if(Yn(s))return kf(e,s,n)}return n}function Xp(e,n,s,u,p,x,E,F,Y){return e=Jc(s,u,!0,e,p,x,E,F,Y),e.context=Yp(null),s=e.current,u=On(),p=cs(s),x=Io(u,p),x.callback=n??null,is(s,x,p),e.current.lanes=p,Ht(e,p,u),Gn(e,u),e}function zl(e,n,s,u){var p=n.current,x=On(),E=cs(p);return s=Yp(s),n.context===null?n.context=s:n.pendingContext=s,n=Io(x,E),n.payload={element:e},u=u===void 0?null:u,u!==null&&(n.callback=u),e=is(p,n,E),e!==null&&(Ur(e,p,E,x),gl(e,p,E)),E}function Bl(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 Qp(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<n?s:n}}function Zc(e,n){Qp(e,n),(e=e.alternate)&&Qp(e,n)}function wy(){return null}var Gp=typeof reportError=="function"?reportError:function(e){console.error(e)};function ed(e){this._internalRoot=e}Fl.prototype.render=ed.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(o(409));zl(e,n,null,null)},Fl.prototype.unmount=ed.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;As(function(){zl(null,e,null,null)}),n[jo]=null}};function Fl(e){this._internalRoot=e}Fl.prototype.unstable_scheduleHydration=function(e){if(e){var n=Ka();e={blockedOn:null,target:e,priority:n};for(var s=0;s<Kn.length&&n!==0&&n<Kn[s].priority;s++);Kn.splice(s,0,e),s===0&&ir(e)}};function td(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Hl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Jp(){}function by(e,n,s,u,p){if(p){if(typeof u=="function"){var x=u;u=function(){var xe=Bl(E);x.call(xe)}}var E=Xp(n,u,e,0,null,!1,!1,"",Jp);return e._reactRootContainer=E,e[jo]=E.current,ra(e.nodeType===8?e.parentNode:e),As(),E}for(;p=e.lastChild;)e.removeChild(p);if(typeof u=="function"){var F=u;u=function(){var xe=Bl(Y);F.call(xe)}}var Y=Jc(e,0,!1,null,null,!1,!1,"",Jp);return e._reactRootContainer=Y,e[jo]=Y.current,ra(e.nodeType===8?e.parentNode:e),As(function(){zl(n,Y,s,u)}),Y}function Vl(e,n,s,u,p){var x=s._reactRootContainer;if(x){var E=x;if(typeof p=="function"){var F=p;p=function(){var Y=Bl(E);F.call(Y)}}zl(n,E,e,p)}else E=by(s,n,e,p,u);return Bl(E)}gt=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var s=L(n.pendingLanes);s!==0&&(yn(n,s|1),Gn(n,wt()),(St&6)===0&&(Si=wt()+500,os()))}break;case 13:As(function(){var u=To(e,1);if(u!==null){var p=On();Ur(u,e,1,p)}}),Zc(e,1)}},Ir=function(e){if(e.tag===13){var n=To(e,134217728);if(n!==null){var s=On();Ur(n,e,134217728,s)}Zc(e,134217728)}},Ws=function(e){if(e.tag===13){var n=cs(e),s=To(e,n);if(s!==null){var u=On();Ur(s,e,n,u)}Zc(e,n)}},Ka=function(){return bt},Nn=function(e,n){var s=bt;try{return bt=e,n()}finally{bt=s}},Ve=function(e,n,s){switch(n){case"input":if(tt(e,s),n=s.name,s.type==="radio"&&n!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<s.length;n++){var u=s[n];if(u!==e&&u.form===e.form){var p=il(u);if(!p)throw Error(o(90));He(u),tt(u,p)}}}break;case"textarea":fr(e,s);break;case"select":n=s.value,n!=null&&vt(e,!!s.multiple,n,!1)}},mr=qc,Fo=As;var ky={usingClientEntryPoint:!1,Events:[ia,di,il,fo,er,qc]},wa={findFiberByHostInstance:Es,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},_y={bundleType:wa.bundleType,version:wa.version,rendererPackageName:wa.rendererPackageName,rendererConfig:wa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:M.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Mr(e),e===null?null:e.stateNode},findFiberByHostInstance:wa.findFiberByHostInstance||wy,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 Ul=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ul.isDisabled&&Ul.supportsFiber)try{Un=Ul.inject(_y),gn=Ul}catch{}}return Jn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ky,Jn.createPortal=function(e,n){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!td(n))throw Error(o(200));return vy(e,n,null,s)},Jn.createRoot=function(e,n){if(!td(e))throw Error(o(299));var s=!1,u="",p=Gp;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onRecoverableError!==void 0&&(p=n.onRecoverableError)),n=Jc(e,1,!1,null,null,s,!1,u,p),e[jo]=n.current,ra(e.nodeType===8?e.parentNode:e),new ed(n)},Jn.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(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=Mr(n),e=e===null?null:e.stateNode,e},Jn.flushSync=function(e){return As(e)},Jn.hydrate=function(e,n,s){if(!Hl(n))throw Error(o(200));return Vl(null,e,n,!0,s)},Jn.hydrateRoot=function(e,n,s){if(!td(e))throw Error(o(405));var u=s!=null&&s.hydratedSources||null,p=!1,x="",E=Gp;if(s!=null&&(s.unstable_strictMode===!0&&(p=!0),s.identifierPrefix!==void 0&&(x=s.identifierPrefix),s.onRecoverableError!==void 0&&(E=s.onRecoverableError)),n=Xp(n,null,e,1,s??null,p,!1,x,E),e[jo]=n.current,ra(e),u)for(e=0;e<u.length;e++)s=u[e],p=s._getVersion,p=p(s._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[s,p]:n.mutableSourceEagerHydrationData.push(s,p);return new Fl(n)},Jn.render=function(e,n,s){if(!Hl(n))throw Error(o(200));return Vl(null,e,n,!1,s)},Jn.unmountComponentAtNode=function(e){if(!Hl(e))throw Error(o(40));return e._reactRootContainer?(As(function(){Vl(null,null,e,!1,function(){e._reactRootContainer=null,e[jo]=null})}),!0):!1},Jn.unstable_batchedUpdates=qc,Jn.unstable_renderSubtreeIntoContainer=function(e,n,s,u){if(!Hl(s))throw Error(o(200));if(e==null||e._reactInternals===void 0)throw Error(o(38));return Vl(e,n,s,!1,u)},Jn.version="18.3.1-next-f1338f8080-20240426",Jn}var ih;function Pm(){if(ih)return od.exports;ih=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(),od.exports=$y(),od.exports}var ah;function Ay(){if(ah)return Kl;ah=1;var t=Pm();return Kl.createRoot=t.createRoot,Kl.hydrateRoot=t.hydrateRoot,Kl}var Oy=Ay();const Ry=Nu(Oy);function ad(t){if(!t||typeof t!="object")throw new Error("OpenAPI: expected object");const r=t;if(r.openapi!=="3.0.0"&&r.openapi!=="3.0.1"&&r.openapi!=="3.0.2"&&r.openapi!=="3.0.3"&&!(typeof r.openapi=="string"&&r.openapi.startsWith("3.0."))){if(!(typeof r.openapi=="string"&&r.openapi.startsWith("3.1")))throw new Error(`OpenAPI: unsupported openapi field: ${String(r.openapi)}`)}if(!r.info||typeof r.info!="object")throw new Error("OpenAPI: missing info");if(!r.paths||typeof r.paths!="object")throw new Error("OpenAPI: missing paths")}const Ly="x-api-doc-tor-llm-key";function ou(t){switch(t){case"anthropic":return"claude-sonnet-4-20250514";case"openai":return"gpt-4o-mini";case"openrouter":return"openai/gpt-4o-mini";default:return"gpt-4o-mini"}}const Dy=["get","post","put","patch","delete","options","head","trace"];function lh(t){return t.replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_|_$/g,"").replace(/_+/g,"_")}function Eu(t,r,o,i){if(o)return lh(o).replace(/^[0-9]/,"_$&")||`op_${i}`;const l=lh(r.replace(/[{}]/g,""));return`${t}_${l}`||`op_${i}`}function ju(t){var i;return`${(((i=t.info)==null?void 0:i.title)??"Api").replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).filter(Boolean).map(l=>l.charAt(0).toUpperCase()+l.slice(1).toLowerCase()).join("")||"Api"}Client`}function Cu(t){return(t.split(/[^a-zA-Z0-9]+/).filter(Boolean).map(o=>o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()).join("")||"Api")+"Service"}function uo(t){const r=[];if(!t.paths)return r;for(const[o,i]of Object.entries(t.paths)){if(!i||typeof i!="object"||"$ref"in i)continue;const l=i;for(const c of Dy){const f=l[c];f&&typeof f=="object"&&r.push({method:c,path:o,operationId:f.operationId,tags:f.tags})}}return r}function zy(t,r,o,i="baseUrl"){var c,f;const l=r.toUpperCase();return`const ${i} = "${((f=(c=t.servers)==null?void 0:c[0])==null?void 0:f.url)??"http://localhost:3000"}";
|
|
41
|
+
/** @returns {Promise<unknown>} */
|
|
42
|
+
const res = await fetch(\`${i}${o}\`, {
|
|
43
|
+
method: "${l}",
|
|
44
|
+
headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
|
|
45
|
+
${l==="GET"||l==="HEAD"?"":"body: JSON.stringify({}),"}
|
|
46
|
+
});
|
|
47
|
+
const data = await res.json();
|
|
48
|
+
`}function Mm(t,r){const o=t.map((i,l)=>` /**
|
|
49
|
+
* @param {{ headers?: Record<string, string> }} [options]
|
|
50
|
+
* @returns {Promise<unknown>}
|
|
51
|
+
*/
|
|
52
|
+
async ${Eu(i.method,i.path,i.operationId,l)}(options) {
|
|
53
|
+
const res = await fetch(\`\${this.baseUrl}${i.path}\`, {
|
|
54
|
+
method: "${i.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
|
+
${o.join(`
|
|
69
|
+
|
|
70
|
+
`)}
|
|
71
|
+
}
|
|
72
|
+
`}function By(t){return Mm(uo(t),ju(t))}function Fy(t,r){const o=Cu(r),i=uo(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return Mm(i,o)}function Hy(t,r,o){var c,f;const i=((f=(c=t.servers)==null?void 0:c[0])==null?void 0:f.url)??"http://localhost:3000",l=r.toUpperCase();return`<?php
|
|
73
|
+
$baseUrl = '${i}';
|
|
74
|
+
$url = $baseUrl . '${o}';
|
|
75
|
+
$opts = [
|
|
76
|
+
'http' => [
|
|
77
|
+
'method' => '${l}',
|
|
78
|
+
'header' => "Content-Type: application/json\\r\\nAuthorization: Bearer {$token}\\r\\n",
|
|
79
|
+
${l==="GET"||l==="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 Tm(t,r){const o=t.map((i,l)=>` public function ${Eu(i.method,i.path,i.operationId,l)}(array $extraHeaders = []): array
|
|
86
|
+
{
|
|
87
|
+
$url = $this->baseUrl . '${i.path}';
|
|
88
|
+
$headers = array_merge($this->defaultHeaders, $extraHeaders);
|
|
89
|
+
$opts = [
|
|
90
|
+
'http' => [
|
|
91
|
+
'method' => '${i.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
|
+
${o.join(`
|
|
123
|
+
|
|
124
|
+
`)}
|
|
125
|
+
}
|
|
126
|
+
`}function Vy(t){return Tm(uo(t),ju(t))}function Uy(t,r){const o=Cu(r),i=uo(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return Tm(i,o)}function Ky(t,r,o){var f,m;const i=((m=(f=t.servers)==null?void 0:f[0])==null?void 0:m.url)??"http://localhost:3000",l=r.toLowerCase();return`import httpx
|
|
127
|
+
|
|
128
|
+
base_url = "${i}"
|
|
129
|
+
url = f"{base_url}${o}"
|
|
130
|
+
headers = {"Authorization": f"Bearer {token}"}
|
|
131
|
+
with httpx.Client() as client:
|
|
132
|
+
response = client.${l}(url, headers=headers${l==="get"||l==="head"?"":", json={}"})
|
|
133
|
+
data = response.json()
|
|
134
|
+
`}function Im(t,r){const o=t.map((i,l)=>{const c=Eu(i.method,i.path,i.operationId,l),f=i.method.toLowerCase(),m=f==="get"||f==="head"?"":", json={}";return` def ${c}(self, headers: dict | None = None) -> dict:
|
|
135
|
+
h = {**self.default_headers, **(headers or {})}
|
|
136
|
+
r = self._client.${f}(f"{self.base_url}${i.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
|
+
${o.join(`
|
|
150
|
+
|
|
151
|
+
`)}
|
|
152
|
+
`}function qy(t){return Im(uo(t),ju(t))}function Wy(t,r){const o=Cu(r),i=uo(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return Im(i,o)}function Yy(t){const r=t.split("/");return(r[r.length-1]??"Unknown").replace(/[^a-zA-Z0-9_]/g,"_")}function Nd(t){if(!t)return"unknown";if("$ref"in t&&t.$ref)return Yy(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?`${Nd(r.items)}[]`:r.type==="object"&&r.properties?`{
|
|
153
|
+
${Object.entries(r.properties).map(([i,l])=>` ${JSON.stringify(i)}?: ${Nd(l)};`).join(`
|
|
154
|
+
`)}
|
|
155
|
+
}`:"Record<string, unknown>"}function Xy(t,r,o,i="baseUrl"){var b,_,v,k,j,C;const l=(_=(b=t.paths)==null?void 0:b[o])==null?void 0:_[r],c=l==null?void 0:l.requestBody;let f;if((k=(v=c==null?void 0:c.content)==null?void 0:v["application/json"])!=null&&k.schema){const I=c.content["application/json"].schema;I&&!("$ref"in I)&&(f=I)}const m=f?Nd(f):"Record<string, unknown>",y=r.toUpperCase();return`const ${i} = "${((C=(j=t.servers)==null?void 0:j[0])==null?void 0:C.url)??"http://localhost:3000"}";
|
|
156
|
+
const res = await fetch(\`${i}${o}\`, {
|
|
157
|
+
method: "${y}",
|
|
158
|
+
headers: { "Content-Type": "application/json", Authorization: \`Bearer \${token}\` },
|
|
159
|
+
${y==="GET"||y==="HEAD"?"":`body: JSON.stringify({} as ${m}),`}
|
|
160
|
+
});
|
|
161
|
+
const data = await res.json() as unknown;
|
|
162
|
+
`}function $m(t,r){const o=t.map((i,l)=>` async ${Eu(i.method,i.path,i.operationId,l)}(options?: { headers?: Record<string, string> }): Promise<unknown> {
|
|
163
|
+
const res = await fetch(\`\${this.baseUrl}${i.path}\`, {
|
|
164
|
+
method: "${i.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
|
+
${o.join(`
|
|
175
|
+
|
|
176
|
+
`)}
|
|
177
|
+
}
|
|
178
|
+
`}function Qy(t){const r=uo(t),o=ju(t);return $m(r,o)}function Gy(t,r){const o=Cu(r),i=uo(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return $m(i,o)}function Jy(t,r,o,i){switch(r){case"typescript":return Xy(t,o,i);case"javascript":return zy(t,o,i);case"python":return Ky(t,o,i);case"php":return Hy(t,o,i);default:{const l=r;throw new Error(`Unsupported language: ${l}`)}}}function Zy(t,r,o){switch(r){case"typescript":return Gy(t,o);case"javascript":return Fy(t,o);case"python":return Wy(t,o);case"php":return Uy(t,o);default:{const i=r;throw new Error(`Unsupported language: ${i}`)}}}function ex(t,r,o){if(o===null)switch(r){case"typescript":return Qy(t);case"javascript":return By(t);case"python":return qy(t);case"php":return Vy(t);default:{const i=r;throw new Error(`Unsupported language: ${i}`)}}return Zy(t,r,o)}function tx(t){const r=new Set;for(const o of uo(t))for(const i of o.tags??[])r.add(i);return r.size===0&&r.add("default"),[...r].sort()}function Ro(t,r){var o,i,l;return r!=null&&r.trim()?r.replace(/\/$/,""):((l=(i=(o=t.servers)==null?void 0:o[0])==null?void 0:i.url)==null?void 0:l.replace(/\/$/,""))??window.location.origin}function nx(t){var o;const r=(o=t.components)==null?void 0:o.securitySchemes;return r?Object.keys(r):[]}function Vd(t,r){if(!r.startsWith("$"))return;let o=t;const i=r.slice(1);if(i.startsWith(".")){for(const l of i.slice(1).split("."))if(o&&typeof o=="object"&&l in o)o=o[l];else return;return o}return o}var su={exports:{}},rx=su.exports,uh;function ox(){return uh||(uh=1,(function(t,r){((o,i)=>{t.exports=i()})(rx,function(){var o=function(a,d){return(o=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(g,w){g.__proto__=w}:function(g,w){for(var S in w)Object.prototype.hasOwnProperty.call(w,S)&&(g[S]=w[S])}))(a,d)},i=function(){return(i=Object.assign||function(a){for(var d,g=1,w=arguments.length;g<w;g++)for(var S in d=arguments[g])Object.prototype.hasOwnProperty.call(d,S)&&(a[S]=d[S]);return a}).apply(this,arguments)};function l(a,d,g){for(var w,S=0,N=d.length;S<N;S++)!w&&S in d||((w=w||Array.prototype.slice.call(d,0,S))[S]=d[S]);return a.concat(w||Array.prototype.slice.call(d))}var c=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:jy,f=Object.keys,m=Array.isArray;function y(a,d){return typeof d=="object"&&f(d).forEach(function(g){a[g]=d[g]}),a}typeof Promise>"u"||c.Promise||(c.Promise=Promise);var b=Object.getPrototypeOf,_={}.hasOwnProperty;function v(a,d){return _.call(a,d)}function k(a,d){typeof d=="function"&&(d=d(b(a))),(typeof Reflect>"u"?f:Reflect.ownKeys)(d).forEach(function(g){C(a,g,d[g])})}var j=Object.defineProperty;function C(a,d,g,w){j(a,d,y(g&&v(g,"get")&&typeof g.get=="function"?{get:g.get,set:g.set,configurable:!0}:{value:g,configurable:!0,writable:!0},w))}function I(a){return{from:function(d){return a.prototype=Object.create(d.prototype),C(a.prototype,"constructor",a),{extend:k.bind(null,a.prototype)}}}}var A=Object.getOwnPropertyDescriptor,T=[].slice;function V(a,d,g){return T.call(a,d,g)}function P(a,d){return d(a)}function M(a){if(!a)throw new Error("Assertion Failed")}function B(a){c.setImmediate?setImmediate(a):setTimeout(a,0)}function U(a,d){if(typeof d=="string"&&v(a,d))return a[d];if(!d)return a;if(typeof d!="string"){for(var g=[],w=0,S=d.length;w<S;++w){var N=U(a,d[w]);g.push(N)}return g}var $,R=d.indexOf(".");return R===-1||($=a[d.substr(0,R)])==null?void 0:U($,d.substr(R+1))}function W(a,d,g){if(a&&d!==void 0&&!("isFrozen"in Object&&Object.isFrozen(a)))if(typeof d!="string"&&"length"in d){M(typeof g!="string"&&"length"in g);for(var w=0,S=d.length;w<S;++w)W(a,d[w],g[w])}else{var N,$,R=d.indexOf(".");R!==-1?(N=d.substr(0,R),(R=d.substr(R+1))===""?g===void 0?m(a)&&!isNaN(parseInt(N))?a.splice(N,1):delete a[N]:a[N]=g:W($=($=a[N])&&v(a,N)?$:a[N]={},R,g)):g===void 0?m(a)&&!isNaN(parseInt(d))?a.splice(d,1):delete a[d]:a[d]=g}}function Z(a){var d,g={};for(d in a)v(a,d)&&(g[d]=a[d]);return g}var fe=[].concat;function Se(a){return fe.apply([],a)}var K="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(d){return d+a+"Array"})}))).filter(function(a){return c[a]}),X=new Set(K.map(function(a){return c[a]})),de=null;function be(a){return de=new WeakMap,a=(function d(g){if(!g||typeof g!="object")return g;var w=de.get(g);if(w)return w;if(m(g)){w=[],de.set(g,w);for(var S=0,N=g.length;S<N;++S)w.push(d(g[S]))}else if(X.has(g.constructor))w=g;else{var $,R=b(g);for($ in w=R===Object.prototype?{}:Object.create(R),de.set(g,w),g)v(g,$)&&(w[$]=d(g[$]))}return w})(a),de=null,a}var z={}.toString;function ue(a){return z.call(a).slice(8,-1)}var Q=typeof Symbol<"u"?Symbol.iterator:"@@iterator",ie=typeof Q=="symbol"?function(a){var d;return a!=null&&(d=a[Q])&&d.apply(a)}:function(){return null};function H(a,d){d=a.indexOf(d),0<=d&&a.splice(d,1)}var q={};function J(a){var d,g,w,S;if(arguments.length===1){if(m(a))return a.slice();if(this===q&&typeof a=="string")return[a];if(S=ie(a))for(g=[];!(w=S.next()).done;)g.push(w.value);else{if(a==null)return[a];if(typeof(d=a.length)!="number")return[a];for(g=new Array(d);d--;)g[d]=a[d]}}else for(d=arguments.length,g=new Array(d);d--;)g[d]=arguments[d];return g}var O=typeof Symbol<"u"?function(a){return a[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},K=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Pt=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(K),ke={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 Ne(a,d){this.name=a,this.message=d}function Ae(a,d){return a+". Errors: "+Object.keys(d).map(function(g){return d[g].toString()}).filter(function(g,w,S){return S.indexOf(g)===w}).join(`
|
|
179
|
+
`)}function Oe(a,d,g,w){this.failures=d,this.failedKeys=w,this.successCount=g,this.message=Ae(a,d)}function Re(a,d){this.name="BulkError",this.failures=Object.keys(d).map(function(g){return d[g]}),this.failuresByPos=d,this.message=Ae(a,this.failures)}I(Ne).from(Error).extend({toString:function(){return this.name+": "+this.message}}),I(Oe).from(Ne),I(Re).from(Ne);var _e=Pt.reduce(function(a,d){return a[d]=d+"Error",a},{}),ze=Ne,Ee=Pt.reduce(function(a,d){var g=d+"Error";function w(S,N){this.name=g,S?typeof S=="string"?(this.message="".concat(S).concat(N?`
|
|
180
|
+
`+N:""),this.inner=N||null):typeof S=="object"&&(this.message="".concat(S.name," ").concat(S.message),this.inner=S):(this.message=ke[d]||g,this.inner=null)}return I(w).from(ze),a[d]=w,a},{}),Ze=(Ee.Syntax=SyntaxError,Ee.Type=TypeError,Ee.Range=RangeError,K.reduce(function(a,d){return a[d+"Error"]=Ee[d],a},{}));K=Pt.reduce(function(a,d){return["Syntax","Type","Range"].indexOf(d)===-1&&(a[d+"Error"]=Ee[d]),a},{});function He(){}function Ke(a){return a}function ct(a,d){return a==null||a===Ke?d:function(g){return d(a(g))}}function dt(a,d){return function(){a.apply(this,arguments),d.apply(this,arguments)}}function we(a,d){return a===He?d:function(){var g=a.apply(this,arguments),w=(g!==void 0&&(arguments[0]=g),this.onsuccess),S=this.onerror,N=(this.onsuccess=null,this.onerror=null,d.apply(this,arguments));return w&&(this.onsuccess=this.onsuccess?dt(w,this.onsuccess):w),S&&(this.onerror=this.onerror?dt(S,this.onerror):S),N!==void 0?N:g}}function tt(a,d){return a===He?d:function(){a.apply(this,arguments);var g=this.onsuccess,w=this.onerror;this.onsuccess=this.onerror=null,d.apply(this,arguments),g&&(this.onsuccess=this.onsuccess?dt(g,this.onsuccess):g),w&&(this.onerror=this.onerror?dt(w,this.onerror):w)}}function _t(a,d){return a===He?d:function(S){var w=a.apply(this,arguments),S=(y(S,w),this.onsuccess),N=this.onerror,$=(this.onsuccess=null,this.onerror=null,d.apply(this,arguments));return S&&(this.onsuccess=this.onsuccess?dt(S,this.onsuccess):S),N&&(this.onerror=this.onerror?dt(N,this.onerror):N),w===void 0?$===void 0?void 0:$:y(w,$)}}function Ct(a,d){return a===He?d:function(){return d.apply(this,arguments)!==!1&&a.apply(this,arguments)}}function xt(a,d){return a===He?d:function(){var g=a.apply(this,arguments);if(g&&typeof g.then=="function"){for(var w=this,S=arguments.length,N=new Array(S);S--;)N[S]=arguments[S];return g.then(function(){return d.apply(w,N)})}return d.apply(this,arguments)}}K.ModifyError=Oe,K.DexieError=Ne,K.BulkError=Re;var vt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function It(a){vt=a}var _n={},fr=100,sn=typeof Promise>"u"?[]:(Pt=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[sn=crypto.subtle.digest("SHA-512",new Uint8Array([0])),b(sn),Pt]:[Pt,b(Pt),Pt]),Pt=sn[0],ko=sn[1],ko=ko&&ko.then,tn=Pt&&Pt.constructor,an=!!sn[2],pr=function(a,d){Ln.push([a,d]),In&&(queueMicrotask(Fo),In=!1)},Tn=!0,In=!0,hn=[],hr=[],Rn=Ke,Sn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:He,pgp:!1,env:{},finalize:He},We=Sn,Ln=[],mn=0,Gt=[];function Ve(a){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var d=this._PSD=We;if(typeof a!="function"){if(a!==_n)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&Qr(this,this._value)}else this._state=null,this._value=null,++d.ref,(function g(w,S){try{S(function(N){if(w._state===null){if(N===w)throw new TypeError("A promise cannot be resolved with itself.");var $=w._lib&&zn();N&&typeof N.then=="function"?g(w,function(R,ee){N instanceof Ve?N._then(R,ee):N.then(R,ee)}):(w._state=!0,w._value=N,fo(w)),$&&Bn()}},Qr.bind(null,w))}catch(N){Qr(w,N)}})(this,a)}var Dn={get:function(){var a=We,d=gr;function g(w,S){var N=this,$=!a.global&&(a!==We||d!==gr),R=$&&!Wt(),ee=new Ve(function(ce,ne){er(N,new Et(ho(w,a,$,R),ho(S,a,$,R),ce,ne,a))});return this._consoleTask&&(ee._consoleTask=this._consoleTask),ee}return g.prototype=_n,g},set:function(a){C(this,"then",a&&a.prototype===_n?Dn:{get:function(){return a},set:Dn.set})}};function Et(a,d,g,w,S){this.onFulfilled=typeof a=="function"?a:null,this.onRejected=typeof d=="function"?d:null,this.resolve=g,this.reject=w,this.psd=S}function Qr(a,d){var g,w;hr.push(d),a._state===null&&(g=a._lib&&zn(),d=Rn(d),a._state=!1,a._value=d,w=a,hn.some(function(S){return S._value===w._value})||hn.push(w),fo(a),g)&&Bn()}function fo(a){var d=a._listeners;a._listeners=[];for(var g=0,w=d.length;g<w;++g)er(a,d[g]);var S=a._PSD;--S.ref||S.finalize(),mn===0&&(++mn,pr(function(){--mn==0&&$n()},[]))}function er(a,d){if(a._state===null)a._listeners.push(d);else{var g=a._state?d.onFulfilled:d.onRejected;if(g===null)return(a._state?d.resolve:d.reject)(a._value);++d.psd.ref,++mn,pr(mr,[g,a,d])}}function mr(a,d,g){try{var w,S=d._value;!d._state&&hr.length&&(hr=[]),w=vt&&d._consoleTask?d._consoleTask.run(function(){return a(S)}):a(S),d._state||hr.indexOf(S)!==-1||(N=>{for(var $=hn.length;$;)if(hn[--$]._value===N._value)return hn.splice($,1)})(d),g.resolve(w)}catch(N){g.reject(N)}finally{--mn==0&&$n(),--g.psd.ref||g.psd.finalize()}}function Fo(){Hn(Sn,function(){zn()&&Bn()})}function zn(){var a=Tn;return In=Tn=!1,a}function Bn(){var a,d,g;do for(;0<Ln.length;)for(a=Ln,Ln=[],g=a.length,d=0;d<g;++d){var w=a[d];w[0].apply(null,w[1])}while(0<Ln.length);In=Tn=!0}function $n(){for(var a=hn,d=(hn=[],a.forEach(function(w){w._PSD.onunhandled.call(null,w._value,w)}),Gt.slice(0)),g=d.length;g;)d[--g]()}function tr(a){return new Ve(_n,!1,a)}function lt(a,d){var g=We;return function(){var w=zn(),S=We;try{return nn(g,!0),a.apply(this,arguments)}catch(N){d&&d(N)}finally{nn(S,!1),w&&Bn()}}}k(Ve.prototype,{then:Dn,_then:function(a,d){er(this,new Et(null,null,a,d,We))},catch:function(a){var d,g;return arguments.length===1?this.then(null,a):(d=a,g=arguments[1],typeof d=="function"?this.then(null,function(w){return(w instanceof d?g:tr)(w)}):this.then(null,function(w){return(w&&w.name===d?g:tr)(w)}))},finally:function(a){return this.then(function(d){return Ve.resolve(a()).then(function(){return d})},function(d){return Ve.resolve(a()).then(function(){return tr(d)})})},timeout:function(a,d){var g=this;return a<1/0?new Ve(function(w,S){var N=setTimeout(function(){return S(new Ee.Timeout(d))},a);g.then(w,S).finally(clearTimeout.bind(null,N))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&C(Ve.prototype,Symbol.toStringTag,"Dexie.Promise"),Sn.env=Mr(),k(Ve,{all:function(){var a=J.apply(null,arguments).map(xr);return new Ve(function(d,g){a.length===0&&d([]);var w=a.length;a.forEach(function(S,N){return Ve.resolve(S).then(function($){a[N]=$,--w||d(a)},g)})})},resolve:function(a){return a instanceof Ve?a:a&&typeof a.then=="function"?new Ve(function(d,g){a.then(d,g)}):new Ve(_n,!0,a)},reject:tr,race:function(){var a=J.apply(null,arguments).map(xr);return new Ve(function(d,g){a.map(function(w){return Ve.resolve(w).then(d,g)})})},PSD:{get:function(){return We},set:function(a){return We=a}},totalEchoes:{get:function(){return gr}},newPSD:Fn,usePSD:Hn,scheduler:{get:function(){return pr},set:function(a){pr=a}},rejectionMapper:{get:function(){return Rn},set:function(a){Rn=a}},follow:function(a,d){return new Ve(function(g,w){return Fn(function(S,N){var $=We;$.unhandleds=[],$.onunhandled=N,$.finalize=dt(function(){var R,ee=this;R=function(){ee.unhandleds.length===0?S():N(ee.unhandleds[0])},Gt.push(function ce(){R(),Gt.splice(Gt.indexOf(ce),1)}),++mn,pr(function(){--mn==0&&$n()},[])},$.finalize),a()},d,g,w)})}}),tn&&(tn.allSettled&&C(Ve,"allSettled",function(){var a=J.apply(null,arguments).map(xr);return new Ve(function(d){a.length===0&&d([]);var g=a.length,w=new Array(g);a.forEach(function(S,N){return Ve.resolve(S).then(function($){return w[N]={status:"fulfilled",value:$}},function($){return w[N]={status:"rejected",reason:$}}).then(function(){return--g||d(w)})})})}),tn.any&&typeof AggregateError<"u"&&C(Ve,"any",function(){var a=J.apply(null,arguments).map(xr);return new Ve(function(d,g){a.length===0&&g(new AggregateError([]));var w=a.length,S=new Array(w);a.forEach(function(N,$){return Ve.resolve(N).then(function(R){return d(R)},function(R){S[$]=R,--w||g(new AggregateError(S))})})})}),tn.withResolvers)&&(Ve.withResolvers=tn.withResolvers);var Dt={awaits:0,echoes:0,id:0},Pr=0,nr=[],rr=0,gr=0,Ho=0;function Fn(a,$,g,w){var S=We,N=Object.create(S),$=(N.parent=S,N.ref=0,N.global=!1,N.id=++Ho,Sn.env,N.env=an?{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}:{},$&&y(N,$),++S.ref,N.finalize=function(){--this.parent.ref||this.parent.finalize()},Hn(N,a,g,w));return N.ref===0&&N.finalize(),$}function yr(){return Dt.id||(Dt.id=++Pr),++Dt.awaits,Dt.echoes+=fr,Dt.id}function Wt(){return!!Dt.awaits&&(--Dt.awaits==0&&(Dt.id=0),Dt.echoes=Dt.awaits*fr,!0)}function xr(a){return Dt.echoes&&a&&a.constructor===tn?(yr(),a.then(function(d){return Wt(),d},function(d){return Wt(),Mt(d)})):a}function po(){var a=nr[nr.length-1];nr.pop(),nn(a,!1)}function nn(a,d){var g,w,S=We;(d?!Dt.echoes||rr++&&a===We:!rr||--rr&&a===We)||queueMicrotask(d?(function(N){++gr,Dt.echoes&&--Dt.echoes!=0||(Dt.echoes=Dt.awaits=Dt.id=0),nr.push(We),nn(N,!0)}).bind(null,a):po),a!==We&&(We=a,S===Sn&&(Sn.env=Mr()),an)&&(g=Sn.env.Promise,w=a.env,S.global||a.global)&&(Object.defineProperty(c,"Promise",w.PromiseProp),g.all=w.all,g.race=w.race,g.resolve=w.resolve,g.reject=w.reject,w.allSettled&&(g.allSettled=w.allSettled),w.any)&&(g.any=w.any)}function Mr(){var a=c.Promise;return an?{Promise:a,PromiseProp:Object.getOwnPropertyDescriptor(c,"Promise"),all:a.all,race:a.race,allSettled:a.allSettled,any:a.any,resolve:a.resolve,reject:a.reject}:{}}function Hn(a,d,g,w,S){var N=We;try{return nn(a,!0),d(g,w,S)}finally{nn(N,!1)}}function ho(a,d,g,w){return typeof a!="function"?a:function(){var S=We;g&&yr(),nn(d,!0);try{return a.apply(this,arguments)}finally{nn(S,!1),w&&queueMicrotask(Wt)}}}function Gr(a){Promise===tn&&Dt.echoes===0?rr===0?a():enqueueNativeMicroTask(a):setTimeout(a,0)}(""+ko).indexOf("[native code]")===-1&&(yr=Wt=He);var Mt=Ve.reject,Vn="",wt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Vo="String expected.",vr="__dbnames",Tr="readonly",wr="readwrite";function or(a,d){return a?d?function(){return a.apply(this,arguments)&&d.apply(this,arguments)}:a:d}var mo={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Un(a){return typeof a!="string"||/\./.test(a)?function(d){return d}:function(d){return d[a]===void 0&&a in d&&delete(d=be(d))[a],d}}function gn(){throw Ee.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function ht(a,d){try{var g=ln(a),w=ln(d);if(g!==w)return g==="Array"?1:w==="Array"?-1:g==="binary"?1:w==="binary"?-1:g==="string"?1:w==="string"?-1:g==="Date"?1:w!=="Date"?NaN:-1;switch(g){case"number":case"Date":case"string":return d<a?1:a<d?-1:0;case"binary":for(var S=Uo(a),N=Uo(d),$=S.length,R=N.length,ee=$<R?$:R,ce=0;ce<ee;++ce)if(S[ce]!==N[ce])return S[ce]<N[ce]?-1:1;return $===R?0:$<R?-1:1;case"Array":for(var ne=a,G=d,te=ne.length,le=G.length,se=te<le?te:le,oe=0;oe<se;++oe){var ae=ht(ne[oe],G[oe]);if(ae!==0)return ae}return te===le?0:te<le?-1:1}}catch{}return NaN}function ln(a){var d=typeof a;return d=="object"&&(ArrayBuffer.isView(a)||(d=ue(a))==="ArrayBuffer")?"binary":d}function Uo(a){return a instanceof Uint8Array?a:ArrayBuffer.isView(a)?new Uint8Array(a.buffer,a.byteOffset,a.byteLength):new Uint8Array(a)}function Jr(a,d,g){var w=a.schema.yProps;return w?(d&&0<g.numFailures&&(d=d.filter(function(S,N){return!g.failures[N]})),Promise.all(w.map(function(S){return S=S.updatesTable,d?a.db.table(S).where("k").anyOf(d).delete():a.db.table(S).clear()})).then(function(){return g})):g}sr.prototype.execute=function(a){var d=this["@@propmod"];if(d.add!==void 0){var g=d.add;if(m(g))return l(l([],m(a)?a:[],!0),g).sort();if(typeof g=="number")return(Number(a)||0)+g;if(typeof g=="bigint")try{return BigInt(a)+g}catch{return BigInt(0)+g}throw new TypeError("Invalid term ".concat(g))}if(d.remove!==void 0){var w=d.remove;if(m(w))return m(a)?a.filter(function(S){return!w.includes(S)}).sort():[];if(typeof w=="number")return Number(a)-w;if(typeof w=="bigint")try{return BigInt(a)-w}catch{return BigInt(0)-w}throw new TypeError("Invalid subtrahend ".concat(w))}return g=(g=d.replacePrefix)==null?void 0:g[0],g&&typeof a=="string"&&a.startsWith(g)?d.replacePrefix[1]+a.substring(g.length):a};var br=sr;function sr(a){this["@@propmod"]=a}function kr(a,d){for(var g=f(d),w=g.length,S=!1,N=0;N<w;++N){var $=g[N],R=d[$],ee=U(a,$);R instanceof br?(W(a,$,R.execute(ee)),S=!0):ee!==R&&(W(a,$,R),S=!0)}return S}me.prototype._trans=function(a,d,g){var w=this._tx||We.trans,S=this.name,N=vt&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(a==="readonly"?"read":"write"," ").concat(this.name));function $(ce,ne,G){if(G.schema[S])return d(G.idbtrans,G);throw new Ee.NotFound("Table "+S+" not part of transaction")}var R=zn();try{var ee=w&&w.db._novip===this.db._novip?w===We.trans?w._promise(a,$,g):Fn(function(){return w._promise(a,$,g)},{trans:w,transless:We.transless||We}):(function ce(ne,G,te,le){if(ne.idbdb&&(ne._state.openComplete||We.letThrough||ne._vip)){var se=ne._createTransaction(G,te,ne._dbSchema);try{se.create(),ne._state.PR1398_maxLoop=3}catch(oe){return oe.name===_e.InvalidState&&ne.isOpen()&&0<--ne._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),ne.close({disableAutoOpen:!1}),ne.open().then(function(){return ce(ne,G,te,le)})):Mt(oe)}return se._promise(G,function(oe,ae){return Fn(function(){return We.trans=se,le(oe,ae,se)})}).then(function(oe){if(G==="readwrite")try{se.idbtrans.commit()}catch{}return G==="readonly"?oe:se._completion.then(function(){return oe})})}if(ne._state.openComplete)return Mt(new Ee.DatabaseClosed(ne._state.dbOpenError));if(!ne._state.isBeingOpened){if(!ne._state.autoOpen)return Mt(new Ee.DatabaseClosed);ne.open().catch(He)}return ne._state.dbReadyPromise.then(function(){return ce(ne,G,te,le)})})(this.db,a,[this.name],$);return N&&(ee._consoleTask=N,ee=ee.catch(function(ce){return console.trace(ce),Mt(ce)})),ee}finally{R&&Bn()}},me.prototype.get=function(a,d){var g=this;return a&&a.constructor===Object?this.where(a).first(d):a==null?Mt(new Ee.Type("Invalid argument to Table.get()")):this._trans("readonly",function(w){return g.core.get({trans:w,key:a}).then(function(S){return g.hook.reading.fire(S)})}).then(d)},me.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 d=f(a);if(d.length===1)return this.where(d[0]).equals(a[d[0]]);var g=this.schema.indexes.concat(this.schema.primKey).filter(function(R){if(R.compound&&d.every(function(ce){return 0<=R.keyPath.indexOf(ce)})){for(var ee=0;ee<d.length;++ee)if(d.indexOf(R.keyPath[ee])===-1)return!1;return!0}return!1}).sort(function(R,ee){return R.keyPath.length-ee.keyPath.length})[0];if(g&&this.db._maxKey!==Vn)return $=g.keyPath.slice(0,d.length),this.where($).equals($.map(function(R){return a[R]}));!g&&vt&&console.warn("The query ".concat(JSON.stringify(a)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(d.join("+"),"]"));var w=this.schema.idxByName;function S(R,ee){return ht(R,ee)===0}var $=d.reduce(function(ne,ee){var ce=ne[0],ne=ne[1],G=w[ee],te=a[ee];return[ce||G,ce||!G?or(ne,G&&G.multi?function(le){return le=U(le,ee),m(le)&&le.some(function(se){return S(te,se)})}:function(le){return S(te,U(le,ee))}):ne]},[null,null]),N=$[0],$=$[1];return N?this.where(N.name).equals(a[N.keyPath]).filter($):g?this.filter($):this.where(d).equals("")},me.prototype.filter=function(a){return this.toCollection().and(a)},me.prototype.count=function(a){return this.toCollection().count(a)},me.prototype.offset=function(a){return this.toCollection().offset(a)},me.prototype.limit=function(a){return this.toCollection().limit(a)},me.prototype.each=function(a){return this.toCollection().each(a)},me.prototype.toArray=function(a){return this.toCollection().toArray(a)},me.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},me.prototype.orderBy=function(a){return new this.db.Collection(new this.db.WhereClause(this,m(a)?"[".concat(a.join("+"),"]"):a))},me.prototype.reverse=function(){return this.toCollection().reverse()},me.prototype.mapToClass=function(a){for(var d=this.db,g=this.name,w=((this.schema.mappedClass=a).prototype instanceof gn&&(a=($=>{var R=ne,ee=$;if(typeof ee!="function"&&ee!==null)throw new TypeError("Class extends value "+String(ee)+" is not a constructor or null");function ce(){this.constructor=R}function ne(){return $!==null&&$.apply(this,arguments)||this}return o(R,ee),R.prototype=ee===null?Object.create(ee):(ce.prototype=ee.prototype,new ce),Object.defineProperty(ne.prototype,"db",{get:function(){return d},enumerable:!1,configurable:!0}),ne.prototype.table=function(){return g},ne})(a)),new Set),S=a.prototype;S;S=b(S))Object.getOwnPropertyNames(S).forEach(function($){return w.add($)});function N($){if(!$)return $;var R,ee=Object.create(a.prototype);for(R in $)if(!w.has(R))try{ee[R]=$[R]}catch{}return ee}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=N,this.hook("reading",N),a},me.prototype.defineClass=function(){return this.mapToClass(function(a){y(this,a)})},me.prototype.add=function(a,d){var g=this,w=this.schema.primKey,S=w.auto,N=w.keyPath,$=a;return N&&S&&($=Un(N)(a)),this._trans("readwrite",function(R){return g.core.mutate({trans:R,type:"add",keys:d!=null?[d]:null,values:[$]})}).then(function(R){return R.numFailures?Ve.reject(R.failures[0]):R.lastResult}).then(function(R){if(N)try{W(a,N,R)}catch{}return R})},me.prototype.upsert=function(a,d){var g=this,w=this.schema.primKey.keyPath;return this._trans("readwrite",function(S){return g.core.get({trans:S,key:a}).then(function(N){var $=N??{};return kr($,d),w&&W($,w,a),g.core.mutate({trans:S,type:"put",values:[$],keys:[a],upsert:!0,updates:{keys:[a],changeSpecs:[d]}}).then(function(R){return R.numFailures?Ve.reject(R.failures[0]):!!N})})})},me.prototype.update=function(a,d){return typeof a!="object"||m(a)?this.where(":id").equals(a).modify(d):(a=U(a,this.schema.primKey.keyPath))===void 0?Mt(new Ee.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(a).modify(d)},me.prototype.put=function(a,d){var g=this,w=this.schema.primKey,S=w.auto,N=w.keyPath,$=a;return N&&S&&($=Un(N)(a)),this._trans("readwrite",function(R){return g.core.mutate({trans:R,type:"put",values:[$],keys:d!=null?[d]:null})}).then(function(R){return R.numFailures?Ve.reject(R.failures[0]):R.lastResult}).then(function(R){if(N)try{W(a,N,R)}catch{}return R})},me.prototype.delete=function(a){var d=this;return this._trans("readwrite",function(g){return d.core.mutate({trans:g,type:"delete",keys:[a]}).then(function(w){return Jr(d,[a],w)}).then(function(w){return w.numFailures?Ve.reject(w.failures[0]):void 0})})},me.prototype.clear=function(){var a=this;return this._trans("readwrite",function(d){return a.core.mutate({trans:d,type:"deleteRange",range:mo}).then(function(g){return Jr(a,null,g)})}).then(function(d){return d.numFailures?Ve.reject(d.failures[0]):void 0})},me.prototype.bulkGet=function(a){var d=this;return this._trans("readonly",function(g){return d.core.getMany({keys:a,trans:g}).then(function(w){return w.map(function(S){return d.hook.reading.fire(S)})})})},me.prototype.bulkAdd=function(a,d,g){var w=this,S=Array.isArray(d)?d:void 0,N=(g=g||(S?void 0:d))?g.allKeys:void 0;return this._trans("readwrite",function($){var R=w.schema.primKey,ce=R.auto,R=R.keyPath;if(R&&S)throw new Ee.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(S&&S.length!==a.length)throw new Ee.InvalidArgument("Arguments objects and keys must have the same length");var ee=a.length,ce=R&&ce?a.map(Un(R)):a;return w.core.mutate({trans:$,type:"add",keys:S,values:ce,wantResults:N}).then(function(ne){var G=ne.numFailures,te=ne.failures;if(G===0)return N?ne.results:ne.lastResult;throw new Re("".concat(w.name,".bulkAdd(): ").concat(G," of ").concat(ee," operations failed"),te)})})},me.prototype.bulkPut=function(a,d,g){var w=this,S=Array.isArray(d)?d:void 0,N=(g=g||(S?void 0:d))?g.allKeys:void 0;return this._trans("readwrite",function($){var R=w.schema.primKey,ce=R.auto,R=R.keyPath;if(R&&S)throw new Ee.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(S&&S.length!==a.length)throw new Ee.InvalidArgument("Arguments objects and keys must have the same length");var ee=a.length,ce=R&&ce?a.map(Un(R)):a;return w.core.mutate({trans:$,type:"put",keys:S,values:ce,wantResults:N}).then(function(ne){var G=ne.numFailures,te=ne.failures;if(G===0)return N?ne.results:ne.lastResult;throw new Re("".concat(w.name,".bulkPut(): ").concat(G," of ").concat(ee," operations failed"),te)})})},me.prototype.bulkUpdate=function(a){var d=this,g=this.core,w=a.map(function($){return $.key}),S=a.map(function($){return $.changes}),N=[];return this._trans("readwrite",function($){return g.getMany({trans:$,keys:w,cache:"clone"}).then(function(R){var ee=[],ce=[],ne=(a.forEach(function(G,te){var le=G.key,se=G.changes,oe=R[te];if(oe){for(var ae=0,ye=Object.keys(se);ae<ye.length;ae++){var pe=ye[ae],ve=se[pe];if(pe===d.schema.primKey.keyPath){if(ht(ve,le)!==0)throw new Ee.Constraint("Cannot update primary key in bulkUpdate()")}else W(oe,pe,ve)}N.push(te),ee.push(le),ce.push(oe)}}),ee.length);return g.mutate({trans:$,type:"put",keys:ee,values:ce,updates:{keys:w,changeSpecs:S}}).then(function(G){var te=G.numFailures,le=G.failures;if(te===0)return ne;for(var se=0,oe=Object.keys(le);se<oe.length;se++){var ae,ye=oe[se],pe=N[Number(ye)];pe!=null&&(ae=le[ye],delete le[ye],le[pe]=ae)}throw new Re("".concat(d.name,".bulkUpdate(): ").concat(te," of ").concat(ne," operations failed"),le)})})})},me.prototype.bulkDelete=function(a){var d=this,g=a.length;return this._trans("readwrite",function(w){return d.core.mutate({trans:w,type:"delete",keys:a}).then(function(S){return Jr(d,a,S)})}).then(function(w){var S=w.numFailures,N=w.failures;if(S===0)return w.lastResult;throw new Re("".concat(d.name,".bulkDelete(): ").concat(S," of ").concat(g," operations failed"),N)})};var L=me;function me(){}function Fe(a){function d($,R){if(R){for(var ee=arguments.length,ce=new Array(ee-1);--ee;)ce[ee-1]=arguments[ee];return g[$].subscribe.apply(null,ce),a}if(typeof $=="string")return g[$]}var g={};d.addEventType=N;for(var w=1,S=arguments.length;w<S;++w)N(arguments[w]);return d;function N($,R,ee){var ce,ne;if(typeof $!="object")return R=R||Ct,ne={subscribers:[],fire:ee=ee||He,subscribe:function(G){ne.subscribers.indexOf(G)===-1&&(ne.subscribers.push(G),ne.fire=R(ne.fire,G))},unsubscribe:function(G){ne.subscribers=ne.subscribers.filter(function(te){return te!==G}),ne.fire=ne.subscribers.reduce(R,ee)}},g[$]=d[$]=ne;f(ce=$).forEach(function(G){var te=ce[G];if(m(te))N(G,ce[G][0],ce[G][1]);else{if(te!=="asap")throw new Ee.InvalidArgument("Invalid event config");var le=N(G,Ke,function(){for(var se=arguments.length,oe=new Array(se);se--;)oe[se]=arguments[se];le.subscribers.forEach(function(ae){B(function(){ae.apply(null,oe)})})})}})}}function Je(a,d){return I(d).from({prototype:a}),d}function jt(a,d){return!(a.filter||a.algorithm||a.or)&&(d?a.justLimit:!a.replayFilter)}function $t(a,d){a.filter=or(a.filter,d)}function Yt(a,d,g){var w=a.replayFilter;a.replayFilter=w?function(){return or(w(),d())}:d,a.justLimit=g&&!w}function Ht(a,d){if(a.isPrimKey)return d.primaryKey;var g=d.getIndexByKeyPath(a.index);if(g)return g;throw new Ee.Schema("KeyPath "+a.index+" on object store "+d.name+" is not indexed")}function Xt(a,d,g){var w=Ht(a,d.schema);return d.openCursor({trans:g,values:!a.keysOnly,reverse:a.dir==="prev",unique:!!a.unique,query:{index:w,range:a.range}})}function yn(a,d,g,w){var S,N,$=a.replayFilter?or(a.filter,a.replayFilter()):a.filter;return a.or?(S={},N=function(R,ee,ce){var ne,G;$&&!$(ee,ce,function(te){return ee.stop(te)},function(te){return ee.fail(te)})||((G=""+(ne=ee.primaryKey))=="[object ArrayBuffer]"&&(G=""+new Uint8Array(ne)),v(S,G))||(S[G]=!0,d(R,ee,ce))},Promise.all([a.or._iterate(N,g),bt(Xt(a,w,g),a.algorithm,N,!a.keysOnly&&a.valueMapper)])):bt(Xt(a,w,g),or(a.algorithm,$),d,!a.keysOnly&&a.valueMapper)}function bt(a,d,g,w){var S=lt(w?function(N,$,R){return g(w(N),$,R)}:g);return a.then(function(N){if(N)return N.start(function(){var $=function(){return N.continue()};d&&!d(N,function(R){return $=R},function(R){N.stop(R),$=He},function(R){N.fail(R),$=He})||S(N.value,N,function(R){return $=R}),$()})})}gt.prototype._read=function(a,d){var g=this._ctx;return g.error?g.table._trans(null,Mt.bind(null,g.error)):g.table._trans("readonly",a).then(d)},gt.prototype._write=function(a){var d=this._ctx;return d.error?d.table._trans(null,Mt.bind(null,d.error)):d.table._trans("readwrite",a,"locked")},gt.prototype._addAlgorithm=function(a){var d=this._ctx;d.algorithm=or(d.algorithm,a)},gt.prototype._iterate=function(a,d){return yn(this._ctx,a,d,this._ctx.table.core)},gt.prototype.clone=function(a){var d=Object.create(this.constructor.prototype),g=Object.create(this._ctx);return a&&y(g,a),d._ctx=g,d},gt.prototype.raw=function(){return this._ctx.valueMapper=null,this},gt.prototype.each=function(a){var d=this._ctx;return this._read(function(g){return yn(d,a,g,d.table.core)})},gt.prototype.count=function(a){var d=this;return this._read(function(g){var w,S=d._ctx,N=S.table.core;return jt(S,!0)?N.count({trans:g,query:{index:Ht(S,N.schema),range:S.range}}).then(function($){return Math.min($,S.limit)}):(w=0,yn(S,function(){return++w,!1},g,N).then(function(){return w}))}).then(a)},gt.prototype.sortBy=function(a,d){var g=a.split(".").reverse(),w=g[0],S=g.length-1;function N(ee,ce){return ce?N(ee[g[ce]],ce-1):ee[w]}var $=this._ctx.dir==="next"?1:-1;function R(ee,ce){return ht(N(ee,S),N(ce,S))*$}return this.toArray(function(ee){return ee.sort(R)}).then(d)},gt.prototype.toArray=function(a){var d=this;return this._read(function(g){var w,S,N,$=d._ctx;return jt($,!0)&&0<$.limit?(w=$.valueMapper,S=Ht($,$.table.core.schema),$.table.core.query({trans:g,limit:$.limit,values:!0,direction:$.dir==="prev"?"prev":void 0,query:{index:S,range:$.range}}).then(function(R){return R=R.result,w?R.map(w):R})):(N=[],yn($,function(R){return N.push(R)},g,$.table.core).then(function(){return N}))},a)},gt.prototype.offset=function(a){var d=this._ctx;return a<=0||(d.offset+=a,jt(d)?Yt(d,function(){var g=a;return function(w,S){return g===0||(g===1?--g:S(function(){w.advance(g),g=0}),!1)}}):Yt(d,function(){var g=a;return function(){return--g<0}})),this},gt.prototype.limit=function(a){return this._ctx.limit=Math.min(this._ctx.limit,a),Yt(this._ctx,function(){var d=a;return function(g,w,S){return--d<=0&&w(S),0<=d}},!0),this},gt.prototype.until=function(a,d){return $t(this._ctx,function(g,w,S){return!a(g.value)||(w(S),d)}),this},gt.prototype.first=function(a){return this.limit(1).toArray(function(d){return d[0]}).then(a)},gt.prototype.last=function(a){return this.reverse().first(a)},gt.prototype.filter=function(a){var d;return $t(this._ctx,function(g){return a(g.value)}),(d=this._ctx).isMatch=or(d.isMatch,a),this},gt.prototype.and=function(a){return this.filter(a)},gt.prototype.or=function(a){return new this.db.WhereClause(this._ctx.table,a,this)},gt.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},gt.prototype.desc=function(){return this.reverse()},gt.prototype.eachKey=function(a){var d=this._ctx;return d.keysOnly=!d.isMatch,this.each(function(g,w){a(w.key,w)})},gt.prototype.eachUniqueKey=function(a){return this._ctx.unique="unique",this.eachKey(a)},gt.prototype.eachPrimaryKey=function(a){var d=this._ctx;return d.keysOnly=!d.isMatch,this.each(function(g,w){a(w.primaryKey,w)})},gt.prototype.keys=function(a){var d=this._ctx,g=(d.keysOnly=!d.isMatch,[]);return this.each(function(w,S){g.push(S.key)}).then(function(){return g}).then(a)},gt.prototype.primaryKeys=function(a){var d=this._ctx;if(jt(d,!0)&&0<d.limit)return this._read(function(w){var S=Ht(d,d.table.core.schema);return d.table.core.query({trans:w,values:!1,limit:d.limit,direction:d.dir==="prev"?"prev":void 0,query:{index:S,range:d.range}})}).then(function(w){return w.result}).then(a);d.keysOnly=!d.isMatch;var g=[];return this.each(function(w,S){g.push(S.primaryKey)}).then(function(){return g}).then(a)},gt.prototype.uniqueKeys=function(a){return this._ctx.unique="unique",this.keys(a)},gt.prototype.firstKey=function(a){return this.limit(1).keys(function(d){return d[0]}).then(a)},gt.prototype.lastKey=function(a){return this.reverse().firstKey(a)},gt.prototype.distinct=function(){var a,d=this._ctx,d=d.index&&d.table.schema.idxByName[d.index];return d&&d.multi&&(a={},$t(this._ctx,function(w){var w=w.primaryKey.toString(),S=v(a,w);return a[w]=!0,!S})),this},gt.prototype.modify=function(a){var d=this,g=this._ctx;return this._write(function(w){function S(oe,ae){var ye=ae.failures;te+=oe-ae.numFailures;for(var pe=0,ve=f(ye);pe<ve.length;pe++){var je=ve[pe];G.push(ye[je])}}var N=typeof a=="function"?a:function(oe){return kr(oe,a)},$=g.table.core,ne=$.schema.primaryKey,R=ne.outbound,ee=ne.extractKey,ce=200,ne=d.db._options.modifyChunkSize,G=(ne&&(ce=typeof ne=="object"?ne[$.name]||ne["*"]||200:ne),[]),te=0,le=[],se=a===Ir;return d.clone().primaryKeys().then(function(oe){function ae(pe){var ve=Math.min(ce,oe.length-pe),je=oe.slice(pe,pe+ve);return(se?Promise.resolve([]):$.getMany({trans:w,keys:je,cache:"immutable"})).then(function(Pe){var De=[],Ie=[],Ue=R?[]:null,Le=se?je:[];if(!se)for(var Ye=0;Ye<ve;++Ye){var Ce=Pe[Ye],it={value:be(Ce),primKey:oe[pe+Ye]};N.call(it,it.value,it)!==!1&&(it.value==null?Le.push(oe[pe+Ye]):R||ht(ee(Ce),ee(it.value))===0?(Ie.push(it.value),R&&Ue.push(oe[pe+Ye])):(Le.push(oe[pe+Ye]),De.push(it.value)))}return Promise.resolve(0<De.length&&$.mutate({trans:w,type:"add",values:De}).then(function(at){for(var pt in at.failures)Le.splice(parseInt(pt),1);S(De.length,at)})).then(function(){return(0<Ie.length||ye&&typeof a=="object")&&$.mutate({trans:w,type:"put",keys:Ue,values:Ie,criteria:ye,changeSpec:typeof a!="function"&&a,isAdditionalChunk:0<pe}).then(function(at){return S(Ie.length,at)})}).then(function(){return(0<Le.length||ye&&se)&&$.mutate({trans:w,type:"delete",keys:Le,criteria:ye,isAdditionalChunk:0<pe}).then(function(at){return Jr(g.table,Le,at)}).then(function(at){return S(Le.length,at)})}).then(function(){return oe.length>pe+ve&&ae(pe+ce)})})}var ye=jt(g)&&g.limit===1/0&&(typeof a!="function"||se)&&{index:g.index,range:g.range};return ae(0).then(function(){if(0<G.length)throw new Oe("Error modifying one or more objects",G,te,le);return oe.length})})})},gt.prototype.delete=function(){var a=this._ctx,d=a.range;return!jt(a)||a.table.schema.yProps||!a.isPrimKey&&d.type!==3?this.modify(Ir):this._write(function(g){var w=a.table.core.schema.primaryKey,S=d;return a.table.core.count({trans:g,query:{index:w,range:S}}).then(function(N){return a.table.core.mutate({trans:g,type:"deleteRange",range:S}).then(function(ee){var R=ee.failures,ee=ee.numFailures;if(ee)throw new Oe("Could not delete some values",Object.keys(R).map(function(ce){return R[ce]}),N-ee);return N-ee})})})};var ys=gt;function gt(){}var Ir=function(a,d){return d.value=null};function Ws(a,d){return a<d?-1:a===d?0:1}function Ka(a,d){return d<a?-1:a===d?0:1}function Nn(a,d,g){return a=a instanceof Ar?new a.Collection(a):a,a._ctx.error=new(g||TypeError)(d),a}function Zr(a){return new a.Collection(a,function(){return $r("")}).limit(0)}function go(le,d,g,w){var S,N,$,R,ee,ce,ne,G=g.length;if(!g.every(function(oe){return typeof oe=="string"}))return Nn(le,Vo);function te(oe){S=oe==="next"?function(ye){return ye.toUpperCase()}:function(ye){return ye.toLowerCase()},N=oe==="next"?function(ye){return ye.toLowerCase()}:function(ye){return ye.toUpperCase()},$=oe==="next"?Ws:Ka;var ae=g.map(function(ye){return{lower:N(ye),upper:S(ye)}}).sort(function(ye,pe){return $(ye.lower,pe.lower)});R=ae.map(function(ye){return ye.upper}),ee=ae.map(function(ye){return ye.lower}),ne=(ce=oe)==="next"?"":w}te("next");var le=new le.Collection(le,function(){return xn(R[0],ee[G-1]+w)}),se=(le._ondirectionchange=function(oe){te(oe)},0);return le._addAlgorithm(function(oe,ae,ye){var pe=oe.key;if(typeof pe=="string"){var ve=N(pe);if(d(ve,ee,se))return!0;for(var je=null,Pe=se;Pe<G;++Pe){var De=((Ie,Ue,Le,Ye,Ce,it)=>{for(var at=Math.min(Ie.length,Ye.length),pt=-1,mt=0;mt<at;++mt){var En=Ue[mt];if(En!==Ye[mt])return Ce(Ie[mt],Le[mt])<0?Ie.substr(0,mt)+Le[mt]+Le.substr(mt+1):Ce(Ie[mt],Ye[mt])<0?Ie.substr(0,mt)+Ye[mt]+Le.substr(mt+1):0<=pt?Ie.substr(0,pt)+Ue[pt]+Le.substr(pt+1):null;Ce(Ie[mt],En)<0&&(pt=mt)}return at<Ye.length&&it==="next"?Ie+Le.substr(Ie.length):at<Ie.length&&it==="prev"?Ie.substr(0,Le.length):pt<0?null:Ie.substr(0,pt)+Ye[pt]+Le.substr(pt+1)})(pe,ve,R[Pe],ee[Pe],$,ce);De===null&&je===null?se=Pe+1:(je===null||0<$(je,De))&&(je=De)}ae(je!==null?function(){oe.continue(je+ne)}:ye)}return!1}),le}function xn(a,d,g,w){return{type:2,lower:a,upper:d,lowerOpen:g,upperOpen:w}}function $r(a){return{type:1,lower:a,upper:a}}Object.defineProperty(zt.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),zt.prototype.between=function(a,d,g,w){g=g!==!1,w=w===!0;try{return 0<this._cmp(a,d)||this._cmp(a,d)===0&&(g||w)&&(!g||!w)?Zr(this):new this.Collection(this,function(){return xn(a,d,!g,!w)})}catch{return Nn(this,wt)}},zt.prototype.equals=function(a){return a==null?Nn(this,wt):new this.Collection(this,function(){return $r(a)})},zt.prototype.above=function(a){return a==null?Nn(this,wt):new this.Collection(this,function(){return xn(a,void 0,!0)})},zt.prototype.aboveOrEqual=function(a){return a==null?Nn(this,wt):new this.Collection(this,function(){return xn(a,void 0,!1)})},zt.prototype.below=function(a){return a==null?Nn(this,wt):new this.Collection(this,function(){return xn(void 0,a,!1,!0)})},zt.prototype.belowOrEqual=function(a){return a==null?Nn(this,wt):new this.Collection(this,function(){return xn(void 0,a)})},zt.prototype.startsWith=function(a){return typeof a!="string"?Nn(this,Vo):this.between(a,a+Vn,!0,!0)},zt.prototype.startsWithIgnoreCase=function(a){return a===""?this.startsWith(a):go(this,function(d,g){return d.indexOf(g[0])===0},[a],Vn)},zt.prototype.equalsIgnoreCase=function(a){return go(this,function(d,g){return d===g[0]},[a],"")},zt.prototype.anyOfIgnoreCase=function(){var a=J.apply(q,arguments);return a.length===0?Zr(this):go(this,function(d,g){return g.indexOf(d)!==-1},a,"")},zt.prototype.startsWithAnyOfIgnoreCase=function(){var a=J.apply(q,arguments);return a.length===0?Zr(this):go(this,function(d,g){return g.some(function(w){return d.indexOf(w)===0})},a,Vn)},zt.prototype.anyOf=function(){var a,d,g=this,w=J.apply(q,arguments),S=this._cmp;try{w.sort(S)}catch{return Nn(this,wt)}return w.length===0?Zr(this):((a=new this.Collection(this,function(){return xn(w[0],w[w.length-1])}))._ondirectionchange=function(N){S=N==="next"?g._ascending:g._descending,w.sort(S)},d=0,a._addAlgorithm(function(N,$,R){for(var ee=N.key;0<S(ee,w[d]);)if(++d===w.length)return $(R),!1;return S(ee,w[d])===0||($(function(){N.continue(w[d])}),!1)}),a)},zt.prototype.notEqual=function(a){return this.inAnyRange([[-1/0,a],[a,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},zt.prototype.noneOf=function(){var a=J.apply(q,arguments);if(a.length===0)return new this.Collection(this);try{a.sort(this._ascending)}catch{return Nn(this,wt)}var d=a.reduce(function(g,w){return g?g.concat([[g[g.length-1][1],w]]):[[-1/0,w]]},null);return d.push([a[a.length-1],this.db._maxKey]),this.inAnyRange(d,{includeLowers:!1,includeUppers:!1})},zt.prototype.inAnyRange=function(a,ye){var g=this,w=this._cmp,S=this._ascending,N=this._descending,$=this._min,R=this._max;if(a.length===0)return Zr(this);if(!a.every(function(pe){return pe[0]!==void 0&&pe[1]!==void 0&&S(pe[0],pe[1])<=0}))return Nn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Ee.InvalidArgument);var ee=!ye||ye.includeLowers!==!1,ce=ye&&ye.includeUppers===!0,ne,G=S;function te(pe,ve){return G(pe[0],ve[0])}try{(ne=a.reduce(function(pe,ve){for(var je=0,Pe=pe.length;je<Pe;++je){var De=pe[je];if(w(ve[0],De[1])<0&&0<w(ve[1],De[0])){De[0]=$(De[0],ve[0]),De[1]=R(De[1],ve[1]);break}}return je===Pe&&pe.push(ve),pe},[])).sort(te)}catch{return Nn(this,wt)}var le=0,se=ce?function(pe){return 0<S(pe,ne[le][1])}:function(pe){return 0<=S(pe,ne[le][1])},oe=ee?function(pe){return 0<N(pe,ne[le][0])}:function(pe){return 0<=N(pe,ne[le][0])},ae=se,ye=new this.Collection(this,function(){return xn(ne[0][0],ne[ne.length-1][1],!ee,!ce)});return ye._ondirectionchange=function(pe){G=pe==="next"?(ae=se,S):(ae=oe,N),ne.sort(te)},ye._addAlgorithm(function(pe,ve,je){for(var Pe,De=pe.key;ae(De);)if(++le===ne.length)return ve(je),!1;return!se(Pe=De)&&!oe(Pe)||(g._cmp(De,ne[le][1])===0||g._cmp(De,ne[le][0])===0||ve(function(){G===S?pe.continue(ne[le][0]):pe.continue(ne[le][1])}),!1)}),ye},zt.prototype.startsWithAnyOf=function(){var a=J.apply(q,arguments);return a.every(function(d){return typeof d=="string"})?a.length===0?Zr(this):this.inAnyRange(a.map(function(d){return[d,d+Vn]})):Nn(this,"startsWithAnyOf() only works with strings")};var Ar=zt;function zt(){}function vn(a){return lt(function(d){return Kn(d),a(d.target.error),!1})}function Kn(a){a.stopPropagation&&a.stopPropagation(),a.preventDefault&&a.preventDefault()}var xs="storagemutated",Ys="x-storagemutated-1",qn=Fe(null,xs),Bu=(ir.prototype._lock=function(){return M(!We.global),++this._reculock,this._reculock!==1||We.global||(We.lockOwnerFor=this),this},ir.prototype._unlock=function(){if(M(!We.global),--this._reculock==0)for(We.global||(We.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var a=this._blockedFuncs.shift();try{Hn(a[1],a[0])}catch{}}return this},ir.prototype._locked=function(){return this._reculock&&We.lockOwnerFor!==this},ir.prototype.create=function(a){var d=this;if(this.mode){var g=this.db.idbdb,w=this.db._state.dbOpenError;if(M(!this.idbtrans),!a&&!g)switch(w&&w.name){case"DatabaseClosedError":throw new Ee.DatabaseClosed(w);case"MissingAPIError":throw new Ee.MissingAPI(w.message,w);default:throw new Ee.OpenFailed(w)}if(!this.active)throw new Ee.TransactionInactive;M(this._completion._state===null),(a=this.idbtrans=a||(this.db.core||g).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=lt(function(S){Kn(S),d._reject(a.error)}),a.onabort=lt(function(S){Kn(S),d.active&&d._reject(new Ee.Abort(a.error)),d.active=!1,d.on("abort").fire(S)}),a.oncomplete=lt(function(){d.active=!1,d._resolve(),"mutatedParts"in a&&qn.storagemutated.fire(a.mutatedParts)})}return this},ir.prototype._promise=function(a,d,g){var w,S=this;return a==="readwrite"&&this.mode!=="readwrite"?Mt(new Ee.ReadOnly("Transaction is readonly")):this.active?this._locked()?new Ve(function(N,$){S._blockedFuncs.push([function(){S._promise(a,d,g).then(N,$)},We])}):g?Fn(function(){var N=new Ve(function($,R){S._lock();var ee=d($,R,S);ee&&ee.then&&ee.then($,R)});return N.finally(function(){return S._unlock()}),N._lib=!0,N}):((w=new Ve(function(N,$){var R=d(N,$,S);R&&R.then&&R.then(N,$)}))._lib=!0,w):Mt(new Ee.TransactionInactive)},ir.prototype._root=function(){return this.parent?this.parent._root():this},ir.prototype.waitFor=function(a){var d,g=this._root(),w=Ve.resolve(a),S=(g._waitingFor?g._waitingFor=g._waitingFor.then(function(){return w}):(g._waitingFor=w,g._waitingQueue=[],d=g.idbtrans.objectStore(g.storeNames[0]),(function N(){for(++g._spinCount;g._waitingQueue.length;)g._waitingQueue.shift()();g._waitingFor&&(d.get(-1/0).onsuccess=N)})()),g._waitingFor);return new Ve(function(N,$){w.then(function(R){return g._waitingQueue.push(lt(N.bind(null,R)))},function(R){return g._waitingQueue.push(lt($.bind(null,R)))}).finally(function(){g._waitingFor===S&&(g._waitingFor=null)})})},ir.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Ee.Abort))},ir.prototype.table=function(a){var d=this._memoizedTables||(this._memoizedTables={});if(v(d,a))return d[a];var g=this.schema[a];if(g)return(g=new this.db.Table(a,g,this)).core=this.db.core.table(a),d[a]=g;throw new Ee.NotFound("Table "+a+" not part of transaction")},ir);function ir(){}function Ko(a,d,g,w,S,N,$,R){return{name:a,keyPath:d,unique:g,multi:w,auto:S,compound:N,src:(g&&!$?"&":"")+(w?"*":"")+(S?"++":"")+Hi(d),type:R}}function Hi(a){return typeof a=="string"?a:a?"["+[].join.call(a,"+")+"]":""}function Vi(a,d,g){return{name:a,primKey:d,indexes:g,mappedClass:null,idxByName:(w=function(S){return[S.name,S]},g.reduce(function(S,N,$){return N=w(N,$),N&&(S[N[0]]=N[1]),S},{}))};var w}var Or=function(a){try{return a.only([[]]),Or=function(){return[[]]},[[]]}catch{return Or=function(){return Vn},Vn}};function yo(a){return a==null?function(){}:typeof a=="string"?(d=a).split(".").length===1?function(g){return g[d]}:function(g){return U(g,d)}:function(g){return U(g,a)};var d}function xo(a){return[].slice.call(a)}var Xs=0;function vs(a){return a==null?":id":typeof a=="string"?a:"[".concat(a.join("+"),"]")}function Fu(a,d,$){function w(ae){if(ae.type===3)return null;if(ae.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var le=ae.lower,se=ae.upper,oe=ae.lowerOpen,ae=ae.upperOpen;return le===void 0?se===void 0?null:d.upperBound(se,!!ae):se===void 0?d.lowerBound(le,!!oe):d.bound(le,se,!!oe,!!ae)}function S(te){var le,se,oe=te.name;return{name:oe,schema:te,mutate:function(ae){var ye=ae.trans,pe=ae.type,ve=ae.keys,je=ae.values,Pe=ae.range;return new Promise(function(De,Ie){De=lt(De);var Ue=ye.objectStore(oe),Le=Ue.keyPath==null,Ye=pe==="put"||pe==="add";if(!Ye&&pe!=="delete"&&pe!=="deleteRange")throw new Error("Invalid operation type: "+pe);var Ce,it=(ve||je||{length:1}).length;if(ve&&je&&ve.length!==je.length)throw new Error("Given keys array must have same length as given values array.");if(it===0)return De({numFailures:0,failures:{},results:[],lastResult:void 0});function at(wn){++En,Kn(wn)}var pt=[],mt=[],En=0;if(pe==="deleteRange"){if(Pe.type===4)return De({numFailures:En,failures:mt,results:[],lastResult:void 0});Pe.type===3?pt.push(Ce=Ue.clear()):pt.push(Ce=Ue.delete(w(Pe)))}else{var Le=Ye?Le?[je,ve]:[je,null]:[ve,null],ft=Le[0],At=Le[1];if(Ye)for(var Jt=0;Jt<it;++Jt)pt.push(Ce=At&&At[Jt]!==void 0?Ue[pe](ft[Jt],At[Jt]):Ue[pe](ft[Jt])),Ce.onerror=at;else for(Jt=0;Jt<it;++Jt)pt.push(Ce=Ue[pe](ft[Jt])),Ce.onerror=at}function es(wn){wn=wn.target.result,pt.forEach(function(No,Eo){return No.error!=null&&(mt[Eo]=No.error)}),De({numFailures:En,failures:mt,results:pe==="delete"?ve:pt.map(function(No){return No.result}),lastResult:wn})}Ce.onerror=function(wn){at(wn),es(wn)},Ce.onsuccess=es})},getMany:function(ae){var ye=ae.trans,pe=ae.keys;return new Promise(function(ve,je){ve=lt(ve);for(var Pe,De=ye.objectStore(oe),Ie=pe.length,Ue=new Array(Ie),Le=0,Ye=0,Ce=function(pt){pt=pt.target,Ue[pt._pos]=pt.result,++Ye===Le&&ve(Ue)},it=vn(je),at=0;at<Ie;++at)pe[at]!=null&&((Pe=De.get(pe[at]))._pos=at,Pe.onsuccess=Ce,Pe.onerror=it,++Le);Le===0&&ve(Ue)})},get:function(ae){var ye=ae.trans,pe=ae.key;return new Promise(function(ve,je){ve=lt(ve);var Pe=ye.objectStore(oe).get(pe);Pe.onsuccess=function(De){return ve(De.target.result)},Pe.onerror=vn(je)})},query:(le=ee,se=ce,function(ae){return new Promise(function(ye,pe){ye=lt(ye);var ve,je,Pe,De,it=ae.trans,Ie=ae.values,Ue=ae.limit,Ce=ae.query,Le=(Le=ae.direction)!=null?Le:"next",Ye=Ue===1/0?void 0:Ue,at=Ce.index,Ce=Ce.range,it=it.objectStore(oe),it=at.isPrimaryKey?it:it.index(at.name),at=w(Ce);if(Ue===0)return ye({result:[]});se?(Ce={query:at,count:Ye,direction:Le},(ve=Ie?it.getAll(Ce):it.getAllKeys(Ce)).onsuccess=function(pt){return ye({result:pt.target.result})},ve.onerror=vn(pe)):le&&Le==="next"?((ve=Ie?it.getAll(at,Ye):it.getAllKeys(at,Ye)).onsuccess=function(pt){return ye({result:pt.target.result})},ve.onerror=vn(pe)):(je=0,Pe=!Ie&&"openKeyCursor"in it?it.openKeyCursor(at,Le):it.openCursor(at,Le),De=[],Pe.onsuccess=function(){var pt=Pe.result;return!pt||(De.push(Ie?pt.value:pt.primaryKey),++je===Ue)?ye({result:De}):void pt.continue()},Pe.onerror=vn(pe))})}),openCursor:function(ae){var ye=ae.trans,pe=ae.values,ve=ae.query,je=ae.reverse,Pe=ae.unique;return new Promise(function(De,Ie){De=lt(De);var Ye=ve.index,Ue=ve.range,Le=ye.objectStore(oe),Le=Ye.isPrimaryKey?Le:Le.index(Ye.name),Ye=je?Pe?"prevunique":"prev":Pe?"nextunique":"next",Ce=!pe&&"openKeyCursor"in Le?Le.openKeyCursor(w(Ue),Ye):Le.openCursor(w(Ue),Ye);Ce.onerror=vn(Ie),Ce.onsuccess=lt(function(it){var at,pt,mt,En,ft=Ce.result;ft?(ft.___id=++Xs,ft.done=!1,at=ft.continue.bind(ft),pt=(pt=ft.continuePrimaryKey)&&pt.bind(ft),mt=ft.advance.bind(ft),En=function(){throw new Error("Cursor not stopped")},ft.trans=ye,ft.stop=ft.continue=ft.continuePrimaryKey=ft.advance=function(){throw new Error("Cursor not started")},ft.fail=lt(Ie),ft.next=function(){var At=this,Jt=1;return this.start(function(){return Jt--?At.continue():At.stop()}).then(function(){return At})},ft.start=function(At){function Jt(){if(Ce.result)try{At()}catch(wn){ft.fail(wn)}else ft.done=!0,ft.start=function(){throw new Error("Cursor behind last entry")},ft.stop()}var es=new Promise(function(wn,No){wn=lt(wn),Ce.onerror=vn(No),ft.fail=No,ft.stop=function(Eo){ft.stop=ft.continue=ft.continuePrimaryKey=ft.advance=En,wn(Eo)}});return Ce.onsuccess=lt(function(wn){Ce.onsuccess=Jt,Jt()}),ft.continue=at,ft.continuePrimaryKey=pt,ft.advance=mt,Jt(),es},De(ft)):De(null)},Ie)})},count:function(ae){var ye=ae.query,pe=ae.trans,ve=ye.index,je=ye.range;return new Promise(function(Pe,De){var Ie=pe.objectStore(oe),Ie=ve.isPrimaryKey?Ie:Ie.index(ve.name),Ue=w(je),Ue=Ue?Ie.count(Ue):Ie.count();Ue.onsuccess=lt(function(Le){return Pe(Le.target.result)}),Ue.onerror=vn(De)})}}}N=$,R=xo(($=a).objectStoreNames),ne=0<R.length?N.objectStore(R[0]):{};var N,$={schema:{name:$.name,tables:R.map(function(te){return N.objectStore(te)}).map(function(te){var le=te.keyPath,se=te.autoIncrement,ae=m(le),oe={},ae={name:te.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:le==null,compound:ae,keyPath:le,autoIncrement:se,unique:!0,extractKey:yo(le)},indexes:xo(te.indexNames).map(function(ye){return te.index(ye)}).map(function(je){var Pe=je.name,pe=je.unique,ve=je.multiEntry,je=je.keyPath,Pe={name:Pe,compound:m(je),keyPath:je,unique:pe,multiEntry:ve,extractKey:yo(je)};return oe[vs(je)]=Pe}),getIndexByKeyPath:function(ye){return oe[vs(ye)]}};return oe[":id"]=ae.primaryKey,le!=null&&(oe[vs(le)]=ae.primaryKey),ae})},hasGetAll:0<R.length&&"getAll"in ne&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:"getAllRecords"in ne},R=$.schema,ee=$.hasGetAll,ce=$.hasIdb3Features,ne=R.tables.map(S),G={};return ne.forEach(function(te){return G[te.name]=te}),{stack:"dbcore",transaction:a.transaction.bind(a),table:function(te){if(G[te])return G[te];throw new Error("Table '".concat(te,"' not found"))},MIN_KEY:-1/0,MAX_KEY:Or(d),schema:R}}function Ui(a,d,g,w){return g=g.IDBKeyRange,d=Fu(d,g,w),{dbcore:a.dbcore.reduce(function(S,N){return N=N.create,i(i({},S),N(S))},d)}}function vo(a,d){var g=d.db,g=Ui(a._middlewares,g,a._deps,d);a.core=g.dbcore,a.tables.forEach(function(w){var S=w.name;a.core.schema.tables.some(function(N){return N.name===S})&&(w.core=a.core.table(S),a[S]instanceof a.Table)&&(a[S].core=w.core)})}function qo(a,d,g,w){g.forEach(function(S){var N=w[S];d.forEach(function($){var R=(function ee(ce,ne){return A(ce,ne)||(ce=b(ce))&&ee(ce,ne)})($,S);(!R||"value"in R&&R.value===void 0)&&($===a.Transaction.prototype||$ instanceof a.Transaction?C($,S,{get:function(){return this.table(S)},set:function(ee){j(this,S,{value:ee,writable:!0,configurable:!0,enumerable:!0})}}):$[S]=new a.Table(S,N))})})}function Qs(a,d){d.forEach(function(g){for(var w in g)g[w]instanceof a.Table&&delete g[w]})}function eo(a,d){return a._cfg.version-d._cfg.version}function Ki(a,d,g,w){var S=a._dbSchema,N=(g.objectStoreNames.contains("$meta")&&!S.$meta&&(S.$meta=Vi("$meta",Zs("")[0],[]),a._storeNames.push("$meta")),a._createTransaction("readwrite",a._storeNames,S)),$=(N.create(g),N._completion.catch(w),N._reject.bind(N)),R=We.transless||We;Fn(function(){if(We.trans=N,We.transless=R,d!==0)return vo(a,g),ce=d,((ee=N).storeNames.includes("$meta")?ee.table("$meta").get("version").then(function(ne){return ne??ce}):Ve.resolve(ce)).then(function(ae){var G=a,te=ae,le=N,se=g,oe=[],ae=G._versions,ye=G._dbSchema=un(0,G.idbdb,se);return(ae=ae.filter(function(pe){return pe._cfg.version>=te})).length===0?Ve.resolve():(ae.forEach(function(pe){oe.push(function(){var ve,je,Pe,De=ye,Ie=pe._cfg.dbschema,Ue=(Rr(G,De,se),Rr(G,Ie,se),ye=G._dbSchema=Ie,Js(De,Ie)),Le=(Ue.add.forEach(function(Ye){Wo(se,Ye[0],Ye[1].primKey,Ye[1].indexes)}),Ue.change.forEach(function(Ye){if(Ye.recreate)throw new Ee.Upgrade("Not yet support for changing primary key");var Ce=se.objectStore(Ye.name);Ye.add.forEach(function(it){return bs(Ce,it)}),Ye.change.forEach(function(it){Ce.deleteIndex(it.name),bs(Ce,it)}),Ye.del.forEach(function(it){return Ce.deleteIndex(it)})}),pe._cfg.contentUpgrade);if(Le&&pe._cfg.version>te)return vo(G,se),le._memoizedTables={},ve=Z(Ie),Ue.del.forEach(function(Ye){ve[Ye]=De[Ye]}),Qs(G,[G.Transaction.prototype]),qo(G,[G.Transaction.prototype],f(ve),ve),le.schema=ve,(je=O(Le))&&yr(),Ie=Ve.follow(function(){var Ye;(Pe=Le(le))&&je&&(Ye=Wt.bind(null,null),Pe.then(Ye,Ye))}),Pe&&typeof Pe.then=="function"?Ve.resolve(Pe):Ie.then(function(){return Pe})}),oe.push(function(ve){var je,Pe,De=pe._cfg.dbschema;je=De,Pe=ve,[].slice.call(Pe.db.objectStoreNames).forEach(function(Ie){return je[Ie]==null&&Pe.db.deleteObjectStore(Ie)}),Qs(G,[G.Transaction.prototype]),qo(G,[G.Transaction.prototype],G._storeNames,G._dbSchema),le.schema=G._dbSchema}),oe.push(function(ve){G.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(G.idbdb.version/10)===pe._cfg.version?(G.idbdb.deleteObjectStore("$meta"),delete G._dbSchema.$meta,G._storeNames=G._storeNames.filter(function(je){return je!=="$meta"})):ve.objectStore("$meta").put(pe._cfg.version,"version"))})}),(function pe(){return oe.length?Ve.resolve(oe.shift()(le.idbtrans)).then(pe):Ve.resolve()})().then(function(){ws(ye,se)}))}).catch($);var ee,ce;f(S).forEach(function(ne){Wo(g,ne,S[ne].primKey,S[ne].indexes)}),vo(a,g),Ve.follow(function(){return a.on.populate.fire(N)}).catch($)})}function Gs(a,d){ws(a._dbSchema,d),d.db.version%10!=0||d.objectStoreNames.contains("$meta")||d.db.createObjectStore("$meta").add(Math.ceil(d.db.version/10-1),"version");var g=un(0,a.idbdb,d);Rr(a,a._dbSchema,d);for(var w=0,S=Js(g,a._dbSchema).change;w<S.length;w++){var N=($=>{if($.change.length||$.recreate)return console.warn("Unable to patch indexes of table ".concat($.name," because it has changes on the type of index or primary key.")),{value:void 0};var R=d.objectStore($.name);$.add.forEach(function(ee){vt&&console.debug("Dexie upgrade patch: Creating missing index ".concat($.name,".").concat(ee.src)),bs(R,ee)})})(S[w]);if(typeof N=="object")return N.value}}function Js(a,d){var g,w={del:[],add:[],change:[]};for(g in a)d[g]||w.del.push(g);for(g in d){var S=a[g],N=d[g];if(S){var $={name:g,def:N,recreate:!1,del:[],add:[],change:[]};if(""+(S.primKey.keyPath||"")!=""+(N.primKey.keyPath||"")||S.primKey.auto!==N.primKey.auto)$.recreate=!0,w.change.push($);else{var R=S.idxByName,ee=N.idxByName,ce=void 0;for(ce in R)ee[ce]||$.del.push(ce);for(ce in ee){var ne=R[ce],G=ee[ce];ne?ne.src!==G.src&&$.change.push(G):$.add.push(G)}(0<$.del.length||0<$.add.length||0<$.change.length)&&w.change.push($)}}else w.add.push([g,N])}return w}function Wo(a,d,g,w){var S=a.db.createObjectStore(d,g.keyPath?{keyPath:g.keyPath,autoIncrement:g.auto}:{autoIncrement:g.auto});w.forEach(function(N){return bs(S,N)})}function ws(a,d){f(a).forEach(function(g){d.db.objectStoreNames.contains(g)||(vt&&console.debug("Dexie: Creating missing table",g),Wo(d,g,a[g].primKey,a[g].indexes))})}function bs(a,d){a.createIndex(d.name,d.keyPath,{unique:d.unique,multiEntry:d.multi})}function un(a,d,g){var w={};return V(d.objectStoreNames,0).forEach(function(S){for(var N=g.objectStore(S),$=Ko(Hi(ce=N.keyPath),ce||"",!0,!1,!!N.autoIncrement,ce&&typeof ce!="string",!0),R=[],ee=0;ee<N.indexNames.length;++ee){var ne=N.index(N.indexNames[ee]),ce=ne.keyPath,ne=Ko(ne.name,ce,!!ne.unique,!!ne.multiEntry,!1,ce&&typeof ce!="string",!1);R.push(ne)}w[S]=Vi(S,$,R)}),w}function Rr(a,d,g){for(var w=g.db.objectStoreNames,S=0;S<w.length;++S){var N=w[S],$=g.objectStore(N);a._hasGetAll="getAll"in $;for(var R=0;R<$.indexNames.length;++R){var ee,ce=$.indexNames[R],ne=$.index(ce).keyPath,ne=typeof ne=="string"?ne:"["+V(ne).join("+")+"]";d[N]&&(ee=d[N].idxByName[ne])&&(ee.name=ce,delete d[N].idxByName[ne],d[N].idxByName[ce]=ee)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&c.WorkerGlobalScope&&c instanceof c.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(a._hasGetAll=!1)}function Zs(a){return a.split(",").map(function(d,g){var S=d.split(":"),w=(w=S[1])==null?void 0:w.trim(),S=(d=S[0].trim()).replace(/([&*]|\+\+)/g,""),N=/^\[/.test(S)?S.match(/^\[(.*)\]$/)[1].split("+"):S;return Ko(S,N||null,/\&/.test(d),/\*/.test(d),/\+\+/.test(d),m(N),g===0,w)})}Yo.prototype._createTableSchema=Vi,Yo.prototype._parseIndexSyntax=Zs,Yo.prototype._parseStoresSpec=function(a,d){var g=this;f(a).forEach(function(w){if(a[w]!==null){var S=g._parseIndexSyntax(a[w]),N=S.shift();if(!N)throw new Ee.Schema("Invalid schema for table "+w+": "+a[w]);if(N.unique=!0,N.multi)throw new Ee.Schema("Primary key cannot be multiEntry*");S.forEach(function($){if($.auto)throw new Ee.Schema("Only primary key can be marked as autoIncrement (++)");if(!$.keyPath)throw new Ee.Schema("Index must have a name and cannot be an empty string")}),N=g._createTableSchema(w,N,S),d[w]=N}})},Yo.prototype.stores=function(g){var d=this.db,g=(this._cfg.storesSource=this._cfg.storesSource?y(this._cfg.storesSource,g):g,d._versions),w={},S={};return g.forEach(function(N){y(w,N._cfg.storesSource),S=N._cfg.dbschema={},N._parseStoresSpec(w,S)}),d._dbSchema=S,Qs(d,[d._allTables,d,d.Transaction.prototype]),qo(d,[d._allTables,d,d.Transaction.prototype,this._cfg.tables],f(S),S),d._storeNames=f(S),this},Yo.prototype.upgrade=function(a){return this._cfg.contentUpgrade=xt(this._cfg.contentUpgrade||He,a),this};var ks=Yo;function Yo(){}var wo=(()=>{var a,d,g;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(a=new Set,d=new FinalizationRegistry(function(w){a.delete(w)}),{toArray:function(){return Array.from(a).map(function(w){return w.deref()}).filter(function(w){return w!==void 0})},add:function(w){var S=new WeakRef(w._novip);a.add(S),d.register(w._novip,S,S),a.size>w._options.maxConnections&&(S=a.values().next().value,a.delete(S),d.unregister(S))},remove:function(w){if(w)for(var S=a.values(),N=S.next();!N.done;){var $=N.value;if($.deref()===w._novip)return a.delete($),void d.unregister($);N=S.next()}}}):(g=[],{toArray:function(){return g},add:function(w){g.push(w._novip)},remove:function(w){w&&(w=g.indexOf(w._novip))!==-1&&g.splice(w,1)}})})();function _s(a,d){var g=a._dbNamesDB;return g||(g=a._dbNamesDB=new Dr(vr,{addons:[],indexedDB:a,IDBKeyRange:d})).version(1).stores({dbnames:"name"}),g.table("dbnames")}function bo(a){return a&&typeof a.databases=="function"}function Xo(a){return Fn(function(){return We.letThrough=!0,a()})}function ei(a){return!("from"in a)}var cn=function(a,d){var g;if(!this)return g=new cn,a&&"d"in a&&y(g,a),g;y(this,arguments.length?{d:1,from:a,to:1<arguments.length?d:a}:{d:0})};function Ss(a,d,g){var w=ht(d,g);if(!isNaN(w)){if(0<w)throw RangeError();if(ei(a))return y(a,{from:d,to:g,d:1});var w=a.l,S=a.r;if(ht(g,a.from)<0)return w?Ss(w,d,g):a.l={from:d,to:g,d:1,l:null,r:null},qa(a);if(0<ht(d,a.to))return S?Ss(S,d,g):a.r={from:d,to:g,d:1,l:null,r:null},qa(a);ht(d,a.from)<0&&(a.from=d,a.l=null,a.d=S?S.d+1:1),0<ht(g,a.to)&&(a.to=g,a.r=null,a.d=a.l?a.l.d+1:1),d=!a.r,w&&!a.l&&Ns(a,w),S&&d&&Ns(a,S)}}function Ns(a,d){ei(d)||(function g(w,S){var N=S.from,$=S.l,R=S.r;Ss(w,N,S.to),$&&g(w,$),R&&g(w,R)})(a,d)}function ti(a,d){var g=ni(d),w=g.next();if(!w.done)for(var S=w.value,N=ni(a),$=N.next(S.from),R=$.value;!w.done&&!$.done;){if(ht(R.from,S.to)<=0&&0<=ht(R.to,S.from))return!0;ht(S.from,R.from)<0?S=(w=g.next(R.from)).value:R=($=N.next(S.from)).value}return!1}function ni(a){var d=ei(a)?null:{s:0,n:a};return{next:function(g){for(var w=0<arguments.length;d;)switch(d.s){case 0:if(d.s=1,w)for(;d.n.l&&ht(g,d.n.from)<0;)d={up:d,n:d.n.l,s:1};else for(;d.n.l;)d={up:d,n:d.n.l,s:1};case 1:if(d.s=2,!w||ht(g,d.n.to)<=0)return{value:d.n,done:!1};case 2:if(d.n.r){d.s=3,d={up:d,n:d.n.r,s:0};continue}case 3:d=d.up}return{done:!0}}}}function qa(a){var d,g,w,S=(((S=a.r)==null?void 0:S.d)||0)-(((S=a.l)==null?void 0:S.d)||0),S=1<S?"r":S<-1?"l":"";S&&(d=S=="r"?"l":"r",g=i({},a),w=a[S],a.from=w.from,a.to=w.to,a[S]=w[S],g[S]=w[d],(a[d]=g).d=Wa(g)),a.d=Wa(a)}function Wa(g){var d=g.r,g=g.l;return(d?g?Math.max(d.d,g.d):d.d:g?g.d:0)+1}function ri(a,d){return f(d).forEach(function(g){a[g]?Ns(a[g],d[g]):a[g]=(function w(S){var N,$,R={};for(N in S)v(S,N)&&($=S[N],R[N]=!$||typeof $!="object"||X.has($.constructor)?$:w($));return R})(d[g])}),a}function qi(a,d){return a.all||d.all||Object.keys(a).some(function(g){return d[g]&&ti(d[g],a[g])})}k(cn.prototype,((Pt={add:function(a){return Ns(this,a),this},addKey:function(a){return Ss(this,a,a),this},addKeys:function(a){var d=this;return a.forEach(function(g){return Ss(d,g,g)}),this},hasKey:function(a){var d=ni(this).next(a).value;return d&&ht(d.from,a)<=0&&0<=ht(d.to,a)}})[Q]=function(){return ni(this)},Pt));var to={},Wi={},Yi=!1;function oi(a){ri(Wi,a),Yi||(Yi=!0,setTimeout(function(){Yi=!1,Xi(Wi,!(Wi={}))},0))}function Xi(a,d){d===void 0&&(d=!1);var g=new Set;if(a.all)for(var w=0,S=Object.values(to);w<S.length;w++)si(R=S[w],a,g,d);else for(var N in a){var $,R,N=/^idb\:\/\/(.*)\/(.*)\//.exec(N);N&&($=N[1],N=N[2],R=to["idb://".concat($,"/").concat(N)])&&si(R,a,g,d)}g.forEach(function(ee){return ee()})}function si(a,d,g,w){for(var S=[],N=0,$=Object.entries(a.queries.query);N<$.length;N++){for(var R=$[N],ee=R[0],ce=[],ne=0,G=R[1];ne<G.length;ne++){var te=G[ne];qi(d,te.obsSet)?te.subscribers.forEach(function(ae){return g.add(ae)}):w&&ce.push(te)}w&&S.push([ee,ce])}if(w)for(var le=0,se=S;le<se.length;le++){var oe=se[le],ee=oe[0],ce=oe[1];a.queries.query[ee]=ce}}function Hu(a){var d=a._state,g=a._deps.indexedDB;if(d.isBeingOpened||a.idbdb)return d.dbReadyPromise.then(function(){return d.dbOpenError?Mt(d.dbOpenError):a});d.isBeingOpened=!0,d.dbOpenError=null,d.openComplete=!1;var w=d.openCanceller,S=Math.round(10*a.verno),N=!1;function $(){if(d.openCanceller!==w)throw new Ee.DatabaseClosed("db.open() was cancelled")}function R(){return new Ve(function(te,le){if($(),!g)throw new Ee.MissingAPI;var se=a.name,oe=d.autoSchema||!S?g.open(se):g.open(se,S);if(!oe)throw new Ee.MissingAPI;oe.onerror=vn(le),oe.onblocked=lt(a._fireOnBlocked),oe.onupgradeneeded=lt(function(ae){var ye;ne=oe.transaction,d.autoSchema&&!a._options.allowEmptyDB?(oe.onerror=Kn,ne.abort(),oe.result.close(),(ye=g.deleteDatabase(se)).onsuccess=ye.onerror=lt(function(){le(new Ee.NoSuchDatabase("Database ".concat(se," doesnt exist")))})):(ne.onerror=vn(le),ye=ae.oldVersion>Math.pow(2,62)?0:ae.oldVersion,G=ye<1,a.idbdb=oe.result,N&&Gs(a,ne),Ki(a,ye/10,ne,le))},le),oe.onsuccess=lt(function(){ne=null;var ae,ye,pe,ve,je,Pe,De=a.idbdb=oe.result,Ie=V(De.objectStoreNames);if(0<Ie.length)try{var Ue=De.transaction((je=Ie).length===1?je[0]:je,"readonly");if(d.autoSchema)Pe=De,ve=Ue,(pe=a).verno=Pe.version/10,ve=pe._dbSchema=un(0,Pe,ve),pe._storeNames=V(Pe.objectStoreNames,0),qo(pe,[pe._allTables],f(ve),ve);else if(Rr(a,a._dbSchema,Ue),ye=Ue,((ye=Js(un(0,(ae=a).idbdb,ye),ae._dbSchema)).add.length||ye.change.some(function(Le){return Le.add.length||Le.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(),S=De.version+1,N=!0,te(R());vo(a,Ue)}catch{}wo.add(a),De.onversionchange=lt(function(Le){d.vcFired=!0,a.on("versionchange").fire(Le)}),De.onclose=lt(function(){a.close({disableAutoOpen:!1})}),G&&(Ie=a._deps,je=se,bo(Pe=Ie.indexedDB)||je===vr||_s(Pe,Ie.IDBKeyRange).put({name:je}).catch(He)),te()},le)}).catch(function(te){switch(te==null?void 0:te.name){case"UnknownError":if(0<d.PR1398_maxLoop)return d.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),R();break;case"VersionError":if(0<S)return S=0,R()}return Ve.reject(te)})}var ee,ce=d.dbReadyResolve,ne=null,G=!1;return Ve.race([w,(typeof navigator>"u"?Ve.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(te){function le(){return indexedDB.databases().finally(te)}ee=setInterval(le,100),le()}).finally(function(){return clearInterval(ee)}):Promise.resolve()).then(R)]).then(function(){return $(),d.onReadyBeingFired=[],Ve.resolve(Xo(function(){return a.on.ready.fire(a.vip)})).then(function te(){var le;if(0<d.onReadyBeingFired.length)return le=d.onReadyBeingFired.reduce(xt,He),d.onReadyBeingFired=[],Ve.resolve(Xo(function(){return le(a.vip)})).then(te)})}).finally(function(){d.openCanceller===w&&(d.onReadyBeingFired=null,d.isBeingOpened=!1)}).catch(function(te){d.dbOpenError=te;try{ne&&ne.abort()}catch{}return w===d.openCanceller&&a._close(),Mt(te)}).finally(function(){d.openComplete=!0,ce()}).then(function(){var te;return G&&(te={},a.tables.forEach(function(le){le.schema.indexes.forEach(function(se){se.name&&(te["idb://".concat(a.name,"/").concat(le.name,"/").concat(se.name)]=new cn(-1/0,[[[]]]))}),te["idb://".concat(a.name,"/").concat(le.name,"/")]=te["idb://".concat(a.name,"/").concat(le.name,"/:dels")]=new cn(-1/0,[[[]]])}),qn(xs).fire(te),Xi(te,!0)),a})}function Qi(a){function d(N){return a.next(N)}var g=S(d),w=S(function(N){return a.throw(N)});function S(N){return function(R){var R=N(R),ee=R.value;return R.done?ee:ee&&typeof ee.then=="function"?ee.then(g,w):m(ee)?Promise.all(ee).then(g,w):g(ee)}}return S(d)()}function ii(a,d,g){for(var w=m(a)?a.slice():[a],S=0;S<g;++S)w.push(d);return w}var Ya={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(a){return i(i({},a),{table:function(w){var g=a.table(w),w=g.schema,S={},N=[];function $(te,le,se){var pe=vs(te),oe=S[pe]=S[pe]||[],ae=te==null?0:typeof te=="string"?1:te.length,ye=0<le,pe=i(i({},se),{name:ye?"".concat(pe,"(virtual-from:").concat(se.name,")"):se.name,lowLevelIndex:se,isVirtual:ye,keyTail:le,keyLength:ae,extractKey:yo(te),unique:!ye&&se.unique});return oe.push(pe),pe.isPrimaryKey||N.push(pe),1<ae&&$(ae===2?te[0]:te.slice(0,ae-1),le+1,se),oe.sort(function(ve,je){return ve.keyTail-je.keyTail}),pe}var R=$(w.primaryKey.keyPath,0,w.primaryKey);S[":id"]=[R];for(var ee=0,ce=w.indexes;ee<ce.length;ee++){var ne=ce[ee];$(ne.keyPath,0,ne)}function G(te){var le,se=te.query.index;return se.isVirtual?i(i({},te),{query:{index:se.lowLevelIndex,range:(le=te.query.range,se=se.keyTail,{type:le.type===1?2:le.type,lower:ii(le.lower,le.lowerOpen?a.MAX_KEY:a.MIN_KEY,se),lowerOpen:!0,upper:ii(le.upper,le.upperOpen?a.MIN_KEY:a.MAX_KEY,se),upperOpen:!0})}}):te}return i(i({},g),{schema:i(i({},w),{primaryKey:R,indexes:N,getIndexByKeyPath:function(te){return(te=S[vs(te)])&&te[0]}}),count:function(te){return g.count(G(te))},query:function(te){return g.query(G(te))},openCursor:function(te){var le=te.query.index,se=le.keyTail,oe=le.keyLength;return le.isVirtual?g.openCursor(G(te)).then(function(ye){return ye&&ae(ye)}):g.openCursor(te);function ae(ye){return Object.create(ye,{continue:{value:function(pe){pe!=null?ye.continue(ii(pe,te.reverse?a.MAX_KEY:a.MIN_KEY,se)):te.unique?ye.continue(ye.key.slice(0,oe).concat(te.reverse?a.MIN_KEY:a.MAX_KEY,se)):ye.continue()}},continuePrimaryKey:{value:function(pe,ve){ye.continuePrimaryKey(ii(pe,a.MAX_KEY,se),ve)}},primaryKey:{get:function(){return ye.primaryKey}},key:{get:function(){var pe=ye.key;return oe===1?pe[0]:pe.slice(0,oe)}},value:{get:function(){return ye.value}}})}}})}})}};function Gi(a,d,g,w){return g=g||{},w=w||"",f(a).forEach(function(S){var N,$,R;v(d,S)?(N=a[S],$=d[S],typeof N=="object"&&typeof $=="object"&&N&&$?(R=ue(N))!==ue($)?g[w+S]=d[S]:R==="Object"?Gi(N,$,g,w+S+"."):N!==$&&(g[w+S]=d[S]):N!==$&&(g[w+S]=d[S])):g[w+S]=void 0}),f(d).forEach(function(S){v(a,S)||(g[w+S]=d[S])}),g}function Ji(a,d){return d.type==="delete"?d.keys:d.keys||d.values.map(a.extractKey)}var Vu={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(a){return i(i({},a),{table:function(d){var g=a.table(d),w=g.schema.primaryKey;return i(i({},g),{mutate:function(S){var N=We.trans,$=N.table(d).hook,R=$.deleting,ee=$.creating,ce=$.updating;switch(S.type){case"add":if(ee.fire===He)break;return N._promise("readwrite",function(){return ne(S)},!0);case"put":if(ee.fire===He&&ce.fire===He)break;return N._promise("readwrite",function(){return ne(S)},!0);case"delete":if(R.fire===He)break;return N._promise("readwrite",function(){return ne(S)},!0);case"deleteRange":if(R.fire===He)break;return N._promise("readwrite",function(){return(function G(te,le,se){return g.query({trans:te,values:!1,query:{index:w,range:le},limit:se}).then(function(oe){var ae=oe.result;return ne({type:"delete",keys:ae,trans:te}).then(function(ye){return 0<ye.numFailures?Promise.reject(ye.failures[0]):ae.length<se?{failures:[],numFailures:0,lastResult:void 0}:G(te,i(i({},le),{lower:ae[ae.length-1],lowerOpen:!0}),se)})})})(S.trans,S.range,1e4)},!0)}return g.mutate(S);function ne(G){var te,le,se,oe=We.trans,ae=G.keys||Ji(w,G);if(ae)return(G=G.type==="add"||G.type==="put"?i(i({},G),{keys:ae}):i({},G)).type!=="delete"&&(G.values=l([],G.values)),G.keys&&(G.keys=l([],G.keys)),te=g,se=ae,((le=G).type==="add"?Promise.resolve([]):te.getMany({trans:le.trans,keys:se,cache:"immutable"})).then(function(ye){var pe=ae.map(function(ve,je){var Pe,De,Ie,Ue=ye[je],Le={onerror:null,onsuccess:null};return G.type==="delete"?R.fire.call(Le,ve,Ue,oe):G.type==="add"||Ue===void 0?(Pe=ee.fire.call(Le,ve,G.values[je],oe),ve==null&&Pe!=null&&(G.keys[je]=ve=Pe,w.outbound||W(G.values[je],w.keyPath,ve))):(Pe=Gi(Ue,G.values[je]),(De=ce.fire.call(Le,Pe,ve,Ue,oe))&&(Ie=G.values[je],Object.keys(De).forEach(function(Ye){v(Ie,Ye)?Ie[Ye]=De[Ye]:W(Ie,Ye,De[Ye])}))),Le});return g.mutate(G).then(function(ve){for(var je=ve.failures,Pe=ve.results,De=ve.numFailures,ve=ve.lastResult,Ie=0;Ie<ae.length;++Ie){var Ue=(Pe||ae)[Ie],Le=pe[Ie];Ue==null?Le.onerror&&Le.onerror(je[Ie]):Le.onsuccess&&Le.onsuccess(G.type==="put"&&ye[Ie]?G.values[Ie]:Ue)}return{failures:je,results:Pe,numFailures:De,lastResult:ve}}).catch(function(ve){return pe.forEach(function(je){return je.onerror&&je.onerror(ve)}),Promise.reject(ve)})});throw new Error("Keys missing")}}})}})}};function Xa(a,d,g){try{if(!d||d.keys.length<a.length)return null;for(var w=[],S=0,N=0;S<d.keys.length&&N<a.length;++S)ht(d.keys[S],a[N])===0&&(w.push(g?be(d.values[S]):d.values[S]),++N);return w.length===a.length?w:null}catch{return null}}var Uu={stack:"dbcore",level:-1,create:function(a){return{table:function(d){var g=a.table(d);return i(i({},g),{getMany:function(w){var S;return w.cache?(S=Xa(w.keys,w.trans._cache,w.cache==="clone"))?Ve.resolve(S):g.getMany(w).then(function(N){return w.trans._cache={keys:w.keys,values:w.cache==="clone"?be(N):N},N}):g.getMany(w)},mutate:function(w){return w.type!=="add"&&(w.trans._cache=null),g.mutate(w)}})}}}};function Qa(a,d){return a.trans.mode==="readonly"&&!!a.subscr&&!a.trans.explicit&&a.trans.db._options.cache!=="disabled"&&!d.schema.primaryKey.outbound}function Ga(a,d){switch(a){case"query":return d.values&&!d.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Zi={stack:"dbcore",level:0,name:"Observability",create:function(a){var d=a.schema.name,g=new cn(a.MIN_KEY,a.MAX_KEY);return i(i({},a),{transaction:function(w,S,N){if(We.subscr&&S!=="readonly")throw new Ee.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(We.querier));return a.transaction(w,S,N)},table:function(w){function S(ae){var oe,ae=ae.query;return[oe=ae.index,new cn((oe=(ae=ae.range).lower)!=null?oe:a.MIN_KEY,(oe=ae.upper)!=null?oe:a.MAX_KEY)]}var N=a.table(w),$=N.schema,R=$.primaryKey,ee=$.indexes,ce=R.extractKey,ne=R.outbound,G=R.autoIncrement&&ee.filter(function(se){return se.compound&&se.keyPath.includes(R.keyPath)}),te=i(i({},N),{mutate:function(se){function oe(Ce){return Ce="idb://".concat(d,"/").concat(w,"/").concat(Ce),je[Ce]||(je[Ce]=new cn)}var ae,ye,pe,ve=se.trans,je=se.mutatedParts||(se.mutatedParts={}),Pe=oe(""),De=oe(":dels"),Ie=se.type,Le=se.type==="deleteRange"?[se.range]:se.type==="delete"?[se.keys]:se.values.length<50?[Ji(R,se).filter(function(Ce){return Ce}),se.values]:[],Ue=Le[0],Le=Le[1],Ye=se.trans._cache;return m(Ue)?(Pe.addKeys(Ue),(Ie=Ie==="delete"||Ue.length===Le.length?Xa(Ue,Ye):null)||De.addKeys(Ue),(Ie||Le)&&(ae=oe,ye=Ie,pe=Le,$.indexes.forEach(function(Ce){var it=ae(Ce.name||"");function at(mt){return mt!=null?Ce.extractKey(mt):null}function pt(mt){Ce.multiEntry&&m(mt)?mt.forEach(function(En){return it.addKey(En)}):it.addKey(mt)}(ye||pe).forEach(function(mt,At){var ft=ye&&at(ye[At]),At=pe&&at(pe[At]);ht(ft,At)!==0&&(ft!=null&&pt(ft),At!=null)&&pt(At)})}))):Ue?(Le={from:(Ye=Ue.lower)!=null?Ye:a.MIN_KEY,to:(Ie=Ue.upper)!=null?Ie:a.MAX_KEY},De.add(Le),Pe.add(Le)):(Pe.add(g),De.add(g),$.indexes.forEach(function(Ce){return oe(Ce.name).add(g)})),N.mutate(se).then(function(Ce){return!Ue||se.type!=="add"&&se.type!=="put"||(Pe.addKeys(Ce.results),G&&G.forEach(function(it){for(var at=se.values.map(function(ft){return it.extractKey(ft)}),pt=it.keyPath.findIndex(function(ft){return ft===R.keyPath}),mt=0,En=Ce.results.length;mt<En;++mt)at[mt][pt]=Ce.results[mt];oe(it.name).addKeys(at)})),ve.mutatedParts=ri(ve.mutatedParts||{},je),Ce})}}),le={get:function(se){return[R,new cn(se.key)]},getMany:function(se){return[R,new cn().addKeys(se.keys)]},count:S,query:S,openCursor:S};return f(le).forEach(function(se){te[se]=function(oe){var ae=We.subscr,ye=!!ae,pe=Qa(We,N)&&Ga(se,oe)?oe.obsSet={}:ae;if(ye){var ve,ae=function(Le){return Le="idb://".concat(d,"/").concat(w,"/").concat(Le),pe[Le]||(pe[Le]=new cn)},je=ae(""),Pe=ae(":dels"),ye=le[se](oe),De=ye[0],ye=ye[1];if((se==="query"&&De.isPrimaryKey&&!oe.values?Pe:ae(De.name||"")).add(ye),!De.isPrimaryKey){if(se!=="count")return ve=se==="query"&&ne&&oe.values&&N.query(i(i({},oe),{values:!1})),N[se].apply(this,arguments).then(function(Le){if(se==="query"){if(ne&&oe.values)return ve.then(function(at){return at=at.result,je.addKeys(at),Le});var Ye=oe.values?Le.result.map(ce):Le.result;(oe.values?je:Pe).addKeys(Ye)}else{var Ce,it;if(se==="openCursor")return it=oe.values,(Ce=Le)&&Object.create(Ce,{key:{get:function(){return Pe.addKey(Ce.primaryKey),Ce.key}},primaryKey:{get:function(){var at=Ce.primaryKey;return Pe.addKey(at),at}},value:{get:function(){return it&&je.addKey(Ce.primaryKey),Ce.value}}})}return Le});Pe.add(g)}}return N[se].apply(this,arguments)}}),te}})}};function Qo(a,d,g){var w;return g.numFailures===0?d:d.type==="deleteRange"||(w=d.keys?d.keys.length:"values"in d&&d.values?d.values.length:1,g.numFailures===w)?null:(w=i({},d),m(w.keys)&&(w.keys=w.keys.filter(function(S,N){return!(N in g.failures)})),"values"in w&&m(w.values)&&(w.values=w.values.filter(function(S,N){return!(N in g.failures)})),w)}function ea(a,d){return g=a,((w=d).lower===void 0||(w.lowerOpen?0<ht(g,w.lower):0<=ht(g,w.lower)))&&(g=a,(w=d).upper===void 0||(w.upperOpen?ht(g,w.upper)<0:ht(g,w.upper)<=0));var g,w}function ta(a,d,g,w,S,N){var $,R,ee,ce,ne,G,te;return!g||g.length===0||($=d.query.index,R=$.multiEntry,ee=d.query.range,ce=w.schema.primaryKey.extractKey,ne=$.extractKey,G=($.lowLevelIndex||$).extractKey,(w=g.reduce(function(le,se){var oe=le,ae=[];if(se.type==="add"||se.type==="put")for(var ye=new cn,pe=se.values.length-1;0<=pe;--pe){var ve,je=se.values[pe],Pe=ce(je);!ye.hasKey(Pe)&&(ve=ne(je),R&&m(ve)?ve.some(function(Ye){return ea(Ye,ee)}):ea(ve,ee))&&(ye.addKey(Pe),ae.push(je))}switch(se.type){case"add":var De=new cn().addKeys(d.values?le.map(function(Ce){return ce(Ce)}):le),oe=le.concat(d.values?ae.filter(function(Ce){return Ce=ce(Ce),!De.hasKey(Ce)&&(De.addKey(Ce),!0)}):ae.map(function(Ce){return ce(Ce)}).filter(function(Ce){return!De.hasKey(Ce)&&(De.addKey(Ce),!0)}));break;case"put":var Ie=new cn().addKeys(se.values.map(function(Ce){return ce(Ce)}));oe=le.filter(function(Ce){return!Ie.hasKey(d.values?ce(Ce):Ce)}).concat(d.values?ae:ae.map(function(Ce){return ce(Ce)}));break;case"delete":var Ue=new cn().addKeys(se.keys);oe=le.filter(function(Ce){return!Ue.hasKey(d.values?ce(Ce):Ce)});break;case"deleteRange":var Le=se.range;oe=le.filter(function(Ce){return!ea(ce(Ce),Le)})}return oe},a))===a)?a:(te=function(le,se){return ht(G(le),G(se))||ht(ce(le),ce(se))},w.sort(d.direction==="prev"||d.direction==="prevunique"?function(le,se){return te(se,le)}:te),d.limit&&d.limit<1/0&&(w.length>d.limit?w.length=d.limit:a.length===d.limit&&w.length<d.limit&&(S.dirty=!0)),N?Object.freeze(w):w)}function na(a,d){return ht(a.lower,d.lower)===0&&ht(a.upper,d.upper)===0&&!!a.lowerOpen==!!d.lowerOpen&&!!a.upperOpen==!!d.upperOpen}function Ja(a,d){return((g,w,S,N)=>{if(g===void 0)return w!==void 0?-1:0;if(w===void 0)return 1;if((g=ht(g,w))===0){if(S&&N)return 0;if(S)return 1;if(N)return-1}return g})(a.lower,d.lower,a.lowerOpen,d.lowerOpen)<=0&&0<=((g,w,S,N)=>{if(g===void 0)return w!==void 0?1:0;if(w===void 0)return-1;if((g=ht(g,w))===0){if(S&&N)return 0;if(S)return-1;if(N)return 1}return g})(a.upper,d.upper,a.upperOpen,d.upperOpen)}function Za(a,d,g,w){a.subscribers.add(g),w.addEventListener("abort",function(){var S,N;a.subscribers.delete(g),a.subscribers.size===0&&(S=a,N=d,setTimeout(function(){S.subscribers.size===0&&H(N,S)},3e3))})}var el={stack:"dbcore",level:0,name:"Cache",create:function(a){var d=a.schema.name;return i(i({},a),{transaction:function(g,w,S){var N,$,R=a.transaction(g,w,S);return w==="readwrite"&&(S=(N=new AbortController).signal,R.addEventListener("abort",($=function(ee){return function(){if(N.abort(),w==="readwrite"){for(var ce=new Set,ne=0,G=g;ne<G.length;ne++){var te=G[ne],le=to["idb://".concat(d,"/").concat(te)];if(le){var se=a.table(te),oe=le.optimisticOps.filter(function(Ce){return Ce.trans===R});if(R._explicit&&ee&&R.mutatedParts)for(var ae=0,ye=Object.values(le.queries.query);ae<ye.length;ae++)for(var pe=0,ve=(De=ye[ae]).slice();pe<ve.length;pe++)qi((Ie=ve[pe]).obsSet,R.mutatedParts)&&(H(De,Ie),Ie.subscribers.forEach(function(Ce){return ce.add(Ce)}));else if(0<oe.length){le.optimisticOps=le.optimisticOps.filter(function(Ce){return Ce.trans!==R});for(var je=0,Pe=Object.values(le.queries.query);je<Pe.length;je++)for(var De,Ie,Ue,Le=0,Ye=(De=Pe[je]).slice();Le<Ye.length;Le++)(Ie=Ye[Le]).res!=null&&R.mutatedParts&&(ee&&!Ie.dirty?(Ue=Object.isFrozen(Ie.res),Ue=ta(Ie.res,Ie.req,oe,se,Ie,Ue),Ie.dirty?(H(De,Ie),Ie.subscribers.forEach(function(Ce){return ce.add(Ce)})):Ue!==Ie.res&&(Ie.res=Ue,Ie.promise=Ve.resolve({result:Ue}))):(Ie.dirty&&H(De,Ie),Ie.subscribers.forEach(function(Ce){return ce.add(Ce)})))}}}ce.forEach(function(Ce){return Ce()})}}})(!1),{signal:S}),R.addEventListener("error",$(!1),{signal:S}),R.addEventListener("complete",$(!0),{signal:S})),R},table:function(g){var w=a.table(g),S=w.schema.primaryKey;return i(i({},w),{mutate:function(N){var $,R=We.trans;return!S.outbound&&R.db._options.cache!=="disabled"&&!R.explicit&&R.idbtrans.mode==="readwrite"&&($=to["idb://".concat(d,"/").concat(g)])?(R=w.mutate(N),N.type!=="add"&&N.type!=="put"||!(50<=N.values.length||Ji(S,N).some(function(ee){return ee==null}))?($.optimisticOps.push(N),N.mutatedParts&&oi(N.mutatedParts),R.then(function(ee){0<ee.numFailures&&(H($.optimisticOps,N),(ee=Qo(0,N,ee))&&$.optimisticOps.push(ee),N.mutatedParts)&&oi(N.mutatedParts)}),R.catch(function(){H($.optimisticOps,N),N.mutatedParts&&oi(N.mutatedParts)})):R.then(function(ee){var ce=Qo(0,i(i({},N),{values:N.values.map(function(ne,G){var te;return ee.failures[G]?ne:(W(te=(te=S.keyPath)!=null&&te.includes(".")?be(ne):i({},ne),S.keyPath,ee.results[G]),te)})}),ee);$.optimisticOps.push(ce),queueMicrotask(function(){return N.mutatedParts&&oi(N.mutatedParts)})}),R):w.mutate(N)},query:function(N){var $,R,ee,ce,ne,G,te;return Qa(We,w)&&Ga("query",N)?($=((ee=We.trans)==null?void 0:ee.db._options.cache)==="immutable",R=(ee=We).requery,ee=ee.signal,G=((le,se,oe,ae)=>{var ye=to["idb://".concat(le,"/").concat(se)];if(!ye)return[];if(!(le=ye.queries[oe]))return[null,!1,ye,null];var pe=le[(ae.query?ae.query.index.name:null)||""];if(!pe)return[null,!1,ye,null];switch(oe){case"query":var ve=(je=ae.direction)!=null?je:"next",je=pe.find(function(Pe){var De;return Pe.req.limit===ae.limit&&Pe.req.values===ae.values&&((De=Pe.req.direction)!=null?De:"next")===ve&&na(Pe.req.query.range,ae.query.range)});return je?[je,!0,ye,pe]:[pe.find(function(Pe){var De;return("limit"in Pe.req?Pe.req.limit:1/0)>=ae.limit&&((De=Pe.req.direction)!=null?De:"next")===ve&&(!ae.values||Pe.req.values)&&Ja(Pe.req.query.range,ae.query.range)}),!1,ye,pe];case"count":return je=pe.find(function(Pe){return na(Pe.req.query.range,ae.query.range)}),[je,!!je,ye,pe]}})(d,g,"query",N),te=G[0],ce=G[2],ne=G[3],te&&G[1]?te.obsSet=N.obsSet:(G=w.query(N).then(function(le){var se=le.result;if(te&&(te.res=se),$){for(var oe=0,ae=se.length;oe<ae;++oe)Object.freeze(se[oe]);Object.freeze(se)}else le.result=be(se);return le}).catch(function(le){return ne&&te&&H(ne,te),Promise.reject(le)}),te={obsSet:N.obsSet,promise:G,subscribers:new Set,type:"query",req:N,dirty:!1},ne?ne.push(te):(ne=[te],(ce=ce||(to["idb://".concat(d,"/").concat(g)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[N.query.index.name||""]=ne)),Za(te,ne,R,ee),te.promise.then(function(le){return{result:ta(le.result,N,ce==null?void 0:ce.optimisticOps,w,te,$)}})):w.query(N)}})}})}};function Lr(a,d){return new Proxy(a,{get:function(g,w,S){return w==="db"?d:Reflect.get(g,w,S)}})}Vt.prototype.version=function(a){if(isNaN(a)||a<.1)throw new Ee.Type("Given version is not a positive number");if(a=Math.round(10*a)/10,this.idbdb||this._state.isBeingOpened)throw new Ee.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,a);var d=this._versions,g=d.filter(function(w){return w._cfg.version===a})[0];return g||(g=new this.Version(a),d.push(g),d.sort(eo),g.stores({}),this._state.autoSchema=!1),g},Vt.prototype._whenReady=function(a){var d=this;return this.idbdb&&(this._state.openComplete||We.letThrough||this._vip)?a():new Ve(function(g,w){if(d._state.openComplete)return w(new Ee.DatabaseClosed(d._state.dbOpenError));if(!d._state.isBeingOpened){if(!d._state.autoOpen)return void w(new Ee.DatabaseClosed);d.open().catch(He)}d._state.dbReadyPromise.then(g,w)}).then(a)},Vt.prototype.use=function(S){var d=S.stack,g=S.create,w=S.level,S=S.name,N=(S&&this.unuse({stack:d,name:S}),this._middlewares[d]||(this._middlewares[d]=[]));return N.push({stack:d,create:g,level:w??10,name:S}),N.sort(function($,R){return $.level-R.level}),this},Vt.prototype.unuse=function(a){var d=a.stack,g=a.name,w=a.create;return d&&this._middlewares[d]&&(this._middlewares[d]=this._middlewares[d].filter(function(S){return w?S.create!==w:!!g&&S.name!==g})),this},Vt.prototype.open=function(){var a=this;return Hn(Sn,function(){return Hu(a)})},Vt.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var a=this._state;if(wo.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}a.isBeingOpened||(a.dbReadyPromise=new Ve(function(d){a.dbReadyResolve=d}),a.openCanceller=new Ve(function(d,g){a.cancelOpen=g}))},Vt.prototype.close=function(d){var d=(d===void 0?{disableAutoOpen:!0}:d).disableAutoOpen,g=this._state;d?(g.isBeingOpened&&g.cancelOpen(new Ee.DatabaseClosed),this._close(),g.autoOpen=!1,g.dbOpenError=new Ee.DatabaseClosed):(this._close(),g.autoOpen=this._options.autoOpen||g.isBeingOpened,g.openComplete=!1,g.dbOpenError=null)},Vt.prototype.delete=function(a){var d=this,g=(a===void 0&&(a={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),w=this._state;return new Ve(function(S,N){function $(){d.close(a);var R=d._deps.indexedDB.deleteDatabase(d.name);R.onsuccess=lt(function(){var ee,ce,ne;ee=d._deps,ce=d.name,bo(ne=ee.indexedDB)||ce===vr||_s(ne,ee.IDBKeyRange).delete(ce).catch(He),S()}),R.onerror=vn(N),R.onblocked=d._fireOnBlocked}if(g)throw new Ee.InvalidArgument("Invalid closeOptions argument to db.delete()");w.isBeingOpened?w.dbReadyPromise.then($):$()})},Vt.prototype.backendDB=function(){return this.idbdb},Vt.prototype.isOpen=function(){return this.idbdb!==null},Vt.prototype.hasBeenClosed=function(){var a=this._state.dbOpenError;return a&&a.name==="DatabaseClosed"},Vt.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Vt.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Vt.prototype,"tables",{get:function(){var a=this;return f(this._allTables).map(function(d){return a._allTables[d]})},enumerable:!1,configurable:!0}),Vt.prototype.transaction=function(){var a=(function(d,g,w){var S=arguments.length;if(S<2)throw new Ee.InvalidArgument("Too few arguments");for(var N=new Array(S-1);--S;)N[S-1]=arguments[S];return w=N.pop(),[d,Se(N),w]}).apply(this,arguments);return this._transaction.apply(this,a)},Vt.prototype._transaction=function(a,d,g){var w,S,N=this,$=We.trans,R=($&&$.db===this&&a.indexOf("!")===-1||($=null),a.indexOf("?")!==-1);a=a.replace("!","").replace("?","");try{if(S=d.map(function(ce){if(ce=ce instanceof N.Table?ce.name:ce,typeof ce!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return ce}),a=="r"||a===Tr)w=Tr;else{if(a!="rw"&&a!=wr)throw new Ee.InvalidArgument("Invalid transaction mode: "+a);w=wr}if($){if($.mode===Tr&&w===wr){if(!R)throw new Ee.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");$=null}$&&S.forEach(function(ce){if($&&$.storeNames.indexOf(ce)===-1){if(!R)throw new Ee.SubTransaction("Table "+ce+" not included in parent transaction.");$=null}}),R&&$&&!$.active&&($=null)}}catch(ce){return $?$._promise(null,function(ne,G){G(ce)}):Mt(ce)}var ee=(function ce(ne,G,te,le,se){return Ve.resolve().then(function(){var pe=We.transless||We,oe=ne._createTransaction(G,te,ne._dbSchema,le),pe=(oe.explicit=!0,{trans:oe,transless:pe});if(le)oe.idbtrans=le.idbtrans;else try{oe.create(),oe.idbtrans._explicit=!0,ne._state.PR1398_maxLoop=3}catch(ve){return ve.name===_e.InvalidState&&ne.isOpen()&&0<--ne._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),ne.close({disableAutoOpen:!1}),ne.open().then(function(){return ce(ne,G,te,null,se)})):Mt(ve)}var ae,ye=O(se),pe=(ye&&yr(),Ve.follow(function(){var ve;(ae=se.call(oe,oe))&&(ye?(ve=Wt.bind(null,null),ae.then(ve,ve)):typeof ae.next=="function"&&typeof ae.throw=="function"&&(ae=Qi(ae)))},pe));return(ae&&typeof ae.then=="function"?Ve.resolve(ae).then(function(ve){return oe.active?ve:Mt(new Ee.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):pe.then(function(){return ae})).then(function(ve){return le&&oe._resolve(),oe._completion.then(function(){return ve})}).catch(function(ve){return oe._reject(ve),Mt(ve)})})}).bind(null,this,w,S,$,g);return $?$._promise(w,ee,"lock"):We.trans?Hn(We.transless,function(){return N._whenReady(ee)}):this._whenReady(ee)},Vt.prototype.table=function(a){if(v(this._allTables,a))return this._allTables[a];throw new Ee.InvalidTable("Table ".concat(a," does not exist"))};var Dr=Vt;function Vt(a,d){var g,w,S,N,$,R=this,ee=(this._middlewares={},this.verno=0,Vt.dependencies),ee=(this._options=d=i({addons:Vt.addons,autoOpen:!0,indexedDB:ee.indexedDB,IDBKeyRange:ee.IDBKeyRange,cache:"cloned",maxConnections:1e3},d),this._deps={indexedDB:d.indexedDB,IDBKeyRange:d.IDBKeyRange},d.addons),ce=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:He,dbReadyPromise:null,cancelOpen:He,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:d.autoOpen}),ne=(ce.dbReadyPromise=new Ve(function(G){ce.dbReadyResolve=G}),ce.openCanceller=new Ve(function(G,te){ce.cancelOpen=te}),this._state=ce,this.name=a,this.on=Fe(this,"populate","blocked","versionchange","close",{ready:[xt,He]}),this.once=function(G,te){var le=function(){for(var se=[],oe=0;oe<arguments.length;oe++)se[oe]=arguments[oe];R.on(G).unsubscribe(le),te.apply(R,se)};return R.on(G,le)},this.on.ready.subscribe=P(this.on.ready.subscribe,function(G){return function(te,le){Vt.vip(function(){var se,oe=R._state;oe.openComplete?(oe.dbOpenError||Ve.resolve().then(te),le&&G(te)):oe.onReadyBeingFired?(oe.onReadyBeingFired.push(te),le&&G(te)):(G(te),se=R,le||G(function ae(){se.on.ready.unsubscribe(te),se.on.ready.unsubscribe(ae)}))})}}),this.Collection=(g=this,Je(ys.prototype,function(ae,oe){this.db=g;var le=mo,se=null;if(oe)try{le=oe()}catch(pe){se=pe}var oe=ae._ctx,ae=oe.table,ye=ae.hook.reading.fire;this._ctx={table:ae,index:oe.index,isPrimKey:!oe.index||ae.schema.primKey.keyPath&&oe.index===ae.schema.primKey.name,range:le,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:se,or:oe.or,valueMapper:ye!==Ke?ye:null}})),this.Table=(w=this,Je(L.prototype,function(G,te,le){this.db=w,this._tx=le,this.name=G,this.schema=te,this.hook=w._allTables[G]?w._allTables[G].hook:Fe(null,{creating:[we,He],reading:[ct,Ke],updating:[_t,He],deleting:[tt,He]})})),this.Transaction=(S=this,Je(Bu.prototype,function(G,te,le,se,oe){var ae=this;G!=="readonly"&&te.forEach(function(ye){ye=(ye=le[ye])==null?void 0:ye.yProps,ye&&(te=te.concat(ye.map(function(pe){return pe.updatesTable})))}),this.db=S,this.mode=G,this.storeNames=te,this.schema=le,this.chromeTransactionDurability=se,this.idbtrans=null,this.on=Fe(this,"complete","error","abort"),this.parent=oe||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(ye,pe){ae._resolve=ye,ae._reject=pe}),this._completion.then(function(){ae.active=!1,ae.on.complete.fire()},function(ye){var pe=ae.active;return ae.active=!1,ae.on.error.fire(ye),ae.parent?ae.parent._reject(ye):pe&&ae.idbtrans&&ae.idbtrans.abort(),Mt(ye)})})),this.Version=(N=this,Je(ks.prototype,function(G){this.db=N,this._cfg={version:G,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=($=this,Je(Ar.prototype,function(G,te,le){if(this.db=$,this._ctx={table:G,index:te===":id"?null:te,or:le},this._cmp=this._ascending=ht,this._descending=function(se,oe){return ht(oe,se)},this._max=function(se,oe){return 0<ht(se,oe)?se:oe},this._min=function(se,oe){return ht(se,oe)<0?se:oe},this._IDBKeyRange=$._deps.IDBKeyRange,!this._IDBKeyRange)throw new Ee.MissingAPI})),this.on("versionchange",function(G){0<G.newVersion?console.warn("Another connection wants to upgrade database '".concat(R.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(R.name,"'. Closing db now to resume the delete request.")),R.close({disableAutoOpen:!1})}),this.on("blocked",function(G){!G.newVersion||G.newVersion<G.oldVersion?console.warn("Dexie.delete('".concat(R.name,"') was blocked")):console.warn("Upgrade '".concat(R.name,"' blocked by other connection holding version ").concat(G.oldVersion/10))}),this._maxKey=Or(d.IDBKeyRange),this._createTransaction=function(G,te,le,se){return new R.Transaction(G,te,le,R._options.chromeTransactionDurability,se)},this._fireOnBlocked=function(G){R.on("blocked").fire(G),wo.toArray().filter(function(te){return te.name===R.name&&te!==R&&!te._state.vcFired}).map(function(te){return te.on("versionchange").fire(G)})},this.use(Uu),this.use(el),this.use(Zi),this.use(Ya),this.use(Vu),new Proxy(this,{get:function(G,te,le){var se;return te==="_vip"||(te==="table"?function(oe){return Lr(R.table(oe),ne)}:(se=Reflect.get(G,te,le))instanceof L?Lr(se,ne):te==="tables"?se.map(function(oe){return Lr(oe,ne)}):te==="_createTransaction"?function(){return Lr(se.apply(this,arguments),ne)}:se)}}));this.vip=ne,ee.forEach(function(G){return G(R)})}var ai,ko=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",tl=(_o.prototype.subscribe=function(a,d,g){return this._subscribe(a&&typeof a!="function"?a:{next:a,error:d,complete:g})},_o.prototype[ko]=function(){return this},_o);function _o(a){this._subscribe=a}try{ai={indexedDB:c.indexedDB||c.mozIndexedDB||c.webkitIndexedDB||c.msIndexedDB,IDBKeyRange:c.IDBKeyRange||c.webkitIDBKeyRange}}catch{ai={indexedDB:null,IDBKeyRange:null}}function Go(a){var d,g=!1,w=new tl(function(S){var N=O(a),$,R=!1,ee={},ce={},ne={get closed(){return R},unsubscribe:function(){R||(R=!0,$&&$.abort(),G&&qn.storagemutated.unsubscribe(se))}},G=(S.start&&S.start(ne),!1),te=function(){return Gr(oe)};function le(){return qi(ce,ee)}var se=function(ae){ri(ee,ae),le()&&te()},oe=function(){var ae,ye,pe;!R&&ai.indexedDB&&(ee={},ae={},$&&$.abort(),$=new AbortController,pe=(ve=>{var je=zn();try{N&&yr();var Pe=Fn(a,ve);return Pe=N?Pe.finally(Wt):Pe}finally{je&&Bn()}})(ye={subscr:ae,signal:$.signal,requery:te,querier:a,trans:null}),G||(qn(xs,se),G=!0),Promise.resolve(pe).then(function(ve){g=!0,d=ve,R||ye.signal.aborted||(le()||(ce=ae,le())?te():(ee={},Gr(function(){return!R&&S.next&&S.next(ve)})))},function(ve){g=!1,["DatabaseClosedError","AbortError"].includes(ve==null?void 0:ve.name)||R||Gr(function(){R||S.error&&S.error(ve)})}))};return setTimeout(te,0),ne});return w.hasValue=function(){return g},w.getValue=function(){return d},w}var So=Dr;function Jo(a){var d=zr;try{zr=!0,qn.storagemutated.fire(a),Xi(a,!0)}finally{zr=d}}k(So,i(i({},K),{delete:function(a){return new So(a,{addons:[]}).delete()},exists:function(a){return new So(a,{addons:[]}).open().then(function(d){return d.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(a){try{return d=So.dependencies,g=d.indexedDB,d=d.IDBKeyRange,(bo(g)?Promise.resolve(g.databases()).then(function(w){return w.map(function(S){return S.name}).filter(function(S){return S!==vr})}):_s(g,d).toCollection().primaryKeys()).then(a)}catch{return Mt(new Ee.MissingAPI)}var d,g},defineClass:function(){return function(a){y(this,a)}},ignoreTransaction:function(a){return We.trans?Hn(We.transless||Sn,a):a()},vip:Xo,async:function(a){return function(){try{var d=Qi(a.apply(this,arguments));return d&&typeof d.then=="function"?d:Ve.resolve(d)}catch(g){return Mt(g)}}},spawn:function(a,d,g){try{var w=Qi(a.apply(g,d||[]));return w&&typeof w.then=="function"?w:Ve.resolve(w)}catch(S){return Mt(S)}},currentTransaction:{get:function(){return We.trans||null}},waitFor:function(a,d){return a=Ve.resolve(typeof a=="function"?So.ignoreTransaction(a):a).timeout(d||6e4),We.trans?We.trans.waitFor(a):a},Promise:Ve,debug:{get:function(){return vt},set:function(a){It(a)}},derive:I,extend:y,props:k,override:P,Events:Fe,on:qn,liveQuery:Go,extendObservabilitySet:ri,getByKeyPath:U,setByKeyPath:W,delByKeyPath:function(a,d){typeof d=="string"?W(a,d,void 0):"length"in d&&[].map.call(d,function(g){W(a,g,void 0)})},shallowClone:Z,deepClone:be,getObjectDiff:Gi,cmp:ht,asap:B,minKey:-1/0,addons:[],connections:{get:wo.toArray},errnames:_e,dependencies:ai,cache:to,semVer:"4.4.2",version:"4.4.2".split(".").map(function(a){return parseInt(a)}).reduce(function(a,d,g){return a+d/Math.pow(10,2*g)})})),So.maxKey=Or(So.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(qn(xs,function(a){zr||(a=new CustomEvent(Ys,{detail:a}),zr=!0,dispatchEvent(a),zr=!1)}),addEventListener(Ys,function(a){a=a.detail,zr||Jo(a)}));var Zo,zr=!1,li=function(){};return typeof BroadcastChannel<"u"&&((li=function(){(Zo=new BroadcastChannel(Ys)).onmessage=function(a){return a.data&&Jo(a.data)}})(),typeof Zo.unref=="function"&&Zo.unref(),qn(xs,function(a){zr||Zo.postMessage(a)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(a){if(!Dr.disableBfCache&&a.persisted){vt&&console.debug("Dexie: handling persisted pagehide"),Zo!=null&&Zo.close();for(var d=0,g=wo.toArray();d<g.length;d++)g[d].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(a){!Dr.disableBfCache&&a.persisted&&(vt&&console.debug("Dexie: handling persisted pageshow"),li(),Jo({all:new cn(-1/0,[[]])}))})),Ve.rejectionMapper=function(a,d){return!a||a instanceof Ne||a instanceof TypeError||a instanceof SyntaxError||!a.name||!Ze[a.name]?a:(d=new Ze[a.name](d||a.message,a),"stack"in a&&C(d,"stack",{get:function(){return this.inner.stack}}),d)},It(vt),i(Dr,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:Dr,Entity:gn,PropModification:br,RangeSet:cn,add:function(a){return new br({add:a})},cmp:ht,default:Dr,liveQuery:Go,mergeRanges:Ns,rangesOverlap:ti,remove:function(a){return new br({remove:a})},replacePrefix:function(a,d){return new br({replacePrefix:[a,d]})}}),{default:Dr}),Dr})})(su)),su.exports}var sx=ox();const Ed=Nu(sx),ch=Symbol.for("Dexie"),pu=globalThis[ch]||(globalThis[ch]=Ed);if(Ed.semVer!==pu.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Ed.semVer} and ${pu.semVer}`);const{liveQuery:A2,mergeRanges:O2,rangesOverlap:R2,RangeSet:L2,cmp:D2,Entity:z2,PropModification:B2,replacePrefix:F2,add:H2,remove:V2,DexieYProvider:U2}=pu,jd=500;class ix extends pu{constructor(){super("api-doc-tor");Ds(this,"flows");Ds(this,"testSuites");Ds(this,"environments");Ds(this,"requestPresets");Ds(this,"tryHistory");Ds(this,"kv");this.version(1).stores({flows:"++id, name",testSuites:"++id, name",environments:"++id, name",kv:"key"}),this.version(2).stores({flows:"++id, name",testSuites:"++id, name",environments:"++id, name",requestPresets:"++id, method, path, name",tryHistory:"++id, at, method, path",kv:"key"})}}const nt=new ix,$i="openapiOverride";async function ax(t){await nt.kv.put({key:$i,value:JSON.stringify(t)})}async function dh(){await nt.kv.delete($i)}function Am(t){return{name:t.name,method:t.method,path:t.path,pathVals:{...t.pathVals},queryVals:{...t.queryVals},headerVals:{...t.headerVals},cookieVals:{...t.cookieVals},bodyMode:t.bodyMode,tryBodyRaw:t.tryBodyRaw,bodyVals:{...t.bodyVals}}}function Om(t){return{at:t.at,method:t.method,path:t.path,baseUrl:t.baseUrl,url:t.url,requestHeaders:{...t.requestHeaders},requestBody:t.requestBody,credentials:t.credentials,...t.status!==void 0?{status:t.status}:{},...t.statusText!==void 0?{statusText:t.statusText}:{},...t.responseHeaders!==void 0?{responseHeaders:{...t.responseHeaders}}:{},...t.responseBodyText!==void 0?{responseBodyText:t.responseBodyText}:{},...t.networkError!==void 0?{networkError:t.networkError}:{},...t.tryForm!==void 0?{tryForm:{pathVals:{...t.tryForm.pathVals},queryVals:{...t.tryForm.queryVals},headerVals:{...t.tryForm.headerVals},cookieVals:{...t.tryForm.cookieVals},bodyMode:t.tryForm.bodyMode,tryBodyRaw:t.tryForm.tryBodyRaw,bodyVals:{...t.tryForm.bodyVals}}}:{}}}async function lx(t,r){const o=t.toLowerCase();return nt.requestPresets.where("path").equals(r).filter(i=>i.method.toLowerCase()===o).toArray()}async function ux(t){return nt.requestPresets.add(t)}async function cx(t){await nt.requestPresets.delete(t)}async function Rm(){const t=await nt.tryHistory.count();if(t<=jd)return;const r=t-jd,o=await nt.tryHistory.orderBy("at").limit(r).primaryKeys();await nt.tryHistory.bulkDelete(o)}async function fh(t){await nt.tryHistory.add(t),await Rm()}async function dx(){return nt.tryHistory.orderBy("at").reverse().toArray()}async function fx(){await nt.tryHistory.clear()}async function px(t){await nt.tryHistory.delete(t)}async function hx(){const[t,r,o,i,l,c]=await Promise.all([nt.flows.toArray(),nt.testSuites.toArray(),nt.environments.toArray(),nt.requestPresets.toArray(),nt.tryHistory.toArray(),nt.kv.get($i)]),f=await nt.kv.get("authTokens");let m;try{m=f!=null&&f.value?JSON.parse(f.value):void 0}catch{m=void 0}let y;if(c!=null&&c.value)try{y=JSON.parse(c.value)}catch{y=void 0}return{formatVersion:1,exportedAt:new Date().toISOString(),flows:t,testSuites:r,environments:o,authTokens:m,requestPresets:i.map(Am),tryHistory:l.map(Om),...y!==void 0?{importedOpenApi:y}:{}}}async function Lm(t){await nt.transaction("rw",nt.flows,nt.testSuites,nt.environments,nt.requestPresets,nt.tryHistory,nt.kv,async()=>{await nt.flows.clear(),await nt.testSuites.clear(),await nt.environments.clear(),await nt.requestPresets.clear(),await nt.tryHistory.clear();for(const r of t.flows)await nt.flows.add({name:r.name,steps:r.steps,graph:r.graph});for(const r of t.testSuites)await nt.testSuites.add({name:r.name,cases:r.cases});for(const r of t.environments)await nt.environments.add({name:r.name,baseUrl:r.baseUrl,vars:r.vars??{}});for(const r of t.requestPresets??[])await nt.requestPresets.add(Am(r));for(const r of t.tryHistory??[])await nt.tryHistory.add(Om(r));await Rm(),t.authTokens&&await nt.kv.put({key:"authTokens",value:JSON.stringify(t.authTokens)}),Object.prototype.hasOwnProperty.call(t,"importedOpenApi")&&(t.importedOpenApi===null?await nt.kv.delete($i):t.importedOpenApi!==void 0&&await nt.kv.put({key:$i,value:JSON.stringify(t.importedOpenApi)}))})}async function mx(t){if(t.formatVersion!==1)return!1;const[r,o,i,l]=await Promise.all([nt.flows.count(),nt.testSuites.count(),nt.requestPresets.count(),nt.tryHistory.count()]);return r>0||o>0||i>0||l>0?!1:(await Lm(t),!0)}function gx(t,r,o){var f,m;const i=[],l=r===t.expectStatus;if(i.push(`HTTP ${r} ${l?"✓":`✗ (esperado ${t.expectStatus})`}`),!l)return{pass:!1,lines:i};if((f=t.contains)!=null&&f.trim()){const y=o.includes(t.contains);if(i.push(`Contiene texto "${t.contains}": ${y?"✓":"✗"}`),!y)return{pass:!1,lines:i}}const c=(m=t.jsonPath)==null?void 0:m.trim();if(c){let y;try{y=JSON.parse(o)}catch{return i.push("Body no es JSON válido: ✗"),{pass:!1,lines:i}}const b=Vd(y,c),_=t.expectJsonValue;if(_!==void 0&&_!==""){const v=b==null?String(b):typeof b=="object"?JSON.stringify(b):String(b),k=_.trim(),j=v===k||String(b)===k;if(i.push(`JSON path ${c} → ${v} vs "${k}": ${j?"✓":"✗"}`),!j)return{pass:!1,lines:i}}else{const v=b!=null;if(i.push(`JSON path ${c} existe: ${v?"✓":"✗"}`),!v)return{pass:!1,lines:i}}}return{pass:!0,lines:i}}function en(t){if(typeof t=="string"||typeof t=="number")return""+t;let r="";if(Array.isArray(t))for(let o=0,i;o<t.length;o++)(i=en(t[o]))!==""&&(r+=(r&&" ")+i);else for(let o in t)t[o]&&(r+=(r&&" ")+o);return r}var yx={value:()=>{}};function Pu(){for(var t=0,r=arguments.length,o={},i;t<r;++t){if(!(i=arguments[t]+"")||i in o||/[\s.]/.test(i))throw new Error("illegal type: "+i);o[i]=[]}return new iu(o)}function iu(t){this._=t}function xx(t,r){return t.trim().split(/^|\s+/).map(function(o){var i="",l=o.indexOf(".");if(l>=0&&(i=o.slice(l+1),o=o.slice(0,l)),o&&!r.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:i}})}iu.prototype=Pu.prototype={constructor:iu,on:function(t,r){var o=this._,i=xx(t+"",o),l,c=-1,f=i.length;if(arguments.length<2){for(;++c<f;)if((l=(t=i[c]).type)&&(l=vx(o[l],t.name)))return l;return}if(r!=null&&typeof r!="function")throw new Error("invalid callback: "+r);for(;++c<f;)if(l=(t=i[c]).type)o[l]=ph(o[l],t.name,r);else if(r==null)for(l in o)o[l]=ph(o[l],t.name,null);return this},copy:function(){var t={},r=this._;for(var o in r)t[o]=r[o].slice();return new iu(t)},call:function(t,r){if((l=arguments.length-2)>0)for(var o=new Array(l),i=0,l,c;i<l;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(c=this._[t],i=0,l=c.length;i<l;++i)c[i].value.apply(r,o)},apply:function(t,r,o){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var i=this._[t],l=0,c=i.length;l<c;++l)i[l].value.apply(r,o)}};function vx(t,r){for(var o=0,i=t.length,l;o<i;++o)if((l=t[o]).name===r)return l.value}function ph(t,r,o){for(var i=0,l=t.length;i<l;++i)if(t[i].name===r){t[i]=yx,t=t.slice(0,i).concat(t.slice(i+1));break}return o!=null&&t.push({name:r,value:o}),t}var Cd="http://www.w3.org/1999/xhtml";const hh={svg:"http://www.w3.org/2000/svg",xhtml:Cd,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Mu(t){var r=t+="",o=r.indexOf(":");return o>=0&&(r=t.slice(0,o))!=="xmlns"&&(t=t.slice(o+1)),hh.hasOwnProperty(r)?{space:hh[r],local:t}:t}function wx(t){return function(){var r=this.ownerDocument,o=this.namespaceURI;return o===Cd&&r.documentElement.namespaceURI===Cd?r.createElement(t):r.createElementNS(o,t)}}function bx(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Dm(t){var r=Mu(t);return(r.local?bx:wx)(r)}function kx(){}function Ud(t){return t==null?kx:function(){return this.querySelector(t)}}function _x(t){typeof t!="function"&&(t=Ud(t));for(var r=this._groups,o=r.length,i=new Array(o),l=0;l<o;++l)for(var c=r[l],f=c.length,m=i[l]=new Array(f),y,b,_=0;_<f;++_)(y=c[_])&&(b=t.call(y,y.__data__,_,c))&&("__data__"in y&&(b.__data__=y.__data__),m[_]=b);return new dr(i,this._parents)}function Sx(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Nx(){return[]}function zm(t){return t==null?Nx:function(){return this.querySelectorAll(t)}}function Ex(t){return function(){return Sx(t.apply(this,arguments))}}function jx(t){typeof t=="function"?t=Ex(t):t=zm(t);for(var r=this._groups,o=r.length,i=[],l=[],c=0;c<o;++c)for(var f=r[c],m=f.length,y,b=0;b<m;++b)(y=f[b])&&(i.push(t.call(y,y.__data__,b,f)),l.push(y));return new dr(i,l)}function Bm(t){return function(){return this.matches(t)}}function Fm(t){return function(r){return r.matches(t)}}var Cx=Array.prototype.find;function Px(t){return function(){return Cx.call(this.children,t)}}function Mx(){return this.firstElementChild}function Tx(t){return this.select(t==null?Mx:Px(typeof t=="function"?t:Fm(t)))}var Ix=Array.prototype.filter;function $x(){return Array.from(this.children)}function Ax(t){return function(){return Ix.call(this.children,t)}}function Ox(t){return this.selectAll(t==null?$x:Ax(typeof t=="function"?t:Fm(t)))}function Rx(t){typeof t!="function"&&(t=Bm(t));for(var r=this._groups,o=r.length,i=new Array(o),l=0;l<o;++l)for(var c=r[l],f=c.length,m=i[l]=[],y,b=0;b<f;++b)(y=c[b])&&t.call(y,y.__data__,b,c)&&m.push(y);return new dr(i,this._parents)}function Hm(t){return new Array(t.length)}function Lx(){return new dr(this._enter||this._groups.map(Hm),this._parents)}function hu(t,r){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=r}hu.prototype={constructor:hu,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 Dx(t){return function(){return t}}function zx(t,r,o,i,l,c){for(var f=0,m,y=r.length,b=c.length;f<b;++f)(m=r[f])?(m.__data__=c[f],i[f]=m):o[f]=new hu(t,c[f]);for(;f<y;++f)(m=r[f])&&(l[f]=m)}function Bx(t,r,o,i,l,c,f){var m,y,b=new Map,_=r.length,v=c.length,k=new Array(_),j;for(m=0;m<_;++m)(y=r[m])&&(k[m]=j=f.call(y,y.__data__,m,r)+"",b.has(j)?l[m]=y:b.set(j,y));for(m=0;m<v;++m)j=f.call(t,c[m],m,c)+"",(y=b.get(j))?(i[m]=y,y.__data__=c[m],b.delete(j)):o[m]=new hu(t,c[m]);for(m=0;m<_;++m)(y=r[m])&&b.get(k[m])===y&&(l[m]=y)}function Fx(t){return t.__data__}function Hx(t,r){if(!arguments.length)return Array.from(this,Fx);var o=r?Bx:zx,i=this._parents,l=this._groups;typeof t!="function"&&(t=Dx(t));for(var c=l.length,f=new Array(c),m=new Array(c),y=new Array(c),b=0;b<c;++b){var _=i[b],v=l[b],k=v.length,j=Vx(t.call(_,_&&_.__data__,b,i)),C=j.length,I=m[b]=new Array(C),A=f[b]=new Array(C),T=y[b]=new Array(k);o(_,v,I,A,T,j,r);for(var V=0,P=0,M,B;V<C;++V)if(M=I[V]){for(V>=P&&(P=V+1);!(B=A[P])&&++P<C;);M._next=B||null}}return f=new dr(f,i),f._enter=m,f._exit=y,f}function Vx(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Ux(){return new dr(this._exit||this._groups.map(Hm),this._parents)}function Kx(t,r,o){var i=this.enter(),l=this,c=this.exit();return typeof t=="function"?(i=t(i),i&&(i=i.selection())):i=i.append(t+""),r!=null&&(l=r(l),l&&(l=l.selection())),o==null?c.remove():o(c),i&&l?i.merge(l).order():l}function qx(t){for(var r=t.selection?t.selection():t,o=this._groups,i=r._groups,l=o.length,c=i.length,f=Math.min(l,c),m=new Array(l),y=0;y<f;++y)for(var b=o[y],_=i[y],v=b.length,k=m[y]=new Array(v),j,C=0;C<v;++C)(j=b[C]||_[C])&&(k[C]=j);for(;y<l;++y)m[y]=o[y];return new dr(m,this._parents)}function Wx(){for(var t=this._groups,r=-1,o=t.length;++r<o;)for(var i=t[r],l=i.length-1,c=i[l],f;--l>=0;)(f=i[l])&&(c&&f.compareDocumentPosition(c)^4&&c.parentNode.insertBefore(f,c),c=f);return this}function Yx(t){t||(t=Xx);function r(v,k){return v&&k?t(v.__data__,k.__data__):!v-!k}for(var o=this._groups,i=o.length,l=new Array(i),c=0;c<i;++c){for(var f=o[c],m=f.length,y=l[c]=new Array(m),b,_=0;_<m;++_)(b=f[_])&&(y[_]=b);y.sort(r)}return new dr(l,this._parents).order()}function Xx(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function Qx(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Gx(){return Array.from(this)}function Jx(){for(var t=this._groups,r=0,o=t.length;r<o;++r)for(var i=t[r],l=0,c=i.length;l<c;++l){var f=i[l];if(f)return f}return null}function Zx(){let t=0;for(const r of this)++t;return t}function ev(){return!this.node()}function tv(t){for(var r=this._groups,o=0,i=r.length;o<i;++o)for(var l=r[o],c=0,f=l.length,m;c<f;++c)(m=l[c])&&t.call(m,m.__data__,c,l);return this}function nv(t){return function(){this.removeAttribute(t)}}function rv(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ov(t,r){return function(){this.setAttribute(t,r)}}function sv(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function iv(t,r){return function(){var o=r.apply(this,arguments);o==null?this.removeAttribute(t):this.setAttribute(t,o)}}function av(t,r){return function(){var o=r.apply(this,arguments);o==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,o)}}function lv(t,r){var o=Mu(t);if(arguments.length<2){var i=this.node();return o.local?i.getAttributeNS(o.space,o.local):i.getAttribute(o)}return this.each((r==null?o.local?rv:nv:typeof r=="function"?o.local?av:iv:o.local?sv:ov)(o,r))}function Vm(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function uv(t){return function(){this.style.removeProperty(t)}}function cv(t,r,o){return function(){this.style.setProperty(t,r,o)}}function dv(t,r,o){return function(){var i=r.apply(this,arguments);i==null?this.style.removeProperty(t):this.style.setProperty(t,i,o)}}function fv(t,r,o){return arguments.length>1?this.each((r==null?uv:typeof r=="function"?dv:cv)(t,r,o??"")):Ai(this.node(),t)}function Ai(t,r){return t.style.getPropertyValue(r)||Vm(t).getComputedStyle(t,null).getPropertyValue(r)}function pv(t){return function(){delete this[t]}}function hv(t,r){return function(){this[t]=r}}function mv(t,r){return function(){var o=r.apply(this,arguments);o==null?delete this[t]:this[t]=o}}function gv(t,r){return arguments.length>1?this.each((r==null?pv:typeof r=="function"?mv:hv)(t,r)):this.node()[t]}function Um(t){return t.trim().split(/^|\s+/)}function Kd(t){return t.classList||new Km(t)}function Km(t){this._node=t,this._names=Um(t.getAttribute("class")||"")}Km.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 qm(t,r){for(var o=Kd(t),i=-1,l=r.length;++i<l;)o.add(r[i])}function Wm(t,r){for(var o=Kd(t),i=-1,l=r.length;++i<l;)o.remove(r[i])}function yv(t){return function(){qm(this,t)}}function xv(t){return function(){Wm(this,t)}}function vv(t,r){return function(){(r.apply(this,arguments)?qm:Wm)(this,t)}}function wv(t,r){var o=Um(t+"");if(arguments.length<2){for(var i=Kd(this.node()),l=-1,c=o.length;++l<c;)if(!i.contains(o[l]))return!1;return!0}return this.each((typeof r=="function"?vv:r?yv:xv)(o,r))}function bv(){this.textContent=""}function kv(t){return function(){this.textContent=t}}function _v(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function Sv(t){return arguments.length?this.each(t==null?bv:(typeof t=="function"?_v:kv)(t)):this.node().textContent}function Nv(){this.innerHTML=""}function Ev(t){return function(){this.innerHTML=t}}function jv(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function Cv(t){return arguments.length?this.each(t==null?Nv:(typeof t=="function"?jv:Ev)(t)):this.node().innerHTML}function Pv(){this.nextSibling&&this.parentNode.appendChild(this)}function Mv(){return this.each(Pv)}function Tv(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Iv(){return this.each(Tv)}function $v(t){var r=typeof t=="function"?t:Dm(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function Av(){return null}function Ov(t,r){var o=typeof t=="function"?t:Dm(t),i=r==null?Av:typeof r=="function"?r:Ud(r);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function Rv(){var t=this.parentNode;t&&t.removeChild(this)}function Lv(){return this.each(Rv)}function Dv(){var t=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function zv(){var t=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function Bv(t){return this.select(t?zv:Dv)}function Fv(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Hv(t){return function(r){t.call(this,r,this.__data__)}}function Vv(t){return t.trim().split(/^|\s+/).map(function(r){var o="",i=r.indexOf(".");return i>=0&&(o=r.slice(i+1),r=r.slice(0,i)),{type:r,name:o}})}function Uv(t){return function(){var r=this.__on;if(r){for(var o=0,i=-1,l=r.length,c;o<l;++o)c=r[o],(!t.type||c.type===t.type)&&c.name===t.name?this.removeEventListener(c.type,c.listener,c.options):r[++i]=c;++i?r.length=i:delete this.__on}}}function Kv(t,r,o){return function(){var i=this.__on,l,c=Hv(r);if(i){for(var f=0,m=i.length;f<m;++f)if((l=i[f]).type===t.type&&l.name===t.name){this.removeEventListener(l.type,l.listener,l.options),this.addEventListener(l.type,l.listener=c,l.options=o),l.value=r;return}}this.addEventListener(t.type,c,o),l={type:t.type,name:t.name,value:r,listener:c,options:o},i?i.push(l):this.__on=[l]}}function qv(t,r,o){var i=Vv(t+""),l,c=i.length,f;if(arguments.length<2){var m=this.node().__on;if(m){for(var y=0,b=m.length,_;y<b;++y)for(l=0,_=m[y];l<c;++l)if((f=i[l]).type===_.type&&f.name===_.name)return _.value}return}for(m=r?Kv:Uv,l=0;l<c;++l)this.each(m(i[l],r,o));return this}function Ym(t,r,o){var i=Vm(t),l=i.CustomEvent;typeof l=="function"?l=new l(r,o):(l=i.document.createEvent("Event"),o?(l.initEvent(r,o.bubbles,o.cancelable),l.detail=o.detail):l.initEvent(r,!1,!1)),t.dispatchEvent(l)}function Wv(t,r){return function(){return Ym(this,t,r)}}function Yv(t,r){return function(){return Ym(this,t,r.apply(this,arguments))}}function Xv(t,r){return this.each((typeof r=="function"?Yv:Wv)(t,r))}function*Qv(){for(var t=this._groups,r=0,o=t.length;r<o;++r)for(var i=t[r],l=0,c=i.length,f;l<c;++l)(f=i[l])&&(yield f)}var Xm=[null];function dr(t,r){this._groups=t,this._parents=r}function Da(){return new dr([[document.documentElement]],Xm)}function Gv(){return this}dr.prototype=Da.prototype={constructor:dr,select:_x,selectAll:jx,selectChild:Tx,selectChildren:Ox,filter:Rx,data:Hx,enter:Lx,exit:Ux,join:Kx,merge:qx,selection:Gv,order:Wx,sort:Yx,call:Qx,nodes:Gx,node:Jx,size:Zx,empty:ev,each:tv,attr:lv,style:fv,property:gv,classed:wv,text:Sv,html:Cv,raise:Mv,lower:Iv,append:$v,insert:Ov,remove:Lv,clone:Bv,datum:Fv,on:qv,dispatch:Xv,[Symbol.iterator]:Qv};function cr(t){return typeof t=="string"?new dr([[document.querySelector(t)]],[document.documentElement]):new dr([[t]],Xm)}function Jv(t){let r;for(;r=t.sourceEvent;)t=r;return t}function Kr(t,r){if(t=Jv(t),r===void 0&&(r=t.currentTarget),r){var o=r.ownerSVGElement||r;if(o.createSVGPoint){var i=o.createSVGPoint();return i.x=t.clientX,i.y=t.clientY,i=i.matrixTransform(r.getScreenCTM().inverse()),[i.x,i.y]}if(r.getBoundingClientRect){var l=r.getBoundingClientRect();return[t.clientX-l.left-r.clientLeft,t.clientY-l.top-r.clientTop]}}return[t.pageX,t.pageY]}const Zv={passive:!1},Ca={capture:!0,passive:!1};function ld(t){t.stopImmediatePropagation()}function Mi(t){t.preventDefault(),t.stopImmediatePropagation()}function Qm(t){var r=t.document.documentElement,o=cr(t).on("dragstart.drag",Mi,Ca);"onselectstart"in r?o.on("selectstart.drag",Mi,Ca):(r.__noselect=r.style.MozUserSelect,r.style.MozUserSelect="none")}function Gm(t,r){var o=t.document.documentElement,i=cr(t).on("dragstart.drag",null);r&&(i.on("click.drag",Mi,Ca),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in o?i.on("selectstart.drag",null):(o.style.MozUserSelect=o.__noselect,delete o.__noselect)}const ql=t=>()=>t;function Pd(t,{sourceEvent:r,subject:o,target:i,identifier:l,active:c,x:f,y:m,dx:y,dy:b,dispatch:_}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},subject:{value:o,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:l,enumerable:!0,configurable:!0},active:{value:c,enumerable:!0,configurable:!0},x:{value:f,enumerable:!0,configurable:!0},y:{value:m,enumerable:!0,configurable:!0},dx:{value:y,enumerable:!0,configurable:!0},dy:{value:b,enumerable:!0,configurable:!0},_:{value:_}})}Pd.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function ew(t){return!t.ctrlKey&&!t.button}function tw(){return this.parentNode}function nw(t,r){return r??{x:t.x,y:t.y}}function rw(){return navigator.maxTouchPoints||"ontouchstart"in this}function Jm(){var t=ew,r=tw,o=nw,i=rw,l={},c=Pu("start","drag","end"),f=0,m,y,b,_,v=0;function k(M){M.on("mousedown.drag",j).filter(i).on("touchstart.drag",A).on("touchmove.drag",T,Zv).on("touchend.drag touchcancel.drag",V).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function j(M,B){if(!(_||!t.call(this,M,B))){var U=P(this,r.call(this,M,B),M,B,"mouse");U&&(cr(M.view).on("mousemove.drag",C,Ca).on("mouseup.drag",I,Ca),Qm(M.view),ld(M),b=!1,m=M.clientX,y=M.clientY,U("start",M))}}function C(M){if(Mi(M),!b){var B=M.clientX-m,U=M.clientY-y;b=B*B+U*U>v}l.mouse("drag",M)}function I(M){cr(M.view).on("mousemove.drag mouseup.drag",null),Gm(M.view,b),Mi(M),l.mouse("end",M)}function A(M,B){if(t.call(this,M,B)){var U=M.changedTouches,W=r.call(this,M,B),Z=U.length,fe,Se;for(fe=0;fe<Z;++fe)(Se=P(this,W,M,B,U[fe].identifier,U[fe]))&&(ld(M),Se("start",M,U[fe]))}}function T(M){var B=M.changedTouches,U=B.length,W,Z;for(W=0;W<U;++W)(Z=l[B[W].identifier])&&(Mi(M),Z("drag",M,B[W]))}function V(M){var B=M.changedTouches,U=B.length,W,Z;for(_&&clearTimeout(_),_=setTimeout(function(){_=null},500),W=0;W<U;++W)(Z=l[B[W].identifier])&&(ld(M),Z("end",M,B[W]))}function P(M,B,U,W,Z,fe){var Se=c.copy(),X=Kr(fe||U,B),de,be,z;if((z=o.call(M,new Pd("beforestart",{sourceEvent:U,target:k,identifier:Z,active:f,x:X[0],y:X[1],dx:0,dy:0,dispatch:Se}),W))!=null)return de=z.x-X[0]||0,be=z.y-X[1]||0,function ue(Q,ie,H){var q=X,J;switch(Q){case"start":l[Z]=ue,J=f++;break;case"end":delete l[Z],--f;case"drag":X=Kr(H||ie,B),J=f;break}Se.call(Q,M,new Pd(Q,{sourceEvent:ie,subject:z,target:k,identifier:Z,active:J,x:X[0]+de,y:X[1]+be,dx:X[0]-q[0],dy:X[1]-q[1],dispatch:Se}),W)}}return k.filter=function(M){return arguments.length?(t=typeof M=="function"?M:ql(!!M),k):t},k.container=function(M){return arguments.length?(r=typeof M=="function"?M:ql(M),k):r},k.subject=function(M){return arguments.length?(o=typeof M=="function"?M:ql(M),k):o},k.touchable=function(M){return arguments.length?(i=typeof M=="function"?M:ql(!!M),k):i},k.on=function(){var M=c.on.apply(c,arguments);return M===c?k:M},k.clickDistance=function(M){return arguments.length?(v=(M=+M)*M,k):Math.sqrt(v)},k}function qd(t,r,o){t.prototype=r.prototype=o,o.constructor=t}function Zm(t,r){var o=Object.create(t.prototype);for(var i in r)o[i]=r[i];return o}function za(){}var Pa=.7,mu=1/Pa,Ti="\\s*([+-]?\\d+)\\s*",Ma="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ao="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ow=/^#([0-9a-f]{3,8})$/,sw=new RegExp(`^rgb\\(${Ti},${Ti},${Ti}\\)$`),iw=new RegExp(`^rgb\\(${ao},${ao},${ao}\\)$`),aw=new RegExp(`^rgba\\(${Ti},${Ti},${Ti},${Ma}\\)$`),lw=new RegExp(`^rgba\\(${ao},${ao},${ao},${Ma}\\)$`),uw=new RegExp(`^hsl\\(${Ma},${ao},${ao}\\)$`),cw=new RegExp(`^hsla\\(${Ma},${ao},${ao},${Ma}\\)$`),mh={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};qd(za,Vs,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:gh,formatHex:gh,formatHex8:dw,formatHsl:fw,formatRgb:yh,toString:yh});function gh(){return this.rgb().formatHex()}function dw(){return this.rgb().formatHex8()}function fw(){return e0(this).formatHsl()}function yh(){return this.rgb().formatRgb()}function Vs(t){var r,o;return t=(t+"").trim().toLowerCase(),(r=ow.exec(t))?(o=r[1].length,r=parseInt(r[1],16),o===6?xh(r):o===3?new Zn(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):o===8?Wl(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):o===4?Wl(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=sw.exec(t))?new Zn(r[1],r[2],r[3],1):(r=iw.exec(t))?new Zn(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=aw.exec(t))?Wl(r[1],r[2],r[3],r[4]):(r=lw.exec(t))?Wl(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=uw.exec(t))?bh(r[1],r[2]/100,r[3]/100,1):(r=cw.exec(t))?bh(r[1],r[2]/100,r[3]/100,r[4]):mh.hasOwnProperty(t)?xh(mh[t]):t==="transparent"?new Zn(NaN,NaN,NaN,0):null}function xh(t){return new Zn(t>>16&255,t>>8&255,t&255,1)}function Wl(t,r,o,i){return i<=0&&(t=r=o=NaN),new Zn(t,r,o,i)}function pw(t){return t instanceof za||(t=Vs(t)),t?(t=t.rgb(),new Zn(t.r,t.g,t.b,t.opacity)):new Zn}function Md(t,r,o,i){return arguments.length===1?pw(t):new Zn(t,r,o,i??1)}function Zn(t,r,o,i){this.r=+t,this.g=+r,this.b=+o,this.opacity=+i}qd(Zn,Md,Zm(za,{brighter(t){return t=t==null?mu:Math.pow(mu,t),new Zn(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Pa:Math.pow(Pa,t),new Zn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Zn(Fs(this.r),Fs(this.g),Fs(this.b),gu(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:vh,formatHex:vh,formatHex8:hw,formatRgb:wh,toString:wh}));function vh(){return`#${Bs(this.r)}${Bs(this.g)}${Bs(this.b)}`}function hw(){return`#${Bs(this.r)}${Bs(this.g)}${Bs(this.b)}${Bs((isNaN(this.opacity)?1:this.opacity)*255)}`}function wh(){const t=gu(this.opacity);return`${t===1?"rgb(":"rgba("}${Fs(this.r)}, ${Fs(this.g)}, ${Fs(this.b)}${t===1?")":`, ${t})`}`}function gu(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Fs(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Bs(t){return t=Fs(t),(t<16?"0":"")+t.toString(16)}function bh(t,r,o,i){return i<=0?t=r=o=NaN:o<=0||o>=1?t=r=NaN:r<=0&&(t=NaN),new qr(t,r,o,i)}function e0(t){if(t instanceof qr)return new qr(t.h,t.s,t.l,t.opacity);if(t instanceof za||(t=Vs(t)),!t)return new qr;if(t instanceof qr)return t;t=t.rgb();var r=t.r/255,o=t.g/255,i=t.b/255,l=Math.min(r,o,i),c=Math.max(r,o,i),f=NaN,m=c-l,y=(c+l)/2;return m?(r===c?f=(o-i)/m+(o<i)*6:o===c?f=(i-r)/m+2:f=(r-o)/m+4,m/=y<.5?c+l:2-c-l,f*=60):m=y>0&&y<1?0:f,new qr(f,m,y,t.opacity)}function mw(t,r,o,i){return arguments.length===1?e0(t):new qr(t,r,o,i??1)}function qr(t,r,o,i){this.h=+t,this.s=+r,this.l=+o,this.opacity=+i}qd(qr,mw,Zm(za,{brighter(t){return t=t==null?mu:Math.pow(mu,t),new qr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Pa:Math.pow(Pa,t),new qr(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,o=this.l,i=o+(o<.5?o:1-o)*r,l=2*o-i;return new Zn(ud(t>=240?t-240:t+120,l,i),ud(t,l,i),ud(t<120?t+240:t-120,l,i),this.opacity)},clamp(){return new qr(kh(this.h),Yl(this.s),Yl(this.l),gu(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=gu(this.opacity);return`${t===1?"hsl(":"hsla("}${kh(this.h)}, ${Yl(this.s)*100}%, ${Yl(this.l)*100}%${t===1?")":`, ${t})`}`}}));function kh(t){return t=(t||0)%360,t<0?t+360:t}function Yl(t){return Math.max(0,Math.min(1,t||0))}function ud(t,r,o){return(t<60?r+(o-r)*t/60:t<180?o:t<240?r+(o-r)*(240-t)/60:r)*255}const Wd=t=>()=>t;function gw(t,r){return function(o){return t+o*r}}function yw(t,r,o){return t=Math.pow(t,o),r=Math.pow(r,o)-t,o=1/o,function(i){return Math.pow(t+i*r,o)}}function xw(t){return(t=+t)==1?t0:function(r,o){return o-r?yw(r,o,t):Wd(isNaN(r)?o:r)}}function t0(t,r){var o=r-t;return o?gw(t,o):Wd(isNaN(t)?r:t)}const yu=(function t(r){var o=xw(r);function i(l,c){var f=o((l=Md(l)).r,(c=Md(c)).r),m=o(l.g,c.g),y=o(l.b,c.b),b=t0(l.opacity,c.opacity);return function(_){return l.r=f(_),l.g=m(_),l.b=y(_),l.opacity=b(_),l+""}}return i.gamma=t,i})(1);function vw(t,r){r||(r=[]);var o=t?Math.min(r.length,t.length):0,i=r.slice(),l;return function(c){for(l=0;l<o;++l)i[l]=t[l]*(1-c)+r[l]*c;return i}}function ww(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function bw(t,r){var o=r?r.length:0,i=t?Math.min(o,t.length):0,l=new Array(i),c=new Array(o),f;for(f=0;f<i;++f)l[f]=Ea(t[f],r[f]);for(;f<o;++f)c[f]=r[f];return function(m){for(f=0;f<i;++f)c[f]=l[f](m);return c}}function kw(t,r){var o=new Date;return t=+t,r=+r,function(i){return o.setTime(t*(1-i)+r*i),o}}function io(t,r){return t=+t,r=+r,function(o){return t*(1-o)+r*o}}function _w(t,r){var o={},i={},l;(t===null||typeof t!="object")&&(t={}),(r===null||typeof r!="object")&&(r={});for(l in r)l in t?o[l]=Ea(t[l],r[l]):i[l]=r[l];return function(c){for(l in o)i[l]=o[l](c);return i}}var Td=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,cd=new RegExp(Td.source,"g");function Sw(t){return function(){return t}}function Nw(t){return function(r){return t(r)+""}}function n0(t,r){var o=Td.lastIndex=cd.lastIndex=0,i,l,c,f=-1,m=[],y=[];for(t=t+"",r=r+"";(i=Td.exec(t))&&(l=cd.exec(r));)(c=l.index)>o&&(c=r.slice(o,c),m[f]?m[f]+=c:m[++f]=c),(i=i[0])===(l=l[0])?m[f]?m[f]+=l:m[++f]=l:(m[++f]=null,y.push({i:f,x:io(i,l)})),o=cd.lastIndex;return o<r.length&&(c=r.slice(o),m[f]?m[f]+=c:m[++f]=c),m.length<2?y[0]?Nw(y[0].x):Sw(r):(r=y.length,function(b){for(var _=0,v;_<r;++_)m[(v=y[_]).i]=v.x(b);return m.join("")})}function Ea(t,r){var o=typeof r,i;return r==null||o==="boolean"?Wd(r):(o==="number"?io:o==="string"?(i=Vs(r))?(r=i,yu):n0:r instanceof Vs?yu:r instanceof Date?kw:ww(r)?vw:Array.isArray(r)?bw:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?_w:io)(t,r)}var _h=180/Math.PI,Id={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function r0(t,r,o,i,l,c){var f,m,y;return(f=Math.sqrt(t*t+r*r))&&(t/=f,r/=f),(y=t*o+r*i)&&(o-=t*y,i-=r*y),(m=Math.sqrt(o*o+i*i))&&(o/=m,i/=m,y/=m),t*i<r*o&&(t=-t,r=-r,y=-y,f=-f),{translateX:l,translateY:c,rotate:Math.atan2(r,t)*_h,skewX:Math.atan(y)*_h,scaleX:f,scaleY:m}}var Xl;function Ew(t){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return r.isIdentity?Id:r0(r.a,r.b,r.c,r.d,r.e,r.f)}function jw(t){return t==null||(Xl||(Xl=document.createElementNS("http://www.w3.org/2000/svg","g")),Xl.setAttribute("transform",t),!(t=Xl.transform.baseVal.consolidate()))?Id:(t=t.matrix,r0(t.a,t.b,t.c,t.d,t.e,t.f))}function o0(t,r,o,i){function l(b){return b.length?b.pop()+" ":""}function c(b,_,v,k,j,C){if(b!==v||_!==k){var I=j.push("translate(",null,r,null,o);C.push({i:I-4,x:io(b,v)},{i:I-2,x:io(_,k)})}else(v||k)&&j.push("translate("+v+r+k+o)}function f(b,_,v,k){b!==_?(b-_>180?_+=360:_-b>180&&(b+=360),k.push({i:v.push(l(v)+"rotate(",null,i)-2,x:io(b,_)})):_&&v.push(l(v)+"rotate("+_+i)}function m(b,_,v,k){b!==_?k.push({i:v.push(l(v)+"skewX(",null,i)-2,x:io(b,_)}):_&&v.push(l(v)+"skewX("+_+i)}function y(b,_,v,k,j,C){if(b!==v||_!==k){var I=j.push(l(j)+"scale(",null,",",null,")");C.push({i:I-4,x:io(b,v)},{i:I-2,x:io(_,k)})}else(v!==1||k!==1)&&j.push(l(j)+"scale("+v+","+k+")")}return function(b,_){var v=[],k=[];return b=t(b),_=t(_),c(b.translateX,b.translateY,_.translateX,_.translateY,v,k),f(b.rotate,_.rotate,v,k),m(b.skewX,_.skewX,v,k),y(b.scaleX,b.scaleY,_.scaleX,_.scaleY,v,k),b=_=null,function(j){for(var C=-1,I=k.length,A;++C<I;)v[(A=k[C]).i]=A.x(j);return v.join("")}}}var Cw=o0(Ew,"px, ","px)","deg)"),Pw=o0(jw,", ",")",")"),Mw=1e-12;function Sh(t){return((t=Math.exp(t))+1/t)/2}function Tw(t){return((t=Math.exp(t))-1/t)/2}function Iw(t){return((t=Math.exp(2*t))-1)/(t+1)}const au=(function t(r,o,i){function l(c,f){var m=c[0],y=c[1],b=c[2],_=f[0],v=f[1],k=f[2],j=_-m,C=v-y,I=j*j+C*C,A,T;if(I<Mw)T=Math.log(k/b)/r,A=function(W){return[m+W*j,y+W*C,b*Math.exp(r*W*T)]};else{var V=Math.sqrt(I),P=(k*k-b*b+i*I)/(2*b*o*V),M=(k*k-b*b-i*I)/(2*k*o*V),B=Math.log(Math.sqrt(P*P+1)-P),U=Math.log(Math.sqrt(M*M+1)-M);T=(U-B)/r,A=function(W){var Z=W*T,fe=Sh(B),Se=b/(o*V)*(fe*Iw(r*Z+B)-Tw(B));return[m+Se*j,y+Se*C,b*fe/Sh(r*Z+B)]}}return A.duration=T*1e3*r/Math.SQRT2,A}return l.rho=function(c){var f=Math.max(.001,+c),m=f*f,y=m*m;return t(f,m,y)},l})(Math.SQRT2,2,4);var Oi=0,Sa=0,ka=0,s0=1e3,xu,Na,vu=0,Us=0,Tu=0,Ta=typeof performance=="object"&&performance.now?performance:Date,i0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Yd(){return Us||(i0($w),Us=Ta.now()+Tu)}function $w(){Us=0}function wu(){this._call=this._time=this._next=null}wu.prototype=a0.prototype={constructor:wu,restart:function(t,r,o){if(typeof t!="function")throw new TypeError("callback is not a function");o=(o==null?Yd():+o)+(r==null?0:+r),!this._next&&Na!==this&&(Na?Na._next=this:xu=this,Na=this),this._call=t,this._time=o,$d()},stop:function(){this._call&&(this._call=null,this._time=1/0,$d())}};function a0(t,r,o){var i=new wu;return i.restart(t,r,o),i}function Aw(){Yd(),++Oi;for(var t=xu,r;t;)(r=Us-t._time)>=0&&t._call.call(void 0,r),t=t._next;--Oi}function Nh(){Us=(vu=Ta.now())+Tu,Oi=Sa=0;try{Aw()}finally{Oi=0,Rw(),Us=0}}function Ow(){var t=Ta.now(),r=t-vu;r>s0&&(Tu-=r,vu=t)}function Rw(){for(var t,r=xu,o,i=1/0;r;)r._call?(i>r._time&&(i=r._time),t=r,r=r._next):(o=r._next,r._next=null,r=t?t._next=o:xu=o);Na=t,$d(i)}function $d(t){if(!Oi){Sa&&(Sa=clearTimeout(Sa));var r=t-Us;r>24?(t<1/0&&(Sa=setTimeout(Nh,t-Ta.now()-Tu)),ka&&(ka=clearInterval(ka))):(ka||(vu=Ta.now(),ka=setInterval(Ow,s0)),Oi=1,i0(Nh))}}function Eh(t,r,o){var i=new wu;return r=r==null?0:+r,i.restart(l=>{i.stop(),t(l+r)},r,o),i}var Lw=Pu("start","end","cancel","interrupt"),Dw=[],l0=0,jh=1,Ad=2,lu=3,Ch=4,Od=5,uu=6;function Iu(t,r,o,i,l,c){var f=t.__transition;if(!f)t.__transition={};else if(o in f)return;zw(t,o,{name:r,index:i,group:l,on:Lw,tween:Dw,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:l0})}function Xd(t,r){var o=Xr(t,r);if(o.state>l0)throw new Error("too late; already scheduled");return o}function co(t,r){var o=Xr(t,r);if(o.state>lu)throw new Error("too late; already running");return o}function Xr(t,r){var o=t.__transition;if(!o||!(o=o[r]))throw new Error("transition not found");return o}function zw(t,r,o){var i=t.__transition,l;i[r]=o,o.timer=a0(c,0,o.time);function c(b){o.state=jh,o.timer.restart(f,o.delay,o.time),o.delay<=b&&f(b-o.delay)}function f(b){var _,v,k,j;if(o.state!==jh)return y();for(_ in i)if(j=i[_],j.name===o.name){if(j.state===lu)return Eh(f);j.state===Ch?(j.state=uu,j.timer.stop(),j.on.call("interrupt",t,t.__data__,j.index,j.group),delete i[_]):+_<r&&(j.state=uu,j.timer.stop(),j.on.call("cancel",t,t.__data__,j.index,j.group),delete i[_])}if(Eh(function(){o.state===lu&&(o.state=Ch,o.timer.restart(m,o.delay,o.time),m(b))}),o.state=Ad,o.on.call("start",t,t.__data__,o.index,o.group),o.state===Ad){for(o.state=lu,l=new Array(k=o.tween.length),_=0,v=-1;_<k;++_)(j=o.tween[_].value.call(t,t.__data__,o.index,o.group))&&(l[++v]=j);l.length=v+1}}function m(b){for(var _=b<o.duration?o.ease.call(null,b/o.duration):(o.timer.restart(y),o.state=Od,1),v=-1,k=l.length;++v<k;)l[v].call(t,_);o.state===Od&&(o.on.call("end",t,t.__data__,o.index,o.group),y())}function y(){o.state=uu,o.timer.stop(),delete i[r];for(var b in i)return;delete t.__transition}}function cu(t,r){var o=t.__transition,i,l,c=!0,f;if(o){r=r==null?null:r+"";for(f in o){if((i=o[f]).name!==r){c=!1;continue}l=i.state>Ad&&i.state<Od,i.state=uu,i.timer.stop(),i.on.call(l?"interrupt":"cancel",t,t.__data__,i.index,i.group),delete o[f]}c&&delete t.__transition}}function Bw(t){return this.each(function(){cu(this,t)})}function Fw(t,r){var o,i;return function(){var l=co(this,t),c=l.tween;if(c!==o){i=o=c;for(var f=0,m=i.length;f<m;++f)if(i[f].name===r){i=i.slice(),i.splice(f,1);break}}l.tween=i}}function Hw(t,r,o){var i,l;if(typeof o!="function")throw new Error;return function(){var c=co(this,t),f=c.tween;if(f!==i){l=(i=f).slice();for(var m={name:r,value:o},y=0,b=l.length;y<b;++y)if(l[y].name===r){l[y]=m;break}y===b&&l.push(m)}c.tween=l}}function Vw(t,r){var o=this._id;if(t+="",arguments.length<2){for(var i=Xr(this.node(),o).tween,l=0,c=i.length,f;l<c;++l)if((f=i[l]).name===t)return f.value;return null}return this.each((r==null?Fw:Hw)(o,t,r))}function Qd(t,r,o){var i=t._id;return t.each(function(){var l=co(this,i);(l.value||(l.value={}))[r]=o.apply(this,arguments)}),function(l){return Xr(l,i).value[r]}}function u0(t,r){var o;return(typeof r=="number"?io:r instanceof Vs?yu:(o=Vs(r))?(r=o,yu):n0)(t,r)}function Uw(t){return function(){this.removeAttribute(t)}}function Kw(t){return function(){this.removeAttributeNS(t.space,t.local)}}function qw(t,r,o){var i,l=o+"",c;return function(){var f=this.getAttribute(t);return f===l?null:f===i?c:c=r(i=f,o)}}function Ww(t,r,o){var i,l=o+"",c;return function(){var f=this.getAttributeNS(t.space,t.local);return f===l?null:f===i?c:c=r(i=f,o)}}function Yw(t,r,o){var i,l,c;return function(){var f,m=o(this),y;return m==null?void this.removeAttribute(t):(f=this.getAttribute(t),y=m+"",f===y?null:f===i&&y===l?c:(l=y,c=r(i=f,m)))}}function Xw(t,r,o){var i,l,c;return function(){var f,m=o(this),y;return m==null?void this.removeAttributeNS(t.space,t.local):(f=this.getAttributeNS(t.space,t.local),y=m+"",f===y?null:f===i&&y===l?c:(l=y,c=r(i=f,m)))}}function Qw(t,r){var o=Mu(t),i=o==="transform"?Pw:u0;return this.attrTween(t,typeof r=="function"?(o.local?Xw:Yw)(o,i,Qd(this,"attr."+t,r)):r==null?(o.local?Kw:Uw)(o):(o.local?Ww:qw)(o,i,r))}function Gw(t,r){return function(o){this.setAttribute(t,r.call(this,o))}}function Jw(t,r){return function(o){this.setAttributeNS(t.space,t.local,r.call(this,o))}}function Zw(t,r){var o,i;function l(){var c=r.apply(this,arguments);return c!==i&&(o=(i=c)&&Jw(t,c)),o}return l._value=r,l}function e1(t,r){var o,i;function l(){var c=r.apply(this,arguments);return c!==i&&(o=(i=c)&&Gw(t,c)),o}return l._value=r,l}function t1(t,r){var o="attr."+t;if(arguments.length<2)return(o=this.tween(o))&&o._value;if(r==null)return this.tween(o,null);if(typeof r!="function")throw new Error;var i=Mu(t);return this.tween(o,(i.local?Zw:e1)(i,r))}function n1(t,r){return function(){Xd(this,t).delay=+r.apply(this,arguments)}}function r1(t,r){return r=+r,function(){Xd(this,t).delay=r}}function o1(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?n1:r1)(r,t)):Xr(this.node(),r).delay}function s1(t,r){return function(){co(this,t).duration=+r.apply(this,arguments)}}function i1(t,r){return r=+r,function(){co(this,t).duration=r}}function a1(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?s1:i1)(r,t)):Xr(this.node(),r).duration}function l1(t,r){if(typeof r!="function")throw new Error;return function(){co(this,t).ease=r}}function u1(t){var r=this._id;return arguments.length?this.each(l1(r,t)):Xr(this.node(),r).ease}function c1(t,r){return function(){var o=r.apply(this,arguments);if(typeof o!="function")throw new Error;co(this,t).ease=o}}function d1(t){if(typeof t!="function")throw new Error;return this.each(c1(this._id,t))}function f1(t){typeof t!="function"&&(t=Bm(t));for(var r=this._groups,o=r.length,i=new Array(o),l=0;l<o;++l)for(var c=r[l],f=c.length,m=i[l]=[],y,b=0;b<f;++b)(y=c[b])&&t.call(y,y.__data__,b,c)&&m.push(y);return new zo(i,this._parents,this._name,this._id)}function p1(t){if(t._id!==this._id)throw new Error;for(var r=this._groups,o=t._groups,i=r.length,l=o.length,c=Math.min(i,l),f=new Array(i),m=0;m<c;++m)for(var y=r[m],b=o[m],_=y.length,v=f[m]=new Array(_),k,j=0;j<_;++j)(k=y[j]||b[j])&&(v[j]=k);for(;m<i;++m)f[m]=r[m];return new zo(f,this._parents,this._name,this._id)}function h1(t){return(t+"").trim().split(/^|\s+/).every(function(r){var o=r.indexOf(".");return o>=0&&(r=r.slice(0,o)),!r||r==="start"})}function m1(t,r,o){var i,l,c=h1(r)?Xd:co;return function(){var f=c(this,t),m=f.on;m!==i&&(l=(i=m).copy()).on(r,o),f.on=l}}function g1(t,r){var o=this._id;return arguments.length<2?Xr(this.node(),o).on.on(t):this.each(m1(o,t,r))}function y1(t){return function(){var r=this.parentNode;for(var o in this.__transition)if(+o!==t)return;r&&r.removeChild(this)}}function x1(){return this.on("end.remove",y1(this._id))}function v1(t){var r=this._name,o=this._id;typeof t!="function"&&(t=Ud(t));for(var i=this._groups,l=i.length,c=new Array(l),f=0;f<l;++f)for(var m=i[f],y=m.length,b=c[f]=new Array(y),_,v,k=0;k<y;++k)(_=m[k])&&(v=t.call(_,_.__data__,k,m))&&("__data__"in _&&(v.__data__=_.__data__),b[k]=v,Iu(b[k],r,o,k,b,Xr(_,o)));return new zo(c,this._parents,r,o)}function w1(t){var r=this._name,o=this._id;typeof t!="function"&&(t=zm(t));for(var i=this._groups,l=i.length,c=[],f=[],m=0;m<l;++m)for(var y=i[m],b=y.length,_,v=0;v<b;++v)if(_=y[v]){for(var k=t.call(_,_.__data__,v,y),j,C=Xr(_,o),I=0,A=k.length;I<A;++I)(j=k[I])&&Iu(j,r,o,I,k,C);c.push(k),f.push(_)}return new zo(c,f,r,o)}var b1=Da.prototype.constructor;function k1(){return new b1(this._groups,this._parents)}function _1(t,r){var o,i,l;return function(){var c=Ai(this,t),f=(this.style.removeProperty(t),Ai(this,t));return c===f?null:c===o&&f===i?l:l=r(o=c,i=f)}}function c0(t){return function(){this.style.removeProperty(t)}}function S1(t,r,o){var i,l=o+"",c;return function(){var f=Ai(this,t);return f===l?null:f===i?c:c=r(i=f,o)}}function N1(t,r,o){var i,l,c;return function(){var f=Ai(this,t),m=o(this),y=m+"";return m==null&&(y=m=(this.style.removeProperty(t),Ai(this,t))),f===y?null:f===i&&y===l?c:(l=y,c=r(i=f,m))}}function E1(t,r){var o,i,l,c="style."+r,f="end."+c,m;return function(){var y=co(this,t),b=y.on,_=y.value[c]==null?m||(m=c0(r)):void 0;(b!==o||l!==_)&&(i=(o=b).copy()).on(f,l=_),y.on=i}}function j1(t,r,o){var i=(t+="")=="transform"?Cw:u0;return r==null?this.styleTween(t,_1(t,i)).on("end.style."+t,c0(t)):typeof r=="function"?this.styleTween(t,N1(t,i,Qd(this,"style."+t,r))).each(E1(this._id,t)):this.styleTween(t,S1(t,i,r),o).on("end.style."+t,null)}function C1(t,r,o){return function(i){this.style.setProperty(t,r.call(this,i),o)}}function P1(t,r,o){var i,l;function c(){var f=r.apply(this,arguments);return f!==l&&(i=(l=f)&&C1(t,f,o)),i}return c._value=r,c}function M1(t,r,o){var i="style."+(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;return this.tween(i,P1(t,r,o??""))}function T1(t){return function(){this.textContent=t}}function I1(t){return function(){var r=t(this);this.textContent=r??""}}function $1(t){return this.tween("text",typeof t=="function"?I1(Qd(this,"text",t)):T1(t==null?"":t+""))}function A1(t){return function(r){this.textContent=t.call(this,r)}}function O1(t){var r,o;function i(){var l=t.apply(this,arguments);return l!==o&&(r=(o=l)&&A1(l)),r}return i._value=t,i}function R1(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,O1(t))}function L1(){for(var t=this._name,r=this._id,o=d0(),i=this._groups,l=i.length,c=0;c<l;++c)for(var f=i[c],m=f.length,y,b=0;b<m;++b)if(y=f[b]){var _=Xr(y,r);Iu(y,t,o,b,f,{time:_.time+_.delay+_.duration,delay:0,duration:_.duration,ease:_.ease})}return new zo(i,this._parents,t,o)}function D1(){var t,r,o=this,i=o._id,l=o.size();return new Promise(function(c,f){var m={value:f},y={value:function(){--l===0&&c()}};o.each(function(){var b=co(this,i),_=b.on;_!==t&&(r=(t=_).copy(),r._.cancel.push(m),r._.interrupt.push(m),r._.end.push(y)),b.on=r}),l===0&&c()})}var z1=0;function zo(t,r,o,i){this._groups=t,this._parents=r,this._name=o,this._id=i}function d0(){return++z1}var Oo=Da.prototype;zo.prototype={constructor:zo,select:v1,selectAll:w1,selectChild:Oo.selectChild,selectChildren:Oo.selectChildren,filter:f1,merge:p1,selection:k1,transition:L1,call:Oo.call,nodes:Oo.nodes,node:Oo.node,size:Oo.size,empty:Oo.empty,each:Oo.each,on:g1,attr:Qw,attrTween:t1,style:j1,styleTween:M1,text:$1,textTween:R1,remove:x1,tween:Vw,delay:o1,duration:a1,ease:u1,easeVarying:d1,end:D1,[Symbol.iterator]:Oo[Symbol.iterator]};function B1(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var F1={time:null,delay:0,duration:250,ease:B1};function H1(t,r){for(var o;!(o=t.__transition)||!(o=o[r]);)if(!(t=t.parentNode))throw new Error(`transition ${r} not found`);return o}function V1(t){var r,o;t instanceof zo?(r=t._id,t=t._name):(r=d0(),(o=F1).time=Yd(),t=t==null?null:t+"");for(var i=this._groups,l=i.length,c=0;c<l;++c)for(var f=i[c],m=f.length,y,b=0;b<m;++b)(y=f[b])&&Iu(y,t,r,b,f,o||H1(y,r));return new zo(i,this._parents,t,r)}Da.prototype.interrupt=Bw;Da.prototype.transition=V1;const Ql=t=>()=>t;function U1(t,{sourceEvent:r,target:o,transform:i,dispatch:l}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:r,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:l}})}function Lo(t,r,o){this.k=t,this.x=r,this.y=o}Lo.prototype={constructor:Lo,scale:function(t){return t===1?this:new Lo(this.k*t,this.x,this.y)},translate:function(t,r){return t===0&r===0?this:new Lo(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 $u=new Lo(1,0,0);f0.prototype=Lo.prototype;function f0(t){for(;!t.__zoom;)if(!(t=t.parentNode))return $u;return t.__zoom}function dd(t){t.stopImmediatePropagation()}function _a(t){t.preventDefault(),t.stopImmediatePropagation()}function K1(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function q1(){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 Ph(){return this.__zoom||$u}function W1(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Y1(){return navigator.maxTouchPoints||"ontouchstart"in this}function X1(t,r,o){var i=t.invertX(r[0][0])-o[0][0],l=t.invertX(r[1][0])-o[1][0],c=t.invertY(r[0][1])-o[0][1],f=t.invertY(r[1][1])-o[1][1];return t.translate(l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l),f>c?(c+f)/2:Math.min(0,c)||Math.max(0,f))}function p0(){var t=K1,r=q1,o=X1,i=W1,l=Y1,c=[0,1/0],f=[[-1/0,-1/0],[1/0,1/0]],m=250,y=au,b=Pu("start","zoom","end"),_,v,k,j=500,C=150,I=0,A=10;function T(z){z.property("__zoom",Ph).on("wheel.zoom",Z,{passive:!1}).on("mousedown.zoom",fe).on("dblclick.zoom",Se).filter(l).on("touchstart.zoom",X).on("touchmove.zoom",de).on("touchend.zoom touchcancel.zoom",be).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}T.transform=function(z,ue,Q,ie){var H=z.selection?z.selection():z;H.property("__zoom",Ph),z!==H?B(z,ue,Q,ie):H.interrupt().each(function(){U(this,arguments).event(ie).start().zoom(null,typeof ue=="function"?ue.apply(this,arguments):ue).end()})},T.scaleBy=function(z,ue,Q,ie){T.scaleTo(z,function(){var H=this.__zoom.k,q=typeof ue=="function"?ue.apply(this,arguments):ue;return H*q},Q,ie)},T.scaleTo=function(z,ue,Q,ie){T.transform(z,function(){var H=r.apply(this,arguments),q=this.__zoom,J=Q==null?M(H):typeof Q=="function"?Q.apply(this,arguments):Q,O=q.invert(J),K=typeof ue=="function"?ue.apply(this,arguments):ue;return o(P(V(q,K),J,O),H,f)},Q,ie)},T.translateBy=function(z,ue,Q,ie){T.transform(z,function(){return o(this.__zoom.translate(typeof ue=="function"?ue.apply(this,arguments):ue,typeof Q=="function"?Q.apply(this,arguments):Q),r.apply(this,arguments),f)},null,ie)},T.translateTo=function(z,ue,Q,ie,H){T.transform(z,function(){var q=r.apply(this,arguments),J=this.__zoom,O=ie==null?M(q):typeof ie=="function"?ie.apply(this,arguments):ie;return o($u.translate(O[0],O[1]).scale(J.k).translate(typeof ue=="function"?-ue.apply(this,arguments):-ue,typeof Q=="function"?-Q.apply(this,arguments):-Q),q,f)},ie,H)};function V(z,ue){return ue=Math.max(c[0],Math.min(c[1],ue)),ue===z.k?z:new Lo(ue,z.x,z.y)}function P(z,ue,Q){var ie=ue[0]-Q[0]*z.k,H=ue[1]-Q[1]*z.k;return ie===z.x&&H===z.y?z:new Lo(z.k,ie,H)}function M(z){return[(+z[0][0]+ +z[1][0])/2,(+z[0][1]+ +z[1][1])/2]}function B(z,ue,Q,ie){z.on("start.zoom",function(){U(this,arguments).event(ie).start()}).on("interrupt.zoom end.zoom",function(){U(this,arguments).event(ie).end()}).tween("zoom",function(){var H=this,q=arguments,J=U(H,q).event(ie),O=r.apply(H,q),K=Q==null?M(O):typeof Q=="function"?Q.apply(H,q):Q,ke=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),Ne=H.__zoom,Ae=typeof ue=="function"?ue.apply(H,q):ue,Oe=y(Ne.invert(K).concat(ke/Ne.k),Ae.invert(K).concat(ke/Ae.k));return function(Re){if(Re===1)Re=Ae;else{var _e=Oe(Re),ze=ke/_e[2];Re=new Lo(ze,K[0]-_e[0]*ze,K[1]-_e[1]*ze)}J.zoom(null,Re)}})}function U(z,ue,Q){return!Q&&z.__zooming||new W(z,ue)}function W(z,ue){this.that=z,this.args=ue,this.active=0,this.sourceEvent=null,this.extent=r.apply(z,ue),this.taps=0}W.prototype={event:function(z){return z&&(this.sourceEvent=z),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(z,ue){return this.mouse&&z!=="mouse"&&(this.mouse[1]=ue.invert(this.mouse[0])),this.touch0&&z!=="touch"&&(this.touch0[1]=ue.invert(this.touch0[0])),this.touch1&&z!=="touch"&&(this.touch1[1]=ue.invert(this.touch1[0])),this.that.__zoom=ue,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(z){var ue=cr(this.that).datum();b.call(z,this.that,new U1(z,{sourceEvent:this.sourceEvent,target:T,transform:this.that.__zoom,dispatch:b}),ue)}};function Z(z,...ue){if(!t.apply(this,arguments))return;var Q=U(this,ue).event(z),ie=this.__zoom,H=Math.max(c[0],Math.min(c[1],ie.k*Math.pow(2,i.apply(this,arguments)))),q=Kr(z);if(Q.wheel)(Q.mouse[0][0]!==q[0]||Q.mouse[0][1]!==q[1])&&(Q.mouse[1]=ie.invert(Q.mouse[0]=q)),clearTimeout(Q.wheel);else{if(ie.k===H)return;Q.mouse=[q,ie.invert(q)],cu(this),Q.start()}_a(z),Q.wheel=setTimeout(J,C),Q.zoom("mouse",o(P(V(ie,H),Q.mouse[0],Q.mouse[1]),Q.extent,f));function J(){Q.wheel=null,Q.end()}}function fe(z,...ue){if(k||!t.apply(this,arguments))return;var Q=z.currentTarget,ie=U(this,ue,!0).event(z),H=cr(z.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",ke,!0),q=Kr(z,Q),J=z.clientX,O=z.clientY;Qm(z.view),dd(z),ie.mouse=[q,this.__zoom.invert(q)],cu(this),ie.start();function K(Ne){if(_a(Ne),!ie.moved){var Ae=Ne.clientX-J,Oe=Ne.clientY-O;ie.moved=Ae*Ae+Oe*Oe>I}ie.event(Ne).zoom("mouse",o(P(ie.that.__zoom,ie.mouse[0]=Kr(Ne,Q),ie.mouse[1]),ie.extent,f))}function ke(Ne){H.on("mousemove.zoom mouseup.zoom",null),Gm(Ne.view,ie.moved),_a(Ne),ie.event(Ne).end()}}function Se(z,...ue){if(t.apply(this,arguments)){var Q=this.__zoom,ie=Kr(z.changedTouches?z.changedTouches[0]:z,this),H=Q.invert(ie),q=Q.k*(z.shiftKey?.5:2),J=o(P(V(Q,q),ie,H),r.apply(this,ue),f);_a(z),m>0?cr(this).transition().duration(m).call(B,J,ie,z):cr(this).call(T.transform,J,ie,z)}}function X(z,...ue){if(t.apply(this,arguments)){var Q=z.touches,ie=Q.length,H=U(this,ue,z.changedTouches.length===ie).event(z),q,J,O,K;for(dd(z),J=0;J<ie;++J)O=Q[J],K=Kr(O,this),K=[K,this.__zoom.invert(K),O.identifier],H.touch0?!H.touch1&&H.touch0[2]!==K[2]&&(H.touch1=K,H.taps=0):(H.touch0=K,q=!0,H.taps=1+!!_);_&&(_=clearTimeout(_)),q&&(H.taps<2&&(v=K[0],_=setTimeout(function(){_=null},j)),cu(this),H.start())}}function de(z,...ue){if(this.__zooming){var Q=U(this,ue).event(z),ie=z.changedTouches,H=ie.length,q,J,O,K;for(_a(z),q=0;q<H;++q)J=ie[q],O=Kr(J,this),Q.touch0&&Q.touch0[2]===J.identifier?Q.touch0[0]=O:Q.touch1&&Q.touch1[2]===J.identifier&&(Q.touch1[0]=O);if(J=Q.that.__zoom,Q.touch1){var ke=Q.touch0[0],Ne=Q.touch0[1],Ae=Q.touch1[0],Oe=Q.touch1[1],Re=(Re=Ae[0]-ke[0])*Re+(Re=Ae[1]-ke[1])*Re,_e=(_e=Oe[0]-Ne[0])*_e+(_e=Oe[1]-Ne[1])*_e;J=V(J,Math.sqrt(Re/_e)),O=[(ke[0]+Ae[0])/2,(ke[1]+Ae[1])/2],K=[(Ne[0]+Oe[0])/2,(Ne[1]+Oe[1])/2]}else if(Q.touch0)O=Q.touch0[0],K=Q.touch0[1];else return;Q.zoom("touch",o(P(J,O,K),Q.extent,f))}}function be(z,...ue){if(this.__zooming){var Q=U(this,ue).event(z),ie=z.changedTouches,H=ie.length,q,J;for(dd(z),k&&clearTimeout(k),k=setTimeout(function(){k=null},j),q=0;q<H;++q)J=ie[q],Q.touch0&&Q.touch0[2]===J.identifier?delete Q.touch0:Q.touch1&&Q.touch1[2]===J.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&&(J=Kr(J,this),Math.hypot(v[0]-J[0],v[1]-J[1])<A)){var O=cr(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return T.wheelDelta=function(z){return arguments.length?(i=typeof z=="function"?z:Ql(+z),T):i},T.filter=function(z){return arguments.length?(t=typeof z=="function"?z:Ql(!!z),T):t},T.touchable=function(z){return arguments.length?(l=typeof z=="function"?z:Ql(!!z),T):l},T.extent=function(z){return arguments.length?(r=typeof z=="function"?z:Ql([[+z[0][0],+z[0][1]],[+z[1][0],+z[1][1]]]),T):r},T.scaleExtent=function(z){return arguments.length?(c[0]=+z[0],c[1]=+z[1],T):[c[0],c[1]]},T.translateExtent=function(z){return arguments.length?(f[0][0]=+z[0][0],f[1][0]=+z[1][0],f[0][1]=+z[0][1],f[1][1]=+z[1][1],T):[[f[0][0],f[0][1]],[f[1][0],f[1][1]]]},T.constrain=function(z){return arguments.length?(o=z,T):o},T.duration=function(z){return arguments.length?(m=+z,T):m},T.interpolate=function(z){return arguments.length?(y=z,T):y},T.on=function(){var z=b.on.apply(b,arguments);return z===b?T:z},T.clickDistance=function(z){return arguments.length?(I=(z=+z)*z,T):Math.sqrt(I)},T.tapDistance=function(z){return arguments.length?(A=+z,T):A},T}const lo={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:o,targetHandle:i})=>`Couldn't create edge for ${t} handle id: "${t==="source"?o:i}", 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."},Ia=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],h0=["Enter"," ","Escape"],m0={"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:o})=>`Moved selected node ${t}. New position, x: ${r}, y: ${o}`,"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 Ri;(function(t){t.Strict="strict",t.Loose="loose"})(Ri||(Ri={}));var Hs;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Hs||(Hs={}));var $a;(function(t){t.Partial="partial",t.Full="full"})($a||($a={}));const g0={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var gs;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(gs||(gs={}));var bu;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(bu||(bu={}));var rt;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(rt||(rt={}));const Mh={[rt.Left]:rt.Right,[rt.Right]:rt.Left,[rt.Top]:rt.Bottom,[rt.Bottom]:rt.Top};function y0(t){return t===null?null:t?"valid":"invalid"}const x0=t=>"id"in t&&"source"in t&&"target"in t,Q1=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Gd=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),Ba=(t,r=[0,0])=>{const{width:o,height:i}=Bo(t),l=t.origin??r,c=o*l[0],f=i*l[1];return{x:t.position.x-c,y:t.position.y-f}},G1=(t,r={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const o=t.reduce((i,l)=>{const c=typeof l=="string";let f=!r.nodeLookup&&!c?l:void 0;r.nodeLookup&&(f=c?r.nodeLookup.get(l):Gd(l)?l:r.nodeLookup.get(l.id));const m=f?ku(f,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Au(i,m)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Ou(o)},Fa=(t,r={})=>{let o={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return t.forEach(l=>{(r.filter===void 0||r.filter(l))&&(o=Au(o,ku(l)),i=!0)}),i?Ou(o):{x:0,y:0,width:0,height:0}},Jd=(t,r,[o,i,l]=[0,0,1],c=!1,f=!1)=>{const m={...Va(r,[o,i,l]),width:r.width/l,height:r.height/l},y=[];for(const b of t.values()){const{measured:_,selectable:v=!0,hidden:k=!1}=b;if(f&&!v||k)continue;const j=_.width??b.width??b.initialWidth??null,C=_.height??b.height??b.initialHeight??null,I=Aa(m,Di(b)),A=(j??0)*(C??0),T=c&&I>0;(!b.internals.handleBounds||T||I>=A||b.dragging)&&y.push(b)}return y},J1=(t,r)=>{const o=new Set;return t.forEach(i=>{o.add(i.id)}),r.filter(i=>o.has(i.source)||o.has(i.target))};function Z1(t,r){const o=new Map,i=r!=null&&r.nodes?new Set(r.nodes.map(l=>l.id)):null;return t.forEach(l=>{l.measured.width&&l.measured.height&&((r==null?void 0:r.includeHiddenNodes)||!l.hidden)&&(!i||i.has(l.id))&&o.set(l.id,l)}),o}async function eb({nodes:t,width:r,height:o,panZoom:i,minZoom:l,maxZoom:c},f){if(t.size===0)return Promise.resolve(!0);const m=Z1(t,f),y=Fa(m),b=Zd(y,r,o,(f==null?void 0:f.minZoom)??l,(f==null?void 0:f.maxZoom)??c,(f==null?void 0:f.padding)??.1);return await i.setViewport(b,{duration:f==null?void 0:f.duration,ease:f==null?void 0:f.ease,interpolate:f==null?void 0:f.interpolate}),Promise.resolve(!0)}function v0({nodeId:t,nextPosition:r,nodeLookup:o,nodeOrigin:i=[0,0],nodeExtent:l,onError:c}){const f=o.get(t),m=f.parentId?o.get(f.parentId):void 0,{x:y,y:b}=m?m.internals.positionAbsolute:{x:0,y:0},_=f.origin??i;let v=f.extent||l;if(f.extent==="parent"&&!f.expandParent)if(!m)c==null||c("005",lo.error005());else{const j=m.measured.width,C=m.measured.height;j&&C&&(v=[[y,b],[y+j,b+C]])}else m&&zi(f.extent)&&(v=[[f.extent[0][0]+y,f.extent[0][1]+b],[f.extent[1][0]+y,f.extent[1][1]+b]]);const k=zi(v)?Ks(r,v,f.measured):r;return(f.measured.width===void 0||f.measured.height===void 0)&&(c==null||c("015",lo.error015())),{position:{x:k.x-y+(f.measured.width??0)*_[0],y:k.y-b+(f.measured.height??0)*_[1]},positionAbsolute:k}}async function tb({nodesToRemove:t=[],edgesToRemove:r=[],nodes:o,edges:i,onBeforeDelete:l}){const c=new Set(t.map(k=>k.id)),f=[];for(const k of o){if(k.deletable===!1)continue;const j=c.has(k.id),C=!j&&k.parentId&&f.find(I=>I.id===k.parentId);(j||C)&&f.push(k)}const m=new Set(r.map(k=>k.id)),y=i.filter(k=>k.deletable!==!1),_=J1(f,y);for(const k of y)m.has(k.id)&&!_.find(C=>C.id===k.id)&&_.push(k);if(!l)return{edges:_,nodes:f};const v=await l({nodes:f,edges:_});return typeof v=="boolean"?v?{edges:_,nodes:f}:{edges:[],nodes:[]}:v}const Li=(t,r=0,o=1)=>Math.min(Math.max(t,r),o),Ks=(t={x:0,y:0},r,o)=>({x:Li(t.x,r[0][0],r[1][0]-((o==null?void 0:o.width)??0)),y:Li(t.y,r[0][1],r[1][1]-((o==null?void 0:o.height)??0))});function w0(t,r,o){const{width:i,height:l}=Bo(o),{x:c,y:f}=o.internals.positionAbsolute;return Ks(t,[[c,f],[c+i,f+l]],r)}const Th=(t,r,o)=>t<r?Li(Math.abs(t-r),1,r)/r:t>o?-Li(Math.abs(t-o),1,r)/r:0,b0=(t,r,o=15,i=40)=>{const l=Th(t.x,i,r.width-i)*o,c=Th(t.y,i,r.height-i)*o;return[l,c]},Au=(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)}),Rd=({x:t,y:r,width:o,height:i})=>({x:t,y:r,x2:t+o,y2:r+i}),Ou=({x:t,y:r,x2:o,y2:i})=>({x:t,y:r,width:o-t,height:i-r}),Di=(t,r=[0,0])=>{var l,c;const{x:o,y:i}=Gd(t)?t.internals.positionAbsolute:Ba(t,r);return{x:o,y:i,width:((l=t.measured)==null?void 0:l.width)??t.width??t.initialWidth??0,height:((c=t.measured)==null?void 0:c.height)??t.height??t.initialHeight??0}},ku=(t,r=[0,0])=>{var l,c;const{x:o,y:i}=Gd(t)?t.internals.positionAbsolute:Ba(t,r);return{x:o,y:i,x2:o+(((l=t.measured)==null?void 0:l.width)??t.width??t.initialWidth??0),y2:i+(((c=t.measured)==null?void 0:c.height)??t.height??t.initialHeight??0)}},k0=(t,r)=>Ou(Au(Rd(t),Rd(r))),Aa=(t,r)=>{const o=Math.max(0,Math.min(t.x+t.width,r.x+r.width)-Math.max(t.x,r.x)),i=Math.max(0,Math.min(t.y+t.height,r.y+r.height)-Math.max(t.y,r.y));return Math.ceil(o*i)},Ih=t=>Wr(t.width)&&Wr(t.height)&&Wr(t.x)&&Wr(t.y),Wr=t=>!isNaN(t)&&isFinite(t),nb=(t,r)=>{},Ha=(t,r=[1,1])=>({x:r[0]*Math.round(t.x/r[0]),y:r[1]*Math.round(t.y/r[1])}),Va=({x:t,y:r},[o,i,l],c=!1,f=[1,1])=>{const m={x:(t-o)/l,y:(r-i)/l};return c?Ha(m,f):m},_u=({x:t,y:r},[o,i,l])=>({x:t*l+o,y:r*l+i});function Ei(t,r){if(typeof t=="number")return Math.floor((r-r/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const o=parseFloat(t);if(!Number.isNaN(o))return Math.floor(o)}if(typeof t=="string"&&t.endsWith("%")){const o=parseFloat(t);if(!Number.isNaN(o))return Math.floor(r*o*.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 rb(t,r,o){if(typeof t=="string"||typeof t=="number"){const i=Ei(t,o),l=Ei(t,r);return{top:i,right:l,bottom:i,left:l,x:l*2,y:i*2}}if(typeof t=="object"){const i=Ei(t.top??t.y??0,o),l=Ei(t.bottom??t.y??0,o),c=Ei(t.left??t.x??0,r),f=Ei(t.right??t.x??0,r);return{top:i,right:f,bottom:l,left:c,x:c+f,y:i+l}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function ob(t,r,o,i,l,c){const{x:f,y:m}=_u(t,[r,o,i]),{x:y,y:b}=_u({x:t.x+t.width,y:t.y+t.height},[r,o,i]),_=l-y,v=c-b;return{left:Math.floor(f),top:Math.floor(m),right:Math.floor(_),bottom:Math.floor(v)}}const Zd=(t,r,o,i,l,c)=>{const f=rb(c,r,o),m=(r-f.x)/t.width,y=(o-f.y)/t.height,b=Math.min(m,y),_=Li(b,i,l),v=t.x+t.width/2,k=t.y+t.height/2,j=r/2-v*_,C=o/2-k*_,I=ob(t,j,C,_,r,o),A={left:Math.min(I.left-f.left,0),top:Math.min(I.top-f.top,0),right:Math.min(I.right-f.right,0),bottom:Math.min(I.bottom-f.bottom,0)};return{x:j-A.left+A.right,y:C-A.top+A.bottom,zoom:_}},Oa=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function zi(t){return t!=null&&t!=="parent"}function Bo(t){var r,o;return{width:((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth??0,height:((o=t.measured)==null?void 0:o.height)??t.height??t.initialHeight??0}}function _0(t){var r,o;return(((r=t.measured)==null?void 0:r.width)??t.width??t.initialWidth)!==void 0&&(((o=t.measured)==null?void 0:o.height)??t.height??t.initialHeight)!==void 0}function S0(t,r={width:0,height:0},o,i,l){const c={...t},f=i.get(o);if(f){const m=f.origin||l;c.x+=f.internals.positionAbsolute.x-(r.width??0)*m[0],c.y+=f.internals.positionAbsolute.y-(r.height??0)*m[1]}return c}function $h(t,r){if(t.size!==r.size)return!1;for(const o of t)if(!r.has(o))return!1;return!0}function sb(){let t,r;return{promise:new Promise((i,l)=>{t=i,r=l}),resolve:t,reject:r}}function ib(t){return{...m0,...t||{}}}function ja(t,{snapGrid:r=[0,0],snapToGrid:o=!1,transform:i,containerBounds:l}){const{x:c,y:f}=Yr(t),m=Va({x:c-((l==null?void 0:l.left)??0),y:f-((l==null?void 0:l.top)??0)},i),{x:y,y:b}=o?Ha(m,r):m;return{xSnapped:y,ySnapped:b,...m}}const ef=t=>({width:t.offsetWidth,height:t.offsetHeight}),N0=t=>{var r;return((r=t==null?void 0:t.getRootNode)==null?void 0:r.call(t))||(window==null?void 0:window.document)},ab=["INPUT","SELECT","TEXTAREA"];function E0(t){var i,l;const r=((l=(i=t.composedPath)==null?void 0:i.call(t))==null?void 0:l[0])||t.target;return(r==null?void 0:r.nodeType)!==1?!1:ab.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const j0=t=>"clientX"in t,Yr=(t,r)=>{var c,f;const o=j0(t),i=o?t.clientX:(c=t.touches)==null?void 0:c[0].clientX,l=o?t.clientY:(f=t.touches)==null?void 0:f[0].clientY;return{x:i-((r==null?void 0:r.left)??0),y:l-((r==null?void 0:r.top)??0)}},Ah=(t,r,o,i,l)=>{const c=r.querySelectorAll(`.${t}`);return!c||!c.length?null:Array.from(c).map(f=>{const m=f.getBoundingClientRect();return{id:f.getAttribute("data-handleid"),type:t,nodeId:l,position:f.getAttribute("data-handlepos"),x:(m.left-o.left)/i,y:(m.top-o.top)/i,...ef(f)}})};function C0({sourceX:t,sourceY:r,targetX:o,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:f,targetControlY:m}){const y=t*.125+l*.375+f*.375+o*.125,b=r*.125+c*.375+m*.375+i*.125,_=Math.abs(y-t),v=Math.abs(b-r);return[y,b,_,v]}function Gl(t,r){return t>=0?.5*t:r*25*Math.sqrt(-t)}function Oh({pos:t,x1:r,y1:o,x2:i,y2:l,c}){switch(t){case rt.Left:return[r-Gl(r-i,c),o];case rt.Right:return[r+Gl(i-r,c),o];case rt.Top:return[r,o-Gl(o-l,c)];case rt.Bottom:return[r,o+Gl(l-o,c)]}}function P0({sourceX:t,sourceY:r,sourcePosition:o=rt.Bottom,targetX:i,targetY:l,targetPosition:c=rt.Top,curvature:f=.25}){const[m,y]=Oh({pos:o,x1:t,y1:r,x2:i,y2:l,c:f}),[b,_]=Oh({pos:c,x1:i,y1:l,x2:t,y2:r,c:f}),[v,k,j,C]=C0({sourceX:t,sourceY:r,targetX:i,targetY:l,sourceControlX:m,sourceControlY:y,targetControlX:b,targetControlY:_});return[`M${t},${r} C${m},${y} ${b},${_} ${i},${l}`,v,k,j,C]}function M0({sourceX:t,sourceY:r,targetX:o,targetY:i}){const l=Math.abs(o-t)/2,c=o<t?o+l:o-l,f=Math.abs(i-r)/2,m=i<r?i+f:i-f;return[c,m,l,f]}function lb({sourceNode:t,targetNode:r,selected:o=!1,zIndex:i=0,elevateOnSelect:l=!1,zIndexMode:c="basic"}){if(c==="manual")return i;const f=l&&o?i+1e3:i,m=Math.max(t.parentId||l&&t.selected?t.internals.z:0,r.parentId||l&&r.selected?r.internals.z:0);return f+m}function ub({sourceNode:t,targetNode:r,width:o,height:i,transform:l}){const c=Au(ku(t),ku(r));c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const f={x:-l[0]/l[2],y:-l[1]/l[2],width:o/l[2],height:i/l[2]};return Aa(f,Ou(c))>0}const cb=({source:t,sourceHandle:r,target:o,targetHandle:i})=>`xy-edge__${t}${r||""}-${o}${i||""}`,db=(t,r)=>r.some(o=>o.source===t.source&&o.target===t.target&&(o.sourceHandle===t.sourceHandle||!o.sourceHandle&&!t.sourceHandle)&&(o.targetHandle===t.targetHandle||!o.targetHandle&&!t.targetHandle)),T0=(t,r,o={})=>{if(!t.source||!t.target)return r;const i=o.getEdgeId||cb;let l;return x0(t)?l={...t}:l={...t,id:i(t)},db(l,r)?r:(l.sourceHandle===null&&delete l.sourceHandle,l.targetHandle===null&&delete l.targetHandle,r.concat(l))};function I0({sourceX:t,sourceY:r,targetX:o,targetY:i}){const[l,c,f,m]=M0({sourceX:t,sourceY:r,targetX:o,targetY:i});return[`M ${t},${r}L ${o},${i}`,l,c,f,m]}const Rh={[rt.Left]:{x:-1,y:0},[rt.Right]:{x:1,y:0},[rt.Top]:{x:0,y:-1},[rt.Bottom]:{x:0,y:1}},fb=({source:t,sourcePosition:r=rt.Bottom,target:o})=>r===rt.Left||r===rt.Right?t.x<o.x?{x:1,y:0}:{x:-1,y:0}:t.y<o.y?{x:0,y:1}:{x:0,y:-1},Lh=(t,r)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));function pb({source:t,sourcePosition:r=rt.Bottom,target:o,targetPosition:i=rt.Top,center:l,offset:c,stepPosition:f}){const m=Rh[r],y=Rh[i],b={x:t.x+m.x*c,y:t.y+m.y*c},_={x:o.x+y.x*c,y:o.y+y.y*c},v=fb({source:b,sourcePosition:r,target:_}),k=v.x!==0?"x":"y",j=v[k];let C=[],I,A;const T={x:0,y:0},V={x:0,y:0},[,,P,M]=M0({sourceX:t.x,sourceY:t.y,targetX:o.x,targetY:o.y});if(m[k]*y[k]===-1){k==="x"?(I=l.x??b.x+(_.x-b.x)*f,A=l.y??(b.y+_.y)/2):(I=l.x??(b.x+_.x)/2,A=l.y??b.y+(_.y-b.y)*f);const Z=[{x:I,y:b.y},{x:I,y:_.y}],fe=[{x:b.x,y:A},{x:_.x,y:A}];m[k]===j?C=k==="x"?Z:fe:C=k==="x"?fe:Z}else{const Z=[{x:b.x,y:_.y}],fe=[{x:_.x,y:b.y}];if(k==="x"?C=m.x===j?fe:Z:C=m.y===j?Z:fe,r===i){const z=Math.abs(t[k]-o[k]);if(z<=c){const ue=Math.min(c-1,c-z);m[k]===j?T[k]=(b[k]>t[k]?-1:1)*ue:V[k]=(_[k]>o[k]?-1:1)*ue}}if(r!==i){const z=k==="x"?"y":"x",ue=m[k]===y[z],Q=b[z]>_[z],ie=b[z]<_[z];(m[k]===1&&(!ue&&Q||ue&&ie)||m[k]!==1&&(!ue&&ie||ue&&Q))&&(C=k==="x"?Z:fe)}const Se={x:b.x+T.x,y:b.y+T.y},X={x:_.x+V.x,y:_.y+V.y},de=Math.max(Math.abs(Se.x-C[0].x),Math.abs(X.x-C[0].x)),be=Math.max(Math.abs(Se.y-C[0].y),Math.abs(X.y-C[0].y));de>=be?(I=(Se.x+X.x)/2,A=C[0].y):(I=C[0].x,A=(Se.y+X.y)/2)}const B={x:b.x+T.x,y:b.y+T.y},U={x:_.x+V.x,y:_.y+V.y};return[[t,...B.x!==C[0].x||B.y!==C[0].y?[B]:[],...C,...U.x!==C[C.length-1].x||U.y!==C[C.length-1].y?[U]:[],o],I,A,P,M]}function hb(t,r,o,i){const l=Math.min(Lh(t,r)/2,Lh(r,o)/2,i),{x:c,y:f}=r;if(t.x===c&&c===o.x||t.y===f&&f===o.y)return`L${c} ${f}`;if(t.y===f){const b=t.x<o.x?-1:1,_=t.y<o.y?1:-1;return`L ${c+l*b},${f}Q ${c},${f} ${c},${f+l*_}`}const m=t.x<o.x?1:-1,y=t.y<o.y?-1:1;return`L ${c},${f+l*y}Q ${c},${f} ${c+l*m},${f}`}function Ld({sourceX:t,sourceY:r,sourcePosition:o=rt.Bottom,targetX:i,targetY:l,targetPosition:c=rt.Top,borderRadius:f=5,centerX:m,centerY:y,offset:b=20,stepPosition:_=.5}){const[v,k,j,C,I]=pb({source:{x:t,y:r},sourcePosition:o,target:{x:i,y:l},targetPosition:c,center:{x:m,y},offset:b,stepPosition:_});let A=`M${v[0].x} ${v[0].y}`;for(let T=1;T<v.length-1;T++)A+=hb(v[T-1],v[T],v[T+1],f);return A+=`L${v[v.length-1].x} ${v[v.length-1].y}`,[A,k,j,C,I]}function Dh(t){var r;return t&&!!(t.internals.handleBounds||(r=t.handles)!=null&&r.length)&&!!(t.measured.width||t.width||t.initialWidth)}function mb(t){var v;const{sourceNode:r,targetNode:o}=t;if(!Dh(r)||!Dh(o))return null;const i=r.internals.handleBounds||zh(r.handles),l=o.internals.handleBounds||zh(o.handles),c=Bh((i==null?void 0:i.source)??[],t.sourceHandle),f=Bh(t.connectionMode===Ri.Strict?(l==null?void 0:l.target)??[]:((l==null?void 0:l.target)??[]).concat((l==null?void 0:l.source)??[]),t.targetHandle);if(!c||!f)return(v=t.onError)==null||v.call(t,"008",lo.error008(c?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const m=(c==null?void 0:c.position)||rt.Bottom,y=(f==null?void 0:f.position)||rt.Top,b=qs(r,c,m),_=qs(o,f,y);return{sourceX:b.x,sourceY:b.y,targetX:_.x,targetY:_.y,sourcePosition:m,targetPosition:y}}function zh(t){if(!t)return null;const r=[],o=[];for(const i of t)i.width=i.width??1,i.height=i.height??1,i.type==="source"?r.push(i):i.type==="target"&&o.push(i);return{source:r,target:o}}function qs(t,r,o=rt.Left,i=!1){const l=((r==null?void 0:r.x)??0)+t.internals.positionAbsolute.x,c=((r==null?void 0:r.y)??0)+t.internals.positionAbsolute.y,{width:f,height:m}=r??Bo(t);if(i)return{x:l+f/2,y:c+m/2};switch((r==null?void 0:r.position)??o){case rt.Top:return{x:l+f/2,y:c};case rt.Right:return{x:l+f,y:c+m/2};case rt.Bottom:return{x:l+f/2,y:c+m};case rt.Left:return{x:l,y:c+m/2}}}function Bh(t,r){return t&&(r?t.find(o=>o.id===r):t[0])||null}function Dd(t,r){return t?typeof t=="string"?t:`${r?`${r}__`:""}${Object.keys(t).sort().map(i=>`${i}=${t[i]}`).join("&")}`:""}function gb(t,{id:r,defaultColor:o,defaultMarkerStart:i,defaultMarkerEnd:l}){const c=new Set;return t.reduce((f,m)=>([m.markerStart||i,m.markerEnd||l].forEach(y=>{if(y&&typeof y=="object"){const b=Dd(y,r);c.has(b)||(f.push({id:b,color:y.color||o,...y}),c.add(b))}}),f),[]).sort((f,m)=>f.id.localeCompare(m.id))}const $0=1e3,yb=10,tf={nodeOrigin:[0,0],nodeExtent:Ia,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},xb={...tf,checkEquality:!0};function nf(t,r){const o={...t};for(const i in r)r[i]!==void 0&&(o[i]=r[i]);return o}function vb(t,r,o){const i=nf(tf,o);for(const l of t.values())if(l.parentId)of(l,t,r,i);else{const c=Ba(l,i.nodeOrigin),f=zi(l.extent)?l.extent:i.nodeExtent,m=Ks(c,f,Bo(l));l.internals.positionAbsolute=m}}function wb(t,r){if(!t.handles)return t.measured?r==null?void 0:r.internals.handleBounds:void 0;const o=[],i=[];for(const l of t.handles){const c={id:l.id,width:l.width??1,height:l.height??1,nodeId:t.id,x:l.x,y:l.y,position:l.position,type:l.type};l.type==="source"?o.push(c):l.type==="target"&&i.push(c)}return{source:o,target:i}}function rf(t){return t==="manual"}function zd(t,r,o,i={}){var _,v;const l=nf(xb,i),c={i:0},f=new Map(r),m=l!=null&&l.elevateNodesOnSelect&&!rf(l.zIndexMode)?$0:0;let y=t.length>0,b=!1;r.clear(),o.clear();for(const k of t){let j=f.get(k.id);if(l.checkEquality&&k===(j==null?void 0:j.internals.userNode))r.set(k.id,j);else{const C=Ba(k,l.nodeOrigin),I=zi(k.extent)?k.extent:l.nodeExtent,A=Ks(C,I,Bo(k));j={...l.defaults,...k,measured:{width:(_=k.measured)==null?void 0:_.width,height:(v=k.measured)==null?void 0:v.height},internals:{positionAbsolute:A,handleBounds:wb(k,j),z:A0(k,m,l.zIndexMode),userNode:k}},r.set(k.id,j)}(j.measured===void 0||j.measured.width===void 0||j.measured.height===void 0)&&!j.hidden&&(y=!1),k.parentId&&of(j,r,o,i,c),b||(b=k.selected??!1)}return{nodesInitialized:y,hasSelectedNodes:b}}function bb(t,r){if(!t.parentId)return;const o=r.get(t.parentId);o?o.set(t.id,t):r.set(t.parentId,new Map([[t.id,t]]))}function of(t,r,o,i,l){const{elevateNodesOnSelect:c,nodeOrigin:f,nodeExtent:m,zIndexMode:y}=nf(tf,i),b=t.parentId,_=r.get(b);if(!_){console.warn(`Parent node ${b} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}bb(t,o),l&&!_.parentId&&_.internals.rootParentIndex===void 0&&y==="auto"&&(_.internals.rootParentIndex=++l.i,_.internals.z=_.internals.z+l.i*yb),l&&_.internals.rootParentIndex!==void 0&&(l.i=_.internals.rootParentIndex);const v=c&&!rf(y)?$0:0,{x:k,y:j,z:C}=kb(t,_,f,m,v,y),{positionAbsolute:I}=t.internals,A=k!==I.x||j!==I.y;(A||C!==t.internals.z)&&r.set(t.id,{...t,internals:{...t.internals,positionAbsolute:A?{x:k,y:j}:I,z:C}})}function A0(t,r,o){const i=Wr(t.zIndex)?t.zIndex:0;return rf(o)?i:i+(t.selected?r:0)}function kb(t,r,o,i,l,c){const{x:f,y:m}=r.internals.positionAbsolute,y=Bo(t),b=Ba(t,o),_=zi(t.extent)?Ks(b,t.extent,y):b;let v=Ks({x:f+_.x,y:m+_.y},i,y);t.extent==="parent"&&(v=w0(v,y,r));const k=A0(t,l,c),j=r.internals.z??0;return{x:v.x,y:v.y,z:j>=k?j+1:k}}function sf(t,r,o,i=[0,0]){var f;const l=[],c=new Map;for(const m of t){const y=r.get(m.parentId);if(!y)continue;const b=((f=c.get(m.parentId))==null?void 0:f.expandedRect)??Di(y),_=k0(b,m.rect);c.set(m.parentId,{expandedRect:_,parent:y})}return c.size>0&&c.forEach(({expandedRect:m,parent:y},b)=>{var P;const _=y.internals.positionAbsolute,v=Bo(y),k=y.origin??i,j=m.x<_.x?Math.round(Math.abs(_.x-m.x)):0,C=m.y<_.y?Math.round(Math.abs(_.y-m.y)):0,I=Math.max(v.width,Math.round(m.width)),A=Math.max(v.height,Math.round(m.height)),T=(I-v.width)*k[0],V=(A-v.height)*k[1];(j>0||C>0||T||V)&&(l.push({id:b,type:"position",position:{x:y.position.x-j+T,y:y.position.y-C+V}}),(P=o.get(b))==null||P.forEach(M=>{t.some(B=>B.id===M.id)||l.push({id:M.id,type:"position",position:{x:M.position.x+j,y:M.position.y+C}})})),(v.width<m.width||v.height<m.height||j||C)&&l.push({id:b,type:"dimensions",setAttributes:!0,dimensions:{width:I+(j?k[0]*j-T:0),height:A+(C?k[1]*C-V:0)}})}),l}function _b(t,r,o,i,l,c,f){const m=i==null?void 0:i.querySelector(".xyflow__viewport");let y=!1;if(!m)return{changes:[],updatedInternals:y};const b=[],_=window.getComputedStyle(m),{m22:v}=new window.DOMMatrixReadOnly(_.transform),k=[];for(const j of t.values()){const C=r.get(j.id);if(!C)continue;if(C.hidden){r.set(C.id,{...C,internals:{...C.internals,handleBounds:void 0}}),y=!0;continue}const I=ef(j.nodeElement),A=C.measured.width!==I.width||C.measured.height!==I.height;if(!!(I.width&&I.height&&(A||!C.internals.handleBounds||j.force))){const V=j.nodeElement.getBoundingClientRect(),P=zi(C.extent)?C.extent:c;let{positionAbsolute:M}=C.internals;C.parentId&&C.extent==="parent"?M=w0(M,I,r.get(C.parentId)):P&&(M=Ks(M,P,I));const B={...C,measured:I,internals:{...C.internals,positionAbsolute:M,handleBounds:{source:Ah("source",j.nodeElement,V,v,C.id),target:Ah("target",j.nodeElement,V,v,C.id)}}};r.set(C.id,B),C.parentId&&of(B,r,o,{nodeOrigin:l,zIndexMode:f}),y=!0,A&&(b.push({id:C.id,type:"dimensions",dimensions:I}),C.expandParent&&C.parentId&&k.push({id:C.id,parentId:C.parentId,rect:Di(B,l)}))}}if(k.length>0){const j=sf(k,r,o,l);b.push(...j)}return{changes:b,updatedInternals:y}}async function Sb({delta:t,panZoom:r,transform:o,translateExtent:i,width:l,height:c}){if(!r||!t.x&&!t.y)return Promise.resolve(!1);const f=await r.setViewportConstrained({x:o[0]+t.x,y:o[1]+t.y,zoom:o[2]},[[0,0],[l,c]],i),m=!!f&&(f.x!==o[0]||f.y!==o[1]||f.k!==o[2]);return Promise.resolve(m)}function Fh(t,r,o,i,l,c){let f=l;const m=i.get(f)||new Map;i.set(f,m.set(o,r)),f=`${l}-${t}`;const y=i.get(f)||new Map;if(i.set(f,y.set(o,r)),c){f=`${l}-${t}-${c}`;const b=i.get(f)||new Map;i.set(f,b.set(o,r))}}function O0(t,r,o){t.clear(),r.clear();for(const i of o){const{source:l,target:c,sourceHandle:f=null,targetHandle:m=null}=i,y={edgeId:i.id,source:l,target:c,sourceHandle:f,targetHandle:m},b=`${l}-${f}--${c}-${m}`,_=`${c}-${m}--${l}-${f}`;Fh("source",y,_,t,l,f),Fh("target",y,b,t,c,m),r.set(i.id,i)}}function R0(t,r){if(!t.parentId)return!1;const o=r.get(t.parentId);return o?o.selected?!0:R0(o,r):!1}function Hh(t,r,o){var l;let i=t;do{if((l=i==null?void 0:i.matches)!=null&&l.call(i,r))return!0;if(i===o)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function Nb(t,r,o,i){const l=new Map;for(const[c,f]of t)if((f.selected||f.id===i)&&(!f.parentId||!R0(f,t))&&(f.draggable||r&&typeof f.draggable>"u")){const m=t.get(c);m&&l.set(c,{id:c,position:m.position||{x:0,y:0},distance:{x:o.x-m.internals.positionAbsolute.x,y:o.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 l}function fd({nodeId:t,dragItems:r,nodeLookup:o,dragging:i=!0}){var f,m,y;const l=[];for(const[b,_]of r){const v=(f=o.get(b))==null?void 0:f.internals.userNode;v&&l.push({...v,position:_.position,dragging:i})}if(!t)return[l[0],l];const c=(m=o.get(t))==null?void 0:m.internals.userNode;return[c?{...c,position:((y=r.get(t))==null?void 0:y.position)||c.position,dragging:i}:l[0],l]}function Eb({dragItems:t,snapGrid:r,x:o,y:i}){const l=t.values().next().value;if(!l)return null;const c={x:o-l.distance.x,y:i-l.distance.y},f=Ha(c,r);return{x:f.x-c.x,y:f.y-c.y}}function jb({onNodeMouseDown:t,getStoreItems:r,onDragStart:o,onDrag:i,onDragStop:l}){let c={x:null,y:null},f=0,m=new Map,y=!1,b={x:0,y:0},_=null,v=!1,k=null,j=!1,C=!1,I=null;function A({noDragClassName:V,handleSelector:P,domNode:M,isSelectable:B,nodeId:U,nodeClickDistance:W=0}){k=cr(M);function Z({x:de,y:be}){const{nodeLookup:z,nodeExtent:ue,snapGrid:Q,snapToGrid:ie,nodeOrigin:H,onNodeDrag:q,onSelectionDrag:J,onError:O,updateNodePositions:K}=r();c={x:de,y:be};let ke=!1;const Ne=m.size>1,Ae=Ne&&ue?Rd(Fa(m)):null,Oe=Ne&&ie?Eb({dragItems:m,snapGrid:Q,x:de,y:be}):null;for(const[Re,_e]of m){if(!z.has(Re))continue;let ze={x:de-_e.distance.x,y:be-_e.distance.y};ie&&(ze=Oe?{x:Math.round(ze.x+Oe.x),y:Math.round(ze.y+Oe.y)}:Ha(ze,Q));let Ee=null;if(Ne&&ue&&!_e.extent&&Ae){const{positionAbsolute:Ke}=_e.internals,ct=Ke.x-Ae.x+ue[0][0],dt=Ke.x+_e.measured.width-Ae.x2+ue[1][0],we=Ke.y-Ae.y+ue[0][1],tt=Ke.y+_e.measured.height-Ae.y2+ue[1][1];Ee=[[ct,we],[dt,tt]]}const{position:Ze,positionAbsolute:He}=v0({nodeId:Re,nextPosition:ze,nodeLookup:z,nodeExtent:Ee||ue,nodeOrigin:H,onError:O});ke=ke||_e.position.x!==Ze.x||_e.position.y!==Ze.y,_e.position=Ze,_e.internals.positionAbsolute=He}if(C=C||ke,!!ke&&(K(m,!0),I&&(i||q||!U&&J))){const[Re,_e]=fd({nodeId:U,dragItems:m,nodeLookup:z});i==null||i(I,m,Re,_e),q==null||q(I,Re,_e),U||J==null||J(I,_e)}}async function fe(){if(!_)return;const{transform:de,panBy:be,autoPanSpeed:z,autoPanOnNodeDrag:ue}=r();if(!ue){y=!1,cancelAnimationFrame(f);return}const[Q,ie]=b0(b,_,z);(Q!==0||ie!==0)&&(c.x=(c.x??0)-Q/de[2],c.y=(c.y??0)-ie/de[2],await be({x:Q,y:ie})&&Z(c)),f=requestAnimationFrame(fe)}function Se(de){var Ne;const{nodeLookup:be,multiSelectionActive:z,nodesDraggable:ue,transform:Q,snapGrid:ie,snapToGrid:H,selectNodesOnDrag:q,onNodeDragStart:J,onSelectionDragStart:O,unselectNodesAndEdges:K}=r();v=!0,(!q||!B)&&!z&&U&&((Ne=be.get(U))!=null&&Ne.selected||K()),B&&q&&U&&(t==null||t(U));const ke=ja(de.sourceEvent,{transform:Q,snapGrid:ie,snapToGrid:H,containerBounds:_});if(c=ke,m=Nb(be,ue,ke,U),m.size>0&&(o||J||!U&&O)){const[Ae,Oe]=fd({nodeId:U,dragItems:m,nodeLookup:be});o==null||o(de.sourceEvent,m,Ae,Oe),J==null||J(de.sourceEvent,Ae,Oe),U||O==null||O(de.sourceEvent,Oe)}}const X=Jm().clickDistance(W).on("start",de=>{const{domNode:be,nodeDragThreshold:z,transform:ue,snapGrid:Q,snapToGrid:ie}=r();_=(be==null?void 0:be.getBoundingClientRect())||null,j=!1,C=!1,I=de.sourceEvent,z===0&&Se(de),c=ja(de.sourceEvent,{transform:ue,snapGrid:Q,snapToGrid:ie,containerBounds:_}),b=Yr(de.sourceEvent,_)}).on("drag",de=>{const{autoPanOnNodeDrag:be,transform:z,snapGrid:ue,snapToGrid:Q,nodeDragThreshold:ie,nodeLookup:H}=r(),q=ja(de.sourceEvent,{transform:z,snapGrid:ue,snapToGrid:Q,containerBounds:_});if(I=de.sourceEvent,(de.sourceEvent.type==="touchmove"&&de.sourceEvent.touches.length>1||U&&!H.has(U))&&(j=!0),!j){if(!y&&be&&v&&(y=!0,fe()),!v){const J=Yr(de.sourceEvent,_),O=J.x-b.x,K=J.y-b.y;Math.sqrt(O*O+K*K)>ie&&Se(de)}(c.x!==q.xSnapped||c.y!==q.ySnapped)&&m&&v&&(b=Yr(de.sourceEvent,_),Z(q))}}).on("end",de=>{if(!(!v||j)&&(y=!1,v=!1,cancelAnimationFrame(f),m.size>0)){const{nodeLookup:be,updateNodePositions:z,onNodeDragStop:ue,onSelectionDragStop:Q}=r();if(C&&(z(m,!1),C=!1),l||ue||!U&&Q){const[ie,H]=fd({nodeId:U,dragItems:m,nodeLookup:be,dragging:!1});l==null||l(de.sourceEvent,m,ie,H),ue==null||ue(de.sourceEvent,ie,H),U||Q==null||Q(de.sourceEvent,H)}}}).filter(de=>{const be=de.target;return!de.button&&(!V||!Hh(be,`.${V}`,M))&&(!P||Hh(be,P,M))});k.call(X)}function T(){k==null||k.on(".drag",null)}return{update:A,destroy:T}}function Cb(t,r,o){const i=[],l={x:t.x-o,y:t.y-o,width:o*2,height:o*2};for(const c of r.values())Aa(l,Di(c))>0&&i.push(c);return i}const Pb=250;function Mb(t,r,o,i){var m,y;let l=[],c=1/0;const f=Cb(t,o,r+Pb);for(const b of f){const _=[...((m=b.internals.handleBounds)==null?void 0:m.source)??[],...((y=b.internals.handleBounds)==null?void 0:y.target)??[]];for(const v of _){if(i.nodeId===v.nodeId&&i.type===v.type&&i.id===v.id)continue;const{x:k,y:j}=qs(b,v,v.position,!0),C=Math.sqrt(Math.pow(k-t.x,2)+Math.pow(j-t.y,2));C>r||(C<c?(l=[{...v,x:k,y:j}],c=C):C===c&&l.push({...v,x:k,y:j}))}}if(!l.length)return null;if(l.length>1){const b=i.type==="source"?"target":"source";return l.find(_=>_.type===b)??l[0]}return l[0]}function L0(t,r,o,i,l,c=!1){var b,_,v;const f=i.get(t);if(!f)return null;const m=l==="strict"?(b=f.internals.handleBounds)==null?void 0:b[r]:[...((_=f.internals.handleBounds)==null?void 0:_.source)??[],...((v=f.internals.handleBounds)==null?void 0:v.target)??[]],y=(o?m==null?void 0:m.find(k=>k.id===o):m==null?void 0:m[0])??null;return y&&c?{...y,...qs(f,y,y.position,!0)}:y}function D0(t,r){return t||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function Tb(t,r){let o=null;return r?o=!0:t&&!r&&(o=!1),o}const z0=()=>!0;function Ib(t,{connectionMode:r,connectionRadius:o,handleId:i,nodeId:l,edgeUpdaterType:c,isTarget:f,domNode:m,nodeLookup:y,lib:b,autoPanOnConnect:_,flowId:v,panBy:k,cancelConnection:j,onConnectStart:C,onConnect:I,onConnectEnd:A,isValidConnection:T=z0,onReconnectEnd:V,updateConnection:P,getTransform:M,getFromHandle:B,autoPanSpeed:U,dragThreshold:W=1,handleDomNode:Z}){const fe=N0(t.target);let Se=0,X;const{x:de,y:be}=Yr(t),z=D0(c,Z),ue=m==null?void 0:m.getBoundingClientRect();let Q=!1;if(!ue||!z)return;const ie=L0(l,z,i,y,r);if(!ie)return;let H=Yr(t,ue),q=!1,J=null,O=!1,K=null;function ke(){if(!_||!ue)return;const[Ze,He]=b0(H,ue,U);k({x:Ze,y:He}),Se=requestAnimationFrame(ke)}const Ne={...ie,nodeId:l,type:z,position:ie.position},Ae=y.get(l);let Re={inProgress:!0,isValid:null,from:qs(Ae,Ne,rt.Left,!0),fromHandle:Ne,fromPosition:Ne.position,fromNode:Ae,to:H,toHandle:null,toPosition:Mh[Ne.position],toNode:null,pointer:H};function _e(){Q=!0,P(Re),C==null||C(t,{nodeId:l,handleId:i,handleType:z})}W===0&&_e();function ze(Ze){if(!Q){const{x:tt,y:_t}=Yr(Ze),Ct=tt-de,xt=_t-be;if(!(Ct*Ct+xt*xt>W*W))return;_e()}if(!B()||!Ne){Ee(Ze);return}const He=M();H=Yr(Ze,ue),X=Mb(Va(H,He,!1,[1,1]),o,y,Ne),q||(ke(),q=!0);const Ke=B0(Ze,{handle:X,connectionMode:r,fromNodeId:l,fromHandleId:i,fromType:f?"target":"source",isValidConnection:T,doc:fe,lib:b,flowId:v,nodeLookup:y});K=Ke.handleDomNode,J=Ke.connection,O=Tb(!!X,Ke.isValid);const ct=y.get(l),dt=ct?qs(ct,Ne,rt.Left,!0):Re.from,we={...Re,from:dt,isValid:O,to:Ke.toHandle&&O?_u({x:Ke.toHandle.x,y:Ke.toHandle.y},He):H,toHandle:Ke.toHandle,toPosition:O&&Ke.toHandle?Ke.toHandle.position:Mh[Ne.position],toNode:Ke.toHandle?y.get(Ke.toHandle.nodeId):null,pointer:H};P(we),Re=we}function Ee(Ze){if(!("touches"in Ze&&Ze.touches.length>0)){if(Q){(X||K)&&J&&O&&(I==null||I(J));const{inProgress:He,...Ke}=Re,ct={...Ke,toPosition:Re.toHandle?Re.toPosition:null};A==null||A(Ze,ct),c&&(V==null||V(Ze,ct))}j(),cancelAnimationFrame(Se),q=!1,O=!1,J=null,K=null,fe.removeEventListener("mousemove",ze),fe.removeEventListener("mouseup",Ee),fe.removeEventListener("touchmove",ze),fe.removeEventListener("touchend",Ee)}}fe.addEventListener("mousemove",ze),fe.addEventListener("mouseup",Ee),fe.addEventListener("touchmove",ze),fe.addEventListener("touchend",Ee)}function B0(t,{handle:r,connectionMode:o,fromNodeId:i,fromHandleId:l,fromType:c,doc:f,lib:m,flowId:y,isValidConnection:b=z0,nodeLookup:_}){const v=c==="target",k=r?f.querySelector(`.${m}-flow__handle[data-id="${y}-${r==null?void 0:r.nodeId}-${r==null?void 0:r.id}-${r==null?void 0:r.type}"]`):null,{x:j,y:C}=Yr(t),I=f.elementFromPoint(j,C),A=I!=null&&I.classList.contains(`${m}-flow__handle`)?I:k,T={handleDomNode:A,isValid:!1,connection:null,toHandle:null};if(A){const V=D0(void 0,A),P=A.getAttribute("data-nodeid"),M=A.getAttribute("data-handleid"),B=A.classList.contains("connectable"),U=A.classList.contains("connectableend");if(!P||!V)return T;const W={source:v?P:i,sourceHandle:v?M:l,target:v?i:P,targetHandle:v?l:M};T.connection=W;const fe=B&&U&&(o===Ri.Strict?v&&V==="source"||!v&&V==="target":P!==i||M!==l);T.isValid=fe&&b(W),T.toHandle=L0(P,V,M,_,o,!0)}return T}const Bd={onPointerDown:Ib,isValid:B0};function $b({domNode:t,panZoom:r,getTransform:o,getViewScale:i}){const l=cr(t);function c({translateExtent:m,width:y,height:b,zoomStep:_=1,pannable:v=!0,zoomable:k=!0,inversePan:j=!1}){const C=P=>{if(P.sourceEvent.type!=="wheel"||!r)return;const M=o(),B=P.sourceEvent.ctrlKey&&Oa()?10:1,U=-P.sourceEvent.deltaY*(P.sourceEvent.deltaMode===1?.05:P.sourceEvent.deltaMode?1:.002)*_,W=M[2]*Math.pow(2,U*B);r.scaleTo(W)};let I=[0,0];const A=P=>{(P.sourceEvent.type==="mousedown"||P.sourceEvent.type==="touchstart")&&(I=[P.sourceEvent.clientX??P.sourceEvent.touches[0].clientX,P.sourceEvent.clientY??P.sourceEvent.touches[0].clientY])},T=P=>{const M=o();if(P.sourceEvent.type!=="mousemove"&&P.sourceEvent.type!=="touchmove"||!r)return;const B=[P.sourceEvent.clientX??P.sourceEvent.touches[0].clientX,P.sourceEvent.clientY??P.sourceEvent.touches[0].clientY],U=[B[0]-I[0],B[1]-I[1]];I=B;const W=i()*Math.max(M[2],Math.log(M[2]))*(j?-1:1),Z={x:M[0]-U[0]*W,y:M[1]-U[1]*W},fe=[[0,0],[y,b]];r.setViewportConstrained({x:Z.x,y:Z.y,zoom:M[2]},fe,m)},V=p0().on("start",A).on("zoom",v?T:null).on("zoom.wheel",k?C:null);l.call(V,{})}function f(){l.on("zoom",null)}return{update:c,destroy:f,pointer:Kr}}const Ru=t=>({x:t.x,y:t.y,zoom:t.k}),pd=({x:t,y:r,zoom:o})=>$u.translate(t,r).scale(o),Ci=(t,r)=>t.target.closest(`.${r}`),F0=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),Ab=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,hd=(t,r=0,o=Ab,i=()=>{})=>{const l=typeof r=="number"&&r>0;return l||i(),l?t.transition().duration(r).ease(o).on("end",i):t},H0=t=>{const r=t.ctrlKey&&Oa()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function Ob({zoomPanValues:t,noWheelClassName:r,d3Selection:o,d3Zoom:i,panOnScrollMode:l,panOnScrollSpeed:c,zoomOnPinch:f,onPanZoomStart:m,onPanZoom:y,onPanZoomEnd:b}){return _=>{if(Ci(_,r))return _.ctrlKey&&_.preventDefault(),!1;_.preventDefault(),_.stopImmediatePropagation();const v=o.property("__zoom").k||1;if(_.ctrlKey&&f){const A=Kr(_),T=H0(_),V=v*Math.pow(2,T);i.scaleTo(o,V,A,_);return}const k=_.deltaMode===1?20:1;let j=l===Hs.Vertical?0:_.deltaX*k,C=l===Hs.Horizontal?0:_.deltaY*k;!Oa()&&_.shiftKey&&l!==Hs.Vertical&&(j=_.deltaY*k,C=0),i.translateBy(o,-(j/v)*c,-(C/v)*c,{internal:!0});const I=Ru(o.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(y==null||y(_,I),t.panScrollTimeout=setTimeout(()=>{b==null||b(_,I),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,m==null||m(_,I))}}function Rb({noWheelClassName:t,preventScrolling:r,d3ZoomHandler:o}){return function(i,l){const c=i.type==="wheel",f=!r&&c&&!i.ctrlKey,m=Ci(i,t);if(i.ctrlKey&&c&&m&&i.preventDefault(),f||m)return null;i.preventDefault(),o.call(this,i,l)}}function Lb({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:o}){return i=>{var c,f,m;if((c=i.sourceEvent)!=null&&c.internal)return;const l=Ru(i.transform);t.mouseButton=((f=i.sourceEvent)==null?void 0:f.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=l,((m=i.sourceEvent)==null?void 0:m.type)==="mousedown"&&r(!0),o&&(o==null||o(i.sourceEvent,l))}}function Db({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:o,onTransformChange:i,onPanZoom:l}){return c=>{var f,m;t.usedRightMouseButton=!!(o&&F0(r,t.mouseButton??0)),(f=c.sourceEvent)!=null&&f.sync||i([c.transform.x,c.transform.y,c.transform.k]),l&&!((m=c.sourceEvent)!=null&&m.internal)&&(l==null||l(c.sourceEvent,Ru(c.transform)))}}function zb({zoomPanValues:t,panOnDrag:r,panOnScroll:o,onDraggingChange:i,onPanZoomEnd:l,onPaneContextMenu:c}){return f=>{var m;if(!((m=f.sourceEvent)!=null&&m.internal)&&(t.isZoomingOrPanning=!1,c&&F0(r,t.mouseButton??0)&&!t.usedRightMouseButton&&f.sourceEvent&&c(f.sourceEvent),t.usedRightMouseButton=!1,i(!1),l)){const y=Ru(f.transform);t.prevViewport=y,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{l==null||l(f.sourceEvent,y)},o?150:0)}}}function Bb({zoomActivationKeyPressed:t,zoomOnScroll:r,zoomOnPinch:o,panOnDrag:i,panOnScroll:l,zoomOnDoubleClick:c,userSelectionActive:f,noWheelClassName:m,noPanClassName:y,lib:b,connectionInProgress:_}){return v=>{var A;const k=t||r,j=o&&v.ctrlKey,C=v.type==="wheel";if(v.button===1&&v.type==="mousedown"&&(Ci(v,`${b}-flow__node`)||Ci(v,`${b}-flow__edge`)))return!0;if(!i&&!k&&!l&&!c&&!o||f||_&&!C||Ci(v,m)&&C||Ci(v,y)&&(!C||l&&C&&!t)||!o&&v.ctrlKey&&C)return!1;if(!o&&v.type==="touchstart"&&((A=v.touches)==null?void 0:A.length)>1)return v.preventDefault(),!1;if(!k&&!l&&!j&&C||!i&&(v.type==="mousedown"||v.type==="touchstart")||Array.isArray(i)&&!i.includes(v.button)&&v.type==="mousedown")return!1;const I=Array.isArray(i)&&i.includes(v.button)||!v.button||v.button<=1;return(!v.ctrlKey||C)&&I}}function Fb({domNode:t,minZoom:r,maxZoom:o,translateExtent:i,viewport:l,onPanZoom:c,onPanZoomStart:f,onPanZoomEnd:m,onDraggingChange:y}){const b={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},_=t.getBoundingClientRect(),v=p0().scaleExtent([r,o]).translateExtent(i),k=cr(t).call(v);V({x:l.x,y:l.y,zoom:Li(l.zoom,r,o)},[[0,0],[_.width,_.height]],i);const j=k.on("wheel.zoom"),C=k.on("dblclick.zoom");v.wheelDelta(H0);function I(X,de){return k?new Promise(be=>{v==null||v.interpolate((de==null?void 0:de.interpolate)==="linear"?Ea:au).transform(hd(k,de==null?void 0:de.duration,de==null?void 0:de.ease,()=>be(!0)),X)}):Promise.resolve(!1)}function A({noWheelClassName:X,noPanClassName:de,onPaneContextMenu:be,userSelectionActive:z,panOnScroll:ue,panOnDrag:Q,panOnScrollMode:ie,panOnScrollSpeed:H,preventScrolling:q,zoomOnPinch:J,zoomOnScroll:O,zoomOnDoubleClick:K,zoomActivationKeyPressed:ke,lib:Ne,onTransformChange:Ae,connectionInProgress:Oe,paneClickDistance:Re,selectionOnDrag:_e}){z&&!b.isZoomingOrPanning&&T();const ze=ue&&!ke&&!z;v.clickDistance(_e?1/0:!Wr(Re)||Re<0?0:Re);const Ee=ze?Ob({zoomPanValues:b,noWheelClassName:X,d3Selection:k,d3Zoom:v,panOnScrollMode:ie,panOnScrollSpeed:H,zoomOnPinch:J,onPanZoomStart:f,onPanZoom:c,onPanZoomEnd:m}):Rb({noWheelClassName:X,preventScrolling:q,d3ZoomHandler:j});if(k.on("wheel.zoom",Ee,{passive:!1}),!z){const He=Lb({zoomPanValues:b,onDraggingChange:y,onPanZoomStart:f});v.on("start",He);const Ke=Db({zoomPanValues:b,panOnDrag:Q,onPaneContextMenu:!!be,onPanZoom:c,onTransformChange:Ae});v.on("zoom",Ke);const ct=zb({zoomPanValues:b,panOnDrag:Q,panOnScroll:ue,onPaneContextMenu:be,onPanZoomEnd:m,onDraggingChange:y});v.on("end",ct)}const Ze=Bb({zoomActivationKeyPressed:ke,panOnDrag:Q,zoomOnScroll:O,panOnScroll:ue,zoomOnDoubleClick:K,zoomOnPinch:J,userSelectionActive:z,noPanClassName:de,noWheelClassName:X,lib:Ne,connectionInProgress:Oe});v.filter(Ze),K?k.on("dblclick.zoom",C):k.on("dblclick.zoom",null)}function T(){v.on("zoom",null)}async function V(X,de,be){const z=pd(X),ue=v==null?void 0:v.constrain()(z,de,be);return ue&&await I(ue),new Promise(Q=>Q(ue))}async function P(X,de){const be=pd(X);return await I(be,de),new Promise(z=>z(be))}function M(X){if(k){const de=pd(X),be=k.property("__zoom");(be.k!==X.zoom||be.x!==X.x||be.y!==X.y)&&(v==null||v.transform(k,de,null,{sync:!0}))}}function B(){const X=k?f0(k.node()):{x:0,y:0,k:1};return{x:X.x,y:X.y,zoom:X.k}}function U(X,de){return k?new Promise(be=>{v==null||v.interpolate((de==null?void 0:de.interpolate)==="linear"?Ea:au).scaleTo(hd(k,de==null?void 0:de.duration,de==null?void 0:de.ease,()=>be(!0)),X)}):Promise.resolve(!1)}function W(X,de){return k?new Promise(be=>{v==null||v.interpolate((de==null?void 0:de.interpolate)==="linear"?Ea:au).scaleBy(hd(k,de==null?void 0:de.duration,de==null?void 0:de.ease,()=>be(!0)),X)}):Promise.resolve(!1)}function Z(X){v==null||v.scaleExtent(X)}function fe(X){v==null||v.translateExtent(X)}function Se(X){const de=!Wr(X)||X<0?0:X;v==null||v.clickDistance(de)}return{update:A,destroy:T,setViewport:P,setViewportConstrained:V,getViewport:B,scaleTo:U,scaleBy:W,setScaleExtent:Z,setTranslateExtent:fe,syncViewport:M,setClickDistance:Se}}var Bi;(function(t){t.Line="line",t.Handle="handle"})(Bi||(Bi={}));function Hb({width:t,prevWidth:r,height:o,prevHeight:i,affectsX:l,affectsY:c}){const f=t-r,m=o-i,y=[f>0?1:f<0?-1:0,m>0?1:m<0?-1:0];return f&&l&&(y[0]=y[0]*-1),m&&c&&(y[1]=y[1]*-1),y}function Vh(t){const r=t.includes("right")||t.includes("left"),o=t.includes("bottom")||t.includes("top"),i=t.includes("left"),l=t.includes("top");return{isHorizontal:r,isVertical:o,affectsX:i,affectsY:l}}function hs(t,r){return Math.max(0,r-t)}function ms(t,r){return Math.max(0,t-r)}function Jl(t,r,o){return Math.max(0,r-t,t-o)}function Uh(t,r){return t?!r:r}function Vb(t,r,o,i,l,c,f,m){let{affectsX:y,affectsY:b}=r;const{isHorizontal:_,isVertical:v}=r,k=_&&v,{xSnapped:j,ySnapped:C}=o,{minWidth:I,maxWidth:A,minHeight:T,maxHeight:V}=i,{x:P,y:M,width:B,height:U,aspectRatio:W}=t;let Z=Math.floor(_?j-t.pointerX:0),fe=Math.floor(v?C-t.pointerY:0);const Se=B+(y?-Z:Z),X=U+(b?-fe:fe),de=-c[0]*B,be=-c[1]*U;let z=Jl(Se,I,A),ue=Jl(X,T,V);if(f){let H=0,q=0;y&&Z<0?H=hs(P+Z+de,f[0][0]):!y&&Z>0&&(H=ms(P+Se+de,f[1][0])),b&&fe<0?q=hs(M+fe+be,f[0][1]):!b&&fe>0&&(q=ms(M+X+be,f[1][1])),z=Math.max(z,H),ue=Math.max(ue,q)}if(m){let H=0,q=0;y&&Z>0?H=ms(P+Z,m[0][0]):!y&&Z<0&&(H=hs(P+Se,m[1][0])),b&&fe>0?q=ms(M+fe,m[0][1]):!b&&fe<0&&(q=hs(M+X,m[1][1])),z=Math.max(z,H),ue=Math.max(ue,q)}if(l){if(_){const H=Jl(Se/W,T,V)*W;if(z=Math.max(z,H),f){let q=0;!y&&!b||y&&!b&&k?q=ms(M+be+Se/W,f[1][1])*W:q=hs(M+be+(y?Z:-Z)/W,f[0][1])*W,z=Math.max(z,q)}if(m){let q=0;!y&&!b||y&&!b&&k?q=hs(M+Se/W,m[1][1])*W:q=ms(M+(y?Z:-Z)/W,m[0][1])*W,z=Math.max(z,q)}}if(v){const H=Jl(X*W,I,A)/W;if(ue=Math.max(ue,H),f){let q=0;!y&&!b||b&&!y&&k?q=ms(P+X*W+de,f[1][0])/W:q=hs(P+(b?fe:-fe)*W+de,f[0][0])/W,ue=Math.max(ue,q)}if(m){let q=0;!y&&!b||b&&!y&&k?q=hs(P+X*W,m[1][0])/W:q=ms(P+(b?fe:-fe)*W,m[0][0])/W,ue=Math.max(ue,q)}}}fe=fe+(fe<0?ue:-ue),Z=Z+(Z<0?z:-z),l&&(k?Se>X*W?fe=(Uh(y,b)?-Z:Z)/W:Z=(Uh(y,b)?-fe:fe)*W:_?(fe=Z/W,b=y):(Z=fe*W,y=b));const Q=y?P+Z:P,ie=b?M+fe:M;return{width:B+(y?-Z:Z),height:U+(b?-fe:fe),x:c[0]*Z*(y?-1:1)+Q,y:c[1]*fe*(b?-1:1)+ie}}const V0={width:0,height:0,x:0,y:0},Ub={...V0,pointerX:0,pointerY:0,aspectRatio:1};function Kb(t){return[[0,0],[t.measured.width,t.measured.height]]}function qb(t,r,o){const i=r.position.x+t.position.x,l=r.position.y+t.position.y,c=t.measured.width??0,f=t.measured.height??0,m=o[0]*c,y=o[1]*f;return[[i-m,l-y],[i+c-m,l+f-y]]}function Wb({domNode:t,nodeId:r,getStoreItems:o,onChange:i,onEnd:l}){const c=cr(t);let f={controlDirection:Vh("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function m({controlPosition:b,boundaries:_,keepAspectRatio:v,resizeDirection:k,onResizeStart:j,onResize:C,onResizeEnd:I,shouldResize:A}){let T={...V0},V={...Ub};f={boundaries:_,resizeDirection:k,keepAspectRatio:v,controlDirection:Vh(b)};let P,M=null,B=[],U,W,Z,fe=!1;const Se=Jm().on("start",X=>{const{nodeLookup:de,transform:be,snapGrid:z,snapToGrid:ue,nodeOrigin:Q,paneDomNode:ie}=o();if(P=de.get(r),!P)return;M=(ie==null?void 0:ie.getBoundingClientRect())??null;const{xSnapped:H,ySnapped:q}=ja(X.sourceEvent,{transform:be,snapGrid:z,snapToGrid:ue,containerBounds:M});T={width:P.measured.width??0,height:P.measured.height??0,x:P.position.x??0,y:P.position.y??0},V={...T,pointerX:H,pointerY:q,aspectRatio:T.width/T.height},U=void 0,P.parentId&&(P.extent==="parent"||P.expandParent)&&(U=de.get(P.parentId),W=U&&P.extent==="parent"?Kb(U):void 0),B=[],Z=void 0;for(const[J,O]of de)if(O.parentId===r&&(B.push({id:J,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const K=qb(O,P,O.origin??Q);Z?Z=[[Math.min(K[0][0],Z[0][0]),Math.min(K[0][1],Z[0][1])],[Math.max(K[1][0],Z[1][0]),Math.max(K[1][1],Z[1][1])]]:Z=K}j==null||j(X,{...T})}).on("drag",X=>{const{transform:de,snapGrid:be,snapToGrid:z,nodeOrigin:ue}=o(),Q=ja(X.sourceEvent,{transform:de,snapGrid:be,snapToGrid:z,containerBounds:M}),ie=[];if(!P)return;const{x:H,y:q,width:J,height:O}=T,K={},ke=P.origin??ue,{width:Ne,height:Ae,x:Oe,y:Re}=Vb(V,f.controlDirection,Q,f.boundaries,f.keepAspectRatio,ke,W,Z),_e=Ne!==J,ze=Ae!==O,Ee=Oe!==H&&_e,Ze=Re!==q&&ze;if(!Ee&&!Ze&&!_e&&!ze)return;if((Ee||Ze||ke[0]===1||ke[1]===1)&&(K.x=Ee?Oe:T.x,K.y=Ze?Re:T.y,T.x=K.x,T.y=K.y,B.length>0)){const dt=Oe-H,we=Re-q;for(const tt of B)tt.position={x:tt.position.x-dt+ke[0]*(Ne-J),y:tt.position.y-we+ke[1]*(Ae-O)},ie.push(tt)}if((_e||ze)&&(K.width=_e&&(!f.resizeDirection||f.resizeDirection==="horizontal")?Ne:T.width,K.height=ze&&(!f.resizeDirection||f.resizeDirection==="vertical")?Ae:T.height,T.width=K.width,T.height=K.height),U&&P.expandParent){const dt=ke[0]*(K.width??0);K.x&&K.x<dt&&(T.x=dt,V.x=V.x-(K.x-dt));const we=ke[1]*(K.height??0);K.y&&K.y<we&&(T.y=we,V.y=V.y-(K.y-we))}const He=Hb({width:T.width,prevWidth:J,height:T.height,prevHeight:O,affectsX:f.controlDirection.affectsX,affectsY:f.controlDirection.affectsY}),Ke={...T,direction:He};(A==null?void 0:A(X,Ke))!==!1&&(fe=!0,C==null||C(X,Ke),i(K,ie))}).on("end",X=>{fe&&(I==null||I(X,{...T}),l==null||l({...T}),fe=!1)});c.call(Se)}function y(){c.on(".drag",null)}return{update:m,destroy:y}}var md={exports:{}},gd={},yd={exports:{}},xd={};/**
|
|
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 Kh;function Yb(){if(Kh)return xd;Kh=1;var t=La();function r(v,k){return v===k&&(v!==0||1/v===1/k)||v!==v&&k!==k}var o=typeof Object.is=="function"?Object.is:r,i=t.useState,l=t.useEffect,c=t.useLayoutEffect,f=t.useDebugValue;function m(v,k){var j=k(),C=i({inst:{value:j,getSnapshot:k}}),I=C[0].inst,A=C[1];return c(function(){I.value=j,I.getSnapshot=k,y(I)&&A({inst:I})},[v,j,k]),l(function(){return y(I)&&A({inst:I}),v(function(){y(I)&&A({inst:I})})},[v]),f(j),j}function y(v){var k=v.getSnapshot;v=v.value;try{var j=k();return!o(v,j)}catch{return!0}}function b(v,k){return k()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?b:m;return xd.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:_,xd}var qh;function Xb(){return qh||(qh=1,yd.exports=Yb()),yd.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 Wh;function Qb(){if(Wh)return gd;Wh=1;var t=La(),r=Xb();function o(b,_){return b===_&&(b!==0||1/b===1/_)||b!==b&&_!==_}var i=typeof Object.is=="function"?Object.is:o,l=r.useSyncExternalStore,c=t.useRef,f=t.useEffect,m=t.useMemo,y=t.useDebugValue;return gd.useSyncExternalStoreWithSelector=function(b,_,v,k,j){var C=c(null);if(C.current===null){var I={hasValue:!1,value:null};C.current=I}else I=C.current;C=m(function(){function T(U){if(!V){if(V=!0,P=U,U=k(U),j!==void 0&&I.hasValue){var W=I.value;if(j(W,U))return M=W}return M=U}if(W=M,i(P,U))return W;var Z=k(U);return j!==void 0&&j(W,Z)?(P=U,W):(P=U,M=Z)}var V=!1,P,M,B=v===void 0?null:v;return[function(){return T(_())},B===null?void 0:function(){return T(B())}]},[_,v,k,j]);var A=l(b,C[0],C[1]);return f(function(){I.hasValue=!0,I.value=A},[A]),y(A),A},gd}var Yh;function Gb(){return Yh||(Yh=1,md.exports=Qb()),md.exports}var Jb=Gb();const Zb=Nu(Jb),ek={},Xh=t=>{let r;const o=new Set,i=(_,v)=>{const k=typeof _=="function"?_(r):_;if(!Object.is(k,r)){const j=r;r=v??(typeof k!="object"||k===null)?k:Object.assign({},r,k),o.forEach(C=>C(r,j))}},l=()=>r,y={setState:i,getState:l,getInitialState:()=>b,subscribe:_=>(o.add(_),()=>o.delete(_)),destroy:()=>{(ek?"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."),o.clear()}},b=r=t(i,l,y);return y},tk=t=>t?Xh(t):Xh,{useDebugValue:nk}=Cm,{useSyncExternalStoreWithSelector:rk}=Zb,ok=t=>t;function U0(t,r=ok,o){const i=rk(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,o);return nk(i),i}const Qh=(t,r)=>{const o=tk(t),i=(l,c=r)=>U0(o,l,c);return Object.assign(i,o),i},sk=(t,r)=>t?Qh(t,r):Qh;function Ft(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[i,l]of t)if(!Object.is(l,r.get(i)))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(const i of t)if(!r.has(i))return!1;return!0}const o=Object.keys(t);if(o.length!==Object.keys(r).length)return!1;for(const i of o)if(!Object.prototype.hasOwnProperty.call(r,i)||!Object.is(t[i],r[i]))return!1;return!0}Pm();const Lu=D.createContext(null),ik=Lu.Provider,K0=lo.error001();function kt(t,r){const o=D.useContext(Lu);if(o===null)throw new Error(K0);return U0(o,t,r)}function Lt(){const t=D.useContext(Lu);if(t===null)throw new Error(K0);return D.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const Gh={display:"none"},ak={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},q0="react-flow__node-desc",W0="react-flow__edge-desc",lk="react-flow__aria-live",uk=t=>t.ariaLiveMessage,ck=t=>t.ariaLabelConfig;function dk({rfId:t}){const r=kt(uk);return h.jsx("div",{id:`${lk}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:ak,children:r})}function fk({rfId:t,disableKeyboardA11y:r}){const o=kt(ck);return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:`${q0}-${t}`,style:Gh,children:r?o["node.a11yDescription.default"]:o["node.a11yDescription.keyboardDisabled"]}),h.jsx("div",{id:`${W0}-${t}`,style:Gh,children:o["edge.a11yDescription.default"]}),!r&&h.jsx(dk,{rfId:t})]})}const Ua=D.forwardRef(({position:t="top-left",children:r,className:o,style:i,...l},c)=>{const f=`${t}`.split("-");return h.jsx("div",{className:en(["react-flow__panel",o,...f]),style:i,ref:c,...l,children:r})});Ua.displayName="Panel";function pk({proOptions:t,position:r="bottom-right"}){return t!=null&&t.hideAttribution?null:h.jsx(Ua,{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:h.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const hk=t=>{const r=[],o=[];for(const[,i]of t.nodeLookup)i.selected&&r.push(i.internals.userNode);for(const[,i]of t.edgeLookup)i.selected&&o.push(i);return{selectedNodes:r,selectedEdges:o}},Zl=t=>t.id;function mk(t,r){return Ft(t.selectedNodes.map(Zl),r.selectedNodes.map(Zl))&&Ft(t.selectedEdges.map(Zl),r.selectedEdges.map(Zl))}function gk({onSelectionChange:t}){const r=Lt(),{selectedNodes:o,selectedEdges:i}=kt(hk,mk);return D.useEffect(()=>{const l={nodes:o,edges:i};t==null||t(l),r.getState().onSelectionChangeHandlers.forEach(c=>c(l))},[o,i,t]),null}const yk=t=>!!t.onSelectionChangeHandlers;function xk({onSelectionChange:t}){const r=kt(yk);return t||r?h.jsx(gk,{onSelectionChange:t}):null}const Fd=typeof window<"u"?D.useLayoutEffect:D.useEffect,Y0=[0,0],vk={x:0,y:0,zoom:1},wk=["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"],Jh=[...wk,"rfId"],bk=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}),Zh={translateExtent:Ia,nodeOrigin:Y0,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function kk(t){const{setNodes:r,setEdges:o,setMinZoom:i,setMaxZoom:l,setTranslateExtent:c,setNodeExtent:f,reset:m,setDefaultNodesAndEdges:y}=kt(bk,Ft),b=Lt();Fd(()=>(y(t.defaultNodes,t.defaultEdges),()=>{_.current=Zh,m()}),[]);const _=D.useRef(Zh);return Fd(()=>{for(const v of Jh){const k=t[v],j=_.current[v];k!==j&&(typeof t[v]>"u"||(v==="nodes"?r(k):v==="edges"?o(k):v==="minZoom"?i(k):v==="maxZoom"?l(k):v==="translateExtent"?c(k):v==="nodeExtent"?f(k):v==="ariaLabelConfig"?b.setState({ariaLabelConfig:ib(k)}):v==="fitView"?b.setState({fitViewQueued:k}):v==="fitViewOptions"?b.setState({fitViewOptions:k}):b.setState({[v]:k})))}_.current=t},Jh.map(v=>t[v])),null}function em(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function _k(t){var i;const[r,o]=D.useState(t==="system"?null:t);return D.useEffect(()=>{if(t!=="system"){o(t);return}const l=em(),c=()=>o(l!=null&&l.matches?"dark":"light");return c(),l==null||l.addEventListener("change",c),()=>{l==null||l.removeEventListener("change",c)}},[t]),r!==null?r:(i=em())!=null&&i.matches?"dark":"light"}const tm=typeof document<"u"?document:null;function Ra(t=null,r={target:tm,actInsideInputWithModifier:!0}){const[o,i]=D.useState(!1),l=D.useRef(!1),c=D.useRef(new Set([])),[f,m]=D.useMemo(()=>{if(t!==null){const b=(Array.isArray(t)?t:[t]).filter(v=>typeof v=="string").map(v=>v.replace("+",`
|
|
197
|
+
`).replace(`
|
|
198
|
+
|
|
199
|
+
`,`
|
|
200
|
+
+`).split(`
|
|
201
|
+
`)),_=b.reduce((v,k)=>v.concat(...k),[]);return[b,_]}return[[],[]]},[t]);return D.useEffect(()=>{const y=(r==null?void 0:r.target)??tm,b=(r==null?void 0:r.actInsideInputWithModifier)??!0;if(t!==null){const _=j=>{var A,T;if(l.current=j.ctrlKey||j.metaKey||j.shiftKey||j.altKey,(!l.current||l.current&&!b)&&E0(j))return!1;const I=rm(j.code,m);if(c.current.add(j[I]),nm(f,c.current,!1)){const V=((T=(A=j.composedPath)==null?void 0:A.call(j))==null?void 0:T[0])||j.target,P=(V==null?void 0:V.nodeName)==="BUTTON"||(V==null?void 0:V.nodeName)==="A";r.preventDefault!==!1&&(l.current||!P)&&j.preventDefault(),i(!0)}},v=j=>{const C=rm(j.code,m);nm(f,c.current,!0)?(i(!1),c.current.clear()):c.current.delete(j[C]),j.key==="Meta"&&c.current.clear(),l.current=!1},k=()=>{c.current.clear(),i(!1)};return y==null||y.addEventListener("keydown",_),y==null||y.addEventListener("keyup",v),window.addEventListener("blur",k),window.addEventListener("contextmenu",k),()=>{y==null||y.removeEventListener("keydown",_),y==null||y.removeEventListener("keyup",v),window.removeEventListener("blur",k),window.removeEventListener("contextmenu",k)}}},[t,i]),o}function nm(t,r,o){return t.filter(i=>o||i.length===r.size).some(i=>i.every(l=>r.has(l)))}function rm(t,r){return r.includes(t)?"code":"key"}const Sk=()=>{const t=Lt();return D.useMemo(()=>({zoomIn:r=>{const{panZoom:o}=t.getState();return o?o.scaleBy(1.2,r):Promise.resolve(!1)},zoomOut:r=>{const{panZoom:o}=t.getState();return o?o.scaleBy(1/1.2,r):Promise.resolve(!1)},zoomTo:(r,o)=>{const{panZoom:i}=t.getState();return i?i.scaleTo(r,o):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(r,o)=>{const{transform:[i,l,c],panZoom:f}=t.getState();return f?(await f.setViewport({x:r.x??i,y:r.y??l,zoom:r.zoom??c},o),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[r,o,i]=t.getState().transform;return{x:r,y:o,zoom:i}},setCenter:async(r,o,i)=>t.getState().setCenter(r,o,i),fitBounds:async(r,o)=>{const{width:i,height:l,minZoom:c,maxZoom:f,panZoom:m}=t.getState(),y=Zd(r,i,l,c,f,(o==null?void 0:o.padding)??.1);return m?(await m.setViewport(y,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(r,o={})=>{const{transform:i,snapGrid:l,snapToGrid:c,domNode:f}=t.getState();if(!f)return r;const{x:m,y}=f.getBoundingClientRect(),b={x:r.x-m,y:r.y-y},_=o.snapGrid??l,v=o.snapToGrid??c;return Va(b,i,v,_)},flowToScreenPosition:r=>{const{transform:o,domNode:i}=t.getState();if(!i)return r;const{x:l,y:c}=i.getBoundingClientRect(),f=_u(r,o);return{x:f.x+l,y:f.y+c}}}),[])};function X0(t,r){const o=[],i=new Map,l=[];for(const c of t)if(c.type==="add"){l.push(c);continue}else if(c.type==="remove"||c.type==="replace")i.set(c.id,[c]);else{const f=i.get(c.id);f?f.push(c):i.set(c.id,[c])}for(const c of r){const f=i.get(c.id);if(!f){o.push(c);continue}if(f[0].type==="remove")continue;if(f[0].type==="replace"){o.push({...f[0].item});continue}const m={...c};for(const y of f)Nk(y,m);o.push(m)}return l.length&&l.forEach(c=>{c.index!==void 0?o.splice(c.index,0,{...c.item}):o.push({...c.item})}),o}function Nk(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 Q0(t,r){return X0(t,r)}function G0(t,r){return X0(t,r)}function zs(t,r){return{id:t,type:"select",selected:r}}function Pi(t,r=new Set,o=!1){const i=[];for(const[l,c]of t){const f=r.has(l);!(c.selected===void 0&&!f)&&c.selected!==f&&(o&&(c.selected=f),i.push(zs(c.id,f)))}return i}function om({items:t=[],lookup:r}){var l;const o=[],i=new Map(t.map(c=>[c.id,c]));for(const[c,f]of t.entries()){const m=r.get(f.id),y=((l=m==null?void 0:m.internals)==null?void 0:l.userNode)??m;y!==void 0&&y!==f&&o.push({id:f.id,item:f,type:"replace"}),y===void 0&&o.push({item:f,type:"add",index:c})}for(const[c]of r)i.get(c)===void 0&&o.push({id:c,type:"remove"});return o}function sm(t){return{id:t.id,type:"remove"}}const im=t=>Q1(t),Ek=t=>x0(t);function J0(t){return D.forwardRef(t)}function am(t){const[r,o]=D.useState(BigInt(0)),[i]=D.useState(()=>jk(()=>o(l=>l+BigInt(1))));return Fd(()=>{const l=i.get();l.length&&(t(l),i.reset())},[r]),i}function jk(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:o=>{r.push(o),t()}}}const Z0=D.createContext(null);function Ck({children:t}){const r=Lt(),o=D.useCallback(m=>{const{nodes:y=[],setNodes:b,hasDefaultNodes:_,onNodesChange:v,nodeLookup:k,fitViewQueued:j,onNodesChangeMiddlewareMap:C}=r.getState();let I=y;for(const T of m)I=typeof T=="function"?T(I):T;let A=om({items:I,lookup:k});for(const T of C.values())A=T(A);_&&b(I),A.length>0?v==null||v(A):j&&window.requestAnimationFrame(()=>{const{fitViewQueued:T,nodes:V,setNodes:P}=r.getState();T&&P(V)})},[]),i=am(o),l=D.useCallback(m=>{const{edges:y=[],setEdges:b,hasDefaultEdges:_,onEdgesChange:v,edgeLookup:k}=r.getState();let j=y;for(const C of m)j=typeof C=="function"?C(j):C;_?b(j):v&&v(om({items:j,lookup:k}))},[]),c=am(l),f=D.useMemo(()=>({nodeQueue:i,edgeQueue:c}),[]);return h.jsx(Z0.Provider,{value:f,children:t})}function Pk(){const t=D.useContext(Z0);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const Mk=t=>!!t.panZoom;function af(){const t=Sk(),r=Lt(),o=Pk(),i=kt(Mk),l=D.useMemo(()=>{const c=v=>r.getState().nodeLookup.get(v),f=v=>{o.nodeQueue.push(v)},m=v=>{o.edgeQueue.push(v)},y=v=>{var T,V;const{nodeLookup:k,nodeOrigin:j}=r.getState(),C=im(v)?v:k.get(v.id),I=C.parentId?S0(C.position,C.measured,C.parentId,k,j):C.position,A={...C,position:I,width:((T=C.measured)==null?void 0:T.width)??C.width,height:((V=C.measured)==null?void 0:V.height)??C.height};return Di(A)},b=(v,k,j={replace:!1})=>{f(C=>C.map(I=>{if(I.id===v){const A=typeof k=="function"?k(I):k;return j.replace&&im(A)?A:{...I,...A}}return I}))},_=(v,k,j={replace:!1})=>{m(C=>C.map(I=>{if(I.id===v){const A=typeof k=="function"?k(I):k;return j.replace&&Ek(A)?A:{...I,...A}}return I}))};return{getNodes:()=>r.getState().nodes.map(v=>({...v})),getNode:v=>{var k;return(k=c(v))==null?void 0:k.internals.userNode},getInternalNode:c,getEdges:()=>{const{edges:v=[]}=r.getState();return v.map(k=>({...k}))},getEdge:v=>r.getState().edgeLookup.get(v),setNodes:f,setEdges:m,addNodes:v=>{const k=Array.isArray(v)?v:[v];o.nodeQueue.push(j=>[...j,...k])},addEdges:v=>{const k=Array.isArray(v)?v:[v];o.edgeQueue.push(j=>[...j,...k])},toObject:()=>{const{nodes:v=[],edges:k=[],transform:j}=r.getState(),[C,I,A]=j;return{nodes:v.map(T=>({...T})),edges:k.map(T=>({...T})),viewport:{x:C,y:I,zoom:A}}},deleteElements:async({nodes:v=[],edges:k=[]})=>{const{nodes:j,edges:C,onNodesDelete:I,onEdgesDelete:A,triggerNodeChanges:T,triggerEdgeChanges:V,onDelete:P,onBeforeDelete:M}=r.getState(),{nodes:B,edges:U}=await tb({nodesToRemove:v,edgesToRemove:k,nodes:j,edges:C,onBeforeDelete:M}),W=U.length>0,Z=B.length>0;if(W){const fe=U.map(sm);A==null||A(U),V(fe)}if(Z){const fe=B.map(sm);I==null||I(B),T(fe)}return(Z||W)&&(P==null||P({nodes:B,edges:U})),{deletedNodes:B,deletedEdges:U}},getIntersectingNodes:(v,k=!0,j)=>{const C=Ih(v),I=C?v:y(v),A=j!==void 0;return I?(j||r.getState().nodes).filter(T=>{const V=r.getState().nodeLookup.get(T.id);if(V&&!C&&(T.id===v.id||!V.internals.positionAbsolute))return!1;const P=Di(A?T:V),M=Aa(P,I);return k&&M>0||M>=P.width*P.height||M>=I.width*I.height}):[]},isNodeIntersecting:(v,k,j=!0)=>{const I=Ih(v)?v:y(v);if(!I)return!1;const A=Aa(I,k);return j&&A>0||A>=k.width*k.height||A>=I.width*I.height},updateNode:b,updateNodeData:(v,k,j={replace:!1})=>{b(v,C=>{const I=typeof k=="function"?k(C):k;return j.replace?{...C,data:I}:{...C,data:{...C.data,...I}}},j)},updateEdge:_,updateEdgeData:(v,k,j={replace:!1})=>{_(v,C=>{const I=typeof k=="function"?k(C):k;return j.replace?{...C,data:I}:{...C,data:{...C.data,...I}}},j)},getNodesBounds:v=>{const{nodeLookup:k,nodeOrigin:j}=r.getState();return G1(v,{nodeLookup:k,nodeOrigin:j})},getHandleConnections:({type:v,id:k,nodeId:j})=>{var C;return Array.from(((C=r.getState().connectionLookup.get(`${j}-${v}${k?`-${k}`:""}`))==null?void 0:C.values())??[])},getNodeConnections:({type:v,handleId:k,nodeId:j})=>{var C;return Array.from(((C=r.getState().connectionLookup.get(`${j}${v?k?`-${v}-${k}`:`-${v}`:""}`))==null?void 0:C.values())??[])},fitView:async v=>{const k=r.getState().fitViewResolver??sb();return r.setState({fitViewQueued:!0,fitViewOptions:v,fitViewResolver:k}),o.nodeQueue.push(j=>[...j]),k.promise}}},[]);return D.useMemo(()=>({...l,...t,viewportInitialized:i}),[i])}const lm=t=>t.selected,Tk=typeof window<"u"?window:void 0;function Ik({deleteKeyCode:t,multiSelectionKeyCode:r}){const o=Lt(),{deleteElements:i}=af(),l=Ra(t,{actInsideInputWithModifier:!1}),c=Ra(r,{target:Tk});D.useEffect(()=>{if(l){const{edges:f,nodes:m}=o.getState();i({nodes:m.filter(lm),edges:f.filter(lm)}),o.setState({nodesSelectionActive:!1})}},[l]),D.useEffect(()=>{o.setState({multiSelectionActive:c})},[c])}function $k(t){const r=Lt();D.useEffect(()=>{const o=()=>{var l,c,f,m;if(!t.current||!(((c=(l=t.current).checkVisibility)==null?void 0:c.call(l))??!0))return!1;const i=ef(t.current);(i.height===0||i.width===0)&&((m=(f=r.getState()).onError)==null||m.call(f,"004",lo.error004())),r.setState({width:i.width||500,height:i.height||500})};if(t.current){o(),window.addEventListener("resize",o);const i=new ResizeObserver(()=>o());return i.observe(t.current),()=>{window.removeEventListener("resize",o),i&&t.current&&i.unobserve(t.current)}}},[])}const Du={position:"absolute",width:"100%",height:"100%",top:0,left:0},Ak=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function Ok({onPaneContextMenu:t,zoomOnScroll:r=!0,zoomOnPinch:o=!0,panOnScroll:i=!1,panOnScrollSpeed:l=.5,panOnScrollMode:c=Hs.Free,zoomOnDoubleClick:f=!0,panOnDrag:m=!0,defaultViewport:y,translateExtent:b,minZoom:_,maxZoom:v,zoomActivationKeyCode:k,preventScrolling:j=!0,children:C,noWheelClassName:I,noPanClassName:A,onViewportChange:T,isControlledViewport:V,paneClickDistance:P,selectionOnDrag:M}){const B=Lt(),U=D.useRef(null),{userSelectionActive:W,lib:Z,connectionInProgress:fe}=kt(Ak,Ft),Se=Ra(k),X=D.useRef();$k(U);const de=D.useCallback(be=>{T==null||T({x:be[0],y:be[1],zoom:be[2]}),V||B.setState({transform:be})},[T,V]);return D.useEffect(()=>{if(U.current){X.current=Fb({domNode:U.current,minZoom:_,maxZoom:v,translateExtent:b,viewport:y,onDraggingChange:Q=>B.setState(ie=>ie.paneDragging===Q?ie:{paneDragging:Q}),onPanZoomStart:(Q,ie)=>{const{onViewportChangeStart:H,onMoveStart:q}=B.getState();q==null||q(Q,ie),H==null||H(ie)},onPanZoom:(Q,ie)=>{const{onViewportChange:H,onMove:q}=B.getState();q==null||q(Q,ie),H==null||H(ie)},onPanZoomEnd:(Q,ie)=>{const{onViewportChangeEnd:H,onMoveEnd:q}=B.getState();q==null||q(Q,ie),H==null||H(ie)}});const{x:be,y:z,zoom:ue}=X.current.getViewport();return B.setState({panZoom:X.current,transform:[be,z,ue],domNode:U.current.closest(".react-flow")}),()=>{var Q;(Q=X.current)==null||Q.destroy()}}},[]),D.useEffect(()=>{var be;(be=X.current)==null||be.update({onPaneContextMenu:t,zoomOnScroll:r,zoomOnPinch:o,panOnScroll:i,panOnScrollSpeed:l,panOnScrollMode:c,zoomOnDoubleClick:f,panOnDrag:m,zoomActivationKeyPressed:Se,preventScrolling:j,noPanClassName:A,userSelectionActive:W,noWheelClassName:I,lib:Z,onTransformChange:de,connectionInProgress:fe,selectionOnDrag:M,paneClickDistance:P})},[t,r,o,i,l,c,f,m,Se,j,A,W,I,Z,de,fe,M,P]),h.jsx("div",{className:"react-flow__renderer",ref:U,style:Du,children:C})}const Rk=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function Lk(){const{userSelectionActive:t,userSelectionRect:r}=kt(Rk,Ft);return t&&r?h.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 vd=(t,r)=>o=>{o.target===r.current&&(t==null||t(o))},Dk=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function zk({isSelecting:t,selectionKeyPressed:r,selectionMode:o=$a.Full,panOnDrag:i,paneClickDistance:l,selectionOnDrag:c,onSelectionStart:f,onSelectionEnd:m,onPaneClick:y,onPaneContextMenu:b,onPaneScroll:_,onPaneMouseEnter:v,onPaneMouseMove:k,onPaneMouseLeave:j,children:C}){const I=Lt(),{userSelectionActive:A,elementsSelectable:T,dragging:V,connectionInProgress:P}=kt(Dk,Ft),M=T&&(t||A),B=D.useRef(null),U=D.useRef(),W=D.useRef(new Set),Z=D.useRef(new Set),fe=D.useRef(!1),Se=H=>{if(fe.current||P){fe.current=!1;return}y==null||y(H),I.getState().resetSelectedElements(),I.setState({nodesSelectionActive:!1})},X=H=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){H.preventDefault();return}b==null||b(H)},de=_?H=>_(H):void 0,be=H=>{fe.current&&(H.stopPropagation(),fe.current=!1)},z=H=>{var Ae,Oe;const{domNode:q}=I.getState();if(U.current=q==null?void 0:q.getBoundingClientRect(),!U.current)return;const J=H.target===B.current;if(!J&&!!H.target.closest(".nokey")||!t||!(c&&J||r)||H.button!==0||!H.isPrimary)return;(Oe=(Ae=H.target)==null?void 0:Ae.setPointerCapture)==null||Oe.call(Ae,H.pointerId),fe.current=!1;const{x:ke,y:Ne}=Yr(H.nativeEvent,U.current);I.setState({userSelectionRect:{width:0,height:0,startX:ke,startY:Ne,x:ke,y:Ne}}),J||(H.stopPropagation(),H.preventDefault())},ue=H=>{const{userSelectionRect:q,transform:J,nodeLookup:O,edgeLookup:K,connectionLookup:ke,triggerNodeChanges:Ne,triggerEdgeChanges:Ae,defaultEdgeOptions:Oe,resetSelectedElements:Re}=I.getState();if(!U.current||!q)return;const{x:_e,y:ze}=Yr(H.nativeEvent,U.current),{startX:Ee,startY:Ze}=q;if(!fe.current){const we=r?0:l;if(Math.hypot(_e-Ee,ze-Ze)<=we)return;Re(),f==null||f(H)}fe.current=!0;const He={startX:Ee,startY:Ze,x:_e<Ee?_e:Ee,y:ze<Ze?ze:Ze,width:Math.abs(_e-Ee),height:Math.abs(ze-Ze)},Ke=W.current,ct=Z.current;W.current=new Set(Jd(O,He,J,o===$a.Partial,!0).map(we=>we.id)),Z.current=new Set;const dt=(Oe==null?void 0:Oe.selectable)??!0;for(const we of W.current){const tt=ke.get(we);if(tt)for(const{edgeId:_t}of tt.values()){const Ct=K.get(_t);Ct&&(Ct.selectable??dt)&&Z.current.add(_t)}}if(!$h(Ke,W.current)){const we=Pi(O,W.current,!0);Ne(we)}if(!$h(ct,Z.current)){const we=Pi(K,Z.current);Ae(we)}I.setState({userSelectionRect:He,userSelectionActive:!0,nodesSelectionActive:!1})},Q=H=>{var q,J;H.button===0&&((J=(q=H.target)==null?void 0:q.releasePointerCapture)==null||J.call(q,H.pointerId),!A&&H.target===B.current&&I.getState().userSelectionRect&&(Se==null||Se(H)),I.setState({userSelectionActive:!1,userSelectionRect:null}),fe.current&&(m==null||m(H),I.setState({nodesSelectionActive:W.current.size>0})))},ie=i===!0||Array.isArray(i)&&i.includes(0);return h.jsxs("div",{className:en(["react-flow__pane",{draggable:ie,dragging:V,selection:t}]),onClick:M?void 0:vd(Se,B),onContextMenu:vd(X,B),onWheel:vd(de,B),onPointerEnter:M?void 0:v,onPointerMove:M?ue:k,onPointerUp:M?Q:void 0,onPointerDownCapture:M?z:void 0,onClickCapture:M?be:void 0,onPointerLeave:j,ref:B,style:Du,children:[C,h.jsx(Lk,{})]})}function Hd({id:t,store:r,unselect:o=!1,nodeRef:i}){const{addSelectedNodes:l,unselectNodesAndEdges:c,multiSelectionActive:f,nodeLookup:m,onError:y}=r.getState(),b=m.get(t);if(!b){y==null||y("012",lo.error012(t));return}r.setState({nodesSelectionActive:!1}),b.selected?(o||b.selected&&f)&&(c({nodes:[b],edges:[]}),requestAnimationFrame(()=>{var _;return(_=i==null?void 0:i.current)==null?void 0:_.blur()})):l([t])}function eg({nodeRef:t,disabled:r=!1,noDragClassName:o,handleSelector:i,nodeId:l,isSelectable:c,nodeClickDistance:f}){const m=Lt(),[y,b]=D.useState(!1),_=D.useRef();return D.useEffect(()=>{_.current=jb({getStoreItems:()=>m.getState(),onNodeMouseDown:v=>{Hd({id:v,store:m,nodeRef:t})},onDragStart:()=>{b(!0)},onDragStop:()=>{b(!1)}})},[]),D.useEffect(()=>{if(!(r||!t.current||!_.current))return _.current.update({noDragClassName:o,handleSelector:i,domNode:t.current,isSelectable:c,nodeId:l,nodeClickDistance:f}),()=>{var v;(v=_.current)==null||v.destroy()}},[o,i,r,c,t,l,f]),y}const Bk=t=>r=>r.selected&&(r.draggable||t&&typeof r.draggable>"u");function tg(){const t=Lt();return D.useCallback(o=>{const{nodeExtent:i,snapToGrid:l,snapGrid:c,nodesDraggable:f,onError:m,updateNodePositions:y,nodeLookup:b,nodeOrigin:_}=t.getState(),v=new Map,k=Bk(f),j=l?c[0]:5,C=l?c[1]:5,I=o.direction.x*j*o.factor,A=o.direction.y*C*o.factor;for(const[,T]of b){if(!k(T))continue;let V={x:T.internals.positionAbsolute.x+I,y:T.internals.positionAbsolute.y+A};l&&(V=Ha(V,c));const{position:P,positionAbsolute:M}=v0({nodeId:T.id,nextPosition:V,nodeLookup:b,nodeExtent:i,nodeOrigin:_,onError:m});T.position=P,T.internals.positionAbsolute=M,v.set(T.id,T)}y(v)},[])}const lf=D.createContext(null),Fk=lf.Provider;lf.Consumer;const ng=()=>D.useContext(lf),Hk=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),Vk=(t,r,o)=>i=>{const{connectionClickStartHandle:l,connectionMode:c,connection:f}=i,{fromHandle:m,toHandle:y,isValid:b}=f,_=(y==null?void 0:y.nodeId)===t&&(y==null?void 0:y.id)===r&&(y==null?void 0:y.type)===o;return{connectingFrom:(m==null?void 0:m.nodeId)===t&&(m==null?void 0:m.id)===r&&(m==null?void 0:m.type)===o,connectingTo:_,clickConnecting:(l==null?void 0:l.nodeId)===t&&(l==null?void 0:l.id)===r&&(l==null?void 0:l.type)===o,isPossibleEndHandle:c===Ri.Strict?(m==null?void 0:m.type)!==o:t!==(m==null?void 0:m.nodeId)||r!==(m==null?void 0:m.id),connectionInProcess:!!m,clickConnectionInProcess:!!l,valid:_&&b}};function Uk({type:t="source",position:r=rt.Top,isValidConnection:o,isConnectable:i=!0,isConnectableStart:l=!0,isConnectableEnd:c=!0,id:f,onConnect:m,children:y,className:b,onMouseDown:_,onTouchStart:v,...k},j){var ue,Q;const C=f||null,I=t==="target",A=Lt(),T=ng(),{connectOnClick:V,noPanClassName:P,rfId:M}=kt(Hk,Ft),{connectingFrom:B,connectingTo:U,clickConnecting:W,isPossibleEndHandle:Z,connectionInProcess:fe,clickConnectionInProcess:Se,valid:X}=kt(Vk(T,C,t),Ft);T||(Q=(ue=A.getState()).onError)==null||Q.call(ue,"010",lo.error010());const de=ie=>{const{defaultEdgeOptions:H,onConnect:q,hasDefaultEdges:J}=A.getState(),O={...H,...ie};if(J){const{edges:K,setEdges:ke}=A.getState();ke(T0(O,K))}q==null||q(O),m==null||m(O)},be=ie=>{if(!T)return;const H=j0(ie.nativeEvent);if(l&&(H&&ie.button===0||!H)){const q=A.getState();Bd.onPointerDown(ie.nativeEvent,{handleDomNode:ie.currentTarget,autoPanOnConnect:q.autoPanOnConnect,connectionMode:q.connectionMode,connectionRadius:q.connectionRadius,domNode:q.domNode,nodeLookup:q.nodeLookup,lib:q.lib,isTarget:I,handleId:C,nodeId:T,flowId:q.rfId,panBy:q.panBy,cancelConnection:q.cancelConnection,onConnectStart:q.onConnectStart,onConnectEnd:(...J)=>{var O,K;return(K=(O=A.getState()).onConnectEnd)==null?void 0:K.call(O,...J)},updateConnection:q.updateConnection,onConnect:de,isValidConnection:o||((...J)=>{var O,K;return((K=(O=A.getState()).isValidConnection)==null?void 0:K.call(O,...J))??!0}),getTransform:()=>A.getState().transform,getFromHandle:()=>A.getState().connection.fromHandle,autoPanSpeed:q.autoPanSpeed,dragThreshold:q.connectionDragThreshold})}H?_==null||_(ie):v==null||v(ie)},z=ie=>{const{onClickConnectStart:H,onClickConnectEnd:q,connectionClickStartHandle:J,connectionMode:O,isValidConnection:K,lib:ke,rfId:Ne,nodeLookup:Ae,connection:Oe}=A.getState();if(!T||!J&&!l)return;if(!J){H==null||H(ie.nativeEvent,{nodeId:T,handleId:C,handleType:t}),A.setState({connectionClickStartHandle:{nodeId:T,type:t,id:C}});return}const Re=N0(ie.target),_e=o||K,{connection:ze,isValid:Ee}=Bd.isValid(ie.nativeEvent,{handle:{nodeId:T,id:C,type:t},connectionMode:O,fromNodeId:J.nodeId,fromHandleId:J.id||null,fromType:J.type,isValidConnection:_e,flowId:Ne,doc:Re,lib:ke,nodeLookup:Ae});Ee&&ze&&de(ze);const Ze=structuredClone(Oe);delete Ze.inProgress,Ze.toPosition=Ze.toHandle?Ze.toHandle.position:null,q==null||q(ie,Ze),A.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":C,"data-nodeid":T,"data-handlepos":r,"data-id":`${M}-${T}-${C}-${t}`,className:en(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",P,b,{source:!I,target:I,connectable:i,connectablestart:l,connectableend:c,clickconnecting:W,connectingfrom:B,connectingto:U,valid:X,connectionindicator:i&&(!fe||Z)&&(fe||Se?c:l)}]),onMouseDown:be,onTouchStart:be,onClick:V?z:void 0,ref:j,...k,children:y})}const Fi=D.memo(J0(Uk));function Kk({data:t,isConnectable:r,sourcePosition:o=rt.Bottom}){return h.jsxs(h.Fragment,{children:[t==null?void 0:t.label,h.jsx(Fi,{type:"source",position:o,isConnectable:r})]})}function qk({data:t,isConnectable:r,targetPosition:o=rt.Top,sourcePosition:i=rt.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(Fi,{type:"target",position:o,isConnectable:r}),t==null?void 0:t.label,h.jsx(Fi,{type:"source",position:i,isConnectable:r})]})}function Wk(){return null}function Yk({data:t,isConnectable:r,targetPosition:o=rt.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(Fi,{type:"target",position:o,isConnectable:r}),t==null?void 0:t.label]})}const Su={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},um={input:Kk,default:qk,output:Yk,group:Wk};function Xk(t){var r,o,i,l;return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??((r=t.style)==null?void 0:r.width),height:t.height??t.initialHeight??((o=t.style)==null?void 0:o.height)}:{width:t.width??((i=t.style)==null?void 0:i.width),height:t.height??((l=t.style)==null?void 0:l.height)}}const Qk=t=>{const{width:r,height:o,x:i,y:l}=Fa(t.nodeLookup,{filter:c=>!!c.selected});return{width:Wr(r)?r:null,height:Wr(o)?o:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${i}px,${l}px)`}};function Gk({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:o}){const i=Lt(),{width:l,height:c,transformString:f,userSelectionActive:m}=kt(Qk,Ft),y=tg(),b=D.useRef(null);D.useEffect(()=>{var j;o||(j=b.current)==null||j.focus({preventScroll:!0})},[o]);const _=!m&&l!==null&&c!==null;if(eg({nodeRef:b,disabled:!_}),!_)return null;const v=t?j=>{const C=i.getState().nodes.filter(I=>I.selected);t(j,C)}:void 0,k=j=>{Object.prototype.hasOwnProperty.call(Su,j.key)&&(j.preventDefault(),y({direction:Su[j.key],factor:j.shiftKey?4:1}))};return h.jsx("div",{className:en(["react-flow__nodesselection","react-flow__container",r]),style:{transform:f},children:h.jsx("div",{ref:b,className:"react-flow__nodesselection-rect",onContextMenu:v,tabIndex:o?void 0:-1,onKeyDown:o?void 0:k,style:{width:l,height:c}})})}const cm=typeof window<"u"?window:void 0,Jk=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function rg({children:t,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:i,onPaneMouseLeave:l,onPaneContextMenu:c,onPaneScroll:f,paneClickDistance:m,deleteKeyCode:y,selectionKeyCode:b,selectionOnDrag:_,selectionMode:v,onSelectionStart:k,onSelectionEnd:j,multiSelectionKeyCode:C,panActivationKeyCode:I,zoomActivationKeyCode:A,elementsSelectable:T,zoomOnScroll:V,zoomOnPinch:P,panOnScroll:M,panOnScrollSpeed:B,panOnScrollMode:U,zoomOnDoubleClick:W,panOnDrag:Z,defaultViewport:fe,translateExtent:Se,minZoom:X,maxZoom:de,preventScrolling:be,onSelectionContextMenu:z,noWheelClassName:ue,noPanClassName:Q,disableKeyboardA11y:ie,onViewportChange:H,isControlledViewport:q}){const{nodesSelectionActive:J,userSelectionActive:O}=kt(Jk,Ft),K=Ra(b,{target:cm}),ke=Ra(I,{target:cm}),Ne=ke||Z,Ae=ke||M,Oe=_&&Ne!==!0,Re=K||O||Oe;return Ik({deleteKeyCode:y,multiSelectionKeyCode:C}),h.jsx(Ok,{onPaneContextMenu:c,elementsSelectable:T,zoomOnScroll:V,zoomOnPinch:P,panOnScroll:Ae,panOnScrollSpeed:B,panOnScrollMode:U,zoomOnDoubleClick:W,panOnDrag:!K&&Ne,defaultViewport:fe,translateExtent:Se,minZoom:X,maxZoom:de,zoomActivationKeyCode:A,preventScrolling:be,noWheelClassName:ue,noPanClassName:Q,onViewportChange:H,isControlledViewport:q,paneClickDistance:m,selectionOnDrag:Oe,children:h.jsxs(zk,{onSelectionStart:k,onSelectionEnd:j,onPaneClick:r,onPaneMouseEnter:o,onPaneMouseMove:i,onPaneMouseLeave:l,onPaneContextMenu:c,onPaneScroll:f,panOnDrag:Ne,isSelecting:!!Re,selectionMode:v,selectionKeyPressed:K,paneClickDistance:m,selectionOnDrag:Oe,children:[t,J&&h.jsx(Gk,{onSelectionContextMenu:z,noPanClassName:Q,disableKeyboardA11y:ie})]})})}rg.displayName="FlowRenderer";const Zk=D.memo(rg),e_=t=>r=>t?Jd(r.nodeLookup,{x:0,y:0,width:r.width,height:r.height},r.transform,!0).map(o=>o.id):Array.from(r.nodeLookup.keys());function t_(t){return kt(D.useCallback(e_(t),[t]),Ft)}const n_=t=>t.updateNodeInternals;function r_(){const t=kt(n_),[r]=D.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(o=>{const i=new Map;o.forEach(l=>{const c=l.target.getAttribute("data-id");i.set(c,{id:c,nodeElement:l.target,force:!0})}),t(i)}));return D.useEffect(()=>()=>{r==null||r.disconnect()},[r]),r}function o_({node:t,nodeType:r,hasDimensions:o,resizeObserver:i}){const l=Lt(),c=D.useRef(null),f=D.useRef(null),m=D.useRef(t.sourcePosition),y=D.useRef(t.targetPosition),b=D.useRef(r),_=o&&!!t.internals.handleBounds;return D.useEffect(()=>{c.current&&!t.hidden&&(!_||f.current!==c.current)&&(f.current&&(i==null||i.unobserve(f.current)),i==null||i.observe(c.current),f.current=c.current)},[_,t.hidden]),D.useEffect(()=>()=>{f.current&&(i==null||i.unobserve(f.current),f.current=null)},[]),D.useEffect(()=>{if(c.current){const v=b.current!==r,k=m.current!==t.sourcePosition,j=y.current!==t.targetPosition;(v||k||j)&&(b.current=r,m.current=t.sourcePosition,y.current=t.targetPosition,l.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:c.current,force:!0}]])))}},[t.id,r,t.sourcePosition,t.targetPosition]),c}function s_({id:t,onClick:r,onMouseEnter:o,onMouseMove:i,onMouseLeave:l,onContextMenu:c,onDoubleClick:f,nodesDraggable:m,elementsSelectable:y,nodesConnectable:b,nodesFocusable:_,resizeObserver:v,noDragClassName:k,noPanClassName:j,disableKeyboardA11y:C,rfId:I,nodeTypes:A,nodeClickDistance:T,onError:V}){const{node:P,internals:M,isParent:B}=kt(_e=>{const ze=_e.nodeLookup.get(t),Ee=_e.parentLookup.has(t);return{node:ze,internals:ze.internals,isParent:Ee}},Ft);let U=P.type||"default",W=(A==null?void 0:A[U])||um[U];W===void 0&&(V==null||V("003",lo.error003(U)),U="default",W=(A==null?void 0:A.default)||um.default);const Z=!!(P.draggable||m&&typeof P.draggable>"u"),fe=!!(P.selectable||y&&typeof P.selectable>"u"),Se=!!(P.connectable||b&&typeof P.connectable>"u"),X=!!(P.focusable||_&&typeof P.focusable>"u"),de=Lt(),be=_0(P),z=o_({node:P,nodeType:U,hasDimensions:be,resizeObserver:v}),ue=eg({nodeRef:z,disabled:P.hidden||!Z,noDragClassName:k,handleSelector:P.dragHandle,nodeId:t,isSelectable:fe,nodeClickDistance:T}),Q=tg();if(P.hidden)return null;const ie=Bo(P),H=Xk(P),q=fe||Z||r||o||i||l,J=o?_e=>o(_e,{...M.userNode}):void 0,O=i?_e=>i(_e,{...M.userNode}):void 0,K=l?_e=>l(_e,{...M.userNode}):void 0,ke=c?_e=>c(_e,{...M.userNode}):void 0,Ne=f?_e=>f(_e,{...M.userNode}):void 0,Ae=_e=>{const{selectNodesOnDrag:ze,nodeDragThreshold:Ee}=de.getState();fe&&(!ze||!Z||Ee>0)&&Hd({id:t,store:de,nodeRef:z}),r&&r(_e,{...M.userNode})},Oe=_e=>{if(!(E0(_e.nativeEvent)||C)){if(h0.includes(_e.key)&&fe){const ze=_e.key==="Escape";Hd({id:t,store:de,unselect:ze,nodeRef:z})}else if(Z&&P.selected&&Object.prototype.hasOwnProperty.call(Su,_e.key)){_e.preventDefault();const{ariaLabelConfig:ze}=de.getState();de.setState({ariaLiveMessage:ze["node.a11yDescription.ariaLiveMessage"]({direction:_e.key.replace("Arrow","").toLowerCase(),x:~~M.positionAbsolute.x,y:~~M.positionAbsolute.y})}),Q({direction:Su[_e.key],factor:_e.shiftKey?4:1})}}},Re=()=>{var ct;if(C||!((ct=z.current)!=null&&ct.matches(":focus-visible")))return;const{transform:_e,width:ze,height:Ee,autoPanOnNodeFocus:Ze,setCenter:He}=de.getState();if(!Ze)return;Jd(new Map([[t,P]]),{x:0,y:0,width:ze,height:Ee},_e,!0).length>0||He(P.position.x+ie.width/2,P.position.y+ie.height/2,{zoom:_e[2]})};return h.jsx("div",{className:en(["react-flow__node",`react-flow__node-${U}`,{[j]:Z},P.className,{selected:P.selected,selectable:fe,parent:B,draggable:Z,dragging:ue}]),ref:z,style:{zIndex:M.z,transform:`translate(${M.positionAbsolute.x}px,${M.positionAbsolute.y}px)`,pointerEvents:q?"all":"none",visibility:be?"visible":"hidden",...P.style,...H},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:J,onMouseMove:O,onMouseLeave:K,onContextMenu:ke,onClick:Ae,onDoubleClick:Ne,onKeyDown:X?Oe:void 0,tabIndex:X?0:void 0,onFocus:X?Re:void 0,role:P.ariaRole??(X?"group":void 0),"aria-roledescription":"node","aria-describedby":C?void 0:`${q0}-${I}`,"aria-label":P.ariaLabel,...P.domAttributes,children:h.jsx(Fk,{value:t,children:h.jsx(W,{id:t,data:P.data,type:U,positionAbsoluteX:M.positionAbsolute.x,positionAbsoluteY:M.positionAbsolute.y,selected:P.selected??!1,selectable:fe,draggable:Z,deletable:P.deletable??!0,isConnectable:Se,sourcePosition:P.sourcePosition,targetPosition:P.targetPosition,dragging:ue,dragHandle:P.dragHandle,zIndex:M.z,parentId:P.parentId,...ie})})})}var i_=D.memo(s_);const a_=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function og(t){const{nodesDraggable:r,nodesConnectable:o,nodesFocusable:i,elementsSelectable:l,onError:c}=kt(a_,Ft),f=t_(t.onlyRenderVisibleElements),m=r_();return h.jsx("div",{className:"react-flow__nodes",style:Du,children:f.map(y=>h.jsx(i_,{id:y,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:o,nodesFocusable:i,elementsSelectable:l,nodeClickDistance:t.nodeClickDistance,onError:c},y))})}og.displayName="NodeRenderer";const l_=D.memo(og);function u_(t){return kt(D.useCallback(o=>{if(!t)return o.edges.map(l=>l.id);const i=[];if(o.width&&o.height)for(const l of o.edges){const c=o.nodeLookup.get(l.source),f=o.nodeLookup.get(l.target);c&&f&&ub({sourceNode:c,targetNode:f,width:o.width,height:o.height,transform:o.transform})&&i.push(l.id)}return i},[t]),Ft)}const c_=({color:t="none",strokeWidth:r=1})=>{const o={strokeWidth:r,...t&&{stroke:t}};return h.jsx("polyline",{className:"arrow",style:o,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},d_=({color:t="none",strokeWidth:r=1})=>{const o={strokeWidth:r,...t&&{stroke:t,fill:t}};return h.jsx("polyline",{className:"arrowclosed",style:o,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},dm={[bu.Arrow]:c_,[bu.ArrowClosed]:d_};function f_(t){const r=Lt();return D.useMemo(()=>{var l,c;return Object.prototype.hasOwnProperty.call(dm,t)?dm[t]:((c=(l=r.getState()).onError)==null||c.call(l,"009",lo.error009(t)),null)},[t])}const p_=({id:t,type:r,color:o,width:i=12.5,height:l=12.5,markerUnits:c="strokeWidth",strokeWidth:f,orient:m="auto-start-reverse"})=>{const y=f_(r);return y?h.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${i}`,markerHeight:`${l}`,viewBox:"-10 -10 20 20",markerUnits:c,orient:m,refX:"0",refY:"0",children:h.jsx(y,{color:o,strokeWidth:f})}):null},sg=({defaultColor:t,rfId:r})=>{const o=kt(c=>c.edges),i=kt(c=>c.defaultEdgeOptions),l=D.useMemo(()=>gb(o,{id:r,defaultColor:t,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[o,i,r,t]);return l.length?h.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:h.jsx("defs",{children:l.map(c=>h.jsx(p_,{id:c.id,type:c.type,color:c.color,width:c.width,height:c.height,markerUnits:c.markerUnits,strokeWidth:c.strokeWidth,orient:c.orient},c.id))})}):null};sg.displayName="MarkerDefinitions";var h_=D.memo(sg);function ig({x:t,y:r,label:o,labelStyle:i,labelShowBg:l=!0,labelBgStyle:c,labelBgPadding:f=[2,4],labelBgBorderRadius:m=2,children:y,className:b,..._}){const[v,k]=D.useState({x:1,y:0,width:0,height:0}),j=en(["react-flow__edge-textwrapper",b]),C=D.useRef(null);return D.useEffect(()=>{if(C.current){const I=C.current.getBBox();k({x:I.x,y:I.y,width:I.width,height:I.height})}},[o]),o?h.jsxs("g",{transform:`translate(${t-v.width/2} ${r-v.height/2})`,className:j,visibility:v.width?"visible":"hidden",..._,children:[l&&h.jsx("rect",{width:v.width+2*f[0],x:-f[0],y:-f[1],height:v.height+2*f[1],className:"react-flow__edge-textbg",style:c,rx:m,ry:m}),h.jsx("text",{className:"react-flow__edge-text",y:v.height/2,dy:"0.3em",ref:C,style:i,children:o}),y]}):null}ig.displayName="EdgeText";const m_=D.memo(ig);function zu({path:t,labelX:r,labelY:o,label:i,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:y,interactionWidth:b=20,..._}){return h.jsxs(h.Fragment,{children:[h.jsx("path",{..._,d:t,fill:"none",className:en(["react-flow__edge-path",_.className])}),b?h.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:b,className:"react-flow__edge-interaction"}):null,i&&Wr(r)&&Wr(o)?h.jsx(m_,{x:r,y:o,label:i,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:y}):null]})}function fm({pos:t,x1:r,y1:o,x2:i,y2:l}){return t===rt.Left||t===rt.Right?[.5*(r+i),o]:[r,.5*(o+l)]}function ag({sourceX:t,sourceY:r,sourcePosition:o=rt.Bottom,targetX:i,targetY:l,targetPosition:c=rt.Top}){const[f,m]=fm({pos:o,x1:t,y1:r,x2:i,y2:l}),[y,b]=fm({pos:c,x1:i,y1:l,x2:t,y2:r}),[_,v,k,j]=C0({sourceX:t,sourceY:r,targetX:i,targetY:l,sourceControlX:f,sourceControlY:m,targetControlX:y,targetControlY:b});return[`M${t},${r} C${f},${m} ${y},${b} ${i},${l}`,_,v,k,j]}function lg(t){return D.memo(({id:r,sourceX:o,sourceY:i,targetX:l,targetY:c,sourcePosition:f,targetPosition:m,label:y,labelStyle:b,labelShowBg:_,labelBgStyle:v,labelBgPadding:k,labelBgBorderRadius:j,style:C,markerEnd:I,markerStart:A,interactionWidth:T})=>{const[V,P,M]=ag({sourceX:o,sourceY:i,sourcePosition:f,targetX:l,targetY:c,targetPosition:m}),B=t.isInternal?void 0:r;return h.jsx(zu,{id:B,path:V,labelX:P,labelY:M,label:y,labelStyle:b,labelShowBg:_,labelBgStyle:v,labelBgPadding:k,labelBgBorderRadius:j,style:C,markerEnd:I,markerStart:A,interactionWidth:T})})}const g_=lg({isInternal:!1}),ug=lg({isInternal:!0});g_.displayName="SimpleBezierEdge";ug.displayName="SimpleBezierEdgeInternal";function cg(t){return D.memo(({id:r,sourceX:o,sourceY:i,targetX:l,targetY:c,label:f,labelStyle:m,labelShowBg:y,labelBgStyle:b,labelBgPadding:_,labelBgBorderRadius:v,style:k,sourcePosition:j=rt.Bottom,targetPosition:C=rt.Top,markerEnd:I,markerStart:A,pathOptions:T,interactionWidth:V})=>{const[P,M,B]=Ld({sourceX:o,sourceY:i,sourcePosition:j,targetX:l,targetY:c,targetPosition:C,borderRadius:T==null?void 0:T.borderRadius,offset:T==null?void 0:T.offset,stepPosition:T==null?void 0:T.stepPosition}),U=t.isInternal?void 0:r;return h.jsx(zu,{id:U,path:P,labelX:M,labelY:B,label:f,labelStyle:m,labelShowBg:y,labelBgStyle:b,labelBgPadding:_,labelBgBorderRadius:v,style:k,markerEnd:I,markerStart:A,interactionWidth:V})})}const dg=cg({isInternal:!1}),fg=cg({isInternal:!0});dg.displayName="SmoothStepEdge";fg.displayName="SmoothStepEdgeInternal";function pg(t){return D.memo(({id:r,...o})=>{var l;const i=t.isInternal?void 0:r;return h.jsx(dg,{...o,id:i,pathOptions:D.useMemo(()=>{var c;return{borderRadius:0,offset:(c=o.pathOptions)==null?void 0:c.offset}},[(l=o.pathOptions)==null?void 0:l.offset])})})}const y_=pg({isInternal:!1}),hg=pg({isInternal:!0});y_.displayName="StepEdge";hg.displayName="StepEdgeInternal";function mg(t){return D.memo(({id:r,sourceX:o,sourceY:i,targetX:l,targetY:c,label:f,labelStyle:m,labelShowBg:y,labelBgStyle:b,labelBgPadding:_,labelBgBorderRadius:v,style:k,markerEnd:j,markerStart:C,interactionWidth:I})=>{const[A,T,V]=I0({sourceX:o,sourceY:i,targetX:l,targetY:c}),P=t.isInternal?void 0:r;return h.jsx(zu,{id:P,path:A,labelX:T,labelY:V,label:f,labelStyle:m,labelShowBg:y,labelBgStyle:b,labelBgPadding:_,labelBgBorderRadius:v,style:k,markerEnd:j,markerStart:C,interactionWidth:I})})}const x_=mg({isInternal:!1}),gg=mg({isInternal:!0});x_.displayName="StraightEdge";gg.displayName="StraightEdgeInternal";function yg(t){return D.memo(({id:r,sourceX:o,sourceY:i,targetX:l,targetY:c,sourcePosition:f=rt.Bottom,targetPosition:m=rt.Top,label:y,labelStyle:b,labelShowBg:_,labelBgStyle:v,labelBgPadding:k,labelBgBorderRadius:j,style:C,markerEnd:I,markerStart:A,pathOptions:T,interactionWidth:V})=>{const[P,M,B]=P0({sourceX:o,sourceY:i,sourcePosition:f,targetX:l,targetY:c,targetPosition:m,curvature:T==null?void 0:T.curvature}),U=t.isInternal?void 0:r;return h.jsx(zu,{id:U,path:P,labelX:M,labelY:B,label:y,labelStyle:b,labelShowBg:_,labelBgStyle:v,labelBgPadding:k,labelBgBorderRadius:j,style:C,markerEnd:I,markerStart:A,interactionWidth:V})})}const v_=yg({isInternal:!1}),xg=yg({isInternal:!0});v_.displayName="BezierEdge";xg.displayName="BezierEdgeInternal";const pm={default:xg,straight:gg,step:hg,smoothstep:fg,simplebezier:ug},hm={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},w_=(t,r,o)=>o===rt.Left?t-r:o===rt.Right?t+r:t,b_=(t,r,o)=>o===rt.Top?t-r:o===rt.Bottom?t+r:t,mm="react-flow__edgeupdater";function gm({position:t,centerX:r,centerY:o,radius:i=10,onMouseDown:l,onMouseEnter:c,onMouseOut:f,type:m}){return h.jsx("circle",{onMouseDown:l,onMouseEnter:c,onMouseOut:f,className:en([mm,`${mm}-${m}`]),cx:w_(r,i,t),cy:b_(o,i,t),r:i,stroke:"transparent",fill:"transparent"})}function k_({isReconnectable:t,reconnectRadius:r,edge:o,sourceX:i,sourceY:l,targetX:c,targetY:f,sourcePosition:m,targetPosition:y,onReconnect:b,onReconnectStart:_,onReconnectEnd:v,setReconnecting:k,setUpdateHover:j}){const C=Lt(),I=(M,B)=>{if(M.button!==0)return;const{autoPanOnConnect:U,domNode:W,connectionMode:Z,connectionRadius:fe,lib:Se,onConnectStart:X,cancelConnection:de,nodeLookup:be,rfId:z,panBy:ue,updateConnection:Q}=C.getState(),ie=B.type==="target",H=(O,K)=>{k(!1),v==null||v(O,o,B.type,K)},q=O=>b==null?void 0:b(o,O),J=(O,K)=>{k(!0),_==null||_(M,o,B.type),X==null||X(O,K)};Bd.onPointerDown(M.nativeEvent,{autoPanOnConnect:U,connectionMode:Z,connectionRadius:fe,domNode:W,handleId:B.id,nodeId:B.nodeId,nodeLookup:be,isTarget:ie,edgeUpdaterType:B.type,lib:Se,flowId:z,cancelConnection:de,panBy:ue,isValidConnection:(...O)=>{var K,ke;return((ke=(K=C.getState()).isValidConnection)==null?void 0:ke.call(K,...O))??!0},onConnect:q,onConnectStart:J,onConnectEnd:(...O)=>{var K,ke;return(ke=(K=C.getState()).onConnectEnd)==null?void 0:ke.call(K,...O)},onReconnectEnd:H,updateConnection:Q,getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle,dragThreshold:C.getState().connectionDragThreshold,handleDomNode:M.currentTarget})},A=M=>I(M,{nodeId:o.target,id:o.targetHandle??null,type:"target"}),T=M=>I(M,{nodeId:o.source,id:o.sourceHandle??null,type:"source"}),V=()=>j(!0),P=()=>j(!1);return h.jsxs(h.Fragment,{children:[(t===!0||t==="source")&&h.jsx(gm,{position:m,centerX:i,centerY:l,radius:r,onMouseDown:A,onMouseEnter:V,onMouseOut:P,type:"source"}),(t===!0||t==="target")&&h.jsx(gm,{position:y,centerX:c,centerY:f,radius:r,onMouseDown:T,onMouseEnter:V,onMouseOut:P,type:"target"})]})}function __({id:t,edgesFocusable:r,edgesReconnectable:o,elementsSelectable:i,onClick:l,onDoubleClick:c,onContextMenu:f,onMouseEnter:m,onMouseMove:y,onMouseLeave:b,reconnectRadius:_,onReconnect:v,onReconnectStart:k,onReconnectEnd:j,rfId:C,edgeTypes:I,noPanClassName:A,onError:T,disableKeyboardA11y:V}){let P=kt(He=>He.edgeLookup.get(t));const M=kt(He=>He.defaultEdgeOptions);P=M?{...M,...P}:P;let B=P.type||"default",U=(I==null?void 0:I[B])||pm[B];U===void 0&&(T==null||T("011",lo.error011(B)),B="default",U=(I==null?void 0:I.default)||pm.default);const W=!!(P.focusable||r&&typeof P.focusable>"u"),Z=typeof v<"u"&&(P.reconnectable||o&&typeof P.reconnectable>"u"),fe=!!(P.selectable||i&&typeof P.selectable>"u"),Se=D.useRef(null),[X,de]=D.useState(!1),[be,z]=D.useState(!1),ue=Lt(),{zIndex:Q,sourceX:ie,sourceY:H,targetX:q,targetY:J,sourcePosition:O,targetPosition:K}=kt(D.useCallback(He=>{const Ke=He.nodeLookup.get(P.source),ct=He.nodeLookup.get(P.target);if(!Ke||!ct)return{zIndex:P.zIndex,...hm};const dt=mb({id:t,sourceNode:Ke,targetNode:ct,sourceHandle:P.sourceHandle||null,targetHandle:P.targetHandle||null,connectionMode:He.connectionMode,onError:T});return{zIndex:lb({selected:P.selected,zIndex:P.zIndex,sourceNode:Ke,targetNode:ct,elevateOnSelect:He.elevateEdgesOnSelect,zIndexMode:He.zIndexMode}),...dt||hm}},[P.source,P.target,P.sourceHandle,P.targetHandle,P.selected,P.zIndex]),Ft),ke=D.useMemo(()=>P.markerStart?`url('#${Dd(P.markerStart,C)}')`:void 0,[P.markerStart,C]),Ne=D.useMemo(()=>P.markerEnd?`url('#${Dd(P.markerEnd,C)}')`:void 0,[P.markerEnd,C]);if(P.hidden||ie===null||H===null||q===null||J===null)return null;const Ae=He=>{var we;const{addSelectedEdges:Ke,unselectNodesAndEdges:ct,multiSelectionActive:dt}=ue.getState();fe&&(ue.setState({nodesSelectionActive:!1}),P.selected&&dt?(ct({nodes:[],edges:[P]}),(we=Se.current)==null||we.blur()):Ke([t])),l&&l(He,P)},Oe=c?He=>{c(He,{...P})}:void 0,Re=f?He=>{f(He,{...P})}:void 0,_e=m?He=>{m(He,{...P})}:void 0,ze=y?He=>{y(He,{...P})}:void 0,Ee=b?He=>{b(He,{...P})}:void 0,Ze=He=>{var Ke;if(!V&&h0.includes(He.key)&&fe){const{unselectNodesAndEdges:ct,addSelectedEdges:dt}=ue.getState();He.key==="Escape"?((Ke=Se.current)==null||Ke.blur(),ct({edges:[P]})):dt([t])}};return h.jsx("svg",{style:{zIndex:Q},children:h.jsxs("g",{className:en(["react-flow__edge",`react-flow__edge-${B}`,P.className,A,{selected:P.selected,animated:P.animated,inactive:!fe&&!l,updating:X,selectable:fe}]),onClick:Ae,onDoubleClick:Oe,onContextMenu:Re,onMouseEnter:_e,onMouseMove:ze,onMouseLeave:Ee,onKeyDown:W?Ze:void 0,tabIndex:W?0:void 0,role:P.ariaRole??(W?"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":W?`${W0}-${C}`:void 0,ref:Se,...P.domAttributes,children:[!be&&h.jsx(U,{id:t,source:P.source,target:P.target,type:P.type,selected:P.selected,animated:P.animated,selectable:fe,deletable:P.deletable??!0,label:P.label,labelStyle:P.labelStyle,labelShowBg:P.labelShowBg,labelBgStyle:P.labelBgStyle,labelBgPadding:P.labelBgPadding,labelBgBorderRadius:P.labelBgBorderRadius,sourceX:ie,sourceY:H,targetX:q,targetY:J,sourcePosition:O,targetPosition:K,data:P.data,style:P.style,sourceHandleId:P.sourceHandle,targetHandleId:P.targetHandle,markerStart:ke,markerEnd:Ne,pathOptions:"pathOptions"in P?P.pathOptions:void 0,interactionWidth:P.interactionWidth}),Z&&h.jsx(k_,{edge:P,isReconnectable:Z,reconnectRadius:_,onReconnect:v,onReconnectStart:k,onReconnectEnd:j,sourceX:ie,sourceY:H,targetX:q,targetY:J,sourcePosition:O,targetPosition:K,setUpdateHover:de,setReconnecting:z})]})})}var S_=D.memo(__);const N_=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function vg({defaultMarkerColor:t,onlyRenderVisibleElements:r,rfId:o,edgeTypes:i,noPanClassName:l,onReconnect:c,onEdgeContextMenu:f,onEdgeMouseEnter:m,onEdgeMouseMove:y,onEdgeMouseLeave:b,onEdgeClick:_,reconnectRadius:v,onEdgeDoubleClick:k,onReconnectStart:j,onReconnectEnd:C,disableKeyboardA11y:I}){const{edgesFocusable:A,edgesReconnectable:T,elementsSelectable:V,onError:P}=kt(N_,Ft),M=u_(r);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(h_,{defaultColor:t,rfId:o}),M.map(B=>h.jsx(S_,{id:B,edgesFocusable:A,edgesReconnectable:T,elementsSelectable:V,noPanClassName:l,onReconnect:c,onContextMenu:f,onMouseEnter:m,onMouseMove:y,onMouseLeave:b,onClick:_,reconnectRadius:v,onDoubleClick:k,onReconnectStart:j,onReconnectEnd:C,rfId:o,onError:P,edgeTypes:i,disableKeyboardA11y:I},B))]})}vg.displayName="EdgeRenderer";const E_=D.memo(vg),j_=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function C_({children:t}){const r=kt(j_);return h.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function P_(t){const r=af(),o=D.useRef(!1);D.useEffect(()=>{!o.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),o.current=!0)},[t,r.viewportInitialized])}const M_=t=>{var r;return(r=t.panZoom)==null?void 0:r.syncViewport};function T_(t){const r=kt(M_),o=Lt();return D.useEffect(()=>{t&&(r==null||r(t),o.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function I_(t){return t.connection.inProgress?{...t.connection,to:Va(t.connection.to,t.transform)}:{...t.connection}}function $_(t){return I_}function A_(t){const r=$_();return kt(r,Ft)}const O_=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function R_({containerStyle:t,style:r,type:o,component:i}){const{nodesConnectable:l,width:c,height:f,isValid:m,inProgress:y}=kt(O_,Ft);return!(c&&l&&y)?null:h.jsx("svg",{style:t,width:c,height:f,className:"react-flow__connectionline react-flow__container",children:h.jsx("g",{className:en(["react-flow__connection",y0(m)]),children:h.jsx(wg,{style:r,type:o,CustomComponent:i,isValid:m})})})}const wg=({style:t,type:r=gs.Bezier,CustomComponent:o,isValid:i})=>{const{inProgress:l,from:c,fromNode:f,fromHandle:m,fromPosition:y,to:b,toNode:_,toHandle:v,toPosition:k,pointer:j}=A_();if(!l)return;if(o)return h.jsx(o,{connectionLineType:r,connectionLineStyle:t,fromNode:f,fromHandle:m,fromX:c.x,fromY:c.y,toX:b.x,toY:b.y,fromPosition:y,toPosition:k,connectionStatus:y0(i),toNode:_,toHandle:v,pointer:j});let C="";const I={sourceX:c.x,sourceY:c.y,sourcePosition:y,targetX:b.x,targetY:b.y,targetPosition:k};switch(r){case gs.Bezier:[C]=P0(I);break;case gs.SimpleBezier:[C]=ag(I);break;case gs.Step:[C]=Ld({...I,borderRadius:0});break;case gs.SmoothStep:[C]=Ld(I);break;default:[C]=I0(I)}return h.jsx("path",{d:C,fill:"none",className:"react-flow__connection-path",style:t})};wg.displayName="ConnectionLine";const L_={};function ym(t=L_){D.useRef(t),Lt(),D.useEffect(()=>{},[t])}function D_(){Lt(),D.useRef(!1),D.useEffect(()=>{},[])}function bg({nodeTypes:t,edgeTypes:r,onInit:o,onNodeClick:i,onEdgeClick:l,onNodeDoubleClick:c,onEdgeDoubleClick:f,onNodeMouseEnter:m,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:_,onSelectionContextMenu:v,onSelectionStart:k,onSelectionEnd:j,connectionLineType:C,connectionLineStyle:I,connectionLineComponent:A,connectionLineContainerStyle:T,selectionKeyCode:V,selectionOnDrag:P,selectionMode:M,multiSelectionKeyCode:B,panActivationKeyCode:U,zoomActivationKeyCode:W,deleteKeyCode:Z,onlyRenderVisibleElements:fe,elementsSelectable:Se,defaultViewport:X,translateExtent:de,minZoom:be,maxZoom:z,preventScrolling:ue,defaultMarkerColor:Q,zoomOnScroll:ie,zoomOnPinch:H,panOnScroll:q,panOnScrollSpeed:J,panOnScrollMode:O,zoomOnDoubleClick:K,panOnDrag:ke,onPaneClick:Ne,onPaneMouseEnter:Ae,onPaneMouseMove:Oe,onPaneMouseLeave:Re,onPaneScroll:_e,onPaneContextMenu:ze,paneClickDistance:Ee,nodeClickDistance:Ze,onEdgeContextMenu:He,onEdgeMouseEnter:Ke,onEdgeMouseMove:ct,onEdgeMouseLeave:dt,reconnectRadius:we,onReconnect:tt,onReconnectStart:_t,onReconnectEnd:Ct,noDragClassName:xt,noWheelClassName:vt,noPanClassName:It,disableKeyboardA11y:_n,nodeExtent:fr,rfId:sn,viewport:Pt,onViewportChange:tn}){return ym(t),ym(r),D_(),P_(o),T_(Pt),h.jsx(Zk,{onPaneClick:Ne,onPaneMouseEnter:Ae,onPaneMouseMove:Oe,onPaneMouseLeave:Re,onPaneContextMenu:ze,onPaneScroll:_e,paneClickDistance:Ee,deleteKeyCode:Z,selectionKeyCode:V,selectionOnDrag:P,selectionMode:M,onSelectionStart:k,onSelectionEnd:j,multiSelectionKeyCode:B,panActivationKeyCode:U,zoomActivationKeyCode:W,elementsSelectable:Se,zoomOnScroll:ie,zoomOnPinch:H,zoomOnDoubleClick:K,panOnScroll:q,panOnScrollSpeed:J,panOnScrollMode:O,panOnDrag:ke,defaultViewport:X,translateExtent:de,minZoom:be,maxZoom:z,onSelectionContextMenu:v,preventScrolling:ue,noDragClassName:xt,noWheelClassName:vt,noPanClassName:It,disableKeyboardA11y:_n,onViewportChange:tn,isControlledViewport:!!Pt,children:h.jsxs(C_,{children:[h.jsx(E_,{edgeTypes:r,onEdgeClick:l,onEdgeDoubleClick:f,onReconnect:tt,onReconnectStart:_t,onReconnectEnd:Ct,onlyRenderVisibleElements:fe,onEdgeContextMenu:He,onEdgeMouseEnter:Ke,onEdgeMouseMove:ct,onEdgeMouseLeave:dt,reconnectRadius:we,defaultMarkerColor:Q,noPanClassName:It,disableKeyboardA11y:_n,rfId:sn}),h.jsx(R_,{style:I,type:C,component:A,containerStyle:T}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(l_,{nodeTypes:t,onNodeClick:i,onNodeDoubleClick:c,onNodeMouseEnter:m,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:_,nodeClickDistance:Ze,onlyRenderVisibleElements:fe,noPanClassName:It,noDragClassName:xt,disableKeyboardA11y:_n,nodeExtent:fr,rfId:sn}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}bg.displayName="GraphView";const z_=D.memo(bg),xm=({nodes:t,edges:r,defaultNodes:o,defaultEdges:i,width:l,height:c,fitView:f,fitViewOptions:m,minZoom:y=.5,maxZoom:b=2,nodeOrigin:_,nodeExtent:v,zIndexMode:k="basic"}={})=>{const j=new Map,C=new Map,I=new Map,A=new Map,T=i??r??[],V=o??t??[],P=_??[0,0],M=v??Ia;O0(I,A,T);const{nodesInitialized:B}=zd(V,j,C,{nodeOrigin:P,nodeExtent:M,zIndexMode:k});let U=[0,0,1];if(f&&l&&c){const W=Fa(j,{filter:X=>!!((X.width||X.initialWidth)&&(X.height||X.initialHeight))}),{x:Z,y:fe,zoom:Se}=Zd(W,l,c,y,b,(m==null?void 0:m.padding)??.1);U=[Z,fe,Se]}return{rfId:"1",width:l??0,height:c??0,transform:U,nodes:V,nodesInitialized:B,nodeLookup:j,parentLookup:C,edges:T,edgeLookup:A,connectionLookup:I,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:o!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:y,maxZoom:b,translateExtent:Ia,nodeExtent:M,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ri.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:f??!1,fitViewOptions:m,fitViewResolver:null,connection:{...g0},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:nb,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:m0,zIndexMode:k,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},B_=({nodes:t,edges:r,defaultNodes:o,defaultEdges:i,width:l,height:c,fitView:f,fitViewOptions:m,minZoom:y,maxZoom:b,nodeOrigin:_,nodeExtent:v,zIndexMode:k})=>sk((j,C)=>{async function I(){const{nodeLookup:A,panZoom:T,fitViewOptions:V,fitViewResolver:P,width:M,height:B,minZoom:U,maxZoom:W}=C();T&&(await eb({nodes:A,width:M,height:B,panZoom:T,minZoom:U,maxZoom:W},V),P==null||P.resolve(!0),j({fitViewResolver:null}))}return{...xm({nodes:t,edges:r,width:l,height:c,fitView:f,fitViewOptions:m,minZoom:y,maxZoom:b,nodeOrigin:_,nodeExtent:v,defaultNodes:o,defaultEdges:i,zIndexMode:k}),setNodes:A=>{const{nodeLookup:T,parentLookup:V,nodeOrigin:P,elevateNodesOnSelect:M,fitViewQueued:B,zIndexMode:U,nodesSelectionActive:W}=C(),{nodesInitialized:Z,hasSelectedNodes:fe}=zd(A,T,V,{nodeOrigin:P,nodeExtent:v,elevateNodesOnSelect:M,checkEquality:!0,zIndexMode:U}),Se=W&&fe;B&&Z?(I(),j({nodes:A,nodesInitialized:Z,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:Se})):j({nodes:A,nodesInitialized:Z,nodesSelectionActive:Se})},setEdges:A=>{const{connectionLookup:T,edgeLookup:V}=C();O0(T,V,A),j({edges:A})},setDefaultNodesAndEdges:(A,T)=>{if(A){const{setNodes:V}=C();V(A),j({hasDefaultNodes:!0})}if(T){const{setEdges:V}=C();V(T),j({hasDefaultEdges:!0})}},updateNodeInternals:A=>{const{triggerNodeChanges:T,nodeLookup:V,parentLookup:P,domNode:M,nodeOrigin:B,nodeExtent:U,debug:W,fitViewQueued:Z,zIndexMode:fe}=C(),{changes:Se,updatedInternals:X}=_b(A,V,P,M,B,U,fe);X&&(vb(V,P,{nodeOrigin:B,nodeExtent:U,zIndexMode:fe}),Z?(I(),j({fitViewQueued:!1,fitViewOptions:void 0})):j({}),(Se==null?void 0:Se.length)>0&&(W&&console.log("React Flow: trigger node changes",Se),T==null||T(Se)))},updateNodePositions:(A,T=!1)=>{const V=[];let P=[];const{nodeLookup:M,triggerNodeChanges:B,connection:U,updateConnection:W,onNodesChangeMiddlewareMap:Z}=C();for(const[fe,Se]of A){const X=M.get(fe),de=!!(X!=null&&X.expandParent&&(X!=null&&X.parentId)&&(Se!=null&&Se.position)),be={id:fe,type:"position",position:de?{x:Math.max(0,Se.position.x),y:Math.max(0,Se.position.y)}:Se.position,dragging:T};if(X&&U.inProgress&&U.fromNode.id===X.id){const z=qs(X,U.fromHandle,rt.Left,!0);W({...U,from:z})}de&&X.parentId&&V.push({id:fe,parentId:X.parentId,rect:{...Se.internals.positionAbsolute,width:Se.measured.width??0,height:Se.measured.height??0}}),P.push(be)}if(V.length>0){const{parentLookup:fe,nodeOrigin:Se}=C(),X=sf(V,M,fe,Se);P.push(...X)}for(const fe of Z.values())P=fe(P);B(P)},triggerNodeChanges:A=>{const{onNodesChange:T,setNodes:V,nodes:P,hasDefaultNodes:M,debug:B}=C();if(A!=null&&A.length){if(M){const U=Q0(A,P);V(U)}B&&console.log("React Flow: trigger node changes",A),T==null||T(A)}},triggerEdgeChanges:A=>{const{onEdgesChange:T,setEdges:V,edges:P,hasDefaultEdges:M,debug:B}=C();if(A!=null&&A.length){if(M){const U=G0(A,P);V(U)}B&&console.log("React Flow: trigger edge changes",A),T==null||T(A)}},addSelectedNodes:A=>{const{multiSelectionActive:T,edgeLookup:V,nodeLookup:P,triggerNodeChanges:M,triggerEdgeChanges:B}=C();if(T){const U=A.map(W=>zs(W,!0));M(U);return}M(Pi(P,new Set([...A]),!0)),B(Pi(V))},addSelectedEdges:A=>{const{multiSelectionActive:T,edgeLookup:V,nodeLookup:P,triggerNodeChanges:M,triggerEdgeChanges:B}=C();if(T){const U=A.map(W=>zs(W,!0));B(U);return}B(Pi(V,new Set([...A]))),M(Pi(P,new Set,!0))},unselectNodesAndEdges:({nodes:A,edges:T}={})=>{const{edges:V,nodes:P,nodeLookup:M,triggerNodeChanges:B,triggerEdgeChanges:U}=C(),W=A||P,Z=T||V,fe=[];for(const X of W){if(!X.selected)continue;const de=M.get(X.id);de&&(de.selected=!1),fe.push(zs(X.id,!1))}const Se=[];for(const X of Z)X.selected&&Se.push(zs(X.id,!1));B(fe),U(Se)},setMinZoom:A=>{const{panZoom:T,maxZoom:V}=C();T==null||T.setScaleExtent([A,V]),j({minZoom:A})},setMaxZoom:A=>{const{panZoom:T,minZoom:V}=C();T==null||T.setScaleExtent([V,A]),j({maxZoom:A})},setTranslateExtent:A=>{var T;(T=C().panZoom)==null||T.setTranslateExtent(A),j({translateExtent:A})},resetSelectedElements:()=>{const{edges:A,nodes:T,triggerNodeChanges:V,triggerEdgeChanges:P,elementsSelectable:M}=C();if(!M)return;const B=T.reduce((W,Z)=>Z.selected?[...W,zs(Z.id,!1)]:W,[]),U=A.reduce((W,Z)=>Z.selected?[...W,zs(Z.id,!1)]:W,[]);V(B),P(U)},setNodeExtent:A=>{const{nodes:T,nodeLookup:V,parentLookup:P,nodeOrigin:M,elevateNodesOnSelect:B,nodeExtent:U,zIndexMode:W}=C();A[0][0]===U[0][0]&&A[0][1]===U[0][1]&&A[1][0]===U[1][0]&&A[1][1]===U[1][1]||(zd(T,V,P,{nodeOrigin:M,nodeExtent:A,elevateNodesOnSelect:B,checkEquality:!1,zIndexMode:W}),j({nodeExtent:A}))},panBy:A=>{const{transform:T,width:V,height:P,panZoom:M,translateExtent:B}=C();return Sb({delta:A,panZoom:M,transform:T,translateExtent:B,width:V,height:P})},setCenter:async(A,T,V)=>{const{width:P,height:M,maxZoom:B,panZoom:U}=C();if(!U)return Promise.resolve(!1);const W=typeof(V==null?void 0:V.zoom)<"u"?V.zoom:B;return await U.setViewport({x:P/2-A*W,y:M/2-T*W,zoom:W},{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:()=>{j({connection:{...g0}})},updateConnection:A=>{j({connection:A})},reset:()=>j({...xm()})}},Object.is);function F_({initialNodes:t,initialEdges:r,defaultNodes:o,defaultEdges:i,initialWidth:l,initialHeight:c,initialMinZoom:f,initialMaxZoom:m,initialFitViewOptions:y,fitView:b,nodeOrigin:_,nodeExtent:v,zIndexMode:k,children:j}){const[C]=D.useState(()=>B_({nodes:t,edges:r,defaultNodes:o,defaultEdges:i,width:l,height:c,fitView:b,minZoom:f,maxZoom:m,fitViewOptions:y,nodeOrigin:_,nodeExtent:v,zIndexMode:k}));return h.jsx(ik,{value:C,children:h.jsx(Ck,{children:j})})}function H_({children:t,nodes:r,edges:o,defaultNodes:i,defaultEdges:l,width:c,height:f,fitView:m,fitViewOptions:y,minZoom:b,maxZoom:_,nodeOrigin:v,nodeExtent:k,zIndexMode:j}){return D.useContext(Lu)?h.jsx(h.Fragment,{children:t}):h.jsx(F_,{initialNodes:r,initialEdges:o,defaultNodes:i,defaultEdges:l,initialWidth:c,initialHeight:f,fitView:m,initialFitViewOptions:y,initialMinZoom:b,initialMaxZoom:_,nodeOrigin:v,nodeExtent:k,zIndexMode:j,children:t})}const V_={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function U_({nodes:t,edges:r,defaultNodes:o,defaultEdges:i,className:l,nodeTypes:c,edgeTypes:f,onNodeClick:m,onEdgeClick:y,onInit:b,onMove:_,onMoveStart:v,onMoveEnd:k,onConnect:j,onConnectStart:C,onConnectEnd:I,onClickConnectStart:A,onClickConnectEnd:T,onNodeMouseEnter:V,onNodeMouseMove:P,onNodeMouseLeave:M,onNodeContextMenu:B,onNodeDoubleClick:U,onNodeDragStart:W,onNodeDrag:Z,onNodeDragStop:fe,onNodesDelete:Se,onEdgesDelete:X,onDelete:de,onSelectionChange:be,onSelectionDragStart:z,onSelectionDrag:ue,onSelectionDragStop:Q,onSelectionContextMenu:ie,onSelectionStart:H,onSelectionEnd:q,onBeforeDelete:J,connectionMode:O,connectionLineType:K=gs.Bezier,connectionLineStyle:ke,connectionLineComponent:Ne,connectionLineContainerStyle:Ae,deleteKeyCode:Oe="Backspace",selectionKeyCode:Re="Shift",selectionOnDrag:_e=!1,selectionMode:ze=$a.Full,panActivationKeyCode:Ee="Space",multiSelectionKeyCode:Ze=Oa()?"Meta":"Control",zoomActivationKeyCode:He=Oa()?"Meta":"Control",snapToGrid:Ke,snapGrid:ct,onlyRenderVisibleElements:dt=!1,selectNodesOnDrag:we,nodesDraggable:tt,autoPanOnNodeFocus:_t,nodesConnectable:Ct,nodesFocusable:xt,nodeOrigin:vt=Y0,edgesFocusable:It,edgesReconnectable:_n,elementsSelectable:fr=!0,defaultViewport:sn=vk,minZoom:Pt=.5,maxZoom:tn=2,translateExtent:an=Ia,preventScrolling:pr=!0,nodeExtent:Tn,defaultMarkerColor:In="#b1b1b7",zoomOnScroll:hn=!0,zoomOnPinch:hr=!0,panOnScroll:Rn=!1,panOnScrollSpeed:Sn=.5,panOnScrollMode:We=Hs.Free,zoomOnDoubleClick:Ln=!0,panOnDrag:mn=!0,onPaneClick:Gt,onPaneMouseEnter:Ve,onPaneMouseMove:Dn,onPaneMouseLeave:Et,onPaneScroll:Qr,onPaneContextMenu:fo,paneClickDistance:er=1,nodeClickDistance:mr=0,children:Fo,onReconnect:zn,onReconnectStart:Bn,onReconnectEnd:$n,onEdgeContextMenu:tr,onEdgeDoubleClick:lt,onEdgeMouseEnter:Dt,onEdgeMouseMove:Pr,onEdgeMouseLeave:nr,reconnectRadius:rr=10,onNodesChange:gr,onEdgesChange:Ho,noDragClassName:Fn="nodrag",noWheelClassName:yr="nowheel",noPanClassName:Wt="nopan",fitView:xr,fitViewOptions:po,connectOnClick:nn,attributionPosition:Mr,proOptions:Hn,defaultEdgeOptions:ho,elevateNodesOnSelect:Gr=!0,elevateEdgesOnSelect:Mt=!1,disableKeyboardA11y:Vn=!1,autoPanOnConnect:wt,autoPanOnNodeDrag:Vo,autoPanSpeed:vr,connectionRadius:Tr,isValidConnection:wr,onError:or,style:mo,id:Un,nodeDragThreshold:gn,connectionDragThreshold:ht,viewport:ln,onViewportChange:Uo,width:Jr,height:br,colorMode:sr="light",debug:kr,onScroll:L,ariaLabelConfig:me,zIndexMode:Fe="basic",...Je},jt){const $t=Un||"1",Yt=_k(sr),Ht=D.useCallback(Xt=>{Xt.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),L==null||L(Xt)},[L]);return h.jsx("div",{"data-testid":"rf__wrapper",...Je,onScroll:Ht,style:{...mo,...V_},ref:jt,className:en(["react-flow",l,Yt]),id:Un,role:"application",children:h.jsxs(H_,{nodes:t,edges:r,width:Jr,height:br,fitView:xr,fitViewOptions:po,minZoom:Pt,maxZoom:tn,nodeOrigin:vt,nodeExtent:Tn,zIndexMode:Fe,children:[h.jsx(kk,{nodes:t,edges:r,defaultNodes:o,defaultEdges:i,onConnect:j,onConnectStart:C,onConnectEnd:I,onClickConnectStart:A,onClickConnectEnd:T,nodesDraggable:tt,autoPanOnNodeFocus:_t,nodesConnectable:Ct,nodesFocusable:xt,edgesFocusable:It,edgesReconnectable:_n,elementsSelectable:fr,elevateNodesOnSelect:Gr,elevateEdgesOnSelect:Mt,minZoom:Pt,maxZoom:tn,nodeExtent:Tn,onNodesChange:gr,onEdgesChange:Ho,snapToGrid:Ke,snapGrid:ct,connectionMode:O,translateExtent:an,connectOnClick:nn,defaultEdgeOptions:ho,fitView:xr,fitViewOptions:po,onNodesDelete:Se,onEdgesDelete:X,onDelete:de,onNodeDragStart:W,onNodeDrag:Z,onNodeDragStop:fe,onSelectionDrag:ue,onSelectionDragStart:z,onSelectionDragStop:Q,onMove:_,onMoveStart:v,onMoveEnd:k,noPanClassName:Wt,nodeOrigin:vt,rfId:$t,autoPanOnConnect:wt,autoPanOnNodeDrag:Vo,autoPanSpeed:vr,onError:or,connectionRadius:Tr,isValidConnection:wr,selectNodesOnDrag:we,nodeDragThreshold:gn,connectionDragThreshold:ht,onBeforeDelete:J,debug:kr,ariaLabelConfig:me,zIndexMode:Fe}),h.jsx(z_,{onInit:b,onNodeClick:m,onEdgeClick:y,onNodeMouseEnter:V,onNodeMouseMove:P,onNodeMouseLeave:M,onNodeContextMenu:B,onNodeDoubleClick:U,nodeTypes:c,edgeTypes:f,connectionLineType:K,connectionLineStyle:ke,connectionLineComponent:Ne,connectionLineContainerStyle:Ae,selectionKeyCode:Re,selectionOnDrag:_e,selectionMode:ze,deleteKeyCode:Oe,multiSelectionKeyCode:Ze,panActivationKeyCode:Ee,zoomActivationKeyCode:He,onlyRenderVisibleElements:dt,defaultViewport:sn,translateExtent:an,minZoom:Pt,maxZoom:tn,preventScrolling:pr,zoomOnScroll:hn,zoomOnPinch:hr,zoomOnDoubleClick:Ln,panOnScroll:Rn,panOnScrollSpeed:Sn,panOnScrollMode:We,panOnDrag:mn,onPaneClick:Gt,onPaneMouseEnter:Ve,onPaneMouseMove:Dn,onPaneMouseLeave:Et,onPaneScroll:Qr,onPaneContextMenu:fo,paneClickDistance:er,nodeClickDistance:mr,onSelectionContextMenu:ie,onSelectionStart:H,onSelectionEnd:q,onReconnect:zn,onReconnectStart:Bn,onReconnectEnd:$n,onEdgeContextMenu:tr,onEdgeDoubleClick:lt,onEdgeMouseEnter:Dt,onEdgeMouseMove:Pr,onEdgeMouseLeave:nr,reconnectRadius:rr,defaultMarkerColor:In,noDragClassName:Fn,noWheelClassName:yr,noPanClassName:Wt,rfId:$t,disableKeyboardA11y:Vn,nodeExtent:Tn,viewport:ln,onViewportChange:Uo}),h.jsx(xk,{onSelectionChange:be}),Fo,h.jsx(pk,{proOptions:Hn,position:Mr}),h.jsx(fk,{rfId:$t,disableKeyboardA11y:Vn})]})})}var K_=J0(U_);function q_(){const t=Lt();return D.useCallback(r=>{const{domNode:o,updateNodeInternals:i}=t.getState(),l=Array.isArray(r)?r:[r],c=new Map;l.forEach(f=>{const m=o==null?void 0:o.querySelector(`.react-flow__node[data-id="${f}"]`);m&&c.set(f,{id:f,nodeElement:m,force:!0})}),requestAnimationFrame(()=>i(c,{triggerFitView:!1}))},[])}function W_(t){const[r,o]=D.useState(t),i=D.useCallback(l=>o(c=>Q0(l,c)),[]);return[r,o,i]}function Y_(t){const[r,o]=D.useState(t),i=D.useCallback(l=>o(c=>G0(l,c)),[]);return[r,o,i]}function X_({dimensions:t,lineWidth:r,variant:o,className:i}){return h.jsx("path",{strokeWidth:r,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:en(["react-flow__background-pattern",o,i])})}function Q_({radius:t,className:r}){return h.jsx("circle",{cx:t,cy:t,r:t,className:en(["react-flow__background-pattern","dots",r])})}var Do;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Do||(Do={}));const G_={[Do.Dots]:1,[Do.Lines]:1,[Do.Cross]:6},J_=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function kg({id:t,variant:r=Do.Dots,gap:o=20,size:i,lineWidth:l=1,offset:c=0,color:f,bgColor:m,style:y,className:b,patternClassName:_}){const v=D.useRef(null),{transform:k,patternId:j}=kt(J_,Ft),C=i||G_[r],I=r===Do.Dots,A=r===Do.Cross,T=Array.isArray(o)?o:[o,o],V=[T[0]*k[2]||1,T[1]*k[2]||1],P=C*k[2],M=Array.isArray(c)?c:[c,c],B=A?[P,P]:V,U=[M[0]*k[2]||1+B[0]/2,M[1]*k[2]||1+B[1]/2],W=`${j}${t||""}`;return h.jsxs("svg",{className:en(["react-flow__background",b]),style:{...y,...Du,"--xy-background-color-props":m,"--xy-background-pattern-color-props":f},ref:v,"data-testid":"rf__background",children:[h.jsx("pattern",{id:W,x:k[0]%V[0],y:k[1]%V[1],width:V[0],height:V[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${U[0]},-${U[1]})`,children:I?h.jsx(Q_,{radius:P/2,className:_}):h.jsx(X_,{dimensions:B,lineWidth:l,variant:r,className:_})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${W})`})]})}kg.displayName="Background";const Z_=D.memo(kg);function eS(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:h.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function tS(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:h.jsx("path",{d:"M0 0h32v4.2H0z"})})}function nS(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:h.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function rS(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function oS(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function eu({children:t,className:r,...o}){return h.jsx("button",{type:"button",className:en(["react-flow__controls-button",r]),...o,children:t})}const sS=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function _g({style:t,showZoom:r=!0,showFitView:o=!0,showInteractive:i=!0,fitViewOptions:l,onZoomIn:c,onZoomOut:f,onFitView:m,onInteractiveChange:y,className:b,children:_,position:v="bottom-left",orientation:k="vertical","aria-label":j}){const C=Lt(),{isInteractive:I,minZoomReached:A,maxZoomReached:T,ariaLabelConfig:V}=kt(sS,Ft),{zoomIn:P,zoomOut:M,fitView:B}=af(),U=()=>{P(),c==null||c()},W=()=>{M(),f==null||f()},Z=()=>{B(l),m==null||m()},fe=()=>{C.setState({nodesDraggable:!I,nodesConnectable:!I,elementsSelectable:!I}),y==null||y(!I)},Se=k==="horizontal"?"horizontal":"vertical";return h.jsxs(Ua,{className:en(["react-flow__controls",Se,b]),position:v,style:t,"data-testid":"rf__controls","aria-label":j??V["controls.ariaLabel"],children:[r&&h.jsxs(h.Fragment,{children:[h.jsx(eu,{onClick:U,className:"react-flow__controls-zoomin",title:V["controls.zoomIn.ariaLabel"],"aria-label":V["controls.zoomIn.ariaLabel"],disabled:T,children:h.jsx(eS,{})}),h.jsx(eu,{onClick:W,className:"react-flow__controls-zoomout",title:V["controls.zoomOut.ariaLabel"],"aria-label":V["controls.zoomOut.ariaLabel"],disabled:A,children:h.jsx(tS,{})})]}),o&&h.jsx(eu,{className:"react-flow__controls-fitview",onClick:Z,title:V["controls.fitView.ariaLabel"],"aria-label":V["controls.fitView.ariaLabel"],children:h.jsx(nS,{})}),i&&h.jsx(eu,{className:"react-flow__controls-interactive",onClick:fe,title:V["controls.interactive.ariaLabel"],"aria-label":V["controls.interactive.ariaLabel"],children:I?h.jsx(oS,{}):h.jsx(rS,{})}),_]})}_g.displayName="Controls";const iS=D.memo(_g);function aS({id:t,x:r,y:o,width:i,height:l,style:c,color:f,strokeColor:m,strokeWidth:y,className:b,borderRadius:_,shapeRendering:v,selected:k,onClick:j}){const{background:C,backgroundColor:I}=c||{},A=f||C||I;return h.jsx("rect",{className:en(["react-flow__minimap-node",{selected:k},b]),x:r,y:o,rx:_,ry:_,width:i,height:l,style:{fill:A,stroke:m,strokeWidth:y},shapeRendering:v,onClick:j?T=>j(T,t):void 0})}const lS=D.memo(aS),uS=t=>t.nodes.map(r=>r.id),wd=t=>t instanceof Function?t:()=>t;function cS({nodeStrokeColor:t,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:l,nodeComponent:c=lS,onClick:f}){const m=kt(uS,Ft),y=wd(r),b=wd(t),_=wd(o),v=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:m.map(k=>h.jsx(fS,{id:k,nodeColorFunc:y,nodeStrokeColorFunc:b,nodeClassNameFunc:_,nodeBorderRadius:i,nodeStrokeWidth:l,NodeComponent:c,onClick:f,shapeRendering:v},k))})}function dS({id:t,nodeColorFunc:r,nodeStrokeColorFunc:o,nodeClassNameFunc:i,nodeBorderRadius:l,nodeStrokeWidth:c,shapeRendering:f,NodeComponent:m,onClick:y}){const{node:b,x:_,y:v,width:k,height:j}=kt(C=>{const I=C.nodeLookup.get(t);if(!I)return{node:void 0,x:0,y:0,width:0,height:0};const A=I.internals.userNode,{x:T,y:V}=I.internals.positionAbsolute,{width:P,height:M}=Bo(A);return{node:A,x:T,y:V,width:P,height:M}},Ft);return!b||b.hidden||!_0(b)?null:h.jsx(m,{x:_,y:v,width:k,height:j,style:b.style,selected:!!b.selected,className:i(b),color:r(b),borderRadius:l,strokeColor:o(b),strokeWidth:c,shapeRendering:f,onClick:y,id:b.id})}const fS=D.memo(dS);var pS=D.memo(cS);const hS=200,mS=150,gS=t=>!t.hidden,yS=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?k0(Fa(t.nodeLookup,{filter:gS}),r):r,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},xS="react-flow__minimap-desc";function Sg({style:t,className:r,nodeStrokeColor:o,nodeColor:i,nodeClassName:l="",nodeBorderRadius:c=5,nodeStrokeWidth:f,nodeComponent:m,bgColor:y,maskColor:b,maskStrokeColor:_,maskStrokeWidth:v,position:k="bottom-right",onClick:j,onNodeClick:C,pannable:I=!1,zoomable:A=!1,ariaLabel:T,inversePan:V,zoomStep:P=1,offsetScale:M=5}){const B=Lt(),U=D.useRef(null),{boundingRect:W,viewBB:Z,rfId:fe,panZoom:Se,translateExtent:X,flowWidth:de,flowHeight:be,ariaLabelConfig:z}=kt(yS,Ft),ue=(t==null?void 0:t.width)??hS,Q=(t==null?void 0:t.height)??mS,ie=W.width/ue,H=W.height/Q,q=Math.max(ie,H),J=q*ue,O=q*Q,K=M*q,ke=W.x-(J-W.width)/2-K,Ne=W.y-(O-W.height)/2-K,Ae=J+K*2,Oe=O+K*2,Re=`${xS}-${fe}`,_e=D.useRef(0),ze=D.useRef();_e.current=q,D.useEffect(()=>{if(U.current&&Se)return ze.current=$b({domNode:U.current,panZoom:Se,getTransform:()=>B.getState().transform,getViewScale:()=>_e.current}),()=>{var Ke;(Ke=ze.current)==null||Ke.destroy()}},[Se]),D.useEffect(()=>{var Ke;(Ke=ze.current)==null||Ke.update({translateExtent:X,width:de,height:be,inversePan:V,pannable:I,zoomStep:P,zoomable:A})},[I,A,V,P,X,de,be]);const Ee=j?Ke=>{var we;const[ct,dt]=((we=ze.current)==null?void 0:we.pointer(Ke))||[0,0];j(Ke,{x:ct,y:dt})}:void 0,Ze=C?D.useCallback((Ke,ct)=>{const dt=B.getState().nodeLookup.get(ct).internals.userNode;C(Ke,dt)},[]):void 0,He=T??z["minimap.ariaLabel"];return h.jsx(Ua,{position:k,style:{...t,"--xy-minimap-background-color-props":typeof y=="string"?y:void 0,"--xy-minimap-mask-background-color-props":typeof b=="string"?b:void 0,"--xy-minimap-mask-stroke-color-props":typeof _=="string"?_:void 0,"--xy-minimap-mask-stroke-width-props":typeof v=="number"?v*q:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-width-props":typeof f=="number"?f:void 0},className:en(["react-flow__minimap",r]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:ue,height:Q,viewBox:`${ke} ${Ne} ${Ae} ${Oe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Re,ref:U,onClick:Ee,children:[He&&h.jsx("title",{id:Re,children:He}),h.jsx(pS,{onClick:Ze,nodeColor:i,nodeStrokeColor:o,nodeBorderRadius:c,nodeClassName:l,nodeStrokeWidth:f,nodeComponent:m}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${ke-K},${Ne-K}h${Ae+K*2}v${Oe+K*2}h${-Ae-K*2}z
|
|
202
|
+
M${Z.x},${Z.y}h${Z.width}v${Z.height}h${-Z.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Sg.displayName="MiniMap";const vS=D.memo(Sg),wS=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,bS={[Bi.Line]:"right",[Bi.Handle]:"bottom-right"};function kS({nodeId:t,position:r,variant:o=Bi.Handle,className:i,style:l=void 0,children:c,color:f,minWidth:m=10,minHeight:y=10,maxWidth:b=Number.MAX_VALUE,maxHeight:_=Number.MAX_VALUE,keepAspectRatio:v=!1,resizeDirection:k,autoScale:j=!0,shouldResize:C,onResizeStart:I,onResize:A,onResizeEnd:T}){const V=ng(),P=typeof t=="string"?t:V,M=Lt(),B=D.useRef(null),U=o===Bi.Handle,W=kt(D.useCallback(wS(U&&j),[U,j]),Ft),Z=D.useRef(null),fe=r??bS[o];D.useEffect(()=>{if(!(!B.current||!P))return Z.current||(Z.current=Wb({domNode:B.current,nodeId:P,getStoreItems:()=>{const{nodeLookup:X,transform:de,snapGrid:be,snapToGrid:z,nodeOrigin:ue,domNode:Q}=M.getState();return{nodeLookup:X,transform:de,snapGrid:be,snapToGrid:z,nodeOrigin:ue,paneDomNode:Q}},onChange:(X,de)=>{const{triggerNodeChanges:be,nodeLookup:z,parentLookup:ue,nodeOrigin:Q}=M.getState(),ie=[],H={x:X.x,y:X.y},q=z.get(P);if(q&&q.expandParent&&q.parentId){const J=q.origin??Q,O=X.width??q.measured.width??0,K=X.height??q.measured.height??0,ke={id:q.id,parentId:q.parentId,rect:{width:O,height:K,...S0({x:X.x??q.position.x,y:X.y??q.position.y},{width:O,height:K},q.parentId,z,J)}},Ne=sf([ke],z,ue,Q);ie.push(...Ne),H.x=X.x?Math.max(J[0]*O,X.x):void 0,H.y=X.y?Math.max(J[1]*K,X.y):void 0}if(H.x!==void 0&&H.y!==void 0){const J={id:P,type:"position",position:{...H}};ie.push(J)}if(X.width!==void 0&&X.height!==void 0){const O={id:P,type:"dimensions",resizing:!0,setAttributes:k?k==="horizontal"?"width":"height":!0,dimensions:{width:X.width,height:X.height}};ie.push(O)}for(const J of de){const O={...J,type:"position"};ie.push(O)}be(ie)},onEnd:({width:X,height:de})=>{const be={id:P,type:"dimensions",resizing:!1,dimensions:{width:X,height:de}};M.getState().triggerNodeChanges([be])}})),Z.current.update({controlPosition:fe,boundaries:{minWidth:m,minHeight:y,maxWidth:b,maxHeight:_},keepAspectRatio:v,resizeDirection:k,onResizeStart:I,onResize:A,onResizeEnd:T,shouldResize:C}),()=>{var X;(X=Z.current)==null||X.destroy()}},[fe,m,y,b,_,v,I,A,T,C]);const Se=fe.split("-");return h.jsx("div",{className:en(["react-flow__resize-control","nodrag",...Se,o,i]),ref:B,style:{...l,scale:W,...f&&{[U?"backgroundColor":"borderColor"]:f}},children:c})}D.memo(kS);const _S={get:"bg-emerald-500/20 text-emerald-200 border-emerald-500/45",post:"bg-sky-500/20 text-sky-200 border-sky-500/45",put:"bg-amber-500/20 text-amber-200 border-amber-500/45",patch:"bg-violet-500/20 text-violet-200 border-violet-500/45",delete:"bg-rose-500/20 text-rose-200 border-rose-500/45",head:"bg-slate-500/25 text-slate-300 border-slate-500/45",options:"bg-slate-500/25 text-slate-300 border-slate-500/45",trace:"bg-slate-500/25 text-slate-300 border-slate-500/45"};function Ii({method:t,className:r="",size:o="sm"}){const i=t.toLowerCase().trim(),l=_S[i]??"bg-accent/15 text-accent border-accent/40",c=o==="md"?"text-xs px-2.5 py-1 min-w-[3.25rem] justify-center":"text-[10px] px-1.5 py-0.5 min-w-[2.75rem] justify-center";return h.jsx("span",{className:`inline-flex items-center rounded-md font-semibold uppercase tracking-wide border shrink-0 transition-colors duration-200 ${l} ${c} ${r}`,children:t.toUpperCase()})}function uf(t,r,o){var c,f;const i=r.toLowerCase(),l=(f=(c=t.paths)==null?void 0:c[o])==null?void 0:f[i];return(l==null?void 0:l.summary)??(l==null?void 0:l.operationId)??`${r.toUpperCase()} ${o}`}function cf(t,r,o){var m,y,b,_;const i=r.toLowerCase(),l=(y=(m=t.paths)==null?void 0:m[o])==null?void 0:y[i];if(!(l!=null&&l.requestBody))return"— sin body";const f=(_=(b=l.requestBody.content)==null?void 0:b["application/json"])==null?void 0:_.schema;return f&&"$ref"in f?`body: ${f.$ref}`:"body: JSON"}function df(t,r,o){var m,y,b,_,v,k;const i=r.toLowerCase(),l=(y=(m=t.paths)==null?void 0:m[o])==null?void 0:y[i],c=((b=l==null?void 0:l.responses)==null?void 0:b["200"])??((_=l==null?void 0:l.responses)==null?void 0:_["201"]);if(!c)return"—";const f=typeof c=="object"&&c&&"content"in c?(k=(v=c.content)==null?void 0:v["application/json"])==null?void 0:k.schema:void 0;return f&&"$ref"in f?String(f.$ref):"JSON"}const du=()=>({sourceJsonPath:"$",variableName:"v",useInTarget:"vars_only",targetKey:""});function bd(t,r){return`${t.toLowerCase()} ${r}`}function SS(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}const Ng=D.createContext(null);function NS(t){const{id:r,selected:o}=t,i=t.data,l=D.useContext(Ng),c=q_();return D.useEffect(()=>{c(r)},[i.path,i.method,r,c]),h.jsxs("div",{className:`rounded-xl border bg-surface-950/90 px-3 py-2 min-w-[200px] max-w-[280px] shadow-lg ${o?"border-accent ring-2 ring-accent/40":"border-surface-600"}`,children:[h.jsx(Fi,{type:"target",position:rt.Left,id:"in",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-teal-500"}),h.jsxs("div",{className:"flex items-center gap-2 mb-1 min-w-0",children:[h.jsx(Ii,{method:i.method}),h.jsx("span",{className:"text-[10px] text-slate-500 truncate",title:i.summary,children:i.summary})]}),l?h.jsxs("label",{className:"block text-[10px] text-slate-500 mb-1",children:["Endpoint",h.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:bd(i.method,i.path),onChange:f=>{const{method:m,path:y}=SS(f.target.value);l.updateNodeData(r,{method:m,path:y,summary:uf(l.doc,m,y),reqHint:cf(l.doc,m,y),resHint:df(l.doc,m,y)})},children:l.ops.map(f=>h.jsxs("option",{value:bd(f.method,f.path),children:[f.method.toUpperCase()," ",f.path]},bd(f.method,f.path)))})]}):h.jsx("p",{className:"font-mono text-[11px] text-slate-300 truncate",children:i.path}),h.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-1 text-[9px] text-slate-500 leading-tight",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-slate-600",children:"req"})," ",i.reqHint]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-slate-600",children:"res"})," ",i.resHint]})]}),h.jsx(Fi,{type:"source",position:rt.Right,id:"out",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-amber-500"})]})}const ES={apiOp:NS};function jS(t,r){const o=r.nodes.map(l=>({id:l.id,type:"apiOp",position:{x:l.x,y:l.y},data:{method:l.method.toLowerCase(),path:l.path,summary:uf(t,l.method,l.path),reqHint:cf(t,l.method,l.path),resHint:df(t,l.method,l.path)}})),i=r.edges.map(l=>({id:l.id,source:l.source,target:l.target,sourceHandle:"out",targetHandle:"in",data:{mapping:{...l.mapping}},label:l.mapping.variableName,style:{stroke:"rgb(148 163 184 / 0.9)",strokeWidth:2}}));return{nodes:o,edges:i}}function CS(t,r){return{nodes:t.map(o=>({id:o.id,method:o.data.method,path:o.data.path,x:o.position.x,y:o.position.y})),edges:r.map(o=>{var i;return{id:o.id,source:o.source,target:o.target,mapping:((i=o.data)==null?void 0:i.mapping)??du()}})}}const PS=[{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 MS({doc:t,ops:r,graph:o,onGraphChange:i}){var P,M,B,U,W,Z,fe,Se;const l=D.useMemo(()=>jS(t,o),[t,o]),[c,f,m]=W_(l.nodes),[y,b,_]=Y_(l.edges),[v,k]=D.useState(null);D.useEffect(()=>{i(CS(c,y))},[c,y,i]);const j=D.useCallback((X,de)=>{f(be=>be.map(z=>z.id===X?{...z,data:{...z.data,...de}}:z))},[f]),C=D.useMemo(()=>({doc:t,ops:r,updateNodeData:j}),[t,r,j]),I=D.useCallback(X=>{X.sourceHandle!=="out"||X.targetHandle!=="in"||b(de=>T0({...X,id:`e-${X.source}-${X.target}-${crypto.randomUUID().slice(0,8)}`,sourceHandle:"out",targetHandle:"in",data:{mapping:du()},label:du().variableName,style:{stroke:"rgb(148 163 184 / 0.9)",strokeWidth:2}},de))},[b]),A=y.find(X=>X.id===v),T=X=>{v&&b(de=>de.map(be=>{var ue;if(be.id!==v)return be;const z={...((ue=be.data)==null?void 0:ue.mapping)??du(),...X};return{...be,data:{mapping:z},label:z.variableName}}))},V=()=>{const X=c.reduce((ie,H)=>H.position.x>ie?H.position.x:ie,0),de=r[0];if(!de)return;const be=crypto.randomUUID(),z=X>0?X+40:80,Q={id:be,type:"apiOp",position:{x:z,y:120},data:{method:de.method.toLowerCase(),path:de.path,summary:uf(t,de.method,de.path),reqHint:cf(t,de.method,de.path),resHint:df(t,de.method,de.path)}};f(ie=>[...ie,Q])};return h.jsx(Ng.Provider,{value:C,children:h.jsxs("div",{className:"space-y-3",children:[h.jsx("div",{className:"h-[min(520px,70vh)] w-full rounded-xl border border-surface-700 bg-surface-950",children:h.jsxs(K_,{nodes:c,edges:y,onNodesChange:m,onEdgesChange:_,onConnect:I,nodeTypes:ES,onEdgeClick:(X,de)=>k(de.id),onPaneClick:()=>k(null),fitView:!0,minZoom:.4,maxZoom:1.5,proOptions:{hideAttribution:!0},isValidConnection:X=>X.sourceHandle==="out"&&X.targetHandle==="in",children:[h.jsx(Z_,{variant:Do.Dots,gap:16,size:1,color:"rgb(51 65 85 / 0.5)"}),h.jsx(iS,{className:"!bg-surface-900 !border-surface-600 !shadow-lg"}),h.jsx(vS,{className:"!bg-surface-900/95 !border-surface-600",nodeColor:()=>"rgb(45 212 191 / 0.5)"}),h.jsx(Ua,{position:"top-left",children:h.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)"})})]})}),h.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[h.jsx("h4",{className:"text-xs font-semibold text-slate-300",children:"Cable seleccionado (respuesta → request)"}),A?h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 text-xs",children:[h.jsxs("label",{className:"text-slate-500",children:["JSON path en la respuesta",h.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((P=A.data)==null?void 0:P.mapping.sourceJsonPath)??"$",onChange:X=>T({sourceJsonPath:X.target.value}),placeholder:"$.access_token"})]}),h.jsxs("label",{className:"text-slate-500",children:["Nombre de variable",h.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((M=A.data)==null?void 0:M.mapping.variableName)??"",onChange:X=>T({variableName:X.target.value}),placeholder:"token"})]}),h.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Cómo se usa en el request del nodo destino",h.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5",value:((B=A.data)==null?void 0:B.mapping.useInTarget)??"vars_only",onChange:X=>T({useInTarget:X.target.value}),children:PS.map(X=>h.jsx("option",{value:X.value,children:X.label},X.value))})]}),(((U=A.data)==null?void 0:U.mapping.useInTarget)==="path_param"||((W=A.data)==null?void 0:W.mapping.useInTarget)==="header"||((Z=A.data)==null?void 0:Z.mapping.useInTarget)==="query")&&h.jsxs("label",{className:"text-slate-500 sm:col-span-2",children:["Clave (nombre del param / header / query)",h.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-2 py-1.5 font-mono",value:((fe=A.data)==null?void 0:fe.mapping.targetKey)??"",onChange:X=>T({targetKey:X.target.value}),placeholder:"id / Authorization / q"})]}),h.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"," ",h.jsx("code",{className:"text-accent",children:"{clave}"}),", en un header, o en query. Con «solo variable», usa"," ",h.jsx("code",{className:"text-accent",children:"{"+(((Se=A.data)==null?void 0:Se.mapping.variableName)||"var")+"}"})," ","en la ruta del endpoint destino."]})]}):h.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 Eg(t,r){const o=new Map(t.map(y=>[y.id,y])),i=new Set(t.map(y=>y.id)),l=new Map,c=new Map;for(const y of i)l.set(y,0),c.set(y,[]);for(const y of r)!i.has(y.source)||!i.has(y.target)||(l.set(y.target,(l.get(y.target)??0)+1),c.get(y.source).push(y.target));const f=[];for(const[y,b]of l)b===0&&f.push(y);f.sort((y,b)=>o.get(y).x-o.get(b).x||o.get(y).y-o.get(b).y);const m=[];for(;f.length;){const y=f.shift();m.push(y);for(const b of c.get(y)??[]){const _=(l.get(b)??0)-1;l.set(b,_),_===0&&(f.push(b),f.sort((v,k)=>o.get(v).x-o.get(k).x||o.get(v).y-o.get(k).y))}}if(m.length<t.length){const y=t.filter(b=>!m.includes(b.id)).sort((b,_)=>b.x-_.x||b.y-_.y);return[...m.map(b=>o.get(b)),...y]}return m.map(y=>o.get(y))}async function vm(t,r,o){var y;const{nodes:i,edges:l}=t;if(i.length===0)return"Sin nodos en el flujo.";const c=Eg(i,l),f={};let m="";for(let b=0;b<c.length;b++){const _=c[b];let v=_.path;const k={...o()},j=l.filter(B=>B.target===_.id);for(const B of j){const{mapping:U}=B,W=f[U.variableName];if(W!==void 0)switch(U.useInTarget){case"path_param":U.targetKey&&(v=v.split(`{${U.targetKey}}`).join(W));break;case"header":if(U.targetKey){const Z=U.targetKey;k[Z]=Z.toLowerCase()==="authorization"&&!W.startsWith("Bearer ")?`Bearer ${W}`:W}break;case"query":{const Z=v.includes("?")?"&":"?";v=`${v}${Z}${encodeURIComponent(U.targetKey)}=${encodeURIComponent(W)}`;break}case"vars_only":default:v=v.split(`{${U.variableName}}`).join(W);break}}for(const[B,U]of Object.entries(f))v=v.split(`{${B}}`).join(U);const C=`${r.replace(/\/$/,"")}${v}`,I={method:_.method.toUpperCase(),headers:k},A=_.method.toLowerCase();A!=="get"&&A!=="head"&&(I.body="{}");const T=await fetch(C,{...I,credentials:"include"});let V={};const P=await T.text();try{V=P?JSON.parse(P):{}}catch{V={_raw:P}}m+=`▸ ${_.method.toUpperCase()} ${_.path} → ${T.status}
|
|
203
|
+
${JSON.stringify(V,null,2)}
|
|
204
|
+
|
|
205
|
+
`;const M=l.filter(B=>B.source===_.id);for(const B of M){const U=((y=B.mapping.sourceJsonPath)==null?void 0:y.trim())||"$",W=Vd(V,U);W!=null&&(f[B.mapping.variableName]=typeof W=="object"?JSON.stringify(W):String(W))}}return m+=`
|
|
206
|
+
Variables finales: ${JSON.stringify(f,null,2)}`,m}function TS(t){const r=Eg(t.nodes,t.edges);return r.map((o,i)=>{const l=r[i+1];if(!l)return{method:o.method,path:o.path};const c=t.edges.find(f=>f.source===o.id&&f.target===l.id);return c?{method:o.method,path:o.path,extract:{varName:c.mapping.variableName,jsonPath:c.mapping.sourceJsonPath||"$"}}:{method:o.method,path:o.path}})}function IS(t){var i;const r=t.map((l,c)=>({id:`n-${c}`,method:l.method,path:l.path,x:40+c*300,y:120})),o=[];for(let l=0;l<t.length-1;l++){const c=(i=t[l])==null?void 0:i.extract;c!=null&&c.jsonPath&&o.push({id:`e-${l}`,source:`n-${l}`,target:`n-${l+1}`,mapping:{sourceJsonPath:c.jsonPath,variableName:c.varName,useInTarget:"vars_only",targetKey:""}})}return{nodes:r,edges:o}}const jg=D.createContext({productName:null,logoDataUrl:null});function $S({value:t,children:r}){return h.jsx(jg.Provider,{value:t,children:r})}function AS(){return D.useContext(jg)}function OS({data:t,defaultOpenDepth:r=3}){return h.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:h.jsx(ff,{value:t,depth:0,defaultOpenDepth:r})})}function ff({value:t,depth:r,defaultOpenDepth:o,name:i}){return t===null||typeof t!="object"?h.jsx(RS,{name:i,value:t}):Array.isArray(t)?h.jsx(LS,{name:i,value:t,depth:r,defaultOpenDepth:o}):h.jsx(DS,{name:i,value:t,depth:r,defaultOpenDepth:o})}function RS({name:t,value:r}){return h.jsxs("div",{className:"pl-1 break-all",children:[t!=null&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),h.jsx("span",{className:"text-slate-500",children:": "})]}),h.jsx("span",{className:"text-emerald-200/95",children:JSON.stringify(r)})]})}function LS({name:t,value:r,depth:o,defaultOpenDepth:i}){const l=o<i,[c,f]=D.useState(l);return r.length===0?h.jsxs("div",{className:"pl-1",children:[t!=null&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),h.jsx("span",{className:"text-slate-500",children:": "})]}),h.jsx("span",{className:"text-slate-500",children:"[]"})]}):h.jsxs("div",{className:"pl-1",children:[t!=null&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),h.jsx("span",{className:"text-slate-500",children:": "})]}),h.jsx("button",{type:"button","aria-expanded":c,onClick:()=>f(!c),className:"inline align-middle text-slate-400 hover:text-slate-200 mr-1 select-none w-4",children:c?"▼":"▶"}),h.jsx("span",{className:"text-slate-500",children:"["}),h.jsx("span",{className:"text-slate-600 text-[10px] ml-1",children:r.length}),c&&h.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,y)=>h.jsxs("li",{children:[h.jsx("span",{className:"text-violet-400/90 mr-1",children:y}),h.jsx(ff,{value:m,depth:o+1,defaultOpenDepth:i})]},y))}),!c&&h.jsx("span",{className:"text-slate-600",children:" … "}),h.jsx("span",{className:"text-slate-500",children:"]"})]})}function DS({name:t,value:r,depth:o,defaultOpenDepth:i}){const l=Object.keys(r),c=o<i,[f,m]=D.useState(c);return l.length===0?h.jsxs("div",{className:"pl-1",children:[t!=null&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),h.jsx("span",{className:"text-slate-500",children:": "})]}),h.jsx("span",{className:"text-slate-500",children:"{}"})]}):h.jsxs("div",{className:"pl-1",children:[t!=null&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-sky-300/95",children:JSON.stringify(t)}),h.jsx("span",{className:"text-slate-500",children:": "})]}),h.jsx("button",{type:"button","aria-expanded":f,onClick:()=>m(!f),className:"inline align-middle text-slate-400 hover:text-slate-200 mr-1 select-none w-4",children:f?"▼":"▶"}),h.jsx("span",{className:"text-slate-500",children:"{"}),h.jsx("span",{className:"text-slate-600 text-[10px] ml-1",children:l.length}),f&&h.jsx("ul",{className:"list-none my-0.5 ml-4 border-l border-surface-600 pl-2 space-y-0.5",children:l.map(y=>h.jsx("li",{children:h.jsx(ff,{name:y,value:r[y],depth:o+1,defaultOpenDepth:i})},y))}),!f&&h.jsx("span",{className:"text-slate-600",children:" … "}),h.jsx("span",{className:"text-slate-500",children:"}"})]})}function pf(t,r){if(!r.startsWith("#/"))return;const o=r.slice(2).split("/");let i=t;for(const l of o)if(i&&typeof i=="object"&&l in i)i=i[l];else return;return i}function zS(t,r){return"$ref"in r?pf(t,r.$ref):r}function wm(t,r){return"$ref"in r?pf(t,r.$ref):r}function Cg(t,r,o){var b;const i=(b=t.paths)==null?void 0:b[o],l=i==null?void 0:i[r.toLowerCase()];if(!l)return[];const c=(i==null?void 0:i.parameters)??[],f=l.parameters??[],m=new Set,y=[];for(const _ of[...c,...f]){const v=zS(t,_);if(!v||!["query","path","header","cookie"].includes(v.in))continue;const k=`${v.in}:${v.name}`;m.has(k)||(m.add(k),y.push({name:v.name,in:v.in,required:!!v.required,description:typeof v.description=="string"?v.description:void 0}))}return y}function fu(t,r,o){var y,b,_,v;const i=(b=(y=t.paths)==null?void 0:y[o])==null?void 0:b[r.toLowerCase()];if(!(i!=null&&i.requestBody))return null;const l=i.requestBody,c="$ref"in l?pf(t,l.$ref):l;if(!((v=(_=c==null?void 0:c.content)==null?void 0:_["application/json"])!=null&&v.schema))return null;const f=c.content["application/json"].schema,m=wm(t,f);if(!m)return null;if(m.type==="object"&&m.properties&&Object.keys(m.properties).length>0){const k=new Set(m.required??[]);return Object.keys(m.properties).map(j=>{const C=m.properties[j],I=C&&"$ref"in C?wm(t,C):C;return{key:j,required:k.has(j),description:I==null?void 0:I.description,format:I==null?void 0:I.format,type:I==null?void 0:I.type}})}return null}function BS(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function FS(t,r){let o=t;for(const[i,l]of Object.entries(r))o=o.replace(new RegExp(`\\{${BS(i)}\\}`,"g"),encodeURIComponent(l));return o}function HS(t,r){const o=new URLSearchParams;for(const l of r){if(l.in!=="query")continue;const c=t[l.name];c!==void 0&&c!==""&&o.set(l.name,c)}const i=o.toString();return i?`?${i}`:""}function Pg(t,r){var i;if(!(t!=null&&t.length))return{};const o={};for(const l of t){const c=((i=r[l.key])==null?void 0:i.trim())??"";if(c==="")continue;const f=l.type;if(f==="integer"||f==="number"){const m=Number(c);o[l.key]=Number.isFinite(m)?m:c}else if(f==="boolean")o[l.key]=c==="true"||c==="1";else try{o[l.key]=JSON.parse(c)}catch{o[l.key]=c}}return o}function bm(t,r){const o=Pg(t,r);return JSON.stringify(o,null,2)}function VS(t,r){if(!(t!=null&&t.length))return{};try{const o=JSON.parse(r||"{}"),i={};for(const l of t)if(l.key in o&&o[l.key]!==void 0){const c=o[l.key];i[l.key]=typeof c=="string"?c:JSON.stringify(c)}else i[l.key]="";return i}catch{return Object.fromEntries(t.map(o=>[o.key,""]))}}function US(t){return/\{[^/}]+\}/.test(t)}function KS(t,r,o,i,l){var m,y;const c={...t};for(const b of r){const _=(m=o[b.name])==null?void 0:m.trim();_&&(c[b.name]=_)}const f=[];for(const b of i){const _=(y=l[b.name])==null?void 0:y.trim();_&&f.push(`${b.name}=${_}`)}return f.length&&(c.Cookie=c.Cookie?`${c.Cookie}; ${f.join("; ")}`:f.join("; ")),c}function km(t,r,o,i,l){var P,M,B,U,W;const c=Cg(t,r.method,r.path),f=c.filter(Z=>Z.in==="path"),m=c.filter(Z=>Z.in==="query"),y=c.filter(Z=>Z.in==="header"),b=c.filter(Z=>Z.in==="cookie"),_=fu(t,r.method,r.path),v=r.method.toLowerCase(),k=v!=="get"&&v!=="head";for(const Z of f)if(Z.required&&!((P=l.pathVals[Z.name])!=null&&P.trim()))return{ok:!1,error:`Parámetro de ruta obligatorio: ${Z.name}`};for(const Z of m)if(Z.required&&!((M=l.queryVals[Z.name])!=null&&M.trim()))return{ok:!1,error:`Query obligatorio: ${Z.name}`};for(const Z of y)if(Z.required&&!((B=l.headerVals[Z.name])!=null&&B.trim()))return{ok:!1,error:`Header obligatorio: ${Z.name}`};for(const Z of b)if(Z.required&&!((U=l.cookieVals[Z.name])!=null&&U.trim()))return{ok:!1,error:`Cookie obligatorio: ${Z.name}`};let j=FS(r.path,l.pathVals);if(US(j))return{ok:!1,error:"Quedan placeholders `{…}` en la ruta sin valor."};const C=HS(l.queryVals,c),A=`${Ro(t,o)}${j}${C}`,T=KS(i(),y,l.headerVals,b,l.cookieVals);let V;if(k)if(l.bodyMode==="fields"&&(_!=null&&_.length)){for(const fe of _)if(fe.required&&!((W=l.bodyVals[fe.key])!=null&&W.trim()))return{ok:!1,error:`Campo de body obligatorio: ${fe.key}`};const Z=Pg(_,l.bodyVals);V=JSON.stringify(Z)}else V=l.tryBodyRaw.trim()||"{}";return{ok:!0,url:A,headers:T,body:V,method:r.method.toUpperCase()}}function tu(t){return`'${t.replace(/'/g,"'\\''")}'`}function qS(t){const r={};return t.forEach((o,i)=>{r[i]=o}),r}function WS(t){const r=["curl","-sS","-X",tu(t.method)],o=Object.entries(t.headers);o.sort(([i],[l])=>i.localeCompare(l));for(const[i,l]of o)r.push("-H",tu(`${i}: ${l}`));return t.body!==void 0&&t.body!==""&&r.push("--data",tu(t.body)),r.push(tu(t.url)),r.join(" ")}function kd(t,r,o){var f;const i=r.toLowerCase(),l=(f=t.paths)==null?void 0:f[o];if(!l||typeof l!="object"||"$ref"in l)return!1;const c=l[i];return(c==null?void 0:c.deprecated)===!0}function YS(t,r,o,i,l,c,f){return{pathVals:{...t},queryVals:{...r},headerVals:{...o},cookieVals:{...i},bodyMode:l,tryBodyRaw:c,bodyVals:{...f}}}function XS({doc:t,selectedOp:r,baseUrl:o,buildHeaders:i,hydrateEntry:l,onHydrateConsumed:c}){const[f,m]=D.useState({}),[y,b]=D.useState({}),[_,v]=D.useState({}),[k,j]=D.useState({}),[C,I]=D.useState({}),[A,T]=D.useState("{}"),[V,P]=D.useState("raw"),[M,B]=D.useState(null),[U,W]=D.useState(null),[Z,fe]=D.useState(null),[Se,X]=D.useState([]),[de,be]=D.useState(""),[z,ue]=D.useState(null),Q=D.useMemo(()=>Cg(t,r.method,r.path),[t,r.method,r.path]),ie=D.useMemo(()=>Q.filter(we=>we.in==="path"),[Q]),H=D.useMemo(()=>Q.filter(we=>we.in==="query"),[Q]),q=D.useMemo(()=>Q.filter(we=>we.in==="header"),[Q]),J=D.useMemo(()=>Q.filter(we=>we.in==="cookie"),[Q]),O=D.useMemo(()=>fu(t,r.method,r.path),[t,r.method,r.path]),K=r.method.toLowerCase(),ke=K!=="get"&&K!=="head",Ne=D.useCallback(async()=>{const we=await lx(r.method,r.path);X(we.sort((tt,_t)=>tt.name.localeCompare(_t.name)))},[r.method,r.path]);D.useEffect(()=>{Ne()},[Ne]),D.useEffect(()=>{m({}),b({}),v({}),j({}),W(null),B(null),ue(null);const we=fu(t,r.method,r.path);we!=null&&we.length?(I(Object.fromEntries(we.map(tt=>[tt.key,""]))),P("fields"),T(bm(we,{}))):(I({}),P("raw"),T("{}"))},[t,r.method,r.path]),D.useEffect(()=>{if(!l)return;if(!(l.method.toLowerCase()===r.method.toLowerCase()&&l.path===r.path)){c==null||c();return}const tt=l.tryForm;if(tt){m({...tt.pathVals}),b({...tt.queryVals}),v({...tt.headerVals}),j({...tt.cookieVals}),P(tt.bodyMode),T(tt.tryBodyRaw);const _t=fu(t,r.method,r.path);if(_t!=null&&_t.length&&tt.bodyMode==="fields"){const Ct={};for(const xt of _t)Ct[xt.key]=tt.bodyVals[xt.key]??"";I(Ct)}else I({...tt.bodyVals});W(null),B(null)}c==null||c()},[l,r.method,r.path,t,c]);const Ae=D.useCallback((we,tt)=>{I(_t=>({..._t,[we]:tt}))},[]),Oe=D.useCallback(()=>{O!=null&&O.length&&T(bm(O,C)),P("raw")},[O,C]),Re=D.useCallback(()=>{O!=null&&O.length&&I(VS(O,A)),P("fields")},[O,A]),_e=D.useMemo(()=>({pathVals:f,queryVals:y,headerVals:_,cookieVals:k,bodyVals:C,tryBodyRaw:A,bodyMode:V}),[f,y,_,k,C,A,V]),ze=async()=>{W(null);const we=km(t,r,o,i,_e);if(!we.ok){W(we.error);return}const tt={method:we.method,headers:we.headers,credentials:"include"};we.body!==void 0&&(tt.body=we.body);const _t=YS(f,y,_,k,V,A,C),Ct={at:new Date().toISOString(),method:r.method,path:r.path,baseUrl:o,url:we.url,requestHeaders:{...we.headers},requestBody:we.body??null,credentials:"include",tryForm:_t};try{const xt=await fetch(we.url,tt),vt=await xt.text();let It=null;try{It=vt?JSON.parse(vt):null}catch{It=null}B({status:xt.status,statusText:xt.statusText,bodyText:vt,json:It});try{await fh({...Ct,status:xt.status,statusText:xt.statusText,responseHeaders:qS(xt.headers),responseBodyText:vt})}catch{}}catch(xt){B(null);const vt=xt instanceof Error?xt.message:String(xt);W(vt);try{await fh({...Ct,networkError:vt})}catch{}}},Ee=async()=>{ue(null);const we=de.trim();if(!we){ue("Escribe un nombre para la plantilla.");return}await ux({name:we,method:r.method,path:r.path,pathVals:{...f},queryVals:{...y},headerVals:{..._},cookieVals:{...k},bodyMode:V,tryBodyRaw:A,bodyVals:{...C}}),be(""),ue("Plantilla guardada."),await Ne(),window.setTimeout(()=>ue(null),2500)},Ze=we=>{if(m({...we.pathVals}),b({...we.queryVals}),v({...we.headerVals}),j({...we.cookieVals}),P(we.bodyMode),T(we.tryBodyRaw),O!=null&&O.length&&we.bodyMode==="fields"){const tt={};for(const _t of O)tt[_t.key]=we.bodyVals[_t.key]??"";I(tt)}else I({...we.bodyVals});ue(null)},He=async we=>{await cx(we),await Ne()},Ke=async()=>{fe(null);const we=km(t,r,o,i,_e);if(!we.ok){fe(we.error);return}const tt=WS(we);try{await navigator.clipboard.writeText(tt),fe("cURL copiado al portapapeles."),window.setTimeout(()=>fe(null),2500)}catch{fe("No se pudo copiar (permiso del portapapeles).")}},ct=(we,tt,_t)=>h.jsxs("label",{className:"block text-xs",children:[h.jsxs("span",{className:"text-slate-400",children:[we.name,we.required?h.jsx("span",{className:"text-rose-400/90",children:" *"}):null,we.in!=="path"?h.jsxs("span",{className:"text-slate-600 ml-1",children:["(",we.in,")"]}):null]}),h.jsx("input",{type:"text",className:"glass-input mt-0.5 w-full min-h-[44px] sm:min-h-0 border rounded-xl px-3 py-2 font-mono text-[11px] text-slate-200 transition-colors duration-150 hover:border-accent/25",value:tt[we.name]??"",onChange:Ct=>_t(xt=>({...xt,[we.name]:Ct.target.value})),placeholder:we.description||(we.in==="path"?`{${we.name}}`:""),autoComplete:"off"})]},`${we.in}:${we.name}`),dt=we=>h.jsxs("label",{className:"block text-xs",children:[h.jsxs("span",{className:"text-slate-400",children:[we.key,we.required?h.jsx("span",{className:"text-rose-400/90",children:" *"}):null,we.type?h.jsxs("span",{className:"text-slate-600 ml-1",children:["(",we.type,")"]}):null]}),h.jsx("input",{type:"text",className:"glass-input mt-0.5 w-full min-h-[44px] sm:min-h-0 border rounded-xl px-3 py-2 font-mono text-[11px] text-slate-200 transition-colors duration-150 hover:border-accent/25",value:C[we.key]??"",onChange:tt=>Ae(we.key,tt.target.value),placeholder:we.description||"valor o JSON para objetos anidados",autoComplete:"off"})]},we.key);return h.jsxs("section",{className:"space-y-4 glass-card p-4",children:[h.jsx("h3",{className:"text-sm font-semibold tracking-tight text-slate-200",children:"Probar"}),h.jsxs("div",{className:"space-y-2 rounded-xl border border-white/[0.07] bg-surface-950/35 backdrop-blur-sm p-3",children:[h.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Plantillas"}),h.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-end",children:[h.jsxs("label",{className:"block text-xs flex-1 min-w-[12rem]",children:[h.jsx("span",{className:"text-slate-400",children:"Nombre nueva plantilla"}),h.jsx("input",{type:"text",className:"glass-input mt-0.5 w-full min-h-[44px] sm:min-h-0 border rounded-xl px-3 py-2 font-mono text-[11px] text-slate-200",value:de,onChange:we=>be(we.target.value),placeholder:"p. ej. Staging · usuario demo",autoComplete:"off"})]}),h.jsx("button",{type:"button",onClick:()=>void Ee(),className:"min-h-[44px] sm:min-h-0 px-4 py-2.5 rounded-xl glass-pill text-slate-200 text-sm font-medium cursor-pointer transition-colors duration-200 hover:border-accent/30",children:"Guardar plantilla"})]}),z?h.jsx("p",{className:"text-xs text-emerald-400/90",role:"status",children:z}):null,Se.length>0?h.jsx("ul",{className:"space-y-1.5 text-xs",children:Se.map(we=>h.jsxs("li",{className:"flex flex-wrap items-center gap-2 rounded-lg border border-surface-700/60 bg-surface-900/40 px-2 py-2",children:[h.jsx("span",{className:"text-slate-300 font-medium truncate flex-1 min-w-0",children:we.name}),h.jsx("button",{type:"button",onClick:()=>Ze(we),className:"min-h-[44px] sm:min-h-0 shrink-0 px-3 py-2 rounded-lg glass-pill text-accent cursor-pointer transition-colors duration-200",children:"Cargar"}),we.id!==void 0?h.jsx("button",{type:"button",onClick:()=>void He(we.id),className:"min-h-[44px] sm:min-h-0 shrink-0 px-3 py-2 rounded-lg border border-rose-500/35 text-rose-300 hover:bg-rose-950/40 cursor-pointer transition-colors duration-200","aria-label":`Eliminar plantilla ${we.name}`,children:"Eliminar"}):null]},we.id??we.name))}):h.jsx("p",{className:"text-[11px] text-slate-500",children:"No hay plantillas para esta operación."})]}),(ie.length>0||H.length>0||q.length>0||J.length>0)&&h.jsxs("div",{className:"space-y-2 rounded-xl border border-white/[0.07] bg-surface-950/35 backdrop-blur-sm p-3",children:[h.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Parámetros"}),h.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[ie.map(we=>ct(we,f,m)),H.map(we=>ct(we,y,b)),q.map(we=>ct(we,_,v)),J.map(we=>ct(we,k,j))]})]}),ke&&h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx("span",{className:"text-xs text-slate-400",children:"Body"}),O!=null&&O.length?h.jsxs("div",{className:"flex rounded-lg border border-surface-600 overflow-hidden text-xs shadow-inner shadow-black/20",role:"group","aria-label":"Modo de body",children:[h.jsx("button",{type:"button",className:`min-h-[40px] px-3 py-2 transition-colors duration-200 sm:min-h-0 sm:py-1.5 ${V==="fields"?"bg-accent/25 text-accent font-medium":"bg-surface-800 text-slate-400 hover:text-slate-200"}`,onClick:Re,children:"Campos"}),h.jsx("button",{type:"button",className:`min-h-[40px] px-3 py-2 transition-colors duration-200 sm:min-h-0 sm:py-1.5 border-l border-surface-600/80 ${V==="raw"?"bg-accent/25 text-accent font-medium":"bg-surface-800 text-slate-400 hover:text-slate-200"}`,onClick:Oe,children:"JSON raw"})]}):h.jsx("span",{className:"text-[10px] text-slate-500",children:"(solo JSON — sin propiedades `object` en el spec)"})]}),V==="fields"&&(O!=null&&O.length)?h.jsx("div",{className:"grid gap-2 sm:grid-cols-2 rounded-xl border border-white/[0.07] bg-surface-950/35 backdrop-blur-sm p-3",children:O.map(we=>dt(we))}):h.jsx("textarea",{className:"glass-input w-full h-28 min-h-[7rem] border rounded-xl p-3 font-mono text-xs text-slate-200 leading-relaxed transition-colors duration-150 hover:border-accent/25",value:A,onChange:we=>T(we.target.value),placeholder:'{"key": "value"}',spellCheck:!1})]}),U&&h.jsx("p",{role:"alert",className:"text-xs text-rose-200 bg-rose-950/40 border border-rose-700/50 rounded-lg px-3 py-2 leading-relaxed",children:U}),h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx("button",{type:"button",onClick:()=>void ze(),className:"min-h-[48px] sm:min-h-0 px-6 py-3 sm:px-5 sm:py-2.5 rounded-xl bg-accent text-surface-950 font-semibold text-sm shadow-lg shadow-accent/15 transition-[transform,filter] duration-200 hover:brightness-110 active:scale-[0.98] motion-reduce:active:scale-100 cursor-pointer",children:"Ejecutar"}),h.jsx("button",{type:"button",onClick:()=>void Ke(),className:"min-h-[48px] sm:min-h-0 px-4 py-3 sm:py-2.5 rounded-xl glass-pill text-slate-200 text-sm font-medium cursor-pointer transition-colors duration-200",children:"Copiar cURL"})]}),Z?h.jsx("p",{className:"text-xs text-emerald-400/90",role:"status",children:Z}):null,h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"text-[10px] uppercase tracking-wide text-slate-500",children:"Respuesta"}),M?h.jsxs(h.Fragment,{children:[h.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:[h.jsx("span",{className:M.status>=200&&M.status<300?"text-emerald-400":M.status>=400?"text-rose-400":"text-amber-300",children:M.status})," ",M.statusText]}),M.json!==null?h.jsx(OS,{data:M.json,defaultOpenDepth:3}):h.jsx("pre",{className:"text-xs glass-input border rounded-xl p-3 overflow-auto max-h-64 text-emerald-300/90 whitespace-pre-wrap font-mono",children:M.bodyText||"—"})]}):h.jsx("p",{className:"text-xs text-slate-500",children:"—"})]})]})}function QS(t){const r=t.toLowerCase().trim();return`border-l-[3px] ${r==="get"?"border-l-emerald-400":r==="post"?"border-l-sky-400":r==="put"?"border-l-amber-400":r==="patch"?"border-l-violet-400":r==="delete"?"border-l-rose-400":r==="head"||r==="options"||r==="trace"?"border-l-slate-400":"border-l-cyan-400/80"}`}function GS(t){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[h.jsx("circle",{cx:"11",cy:"11",r:"8"}),h.jsx("path",{d:"m21 21-4.3-4.3"})]})}function JS(t){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[h.jsx("circle",{cx:"18",cy:"5",r:"3"}),h.jsx("circle",{cx:"6",cy:"12",r:"3"}),h.jsx("circle",{cx:"18",cy:"19",r:"3"}),h.jsx("path",{d:"m8.59 13.51 6.83 3.98"}),h.jsx("path",{d:"m15.41 6.51-6.82 3.98"})]})}function ZS(t){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[h.jsx("path",{d:"M12 3 2 8l10 5 10-5-10-5Z"}),h.jsx("path",{d:"M2 13 12 18l10-5"}),h.jsx("path",{d:"M2 18 12 23l10-5"})]})}function e2(t){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[h.jsx("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),h.jsx("path",{d:"M3 3v5h5"}),h.jsx("path",{d:"M12 7v5l4 2"})]})}function t2(t){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[h.jsx("path",{d:"M9 11l3 3L22 4"}),h.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]})}function Mg(t){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[h.jsx("path",{d:"M12 8V4H8"}),h.jsx("rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}),h.jsx("path",{d:"M2 14h2"}),h.jsx("path",{d:"M20 14h2"}),h.jsx("path",{d:"M15 13v2"}),h.jsx("path",{d:"M9 13v2"})]})}function n2(t){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[h.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),h.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}function r2(t){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[h.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),h.jsx("polyline",{points:"7 10 12 15 17 10"}),h.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}function o2(t){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[h.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),h.jsx("polyline",{points:"17 8 12 3 7 8"}),h.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]})}function s2(t){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[h.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),h.jsx("polyline",{points:"16 17 21 12 16 7"}),h.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})}function _m(t){return h.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t.className,"aria-hidden":!0,children:[h.jsx("path",{d:"M15 3h6v6"}),h.jsx("path",{d:"M9 21H3v-6"}),h.jsx("path",{d:"M21 3l-7 7"}),h.jsx("path",{d:"M3 21l7-7"})]})}const i2=["get","post","put","patch","delete","options","head","trace"];function Tg(t,r){const o=t.trim().replace(/\s+/g," ");return o.length<=r?o:`${o.slice(0,r-1)}…`}function a2(t,r,o,i,l){const c=[`${t.toUpperCase()} ${r}`];return o&&c.push(`— ${Tg(o,140)}`),i!=null&&i.length&&c.push(`[tags: ${i.join(", ")}]`),l&&c.push(`(operationId: ${l})`),c.join(" ")}function l2(t,r){const o=[];let i=0;const l=t.paths;if(!l)return{lines:o,total:0};for(const[c,f]of Object.entries(l)){if(!f||typeof f!="object"||"$ref"in f)continue;const m=f;for(const y of i2){const b=m[y];if(!(!b||typeof b!="object")&&(i+=1,o.length<r)){const _=b.summary||(b.description?Tg(b.description,200):void 0);o.push(a2(y,c,_,b.tags,b.operationId))}}}return{lines:o,total:i}}function u2(t){var o,i,l,c,f,m,y;const r=[`Flujo «${t.name}»`];if((o=t.steps)!=null&&o.length){const b=t.steps.map(v=>`${v.method.toUpperCase()} ${v.path}`).join(" → ");r.push(`secuencia (pasos): ${b}`);const _=t.steps.filter(v=>v.extract).map(v=>`${v.extract.varName} ← ${v.extract.jsonPath}`);_.length&&r.push(`extracciones: ${_.join("; ")}`)}if((l=(i=t.graph)==null?void 0:i.nodes)!=null&&l.length){const b=t.graph.nodes.map(_=>`${_.method.toUpperCase()} ${_.path}`).join(" → ");r.push(`grafo (nodos en orden guardado): ${b}`),(c=t.graph.edges)!=null&&c.length&&r.push(`cables: ${t.graph.edges.length} (mapeo respuesta → siguiente request; detalle en la UI Flujos)`)}return!((f=t.steps)!=null&&f.length)&&!((y=(m=t.graph)==null?void 0:m.nodes)!=null&&y.length)&&r.push("(sin pasos ni nodos)"),r.join(". ")}function c2(t){var o;if(!((o=t.cases)!=null&&o.length))return`Suite «${t.name}»: sin casos`;const r=t.cases.map(i=>`${i.method.toUpperCase()} ${i.path} → esperado HTTP ${i.expectStatus}`).join("; ");return`Suite «${t.name}» (${t.cases.length} caso(s)): ${r}`}function d2(t,r){var A,T,V,P;const o=t.info.title??"API",i=t.info.version??"",l=`Documentación OpenAPI «${o}»${i?` v${i}`:""}.`,c=((A=t.servers)==null?void 0:A.map(M=>`${M.url}${M.description?` (${M.description})`:""}`).join(`
|
|
207
|
+
`))||"(sin servers en el spec; usa la Base URL de la barra superior en la UI)",f=(T=t.components)!=null&&T.securitySchemes?Object.entries(t.components.securitySchemes).map(([M,B])=>{if(!B||typeof B!="object"||"$ref"in B)return`${M}: ref`;const U=B.type??"?";return`${M} (${U})`}).join("; "):"",{lines:m,total:y}=l2(t,400),b=y>m.length?`
|
|
208
|
+
… y ${y-m.length} operación(es) más en el spec.`:"";let _="";const v=((V=r==null?void 0:r.savedFlows)==null?void 0:V.filter(M=>M.name))??[];v.length&&(_=`
|
|
209
|
+
|
|
210
|
+
--- Flujos guardados por el usuario en esta app (${v.length}) ---
|
|
211
|
+
${v.map(u2).join(`
|
|
212
|
+
`)}`);let k="";const j=((P=r==null?void 0:r.testSuites)==null?void 0:P.filter(M=>M.name))??[];j.length&&(k=`
|
|
213
|
+
|
|
214
|
+
--- Suites de tests guardadas (${j.length}) ---
|
|
215
|
+
${j.map(c2).join(`
|
|
216
|
+
`)}`);let C="";const I=r==null?void 0:r.selectedOperation;return I!=null&&I.path&&(C=`
|
|
217
|
+
|
|
218
|
+
--- Operación enfocada en la UI (Explorar) ---
|
|
219
|
+
${I.method.toUpperCase()} ${I.path}
|
|
220
|
+
(Prioriza explicar esta ruta si el usuario pregunta en genérico «este endpoint».)`),`${l}
|
|
221
|
+
|
|
222
|
+
--- Servidores (servers) ---
|
|
223
|
+
${c}
|
|
224
|
+
|
|
225
|
+
--- Seguridad (components.securitySchemes) ---
|
|
226
|
+
${f||"(ninguno declarado o solo referencias)"}
|
|
227
|
+
|
|
228
|
+
--- Catálogo de endpoints (método, ruta, resumen/tags) ---
|
|
229
|
+
Total de operaciones en el spec: ${y}.
|
|
230
|
+
${m.join(`
|
|
231
|
+
`)}${b}
|
|
232
|
+
${_}
|
|
233
|
+
${k}${C}
|
|
234
|
+
|
|
235
|
+
Instrucciones:
|
|
236
|
+
- Responde en el idioma del usuario. Sé preciso: cita método y ruta cuando hables de un endpoint.
|
|
237
|
+
- Puedes explicar cómo encadenar llamadas (flujos), qué variables extraer entre pasos, y cómo se relacionan con los tests guardados.
|
|
238
|
+
- Para probar requests reales, el usuario debe usar la pestaña Explorar (o Flujos/Tests); tú no ejecutas HTTP.
|
|
239
|
+
- Si falta detalle en este resumen, indica que puede ver el cuerpo completo de la operación en la UI (Explorar) o en el JSON OpenAPI.`}async function f2(t,r,o,i,l){const c=`${t.replace(/\/?$/,"/")}__chat`,f=await fetch(c,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",[Ly]:r},body:JSON.stringify({provider:o,model:i,messages:l})}),m=await f.text();if(!f.ok){let y=m;try{const b=JSON.parse(m);y=b.message??b.error??m}catch{}throw new Error(y||`HTTP ${f.status}`)}return JSON.parse(m)}function p2({doc:t,contextExtras:r,provider:o,model:i,apiKey:l,onOpenLlmSettings:c}){const f="/docs/",[m,y]=D.useState(!1),[b,_]=D.useState([]),[v,k]=D.useState(""),[j,C]=D.useState(!1),[I,A]=D.useState(null),T=D.useRef(null),V=D.useMemo(()=>d2(t,r),[t,r]);D.useEffect(()=>{var B;(B=T.current)==null||B.scrollIntoView({behavior:"smooth"})},[b]);const P=D.useCallback(async()=>{const B=v.trim();if(!B||j)return;if(!l.trim()){A("Configura tu API key: botón «Asistente: API de IA…» al pie del menú, o el icono del asistente."),c==null||c();return}A(null);const U=i.trim()||ou(o),W={role:"user",content:B},Z=[{role:"system",content:V},...b.filter(fe=>fe.role!=="system"),W];k(""),_(fe=>[...fe,W]),C(!0);try{const fe=await f2(f,l.trim(),o,U,Z);_(Se=>[...Se,{role:"assistant",content:fe.content??""}])}catch(fe){A(fe instanceof Error?fe.message:String(fe))}finally{C(!1)}},[l,f,v,j,b,i,c,o,V]),M=D.useCallback(()=>{_([]),A(null)},[]);return h.jsxs("div",{className:"fixed bottom-4 right-4 z-[100] flex flex-col items-end gap-2 pointer-events-none [&>*]:pointer-events-auto",style:{paddingBottom:"max(0.5rem, env(safe-area-inset-bottom))"},children:[m?h.jsxs("div",{className:"glass-modal-panel w-[min(100vw-1.5rem,24rem)] h-[min(72vh,28rem)] flex flex-col rounded-2xl overflow-hidden",role:"dialog","aria-label":"Asistente de la API",children:[h.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2.5 border-b border-white/[0.08] bg-surface-950/30",children:[h.jsx("span",{className:"text-sm font-medium text-slate-200",children:"Asistente"}),h.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[h.jsx("button",{type:"button",onClick:M,className:"text-[11px] text-slate-500 hover:text-slate-300 px-2 py-1 rounded-lg glass-pill",children:"Vaciar"}),h.jsx("button",{type:"button",onClick:()=>y(!1),className:"touch-target min-w-[2.25rem] min-h-[2.25rem] rounded-xl text-slate-400 hover:text-white glass-pill text-lg leading-none","aria-label":"Cerrar panel del asistente",children:"×"})]})]}),I?h.jsxs("div",{className:"px-3 py-2 text-xs text-rose-200 bg-rose-950/35 backdrop-blur-sm border-b border-rose-500/20 flex flex-wrap items-center gap-2",children:[h.jsx("span",{className:"flex-1 min-w-0",children:I}),c?h.jsx("button",{type:"button",className:"shrink-0 underline text-accent",onClick:c,children:"Abrir configuración"}):null]}):null,h.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-3 min-h-0",children:[b.length===0?h.jsx("p",{className:"text-xs text-slate-500 text-center py-6 leading-relaxed px-1",children:"Pregunta por endpoints, flujos o tests. Configura el proveedor con «Asistente: API de IA…» en el menú."}):b.map((B,U)=>h.jsxs("div",{className:`text-xs leading-relaxed rounded-xl px-2.5 py-2 backdrop-blur-sm ${B.role==="user"?"bg-accent/15 text-slate-100 ml-3 border border-accent/30 shadow-[0_4px_20px_-8px_rgb(var(--accent)/0.35)]":"bg-surface-800/50 text-slate-200 mr-3 border border-white/[0.08]"}`,children:[h.jsx("span",{className:"text-[10px] uppercase tracking-wider text-slate-500 block mb-0.5",children:B.role==="user"?"Tú":"Asistente"}),h.jsx("div",{className:"whitespace-pre-wrap break-words",children:B.content})]},`${U}-${B.role}`)),h.jsx("div",{ref:T})]}),h.jsxs("div",{className:"p-2.5 border-t border-white/[0.08] flex gap-2 bg-surface-950/25",children:[h.jsx("textarea",{className:"glass-input flex-1 min-h-[44px] max-h-32 border rounded-xl px-2.5 py-2 text-xs text-slate-200 resize-y",rows:2,value:v,onChange:B=>k(B.target.value),onKeyDown:B=>{B.key==="Enter"&&!B.shiftKey&&(B.preventDefault(),P())},placeholder:"Pregunta sobre el spec…",disabled:j}),h.jsx("button",{type:"button",onClick:()=>void P(),disabled:j||!v.trim(),className:"self-end shrink-0 min-h-[44px] px-3 rounded-xl bg-accent text-surface-950 font-semibold text-xs shadow-[0_6px_20px_-6px_rgb(var(--accent)/0.5)] disabled:opacity-40",children:j?"…":"Enviar"})]})]}):null,h.jsx("button",{type:"button",onClick:()=>y(B=>!B),className:`touch-target min-w-[3.25rem] min-h-[3.25rem] rounded-full flex items-center justify-center transition-[transform,box-shadow,filter] duration-200 ${m?"glass-fab-muted scale-95":"glass-fab hover:scale-[1.03] hover:brightness-110"}`,"aria-expanded":m,"aria-label":m?"Ocultar asistente":"Abrir asistente",title:"Asistente",children:h.jsx(Mg,{className:m?"opacity-80":void 0})})]})}const Ig="adt-llm-provider",$g="adt-llm-model",Ag="adt-llm-key";function h2(){try{const t=localStorage.getItem(Ig),r=t==="anthropic"||t==="openai"||t==="openrouter"?t:"openrouter",o=localStorage.getItem($g)??"",i=localStorage.getItem(Ag)??"";return{provider:r,model:o,apiKey:i}}catch{return{provider:"openrouter",model:"",apiKey:""}}}function m2(t,r,o){try{localStorage.setItem(Ig,t),localStorage.setItem($g,r),localStorage.setItem(Ag,o)}catch{}}function g2({open:t,onClose:r,ops:o,onPick:i}){const[l,c]=D.useState(""),f=D.useRef(null),[m,y]=D.useState(0),b=D.useMemo(()=>{const v=l.trim().toLowerCase();return v?o.filter(k=>{const j=(k.operationId??"").toLowerCase(),C=k.path.toLowerCase(),I=k.method.toLowerCase(),A=(k.tags??[]).join(" ").toLowerCase();return C.includes(v)||I.includes(v)||j.includes(v)||A.includes(v)}).slice(0,80):o.slice(0,80)},[o,l]);D.useEffect(()=>{t&&(c(""),y(0),window.setTimeout(()=>{var v;return(v=f.current)==null?void 0:v.focus()},10))},[t]),D.useEffect(()=>{y(0)},[l]);const _=D.useCallback(v=>{i({method:v.method,path:v.path}),r()},[r,i]);return D.useEffect(()=>{if(!t)return;const v=k=>{if(k.key==="Escape"){k.preventDefault(),r();return}k.key==="ArrowDown"&&(k.preventDefault(),y(j=>Math.min(j+1,Math.max(0,b.length-1)))),k.key==="ArrowUp"&&(k.preventDefault(),y(j=>Math.max(0,j-1))),k.key==="Enter"&&b[m]&&(k.preventDefault(),_(b[m]))};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[t,b,m,r,_]),t?h.jsx("div",{className:"glass-modal-backdrop fixed inset-0 z-[120] flex items-start justify-center pt-[12vh] px-3",role:"presentation",onClick:r,children:h.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Buscar operación",className:"glass-modal-panel w-full max-w-xl rounded-2xl overflow-hidden shadow-2xl",onClick:v=>v.stopPropagation(),children:[h.jsxs("div",{className:"border-b border-white/[0.08] px-3 py-2",children:[h.jsx("input",{ref:f,type:"search",className:"glass-input w-full border-0 rounded-xl px-3 py-2.5 text-sm text-slate-100 placeholder:text-slate-500 focus:ring-2 focus:ring-accent/50",placeholder:"Buscar por ruta, método, operationId o tag…",value:l,onChange:v=>c(v.target.value),autoComplete:"off"}),h.jsxs("p",{className:"text-[10px] text-slate-500 mt-1 px-1",children:["↑↓ navegar · Enter abrir · Esc cerrar ·"," ",h.jsx("kbd",{className:"px-1 rounded bg-surface-800 text-slate-400",children:"⌘K"})," /"," ",h.jsx("kbd",{className:"px-1 rounded bg-surface-800 text-slate-400",children:"Ctrl+K"})]})]}),h.jsx("ul",{className:"max-h-[min(50vh,22rem)] overflow-y-auto py-1",role:"listbox",children:b.length===0?h.jsx("li",{className:"px-4 py-6 text-sm text-slate-500 text-center",children:"Sin coincidencias"}):b.map((v,k)=>h.jsx("li",{children:h.jsxs("button",{type:"button",role:"option","aria-selected":k===m,className:`w-full text-left px-3 py-2.5 flex items-start gap-2 transition-colors ${k===m?"bg-accent/15 text-slate-100":"hover:bg-white/[0.04] text-slate-300"}`,onMouseEnter:()=>y(k),onClick:()=>_(v),children:[h.jsx(Ii,{method:v.method,size:"sm"}),h.jsxs("span",{className:"flex-1 min-w-0",children:[h.jsx("span",{className:"font-mono text-xs break-all",children:v.path}),v.operationId?h.jsx("span",{className:"block text-[10px] text-slate-500 mt-0.5",children:v.operationId}):null,v.deprecated?h.jsx("span",{className:"ml-2 text-[10px] uppercase text-amber-400/90",children:"deprecated"}):null]})]})},`${v.method}:${v.path}`))})]})}):null}function y2(t){return typeof t=="object"&&t!==null&&"$ref"in t&&typeof t.$ref=="string"}function x2({doc:t}){const r=D.useMemo(()=>{var m;const f=(m=t.components)==null?void 0:m.schemas;return!f||typeof f!="object"?[]:Object.keys(f).sort((y,b)=>y.localeCompare(b))},[t]),[o,i]=D.useState(null);D.useEffect(()=>{if(r.length===0){i(null);return}(!o||!r.includes(o))&&i(r[0])},[r,o]);const l=D.useMemo(()=>{var m,y;if(!o)return"";const f=(y=(m=t.components)==null?void 0:m.schemas)==null?void 0:y[o];if(f===void 0)return"// (no definido)";try{return JSON.stringify(f,null,2)}catch{return String(f)}},[t,o]),c=async()=>{try{await navigator.clipboard.writeText(l)}catch{}};return r.length===0?h.jsx("div",{className:"p-4 max-w-3xl",children:h.jsxs("p",{className:"text-sm text-slate-500",children:["Este spec no define ",h.jsx("code",{className:"text-accent",children:"components.schemas"}),"."]})}):h.jsxs("div",{className:"p-4 flex flex-col lg:flex-row gap-4 min-h-0 max-w-6xl",children:[h.jsxs("div",{className:"lg:w-56 shrink-0 space-y-2",children:[h.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-slate-500",children:"Esquemas"}),h.jsx("ul",{className:"space-y-0.5 max-h-[min(70vh,32rem)] overflow-y-auto rounded-xl border border-white/[0.08] bg-surface-950/30 p-1",children:r.map(f=>{var b,_;const m=(_=(b=t.components)==null?void 0:b.schemas)==null?void 0:_[f],y=y2(m);return h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>i(f),className:`w-full text-left px-2 py-2 rounded-lg text-xs font-mono transition-colors ${o===f?"glass-pill-active text-slate-100":"text-slate-400 hover:bg-white/[0.04] hover:text-slate-200"}`,children:[f,y?h.jsx("span",{className:"block text-[10px] text-slate-500 truncate",title:m.$ref,children:"→ ref"}):null]})},f)})})]}),h.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-2 min-h-0",children:[h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[h.jsx("h3",{className:"text-sm font-medium text-slate-200",children:o?h.jsx(h.Fragment,{children:h.jsx("code",{className:"text-accent",children:o})}):h.jsx("span",{className:"text-slate-500",children:"Selecciona un esquema"})}),o?h.jsx("button",{type:"button",onClick:()=>void c(),className:"text-xs px-3 py-1.5 rounded-lg glass-pill text-slate-300",children:"Copiar JSON"}):null]}),o?h.jsx("pre",{className:"glass-input border rounded-xl p-3 text-xs font-mono text-slate-200 overflow-auto max-h-[min(70vh,36rem)] whitespace-pre",children:l}):h.jsx("p",{className:"text-xs text-slate-500",children:"Los modelos reutilizables del spec aparecen aquí."})]})]})}const nu="op",v2="playground";function Sm(t){if(!t)return!1;const r=t.startsWith("?")?t.slice(1):t;return new URLSearchParams(r).get(v2)==="1"}function w2(t,r){const o=`${t.toLowerCase()} ${r}`;return encodeURIComponent(o)}function b2(t){if(!(t!=null&&t.trim()))return null;try{const r=decodeURIComponent(t),o=r.indexOf(" ");if(o===-1)return null;const i=r.slice(0,o).trim().toLowerCase(),l=r.slice(o+1);return!i||l.length===0?null:{method:i,path:l}}catch{return null}}function Nm(t){try{const r=JSON.parse(t);return JSON.stringify(r,null,2)}catch{return null}}async function ru(t){await navigator.clipboard.writeText(t)}function k2({listKey:t,onReplay:r}){const[o,i]=D.useState([]),[l,c]=D.useState(null),[f,m]=D.useState(""),[y,b]=D.useState(""),[_,v]=D.useState(null),[k,j]=D.useState(!1),C=D.useCallback(async()=>{const M=await dx();i(M)},[]);D.useEffect(()=>{C()},[C,t]);const I=D.useMemo(()=>{const M=f.trim().toLowerCase(),B=y.trim().toLowerCase();return o.filter(U=>!(M&&U.method.toLowerCase()!==M||B&&!U.path.toLowerCase().includes(B)&&!U.url.toLowerCase().includes(B)))},[o,f,y]),A=M=>{M!==void 0&&c(B=>B===M?null:M)},T=async()=>{if(window.confirm("¿Vaciar todo el historial de llamadas? No se puede deshacer.")){j(!0);try{await fx(),i([]),c(null)}finally{j(!1)}}},V=async M=>{M!==void 0&&(await px(M),c(B=>B===M?null:B),await C())},P=()=>{v("Copiado."),window.setTimeout(()=>v(null),2e3)};return h.jsxs("div",{className:"flex-1 flex flex-col min-h-0 p-4 md:p-6 max-w-5xl w-full mx-auto space-y-4",children:[h.jsxs("div",{children:[h.jsx("h2",{className:"text-lg font-semibold text-slate-100 tracking-tight",children:"Historial de «Probar»"}),h.jsxs("p",{className:"text-xs text-slate-500 mt-1 leading-relaxed max-w-2xl",children:["Cada ejecución guarda URL, cabeceras, cuerpos y respuesta en este navegador. Puede incluir tokens u datos sensibles. Se conservan como máximo ",jd," entradas (las más antiguas se eliminan)."]})]}),h.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[h.jsxs("label",{className:"text-xs text-slate-400 flex items-center gap-2",children:["Método",h.jsx("input",{type:"text",className:"glass-input border rounded-xl px-3 py-2 min-h-[44px] sm:min-h-0 w-24 font-mono text-xs text-slate-200",value:f,onChange:M=>m(M.target.value),placeholder:"get",autoComplete:"off",spellCheck:!1})]}),h.jsxs("label",{className:"text-xs text-slate-400 flex items-center gap-2 flex-1 min-w-[12rem]",children:["Ruta o URL",h.jsx("input",{type:"search",className:"glass-input border rounded-xl px-3 py-2 min-h-[44px] sm:min-h-0 flex-1 font-mono text-xs text-slate-200",value:y,onChange:M=>b(M.target.value),placeholder:"/users …",autoComplete:"off",spellCheck:!1})]}),h.jsx("button",{type:"button",onClick:()=>void C(),className:"min-h-[44px] sm:min-h-0 px-4 py-2.5 rounded-xl glass-pill text-slate-200 text-sm cursor-pointer transition-colors duration-200",children:"Actualizar"}),h.jsx("button",{type:"button",disabled:k||o.length===0,onClick:()=>void T(),className:"min-h-[44px] sm:min-h-0 px-4 py-2.5 rounded-xl border border-rose-500/40 text-rose-200 text-sm cursor-pointer transition-colors duration-200 hover:bg-rose-950/35 disabled:opacity-40 disabled:cursor-not-allowed",children:k?"…":"Vaciar historial"})]}),_?h.jsx("p",{className:"text-xs text-emerald-400/90",role:"status",children:_}):null,I.length===0?h.jsx("p",{className:"text-sm text-slate-500 py-8 text-center border border-dashed border-surface-600 rounded-2xl",children:o.length===0?"Aún no hay llamadas. Usa Explorar → Probar → Ejecutar.":"Nada coincide con el filtro."}):h.jsx("ul",{className:"space-y-2 overflow-auto flex-1 min-h-0 pb-8",children:I.map(M=>{const B=M.id,U=B!==void 0&&l===B;return h.jsxs("li",{className:"rounded-2xl border border-surface-600/50 bg-surface-900/40 overflow-hidden",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2 p-3",children:[h.jsxs("button",{type:"button",onClick:()=>A(B),className:"flex flex-wrap items-center gap-2 flex-1 min-w-0 text-left cursor-pointer rounded-lg focus:outline-none focus-visible:ring-2 focus-visible:ring-accent/60","aria-expanded":U,children:[h.jsx(Ii,{method:M.method}),h.jsx("span",{className:"text-xs font-mono text-slate-300 truncate",children:M.path}),h.jsx("span",{className:"text-[10px] text-slate-500 shrink-0",children:new Date(M.at).toLocaleString()}),M.networkError!==void 0?h.jsx("span",{className:"text-[10px] uppercase text-rose-400 shrink-0",children:"error"}):M.status!==void 0?h.jsx("span",{className:`text-xs font-mono shrink-0 ${M.status<400?"text-emerald-400":"text-rose-400"}`,children:M.status}):null]}),h.jsxs("div",{className:"flex flex-wrap gap-2 shrink-0",children:[h.jsx("button",{type:"button",onClick:()=>r(M),className:"min-h-[44px] sm:min-h-0 px-3 py-2 rounded-xl glass-pill text-accent text-xs font-medium cursor-pointer transition-colors duration-200",children:"Cargar en Probar"}),B!==void 0?h.jsx("button",{type:"button",onClick:()=>void V(B),className:"min-h-[44px] sm:min-h-0 px-3 py-2 rounded-xl border border-surface-600 text-slate-400 text-xs cursor-pointer hover:text-rose-300 transition-colors duration-200","aria-label":"Eliminar entrada del historial",children:"Borrar"}):null]})]}),U?h.jsxs("div",{className:"border-t border-surface-700/60 p-3 space-y-3 text-xs bg-surface-950/50",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-[10px] uppercase text-slate-500 mb-1",children:"Base URL (campo superior)"}),h.jsx("p",{className:"font-mono text-slate-300 break-all",children:M.baseUrl||"—"})]}),h.jsxs("div",{children:[h.jsx("p",{className:"text-[10px] uppercase text-slate-500 mb-1",children:"URL final"}),h.jsx("p",{className:"font-mono text-slate-300 break-all",children:M.url}),h.jsx("button",{type:"button",onClick:()=>void ru(M.url).then(P),className:"mt-1 text-accent hover:underline cursor-pointer",children:"Copiar URL"})]}),h.jsxs("div",{children:[h.jsx("p",{className:"text-[10px] uppercase text-slate-500 mb-1",children:"Request headers"}),h.jsx("pre",{className:"glass-input border rounded-lg p-2 max-h-40 overflow-auto font-mono text-[11px] text-slate-300 whitespace-pre-wrap",children:JSON.stringify(M.requestHeaders,null,2)}),h.jsx("button",{type:"button",onClick:()=>void ru(JSON.stringify(M.requestHeaders,null,2)).then(P),className:"mt-1 text-accent hover:underline cursor-pointer",children:"Copiar JSON"})]}),h.jsxs("div",{children:[h.jsx("p",{className:"text-[10px] uppercase text-slate-500 mb-1",children:"Request body"}),M.requestBody?h.jsxs(h.Fragment,{children:[h.jsx("pre",{className:"glass-input border rounded-lg p-2 max-h-48 overflow-auto font-mono text-[11px] text-slate-300 whitespace-pre-wrap",children:Nm(M.requestBody)??M.requestBody}),h.jsx("button",{type:"button",onClick:()=>void ru(M.requestBody??"").then(P),className:"mt-1 text-accent hover:underline cursor-pointer",children:"Copiar body"})]}):h.jsx("p",{className:"text-slate-500",children:"—"})]}),M.networkError!==void 0?h.jsxs("p",{className:"text-rose-300",role:"alert",children:["Error de red: ",M.networkError]}):null,M.responseHeaders!==void 0?h.jsxs("div",{children:[h.jsx("p",{className:"text-[10px] uppercase text-slate-500 mb-1",children:"Response headers"}),h.jsx("pre",{className:"glass-input border rounded-lg p-2 max-h-40 overflow-auto font-mono text-[11px] text-slate-300 whitespace-pre-wrap",children:JSON.stringify(M.responseHeaders,null,2)})]}):null,M.responseBodyText!==void 0?h.jsxs("div",{children:[h.jsx("p",{className:"text-[10px] uppercase text-slate-500 mb-1",children:"Response body"}),h.jsx("pre",{className:"glass-input border rounded-lg p-2 max-h-64 overflow-auto font-mono text-[11px] text-slate-300 whitespace-pre-wrap",children:Nm(M.responseBodyText)??M.responseBodyText}),h.jsx("button",{type:"button",onClick:()=>void ru(M.responseBodyText??"").then(P),className:"mt-1 text-accent hover:underline cursor-pointer",children:"Copiar respuesta"})]}):null]}):null]},B??`${M.at}-${M.url}`)})})]})}const Og=[{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 Em(t){return Og.some(r=>r.value===t)}const _d=[{id:"typescript",label:"TypeScript"},{id:"javascript",label:"JavaScript"},{id:"python",label:"Python"},{id:"php",label:"PHP"}];function Sd(t,r){return`${t.toLowerCase()} ${r}`}function _2(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}function S2(){if(typeof window>"u")return null;let t=new URLSearchParams(window.location.search).get("spec");if(!(t!=null&&t.trim()))return null;t=t.trim();try{t=decodeURIComponent(t)}catch{}try{const r=new URL(t);return r.protocol!=="http:"&&r.protocol!=="https:"?null:r.href}catch{return null}}async function jm(t){await navigator.clipboard.writeText(t)}function N2(){var kr;const t=AS(),[r,o]=D.useState(null),[i,l]=D.useState(null),[c,f]=D.useState("server"),[m,y]=D.useState(null),[b,_]=D.useState(null),[v,k]=D.useState("explore"),[j,C]=D.useState(""),[I,A]=D.useState(null),[T,V]=D.useState(null),[P,M]=D.useState("typescript"),[B,U]=D.useState(""),[W,Z]=D.useState(""),[fe,Se]=D.useState("X-Api-Key"),[X,de]=D.useState({nodes:[],edges:[]}),[be,z]=D.useState(0),[ue,Q]=D.useState("Mi flujo"),[ie,H]=D.useState([]),[q,J]=D.useState(""),[O,K]=D.useState({name:"Suite 1",cases:[]}),[ke,Ne]=D.useState([]),[Ae,Oe]=D.useState(""),[Re,_e]=D.useState(""),[ze,Ee]=D.useState(null),[Ze,He]=D.useState(null),[Ke,ct]=D.useState(null),[dt,we]=D.useState("openrouter"),[tt,_t]=D.useState(""),[Ct,xt]=D.useState(""),[vt,It]=D.useState(!1),[_n,fr]=D.useState(!1),[sn,Pt]=D.useState(!1),[tn,an]=D.useState(null),[pr,Tn]=D.useState(0),In=(L,me)=>{try{const Fe=sessionStorage.getItem(L);if(Fe==="1")return!0;if(Fe==="0")return!1}catch{}return me},[hn,hr]=D.useState(()=>In("adt-collapse-main",!1)),[Rn,Sn]=D.useState(()=>In("adt-collapse-explore",!1)),We="/docs/openapi.json",Ln="/docs/preset.json",mn=D.useMemo(()=>S2(),[]),Gt=D.useCallback(async()=>{const[L,me]=await Promise.all([nt.flows.toArray(),nt.testSuites.toArray()]);H(L.sort((Fe,Je)=>(Fe.name??"").localeCompare(Je.name??""))),Ne(me.sort((Fe,Je)=>(Fe.name??"").localeCompare(Je.name??"")))},[]);D.useEffect(()=>{var me,Fe;if(!r)return;const L=((me=t.productName)==null?void 0:me.trim())||((Fe=r.info.title)==null?void 0:Fe.trim())||"API";document.title=L},[r,t.productName]);const Ve=D.useCallback(async()=>{if(y(null),mn)try{const me=await fetch(mn,{credentials:"omit",mode:"cors"});if(!me.ok)throw new Error(`${me.status} ${me.statusText}`);const Fe=await me.json();ad(Fe);const Je=Fe;o(Je),C(Ro(Je)),l(null),f("remote");return}catch(me){l(me instanceof Error?me.message:String(me));return}const L=await nt.kv.get($i);if(L!=null&&L.value)try{const me=JSON.parse(L.value);ad(me);const Fe=me;o(Fe),C(Ro(Fe)),l(null),f("local");return}catch{await dh()}try{const me=await fetch(We,{credentials:"include"});if(me.status===401){let Je="/docs/__auth/login";try{const jt=await me.json();jt.loginPath&&(Je=jt.loginPath)}catch{}window.location.href=Je;return}if(!me.ok)throw new Error(`${me.status} ${me.statusText}`);const Fe=await me.json();o(Fe),C(Ro(Fe)),l(null),f("server")}catch(me){l(me instanceof Error?me.message:String(me))}},[We,mn]);D.useEffect(()=>{Ve()},[Ve]),D.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-main",hn?"1":"0")}catch{}},[hn]),D.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-explore",Rn?"1":"0")}catch{}},[Rn]),D.useEffect(()=>{(async()=>{try{const L=await fetch("/docs/__auth/session",{credentials:"include"});if(L.ok){const me=await L.json();ct({username:me.username})}else ct(null)}catch{ct(null)}})()},[]),D.useEffect(()=>{if(!r)return;let L=!1;return(async()=>{try{const me=await fetch(Ln,{credentials:"include"});if(!me.ok||L)return;const Fe=await me.json(),Je=await mx(Fe);!L&&Je&&await Gt()}catch{}})(),()=>{L=!0}},[r,Ln,Gt]),D.useEffect(()=>{Gt(),nt.kv.get("bearer").then(L=>L&&U(L.value)),nt.kv.get("apiKey").then(L=>L&&Z(L.value))},[Gt]),D.useEffect(()=>{const L=h2();we(L.provider),_t(L.model||ou(L.provider)),xt(L.apiKey)},[]),D.useEffect(()=>{Pt(!1)},[r]);const Dn=D.useMemo(()=>r?tx(r):[],[r]),Et=D.useMemo(()=>r?uo(r):[],[r]),Qr=D.useMemo(()=>r?Et.map(L=>({method:L.method,path:L.path,operationId:L.operationId,tags:L.tags,deprecated:kd(r,L.method,L.path)})):[],[r,Et]);D.useEffect(()=>{if(!r||Et.length===0||sn)return;const L=new URLSearchParams(window.location.search);if(Sm(window.location.search)){Pt(!0);return}const me=b2(L.get(nu));me&&Et.some(Je=>Je.method.toLowerCase()===me.method&&Je.path===me.path)&&(an(null),V({method:me.method,path:me.path}),k("explore")),Pt(!0)},[r,Et,sn]),D.useEffect(()=>{if(!sn||!r)return;const L=new URL(window.location.href);if(Sm(L.search)){L.searchParams.delete(nu),window.history.replaceState({},"",L.toString());return}v==="explore"&&T?L.searchParams.set(nu,w2(T.method,T.path)):L.searchParams.delete(nu),window.history.replaceState({},"",L.toString())},[sn,r,v,T]),D.useEffect(()=>{const L=me=>{(me.metaKey||me.ctrlKey)&&me.key.toLowerCase()==="k"&&(me.preventDefault(),fr(Fe=>!Fe))};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[]);const fo=D.useMemo(()=>({savedFlows:ie,testSuites:ke,selectedOperation:T}),[ie,ke,T]),er=D.useMemo(()=>I?Et.filter(L=>(L.tags??["default"]).includes(I)):Et,[Et,I]);D.useEffect(()=>{if(Et.length&&!Re){const L=Et[0];_e(Sd(L.method,L.path))}},[Et,Re]),D.useEffect(()=>{if(Et.length===0||X.nodes.length>0||v!=="flows"||ze!=null)return;const L=Et[0];de({nodes:[{id:crypto.randomUUID(),method:L.method.toLowerCase(),path:L.path,x:80,y:120}],edges:[]}),z(me=>me+1)},[Et,X.nodes.length,v,ze]);const mr=D.useCallback(()=>{const L={"Content-Type":"application/json"};return B.trim()&&(L.Authorization=`Bearer ${B.trim()}`),W.trim()&&(L[fe]=W.trim()),L},[B,W,fe]),Fo=D.useCallback(()=>{an(null)},[]),zn=D.useCallback(L=>{V({method:L.method,path:L.path}),an(L),k("explore")},[]);D.useEffect(()=>{v==="history"&&Tn(L=>L+1)},[v]);const Bn=D.useCallback(L=>{an(null),V(L)},[]),$n=D.useMemo(()=>{if(!r||!T)return null;const L={};for(const{id:me}of _d)L[me]=Jy(r,me,T.method,T.path);return L},[r,T]),tr=D.useMemo(()=>r?ex(r,P,I):"",[r,P,I]),lt=D.useMemo(()=>{var $t,Yt;if(!r||!T)return null;const L=($t=r.paths)==null?void 0:$t[T.path];if(!L||typeof L!="object"||"$ref"in L)return null;const me=L[T.method.toLowerCase()];if(!me)return null;const Fe=typeof me.summary=="string"?me.summary:void 0,Je=typeof me.description=="string"?me.description:void 0;let jt=null;try{const Ht=me.requestBody,Xt=(Yt=Ht==null?void 0:Ht.content)==null?void 0:Yt["application/json"];if((Xt==null?void 0:Xt.example)!==void 0)jt=JSON.stringify(Xt.example,null,2);else if(Xt!=null&&Xt.examples&&typeof Xt.examples=="object"){const yn=Object.values(Xt.examples)[0];yn&&yn.value!==void 0&&(jt=JSON.stringify(yn.value,null,2))}}catch{}return{summary:Fe,description:Je,exampleStr:jt}},[r,T]),Dt=D.useCallback(L=>{an(null),V(L),k("explore")},[]),Pr=async L=>{var jt;if(!r)return"";const me={};let Fe="";const Je=Ro(r,j);for(let $t=0;$t<L.length;$t++){const Yt=L[$t];let Ht=Yt.path;for(const[Ir,Ws]of Object.entries(me))Ht=Ht.replace(`{${Ir}}`,Ws);const Xt=`${Je}${Ht}`,yn={method:Yt.method.toUpperCase(),headers:mr()},bt=Yt.method.toLowerCase();bt!=="get"&&bt!=="head"&&(yn.body="{}");const ys=await fetch(Xt,{...yn,credentials:"include"}),gt=await ys.json().catch(()=>({}));if(Fe+=`Paso ${$t+1}: ${ys.status}
|
|
240
|
+
${JSON.stringify(gt,null,2)}
|
|
241
|
+
|
|
242
|
+
`,(jt=Yt.extract)!=null&&jt.jsonPath){const Ir=Vd(gt,Yt.extract.jsonPath);Ir!==void 0&&(me[Yt.extract.varName]=String(Ir))}}return Fe},nr=async()=>{if(!r)return;const L=Ro(r,j);if(X.nodes.length===0){J("Añade al menos un nodo al flujo.");return}const me=await vm(X,L,mr);J(me)},rr=async L=>{if(!r)return;const me=Ro(r,j),Fe=L.graph&&L.graph.nodes.length>0?await vm(L.graph,me,mr):await Pr(L.steps);J(Fe),k("flows")},gr=L=>{Q(L.name),de(L.graph&&L.graph.nodes.length>0?L.graph:IS(L.steps.length?L.steps:[{method:"get",path:"/"}])),z(me=>me+1),Ee(L.id??null),k("flows")},Ho=()=>{Ee(null),Q("Nuevo flujo"),Et[0]?de({nodes:[{id:crypto.randomUUID(),method:Et[0].method.toLowerCase(),path:Et[0].path,x:80,y:120}],edges:[]}):de({nodes:[],edges:[]}),z(L=>L+1)},Fn=D.useCallback(L=>{de(L)},[]),yr=async()=>{const L=TS(X);if(ze!=null)await nt.flows.update(ze,{name:ue,steps:L,graph:X});else{const me=await nt.flows.add({name:ue,steps:L,graph:X});Ee(me)}await Gt()},Wt=async L=>{L!==void 0&&(L===ze&&(Ee(null),Ho()),await nt.flows.delete(L),await Gt())},xr=()=>{if(!Re)return;const{method:L,path:me}=_2(Re),Fe={id:crypto.randomUUID(),method:L,path:me,expectStatus:200,contains:void 0,jsonPath:void 0,expectJsonValue:void 0};K(Je=>({...Je,cases:[...Je.cases,Fe]}))},po=L=>{K(me=>({...me,cases:me.cases.filter(Fe=>Fe.id!==L)}))},nn=(L,me)=>{K(Fe=>({...Fe,cases:Fe.cases.map(Je=>Je.id===L?{...Je,...me}:Je)}))},Mr=async L=>{if(!r)return"";const me=Ro(r,j);let Fe="";for(const Je of L){const jt=`${me}${Je.path}`,$t=await fetch(jt,{method:Je.method.toUpperCase(),headers:mr(),credentials:"include"}),Yt=await $t.text(),Ht=gx(Je,$t.status,Yt),Xt=`${Ht.pass?"PASS":"FAIL"} ${Je.method.toUpperCase()} ${Je.path}`;Fe+=`${Xt}
|
|
243
|
+
${Ht.lines.map(yn=>` ${yn}`).join(`
|
|
244
|
+
`)}
|
|
245
|
+
|
|
246
|
+
`}return Fe},Hn=async()=>{const L=await Mr(O.cases);Oe(L)},ho=async()=>{if(!r||ke.length===0)return;let L="";for(const me of ke)L+=`━━━ ${me.name} (${me.cases.length} casos) ━━━
|
|
247
|
+
`,L+=await Mr(me.cases);Oe(L),k("tests")},Gr=async L=>{const me=await Mr(L.cases);Oe(me),k("tests")},Mt=L=>{K({name:L.name,cases:L.cases.map(me=>({...me,id:me.id&&me.id.length>0?me.id:crypto.randomUUID()}))}),He(L.id??null),k("tests")},Vn=()=>{He(null),K({name:"Nueva suite",cases:[]})},wt=async()=>{if(Ze!=null)await nt.testSuites.update(Ze,{name:O.name,cases:O.cases});else{const L=await nt.testSuites.add({name:O.name,cases:O.cases});He(L)}await Gt()},Vo=async L=>{L!==void 0&&(L===Ze&&(He(null),K({name:"Nueva suite",cases:[]})),await nt.testSuites.delete(L),await Gt())},vr=async()=>{await nt.kv.put({key:"bearer",value:B}),await nt.kv.put({key:"apiKey",value:W})},Tr=async()=>{_(null);const L=await hx(),me=new Blob([JSON.stringify(L,null,2)],{type:"application/json"}),Fe=document.createElement("a");Fe.href=URL.createObjectURL(me),Fe.download="api-doc-tor-estado-app.json",Fe.click(),URL.revokeObjectURL(Fe.href)},wr=async L=>{var Fe;const me=(Fe=L.target.files)==null?void 0:Fe[0];if(L.target.value="",!!me){_(null);try{const Je=await me.text(),jt=JSON.parse(Je);if(jt.formatVersion!==1)throw new Error("Se esperaba un export de estado de la app (formatVersion: 1).");await Lm(jt),await Gt(),await Ve()}catch(Je){_(Je instanceof Error?Je.message:String(Je))}}},or=D.useCallback(()=>{var Je;if(!r)return;const L=new Blob([JSON.stringify(r,null,2)],{type:"application/json"}),me=document.createElement("a"),Fe=(((Je=r.info)==null?void 0:Je.title)??"openapi").replace(/[^\w\-.]+/g,"-").slice(0,80);me.href=URL.createObjectURL(L),me.download=`${Fe||"openapi"}.json`,me.click(),URL.revokeObjectURL(me.href)},[r]),mo=async L=>{var Fe;const me=(Fe=L.target.files)==null?void 0:Fe[0];if(L.target.value="",!!me){y(null);try{const Je=await me.text(),jt=JSON.parse(Je);ad(jt);const $t=jt;await ax($t),o($t),C(Ro($t)),l(null),f("local"),an(null),V(null),A(null)}catch(Je){y(Je instanceof Error?Je.message:String(Je))}}},Un=D.useCallback(async()=>{y(null),await dh(),await Ve()},[Ve]),gn=D.useCallback(()=>{const L=new URL(window.location.href);L.searchParams.delete("spec"),window.location.replace(L.pathname+L.search+L.hash)},[]),ht=async()=>{await fetch("/docs/__auth/logout",{method:"POST",credentials:"include"}),window.location.href="/docs/__auth/login"},ln=D.useCallback(()=>{It(!0)},[]),Uo=D.useCallback(()=>{m2(dt,tt.trim(),Ct),It(!1)},[Ct,tt,dt]);D.useEffect(()=>{if(!vt)return;const L=me=>{me.key==="Escape"&&It(!1)};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[vt]);const Jr=()=>{T&&(de(L=>{const me=L.nodes[L.nodes.length-1],Fe=me?me.x+280:80,Je=(me==null?void 0:me.y)??120;return{nodes:[...L.nodes,{id:crypto.randomUUID(),method:T.method.toLowerCase(),path:T.path,x:Fe,y:Je}],edges:L.edges}}),z(L=>L+1),k("flows"))};if(i)return h.jsx("div",{className:"app-glass-bg min-h-screen flex items-center justify-center p-8",children:h.jsxs("div",{role:"alert",className:"glass-card max-w-lg border-red-500/40 bg-red-950/25 p-6 text-red-100",children:[h.jsx("h1",{className:"font-display text-xl font-bold mb-2",children:"No se pudo cargar OpenAPI"}),h.jsx("p",{className:"text-sm opacity-90 leading-relaxed",children:i}),h.jsxs("p",{className:"text-xs mt-4 text-slate-500",children:["URL intentada: ",We]})]})});if(!r)return h.jsx("div",{className:"app-glass-bg min-h-screen flex items-center justify-center p-6",children:h.jsx("div",{className:"glass-card px-8 py-6 border-white/[0.08]",children:h.jsx("p",{className:"text-slate-300 motion-safe:animate-pulse text-sm font-medium",children:"Cargando especificación…"})})});const br=I===null?"Todos los endpoints (cliente único con todas las operaciones)":`Tag «${I}» (solo operaciones de este grupo)`,sr=((kr=t.productName)==null?void 0:kr.trim())||r.info.title;return h.jsxs("div",{className:"app-glass-bg min-h-screen flex flex-col selection:bg-accent/25 selection:text-slate-50",children:[h.jsx("a",{href:"#main-content",className:"skip-link",children:"Saltar al contenido"}),h.jsxs("div",{className:"flex flex-1 flex-col md:flex-row min-h-0",children:[h.jsxs("aside",{className:`glass-sidebar w-full border-b md:border-b-0 md:border-r border-surface-600/40 shrink-0 transition-[width] duration-200 ease-out flex flex-col overflow-hidden md:rounded-r-3xl ${hn?"md:w-14 md:min-w-[3.5rem]":"md:w-64"}`,children:[h.jsx("input",{id:"adt-state-import",type:"file",accept:"application/json,.json",className:"hidden",onChange:wr}),h.jsx("input",{id:"adt-openapi-import",type:"file",accept:"application/json,.json",className:"hidden",onChange:mo}),h.jsxs("div",{className:hn?"max-md:block md:hidden":"block",children:[h.jsxs("div",{className:"p-4 border-b border-surface-700 flex justify-between items-start gap-2",children:[h.jsxs("div",{className:"min-w-0",children:[t.logoDataUrl?h.jsx("img",{src:t.logoDataUrl,alt:sr,className:"h-9 max-w-[200px] object-contain object-left mb-2"}):null,h.jsx("h1",{className:"font-display text-lg font-bold text-white tracking-tight",children:sr}),h.jsx("p",{className:"text-xs text-slate-500 mt-1",children:sr===r.info.title?`v${r.info.version}`:`${r.info.title} · v${r.info.version}`})]}),h.jsx("button",{type:"button",className:"hidden md:flex shrink-0 touch-target rounded-lg border border-surface-600 bg-surface-800 text-slate-300 hover:bg-surface-700 items-center justify-center text-lg leading-none transition-colors duration-200",onClick:()=>hr(!0),"aria-label":"Ocultar menú lateral",title:"Ocultar menú",children:"‹"})]}),h.jsx("nav",{className:"p-2 flex flex-row md:flex-col gap-1 overflow-x-auto","aria-label":"Navegación principal",children:[["explore","Explorar"],["flows",`Flujos (${ie.length})`],["tests",`Tests (${ke.length})`],["history","Historial"],["schemas","Esquemas"],["auth","Auth"]].map(([L,me])=>h.jsx("button",{type:"button",onClick:()=>k(L),className:`text-left px-3 py-2.5 md:py-2 rounded-xl text-sm transition-all duration-200 ease-out min-h-[44px] md:min-h-0 flex items-center ${v===L?"glass-pill-active text-accent":"text-slate-400 glass-pill hover:text-slate-200"}`,children:me},L))}),Ke?h.jsxs("div",{className:"px-3 py-2 border-t border-surface-700 flex items-center justify-between gap-2 text-xs",children:[h.jsx("span",{className:"text-slate-400 truncate",title:Ke.username,children:Ke.username}),h.jsx("button",{type:"button",className:"shrink-0 text-accent hover:underline",onClick:()=>void ht(),children:"Salir"})]}):null,h.jsxs("div",{className:"p-3 border-t border-surface-700 space-y-2",children:[h.jsx("button",{type:"button",onClick:()=>It(!0),className:"w-full text-xs py-2.5 rounded-xl glass-pill text-slate-200 hover:text-accent min-h-[44px] md:min-h-0 transition-all duration-200",children:"Asistente: API de IA…"}),b?h.jsx("p",{className:"text-[11px] text-rose-300/95 leading-snug rounded-lg border border-rose-500/35 bg-rose-950/30 px-2 py-2",role:"alert",children:b}):null,h.jsx("button",{type:"button",onClick:()=>void Tr(),className:"w-full text-xs py-2.5 rounded-xl glass-pill text-slate-300 min-h-[44px] md:min-h-0",children:"Exportar estado (app)"}),h.jsx("label",{htmlFor:"adt-state-import",className:"block w-full text-xs py-2.5 rounded-xl glass-pill text-center text-slate-300 cursor-pointer transition-all duration-200 min-h-[44px] md:min-h-0 flex items-center justify-center",children:"Importar estado (app)"})]})]}),hn?h.jsxs("div",{className:"max-md:hidden md:flex flex-1 flex-col items-stretch py-2 px-1 gap-1 min-h-0 overflow-y-auto overflow-x-hidden",children:[h.jsx("button",{type:"button",className:"touch-target w-11 h-11 mx-auto rounded-lg border border-surface-600 bg-surface-800 text-slate-200 hover:bg-surface-700 flex items-center justify-center shrink-0 transition-colors duration-200",onClick:()=>hr(!1),"aria-label":"Mostrar menú lateral completo",title:"Expandir panel completo",children:h.jsx(_m,{className:"text-slate-300"})}),h.jsxs("nav",{className:"flex flex-col gap-0.5 items-center w-full py-1 border-b border-surface-700/80","aria-label":"Secciones",children:[h.jsx("button",{type:"button",onClick:()=>k("explore"),title:"Explorar","aria-current":v==="explore"?"page":void 0,className:`relative touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${v==="explore"?"border-accent/60 bg-accent/15 text-accent":"border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:h.jsx(GS,{})}),h.jsxs("button",{type:"button",onClick:()=>k("flows"),title:`Flujos (${ie.length})`,"aria-current":v==="flows"?"page":void 0,className:`relative touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${v==="flows"?"border-accent/60 bg-accent/15 text-accent":"border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:[h.jsx(JS,{}),ie.length>0?h.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 min-w-[14px] h-3.5 px-0.5 rounded-full bg-accent text-[8px] font-bold text-surface-950 flex items-center justify-center leading-none",children:ie.length>99?"99+":ie.length}):null]}),h.jsxs("button",{type:"button",onClick:()=>k("tests"),title:`Tests (${ke.length})`,"aria-current":v==="tests"?"page":void 0,className:`relative touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${v==="tests"?"border-accent/60 bg-accent/15 text-accent":"border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:[h.jsx(t2,{}),ke.length>0?h.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 min-w-[14px] h-3.5 px-0.5 rounded-full bg-emerald-500 text-[8px] font-bold text-surface-950 flex items-center justify-center leading-none",children:ke.length>99?"99+":ke.length}):null]}),h.jsx("button",{type:"button",onClick:()=>k("history"),title:"Historial de Probar","aria-current":v==="history"?"page":void 0,className:`touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${v==="history"?"border-accent/60 bg-accent/15 text-accent":"border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:h.jsx(e2,{})}),h.jsx("button",{type:"button",onClick:()=>k("schemas"),title:"Esquemas","aria-current":v==="schemas"?"page":void 0,className:`touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${v==="schemas"?"border-accent/60 bg-accent/15 text-accent":"border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:h.jsx(ZS,{})}),h.jsx("button",{type:"button",onClick:()=>It(!0),title:"Asistente: configurar API de IA",className:"touch-target w-11 h-11 rounded-lg border border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-accent flex items-center justify-center shrink-0 transition-colors duration-200",children:h.jsx(Mg,{})}),h.jsxs("button",{type:"button",onClick:()=>k("auth"),title:"Auth","aria-current":v==="auth"?"page":void 0,className:`relative touch-target w-11 h-11 rounded-lg border flex items-center justify-center shrink-0 transition-colors duration-200 ${v==="auth"?"border-accent/60 bg-accent/15 text-accent":"border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200"}`,children:[h.jsx(n2,{}),Ke?h.jsx("span",{className:"absolute -top-0.5 -right-0.5 w-2 h-2 rounded-full bg-emerald-400 border border-surface-900","aria-hidden":!0}):null]})]}),h.jsxs("div",{className:"flex flex-col gap-0.5 items-center w-full py-1 mt-auto border-t border-surface-700/80",children:[h.jsx("button",{type:"button",onClick:()=>void Tr(),title:"Exportar estado de la app (flujos, tests, spec local…)",className:"touch-target w-11 h-11 rounded-lg border border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200 flex items-center justify-center transition-colors duration-200",children:h.jsx(r2,{})}),h.jsx("button",{type:"button",onClick:()=>{var L;return(L=document.getElementById("adt-state-import"))==null?void 0:L.click()},title:"Importar estado de la app",className:"touch-target w-11 h-11 rounded-lg border border-transparent bg-surface-800/80 text-slate-400 hover:bg-surface-800 hover:text-slate-200 flex items-center justify-center transition-colors duration-200",children:h.jsx(o2,{})}),Ke?h.jsx("button",{type:"button",onClick:()=>void ht(),title:`Salir (${Ke.username})`,className:"touch-target w-11 h-11 rounded-lg border border-transparent bg-surface-800/80 text-rose-400/90 hover:bg-rose-950/50 flex items-center justify-center transition-colors duration-200",children:h.jsx(s2,{})}):null]})]}):null]}),h.jsxs("main",{id:"main-content",tabIndex:-1,className:"flex-1 flex flex-col min-h-0 outline-none",children:[h.jsx("header",{className:"glass-sticky-header sticky top-0 z-20 px-4 py-3 flex flex-wrap gap-3 items-center",children:h.jsxs("label",{className:"text-xs text-slate-500 flex flex-col gap-1 sm:flex-row sm:items-center",children:[h.jsx("span",{className:"shrink-0 font-medium text-slate-400",children:"Base URL"}),h.jsx("input",{className:"glass-input sm:ml-2 min-h-[44px] sm:min-h-0 border rounded-xl px-3 py-2 text-sm w-full max-w-md text-slate-200 transition-colors duration-200 hover:border-accent/30",value:j,onChange:L=>C(L.target.value),placeholder:"https://api.ejemplo.com",autoComplete:"url",spellCheck:!1})]})}),v==="explore"&&h.jsxs("div",{className:"flex-1 flex flex-col lg:flex-row min-h-0",children:[h.jsxs("div",{className:`glass-explore-rail shrink-0 border-b lg:border-b-0 lg:border-r border-surface-600/35 overflow-auto transition-[width] duration-200 ease-out lg:rounded-r-2xl ${Rn?"lg:w-14 lg:min-w-[3.5rem] max-h-16 lg:max-h-none":"lg:w-72 max-h-64 lg:max-h-none"}`,children:[h.jsxs("div",{className:Rn?"max-lg:block lg:hidden":"block",children:[h.jsxs("div",{className:"p-2 flex items-start justify-between gap-2 border-b border-surface-700 lg:border-b-0",children:[h.jsx("p",{className:"text-xs uppercase tracking-wider text-slate-500 shrink-0",children:"Tags"}),h.jsx("button",{type:"button",className:"hidden lg:flex shrink-0 touch-target rounded-lg border border-surface-600 bg-surface-800 text-slate-300 hover:bg-surface-700 items-center justify-center text-sm leading-none transition-colors duration-200",onClick:()=>Sn(!0),"aria-label":"Ocultar lista de endpoints",title:"Ocultar endpoints",children:"‹"})]}),h.jsx("div",{className:"p-2 pt-1",children:h.jsxs("div",{className:"flex flex-wrap gap-1",children:[h.jsx("button",{type:"button",onClick:()=>A(null),className:`text-xs px-3 py-2 sm:py-1 rounded-xl min-h-[40px] sm:min-h-0 transition-all duration-200 ${I===null?"glass-pill-active text-slate-100":"glass-pill text-slate-300"}`,children:"Todos"}),Dn.map(L=>h.jsx("button",{type:"button",onClick:()=>A(L),className:`text-xs px-3 py-2 sm:py-1 rounded-xl min-h-[40px] sm:min-h-0 transition-all duration-200 ${I===L?"glass-pill-active text-slate-100":"glass-pill text-slate-300"}`,children:L},L))]})}),h.jsx("ul",{className:"text-sm",children:er.map(L=>h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>Bn({method:L.method,path:L.path}),className:`w-full text-left px-3 py-2.5 sm:py-2 min-h-[44px] sm:min-h-0 flex gap-2 items-center transition-all duration-150 rounded-r-xl ${(T==null?void 0:T.method)===L.method&&T.path===L.path?"glass-pill-active border-l-2 border-accent ml-0.5":"hover:bg-white/[0.04]"}`,children:[h.jsx(Ii,{method:L.method}),h.jsxs("span",{className:"flex-1 min-w-0 flex items-center gap-1.5",children:[h.jsx("span",{className:"truncate text-slate-300",children:L.path}),r&&kd(r,L.method,L.path)?h.jsx("span",{className:"shrink-0 text-[9px] uppercase text-amber-400/90",title:"Deprecated",children:"dep"}):null]})]})},`${L.method}:${L.path}`))})]}),Rn?h.jsxs("div",{className:"max-lg:hidden lg:flex flex-1 flex-col items-stretch py-2 px-1 gap-1 min-h-0 min-w-0",children:[h.jsx("button",{type:"button",className:"touch-target w-11 h-11 mx-auto rounded-lg border border-surface-600 bg-surface-800 text-slate-200 hover:bg-surface-700 flex items-center justify-center shrink-0 transition-colors duration-200",onClick:()=>Sn(!1),"aria-label":"Mostrar lista de endpoints completa",title:"Expandir lista de endpoints",children:h.jsx(_m,{className:"text-slate-300"})}),h.jsxs("div",{className:"text-center text-[9px] font-mono text-slate-500 leading-none px-0.5",title:`${er.length} operación(es) (filtro actual)`,children:[h.jsx("span",{className:"block text-slate-400 font-semibold text-[11px]",children:er.length}),h.jsx("span",{className:"text-[8px] uppercase tracking-tighter",children:"ops"})]}),h.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden flex flex-col gap-0.5 min-h-0 max-h-[min(70vh,32rem)] items-center w-full",role:"list","aria-label":"Endpoints numerados",children:er.map((L,me)=>{const Fe=(T==null?void 0:T.method)===L.method&&T.path===L.path;return h.jsx("button",{type:"button",role:"listitem",title:`${L.method.toUpperCase()} ${L.path}`,onClick:()=>Bn({method:L.method,path:L.path}),className:`touch-target min-h-[40px] min-w-[40px] w-10 h-10 shrink-0 rounded-md border border-surface-700 bg-surface-900 text-[11px] font-mono font-semibold text-slate-200 hover:bg-surface-800 transition-colors duration-150 ${QS(L.method)} ${Fe?"ring-2 ring-accent/80 shadow-[inset_0_0_0_1px_rgba(56,189,248,0.2)]":""}`,children:me+1},`${L.method}:${L.path}`)})})]}):null]}),h.jsxs("div",{className:"flex-1 p-4 overflow-auto space-y-6",children:[h.jsxs("section",{className:"rounded-2xl border border-surface-600/50 bg-surface-900/45 p-4 space-y-3","aria-labelledby":"adt-openapi-tools-heading",children:[h.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[h.jsxs("div",{children:[h.jsx("h2",{id:"adt-openapi-tools-heading",className:"text-sm font-semibold text-slate-200",children:"Documento OpenAPI"}),h.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:["Fuente actual:"," ",h.jsx("span",{className:"text-slate-300 font-medium",children:c==="local"?"copia local (IndexedDB)":c==="remote"?"URL remota (?spec=…)":"servidor (openapi.json)"})]})]}),h.jsxs("div",{className:"flex flex-wrap gap-2 justify-end",children:[h.jsx("button",{type:"button",onClick:or,className:"text-xs px-3 py-2 rounded-xl glass-pill text-slate-200 min-h-[40px] sm:min-h-0 transition-colors duration-200",children:"Exportar OpenAPI"}),h.jsx("label",{htmlFor:"adt-openapi-import",className:"text-xs px-3 py-2 rounded-xl glass-pill text-slate-200 cursor-pointer min-h-[40px] sm:min-h-0 inline-flex items-center transition-colors duration-200",children:"Importar OpenAPI…"}),c==="local"?h.jsx("button",{type:"button",onClick:()=>void Un(),className:"text-xs px-3 py-2 rounded-xl border border-surface-600 text-slate-300 hover:bg-surface-800 min-h-[40px] sm:min-h-0 transition-colors duration-200",children:"Usar spec del servidor"}):null,c==="remote"?h.jsx("button",{type:"button",onClick:()=>gn(),className:"text-xs px-3 py-2 rounded-xl border border-surface-600 text-slate-300 hover:bg-surface-800 min-h-[40px] sm:min-h-0 transition-colors duration-200",children:"Usar openapi.json del sitio"}):null]})]}),h.jsxs("p",{className:"text-[11px] text-slate-500 leading-relaxed",children:["Importar guarda el JSON en tu navegador y sustituye al spec del servidor hasta que lo descartes. Exportar / importar el"," ",h.jsx("strong",{className:"text-slate-400",children:"estado de la app"})," (flujos, tests, entornos y este spec si existe) está en el menú lateral."]}),m?h.jsx("p",{className:"text-[11px] text-rose-300/95 rounded-lg border border-rose-500/35 bg-rose-950/30 px-3 py-2",role:"alert",children:m}):null]}),T?h.jsxs(h.Fragment,{children:[h.jsxs("div",{children:[h.jsxs("h2",{className:"font-display font-semibold text-white text-lg flex flex-wrap items-center gap-2",children:[h.jsx(Ii,{method:T.method,size:"md"}),h.jsx("span",{className:"font-mono text-slate-200 break-all",children:T.path}),r&&kd(r,T.method,T.path)?h.jsx("span",{className:"text-[10px] uppercase px-2 py-0.5 rounded-md border border-amber-500/40 text-amber-300 bg-amber-500/10",children:"deprecated"}):null]}),lt!=null&<.summary?h.jsx("p",{className:"text-sm text-slate-300 mt-2 leading-relaxed",children:lt.summary}):null,lt!=null&<.description&<.description!==lt.summary?h.jsx("p",{className:"text-xs text-slate-500 mt-2 leading-relaxed whitespace-pre-wrap",children:lt.description}):null,lt!=null&<.exampleStr?h.jsxs("details",{className:"mt-3 group",children:[h.jsx("summary",{className:"text-xs text-slate-400 cursor-pointer hover:text-slate-300",children:"Ejemplo de cuerpo (request)"}),h.jsx("pre",{className:"mt-2 glass-input border rounded-xl p-3 text-xs font-mono text-slate-200 overflow-auto max-h-48",children:lt.exampleStr})]}):null,h.jsxs("p",{className:"text-xs text-slate-500 mt-2",children:["Filtro de exportación de servicio: ",br]})]}),r?h.jsx(XS,{doc:r,selectedOp:T,baseUrl:j,buildHeaders:mr,hydrateEntry:tn,onHydrateConsumed:Fo}):null,h.jsxs("section",{className:"space-y-3",children:[h.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Snippets por lenguaje"}),h.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:$n&&_d.map(({id:L,label:me})=>h.jsxs("div",{className:"rounded-xl border border-surface-700 bg-surface-900/60 overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-surface-700 bg-surface-800/50",children:[h.jsx("span",{className:"text-xs font-medium text-accent",children:me}),h.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-surface-600",onClick:()=>void jm($n[L]),children:"Copiar"})]}),h.jsx("pre",{className:"text-[11px] p-3 overflow-auto max-h-56 text-slate-300 font-mono whitespace-pre-wrap",children:$n[L]})]},L))})]}),h.jsxs("section",{className:"space-y-3 rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[h.jsx("h3",{className:"text-sm font-medium text-slate-300",children:"Cliente / servicio generado"}),h.jsx("p",{className:"text-xs text-slate-500",children:br}),h.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[h.jsxs("label",{className:"text-xs text-slate-400",children:["Lenguaje del archivo",h.jsx("select",{className:"ml-2 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:P,onChange:L=>M(L.target.value),children:_d.map(({id:L,label:me})=>h.jsx("option",{value:L,children:me},L))})]}),h.jsx("button",{type:"button",className:"text-xs px-3 py-1.5 rounded-lg bg-surface-700 hover:bg-surface-600",onClick:()=>void jm(tr),children:"Copiar servicio"})]}),h.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:tr})]}),h.jsx("div",{className:"flex flex-wrap gap-2 pt-2 border-t border-surface-800",children:h.jsx("button",{type:"button",className:"text-xs px-3 py-2 rounded-lg bg-surface-800 hover:bg-surface-700",onClick:Jr,children:"Añadir operación actual a un flujo (ve a Flujos)"})})]}):h.jsx("p",{className:"text-slate-500",children:"Selecciona una operación en la lista."})]})]}),v==="history"&&h.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:h.jsx(k2,{listKey:pr,onReplay:zn})}),v==="schemas"&&h.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:h.jsx(x2,{doc:r})}),v==="flows"&&h.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[h.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4",children:[h.jsx("h3",{className:"text-sm font-semibold text-white mb-3",children:"Flujos guardados"}),ie.length===0?h.jsx("p",{className:"text-sm text-slate-500",children:"Aún no hay flujos. Crea uno en el editor y guarda."}):h.jsx("ul",{className:"space-y-2",children:ie.map(L=>{var me,Fe;return h.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:[h.jsxs("div",{children:[h.jsx("span",{className:"text-sm text-slate-200 font-medium",children:L.name}),h.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[(((Fe=(me=L.graph)==null?void 0:me.nodes)==null?void 0:Fe.length)??L.steps.length)||0," nodo(s)"]})]}),h.jsxs("div",{className:"flex flex-wrap gap-2",children:[h.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 rr(L),children:"Play"}),h.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent hover:bg-accent/30",onClick:()=>gr(L),children:"Editar"}),h.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 Wt(L.id),children:"Eliminar"})]})]},L.id!=null?`flow-${L.id}`:`flow-${L.name}`)})})]}),h.jsxs("section",{className:"space-y-4 max-w-6xl",children:[h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[h.jsx("h3",{className:"text-sm font-semibold text-white",children:"Editor de flujo (nodos y cables)"}),h.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:Ho,children:"Nuevo flujo"})]}),ze!=null&&h.jsxs("p",{className:"text-xs text-accent",children:["Editando flujo guardado (#",ze,")"]}),h.jsxs("p",{className:"text-sm text-slate-400",children:["Cada nodo es un endpoint del spec. Conecta ",h.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 ",h.jsx("code",{className:"text-accent",children:"{variable}"})," en la ruta)."]}),h.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm w-full max-w-md",value:ue,onChange:L=>Q(L.target.value),placeholder:"Nombre del flujo"}),h.jsx(MS,{doc:r,ops:Et,graph:X,onGraphChange:Fn},be),h.jsxs("div",{className:"flex flex-wrap gap-2",children:[h.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 nr(),children:"Play (grafo)"}),h.jsx("button",{type:"button",className:"px-3 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void yr(),children:ze!=null?"Guardar cambios":"Guardar flujo"})]}),h.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:q||"Resultado de la ejecución aquí."})]})]}),v==="tests"&&h.jsxs("div",{className:"p-4 space-y-6 overflow-auto max-w-5xl",children:[h.jsxs("section",{className:"rounded-xl border border-surface-700 bg-surface-900/50 p-4 space-y-3",children:[h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[h.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suites guardadas"}),ke.length>0&&h.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 ho(),children:"Ejecutar todas las suites"})]}),ke.length===0?h.jsx("p",{className:"text-sm text-slate-500",children:"Ninguna suite guardada."}):h.jsx("ul",{className:"space-y-2",children:ke.map(L=>h.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:[h.jsxs("div",{children:[h.jsx("span",{className:"text-sm text-slate-200 font-medium",children:L.name}),h.jsxs("span",{className:"text-xs text-slate-500 ml-2",children:[L.cases.length," caso(s)"]})]}),h.jsxs("div",{className:"flex flex-wrap gap-2",children:[h.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 Gr(L),children:"Play"}),h.jsx("button",{type:"button",className:"text-xs px-2 py-1.5 rounded bg-accent/20 text-accent",onClick:()=>Mt(L),children:"Editar"}),h.jsx("button",{type:"button",className:"text-xs px-2 py-1 rounded bg-surface-700 hover:bg-red-900/40",onClick:()=>void Vo(L.id),children:"Eliminar"})]})]},L.id!=null?`suite-${L.id}`:`suite-${L.name}`))})]}),h.jsxs("section",{className:"space-y-4",children:[h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[h.jsx("h3",{className:"text-sm font-semibold text-white",children:"Suite en edición"}),h.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:Vn,children:"Nueva suite"})]}),Ze!=null&&h.jsxs("p",{className:"text-xs text-accent",children:["Editando suite guardada (#",Ze,")"]}),h.jsx("input",{className:"bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm max-w-md",value:O.name,onChange:L=>K(me=>({...me,name:L.target.value})),placeholder:"Nombre de la suite"}),h.jsxs("div",{className:"flex flex-wrap gap-2 items-end rounded-xl border border-surface-700 bg-surface-900/40 p-4",children:[h.jsxs("label",{className:"text-xs text-slate-400 flex-1 min-w-[200px]",children:["Añadir endpoint del spec",h.jsx("select",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2 text-sm font-mono",value:Re,onChange:L=>_e(L.target.value),children:Et.map(L=>h.jsxs("option",{value:Sd(L.method,L.path),children:[L.method.toUpperCase()," ",L.path]},Sd(L.method,L.path)))})]}),h.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-800 text-sm hover:bg-surface-700",onClick:xr,children:"Añadir a la suite"})]}),h.jsx("ul",{className:"space-y-4",children:O.cases.map(L=>{const me=Em(L.expectStatus)?String(L.expectStatus):"custom";return h.jsxs("li",{className:"rounded-xl border border-surface-700 bg-surface-950/40 p-4 space-y-3 text-sm",children:[h.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[h.jsxs("span",{className:"flex flex-wrap items-center gap-2 min-w-0",children:[h.jsx(Ii,{method:L.method}),h.jsx("span",{className:"font-mono text-xs text-slate-300 break-all",children:L.path})]}),h.jsx("button",{type:"button",className:"text-xs text-red-400 hover:underline shrink-0",onClick:()=>po(L.id),children:"Quitar"})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[h.jsxs("label",{className:"text-xs text-slate-400 block",children:["Código HTTP esperado",h.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[h.jsxs("select",{className:"bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm max-w-[200px]",value:me,onChange:Fe=>{const Je=Fe.target.value;if(Je==="custom"){nn(L.id,{expectStatus:Em(L.expectStatus)?1e3:L.expectStatus});return}nn(L.id,{expectStatus:Number(Je)})},children:[Og.map(Fe=>h.jsx("option",{value:String(Fe.value),children:Fe.label},Fe.value)),h.jsx("option",{value:"custom",children:"Otro…"})]}),me==="custom"&&h.jsx("input",{type:"number",className:"w-20 bg-surface-800 border border-surface-600 rounded px-2 py-1.5 text-sm",value:L.expectStatus,onChange:Fe=>nn(L.id,{expectStatus:Number(Fe.target.value)||0})})]})]}),h.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["El body contiene (opcional)",h.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:L.contains??"",onChange:Fe=>nn(L.id,{contains:Fe.target.value||void 0})})]}),h.jsxs("label",{className:"text-xs text-slate-400 block",children:["JSON path (opcional)",h.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:L.jsonPath??"",onChange:Fe=>nn(L.id,{jsonPath:Fe.target.value||void 0})})]}),h.jsxs("label",{className:"text-xs text-slate-400 block sm:col-span-2",children:["Valor esperado en JSON path (opcional)",h.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:L.expectJsonValue??"",onChange:Fe=>nn(L.id,{expectJsonValue:Fe.target.value||void 0})})]})]})]},L.id)})}),h.jsxs("div",{className:"flex flex-wrap gap-2 items-center",children:[h.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 Hn(),children:"Correr todos los casos (suite actual)"}),h.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void wt(),children:Ze!=null?"Guardar cambios":"Guardar suite"})]}),h.jsx("pre",{className:"text-xs bg-surface-950 border border-surface-700 rounded-lg p-3 whitespace-pre-wrap min-h-[4rem]",children:Ae||"—"})]})]}),v==="auth"&&h.jsxs("div",{className:"p-4 space-y-4 max-w-lg",children:[h.jsxs("p",{className:"text-sm text-slate-400",children:["Esquemas en el spec: ",nx(r).join(", ")||"ninguno"]}),h.jsxs("label",{className:"block text-sm",children:["Bearer token",h.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:B,onChange:L=>U(L.target.value),placeholder:"eyJ..."})]}),h.jsxs("label",{className:"block text-sm",children:["API key header",h.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:fe,onChange:L=>Se(L.target.value)})]}),h.jsxs("label",{className:"block text-sm",children:["API key",h.jsx("input",{className:"mt-1 w-full bg-surface-800 border border-surface-600 rounded px-3 py-2",value:W,onChange:L=>Z(L.target.value),type:"password",autoComplete:"off"})]}),h.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-surface-700 text-sm",onClick:()=>void vr(),children:"Recordar en este navegador"})]})]})]}),h.jsx(g2,{open:_n,onClose:()=>fr(!1),ops:Qr,onPick:Dt}),vt?h.jsx("div",{className:"glass-modal-backdrop fixed inset-0 z-[110] flex items-end sm:items-center justify-center p-4 sm:p-6",role:"presentation",onClick:()=>It(!1),children:h.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"adt-llm-modal-title",className:"glass-modal-panel w-full max-w-md rounded-2xl max-h-[90vh] overflow-y-auto",onClick:L=>L.stopPropagation(),children:[h.jsxs("div",{className:"flex items-start justify-between gap-2 px-4 py-3 border-b border-white/[0.08]",children:[h.jsx("h2",{id:"adt-llm-modal-title",className:"text-sm font-semibold text-slate-100 pr-2",children:"Asistente: proveedor de IA"}),h.jsx("button",{type:"button",className:"shrink-0 touch-target min-w-[2.25rem] min-h-[2.25rem] rounded-xl text-slate-400 hover:text-white glass-pill text-lg leading-none",onClick:()=>It(!1),"aria-label":"Cerrar",children:"×"})]}),h.jsxs("div",{className:"px-4 py-4 space-y-3",children:[h.jsx("p",{className:"text-xs text-slate-400 leading-relaxed",children:"Tu clave se guarda solo en este navegador. El servidor la reenvía al proveedor; no se almacena en el servidor."}),h.jsxs("label",{className:"block text-xs text-slate-400",children:["Proveedor",h.jsxs("select",{className:"glass-input mt-1 w-full border rounded-xl px-3 py-2 text-sm text-slate-200",value:dt,onChange:L=>{const me=L.target.value;we(me),_t(Fe=>Fe.trim()?Fe:ou(me))},children:[h.jsx("option",{value:"anthropic",children:"Anthropic (Claude)"}),h.jsx("option",{value:"openai",children:"OpenAI"}),h.jsx("option",{value:"openrouter",children:"OpenRouter"})]})]}),h.jsxs("label",{className:"block text-xs text-slate-400",children:["Modelo (opcional)",h.jsx("input",{className:"glass-input mt-1 w-full border rounded-xl px-3 py-2 text-sm font-mono text-slate-200",value:tt,onChange:L=>_t(L.target.value),placeholder:ou(dt),spellCheck:!1})]}),h.jsxs("label",{className:"block text-xs text-slate-400",children:["API key",h.jsx("input",{type:"password",className:"glass-input mt-1 w-full border rounded-xl px-3 py-2 text-sm font-mono text-slate-200",value:Ct,onChange:L=>xt(L.target.value),placeholder:dt==="anthropic"?"sk-ant-…":dt==="openai"?"sk-…":"sk-or-v1-…",autoComplete:"off"})]}),h.jsxs("div",{className:"flex flex-wrap gap-2 pt-1",children:[h.jsx("button",{type:"button",onClick:Uo,className:"px-4 py-2.5 rounded-xl bg-accent text-surface-950 text-sm font-medium shadow-[0_8px_24px_-8px_rgb(var(--accent)/0.55)] hover:brightness-110 transition-[filter]",children:"Guardar"}),h.jsx("button",{type:"button",onClick:()=>It(!1),className:"px-4 py-2.5 rounded-xl glass-pill text-slate-300 text-sm",children:"Cancelar"})]})]})]})}):null,h.jsx(p2,{doc:r,contextExtras:fo,provider:dt,model:tt,apiKey:Ct,onOpenLlmSettings:ln}),h.jsx("footer",{className:"glass-footer px-3 py-2.5 text-center text-[11px] text-slate-500 shrink-0",children:"made with ♥ by andres arcila"})]})}const E2={surface950:"#0c0f14",surface900:"#12171f",surface800:"#1a2230",surface700:"#243044",accent:"#38bdf8",accentDim:"#0ea5e9"};function ji(t){const r=t.trim(),o=/^#?([0-9a-f]{6})$/i.exec(r);if(!o)return"12 15 20";const i=parseInt(o[1],16);return`${i>>16&255} ${i>>8&255} ${i&255}`}function j2(t){return{...E2,...t}}function C2(t){var i,l;const r=(i=t.logoBase64)==null?void 0:i.trim();return r?r.startsWith("data:")?r:`data:${((l=t.logoMimeType)==null?void 0:l.trim())||"image/png"};base64,${r}`:null}function P2(t){var o;const r=j2(t==null?void 0:t.colors);return{productName:((o=t==null?void 0:t.productName)==null?void 0:o.trim())||null,logoDataUrl:t?C2(t):null,colors:r,colorsRgb:{surface950:ji(r.surface950),surface900:ji(r.surface900),surface800:ji(r.surface800),surface700:ji(r.surface700),accent:ji(r.accent),accentDim:ji(r.accentDim)}}}const M2={credentials:"include"};function T2(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 I2(){const t=P2(void 0);try{const r=await fetch("/docs/ui-config.json",M2);return r.status===401?{...t,docsAuthRequired:!0}:r.ok?await r.json():t}catch{return t}}(async()=>{const t=await I2();T2(t.colorsRgb),Ry.createRoot(document.getElementById("root")).render(h.jsx(Cm.StrictMode,{children:h.jsx($S,{value:{productName:t.productName,logoDataUrl:t.logoDataUrl},children:h.jsx(N2,{})})}))})();
|