@api-doc-tor/express 0.2.1 → 0.2.2

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 Ey=Object.defineProperty;var jy=(t,r,o)=>r in t?Ey(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o;var Ds=(t,r,o)=>jy(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 Cy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Eu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var rd={exports:{}},ba={},od={exports:{}},xt={};/**
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 eh;function Py(){if(eh)return xt;eh=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,F=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)F.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 xt.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}},xt.Component=A,xt.Fragment=o,xt.Profiler=l,xt.PureComponent=V,xt.StrictMode=i,xt.Suspense=y,xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,xt.act=J,xt.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)F.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}},xt.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},xt.createElement=Z,xt.createFactory=function(O){var K=Z.bind(null,O);return K.type=O,K},xt.createRef=function(){return{current:null}},xt.forwardRef=function(O){return{$$typeof:m,render:O}},xt.isValidElement=Se,xt.lazy=function(O){return{$$typeof:_,_payload:{_status:-1,_result:O},_init:Q}},xt.memo=function(O,K){return{$$typeof:b,type:O,compare:K===void 0?null:K}},xt.startTransition=function(O){var K=H.transition;H.transition={};try{O()}finally{H.transition=K}},xt.unstable_act=J,xt.useCallback=function(O,K){return ie.current.useCallback(O,K)},xt.useContext=function(O){return ie.current.useContext(O)},xt.useDebugValue=function(){},xt.useDeferredValue=function(O){return ie.current.useDeferredValue(O)},xt.useEffect=function(O,K){return ie.current.useEffect(O,K)},xt.useId=function(){return ie.current.useId()},xt.useImperativeHandle=function(O,K,ke){return ie.current.useImperativeHandle(O,K,ke)},xt.useInsertionEffect=function(O,K){return ie.current.useInsertionEffect(O,K)},xt.useLayoutEffect=function(O,K){return ie.current.useLayoutEffect(O,K)},xt.useMemo=function(O,K){return ie.current.useMemo(O,K)},xt.useReducer=function(O,K,ke){return ie.current.useReducer(O,K,ke)},xt.useRef=function(O){return ie.current.useRef(O)},xt.useState=function(O){return ie.current.useState(O)},xt.useSyncExternalStore=function(O,K,ke){return ie.current.useSyncExternalStore(O,K,ke)},xt.useTransition=function(){return ie.current.useTransition()},xt.version="18.3.1",xt}var th;function La(){return th||(th=1,od.exports=Py()),od.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 nh;function My(){if(nh)return ba;nh=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 rh;function Ty(){return rh||(rh=1,rd.exports=My()),rd.exports}var h=Ty(),D=La();const Pm=Eu(D);var Kl={},sd={exports:{}},Jn={},id={exports:{}},ad={};/**
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 oh;function Iy(){return oh||(oh=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(F);else{var q=o(b);q!==null&&ie(M,q.startTime-H)}}function F(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(F))},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(F))),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}}}})(ad)),ad}var sh;function $y(){return sh||(sh=1,id.exports=Iy()),id.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 ih;function Ay(){if(ih)return Jn;ih=1;var t=La(),r=$y();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,F=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,B=x.length-1;1<=E&&0<=B&&p[E]!==x[B];)B--;for(;1<=E&&0<=B;E--,B--)if(p[E]!==x[B]){if(E!==1||B!==1)do if(E--,B--,0>B||p[E]!==x[B]){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<=B);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 ve(e,n){n=n.checked,n!=null&&P(e,"checked",n,!1)}function tt(e,n){ve(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")?Pt(e,n.type,s):n.hasOwnProperty("defaultValue")&&Pt(e,n.type,_e(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function bt(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 Pt(e,n,s){(n!=="number"||Ke(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var Ct=Array.isArray;function gt(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 jt(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(o(91));return J({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Gt(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(Ct(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 an(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function Mt(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 nn(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?Mt(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ln,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(ln=ln||document.createElement("div"),ln.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=ln.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},mn=["Webkit","ms","Moz","O"];Object.keys(In).forEach(function(e){mn.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 gn=null;function Jt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ve=null,Dn=null,Nt=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?Nt?Nt.push(e):Nt=[e]:Dn=e}function er(){if(Dn){var e=Dn,n=Nt;if(Nt=Dn=null,Qr(e),n)for(e=0;e<n.length;e++)Qr(n[e])}}function mr(e,n){return e(n)}function Bo(){}var zn=!1;function Fn(e,n,s){if(zn)return e(n,s);zn=!0;try{return mr(e,n,s)}finally{zn=!1,(Dn!==null||Nt!==null)&&(Bo(),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,B,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 Bn(e,n,s,u,p,x,E,B,Y){Pr=!1,nr=null,Dt.apply(Ho,arguments)}function yr(e,n,s,u,p,x,E,B,Y){if(Bn.apply(this,arguments),Pr){if(Pr){var xe=nr;Pr=!1,nr=null}else throw Error(o(198));rr||(rr=!0,gr=xe)}}function Yt(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(Yt(e)!==e)throw Error(o(188))}function rn(e){var n=e.alternate;if(!n){if(n=Yt(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,B=p.child;B;){if(B===s){E=!0,s=p,u=x;break}if(B===u){E=!0,u=p,s=x;break}B=B.sibling}if(!E){for(B=x.child;B;){if(B===s){E=!0,s=x,u=p;break}if(B===u){E=!0,u=x,s=p;break}B=B.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=rn(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,Tt=r.unstable_shouldYield,Vn=r.unstable_requestPaint,vt=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,yn=null;function ht(e){if(yn&&typeof yn.onCommitFiberRoot=="function")try{yn.onCommitFiberRoot(Un,e,void 0,(e.current.flags&128)===128)}catch{}}var un=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 B=E&~p;B!==0?u=L(B):(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-un(n),p=1<<s,u|=e[s],n&=~p;return u}function Be(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-un(x),B=1<<E,Y=p[E];Y===-1?((B&s)===0||(B&u)!==0)&&(p[E]=Be(B,n)):Y<=n&&(e.expiredLanes|=B),x&=~B}}function Et(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 Xt(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-un(n),e[n]=s}function qt(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-un(s),x=1<<p;n[p]=0,u[p]=-1,e[p]=-1,s&=~x}}function xn(e,n){var s=e.entangledLanes|=n;for(e=e.entanglements;s;){var u=31-un(s),p=1<<u;p&n|e[u]&n&&(e[u]|=n),s&=~p}}var wt=0;function ys(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var yt,Ir,Ws,Ka,Nn,Zr=!1,go=[],vn=null,$r=null,Ar=null,zt=new Map,wn=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":vn=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":wn.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 vn=qn(vn,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,wn.set(x,qn(wn.get(x)||null,e,n,s,u,p)),!0}return!1}function ir(e){var n=Es(e.target);if(n!==null){var s=Yt(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);gn=u,s.target.dispatchEvent(u),gn=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,vn!==null&&Ko(vn)&&(vn=null),$r!==null&&Ko($r)&&($r=null),Ar!==null&&Ko(Ar)&&(Ar=null),zt.forEach(Hi),wn.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(vn!==null&&Or(vn,e),$r!==null&&Or($r,e),Ar!==null&&Or(Ar,e),zt.forEach(n),wn.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=wt,x=xo.transition;xo.transition=null;try{wt=1,Ui(e,n,s,u)}finally{wt=p,xo.transition=x}}function Hu(e,n,s,u){var p=wt,x=xo.transition;xo.transition=null;try{wt=4,Ui(e,n,s,u)}finally{wt=p,xo.transition=x}}function Ui(e,n,s,u){if(Xs){var p=qo(e,n,s,u);if(p===null)Wu(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&&yt(x),x=qo(e,n,s,u),x===null&&Wu(e,n,u,vo,s),x===p)break;p=x}p!==null&&u.stopPropagation()}else Wu(e,n,u,null,s)}}var vo=null;function qo(e,n,s,u){if(vo=null,e=Jt(u),e=Es(e),e!==null)if(n=Yt(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 cn(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 B in e)e.hasOwnProperty(B)&&(s=e[B],this[B]=s?s(x):x[B]);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=cn(Rr),ks=J({},Rr,{view:0,detail:0}),Yo=cn(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=cn(Xo),dn=J({},Xo,{dataTransfer:0}),Ss=cn(dn),Ns=J({},ks,{relatedTarget:0}),ti=cn(Ns),ni=J({},Rr,{animationName:0,elapsedTime:0,pseudoElement:0}),qa=cn(ni),Wa=J({},Rr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ri=cn(Wa),qi=J({},Rr,{data:0}),to=cn(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 Vu=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=cn(Vu),ii=J({},Xo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ya=cn(ii),Gi=J({},ks,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:si}),Ji=cn(Gi),Uu=J({},Rr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xa=cn(Uu),Ku=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=cn(Ku),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){gf(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,Jt(e)),Fn(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,we=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(we,"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 Zt=0;Zt<ft.length;Zt++){var es=ft[Zt],bn=es.toLowerCase(),No=es[0].toUpperCase()+es.slice(1);At(bn,"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(" "),Lg=new Set("cancel close invalid load scroll toggle".split(" ").concat(Eo));function mf(e,n,s){var u=e.type||"unknown-event";e.currentTarget=s,yr(u,n,void 0,e),e.currentTarget=null}function gf(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 B=u[E],Y=B.instance,xe=B.currentTarget;if(B=B.listener,Y!==x&&p.isPropagationStopped())break e;mf(p,B,xe),x=Y}else for(E=0;E<u.length;E++){if(B=u[E],Y=B.instance,xe=B.currentTarget,B=B.listener,Y!==x&&p.isPropagationStopped())break e;mf(p,B,xe),x=Y}}}if(rr)throw e=gr,rr=!1,gr=null,e}function Ot(e,n){var s=n[Zu];s===void 0&&(s=n[Zu]=new Set);var u=e+"__bubble";s.has(u)||(yf(n,e,2,!1),s.add(u))}function qu(e,n,s){var u=0;n&&(u|=4),yf(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"&&(Lg.has(s)||qu(s,!1,e),qu(s,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[nl]||(n[nl]=!0,qu("selectionchange",!1,n))}}function yf(e,n,s,u){switch(Qs(n)){case 1:var p=vs;break;case 4:p=Hu;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 Wu(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 B=u.stateNode.containerInfo;if(B===p||B.nodeType===8&&B.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(;B!==null;){if(E=Es(B),E===null)return;if(Y=E.tag,Y===5||Y===6){u=x=E;continue e}B=B.parentNode}}u=u.return}Fn(function(){var xe=x,Te=Jt(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 Fe=ge.stateNode;if(ge.tag===5&&Fe!==null&&(ge=Fe,he!==null&&(Fe=$n(re,he),Fe!=null&&Ge.push(oa(re,Fe,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!==gn&&(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=Yt(Qe),Qe!==Qt||Qe.tag!==5&&Qe.tag!==6)&&(Qe=null)):(qe=null,Qe=xe),qe!==Qe)){if(Ge=ei,Fe="onMouseLeave",he="onMouseEnter",re="mouse",(e==="pointerout"||e==="pointerover")&&(Ge=Ya,Fe="onPointerLeave",he="onPointerEnter",re="pointer"),Qt=qe==null?Me:di(qe),ge=Qe==null?Me:di(Qe),Me=new Ge(Fe,re+"leave",qe,s,Te),Me.target=Qt,Me.relatedTarget=ge,Fe=null,Es(Te)===xe&&(Ge=new Ge(he,re+"enter",Qe,s,Te),Ge.target=ge,Ge.relatedTarget=Qt,Fe=Ge),Qt=Fe,qe&&Qe)t:{for(Ge=qe,he=Qe,re=0,ge=Ge;ge;ge=ui(ge))re++;for(ge=0,Fe=he;Fe;Fe=ui(Fe))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&&xf($e,Me,qe,Ge,!1),Qe!==null&&Qt!==null&&xf($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"&&Pt(Me,"number",Me.value)}switch(ot=xe?di(xe):window,e){case"focusin":(ko(ot)||ot.contentEditable==="true")&&(pe=ot,we=xe,je=null);break;case"focusout":je=we=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))}gf($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 xf(e,n,s,u,p){for(var x=n._reactName,E=[];s!==null&&s!==u;){var B=s,Y=B.alternate,xe=B.stateNode;if(Y!==null&&Y===u)break;B.tag===5&&xe!==null&&(B=xe,p?(Y=$n(s,x),Y!=null&&E.unshift(oa(s,Y,B))):p||(Y=$n(s,x),Y!=null&&E.push(oa(s,Y,B)))),s=s.return}E.length!==0&&e.push({event:n,listeners:E})}var Dg=/\r\n?/g,zg=/\u0000|\uFFFD/g;function vf(e){return(typeof e=="string"?e:""+e).replace(Dg,`
38
+ `).replace(zg,"")}function ol(e,n,s){if(n=vf(n),vf(e)!==n&&s)throw Error(o(425))}function sl(){}var Yu=null,Xu=null;function Qu(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 Gu=typeof setTimeout=="function"?setTimeout:void 0,Fg=typeof clearTimeout=="function"?clearTimeout:void 0,wf=typeof Promise=="function"?Promise:void 0,Bg=typeof queueMicrotask=="function"?queueMicrotask:typeof wf<"u"?function(e){return wf.resolve(null).then(e).catch(Hg)}:Gu;function Hg(e){setTimeout(function(){throw e})}function Ju(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 bf(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,Zu="__reactEvents$"+ci,Vg="__reactListeners$"+ci,Ug="__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=bf(e);e!==null;){if(s=e[no])return s;e=bf(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 ec=[],fi=-1;function ns(e){return{current:e}}function Rt(e){0>fi||(e.current=ec[fi],ec[fi]=null,fi--)}function It(e,n){fi++,ec[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 kf(e,n,s){if(jn.current!==rs)throw Error(o(168));It(jn,n),It(Wn,s)}function _f(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,It(jn,e),It(Wn,Wn.current),!0}function Sf(e,n,s){var u=e.stateNode;if(!u)throw Error(o(169));s?(e=_f(e,n,js),u.__reactInternalMemoizedMergedChildContext=e,Rt(Wn),Rt(jn),It(jn,e)):Rt(Wn),It(Wn,s)}var Co=null,ul=!1,tc=!1;function Nf(e){Co===null?Co=[e]:Co.push(e)}function Kg(e){ul=!0,Nf(e)}function os(){if(!tc&&Co!==null){tc=!0;var e=0,n=wt;try{var s=Co;for(wt=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{wt=n,tc=!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 Ef(e,n,s){_r[Sr++]=Po,_r[Sr++]=Mo,_r[Sr++]=Cs,Cs=e;var u=Po;e=Mo;var p=32-un(u)-1;u&=~(1<<p),s+=1;var x=32-un(n)+p;if(30<x){var E=p-p%5;x=(u&(1<<E)-1).toString(32),u>>=E,p-=E,Po=1<<32-un(n)+p|s<<p|u,Mo=x+e}else Po=1<<x|s<<p|u,Mo=e}function nc(e){e.return!==null&&(Ps(e,1),Ef(e,1,0))}function rc(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,Ft=!1,Fr=null;function jf(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 Cf(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 oc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function sc(e){if(Ft){var n=lr;if(n){var s=n;if(!Cf(e,n)){if(oc(e))throw Error(o(418));n=ts(s.nextSibling);var u=ar;n&&Cf(e,n)?jf(u,s):(e.flags=e.flags&-4097|2,Ft=!1,ar=e)}}else{if(oc(e))throw Error(o(418));e.flags=e.flags&-4097|2,Ft=!1,ar=e}}}function Pf(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(!Ft)return Pf(e),Ft=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!Qu(e.type,e.memoizedProps)),n&&(n=lr)){if(oc(e))throw Mf(),Error(o(418));for(;n;)jf(e,n),n=ts(n.nextSibling)}if(Pf(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 Mf(){for(var e=lr;e;)e=ts(e.nextSibling)}function gi(){lr=ar=null,Ft=!1}function ic(e){Fr===null?Fr=[e]:Fr.push(e)}var qg=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 B=p.refs;E===null?delete B[x]:B[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 Tf(e){var n=e._init;return n(e._payload)}function If(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 B(he,re,ge,Fe){return re===null||re.tag!==6?(re=Gc(ge,he.mode,Fe),re.return=he,re):(re=p(re,ge),re.return=he,re)}function Y(he,re,ge,Fe){var et=ge.type;return et===W?Te(he,re,ge.props.children,Fe,ge.key):re!==null&&(re.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===Q&&Tf(et)===re.type)?(Fe=p(re,ge.props),Fe.ref=aa(he,re,ge),Fe.return=he,Fe):(Fe=Ll(ge.type,ge.key,ge.props,null,he.mode,Fe),Fe.ref=aa(he,re,ge),Fe.return=he,Fe)}function xe(he,re,ge,Fe){return re===null||re.tag!==4||re.stateNode.containerInfo!==ge.containerInfo||re.stateNode.implementation!==ge.implementation?(re=Jc(ge,he.mode,Fe),re.return=he,re):(re=p(re,ge.children||[]),re.return=he,re)}function Te(he,re,ge,Fe,et){return re===null||re.tag!==7?(re=Ls(ge,he.mode,Fe,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=Gc(""+re,he.mode,ge),re.return=he,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case F: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=Jc(re,he.mode,ge),re.return=he,re;case Q:var Fe=re._init;return $e(he,Fe(re._payload),ge)}if(Ct(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,Fe){var et=re!==null?re.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number")return et!==null?null:B(he,re,""+ge,Fe);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case F:return ge.key===et?Y(he,re,ge,Fe):null;case U:return ge.key===et?xe(he,re,ge,Fe):null;case Q:return et=ge._init,Me(he,re,et(ge._payload),Fe)}if(Ct(ge)||q(ge))return et!==null?null:Te(he,re,ge,Fe,null);pl(he,ge)}return null}function qe(he,re,ge,Fe,et){if(typeof Fe=="string"&&Fe!==""||typeof Fe=="number")return he=he.get(ge)||null,B(re,he,""+Fe,et);if(typeof Fe=="object"&&Fe!==null){switch(Fe.$$typeof){case F:return he=he.get(Fe.key===null?ge:Fe.key)||null,Y(re,he,Fe,et);case U:return he=he.get(Fe.key===null?ge:Fe.key)||null,xe(re,he,Fe,et);case Q:var ot=Fe._init;return qe(he,re,ge,ot(Fe._payload),et)}if(Ct(Fe)||q(Fe))return he=he.get(ge)||null,Te(re,he,Fe,et,null);pl(re,Fe)}return null}function Qe(he,re,ge,Fe){for(var et=null,ot=null,st=re,ut=re=0,hn=null;st!==null&&ut<ge.length;ut++){st.index>ut?(hn=st,st=null):hn=st.sibling;var St=Me(he,st,ge[ut],Fe);if(St===null){st===null&&(st=hn);break}e&&st&&St.alternate===null&&n(he,st),re=x(St,re,ut),ot===null?et=St:ot.sibling=St,ot=St,st=hn}if(ut===ge.length)return s(he,st),Ft&&Ps(he,ut),et;if(st===null){for(;ut<ge.length;ut++)st=$e(he,ge[ut],Fe),st!==null&&(re=x(st,re,ut),ot===null?et=st:ot.sibling=st,ot=st);return Ft&&Ps(he,ut),et}for(st=u(he,st);ut<ge.length;ut++)hn=qe(st,he,ut,ge[ut],Fe),hn!==null&&(e&&hn.alternate!==null&&st.delete(hn.key===null?ut:hn.key),re=x(hn,re,ut),ot===null?et=hn:ot.sibling=hn,ot=hn);return e&&st.forEach(function(ps){return n(he,ps)}),Ft&&Ps(he,ut),et}function Ge(he,re,ge,Fe){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,hn=null,St=ge.next();st!==null&&!St.done;ut++,St=ge.next()){st.index>ut?(hn=st,st=null):hn=st.sibling;var ps=Me(he,st,St.value,Fe);if(ps===null){st===null&&(st=hn);break}e&&st&&ps.alternate===null&&n(he,st),re=x(ps,re,ut),ot===null?et=ps:ot.sibling=ps,ot=ps,st=hn}if(St.done)return s(he,st),Ft&&Ps(he,ut),et;if(st===null){for(;!St.done;ut++,St=ge.next())St=$e(he,St.value,Fe),St!==null&&(re=x(St,re,ut),ot===null?et=St:ot.sibling=St,ot=St);return Ft&&Ps(he,ut),et}for(st=u(he,st);!St.done;ut++,St=ge.next())St=qe(st,he,ut,St.value,Fe),St!==null&&(e&&St.alternate!==null&&st.delete(St.key===null?ut:St.key),re=x(St,re,ut),ot===null?et=St:ot.sibling=St,ot=St);return e&&st.forEach(function(Ny){return n(he,Ny)}),Ft&&Ps(he,ut),et}function Qt(he,re,ge,Fe){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 F: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&&Tf(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,Fe,ge.key),re.return=he,he=re):(Fe=Ll(ge.type,ge.key,ge.props,null,he.mode,Fe),Fe.ref=aa(he,re,ge),Fe.return=he,he=Fe)}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=Jc(ge,he.mode,Fe),re.return=he,he=re}return E(he);case Q:return ot=ge._init,Qt(he,re,ot(ge._payload),Fe)}if(Ct(ge))return Qe(he,re,ge,Fe);if(q(ge))return Ge(he,re,ge,Fe);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=Gc(ge,he.mode,Fe),re.return=he,he=re),E(he)):s(he,re)}return Qt}var yi=If(!0),$f=If(!1),hl=ns(null),ml=null,xi=null,ac=null;function lc(){ac=xi=ml=null}function uc(e){var n=hl.current;Rt(hl),e._currentValue=n}function cc(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,ac=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(ac!==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 dc(e){Ms===null?Ms=[e]:Ms.push(e)}function Af(e,n,s,u){var p=n.interleaved;return p===null?(s.next=s,dc(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 fc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Of(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,(_t&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,dc(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,xn(e,s)}}function Rf(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,B=p.shared.pending;if(B!==null){p.shared.pending=null;var Y=B,xe=Y.next;Y.next=null,E===null?x=xe:E.next=xe,E=Y;var Te=e.alternate;Te!==null&&(Te=Te.updateQueue,B=Te.lastBaseUpdate,B!==E&&(B===null?Te.firstBaseUpdate=xe:B.next=xe,Te.lastBaseUpdate=Y))}if(x!==null){var $e=p.baseState;E=0,Te=xe=Y=null,B=x;do{var Me=B.lane,qe=B.eventTime;if((u&Me)===Me){Te!==null&&(Te=Te.next={eventTime:qe,lane:0,tag:B.tag,payload:B.payload,callback:B.callback,next:null});e:{var Qe=e,Ge=B;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}}B.callback!==null&&B.lane!==0&&(e.flags|=64,Me=p.effects,Me===null?p.effects=[B]:Me.push(B))}else qe={eventTime:qe,lane:Me,tag:B.tag,payload:B.payload,callback:B.callback,next:null},Te===null?(xe=Te=qe,Y=$e):Te=Te.next=qe,E|=Me;if(B=B.next,B===null){if(B=p.shared.pending,B===null)break;Me=B,B=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 Lf(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 pc(e,n){switch(It(ca,n),It(ua,e),It(ro,la),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:nn(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=nn(n,e)}Rt(ro),It(ro,n)}function wi(){Rt(ro),Rt(ua),Rt(ca)}function Df(e){Ts(ca.current);var n=Ts(ro.current),s=nn(n,e.type);n!==s&&(It(ua,e),It(ro,s))}function hc(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 mc=[];function gc(){for(var e=0;e<mc.length;e++)mc[e]._workInProgressVersionPrimary=null;mc.length=0}var vl=M.ReactCurrentDispatcher,yc=M.ReactCurrentBatchConfig,Is=0,Kt=null,on=null,fn=null,wl=!1,da=!1,fa=0,Wg=0;function Cn(){throw Error(o(321))}function xc(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 vc(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?Gg:Jg,e=s(u,p),da){x=0;do{if(da=!1,fa=0,25<=x)throw Error(o(301));x+=1,fn=on=null,n.updateQueue=null,vl.current=Zg,e=s(u,p)}while(da)}if(vl.current=_l,n=on!==null&&on.next!==null,Is=0,fn=on=Kt=null,wl=!1,n)throw Error(o(300));return e}function wc(){var e=fa!==0;return fa=0,e}function oo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return fn===null?Kt.memoizedState=fn=e:fn=fn.next=e,fn}function Er(){if(on===null){var e=Kt.alternate;e=e!==null?e.memoizedState:null}else e=on.next;var n=fn===null?Kt.memoizedState:fn.next;if(n!==null)fn=n,on=e;else{if(e===null)throw Error(o(310));on=e,e={memoizedState:on.memoizedState,baseState:on.baseState,baseQueue:on.baseQueue,queue:on.queue,next:null},fn===null?Kt.memoizedState=fn=e:fn=fn.next=e}return fn}function pa(e,n){return typeof n=="function"?n(e):n}function bc(e){var n=Er(),s=n.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var u=on,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 B=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?(B=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=B,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 kc(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 zf(){}function Ff(e,n){var s=Kt,u=Er(),p=n(),x=!ce(u.memoizedState,p);if(x&&(u.memoizedState=p,Xn=!0),u=u.queue,_c(Vf.bind(null,s,u,e),[e]),u.getSnapshot!==n||x||fn!==null&&fn.memoizedState.tag&1){if(s.flags|=2048,ha(9,Hf.bind(null,s,u,p,n),void 0,null),pn===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 Hf(e,n,s,u){n.value=s,n.getSnapshot=u,Uf(n)&&Kf(e)}function Vf(e,n,s){return s(function(){Uf(n)&&Kf(e)})}function Uf(e){var n=e.getSnapshot;e=e.value;try{var s=n();return!ce(e,s)}catch{return!0}}function Kf(e){var n=To(e,1);n!==null&&Ur(n,e,1,-1)}function qf(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=Qg.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 Wf(){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(on!==null){var E=on.memoizedState;if(x=E.destroy,u!==null&&xc(u,E.deps)){p.memoizedState=ha(n,s,x,u);return}}Kt.flags|=e,p.memoizedState=ha(1|n,s,x,u)}function Yf(e,n){return bl(8390656,8,e,n)}function _c(e,n){return kl(2048,8,e,n)}function Xf(e,n){return kl(4,2,e,n)}function Qf(e,n){return kl(4,4,e,n)}function Gf(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 Jf(e,n,s){return s=s!=null?s.concat([e]):null,kl(4,4,Gf.bind(null,n,e),s)}function Sc(){}function Zf(e,n){var s=Er();n=n===void 0?null:n;var u=s.memoizedState;return u!==null&&n!==null&&xc(n,u[1])?u[0]:(s.memoizedState=[e,n],e)}function ep(e,n){var s=Er();n=n===void 0?null:n;var u=s.memoizedState;return u!==null&&n!==null&&xc(n,u[1])?u[0]:(e=e(),s.memoizedState=[e,n],e)}function tp(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 Yg(e,n){var s=wt;wt=s!==0&&4>s?s:4,e(!0);var u=yc.transition;yc.transition={};try{e(!1),n()}finally{wt=s,yc.transition=u}}function np(){return Er().memoizedState}function Xg(e,n,s){var u=cs(e);if(s={lane:u,action:s,hasEagerState:!1,eagerState:null,next:null},rp(e))op(n,s);else if(s=Af(e,n,s,u),s!==null){var p=On();Ur(s,e,u,p),sp(s,n,u)}}function Qg(e,n,s){var u=cs(e),p={lane:u,action:s,hasEagerState:!1,eagerState:null,next:null};if(rp(e))op(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,B=x(E,s);if(p.hasEagerState=!0,p.eagerState=B,ce(B,E)){var Y=n.interleaved;Y===null?(p.next=p,dc(n)):(p.next=Y.next,Y.next=p),n.interleaved=p;return}}catch{}finally{}s=Af(e,n,p,u),s!==null&&(p=On(),Ur(s,e,u,p),sp(s,n,u))}}function rp(e){var n=e.alternate;return e===Kt||n!==null&&n===Kt}function op(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 sp(e,n,s){if((s&4194240)!==0){var u=n.lanes;u&=e.pendingLanes,s|=u,n.lanes=s,xn(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},Gg={readContext:Nr,useCallback:function(e,n){return oo().memoizedState=[e,n===void 0?null:n],e},useContext:Nr,useEffect:Yf,useImperativeHandle:function(e,n,s){return s=s!=null?s.concat([e]):null,bl(4194308,4,Gf.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=Xg.bind(null,Kt,e),[u.memoizedState,e]},useRef:function(e){var n=oo();return e={current:e},n.memoizedState=e},useState:qf,useDebugValue:Sc,useDeferredValue:function(e){return oo().memoizedState=e},useTransition:function(){var e=qf(!1),n=e[0];return e=Yg.bind(null,e[1]),oo().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,s){var u=Kt,p=oo();if(Ft){if(s===void 0)throw Error(o(407));s=s()}else{if(s=n(),pn===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,Yf(Vf.bind(null,u,x,e),[e]),u.flags|=2048,ha(9,Hf.bind(null,u,x,s,n),void 0,null),s},useId:function(){var e=oo(),n=pn.identifierPrefix;if(Ft){var s=Mo,u=Po;s=(u&~(1<<32-un(u)-1)).toString(32)+s,n=":"+n+"R"+s,s=fa++,0<s&&(n+="H"+s.toString(32)),n+=":"}else s=Wg++,n=":"+n+"r"+s.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},Jg={readContext:Nr,useCallback:Zf,useContext:Nr,useEffect:_c,useImperativeHandle:Jf,useInsertionEffect:Xf,useLayoutEffect:Qf,useMemo:ep,useReducer:bc,useRef:Wf,useState:function(){return bc(pa)},useDebugValue:Sc,useDeferredValue:function(e){var n=Er();return tp(n,on.memoizedState,e)},useTransition:function(){var e=bc(pa)[0],n=Er().memoizedState;return[e,n]},useMutableSource:zf,useSyncExternalStore:Ff,useId:np,unstable_isNewReconciler:!1},Zg={readContext:Nr,useCallback:Zf,useContext:Nr,useEffect:_c,useImperativeHandle:Jf,useInsertionEffect:Xf,useLayoutEffect:Qf,useMemo:ep,useReducer:kc,useRef:Wf,useState:function(){return kc(pa)},useDebugValue:Sc,useDeferredValue:function(e){var n=Er();return on===null?n.memoizedState=e:tp(n,on.memoizedState,e)},useTransition:function(){var e=kc(pa)[0],n=Er().memoizedState;return[e,n]},useMutableSource:zf,useSyncExternalStore:Ff,useId:np,unstable_isNewReconciler:!1};function Br(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 Nc(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)?Yt(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 ip(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 ap(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 lp(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 Ec(e,n,s,u){var p=e.stateNode;p.props=s,p.state=e.memoizedState,p.refs={},fc(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"&&(Nc(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 jc(e,n,s){return{value:e,source:null,stack:s??null,digest:n??null}}function Cc(e,n){try{console.error(n.value)}catch(s){setTimeout(function(){throw s})}}var ey=typeof WeakMap=="function"?WeakMap:Map;function up(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,Vc=u),Cc(e,n)},s}function cp(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(){Cc(e,n)}}var x=e.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(s.callback=function(){Cc(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 dp(e,n,s){var u=e.pingCache;if(u===null){u=e.pingCache=new ey;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=hy.bind(null,e,n,s),n.then(e,e))}function fp(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 pp(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 ty=M.ReactCurrentOwner,Xn=!1;function An(e,n,s,u){n.child=e===null?$f(n,null,s,u):yi(n,e.child,s,u)}function hp(e,n,s,u,p){s=s.render;var x=n.ref;return vi(n,p),u=vc(e,n,s,u,x,p),s=wc(),e!==null&&!Xn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,$o(e,n,p)):(Ft&&s&&nc(n),n.flags|=1,An(e,n,u,p),n.child)}function mp(e,n,s,u,p){if(e===null){var x=s.type;return typeof x=="function"&&!Qc(x)&&x.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(n.tag=15,n.type=x,gp(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 gp(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 Pc(e,n,s,u,p)}function yp(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},It(_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,It(_i,ur),ur|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=x!==null?x.baseLanes:s,It(_i,ur),ur|=u}else x!==null?(u=x.baseLanes|s,n.memoizedState=null):u=s,It(_i,ur),ur|=u;return An(e,n,p,s),n.child}function xp(e,n){var s=n.ref;(e===null&&s!==null||e!==null&&e.ref!==s)&&(n.flags|=512,n.flags|=2097152)}function Pc(e,n,s,u,p){var x=Yn(s)?js:jn.current;return x=pi(n,x),vi(n,p),s=vc(e,n,s,u,x,p),u=wc(),e!==null&&!Xn?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~p,$o(e,n,p)):(Ft&&u&&nc(n),n.flags|=1,An(e,n,s,p),n.child)}function vp(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),ap(n,s,u),Ec(n,s,u,p),u=!0;else if(e===null){var E=n.stateNode,B=n.memoizedProps;E.props=B;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"||(B!==u||Y!==xe)&&lp(n,E,u,xe),ss=!1;var Me=n.memoizedState;E.state=Me,yl(n,u,E,p),Y=n.memoizedState,B!==u||Me!==Y||Wn.current||ss?(typeof Te=="function"&&(Nc(n,s,Te,u),Y=n.memoizedState),(B=ss||ip(n,s,B,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=B):(typeof E.componentDidMount=="function"&&(n.flags|=4194308),u=!1)}else{E=n.stateNode,Of(e,n),B=n.memoizedProps,xe=n.type===n.elementType?B:Br(n.type,B),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"||(B!==$e||Me!==Y)&&lp(n,E,u,Y),ss=!1,Me=n.memoizedState,E.state=Me,yl(n,u,E,p);var Qe=n.memoizedState;B!==$e||Me!==Qe||Wn.current||ss?(typeof qe=="function"&&(Nc(n,s,qe,u),Qe=n.memoizedState),(xe=ss||ip(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"||B===e.memoizedProps&&Me===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||B===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"||B===e.memoizedProps&&Me===e.memoizedState||(n.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||B===e.memoizedProps&&Me===e.memoizedState||(n.flags|=1024),u=!1)}return Mc(e,n,s,u,x,p)}function Mc(e,n,s,u,p,x){xp(e,n);var E=(n.flags&128)!==0;if(!u&&!E)return p&&Sf(n,s,!1),$o(e,n,x);u=n.stateNode,ty.current=n;var B=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,B,x)):An(e,n,B,x),n.memoizedState=u.state,p&&Sf(n,s,!0),n.child}function wp(e){var n=e.stateNode;n.pendingContext?kf(e,n.pendingContext,n.pendingContext!==n.context):n.context&&kf(e,n.context,!1),pc(e,n.containerInfo)}function bp(e,n,s,u,p){return gi(),ic(p),n.flags|=256,An(e,n,s,u),n.child}var Tc={dehydrated:null,treeContext:null,retryLane:0};function Ic(e){return{baseLanes:e,cachePool:null,transitions:null}}function kp(e,n,s){var u=n.pendingProps,p=Ut.current,x=!1,E=(n.flags&128)!==0,B;if((B=E)||(B=e!==null&&e.memoizedState===null?!1:(p&2)!==0),B?(x=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(p|=1),It(Ut,p&1),e===null)return sc(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=Ic(s),n.memoizedState=Tc,e):$c(n,E));if(p=e.memoizedState,p!==null&&(B=p.dehydrated,B!==null))return ny(e,n,E,u,B,p,s);if(x){x=u.fallback,E=n.mode,p=e.child,B=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),B!==null?x=fs(B,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?Ic(s):{baseLanes:E.baseLanes|s,cachePool:null,transitions:E.transitions},x.memoizedState=E,x.childLanes=e.childLanes&~s,n.memoizedState=Tc,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 $c(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&&ic(u),yi(n,e.child,null,s),e=$c(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function ny(e,n,s,u,p,x,E){if(s)return n.flags&256?(n.flags&=-257,u=jc(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=Ic(E),n.memoizedState=Tc,x);if((n.mode&1)===0)return Nl(e,n,E,null);if(p.data==="$!"){if(u=p.nextSibling&&p.nextSibling.dataset,u)var B=u.dgst;return u=B,x=Error(o(419)),u=jc(x,u,void 0),Nl(e,n,E,u)}if(B=(E&e.childLanes)!==0,Xn||B){if(u=pn,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 Xc(),u=jc(Error(o(421))),Nl(e,n,E,u)}return p.data==="$?"?(n.flags|=128,n.child=e.child,n=my.bind(null,e),p._reactRetry=n,null):(e=x.treeContext,lr=ts(p.nextSibling),ar=n,Ft=!0,Fr=null,e!==null&&(_r[Sr++]=Po,_r[Sr++]=Mo,_r[Sr++]=Cs,Po=e.id,Mo=e.overflow,Cs=n),n=$c(n,u.children),n.flags|=4096,n)}function _p(e,n,s){e.lanes|=n;var u=e.alternate;u!==null&&(u.lanes|=n),cc(e.return,n,s)}function Ac(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 Sp(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&&_p(e,s,n);else if(e.tag===19)_p(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(It(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),Ac(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}Ac(n,!0,s,null,x);break;case"together":Ac(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 ry(e,n,s){switch(n.tag){case 3:wp(n),gi();break;case 5:Df(n);break;case 1:Yn(n.type)&&ll(n);break;case 4:pc(n,n.stateNode.containerInfo);break;case 10:var u=n.type._context,p=n.memoizedProps.value;It(hl,u._currentValue),u._currentValue=p;break;case 13:if(u=n.memoizedState,u!==null)return u.dehydrated!==null?(It(Ut,Ut.current&1),n.flags|=128,null):(s&n.child.childLanes)!==0?kp(e,n,s):(It(Ut,Ut.current&1),e=$o(e,n,s),e!==null?e.sibling:null);It(Ut,Ut.current&1);break;case 19:if(u=(s&n.childLanes)!==0,(e.flags&128)!==0){if(u)return Sp(e,n,s);n.flags|=128}if(p=n.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),It(Ut,Ut.current),u)break;return null;case 22:case 23:return n.lanes=0,yp(e,n,s)}return $o(e,n,s)}var Np,Oc,Ep,jp;Np=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}},Oc=function(){},Ep=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=jt(e,p),u=jt(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 B=p[xe];for(E in B)B.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(B=p!=null?p[xe]:void 0,u.hasOwnProperty(xe)&&Y!==B&&(Y!=null||B!=null))if(xe==="style")if(B){for(E in B)!B.hasOwnProperty(E)||Y&&Y.hasOwnProperty(E)||(s||(s={}),s[E]="");for(E in Y)Y.hasOwnProperty(E)&&B[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,B=B?B.__html:void 0,Y!=null&&B!==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||B===Y||(x=[])):(x=x||[]).push(xe,Y))}s&&(x=x||[]).push("style",s);var xe=x;(n.updateQueue=xe)&&(n.flags|=4)}},jp=function(e,n,s,u){s!==u&&(n.flags|=4)};function ma(e,n){if(!Ft)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 oy(e,n,s){var u=n.pendingProps;switch(rc(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),gc(),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,Fr!==null&&(qc(Fr),Fr=null))),Oc(e,n),Pn(n),null;case 5:hc(n);var p=Ts(ca.current);if(s=n.type,e!==null&&n.stateNode!=null)Ep(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":Gt(u,x),Ot("invalid",u)}We(s,x),p=null;for(var E in x)if(x.hasOwnProperty(E)){var B=x[E];E==="children"?typeof B=="string"?u.textContent!==B&&(x.suppressHydrationWarning!==!0&&ol(u.textContent,B,e),p=["children",B]):typeof B=="number"&&u.textContent!==""+B&&(x.suppressHydrationWarning!==!0&&ol(u.textContent,B,e),p=["children",""+B]):l.hasOwnProperty(E)&&B!=null&&E==="onScroll"&&Ot("scroll",u)}switch(s){case"input":Ze(u),bt(u,x,!0);break;case"textarea":Ze(u),an(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=Mt(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,Np(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":Gt(e,u),p=jt(e,u),Ot("invalid",e);break;default:p=u}We(s,p),B=p;for(x in B)if(B.hasOwnProperty(x)){var Y=B[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),bt(e,u,!1);break;case"textarea":Ze(e),an(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?gt(e,!!u.multiple,x,!1):u.defaultValue!=null&&gt(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)jp(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(Ft&&lr!==null&&(n.mode&1)!==0&&(n.flags&128)===0)Mf(),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 Fr!==null&&(qc(Fr),Fr=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?sn===0&&(sn=3):Xc())),n.updateQueue!==null&&(n.flags|=4),Pn(n),null);case 4:return wi(),Oc(e,n),e===null&&ra(n.stateNode.containerInfo),Pn(n),null;case 10:return uc(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(sn!==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 It(Ut,Ut.current&1|2),n.child}e=e.sibling}x.tail!==null&&vt()>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&&!Ft)return Pn(n),null}else 2*vt()-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=vt(),n.sibling=null,s=Ut.current,It(Ut,u?s&1|2:s&1),n):(Pn(n),null);case 22:case 23:return Yc(),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 sy(e,n){switch(rc(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),gc(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return hc(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 uc(n.type._context),null;case 22:case 23:return Yc(),null;case 24:return null;default:return null}}var jl=!1,Mn=!1,iy=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){Wt(e,n,u)}else s.current=null}function Rc(e,n,s){try{s()}catch(u){Wt(e,n,u)}}var Cp=!1;function ay(e,n){if(Yu=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,B=-1,Y=-1,xe=0,Te=0,$e=e,Me=null;t:for(;;){for(var qe;$e!==s||p!==0&&$e.nodeType!==3||(B=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&&(B=E),Me===x&&++Te===u&&(Y=E),(qe=$e.nextSibling)!==null)break;$e=Me,Me=$e.parentNode}$e=qe}s=B===-1||Y===-1?null:{start:B,end:Y}}else s=null}s=s||{start:0,end:0}}else s=null;for(Xu={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:Br(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(Fe){Wt(n,n.return,Fe)}if(e=n.sibling,e!==null){e.return=n.return,Xe=e;break}Xe=n.return}return Qe=Cp,Cp=!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&&Rc(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 Lc(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 Pp(e){var n=e.alternate;n!==null&&(e.alternate=null,Pp(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[Zu],delete n[Vg],delete n[Ug])),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 Mp(e){return e.tag===5||e.tag===3||e.tag===4}function Tp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Mp(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 Dc(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(Dc(e,n,s),e=e.sibling;e!==null;)Dc(e,n,s),e=e.sibling}function zc(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(zc(e,n,s),e=e.sibling;e!==null;)zc(e,n,s),e=e.sibling}var kn=null,Hr=!1;function as(e,n,s){for(s=s.child;s!==null;)Ip(e,n,s),s=s.sibling}function Ip(e,n,s){if(yn&&typeof yn.onCommitFiberUnmount=="function")try{yn.onCommitFiberUnmount(Un,s)}catch{}switch(s.tag){case 5:Mn||ki(s,n);case 6:var u=kn,p=Hr;kn=null,as(e,n,s),kn=u,Hr=p,kn!==null&&(Hr?(e=kn,s=s.stateNode,e.nodeType===8?e.parentNode.removeChild(s):e.removeChild(s)):kn.removeChild(s.stateNode));break;case 18:kn!==null&&(Hr?(e=kn,s=s.stateNode,e.nodeType===8?Ju(e.parentNode,s):e.nodeType===1&&Ju(e,s),yo(e)):Ju(kn,s.stateNode));break;case 4:u=kn,p=Hr,kn=s.stateNode.containerInfo,Hr=!0,as(e,n,s),kn=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)&&Rc(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(B){Wt(s,n,B)}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 $p(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var s=e.stateNode;s===null&&(s=e.stateNode=new iy),n.forEach(function(u){var p=gy.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,B=E;e:for(;B!==null;){switch(B.tag){case 5:kn=B.stateNode,Hr=!1;break e;case 3:kn=B.stateNode.containerInfo,Hr=!0;break e;case 4:kn=B.stateNode.containerInfo,Hr=!0;break e}B=B.return}if(kn===null)throw Error(o(160));Ip(x,E,p),kn=null,Hr=!1;var Y=p.alternate;Y!==null&&(Y.return=null),p.return=null}catch(xe){Wt(p,n,xe)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)Ap(n,e),n=n.sibling}function Ap(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){Wt(e,e.return,Ge)}try{ga(5,e,e.return)}catch(Ge){Wt(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){Wt(e,e.return,Ge)}}if(u&4&&(p=e.stateNode,p!=null)){var x=e.memoizedProps,E=s!==null?s.memoizedProps:x,B=e.type,Y=e.updateQueue;if(e.updateQueue=null,Y!==null)try{B==="input"&&x.type==="radio"&&x.name!=null&&ve(p,x),Ln(B,E);var xe=Ln(B,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(B){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?gt(p,!!x.multiple,qe,!1):Me!==!!x.multiple&&(x.defaultValue!=null?gt(p,!!x.multiple,x.defaultValue,!0):gt(p,!!x.multiple,x.multiple?[]:"",!1))}p[sa]=x}catch(Ge){Wt(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){Wt(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){Wt(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||(Hc=vt())),u&4&&$p(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){Wt(u,s,Ge)}}break;case 5:ki(Me,Me.return);break;case 22:if(Me.memoizedState!==null){Lp($e);continue}}qe!==null?(qe.return=Me,Xe=qe):Lp($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"):(B=$e.stateNode,Y=$e.memoizedProps.style,E=Y!=null&&Y.hasOwnProperty("display")?Y.display:null,B.style.display=hr("display",E))}catch(Ge){Wt(e,e.return,Ge)}}}else if($e.tag===6){if(Te===null)try{$e.stateNode.nodeValue=xe?"":$e.memoizedProps}catch(Ge){Wt(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&&$p(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(Mp(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=Tp(e);zc(e,x,p);break;case 3:case 4:var E=u.stateNode.containerInfo,B=Tp(e);Dc(e,B,E);break;default:throw Error(o(161))}}catch(Y){Wt(e,e.return,Y)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function ly(e,n,s){Xe=e,Op(e)}function Op(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 B=p.alternate,Y=B!==null&&B.memoizedState!==null||Mn;B=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?Dp(p):Y!==null?(Y.return=E,Xe=Y):Dp(p);for(;x!==null;)Xe=x,Op(x),x=x.sibling;Xe=p,jl=B,Mn=xe}Rp(e)}else(p.subtreeFlags&8772)!==0&&x!==null?(x.return=p,Xe=x):Rp(e)}}function Rp(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:Br(n.type,s.memoizedProps);u.componentDidUpdate(p,s.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var x=n.updateQueue;x!==null&&Lf(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}Lf(n,E,s)}break;case 5:var B=n.stateNode;if(s===null&&n.flags&4){s=B;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&&Lc(n)}catch(Me){Wt(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 Lp(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 Dp(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){Wt(n,s,Y)}break;case 1:var u=n.stateNode;if(typeof u.componentDidMount=="function"){var p=n.return;try{u.componentDidMount()}catch(Y){Wt(n,p,Y)}}var x=n.return;try{Lc(n)}catch(Y){Wt(n,x,Y)}break;case 5:var E=n.return;try{Lc(n)}catch(Y){Wt(n,E,Y)}}}catch(Y){Wt(n,n.return,Y)}if(n===e){Xe=null;break}var B=n.sibling;if(B!==null){B.return=n.return,Xe=B;break}Xe=n.return}}var uy=Math.ceil,Pl=M.ReactCurrentDispatcher,Fc=M.ReactCurrentOwner,jr=M.ReactCurrentBatchConfig,_t=0,pn=null,en=null,_n=0,ur=0,_i=ns(0),sn=0,ya=null,$s=0,Ml=0,Bc=0,xa=null,Qn=null,Hc=0,Si=1/0,Ao=null,Tl=!1,Vc=null,ls=null,Il=!1,us=null,$l=0,va=0,Uc=null,Al=-1,Ol=0;function On(){return(_t&6)!==0?vt():Al!==-1?Al:Al=vt()}function cs(e){return(e.mode&1)===0?1:(_t&2)!==0&&_n!==0?_n&-_n:qg.transition!==null?(Ol===0&&(Ol=$t()),Ol):(e=wt,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,Uc=null,Error(o(185));Ht(e,s,u),((_t&2)===0||e!==pn)&&(e===pn&&((_t&2)===0&&(Ml|=s),sn===4&&ds(e,_n)),Gn(e,u),s===1&&_t===0&&(n.mode&1)===0&&(Si=vt()+500,ul&&os()))}function Gn(e,n){var s=e.callbackNode;Je(e,n);var u=me(e,e===pn?_n: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?Kg(Fp.bind(null,e)):Nf(Fp.bind(null,e)),Bg(function(){(_t&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=Yp(s,zp.bind(null,e))}e.callbackPriority=n,e.callbackNode=s}}function zp(e,n){if(Al=-1,Ol=0,(_t&6)!==0)throw Error(o(327));var s=e.callbackNode;if(Ni()&&e.callbackNode!==s)return null;var u=me(e,e===pn?_n:0);if(u===0)return null;if((u&30)!==0||(u&e.expiredLanes)!==0||n)n=Rl(e,u);else{n=u;var p=_t;_t|=2;var x=Hp();(pn!==e||_n!==n)&&(Ao=null,Si=vt()+500,Os(e,n));do try{fy();break}catch(B){Bp(e,B)}while(!0);lc(),Pl.current=x,_t=p,en!==null?n=0:(pn=null,_n=0,n=sn)}if(n!==0){if(n===2&&(p=Et(e),p!==0&&(u=p,n=Kc(e,p))),n===1)throw s=ya,Os(e,0),ds(e,u),Gn(e,vt()),s;if(n===6)ds(e,u);else{if(p=e.current.alternate,(u&30)===0&&!cy(p)&&(n=Rl(e,u),n===2&&(x=Et(e),x!==0&&(u=x,n=Kc(e,x))),n===1))throw s=ya,Os(e,0),ds(e,u),Gn(e,vt()),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=Hc+500-vt(),10<n)){if(me(e,0)!==0)break;if(p=e.suspendedLanes,(p&u)!==u){On(),e.pingedLanes|=e.suspendedLanes&p;break}e.timeoutHandle=Gu(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-un(u);x=1<<E,E=n[E],E>p&&(p=E),u&=~x}if(u=p,u=vt()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*uy(u/1960))-u,10<u){e.timeoutHandle=Gu(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,vt()),e.callbackNode===s?zp.bind(null,e):null}function Kc(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&&qc(n)),e}function qc(e){Qn===null?Qn=e:Qn.push.apply(Qn,e)}function cy(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-un(n),u=1<<s;e[s]=-1,n&=~u}}function Fp(e){if((_t&6)!==0)throw Error(o(327));Ni();var n=me(e,0);if((n&1)===0)return Gn(e,vt()),null;var s=Rl(e,n);if(e.tag!==0&&s===2){var u=Et(e);u!==0&&(n=u,s=Kc(e,u))}if(s===1)throw s=ya,Os(e,0),ds(e,n),Gn(e,vt()),s;if(s===6)throw Error(o(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,Rs(e,Qn,Ao),Gn(e,vt()),null}function Wc(e,n){var s=_t;_t|=1;try{return e(n)}finally{_t=s,_t===0&&(Si=vt()+500,ul&&os())}}function As(e){us!==null&&us.tag===0&&(_t&6)===0&&Ni();var n=_t;_t|=1;var s=jr.transition,u=wt;try{if(jr.transition=null,wt=1,e)return e()}finally{wt=u,jr.transition=s,_t=n,(_t&6)===0&&os()}}function Yc(){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,Fg(s)),en!==null)for(s=en.return;s!==null;){var u=s;switch(rc(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&al();break;case 3:wi(),Rt(Wn),Rt(jn),gc();break;case 5:hc(u);break;case 4:wi();break;case 13:Rt(Ut);break;case 19:Rt(Ut);break;case 10:uc(u.type._context);break;case 22:case 23:Yc()}s=s.return}if(pn=e,en=e=fs(e.current,null),_n=ur=n,sn=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=en;try{if(lc(),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,fn=on=Kt=null,da=!1,fa=0,Fc.current=null,s===null||s.return===null){sn=1,ya=n,en=null;break}e:{var x=e,E=s.return,B=s,Y=n;if(n=_n,B.flags|=32768,Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var xe=Y,Te=B,$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=fp(E);if(qe!==null){qe.flags&=-257,pp(qe,E,B,x,n),qe.mode&1&&dp(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){dp(x,xe,n),Xc();break e}Y=Error(o(426))}}else if(Ft&&B.mode&1){var Qt=fp(E);if(Qt!==null){(Qt.flags&65536)===0&&(Qt.flags|=256),pp(Qt,E,B,x,n),ic(bi(Y,B));break e}}x=Y=bi(Y,B),sn!==4&&(sn=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=up(x,Y,n);Rf(x,he);break e;case 1:B=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 Fe=cp(x,B,n);Rf(x,Fe);break e}}x=x.return}while(x!==null)}Up(s)}catch(et){n=et,en===s&&s!==null&&(en=s=s.return);continue}break}while(!0)}function Hp(){var e=Pl.current;return Pl.current=_l,e===null?_l:e}function Xc(){(sn===0||sn===3||sn===2)&&(sn=4),pn===null||($s&268435455)===0&&(Ml&268435455)===0||ds(pn,_n)}function Rl(e,n){var s=_t;_t|=2;var u=Hp();(pn!==e||_n!==n)&&(Ao=null,Os(e,n));do try{dy();break}catch(p){Bp(e,p)}while(!0);if(lc(),_t=s,Pl.current=u,en!==null)throw Error(o(261));return pn=null,_n=0,sn}function dy(){for(;en!==null;)Vp(en)}function fy(){for(;en!==null&&!Tt();)Vp(en)}function Vp(e){var n=Wp(e.alternate,e,ur);e.memoizedProps=e.pendingProps,n===null?Up(e):en=n,Fc.current=null}function Up(e){var n=e;do{var s=n.alternate;if(e=n.return,(n.flags&32768)===0){if(s=oy(s,n,ur),s!==null){en=s;return}}else{if(s=sy(s,n),s!==null){s.flags&=32767,en=s;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{sn=6,en=null;return}}if(n=n.sibling,n!==null){en=n;return}en=n=e}while(n!==null);sn===0&&(sn=5)}function Rs(e,n,s){var u=wt,p=jr.transition;try{jr.transition=null,wt=1,py(e,n,s,u)}finally{jr.transition=p,wt=u}return null}function py(e,n,s,u){do Ni();while(us!==null);if((_t&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(qt(e,x),e===pn&&(en=pn=null,_n=0),(s.subtreeFlags&2064)===0&&(s.flags&2064)===0||Il||(Il=!0,Yp(wr,function(){return Ni(),null})),x=(s.flags&15990)!==0,(s.subtreeFlags&15990)!==0||x){x=jr.transition,jr.transition=null;var E=wt;wt=1;var B=_t;_t|=4,Fc.current=null,ay(e,s),Ap(s,e),ae(Xu),Xs=!!Yu,Xu=Yu=null,e.current=s,ly(s),Vn(),_t=B,wt=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,vt()),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=Vc,Vc=null,e;return($l&1)!==0&&e.tag!==0&&Ni(),x=e.pendingLanes,(x&1)!==0?e===Uc?va++:(va=0,Uc=e):va=0,os(),null}function Ni(){if(us!==null){var e=ys($l),n=jr.transition,s=wt;try{if(jr.transition=null,wt=16>e?16:e,us===null)var u=!1;else{if(e=us,us=null,$l=0,(_t&6)!==0)throw Error(o(331));var p=_t;for(_t|=4,Xe=e.current;Xe!==null;){var x=Xe,E=x.child;if((Xe.flags&16)!==0){var B=x.deletions;if(B!==null){for(var Y=0;Y<B.length;Y++){var xe=B[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(Pp(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(B=Xe,(B.flags&2048)!==0)try{switch(B.tag){case 0:case 11:case 15:Cl(9,B)}}catch(et){Wt(B,B.return,et)}if(B===E){Xe=null;break e}var Fe=B.sibling;if(Fe!==null){Fe.return=B.return,Xe=Fe;break e}Xe=B.return}}if(_t=p,os(),yn&&typeof yn.onPostCommitFiberRoot=="function")try{yn.onPostCommitFiberRoot(Un,e)}catch{}u=!0}return u}finally{wt=s,jr.transition=n}}return!1}function Kp(e,n,s){n=bi(s,n),n=up(e,n,1),e=is(e,n,1),n=On(),e!==null&&(Ht(e,1,n),Gn(e,n))}function Wt(e,n,s){if(e.tag===3)Kp(e,e,s);else for(;n!==null;){if(n.tag===3){Kp(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=cp(n,e,1),n=is(n,e,1),e=On(),n!==null&&(Ht(n,1,e),Gn(n,e));break}}n=n.return}}function hy(e,n,s){var u=e.pingCache;u!==null&&u.delete(n),n=On(),e.pingedLanes|=e.suspendedLanes&s,pn===e&&(_n&s)===s&&(sn===4||sn===3&&(_n&130023424)===_n&&500>vt()-Hc?Os(e,0):Bc|=s),Gn(e,n)}function qp(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 my(e){var n=e.memoizedState,s=0;n!==null&&(s=n.retryLane),qp(e,s)}function gy(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),qp(e,s)}var Wp;Wp=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,ry(e,n,s);Xn=(e.flags&131072)!==0}else Xn=!1,Ft&&(n.flags&1048576)!==0&&Ef(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=vc(null,n,u,e,p,s);var x=wc();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,fc(n),p.updater=Sl,n.stateNode=p,p._reactInternals=n,Ec(n,u,e,s),n=Mc(null,n,u,!0,x,s)):(n.tag=0,Ft&&x&&nc(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=xy(u),e=Br(u,e),p){case 0:n=Pc(null,n,u,e,s);break e;case 1:n=vp(null,n,u,e,s);break e;case 11:n=hp(null,n,u,e,s);break e;case 14:n=mp(null,n,u,Br(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:Br(u,p),Pc(e,n,u,p,s);case 1:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Br(u,p),vp(e,n,u,p,s);case 3:e:{if(wp(n),e===null)throw Error(o(387));u=n.pendingProps,x=n.memoizedState,p=x.element,Of(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=bp(e,n,u,s,p);break e}else if(u!==p){p=bi(Error(o(424)),n),n=bp(e,n,u,s,p);break e}else for(lr=ts(n.stateNode.containerInfo.firstChild),ar=n,Ft=!0,Fr=null,s=$f(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 Df(n),e===null&&sc(n),u=n.type,p=n.pendingProps,x=e!==null?e.memoizedProps:null,E=p.children,Qu(u,p)?E=null:x!==null&&Qu(u,x)&&(n.flags|=32),xp(e,n),An(e,n,E,s),n.child;case 6:return e===null&&sc(n),null;case 13:return kp(e,n,s);case 4:return pc(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:Br(u,p),hp(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,It(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 B=x.dependencies;if(B!==null){E=x.child;for(var Y=B.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),cc(x.return,s,n),B.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,B=E.alternate,B!==null&&(B.lanes|=s),cc(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=Br(u,n.pendingProps),p=Br(u.type,p),mp(e,n,u,p,s);case 15:return gp(e,n,n.type,n.pendingProps,s);case 17:return u=n.type,p=n.pendingProps,p=n.elementType===u?p:Br(u,p),El(e,n),n.tag=1,Yn(u)?(e=!0,ll(n)):e=!1,vi(n,s),ap(n,u,p),Ec(n,u,p,s),Mc(null,n,u,!0,e,s);case 19:return Sp(e,n,s);case 22:return yp(e,n,s)}throw Error(o(156,n.tag))};function Yp(e,n){return ho(e,n)}function yy(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 yy(e,n,s,u)}function Qc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function xy(e){if(typeof e=="function")return Qc(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")Qc(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 Gc(e,n,s){return e=Cr(6,e,null,n),e.lanes=s,e}function Jc(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 vy(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=Xt(0),this.expirationTimes=Xt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xt(0),this.identifierPrefix=u,this.onRecoverableError=p,this.mutableSourceEagerHydrationData=null}function Zc(e,n,s,u,p,x,E,B,Y){return e=new vy(e,n,s,B,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},fc(x),e}function wy(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 Xp(e){if(!e)return rs;e=e._reactInternals;e:{if(Yt(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 _f(e,s,n)}return n}function Qp(e,n,s,u,p,x,E,B,Y){return e=Zc(s,u,!0,e,p,x,E,B,Y),e.context=Xp(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=Xp(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 Fl(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 Gp(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<n?s:n}}function ed(e,n){Gp(e,n),(e=e.alternate)&&Gp(e,n)}function by(){return null}var Jp=typeof reportError=="function"?reportError:function(e){console.error(e)};function td(e){this._internalRoot=e}Bl.prototype.render=td.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(o(409));zl(e,n,null,null)},Bl.prototype.unmount=td.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 Bl(e){this._internalRoot=e}Bl.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 nd(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 Zp(){}function ky(e,n,s,u,p){if(p){if(typeof u=="function"){var x=u;u=function(){var xe=Fl(E);x.call(xe)}}var E=Qp(n,u,e,0,null,!1,!1,"",Zp);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 B=u;u=function(){var xe=Fl(Y);B.call(xe)}}var Y=Zc(e,0,!1,null,null,!1,!1,"",Zp);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 B=p;p=function(){var Y=Fl(E);B.call(Y)}}zl(n,E,e,p)}else E=ky(s,n,e,p,u);return Fl(E)}yt=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var s=L(n.pendingLanes);s!==0&&(xn(n,s|1),Gn(n,vt()),(_t&6)===0&&(Si=vt()+500,os()))}break;case 13:As(function(){var u=To(e,1);if(u!==null){var p=On();Ur(u,e,1,p)}}),ed(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)}ed(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)}ed(e,n)}},Ka=function(){return wt},Nn=function(e,n){var s=wt;try{return wt=e,n()}finally{wt=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&&gt(e,!!s.multiple,n,!1)}},mr=Wc,Bo=As;var _y={usingClientEntryPoint:!1,Events:[ia,di,il,fo,er,Wc]},wa={findFiberByHostInstance:Es,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Sy={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||by,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(Sy),yn=Ul}catch{}}return Jn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_y,Jn.createPortal=function(e,n){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!nd(n))throw Error(o(200));return wy(e,n,null,s)},Jn.createRoot=function(e,n){if(!nd(e))throw Error(o(299));var s=!1,u="",p=Jp;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onRecoverableError!==void 0&&(p=n.onRecoverableError)),n=Zc(e,1,!1,null,null,s,!1,u,p),e[jo]=n.current,ra(e.nodeType===8?e.parentNode:e),new td(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(!nd(e))throw Error(o(405));var u=s!=null&&s.hydratedSources||null,p=!1,x="",E=Jp;if(s!=null&&(s.unstable_strictMode===!0&&(p=!0),s.identifierPrefix!==void 0&&(x=s.identifierPrefix),s.onRecoverableError!==void 0&&(E=s.onRecoverableError)),n=Qp(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 Bl(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=Wc,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 ah;function Mm(){if(ah)return sd.exports;ah=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(),sd.exports=Ay(),sd.exports}var lh;function Oy(){if(lh)return Kl;lh=1;var t=Mm();return Kl.createRoot=t.createRoot,Kl.hydrateRoot=t.hydrateRoot,Kl}var Ry=Oy();const Ly=Eu(Ry);function ld(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 Dy="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 zy=["get","post","put","patch","delete","options","head","trace"];function uh(t){return t.replace(/[^a-zA-Z0-9]+/g,"_").replace(/^_|_$/g,"").replace(/_+/g,"_")}function ju(t,r,o,i){if(o)return uh(o).replace(/^[0-9]/,"_$&")||`op_${i}`;const l=uh(r.replace(/[{}]/g,""));return`${t}_${l}`||`op_${i}`}function Cu(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 Pu(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 zy){const f=l[c];f&&typeof f=="object"&&r.push({method:c,path:o,operationId:f.operationId,tags:f.tags})}}return r}function Fy(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 Tm(t,r){const o=t.map((i,l)=>` /**
49
+ * @param {{ headers?: Record<string, string> }} [options]
50
+ * @returns {Promise<unknown>}
51
+ */
52
+ async ${ju(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 Tm(uo(t),Cu(t))}function Hy(t,r){const o=Pu(r),i=uo(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return Tm(i,o)}function Vy(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 Im(t,r){const o=t.map((i,l)=>` public function ${ju(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 Uy(t){return Im(uo(t),Cu(t))}function Ky(t,r){const o=Pu(r),i=uo(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return Im(i,o)}function qy(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 $m(t,r){const o=t.map((i,l)=>{const c=ju(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 Wy(t){return $m(uo(t),Cu(t))}function Yy(t,r){const o=Pu(r),i=uo(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return $m(i,o)}function Xy(t){const r=t.split("/");return(r[r.length-1]??"Unknown").replace(/[^a-zA-Z0-9_]/g,"_")}function Ed(t){if(!t)return"unknown";if("$ref"in t&&t.$ref)return Xy(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?`${Ed(r.items)}[]`:r.type==="object"&&r.properties?`{
153
+ ${Object.entries(r.properties).map(([i,l])=>` ${JSON.stringify(i)}?: ${Ed(l)};`).join(`
154
+ `)}
155
+ }`:"Record<string, unknown>"}function Qy(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?Ed(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 Am(t,r){const o=t.map((i,l)=>` async ${ju(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 Gy(t){const r=uo(t),o=Cu(t);return Am(r,o)}function Jy(t,r){const o=Pu(r),i=uo(t).filter(l=>{var c;return(c=l.tags)==null?void 0:c.includes(r)});return Am(i,o)}function Zy(t,r,o,i){switch(r){case"typescript":return Qy(t,o,i);case"javascript":return Fy(t,o,i);case"python":return qy(t,o,i);case"php":return Vy(t,o,i);default:{const l=r;throw new Error(`Unsupported language: ${l}`)}}}function ex(t,r,o){switch(r){case"typescript":return Jy(t,o);case"javascript":return Hy(t,o);case"python":return Yy(t,o);case"php":return Ky(t,o);default:{const i=r;throw new Error(`Unsupported language: ${i}`)}}}function tx(t,r,o){if(o===null)switch(r){case"typescript":return Gy(t);case"javascript":return By(t);case"python":return Wy(t);case"php":return Uy(t);default:{const i=r;throw new Error(`Unsupported language: ${i}`)}}return ex(t,r,o)}function nx(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 rx(t){var o;const r=(o=t.components)==null?void 0:o.securitySchemes;return r?Object.keys(r):[]}function Ud(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}function pu(t){if(typeof window>"u")return"omit";try{return new URL(t).origin===window.location.origin?"include":"omit"}catch{return"omit"}}var su={exports:{}},ox=su.exports,ch;function sx(){return ch||(ch=1,(function(t,r){((o,i)=>{t.exports=i()})(ox,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:Cy,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 F(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"],Mt=["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=Mt.reduce(function(a,d){return a[d]=d+"Error",a},{}),ze=Ne,Ee=Mt.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=Mt.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 ve(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 bt(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 Pt(a,d){return a===He?d:function(){return d.apply(this,arguments)!==!1&&a.apply(this,arguments)}}function Ct(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 gt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function jt(a){gt=a}var Gt={},fr=100,an=typeof Promise>"u"?[]:(Mt=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[an=crypto.subtle.digest("SHA-512",new Uint8Array([0])),b(an),Mt]:[Mt,b(Mt),Mt]),Mt=an[0],ko=an[1],ko=ko&&ko.then,nn=Mt&&Mt.constructor,ln=!!an[2],pr=function(a,d){Ln.push([a,d]),In&&(queueMicrotask(Bo),In=!1)},Tn=!0,In=!0,mn=[],hr=[],Rn=Ke,Sn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:He,pgp:!1,env:{},finalize:He},We=Sn,Ln=[],gn=0,Jt=[];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!==Gt)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)),$&&Fn()}},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=$&&!Yt(),ee=new Ve(function(ce,ne){er(N,new Nt(ho(w,a,$,R),ho(S,a,$,R),ce,ne,a))});return this._consoleTask&&(ee._consoleTask=this._consoleTask),ee}return g.prototype=Gt,g},set:function(a){C(this,"then",a&&a.prototype===Gt?Dn:{get:function(){return a},set:Dn.set})}};function Nt(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,mn.some(function(S){return S._value===w._value})||mn.push(w),fo(a),g)&&Fn()}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(),gn===0&&(++gn,pr(function(){--gn==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,++gn,pr(mr,[g,a,d])}}function mr(a,d,g){try{var w,S=d._value;!d._state&&hr.length&&(hr=[]),w=gt&&d._consoleTask?d._consoleTask.run(function(){return a(S)}):a(S),d._state||hr.indexOf(S)!==-1||(N=>{for(var $=mn.length;$;)if(mn[--$]._value===N._value)return mn.splice($,1)})(d),g.resolve(w)}catch(N){g.reject(N)}finally{--gn==0&&$n(),--g.psd.ref||g.psd.finalize()}}function Bo(){Hn(Sn,function(){zn()&&Fn()})}function zn(){var a=Tn;return In=Tn=!1,a}function Fn(){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=mn,d=(mn=[],a.forEach(function(w){w._PSD.onunhandled.call(null,w._value,w)}),Jt.slice(0)),g=d.length;g;)d[--g]()}function tr(a){return new Ve(Gt,!1,a)}function lt(a,d){var g=We;return function(){var w=zn(),S=We;try{return rn(g,!0),a.apply(this,arguments)}catch(N){d&&d(N)}finally{rn(S,!1),w&&Fn()}}}k(Ve.prototype,{then:Dn,_then:function(a,d){er(this,new Nt(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(Gt,!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:Bn,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 Bn(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])},Jt.push(function ce(){R(),Jt.splice(Jt.indexOf(ce),1)}),++gn,pr(function(){--gn==0&&$n()},[])},$.finalize),a()},d,g,w)})}}),nn&&(nn.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)})})})}),nn.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))})})})}),nn.withResolvers)&&(Ve.withResolvers=nn.withResolvers);var Dt={awaits:0,echoes:0,id:0},Pr=0,nr=[],rr=0,gr=0,Ho=0;function Bn(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=ln?{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 Yt(){return!!Dt.awaits&&(--Dt.awaits==0&&(Dt.id=0),Dt.echoes=Dt.awaits*fr,!0)}function xr(a){return Dt.echoes&&a&&a.constructor===nn?(yr(),a.then(function(d){return Yt(),d},function(d){return Yt(),Tt(d)})):a}function po(){var a=nr[nr.length-1];nr.pop(),rn(a,!1)}function rn(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),rn(N,!0)}).bind(null,a):po),a!==We&&(We=a,S===Sn&&(Sn.env=Mr()),ln)&&(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 ln?{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 rn(a,!0),d(g,w,S)}finally{rn(N,!1)}}function ho(a,d,g,w){return typeof a!="function"?a:function(){var S=We;g&&yr(),rn(d,!0);try{return a.apply(this,arguments)}finally{rn(S,!1),w&&queueMicrotask(Yt)}}}function Gr(a){Promise===nn&&Dt.echoes===0?rr===0?a():enqueueNativeMicroTask(a):setTimeout(a,0)}(""+ko).indexOf("[native code]")===-1&&(yr=Yt=He);var Tt=Ve.reject,Vn="￿",vt="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 yn(){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=un(a),w=un(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 un(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=gt&&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):Bn(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)})):Tt(oe)}return se._promise(G,function(oe,ae){return Bn(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 Tt(new Ee.DatabaseClosed(ne._state.dbOpenError));if(!ne._state.isBeingOpened){if(!ne._state.autoOpen)return Tt(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),Tt(ce)})),ee}finally{R&&Fn()}},me.prototype.get=function(a,d){var g=this;return a&&a.constructor===Object?this.where(a).first(d):a==null?Tt(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&&gt&&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 yn&&(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?Tt(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],we=se[pe];if(pe===d.schema.primKey.keyPath){if(ht(we,le)!==0)throw new Ee.Constraint("Cannot update primary key in bulkUpdate()")}else W(oe,pe,we)}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 Be(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||Pt,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){F(function(){ae.apply(null,oe)})})})}})}}function Je(a,d){return I(d).from({prototype:a}),d}function Et(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 Xt(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 qt(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 xn(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),wt(qt(a,w,g),a.algorithm,N,!a.keysOnly&&a.valueMapper)])):wt(qt(a,w,g),or(a.algorithm,$),d,!a.keysOnly&&a.valueMapper)}function wt(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}),$()})})}yt.prototype._read=function(a,d){var g=this._ctx;return g.error?g.table._trans(null,Tt.bind(null,g.error)):g.table._trans("readonly",a).then(d)},yt.prototype._write=function(a){var d=this._ctx;return d.error?d.table._trans(null,Tt.bind(null,d.error)):d.table._trans("readwrite",a,"locked")},yt.prototype._addAlgorithm=function(a){var d=this._ctx;d.algorithm=or(d.algorithm,a)},yt.prototype._iterate=function(a,d){return xn(this._ctx,a,d,this._ctx.table.core)},yt.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},yt.prototype.raw=function(){return this._ctx.valueMapper=null,this},yt.prototype.each=function(a){var d=this._ctx;return this._read(function(g){return xn(d,a,g,d.table.core)})},yt.prototype.count=function(a){var d=this;return this._read(function(g){var w,S=d._ctx,N=S.table.core;return Et(S,!0)?N.count({trans:g,query:{index:Ht(S,N.schema),range:S.range}}).then(function($){return Math.min($,S.limit)}):(w=0,xn(S,function(){return++w,!1},g,N).then(function(){return w}))}).then(a)},yt.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)},yt.prototype.toArray=function(a){var d=this;return this._read(function(g){var w,S,N,$=d._ctx;return Et($,!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=[],xn($,function(R){return N.push(R)},g,$.table.core).then(function(){return N}))},a)},yt.prototype.offset=function(a){var d=this._ctx;return a<=0||(d.offset+=a,Et(d)?Xt(d,function(){var g=a;return function(w,S){return g===0||(g===1?--g:S(function(){w.advance(g),g=0}),!1)}}):Xt(d,function(){var g=a;return function(){return--g<0}})),this},yt.prototype.limit=function(a){return this._ctx.limit=Math.min(this._ctx.limit,a),Xt(this._ctx,function(){var d=a;return function(g,w,S){return--d<=0&&w(S),0<=d}},!0),this},yt.prototype.until=function(a,d){return $t(this._ctx,function(g,w,S){return!a(g.value)||(w(S),d)}),this},yt.prototype.first=function(a){return this.limit(1).toArray(function(d){return d[0]}).then(a)},yt.prototype.last=function(a){return this.reverse().first(a)},yt.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},yt.prototype.and=function(a){return this.filter(a)},yt.prototype.or=function(a){return new this.db.WhereClause(this._ctx.table,a,this)},yt.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},yt.prototype.desc=function(){return this.reverse()},yt.prototype.eachKey=function(a){var d=this._ctx;return d.keysOnly=!d.isMatch,this.each(function(g,w){a(w.key,w)})},yt.prototype.eachUniqueKey=function(a){return this._ctx.unique="unique",this.eachKey(a)},yt.prototype.eachPrimaryKey=function(a){var d=this._ctx;return d.keysOnly=!d.isMatch,this.each(function(g,w){a(w.primaryKey,w)})},yt.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)},yt.prototype.primaryKeys=function(a){var d=this._ctx;if(Et(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)},yt.prototype.uniqueKeys=function(a){return this._ctx.unique="unique",this.keys(a)},yt.prototype.firstKey=function(a){return this.limit(1).keys(function(d){return d[0]}).then(a)},yt.prototype.lastKey=function(a){return this.reverse().firstKey(a)},yt.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},yt.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,we=f(ye);pe<we.length;pe++){var je=we[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 we=Math.min(ce,oe.length-pe),je=oe.slice(pe,pe+we);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<we;++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+we&&ae(pe+ce)})})}var ye=Et(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})})})},yt.prototype.delete=function(){var a=this._ctx,d=a.range;return!Et(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=yt;function yt(){}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 vn(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 we=N(pe);if(d(we,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,we,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 vn(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 vn(a,d,!g,!w)})}catch{return Nn(this,vt)}},zt.prototype.equals=function(a){return a==null?Nn(this,vt):new this.Collection(this,function(){return $r(a)})},zt.prototype.above=function(a){return a==null?Nn(this,vt):new this.Collection(this,function(){return vn(a,void 0,!0)})},zt.prototype.aboveOrEqual=function(a){return a==null?Nn(this,vt):new this.Collection(this,function(){return vn(a,void 0,!1)})},zt.prototype.below=function(a){return a==null?Nn(this,vt):new this.Collection(this,function(){return vn(void 0,a,!1,!0)})},zt.prototype.belowOrEqual=function(a){return a==null?Nn(this,vt):new this.Collection(this,function(){return vn(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,vt)}return w.length===0?Zr(this):((a=new this.Collection(this,function(){return vn(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,vt)}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,we){return G(pe[0],we[0])}try{(ne=a.reduce(function(pe,we){for(var je=0,Pe=pe.length;je<Pe;++je){var De=pe[je];if(w(we[0],De[1])<0&&0<w(we[1],De[0])){De[0]=$(De[0],we[0]),De[1]=R(De[1],we[1]);break}}return je===Pe&&pe.push(we),pe},[])).sort(te)}catch{return Nn(this,vt)}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 vn(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,we,je){for(var Pe,De=pe.key;ae(De);)if(++le===ne.length)return we(je),!1;return!se(Pe=De)&&!oe(Pe)||(g._cmp(De,ne[le][1])===0||g._cmp(De,ne[le][0])===0||we(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 wn(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=Be(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"?Tt(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?Bn(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):Tt(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 Hu(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,we=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=(we||je||{length:1}).length;if(we&&je&&we.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(bn){++En,Kn(bn)}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,we]:[je,null]:[we,null],ft=Le[0],At=Le[1];if(Ye)for(var Zt=0;Zt<it;++Zt)pt.push(Ce=At&&At[Zt]!==void 0?Ue[pe](ft[Zt],At[Zt]):Ue[pe](ft[Zt])),Ce.onerror=at;else for(Zt=0;Zt<it;++Zt)pt.push(Ce=Ue[pe](ft[Zt])),Ce.onerror=at}function es(bn){bn=bn.target.result,pt.forEach(function(No,Eo){return No.error!=null&&(mt[Eo]=No.error)}),De({numFailures:En,failures:mt,results:pe==="delete"?we:pt.map(function(No){return No.result}),lastResult:bn})}Ce.onerror=function(bn){at(bn),es(bn)},Ce.onsuccess=es})},getMany:function(ae){var ye=ae.trans,pe=ae.keys;return new Promise(function(we,je){we=lt(we);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&&we(Ue)},it=wn(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&&we(Ue)})},get:function(ae){var ye=ae.trans,pe=ae.key;return new Promise(function(we,je){we=lt(we);var Pe=ye.objectStore(oe).get(pe);Pe.onsuccess=function(De){return we(De.target.result)},Pe.onerror=wn(je)})},query:(le=ee,se=ce,function(ae){return new Promise(function(ye,pe){ye=lt(ye);var we,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},(we=Ie?it.getAll(Ce):it.getAllKeys(Ce)).onsuccess=function(pt){return ye({result:pt.target.result})},we.onerror=wn(pe)):le&&Le==="next"?((we=Ie?it.getAll(at,Ye):it.getAllKeys(at,Ye)).onsuccess=function(pt){return ye({result:pt.target.result})},we.onerror=wn(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=wn(pe))})}),openCursor:function(ae){var ye=ae.trans,pe=ae.values,we=ae.query,je=ae.reverse,Pe=ae.unique;return new Promise(function(De,Ie){De=lt(De);var Ye=we.index,Ue=we.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=wn(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,Zt=1;return this.start(function(){return Zt--?At.continue():At.stop()}).then(function(){return At})},ft.start=function(At){function Zt(){if(Ce.result)try{At()}catch(bn){ft.fail(bn)}else ft.done=!0,ft.start=function(){throw new Error("Cursor behind last entry")},ft.stop()}var es=new Promise(function(bn,No){bn=lt(bn),Ce.onerror=wn(No),ft.fail=No,ft.stop=function(Eo){ft.stop=ft.continue=ft.continuePrimaryKey=ft.advance=En,bn(Eo)}});return Ce.onsuccess=lt(function(bn){Ce.onsuccess=Zt,Zt()}),ft.continue=at,ft.continuePrimaryKey=pt,ft.advance=mt,Zt(),es},De(ft)):De(null)},Ie)})},count:function(ae){var ye=ae.query,pe=ae.trans,we=ye.index,je=ye.range;return new Promise(function(Pe,De){var Ie=pe.objectStore(oe),Ie=we.isPrimaryKey?Ie:Ie.index(we.name),Ue=w(je),Ue=Ue?Ie.count(Ue):Ie.count();Ue.onsuccess=lt(function(Le){return Pe(Le.target.result)}),Ue.onerror=wn(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,we=je.multiEntry,je=je.keyPath,Pe={name:Pe,compound:m(je),keyPath:je,unique:pe,multiEntry:we,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=Hu(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;Bn(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=cn(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 we,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={},we=Z(Ie),Ue.del.forEach(function(Ye){we[Ye]=De[Ye]}),Qs(G,[G.Transaction.prototype]),qo(G,[G.Transaction.prototype],f(we),we),le.schema=we,(je=O(Le))&&yr(),Ie=Ve.follow(function(){var Ye;(Pe=Le(le))&&je&&(Ye=Yt.bind(null,null),Pe.then(Ye,Ye))}),Pe&&typeof Pe.then=="function"?Ve.resolve(Pe):Ie.then(function(){return Pe})}),oe.push(function(we){var je,Pe,De=pe._cfg.dbschema;je=De,Pe=we,[].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(we){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"})):we.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=cn(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){gt&&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)||(gt&&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 cn(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=Ct(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 Bn(function(){return We.letThrough=!0,a()})}function ei(a){return!("from"in a)}var dn=function(a,d){var g;if(!this)return g=new dn,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(dn.prototype,((Mt={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)},Mt));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 Vu(a){var d=a._state,g=a._deps.indexedDB;if(d.isBeingOpened||a.idbdb)return d.dbReadyPromise.then(function(){return d.dbOpenError?Tt(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=wn(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=wn(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,we,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,we=Ue,(pe=a).verno=Pe.version/10,we=pe._dbSchema=cn(0,Pe,we),pe._storeNames=V(Pe.objectStoreNames,0),qo(pe,[pe._allTables],f(we),we);else if(Rr(a,a._dbSchema,Ue),ye=Ue,((ye=Js(cn(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(Ct,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(),Tt(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 dn(-1/0,[[[]]]))}),te["idb://".concat(a.name,"/").concat(le.name,"/")]=te["idb://".concat(a.name,"/").concat(le.name,"/:dels")]=new dn(-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(we,je){return we.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,we){ye.continuePrimaryKey(ii(pe,a.MAX_KEY,se),we)}},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 Uu={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(we,je){var Pe,De,Ie,Ue=ye[je],Le={onerror:null,onsuccess:null};return G.type==="delete"?R.fire.call(Le,we,Ue,oe):G.type==="add"||Ue===void 0?(Pe=ee.fire.call(Le,we,G.values[je],oe),we==null&&Pe!=null&&(G.keys[je]=we=Pe,w.outbound||W(G.values[je],w.keyPath,we))):(Pe=Gi(Ue,G.values[je]),(De=ce.fire.call(Le,Pe,we,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(we){for(var je=we.failures,Pe=we.results,De=we.numFailures,we=we.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:we}}).catch(function(we){return pe.forEach(function(je){return je.onerror&&je.onerror(we)}),Promise.reject(we)})});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 Ku={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 dn(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 dn((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 dn)}var ae,ye,pe,we=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)})),we.mutatedParts=ri(we.mutatedParts||{},je),Ce})}}),le={get:function(se){return[R,new dn(se.key)]},getMany:function(se){return[R,new dn().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 we,ae=function(Le){return Le="idb://".concat(d,"/").concat(w,"/").concat(Le),pe[Le]||(pe[Le]=new dn)},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 we=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 we.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 dn,pe=se.values.length-1;0<=pe;--pe){var we,je=se.values[pe],Pe=ce(je);!ye.hasKey(Pe)&&(we=ne(je),R&&m(we)?we.some(function(Ye){return ea(Ye,ee)}):ea(we,ee))&&(ye.addKey(Pe),ae.push(je))}switch(se.type){case"add":var De=new dn().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 dn().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 dn().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,we=(De=ye[ae]).slice();pe<we.length;pe++)qi((Ie=we[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 we=(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")===we&&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")===we&&(!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 Vu(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=wn(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)}):Tt(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(we){return we.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)})):Tt(we)}var ae,ye=O(se),pe=(ye&&yr(),Ve.follow(function(){var we;(ae=se.call(oe,oe))&&(ye?(we=Yt.bind(null,null),ae.then(we,we)):typeof ae.next=="function"&&typeof ae.throw=="function"&&(ae=Qi(ae)))},pe));return(ae&&typeof ae.then=="function"?Ve.resolve(ae).then(function(we){return oe.active?we:Tt(new Ee.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):pe.then(function(){return ae})).then(function(we){return le&&oe._resolve(),oe._completion.then(function(){return we})}).catch(function(we){return oe._reject(we),Tt(we)})})}).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=Be(this,"populate","blocked","versionchange","close",{ready:[Ct,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:Be(null,{creating:[ve,He],reading:[ct,Ke],updating:[bt,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=Be(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(),Tt(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(Ku),this.use(el),this.use(Zi),this.use(Ya),this.use(Uu),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=(we=>{var je=zn();try{N&&yr();var Pe=Bn(a,we);return Pe=N?Pe.finally(Yt):Pe}finally{je&&Fn()}})(ye={subscr:ae,signal:$.signal,requery:te,querier:a,trans:null}),G||(qn(xs,se),G=!0),Promise.resolve(pe).then(function(we){g=!0,d=we,R||ye.signal.aborted||(le()||(ce=ae,le())?te():(ee={},Gr(function(){return!R&&S.next&&S.next(we)})))},function(we){g=!1,["DatabaseClosedError","AbortError"].includes(we==null?void 0:we.name)||R||Gr(function(){R||S.error&&S.error(we)})}))};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 Tt(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 Tt(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 Tt(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 gt},set:function(a){jt(a)}},derive:I,extend:y,props:k,override:P,Events:Be,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:F,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){gt&&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&&(gt&&console.debug("Dexie: handling persisted pageshow"),li(),Jo({all:new dn(-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)},jt(gt),i(Dr,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:Dr,Entity:yn,PropModification:br,RangeSet:dn,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 ix=sx();const jd=Eu(ix),dh=Symbol.for("Dexie"),hu=globalThis[dh]||(globalThis[dh]=jd);if(jd.semVer!==hu.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${jd.semVer} and ${hu.semVer}`);const{liveQuery:O2,mergeRanges:R2,rangesOverlap:L2,RangeSet:D2,cmp:z2,Entity:F2,PropModification:B2,replacePrefix:H2,add:V2,remove:U2,DexieYProvider:K2}=hu,Cd=500;class ax extends hu{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 ax,$i="openapiOverride";async function lx(t){await nt.kv.put({key:$i,value:JSON.stringify(t)})}async function fh(){await nt.kv.delete($i)}function Om(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 Rm(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 ux(t,r){const o=t.toLowerCase();return nt.requestPresets.where("path").equals(r).filter(i=>i.method.toLowerCase()===o).toArray()}async function cx(t){return nt.requestPresets.add(t)}async function dx(t){await nt.requestPresets.delete(t)}async function Lm(){const t=await nt.tryHistory.count();if(t<=Cd)return;const r=t-Cd,o=await nt.tryHistory.orderBy("at").limit(r).primaryKeys();await nt.tryHistory.bulkDelete(o)}async function ph(t){await nt.tryHistory.add(t),await Lm()}async function fx(){return nt.tryHistory.orderBy("at").reverse().toArray()}async function px(){await nt.tryHistory.clear()}async function hx(t){await nt.tryHistory.delete(t)}async function mx(){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(Om),tryHistory:l.map(Rm),...y!==void 0?{importedOpenApi:y}:{}}}async function Dm(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(Om(r));for(const r of t.tryHistory??[])await nt.tryHistory.add(Rm(r));await Lm(),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 gx(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 Dm(t),!0)}function yx(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=Ud(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 tn(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=tn(t[o]))!==""&&(r+=(r&&" ")+i);else for(let o in t)t[o]&&(r+=(r&&" ")+o);return r}var xx={value:()=>{}};function Mu(){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 vx(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=Mu.prototype={constructor:iu,on:function(t,r){var o=this._,i=vx(t+"",o),l,c=-1,f=i.length;if(arguments.length<2){for(;++c<f;)if((l=(t=i[c]).type)&&(l=wx(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]=hh(o[l],t.name,r);else if(r==null)for(l in o)o[l]=hh(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 wx(t,r){for(var o=0,i=t.length,l;o<i;++o)if((l=t[o]).name===r)return l.value}function hh(t,r,o){for(var i=0,l=t.length;i<l;++i)if(t[i].name===r){t[i]=xx,t=t.slice(0,i).concat(t.slice(i+1));break}return o!=null&&t.push({name:r,value:o}),t}var Pd="http://www.w3.org/1999/xhtml";const mh={svg:"http://www.w3.org/2000/svg",xhtml:Pd,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Tu(t){var r=t+="",o=r.indexOf(":");return o>=0&&(r=t.slice(0,o))!=="xmlns"&&(t=t.slice(o+1)),mh.hasOwnProperty(r)?{space:mh[r],local:t}:t}function bx(t){return function(){var r=this.ownerDocument,o=this.namespaceURI;return o===Pd&&r.documentElement.namespaceURI===Pd?r.createElement(t):r.createElementNS(o,t)}}function kx(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function zm(t){var r=Tu(t);return(r.local?kx:bx)(r)}function _x(){}function Kd(t){return t==null?_x:function(){return this.querySelector(t)}}function Sx(t){typeof t!="function"&&(t=Kd(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 Nx(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function Ex(){return[]}function Fm(t){return t==null?Ex:function(){return this.querySelectorAll(t)}}function jx(t){return function(){return Nx(t.apply(this,arguments))}}function Cx(t){typeof t=="function"?t=jx(t):t=Fm(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 Hm(t){return function(r){return r.matches(t)}}var Px=Array.prototype.find;function Mx(t){return function(){return Px.call(this.children,t)}}function Tx(){return this.firstElementChild}function Ix(t){return this.select(t==null?Tx:Mx(typeof t=="function"?t:Hm(t)))}var $x=Array.prototype.filter;function Ax(){return Array.from(this.children)}function Ox(t){return function(){return $x.call(this.children,t)}}function Rx(t){return this.selectAll(t==null?Ax:Ox(typeof t=="function"?t:Hm(t)))}function Lx(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 Vm(t){return new Array(t.length)}function Dx(){return new dr(this._enter||this._groups.map(Vm),this._parents)}function mu(t,r){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=r}mu.prototype={constructor:mu,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 zx(t){return function(){return t}}function Fx(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 mu(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 mu(t,c[m]);for(m=0;m<_;++m)(y=r[m])&&b.get(k[m])===y&&(l[m]=y)}function Hx(t){return t.__data__}function Vx(t,r){if(!arguments.length)return Array.from(this,Hx);var o=r?Bx:Fx,i=this._parents,l=this._groups;typeof t!="function"&&(t=zx(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=Ux(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,F;V<C;++V)if(M=I[V]){for(V>=P&&(P=V+1);!(F=A[P])&&++P<C;);M._next=F||null}}return f=new dr(f,i),f._enter=m,f._exit=y,f}function Ux(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Kx(){return new dr(this._exit||this._groups.map(Vm),this._parents)}function qx(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 Wx(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 Yx(){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 Xx(t){t||(t=Qx);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 Qx(t,r){return t<r?-1:t>r?1:t>=r?0:NaN}function Gx(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Jx(){return Array.from(this)}function Zx(){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 ev(){let t=0;for(const r of this)++t;return t}function tv(){return!this.node()}function nv(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 rv(t){return function(){this.removeAttribute(t)}}function ov(t){return function(){this.removeAttributeNS(t.space,t.local)}}function sv(t,r){return function(){this.setAttribute(t,r)}}function iv(t,r){return function(){this.setAttributeNS(t.space,t.local,r)}}function av(t,r){return function(){var o=r.apply(this,arguments);o==null?this.removeAttribute(t):this.setAttribute(t,o)}}function lv(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 uv(t,r){var o=Tu(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?ov:rv:typeof r=="function"?o.local?lv:av:o.local?iv:sv)(o,r))}function Um(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function cv(t){return function(){this.style.removeProperty(t)}}function dv(t,r,o){return function(){this.style.setProperty(t,r,o)}}function fv(t,r,o){return function(){var i=r.apply(this,arguments);i==null?this.style.removeProperty(t):this.style.setProperty(t,i,o)}}function pv(t,r,o){return arguments.length>1?this.each((r==null?cv:typeof r=="function"?fv:dv)(t,r,o??"")):Ai(this.node(),t)}function Ai(t,r){return t.style.getPropertyValue(r)||Um(t).getComputedStyle(t,null).getPropertyValue(r)}function hv(t){return function(){delete this[t]}}function mv(t,r){return function(){this[t]=r}}function gv(t,r){return function(){var o=r.apply(this,arguments);o==null?delete this[t]:this[t]=o}}function yv(t,r){return arguments.length>1?this.each((r==null?hv:typeof r=="function"?gv:mv)(t,r)):this.node()[t]}function Km(t){return t.trim().split(/^|\s+/)}function qd(t){return t.classList||new qm(t)}function qm(t){this._node=t,this._names=Km(t.getAttribute("class")||"")}qm.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 Wm(t,r){for(var o=qd(t),i=-1,l=r.length;++i<l;)o.add(r[i])}function Ym(t,r){for(var o=qd(t),i=-1,l=r.length;++i<l;)o.remove(r[i])}function xv(t){return function(){Wm(this,t)}}function vv(t){return function(){Ym(this,t)}}function wv(t,r){return function(){(r.apply(this,arguments)?Wm:Ym)(this,t)}}function bv(t,r){var o=Km(t+"");if(arguments.length<2){for(var i=qd(this.node()),l=-1,c=o.length;++l<c;)if(!i.contains(o[l]))return!1;return!0}return this.each((typeof r=="function"?wv:r?xv:vv)(o,r))}function kv(){this.textContent=""}function _v(t){return function(){this.textContent=t}}function Sv(t){return function(){var r=t.apply(this,arguments);this.textContent=r??""}}function Nv(t){return arguments.length?this.each(t==null?kv:(typeof t=="function"?Sv:_v)(t)):this.node().textContent}function Ev(){this.innerHTML=""}function jv(t){return function(){this.innerHTML=t}}function Cv(t){return function(){var r=t.apply(this,arguments);this.innerHTML=r??""}}function Pv(t){return arguments.length?this.each(t==null?Ev:(typeof t=="function"?Cv:jv)(t)):this.node().innerHTML}function Mv(){this.nextSibling&&this.parentNode.appendChild(this)}function Tv(){return this.each(Mv)}function Iv(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function $v(){return this.each(Iv)}function Av(t){var r=typeof t=="function"?t:zm(t);return this.select(function(){return this.appendChild(r.apply(this,arguments))})}function Ov(){return null}function Rv(t,r){var o=typeof t=="function"?t:zm(t),i=r==null?Ov:typeof r=="function"?r:Kd(r);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function Lv(){var t=this.parentNode;t&&t.removeChild(this)}function Dv(){return this.each(Lv)}function zv(){var t=this.cloneNode(!1),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function Fv(){var t=this.cloneNode(!0),r=this.parentNode;return r?r.insertBefore(t,this.nextSibling):t}function Bv(t){return this.select(t?Fv:zv)}function Hv(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Vv(t){return function(r){t.call(this,r,this.__data__)}}function Uv(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 Kv(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 qv(t,r,o){return function(){var i=this.__on,l,c=Vv(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 Wv(t,r,o){var i=Uv(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?qv:Kv,l=0;l<c;++l)this.each(m(i[l],r,o));return this}function Xm(t,r,o){var i=Um(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 Yv(t,r){return function(){return Xm(this,t,r)}}function Xv(t,r){return function(){return Xm(this,t,r.apply(this,arguments))}}function Qv(t,r){return this.each((typeof r=="function"?Xv:Yv)(t,r))}function*Gv(){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 Qm=[null];function dr(t,r){this._groups=t,this._parents=r}function Da(){return new dr([[document.documentElement]],Qm)}function Jv(){return this}dr.prototype=Da.prototype={constructor:dr,select:Sx,selectAll:Cx,selectChild:Ix,selectChildren:Rx,filter:Lx,data:Vx,enter:Dx,exit:Kx,join:qx,merge:Wx,selection:Jv,order:Yx,sort:Xx,call:Gx,nodes:Jx,node:Zx,size:ev,empty:tv,each:nv,attr:uv,style:pv,property:yv,classed:bv,text:Nv,html:Pv,raise:Tv,lower:$v,append:Av,insert:Rv,remove:Dv,clone:Bv,datum:Hv,on:Wv,dispatch:Qv,[Symbol.iterator]:Gv};function cr(t){return typeof t=="string"?new dr([[document.querySelector(t)]],[document.documentElement]):new dr([[t]],Qm)}function Zv(t){let r;for(;r=t.sourceEvent;)t=r;return t}function Kr(t,r){if(t=Zv(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 ew={passive:!1},Ca={capture:!0,passive:!1};function ud(t){t.stopImmediatePropagation()}function Mi(t){t.preventDefault(),t.stopImmediatePropagation()}function Gm(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 Jm(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 Md(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:_}})}Md.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function tw(t){return!t.ctrlKey&&!t.button}function nw(){return this.parentNode}function rw(t,r){return r??{x:t.x,y:t.y}}function ow(){return navigator.maxTouchPoints||"ontouchstart"in this}function Zm(){var t=tw,r=nw,o=rw,i=ow,l={},c=Mu("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,ew).on("touchend.drag touchcancel.drag",V).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function j(M,F){if(!(_||!t.call(this,M,F))){var U=P(this,r.call(this,M,F),M,F,"mouse");U&&(cr(M.view).on("mousemove.drag",C,Ca).on("mouseup.drag",I,Ca),Gm(M.view),ud(M),b=!1,m=M.clientX,y=M.clientY,U("start",M))}}function C(M){if(Mi(M),!b){var F=M.clientX-m,U=M.clientY-y;b=F*F+U*U>v}l.mouse("drag",M)}function I(M){cr(M.view).on("mousemove.drag mouseup.drag",null),Jm(M.view,b),Mi(M),l.mouse("end",M)}function A(M,F){if(t.call(this,M,F)){var U=M.changedTouches,W=r.call(this,M,F),Z=U.length,fe,Se;for(fe=0;fe<Z;++fe)(Se=P(this,W,M,F,U[fe].identifier,U[fe]))&&(ud(M),Se("start",M,U[fe]))}}function T(M){var F=M.changedTouches,U=F.length,W,Z;for(W=0;W<U;++W)(Z=l[F[W].identifier])&&(Mi(M),Z("drag",M,F[W]))}function V(M){var F=M.changedTouches,U=F.length,W,Z;for(_&&clearTimeout(_),_=setTimeout(function(){_=null},500),W=0;W<U;++W)(Z=l[F[W].identifier])&&(ud(M),Z("end",M,F[W]))}function P(M,F,U,W,Z,fe){var Se=c.copy(),X=Kr(fe||U,F),de,be,z;if((z=o.call(M,new Md("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,F),J=f;break}Se.call(Q,M,new Md(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 Wd(t,r,o){t.prototype=r.prototype=o,o.constructor=t}function e0(t,r){var o=Object.create(t.prototype);for(var i in r)o[i]=r[i];return o}function za(){}var Pa=.7,gu=1/Pa,Ti="\\s*([+-]?\\d+)\\s*",Ma="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ao="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sw=/^#([0-9a-f]{3,8})$/,iw=new RegExp(`^rgb\\(${Ti},${Ti},${Ti}\\)$`),aw=new RegExp(`^rgb\\(${ao},${ao},${ao}\\)$`),lw=new RegExp(`^rgba\\(${Ti},${Ti},${Ti},${Ma}\\)$`),uw=new RegExp(`^rgba\\(${ao},${ao},${ao},${Ma}\\)$`),cw=new RegExp(`^hsl\\(${Ma},${ao},${ao}\\)$`),dw=new RegExp(`^hsla\\(${Ma},${ao},${ao},${Ma}\\)$`),gh={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};Wd(za,Vs,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:yh,formatHex:yh,formatHex8:fw,formatHsl:pw,formatRgb:xh,toString:xh});function yh(){return this.rgb().formatHex()}function fw(){return this.rgb().formatHex8()}function pw(){return t0(this).formatHsl()}function xh(){return this.rgb().formatRgb()}function Vs(t){var r,o;return t=(t+"").trim().toLowerCase(),(r=sw.exec(t))?(o=r[1].length,r=parseInt(r[1],16),o===6?vh(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=iw.exec(t))?new Zn(r[1],r[2],r[3],1):(r=aw.exec(t))?new Zn(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=lw.exec(t))?Wl(r[1],r[2],r[3],r[4]):(r=uw.exec(t))?Wl(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=cw.exec(t))?kh(r[1],r[2]/100,r[3]/100,1):(r=dw.exec(t))?kh(r[1],r[2]/100,r[3]/100,r[4]):gh.hasOwnProperty(t)?vh(gh[t]):t==="transparent"?new Zn(NaN,NaN,NaN,0):null}function vh(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 hw(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 Td(t,r,o,i){return arguments.length===1?hw(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}Wd(Zn,Td,e0(za,{brighter(t){return t=t==null?gu:Math.pow(gu,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(Bs(this.r),Bs(this.g),Bs(this.b),yu(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:wh,formatHex:wh,formatHex8:mw,formatRgb:bh,toString:bh}));function wh(){return`#${Fs(this.r)}${Fs(this.g)}${Fs(this.b)}`}function mw(){return`#${Fs(this.r)}${Fs(this.g)}${Fs(this.b)}${Fs((isNaN(this.opacity)?1:this.opacity)*255)}`}function bh(){const t=yu(this.opacity);return`${t===1?"rgb(":"rgba("}${Bs(this.r)}, ${Bs(this.g)}, ${Bs(this.b)}${t===1?")":`, ${t})`}`}function yu(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Bs(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Fs(t){return t=Bs(t),(t<16?"0":"")+t.toString(16)}function kh(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 t0(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 gw(t,r,o,i){return arguments.length===1?t0(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}Wd(qr,gw,e0(za,{brighter(t){return t=t==null?gu:Math.pow(gu,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(cd(t>=240?t-240:t+120,l,i),cd(t,l,i),cd(t<120?t+240:t-120,l,i),this.opacity)},clamp(){return new qr(_h(this.h),Yl(this.s),Yl(this.l),yu(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=yu(this.opacity);return`${t===1?"hsl(":"hsla("}${_h(this.h)}, ${Yl(this.s)*100}%, ${Yl(this.l)*100}%${t===1?")":`, ${t})`}`}}));function _h(t){return t=(t||0)%360,t<0?t+360:t}function Yl(t){return Math.max(0,Math.min(1,t||0))}function cd(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 Yd=t=>()=>t;function yw(t,r){return function(o){return t+o*r}}function xw(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 vw(t){return(t=+t)==1?n0:function(r,o){return o-r?xw(r,o,t):Yd(isNaN(r)?o:r)}}function n0(t,r){var o=r-t;return o?yw(t,o):Yd(isNaN(t)?r:t)}const xu=(function t(r){var o=vw(r);function i(l,c){var f=o((l=Td(l)).r,(c=Td(c)).r),m=o(l.g,c.g),y=o(l.b,c.b),b=n0(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 ww(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 bw(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function kw(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 _w(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 Sw(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 Id=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,dd=new RegExp(Id.source,"g");function Nw(t){return function(){return t}}function Ew(t){return function(r){return t(r)+""}}function r0(t,r){var o=Id.lastIndex=dd.lastIndex=0,i,l,c,f=-1,m=[],y=[];for(t=t+"",r=r+"";(i=Id.exec(t))&&(l=dd.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=dd.lastIndex;return o<r.length&&(c=r.slice(o),m[f]?m[f]+=c:m[++f]=c),m.length<2?y[0]?Ew(y[0].x):Nw(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"?Yd(r):(o==="number"?io:o==="string"?(i=Vs(r))?(r=i,xu):r0:r instanceof Vs?xu:r instanceof Date?_w:bw(r)?ww:Array.isArray(r)?kw:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Sw:io)(t,r)}var Sh=180/Math.PI,$d={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function o0(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)*Sh,skewX:Math.atan(y)*Sh,scaleX:f,scaleY:m}}var Xl;function jw(t){const r=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return r.isIdentity?$d:o0(r.a,r.b,r.c,r.d,r.e,r.f)}function Cw(t){return t==null||(Xl||(Xl=document.createElementNS("http://www.w3.org/2000/svg","g")),Xl.setAttribute("transform",t),!(t=Xl.transform.baseVal.consolidate()))?$d:(t=t.matrix,o0(t.a,t.b,t.c,t.d,t.e,t.f))}function s0(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 Pw=s0(jw,"px, ","px)","deg)"),Mw=s0(Cw,", ",")",")"),Tw=1e-12;function Nh(t){return((t=Math.exp(t))+1/t)/2}function Iw(t){return((t=Math.exp(t))-1/t)/2}function $w(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<Tw)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),F=Math.log(Math.sqrt(P*P+1)-P),U=Math.log(Math.sqrt(M*M+1)-M);T=(U-F)/r,A=function(W){var Z=W*T,fe=Nh(F),Se=b/(o*V)*(fe*$w(r*Z+F)-Iw(F));return[m+Se*j,y+Se*C,b*fe/Nh(r*Z+F)]}}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,i0=1e3,vu,Na,wu=0,Us=0,Iu=0,Ta=typeof performance=="object"&&performance.now?performance:Date,a0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Xd(){return Us||(a0(Aw),Us=Ta.now()+Iu)}function Aw(){Us=0}function bu(){this._call=this._time=this._next=null}bu.prototype=l0.prototype={constructor:bu,restart:function(t,r,o){if(typeof t!="function")throw new TypeError("callback is not a function");o=(o==null?Xd():+o)+(r==null?0:+r),!this._next&&Na!==this&&(Na?Na._next=this:vu=this,Na=this),this._call=t,this._time=o,Ad()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ad())}};function l0(t,r,o){var i=new bu;return i.restart(t,r,o),i}function Ow(){Xd(),++Oi;for(var t=vu,r;t;)(r=Us-t._time)>=0&&t._call.call(void 0,r),t=t._next;--Oi}function Eh(){Us=(wu=Ta.now())+Iu,Oi=Sa=0;try{Ow()}finally{Oi=0,Lw(),Us=0}}function Rw(){var t=Ta.now(),r=t-wu;r>i0&&(Iu-=r,wu=t)}function Lw(){for(var t,r=vu,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:vu=o);Na=t,Ad(i)}function Ad(t){if(!Oi){Sa&&(Sa=clearTimeout(Sa));var r=t-Us;r>24?(t<1/0&&(Sa=setTimeout(Eh,t-Ta.now()-Iu)),ka&&(ka=clearInterval(ka))):(ka||(wu=Ta.now(),ka=setInterval(Rw,i0)),Oi=1,a0(Eh))}}function jh(t,r,o){var i=new bu;return r=r==null?0:+r,i.restart(l=>{i.stop(),t(l+r)},r,o),i}var Dw=Mu("start","end","cancel","interrupt"),zw=[],u0=0,Ch=1,Od=2,lu=3,Ph=4,Rd=5,uu=6;function $u(t,r,o,i,l,c){var f=t.__transition;if(!f)t.__transition={};else if(o in f)return;Fw(t,o,{name:r,index:i,group:l,on:Dw,tween:zw,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:u0})}function Qd(t,r){var o=Xr(t,r);if(o.state>u0)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 Fw(t,r,o){var i=t.__transition,l;i[r]=o,o.timer=l0(c,0,o.time);function c(b){o.state=Ch,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!==Ch)return y();for(_ in i)if(j=i[_],j.name===o.name){if(j.state===lu)return jh(f);j.state===Ph?(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(jh(function(){o.state===lu&&(o.state=Ph,o.timer.restart(m,o.delay,o.time),m(b))}),o.state=Od,o.on.call("start",t,t.__data__,o.index,o.group),o.state===Od){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=Rd,1),v=-1,k=l.length;++v<k;)l[v].call(t,_);o.state===Rd&&(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>Od&&i.state<Rd,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 Hw(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 Vw(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 Uw(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?Hw:Vw)(o,t,r))}function Gd(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 c0(t,r){var o;return(typeof r=="number"?io:r instanceof Vs?xu:(o=Vs(r))?(r=o,xu):r0)(t,r)}function Kw(t){return function(){this.removeAttribute(t)}}function qw(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ww(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 Yw(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 Xw(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 Qw(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 Gw(t,r){var o=Tu(t),i=o==="transform"?Mw:c0;return this.attrTween(t,typeof r=="function"?(o.local?Qw:Xw)(o,i,Gd(this,"attr."+t,r)):r==null?(o.local?qw:Kw)(o):(o.local?Yw:Ww)(o,i,r))}function Jw(t,r){return function(o){this.setAttribute(t,r.call(this,o))}}function Zw(t,r){return function(o){this.setAttributeNS(t.space,t.local,r.call(this,o))}}function e1(t,r){var o,i;function l(){var c=r.apply(this,arguments);return c!==i&&(o=(i=c)&&Zw(t,c)),o}return l._value=r,l}function t1(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 n1(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=Tu(t);return this.tween(o,(i.local?e1:t1)(i,r))}function r1(t,r){return function(){Qd(this,t).delay=+r.apply(this,arguments)}}function o1(t,r){return r=+r,function(){Qd(this,t).delay=r}}function s1(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?r1:o1)(r,t)):Xr(this.node(),r).delay}function i1(t,r){return function(){co(this,t).duration=+r.apply(this,arguments)}}function a1(t,r){return r=+r,function(){co(this,t).duration=r}}function l1(t){var r=this._id;return arguments.length?this.each((typeof t=="function"?i1:a1)(r,t)):Xr(this.node(),r).duration}function u1(t,r){if(typeof r!="function")throw new Error;return function(){co(this,t).ease=r}}function c1(t){var r=this._id;return arguments.length?this.each(u1(r,t)):Xr(this.node(),r).ease}function d1(t,r){return function(){var o=r.apply(this,arguments);if(typeof o!="function")throw new Error;co(this,t).ease=o}}function f1(t){if(typeof t!="function")throw new Error;return this.each(d1(this._id,t))}function p1(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 h1(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 m1(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 g1(t,r,o){var i,l,c=m1(r)?Qd:co;return function(){var f=c(this,t),m=f.on;m!==i&&(l=(i=m).copy()).on(r,o),f.on=l}}function y1(t,r){var o=this._id;return arguments.length<2?Xr(this.node(),o).on.on(t):this.each(g1(o,t,r))}function x1(t){return function(){var r=this.parentNode;for(var o in this.__transition)if(+o!==t)return;r&&r.removeChild(this)}}function v1(){return this.on("end.remove",x1(this._id))}function w1(t){var r=this._name,o=this._id;typeof t!="function"&&(t=Kd(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,$u(b[k],r,o,k,b,Xr(_,o)));return new zo(c,this._parents,r,o)}function b1(t){var r=this._name,o=this._id;typeof t!="function"&&(t=Fm(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])&&$u(j,r,o,I,k,C);c.push(k),f.push(_)}return new zo(c,f,r,o)}var k1=Da.prototype.constructor;function _1(){return new k1(this._groups,this._parents)}function S1(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 d0(t){return function(){this.style.removeProperty(t)}}function N1(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 E1(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 j1(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=d0(r)):void 0;(b!==o||l!==_)&&(i=(o=b).copy()).on(f,l=_),y.on=i}}function C1(t,r,o){var i=(t+="")=="transform"?Pw:c0;return r==null?this.styleTween(t,S1(t,i)).on("end.style."+t,d0(t)):typeof r=="function"?this.styleTween(t,E1(t,i,Gd(this,"style."+t,r))).each(j1(this._id,t)):this.styleTween(t,N1(t,i,r),o).on("end.style."+t,null)}function P1(t,r,o){return function(i){this.style.setProperty(t,r.call(this,i),o)}}function M1(t,r,o){var i,l;function c(){var f=r.apply(this,arguments);return f!==l&&(i=(l=f)&&P1(t,f,o)),i}return c._value=r,c}function T1(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,M1(t,r,o??""))}function I1(t){return function(){this.textContent=t}}function $1(t){return function(){var r=t(this);this.textContent=r??""}}function A1(t){return this.tween("text",typeof t=="function"?$1(Gd(this,"text",t)):I1(t==null?"":t+""))}function O1(t){return function(r){this.textContent=t.call(this,r)}}function R1(t){var r,o;function i(){var l=t.apply(this,arguments);return l!==o&&(r=(o=l)&&O1(l)),r}return i._value=t,i}function L1(t){var r="text";if(arguments.length<1)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,R1(t))}function D1(){for(var t=this._name,r=this._id,o=f0(),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);$u(y,t,o,b,f,{time:_.time+_.delay+_.duration,delay:0,duration:_.duration,ease:_.ease})}return new zo(i,this._parents,t,o)}function z1(){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 F1=0;function zo(t,r,o,i){this._groups=t,this._parents=r,this._name=o,this._id=i}function f0(){return++F1}var Oo=Da.prototype;zo.prototype={constructor:zo,select:w1,selectAll:b1,selectChild:Oo.selectChild,selectChildren:Oo.selectChildren,filter:p1,merge:h1,selection:_1,transition:D1,call:Oo.call,nodes:Oo.nodes,node:Oo.node,size:Oo.size,empty:Oo.empty,each:Oo.each,on:y1,attr:Gw,attrTween:n1,style:C1,styleTween:T1,text:A1,textTween:L1,remove:v1,tween:Uw,delay:s1,duration:l1,ease:c1,easeVarying:f1,end:z1,[Symbol.iterator]:Oo[Symbol.iterator]};function B1(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var H1={time:null,delay:0,duration:250,ease:B1};function V1(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 U1(t){var r,o;t instanceof zo?(r=t._id,t=t._name):(r=f0(),(o=H1).time=Xd(),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])&&$u(y,t,r,b,f,o||V1(y,r));return new zo(i,this._parents,t,r)}Da.prototype.interrupt=Bw;Da.prototype.transition=U1;const Ql=t=>()=>t;function K1(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 Au=new Lo(1,0,0);p0.prototype=Lo.prototype;function p0(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Au;return t.__zoom}function fd(t){t.stopImmediatePropagation()}function _a(t){t.preventDefault(),t.stopImmediatePropagation()}function q1(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function W1(){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 Mh(){return this.__zoom||Au}function Y1(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function X1(){return navigator.maxTouchPoints||"ontouchstart"in this}function Q1(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 h0(){var t=q1,r=W1,o=Q1,i=Y1,l=X1,c=[0,1/0],f=[[-1/0,-1/0],[1/0,1/0]],m=250,y=au,b=Mu("start","zoom","end"),_,v,k,j=500,C=150,I=0,A=10;function T(z){z.property("__zoom",Mh).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",Mh),z!==H?F(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(Au.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 F(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 K1(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;Gm(z.view),fd(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),Jm(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(F,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(fd(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(fd(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]],m0=["Enter"," ","Escape"],g0={"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 y0={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 ku;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(ku||(ku={}));var rt;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(rt||(rt={}));const Th={[rt.Left]:rt.Right,[rt.Right]:rt.Left,[rt.Top]:rt.Bottom,[rt.Bottom]:rt.Top};function x0(t){return t===null?null:t?"valid":"invalid"}const v0=t=>"id"in t&&"source"in t&&"target"in t,G1=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Jd=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),Fa=(t,r=[0,0])=>{const{width:o,height:i}=Fo(t),l=t.origin??r,c=o*l[0],f=i*l[1];return{x:t.position.x-c,y:t.position.y-f}},J1=(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):Jd(l)?l:r.nodeLookup.get(l.id));const m=f?_u(f,r.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ou(i,m)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Ru(o)},Ba=(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=Ou(o,_u(l)),i=!0)}),i?Ru(o):{x:0,y:0,width:0,height:0}},Zd=(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},Z1=(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 eb(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 tb({nodes:t,width:r,height:o,panZoom:i,minZoom:l,maxZoom:c},f){if(t.size===0)return Promise.resolve(!0);const m=eb(t,f),y=Ba(m),b=ef(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 w0({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 nb({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),_=Z1(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 b0(t,r,o){const{width:i,height:l}=Fo(o),{x:c,y:f}=o.internals.positionAbsolute;return Ks(t,[[c,f],[c+i,f+l]],r)}const Ih=(t,r,o)=>t<r?Li(Math.abs(t-r),1,r)/r:t>o?-Li(Math.abs(t-o),1,r)/r:0,k0=(t,r,o=15,i=40)=>{const l=Ih(t.x,i,r.width-i)*o,c=Ih(t.y,i,r.height-i)*o;return[l,c]},Ou=(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)}),Ld=({x:t,y:r,width:o,height:i})=>({x:t,y:r,x2:t+o,y2:r+i}),Ru=({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}=Jd(t)?t.internals.positionAbsolute:Fa(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}},_u=(t,r=[0,0])=>{var l,c;const{x:o,y:i}=Jd(t)?t.internals.positionAbsolute:Fa(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)}},_0=(t,r)=>Ru(Ou(Ld(t),Ld(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)},$h=t=>Wr(t.width)&&Wr(t.height)&&Wr(t.x)&&Wr(t.y),Wr=t=>!isNaN(t)&&isFinite(t),rb=(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},Su=({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 ob(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 sb(t,r,o,i,l,c){const{x:f,y:m}=Su(t,[r,o,i]),{x:y,y:b}=Su({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 ef=(t,r,o,i,l,c)=>{const f=ob(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=sb(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 Fo(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 S0(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 N0(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 Ah(t,r){if(t.size!==r.size)return!1;for(const o of t)if(!r.has(o))return!1;return!0}function ib(){let t,r;return{promise:new Promise((i,l)=>{t=i,r=l}),resolve:t,reject:r}}function ab(t){return{...g0,...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 tf=t=>({width:t.offsetWidth,height:t.offsetHeight}),E0=t=>{var r;return((r=t==null?void 0:t.getRootNode)==null?void 0:r.call(t))||(window==null?void 0:window.document)},lb=["INPUT","SELECT","TEXTAREA"];function j0(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:lb.includes(r.nodeName)||r.hasAttribute("contenteditable")||!!r.closest(".nokey")}const C0=t=>"clientX"in t,Yr=(t,r)=>{var c,f;const o=C0(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)}},Oh=(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,...tf(f)}})};function P0({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 Rh({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 M0({sourceX:t,sourceY:r,sourcePosition:o=rt.Bottom,targetX:i,targetY:l,targetPosition:c=rt.Top,curvature:f=.25}){const[m,y]=Rh({pos:o,x1:t,y1:r,x2:i,y2:l,c:f}),[b,_]=Rh({pos:c,x1:i,y1:l,x2:t,y2:r,c:f}),[v,k,j,C]=P0({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 T0({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 ub({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 cb({sourceNode:t,targetNode:r,width:o,height:i,transform:l}){const c=Ou(_u(t),_u(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,Ru(c))>0}const db=({source:t,sourceHandle:r,target:o,targetHandle:i})=>`xy-edge__${t}${r||""}-${o}${i||""}`,fb=(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)),I0=(t,r,o={})=>{if(!t.source||!t.target)return r;const i=o.getEdgeId||db;let l;return v0(t)?l={...t}:l={...t,id:i(t)},fb(l,r)?r:(l.sourceHandle===null&&delete l.sourceHandle,l.targetHandle===null&&delete l.targetHandle,r.concat(l))};function $0({sourceX:t,sourceY:r,targetX:o,targetY:i}){const[l,c,f,m]=T0({sourceX:t,sourceY:r,targetX:o,targetY:i});return[`M ${t},${r}L ${o},${i}`,l,c,f,m]}const Lh={[rt.Left]:{x:-1,y:0},[rt.Right]:{x:1,y:0},[rt.Top]:{x:0,y:-1},[rt.Bottom]:{x:0,y:1}},pb=({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},Dh=(t,r)=>Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));function hb({source:t,sourcePosition:r=rt.Bottom,target:o,targetPosition:i=rt.Top,center:l,offset:c,stepPosition:f}){const m=Lh[r],y=Lh[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=pb({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]=T0({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 F={x:b.x+T.x,y:b.y+T.y},U={x:_.x+V.x,y:_.y+V.y};return[[t,...F.x!==C[0].x||F.y!==C[0].y?[F]:[],...C,...U.x!==C[C.length-1].x||U.y!==C[C.length-1].y?[U]:[],o],I,A,P,M]}function mb(t,r,o,i){const l=Math.min(Dh(t,r)/2,Dh(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 Dd({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]=hb({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+=mb(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 zh(t){var r;return t&&!!(t.internals.handleBounds||(r=t.handles)!=null&&r.length)&&!!(t.measured.width||t.width||t.initialWidth)}function gb(t){var v;const{sourceNode:r,targetNode:o}=t;if(!zh(r)||!zh(o))return null;const i=r.internals.handleBounds||Fh(r.handles),l=o.internals.handleBounds||Fh(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 Fh(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??Fo(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 zd(t,r){return t?typeof t=="string"?t:`${r?`${r}__`:""}${Object.keys(t).sort().map(i=>`${i}=${t[i]}`).join("&")}`:""}function yb(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=zd(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 A0=1e3,xb=10,nf={nodeOrigin:[0,0],nodeExtent:Ia,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},vb={...nf,checkEquality:!0};function rf(t,r){const o={...t};for(const i in r)r[i]!==void 0&&(o[i]=r[i]);return o}function wb(t,r,o){const i=rf(nf,o);for(const l of t.values())if(l.parentId)sf(l,t,r,i);else{const c=Fa(l,i.nodeOrigin),f=zi(l.extent)?l.extent:i.nodeExtent,m=Ks(c,f,Fo(l));l.internals.positionAbsolute=m}}function bb(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 of(t){return t==="manual"}function Fd(t,r,o,i={}){var _,v;const l=rf(vb,i),c={i:0},f=new Map(r),m=l!=null&&l.elevateNodesOnSelect&&!of(l.zIndexMode)?A0: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=Fa(k,l.nodeOrigin),I=zi(k.extent)?k.extent:l.nodeExtent,A=Ks(C,I,Fo(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:bb(k,j),z:O0(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&&sf(j,r,o,i,c),b||(b=k.selected??!1)}return{nodesInitialized:y,hasSelectedNodes:b}}function kb(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 sf(t,r,o,i,l){const{elevateNodesOnSelect:c,nodeOrigin:f,nodeExtent:m,zIndexMode:y}=rf(nf,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}kb(t,o),l&&!_.parentId&&_.internals.rootParentIndex===void 0&&y==="auto"&&(_.internals.rootParentIndex=++l.i,_.internals.z=_.internals.z+l.i*xb),l&&_.internals.rootParentIndex!==void 0&&(l.i=_.internals.rootParentIndex);const v=c&&!of(y)?A0:0,{x:k,y:j,z:C}=_b(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 O0(t,r,o){const i=Wr(t.zIndex)?t.zIndex:0;return of(o)?i:i+(t.selected?r:0)}function _b(t,r,o,i,l,c){const{x:f,y:m}=r.internals.positionAbsolute,y=Fo(t),b=Fa(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=b0(v,y,r));const k=O0(t,l,c),j=r.internals.z??0;return{x:v.x,y:v.y,z:j>=k?j+1:k}}function af(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),_=_0(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=Fo(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(F=>F.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 Sb(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=tf(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=b0(M,I,r.get(C.parentId)):P&&(M=Ks(M,P,I));const F={...C,measured:I,internals:{...C.internals,positionAbsolute:M,handleBounds:{source:Oh("source",j.nodeElement,V,v,C.id),target:Oh("target",j.nodeElement,V,v,C.id)}}};r.set(C.id,F),C.parentId&&sf(F,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(F,l)}))}}if(k.length>0){const j=af(k,r,o,l);b.push(...j)}return{changes:b,updatedInternals:y}}async function Nb({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 Hh(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 R0(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}`;Hh("source",y,_,t,l,f),Hh("target",y,b,t,c,m),r.set(i.id,i)}}function L0(t,r){if(!t.parentId)return!1;const o=r.get(t.parentId);return o?o.selected?!0:L0(o,r):!1}function Vh(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 Eb(t,r,o,i){const l=new Map;for(const[c,f]of t)if((f.selected||f.id===i)&&(!f.parentId||!L0(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 pd({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 jb({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 Cb({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:F,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?Ld(Ba(m)):null,Oe=Ne&&ie?jb({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],ve=Ke.y-Ae.y+ue[0][1],tt=Ke.y+_e.measured.height-Ae.y2+ue[1][1];Ee=[[ct,ve],[dt,tt]]}const{position:Ze,positionAbsolute:He}=w0({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]=pd({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]=k0(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||!F)&&!z&&U&&((Ne=be.get(U))!=null&&Ne.selected||K()),F&&q&&U&&(t==null||t(U));const ke=ja(de.sourceEvent,{transform:Q,snapGrid:ie,snapToGrid:H,containerBounds:_});if(c=ke,m=Eb(be,ue,ke,U),m.size>0&&(o||J||!U&&O)){const[Ae,Oe]=pd({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=Zm().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]=pd({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||!Vh(be,`.${V}`,M))&&(!P||Vh(be,P,M))});k.call(X)}function T(){k==null||k.on(".drag",null)}return{update:A,destroy:T}}function Pb(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 Mb=250;function Tb(t,r,o,i){var m,y;let l=[],c=1/0;const f=Pb(t,o,r+Mb);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 D0(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 z0(t,r){return t||(r!=null&&r.classList.contains("target")?"target":r!=null&&r.classList.contains("source")?"source":null)}function Ib(t,r){let o=null;return r?o=!0:t&&!r&&(o=!1),o}const F0=()=>!0;function $b(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=F0,onReconnectEnd:V,updateConnection:P,getTransform:M,getFromHandle:F,autoPanSpeed:U,dragThreshold:W=1,handleDomNode:Z}){const fe=E0(t.target);let Se=0,X;const{x:de,y:be}=Yr(t),z=z0(c,Z),ue=m==null?void 0:m.getBoundingClientRect();let Q=!1;if(!ue||!z)return;const ie=D0(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]=k0(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:Th[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:bt}=Yr(Ze),Pt=tt-de,Ct=bt-be;if(!(Pt*Pt+Ct*Ct>W*W))return;_e()}if(!F()||!Ne){Ee(Ze);return}const He=M();H=Yr(Ze,ue),X=Tb(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=Ib(!!X,Ke.isValid);const ct=y.get(l),dt=ct?qs(ct,Ne,rt.Left,!0):Re.from,ve={...Re,from:dt,isValid:O,to:Ke.toHandle&&O?Su({x:Ke.toHandle.x,y:Ke.toHandle.y},He):H,toHandle:Ke.toHandle,toPosition:O&&Ke.toHandle?Ke.toHandle.position:Th[Ne.position],toNode:Ke.toHandle?y.get(Ke.toHandle.nodeId):null,pointer:H};P(ve),Re=ve}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=F0,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=z0(void 0,A),P=A.getAttribute("data-nodeid"),M=A.getAttribute("data-handleid"),F=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=F&&U&&(o===Ri.Strict?v&&V==="source"||!v&&V==="target":P!==i||M!==l);T.isValid=fe&&b(W),T.toHandle=D0(P,V,M,_,o,!0)}return T}const Bd={onPointerDown:$b,isValid:B0};function Ab({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(),F=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*F);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 F=[P.sourceEvent.clientX??P.sourceEvent.touches[0].clientX,P.sourceEvent.clientY??P.sourceEvent.touches[0].clientY],U=[F[0]-I[0],F[1]-I[1]];I=F;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=h0().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 Lu=t=>({x:t.x,y:t.y,zoom:t.k}),hd=({x:t,y:r,zoom:o})=>Au.translate(t,r).scale(o),Ci=(t,r)=>t.target.closest(`.${r}`),H0=(t,r)=>r===2&&Array.isArray(t)&&t.includes(2),Ob=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,md=(t,r=0,o=Ob,i=()=>{})=>{const l=typeof r=="number"&&r>0;return l||i(),l?t.transition().duration(r).ease(o).on("end",i):t},V0=t=>{const r=t.ctrlKey&&Oa()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*r};function Rb({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=V0(_),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=Lu(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 Lb({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 Db({zoomPanValues:t,onDraggingChange:r,onPanZoomStart:o}){return i=>{var c,f,m;if((c=i.sourceEvent)!=null&&c.internal)return;const l=Lu(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 zb({zoomPanValues:t,panOnDrag:r,onPaneContextMenu:o,onTransformChange:i,onPanZoom:l}){return c=>{var f,m;t.usedRightMouseButton=!!(o&&H0(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,Lu(c.transform)))}}function Fb({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&&H0(r,t.mouseButton??0)&&!t.usedRightMouseButton&&f.sourceEvent&&c(f.sourceEvent),t.usedRightMouseButton=!1,i(!1),l)){const y=Lu(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 Hb({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=h0().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(V0);function I(X,de){return k?new Promise(be=>{v==null||v.interpolate((de==null?void 0:de.interpolate)==="linear"?Ea:au).transform(md(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?Rb({zoomPanValues:b,noWheelClassName:X,d3Selection:k,d3Zoom:v,panOnScrollMode:ie,panOnScrollSpeed:H,zoomOnPinch:J,onPanZoomStart:f,onPanZoom:c,onPanZoomEnd:m}):Lb({noWheelClassName:X,preventScrolling:q,d3ZoomHandler:j});if(k.on("wheel.zoom",Ee,{passive:!1}),!z){const He=Db({zoomPanValues:b,onDraggingChange:y,onPanZoomStart:f});v.on("start",He);const Ke=zb({zoomPanValues:b,panOnDrag:Q,onPaneContextMenu:!!be,onPanZoom:c,onTransformChange:Ae});v.on("zoom",Ke);const ct=Fb({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=hd(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=hd(X);return await I(be,de),new Promise(z=>z(be))}function M(X){if(k){const de=hd(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 F(){const X=k?p0(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(md(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(md(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:F,scaleTo:U,scaleBy:W,setScaleExtent:Z,setTranslateExtent:fe,syncViewport:M,setClickDistance:Se}}var Fi;(function(t){t.Line="line",t.Handle="handle"})(Fi||(Fi={}));function Vb({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 Uh(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 Kh(t,r){return t?!r:r}function Ub(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:F,height:U,aspectRatio:W}=t;let Z=Math.floor(_?j-t.pointerX:0),fe=Math.floor(v?C-t.pointerY:0);const Se=F+(y?-Z:Z),X=U+(b?-fe:fe),de=-c[0]*F,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=(Kh(y,b)?-Z:Z)/W:Z=(Kh(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:F+(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 U0={width:0,height:0,x:0,y:0},Kb={...U0,pointerX:0,pointerY:0,aspectRatio:1};function qb(t){return[[0,0],[t.measured.width,t.measured.height]]}function Wb(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 Yb({domNode:t,nodeId:r,getStoreItems:o,onChange:i,onEnd:l}){const c=cr(t);let f={controlDirection:Uh("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={...U0},V={...Kb};f={boundaries:_,resizeDirection:k,keepAspectRatio:v,controlDirection:Uh(b)};let P,M=null,F=[],U,W,Z,fe=!1;const Se=Zm().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"?qb(U):void 0),F=[],Z=void 0;for(const[J,O]of de)if(O.parentId===r&&(F.push({id:J,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const K=Wb(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}=Ub(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,F.length>0)){const dt=Oe-H,ve=Re-q;for(const tt of F)tt.position={x:tt.position.x-dt+ke[0]*(Ne-J),y:tt.position.y-ve+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 ve=ke[1]*(K.height??0);K.y&&K.y<ve&&(T.y=ve,V.y=V.y-(K.y-ve))}const He=Vb({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 gd={exports:{}},yd={},xd={exports:{}},vd={};/**
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 qh;function Xb(){if(qh)return vd;qh=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 vd.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:_,vd}var Wh;function Qb(){return Wh||(Wh=1,xd.exports=Xb()),xd.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 Yh;function Gb(){if(Yh)return yd;Yh=1;var t=La(),r=Qb();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 yd.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,F=v===void 0?null:v;return[function(){return T(_())},F===null?void 0:function(){return T(F())}]},[_,v,k,j]);var A=l(b,C[0],C[1]);return f(function(){I.hasValue=!0,I.value=A},[A]),y(A),A},yd}var Xh;function Jb(){return Xh||(Xh=1,gd.exports=Gb()),gd.exports}var Zb=Jb();const ek=Eu(Zb),tk={},Qh=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:()=>{(tk?"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},nk=t=>t?Qh(t):Qh,{useDebugValue:rk}=Pm,{useSyncExternalStoreWithSelector:ok}=ek,sk=t=>t;function K0(t,r=sk,o){const i=ok(t.subscribe,t.getState,t.getServerState||t.getInitialState,r,o);return rk(i),i}const Gh=(t,r)=>{const o=nk(t),i=(l,c=r)=>K0(o,l,c);return Object.assign(i,o),i},ik=(t,r)=>t?Gh(t,r):Gh;function Bt(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}Mm();const Du=D.createContext(null),ak=Du.Provider,q0=lo.error001();function kt(t,r){const o=D.useContext(Du);if(o===null)throw new Error(q0);return K0(o,t,r)}function Lt(){const t=D.useContext(Du);if(t===null)throw new Error(q0);return D.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const Jh={display:"none"},lk={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},W0="react-flow__node-desc",Y0="react-flow__edge-desc",uk="react-flow__aria-live",ck=t=>t.ariaLiveMessage,dk=t=>t.ariaLabelConfig;function fk({rfId:t}){const r=kt(ck);return h.jsx("div",{id:`${uk}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:lk,children:r})}function pk({rfId:t,disableKeyboardA11y:r}){const o=kt(dk);return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:`${W0}-${t}`,style:Jh,children:r?o["node.a11yDescription.default"]:o["node.a11yDescription.keyboardDisabled"]}),h.jsx("div",{id:`${Y0}-${t}`,style:Jh,children:o["edge.a11yDescription.default"]}),!r&&h.jsx(fk,{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:tn(["react-flow__panel",o,...f]),style:i,ref:c,...l,children:r})});Ua.displayName="Panel";function hk({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 mk=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 gk(t,r){return Bt(t.selectedNodes.map(Zl),r.selectedNodes.map(Zl))&&Bt(t.selectedEdges.map(Zl),r.selectedEdges.map(Zl))}function yk({onSelectionChange:t}){const r=Lt(),{selectedNodes:o,selectedEdges:i}=kt(mk,gk);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 xk=t=>!!t.onSelectionChangeHandlers;function vk({onSelectionChange:t}){const r=kt(xk);return t||r?h.jsx(yk,{onSelectionChange:t}):null}const Hd=typeof window<"u"?D.useLayoutEffect:D.useEffect,X0=[0,0],wk={x:0,y:0,zoom:1},bk=["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"],Zh=[...bk,"rfId"],kk=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}),em={translateExtent:Ia,nodeOrigin:X0,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function _k(t){const{setNodes:r,setEdges:o,setMinZoom:i,setMaxZoom:l,setTranslateExtent:c,setNodeExtent:f,reset:m,setDefaultNodesAndEdges:y}=kt(kk,Bt),b=Lt();Hd(()=>(y(t.defaultNodes,t.defaultEdges),()=>{_.current=em,m()}),[]);const _=D.useRef(em);return Hd(()=>{for(const v of Zh){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:ab(k)}):v==="fitView"?b.setState({fitViewQueued:k}):v==="fitViewOptions"?b.setState({fitViewOptions:k}):b.setState({[v]:k})))}_.current=t},Zh.map(v=>t[v])),null}function tm(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Sk(t){var i;const[r,o]=D.useState(t==="system"?null:t);return D.useEffect(()=>{if(t!=="system"){o(t);return}const l=tm(),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=tm())!=null&&i.matches?"dark":"light"}const nm=typeof document<"u"?document:null;function Ra(t=null,r={target:nm,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)??nm,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)&&j0(j))return!1;const I=om(j.code,m);if(c.current.add(j[I]),rm(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=om(j.code,m);rm(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 rm(t,r,o){return t.filter(i=>o||i.length===r.size).some(i=>i.every(l=>r.has(l)))}function om(t,r){return r.includes(t)?"code":"key"}const Nk=()=>{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=ef(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=Su(r,o);return{x:f.x+l,y:f.y+c}}}),[])};function Q0(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)Ek(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 Ek(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 G0(t,r){return Q0(t,r)}function J0(t,r){return Q0(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 sm({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 im(t){return{id:t.id,type:"remove"}}const am=t=>G1(t),jk=t=>v0(t);function Z0(t){return D.forwardRef(t)}function lm(t){const[r,o]=D.useState(BigInt(0)),[i]=D.useState(()=>Ck(()=>o(l=>l+BigInt(1))));return Hd(()=>{const l=i.get();l.length&&(t(l),i.reset())},[r]),i}function Ck(t){let r=[];return{get:()=>r,reset:()=>{r=[]},push:o=>{r.push(o),t()}}}const eg=D.createContext(null);function Pk({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=sm({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=lm(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(sm({items:j,lookup:k}))},[]),c=lm(l),f=D.useMemo(()=>({nodeQueue:i,edgeQueue:c}),[]);return h.jsx(eg.Provider,{value:f,children:t})}function Mk(){const t=D.useContext(eg);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const Tk=t=>!!t.panZoom;function lf(){const t=Nk(),r=Lt(),o=Mk(),i=kt(Tk),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=am(v)?v:k.get(v.id),I=C.parentId?N0(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&&am(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&&jk(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:F,edges:U}=await nb({nodesToRemove:v,edgesToRemove:k,nodes:j,edges:C,onBeforeDelete:M}),W=U.length>0,Z=F.length>0;if(W){const fe=U.map(im);A==null||A(U),V(fe)}if(Z){const fe=F.map(im);I==null||I(F),T(fe)}return(Z||W)&&(P==null||P({nodes:F,edges:U})),{deletedNodes:F,deletedEdges:U}},getIntersectingNodes:(v,k=!0,j)=>{const C=$h(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=$h(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 J1(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??ib();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 um=t=>t.selected,Ik=typeof window<"u"?window:void 0;function $k({deleteKeyCode:t,multiSelectionKeyCode:r}){const o=Lt(),{deleteElements:i}=lf(),l=Ra(t,{actInsideInputWithModifier:!1}),c=Ra(r,{target:Ik});D.useEffect(()=>{if(l){const{edges:f,nodes:m}=o.getState();i({nodes:m.filter(um),edges:f.filter(um)}),o.setState({nodesSelectionActive:!1})}},[l]),D.useEffect(()=>{o.setState({multiSelectionActive:c})},[c])}function Ak(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=tf(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 zu={position:"absolute",width:"100%",height:"100%",top:0,left:0},Ok=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function Rk({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 F=Lt(),U=D.useRef(null),{userSelectionActive:W,lib:Z,connectionInProgress:fe}=kt(Ok,Bt),Se=Ra(k),X=D.useRef();Ak(U);const de=D.useCallback(be=>{T==null||T({x:be[0],y:be[1],zoom:be[2]}),V||F.setState({transform:be})},[T,V]);return D.useEffect(()=>{if(U.current){X.current=Hb({domNode:U.current,minZoom:_,maxZoom:v,translateExtent:b,viewport:y,onDraggingChange:Q=>F.setState(ie=>ie.paneDragging===Q?ie:{paneDragging:Q}),onPanZoomStart:(Q,ie)=>{const{onViewportChangeStart:H,onMoveStart:q}=F.getState();q==null||q(Q,ie),H==null||H(ie)},onPanZoom:(Q,ie)=>{const{onViewportChange:H,onMove:q}=F.getState();q==null||q(Q,ie),H==null||H(ie)},onPanZoomEnd:(Q,ie)=>{const{onViewportChangeEnd:H,onMoveEnd:q}=F.getState();q==null||q(Q,ie),H==null||H(ie)}});const{x:be,y:z,zoom:ue}=X.current.getViewport();return F.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:zu,children:C})}const Lk=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function Dk(){const{userSelectionActive:t,userSelectionRect:r}=kt(Lk,Bt);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 wd=(t,r)=>o=>{o.target===r.current&&(t==null||t(o))},zk=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function Fk({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(zk,Bt),M=T&&(t||A),F=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===F.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 ve=r?0:l;if(Math.hypot(_e-Ee,ze-Ze)<=ve)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(Zd(O,He,J,o===$a.Partial,!0).map(ve=>ve.id)),Z.current=new Set;const dt=(Oe==null?void 0:Oe.selectable)??!0;for(const ve of W.current){const tt=ke.get(ve);if(tt)for(const{edgeId:bt}of tt.values()){const Pt=K.get(bt);Pt&&(Pt.selectable??dt)&&Z.current.add(bt)}}if(!Ah(Ke,W.current)){const ve=Pi(O,W.current,!0);Ne(ve)}if(!Ah(ct,Z.current)){const ve=Pi(K,Z.current);Ae(ve)}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===F.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:tn(["react-flow__pane",{draggable:ie,dragging:V,selection:t}]),onClick:M?void 0:wd(Se,F),onContextMenu:wd(X,F),onWheel:wd(de,F),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:F,style:zu,children:[C,h.jsx(Dk,{})]})}function Vd({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 tg({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=Cb({getStoreItems:()=>m.getState(),onNodeMouseDown:v=>{Vd({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 ng(){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}=w0({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 uf=D.createContext(null),Hk=uf.Provider;uf.Consumer;const rg=()=>D.useContext(uf),Vk=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),Uk=(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 Kk({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=rg(),{connectOnClick:V,noPanClassName:P,rfId:M}=kt(Vk,Bt),{connectingFrom:F,connectingTo:U,clickConnecting:W,isPossibleEndHandle:Z,connectionInProcess:fe,clickConnectionInProcess:Se,valid:X}=kt(Uk(T,C,t),Bt);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(I0(O,K))}q==null||q(O),m==null||m(O)},be=ie=>{if(!T)return;const H=C0(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=E0(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:tn(["react-flow__handle",`react-flow__handle-${r}`,"nodrag",P,b,{source:!I,target:I,connectable:i,connectablestart:l,connectableend:c,clickconnecting:W,connectingfrom:F,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 Bi=D.memo(Z0(Kk));function qk({data:t,isConnectable:r,sourcePosition:o=rt.Bottom}){return h.jsxs(h.Fragment,{children:[t==null?void 0:t.label,h.jsx(Bi,{type:"source",position:o,isConnectable:r})]})}function Wk({data:t,isConnectable:r,targetPosition:o=rt.Top,sourcePosition:i=rt.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(Bi,{type:"target",position:o,isConnectable:r}),t==null?void 0:t.label,h.jsx(Bi,{type:"source",position:i,isConnectable:r})]})}function Yk(){return null}function Xk({data:t,isConnectable:r,targetPosition:o=rt.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(Bi,{type:"target",position:o,isConnectable:r}),t==null?void 0:t.label]})}const Nu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},cm={input:qk,default:Wk,output:Xk,group:Yk};function Qk(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 Gk=t=>{const{width:r,height:o,x:i,y:l}=Ba(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 Jk({onSelectionContextMenu:t,noPanClassName:r,disableKeyboardA11y:o}){const i=Lt(),{width:l,height:c,transformString:f,userSelectionActive:m}=kt(Gk,Bt),y=ng(),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(tg({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(Nu,j.key)&&(j.preventDefault(),y({direction:Nu[j.key],factor:j.shiftKey?4:1}))};return h.jsx("div",{className:tn(["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 dm=typeof window<"u"?window:void 0,Zk=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function og({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:F,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(Zk,Bt),K=Ra(b,{target:dm}),ke=Ra(I,{target:dm}),Ne=ke||Z,Ae=ke||M,Oe=_&&Ne!==!0,Re=K||O||Oe;return $k({deleteKeyCode:y,multiSelectionKeyCode:C}),h.jsx(Rk,{onPaneContextMenu:c,elementsSelectable:T,zoomOnScroll:V,zoomOnPinch:P,panOnScroll:Ae,panOnScrollSpeed:F,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(Fk,{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(Jk,{onSelectionContextMenu:z,noPanClassName:Q,disableKeyboardA11y:ie})]})})}og.displayName="FlowRenderer";const e_=D.memo(og),t_=t=>r=>t?Zd(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 n_(t){return kt(D.useCallback(t_(t),[t]),Bt)}const r_=t=>t.updateNodeInternals;function o_(){const t=kt(r_),[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 s_({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 i_({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:F}=kt(_e=>{const ze=_e.nodeLookup.get(t),Ee=_e.parentLookup.has(t);return{node:ze,internals:ze.internals,isParent:Ee}},Bt);let U=P.type||"default",W=(A==null?void 0:A[U])||cm[U];W===void 0&&(V==null||V("003",lo.error003(U)),U="default",W=(A==null?void 0:A.default)||cm.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=S0(P),z=s_({node:P,nodeType:U,hasDimensions:be,resizeObserver:v}),ue=tg({nodeRef:z,disabled:P.hidden||!Z,noDragClassName:k,handleSelector:P.dragHandle,nodeId:t,isSelectable:fe,nodeClickDistance:T}),Q=ng();if(P.hidden)return null;const ie=Fo(P),H=Qk(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)&&Vd({id:t,store:de,nodeRef:z}),r&&r(_e,{...M.userNode})},Oe=_e=>{if(!(j0(_e.nativeEvent)||C)){if(m0.includes(_e.key)&&fe){const ze=_e.key==="Escape";Vd({id:t,store:de,unselect:ze,nodeRef:z})}else if(Z&&P.selected&&Object.prototype.hasOwnProperty.call(Nu,_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:Nu[_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;Zd(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:tn(["react-flow__node",`react-flow__node-${U}`,{[j]:Z},P.className,{selected:P.selected,selectable:fe,parent:F,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:`${W0}-${I}`,"aria-label":P.ariaLabel,...P.domAttributes,children:h.jsx(Hk,{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 a_=D.memo(i_);const l_=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function sg(t){const{nodesDraggable:r,nodesConnectable:o,nodesFocusable:i,elementsSelectable:l,onError:c}=kt(l_,Bt),f=n_(t.onlyRenderVisibleElements),m=o_();return h.jsx("div",{className:"react-flow__nodes",style:zu,children:f.map(y=>h.jsx(a_,{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))})}sg.displayName="NodeRenderer";const u_=D.memo(sg);function c_(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&&cb({sourceNode:c,targetNode:f,width:o.width,height:o.height,transform:o.transform})&&i.push(l.id)}return i},[t]),Bt)}const d_=({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"})},f_=({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"})},fm={[ku.Arrow]:d_,[ku.ArrowClosed]:f_};function p_(t){const r=Lt();return D.useMemo(()=>{var l,c;return Object.prototype.hasOwnProperty.call(fm,t)?fm[t]:((c=(l=r.getState()).onError)==null||c.call(l,"009",lo.error009(t)),null)},[t])}const h_=({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=p_(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},ig=({defaultColor:t,rfId:r})=>{const o=kt(c=>c.edges),i=kt(c=>c.defaultEdgeOptions),l=D.useMemo(()=>yb(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(h_,{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};ig.displayName="MarkerDefinitions";var m_=D.memo(ig);function ag({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=tn(["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}ag.displayName="EdgeText";const g_=D.memo(ag);function Fu({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:tn(["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(g_,{x:r,y:o,label:i,labelStyle:l,labelShowBg:c,labelBgStyle:f,labelBgPadding:m,labelBgBorderRadius:y}):null]})}function pm({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 lg({sourceX:t,sourceY:r,sourcePosition:o=rt.Bottom,targetX:i,targetY:l,targetPosition:c=rt.Top}){const[f,m]=pm({pos:o,x1:t,y1:r,x2:i,y2:l}),[y,b]=pm({pos:c,x1:i,y1:l,x2:t,y2:r}),[_,v,k,j]=P0({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 ug(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]=lg({sourceX:o,sourceY:i,sourcePosition:f,targetX:l,targetY:c,targetPosition:m}),F=t.isInternal?void 0:r;return h.jsx(Fu,{id:F,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 y_=ug({isInternal:!1}),cg=ug({isInternal:!0});y_.displayName="SimpleBezierEdge";cg.displayName="SimpleBezierEdgeInternal";function dg(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,F]=Dd({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(Fu,{id:U,path:P,labelX:M,labelY:F,label:f,labelStyle:m,labelShowBg:y,labelBgStyle:b,labelBgPadding:_,labelBgBorderRadius:v,style:k,markerEnd:I,markerStart:A,interactionWidth:V})})}const fg=dg({isInternal:!1}),pg=dg({isInternal:!0});fg.displayName="SmoothStepEdge";pg.displayName="SmoothStepEdgeInternal";function hg(t){return D.memo(({id:r,...o})=>{var l;const i=t.isInternal?void 0:r;return h.jsx(fg,{...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 x_=hg({isInternal:!1}),mg=hg({isInternal:!0});x_.displayName="StepEdge";mg.displayName="StepEdgeInternal";function gg(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]=$0({sourceX:o,sourceY:i,targetX:l,targetY:c}),P=t.isInternal?void 0:r;return h.jsx(Fu,{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 v_=gg({isInternal:!1}),yg=gg({isInternal:!0});v_.displayName="StraightEdge";yg.displayName="StraightEdgeInternal";function xg(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,F]=M0({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(Fu,{id:U,path:P,labelX:M,labelY:F,label:y,labelStyle:b,labelShowBg:_,labelBgStyle:v,labelBgPadding:k,labelBgBorderRadius:j,style:C,markerEnd:I,markerStart:A,interactionWidth:V})})}const w_=xg({isInternal:!1}),vg=xg({isInternal:!0});w_.displayName="BezierEdge";vg.displayName="BezierEdgeInternal";const hm={default:vg,straight:yg,step:mg,smoothstep:pg,simplebezier:cg},mm={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},b_=(t,r,o)=>o===rt.Left?t-r:o===rt.Right?t+r:t,k_=(t,r,o)=>o===rt.Top?t-r:o===rt.Bottom?t+r:t,gm="react-flow__edgeupdater";function ym({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:tn([gm,`${gm}-${m}`]),cx:b_(r,i,t),cy:k_(o,i,t),r:i,stroke:"transparent",fill:"transparent"})}function __({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,F)=>{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=F.type==="target",H=(O,K)=>{k(!1),v==null||v(O,o,F.type,K)},q=O=>b==null?void 0:b(o,O),J=(O,K)=>{k(!0),_==null||_(M,o,F.type),X==null||X(O,K)};Bd.onPointerDown(M.nativeEvent,{autoPanOnConnect:U,connectionMode:Z,connectionRadius:fe,domNode:W,handleId:F.id,nodeId:F.nodeId,nodeLookup:be,isTarget:ie,edgeUpdaterType:F.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(ym,{position:m,centerX:i,centerY:l,radius:r,onMouseDown:A,onMouseEnter:V,onMouseOut:P,type:"source"}),(t===!0||t==="target")&&h.jsx(ym,{position:y,centerX:c,centerY:f,radius:r,onMouseDown:T,onMouseEnter:V,onMouseOut:P,type:"target"})]})}function S_({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 F=P.type||"default",U=(I==null?void 0:I[F])||hm[F];U===void 0&&(T==null||T("011",lo.error011(F)),F="default",U=(I==null?void 0:I.default)||hm.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,...mm};const dt=gb({id:t,sourceNode:Ke,targetNode:ct,sourceHandle:P.sourceHandle||null,targetHandle:P.targetHandle||null,connectionMode:He.connectionMode,onError:T});return{zIndex:ub({selected:P.selected,zIndex:P.zIndex,sourceNode:Ke,targetNode:ct,elevateOnSelect:He.elevateEdgesOnSelect,zIndexMode:He.zIndexMode}),...dt||mm}},[P.source,P.target,P.sourceHandle,P.targetHandle,P.selected,P.zIndex]),Bt),ke=D.useMemo(()=>P.markerStart?`url('#${zd(P.markerStart,C)}')`:void 0,[P.markerStart,C]),Ne=D.useMemo(()=>P.markerEnd?`url('#${zd(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 ve;const{addSelectedEdges:Ke,unselectNodesAndEdges:ct,multiSelectionActive:dt}=ue.getState();fe&&(ue.setState({nodesSelectionActive:!1}),P.selected&&dt?(ct({nodes:[],edges:[P]}),(ve=Se.current)==null||ve.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&&m0.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:tn(["react-flow__edge",`react-flow__edge-${F}`,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?`${Y0}-${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(__,{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 N_=D.memo(S_);const E_=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function wg({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(E_,Bt),M=c_(r);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(m_,{defaultColor:t,rfId:o}),M.map(F=>h.jsx(N_,{id:F,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},F))]})}wg.displayName="EdgeRenderer";const j_=D.memo(wg),C_=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function P_({children:t}){const r=kt(C_);return h.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:r},children:t})}function M_(t){const r=lf(),o=D.useRef(!1);D.useEffect(()=>{!o.current&&r.viewportInitialized&&t&&(setTimeout(()=>t(r),1),o.current=!0)},[t,r.viewportInitialized])}const T_=t=>{var r;return(r=t.panZoom)==null?void 0:r.syncViewport};function I_(t){const r=kt(T_),o=Lt();return D.useEffect(()=>{t&&(r==null||r(t),o.setState({transform:[t.x,t.y,t.zoom]}))},[t,r]),null}function $_(t){return t.connection.inProgress?{...t.connection,to:Va(t.connection.to,t.transform)}:{...t.connection}}function A_(t){return $_}function O_(t){const r=A_();return kt(r,Bt)}const R_=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function L_({containerStyle:t,style:r,type:o,component:i}){const{nodesConnectable:l,width:c,height:f,isValid:m,inProgress:y}=kt(R_,Bt);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:tn(["react-flow__connection",x0(m)]),children:h.jsx(bg,{style:r,type:o,CustomComponent:i,isValid:m})})})}const bg=({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}=O_();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:x0(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]=M0(I);break;case gs.SimpleBezier:[C]=lg(I);break;case gs.Step:[C]=Dd({...I,borderRadius:0});break;case gs.SmoothStep:[C]=Dd(I);break;default:[C]=$0(I)}return h.jsx("path",{d:C,fill:"none",className:"react-flow__connection-path",style:t})};bg.displayName="ConnectionLine";const D_={};function xm(t=D_){D.useRef(t),Lt(),D.useEffect(()=>{},[t])}function z_(){Lt(),D.useRef(!1),D.useEffect(()=>{},[])}function kg({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:F,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:ve,onReconnect:tt,onReconnectStart:bt,onReconnectEnd:Pt,noDragClassName:Ct,noWheelClassName:gt,noPanClassName:jt,disableKeyboardA11y:Gt,nodeExtent:fr,rfId:an,viewport:Mt,onViewportChange:nn}){return xm(t),xm(r),z_(),M_(o),I_(Mt),h.jsx(e_,{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:F,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:Ct,noWheelClassName:gt,noPanClassName:jt,disableKeyboardA11y:Gt,onViewportChange:nn,isControlledViewport:!!Mt,children:h.jsxs(P_,{children:[h.jsx(j_,{edgeTypes:r,onEdgeClick:l,onEdgeDoubleClick:f,onReconnect:tt,onReconnectStart:bt,onReconnectEnd:Pt,onlyRenderVisibleElements:fe,onEdgeContextMenu:He,onEdgeMouseEnter:Ke,onEdgeMouseMove:ct,onEdgeMouseLeave:dt,reconnectRadius:ve,defaultMarkerColor:Q,noPanClassName:jt,disableKeyboardA11y:Gt,rfId:an}),h.jsx(L_,{style:I,type:C,component:A,containerStyle:T}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(u_,{nodeTypes:t,onNodeClick:i,onNodeDoubleClick:c,onNodeMouseEnter:m,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:_,nodeClickDistance:Ze,onlyRenderVisibleElements:fe,noPanClassName:jt,noDragClassName:Ct,disableKeyboardA11y:Gt,nodeExtent:fr,rfId:an}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}kg.displayName="GraphView";const F_=D.memo(kg),vm=({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;R0(I,A,T);const{nodesInitialized:F}=Fd(V,j,C,{nodeOrigin:P,nodeExtent:M,zIndexMode:k});let U=[0,0,1];if(f&&l&&c){const W=Ba(j,{filter:X=>!!((X.width||X.initialWidth)&&(X.height||X.initialHeight))}),{x:Z,y:fe,zoom:Se}=ef(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:F,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:{...y0},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:rb,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:g0,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})=>ik((j,C)=>{async function I(){const{nodeLookup:A,panZoom:T,fitViewOptions:V,fitViewResolver:P,width:M,height:F,minZoom:U,maxZoom:W}=C();T&&(await tb({nodes:A,width:M,height:F,panZoom:T,minZoom:U,maxZoom:W},V),P==null||P.resolve(!0),j({fitViewResolver:null}))}return{...vm({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:F,zIndexMode:U,nodesSelectionActive:W}=C(),{nodesInitialized:Z,hasSelectedNodes:fe}=Fd(A,T,V,{nodeOrigin:P,nodeExtent:v,elevateNodesOnSelect:M,checkEquality:!0,zIndexMode:U}),Se=W&&fe;F&&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();R0(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:F,nodeExtent:U,debug:W,fitViewQueued:Z,zIndexMode:fe}=C(),{changes:Se,updatedInternals:X}=Sb(A,V,P,M,F,U,fe);X&&(wb(V,P,{nodeOrigin:F,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:F,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=af(V,M,fe,Se);P.push(...X)}for(const fe of Z.values())P=fe(P);F(P)},triggerNodeChanges:A=>{const{onNodesChange:T,setNodes:V,nodes:P,hasDefaultNodes:M,debug:F}=C();if(A!=null&&A.length){if(M){const U=G0(A,P);V(U)}F&&console.log("React Flow: trigger node changes",A),T==null||T(A)}},triggerEdgeChanges:A=>{const{onEdgesChange:T,setEdges:V,edges:P,hasDefaultEdges:M,debug:F}=C();if(A!=null&&A.length){if(M){const U=J0(A,P);V(U)}F&&console.log("React Flow: trigger edge changes",A),T==null||T(A)}},addSelectedNodes:A=>{const{multiSelectionActive:T,edgeLookup:V,nodeLookup:P,triggerNodeChanges:M,triggerEdgeChanges:F}=C();if(T){const U=A.map(W=>zs(W,!0));M(U);return}M(Pi(P,new Set([...A]),!0)),F(Pi(V))},addSelectedEdges:A=>{const{multiSelectionActive:T,edgeLookup:V,nodeLookup:P,triggerNodeChanges:M,triggerEdgeChanges:F}=C();if(T){const U=A.map(W=>zs(W,!0));F(U);return}F(Pi(V,new Set([...A]))),M(Pi(P,new Set,!0))},unselectNodesAndEdges:({nodes:A,edges:T}={})=>{const{edges:V,nodes:P,nodeLookup:M,triggerNodeChanges:F,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));F(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 F=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(F),P(U)},setNodeExtent:A=>{const{nodes:T,nodeLookup:V,parentLookup:P,nodeOrigin:M,elevateNodesOnSelect:F,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]||(Fd(T,V,P,{nodeOrigin:M,nodeExtent:A,elevateNodesOnSelect:F,checkEquality:!1,zIndexMode:W}),j({nodeExtent:A}))},panBy:A=>{const{transform:T,width:V,height:P,panZoom:M,translateExtent:F}=C();return Nb({delta:A,panZoom:M,transform:T,translateExtent:F,width:V,height:P})},setCenter:async(A,T,V)=>{const{width:P,height:M,maxZoom:F,panZoom:U}=C();if(!U)return Promise.resolve(!1);const W=typeof(V==null?void 0:V.zoom)<"u"?V.zoom:F;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:{...y0}})},updateConnection:A=>{j({connection:A})},reset:()=>j({...vm()})}},Object.is);function H_({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(ak,{value:C,children:h.jsx(Pk,{children:j})})}function V_({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(Du)?h.jsx(h.Fragment,{children:t}):h.jsx(H_,{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 U_={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function K_({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:F,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:ve,nodesDraggable:tt,autoPanOnNodeFocus:bt,nodesConnectable:Pt,nodesFocusable:Ct,nodeOrigin:gt=X0,edgesFocusable:jt,edgesReconnectable:Gt,elementsSelectable:fr=!0,defaultViewport:an=wk,minZoom:Mt=.5,maxZoom:nn=2,translateExtent:ln=Ia,preventScrolling:pr=!0,nodeExtent:Tn,defaultMarkerColor:In="#b1b1b7",zoomOnScroll:mn=!0,zoomOnPinch:hr=!0,panOnScroll:Rn=!1,panOnScrollSpeed:Sn=.5,panOnScrollMode:We=Hs.Free,zoomOnDoubleClick:Ln=!0,panOnDrag:gn=!0,onPaneClick:Jt,onPaneMouseEnter:Ve,onPaneMouseMove:Dn,onPaneMouseLeave:Nt,onPaneScroll:Qr,onPaneContextMenu:fo,paneClickDistance:er=1,nodeClickDistance:mr=0,children:Bo,onReconnect:zn,onReconnectStart:Fn,onReconnectEnd:$n,onEdgeContextMenu:tr,onEdgeDoubleClick:lt,onEdgeMouseEnter:Dt,onEdgeMouseMove:Pr,onEdgeMouseLeave:nr,reconnectRadius:rr=10,onNodesChange:gr,onEdgesChange:Ho,noDragClassName:Bn="nodrag",noWheelClassName:yr="nowheel",noPanClassName:Yt="nopan",fitView:xr,fitViewOptions:po,connectOnClick:rn,attributionPosition:Mr,proOptions:Hn,defaultEdgeOptions:ho,elevateNodesOnSelect:Gr=!0,elevateEdgesOnSelect:Tt=!1,disableKeyboardA11y:Vn=!1,autoPanOnConnect:vt,autoPanOnNodeDrag:Vo,autoPanSpeed:vr,connectionRadius:Tr,isValidConnection:wr,onError:or,style:mo,id:Un,nodeDragThreshold:yn,connectionDragThreshold:ht,viewport:un,onViewportChange:Uo,width:Jr,height:br,colorMode:sr="light",debug:kr,onScroll:L,ariaLabelConfig:me,zIndexMode:Be="basic",...Je},Et){const $t=Un||"1",Xt=Sk(sr),Ht=D.useCallback(qt=>{qt.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),L==null||L(qt)},[L]);return h.jsx("div",{"data-testid":"rf__wrapper",...Je,onScroll:Ht,style:{...mo,...U_},ref:Et,className:tn(["react-flow",l,Xt]),id:Un,role:"application",children:h.jsxs(V_,{nodes:t,edges:r,width:Jr,height:br,fitView:xr,fitViewOptions:po,minZoom:Mt,maxZoom:nn,nodeOrigin:gt,nodeExtent:Tn,zIndexMode:Be,children:[h.jsx(_k,{nodes:t,edges:r,defaultNodes:o,defaultEdges:i,onConnect:j,onConnectStart:C,onConnectEnd:I,onClickConnectStart:A,onClickConnectEnd:T,nodesDraggable:tt,autoPanOnNodeFocus:bt,nodesConnectable:Pt,nodesFocusable:Ct,edgesFocusable:jt,edgesReconnectable:Gt,elementsSelectable:fr,elevateNodesOnSelect:Gr,elevateEdgesOnSelect:Tt,minZoom:Mt,maxZoom:nn,nodeExtent:Tn,onNodesChange:gr,onEdgesChange:Ho,snapToGrid:Ke,snapGrid:ct,connectionMode:O,translateExtent:ln,connectOnClick:rn,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:Yt,nodeOrigin:gt,rfId:$t,autoPanOnConnect:vt,autoPanOnNodeDrag:Vo,autoPanSpeed:vr,onError:or,connectionRadius:Tr,isValidConnection:wr,selectNodesOnDrag:ve,nodeDragThreshold:yn,connectionDragThreshold:ht,onBeforeDelete:J,debug:kr,ariaLabelConfig:me,zIndexMode:Be}),h.jsx(F_,{onInit:b,onNodeClick:m,onEdgeClick:y,onNodeMouseEnter:V,onNodeMouseMove:P,onNodeMouseLeave:M,onNodeContextMenu:F,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:an,translateExtent:ln,minZoom:Mt,maxZoom:nn,preventScrolling:pr,zoomOnScroll:mn,zoomOnPinch:hr,zoomOnDoubleClick:Ln,panOnScroll:Rn,panOnScrollSpeed:Sn,panOnScrollMode:We,panOnDrag:gn,onPaneClick:Jt,onPaneMouseEnter:Ve,onPaneMouseMove:Dn,onPaneMouseLeave:Nt,onPaneScroll:Qr,onPaneContextMenu:fo,paneClickDistance:er,nodeClickDistance:mr,onSelectionContextMenu:ie,onSelectionStart:H,onSelectionEnd:q,onReconnect:zn,onReconnectStart:Fn,onReconnectEnd:$n,onEdgeContextMenu:tr,onEdgeDoubleClick:lt,onEdgeMouseEnter:Dt,onEdgeMouseMove:Pr,onEdgeMouseLeave:nr,reconnectRadius:rr,defaultMarkerColor:In,noDragClassName:Bn,noWheelClassName:yr,noPanClassName:Yt,rfId:$t,disableKeyboardA11y:Vn,nodeExtent:Tn,viewport:un,onViewportChange:Uo}),h.jsx(vk,{onSelectionChange:be}),Bo,h.jsx(hk,{proOptions:Hn,position:Mr}),h.jsx(pk,{rfId:$t,disableKeyboardA11y:Vn})]})})}var q_=Z0(K_);function W_(){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 Y_(t){const[r,o]=D.useState(t),i=D.useCallback(l=>o(c=>G0(l,c)),[]);return[r,o,i]}function X_(t){const[r,o]=D.useState(t),i=D.useCallback(l=>o(c=>J0(l,c)),[]);return[r,o,i]}function Q_({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:tn(["react-flow__background-pattern",o,i])})}function G_({radius:t,className:r}){return h.jsx("circle",{cx:t,cy:t,r:t,className:tn(["react-flow__background-pattern","dots",r])})}var Do;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Do||(Do={}));const J_={[Do.Dots]:1,[Do.Lines]:1,[Do.Cross]:6},Z_=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function _g({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(Z_,Bt),C=i||J_[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],F=A?[P,P]:V,U=[M[0]*k[2]||1+F[0]/2,M[1]*k[2]||1+F[1]/2],W=`${j}${t||""}`;return h.jsxs("svg",{className:tn(["react-flow__background",b]),style:{...y,...zu,"--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(G_,{radius:P/2,className:_}):h.jsx(Q_,{dimensions:F,lineWidth:l,variant:r,className:_})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${W})`})]})}_g.displayName="Background";const eS=D.memo(_g);function tS(){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 nS(){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 rS(){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 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 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 sS(){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:tn(["react-flow__controls-button",r]),...o,children:t})}const iS=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function Sg({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(iS,Bt),{zoomIn:P,zoomOut:M,fitView:F}=lf(),U=()=>{P(),c==null||c()},W=()=>{M(),f==null||f()},Z=()=>{F(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:tn(["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(tS,{})}),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(nS,{})})]}),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(rS,{})}),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(sS,{}):h.jsx(oS,{})}),_]})}Sg.displayName="Controls";const aS=D.memo(Sg);function lS({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:tn(["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 uS=D.memo(lS),cS=t=>t.nodes.map(r=>r.id),bd=t=>t instanceof Function?t:()=>t;function dS({nodeStrokeColor:t,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:l,nodeComponent:c=uS,onClick:f}){const m=kt(cS,Bt),y=bd(r),b=bd(t),_=bd(o),v=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:m.map(k=>h.jsx(pS,{id:k,nodeColorFunc:y,nodeStrokeColorFunc:b,nodeClassNameFunc:_,nodeBorderRadius:i,nodeStrokeWidth:l,NodeComponent:c,onClick:f,shapeRendering:v},k))})}function fS({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}=Fo(A);return{node:A,x:T,y:V,width:P,height:M}},Bt);return!b||b.hidden||!S0(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 pS=D.memo(fS);var hS=D.memo(dS);const mS=200,gS=150,yS=t=>!t.hidden,xS=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?_0(Ba(t.nodeLookup,{filter:yS}),r):r,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},vS="react-flow__minimap-desc";function Ng({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 F=Lt(),U=D.useRef(null),{boundingRect:W,viewBB:Z,rfId:fe,panZoom:Se,translateExtent:X,flowWidth:de,flowHeight:be,ariaLabelConfig:z}=kt(xS,Bt),ue=(t==null?void 0:t.width)??mS,Q=(t==null?void 0:t.height)??gS,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=`${vS}-${fe}`,_e=D.useRef(0),ze=D.useRef();_e.current=q,D.useEffect(()=>{if(U.current&&Se)return ze.current=Ab({domNode:U.current,panZoom:Se,getTransform:()=>F.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 ve;const[ct,dt]=((ve=ze.current)==null?void 0:ve.pointer(Ke))||[0,0];j(Ke,{x:ct,y:dt})}:void 0,Ze=C?D.useCallback((Ke,ct)=>{const dt=F.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:tn(["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(hS,{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"})]})})}Ng.displayName="MiniMap";const wS=D.memo(Ng),bS=t=>r=>t?`${Math.max(1/r.transform[2],1)}`:void 0,kS={[Fi.Line]:"right",[Fi.Handle]:"bottom-right"};function _S({nodeId:t,position:r,variant:o=Fi.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=rg(),P=typeof t=="string"?t:V,M=Lt(),F=D.useRef(null),U=o===Fi.Handle,W=kt(D.useCallback(bS(U&&j),[U,j]),Bt),Z=D.useRef(null),fe=r??kS[o];D.useEffect(()=>{if(!(!F.current||!P))return Z.current||(Z.current=Yb({domNode:F.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,...N0({x:X.x??q.position.x,y:X.y??q.position.y},{width:O,height:K},q.parentId,z,J)}},Ne=af([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:tn(["react-flow__resize-control","nodrag",...Se,o,i]),ref:F,style:{...l,scale:W,...f&&{[U?"backgroundColor":"borderColor"]:f}},children:c})}D.memo(_S);const SS={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=SS[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 cf(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 df(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 ff(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 kd(t,r){return`${t.toLowerCase()} ${r}`}function NS(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}const Eg=D.createContext(null);function ES(t){const{id:r,selected:o}=t,i=t.data,l=D.useContext(Eg),c=W_();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(Bi,{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:kd(i.method,i.path),onChange:f=>{const{method:m,path:y}=NS(f.target.value);l.updateNodeData(r,{method:m,path:y,summary:cf(l.doc,m,y),reqHint:df(l.doc,m,y),resHint:ff(l.doc,m,y)})},children:l.ops.map(f=>h.jsxs("option",{value:kd(f.method,f.path),children:[f.method.toUpperCase()," ",f.path]},kd(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(Bi,{type:"source",position:rt.Right,id:"out",className:"!h-3 !w-3 !border-2 !border-surface-900 !bg-amber-500"})]})}const jS={apiOp:ES};function CS(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:cf(t,l.method,l.path),reqHint:df(t,l.method,l.path),resHint:ff(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 PS(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 MS=[{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 TS({doc:t,ops:r,graph:o,onGraphChange:i}){var P,M,F,U,W,Z,fe,Se;const l=D.useMemo(()=>CS(t,o),[t,o]),[c,f,m]=Y_(l.nodes),[y,b,_]=X_(l.edges),[v,k]=D.useState(null);D.useEffect(()=>{i(PS(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=>I0({...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:cf(t,de.method,de.path),reqHint:df(t,de.method,de.path),resHint:ff(t,de.method,de.path)}};f(ie=>[...ie,Q])};return h.jsx(Eg.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(q_,{nodes:c,edges:y,onNodesChange:m,onEdgesChange:_,onConnect:I,nodeTypes:jS,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(eS,{variant:Do.Dots,gap:16,size:1,color:"rgb(51 65 85 / 0.5)"}),h.jsx(aS,{className:"!bg-surface-900 !border-surface-600 !shadow-lg"}),h.jsx(wS,{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:((F=A.data)==null?void 0:F.mapping.useInTarget)??"vars_only",onChange:X=>T({useInTarget:X.target.value}),children:MS.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 jg(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 wm(t,r,o){var y;const{nodes:i,edges:l}=t;if(i.length===0)return"Sin nodos en el flujo.";const c=jg(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(F=>F.target===_.id);for(const F of j){const{mapping:U}=F,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[F,U]of Object.entries(f))v=v.split(`{${F}}`).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:pu(C)});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(F=>F.source===_.id);for(const F of M){const U=((y=F.mapping.sourceJsonPath)==null?void 0:y.trim())||"$",W=Ud(V,U);W!=null&&(f[F.mapping.variableName]=typeof W=="object"?JSON.stringify(W):String(W))}}return m+=`
206
+ Variables finales: ${JSON.stringify(f,null,2)}`,m}function IS(t){const r=jg(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 $S(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 Cg=D.createContext({productName:null,logoDataUrl:null});function AS({value:t,children:r}){return h.jsx(Cg.Provider,{value:t,children:r})}function OS(){return D.useContext(Cg)}function RS({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(pf,{value:t,depth:0,defaultOpenDepth:r})})}function pf({value:t,depth:r,defaultOpenDepth:o,name:i}){return t===null||typeof t!="object"?h.jsx(LS,{name:i,value:t}):Array.isArray(t)?h.jsx(DS,{name:i,value:t,depth:r,defaultOpenDepth:o}):h.jsx(zS,{name:i,value:t,depth:r,defaultOpenDepth:o})}function LS({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 DS({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(pf,{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 zS({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(pf,{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 hf(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 FS(t,r){return"$ref"in r?hf(t,r.$ref):r}function bm(t,r){return"$ref"in r?hf(t,r.$ref):r}function Pg(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=FS(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?hf(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=bm(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?bm(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 HS(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 VS(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 Mg(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 km(t,r){const o=Mg(t,r);return JSON.stringify(o,null,2)}function US(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 KS(t){return/\{[^/}]+\}/.test(t)}function qS(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 _m(t,r,o,i,l){var P,M,F,U,W;const c=Pg(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&&!((F=l.headerVals[Z.name])!=null&&F.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=HS(r.path,l.pathVals);if(KS(j))return{ok:!1,error:"Quedan placeholders `{…}` en la ruta sin valor."};const C=VS(l.queryVals,c),A=`${Ro(t,o)}${j}${C}`,T=qS(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=Mg(_,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 WS(t){const r={};return t.forEach((o,i)=>{r[i]=o}),r}function YS(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 _d(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 XS(t,r,o,i,l,c,f){return{pathVals:{...t},queryVals:{...r},headerVals:{...o},cookieVals:{...i},bodyMode:l,tryBodyRaw:c,bodyVals:{...f}}}function QS({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,F]=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(()=>Pg(t,r.method,r.path),[t,r.method,r.path]),ie=D.useMemo(()=>Q.filter(ve=>ve.in==="path"),[Q]),H=D.useMemo(()=>Q.filter(ve=>ve.in==="query"),[Q]),q=D.useMemo(()=>Q.filter(ve=>ve.in==="header"),[Q]),J=D.useMemo(()=>Q.filter(ve=>ve.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 ve=await ux(r.method,r.path);X(ve.sort((tt,bt)=>tt.name.localeCompare(bt.name)))},[r.method,r.path]);D.useEffect(()=>{Ne()},[Ne]),D.useEffect(()=>{m({}),b({}),v({}),j({}),W(null),F(null),ue(null);const ve=fu(t,r.method,r.path);ve!=null&&ve.length?(I(Object.fromEntries(ve.map(tt=>[tt.key,""]))),P("fields"),T(km(ve,{}))):(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 bt=fu(t,r.method,r.path);if(bt!=null&&bt.length&&tt.bodyMode==="fields"){const Pt={};for(const Ct of bt)Pt[Ct.key]=tt.bodyVals[Ct.key]??"";I(Pt)}else I({...tt.bodyVals});W(null),F(null)}c==null||c()},[l,r.method,r.path,t,c]);const Ae=D.useCallback((ve,tt)=>{I(bt=>({...bt,[ve]:tt}))},[]),Oe=D.useCallback(()=>{O!=null&&O.length&&T(km(O,C)),P("raw")},[O,C]),Re=D.useCallback(()=>{O!=null&&O.length&&I(US(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 ve=_m(t,r,o,i,_e);if(!ve.ok){W(ve.error);return}const tt=pu(ve.url),bt={method:ve.method,headers:ve.headers,credentials:tt};ve.body!==void 0&&(bt.body=ve.body);const Pt=XS(f,y,_,k,V,A,C),Ct={at:new Date().toISOString(),method:r.method,path:r.path,baseUrl:o,url:ve.url,requestHeaders:{...ve.headers},requestBody:ve.body??null,credentials:tt,tryForm:Pt};try{const gt=await fetch(ve.url,bt),jt=await gt.text();let Gt=null;try{Gt=jt?JSON.parse(jt):null}catch{Gt=null}F({status:gt.status,statusText:gt.statusText,bodyText:jt,json:Gt});try{await ph({...Ct,status:gt.status,statusText:gt.statusText,responseHeaders:WS(gt.headers),responseBodyText:jt})}catch{}}catch(gt){F(null);const jt=gt instanceof Error?gt.message:String(gt);W(jt);try{await ph({...Ct,networkError:jt})}catch{}}},Ee=async()=>{ue(null);const ve=de.trim();if(!ve){ue("Escribe un nombre para la plantilla.");return}await cx({name:ve,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=ve=>{if(m({...ve.pathVals}),b({...ve.queryVals}),v({...ve.headerVals}),j({...ve.cookieVals}),P(ve.bodyMode),T(ve.tryBodyRaw),O!=null&&O.length&&ve.bodyMode==="fields"){const tt={};for(const bt of O)tt[bt.key]=ve.bodyVals[bt.key]??"";I(tt)}else I({...ve.bodyVals});ue(null)},He=async ve=>{await dx(ve),await Ne()},Ke=async()=>{fe(null);const ve=_m(t,r,o,i,_e);if(!ve.ok){fe(ve.error);return}const tt=YS(ve);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=(ve,tt,bt)=>h.jsxs("label",{className:"block text-xs",children:[h.jsxs("span",{className:"text-slate-400",children:[ve.name,ve.required?h.jsx("span",{className:"text-rose-400/90",children:" *"}):null,ve.in!=="path"?h.jsxs("span",{className:"text-slate-600 ml-1",children:["(",ve.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[ve.name]??"",onChange:Pt=>bt(Ct=>({...Ct,[ve.name]:Pt.target.value})),placeholder:ve.description||(ve.in==="path"?`{${ve.name}}`:""),autoComplete:"off"})]},`${ve.in}:${ve.name}`),dt=ve=>h.jsxs("label",{className:"block text-xs",children:[h.jsxs("span",{className:"text-slate-400",children:[ve.key,ve.required?h.jsx("span",{className:"text-rose-400/90",children:" *"}):null,ve.type?h.jsxs("span",{className:"text-slate-600 ml-1",children:["(",ve.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[ve.key]??"",onChange:tt=>Ae(ve.key,tt.target.value),placeholder:ve.description||"valor o JSON para objetos anidados",autoComplete:"off"})]},ve.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:ve=>be(ve.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(ve=>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:ve.name}),h.jsx("button",{type:"button",onClick:()=>Ze(ve),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"}),ve.id!==void 0?h.jsx("button",{type:"button",onClick:()=>void He(ve.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 ${ve.name}`,children:"Eliminar"}):null]},ve.id??ve.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(ve=>ct(ve,f,m)),H.map(ve=>ct(ve,y,b)),q.map(ve=>ct(ve,_,v)),J.map(ve=>ct(ve,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(ve=>dt(ve))}):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:ve=>T(ve.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(RS,{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 GS(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 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:"11",cy:"11",r:"8"}),h.jsx("path",{d:"m21 21-4.3-4.3"})]})}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("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 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:"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 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:"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 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("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 Tg(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 r2(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 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:"7 10 12 15 17 10"}),h.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]})}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:"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 i2(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 Sm(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 a2=["get","post","put","patch","delete","options","head","trace"];function Ig(t,r){const o=t.trim().replace(/\s+/g," ");return o.length<=r?o:`${o.slice(0,r-1)}…`}function l2(t,r,o,i,l){const c=[`${t.toUpperCase()} ${r}`];return o&&c.push(`— ${Ig(o,140)}`),i!=null&&i.length&&c.push(`[tags: ${i.join(", ")}]`),l&&c.push(`(operationId: ${l})`),c.join(" ")}function u2(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 a2){const b=m[y];if(!(!b||typeof b!="object")&&(i+=1,o.length<r)){const _=b.summary||(b.description?Ig(b.description,200):void 0);o.push(l2(y,c,_,b.tags,b.operationId))}}}return{lines:o,total:i}}function c2(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 d2(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 f2(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,F])=>{if(!F||typeof F!="object"||"$ref"in F)return`${M}: ref`;const U=F.type??"?";return`${M} (${U})`}).join("; "):"",{lines:m,total:y}=u2(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(c2).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(d2).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 p2(t,r,o,i,l){const c=`${t.replace(/\/?$/,"/")}__chat`,f=await fetch(c,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",[Dy]: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 h2({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(()=>f2(t,r),[t,r]);D.useEffect(()=>{var F;(F=T.current)==null||F.scrollIntoView({behavior:"smooth"})},[b]);const P=D.useCallback(async()=>{const F=v.trim();if(!F||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:F},Z=[{role:"system",content:V},...b.filter(fe=>fe.role!=="system"),W];k(""),_(fe=>[...fe,W]),C(!0);try{const fe=await p2(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((F,U)=>h.jsxs("div",{className:`text-xs leading-relaxed rounded-xl px-2.5 py-2 backdrop-blur-sm ${F.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:F.role==="user"?"Tú":"Asistente"}),h.jsx("div",{className:"whitespace-pre-wrap break-words",children:F.content})]},`${U}-${F.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:F=>k(F.target.value),onKeyDown:F=>{F.key==="Enter"&&!F.shiftKey&&(F.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(F=>!F),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(Tg,{className:m?"opacity-80":void 0})})]})}const $g="adt-llm-provider",Ag="adt-llm-model",Og="adt-llm-key";function m2(){try{const t=localStorage.getItem($g),r=t==="anthropic"||t==="openai"||t==="openrouter"?t:"openrouter",o=localStorage.getItem(Ag)??"",i=localStorage.getItem(Og)??"";return{provider:r,model:o,apiKey:i}}catch{return{provider:"openrouter",model:"",apiKey:""}}}function g2(t,r,o){try{localStorage.setItem($g,t),localStorage.setItem(Ag,r),localStorage.setItem(Og,o)}catch{}}function y2({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 x2(t){return typeof t=="object"&&t!==null&&"$ref"in t&&typeof t.$ref=="string"}function v2({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=x2(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",w2="playground";function Nm(t){if(!t)return!1;const r=t.startsWith("?")?t.slice(1):t;return new URLSearchParams(r).get(w2)==="1"}function b2(t,r){const o=`${t.toLowerCase()} ${r}`;return encodeURIComponent(o)}function k2(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 Em(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 _2({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 fx();i(M)},[]);D.useEffect(()=>{C()},[C,t]);const I=D.useMemo(()=>{const M=f.trim().toLowerCase(),F=y.trim().toLowerCase();return o.filter(U=>!(M&&U.method.toLowerCase()!==M||F&&!U.path.toLowerCase().includes(F)&&!U.url.toLowerCase().includes(F)))},[o,f,y]),A=M=>{M!==void 0&&c(F=>F===M?null:M)},T=async()=>{if(window.confirm("¿Vaciar todo el historial de llamadas? No se puede deshacer.")){j(!0);try{await px(),i([]),c(null)}finally{j(!1)}}},V=async M=>{M!==void 0&&(await hx(M),c(F=>F===M?null:F),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 ",Cd," 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 F=M.id,U=F!==void 0&&l===F;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(F),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"}),F!==void 0?h.jsx("button",{type:"button",onClick:()=>void V(F),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:Em(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:Em(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]},F??`${M.at}-${M.url}`)})})]})}const Rg=[{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 jm(t){return Rg.some(r=>r.value===t)}const Sd=[{id:"typescript",label:"TypeScript"},{id:"javascript",label:"JavaScript"},{id:"python",label:"Python"},{id:"php",label:"PHP"}];function Nd(t,r){return`${t.toLowerCase()} ${r}`}function S2(t){const r=t.indexOf(" ");return r===-1?{method:"get",path:"/"}:{method:t.slice(0,r),path:t.slice(r+1)}}function N2(){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 Cm(t){await navigator.clipboard.writeText(t)}function E2(){var kr;const t=OS(),[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"),[F,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,ve]=D.useState("openrouter"),[tt,bt]=D.useState(""),[Pt,Ct]=D.useState(""),[gt,jt]=D.useState(!1),[Gt,fr]=D.useState(!1),[an,Mt]=D.useState(!1),[nn,ln]=D.useState(null),[pr,Tn]=D.useState(0),In=(L,me)=>{try{const Be=sessionStorage.getItem(L);if(Be==="1")return!0;if(Be==="0")return!1}catch{}return me},[mn,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",gn=D.useMemo(()=>N2(),[]),Jt=D.useCallback(async()=>{const[L,me]=await Promise.all([nt.flows.toArray(),nt.testSuites.toArray()]);H(L.sort((Be,Je)=>(Be.name??"").localeCompare(Je.name??""))),Ne(me.sort((Be,Je)=>(Be.name??"").localeCompare(Je.name??"")))},[]);D.useEffect(()=>{var me,Be;if(!r)return;const L=((me=t.productName)==null?void 0:me.trim())||((Be=r.info.title)==null?void 0:Be.trim())||"API";document.title=L},[r,t.productName]);const Ve=D.useCallback(async()=>{if(y(null),gn)try{const me=await fetch(gn,{credentials:"omit",mode:"cors"});if(!me.ok)throw new Error(`${me.status} ${me.statusText}`);const Be=await me.json();ld(Be);const Je=Be;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);ld(me);const Be=me;o(Be),C(Ro(Be)),l(null),f("local");return}catch{await fh()}try{const me=await fetch(We,{credentials:"include"});if(me.status===401){let Je="/docs/__auth/login";try{const Et=await me.json();Et.loginPath&&(Je=Et.loginPath)}catch{}window.location.href=Je;return}if(!me.ok)throw new Error(`${me.status} ${me.statusText}`);const Be=await me.json();o(Be),C(Ro(Be)),l(null),f("server")}catch(me){l(me instanceof Error?me.message:String(me))}},[We,gn]);D.useEffect(()=>{Ve()},[Ve]),D.useEffect(()=>{try{sessionStorage.setItem("adt-collapse-main",mn?"1":"0")}catch{}},[mn]),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 Be=await me.json(),Je=await gx(Be);!L&&Je&&await Jt()}catch{}})(),()=>{L=!0}},[r,Ln,Jt]),D.useEffect(()=>{Jt(),nt.kv.get("bearer").then(L=>L&&U(L.value)),nt.kv.get("apiKey").then(L=>L&&Z(L.value))},[Jt]),D.useEffect(()=>{const L=m2();ve(L.provider),bt(L.model||ou(L.provider)),Ct(L.apiKey)},[]),D.useEffect(()=>{Mt(!1)},[r]);const Dn=D.useMemo(()=>r?nx(r):[],[r]),Nt=D.useMemo(()=>r?uo(r):[],[r]),Qr=D.useMemo(()=>r?Nt.map(L=>({method:L.method,path:L.path,operationId:L.operationId,tags:L.tags,deprecated:_d(r,L.method,L.path)})):[],[r,Nt]);D.useEffect(()=>{if(!r||Nt.length===0||an)return;const L=new URLSearchParams(window.location.search);if(Nm(window.location.search)){Mt(!0);return}const me=k2(L.get(nu));me&&Nt.some(Je=>Je.method.toLowerCase()===me.method&&Je.path===me.path)&&(ln(null),V({method:me.method,path:me.path}),k("explore")),Mt(!0)},[r,Nt,an]),D.useEffect(()=>{if(!an||!r)return;const L=new URL(window.location.href);if(Nm(L.search)){L.searchParams.delete(nu),window.history.replaceState({},"",L.toString());return}v==="explore"&&T?L.searchParams.set(nu,b2(T.method,T.path)):L.searchParams.delete(nu),window.history.replaceState({},"",L.toString())},[an,r,v,T]),D.useEffect(()=>{const L=me=>{(me.metaKey||me.ctrlKey)&&me.key.toLowerCase()==="k"&&(me.preventDefault(),fr(Be=>!Be))};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?Nt.filter(L=>(L.tags??["default"]).includes(I)):Nt,[Nt,I]);D.useEffect(()=>{if(Nt.length&&!Re){const L=Nt[0];_e(Nd(L.method,L.path))}},[Nt,Re]),D.useEffect(()=>{if(Nt.length===0||X.nodes.length>0||v!=="flows"||ze!=null)return;const L=Nt[0];de({nodes:[{id:crypto.randomUUID(),method:L.method.toLowerCase(),path:L.path,x:80,y:120}],edges:[]}),z(me=>me+1)},[Nt,X.nodes.length,v,ze]);const mr=D.useCallback(()=>{const L={"Content-Type":"application/json"};return F.trim()&&(L.Authorization=`Bearer ${F.trim()}`),W.trim()&&(L[fe]=W.trim()),L},[F,W,fe]),Bo=D.useCallback(()=>{ln(null)},[]),zn=D.useCallback(L=>{V({method:L.method,path:L.path}),ln(L),k("explore")},[]);D.useEffect(()=>{v==="history"&&Tn(L=>L+1)},[v]);const Fn=D.useCallback(L=>{ln(null),V(L)},[]),$n=D.useMemo(()=>{if(!r||!T)return null;const L={};for(const{id:me}of Sd)L[me]=Zy(r,me,T.method,T.path);return L},[r,T]),tr=D.useMemo(()=>r?tx(r,P,I):"",[r,P,I]),lt=D.useMemo(()=>{var $t,Xt;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 Be=typeof me.summary=="string"?me.summary:void 0,Je=typeof me.description=="string"?me.description:void 0;let Et=null;try{const Ht=me.requestBody,qt=(Xt=Ht==null?void 0:Ht.content)==null?void 0:Xt["application/json"];if((qt==null?void 0:qt.example)!==void 0)Et=JSON.stringify(qt.example,null,2);else if(qt!=null&&qt.examples&&typeof qt.examples=="object"){const xn=Object.values(qt.examples)[0];xn&&xn.value!==void 0&&(Et=JSON.stringify(xn.value,null,2))}}catch{}return{summary:Be,description:Je,exampleStr:Et}},[r,T]),Dt=D.useCallback(L=>{ln(null),V(L),k("explore")},[]),Pr=async L=>{var Et;if(!r)return"";const me={};let Be="";const Je=Ro(r,j);for(let $t=0;$t<L.length;$t++){const Xt=L[$t];let Ht=Xt.path;for(const[Ir,Ws]of Object.entries(me))Ht=Ht.replace(`{${Ir}}`,Ws);const qt=`${Je}${Ht}`,xn={method:Xt.method.toUpperCase(),headers:mr()},wt=Xt.method.toLowerCase();wt!=="get"&&wt!=="head"&&(xn.body="{}");const ys=await fetch(qt,{...xn,credentials:pu(qt)}),yt=await ys.json().catch(()=>({}));if(Be+=`Paso ${$t+1}: ${ys.status}
240
+ ${JSON.stringify(yt,null,2)}
241
+
242
+ `,(Et=Xt.extract)!=null&&Et.jsonPath){const Ir=Ud(yt,Xt.extract.jsonPath);Ir!==void 0&&(me[Xt.extract.varName]=String(Ir))}}return Be},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 wm(X,L,mr);J(me)},rr=async L=>{if(!r)return;const me=Ro(r,j),Be=L.graph&&L.graph.nodes.length>0?await wm(L.graph,me,mr):await Pr(L.steps);J(Be),k("flows")},gr=L=>{Q(L.name),de(L.graph&&L.graph.nodes.length>0?L.graph:$S(L.steps.length?L.steps:[{method:"get",path:"/"}])),z(me=>me+1),Ee(L.id??null),k("flows")},Ho=()=>{Ee(null),Q("Nuevo flujo"),Nt[0]?de({nodes:[{id:crypto.randomUUID(),method:Nt[0].method.toLowerCase(),path:Nt[0].path,x:80,y:120}],edges:[]}):de({nodes:[],edges:[]}),z(L=>L+1)},Bn=D.useCallback(L=>{de(L)},[]),yr=async()=>{const L=IS(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 Jt()},Yt=async L=>{L!==void 0&&(L===ze&&(Ee(null),Ho()),await nt.flows.delete(L),await Jt())},xr=()=>{if(!Re)return;const{method:L,path:me}=S2(Re),Be={id:crypto.randomUUID(),method:L,path:me,expectStatus:200,contains:void 0,jsonPath:void 0,expectJsonValue:void 0};K(Je=>({...Je,cases:[...Je.cases,Be]}))},po=L=>{K(me=>({...me,cases:me.cases.filter(Be=>Be.id!==L)}))},rn=(L,me)=>{K(Be=>({...Be,cases:Be.cases.map(Je=>Je.id===L?{...Je,...me}:Je)}))},Mr=async L=>{if(!r)return"";const me=Ro(r,j);let Be="";for(const Je of L){const Et=`${me}${Je.path}`,$t=await fetch(Et,{method:Je.method.toUpperCase(),headers:mr(),credentials:pu(Et)}),Xt=await $t.text(),Ht=yx(Je,$t.status,Xt),qt=`${Ht.pass?"PASS":"FAIL"} ${Je.method.toUpperCase()} ${Je.path}`;Be+=`${qt}
243
+ ${Ht.lines.map(xn=>` ${xn}`).join(`
244
+ `)}
245
+
246
+ `}return Be},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")},Tt=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:[]})},vt=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 Jt()},Vo=async L=>{L!==void 0&&(L===Ze&&(He(null),K({name:"Nueva suite",cases:[]})),await nt.testSuites.delete(L),await Jt())},vr=async()=>{await nt.kv.put({key:"bearer",value:F}),await nt.kv.put({key:"apiKey",value:W})},Tr=async()=>{_(null);const L=await mx(),me=new Blob([JSON.stringify(L,null,2)],{type:"application/json"}),Be=document.createElement("a");Be.href=URL.createObjectURL(me),Be.download="api-doc-tor-estado-app.json",Be.click(),URL.revokeObjectURL(Be.href)},wr=async L=>{var Be;const me=(Be=L.target.files)==null?void 0:Be[0];if(L.target.value="",!!me){_(null);try{const Je=await me.text(),Et=JSON.parse(Je);if(Et.formatVersion!==1)throw new Error("Se esperaba un export de estado de la app (formatVersion: 1).");await Dm(Et),await Jt(),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"),Be=(((Je=r.info)==null?void 0:Je.title)??"openapi").replace(/[^\w\-.]+/g,"-").slice(0,80);me.href=URL.createObjectURL(L),me.download=`${Be||"openapi"}.json`,me.click(),URL.revokeObjectURL(me.href)},[r]),mo=async L=>{var Be;const me=(Be=L.target.files)==null?void 0:Be[0];if(L.target.value="",!!me){y(null);try{const Je=await me.text(),Et=JSON.parse(Je);ld(Et);const $t=Et;await lx($t),o($t),C(Ro($t)),l(null),f("local"),ln(null),V(null),A(null)}catch(Je){y(Je instanceof Error?Je.message:String(Je))}}},Un=D.useCallback(async()=>{y(null),await fh(),await Ve()},[Ve]),yn=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"},un=D.useCallback(()=>{jt(!0)},[]),Uo=D.useCallback(()=>{g2(dt,tt.trim(),Pt),jt(!1)},[Pt,tt,dt]);D.useEffect(()=>{if(!gt)return;const L=me=>{me.key==="Escape"&&jt(!1)};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[gt]);const Jr=()=>{T&&(de(L=>{const me=L.nodes[L.nodes.length-1],Be=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:Be,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 ${mn?"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:mn?"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:()=>jt(!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)"})]})]}),mn?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(Sm,{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(JS,{})}),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(ZS,{}),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(n2,{}),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(t2,{})}),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(e2,{})}),h.jsx("button",{type:"button",onClick:()=>jt(!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(Tg,{})}),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(r2,{}),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(o2,{})}),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(s2,{})}),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(i2,{})}):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:()=>Fn({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&&_d(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(Sm,{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 Be=(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:()=>Fn({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 ${GS(L.method)} ${Be?"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:()=>yn(),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&&_d(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&&lt.summary?h.jsx("p",{className:"text-sm text-slate-300 mt-2 leading-relaxed",children:lt.summary}):null,lt!=null&&lt.description&&lt.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&&lt.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(QS,{doc:r,selectedOp:T,baseUrl:j,buildHeaders:mr,hydrateEntry:nn,onHydrateConsumed:Bo}):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&&Sd.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 Cm($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:Sd.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 Cm(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(_2,{listKey:pr,onReplay:zn})}),v==="schemas"&&h.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:h.jsx(v2,{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,Be;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:[(((Be=(me=L.graph)==null?void 0:me.nodes)==null?void 0:Be.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 Yt(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(TS,{doc:r,ops:Nt,graph:X,onGraphChange:Bn},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:()=>Tt(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:Nt.map(L=>h.jsxs("option",{value:Nd(L.method,L.path),children:[L.method.toUpperCase()," ",L.path]},Nd(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=jm(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:Be=>{const Je=Be.target.value;if(Je==="custom"){rn(L.id,{expectStatus:jm(L.expectStatus)?1e3:L.expectStatus});return}rn(L.id,{expectStatus:Number(Je)})},children:[Rg.map(Be=>h.jsx("option",{value:String(Be.value),children:Be.label},Be.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:Be=>rn(L.id,{expectStatus:Number(Be.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:Be=>rn(L.id,{contains:Be.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:Be=>rn(L.id,{jsonPath:Be.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:Be=>rn(L.id,{expectJsonValue:Be.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 vt(),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: ",rx(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:F,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(y2,{open:Gt,onClose:()=>fr(!1),ops:Qr,onPick:Dt}),gt?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:()=>jt(!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:()=>jt(!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;ve(me),bt(Be=>Be.trim()?Be: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=>bt(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:Pt,onChange:L=>Ct(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:()=>jt(!1),className:"px-4 py-2.5 rounded-xl glass-pill text-slate-300 text-sm",children:"Cancelar"})]})]})]})}):null,h.jsx(h2,{doc:r,contextExtras:fo,provider:dt,model:tt,apiKey:Pt,onOpenLlmSettings:un}),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 j2={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 C2(t){return{...j2,...t}}function P2(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 M2(t){var o;const r=C2(t==null?void 0:t.colors);return{productName:((o=t==null?void 0:t.productName)==null?void 0:o.trim())||null,logoDataUrl:t?P2(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 T2={credentials:"include"};function I2(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 $2(){const t=M2(void 0);try{const r=await fetch("/docs/ui-config.json",T2);return r.status===401?{...t,docsAuthRequired:!0}:r.ok?await r.json():t}catch{return t}}(async()=>{const t=await $2();I2(t.colorsRgb),Ly.createRoot(document.getElementById("root")).render(h.jsx(Pm.StrictMode,{children:h.jsx(AS,{value:{productName:t.productName,logoDataUrl:t.logoDataUrl},children:h.jsx(E2,{})})}))})();