schemalens 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,127 @@
1
+ var iq=e=>{throw TypeError(e)};var Fp=(e,n,r)=>n.has(e)||iq("Cannot "+r);var Y=(e,n,r)=>(Fp(e,n,"read from private field"),r?r.call(e):n.get(e)),Ce=(e,n,r)=>n.has(e)?iq("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,r),ye=(e,n,r,s)=>(Fp(e,n,"write to private field"),s?s.call(e,r):n.set(e,r),r),Le=(e,n,r)=>(Fp(e,n,"access private method"),r);var Wc=(e,n,r,s)=>({set _(a){ye(e,n,a,r)},get _(){return Y(e,n,s)}});function Tz(e,n){for(var r=0;r<n.length;r++){const s=n[r];if(typeof s!="string"&&!Array.isArray(s)){for(const a in s)if(a!=="default"&&!(a in e)){const o=Object.getOwnPropertyDescriptor(s,a);o&&Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>s[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function r(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(a){if(a.ep)return;a.ep=!0;const o=r(a);fetch(a.href,o)}})();var Jc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function qz(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var n=e.default;if(typeof n=="function"){var r=function s(){return this instanceof s?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};r.prototype=n.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(s){var a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(r,s,a.get?a:{enumerable:!0,get:function(){return e[s]}})}),r}var Gp={exports:{}},Tu={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and 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 sq;function Az(){if(sq)return Tu;sq=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(s,a,o){var l=null;if(o!==void 0&&(l=""+o),a.key!==void 0&&(l=""+a.key),"key"in a){o={};for(var u in a)u!=="key"&&(o[u]=a[u])}else o=a;return a=o.ref,{$$typeof:e,type:s,key:l,ref:a!==void 0?a:null,props:o}}return Tu.Fragment=n,Tu.jsx=r,Tu.jsxs=r,Tu}var aq;function Nz(){return aq||(aq=1,Gp.exports=Az()),Gp.exports}var F=Nz(),Kp={exports:{}},Ie={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and 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 oq;function Rz(){if(oq)return Ie;oq=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),g=Symbol.iterator;function y(B){return B===null||typeof B!="object"?null:(B=g&&B[g]||B["@@iterator"],typeof B=="function"?B:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,v={};function b(B,K,ne){this.props=B,this.context=K,this.refs=v,this.updater=ne||E}b.prototype.isReactComponent={},b.prototype.setState=function(B,K){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,K,"setState")},b.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function w(){}w.prototype=b.prototype;function C(B,K,ne){this.props=B,this.context=K,this.refs=v,this.updater=ne||E}var T=C.prototype=new w;T.constructor=C,x(T,b.prototype),T.isPureReactComponent=!0;var A=Array.isArray;function N(){}var O={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function k(B,K,ne){var Q=ne.ref;return{$$typeof:e,type:B,key:K,ref:Q!==void 0?Q:null,props:ne}}function R(B,K){return k(B.type,K,B.props)}function M(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function D(B){var K={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(ne){return K[ne]})}var z=/\/+/g;function q(B,K){return typeof B=="object"&&B!==null&&B.key!=null?D(""+B.key):K.toString(36)}function j(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(N,N):(B.status="pending",B.then(function(K){B.status==="pending"&&(B.status="fulfilled",B.value=K)},function(K){B.status==="pending"&&(B.status="rejected",B.reason=K)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function L(B,K,ne,Q,J){var ie=typeof B;(ie==="undefined"||ie==="boolean")&&(B=null);var oe=!1;if(B===null)oe=!0;else switch(ie){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(B.$$typeof){case e:case n:oe=!0;break;case p:return oe=B._init,L(oe(B._payload),K,ne,Q,J)}}if(oe)return J=J(B),oe=Q===""?"."+q(B,0):Q,A(J)?(ne="",oe!=null&&(ne=oe.replace(z,"$&/")+"/"),L(J,K,ne,"",function(be){return be})):J!=null&&(M(J)&&(J=R(J,ne+(J.key==null||B&&B.key===J.key?"":(""+J.key).replace(z,"$&/")+"/")+oe)),K.push(J)),1;oe=0;var ee=Q===""?".":Q+":";if(A(B))for(var fe=0;fe<B.length;fe++)Q=B[fe],ie=ee+q(Q,fe),oe+=L(Q,K,ne,ie,J);else if(fe=y(B),typeof fe=="function")for(B=fe.call(B),fe=0;!(Q=B.next()).done;)Q=Q.value,ie=ee+q(Q,fe++),oe+=L(Q,K,ne,ie,J);else if(ie==="object"){if(typeof B.then=="function")return L(j(B),K,ne,Q,J);throw K=String(B),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return oe}function P(B,K,ne){if(B==null)return B;var Q=[],J=0;return L(B,Q,"","",function(ie){return K.call(ne,ie,J++)}),Q}function H(B){if(B._status===-1){var K=B._result;K=K(),K.then(function(ne){(B._status===0||B._status===-1)&&(B._status=1,B._result=ne)},function(ne){(B._status===0||B._status===-1)&&(B._status=2,B._result=ne)}),B._status===-1&&(B._status=0,B._result=K)}if(B._status===1)return B._result.default;throw B._result}var G=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},V={map:P,forEach:function(B,K,ne){P(B,function(){K.apply(this,arguments)},ne)},count:function(B){var K=0;return P(B,function(){K++}),K},toArray:function(B){return P(B,function(K){return K})||[]},only:function(B){if(!M(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return Ie.Activity=d,Ie.Children=V,Ie.Component=b,Ie.Fragment=r,Ie.Profiler=a,Ie.PureComponent=C,Ie.StrictMode=s,Ie.Suspense=h,Ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,Ie.__COMPILER_RUNTIME={__proto__:null,c:function(B){return O.H.useMemoCache(B)}},Ie.cache=function(B){return function(){return B.apply(null,arguments)}},Ie.cacheSignal=function(){return null},Ie.cloneElement=function(B,K,ne){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var Q=x({},B.props),J=B.key;if(K!=null)for(ie in K.key!==void 0&&(J=""+K.key),K)!I.call(K,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&K.ref===void 0||(Q[ie]=K[ie]);var ie=arguments.length-2;if(ie===1)Q.children=ne;else if(1<ie){for(var oe=Array(ie),ee=0;ee<ie;ee++)oe[ee]=arguments[ee+2];Q.children=oe}return k(B.type,J,Q)},Ie.createContext=function(B){return B={$$typeof:l,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:o,_context:B},B},Ie.createElement=function(B,K,ne){var Q,J={},ie=null;if(K!=null)for(Q in K.key!==void 0&&(ie=""+K.key),K)I.call(K,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(J[Q]=K[Q]);var oe=arguments.length-2;if(oe===1)J.children=ne;else if(1<oe){for(var ee=Array(oe),fe=0;fe<oe;fe++)ee[fe]=arguments[fe+2];J.children=ee}if(B&&B.defaultProps)for(Q in oe=B.defaultProps,oe)J[Q]===void 0&&(J[Q]=oe[Q]);return k(B,ie,J)},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(B){return{$$typeof:u,render:B}},Ie.isValidElement=M,Ie.lazy=function(B){return{$$typeof:p,_payload:{_status:-1,_result:B},_init:H}},Ie.memo=function(B,K){return{$$typeof:f,type:B,compare:K===void 0?null:K}},Ie.startTransition=function(B){var K=O.T,ne={};O.T=ne;try{var Q=B(),J=O.S;J!==null&&J(ne,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(N,G)}catch(ie){G(ie)}finally{K!==null&&ne.types!==null&&(K.types=ne.types),O.T=K}},Ie.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},Ie.use=function(B){return O.H.use(B)},Ie.useActionState=function(B,K,ne){return O.H.useActionState(B,K,ne)},Ie.useCallback=function(B,K){return O.H.useCallback(B,K)},Ie.useContext=function(B){return O.H.useContext(B)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(B,K){return O.H.useDeferredValue(B,K)},Ie.useEffect=function(B,K){return O.H.useEffect(B,K)},Ie.useEffectEvent=function(B){return O.H.useEffectEvent(B)},Ie.useId=function(){return O.H.useId()},Ie.useImperativeHandle=function(B,K,ne){return O.H.useImperativeHandle(B,K,ne)},Ie.useInsertionEffect=function(B,K){return O.H.useInsertionEffect(B,K)},Ie.useLayoutEffect=function(B,K){return O.H.useLayoutEffect(B,K)},Ie.useMemo=function(B,K){return O.H.useMemo(B,K)},Ie.useOptimistic=function(B,K){return O.H.useOptimistic(B,K)},Ie.useReducer=function(B,K,ne){return O.H.useReducer(B,K,ne)},Ie.useRef=function(B){return O.H.useRef(B)},Ie.useState=function(B){return O.H.useState(B)},Ie.useSyncExternalStore=function(B,K,ne){return O.H.useSyncExternalStore(B,K,ne)},Ie.useTransition=function(){return O.H.useTransition()},Ie.version="19.2.4",Ie}var uq;function ol(){return uq||(uq=1,Kp.exports=Rz()),Kp.exports}var te=ol();const Ga=hC(te),Oz=Tz({__proto__:null,default:Ga},[te]);var Yp={exports:{}},qu={},Xp={exports:{}},Wp={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and 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 lq;function Mz(){return lq||(lq=1,(function(e){function n(L,P){var H=L.length;L.push(P);e:for(;0<H;){var G=H-1>>>1,V=L[G];if(0<a(V,P))L[G]=P,L[H]=V,H=G;else break e}}function r(L){return L.length===0?null:L[0]}function s(L){if(L.length===0)return null;var P=L[0],H=L.pop();if(H!==P){L[0]=H;e:for(var G=0,V=L.length,B=V>>>1;G<B;){var K=2*(G+1)-1,ne=L[K],Q=K+1,J=L[Q];if(0>a(ne,H))Q<V&&0>a(J,ne)?(L[G]=J,L[Q]=H,G=Q):(L[G]=ne,L[K]=H,G=K);else if(Q<V&&0>a(J,H))L[G]=J,L[Q]=H,G=Q;else break e}}return P}function a(L,P){var H=L.sortIndex-P.sortIndex;return H!==0?H:L.id-P.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var h=[],f=[],p=1,d=null,g=3,y=!1,E=!1,x=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function T(L){for(var P=r(f);P!==null;){if(P.callback===null)s(f);else if(P.startTime<=L)s(f),P.sortIndex=P.expirationTime,n(h,P);else break;P=r(f)}}function A(L){if(x=!1,T(L),!E)if(r(h)!==null)E=!0,N||(N=!0,D());else{var P=r(f);P!==null&&j(A,P.startTime-L)}}var N=!1,O=-1,I=5,k=-1;function R(){return v?!0:!(e.unstable_now()-k<I)}function M(){if(v=!1,N){var L=e.unstable_now();k=L;var P=!0;try{e:{E=!1,x&&(x=!1,w(O),O=-1),y=!0;var H=g;try{t:{for(T(L),d=r(h);d!==null&&!(d.expirationTime>L&&R());){var G=d.callback;if(typeof G=="function"){d.callback=null,g=d.priorityLevel;var V=G(d.expirationTime<=L);if(L=e.unstable_now(),typeof V=="function"){d.callback=V,T(L),P=!0;break t}d===r(h)&&s(h),T(L)}else s(h);d=r(h)}if(d!==null)P=!0;else{var B=r(f);B!==null&&j(A,B.startTime-L),P=!1}}break e}finally{d=null,g=H,y=!1}P=void 0}}finally{P?D():N=!1}}}var D;if(typeof C=="function")D=function(){C(M)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,q=z.port2;z.port1.onmessage=M,D=function(){q.postMessage(null)}}else D=function(){b(M,0)};function j(L,P){O=b(function(){L(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_next=function(L){switch(g){case 1:case 2:case 3:var P=3;break;default:P=g}var H=g;g=P;try{return L()}finally{g=H}},e.unstable_requestPaint=function(){v=!0},e.unstable_runWithPriority=function(L,P){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var H=g;g=L;try{return P()}finally{g=H}},e.unstable_scheduleCallback=function(L,P,H){var G=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?G+H:G):H=G,L){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=H+V,L={id:p++,callback:P,priorityLevel:L,startTime:H,expirationTime:V,sortIndex:-1},H>G?(L.sortIndex=H,n(f,L),r(h)===null&&L===r(f)&&(x?(w(O),O=-1):x=!0,j(A,H-G))):(L.sortIndex=V,n(h,L),E||y||(E=!0,N||(N=!0,D()))),L},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(L){var P=g;return function(){var H=g;g=P;try{return L.apply(this,arguments)}finally{g=H}}}})(Wp)),Wp}var cq;function jz(){return cq||(cq=1,Xp.exports=Mz()),Xp.exports}var Jp={exports:{}},Kt={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and 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 fq;function Lz(){if(fq)return Kt;fq=1;var e=ol();function n(h){var f="https://react.dev/errors/"+h;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+h+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var s={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for("react.portal");function o(h,f,p){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:d==null?null:""+d,children:h,containerInfo:f,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(h,f){if(h==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Kt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Kt.createPortal=function(h,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(n(299));return o(h,f,null,p)},Kt.flushSync=function(h){var f=l.T,p=s.p;try{if(l.T=null,s.p=2,h)return h()}finally{l.T=f,s.p=p,s.d.f()}},Kt.preconnect=function(h,f){typeof h=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,s.d.C(h,f))},Kt.prefetchDNS=function(h){typeof h=="string"&&s.d.D(h)},Kt.preinit=function(h,f){if(typeof h=="string"&&f&&typeof f.as=="string"){var p=f.as,d=u(p,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,y=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?s.d.S(h,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:d,integrity:g,fetchPriority:y}):p==="script"&&s.d.X(h,{crossOrigin:d,integrity:g,fetchPriority:y,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Kt.preinitModule=function(h,f){if(typeof h=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=u(f.as,f.crossOrigin);s.d.M(h,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&s.d.M(h)},Kt.preload=function(h,f){if(typeof h=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,d=u(p,f.crossOrigin);s.d.L(h,p,{crossOrigin:d,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Kt.preloadModule=function(h,f){if(typeof h=="string")if(f){var p=u(f.as,f.crossOrigin);s.d.m(h,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else s.d.m(h)},Kt.requestFormReset=function(h){s.d.r(h)},Kt.unstable_batchedUpdates=function(h,f){return h(f)},Kt.useFormState=function(h,f,p){return l.H.useFormState(h,f,p)},Kt.useFormStatus=function(){return l.H.useHostTransitionStatus()},Kt.version="19.2.4",Kt}var hq;function qI(){if(hq)return Jp.exports;hq=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Jp.exports=Lz(),Jp.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var dq;function $z(){if(dq)return qu;dq=1;var e=jz(),n=ol(),r=qI();function s(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)i+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function o(t){var i=t,c=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(c=i.return),t=i.return;while(t)}return i.tag===3?c:null}function l(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function u(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function h(t){if(o(t)!==t)throw Error(s(188))}function f(t){var i=t.alternate;if(!i){if(i=o(t),i===null)throw Error(s(188));return i!==t?null:t}for(var c=t,m=i;;){var _=c.return;if(_===null)break;var S=_.alternate;if(S===null){if(m=_.return,m!==null){c=m;continue}break}if(_.child===S.child){for(S=_.child;S;){if(S===c)return h(_),t;if(S===m)return h(_),i;S=S.sibling}throw Error(s(188))}if(c.return!==m.return)c=_,m=S;else{for(var $=!1,U=_.child;U;){if(U===c){$=!0,c=_,m=S;break}if(U===m){$=!0,m=_,c=S;break}U=U.sibling}if(!$){for(U=S.child;U;){if(U===c){$=!0,c=S,m=_;break}if(U===m){$=!0,m=S,c=_;break}U=U.sibling}if(!$)throw Error(s(189))}}if(c.alternate!==m)throw Error(s(190))}if(c.tag!==3)throw Error(s(188));return c.stateNode.current===c?t:i}function p(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=p(t),i!==null)return i;t=t.sibling}return null}var d=Object.assign,g=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),C=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),k=Symbol.for("react.activity"),R=Symbol.for("react.memo_cache_sentinel"),M=Symbol.iterator;function D(t){return t===null||typeof t!="object"?null:(t=M&&t[M]||t["@@iterator"],typeof t=="function"?t:null)}var z=Symbol.for("react.client.reference");function q(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===z?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case x:return"Fragment";case b:return"Profiler";case v:return"StrictMode";case A:return"Suspense";case N:return"SuspenseList";case k:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case E:return"Portal";case C:return t.displayName||"Context";case w:return(t._context.displayName||"Context")+".Consumer";case T:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case O:return i=t.displayName||null,i!==null?i:q(t.type)||"Memo";case I:i=t._payload,t=t._init;try{return q(t(i))}catch{}}return null}var j=Array.isArray,L=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},G=[],V=-1;function B(t){return{current:t}}function K(t){0>V||(t.current=G[V],G[V]=null,V--)}function ne(t,i){V++,G[V]=t.current,t.current=i}var Q=B(null),J=B(null),ie=B(null),oe=B(null);function ee(t,i){switch(ne(ie,i),ne(J,t),ne(Q,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?qT(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=qT(i),t=AT(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}K(Q),ne(Q,t)}function fe(){K(Q),K(J),K(ie)}function be(t){t.memoizedState!==null&&ne(oe,t);var i=Q.current,c=AT(i,t.type);i!==c&&(ne(J,t),ne(Q,c))}function ve(t){J.current===t&&(K(Q),K(J)),oe.current===t&&(K(oe),Eu._currentValue=H)}var _e,we;function W(t){if(_e===void 0)try{throw Error()}catch(c){var i=c.stack.trim().match(/\n( *(at )?)/);_e=i&&i[1]||"",we=-1<c.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+_e+t+we}var ae=!1;function xe(t,i){if(!t||ae)return"";ae=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(i){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(he){var ce=he}Reflect.construct(t,[],ge)}else{try{ge.call()}catch(he){ce=he}t.call(ge.prototype)}}else{try{throw Error()}catch(he){ce=he}(ge=t())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(he){if(he&&ce&&typeof he.stack=="string")return[he.stack,ce.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=m.DetermineComponentFrameRoot(),$=S[0],U=S[1];if($&&U){var Z=$.split(`
44
+ `),le=U.split(`
45
+ `);for(_=m=0;m<Z.length&&!Z[m].includes("DetermineComponentFrameRoot");)m++;for(;_<le.length&&!le[_].includes("DetermineComponentFrameRoot");)_++;if(m===Z.length||_===le.length)for(m=Z.length-1,_=le.length-1;1<=m&&0<=_&&Z[m]!==le[_];)_--;for(;1<=m&&0<=_;m--,_--)if(Z[m]!==le[_]){if(m!==1||_!==1)do if(m--,_--,0>_||Z[m]!==le[_]){var pe=`
46
+ `+Z[m].replace(" at new "," at ");return t.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",t.displayName)),pe}while(1<=m&&0<=_);break}}}finally{ae=!1,Error.prepareStackTrace=c}return(c=t?t.displayName||t.name:"")?W(c):""}function Se(t,i){switch(t.tag){case 26:case 27:case 5:return W(t.type);case 16:return W("Lazy");case 13:return t.child!==i&&i!==null?W("Suspense Fallback"):W("Suspense");case 19:return W("SuspenseList");case 0:case 15:return xe(t.type,!1);case 11:return xe(t.type.render,!1);case 1:return xe(t.type,!0);case 31:return W("Activity");default:return""}}function gt(t){try{var i="",c=null;do i+=Se(t,c),c=t,t=t.return;while(t);return i}catch(m){return`
47
+ Error generating stack: `+m.message+`
48
+ `+m.stack}}var ut=Object.prototype.hasOwnProperty,It=e.unstable_scheduleCallback,Tt=e.unstable_cancelCallback,qt=e.unstable_shouldYield,Fe=e.unstable_requestPaint,Oe=e.unstable_now,Xe=e.unstable_getCurrentPriorityLevel,We=e.unstable_ImmediatePriority,rt=e.unstable_UserBlockingPriority,de=e.unstable_NormalPriority,X=e.unstable_LowPriority,Me=e.unstable_IdlePriority,Mo=e.log,sa=e.unstable_setDisableYieldValue,Ft=null,yt=null;function ar(t){if(typeof Mo=="function"&&sa(t),yt&&typeof yt.setStrictMode=="function")try{yt.setStrictMode(Ft,t)}catch{}}var Wt=Math.clz32?Math.clz32:Lh,Mh=Math.log,jh=Math.LN2;function Lh(t){return t>>>=0,t===0?32:31-(Mh(t)/jh|0)|0}var aa=256,oa=262144,ua=4194304;function Cr(t){var i=t&42;if(i!==0)return i;switch(t&-t){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function la(t,i,c){var m=t.pendingLanes;if(m===0)return 0;var _=0,S=t.suspendedLanes,$=t.pingedLanes;t=t.warmLanes;var U=m&134217727;return U!==0?(m=U&~S,m!==0?_=Cr(m):($&=U,$!==0?_=Cr($):c||(c=U&~t,c!==0&&(_=Cr(c))))):(U=m&~S,U!==0?_=Cr(U):$!==0?_=Cr($):c||(c=m&~t,c!==0&&(_=Cr(c)))),_===0?0:i!==0&&i!==_&&(i&S)===0&&(S=_&-_,c=i&-i,S>=c||S===32&&(c&4194048)!==0)?i:_}function Zi(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function $h(t,i){switch(t){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32: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 i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Al(){var t=ua;return ua<<=1,(ua&62914560)===0&&(ua=4194304),t}function jo(t){for(var i=[],c=0;31>c;c++)i.push(t);return i}function es(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ih(t,i,c,m,_,S){var $=t.pendingLanes;t.pendingLanes=c,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=c,t.entangledLanes&=c,t.errorRecoveryDisabledLanes&=c,t.shellSuspendCounter=0;var U=t.entanglements,Z=t.expirationTimes,le=t.hiddenUpdates;for(c=$&~c;0<c;){var pe=31-Wt(c),ge=1<<pe;U[pe]=0,Z[pe]=-1;var ce=le[pe];if(ce!==null)for(le[pe]=null,pe=0;pe<ce.length;pe++){var he=ce[pe];he!==null&&(he.lane&=-536870913)}c&=~ge}m!==0&&Nl(t,m,0),S!==0&&_===0&&t.tag!==0&&(t.suspendedLanes|=S&~($&~i))}function Nl(t,i,c){t.pendingLanes|=i,t.suspendedLanes&=~i;var m=31-Wt(i);t.entangledLanes|=i,t.entanglements[m]=t.entanglements[m]|1073741824|c&261930}function Rl(t,i){var c=t.entangledLanes|=i;for(t=t.entanglements;c;){var m=31-Wt(c),_=1<<m;_&i|t[m]&i&&(t[m]|=i),c&=~_}}function Ol(t,i){var c=i&-i;return c=(c&42)!==0?1:Lo(c),(c&(t.suspendedLanes|i))!==0?0:c}function Lo(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function $o(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Ml(){var t=P.p;return t!==0?t:(t=window.event,t===void 0?32:WT(t.type))}function jl(t,i){var c=P.p;try{return P.p=t,i()}finally{P.p=c}}var or=Math.random().toString(36).slice(2),Lt="__reactFiber$"+or,Gt="__reactProps$"+or,xr="__reactContainer$"+or,ca="__reactEvents$"+or,Ll="__reactListeners$"+or,Dh="__reactHandles$"+or,$l="__reactResources$"+or,ts="__reactMarker$"+or;function Io(t){delete t[Lt],delete t[Gt],delete t[ca],delete t[Ll],delete t[Dh]}function ri(t){var i=t[Lt];if(i)return i;for(var c=t.parentNode;c;){if(i=c[xr]||c[Lt]){if(c=i.alternate,i.child!==null||c!==null&&c.child!==null)for(t=$T(t);t!==null;){if(c=t[Lt])return c;t=$T(t)}return i}t=c,c=t.parentNode}return null}function ii(t){if(t=t[Lt]||t[xr]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function si(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(s(33))}function ai(t){var i=t[$l];return i||(i=t[$l]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function At(t){t[ts]=!0}var Il=new Set,Dl={};function Sr(t,i){oi(t,i),oi(t+"Capture",i)}function oi(t,i){for(Dl[t]=i,t=0;t<i.length;t++)Il.add(i[t])}var kh=RegExp("^[: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]*$"),Do={},kl={};function Bh(t){return ut.call(kl,t)?!0:ut.call(Do,t)?!1:kh.test(t)?kl[t]=!0:(Do[t]=!0,!1)}function fa(t,i,c){if(Bh(i))if(c===null)t.removeAttribute(i);else{switch(typeof c){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var m=i.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+c)}}function ha(t,i,c){if(c===null)t.removeAttribute(i);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+c)}}function zn(t,i,c,m){if(m===null)t.removeAttribute(c);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(c);return}t.setAttributeNS(i,c,""+m)}}function nn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Bl(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Ph(t,i,c){var m=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var _=m.get,S=m.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return _.call(this)},set:function($){c=""+$,S.call(this,$)}}),Object.defineProperty(t,i,{enumerable:m.enumerable}),{getValue:function(){return c},setValue:function($){c=""+$},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function ui(t){if(!t._valueTracker){var i=Bl(t)?"checked":"value";t._valueTracker=Ph(t,i,""+t[i])}}function Pl(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var c=i.getValue(),m="";return t&&(m=Bl(t)?t.checked?"true":"false":t.value),t=m,t!==c?(i.setValue(t),!0):!1}function ns(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var zh=/[\n"\\]/g;function rn(t){return t.replace(zh,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function rs(t,i,c,m,_,S,$,U){t.name="",$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?t.type=$:t.removeAttribute("type"),i!=null?$==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+nn(i)):t.value!==""+nn(i)&&(t.value=""+nn(i)):$!=="submit"&&$!=="reset"||t.removeAttribute("value"),i!=null?ko(t,$,nn(i)):c!=null?ko(t,$,nn(c)):m!=null&&t.removeAttribute("value"),_==null&&S!=null&&(t.defaultChecked=!!S),_!=null&&(t.checked=_&&typeof _!="function"&&typeof _!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?t.name=""+nn(U):t.removeAttribute("name")}function zl(t,i,c,m,_,S,$,U){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.type=S),i!=null||c!=null){if(!(S!=="submit"&&S!=="reset"||i!=null)){ui(t);return}c=c!=null?""+nn(c):"",i=i!=null?""+nn(i):c,U||i===t.value||(t.value=i),t.defaultValue=i}m=m??_,m=typeof m!="function"&&typeof m!="symbol"&&!!m,t.checked=U?t.checked:!!m,t.defaultChecked=!!m,$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"&&(t.name=$),ui(t)}function ko(t,i,c){i==="number"&&ns(t.ownerDocument)===t||t.defaultValue===""+c||(t.defaultValue=""+c)}function Tr(t,i,c,m){if(t=t.options,i){i={};for(var _=0;_<c.length;_++)i["$"+c[_]]=!0;for(c=0;c<t.length;c++)_=i.hasOwnProperty("$"+t[c].value),t[c].selected!==_&&(t[c].selected=_),_&&m&&(t[c].defaultSelected=!0)}else{for(c=""+nn(c),i=null,_=0;_<t.length;_++){if(t[_].value===c){t[_].selected=!0,m&&(t[_].defaultSelected=!0);return}i!==null||t[_].disabled||(i=t[_])}i!==null&&(i.selected=!0)}}function Ex(t,i,c){if(i!=null&&(i=""+nn(i),i!==t.value&&(t.value=i),c==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=c!=null?""+nn(c):""}function Cx(t,i,c,m){if(i==null){if(m!=null){if(c!=null)throw Error(s(92));if(j(m)){if(1<m.length)throw Error(s(93));m=m[0]}c=m}c==null&&(c=""),i=c}c=nn(i),t.defaultValue=c,m=t.textContent,m===c&&m!==""&&m!==null&&(t.value=m),ui(t)}function da(t,i){if(i){var c=t.firstChild;if(c&&c===t.lastChild&&c.nodeType===3){c.nodeValue=i;return}}t.textContent=i}var wP=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function xx(t,i,c){var m=i.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?m?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":m?t.setProperty(i,c):typeof c!="number"||c===0||wP.has(i)?i==="float"?t.cssFloat=c:t[i]=(""+c).trim():t[i]=c+"px"}function Sx(t,i,c){if(i!=null&&typeof i!="object")throw Error(s(62));if(t=t.style,c!=null){for(var m in c)!c.hasOwnProperty(m)||i!=null&&i.hasOwnProperty(m)||(m.indexOf("--")===0?t.setProperty(m,""):m==="float"?t.cssFloat="":t[m]="");for(var _ in i)m=i[_],i.hasOwnProperty(_)&&c[_]!==m&&xx(t,_,m)}else for(var S in i)i.hasOwnProperty(S)&&xx(t,S,i[S])}function Uh(t){if(t.indexOf("-")===-1)return!1;switch(t){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 EP=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),CP=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ul(t){return CP.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function qr(){}var Qh=null;function Hh(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var pa=null,ma=null;function Tx(t){var i=ii(t);if(i&&(t=i.stateNode)){var c=t[Gt]||null;e:switch(t=i.stateNode,i.type){case"input":if(rs(t,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),i=c.name,c.type==="radio"&&i!=null){for(c=t;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+rn(""+i)+'"][type="radio"]'),i=0;i<c.length;i++){var m=c[i];if(m!==t&&m.form===t.form){var _=m[Gt]||null;if(!_)throw Error(s(90));rs(m,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(i=0;i<c.length;i++)m=c[i],m.form===t.form&&Pl(m)}break e;case"textarea":Ex(t,c.value,c.defaultValue);break e;case"select":i=c.value,i!=null&&Tr(t,!!c.multiple,i,!1)}}}var Vh=!1;function qx(t,i,c){if(Vh)return t(i,c);Vh=!0;try{var m=t(i);return m}finally{if(Vh=!1,(pa!==null||ma!==null)&&(Nc(),pa&&(i=pa,t=ma,ma=pa=null,Tx(i),t)))for(i=0;i<t.length;i++)Tx(t[i])}}function Bo(t,i){var c=t.stateNode;if(c===null)return null;var m=c[Gt]||null;if(m===null)return null;c=m[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(t=t.type,m=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!m;break e;default:t=!1}if(t)return null;if(c&&typeof c!="function")throw Error(s(231,i,typeof c));return c}var Ar=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fh=!1;if(Ar)try{var Po={};Object.defineProperty(Po,"passive",{get:function(){Fh=!0}}),window.addEventListener("test",Po,Po),window.removeEventListener("test",Po,Po)}catch{Fh=!1}var li=null,Gh=null,Ql=null;function Ax(){if(Ql)return Ql;var t,i=Gh,c=i.length,m,_="value"in li?li.value:li.textContent,S=_.length;for(t=0;t<c&&i[t]===_[t];t++);var $=c-t;for(m=1;m<=$&&i[c-m]===_[S-m];m++);return Ql=_.slice(t,1<m?1-m:void 0)}function Hl(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function Vl(){return!0}function Nx(){return!1}function sn(t){function i(c,m,_,S,$){this._reactName=c,this._targetInst=_,this.type=m,this.nativeEvent=S,this.target=$,this.currentTarget=null;for(var U in t)t.hasOwnProperty(U)&&(c=t[U],this[U]=c?c(S):S[U]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Vl:Nx,this.isPropagationStopped=Nx,this}return d(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Vl)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Vl)},persist:function(){},isPersistent:Vl}),i}var is={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fl=sn(is),zo=d({},is,{view:0,detail:0}),xP=sn(zo),Kh,Yh,Uo,Gl=d({},zo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wh,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Uo&&(Uo&&t.type==="mousemove"?(Kh=t.screenX-Uo.screenX,Yh=t.screenY-Uo.screenY):Yh=Kh=0,Uo=t),Kh)},movementY:function(t){return"movementY"in t?t.movementY:Yh}}),Rx=sn(Gl),SP=d({},Gl,{dataTransfer:0}),TP=sn(SP),qP=d({},zo,{relatedTarget:0}),Xh=sn(qP),AP=d({},is,{animationName:0,elapsedTime:0,pseudoElement:0}),NP=sn(AP),RP=d({},is,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),OP=sn(RP),MP=d({},is,{data:0}),Ox=sn(MP),jP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},LP={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"},$P={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function IP(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=$P[t])?!!i[t]:!1}function Wh(){return IP}var DP=d({},zo,{key:function(t){if(t.key){var i=jP[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=Hl(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?LP[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wh,charCode:function(t){return t.type==="keypress"?Hl(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Hl(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),kP=sn(DP),BP=d({},Gl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mx=sn(BP),PP=d({},zo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wh}),zP=sn(PP),UP=d({},is,{propertyName:0,elapsedTime:0,pseudoElement:0}),QP=sn(UP),HP=d({},Gl,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),VP=sn(HP),FP=d({},is,{newState:0,oldState:0}),GP=sn(FP),KP=[9,13,27,32],Jh=Ar&&"CompositionEvent"in window,Qo=null;Ar&&"documentMode"in document&&(Qo=document.documentMode);var YP=Ar&&"TextEvent"in window&&!Qo,jx=Ar&&(!Jh||Qo&&8<Qo&&11>=Qo),Lx=" ",$x=!1;function Ix(t,i){switch(t){case"keyup":return KP.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Dx(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ga=!1;function XP(t,i){switch(t){case"compositionend":return Dx(i);case"keypress":return i.which!==32?null:($x=!0,Lx);case"textInput":return t=i.data,t===Lx&&$x?null:t;default:return null}}function WP(t,i){if(ga)return t==="compositionend"||!Jh&&Ix(t,i)?(t=Ax(),Ql=Gh=li=null,ga=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return jx&&i.locale!=="ko"?null:i.data;default:return null}}var JP={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 kx(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!JP[t.type]:i==="textarea"}function Bx(t,i,c,m){pa?ma?ma.push(m):ma=[m]:pa=m,i=Ic(i,"onChange"),0<i.length&&(c=new Fl("onChange","change",null,c,m),t.push({event:c,listeners:i}))}var Ho=null,Vo=null;function ZP(t){wT(t,0)}function Kl(t){var i=si(t);if(Pl(i))return t}function Px(t,i){if(t==="change")return i}var zx=!1;if(Ar){var Zh;if(Ar){var ed="oninput"in document;if(!ed){var Ux=document.createElement("div");Ux.setAttribute("oninput","return;"),ed=typeof Ux.oninput=="function"}Zh=ed}else Zh=!1;zx=Zh&&(!document.documentMode||9<document.documentMode)}function Qx(){Ho&&(Ho.detachEvent("onpropertychange",Hx),Vo=Ho=null)}function Hx(t){if(t.propertyName==="value"&&Kl(Vo)){var i=[];Bx(i,Vo,t,Hh(t)),qx(ZP,i)}}function e3(t,i,c){t==="focusin"?(Qx(),Ho=i,Vo=c,Ho.attachEvent("onpropertychange",Hx)):t==="focusout"&&Qx()}function t3(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Kl(Vo)}function n3(t,i){if(t==="click")return Kl(i)}function r3(t,i){if(t==="input"||t==="change")return Kl(i)}function i3(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var gn=typeof Object.is=="function"?Object.is:i3;function Fo(t,i){if(gn(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var c=Object.keys(t),m=Object.keys(i);if(c.length!==m.length)return!1;for(m=0;m<c.length;m++){var _=c[m];if(!ut.call(i,_)||!gn(t[_],i[_]))return!1}return!0}function Vx(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Fx(t,i){var c=Vx(t);t=0;for(var m;c;){if(c.nodeType===3){if(m=t+c.textContent.length,t<=i&&m>=i)return{node:c,offset:i-t};t=m}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Vx(c)}}function Gx(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?Gx(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function Kx(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=ns(t.document);i instanceof t.HTMLIFrameElement;){try{var c=typeof i.contentWindow.location.href=="string"}catch{c=!1}if(c)t=i.contentWindow;else break;i=ns(t.document)}return i}function td(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}var s3=Ar&&"documentMode"in document&&11>=document.documentMode,ya=null,nd=null,Go=null,rd=!1;function Yx(t,i,c){var m=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;rd||ya==null||ya!==ns(m)||(m=ya,"selectionStart"in m&&td(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Go&&Fo(Go,m)||(Go=m,m=Ic(nd,"onSelect"),0<m.length&&(i=new Fl("onSelect","select",null,i,c),t.push({event:i,listeners:m}),i.target=ya)))}function ss(t,i){var c={};return c[t.toLowerCase()]=i.toLowerCase(),c["Webkit"+t]="webkit"+i,c["Moz"+t]="moz"+i,c}var va={animationend:ss("Animation","AnimationEnd"),animationiteration:ss("Animation","AnimationIteration"),animationstart:ss("Animation","AnimationStart"),transitionrun:ss("Transition","TransitionRun"),transitionstart:ss("Transition","TransitionStart"),transitioncancel:ss("Transition","TransitionCancel"),transitionend:ss("Transition","TransitionEnd")},id={},Xx={};Ar&&(Xx=document.createElement("div").style,"AnimationEvent"in window||(delete va.animationend.animation,delete va.animationiteration.animation,delete va.animationstart.animation),"TransitionEvent"in window||delete va.transitionend.transition);function as(t){if(id[t])return id[t];if(!va[t])return t;var i=va[t],c;for(c in i)if(i.hasOwnProperty(c)&&c in Xx)return id[t]=i[c];return t}var Wx=as("animationend"),Jx=as("animationiteration"),Zx=as("animationstart"),a3=as("transitionrun"),o3=as("transitionstart"),u3=as("transitioncancel"),e1=as("transitionend"),t1=new Map,sd="abort auxClick beforeToggle 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(" ");sd.push("scrollEnd");function Un(t,i){t1.set(t,i),Sr(i,[t])}var Yl=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},An=[],ba=0,ad=0;function Xl(){for(var t=ba,i=ad=ba=0;i<t;){var c=An[i];An[i++]=null;var m=An[i];An[i++]=null;var _=An[i];An[i++]=null;var S=An[i];if(An[i++]=null,m!==null&&_!==null){var $=m.pending;$===null?_.next=_:(_.next=$.next,$.next=_),m.pending=_}S!==0&&n1(c,_,S)}}function Wl(t,i,c,m){An[ba++]=t,An[ba++]=i,An[ba++]=c,An[ba++]=m,ad|=m,t.lanes|=m,t=t.alternate,t!==null&&(t.lanes|=m)}function od(t,i,c,m){return Wl(t,i,c,m),Jl(t)}function os(t,i){return Wl(t,null,null,i),Jl(t)}function n1(t,i,c){t.lanes|=c;var m=t.alternate;m!==null&&(m.lanes|=c);for(var _=!1,S=t.return;S!==null;)S.childLanes|=c,m=S.alternate,m!==null&&(m.childLanes|=c),S.tag===22&&(t=S.stateNode,t===null||t._visibility&1||(_=!0)),t=S,S=S.return;return t.tag===3?(S=t.stateNode,_&&i!==null&&(_=31-Wt(c),t=S.hiddenUpdates,m=t[_],m===null?t[_]=[i]:m.push(i),i.lane=c|536870912),S):null}function Jl(t){if(50<mu)throw mu=0,gp=null,Error(s(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var _a={};function l3(t,i,c,m){this.tag=t,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yn(t,i,c,m){return new l3(t,i,c,m)}function ud(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Nr(t,i){var c=t.alternate;return c===null?(c=yn(t.tag,i,t.key,t.mode),c.elementType=t.elementType,c.type=t.type,c.stateNode=t.stateNode,c.alternate=t,t.alternate=c):(c.pendingProps=i,c.type=t.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=t.flags&65011712,c.childLanes=t.childLanes,c.lanes=t.lanes,c.child=t.child,c.memoizedProps=t.memoizedProps,c.memoizedState=t.memoizedState,c.updateQueue=t.updateQueue,i=t.dependencies,c.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},c.sibling=t.sibling,c.index=t.index,c.ref=t.ref,c.refCleanup=t.refCleanup,c}function r1(t,i){t.flags&=65011714;var c=t.alternate;return c===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=c.childLanes,t.lanes=c.lanes,t.child=c.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=c.memoizedProps,t.memoizedState=c.memoizedState,t.updateQueue=c.updateQueue,t.type=c.type,i=c.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function Zl(t,i,c,m,_,S){var $=0;if(m=t,typeof t=="function")ud(t)&&($=1);else if(typeof t=="string")$=pz(t,c,Q.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case k:return t=yn(31,c,i,_),t.elementType=k,t.lanes=S,t;case x:return us(c.children,_,S,i);case v:$=8,_|=24;break;case b:return t=yn(12,c,i,_|2),t.elementType=b,t.lanes=S,t;case A:return t=yn(13,c,i,_),t.elementType=A,t.lanes=S,t;case N:return t=yn(19,c,i,_),t.elementType=N,t.lanes=S,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case C:$=10;break e;case w:$=9;break e;case T:$=11;break e;case O:$=14;break e;case I:$=16,m=null;break e}$=29,c=Error(s(130,t===null?"null":typeof t,"")),m=null}return i=yn($,c,i,_),i.elementType=t,i.type=m,i.lanes=S,i}function us(t,i,c,m){return t=yn(7,t,m,i),t.lanes=c,t}function ld(t,i,c){return t=yn(6,t,null,i),t.lanes=c,t}function i1(t){var i=yn(18,null,null,0);return i.stateNode=t,i}function cd(t,i,c){return i=yn(4,t.children!==null?t.children:[],t.key,i),i.lanes=c,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var s1=new WeakMap;function Nn(t,i){if(typeof t=="object"&&t!==null){var c=s1.get(t);return c!==void 0?c:(i={value:t,source:i,stack:gt(i)},s1.set(t,i),i)}return{value:t,source:i,stack:gt(i)}}var wa=[],Ea=0,ec=null,Ko=0,Rn=[],On=0,ci=null,ur=1,lr="";function Rr(t,i){wa[Ea++]=Ko,wa[Ea++]=ec,ec=t,Ko=i}function a1(t,i,c){Rn[On++]=ur,Rn[On++]=lr,Rn[On++]=ci,ci=t;var m=ur;t=lr;var _=32-Wt(m)-1;m&=~(1<<_),c+=1;var S=32-Wt(i)+_;if(30<S){var $=_-_%5;S=(m&(1<<$)-1).toString(32),m>>=$,_-=$,ur=1<<32-Wt(i)+_|c<<_|m,lr=S+t}else ur=1<<S|c<<_|m,lr=t}function fd(t){t.return!==null&&(Rr(t,1),a1(t,1,0))}function hd(t){for(;t===ec;)ec=wa[--Ea],wa[Ea]=null,Ko=wa[--Ea],wa[Ea]=null;for(;t===ci;)ci=Rn[--On],Rn[On]=null,lr=Rn[--On],Rn[On]=null,ur=Rn[--On],Rn[On]=null}function o1(t,i){Rn[On++]=ur,Rn[On++]=lr,Rn[On++]=ci,ur=i.id,lr=i.overflow,ci=t}var Bt=null,lt=null,Qe=!1,fi=null,Mn=!1,dd=Error(s(519));function hi(t){var i=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Yo(Nn(i,t)),dd}function u1(t){var i=t.stateNode,c=t.type,m=t.memoizedProps;switch(i[Lt]=t,i[Gt]=m,c){case"dialog":Pe("cancel",i),Pe("close",i);break;case"iframe":case"object":case"embed":Pe("load",i);break;case"video":case"audio":for(c=0;c<yu.length;c++)Pe(yu[c],i);break;case"source":Pe("error",i);break;case"img":case"image":case"link":Pe("error",i),Pe("load",i);break;case"details":Pe("toggle",i);break;case"input":Pe("invalid",i),zl(i,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Pe("invalid",i);break;case"textarea":Pe("invalid",i),Cx(i,m.value,m.defaultValue,m.children)}c=m.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||i.textContent===""+c||m.suppressHydrationWarning===!0||ST(i.textContent,c)?(m.popover!=null&&(Pe("beforetoggle",i),Pe("toggle",i)),m.onScroll!=null&&Pe("scroll",i),m.onScrollEnd!=null&&Pe("scrollend",i),m.onClick!=null&&(i.onclick=qr),i=!0):i=!1,i||hi(t,!0)}function l1(t){for(Bt=t.return;Bt;)switch(Bt.tag){case 5:case 31:case 13:Mn=!1;return;case 27:case 3:Mn=!0;return;default:Bt=Bt.return}}function Ca(t){if(t!==Bt)return!1;if(!Qe)return l1(t),Qe=!0,!1;var i=t.tag,c;if((c=i!==3&&i!==27)&&((c=i===5)&&(c=t.type,c=!(c!=="form"&&c!=="button")||Op(t.type,t.memoizedProps)),c=!c),c&&lt&&hi(t),l1(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));lt=LT(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));lt=LT(t)}else i===27?(i=lt,Ti(t.type)?(t=Ip,Ip=null,lt=t):lt=i):lt=Bt?Ln(t.stateNode.nextSibling):null;return!0}function ls(){lt=Bt=null,Qe=!1}function pd(){var t=fi;return t!==null&&(ln===null?ln=t:ln.push.apply(ln,t),fi=null),t}function Yo(t){fi===null?fi=[t]:fi.push(t)}var md=B(null),cs=null,Or=null;function di(t,i,c){ne(md,i._currentValue),i._currentValue=c}function Mr(t){t._currentValue=md.current,K(md)}function gd(t,i,c){for(;t!==null;){var m=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,m!==null&&(m.childLanes|=i)):m!==null&&(m.childLanes&i)!==i&&(m.childLanes|=i),t===c)break;t=t.return}}function yd(t,i,c,m){var _=t.child;for(_!==null&&(_.return=t);_!==null;){var S=_.dependencies;if(S!==null){var $=_.child;S=S.firstContext;e:for(;S!==null;){var U=S;S=_;for(var Z=0;Z<i.length;Z++)if(U.context===i[Z]){S.lanes|=c,U=S.alternate,U!==null&&(U.lanes|=c),gd(S.return,c,t),m||($=null);break e}S=U.next}}else if(_.tag===18){if($=_.return,$===null)throw Error(s(341));$.lanes|=c,S=$.alternate,S!==null&&(S.lanes|=c),gd($,c,t),$=null}else $=_.child;if($!==null)$.return=_;else for($=_;$!==null;){if($===t){$=null;break}if(_=$.sibling,_!==null){_.return=$.return,$=_;break}$=$.return}_=$}}function xa(t,i,c,m){t=null;for(var _=i,S=!1;_!==null;){if(!S){if((_.flags&524288)!==0)S=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var $=_.alternate;if($===null)throw Error(s(387));if($=$.memoizedProps,$!==null){var U=_.type;gn(_.pendingProps.value,$.value)||(t!==null?t.push(U):t=[U])}}else if(_===oe.current){if($=_.alternate,$===null)throw Error(s(387));$.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(t!==null?t.push(Eu):t=[Eu])}_=_.return}t!==null&&yd(i,t,c,m),i.flags|=262144}function tc(t){for(t=t.firstContext;t!==null;){if(!gn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function fs(t){cs=t,Or=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Pt(t){return c1(cs,t)}function nc(t,i){return cs===null&&fs(t),c1(t,i)}function c1(t,i){var c=i._currentValue;if(i={context:i,memoizedValue:c,next:null},Or===null){if(t===null)throw Error(s(308));Or=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else Or=Or.next=i;return c}var c3=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(c,m){t.push(m)}};this.abort=function(){i.aborted=!0,t.forEach(function(c){return c()})}},f3=e.unstable_scheduleCallback,h3=e.unstable_NormalPriority,Nt={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function vd(){return{controller:new c3,data:new Map,refCount:0}}function Xo(t){t.refCount--,t.refCount===0&&f3(h3,function(){t.controller.abort()})}var Wo=null,bd=0,Sa=0,Ta=null;function d3(t,i){if(Wo===null){var c=Wo=[];bd=0,Sa=Ep(),Ta={status:"pending",value:void 0,then:function(m){c.push(m)}}}return bd++,i.then(f1,f1),i}function f1(){if(--bd===0&&Wo!==null){Ta!==null&&(Ta.status="fulfilled");var t=Wo;Wo=null,Sa=0,Ta=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function p3(t,i){var c=[],m={status:"pending",value:null,reason:null,then:function(_){c.push(_)}};return t.then(function(){m.status="fulfilled",m.value=i;for(var _=0;_<c.length;_++)(0,c[_])(i)},function(_){for(m.status="rejected",m.reason=_,_=0;_<c.length;_++)(0,c[_])(void 0)}),m}var h1=L.S;L.S=function(t,i){YS=Oe(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&d3(t,i),h1!==null&&h1(t,i)};var hs=B(null);function _d(){var t=hs.current;return t!==null?t:ot.pooledCache}function rc(t,i){i===null?ne(hs,hs.current):ne(hs,i.pool)}function d1(){var t=_d();return t===null?null:{parent:Nt._currentValue,pool:t}}var qa=Error(s(460)),wd=Error(s(474)),ic=Error(s(542)),sc={then:function(){}};function p1(t){return t=t.status,t==="fulfilled"||t==="rejected"}function m1(t,i,c){switch(c=t[c],c===void 0?t.push(i):c!==i&&(i.then(qr,qr),i=c),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,y1(t),t;default:if(typeof i.status=="string")i.then(qr,qr);else{if(t=ot,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=i,t.status="pending",t.then(function(m){if(i.status==="pending"){var _=i;_.status="fulfilled",_.value=m}},function(m){if(i.status==="pending"){var _=i;_.status="rejected",_.reason=m}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,y1(t),t}throw ps=i,qa}}function ds(t){try{var i=t._init;return i(t._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(ps=c,qa):c}}var ps=null;function g1(){if(ps===null)throw Error(s(459));var t=ps;return ps=null,t}function y1(t){if(t===qa||t===ic)throw Error(s(483))}var Aa=null,Jo=0;function ac(t){var i=Jo;return Jo+=1,Aa===null&&(Aa=[]),m1(Aa,t,i)}function Zo(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function oc(t,i){throw i.$$typeof===g?Error(s(525)):(t=Object.prototype.toString.call(i),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function v1(t){function i(se,re){if(t){var ue=se.deletions;ue===null?(se.deletions=[re],se.flags|=16):ue.push(re)}}function c(se,re){if(!t)return null;for(;re!==null;)i(se,re),re=re.sibling;return null}function m(se){for(var re=new Map;se!==null;)se.key!==null?re.set(se.key,se):re.set(se.index,se),se=se.sibling;return re}function _(se,re){return se=Nr(se,re),se.index=0,se.sibling=null,se}function S(se,re,ue){return se.index=ue,t?(ue=se.alternate,ue!==null?(ue=ue.index,ue<re?(se.flags|=67108866,re):ue):(se.flags|=67108866,re)):(se.flags|=1048576,re)}function $(se){return t&&se.alternate===null&&(se.flags|=67108866),se}function U(se,re,ue,me){return re===null||re.tag!==6?(re=ld(ue,se.mode,me),re.return=se,re):(re=_(re,ue),re.return=se,re)}function Z(se,re,ue,me){var Re=ue.type;return Re===x?pe(se,re,ue.props.children,me,ue.key):re!==null&&(re.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===I&&ds(Re)===re.type)?(re=_(re,ue.props),Zo(re,ue),re.return=se,re):(re=Zl(ue.type,ue.key,ue.props,null,se.mode,me),Zo(re,ue),re.return=se,re)}function le(se,re,ue,me){return re===null||re.tag!==4||re.stateNode.containerInfo!==ue.containerInfo||re.stateNode.implementation!==ue.implementation?(re=cd(ue,se.mode,me),re.return=se,re):(re=_(re,ue.children||[]),re.return=se,re)}function pe(se,re,ue,me,Re){return re===null||re.tag!==7?(re=us(ue,se.mode,me,Re),re.return=se,re):(re=_(re,ue),re.return=se,re)}function ge(se,re,ue){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return re=ld(""+re,se.mode,ue),re.return=se,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case y:return ue=Zl(re.type,re.key,re.props,null,se.mode,ue),Zo(ue,re),ue.return=se,ue;case E:return re=cd(re,se.mode,ue),re.return=se,re;case I:return re=ds(re),ge(se,re,ue)}if(j(re)||D(re))return re=us(re,se.mode,ue,null),re.return=se,re;if(typeof re.then=="function")return ge(se,ac(re),ue);if(re.$$typeof===C)return ge(se,nc(se,re),ue);oc(se,re)}return null}function ce(se,re,ue,me){var Re=re!==null?re.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Re!==null?null:U(se,re,""+ue,me);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case y:return ue.key===Re?Z(se,re,ue,me):null;case E:return ue.key===Re?le(se,re,ue,me):null;case I:return ue=ds(ue),ce(se,re,ue,me)}if(j(ue)||D(ue))return Re!==null?null:pe(se,re,ue,me,null);if(typeof ue.then=="function")return ce(se,re,ac(ue),me);if(ue.$$typeof===C)return ce(se,re,nc(se,ue),me);oc(se,ue)}return null}function he(se,re,ue,me,Re){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return se=se.get(ue)||null,U(re,se,""+me,Re);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case y:return se=se.get(me.key===null?ue:me.key)||null,Z(re,se,me,Re);case E:return se=se.get(me.key===null?ue:me.key)||null,le(re,se,me,Re);case I:return me=ds(me),he(se,re,ue,me,Re)}if(j(me)||D(me))return se=se.get(ue)||null,pe(re,se,me,Re,null);if(typeof me.then=="function")return he(se,re,ue,ac(me),Re);if(me.$$typeof===C)return he(se,re,ue,nc(re,me),Re);oc(re,me)}return null}function Te(se,re,ue,me){for(var Re=null,Ge=null,Ae=re,ke=re=0,Ue=null;Ae!==null&&ke<ue.length;ke++){Ae.index>ke?(Ue=Ae,Ae=null):Ue=Ae.sibling;var Ke=ce(se,Ae,ue[ke],me);if(Ke===null){Ae===null&&(Ae=Ue);break}t&&Ae&&Ke.alternate===null&&i(se,Ae),re=S(Ke,re,ke),Ge===null?Re=Ke:Ge.sibling=Ke,Ge=Ke,Ae=Ue}if(ke===ue.length)return c(se,Ae),Qe&&Rr(se,ke),Re;if(Ae===null){for(;ke<ue.length;ke++)Ae=ge(se,ue[ke],me),Ae!==null&&(re=S(Ae,re,ke),Ge===null?Re=Ae:Ge.sibling=Ae,Ge=Ae);return Qe&&Rr(se,ke),Re}for(Ae=m(Ae);ke<ue.length;ke++)Ue=he(Ae,se,ke,ue[ke],me),Ue!==null&&(t&&Ue.alternate!==null&&Ae.delete(Ue.key===null?ke:Ue.key),re=S(Ue,re,ke),Ge===null?Re=Ue:Ge.sibling=Ue,Ge=Ue);return t&&Ae.forEach(function(Oi){return i(se,Oi)}),Qe&&Rr(se,ke),Re}function je(se,re,ue,me){if(ue==null)throw Error(s(151));for(var Re=null,Ge=null,Ae=re,ke=re=0,Ue=null,Ke=ue.next();Ae!==null&&!Ke.done;ke++,Ke=ue.next()){Ae.index>ke?(Ue=Ae,Ae=null):Ue=Ae.sibling;var Oi=ce(se,Ae,Ke.value,me);if(Oi===null){Ae===null&&(Ae=Ue);break}t&&Ae&&Oi.alternate===null&&i(se,Ae),re=S(Oi,re,ke),Ge===null?Re=Oi:Ge.sibling=Oi,Ge=Oi,Ae=Ue}if(Ke.done)return c(se,Ae),Qe&&Rr(se,ke),Re;if(Ae===null){for(;!Ke.done;ke++,Ke=ue.next())Ke=ge(se,Ke.value,me),Ke!==null&&(re=S(Ke,re,ke),Ge===null?Re=Ke:Ge.sibling=Ke,Ge=Ke);return Qe&&Rr(se,ke),Re}for(Ae=m(Ae);!Ke.done;ke++,Ke=ue.next())Ke=he(Ae,se,ke,Ke.value,me),Ke!==null&&(t&&Ke.alternate!==null&&Ae.delete(Ke.key===null?ke:Ke.key),re=S(Ke,re,ke),Ge===null?Re=Ke:Ge.sibling=Ke,Ge=Ke);return t&&Ae.forEach(function(Sz){return i(se,Sz)}),Qe&&Rr(se,ke),Re}function at(se,re,ue,me){if(typeof ue=="object"&&ue!==null&&ue.type===x&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case y:e:{for(var Re=ue.key;re!==null;){if(re.key===Re){if(Re=ue.type,Re===x){if(re.tag===7){c(se,re.sibling),me=_(re,ue.props.children),me.return=se,se=me;break e}}else if(re.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===I&&ds(Re)===re.type){c(se,re.sibling),me=_(re,ue.props),Zo(me,ue),me.return=se,se=me;break e}c(se,re);break}else i(se,re);re=re.sibling}ue.type===x?(me=us(ue.props.children,se.mode,me,ue.key),me.return=se,se=me):(me=Zl(ue.type,ue.key,ue.props,null,se.mode,me),Zo(me,ue),me.return=se,se=me)}return $(se);case E:e:{for(Re=ue.key;re!==null;){if(re.key===Re)if(re.tag===4&&re.stateNode.containerInfo===ue.containerInfo&&re.stateNode.implementation===ue.implementation){c(se,re.sibling),me=_(re,ue.children||[]),me.return=se,se=me;break e}else{c(se,re);break}else i(se,re);re=re.sibling}me=cd(ue,se.mode,me),me.return=se,se=me}return $(se);case I:return ue=ds(ue),at(se,re,ue,me)}if(j(ue))return Te(se,re,ue,me);if(D(ue)){if(Re=D(ue),typeof Re!="function")throw Error(s(150));return ue=Re.call(ue),je(se,re,ue,me)}if(typeof ue.then=="function")return at(se,re,ac(ue),me);if(ue.$$typeof===C)return at(se,re,nc(se,ue),me);oc(se,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,re!==null&&re.tag===6?(c(se,re.sibling),me=_(re,ue),me.return=se,se=me):(c(se,re),me=ld(ue,se.mode,me),me.return=se,se=me),$(se)):c(se,re)}return function(se,re,ue,me){try{Jo=0;var Re=at(se,re,ue,me);return Aa=null,Re}catch(Ae){if(Ae===qa||Ae===ic)throw Ae;var Ge=yn(29,Ae,null,se.mode);return Ge.lanes=me,Ge.return=se,Ge}finally{}}}var ms=v1(!0),b1=v1(!1),pi=!1;function Ed(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Cd(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function mi(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function gi(t,i,c){var m=t.updateQueue;if(m===null)return null;if(m=m.shared,(Je&2)!==0){var _=m.pending;return _===null?i.next=i:(i.next=_.next,_.next=i),m.pending=i,i=Jl(t),n1(t,null,c),i}return Wl(t,m,i,c),Jl(t)}function eu(t,i,c){if(i=i.updateQueue,i!==null&&(i=i.shared,(c&4194048)!==0)){var m=i.lanes;m&=t.pendingLanes,c|=m,i.lanes=c,Rl(t,c)}}function xd(t,i){var c=t.updateQueue,m=t.alternate;if(m!==null&&(m=m.updateQueue,c===m)){var _=null,S=null;if(c=c.firstBaseUpdate,c!==null){do{var $={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};S===null?_=S=$:S=S.next=$,c=c.next}while(c!==null);S===null?_=S=i:S=S.next=i}else _=S=i;c={baseState:m.baseState,firstBaseUpdate:_,lastBaseUpdate:S,shared:m.shared,callbacks:m.callbacks},t.updateQueue=c;return}t=c.lastBaseUpdate,t===null?c.firstBaseUpdate=i:t.next=i,c.lastBaseUpdate=i}var Sd=!1;function tu(){if(Sd){var t=Ta;if(t!==null)throw t}}function nu(t,i,c,m){Sd=!1;var _=t.updateQueue;pi=!1;var S=_.firstBaseUpdate,$=_.lastBaseUpdate,U=_.shared.pending;if(U!==null){_.shared.pending=null;var Z=U,le=Z.next;Z.next=null,$===null?S=le:$.next=le,$=Z;var pe=t.alternate;pe!==null&&(pe=pe.updateQueue,U=pe.lastBaseUpdate,U!==$&&(U===null?pe.firstBaseUpdate=le:U.next=le,pe.lastBaseUpdate=Z))}if(S!==null){var ge=_.baseState;$=0,pe=le=Z=null,U=S;do{var ce=U.lane&-536870913,he=ce!==U.lane;if(he?(ze&ce)===ce:(m&ce)===ce){ce!==0&&ce===Sa&&(Sd=!0),pe!==null&&(pe=pe.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var Te=t,je=U;ce=i;var at=c;switch(je.tag){case 1:if(Te=je.payload,typeof Te=="function"){ge=Te.call(at,ge,ce);break e}ge=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=je.payload,ce=typeof Te=="function"?Te.call(at,ge,ce):Te,ce==null)break e;ge=d({},ge,ce);break e;case 2:pi=!0}}ce=U.callback,ce!==null&&(t.flags|=64,he&&(t.flags|=8192),he=_.callbacks,he===null?_.callbacks=[ce]:he.push(ce))}else he={lane:ce,tag:U.tag,payload:U.payload,callback:U.callback,next:null},pe===null?(le=pe=he,Z=ge):pe=pe.next=he,$|=ce;if(U=U.next,U===null){if(U=_.shared.pending,U===null)break;he=U,U=he.next,he.next=null,_.lastBaseUpdate=he,_.shared.pending=null}}while(!0);pe===null&&(Z=ge),_.baseState=Z,_.firstBaseUpdate=le,_.lastBaseUpdate=pe,S===null&&(_.shared.lanes=0),wi|=$,t.lanes=$,t.memoizedState=ge}}function _1(t,i){if(typeof t!="function")throw Error(s(191,t));t.call(i)}function w1(t,i){var c=t.callbacks;if(c!==null)for(t.callbacks=null,t=0;t<c.length;t++)_1(c[t],i)}var Na=B(null),uc=B(0);function E1(t,i){t=zr,ne(uc,t),ne(Na,i),zr=t|i.baseLanes}function Td(){ne(uc,zr),ne(Na,Na.current)}function qd(){zr=uc.current,K(Na),K(uc)}var vn=B(null),jn=null;function yi(t){var i=t.alternate;ne(Ct,Ct.current&1),ne(vn,t),jn===null&&(i===null||Na.current!==null||i.memoizedState!==null)&&(jn=t)}function Ad(t){ne(Ct,Ct.current),ne(vn,t),jn===null&&(jn=t)}function C1(t){t.tag===22?(ne(Ct,Ct.current),ne(vn,t),jn===null&&(jn=t)):vi()}function vi(){ne(Ct,Ct.current),ne(vn,vn.current)}function bn(t){K(vn),jn===t&&(jn=null),K(Ct)}var Ct=B(0);function lc(t){for(var i=t;i!==null;){if(i.tag===13){var c=i.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Lp(c)||$p(c)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var jr=0,De=null,it=null,Rt=null,cc=!1,Ra=!1,gs=!1,fc=0,ru=0,Oa=null,m3=0;function bt(){throw Error(s(321))}function Nd(t,i){if(i===null)return!1;for(var c=0;c<i.length&&c<t.length;c++)if(!gn(t[c],i[c]))return!1;return!0}function Rd(t,i,c,m,_,S){return jr=S,De=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,L.H=t===null||t.memoizedState===null?aS:Vd,gs=!1,S=c(m,_),gs=!1,Ra&&(S=S1(i,c,m,_)),x1(t),S}function x1(t){L.H=au;var i=it!==null&&it.next!==null;if(jr=0,Rt=it=De=null,cc=!1,ru=0,Oa=null,i)throw Error(s(300));t===null||Ot||(t=t.dependencies,t!==null&&tc(t)&&(Ot=!0))}function S1(t,i,c,m){De=t;var _=0;do{if(Ra&&(Oa=null),ru=0,Ra=!1,25<=_)throw Error(s(301));if(_+=1,Rt=it=null,t.updateQueue!=null){var S=t.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}L.H=oS,S=i(c,m)}while(Ra);return S}function g3(){var t=L.H,i=t.useState()[0];return i=typeof i.then=="function"?iu(i):i,t=t.useState()[0],(it!==null?it.memoizedState:null)!==t&&(De.flags|=1024),i}function Od(){var t=fc!==0;return fc=0,t}function Md(t,i,c){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~c}function jd(t){if(cc){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}cc=!1}jr=0,Rt=it=De=null,Ra=!1,ru=fc=0,Oa=null}function Jt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?De.memoizedState=Rt=t:Rt=Rt.next=t,Rt}function xt(){if(it===null){var t=De.alternate;t=t!==null?t.memoizedState:null}else t=it.next;var i=Rt===null?De.memoizedState:Rt.next;if(i!==null)Rt=i,it=t;else{if(t===null)throw De.alternate===null?Error(s(467)):Error(s(310));it=t,t={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},Rt===null?De.memoizedState=Rt=t:Rt=Rt.next=t}return Rt}function hc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function iu(t){var i=ru;return ru+=1,Oa===null&&(Oa=[]),t=m1(Oa,t,i),i=De,(Rt===null?i.memoizedState:Rt.next)===null&&(i=i.alternate,L.H=i===null||i.memoizedState===null?aS:Vd),t}function dc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return iu(t);if(t.$$typeof===C)return Pt(t)}throw Error(s(438,String(t)))}function Ld(t){var i=null,c=De.updateQueue;if(c!==null&&(i=c.memoCache),i==null){var m=De.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(i={data:m.data.map(function(_){return _.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),c===null&&(c=hc(),De.updateQueue=c),c.memoCache=i,c=i.data[i.index],c===void 0)for(c=i.data[i.index]=Array(t),m=0;m<t;m++)c[m]=R;return i.index++,c}function Lr(t,i){return typeof i=="function"?i(t):i}function pc(t){var i=xt();return $d(i,it,t)}function $d(t,i,c){var m=t.queue;if(m===null)throw Error(s(311));m.lastRenderedReducer=c;var _=t.baseQueue,S=m.pending;if(S!==null){if(_!==null){var $=_.next;_.next=S.next,S.next=$}i.baseQueue=_=S,m.pending=null}if(S=t.baseState,_===null)t.memoizedState=S;else{i=_.next;var U=$=null,Z=null,le=i,pe=!1;do{var ge=le.lane&-536870913;if(ge!==le.lane?(ze&ge)===ge:(jr&ge)===ge){var ce=le.revertLane;if(ce===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),ge===Sa&&(pe=!0);else if((jr&ce)===ce){le=le.next,ce===Sa&&(pe=!0);continue}else ge={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},Z===null?(U=Z=ge,$=S):Z=Z.next=ge,De.lanes|=ce,wi|=ce;ge=le.action,gs&&c(S,ge),S=le.hasEagerState?le.eagerState:c(S,ge)}else ce={lane:ge,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},Z===null?(U=Z=ce,$=S):Z=Z.next=ce,De.lanes|=ge,wi|=ge;le=le.next}while(le!==null&&le!==i);if(Z===null?$=S:Z.next=U,!gn(S,t.memoizedState)&&(Ot=!0,pe&&(c=Ta,c!==null)))throw c;t.memoizedState=S,t.baseState=$,t.baseQueue=Z,m.lastRenderedState=S}return _===null&&(m.lanes=0),[t.memoizedState,m.dispatch]}function Id(t){var i=xt(),c=i.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=t;var m=c.dispatch,_=c.pending,S=i.memoizedState;if(_!==null){c.pending=null;var $=_=_.next;do S=t(S,$.action),$=$.next;while($!==_);gn(S,i.memoizedState)||(Ot=!0),i.memoizedState=S,i.baseQueue===null&&(i.baseState=S),c.lastRenderedState=S}return[S,m]}function T1(t,i,c){var m=De,_=xt(),S=Qe;if(S){if(c===void 0)throw Error(s(407));c=c()}else c=i();var $=!gn((it||_).memoizedState,c);if($&&(_.memoizedState=c,Ot=!0),_=_.queue,Bd(N1.bind(null,m,_,t),[t]),_.getSnapshot!==i||$||Rt!==null&&Rt.memoizedState.tag&1){if(m.flags|=2048,Ma(9,{destroy:void 0},A1.bind(null,m,_,c,i),null),ot===null)throw Error(s(349));S||(jr&127)!==0||q1(m,i,c)}return c}function q1(t,i,c){t.flags|=16384,t={getSnapshot:i,value:c},i=De.updateQueue,i===null?(i=hc(),De.updateQueue=i,i.stores=[t]):(c=i.stores,c===null?i.stores=[t]:c.push(t))}function A1(t,i,c,m){i.value=c,i.getSnapshot=m,R1(i)&&O1(t)}function N1(t,i,c){return c(function(){R1(i)&&O1(t)})}function R1(t){var i=t.getSnapshot;t=t.value;try{var c=i();return!gn(t,c)}catch{return!0}}function O1(t){var i=os(t,2);i!==null&&cn(i,t,2)}function Dd(t){var i=Jt();if(typeof t=="function"){var c=t;if(t=c(),gs){ar(!0);try{c()}finally{ar(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lr,lastRenderedState:t},i}function M1(t,i,c,m){return t.baseState=c,$d(t,it,typeof m=="function"?m:Lr)}function y3(t,i,c,m,_){if(yc(t))throw Error(s(485));if(t=i.action,t!==null){var S={payload:_,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function($){S.listeners.push($)}};L.T!==null?c(!0):S.isTransition=!1,m(S),c=i.pending,c===null?(S.next=i.pending=S,j1(i,S)):(S.next=c.next,i.pending=c.next=S)}}function j1(t,i){var c=i.action,m=i.payload,_=t.state;if(i.isTransition){var S=L.T,$={};L.T=$;try{var U=c(_,m),Z=L.S;Z!==null&&Z($,U),L1(t,i,U)}catch(le){kd(t,i,le)}finally{S!==null&&$.types!==null&&(S.types=$.types),L.T=S}}else try{S=c(_,m),L1(t,i,S)}catch(le){kd(t,i,le)}}function L1(t,i,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(m){$1(t,i,m)},function(m){return kd(t,i,m)}):$1(t,i,c)}function $1(t,i,c){i.status="fulfilled",i.value=c,I1(i),t.state=c,i=t.pending,i!==null&&(c=i.next,c===i?t.pending=null:(c=c.next,i.next=c,j1(t,c)))}function kd(t,i,c){var m=t.pending;if(t.pending=null,m!==null){m=m.next;do i.status="rejected",i.reason=c,I1(i),i=i.next;while(i!==m)}t.action=null}function I1(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function D1(t,i){return i}function k1(t,i){if(Qe){var c=ot.formState;if(c!==null){e:{var m=De;if(Qe){if(lt){t:{for(var _=lt,S=Mn;_.nodeType!==8;){if(!S){_=null;break t}if(_=Ln(_.nextSibling),_===null){_=null;break t}}S=_.data,_=S==="F!"||S==="F"?_:null}if(_){lt=Ln(_.nextSibling),m=_.data==="F!";break e}}hi(m)}m=!1}m&&(i=c[0])}}return c=Jt(),c.memoizedState=c.baseState=i,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:D1,lastRenderedState:i},c.queue=m,c=rS.bind(null,De,m),m.dispatch=c,m=Dd(!1),S=Hd.bind(null,De,!1,m.queue),m=Jt(),_={state:i,dispatch:null,action:t,pending:null},m.queue=_,c=y3.bind(null,De,_,S,c),_.dispatch=c,m.memoizedState=t,[i,c,!1]}function B1(t){var i=xt();return P1(i,it,t)}function P1(t,i,c){if(i=$d(t,i,D1)[0],t=pc(Lr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var m=iu(i)}catch($){throw $===qa?ic:$}else m=i;i=xt();var _=i.queue,S=_.dispatch;return c!==i.memoizedState&&(De.flags|=2048,Ma(9,{destroy:void 0},v3.bind(null,_,c),null)),[m,S,t]}function v3(t,i){t.action=i}function z1(t){var i=xt(),c=it;if(c!==null)return P1(i,c,t);xt(),i=i.memoizedState,c=xt();var m=c.queue.dispatch;return c.memoizedState=t,[i,m,!1]}function Ma(t,i,c,m){return t={tag:t,create:c,deps:m,inst:i,next:null},i=De.updateQueue,i===null&&(i=hc(),De.updateQueue=i),c=i.lastEffect,c===null?i.lastEffect=t.next=t:(m=c.next,c.next=t,t.next=m,i.lastEffect=t),t}function U1(){return xt().memoizedState}function mc(t,i,c,m){var _=Jt();De.flags|=t,_.memoizedState=Ma(1|i,{destroy:void 0},c,m===void 0?null:m)}function gc(t,i,c,m){var _=xt();m=m===void 0?null:m;var S=_.memoizedState.inst;it!==null&&m!==null&&Nd(m,it.memoizedState.deps)?_.memoizedState=Ma(i,S,c,m):(De.flags|=t,_.memoizedState=Ma(1|i,S,c,m))}function Q1(t,i){mc(8390656,8,t,i)}function Bd(t,i){gc(2048,8,t,i)}function b3(t){De.flags|=4;var i=De.updateQueue;if(i===null)i=hc(),De.updateQueue=i,i.events=[t];else{var c=i.events;c===null?i.events=[t]:c.push(t)}}function H1(t){var i=xt().memoizedState;return b3({ref:i,nextImpl:t}),function(){if((Je&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}function V1(t,i){return gc(4,2,t,i)}function F1(t,i){return gc(4,4,t,i)}function G1(t,i){if(typeof i=="function"){t=t();var c=i(t);return function(){typeof c=="function"?c():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function K1(t,i,c){c=c!=null?c.concat([t]):null,gc(4,4,G1.bind(null,i,t),c)}function Pd(){}function Y1(t,i){var c=xt();i=i===void 0?null:i;var m=c.memoizedState;return i!==null&&Nd(i,m[1])?m[0]:(c.memoizedState=[t,i],t)}function X1(t,i){var c=xt();i=i===void 0?null:i;var m=c.memoizedState;if(i!==null&&Nd(i,m[1]))return m[0];if(m=t(),gs){ar(!0);try{t()}finally{ar(!1)}}return c.memoizedState=[m,i],m}function zd(t,i,c){return c===void 0||(jr&1073741824)!==0&&(ze&261930)===0?t.memoizedState=i:(t.memoizedState=c,t=WS(),De.lanes|=t,wi|=t,c)}function W1(t,i,c,m){return gn(c,i)?c:Na.current!==null?(t=zd(t,c,m),gn(t,i)||(Ot=!0),t):(jr&42)===0||(jr&1073741824)!==0&&(ze&261930)===0?(Ot=!0,t.memoizedState=c):(t=WS(),De.lanes|=t,wi|=t,i)}function J1(t,i,c,m,_){var S=P.p;P.p=S!==0&&8>S?S:8;var $=L.T,U={};L.T=U,Hd(t,!1,i,c);try{var Z=_(),le=L.S;if(le!==null&&le(U,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var pe=p3(Z,m);su(t,i,pe,En(t))}else su(t,i,m,En(t))}catch(ge){su(t,i,{then:function(){},status:"rejected",reason:ge},En())}finally{P.p=S,$!==null&&U.types!==null&&($.types=U.types),L.T=$}}function _3(){}function Ud(t,i,c,m){if(t.tag!==5)throw Error(s(476));var _=Z1(t).queue;J1(t,_,i,H,c===null?_3:function(){return eS(t),c(m)})}function Z1(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lr,lastRenderedState:H},next:null};var c={};return i.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lr,lastRenderedState:c},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function eS(t){var i=Z1(t);i.next===null&&(i=t.alternate.memoizedState),su(t,i.next.queue,{},En())}function Qd(){return Pt(Eu)}function tS(){return xt().memoizedState}function nS(){return xt().memoizedState}function w3(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var c=En();t=mi(c);var m=gi(i,t,c);m!==null&&(cn(m,i,c),eu(m,i,c)),i={cache:vd()},t.payload=i;return}i=i.return}}function E3(t,i,c){var m=En();c={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},yc(t)?iS(i,c):(c=od(t,i,c,m),c!==null&&(cn(c,t,m),sS(c,i,m)))}function rS(t,i,c){var m=En();su(t,i,c,m)}function su(t,i,c,m){var _={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(yc(t))iS(i,_);else{var S=t.alternate;if(t.lanes===0&&(S===null||S.lanes===0)&&(S=i.lastRenderedReducer,S!==null))try{var $=i.lastRenderedState,U=S($,c);if(_.hasEagerState=!0,_.eagerState=U,gn(U,$))return Wl(t,i,_,0),ot===null&&Xl(),!1}catch{}finally{}if(c=od(t,i,_,m),c!==null)return cn(c,t,m),sS(c,i,m),!0}return!1}function Hd(t,i,c,m){if(m={lane:2,revertLane:Ep(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},yc(t)){if(i)throw Error(s(479))}else i=od(t,c,m,2),i!==null&&cn(i,t,2)}function yc(t){var i=t.alternate;return t===De||i!==null&&i===De}function iS(t,i){Ra=cc=!0;var c=t.pending;c===null?i.next=i:(i.next=c.next,c.next=i),t.pending=i}function sS(t,i,c){if((c&4194048)!==0){var m=i.lanes;m&=t.pendingLanes,c|=m,i.lanes=c,Rl(t,c)}}var au={readContext:Pt,use:dc,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useLayoutEffect:bt,useInsertionEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useSyncExternalStore:bt,useId:bt,useHostTransitionStatus:bt,useFormState:bt,useActionState:bt,useOptimistic:bt,useMemoCache:bt,useCacheRefresh:bt};au.useEffectEvent=bt;var aS={readContext:Pt,use:dc,useCallback:function(t,i){return Jt().memoizedState=[t,i===void 0?null:i],t},useContext:Pt,useEffect:Q1,useImperativeHandle:function(t,i,c){c=c!=null?c.concat([t]):null,mc(4194308,4,G1.bind(null,i,t),c)},useLayoutEffect:function(t,i){return mc(4194308,4,t,i)},useInsertionEffect:function(t,i){mc(4,2,t,i)},useMemo:function(t,i){var c=Jt();i=i===void 0?null:i;var m=t();if(gs){ar(!0);try{t()}finally{ar(!1)}}return c.memoizedState=[m,i],m},useReducer:function(t,i,c){var m=Jt();if(c!==void 0){var _=c(i);if(gs){ar(!0);try{c(i)}finally{ar(!1)}}}else _=i;return m.memoizedState=m.baseState=_,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:_},m.queue=t,t=t.dispatch=E3.bind(null,De,t),[m.memoizedState,t]},useRef:function(t){var i=Jt();return t={current:t},i.memoizedState=t},useState:function(t){t=Dd(t);var i=t.queue,c=rS.bind(null,De,i);return i.dispatch=c,[t.memoizedState,c]},useDebugValue:Pd,useDeferredValue:function(t,i){var c=Jt();return zd(c,t,i)},useTransition:function(){var t=Dd(!1);return t=J1.bind(null,De,t.queue,!0,!1),Jt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,c){var m=De,_=Jt();if(Qe){if(c===void 0)throw Error(s(407));c=c()}else{if(c=i(),ot===null)throw Error(s(349));(ze&127)!==0||q1(m,i,c)}_.memoizedState=c;var S={value:c,getSnapshot:i};return _.queue=S,Q1(N1.bind(null,m,S,t),[t]),m.flags|=2048,Ma(9,{destroy:void 0},A1.bind(null,m,S,c,i),null),c},useId:function(){var t=Jt(),i=ot.identifierPrefix;if(Qe){var c=lr,m=ur;c=(m&~(1<<32-Wt(m)-1)).toString(32)+c,i="_"+i+"R_"+c,c=fc++,0<c&&(i+="H"+c.toString(32)),i+="_"}else c=m3++,i="_"+i+"r_"+c.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:Qd,useFormState:k1,useActionState:k1,useOptimistic:function(t){var i=Jt();i.memoizedState=i.baseState=t;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=c,i=Hd.bind(null,De,!0,c),c.dispatch=i,[t,i]},useMemoCache:Ld,useCacheRefresh:function(){return Jt().memoizedState=w3.bind(null,De)},useEffectEvent:function(t){var i=Jt(),c={impl:t};return i.memoizedState=c,function(){if((Je&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},Vd={readContext:Pt,use:dc,useCallback:Y1,useContext:Pt,useEffect:Bd,useImperativeHandle:K1,useInsertionEffect:V1,useLayoutEffect:F1,useMemo:X1,useReducer:pc,useRef:U1,useState:function(){return pc(Lr)},useDebugValue:Pd,useDeferredValue:function(t,i){var c=xt();return W1(c,it.memoizedState,t,i)},useTransition:function(){var t=pc(Lr)[0],i=xt().memoizedState;return[typeof t=="boolean"?t:iu(t),i]},useSyncExternalStore:T1,useId:tS,useHostTransitionStatus:Qd,useFormState:B1,useActionState:B1,useOptimistic:function(t,i){var c=xt();return M1(c,it,t,i)},useMemoCache:Ld,useCacheRefresh:nS};Vd.useEffectEvent=H1;var oS={readContext:Pt,use:dc,useCallback:Y1,useContext:Pt,useEffect:Bd,useImperativeHandle:K1,useInsertionEffect:V1,useLayoutEffect:F1,useMemo:X1,useReducer:Id,useRef:U1,useState:function(){return Id(Lr)},useDebugValue:Pd,useDeferredValue:function(t,i){var c=xt();return it===null?zd(c,t,i):W1(c,it.memoizedState,t,i)},useTransition:function(){var t=Id(Lr)[0],i=xt().memoizedState;return[typeof t=="boolean"?t:iu(t),i]},useSyncExternalStore:T1,useId:tS,useHostTransitionStatus:Qd,useFormState:z1,useActionState:z1,useOptimistic:function(t,i){var c=xt();return it!==null?M1(c,it,t,i):(c.baseState=t,[t,c.queue.dispatch])},useMemoCache:Ld,useCacheRefresh:nS};oS.useEffectEvent=H1;function Fd(t,i,c,m){i=t.memoizedState,c=c(m,i),c=c==null?i:d({},i,c),t.memoizedState=c,t.lanes===0&&(t.updateQueue.baseState=c)}var Gd={enqueueSetState:function(t,i,c){t=t._reactInternals;var m=En(),_=mi(m);_.payload=i,c!=null&&(_.callback=c),i=gi(t,_,m),i!==null&&(cn(i,t,m),eu(i,t,m))},enqueueReplaceState:function(t,i,c){t=t._reactInternals;var m=En(),_=mi(m);_.tag=1,_.payload=i,c!=null&&(_.callback=c),i=gi(t,_,m),i!==null&&(cn(i,t,m),eu(i,t,m))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var c=En(),m=mi(c);m.tag=2,i!=null&&(m.callback=i),i=gi(t,m,c),i!==null&&(cn(i,t,c),eu(i,t,c))}};function uS(t,i,c,m,_,S,$){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(m,S,$):i.prototype&&i.prototype.isPureReactComponent?!Fo(c,m)||!Fo(_,S):!0}function lS(t,i,c,m){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(c,m),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(c,m),i.state!==t&&Gd.enqueueReplaceState(i,i.state,null)}function ys(t,i){var c=i;if("ref"in i){c={};for(var m in i)m!=="ref"&&(c[m]=i[m])}if(t=t.defaultProps){c===i&&(c=d({},c));for(var _ in t)c[_]===void 0&&(c[_]=t[_])}return c}function cS(t){Yl(t)}function fS(t){console.error(t)}function hS(t){Yl(t)}function vc(t,i){try{var c=t.onUncaughtError;c(i.value,{componentStack:i.stack})}catch(m){setTimeout(function(){throw m})}}function dS(t,i,c){try{var m=t.onCaughtError;m(c.value,{componentStack:c.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function Kd(t,i,c){return c=mi(c),c.tag=3,c.payload={element:null},c.callback=function(){vc(t,i)},c}function pS(t){return t=mi(t),t.tag=3,t}function mS(t,i,c,m){var _=c.type.getDerivedStateFromError;if(typeof _=="function"){var S=m.value;t.payload=function(){return _(S)},t.callback=function(){dS(i,c,m)}}var $=c.stateNode;$!==null&&typeof $.componentDidCatch=="function"&&(t.callback=function(){dS(i,c,m),typeof _!="function"&&(Ei===null?Ei=new Set([this]):Ei.add(this));var U=m.stack;this.componentDidCatch(m.value,{componentStack:U!==null?U:""})})}function C3(t,i,c,m,_){if(c.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(i=c.alternate,i!==null&&xa(i,c,_,!0),c=vn.current,c!==null){switch(c.tag){case 31:case 13:return jn===null?Rc():c.alternate===null&&_t===0&&(_t=3),c.flags&=-257,c.flags|=65536,c.lanes=_,m===sc?c.flags|=16384:(i=c.updateQueue,i===null?c.updateQueue=new Set([m]):i.add(m),bp(t,m,_)),!1;case 22:return c.flags|=65536,m===sc?c.flags|=16384:(i=c.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([m])},c.updateQueue=i):(c=i.retryQueue,c===null?i.retryQueue=new Set([m]):c.add(m)),bp(t,m,_)),!1}throw Error(s(435,c.tag))}return bp(t,m,_),Rc(),!1}if(Qe)return i=vn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=_,m!==dd&&(t=Error(s(422),{cause:m}),Yo(Nn(t,c)))):(m!==dd&&(i=Error(s(423),{cause:m}),Yo(Nn(i,c))),t=t.current.alternate,t.flags|=65536,_&=-_,t.lanes|=_,m=Nn(m,c),_=Kd(t.stateNode,m,_),xd(t,_),_t!==4&&(_t=2)),!1;var S=Error(s(520),{cause:m});if(S=Nn(S,c),pu===null?pu=[S]:pu.push(S),_t!==4&&(_t=2),i===null)return!0;m=Nn(m,c),c=i;do{switch(c.tag){case 3:return c.flags|=65536,t=_&-_,c.lanes|=t,t=Kd(c.stateNode,m,t),xd(c,t),!1;case 1:if(i=c.type,S=c.stateNode,(c.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Ei===null||!Ei.has(S))))return c.flags|=65536,_&=-_,c.lanes|=_,_=pS(_),mS(_,t,c,m),xd(c,_),!1}c=c.return}while(c!==null);return!1}var Yd=Error(s(461)),Ot=!1;function zt(t,i,c,m){i.child=t===null?b1(i,null,c,m):ms(i,t.child,c,m)}function gS(t,i,c,m,_){c=c.render;var S=i.ref;if("ref"in m){var $={};for(var U in m)U!=="ref"&&($[U]=m[U])}else $=m;return fs(i),m=Rd(t,i,c,$,S,_),U=Od(),t!==null&&!Ot?(Md(t,i,_),$r(t,i,_)):(Qe&&U&&fd(i),i.flags|=1,zt(t,i,m,_),i.child)}function yS(t,i,c,m,_){if(t===null){var S=c.type;return typeof S=="function"&&!ud(S)&&S.defaultProps===void 0&&c.compare===null?(i.tag=15,i.type=S,vS(t,i,S,m,_)):(t=Zl(c.type,null,m,i,i.mode,_),t.ref=i.ref,t.return=i,i.child=t)}if(S=t.child,!rp(t,_)){var $=S.memoizedProps;if(c=c.compare,c=c!==null?c:Fo,c($,m)&&t.ref===i.ref)return $r(t,i,_)}return i.flags|=1,t=Nr(S,m),t.ref=i.ref,t.return=i,i.child=t}function vS(t,i,c,m,_){if(t!==null){var S=t.memoizedProps;if(Fo(S,m)&&t.ref===i.ref)if(Ot=!1,i.pendingProps=m=S,rp(t,_))(t.flags&131072)!==0&&(Ot=!0);else return i.lanes=t.lanes,$r(t,i,_)}return Xd(t,i,c,m,_)}function bS(t,i,c,m){var _=m.children,S=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((i.flags&128)!==0){if(S=S!==null?S.baseLanes|c:c,t!==null){for(m=i.child=t.child,_=0;m!==null;)_=_|m.lanes|m.childLanes,m=m.sibling;m=_&~S}else m=0,i.child=null;return _S(t,i,S,c,m)}if((c&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&rc(i,S!==null?S.cachePool:null),S!==null?E1(i,S):Td(),C1(i);else return m=i.lanes=536870912,_S(t,i,S!==null?S.baseLanes|c:c,c,m)}else S!==null?(rc(i,S.cachePool),E1(i,S),vi(),i.memoizedState=null):(t!==null&&rc(i,null),Td(),vi());return zt(t,i,_,c),i.child}function ou(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function _S(t,i,c,m,_){var S=_d();return S=S===null?null:{parent:Nt._currentValue,pool:S},i.memoizedState={baseLanes:c,cachePool:S},t!==null&&rc(i,null),Td(),C1(i),t!==null&&xa(t,i,m,!0),i.childLanes=_,null}function bc(t,i){return i=wc({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function wS(t,i,c){return ms(i,t.child,null,c),t=bc(i,i.pendingProps),t.flags|=2,bn(i),i.memoizedState=null,t}function x3(t,i,c){var m=i.pendingProps,_=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(Qe){if(m.mode==="hidden")return t=bc(i,m),i.lanes=536870912,ou(null,t);if(Ad(i),(t=lt)?(t=jT(t,Mn),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:ci!==null?{id:ur,overflow:lr}:null,retryLane:536870912,hydrationErrors:null},c=i1(t),c.return=i,i.child=c,Bt=i,lt=null)):t=null,t===null)throw hi(i);return i.lanes=536870912,null}return bc(i,m)}var S=t.memoizedState;if(S!==null){var $=S.dehydrated;if(Ad(i),_)if(i.flags&256)i.flags&=-257,i=wS(t,i,c);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(s(558));else if(Ot||xa(t,i,c,!1),_=(c&t.childLanes)!==0,Ot||_){if(m=ot,m!==null&&($=Ol(m,c),$!==0&&$!==S.retryLane))throw S.retryLane=$,os(t,$),cn(m,t,$),Yd;Rc(),i=wS(t,i,c)}else t=S.treeContext,lt=Ln($.nextSibling),Bt=i,Qe=!0,fi=null,Mn=!1,t!==null&&o1(i,t),i=bc(i,m),i.flags|=4096;return i}return t=Nr(t.child,{mode:m.mode,children:m.children}),t.ref=i.ref,i.child=t,t.return=i,t}function _c(t,i){var c=i.ref;if(c===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(s(284));(t===null||t.ref!==c)&&(i.flags|=4194816)}}function Xd(t,i,c,m,_){return fs(i),c=Rd(t,i,c,m,void 0,_),m=Od(),t!==null&&!Ot?(Md(t,i,_),$r(t,i,_)):(Qe&&m&&fd(i),i.flags|=1,zt(t,i,c,_),i.child)}function ES(t,i,c,m,_,S){return fs(i),i.updateQueue=null,c=S1(i,m,c,_),x1(t),m=Od(),t!==null&&!Ot?(Md(t,i,S),$r(t,i,S)):(Qe&&m&&fd(i),i.flags|=1,zt(t,i,c,S),i.child)}function CS(t,i,c,m,_){if(fs(i),i.stateNode===null){var S=_a,$=c.contextType;typeof $=="object"&&$!==null&&(S=Pt($)),S=new c(m,S),i.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=Gd,i.stateNode=S,S._reactInternals=i,S=i.stateNode,S.props=m,S.state=i.memoizedState,S.refs={},Ed(i),$=c.contextType,S.context=typeof $=="object"&&$!==null?Pt($):_a,S.state=i.memoizedState,$=c.getDerivedStateFromProps,typeof $=="function"&&(Fd(i,c,$,m),S.state=i.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||($=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),$!==S.state&&Gd.enqueueReplaceState(S,S.state,null),nu(i,m,S,_),tu(),S.state=i.memoizedState),typeof S.componentDidMount=="function"&&(i.flags|=4194308),m=!0}else if(t===null){S=i.stateNode;var U=i.memoizedProps,Z=ys(c,U);S.props=Z;var le=S.context,pe=c.contextType;$=_a,typeof pe=="object"&&pe!==null&&($=Pt(pe));var ge=c.getDerivedStateFromProps;pe=typeof ge=="function"||typeof S.getSnapshotBeforeUpdate=="function",U=i.pendingProps!==U,pe||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(U||le!==$)&&lS(i,S,m,$),pi=!1;var ce=i.memoizedState;S.state=ce,nu(i,m,S,_),tu(),le=i.memoizedState,U||ce!==le||pi?(typeof ge=="function"&&(Fd(i,c,ge,m),le=i.memoizedState),(Z=pi||uS(i,c,Z,m,ce,le,$))?(pe||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(i.flags|=4194308)):(typeof S.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=m,i.memoizedState=le),S.props=m,S.state=le,S.context=$,m=Z):(typeof S.componentDidMount=="function"&&(i.flags|=4194308),m=!1)}else{S=i.stateNode,Cd(t,i),$=i.memoizedProps,pe=ys(c,$),S.props=pe,ge=i.pendingProps,ce=S.context,le=c.contextType,Z=_a,typeof le=="object"&&le!==null&&(Z=Pt(le)),U=c.getDerivedStateFromProps,(le=typeof U=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||($!==ge||ce!==Z)&&lS(i,S,m,Z),pi=!1,ce=i.memoizedState,S.state=ce,nu(i,m,S,_),tu();var he=i.memoizedState;$!==ge||ce!==he||pi||t!==null&&t.dependencies!==null&&tc(t.dependencies)?(typeof U=="function"&&(Fd(i,c,U,m),he=i.memoizedState),(pe=pi||uS(i,c,pe,m,ce,he,Z)||t!==null&&t.dependencies!==null&&tc(t.dependencies))?(le||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(m,he,Z),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(m,he,Z)),typeof S.componentDidUpdate=="function"&&(i.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof S.componentDidUpdate!="function"||$===t.memoizedProps&&ce===t.memoizedState||(i.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||$===t.memoizedProps&&ce===t.memoizedState||(i.flags|=1024),i.memoizedProps=m,i.memoizedState=he),S.props=m,S.state=he,S.context=Z,m=pe):(typeof S.componentDidUpdate!="function"||$===t.memoizedProps&&ce===t.memoizedState||(i.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||$===t.memoizedProps&&ce===t.memoizedState||(i.flags|=1024),m=!1)}return S=m,_c(t,i),m=(i.flags&128)!==0,S||m?(S=i.stateNode,c=m&&typeof c.getDerivedStateFromError!="function"?null:S.render(),i.flags|=1,t!==null&&m?(i.child=ms(i,t.child,null,_),i.child=ms(i,null,c,_)):zt(t,i,c,_),i.memoizedState=S.state,t=i.child):t=$r(t,i,_),t}function xS(t,i,c,m){return ls(),i.flags|=256,zt(t,i,c,m),i.child}var Wd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jd(t){return{baseLanes:t,cachePool:d1()}}function Zd(t,i,c){return t=t!==null?t.childLanes&~c:0,i&&(t|=wn),t}function SS(t,i,c){var m=i.pendingProps,_=!1,S=(i.flags&128)!==0,$;if(($=S)||($=t!==null&&t.memoizedState===null?!1:(Ct.current&2)!==0),$&&(_=!0,i.flags&=-129),$=(i.flags&32)!==0,i.flags&=-33,t===null){if(Qe){if(_?yi(i):vi(),(t=lt)?(t=jT(t,Mn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:ci!==null?{id:ur,overflow:lr}:null,retryLane:536870912,hydrationErrors:null},c=i1(t),c.return=i,i.child=c,Bt=i,lt=null)):t=null,t===null)throw hi(i);return $p(t)?i.lanes=32:i.lanes=536870912,null}var U=m.children;return m=m.fallback,_?(vi(),_=i.mode,U=wc({mode:"hidden",children:U},_),m=us(m,_,c,null),U.return=i,m.return=i,U.sibling=m,i.child=U,m=i.child,m.memoizedState=Jd(c),m.childLanes=Zd(t,$,c),i.memoizedState=Wd,ou(null,m)):(yi(i),ep(i,U))}var Z=t.memoizedState;if(Z!==null&&(U=Z.dehydrated,U!==null)){if(S)i.flags&256?(yi(i),i.flags&=-257,i=tp(t,i,c)):i.memoizedState!==null?(vi(),i.child=t.child,i.flags|=128,i=null):(vi(),U=m.fallback,_=i.mode,m=wc({mode:"visible",children:m.children},_),U=us(U,_,c,null),U.flags|=2,m.return=i,U.return=i,m.sibling=U,i.child=m,ms(i,t.child,null,c),m=i.child,m.memoizedState=Jd(c),m.childLanes=Zd(t,$,c),i.memoizedState=Wd,i=ou(null,m));else if(yi(i),$p(U)){if($=U.nextSibling&&U.nextSibling.dataset,$)var le=$.dgst;$=le,m=Error(s(419)),m.stack="",m.digest=$,Yo({value:m,source:null,stack:null}),i=tp(t,i,c)}else if(Ot||xa(t,i,c,!1),$=(c&t.childLanes)!==0,Ot||$){if($=ot,$!==null&&(m=Ol($,c),m!==0&&m!==Z.retryLane))throw Z.retryLane=m,os(t,m),cn($,t,m),Yd;Lp(U)||Rc(),i=tp(t,i,c)}else Lp(U)?(i.flags|=192,i.child=t.child,i=null):(t=Z.treeContext,lt=Ln(U.nextSibling),Bt=i,Qe=!0,fi=null,Mn=!1,t!==null&&o1(i,t),i=ep(i,m.children),i.flags|=4096);return i}return _?(vi(),U=m.fallback,_=i.mode,Z=t.child,le=Z.sibling,m=Nr(Z,{mode:"hidden",children:m.children}),m.subtreeFlags=Z.subtreeFlags&65011712,le!==null?U=Nr(le,U):(U=us(U,_,c,null),U.flags|=2),U.return=i,m.return=i,m.sibling=U,i.child=m,ou(null,m),m=i.child,U=t.child.memoizedState,U===null?U=Jd(c):(_=U.cachePool,_!==null?(Z=Nt._currentValue,_=_.parent!==Z?{parent:Z,pool:Z}:_):_=d1(),U={baseLanes:U.baseLanes|c,cachePool:_}),m.memoizedState=U,m.childLanes=Zd(t,$,c),i.memoizedState=Wd,ou(t.child,m)):(yi(i),c=t.child,t=c.sibling,c=Nr(c,{mode:"visible",children:m.children}),c.return=i,c.sibling=null,t!==null&&($=i.deletions,$===null?(i.deletions=[t],i.flags|=16):$.push(t)),i.child=c,i.memoizedState=null,c)}function ep(t,i){return i=wc({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function wc(t,i){return t=yn(22,t,null,i),t.lanes=0,t}function tp(t,i,c){return ms(i,t.child,null,c),t=ep(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function TS(t,i,c){t.lanes|=i;var m=t.alternate;m!==null&&(m.lanes|=i),gd(t.return,i,c)}function np(t,i,c,m,_,S){var $=t.memoizedState;$===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:m,tail:c,tailMode:_,treeForkCount:S}:($.isBackwards=i,$.rendering=null,$.renderingStartTime=0,$.last=m,$.tail=c,$.tailMode=_,$.treeForkCount=S)}function qS(t,i,c){var m=i.pendingProps,_=m.revealOrder,S=m.tail;m=m.children;var $=Ct.current,U=($&2)!==0;if(U?($=$&1|2,i.flags|=128):$&=1,ne(Ct,$),zt(t,i,m,c),m=Qe?Ko:0,!U&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&TS(t,c,i);else if(t.tag===19)TS(t,c,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(_){case"forwards":for(c=i.child,_=null;c!==null;)t=c.alternate,t!==null&&lc(t)===null&&(_=c),c=c.sibling;c=_,c===null?(_=i.child,i.child=null):(_=c.sibling,c.sibling=null),np(i,!1,_,c,S,m);break;case"backwards":case"unstable_legacy-backwards":for(c=null,_=i.child,i.child=null;_!==null;){if(t=_.alternate,t!==null&&lc(t)===null){i.child=_;break}t=_.sibling,_.sibling=c,c=_,_=t}np(i,!0,c,null,S,m);break;case"together":np(i,!1,null,null,void 0,m);break;default:i.memoizedState=null}return i.child}function $r(t,i,c){if(t!==null&&(i.dependencies=t.dependencies),wi|=i.lanes,(c&i.childLanes)===0)if(t!==null){if(xa(t,i,c,!1),(c&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(s(153));if(i.child!==null){for(t=i.child,c=Nr(t,t.pendingProps),i.child=c,c.return=i;t.sibling!==null;)t=t.sibling,c=c.sibling=Nr(t,t.pendingProps),c.return=i;c.sibling=null}return i.child}function rp(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&tc(t)))}function S3(t,i,c){switch(i.tag){case 3:ee(i,i.stateNode.containerInfo),di(i,Nt,t.memoizedState.cache),ls();break;case 27:case 5:be(i);break;case 4:ee(i,i.stateNode.containerInfo);break;case 10:di(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Ad(i),null;break;case 13:var m=i.memoizedState;if(m!==null)return m.dehydrated!==null?(yi(i),i.flags|=128,null):(c&i.child.childLanes)!==0?SS(t,i,c):(yi(i),t=$r(t,i,c),t!==null?t.sibling:null);yi(i);break;case 19:var _=(t.flags&128)!==0;if(m=(c&i.childLanes)!==0,m||(xa(t,i,c,!1),m=(c&i.childLanes)!==0),_){if(m)return qS(t,i,c);i.flags|=128}if(_=i.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),ne(Ct,Ct.current),m)break;return null;case 22:return i.lanes=0,bS(t,i,c,i.pendingProps);case 24:di(i,Nt,t.memoizedState.cache)}return $r(t,i,c)}function AS(t,i,c){if(t!==null)if(t.memoizedProps!==i.pendingProps)Ot=!0;else{if(!rp(t,c)&&(i.flags&128)===0)return Ot=!1,S3(t,i,c);Ot=(t.flags&131072)!==0}else Ot=!1,Qe&&(i.flags&1048576)!==0&&a1(i,Ko,i.index);switch(i.lanes=0,i.tag){case 16:e:{var m=i.pendingProps;if(t=ds(i.elementType),i.type=t,typeof t=="function")ud(t)?(m=ys(t,m),i.tag=1,i=CS(null,i,t,m,c)):(i.tag=0,i=Xd(null,i,t,m,c));else{if(t!=null){var _=t.$$typeof;if(_===T){i.tag=11,i=gS(null,i,t,m,c);break e}else if(_===O){i.tag=14,i=yS(null,i,t,m,c);break e}}throw i=q(t)||t,Error(s(306,i,""))}}return i;case 0:return Xd(t,i,i.type,i.pendingProps,c);case 1:return m=i.type,_=ys(m,i.pendingProps),CS(t,i,m,_,c);case 3:e:{if(ee(i,i.stateNode.containerInfo),t===null)throw Error(s(387));m=i.pendingProps;var S=i.memoizedState;_=S.element,Cd(t,i),nu(i,m,null,c);var $=i.memoizedState;if(m=$.cache,di(i,Nt,m),m!==S.cache&&yd(i,[Nt],c,!0),tu(),m=$.element,S.isDehydrated)if(S={element:m,isDehydrated:!1,cache:$.cache},i.updateQueue.baseState=S,i.memoizedState=S,i.flags&256){i=xS(t,i,m,c);break e}else if(m!==_){_=Nn(Error(s(424)),i),Yo(_),i=xS(t,i,m,c);break e}else{switch(t=i.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(lt=Ln(t.firstChild),Bt=i,Qe=!0,fi=null,Mn=!0,c=b1(i,null,m,c),i.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(ls(),m===_){i=$r(t,i,c);break e}zt(t,i,m,c)}i=i.child}return i;case 26:return _c(t,i),t===null?(c=BT(i.type,null,i.pendingProps,null))?i.memoizedState=c:Qe||(c=i.type,t=i.pendingProps,m=Dc(ie.current).createElement(c),m[Lt]=i,m[Gt]=t,Ut(m,c,t),At(m),i.stateNode=m):i.memoizedState=BT(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return be(i),t===null&&Qe&&(m=i.stateNode=IT(i.type,i.pendingProps,ie.current),Bt=i,Mn=!0,_=lt,Ti(i.type)?(Ip=_,lt=Ln(m.firstChild)):lt=_),zt(t,i,i.pendingProps.children,c),_c(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&Qe&&((_=m=lt)&&(m=tz(m,i.type,i.pendingProps,Mn),m!==null?(i.stateNode=m,Bt=i,lt=Ln(m.firstChild),Mn=!1,_=!0):_=!1),_||hi(i)),be(i),_=i.type,S=i.pendingProps,$=t!==null?t.memoizedProps:null,m=S.children,Op(_,S)?m=null:$!==null&&Op(_,$)&&(i.flags|=32),i.memoizedState!==null&&(_=Rd(t,i,g3,null,null,c),Eu._currentValue=_),_c(t,i),zt(t,i,m,c),i.child;case 6:return t===null&&Qe&&((t=c=lt)&&(c=nz(c,i.pendingProps,Mn),c!==null?(i.stateNode=c,Bt=i,lt=null,t=!0):t=!1),t||hi(i)),null;case 13:return SS(t,i,c);case 4:return ee(i,i.stateNode.containerInfo),m=i.pendingProps,t===null?i.child=ms(i,null,m,c):zt(t,i,m,c),i.child;case 11:return gS(t,i,i.type,i.pendingProps,c);case 7:return zt(t,i,i.pendingProps,c),i.child;case 8:return zt(t,i,i.pendingProps.children,c),i.child;case 12:return zt(t,i,i.pendingProps.children,c),i.child;case 10:return m=i.pendingProps,di(i,i.type,m.value),zt(t,i,m.children,c),i.child;case 9:return _=i.type._context,m=i.pendingProps.children,fs(i),_=Pt(_),m=m(_),i.flags|=1,zt(t,i,m,c),i.child;case 14:return yS(t,i,i.type,i.pendingProps,c);case 15:return vS(t,i,i.type,i.pendingProps,c);case 19:return qS(t,i,c);case 31:return x3(t,i,c);case 22:return bS(t,i,c,i.pendingProps);case 24:return fs(i),m=Pt(Nt),t===null?(_=_d(),_===null&&(_=ot,S=vd(),_.pooledCache=S,S.refCount++,S!==null&&(_.pooledCacheLanes|=c),_=S),i.memoizedState={parent:m,cache:_},Ed(i),di(i,Nt,_)):((t.lanes&c)!==0&&(Cd(t,i),nu(i,null,null,c),tu()),_=t.memoizedState,S=i.memoizedState,_.parent!==m?(_={parent:m,cache:m},i.memoizedState=_,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=_),di(i,Nt,m)):(m=S.cache,di(i,Nt,m),m!==_.cache&&yd(i,[Nt],c,!0))),zt(t,i,i.pendingProps.children,c),i.child;case 29:throw i.pendingProps}throw Error(s(156,i.tag))}function Ir(t){t.flags|=4}function ip(t,i,c,m,_){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(_&335544128)===_)if(t.stateNode.complete)t.flags|=8192;else if(tT())t.flags|=8192;else throw ps=sc,wd}else t.flags&=-16777217}function NS(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!HT(i))if(tT())t.flags|=8192;else throw ps=sc,wd}function Ec(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?Al():536870912,t.lanes|=i,Ia|=i)}function uu(t,i){if(!Qe)switch(t.tailMode){case"hidden":i=t.tail;for(var c=null;i!==null;)i.alternate!==null&&(c=i),i=i.sibling;c===null?t.tail=null:c.sibling=null;break;case"collapsed":c=t.tail;for(var m=null;c!==null;)c.alternate!==null&&(m=c),c=c.sibling;m===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:m.sibling=null}}function ct(t){var i=t.alternate!==null&&t.alternate.child===t.child,c=0,m=0;if(i)for(var _=t.child;_!==null;)c|=_.lanes|_.childLanes,m|=_.subtreeFlags&65011712,m|=_.flags&65011712,_.return=t,_=_.sibling;else for(_=t.child;_!==null;)c|=_.lanes|_.childLanes,m|=_.subtreeFlags,m|=_.flags,_.return=t,_=_.sibling;return t.subtreeFlags|=m,t.childLanes=c,i}function T3(t,i,c){var m=i.pendingProps;switch(hd(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ct(i),null;case 1:return ct(i),null;case 3:return c=i.stateNode,m=null,t!==null&&(m=t.memoizedState.cache),i.memoizedState.cache!==m&&(i.flags|=2048),Mr(Nt),fe(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(t===null||t.child===null)&&(Ca(i)?Ir(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,pd())),ct(i),null;case 26:var _=i.type,S=i.memoizedState;return t===null?(Ir(i),S!==null?(ct(i),NS(i,S)):(ct(i),ip(i,_,null,m,c))):S?S!==t.memoizedState?(Ir(i),ct(i),NS(i,S)):(ct(i),i.flags&=-16777217):(t=t.memoizedProps,t!==m&&Ir(i),ct(i),ip(i,_,t,m,c)),null;case 27:if(ve(i),c=ie.current,_=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==m&&Ir(i);else{if(!m){if(i.stateNode===null)throw Error(s(166));return ct(i),null}t=Q.current,Ca(i)?u1(i):(t=IT(_,m,c),i.stateNode=t,Ir(i))}return ct(i),null;case 5:if(ve(i),_=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==m&&Ir(i);else{if(!m){if(i.stateNode===null)throw Error(s(166));return ct(i),null}if(S=Q.current,Ca(i))u1(i);else{var $=Dc(ie.current);switch(S){case 1:S=$.createElementNS("http://www.w3.org/2000/svg",_);break;case 2:S=$.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;default:switch(_){case"svg":S=$.createElementNS("http://www.w3.org/2000/svg",_);break;case"math":S=$.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;case"script":S=$.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof m.is=="string"?$.createElement("select",{is:m.is}):$.createElement("select"),m.multiple?S.multiple=!0:m.size&&(S.size=m.size);break;default:S=typeof m.is=="string"?$.createElement(_,{is:m.is}):$.createElement(_)}}S[Lt]=i,S[Gt]=m;e:for($=i.child;$!==null;){if($.tag===5||$.tag===6)S.appendChild($.stateNode);else if($.tag!==4&&$.tag!==27&&$.child!==null){$.child.return=$,$=$.child;continue}if($===i)break e;for(;$.sibling===null;){if($.return===null||$.return===i)break e;$=$.return}$.sibling.return=$.return,$=$.sibling}i.stateNode=S;e:switch(Ut(S,_,m),_){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&Ir(i)}}return ct(i),ip(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,c),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==m&&Ir(i);else{if(typeof m!="string"&&i.stateNode===null)throw Error(s(166));if(t=ie.current,Ca(i)){if(t=i.stateNode,c=i.memoizedProps,m=null,_=Bt,_!==null)switch(_.tag){case 27:case 5:m=_.memoizedProps}t[Lt]=i,t=!!(t.nodeValue===c||m!==null&&m.suppressHydrationWarning===!0||ST(t.nodeValue,c)),t||hi(i,!0)}else t=Dc(t).createTextNode(m),t[Lt]=i,i.stateNode=t}return ct(i),null;case 31:if(c=i.memoizedState,t===null||t.memoizedState!==null){if(m=Ca(i),c!==null){if(t===null){if(!m)throw Error(s(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[Lt]=i}else ls(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;ct(i),t=!1}else c=pd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=c),t=!0;if(!t)return i.flags&256?(bn(i),i):(bn(i),null);if((i.flags&128)!==0)throw Error(s(558))}return ct(i),null;case 13:if(m=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(_=Ca(i),m!==null&&m.dehydrated!==null){if(t===null){if(!_)throw Error(s(318));if(_=i.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(s(317));_[Lt]=i}else ls(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;ct(i),_=!1}else _=pd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=_),_=!0;if(!_)return i.flags&256?(bn(i),i):(bn(i),null)}return bn(i),(i.flags&128)!==0?(i.lanes=c,i):(c=m!==null,t=t!==null&&t.memoizedState!==null,c&&(m=i.child,_=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(_=m.alternate.memoizedState.cachePool.pool),S=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(S=m.memoizedState.cachePool.pool),S!==_&&(m.flags|=2048)),c!==t&&c&&(i.child.flags|=8192),Ec(i,i.updateQueue),ct(i),null);case 4:return fe(),t===null&&Tp(i.stateNode.containerInfo),ct(i),null;case 10:return Mr(i.type),ct(i),null;case 19:if(K(Ct),m=i.memoizedState,m===null)return ct(i),null;if(_=(i.flags&128)!==0,S=m.rendering,S===null)if(_)uu(m,!1);else{if(_t!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(S=lc(t),S!==null){for(i.flags|=128,uu(m,!1),t=S.updateQueue,i.updateQueue=t,Ec(i,t),i.subtreeFlags=0,t=c,c=i.child;c!==null;)r1(c,t),c=c.sibling;return ne(Ct,Ct.current&1|2),Qe&&Rr(i,m.treeForkCount),i.child}t=t.sibling}m.tail!==null&&Oe()>qc&&(i.flags|=128,_=!0,uu(m,!1),i.lanes=4194304)}else{if(!_)if(t=lc(S),t!==null){if(i.flags|=128,_=!0,t=t.updateQueue,i.updateQueue=t,Ec(i,t),uu(m,!0),m.tail===null&&m.tailMode==="hidden"&&!S.alternate&&!Qe)return ct(i),null}else 2*Oe()-m.renderingStartTime>qc&&c!==536870912&&(i.flags|=128,_=!0,uu(m,!1),i.lanes=4194304);m.isBackwards?(S.sibling=i.child,i.child=S):(t=m.last,t!==null?t.sibling=S:i.child=S,m.last=S)}return m.tail!==null?(t=m.tail,m.rendering=t,m.tail=t.sibling,m.renderingStartTime=Oe(),t.sibling=null,c=Ct.current,ne(Ct,_?c&1|2:c&1),Qe&&Rr(i,m.treeForkCount),t):(ct(i),null);case 22:case 23:return bn(i),qd(),m=i.memoizedState!==null,t!==null?t.memoizedState!==null!==m&&(i.flags|=8192):m&&(i.flags|=8192),m?(c&536870912)!==0&&(i.flags&128)===0&&(ct(i),i.subtreeFlags&6&&(i.flags|=8192)):ct(i),c=i.updateQueue,c!==null&&Ec(i,c.retryQueue),c=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(c=t.memoizedState.cachePool.pool),m=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(m=i.memoizedState.cachePool.pool),m!==c&&(i.flags|=2048),t!==null&&K(hs),null;case 24:return c=null,t!==null&&(c=t.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),Mr(Nt),ct(i),null;case 25:return null;case 30:return null}throw Error(s(156,i.tag))}function q3(t,i){switch(hd(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return Mr(Nt),fe(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return ve(i),null;case 31:if(i.memoizedState!==null){if(bn(i),i.alternate===null)throw Error(s(340));ls()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(bn(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(s(340));ls()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return K(Ct),null;case 4:return fe(),null;case 10:return Mr(i.type),null;case 22:case 23:return bn(i),qd(),t!==null&&K(hs),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return Mr(Nt),null;case 25:return null;default:return null}}function RS(t,i){switch(hd(i),i.tag){case 3:Mr(Nt),fe();break;case 26:case 27:case 5:ve(i);break;case 4:fe();break;case 31:i.memoizedState!==null&&bn(i);break;case 13:bn(i);break;case 19:K(Ct);break;case 10:Mr(i.type);break;case 22:case 23:bn(i),qd(),t!==null&&K(hs);break;case 24:Mr(Nt)}}function lu(t,i){try{var c=i.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var _=m.next;c=_;do{if((c.tag&t)===t){m=void 0;var S=c.create,$=c.inst;m=S(),$.destroy=m}c=c.next}while(c!==_)}}catch(U){tt(i,i.return,U)}}function bi(t,i,c){try{var m=i.updateQueue,_=m!==null?m.lastEffect:null;if(_!==null){var S=_.next;m=S;do{if((m.tag&t)===t){var $=m.inst,U=$.destroy;if(U!==void 0){$.destroy=void 0,_=i;var Z=c,le=U;try{le()}catch(pe){tt(_,Z,pe)}}}m=m.next}while(m!==S)}}catch(pe){tt(i,i.return,pe)}}function OS(t){var i=t.updateQueue;if(i!==null){var c=t.stateNode;try{w1(i,c)}catch(m){tt(t,t.return,m)}}}function MS(t,i,c){c.props=ys(t.type,t.memoizedProps),c.state=t.memoizedState;try{c.componentWillUnmount()}catch(m){tt(t,i,m)}}function cu(t,i){try{var c=t.ref;if(c!==null){switch(t.tag){case 26:case 27:case 5:var m=t.stateNode;break;case 30:m=t.stateNode;break;default:m=t.stateNode}typeof c=="function"?t.refCleanup=c(m):c.current=m}}catch(_){tt(t,i,_)}}function cr(t,i){var c=t.ref,m=t.refCleanup;if(c!==null)if(typeof m=="function")try{m()}catch(_){tt(t,i,_)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(_){tt(t,i,_)}else c.current=null}function jS(t){var i=t.type,c=t.memoizedProps,m=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":c.autoFocus&&m.focus();break e;case"img":c.src?m.src=c.src:c.srcSet&&(m.srcset=c.srcSet)}}catch(_){tt(t,t.return,_)}}function sp(t,i,c){try{var m=t.stateNode;Y3(m,t.type,c,i),m[Gt]=i}catch(_){tt(t,t.return,_)}}function LS(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Ti(t.type)||t.tag===4}function ap(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||LS(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Ti(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function op(t,i,c){var m=t.tag;if(m===5||m===6)t=t.stateNode,i?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(t,i):(i=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,i.appendChild(t),c=c._reactRootContainer,c!=null||i.onclick!==null||(i.onclick=qr));else if(m!==4&&(m===27&&Ti(t.type)&&(c=t.stateNode,i=null),t=t.child,t!==null))for(op(t,i,c),t=t.sibling;t!==null;)op(t,i,c),t=t.sibling}function Cc(t,i,c){var m=t.tag;if(m===5||m===6)t=t.stateNode,i?c.insertBefore(t,i):c.appendChild(t);else if(m!==4&&(m===27&&Ti(t.type)&&(c=t.stateNode),t=t.child,t!==null))for(Cc(t,i,c),t=t.sibling;t!==null;)Cc(t,i,c),t=t.sibling}function $S(t){var i=t.stateNode,c=t.memoizedProps;try{for(var m=t.type,_=i.attributes;_.length;)i.removeAttributeNode(_[0]);Ut(i,m,c),i[Lt]=t,i[Gt]=c}catch(S){tt(t,t.return,S)}}var Dr=!1,Mt=!1,up=!1,IS=typeof WeakSet=="function"?WeakSet:Set,Dt=null;function A3(t,i){if(t=t.containerInfo,Np=Hc,t=Kx(t),td(t)){if("selectionStart"in t)var c={start:t.selectionStart,end:t.selectionEnd};else e:{c=(c=t.ownerDocument)&&c.defaultView||window;var m=c.getSelection&&c.getSelection();if(m&&m.rangeCount!==0){c=m.anchorNode;var _=m.anchorOffset,S=m.focusNode;m=m.focusOffset;try{c.nodeType,S.nodeType}catch{c=null;break e}var $=0,U=-1,Z=-1,le=0,pe=0,ge=t,ce=null;t:for(;;){for(var he;ge!==c||_!==0&&ge.nodeType!==3||(U=$+_),ge!==S||m!==0&&ge.nodeType!==3||(Z=$+m),ge.nodeType===3&&($+=ge.nodeValue.length),(he=ge.firstChild)!==null;)ce=ge,ge=he;for(;;){if(ge===t)break t;if(ce===c&&++le===_&&(U=$),ce===S&&++pe===m&&(Z=$),(he=ge.nextSibling)!==null)break;ge=ce,ce=ge.parentNode}ge=he}c=U===-1||Z===-1?null:{start:U,end:Z}}else c=null}c=c||{start:0,end:0}}else c=null;for(Rp={focusedElem:t,selectionRange:c},Hc=!1,Dt=i;Dt!==null;)if(i=Dt,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,Dt=t;else for(;Dt!==null;){switch(i=Dt,S=i.alternate,t=i.flags,i.tag){case 0:if((t&4)!==0&&(t=i.updateQueue,t=t!==null?t.events:null,t!==null))for(c=0;c<t.length;c++)_=t[c],_.ref.impl=_.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&S!==null){t=void 0,c=i,_=S.memoizedProps,S=S.memoizedState,m=c.stateNode;try{var Te=ys(c.type,_);t=m.getSnapshotBeforeUpdate(Te,S),m.__reactInternalSnapshotBeforeUpdate=t}catch(je){tt(c,c.return,je)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,c=t.nodeType,c===9)jp(t);else if(c===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":jp(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(s(163))}if(t=i.sibling,t!==null){t.return=i.return,Dt=t;break}Dt=i.return}}function DS(t,i,c){var m=c.flags;switch(c.tag){case 0:case 11:case 15:Br(t,c),m&4&&lu(5,c);break;case 1:if(Br(t,c),m&4)if(t=c.stateNode,i===null)try{t.componentDidMount()}catch($){tt(c,c.return,$)}else{var _=ys(c.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(_,i,t.__reactInternalSnapshotBeforeUpdate)}catch($){tt(c,c.return,$)}}m&64&&OS(c),m&512&&cu(c,c.return);break;case 3:if(Br(t,c),m&64&&(t=c.updateQueue,t!==null)){if(i=null,c.child!==null)switch(c.child.tag){case 27:case 5:i=c.child.stateNode;break;case 1:i=c.child.stateNode}try{w1(t,i)}catch($){tt(c,c.return,$)}}break;case 27:i===null&&m&4&&$S(c);case 26:case 5:Br(t,c),i===null&&m&4&&jS(c),m&512&&cu(c,c.return);break;case 12:Br(t,c);break;case 31:Br(t,c),m&4&&PS(t,c);break;case 13:Br(t,c),m&4&&zS(t,c),m&64&&(t=c.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(c=D3.bind(null,c),rz(t,c))));break;case 22:if(m=c.memoizedState!==null||Dr,!m){i=i!==null&&i.memoizedState!==null||Mt,_=Dr;var S=Mt;Dr=m,(Mt=i)&&!S?Pr(t,c,(c.subtreeFlags&8772)!==0):Br(t,c),Dr=_,Mt=S}break;case 30:break;default:Br(t,c)}}function kS(t){var i=t.alternate;i!==null&&(t.alternate=null,kS(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&Io(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var ft=null,an=!1;function kr(t,i,c){for(c=c.child;c!==null;)BS(t,i,c),c=c.sibling}function BS(t,i,c){if(yt&&typeof yt.onCommitFiberUnmount=="function")try{yt.onCommitFiberUnmount(Ft,c)}catch{}switch(c.tag){case 26:Mt||cr(c,i),kr(t,i,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:Mt||cr(c,i);var m=ft,_=an;Ti(c.type)&&(ft=c.stateNode,an=!1),kr(t,i,c),bu(c.stateNode),ft=m,an=_;break;case 5:Mt||cr(c,i);case 6:if(m=ft,_=an,ft=null,kr(t,i,c),ft=m,an=_,ft!==null)if(an)try{(ft.nodeType===9?ft.body:ft.nodeName==="HTML"?ft.ownerDocument.body:ft).removeChild(c.stateNode)}catch(S){tt(c,i,S)}else try{ft.removeChild(c.stateNode)}catch(S){tt(c,i,S)}break;case 18:ft!==null&&(an?(t=ft,OT(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,c.stateNode),Ha(t)):OT(ft,c.stateNode));break;case 4:m=ft,_=an,ft=c.stateNode.containerInfo,an=!0,kr(t,i,c),ft=m,an=_;break;case 0:case 11:case 14:case 15:bi(2,c,i),Mt||bi(4,c,i),kr(t,i,c);break;case 1:Mt||(cr(c,i),m=c.stateNode,typeof m.componentWillUnmount=="function"&&MS(c,i,m)),kr(t,i,c);break;case 21:kr(t,i,c);break;case 22:Mt=(m=Mt)||c.memoizedState!==null,kr(t,i,c),Mt=m;break;default:kr(t,i,c)}}function PS(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ha(t)}catch(c){tt(i,i.return,c)}}}function zS(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ha(t)}catch(c){tt(i,i.return,c)}}function N3(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new IS),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new IS),i;default:throw Error(s(435,t.tag))}}function xc(t,i){var c=N3(t);i.forEach(function(m){if(!c.has(m)){c.add(m);var _=k3.bind(null,t,m);m.then(_,_)}})}function on(t,i){var c=i.deletions;if(c!==null)for(var m=0;m<c.length;m++){var _=c[m],S=t,$=i,U=$;e:for(;U!==null;){switch(U.tag){case 27:if(Ti(U.type)){ft=U.stateNode,an=!1;break e}break;case 5:ft=U.stateNode,an=!1;break e;case 3:case 4:ft=U.stateNode.containerInfo,an=!0;break e}U=U.return}if(ft===null)throw Error(s(160));BS(S,$,_),ft=null,an=!1,S=_.alternate,S!==null&&(S.return=null),_.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)US(i,t),i=i.sibling}var Qn=null;function US(t,i){var c=t.alternate,m=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:on(i,t),un(t),m&4&&(bi(3,t,t.return),lu(3,t),bi(5,t,t.return));break;case 1:on(i,t),un(t),m&512&&(Mt||c===null||cr(c,c.return)),m&64&&Dr&&(t=t.updateQueue,t!==null&&(m=t.callbacks,m!==null&&(c=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=c===null?m:c.concat(m))));break;case 26:var _=Qn;if(on(i,t),un(t),m&512&&(Mt||c===null||cr(c,c.return)),m&4){var S=c!==null?c.memoizedState:null;if(m=t.memoizedState,c===null)if(m===null)if(t.stateNode===null){e:{m=t.type,c=t.memoizedProps,_=_.ownerDocument||_;t:switch(m){case"title":S=_.getElementsByTagName("title")[0],(!S||S[ts]||S[Lt]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=_.createElement(m),_.head.insertBefore(S,_.querySelector("head > title"))),Ut(S,m,c),S[Lt]=t,At(S),m=S;break e;case"link":var $=UT("link","href",_).get(m+(c.href||""));if($){for(var U=0;U<$.length;U++)if(S=$[U],S.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&S.getAttribute("rel")===(c.rel==null?null:c.rel)&&S.getAttribute("title")===(c.title==null?null:c.title)&&S.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){$.splice(U,1);break t}}S=_.createElement(m),Ut(S,m,c),_.head.appendChild(S);break;case"meta":if($=UT("meta","content",_).get(m+(c.content||""))){for(U=0;U<$.length;U++)if(S=$[U],S.getAttribute("content")===(c.content==null?null:""+c.content)&&S.getAttribute("name")===(c.name==null?null:c.name)&&S.getAttribute("property")===(c.property==null?null:c.property)&&S.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&S.getAttribute("charset")===(c.charSet==null?null:c.charSet)){$.splice(U,1);break t}}S=_.createElement(m),Ut(S,m,c),_.head.appendChild(S);break;default:throw Error(s(468,m))}S[Lt]=t,At(S),m=S}t.stateNode=m}else QT(_,t.type,t.stateNode);else t.stateNode=zT(_,m,t.memoizedProps);else S!==m?(S===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):S.count--,m===null?QT(_,t.type,t.stateNode):zT(_,m,t.memoizedProps)):m===null&&t.stateNode!==null&&sp(t,t.memoizedProps,c.memoizedProps)}break;case 27:on(i,t),un(t),m&512&&(Mt||c===null||cr(c,c.return)),c!==null&&m&4&&sp(t,t.memoizedProps,c.memoizedProps);break;case 5:if(on(i,t),un(t),m&512&&(Mt||c===null||cr(c,c.return)),t.flags&32){_=t.stateNode;try{da(_,"")}catch(Te){tt(t,t.return,Te)}}m&4&&t.stateNode!=null&&(_=t.memoizedProps,sp(t,_,c!==null?c.memoizedProps:_)),m&1024&&(up=!0);break;case 6:if(on(i,t),un(t),m&4){if(t.stateNode===null)throw Error(s(162));m=t.memoizedProps,c=t.stateNode;try{c.nodeValue=m}catch(Te){tt(t,t.return,Te)}}break;case 3:if(Pc=null,_=Qn,Qn=kc(i.containerInfo),on(i,t),Qn=_,un(t),m&4&&c!==null&&c.memoizedState.isDehydrated)try{Ha(i.containerInfo)}catch(Te){tt(t,t.return,Te)}up&&(up=!1,QS(t));break;case 4:m=Qn,Qn=kc(t.stateNode.containerInfo),on(i,t),un(t),Qn=m;break;case 12:on(i,t),un(t);break;case 31:on(i,t),un(t),m&4&&(m=t.updateQueue,m!==null&&(t.updateQueue=null,xc(t,m)));break;case 13:on(i,t),un(t),t.child.flags&8192&&t.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Tc=Oe()),m&4&&(m=t.updateQueue,m!==null&&(t.updateQueue=null,xc(t,m)));break;case 22:_=t.memoizedState!==null;var Z=c!==null&&c.memoizedState!==null,le=Dr,pe=Mt;if(Dr=le||_,Mt=pe||Z,on(i,t),Mt=pe,Dr=le,un(t),m&8192)e:for(i=t.stateNode,i._visibility=_?i._visibility&-2:i._visibility|1,_&&(c===null||Z||Dr||Mt||vs(t)),c=null,i=t;;){if(i.tag===5||i.tag===26){if(c===null){Z=c=i;try{if(S=Z.stateNode,_)$=S.style,typeof $.setProperty=="function"?$.setProperty("display","none","important"):$.display="none";else{U=Z.stateNode;var ge=Z.memoizedProps.style,ce=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;U.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(Te){tt(Z,Z.return,Te)}}}else if(i.tag===6){if(c===null){Z=i;try{Z.stateNode.nodeValue=_?"":Z.memoizedProps}catch(Te){tt(Z,Z.return,Te)}}}else if(i.tag===18){if(c===null){Z=i;try{var he=Z.stateNode;_?MT(he,!0):MT(Z.stateNode,!1)}catch(Te){tt(Z,Z.return,Te)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;c===i&&(c=null),i=i.return}c===i&&(c=null),i.sibling.return=i.return,i=i.sibling}m&4&&(m=t.updateQueue,m!==null&&(c=m.retryQueue,c!==null&&(m.retryQueue=null,xc(t,c))));break;case 19:on(i,t),un(t),m&4&&(m=t.updateQueue,m!==null&&(t.updateQueue=null,xc(t,m)));break;case 30:break;case 21:break;default:on(i,t),un(t)}}function un(t){var i=t.flags;if(i&2){try{for(var c,m=t.return;m!==null;){if(LS(m)){c=m;break}m=m.return}if(c==null)throw Error(s(160));switch(c.tag){case 27:var _=c.stateNode,S=ap(t);Cc(t,S,_);break;case 5:var $=c.stateNode;c.flags&32&&(da($,""),c.flags&=-33);var U=ap(t);Cc(t,U,$);break;case 3:case 4:var Z=c.stateNode.containerInfo,le=ap(t);op(t,le,Z);break;default:throw Error(s(161))}}catch(pe){tt(t,t.return,pe)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function QS(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;QS(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function Br(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)DS(t,i.alternate,i),i=i.sibling}function vs(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:bi(4,i,i.return),vs(i);break;case 1:cr(i,i.return);var c=i.stateNode;typeof c.componentWillUnmount=="function"&&MS(i,i.return,c),vs(i);break;case 27:bu(i.stateNode);case 26:case 5:cr(i,i.return),vs(i);break;case 22:i.memoizedState===null&&vs(i);break;case 30:vs(i);break;default:vs(i)}t=t.sibling}}function Pr(t,i,c){for(c=c&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var m=i.alternate,_=t,S=i,$=S.flags;switch(S.tag){case 0:case 11:case 15:Pr(_,S,c),lu(4,S);break;case 1:if(Pr(_,S,c),m=S,_=m.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(le){tt(m,m.return,le)}if(m=S,_=m.updateQueue,_!==null){var U=m.stateNode;try{var Z=_.shared.hiddenCallbacks;if(Z!==null)for(_.shared.hiddenCallbacks=null,_=0;_<Z.length;_++)_1(Z[_],U)}catch(le){tt(m,m.return,le)}}c&&$&64&&OS(S),cu(S,S.return);break;case 27:$S(S);case 26:case 5:Pr(_,S,c),c&&m===null&&$&4&&jS(S),cu(S,S.return);break;case 12:Pr(_,S,c);break;case 31:Pr(_,S,c),c&&$&4&&PS(_,S);break;case 13:Pr(_,S,c),c&&$&4&&zS(_,S);break;case 22:S.memoizedState===null&&Pr(_,S,c),cu(S,S.return);break;case 30:break;default:Pr(_,S,c)}i=i.sibling}}function lp(t,i){var c=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(c=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==c&&(t!=null&&t.refCount++,c!=null&&Xo(c))}function cp(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Xo(t))}function Hn(t,i,c,m){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)HS(t,i,c,m),i=i.sibling}function HS(t,i,c,m){var _=i.flags;switch(i.tag){case 0:case 11:case 15:Hn(t,i,c,m),_&2048&&lu(9,i);break;case 1:Hn(t,i,c,m);break;case 3:Hn(t,i,c,m),_&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Xo(t)));break;case 12:if(_&2048){Hn(t,i,c,m),t=i.stateNode;try{var S=i.memoizedProps,$=S.id,U=S.onPostCommit;typeof U=="function"&&U($,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(Z){tt(i,i.return,Z)}}else Hn(t,i,c,m);break;case 31:Hn(t,i,c,m);break;case 13:Hn(t,i,c,m);break;case 23:break;case 22:S=i.stateNode,$=i.alternate,i.memoizedState!==null?S._visibility&2?Hn(t,i,c,m):fu(t,i):S._visibility&2?Hn(t,i,c,m):(S._visibility|=2,ja(t,i,c,m,(i.subtreeFlags&10256)!==0||!1)),_&2048&&lp($,i);break;case 24:Hn(t,i,c,m),_&2048&&cp(i.alternate,i);break;default:Hn(t,i,c,m)}}function ja(t,i,c,m,_){for(_=_&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var S=t,$=i,U=c,Z=m,le=$.flags;switch($.tag){case 0:case 11:case 15:ja(S,$,U,Z,_),lu(8,$);break;case 23:break;case 22:var pe=$.stateNode;$.memoizedState!==null?pe._visibility&2?ja(S,$,U,Z,_):fu(S,$):(pe._visibility|=2,ja(S,$,U,Z,_)),_&&le&2048&&lp($.alternate,$);break;case 24:ja(S,$,U,Z,_),_&&le&2048&&cp($.alternate,$);break;default:ja(S,$,U,Z,_)}i=i.sibling}}function fu(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var c=t,m=i,_=m.flags;switch(m.tag){case 22:fu(c,m),_&2048&&lp(m.alternate,m);break;case 24:fu(c,m),_&2048&&cp(m.alternate,m);break;default:fu(c,m)}i=i.sibling}}var hu=8192;function La(t,i,c){if(t.subtreeFlags&hu)for(t=t.child;t!==null;)VS(t,i,c),t=t.sibling}function VS(t,i,c){switch(t.tag){case 26:La(t,i,c),t.flags&hu&&t.memoizedState!==null&&mz(c,Qn,t.memoizedState,t.memoizedProps);break;case 5:La(t,i,c);break;case 3:case 4:var m=Qn;Qn=kc(t.stateNode.containerInfo),La(t,i,c),Qn=m;break;case 22:t.memoizedState===null&&(m=t.alternate,m!==null&&m.memoizedState!==null?(m=hu,hu=16777216,La(t,i,c),hu=m):La(t,i,c));break;default:La(t,i,c)}}function FS(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function du(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var c=0;c<i.length;c++){var m=i[c];Dt=m,KS(m,t)}FS(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)GS(t),t=t.sibling}function GS(t){switch(t.tag){case 0:case 11:case 15:du(t),t.flags&2048&&bi(9,t,t.return);break;case 3:du(t);break;case 12:du(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,Sc(t)):du(t);break;default:du(t)}}function Sc(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var c=0;c<i.length;c++){var m=i[c];Dt=m,KS(m,t)}FS(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:bi(8,i,i.return),Sc(i);break;case 22:c=i.stateNode,c._visibility&2&&(c._visibility&=-3,Sc(i));break;default:Sc(i)}t=t.sibling}}function KS(t,i){for(;Dt!==null;){var c=Dt;switch(c.tag){case 0:case 11:case 15:bi(8,c,i);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var m=c.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Xo(c.memoizedState.cache)}if(m=c.child,m!==null)m.return=c,Dt=m;else e:for(c=t;Dt!==null;){m=Dt;var _=m.sibling,S=m.return;if(kS(m),m===c){Dt=null;break e}if(_!==null){_.return=S,Dt=_;break e}Dt=S}}}var R3={getCacheForType:function(t){var i=Pt(Nt),c=i.data.get(t);return c===void 0&&(c=t(),i.data.set(t,c)),c},cacheSignal:function(){return Pt(Nt).controller.signal}},O3=typeof WeakMap=="function"?WeakMap:Map,Je=0,ot=null,Be=null,ze=0,et=0,_n=null,_i=!1,$a=!1,fp=!1,zr=0,_t=0,wi=0,bs=0,hp=0,wn=0,Ia=0,pu=null,ln=null,dp=!1,Tc=0,YS=0,qc=1/0,Ac=null,Ei=null,$t=0,Ci=null,Da=null,Ur=0,pp=0,mp=null,XS=null,mu=0,gp=null;function En(){return(Je&2)!==0&&ze!==0?ze&-ze:L.T!==null?Ep():Ml()}function WS(){if(wn===0)if((ze&536870912)===0||Qe){var t=oa;oa<<=1,(oa&3932160)===0&&(oa=262144),wn=t}else wn=536870912;return t=vn.current,t!==null&&(t.flags|=32),wn}function cn(t,i,c){(t===ot&&(et===2||et===9)||t.cancelPendingCommit!==null)&&(ka(t,0),xi(t,ze,wn,!1)),es(t,c),((Je&2)===0||t!==ot)&&(t===ot&&((Je&2)===0&&(bs|=c),_t===4&&xi(t,ze,wn,!1)),fr(t))}function JS(t,i,c){if((Je&6)!==0)throw Error(s(327));var m=!c&&(i&127)===0&&(i&t.expiredLanes)===0||Zi(t,i),_=m?L3(t,i):vp(t,i,!0),S=m;do{if(_===0){$a&&!m&&xi(t,i,0,!1);break}else{if(c=t.current.alternate,S&&!M3(c)){_=vp(t,i,!1),S=!1;continue}if(_===2){if(S=i,t.errorRecoveryDisabledLanes&S)var $=0;else $=t.pendingLanes&-536870913,$=$!==0?$:$&536870912?536870912:0;if($!==0){i=$;e:{var U=t;_=pu;var Z=U.current.memoizedState.isDehydrated;if(Z&&(ka(U,$).flags|=256),$=vp(U,$,!1),$!==2){if(fp&&!Z){U.errorRecoveryDisabledLanes|=S,bs|=S,_=4;break e}S=ln,ln=_,S!==null&&(ln===null?ln=S:ln.push.apply(ln,S))}_=$}if(S=!1,_!==2)continue}}if(_===1){ka(t,0),xi(t,i,0,!0);break}e:{switch(m=t,S=_,S){case 0:case 1:throw Error(s(345));case 4:if((i&4194048)!==i)break;case 6:xi(m,i,wn,!_i);break e;case 2:ln=null;break;case 3:case 5:break;default:throw Error(s(329))}if((i&62914560)===i&&(_=Tc+300-Oe(),10<_)){if(xi(m,i,wn,!_i),la(m,0,!0)!==0)break e;Ur=i,m.timeoutHandle=NT(ZS.bind(null,m,c,ln,Ac,dp,i,wn,bs,Ia,_i,S,"Throttled",-0,0),_);break e}ZS(m,c,ln,Ac,dp,i,wn,bs,Ia,_i,S,null,-0,0)}}break}while(!0);fr(t)}function ZS(t,i,c,m,_,S,$,U,Z,le,pe,ge,ce,he){if(t.timeoutHandle=-1,ge=i.subtreeFlags,ge&8192||(ge&16785408)===16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:qr},VS(i,S,ge);var Te=(S&62914560)===S?Tc-Oe():(S&4194048)===S?YS-Oe():0;if(Te=gz(ge,Te),Te!==null){Ur=S,t.cancelPendingCommit=Te(oT.bind(null,t,i,S,c,m,_,$,U,Z,pe,ge,null,ce,he)),xi(t,S,$,!le);return}}oT(t,i,S,c,m,_,$,U,Z)}function M3(t){for(var i=t;;){var c=i.tag;if((c===0||c===11||c===15)&&i.flags&16384&&(c=i.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var m=0;m<c.length;m++){var _=c[m],S=_.getSnapshot;_=_.value;try{if(!gn(S(),_))return!1}catch{return!1}}if(c=i.child,i.subtreeFlags&16384&&c!==null)c.return=i,i=c;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function xi(t,i,c,m){i&=~hp,i&=~bs,t.suspendedLanes|=i,t.pingedLanes&=~i,m&&(t.warmLanes|=i),m=t.expirationTimes;for(var _=i;0<_;){var S=31-Wt(_),$=1<<S;m[S]=-1,_&=~$}c!==0&&Nl(t,c,i)}function Nc(){return(Je&6)===0?(gu(0),!1):!0}function yp(){if(Be!==null){if(et===0)var t=Be.return;else t=Be,Or=cs=null,jd(t),Aa=null,Jo=0,t=Be;for(;t!==null;)RS(t.alternate,t),t=t.return;Be=null}}function ka(t,i){var c=t.timeoutHandle;c!==-1&&(t.timeoutHandle=-1,J3(c)),c=t.cancelPendingCommit,c!==null&&(t.cancelPendingCommit=null,c()),Ur=0,yp(),ot=t,Be=c=Nr(t.current,null),ze=i,et=0,_n=null,_i=!1,$a=Zi(t,i),fp=!1,Ia=wn=hp=bs=wi=_t=0,ln=pu=null,dp=!1,(i&8)!==0&&(i|=i&32);var m=t.entangledLanes;if(m!==0)for(t=t.entanglements,m&=i;0<m;){var _=31-Wt(m),S=1<<_;i|=t[_],m&=~S}return zr=i,Xl(),c}function eT(t,i){De=null,L.H=au,i===qa||i===ic?(i=g1(),et=3):i===wd?(i=g1(),et=4):et=i===Yd?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,_n=i,Be===null&&(_t=1,vc(t,Nn(i,t.current)))}function tT(){var t=vn.current;return t===null?!0:(ze&4194048)===ze?jn===null:(ze&62914560)===ze||(ze&536870912)!==0?t===jn:!1}function nT(){var t=L.H;return L.H=au,t===null?au:t}function rT(){var t=L.A;return L.A=R3,t}function Rc(){_t=4,_i||(ze&4194048)!==ze&&vn.current!==null||($a=!0),(wi&134217727)===0&&(bs&134217727)===0||ot===null||xi(ot,ze,wn,!1)}function vp(t,i,c){var m=Je;Je|=2;var _=nT(),S=rT();(ot!==t||ze!==i)&&(Ac=null,ka(t,i)),i=!1;var $=_t;e:do try{if(et!==0&&Be!==null){var U=Be,Z=_n;switch(et){case 8:yp(),$=6;break e;case 3:case 2:case 9:case 6:vn.current===null&&(i=!0);var le=et;if(et=0,_n=null,Ba(t,U,Z,le),c&&$a){$=0;break e}break;default:le=et,et=0,_n=null,Ba(t,U,Z,le)}}j3(),$=_t;break}catch(pe){eT(t,pe)}while(!0);return i&&t.shellSuspendCounter++,Or=cs=null,Je=m,L.H=_,L.A=S,Be===null&&(ot=null,ze=0,Xl()),$}function j3(){for(;Be!==null;)iT(Be)}function L3(t,i){var c=Je;Je|=2;var m=nT(),_=rT();ot!==t||ze!==i?(Ac=null,qc=Oe()+500,ka(t,i)):$a=Zi(t,i);e:do try{if(et!==0&&Be!==null){i=Be;var S=_n;t:switch(et){case 1:et=0,_n=null,Ba(t,i,S,1);break;case 2:case 9:if(p1(S)){et=0,_n=null,sT(i);break}i=function(){et!==2&&et!==9||ot!==t||(et=7),fr(t)},S.then(i,i);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:p1(S)?(et=0,_n=null,sT(i)):(et=0,_n=null,Ba(t,i,S,7));break;case 5:var $=null;switch(Be.tag){case 26:$=Be.memoizedState;case 5:case 27:var U=Be;if($?HT($):U.stateNode.complete){et=0,_n=null;var Z=U.sibling;if(Z!==null)Be=Z;else{var le=U.return;le!==null?(Be=le,Oc(le)):Be=null}break t}}et=0,_n=null,Ba(t,i,S,5);break;case 6:et=0,_n=null,Ba(t,i,S,6);break;case 8:yp(),_t=6;break e;default:throw Error(s(462))}}$3();break}catch(pe){eT(t,pe)}while(!0);return Or=cs=null,L.H=m,L.A=_,Je=c,Be!==null?0:(ot=null,ze=0,Xl(),_t)}function $3(){for(;Be!==null&&!qt();)iT(Be)}function iT(t){var i=AS(t.alternate,t,zr);t.memoizedProps=t.pendingProps,i===null?Oc(t):Be=i}function sT(t){var i=t,c=i.alternate;switch(i.tag){case 15:case 0:i=ES(c,i,i.pendingProps,i.type,void 0,ze);break;case 11:i=ES(c,i,i.pendingProps,i.type.render,i.ref,ze);break;case 5:jd(i);default:RS(c,i),i=Be=r1(i,zr),i=AS(c,i,zr)}t.memoizedProps=t.pendingProps,i===null?Oc(t):Be=i}function Ba(t,i,c,m){Or=cs=null,jd(i),Aa=null,Jo=0;var _=i.return;try{if(C3(t,_,i,c,ze)){_t=1,vc(t,Nn(c,t.current)),Be=null;return}}catch(S){if(_!==null)throw Be=_,S;_t=1,vc(t,Nn(c,t.current)),Be=null;return}i.flags&32768?(Qe||m===1?t=!0:$a||(ze&536870912)!==0?t=!1:(_i=t=!0,(m===2||m===9||m===3||m===6)&&(m=vn.current,m!==null&&m.tag===13&&(m.flags|=16384))),aT(i,t)):Oc(i)}function Oc(t){var i=t;do{if((i.flags&32768)!==0){aT(i,_i);return}t=i.return;var c=T3(i.alternate,i,zr);if(c!==null){Be=c;return}if(i=i.sibling,i!==null){Be=i;return}Be=i=t}while(i!==null);_t===0&&(_t=5)}function aT(t,i){do{var c=q3(t.alternate,t);if(c!==null){c.flags&=32767,Be=c;return}if(c=t.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!i&&(t=t.sibling,t!==null)){Be=t;return}Be=t=c}while(t!==null);_t=6,Be=null}function oT(t,i,c,m,_,S,$,U,Z){t.cancelPendingCommit=null;do Mc();while($t!==0);if((Je&6)!==0)throw Error(s(327));if(i!==null){if(i===t.current)throw Error(s(177));if(S=i.lanes|i.childLanes,S|=ad,Ih(t,c,S,$,U,Z),t===ot&&(Be=ot=null,ze=0),Da=i,Ci=t,Ur=c,pp=S,mp=_,XS=m,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,B3(de,function(){return hT(),null})):(t.callbackNode=null,t.callbackPriority=0),m=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||m){m=L.T,L.T=null,_=P.p,P.p=2,$=Je,Je|=4;try{A3(t,i,c)}finally{Je=$,P.p=_,L.T=m}}$t=1,uT(),lT(),cT()}}function uT(){if($t===1){$t=0;var t=Ci,i=Da,c=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||c){c=L.T,L.T=null;var m=P.p;P.p=2;var _=Je;Je|=4;try{US(i,t);var S=Rp,$=Kx(t.containerInfo),U=S.focusedElem,Z=S.selectionRange;if($!==U&&U&&U.ownerDocument&&Gx(U.ownerDocument.documentElement,U)){if(Z!==null&&td(U)){var le=Z.start,pe=Z.end;if(pe===void 0&&(pe=le),"selectionStart"in U)U.selectionStart=le,U.selectionEnd=Math.min(pe,U.value.length);else{var ge=U.ownerDocument||document,ce=ge&&ge.defaultView||window;if(ce.getSelection){var he=ce.getSelection(),Te=U.textContent.length,je=Math.min(Z.start,Te),at=Z.end===void 0?je:Math.min(Z.end,Te);!he.extend&&je>at&&($=at,at=je,je=$);var se=Fx(U,je),re=Fx(U,at);if(se&&re&&(he.rangeCount!==1||he.anchorNode!==se.node||he.anchorOffset!==se.offset||he.focusNode!==re.node||he.focusOffset!==re.offset)){var ue=ge.createRange();ue.setStart(se.node,se.offset),he.removeAllRanges(),je>at?(he.addRange(ue),he.extend(re.node,re.offset)):(ue.setEnd(re.node,re.offset),he.addRange(ue))}}}}for(ge=[],he=U;he=he.parentNode;)he.nodeType===1&&ge.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof U.focus=="function"&&U.focus(),U=0;U<ge.length;U++){var me=ge[U];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}Hc=!!Np,Rp=Np=null}finally{Je=_,P.p=m,L.T=c}}t.current=i,$t=2}}function lT(){if($t===2){$t=0;var t=Ci,i=Da,c=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||c){c=L.T,L.T=null;var m=P.p;P.p=2;var _=Je;Je|=4;try{DS(t,i.alternate,i)}finally{Je=_,P.p=m,L.T=c}}$t=3}}function cT(){if($t===4||$t===3){$t=0,Fe();var t=Ci,i=Da,c=Ur,m=XS;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?$t=5:($t=0,Da=Ci=null,fT(t,t.pendingLanes));var _=t.pendingLanes;if(_===0&&(Ei=null),$o(c),i=i.stateNode,yt&&typeof yt.onCommitFiberRoot=="function")try{yt.onCommitFiberRoot(Ft,i,void 0,(i.current.flags&128)===128)}catch{}if(m!==null){i=L.T,_=P.p,P.p=2,L.T=null;try{for(var S=t.onRecoverableError,$=0;$<m.length;$++){var U=m[$];S(U.value,{componentStack:U.stack})}}finally{L.T=i,P.p=_}}(Ur&3)!==0&&Mc(),fr(t),_=t.pendingLanes,(c&261930)!==0&&(_&42)!==0?t===gp?mu++:(mu=0,gp=t):mu=0,gu(0)}}function fT(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,Xo(i)))}function Mc(){return uT(),lT(),cT(),hT()}function hT(){if($t!==5)return!1;var t=Ci,i=pp;pp=0;var c=$o(Ur),m=L.T,_=P.p;try{P.p=32>c?32:c,L.T=null,c=mp,mp=null;var S=Ci,$=Ur;if($t=0,Da=Ci=null,Ur=0,(Je&6)!==0)throw Error(s(331));var U=Je;if(Je|=4,GS(S.current),HS(S,S.current,$,c),Je=U,gu(0,!1),yt&&typeof yt.onPostCommitFiberRoot=="function")try{yt.onPostCommitFiberRoot(Ft,S)}catch{}return!0}finally{P.p=_,L.T=m,fT(t,i)}}function dT(t,i,c){i=Nn(c,i),i=Kd(t.stateNode,i,2),t=gi(t,i,2),t!==null&&(es(t,2),fr(t))}function tt(t,i,c){if(t.tag===3)dT(t,t,c);else for(;i!==null;){if(i.tag===3){dT(i,t,c);break}else if(i.tag===1){var m=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Ei===null||!Ei.has(m))){t=Nn(c,t),c=pS(2),m=gi(i,c,2),m!==null&&(mS(c,m,i,t),es(m,2),fr(m));break}}i=i.return}}function bp(t,i,c){var m=t.pingCache;if(m===null){m=t.pingCache=new O3;var _=new Set;m.set(i,_)}else _=m.get(i),_===void 0&&(_=new Set,m.set(i,_));_.has(c)||(fp=!0,_.add(c),t=I3.bind(null,t,i,c),i.then(t,t))}function I3(t,i,c){var m=t.pingCache;m!==null&&m.delete(i),t.pingedLanes|=t.suspendedLanes&c,t.warmLanes&=~c,ot===t&&(ze&c)===c&&(_t===4||_t===3&&(ze&62914560)===ze&&300>Oe()-Tc?(Je&2)===0&&ka(t,0):hp|=c,Ia===ze&&(Ia=0)),fr(t)}function pT(t,i){i===0&&(i=Al()),t=os(t,i),t!==null&&(es(t,i),fr(t))}function D3(t){var i=t.memoizedState,c=0;i!==null&&(c=i.retryLane),pT(t,c)}function k3(t,i){var c=0;switch(t.tag){case 31:case 13:var m=t.stateNode,_=t.memoizedState;_!==null&&(c=_.retryLane);break;case 19:m=t.stateNode;break;case 22:m=t.stateNode._retryCache;break;default:throw Error(s(314))}m!==null&&m.delete(i),pT(t,c)}function B3(t,i){return It(t,i)}var jc=null,Pa=null,_p=!1,Lc=!1,wp=!1,Si=0;function fr(t){t!==Pa&&t.next===null&&(Pa===null?jc=Pa=t:Pa=Pa.next=t),Lc=!0,_p||(_p=!0,z3())}function gu(t,i){if(!wp&&Lc){wp=!0;do for(var c=!1,m=jc;m!==null;){if(t!==0){var _=m.pendingLanes;if(_===0)var S=0;else{var $=m.suspendedLanes,U=m.pingedLanes;S=(1<<31-Wt(42|t)+1)-1,S&=_&~($&~U),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(c=!0,vT(m,S))}else S=ze,S=la(m,m===ot?S:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(S&3)===0||Zi(m,S)||(c=!0,vT(m,S));m=m.next}while(c);wp=!1}}function P3(){mT()}function mT(){Lc=_p=!1;var t=0;Si!==0&&W3()&&(t=Si);for(var i=Oe(),c=null,m=jc;m!==null;){var _=m.next,S=gT(m,i);S===0?(m.next=null,c===null?jc=_:c.next=_,_===null&&(Pa=c)):(c=m,(t!==0||(S&3)!==0)&&(Lc=!0)),m=_}$t!==0&&$t!==5||gu(t),Si!==0&&(Si=0)}function gT(t,i){for(var c=t.suspendedLanes,m=t.pingedLanes,_=t.expirationTimes,S=t.pendingLanes&-62914561;0<S;){var $=31-Wt(S),U=1<<$,Z=_[$];Z===-1?((U&c)===0||(U&m)!==0)&&(_[$]=$h(U,i)):Z<=i&&(t.expiredLanes|=U),S&=~U}if(i=ot,c=ze,c=la(t,t===i?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),m=t.callbackNode,c===0||t===i&&(et===2||et===9)||t.cancelPendingCommit!==null)return m!==null&&m!==null&&Tt(m),t.callbackNode=null,t.callbackPriority=0;if((c&3)===0||Zi(t,c)){if(i=c&-c,i===t.callbackPriority)return i;switch(m!==null&&Tt(m),$o(c)){case 2:case 8:c=rt;break;case 32:c=de;break;case 268435456:c=Me;break;default:c=de}return m=yT.bind(null,t),c=It(c,m),t.callbackPriority=i,t.callbackNode=c,i}return m!==null&&m!==null&&Tt(m),t.callbackPriority=2,t.callbackNode=null,2}function yT(t,i){if($t!==0&&$t!==5)return t.callbackNode=null,t.callbackPriority=0,null;var c=t.callbackNode;if(Mc()&&t.callbackNode!==c)return null;var m=ze;return m=la(t,t===ot?m:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),m===0?null:(JS(t,m,i),gT(t,Oe()),t.callbackNode!=null&&t.callbackNode===c?yT.bind(null,t):null)}function vT(t,i){if(Mc())return null;JS(t,i,!0)}function z3(){Z3(function(){(Je&6)!==0?It(We,P3):mT()})}function Ep(){if(Si===0){var t=Sa;t===0&&(t=aa,aa<<=1,(aa&261888)===0&&(aa=256)),Si=t}return Si}function bT(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Ul(""+t)}function _T(t,i){var c=i.ownerDocument.createElement("input");return c.name=i.name,c.value=i.value,t.id&&c.setAttribute("form",t.id),i.parentNode.insertBefore(c,i),t=new FormData(t),c.parentNode.removeChild(c),t}function U3(t,i,c,m,_){if(i==="submit"&&c&&c.stateNode===_){var S=bT((_[Gt]||null).action),$=m.submitter;$&&(i=(i=$[Gt]||null)?bT(i.formAction):$.getAttribute("formAction"),i!==null&&(S=i,$=null));var U=new Fl("action","action",null,m,_);t.push({event:U,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Si!==0){var Z=$?_T(_,$):new FormData(_);Ud(c,{pending:!0,data:Z,method:_.method,action:S},null,Z)}}else typeof S=="function"&&(U.preventDefault(),Z=$?_T(_,$):new FormData(_),Ud(c,{pending:!0,data:Z,method:_.method,action:S},S,Z))},currentTarget:_}]})}}for(var Cp=0;Cp<sd.length;Cp++){var xp=sd[Cp],Q3=xp.toLowerCase(),H3=xp[0].toUpperCase()+xp.slice(1);Un(Q3,"on"+H3)}Un(Wx,"onAnimationEnd"),Un(Jx,"onAnimationIteration"),Un(Zx,"onAnimationStart"),Un("dblclick","onDoubleClick"),Un("focusin","onFocus"),Un("focusout","onBlur"),Un(a3,"onTransitionRun"),Un(o3,"onTransitionStart"),Un(u3,"onTransitionCancel"),Un(e1,"onTransitionEnd"),oi("onMouseEnter",["mouseout","mouseover"]),oi("onMouseLeave",["mouseout","mouseover"]),oi("onPointerEnter",["pointerout","pointerover"]),oi("onPointerLeave",["pointerout","pointerover"]),Sr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Sr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Sr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Sr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Sr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Sr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var yu="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(" "),V3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(yu));function wT(t,i){i=(i&4)!==0;for(var c=0;c<t.length;c++){var m=t[c],_=m.event;m=m.listeners;e:{var S=void 0;if(i)for(var $=m.length-1;0<=$;$--){var U=m[$],Z=U.instance,le=U.currentTarget;if(U=U.listener,Z!==S&&_.isPropagationStopped())break e;S=U,_.currentTarget=le;try{S(_)}catch(pe){Yl(pe)}_.currentTarget=null,S=Z}else for($=0;$<m.length;$++){if(U=m[$],Z=U.instance,le=U.currentTarget,U=U.listener,Z!==S&&_.isPropagationStopped())break e;S=U,_.currentTarget=le;try{S(_)}catch(pe){Yl(pe)}_.currentTarget=null,S=Z}}}}function Pe(t,i){var c=i[ca];c===void 0&&(c=i[ca]=new Set);var m=t+"__bubble";c.has(m)||(ET(i,t,2,!1),c.add(m))}function Sp(t,i,c){var m=0;i&&(m|=4),ET(c,t,m,i)}var $c="_reactListening"+Math.random().toString(36).slice(2);function Tp(t){if(!t[$c]){t[$c]=!0,Il.forEach(function(c){c!=="selectionchange"&&(V3.has(c)||Sp(c,!1,t),Sp(c,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[$c]||(i[$c]=!0,Sp("selectionchange",!1,i))}}function ET(t,i,c,m){switch(WT(i)){case 2:var _=bz;break;case 8:_=_z;break;default:_=zp}c=_.bind(null,i,c,t),_=void 0,!Fh||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(_=!0),m?_!==void 0?t.addEventListener(i,c,{capture:!0,passive:_}):t.addEventListener(i,c,!0):_!==void 0?t.addEventListener(i,c,{passive:_}):t.addEventListener(i,c,!1)}function qp(t,i,c,m,_){var S=m;if((i&1)===0&&(i&2)===0&&m!==null)e:for(;;){if(m===null)return;var $=m.tag;if($===3||$===4){var U=m.stateNode.containerInfo;if(U===_)break;if($===4)for($=m.return;$!==null;){var Z=$.tag;if((Z===3||Z===4)&&$.stateNode.containerInfo===_)return;$=$.return}for(;U!==null;){if($=ri(U),$===null)return;if(Z=$.tag,Z===5||Z===6||Z===26||Z===27){m=S=$;continue e}U=U.parentNode}}m=m.return}qx(function(){var le=S,pe=Hh(c),ge=[];e:{var ce=t1.get(t);if(ce!==void 0){var he=Fl,Te=t;switch(t){case"keypress":if(Hl(c)===0)break e;case"keydown":case"keyup":he=kP;break;case"focusin":Te="focus",he=Xh;break;case"focusout":Te="blur",he=Xh;break;case"beforeblur":case"afterblur":he=Xh;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=Rx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=TP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=zP;break;case Wx:case Jx:case Zx:he=NP;break;case e1:he=QP;break;case"scroll":case"scrollend":he=xP;break;case"wheel":he=VP;break;case"copy":case"cut":case"paste":he=OP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=Mx;break;case"toggle":case"beforetoggle":he=GP}var je=(i&4)!==0,at=!je&&(t==="scroll"||t==="scrollend"),se=je?ce!==null?ce+"Capture":null:ce;je=[];for(var re=le,ue;re!==null;){var me=re;if(ue=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||ue===null||se===null||(me=Bo(re,se),me!=null&&je.push(vu(re,me,ue))),at)break;re=re.return}0<je.length&&(ce=new he(ce,Te,null,c,pe),ge.push({event:ce,listeners:je}))}}if((i&7)===0){e:{if(ce=t==="mouseover"||t==="pointerover",he=t==="mouseout"||t==="pointerout",ce&&c!==Qh&&(Te=c.relatedTarget||c.fromElement)&&(ri(Te)||Te[xr]))break e;if((he||ce)&&(ce=pe.window===pe?pe:(ce=pe.ownerDocument)?ce.defaultView||ce.parentWindow:window,he?(Te=c.relatedTarget||c.toElement,he=le,Te=Te?ri(Te):null,Te!==null&&(at=o(Te),je=Te.tag,Te!==at||je!==5&&je!==27&&je!==6)&&(Te=null)):(he=null,Te=le),he!==Te)){if(je=Rx,me="onMouseLeave",se="onMouseEnter",re="mouse",(t==="pointerout"||t==="pointerover")&&(je=Mx,me="onPointerLeave",se="onPointerEnter",re="pointer"),at=he==null?ce:si(he),ue=Te==null?ce:si(Te),ce=new je(me,re+"leave",he,c,pe),ce.target=at,ce.relatedTarget=ue,me=null,ri(pe)===le&&(je=new je(se,re+"enter",Te,c,pe),je.target=ue,je.relatedTarget=at,me=je),at=me,he&&Te)t:{for(je=F3,se=he,re=Te,ue=0,me=se;me;me=je(me))ue++;me=0;for(var Re=re;Re;Re=je(Re))me++;for(;0<ue-me;)se=je(se),ue--;for(;0<me-ue;)re=je(re),me--;for(;ue--;){if(se===re||re!==null&&se===re.alternate){je=se;break t}se=je(se),re=je(re)}je=null}else je=null;he!==null&&CT(ge,ce,he,je,!1),Te!==null&&at!==null&&CT(ge,at,Te,je,!0)}}e:{if(ce=le?si(le):window,he=ce.nodeName&&ce.nodeName.toLowerCase(),he==="select"||he==="input"&&ce.type==="file")var Ge=Px;else if(kx(ce))if(zx)Ge=r3;else{Ge=t3;var Ae=e3}else he=ce.nodeName,!he||he.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?le&&Uh(le.elementType)&&(Ge=Px):Ge=n3;if(Ge&&(Ge=Ge(t,le))){Bx(ge,Ge,c,pe);break e}Ae&&Ae(t,ce,le),t==="focusout"&&le&&ce.type==="number"&&le.memoizedProps.value!=null&&ko(ce,"number",ce.value)}switch(Ae=le?si(le):window,t){case"focusin":(kx(Ae)||Ae.contentEditable==="true")&&(ya=Ae,nd=le,Go=null);break;case"focusout":Go=nd=ya=null;break;case"mousedown":rd=!0;break;case"contextmenu":case"mouseup":case"dragend":rd=!1,Yx(ge,c,pe);break;case"selectionchange":if(s3)break;case"keydown":case"keyup":Yx(ge,c,pe)}var ke;if(Jh)e:{switch(t){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else ga?Ix(t,c)&&(Ue="onCompositionEnd"):t==="keydown"&&c.keyCode===229&&(Ue="onCompositionStart");Ue&&(jx&&c.locale!=="ko"&&(ga||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&ga&&(ke=Ax()):(li=pe,Gh="value"in li?li.value:li.textContent,ga=!0)),Ae=Ic(le,Ue),0<Ae.length&&(Ue=new Ox(Ue,t,null,c,pe),ge.push({event:Ue,listeners:Ae}),ke?Ue.data=ke:(ke=Dx(c),ke!==null&&(Ue.data=ke)))),(ke=YP?XP(t,c):WP(t,c))&&(Ue=Ic(le,"onBeforeInput"),0<Ue.length&&(Ae=new Ox("onBeforeInput","beforeinput",null,c,pe),ge.push({event:Ae,listeners:Ue}),Ae.data=ke)),U3(ge,t,le,c,pe)}wT(ge,i)})}function vu(t,i,c){return{instance:t,listener:i,currentTarget:c}}function Ic(t,i){for(var c=i+"Capture",m=[];t!==null;){var _=t,S=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||S===null||(_=Bo(t,c),_!=null&&m.unshift(vu(t,_,S)),_=Bo(t,i),_!=null&&m.push(vu(t,_,S))),t.tag===3)return m;t=t.return}return[]}function F3(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function CT(t,i,c,m,_){for(var S=i._reactName,$=[];c!==null&&c!==m;){var U=c,Z=U.alternate,le=U.stateNode;if(U=U.tag,Z!==null&&Z===m)break;U!==5&&U!==26&&U!==27||le===null||(Z=le,_?(le=Bo(c,S),le!=null&&$.unshift(vu(c,le,Z))):_||(le=Bo(c,S),le!=null&&$.push(vu(c,le,Z)))),c=c.return}$.length!==0&&t.push({event:i,listeners:$})}var G3=/\r\n?/g,K3=/\u0000|\uFFFD/g;function xT(t){return(typeof t=="string"?t:""+t).replace(G3,`
49
+ `).replace(K3,"")}function ST(t,i){return i=xT(i),xT(t)===i}function st(t,i,c,m,_,S){switch(c){case"children":typeof m=="string"?i==="body"||i==="textarea"&&m===""||da(t,m):(typeof m=="number"||typeof m=="bigint")&&i!=="body"&&da(t,""+m);break;case"className":ha(t,"class",m);break;case"tabIndex":ha(t,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":ha(t,c,m);break;case"style":Sx(t,m,S);break;case"data":if(i!=="object"){ha(t,"data",m);break}case"src":case"href":if(m===""&&(i!=="a"||c!=="href")){t.removeAttribute(c);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){t.removeAttribute(c);break}m=Ul(""+m),t.setAttribute(c,m);break;case"action":case"formAction":if(typeof m=="function"){t.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(c==="formAction"?(i!=="input"&&st(t,i,"name",_.name,_,null),st(t,i,"formEncType",_.formEncType,_,null),st(t,i,"formMethod",_.formMethod,_,null),st(t,i,"formTarget",_.formTarget,_,null)):(st(t,i,"encType",_.encType,_,null),st(t,i,"method",_.method,_,null),st(t,i,"target",_.target,_,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){t.removeAttribute(c);break}m=Ul(""+m),t.setAttribute(c,m);break;case"onClick":m!=null&&(t.onclick=qr);break;case"onScroll":m!=null&&Pe("scroll",t);break;case"onScrollEnd":m!=null&&Pe("scrollend",t);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(s(61));if(c=m.__html,c!=null){if(_.children!=null)throw Error(s(60));t.innerHTML=c}}break;case"multiple":t.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":t.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){t.removeAttribute("xlink:href");break}c=Ul(""+m),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?t.setAttribute(c,""+m):t.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?t.setAttribute(c,""):t.removeAttribute(c);break;case"capture":case"download":m===!0?t.setAttribute(c,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?t.setAttribute(c,m):t.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?t.setAttribute(c,m):t.removeAttribute(c);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?t.removeAttribute(c):t.setAttribute(c,m);break;case"popover":Pe("beforetoggle",t),Pe("toggle",t),fa(t,"popover",m);break;case"xlinkActuate":zn(t,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":zn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":zn(t,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":zn(t,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":zn(t,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":zn(t,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":zn(t,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":zn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":zn(t,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":fa(t,"is",m);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=EP.get(c)||c,fa(t,c,m))}}function Ap(t,i,c,m,_,S){switch(c){case"style":Sx(t,m,S);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(s(61));if(c=m.__html,c!=null){if(_.children!=null)throw Error(s(60));t.innerHTML=c}}break;case"children":typeof m=="string"?da(t,m):(typeof m=="number"||typeof m=="bigint")&&da(t,""+m);break;case"onScroll":m!=null&&Pe("scroll",t);break;case"onScrollEnd":m!=null&&Pe("scrollend",t);break;case"onClick":m!=null&&(t.onclick=qr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Dl.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(_=c.endsWith("Capture"),i=c.slice(2,_?c.length-7:void 0),S=t[Gt]||null,S=S!=null?S[c]:null,typeof S=="function"&&t.removeEventListener(i,S,_),typeof m=="function")){typeof S!="function"&&S!==null&&(c in t?t[c]=null:t.hasAttribute(c)&&t.removeAttribute(c)),t.addEventListener(i,m,_);break e}c in t?t[c]=m:m===!0?t.setAttribute(c,""):fa(t,c,m)}}}function Ut(t,i,c){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pe("error",t),Pe("load",t);var m=!1,_=!1,S;for(S in c)if(c.hasOwnProperty(S)){var $=c[S];if($!=null)switch(S){case"src":m=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:st(t,i,S,$,c,null)}}_&&st(t,i,"srcSet",c.srcSet,c,null),m&&st(t,i,"src",c.src,c,null);return;case"input":Pe("invalid",t);var U=S=$=_=null,Z=null,le=null;for(m in c)if(c.hasOwnProperty(m)){var pe=c[m];if(pe!=null)switch(m){case"name":_=pe;break;case"type":$=pe;break;case"checked":Z=pe;break;case"defaultChecked":le=pe;break;case"value":S=pe;break;case"defaultValue":U=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(s(137,i));break;default:st(t,i,m,pe,c,null)}}zl(t,S,U,Z,le,$,_,!1);return;case"select":Pe("invalid",t),m=$=S=null;for(_ in c)if(c.hasOwnProperty(_)&&(U=c[_],U!=null))switch(_){case"value":S=U;break;case"defaultValue":$=U;break;case"multiple":m=U;default:st(t,i,_,U,c,null)}i=S,c=$,t.multiple=!!m,i!=null?Tr(t,!!m,i,!1):c!=null&&Tr(t,!!m,c,!0);return;case"textarea":Pe("invalid",t),S=_=m=null;for($ in c)if(c.hasOwnProperty($)&&(U=c[$],U!=null))switch($){case"value":m=U;break;case"defaultValue":_=U;break;case"children":S=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(s(91));break;default:st(t,i,$,U,c,null)}Cx(t,m,_,S);return;case"option":for(Z in c)if(c.hasOwnProperty(Z)&&(m=c[Z],m!=null))switch(Z){case"selected":t.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:st(t,i,Z,m,c,null)}return;case"dialog":Pe("beforetoggle",t),Pe("toggle",t),Pe("cancel",t),Pe("close",t);break;case"iframe":case"object":Pe("load",t);break;case"video":case"audio":for(m=0;m<yu.length;m++)Pe(yu[m],t);break;case"image":Pe("error",t),Pe("load",t);break;case"details":Pe("toggle",t);break;case"embed":case"source":case"link":Pe("error",t),Pe("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(le in c)if(c.hasOwnProperty(le)&&(m=c[le],m!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:st(t,i,le,m,c,null)}return;default:if(Uh(i)){for(pe in c)c.hasOwnProperty(pe)&&(m=c[pe],m!==void 0&&Ap(t,i,pe,m,c,void 0));return}}for(U in c)c.hasOwnProperty(U)&&(m=c[U],m!=null&&st(t,i,U,m,c,null))}function Y3(t,i,c,m){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var _=null,S=null,$=null,U=null,Z=null,le=null,pe=null;for(he in c){var ge=c[he];if(c.hasOwnProperty(he)&&ge!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":Z=ge;default:m.hasOwnProperty(he)||st(t,i,he,null,m,ge)}}for(var ce in m){var he=m[ce];if(ge=c[ce],m.hasOwnProperty(ce)&&(he!=null||ge!=null))switch(ce){case"type":S=he;break;case"name":_=he;break;case"checked":le=he;break;case"defaultChecked":pe=he;break;case"value":$=he;break;case"defaultValue":U=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(s(137,i));break;default:he!==ge&&st(t,i,ce,he,m,ge)}}rs(t,$,U,Z,le,pe,S,_);return;case"select":he=$=U=ce=null;for(S in c)if(Z=c[S],c.hasOwnProperty(S)&&Z!=null)switch(S){case"value":break;case"multiple":he=Z;default:m.hasOwnProperty(S)||st(t,i,S,null,m,Z)}for(_ in m)if(S=m[_],Z=c[_],m.hasOwnProperty(_)&&(S!=null||Z!=null))switch(_){case"value":ce=S;break;case"defaultValue":U=S;break;case"multiple":$=S;default:S!==Z&&st(t,i,_,S,m,Z)}i=U,c=$,m=he,ce!=null?Tr(t,!!c,ce,!1):!!m!=!!c&&(i!=null?Tr(t,!!c,i,!0):Tr(t,!!c,c?[]:"",!1));return;case"textarea":he=ce=null;for(U in c)if(_=c[U],c.hasOwnProperty(U)&&_!=null&&!m.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:st(t,i,U,null,m,_)}for($ in m)if(_=m[$],S=c[$],m.hasOwnProperty($)&&(_!=null||S!=null))switch($){case"value":ce=_;break;case"defaultValue":he=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(s(91));break;default:_!==S&&st(t,i,$,_,m,S)}Ex(t,ce,he);return;case"option":for(var Te in c)if(ce=c[Te],c.hasOwnProperty(Te)&&ce!=null&&!m.hasOwnProperty(Te))switch(Te){case"selected":t.selected=!1;break;default:st(t,i,Te,null,m,ce)}for(Z in m)if(ce=m[Z],he=c[Z],m.hasOwnProperty(Z)&&ce!==he&&(ce!=null||he!=null))switch(Z){case"selected":t.selected=ce&&typeof ce!="function"&&typeof ce!="symbol";break;default:st(t,i,Z,ce,m,he)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var je in c)ce=c[je],c.hasOwnProperty(je)&&ce!=null&&!m.hasOwnProperty(je)&&st(t,i,je,null,m,ce);for(le in m)if(ce=m[le],he=c[le],m.hasOwnProperty(le)&&ce!==he&&(ce!=null||he!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(s(137,i));break;default:st(t,i,le,ce,m,he)}return;default:if(Uh(i)){for(var at in c)ce=c[at],c.hasOwnProperty(at)&&ce!==void 0&&!m.hasOwnProperty(at)&&Ap(t,i,at,void 0,m,ce);for(pe in m)ce=m[pe],he=c[pe],!m.hasOwnProperty(pe)||ce===he||ce===void 0&&he===void 0||Ap(t,i,pe,ce,m,he);return}}for(var se in c)ce=c[se],c.hasOwnProperty(se)&&ce!=null&&!m.hasOwnProperty(se)&&st(t,i,se,null,m,ce);for(ge in m)ce=m[ge],he=c[ge],!m.hasOwnProperty(ge)||ce===he||ce==null&&he==null||st(t,i,ge,ce,m,he)}function TT(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function X3(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,c=performance.getEntriesByType("resource"),m=0;m<c.length;m++){var _=c[m],S=_.transferSize,$=_.initiatorType,U=_.duration;if(S&&U&&TT($)){for($=0,U=_.responseEnd,m+=1;m<c.length;m++){var Z=c[m],le=Z.startTime;if(le>U)break;var pe=Z.transferSize,ge=Z.initiatorType;pe&&TT(ge)&&(Z=Z.responseEnd,$+=pe*(Z<U?1:(U-le)/(Z-le)))}if(--m,i+=8*(S+$)/(_.duration/1e3),t++,10<t)break}}if(0<t)return i/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Np=null,Rp=null;function Dc(t){return t.nodeType===9?t:t.ownerDocument}function qT(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function AT(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function Op(t,i){return t==="textarea"||t==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Mp=null;function W3(){var t=window.event;return t&&t.type==="popstate"?t===Mp?!1:(Mp=t,!0):(Mp=null,!1)}var NT=typeof setTimeout=="function"?setTimeout:void 0,J3=typeof clearTimeout=="function"?clearTimeout:void 0,RT=typeof Promise=="function"?Promise:void 0,Z3=typeof queueMicrotask=="function"?queueMicrotask:typeof RT<"u"?function(t){return RT.resolve(null).then(t).catch(ez)}:NT;function ez(t){setTimeout(function(){throw t})}function Ti(t){return t==="head"}function OT(t,i){var c=i,m=0;do{var _=c.nextSibling;if(t.removeChild(c),_&&_.nodeType===8)if(c=_.data,c==="/$"||c==="/&"){if(m===0){t.removeChild(_),Ha(i);return}m--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")m++;else if(c==="html")bu(t.ownerDocument.documentElement);else if(c==="head"){c=t.ownerDocument.head,bu(c);for(var S=c.firstChild;S;){var $=S.nextSibling,U=S.nodeName;S[ts]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&S.rel.toLowerCase()==="stylesheet"||c.removeChild(S),S=$}}else c==="body"&&bu(t.ownerDocument.body);c=_}while(c);Ha(i)}function MT(t,i){var c=t;t=0;do{var m=c.nextSibling;if(c.nodeType===1?i?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(i?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),m&&m.nodeType===8)if(c=m.data,c==="/$"){if(t===0)break;t--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||t++;c=m}while(c)}function jp(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var c=i;switch(i=i.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":jp(c),Io(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}t.removeChild(c)}}function tz(t,i,c,m){for(;t.nodeType===1;){var _=c;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!m&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(m){if(!t[ts])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(S=t.getAttribute("rel"),S==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(S!==_.rel||t.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||t.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||t.getAttribute("title")!==(_.title==null?null:_.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(S=t.getAttribute("src"),(S!==(_.src==null?null:_.src)||t.getAttribute("type")!==(_.type==null?null:_.type)||t.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&S&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var S=_.name==null?null:""+_.name;if(_.type==="hidden"&&t.getAttribute("name")===S)return t}else return t;if(t=Ln(t.nextSibling),t===null)break}return null}function nz(t,i,c){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!c||(t=Ln(t.nextSibling),t===null))return null;return t}function jT(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=Ln(t.nextSibling),t===null))return null;return t}function Lp(t){return t.data==="$?"||t.data==="$~"}function $p(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function rz(t,i){var c=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||c.readyState!=="loading")i();else{var m=function(){i(),c.removeEventListener("DOMContentLoaded",m)};c.addEventListener("DOMContentLoaded",m),t._reactRetry=m}}function Ln(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return t}var Ip=null;function LT(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var c=t.data;if(c==="/$"||c==="/&"){if(i===0)return Ln(t.nextSibling);i--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||i++}t=t.nextSibling}return null}function $T(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var c=t.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(i===0)return t;i--}else c!=="/$"&&c!=="/&"||i++}t=t.previousSibling}return null}function IT(t,i,c){switch(i=Dc(c),t){case"html":if(t=i.documentElement,!t)throw Error(s(452));return t;case"head":if(t=i.head,!t)throw Error(s(453));return t;case"body":if(t=i.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function bu(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Io(t)}var $n=new Map,DT=new Set;function kc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Qr=P.d;P.d={f:iz,r:sz,D:az,C:oz,L:uz,m:lz,X:fz,S:cz,M:hz};function iz(){var t=Qr.f(),i=Nc();return t||i}function sz(t){var i=ii(t);i!==null&&i.tag===5&&i.type==="form"?eS(i):Qr.r(t)}var za=typeof document>"u"?null:document;function kT(t,i,c){var m=za;if(m&&typeof i=="string"&&i){var _=rn(i);_='link[rel="'+t+'"][href="'+_+'"]',typeof c=="string"&&(_+='[crossorigin="'+c+'"]'),DT.has(_)||(DT.add(_),t={rel:t,crossOrigin:c,href:i},m.querySelector(_)===null&&(i=m.createElement("link"),Ut(i,"link",t),At(i),m.head.appendChild(i)))}}function az(t){Qr.D(t),kT("dns-prefetch",t,null)}function oz(t,i){Qr.C(t,i),kT("preconnect",t,i)}function uz(t,i,c){Qr.L(t,i,c);var m=za;if(m&&t&&i){var _='link[rel="preload"][as="'+rn(i)+'"]';i==="image"&&c&&c.imageSrcSet?(_+='[imagesrcset="'+rn(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(_+='[imagesizes="'+rn(c.imageSizes)+'"]')):_+='[href="'+rn(t)+'"]';var S=_;switch(i){case"style":S=Ua(t);break;case"script":S=Qa(t)}$n.has(S)||(t=d({rel:"preload",href:i==="image"&&c&&c.imageSrcSet?void 0:t,as:i},c),$n.set(S,t),m.querySelector(_)!==null||i==="style"&&m.querySelector(_u(S))||i==="script"&&m.querySelector(wu(S))||(i=m.createElement("link"),Ut(i,"link",t),At(i),m.head.appendChild(i)))}}function lz(t,i){Qr.m(t,i);var c=za;if(c&&t){var m=i&&typeof i.as=="string"?i.as:"script",_='link[rel="modulepreload"][as="'+rn(m)+'"][href="'+rn(t)+'"]',S=_;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=Qa(t)}if(!$n.has(S)&&(t=d({rel:"modulepreload",href:t},i),$n.set(S,t),c.querySelector(_)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(wu(S)))return}m=c.createElement("link"),Ut(m,"link",t),At(m),c.head.appendChild(m)}}}function cz(t,i,c){Qr.S(t,i,c);var m=za;if(m&&t){var _=ai(m).hoistableStyles,S=Ua(t);i=i||"default";var $=_.get(S);if(!$){var U={loading:0,preload:null};if($=m.querySelector(_u(S)))U.loading=5;else{t=d({rel:"stylesheet",href:t,"data-precedence":i},c),(c=$n.get(S))&&Dp(t,c);var Z=$=m.createElement("link");At(Z),Ut(Z,"link",t),Z._p=new Promise(function(le,pe){Z.onload=le,Z.onerror=pe}),Z.addEventListener("load",function(){U.loading|=1}),Z.addEventListener("error",function(){U.loading|=2}),U.loading|=4,Bc($,i,m)}$={type:"stylesheet",instance:$,count:1,state:U},_.set(S,$)}}}function fz(t,i){Qr.X(t,i);var c=za;if(c&&t){var m=ai(c).hoistableScripts,_=Qa(t),S=m.get(_);S||(S=c.querySelector(wu(_)),S||(t=d({src:t,async:!0},i),(i=$n.get(_))&&kp(t,i),S=c.createElement("script"),At(S),Ut(S,"link",t),c.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},m.set(_,S))}}function hz(t,i){Qr.M(t,i);var c=za;if(c&&t){var m=ai(c).hoistableScripts,_=Qa(t),S=m.get(_);S||(S=c.querySelector(wu(_)),S||(t=d({src:t,async:!0,type:"module"},i),(i=$n.get(_))&&kp(t,i),S=c.createElement("script"),At(S),Ut(S,"link",t),c.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},m.set(_,S))}}function BT(t,i,c,m){var _=(_=ie.current)?kc(_):null;if(!_)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(i=Ua(c.href),c=ai(_).hoistableStyles,m=c.get(i),m||(m={type:"style",instance:null,count:0,state:null},c.set(i,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){t=Ua(c.href);var S=ai(_).hoistableStyles,$=S.get(t);if($||(_=_.ownerDocument||_,$={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(t,$),(S=_.querySelector(_u(t)))&&!S._p&&($.instance=S,$.state.loading=5),$n.has(t)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},$n.set(t,c),S||dz(_,t,c,$.state))),i&&m===null)throw Error(s(528,""));return $}if(i&&m!==null)throw Error(s(529,""));return null;case"script":return i=c.async,c=c.src,typeof c=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Qa(c),c=ai(_).hoistableScripts,m=c.get(i),m||(m={type:"script",instance:null,count:0,state:null},c.set(i,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function Ua(t){return'href="'+rn(t)+'"'}function _u(t){return'link[rel="stylesheet"]['+t+"]"}function PT(t){return d({},t,{"data-precedence":t.precedence,precedence:null})}function dz(t,i,c,m){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?m.loading=1:(i=t.createElement("link"),m.preload=i,i.addEventListener("load",function(){return m.loading|=1}),i.addEventListener("error",function(){return m.loading|=2}),Ut(i,"link",c),At(i),t.head.appendChild(i))}function Qa(t){return'[src="'+rn(t)+'"]'}function wu(t){return"script[async]"+t}function zT(t,i,c){if(i.count++,i.instance===null)switch(i.type){case"style":var m=t.querySelector('style[data-href~="'+rn(c.href)+'"]');if(m)return i.instance=m,At(m),m;var _=d({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return m=(t.ownerDocument||t).createElement("style"),At(m),Ut(m,"style",_),Bc(m,c.precedence,t),i.instance=m;case"stylesheet":_=Ua(c.href);var S=t.querySelector(_u(_));if(S)return i.state.loading|=4,i.instance=S,At(S),S;m=PT(c),(_=$n.get(_))&&Dp(m,_),S=(t.ownerDocument||t).createElement("link"),At(S);var $=S;return $._p=new Promise(function(U,Z){$.onload=U,$.onerror=Z}),Ut(S,"link",m),i.state.loading|=4,Bc(S,c.precedence,t),i.instance=S;case"script":return S=Qa(c.src),(_=t.querySelector(wu(S)))?(i.instance=_,At(_),_):(m=c,(_=$n.get(S))&&(m=d({},c),kp(m,_)),t=t.ownerDocument||t,_=t.createElement("script"),At(_),Ut(_,"link",m),t.head.appendChild(_),i.instance=_);case"void":return null;default:throw Error(s(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(m=i.instance,i.state.loading|=4,Bc(m,c.precedence,t));return i.instance}function Bc(t,i,c){for(var m=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=m.length?m[m.length-1]:null,S=_,$=0;$<m.length;$++){var U=m[$];if(U.dataset.precedence===i)S=U;else if(S!==_)break}S?S.parentNode.insertBefore(t,S.nextSibling):(i=c.nodeType===9?c.head:c,i.insertBefore(t,i.firstChild))}function Dp(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function kp(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var Pc=null;function UT(t,i,c){if(Pc===null){var m=new Map,_=Pc=new Map;_.set(c,m)}else _=Pc,m=_.get(c),m||(m=new Map,_.set(c,m));if(m.has(t))return m;for(m.set(t,null),c=c.getElementsByTagName(t),_=0;_<c.length;_++){var S=c[_];if(!(S[ts]||S[Lt]||t==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var $=S.getAttribute(i)||"";$=t+$;var U=m.get($);U?U.push(S):m.set($,[S])}}return m}function QT(t,i,c){t=t.ownerDocument||t,t.head.insertBefore(c,i==="title"?t.querySelector("head > title"):null)}function pz(t,i,c){if(c===1||i.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return t=i.disabled,typeof i.precedence=="string"&&t==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function HT(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function mz(t,i,c,m){if(c.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var _=Ua(m.href),S=i.querySelector(_u(_));if(S){i=S._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=zc.bind(t),i.then(t,t)),c.state.loading|=4,c.instance=S,At(S);return}S=i.ownerDocument||i,m=PT(m),(_=$n.get(_))&&Dp(m,_),S=S.createElement("link"),At(S);var $=S;$._p=new Promise(function(U,Z){$.onload=U,$.onerror=Z}),Ut(S,"link",m),c.instance=S}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(c,i),(i=c.state.preload)&&(c.state.loading&3)===0&&(t.count++,c=zc.bind(t),i.addEventListener("load",c),i.addEventListener("error",c))}}var Bp=0;function gz(t,i){return t.stylesheets&&t.count===0&&Qc(t,t.stylesheets),0<t.count||0<t.imgCount?function(c){var m=setTimeout(function(){if(t.stylesheets&&Qc(t,t.stylesheets),t.unsuspend){var S=t.unsuspend;t.unsuspend=null,S()}},6e4+i);0<t.imgBytes&&Bp===0&&(Bp=62500*X3());var _=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Qc(t,t.stylesheets),t.unsuspend)){var S=t.unsuspend;t.unsuspend=null,S()}},(t.imgBytes>Bp?50:800)+i);return t.unsuspend=c,function(){t.unsuspend=null,clearTimeout(m),clearTimeout(_)}}:null}function zc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Qc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Uc=null;function Qc(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Uc=new Map,i.forEach(yz,t),Uc=null,zc.call(t))}function yz(t,i){if(!(i.state.loading&4)){var c=Uc.get(t);if(c)var m=c.get(null);else{c=new Map,Uc.set(t,c);for(var _=t.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<_.length;S++){var $=_[S];($.nodeName==="LINK"||$.getAttribute("media")!=="not all")&&(c.set($.dataset.precedence,$),m=$)}m&&c.set(null,m)}_=i.instance,$=_.getAttribute("data-precedence"),S=c.get($)||m,S===m&&c.set(null,_),c.set($,_),this.count++,m=zc.bind(this),_.addEventListener("load",m),_.addEventListener("error",m),S?S.parentNode.insertBefore(_,S.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(_,t.firstChild)),i.state.loading|=4}}var Eu={$$typeof:C,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function vz(t,i,c,m,_,S,$,U,Z){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=jo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jo(0),this.hiddenUpdates=jo(null),this.identifierPrefix=m,this.onUncaughtError=_,this.onCaughtError=S,this.onRecoverableError=$,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function VT(t,i,c,m,_,S,$,U,Z,le,pe,ge){return t=new vz(t,i,c,$,Z,le,pe,ge,U),i=1,S===!0&&(i|=24),S=yn(3,null,null,i),t.current=S,S.stateNode=t,i=vd(),i.refCount++,t.pooledCache=i,i.refCount++,S.memoizedState={element:m,isDehydrated:c,cache:i},Ed(S),t}function FT(t){return t?(t=_a,t):_a}function GT(t,i,c,m,_,S){_=FT(_),m.context===null?m.context=_:m.pendingContext=_,m=mi(i),m.payload={element:c},S=S===void 0?null:S,S!==null&&(m.callback=S),c=gi(t,m,i),c!==null&&(cn(c,t,i),eu(c,t,i))}function KT(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var c=t.retryLane;t.retryLane=c!==0&&c<i?c:i}}function Pp(t,i){KT(t,i),(t=t.alternate)&&KT(t,i)}function YT(t){if(t.tag===13||t.tag===31){var i=os(t,67108864);i!==null&&cn(i,t,67108864),Pp(t,67108864)}}function XT(t){if(t.tag===13||t.tag===31){var i=En();i=Lo(i);var c=os(t,i);c!==null&&cn(c,t,i),Pp(t,i)}}var Hc=!0;function bz(t,i,c,m){var _=L.T;L.T=null;var S=P.p;try{P.p=2,zp(t,i,c,m)}finally{P.p=S,L.T=_}}function _z(t,i,c,m){var _=L.T;L.T=null;var S=P.p;try{P.p=8,zp(t,i,c,m)}finally{P.p=S,L.T=_}}function zp(t,i,c,m){if(Hc){var _=Up(m);if(_===null)qp(t,i,m,Vc,c),JT(t,m);else if(Ez(_,t,i,c,m))m.stopPropagation();else if(JT(t,m),i&4&&-1<wz.indexOf(t)){for(;_!==null;){var S=ii(_);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var $=Cr(S.pendingLanes);if($!==0){var U=S;for(U.pendingLanes|=2,U.entangledLanes|=2;$;){var Z=1<<31-Wt($);U.entanglements[1]|=Z,$&=~Z}fr(S),(Je&6)===0&&(qc=Oe()+500,gu(0))}}break;case 31:case 13:U=os(S,2),U!==null&&cn(U,S,2),Nc(),Pp(S,2)}if(S=Up(m),S===null&&qp(t,i,m,Vc,c),S===_)break;_=S}_!==null&&m.stopPropagation()}else qp(t,i,m,null,c)}}function Up(t){return t=Hh(t),Qp(t)}var Vc=null;function Qp(t){if(Vc=null,t=ri(t),t!==null){var i=o(t);if(i===null)t=null;else{var c=i.tag;if(c===13){if(t=l(i),t!==null)return t;t=null}else if(c===31){if(t=u(i),t!==null)return t;t=null}else if(c===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return Vc=t,null}function WT(t){switch(t){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Xe()){case We:return 2;case rt:return 8;case de:case X:return 32;case Me:return 268435456;default:return 32}default:return 32}}var Hp=!1,qi=null,Ai=null,Ni=null,Cu=new Map,xu=new Map,Ri=[],wz="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".split(" ");function JT(t,i){switch(t){case"focusin":case"focusout":qi=null;break;case"dragenter":case"dragleave":Ai=null;break;case"mouseover":case"mouseout":Ni=null;break;case"pointerover":case"pointerout":Cu.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":xu.delete(i.pointerId)}}function Su(t,i,c,m,_,S){return t===null||t.nativeEvent!==S?(t={blockedOn:i,domEventName:c,eventSystemFlags:m,nativeEvent:S,targetContainers:[_]},i!==null&&(i=ii(i),i!==null&&YT(i)),t):(t.eventSystemFlags|=m,i=t.targetContainers,_!==null&&i.indexOf(_)===-1&&i.push(_),t)}function Ez(t,i,c,m,_){switch(i){case"focusin":return qi=Su(qi,t,i,c,m,_),!0;case"dragenter":return Ai=Su(Ai,t,i,c,m,_),!0;case"mouseover":return Ni=Su(Ni,t,i,c,m,_),!0;case"pointerover":var S=_.pointerId;return Cu.set(S,Su(Cu.get(S)||null,t,i,c,m,_)),!0;case"gotpointercapture":return S=_.pointerId,xu.set(S,Su(xu.get(S)||null,t,i,c,m,_)),!0}return!1}function ZT(t){var i=ri(t.target);if(i!==null){var c=o(i);if(c!==null){if(i=c.tag,i===13){if(i=l(c),i!==null){t.blockedOn=i,jl(t.priority,function(){XT(c)});return}}else if(i===31){if(i=u(c),i!==null){t.blockedOn=i,jl(t.priority,function(){XT(c)});return}}else if(i===3&&c.stateNode.current.memoizedState.isDehydrated){t.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Fc(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var c=Up(t.nativeEvent);if(c===null){c=t.nativeEvent;var m=new c.constructor(c.type,c);Qh=m,c.target.dispatchEvent(m),Qh=null}else return i=ii(c),i!==null&&YT(i),t.blockedOn=c,!1;i.shift()}return!0}function eq(t,i,c){Fc(t)&&c.delete(i)}function Cz(){Hp=!1,qi!==null&&Fc(qi)&&(qi=null),Ai!==null&&Fc(Ai)&&(Ai=null),Ni!==null&&Fc(Ni)&&(Ni=null),Cu.forEach(eq),xu.forEach(eq)}function Gc(t,i){t.blockedOn===i&&(t.blockedOn=null,Hp||(Hp=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Cz)))}var Kc=null;function tq(t){Kc!==t&&(Kc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Kc===t&&(Kc=null);for(var i=0;i<t.length;i+=3){var c=t[i],m=t[i+1],_=t[i+2];if(typeof m!="function"){if(Qp(m||c)===null)continue;break}var S=ii(c);S!==null&&(t.splice(i,3),i-=3,Ud(S,{pending:!0,data:_,method:c.method,action:m},m,_))}}))}function Ha(t){function i(Z){return Gc(Z,t)}qi!==null&&Gc(qi,t),Ai!==null&&Gc(Ai,t),Ni!==null&&Gc(Ni,t),Cu.forEach(i),xu.forEach(i);for(var c=0;c<Ri.length;c++){var m=Ri[c];m.blockedOn===t&&(m.blockedOn=null)}for(;0<Ri.length&&(c=Ri[0],c.blockedOn===null);)ZT(c),c.blockedOn===null&&Ri.shift();if(c=(t.ownerDocument||t).$$reactFormReplay,c!=null)for(m=0;m<c.length;m+=3){var _=c[m],S=c[m+1],$=_[Gt]||null;if(typeof S=="function")$||tq(c);else if($){var U=null;if(S&&S.hasAttribute("formAction")){if(_=S,$=S[Gt]||null)U=$.formAction;else if(Qp(_)!==null)continue}else U=$.action;typeof U=="function"?c[m+1]=U:(c.splice(m,3),m-=3),tq(c)}}}function nq(){function t(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function($){return _=$})},focusReset:"manual",scroll:"manual"})}function i(){_!==null&&(_(),_=null),m||setTimeout(c,20)}function c(){if(!m&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,_=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(c,100),function(){m=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),_!==null&&(_(),_=null)}}}function Vp(t){this._internalRoot=t}Yc.prototype.render=Vp.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(s(409));var c=i.current,m=En();GT(c,m,t,i,null,null)},Yc.prototype.unmount=Vp.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;GT(t.current,2,null,t,null,null),Nc(),i[xr]=null}};function Yc(t){this._internalRoot=t}Yc.prototype.unstable_scheduleHydration=function(t){if(t){var i=Ml();t={blockedOn:null,target:t,priority:i};for(var c=0;c<Ri.length&&i!==0&&i<Ri[c].priority;c++);Ri.splice(c,0,t),c===0&&ZT(t)}};var rq=n.version;if(rq!=="19.2.4")throw Error(s(527,rq,"19.2.4"));P.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=f(i),t=t!==null?p(t):null,t=t===null?null:t.stateNode,t};var xz={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xc.isDisabled&&Xc.supportsFiber)try{Ft=Xc.inject(xz),yt=Xc}catch{}}return qu.createRoot=function(t,i){if(!a(t))throw Error(s(299));var c=!1,m="",_=cS,S=fS,$=hS;return i!=null&&(i.unstable_strictMode===!0&&(c=!0),i.identifierPrefix!==void 0&&(m=i.identifierPrefix),i.onUncaughtError!==void 0&&(_=i.onUncaughtError),i.onCaughtError!==void 0&&(S=i.onCaughtError),i.onRecoverableError!==void 0&&($=i.onRecoverableError)),i=VT(t,1,!1,null,null,c,m,null,_,S,$,nq),t[xr]=i.current,Tp(t),new Vp(i)},qu.hydrateRoot=function(t,i,c){if(!a(t))throw Error(s(299));var m=!1,_="",S=cS,$=fS,U=hS,Z=null;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(_=c.identifierPrefix),c.onUncaughtError!==void 0&&(S=c.onUncaughtError),c.onCaughtError!==void 0&&($=c.onCaughtError),c.onRecoverableError!==void 0&&(U=c.onRecoverableError),c.formState!==void 0&&(Z=c.formState)),i=VT(t,1,!0,i,c??null,m,_,Z,S,$,U,nq),i.context=FT(null),c=i.current,m=En(),m=Lo(m),_=mi(m),_.callback=null,gi(c,_,m),c=m,i.current.lanes=c,es(i,c),fr(i),t[xr]=i.current,Tp(t),new Yc(i)},qu.version="19.2.4",qu}var pq;function Iz(){if(pq)return Yp.exports;pq=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Yp.exports=$z(),Yp.exports}var Dz=Iz(),Qs=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},kz={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)},Ii,fC,mI,Bz=(mI=class{constructor(){Ce(this,Ii,kz);Ce(this,fC,!1)}setTimeoutProvider(e){ye(this,Ii,e)}setTimeout(e,n){return Y(this,Ii).setTimeout(e,n)}clearTimeout(e){Y(this,Ii).clearTimeout(e)}setInterval(e,n){return Y(this,Ii).setInterval(e,n)}clearInterval(e){Y(this,Ii).clearInterval(e)}},Ii=new WeakMap,fC=new WeakMap,mI),Es=new Bz;function Pz(e){setTimeout(e,0)}var $s=typeof window>"u"||"Deno"in globalThis;function Xt(){}function zz(e,n){return typeof e=="function"?e(n):e}function TE(e){return typeof e=="number"&&e>=0&&e!==1/0}function AI(e,n){return Math.max(e+(n||0)-Date.now(),0)}function Fi(e,n){return typeof e=="function"?e(n):e}function kn(e,n){return typeof e=="function"?e(n):e}function mq(e,n){const{type:r="all",exact:s,fetchStatus:a,predicate:o,queryKey:l,stale:u}=e;if(l){if(s){if(n.queryHash!==dC(l,n.options))return!1}else if(!zu(n.queryKey,l))return!1}if(r!=="all"){const h=n.isActive();if(r==="active"&&!h||r==="inactive"&&h)return!1}return!(typeof u=="boolean"&&n.isStale()!==u||a&&a!==n.state.fetchStatus||o&&!o(n))}function gq(e,n){const{exact:r,status:s,predicate:a,mutationKey:o}=e;if(o){if(!n.options.mutationKey)return!1;if(r){if(Ki(n.options.mutationKey)!==Ki(o))return!1}else if(!zu(n.options.mutationKey,o))return!1}return!(s&&n.state.status!==s||a&&!a(n))}function dC(e,n){return((n==null?void 0:n.queryKeyHashFn)||Ki)(e)}function Ki(e){return JSON.stringify(e,(n,r)=>qE(r)?Object.keys(r).sort().reduce((s,a)=>(s[a]=r[a],s),{}):r)}function zu(e,n){return e===n?!0:typeof e!=typeof n?!1:e&&n&&typeof e=="object"&&typeof n=="object"?Object.keys(n).every(r=>zu(e[r],n[r])):!1}var Uz=Object.prototype.hasOwnProperty;function pC(e,n,r=0){if(e===n)return e;if(r>500)return n;const s=yq(e)&&yq(n);if(!s&&!(qE(e)&&qE(n)))return n;const o=(s?e:Object.keys(e)).length,l=s?n:Object.keys(n),u=l.length,h=s?new Array(u):{};let f=0;for(let p=0;p<u;p++){const d=s?p:l[p],g=e[d],y=n[d];if(g===y){h[d]=g,(s?p<o:Uz.call(e,d))&&f++;continue}if(g===null||y===null||typeof g!="object"||typeof y!="object"){h[d]=y;continue}const E=pC(g,y,r+1);h[d]=E,E===g&&f++}return o===u&&f===o?e:h}function Uu(e,n){if(!n||Object.keys(e).length!==Object.keys(n).length)return!1;for(const r in e)if(e[r]!==n[r])return!1;return!0}function yq(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function qE(e){if(!vq(e))return!1;const n=e.constructor;if(n===void 0)return!0;const r=n.prototype;return!(!vq(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function vq(e){return Object.prototype.toString.call(e)==="[object Object]"}function Qz(e){return new Promise(n=>{Es.setTimeout(n,e)})}function AE(e,n,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,n):r.structuralSharing!==!1?pC(e,n):n}function Hz(e,n,r=0){const s=[...e,n];return r&&s.length>r?s.slice(1):s}function Vz(e,n,r=0){const s=[n,...e];return r&&s.length>r?s.slice(0,-1):s}var xn=Symbol();function NI(e,n){return!e.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!e.queryFn||e.queryFn===xn?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function mC(e,n){return typeof e=="function"?e(...n):!!e}function Fz(e,n,r){let s=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=n()),s||(s=!0,a.aborted?r():a.addEventListener("abort",r,{once:!0})),a)}),e}var xs,Di,Ja,gI,Gz=(gI=class extends Qs{constructor(){super();Ce(this,xs);Ce(this,Di);Ce(this,Ja);ye(this,Ja,n=>{if(!$s&&window.addEventListener){const r=()=>n();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){Y(this,Di)||this.setEventListener(Y(this,Ja))}onUnsubscribe(){var n;this.hasListeners()||((n=Y(this,Di))==null||n.call(this),ye(this,Di,void 0))}setEventListener(n){var r;ye(this,Ja,n),(r=Y(this,Di))==null||r.call(this),ye(this,Di,n(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(n){Y(this,xs)!==n&&(ye(this,xs,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(r=>{r(n)})}isFocused(){var n;return typeof Y(this,xs)=="boolean"?Y(this,xs):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},xs=new WeakMap,Di=new WeakMap,Ja=new WeakMap,gI),gC=new Gz;function NE(){let e,n;const r=new Promise((a,o)=>{e=a,n=o});r.status="pending",r.catch(()=>{});function s(a){Object.assign(r,a),delete r.resolve,delete r.reject}return r.resolve=a=>{s({status:"fulfilled",value:a}),e(a)},r.reject=a=>{s({status:"rejected",reason:a}),n(a)},r}var Kz=Pz;function Yz(){let e=[],n=0,r=u=>{u()},s=u=>{u()},a=Kz;const o=u=>{n?e.push(u):a(()=>{r(u)})},l=()=>{const u=e;e=[],u.length&&a(()=>{s(()=>{u.forEach(h=>{r(h)})})})};return{batch:u=>{let h;n++;try{h=u()}finally{n--,n||l()}return h},batchCalls:u=>(...h)=>{o(()=>{u(...h)})},schedule:o,setNotifyFunction:u=>{r=u},setBatchNotifyFunction:u=>{s=u},setScheduler:u=>{a=u}}}var Et=Yz(),Za,ki,eo,yI,Xz=(yI=class extends Qs{constructor(){super();Ce(this,Za,!0);Ce(this,ki);Ce(this,eo);ye(this,eo,n=>{if(!$s&&window.addEventListener){const r=()=>n(!0),s=()=>n(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",s)}}})}onSubscribe(){Y(this,ki)||this.setEventListener(Y(this,eo))}onUnsubscribe(){var n;this.hasListeners()||((n=Y(this,ki))==null||n.call(this),ye(this,ki,void 0))}setEventListener(n){var r;ye(this,eo,n),(r=Y(this,ki))==null||r.call(this),ye(this,ki,n(this.setOnline.bind(this)))}setOnline(n){Y(this,Za)!==n&&(ye(this,Za,n),this.listeners.forEach(s=>{s(n)}))}isOnline(){return Y(this,Za)}},Za=new WeakMap,ki=new WeakMap,eo=new WeakMap,yI),Rf=new Xz;function Wz(e){return Math.min(1e3*2**e,3e4)}function RI(e){return(e??"online")==="online"?Rf.isOnline():!0}var RE=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function OI(e){let n=!1,r=0,s;const a=NE(),o=()=>a.status!=="pending",l=x=>{var v;if(!o()){const b=new RE(x);g(b),(v=e.onCancel)==null||v.call(e,b)}},u=()=>{n=!0},h=()=>{n=!1},f=()=>gC.isFocused()&&(e.networkMode==="always"||Rf.isOnline())&&e.canRun(),p=()=>RI(e.networkMode)&&e.canRun(),d=x=>{o()||(s==null||s(),a.resolve(x))},g=x=>{o()||(s==null||s(),a.reject(x))},y=()=>new Promise(x=>{var v;s=b=>{(o()||f())&&x(b)},(v=e.onPause)==null||v.call(e)}).then(()=>{var x;s=void 0,o()||(x=e.onContinue)==null||x.call(e)}),E=()=>{if(o())return;let x;const v=r===0?e.initialPromise:void 0;try{x=v??e.fn()}catch(b){x=Promise.reject(b)}Promise.resolve(x).then(d).catch(b=>{var N;if(o())return;const w=e.retry??($s?0:3),C=e.retryDelay??Wz,T=typeof C=="function"?C(r,b):C,A=w===!0||typeof w=="number"&&r<w||typeof w=="function"&&w(r,b);if(n||!A){g(b);return}r++,(N=e.onFail)==null||N.call(e,r,b),Qz(T).then(()=>f()?void 0:y()).then(()=>{n?g(b):E()})})};return{promise:a,status:()=>a.status,cancel:l,continue:()=>(s==null||s(),a),cancelRetry:u,continueRetry:h,canStart:p,start:()=>(p()?E():y().then(E),a)}}var Ss,vI,MI=(vI=class{constructor(){Ce(this,Ss)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),TE(this.gcTime)&&ye(this,Ss,Es.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??($s?1/0:300*1e3))}clearGcTimeout(){Y(this,Ss)&&(Es.clearTimeout(Y(this,Ss)),ye(this,Ss,void 0))}},Ss=new WeakMap,vI),Ts,to,In,qs,kt,Ju,As,Fn,Vr,bI,Jz=(bI=class extends MI{constructor(n){super();Ce(this,Fn);Ce(this,Ts);Ce(this,to);Ce(this,In);Ce(this,qs);Ce(this,kt);Ce(this,Ju);Ce(this,As);ye(this,As,!1),ye(this,Ju,n.defaultOptions),this.setOptions(n.options),this.observers=[],ye(this,qs,n.client),ye(this,In,Y(this,qs).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,ye(this,Ts,_q(this.options)),this.state=n.state??Y(this,Ts),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var n;return(n=Y(this,kt))==null?void 0:n.promise}setOptions(n){if(this.options={...Y(this,Ju),...n},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=_q(this.options);r.data!==void 0&&(this.setState(bq(r.data,r.dataUpdatedAt)),ye(this,Ts,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Y(this,In).remove(this)}setData(n,r){const s=AE(this.state.data,n,this.options);return Le(this,Fn,Vr).call(this,{data:s,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),s}setState(n,r){Le(this,Fn,Vr).call(this,{type:"setState",state:n,setStateOptions:r})}cancel(n){var s,a;const r=(s=Y(this,kt))==null?void 0:s.promise;return(a=Y(this,kt))==null||a.cancel(n),r?r.then(Xt).catch(Xt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Y(this,Ts))}isActive(){return this.observers.some(n=>kn(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===xn||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>Fi(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!AI(this.state.dataUpdatedAt,n)}onFocus(){var r;const n=this.observers.find(s=>s.shouldFetchOnWindowFocus());n==null||n.refetch({cancelRefetch:!1}),(r=Y(this,kt))==null||r.continue()}onOnline(){var r;const n=this.observers.find(s=>s.shouldFetchOnReconnect());n==null||n.refetch({cancelRefetch:!1}),(r=Y(this,kt))==null||r.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),Y(this,In).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(r=>r!==n),this.observers.length||(Y(this,kt)&&(Y(this,As)?Y(this,kt).cancel({revert:!0}):Y(this,kt).cancelRetry()),this.scheduleGc()),Y(this,In).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Le(this,Fn,Vr).call(this,{type:"invalidate"})}async fetch(n,r){var h,f,p,d,g,y,E,x,v,b,w,C;if(this.state.fetchStatus!=="idle"&&((h=Y(this,kt))==null?void 0:h.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(Y(this,kt))return Y(this,kt).continueRetry(),Y(this,kt).promise}if(n&&this.setOptions(n),!this.options.queryFn){const T=this.observers.find(A=>A.options.queryFn);T&&this.setOptions(T.options)}const s=new AbortController,a=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(ye(this,As,!0),s.signal)})},o=()=>{const T=NI(this.options,r),N=(()=>{const O={client:Y(this,qs),queryKey:this.queryKey,meta:this.meta};return a(O),O})();return ye(this,As,!1),this.options.persister?this.options.persister(T,N,this):T(N)},u=(()=>{const T={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:Y(this,qs),state:this.state,fetchFn:o};return a(T),T})();(f=this.options.behavior)==null||f.onFetch(u,this),ye(this,to,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=u.fetchOptions)==null?void 0:p.meta))&&Le(this,Fn,Vr).call(this,{type:"fetch",meta:(d=u.fetchOptions)==null?void 0:d.meta}),ye(this,kt,OI({initialPromise:r==null?void 0:r.initialPromise,fn:u.fetchFn,onCancel:T=>{T instanceof RE&&T.revert&&this.setState({...Y(this,to),fetchStatus:"idle"}),s.abort()},onFail:(T,A)=>{Le(this,Fn,Vr).call(this,{type:"failed",failureCount:T,error:A})},onPause:()=>{Le(this,Fn,Vr).call(this,{type:"pause"})},onContinue:()=>{Le(this,Fn,Vr).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const T=await Y(this,kt).start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(y=(g=Y(this,In).config).onSuccess)==null||y.call(g,T,this),(x=(E=Y(this,In).config).onSettled)==null||x.call(E,T,this.state.error,this),T}catch(T){if(T instanceof RE){if(T.silent)return Y(this,kt).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw Le(this,Fn,Vr).call(this,{type:"error",error:T}),(b=(v=Y(this,In).config).onError)==null||b.call(v,T,this),(C=(w=Y(this,In).config).onSettled)==null||C.call(w,this.state.data,T,this),T}finally{this.scheduleGc()}}},Ts=new WeakMap,to=new WeakMap,In=new WeakMap,qs=new WeakMap,kt=new WeakMap,Ju=new WeakMap,As=new WeakMap,Fn=new WeakSet,Vr=function(n){const r=s=>{switch(n.type){case"failed":return{...s,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...jI(s.data,this.options),fetchMeta:n.meta??null};case"success":const a={...s,...bq(n.data,n.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ye(this,to,n.manual?a:void 0),a;case"error":const o=n.error;return{...s,error:o,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...n.state}}};this.state=r(this.state),Et.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),Y(this,In).notify({query:this,type:"updated",action:n})})},bI);function jI(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:RI(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function bq(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function _q(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,r=n!==void 0,s=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var fn,He,Zu,Zt,Ns,no,Fr,Bi,el,ro,io,Rs,Os,Pi,so,Ze,Mu,OE,ME,jE,LE,$E,IE,DE,LI,_I,ul=(_I=class extends Qs{constructor(n,r){super();Ce(this,Ze);Ce(this,fn);Ce(this,He);Ce(this,Zu);Ce(this,Zt);Ce(this,Ns);Ce(this,no);Ce(this,Fr);Ce(this,Bi);Ce(this,el);Ce(this,ro);Ce(this,io);Ce(this,Rs);Ce(this,Os);Ce(this,Pi);Ce(this,so,new Set);this.options=r,ye(this,fn,n),ye(this,Bi,null),ye(this,Fr,NE()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Y(this,He).addObserver(this),wq(Y(this,He),this.options)?Le(this,Ze,Mu).call(this):this.updateResult(),Le(this,Ze,LE).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return kE(Y(this,He),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return kE(Y(this,He),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Le(this,Ze,$E).call(this),Le(this,Ze,IE).call(this),Y(this,He).removeObserver(this)}setOptions(n){const r=this.options,s=Y(this,He);if(this.options=Y(this,fn).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kn(this.options.enabled,Y(this,He))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Le(this,Ze,DE).call(this),Y(this,He).setOptions(this.options),r._defaulted&&!Uu(this.options,r)&&Y(this,fn).getQueryCache().notify({type:"observerOptionsUpdated",query:Y(this,He),observer:this});const a=this.hasListeners();a&&Eq(Y(this,He),s,this.options,r)&&Le(this,Ze,Mu).call(this),this.updateResult(),a&&(Y(this,He)!==s||kn(this.options.enabled,Y(this,He))!==kn(r.enabled,Y(this,He))||Fi(this.options.staleTime,Y(this,He))!==Fi(r.staleTime,Y(this,He)))&&Le(this,Ze,OE).call(this);const o=Le(this,Ze,ME).call(this);a&&(Y(this,He)!==s||kn(this.options.enabled,Y(this,He))!==kn(r.enabled,Y(this,He))||o!==Y(this,Pi))&&Le(this,Ze,jE).call(this,o)}getOptimisticResult(n){const r=Y(this,fn).getQueryCache().build(Y(this,fn),n),s=this.createResult(r,n);return eU(this,s)&&(ye(this,Zt,s),ye(this,no,this.options),ye(this,Ns,Y(this,He).state)),s}getCurrentResult(){return Y(this,Zt)}trackResult(n,r){return new Proxy(n,{get:(s,a)=>(this.trackProp(a),r==null||r(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&Y(this,Fr).status==="pending"&&Y(this,Fr).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,a))})}trackProp(n){Y(this,so).add(n)}getCurrentQuery(){return Y(this,He)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const r=Y(this,fn).defaultQueryOptions(n),s=Y(this,fn).getQueryCache().build(Y(this,fn),r);return s.fetch().then(()=>this.createResult(s,r))}fetch(n){return Le(this,Ze,Mu).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),Y(this,Zt)))}createResult(n,r){var k;const s=Y(this,He),a=this.options,o=Y(this,Zt),l=Y(this,Ns),u=Y(this,no),f=n!==s?n.state:Y(this,Zu),{state:p}=n;let d={...p},g=!1,y;if(r._optimisticResults){const R=this.hasListeners(),M=!R&&wq(n,r),D=R&&Eq(n,s,r,a);(M||D)&&(d={...d,...jI(p.data,n.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:E,errorUpdatedAt:x,status:v}=d;y=d.data;let b=!1;if(r.placeholderData!==void 0&&y===void 0&&v==="pending"){let R;o!=null&&o.isPlaceholderData&&r.placeholderData===(u==null?void 0:u.placeholderData)?(R=o.data,b=!0):R=typeof r.placeholderData=="function"?r.placeholderData((k=Y(this,io))==null?void 0:k.state.data,Y(this,io)):r.placeholderData,R!==void 0&&(v="success",y=AE(o==null?void 0:o.data,R,r),g=!0)}if(r.select&&y!==void 0&&!b)if(o&&y===(l==null?void 0:l.data)&&r.select===Y(this,el))y=Y(this,ro);else try{ye(this,el,r.select),y=r.select(y),y=AE(o==null?void 0:o.data,y,r),ye(this,ro,y),ye(this,Bi,null)}catch(R){ye(this,Bi,R)}Y(this,Bi)&&(E=Y(this,Bi),y=Y(this,ro),x=Date.now(),v="error");const w=d.fetchStatus==="fetching",C=v==="pending",T=v==="error",A=C&&w,N=y!==void 0,I={status:v,fetchStatus:d.fetchStatus,isPending:C,isSuccess:v==="success",isError:T,isInitialLoading:A,isLoading:A,data:y,dataUpdatedAt:d.dataUpdatedAt,error:E,errorUpdatedAt:x,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>f.dataUpdateCount||d.errorUpdateCount>f.errorUpdateCount,isFetching:w,isRefetching:w&&!C,isLoadingError:T&&!N,isPaused:d.fetchStatus==="paused",isPlaceholderData:g,isRefetchError:T&&N,isStale:yC(n,r),refetch:this.refetch,promise:Y(this,Fr),isEnabled:kn(r.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const R=I.data!==void 0,M=I.status==="error"&&!R,D=j=>{M?j.reject(I.error):R&&j.resolve(I.data)},z=()=>{const j=ye(this,Fr,I.promise=NE());D(j)},q=Y(this,Fr);switch(q.status){case"pending":n.queryHash===s.queryHash&&D(q);break;case"fulfilled":(M||I.data!==q.value)&&z();break;case"rejected":(!M||I.error!==q.reason)&&z();break}}return I}updateResult(){const n=Y(this,Zt),r=this.createResult(Y(this,He),this.options);if(ye(this,Ns,Y(this,He).state),ye(this,no,this.options),Y(this,Ns).data!==void 0&&ye(this,io,Y(this,He)),Uu(r,n))return;ye(this,Zt,r);const s=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!Y(this,so).size)return!0;const l=new Set(o??Y(this,so));return this.options.throwOnError&&l.add("error"),Object.keys(Y(this,Zt)).some(u=>{const h=u;return Y(this,Zt)[h]!==n[h]&&l.has(h)})};Le(this,Ze,LI).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Le(this,Ze,LE).call(this)}},fn=new WeakMap,He=new WeakMap,Zu=new WeakMap,Zt=new WeakMap,Ns=new WeakMap,no=new WeakMap,Fr=new WeakMap,Bi=new WeakMap,el=new WeakMap,ro=new WeakMap,io=new WeakMap,Rs=new WeakMap,Os=new WeakMap,Pi=new WeakMap,so=new WeakMap,Ze=new WeakSet,Mu=function(n){Le(this,Ze,DE).call(this);let r=Y(this,He).fetch(this.options,n);return n!=null&&n.throwOnError||(r=r.catch(Xt)),r},OE=function(){Le(this,Ze,$E).call(this);const n=Fi(this.options.staleTime,Y(this,He));if($s||Y(this,Zt).isStale||!TE(n))return;const s=AI(Y(this,Zt).dataUpdatedAt,n)+1;ye(this,Rs,Es.setTimeout(()=>{Y(this,Zt).isStale||this.updateResult()},s))},ME=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Y(this,He)):this.options.refetchInterval)??!1},jE=function(n){Le(this,Ze,IE).call(this),ye(this,Pi,n),!($s||kn(this.options.enabled,Y(this,He))===!1||!TE(Y(this,Pi))||Y(this,Pi)===0)&&ye(this,Os,Es.setInterval(()=>{(this.options.refetchIntervalInBackground||gC.isFocused())&&Le(this,Ze,Mu).call(this)},Y(this,Pi)))},LE=function(){Le(this,Ze,OE).call(this),Le(this,Ze,jE).call(this,Le(this,Ze,ME).call(this))},$E=function(){Y(this,Rs)&&(Es.clearTimeout(Y(this,Rs)),ye(this,Rs,void 0))},IE=function(){Y(this,Os)&&(Es.clearInterval(Y(this,Os)),ye(this,Os,void 0))},DE=function(){const n=Y(this,fn).getQueryCache().build(Y(this,fn),this.options);if(n===Y(this,He))return;const r=Y(this,He);ye(this,He,n),ye(this,Zu,n.state),this.hasListeners()&&(r==null||r.removeObserver(this),n.addObserver(this))},LI=function(n){Et.batch(()=>{n.listeners&&this.listeners.forEach(r=>{r(Y(this,Zt))}),Y(this,fn).getQueryCache().notify({query:Y(this,He),type:"observerResultsUpdated"})})},_I);function Zz(e,n){return kn(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&n.retryOnMount===!1)}function wq(e,n){return Zz(e,n)||e.state.data!==void 0&&kE(e,n,n.refetchOnMount)}function kE(e,n,r){if(kn(n.enabled,e)!==!1&&Fi(n.staleTime,e)!=="static"){const s=typeof r=="function"?r(e):r;return s==="always"||s!==!1&&yC(e,n)}return!1}function Eq(e,n,r,s){return(e!==n||kn(s.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&yC(e,r)}function yC(e,n){return kn(n.enabled,e)!==!1&&e.isStaleByTime(Fi(n.staleTime,e))}function eU(e,n){return!Uu(e.getCurrentResult(),n)}function Of(e){return{onFetch:(n,r)=>{var p,d,g,y,E;const s=n.options,a=(g=(d=(p=n.fetchOptions)==null?void 0:p.meta)==null?void 0:d.fetchMore)==null?void 0:g.direction,o=((y=n.state.data)==null?void 0:y.pages)||[],l=((E=n.state.data)==null?void 0:E.pageParams)||[];let u={pages:[],pageParams:[]},h=0;const f=async()=>{let x=!1;const v=C=>{Fz(C,()=>n.signal,()=>x=!0)},b=NI(n.options,n.fetchOptions),w=async(C,T,A)=>{if(x)return Promise.reject();if(T==null&&C.pages.length)return Promise.resolve(C);const O=(()=>{const M={client:n.client,queryKey:n.queryKey,pageParam:T,direction:A?"backward":"forward",meta:n.options.meta};return v(M),M})(),I=await b(O),{maxPages:k}=n.options,R=A?Vz:Hz;return{pages:R(C.pages,I,k),pageParams:R(C.pageParams,T,k)}};if(a&&o.length){const C=a==="backward",T=C?$I:BE,A={pages:o,pageParams:l},N=T(s,A);u=await w(A,N,C)}else{const C=e??o.length;do{const T=h===0?l[0]??s.initialPageParam:BE(s,u);if(h>0&&T==null)break;u=await w(u,T),h++}while(h<C)}return u};n.options.persister?n.fetchFn=()=>{var x,v;return(v=(x=n.options).persister)==null?void 0:v.call(x,f,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},r)}:n.fetchFn=f}}}function BE(e,{pages:n,pageParams:r}){const s=n.length-1;return n.length>0?e.getNextPageParam(n[s],n,r[s],r):void 0}function $I(e,{pages:n,pageParams:r}){var s;return n.length>0?(s=e.getPreviousPageParam)==null?void 0:s.call(e,n[0],n,r[0],r):void 0}function tU(e,n){return n?BE(e,n)!=null:!1}function nU(e,n){return!n||!e.getPreviousPageParam?!1:$I(e,n)!=null}var II=class extends ul{constructor(e,n){super(e,n)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:Of()})}getOptimisticResult(e){return e.behavior=Of(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,n){var E,x;const{state:r}=e,s=super.createResult(e,n),{isFetching:a,isRefetching:o,isError:l,isRefetchError:u}=s,h=(x=(E=r.fetchMeta)==null?void 0:E.fetchMore)==null?void 0:x.direction,f=l&&h==="forward",p=a&&h==="forward",d=l&&h==="backward",g=a&&h==="backward";return{...s,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:tU(n,r.data),hasPreviousPage:nU(n,r.data),isFetchNextPageError:f,isFetchingNextPage:p,isFetchPreviousPageError:d,isFetchingPreviousPage:g,isRefetchError:u&&!f&&!d,isRefetching:o&&!p&&!g}}},tl,dr,Yt,Ms,pr,Li,wI,rU=(wI=class extends MI{constructor(n){super();Ce(this,pr);Ce(this,tl);Ce(this,dr);Ce(this,Yt);Ce(this,Ms);ye(this,tl,n.client),this.mutationId=n.mutationId,ye(this,Yt,n.mutationCache),ye(this,dr,[]),this.state=n.state||DI(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){Y(this,dr).includes(n)||(Y(this,dr).push(n),this.clearGcTimeout(),Y(this,Yt).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){ye(this,dr,Y(this,dr).filter(r=>r!==n)),this.scheduleGc(),Y(this,Yt).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){Y(this,dr).length||(this.state.status==="pending"?this.scheduleGc():Y(this,Yt).remove(this))}continue(){var n;return((n=Y(this,Ms))==null?void 0:n.continue())??this.execute(this.state.variables)}async execute(n){var l,u,h,f,p,d,g,y,E,x,v,b,w,C,T,A,N,O;const r=()=>{Le(this,pr,Li).call(this,{type:"continue"})},s={client:Y(this,tl),meta:this.options.meta,mutationKey:this.options.mutationKey};ye(this,Ms,OI({fn:()=>this.options.mutationFn?this.options.mutationFn(n,s):Promise.reject(new Error("No mutationFn found")),onFail:(I,k)=>{Le(this,pr,Li).call(this,{type:"failed",failureCount:I,error:k})},onPause:()=>{Le(this,pr,Li).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Y(this,Yt).canRun(this)}));const a=this.state.status==="pending",o=!Y(this,Ms).canStart();try{if(a)r();else{Le(this,pr,Li).call(this,{type:"pending",variables:n,isPaused:o}),Y(this,Yt).config.onMutate&&await Y(this,Yt).config.onMutate(n,this,s);const k=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,n,s));k!==this.state.context&&Le(this,pr,Li).call(this,{type:"pending",context:k,variables:n,isPaused:o})}const I=await Y(this,Ms).start();return await((f=(h=Y(this,Yt).config).onSuccess)==null?void 0:f.call(h,I,n,this.state.context,this,s)),await((d=(p=this.options).onSuccess)==null?void 0:d.call(p,I,n,this.state.context,s)),await((y=(g=Y(this,Yt).config).onSettled)==null?void 0:y.call(g,I,null,this.state.variables,this.state.context,this,s)),await((x=(E=this.options).onSettled)==null?void 0:x.call(E,I,null,n,this.state.context,s)),Le(this,pr,Li).call(this,{type:"success",data:I}),I}catch(I){try{await((b=(v=Y(this,Yt).config).onError)==null?void 0:b.call(v,I,n,this.state.context,this,s))}catch(k){Promise.reject(k)}try{await((C=(w=this.options).onError)==null?void 0:C.call(w,I,n,this.state.context,s))}catch(k){Promise.reject(k)}try{await((A=(T=Y(this,Yt).config).onSettled)==null?void 0:A.call(T,void 0,I,this.state.variables,this.state.context,this,s))}catch(k){Promise.reject(k)}try{await((O=(N=this.options).onSettled)==null?void 0:O.call(N,void 0,I,n,this.state.context,s))}catch(k){Promise.reject(k)}throw Le(this,pr,Li).call(this,{type:"error",error:I}),I}finally{Y(this,Yt).runNext(this)}}},tl=new WeakMap,dr=new WeakMap,Yt=new WeakMap,Ms=new WeakMap,pr=new WeakSet,Li=function(n){const r=s=>{switch(n.type){case"failed":return{...s,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...s,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:n.error,failureCount:s.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Et.batch(()=>{Y(this,dr).forEach(s=>{s.onMutationUpdate(n)}),Y(this,Yt).notify({mutation:this,type:"updated",action:n})})},wI);function DI(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Gr,Gn,nl,EI,iU=(EI=class extends Qs{constructor(n={}){super();Ce(this,Gr);Ce(this,Gn);Ce(this,nl);this.config=n,ye(this,Gr,new Set),ye(this,Gn,new Map),ye(this,nl,0)}build(n,r,s){const a=new rU({client:n,mutationCache:this,mutationId:++Wc(this,nl)._,options:n.defaultMutationOptions(r),state:s});return this.add(a),a}add(n){Y(this,Gr).add(n);const r=Zc(n);if(typeof r=="string"){const s=Y(this,Gn).get(r);s?s.push(n):Y(this,Gn).set(r,[n])}this.notify({type:"added",mutation:n})}remove(n){if(Y(this,Gr).delete(n)){const r=Zc(n);if(typeof r=="string"){const s=Y(this,Gn).get(r);if(s)if(s.length>1){const a=s.indexOf(n);a!==-1&&s.splice(a,1)}else s[0]===n&&Y(this,Gn).delete(r)}}this.notify({type:"removed",mutation:n})}canRun(n){const r=Zc(n);if(typeof r=="string"){const s=Y(this,Gn).get(r),a=s==null?void 0:s.find(o=>o.state.status==="pending");return!a||a===n}else return!0}runNext(n){var s;const r=Zc(n);if(typeof r=="string"){const a=(s=Y(this,Gn).get(r))==null?void 0:s.find(o=>o!==n&&o.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Et.batch(()=>{Y(this,Gr).forEach(n=>{this.notify({type:"removed",mutation:n})}),Y(this,Gr).clear(),Y(this,Gn).clear()})}getAll(){return Array.from(Y(this,Gr))}find(n){const r={exact:!0,...n};return this.getAll().find(s=>gq(r,s))}findAll(n={}){return this.getAll().filter(r=>gq(n,r))}notify(n){Et.batch(()=>{this.listeners.forEach(r=>{r(n)})})}resumePausedMutations(){const n=this.getAll().filter(r=>r.state.isPaused);return Et.batch(()=>Promise.all(n.map(r=>r.continue().catch(Xt))))}},Gr=new WeakMap,Gn=new WeakMap,nl=new WeakMap,EI);function Zc(e){var n;return(n=e.options.scope)==null?void 0:n.id}var Kr,zi,hn,Yr,Wr,Ef,PE,CI,sU=(CI=class extends Qs{constructor(r,s){super();Ce(this,Wr);Ce(this,Kr);Ce(this,zi);Ce(this,hn);Ce(this,Yr);ye(this,Kr,r),this.setOptions(s),this.bindMethods(),Le(this,Wr,Ef).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var a;const s=this.options;this.options=Y(this,Kr).defaultMutationOptions(r),Uu(this.options,s)||Y(this,Kr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Y(this,hn),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&Ki(s.mutationKey)!==Ki(this.options.mutationKey)?this.reset():((a=Y(this,hn))==null?void 0:a.state.status)==="pending"&&Y(this,hn).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=Y(this,hn))==null||r.removeObserver(this)}onMutationUpdate(r){Le(this,Wr,Ef).call(this),Le(this,Wr,PE).call(this,r)}getCurrentResult(){return Y(this,zi)}reset(){var r;(r=Y(this,hn))==null||r.removeObserver(this),ye(this,hn,void 0),Le(this,Wr,Ef).call(this),Le(this,Wr,PE).call(this)}mutate(r,s){var a;return ye(this,Yr,s),(a=Y(this,hn))==null||a.removeObserver(this),ye(this,hn,Y(this,Kr).getMutationCache().build(Y(this,Kr),this.options)),Y(this,hn).addObserver(this),Y(this,hn).execute(r)}},Kr=new WeakMap,zi=new WeakMap,hn=new WeakMap,Yr=new WeakMap,Wr=new WeakSet,Ef=function(){var s;const r=((s=Y(this,hn))==null?void 0:s.state)??DI();ye(this,zi,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},PE=function(r){Et.batch(()=>{var s,a,o,l,u,h,f,p;if(Y(this,Yr)&&this.hasListeners()){const d=Y(this,zi).variables,g=Y(this,zi).context,y={client:Y(this,Kr),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(a=(s=Y(this,Yr)).onSuccess)==null||a.call(s,r.data,d,g,y)}catch(E){Promise.reject(E)}try{(l=(o=Y(this,Yr)).onSettled)==null||l.call(o,r.data,null,d,g,y)}catch(E){Promise.reject(E)}}else if((r==null?void 0:r.type)==="error"){try{(h=(u=Y(this,Yr)).onError)==null||h.call(u,r.error,d,g,y)}catch(E){Promise.reject(E)}try{(p=(f=Y(this,Yr)).onSettled)==null||p.call(f,void 0,r.error,d,g,y)}catch(E){Promise.reject(E)}}}this.listeners.forEach(d=>{d(Y(this,zi))})})},CI);function Cq(e,n){const r=new Set(n);return e.filter(s=>!r.has(s))}function aU(e,n,r){const s=e.slice(0);return s[n]=r,s}var ao,Cn,oo,uo,Dn,Ui,rl,il,sl,al,Ht,zE,UE,QE,HE,VE,xI,oU=(xI=class extends Qs{constructor(n,r,s){super();Ce(this,Ht);Ce(this,ao);Ce(this,Cn);Ce(this,oo);Ce(this,uo);Ce(this,Dn);Ce(this,Ui);Ce(this,rl);Ce(this,il);Ce(this,sl);Ce(this,al,[]);ye(this,ao,n),ye(this,uo,s),ye(this,oo,[]),ye(this,Dn,[]),ye(this,Cn,[]),this.setQueries(r)}onSubscribe(){this.listeners.size===1&&Y(this,Dn).forEach(n=>{n.subscribe(r=>{Le(this,Ht,HE).call(this,n,r)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,Y(this,Dn).forEach(n=>{n.destroy()})}setQueries(n,r){ye(this,oo,n),ye(this,uo,r),Et.batch(()=>{const s=Y(this,Dn),a=Le(this,Ht,QE).call(this,Y(this,oo));a.forEach(d=>d.observer.setOptions(d.defaultedQueryOptions));const o=a.map(d=>d.observer),l=o.map(d=>d.getCurrentResult()),u=s.length!==o.length,h=o.some((d,g)=>d!==s[g]),f=u||h,p=f?!0:l.some((d,g)=>{const y=Y(this,Cn)[g];return!y||!Uu(d,y)});!f&&!p||(f&&(ye(this,al,a),ye(this,Dn,o)),ye(this,Cn,l),this.hasListeners()&&(f&&(Cq(s,o).forEach(d=>{d.destroy()}),Cq(o,s).forEach(d=>{d.subscribe(g=>{Le(this,Ht,HE).call(this,d,g)})})),Le(this,Ht,VE).call(this)))})}getCurrentResult(){return Y(this,Cn)}getQueries(){return Y(this,Dn).map(n=>n.getCurrentQuery())}getObservers(){return Y(this,Dn)}getOptimisticResult(n,r){const s=Le(this,Ht,QE).call(this,n),a=s.map(l=>l.observer.getOptimisticResult(l.defaultedQueryOptions)),o=s.map(l=>l.defaultedQueryOptions.queryHash);return[a,l=>Le(this,Ht,UE).call(this,l??a,r,o),()=>Le(this,Ht,zE).call(this,a,s)]}},ao=new WeakMap,Cn=new WeakMap,oo=new WeakMap,uo=new WeakMap,Dn=new WeakMap,Ui=new WeakMap,rl=new WeakMap,il=new WeakMap,sl=new WeakMap,al=new WeakMap,Ht=new WeakSet,zE=function(n,r){return r.map((s,a)=>{const o=n[a];return s.defaultedQueryOptions.notifyOnChangeProps?o:s.observer.trackResult(o,l=>{r.forEach(u=>{u.observer.trackProp(l)})})})},UE=function(n,r,s){if(r){const a=Y(this,sl),o=s!==void 0&&a!==void 0&&(a.length!==s.length||s.some((l,u)=>l!==a[u]));return(!Y(this,Ui)||Y(this,Cn)!==Y(this,il)||o||r!==Y(this,rl))&&(ye(this,rl,r),ye(this,il,Y(this,Cn)),s!==void 0&&ye(this,sl,s),ye(this,Ui,pC(Y(this,Ui),r(n)))),Y(this,Ui)}return n},QE=function(n){const r=new Map;Y(this,Dn).forEach(a=>{const o=a.options.queryHash;if(!o)return;const l=r.get(o);l?l.push(a):r.set(o,[a])});const s=[];return n.forEach(a=>{var h;const o=Y(this,ao).defaultQueryOptions(a),u=((h=r.get(o.queryHash))==null?void 0:h.shift())??new ul(Y(this,ao),o);s.push({defaultedQueryOptions:o,observer:u})}),s},HE=function(n,r){const s=Y(this,Dn).indexOf(n);s!==-1&&(ye(this,Cn,aU(Y(this,Cn),s,r)),Le(this,Ht,VE).call(this))},VE=function(){var n;if(this.hasListeners()){const r=Y(this,Ui),s=Le(this,Ht,zE).call(this,Y(this,Cn),Y(this,al)),a=Le(this,Ht,UE).call(this,s,(n=Y(this,uo))==null?void 0:n.combine);r!==a&&Et.batch(()=>{this.listeners.forEach(o=>{o(Y(this,Cn))})})}},xI),mr,SI,uU=(SI=class extends Qs{constructor(n={}){super();Ce(this,mr);this.config=n,ye(this,mr,new Map)}build(n,r,s){const a=r.queryKey,o=r.queryHash??dC(a,r);let l=this.get(o);return l||(l=new Jz({client:n,queryKey:a,queryHash:o,options:n.defaultQueryOptions(r),state:s,defaultOptions:n.getQueryDefaults(a)}),this.add(l)),l}add(n){Y(this,mr).has(n.queryHash)||(Y(this,mr).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const r=Y(this,mr).get(n.queryHash);r&&(n.destroy(),r===n&&Y(this,mr).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Et.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return Y(this,mr).get(n)}getAll(){return[...Y(this,mr).values()]}find(n){const r={exact:!0,...n};return this.getAll().find(s=>mq(r,s))}findAll(n={}){const r=this.getAll();return Object.keys(n).length>0?r.filter(s=>mq(n,s)):r}notify(n){Et.batch(()=>{this.listeners.forEach(r=>{r(n)})})}onFocus(){Et.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Et.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},mr=new WeakMap,SI),wt,Qi,Hi,lo,co,Vi,fo,ho,TI,lU=(TI=class{constructor(e={}){Ce(this,wt);Ce(this,Qi);Ce(this,Hi);Ce(this,lo);Ce(this,co);Ce(this,Vi);Ce(this,fo);Ce(this,ho);ye(this,wt,e.queryCache||new uU),ye(this,Qi,e.mutationCache||new iU),ye(this,Hi,e.defaultOptions||{}),ye(this,lo,new Map),ye(this,co,new Map),ye(this,Vi,0)}mount(){Wc(this,Vi)._++,Y(this,Vi)===1&&(ye(this,fo,gC.subscribe(async e=>{e&&(await this.resumePausedMutations(),Y(this,wt).onFocus())})),ye(this,ho,Rf.subscribe(async e=>{e&&(await this.resumePausedMutations(),Y(this,wt).onOnline())})))}unmount(){var e,n;Wc(this,Vi)._--,Y(this,Vi)===0&&((e=Y(this,fo))==null||e.call(this),ye(this,fo,void 0),(n=Y(this,ho))==null||n.call(this),ye(this,ho,void 0))}isFetching(e){return Y(this,wt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Y(this,Qi).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const n=this.defaultQueryOptions({queryKey:e});return(r=Y(this,wt).get(n.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),r=Y(this,wt).build(this,n),s=r.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Fi(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(s))}getQueriesData(e){return Y(this,wt).findAll(e).map(({queryKey:n,state:r})=>{const s=r.data;return[n,s]})}setQueryData(e,n,r){const s=this.defaultQueryOptions({queryKey:e}),a=Y(this,wt).get(s.queryHash),o=a==null?void 0:a.state.data,l=zz(n,o);if(l!==void 0)return Y(this,wt).build(this,s).setData(l,{...r,manual:!0})}setQueriesData(e,n,r){return Et.batch(()=>Y(this,wt).findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,n,r)]))}getQueryState(e){var r;const n=this.defaultQueryOptions({queryKey:e});return(r=Y(this,wt).get(n.queryHash))==null?void 0:r.state}removeQueries(e){const n=Y(this,wt);Et.batch(()=>{n.findAll(e).forEach(r=>{n.remove(r)})})}resetQueries(e,n){const r=Y(this,wt);return Et.batch(()=>(r.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const r={revert:!0,...n},s=Et.batch(()=>Y(this,wt).findAll(e).map(a=>a.cancel(r)));return Promise.all(s).then(Xt).catch(Xt)}invalidateQueries(e,n={}){return Et.batch(()=>(Y(this,wt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},n)))}refetchQueries(e,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},s=Et.batch(()=>Y(this,wt).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let o=a.fetch(void 0,r);return r.throwOnError||(o=o.catch(Xt)),a.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(s).then(Xt)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const r=Y(this,wt).build(this,n);return r.isStaleByTime(Fi(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Xt).catch(Xt)}fetchInfiniteQuery(e){return e.behavior=Of(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Xt).catch(Xt)}ensureInfiniteQueryData(e){return e.behavior=Of(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Rf.isOnline()?Y(this,Qi).resumePausedMutations():Promise.resolve()}getQueryCache(){return Y(this,wt)}getMutationCache(){return Y(this,Qi)}getDefaultOptions(){return Y(this,Hi)}setDefaultOptions(e){ye(this,Hi,e)}setQueryDefaults(e,n){Y(this,lo).set(Ki(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...Y(this,lo).values()],r={};return n.forEach(s=>{zu(e,s.queryKey)&&Object.assign(r,s.defaultOptions)}),r}setMutationDefaults(e,n){Y(this,co).set(Ki(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...Y(this,co).values()],r={};return n.forEach(s=>{zu(e,s.mutationKey)&&Object.assign(r,s.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const n={...Y(this,Hi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=dC(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===xn&&(n.enabled=!1),n}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Y(this,Hi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Y(this,wt).clear(),Y(this,Qi).clear()}},wt=new WeakMap,Qi=new WeakMap,Hi=new WeakMap,lo=new WeakMap,co=new WeakMap,Vi=new WeakMap,fo=new WeakMap,ho=new WeakMap,TI),kI=te.createContext(void 0),ll=e=>{const n=te.useContext(kI);if(e)return e;if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},cU=({client:e,children:n})=>(te.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),F.jsx(kI.Provider,{value:e,children:n})),BI=te.createContext(!1),PI=()=>te.useContext(BI);BI.Provider;function fU(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var hU=te.createContext(fU()),zI=()=>te.useContext(hU),UI=(e,n,r)=>{const s=r!=null&&r.state.error&&typeof e.throwOnError=="function"?mC(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(n.isReset()||(e.retryOnMount=!1))},QI=e=>{te.useEffect(()=>{e.clearReset()},[e])},HI=({result:e,errorResetBoundary:n,throwOnError:r,query:s,suspense:a})=>e.isError&&!n.isReset()&&!e.isFetching&&s&&(a&&e.data===void 0||mC(r,[e.error,s])),vC=(e,n)=>n.state.data===void 0,VI=e=>{if(e.suspense){const r=a=>a==="static"?a:Math.max(a??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...a)=>r(s(...a)):r(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},FI=(e,n)=>e.isLoading&&e.isFetching&&!n,FE=(e,n)=>(e==null?void 0:e.suspense)&&n.isPending,Mf=(e,n,r)=>n.fetchOptimistic(e).catch(()=>{r.clearReset()});function GI({queries:e,...n},r){const s=ll(r),a=PI(),o=zI(),l=te.useMemo(()=>e.map(x=>{const v=s.defaultQueryOptions(x);return v._optimisticResults=a?"isRestoring":"optimistic",v}),[e,s,a]);l.forEach(x=>{VI(x);const v=s.getQueryCache().get(x.queryHash);UI(x,o,v)}),QI(o);const[u]=te.useState(()=>new oU(s,l,n)),[h,f,p]=u.getOptimisticResult(l,n.combine),d=!a&&n.subscribed!==!1;te.useSyncExternalStore(te.useCallback(x=>d?u.subscribe(Et.batchCalls(x)):Xt,[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),te.useEffect(()=>{u.setQueries(l,n)},[l,n,u]);const y=h.some((x,v)=>FE(l[v],x))?h.flatMap((x,v)=>{const b=l[v];if(b){const w=new ul(s,b);if(FE(b,x))return Mf(b,w,o);FI(x,a)&&Mf(b,w,o)}return[]}):[];if(y.length>0)throw Promise.all(y);const E=h.find((x,v)=>{const b=l[v];return b&&HI({result:x,errorResetBoundary:o,throwOnError:b.throwOnError,query:s.getQueryCache().get(b.queryHash),suspense:b.suspense})});if(E!=null&&E.error)throw E.error;return f(p())}function Gf(e,n,r){var g,y,E,x;const s=PI(),a=zI(),o=ll(r),l=o.defaultQueryOptions(e);(y=(g=o.getDefaultOptions().queries)==null?void 0:g._experimental_beforeQuery)==null||y.call(g,l);const u=o.getQueryCache().get(l.queryHash);l._optimisticResults=s?"isRestoring":"optimistic",VI(l),UI(l,a,u),QI(a);const h=!o.getQueryCache().get(l.queryHash),[f]=te.useState(()=>new n(o,l)),p=f.getOptimisticResult(l),d=!s&&e.subscribed!==!1;if(te.useSyncExternalStore(te.useCallback(v=>{const b=d?f.subscribe(Et.batchCalls(v)):Xt;return f.updateResult(),b},[f,d]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),te.useEffect(()=>{f.setOptions(l)},[l,f]),FE(l,p))throw Mf(l,f,a);if(HI({result:p,errorResetBoundary:a,throwOnError:l.throwOnError,query:u,suspense:l.suspense}))throw p.error;if((x=(E=o.getDefaultOptions().queries)==null?void 0:E._experimental_afterQuery)==null||x.call(E,l,p),l.experimental_prefetchInRender&&!$s&&FI(p,s)){const v=h?Mf(l,f,a):u==null?void 0:u.promise;v==null||v.catch(Xt).finally(()=>{f.updateResult()})}return l.notifyOnChangeProps?p:f.trackResult(p)}function dU(e,n){return Gf(e,ul,n)}function pU(e,n){return Gf({...e,enabled:!0,suspense:!0,throwOnError:vC,placeholderData:void 0},ul,n)}function mU(e,n){return Gf({...e,enabled:!0,suspense:!0,throwOnError:vC},II,n)}function gU(e,n){return GI({...e,queries:e.queries.map(r=>({...r,suspense:!0,throwOnError:vC,enabled:!0,placeholderData:void 0}))},n)}function yU(e,n){const r=ll(n);r.getQueryState(e.queryKey)||r.prefetchQuery(e)}function vU(e,n){const r=ll(n);r.getQueryState(e.queryKey)||r.prefetchInfiniteQuery(e)}function bU(e,n){const r=ll(n),[s]=te.useState(()=>new sU(r,e));te.useEffect(()=>{s.setOptions(e)},[s,e]);const a=te.useSyncExternalStore(te.useCallback(l=>s.subscribe(Et.batchCalls(l)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),o=te.useCallback((l,u)=>{s.mutate(l,u).catch(Xt)},[s]);if(a.error&&mC(s.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}function _U(e,n){return Gf(e,II,n)}function Is(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function wU(){return Object.create(null)}const EU=typeof Symbol=="function"&&!!Symbol.asyncIterator;function KI(e){return EU&&Is(e)&&Symbol.asyncIterator in e}var CU=Object.create,YI=Object.defineProperty,xU=Object.getOwnPropertyDescriptor,XI=Object.getOwnPropertyNames,SU=Object.getPrototypeOf,TU=Object.prototype.hasOwnProperty,cl=(e,n)=>function(){return n||(0,e[XI(e)[0]])((n={exports:{}}).exports,n),n.exports},qU=(e,n,r,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(var a=XI(n),o=0,l=a.length,u;o<l;o++)u=a[o],!TU.call(e,u)&&u!==r&&YI(e,u,{get:(h=>n[h]).bind(null,u),enumerable:!(s=xU(n,u))||s.enumerable});return e},Kf=(e,n,r)=>(r=e!=null?CU(SU(e)):{},qU(YI(r,"default",{value:e,enumerable:!0}),e));const WI=()=>{},xq=e=>{Object.freeze&&Object.freeze(e)};function JI(e,n,r){var s;const a=n.join(".");return(s=r[a])!==null&&s!==void 0||(r[a]=new Proxy(WI,{get(o,l){if(!(typeof l!="string"||l==="then"))return JI(e,[...n,l],r)},apply(o,l,u){const h=n[n.length-1];let f={args:u,path:n};return h==="call"?f={args:u.length>=2?[u[1]]:[],path:n.slice(0,-1)}:h==="apply"&&(f={args:u.length>=2?u[1]:[],path:n.slice(0,-1)}),xq(f.args),xq(f.path),e(f)}})),r[a]}const Yf=e=>JI(e,[],wU()),bC=e=>new Proxy(WI,{get(n,r){if(r!=="then")return e(r)}});var ZI=cl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,n){function r(s){"@babel/helpers - typeof";return n.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},n.exports.__esModule=!0,n.exports.default=n.exports,r(s)}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports}}),AU=cl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,n){var r=ZI().default;function s(a,o){if(r(a)!="object"||!a)return a;var l=a[Symbol.toPrimitive];if(l!==void 0){var u=l.call(a,o||"default");if(r(u)!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(a)}n.exports=s,n.exports.__esModule=!0,n.exports.default=n.exports}}),NU=cl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,n){var r=ZI().default,s=AU();function a(o){var l=s(o,"string");return r(l)=="symbol"?l:l+""}n.exports=a,n.exports.__esModule=!0,n.exports.default=n.exports}}),eD=cl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,n){var r=NU();function s(a,o,l){return(o=r(o))in a?Object.defineProperty(a,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[o]=l,a}n.exports=s,n.exports.__esModule=!0,n.exports.default=n.exports}}),_C=cl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,n){var r=eD();function s(o,l){var u=Object.keys(o);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(o);l&&(h=h.filter(function(f){return Object.getOwnPropertyDescriptor(o,f).enumerable})),u.push.apply(u,h)}return u}function a(o){for(var l=1;l<arguments.length;l++){var u=arguments[l]!=null?arguments[l]:{};l%2?s(Object(u),!0).forEach(function(h){r(o,h,u[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(u)):s(Object(u)).forEach(function(h){Object.defineProperty(o,h,Object.getOwnPropertyDescriptor(u,h))})}return o}n.exports=a,n.exports.__esModule=!0,n.exports.default=n.exports}});Kf(_C());Kf(eD());var ef=Kf(_C());function RU(e,n){if("error"in e){const s=n.deserialize(e.error);return{ok:!1,error:(0,ef.default)((0,ef.default)({},e),{},{error:s})}}return{ok:!0,result:(0,ef.default)((0,ef.default)({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:n.deserialize(e.result.data)})}}var Zp=class extends Error{constructor(){super("Unable to transform response from server")}};function OU(e,n){let r;try{r=RU(e,n)}catch{throw new Zp}if(!r.ok&&(!Is(r.error.error)||typeof r.error.error.code!="number"))throw new Zp;if(r.ok&&!Is(r.result))throw new Zp;return r}Kf(_C());function Xf(e){const n={subscribe(r){let s=null,a=!1,o=!1,l=!1;function u(){if(s===null){l=!0;return}o||(o=!0,typeof s=="function"?s():s&&s.unsubscribe())}return s=e({next(h){var f;a||(f=r.next)===null||f===void 0||f.call(r,h)},error(h){var f;a||(a=!0,(f=r.error)===null||f===void 0||f.call(r,h),u())},complete(){var h;a||(a=!0,(h=r.complete)===null||h===void 0||h.call(r),u())}}),l&&u(),{unsubscribe:u}},pipe(...r){return r.reduce(MU,n)}};return n}function MU(e,n){return n(e)}function jU(e){const n=new AbortController;return new Promise((s,a)=>{let o=!1;function l(){o||(o=!0,u.unsubscribe())}n.signal.addEventListener("abort",()=>{a(n.signal.reason)});const u=e.subscribe({next(h){o=!0,s(h),l()},error(h){a(h)},complete(){n.abort(),l()}})})}var LU=Object.create,tD=Object.defineProperty,$U=Object.getOwnPropertyDescriptor,nD=Object.getOwnPropertyNames,IU=Object.getPrototypeOf,DU=Object.prototype.hasOwnProperty,Yi=(e,n)=>function(){return n||(0,e[nD(e)[0]])((n={exports:{}}).exports,n),n.exports},kU=(e,n,r,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(var a=nD(n),o=0,l=a.length,u;o<l;o++)u=a[o],!DU.call(e,u)&&u!==r&&tD(e,u,{get:(h=>n[h]).bind(null,u),enumerable:!(s=$U(n,u))||s.enumerable});return e},Hs=(e,n,r)=>(r=e!=null?LU(IU(e)):{},kU(n||!e||!e.__esModule?tD(r,"default",{value:e,enumerable:!0}):r,e)),BU=Yi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(e,n){function r(s,a){if(s==null)return{};var o={};for(var l in s)if({}.hasOwnProperty.call(s,l)){if(a.includes(l))continue;o[l]=s[l]}return o}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports}}),PU=Yi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(e,n){var r=BU();function s(a,o){if(a==null)return{};var l,u,h=r(a,o);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(u=0;u<f.length;u++)l=f[u],o.includes(l)||{}.propertyIsEnumerable.call(a,l)&&(h[l]=a[l])}return h}n.exports=s,n.exports.__esModule=!0,n.exports.default=n.exports}}),rD=Yi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,n){function r(s){"@babel/helpers - typeof";return n.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},n.exports.__esModule=!0,n.exports.default=n.exports,r(s)}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports}}),zU=Yi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,n){var r=rD().default;function s(a,o){if(r(a)!="object"||!a)return a;var l=a[Symbol.toPrimitive];if(l!==void 0){var u=l.call(a,o||"default");if(r(u)!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(a)}n.exports=s,n.exports.__esModule=!0,n.exports.default=n.exports}}),UU=Yi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,n){var r=rD().default,s=zU();function a(o){var l=s(o,"string");return r(l)=="symbol"?l:l+""}n.exports=a,n.exports.__esModule=!0,n.exports.default=n.exports}}),QU=Yi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,n){var r=UU();function s(a,o,l){return(o=r(o))in a?Object.defineProperty(a,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[o]=l,a}n.exports=s,n.exports.__esModule=!0,n.exports.default=n.exports}}),fl=Yi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,n){var r=QU();function s(o,l){var u=Object.keys(o);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(o);l&&(h=h.filter(function(f){return Object.getOwnPropertyDescriptor(o,f).enumerable})),u.push.apply(u,h)}return u}function a(o){for(var l=1;l<arguments.length;l++){var u=arguments[l]!=null?arguments[l]:{};l%2?s(Object(u),!0).forEach(function(h){r(o,h,u[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(u)):s(Object(u)).forEach(function(h){Object.defineProperty(o,h,Object.getOwnPropertyDescriptor(u,h))})}return o}n.exports=a,n.exports.__esModule=!0,n.exports.default=n.exports}}),HU=Hs(PU(),1),Sq=Hs(fl(),1);const VU=["cursor","direction"];function hr(e,n,r){const s=e.flatMap(a=>a.split("."));if(!n&&(!r||r==="any"))return s.length?[s]:[];if(r==="infinite"&&Is(n)&&("direction"in n||"cursor"in n)){const{cursor:a,direction:o}=n,l=(0,HU.default)(n,VU);return[s,{input:l,type:"infinite"}]}return[s,(0,Sq.default)((0,Sq.default)({},typeof n<"u"&&n!==xn&&{input:n}),r&&r!=="any"&&{type:r})]}function Cf(e){return hr(e,void 0,"any")}var FU=Object.create,iD=Object.defineProperty,GU=Object.getOwnPropertyDescriptor,sD=Object.getOwnPropertyNames,KU=Object.getPrototypeOf,YU=Object.prototype.hasOwnProperty,_r=(e,n)=>function(){return n||(0,e[sD(e)[0]])((n={exports:{}}).exports,n),n.exports},XU=(e,n,r,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(var a=sD(n),o=0,l=a.length,u;o<l;o++)u=a[o],!YU.call(e,u)&&u!==r&&iD(e,u,{get:(h=>n[h]).bind(null,u),enumerable:!(s=GU(n,u))||s.enumerable});return e},St=(e,n,r)=>(r=e!=null?FU(KU(e)):{},XU(iD(r,"default",{value:e,enumerable:!0}),e)),aD=_r({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,n){function r(s){"@babel/helpers - typeof";return n.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},n.exports.__esModule=!0,n.exports.default=n.exports,r(s)}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports}}),WU=_r({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,n){var r=aD().default;function s(a,o){if(r(a)!="object"||!a)return a;var l=a[Symbol.toPrimitive];if(l!==void 0){var u=l.call(a,o||"default");if(r(u)!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(a)}n.exports=s,n.exports.__esModule=!0,n.exports.default=n.exports}}),JU=_r({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,n){var r=aD().default,s=WU();function a(o){var l=s(o,"string");return r(l)=="symbol"?l:l+""}n.exports=a,n.exports.__esModule=!0,n.exports.default=n.exports}}),Vs=_r({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,n){var r=JU();function s(a,o,l){return(o=r(o))in a?Object.defineProperty(a,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[o]=l,a}n.exports=s,n.exports.__esModule=!0,n.exports.default=n.exports}}),nr=_r({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,n){var r=Vs();function s(o,l){var u=Object.keys(o);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(o);l&&(h=h.filter(function(f){return Object.getOwnPropertyDescriptor(o,f).enumerable})),u.push.apply(u,h)}return u}function a(o){for(var l=1;l<arguments.length;l++){var u=arguments[l]!=null?arguments[l]:{};l%2?s(Object(u),!0).forEach(function(h){r(o,h,u[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(u)):s(Object(u)).forEach(function(h){Object.defineProperty(o,h,Object.getOwnPropertyDescriptor(u,h))})}return o}n.exports=a,n.exports.__esModule=!0,n.exports.default=n.exports}});function ZU(e){return n=>{let r=0,s=null;const a=[];function o(){s||(s=n.subscribe({next(u){for(const f of a){var h;(h=f.next)===null||h===void 0||h.call(f,u)}},error(u){for(const f of a){var h;(h=f.error)===null||h===void 0||h.call(f,u)}},complete(){for(const h of a){var u;(u=h.complete)===null||u===void 0||u.call(h)}}}))}function l(){if(r===0&&s){const u=s;s=null,u.unsubscribe()}}return Xf(u=>(r++,a.push(u),o(),{unsubscribe(){r--,l();const h=a.findIndex(f=>f===u);h>-1&&a.splice(h,1)}}))}}function eQ(e){let n=e;const r=[],s=l=>{n!==void 0&&l.next(n),r.push(l)},a=l=>{r.splice(r.indexOf(l),1)},o=Xf(l=>(s(l),()=>{a(l)}));return o.next=l=>{if(n!==l){n=l;for(const u of r)u.next(l)}},o.get=()=>n,o}function tQ(e){return Xf(n=>{function r(a=0,o=e.op){const l=e.links[a];if(!l)throw new Error("No more links to execute - did you forget to add an ending link?");return l({op:o,next(h){return r(a+1,h)}})}return r().subscribe(n)})}var tf=St(Vs()),Va=St(nr());function nQ(e){return e instanceof jf}function rQ(e){return Is(e)&&Is(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function iQ(e,n){return typeof e=="string"?e:Is(e)&&typeof e.message=="string"?e.message:n}var jf=class xf extends Error{constructor(n,r){var s,a;const o=r==null?void 0:r.cause;super(n,{cause:o}),(0,tf.default)(this,"cause",void 0),(0,tf.default)(this,"shape",void 0),(0,tf.default)(this,"data",void 0),(0,tf.default)(this,"meta",void 0),this.meta=r==null?void 0:r.meta,this.cause=o,this.shape=r==null||(s=r.result)===null||s===void 0?void 0:s.error,this.data=r==null||(a=r.result)===null||a===void 0?void 0:a.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,xf.prototype)}static from(n,r={}){const s=n;return nQ(s)?(r.meta&&(s.meta=(0,Va.default)((0,Va.default)({},s.meta),r.meta)),s):rQ(s)?new xf(s.error.message,(0,Va.default)((0,Va.default)({},r),{},{result:s})):new xf(iQ(s,"Unknown error"),(0,Va.default)((0,Va.default)({},r),{},{cause:s}))}};function sQ(e){const n=e;return n?"input"in n?n:{input:n,output:n}:{input:{serialize:r=>r,deserialize:r=>r},output:{serialize:r=>r,deserialize:r=>r}}}const Tq=e=>typeof e=="function";function aQ(e){if(e)return e;if(typeof window<"u"&&Tq(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Tq(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var ku=St(nr());function oQ(e){return{url:e.url.toString(),fetch:e.fetch,transformer:sQ(e.transformer),methodOverride:e.methodOverride}}function uQ(e){const n={};for(let r=0;r<e.length;r++){const s=e[r];n[r]=s}return n}const lQ={query:"GET",mutation:"POST",subscription:"PATCH"};function oD(e){return"input"in e?e.transformer.input.serialize(e.input):uQ(e.inputs.map(n=>e.transformer.input.serialize(n)))}const uD=e=>{const n=e.url.split("?");let s=n[0].replace(/\/$/,"")+"/"+e.path;const a=[];if(n[1]&&a.push(n[1]),"inputs"in e&&a.push("batch=1"),e.type==="query"||e.type==="subscription"){const o=oD(e);o!==void 0&&e.methodOverride!=="POST"&&a.push(`input=${encodeURIComponent(JSON.stringify(o))}`)}return a.length&&(s+="?"+a.join("&")),s},cQ=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const n=oD(e);return n!==void 0?JSON.stringify(n):void 0},fQ=e=>mQ((0,ku.default)((0,ku.default)({},e),{},{contentTypeHeader:"application/json",getUrl:uD,getBody:cQ}));var hQ=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const dQ=e=>{var n;if(e!=null&&e.aborted)throw(n=e.throwIfAborted)===null||n===void 0||n.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new hQ};async function pQ(e){var n;dQ(e.signal);const r=e.getUrl(e),s=e.getBody(e),a=(n=e.methodOverride)!==null&&n!==void 0?n:lQ[e.type],o=await(async()=>{const u=await e.headers();return Symbol.iterator in u?Object.fromEntries(u):u})(),l=(0,ku.default)((0,ku.default)((0,ku.default)({},e.contentTypeHeader&&a!=="GET"?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0),o);return aQ(e.fetch)(r,{method:a,signal:e.signal,body:s,headers:l})}async function mQ(e){const n={},r=await pQ(e);n.response=r;const s=await r.json();return n.responseJSON=s,{json:s,meta:n}}St(nr());const qq=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function Aq(e){let n=null,r=null;const s=()=>{clearTimeout(r),r=null,n=null};function a(u){const h=[[]];let f=0;for(;;){const g=u[f];if(!g)break;const y=h[h.length-1];if(g.aborted){var p;(p=g.reject)===null||p===void 0||p.call(g,new Error("Aborted")),f++;continue}if(e.validate(y.concat(g).map(x=>x.key))){y.push(g),f++;continue}if(y.length===0){var d;(d=g.reject)===null||d===void 0||d.call(g,new Error("Input is too big for a single dispatch")),f++;continue}h.push([])}return h}function o(){const u=a(n);s();for(const h of u){if(!h.length)continue;const f={items:h};for(const d of h)d.batch=f;e.fetch(f.items.map(d=>d.key)).then(async d=>{await Promise.all(d.map(async(y,E)=>{const x=f.items[E];try{var v;const w=await Promise.resolve(y);(v=x.resolve)===null||v===void 0||v.call(x,w)}catch(w){var b;(b=x.reject)===null||b===void 0||b.call(x,w)}x.batch=null,x.reject=null,x.resolve=null}));for(const y of f.items){var g;(g=y.reject)===null||g===void 0||g.call(y,new Error("Missing result")),y.batch=null}}).catch(d=>{for(const y of f.items){var g;(g=y.reject)===null||g===void 0||g.call(y,d),y.batch=null}})}}function l(u){var h;const f={aborted:!1,key:u,batch:null,resolve:qq,reject:qq},p=new Promise((d,g)=>{var y;f.reject=g,f.resolve=d,(y=n)!==null&&y!==void 0||(n=[]),n.push(f)});return(h=r)!==null&&h!==void 0||(r=setTimeout(o)),p}return{load:l}}function gQ(...e){const n=new AbortController,r=e.length;let s=0;const a=()=>{++s===r&&n.abort()};for(const o of e)o!=null&&o.aborted?a():o==null||o.addEventListener("abort",a,{once:!0});return n.signal}var nf=St(nr());function yQ(e){var n,r;const s=oQ(e),a=(n=e.maxURLLength)!==null&&n!==void 0?n:1/0,o=(r=e.maxItems)!==null&&r!==void 0?r:1/0;return()=>{const l=p=>({validate(d){if(a===1/0&&o===1/0)return!0;if(d.length>o)return!1;const g=d.map(x=>x.path).join(","),y=d.map(x=>x.input);return uD((0,nf.default)((0,nf.default)({},s),{},{type:p,path:g,inputs:y,signal:null})).length<=a},async fetch(d){const g=d.map(w=>w.path).join(","),y=d.map(w=>w.input),E=gQ(...d.map(w=>w.signal)),x=await fQ((0,nf.default)((0,nf.default)({},s),{},{path:g,inputs:y,type:p,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:d}):e.headers:{}},signal:E}));return(Array.isArray(x.json)?x.json:d.map(()=>x.json)).map(w=>({meta:x.meta,json:w}))}}),u=Aq(l("query")),h=Aq(l("mutation")),f={query:u,mutation:h};return({op:p})=>Xf(d=>{/* istanbul ignore if -- @preserve */if(p.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const y=f[p.type].load(p);let E;return y.then(x=>{E=x;const v=OU(x.json,s.transformer.output);if(!v.ok){d.error(jf.from(v.error,{meta:x.meta}));return}d.next({context:x.meta,result:v.result}),d.complete()}).catch(x=>{d.error(jf.from(x,{meta:E==null?void 0:E.meta}))}),()=>{}})}}St(nr());const lD=(e,...n)=>typeof e=="function"?e(...n):e;St(Vs());function vQ(){let e,n;return{promise:new Promise((s,a)=>{e=s,n=a}),resolve:e,reject:n}}async function bQ(e){const n=await lD(e.url);if(!e.connectionParams)return n;const s=`${n.includes("?")?"&":"?"}connectionParams=1`;return n+s}async function _Q(e){const n={method:"connectionParams",data:await lD(e)};return JSON.stringify(n)}St(Vs());var _s=St(Vs());function wQ(e){const{promise:n,resolve:r,reject:s}=vQ();return e.addEventListener("open",()=>{e.removeEventListener("error",s),r()}),e.addEventListener("error",s),n}function EQ(e,{intervalMs:n,pongTimeoutMs:r}){let s,a;function o(){s=setTimeout(()=>{e.send("PING"),a=setTimeout(()=>{e.close()},r)},n)}function l(){clearTimeout(s),o()}function u(){clearTimeout(a),l()}e.addEventListener("open",o),e.addEventListener("message",({data:h})=>{clearTimeout(s),o(),h==="PONG"&&u()}),e.addEventListener("close",()=>{clearTimeout(s),clearTimeout(a)})}var CQ=class GE{constructor(n){var r;if((0,_s.default)(this,"id",++GE.connectCount),(0,_s.default)(this,"WebSocketPonyfill",void 0),(0,_s.default)(this,"urlOptions",void 0),(0,_s.default)(this,"keepAliveOpts",void 0),(0,_s.default)(this,"wsObservable",eQ(null)),(0,_s.default)(this,"openPromise",null),this.WebSocketPonyfill=(r=n.WebSocketPonyfill)!==null&&r!==void 0?r:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=n.urlOptions,this.keepAliveOpts=n.keepAlive}get ws(){return this.wsObservable.get()}set ws(n){this.wsObservable.next(n)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var n=this;if(n.openPromise)return n.openPromise;n.id=++GE.connectCount;const r=bQ(n.urlOptions).then(s=>new n.WebSocketPonyfill(s));n.openPromise=r.then(async s=>{n.ws=s,s.binaryType="arraybuffer",s.addEventListener("message",function({data:a}){a==="PING"&&this.send("PONG")}),n.keepAliveOpts.enabled&&EQ(s,n.keepAliveOpts),s.addEventListener("close",()=>{n.ws===s&&(n.ws=null)}),await wQ(s),n.urlOptions.connectionParams&&s.send(await _Q(n.urlOptions.connectionParams))});try{await n.openPromise}finally{n.openPromise=null}}async close(){var n=this;try{await n.openPromise}finally{var r;(r=n.ws)===null||r===void 0||r.close()}}};(0,_s.default)(CQ,"connectCount",0);St(Vs());St(nr());var em=St(Vs()),Nq=St(nr()),Wf=class{constructor(e){(0,em.default)(this,"links",void 0),(0,em.default)(this,"runtime",void 0),(0,em.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(n=>n(this.runtime))}$request(e){var n;return tQ({links:this.links,op:(0,Nq.default)((0,Nq.default)({},e),{},{context:(n=e.context)!==null&&n!==void 0?n:{},id:++this.requestId})}).pipe(ZU())}async requestAsPromise(e){var n=this;try{const r=n.$request(e);return(await jU(r)).result.data}catch(r){throw jf.from(r)}}query(e,n,r){return this.requestAsPromise({type:"query",path:e,input:n,context:r==null?void 0:r.context,signal:r==null?void 0:r.signal})}mutation(e,n,r){return this.requestAsPromise({type:"mutation",path:e,input:n,context:r==null?void 0:r.context,signal:r==null?void 0:r.signal})}subscription(e,n,r){return this.$request({type:"subscription",path:e,input:n,context:r.context,signal:r.signal}).subscribe({next(a){switch(a.result.type){case"state":{var o;(o=r.onConnectionStateChange)===null||o===void 0||o.call(r,a.result);break}case"started":{var l;(l=r.onStarted)===null||l===void 0||l.call(r,{context:a.context});break}case"stopped":{var u;(u=r.onStopped)===null||u===void 0||u.call(r);break}case"data":case void 0:{var h;(h=r.onData)===null||h===void 0||h.call(r,a.result.data);break}}},error(a){var o;(o=r.onError)===null||o===void 0||o.call(r,a)},complete(){var a;(a=r.onComplete)===null||a===void 0||a.call(r)}})}};const cD=Symbol.for("trpc_untypedClient"),xQ={query:"query",mutate:"mutation",subscribe:"subscription"},SQ=e=>xQ[e];function fD(e){const n=Yf(({path:r,args:s})=>{const a=[...r],o=SQ(a.pop()),l=a.join(".");return e[o](l,...s)});return bC(r=>r===cD?e:n[r])}function TQ(e){const n=new Wf(e);return fD(n)}function wC(e){return e[cD]}St(nr());St(nr());var qQ=_r({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,n){function r(a){var o,l,u,h=2;for(typeof Symbol<"u"&&(l=Symbol.asyncIterator,u=Symbol.iterator);h--;){if(l&&(o=a[l])!=null)return o.call(a);if(u&&(o=a[u])!=null)return new s(o.call(a));l="@@asyncIterator",u="@@iterator"}throw new TypeError("Object is not async iterable")}function s(a){function o(l){if(Object(l)!==l)return Promise.reject(new TypeError(l+" is not an object."));var u=l.done;return Promise.resolve(l.value).then(function(h){return{value:h,done:u}})}return s=function(u){this.s=u,this.n=u.next},s.prototype={s:null,n:null,next:function(){return o(this.n.apply(this.s,arguments))},return:function(u){var h=this.s.return;return h===void 0?Promise.resolve({value:u,done:!0}):o(h.apply(this.s,arguments))},throw:function(u){var h=this.s.return;return h===void 0?Promise.reject(u):o(h.apply(this.s,arguments))}},new s(a)}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports}});St(qQ());St(nr());var AQ=_r({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,n){function r(){var s=typeof SuppressedError=="function"?SuppressedError:function(u,h){var f=Error();return f.name="SuppressedError",f.error=u,f.suppressed=h,f},a={},o=[];function l(u,h){if(h!=null){if(Object(h)!==h)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(u)var f=h[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(f===void 0&&(f=h[Symbol.dispose||Symbol.for("Symbol.dispose")],u))var p=f;if(typeof f!="function")throw new TypeError("Object is not disposable.");p&&(f=function(){try{p.call(h)}catch(g){return Promise.reject(g)}}),o.push({v:h,d:f,a:u})}else u&&o.push({d:h,a:u});return h}return{e:a,u:l.bind(null,!1),a:l.bind(null,!0),d:function(){var h,f=this.e,p=0;function d(){for(;h=o.pop();)try{if(!h.a&&p===1)return p=0,o.push(h),Promise.resolve().then(d);if(h.d){var y=h.d.call(h.v);if(h.a)return p|=2,Promise.resolve(y).then(d,g)}else p|=1}catch(E){return g(E)}if(p===1)return f!==a?Promise.reject(f):Promise.resolve();if(f!==a)throw f}function g(y){return f=f!==a?new s(y,f):y,d()}return d()}}}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports}}),hD=_r({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e,n){function r(s,a){this.v=s,this.k=a}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports}}),NQ=_r({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,n){var r=hD();function s(a){return new r(a,0)}n.exports=s,n.exports.__esModule=!0,n.exports.default=n.exports}}),RQ=_r({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,n){var r=hD();function s(o){return function(){return new a(o.apply(this,arguments))}}function a(o){var l,u;function h(p,d){try{var g=o[p](d),y=g.value,E=y instanceof r;Promise.resolve(E?y.v:y).then(function(x){if(E){var v=p==="return"?"return":"next";if(!y.k||x.done)return h(v,x);x=o[v](x).value}f(g.done?"return":"normal",x)},function(x){h("throw",x)})}catch(x){f("throw",x)}}function f(p,d){switch(p){case"return":l.resolve({value:d,done:!0});break;case"throw":l.reject(d);break;default:l.resolve({value:d,done:!1})}(l=l.next)?h(l.key,l.arg):u=null}this._invoke=function(p,d){return new Promise(function(g,y){var E={key:p,arg:d,resolve:g,reject:y,next:null};u?u=u.next=E:(l=u=E,h(p,d))})},typeof o.return!="function"&&(this.return=void 0)}a.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},a.prototype.next=function(o){return this._invoke("next",o)},a.prototype.throw=function(o){return this._invoke("throw",o)},a.prototype.return=function(o){return this._invoke("return",o)},n.exports=s,n.exports.__esModule=!0,n.exports.default=n.exports}});St(AQ());St(NQ());St(RQ());St(nr());function OQ(e){return Yf(({path:n,args:r})=>{var s;const a=[...n],o=a.pop();if(o==="useMutation")return e[o](a,...r);if(o==="_def")return{path:a};const[l,...u]=r,h=(s=u[0])!==null&&s!==void 0?s:{};return e[o](a,l,h)})}var tm;const MQ=["client","ssrContext","ssrState","abortOnUnmount"],jQ=(tm=te.createContext)===null||tm===void 0?void 0:tm.call(Oz,null),LQ=e=>{switch(e){case"queryOptions":case"fetch":case"ensureData":case"prefetch":case"getData":case"setData":case"setQueriesData":return"query";case"infiniteQueryOptions":case"fetchInfinite":case"prefetchInfinite":case"getInfiniteData":case"setInfiniteData":return"infinite";case"setMutationDefaults":case"getMutationDefaults":case"isMutating":case"cancel":case"invalidate":case"refetch":case"reset":return"any"}};function $Q(e){return Yf(n=>{const r=[...n.path],s=r.pop(),a=[...n.args],o=a.shift(),l=LQ(s),u=hr(r,o,l);return{infiniteQueryOptions:()=>e.infiniteQueryOptions(r,u,a[0]),queryOptions:()=>e.queryOptions(r,u,...a),fetch:()=>e.fetchQuery(u,...a),fetchInfinite:()=>e.fetchInfiniteQuery(u,a[0]),prefetch:()=>e.prefetchQuery(u,...a),prefetchInfinite:()=>e.prefetchInfiniteQuery(u,a[0]),ensureData:()=>e.ensureQueryData(u,...a),invalidate:()=>e.invalidateQueries(u,...a),reset:()=>e.resetQueries(u,...a),refetch:()=>e.refetchQueries(u,...a),cancel:()=>e.cancelQuery(u,...a),setData:()=>{e.setQueryData(u,a[0],a[1])},setQueriesData:()=>e.setQueriesData(u,a[0],a[1],a[2]),setInfiniteData:()=>{e.setInfiniteQueryData(u,a[0],a[1])},getData:()=>e.getQueryData(u),getInfiniteData:()=>e.getInfiniteQueryData(u),setMutationDefaults:()=>e.setMutationDefaults(Cf(r),o),getMutationDefaults:()=>e.getMutationDefaults(Cf(r)),isMutating:()=>e.isMutating({mutationKey:Cf(r)})}[s]()})}function IQ(e){const n=fD(e.client),r=$Q(e);return bC(s=>{const a=s;return a==="client"?n:MQ.includes(a)?e[a]:r[s]})}var DQ=Hs(fl(),1);function Rq(e){const n=e instanceof Wf?e:wC(e);return Yf(r=>{const s=r.path,a=s.join("."),[o,l]=r.args;return(0,DQ.default)({queryKey:hr(s,o,"query"),queryFn:()=>n.query(a,o,l==null?void 0:l.trpc)},l)})}var nm=Hs(fl(),1);function en(e,n,r){var s;const a=e[0];let o=(s=e[1])===null||s===void 0?void 0:s.input;if(r){var l;o=(0,nm.default)((0,nm.default)((0,nm.default)({},(l=o)!==null&&l!==void 0?l:{}),r.pageParam?{cursor:r.pageParam}:{}),{},{direction:r.direction})}return[a.join("."),o,n==null?void 0:n.trpc]}var kQ=Yi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,n){function r(a){var o,l,u,h=2;for(typeof Symbol<"u"&&(l=Symbol.asyncIterator,u=Symbol.iterator);h--;){if(l&&(o=a[l])!=null)return o.call(a);if(u&&(o=a[u])!=null)return new s(o.call(a));l="@@asyncIterator",u="@@iterator"}throw new TypeError("Object is not async iterable")}function s(a){function o(l){if(Object(l)!==l)return Promise.reject(new TypeError(l+" is not an object."));var u=l.done;return Promise.resolve(l.value).then(function(h){return{value:h,done:u}})}return s=function(u){this.s=u,this.n=u.next},s.prototype={s:null,n:null,next:function(){return o(this.n.apply(this.s,arguments))},return:function(u){var h=this.s.return;return h===void 0?Promise.resolve({value:u,done:!0}):o(h.apply(this.s,arguments))},throw:function(u){var h=this.s.return;return h===void 0?Promise.reject(u):o(h.apply(this.s,arguments))}},new s(a)}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports}}),BQ=Hs(kQ(),1);function KE(e){return{path:e.path.join(".")}}function Au(e){const n=KE(e);return te.useMemo(()=>n,[n])}async function dD(e,n,r){const a=n.getQueryCache().build(n,{queryKey:r});a.setState({data:[],status:"success"});const o=[];var l=!1,u=!1,h;try{for(var f=(0,BQ.default)(e),p;l=!(p=await f.next()).done;l=!1){const d=p.value;o.push(d),a.setState({data:[...o]})}}catch(d){u=!0,h=d}finally{try{l&&f.return!=null&&await f.return()}finally{if(u)throw h}}return o}var Ye=Hs(fl(),1);function PQ(e){const{client:n,queryClient:r}=e,s=n instanceof Wf?n:wC(n);return{infiniteQueryOptions:(a,o,l)=>{var u,h;const f=((u=o[1])===null||u===void 0?void 0:u.input)===xn,p=async d=>{var g;const y=(0,Ye.default)((0,Ye.default)({},l),{},{trpc:(0,Ye.default)((0,Ye.default)({},l==null?void 0:l.trpc),!(l==null||(g=l.trpc)===null||g===void 0)&&g.abortOnUnmount?{signal:d.signal}:{signal:null})});return await s.query(...en(o,y,{direction:d.direction,pageParam:d.pageParam}))};return Object.assign((0,Ye.default)((0,Ye.default)({},l),{},{initialData:l==null?void 0:l.initialData,queryKey:o,queryFn:f?xn:p,initialPageParam:(h=l==null?void 0:l.initialCursor)!==null&&h!==void 0?h:null}),{trpc:KE({path:a})})},queryOptions:(a,o,l)=>{var u;const h=((u=o[1])===null||u===void 0?void 0:u.input)===xn,f=async p=>{var d;const g=(0,Ye.default)((0,Ye.default)({},l),{},{trpc:(0,Ye.default)((0,Ye.default)({},l==null?void 0:l.trpc),!(l==null||(d=l.trpc)===null||d===void 0)&&d.abortOnUnmount?{signal:p.signal}:{signal:null})}),y=await s.query(...en(o,g));return KI(y)?dD(y,r,o):y};return Object.assign((0,Ye.default)((0,Ye.default)({},l),{},{initialData:l==null?void 0:l.initialData,queryKey:o,queryFn:h?xn:f}),{trpc:KE({path:a})})},fetchQuery:(a,o)=>r.fetchQuery((0,Ye.default)((0,Ye.default)({},o),{},{queryKey:a,queryFn:()=>s.query(...en(a,o))})),fetchInfiniteQuery:(a,o)=>{var l;return r.fetchInfiniteQuery((0,Ye.default)((0,Ye.default)({},o),{},{queryKey:a,queryFn:({pageParam:u,direction:h})=>s.query(...en(a,o,{pageParam:u,direction:h})),initialPageParam:(l=o==null?void 0:o.initialCursor)!==null&&l!==void 0?l:null}))},prefetchQuery:(a,o)=>r.prefetchQuery((0,Ye.default)((0,Ye.default)({},o),{},{queryKey:a,queryFn:()=>s.query(...en(a,o))})),prefetchInfiniteQuery:(a,o)=>{var l;return r.prefetchInfiniteQuery((0,Ye.default)((0,Ye.default)({},o),{},{queryKey:a,queryFn:({pageParam:u,direction:h})=>s.query(...en(a,o,{pageParam:u,direction:h})),initialPageParam:(l=o==null?void 0:o.initialCursor)!==null&&l!==void 0?l:null}))},ensureQueryData:(a,o)=>r.ensureQueryData((0,Ye.default)((0,Ye.default)({},o),{},{queryKey:a,queryFn:()=>s.query(...en(a,o))})),invalidateQueries:(a,o,l)=>r.invalidateQueries((0,Ye.default)((0,Ye.default)({},o),{},{queryKey:a}),l),resetQueries:(a,o,l)=>r.resetQueries((0,Ye.default)((0,Ye.default)({},o),{},{queryKey:a}),l),refetchQueries:(a,o,l)=>r.refetchQueries((0,Ye.default)((0,Ye.default)({},o),{},{queryKey:a}),l),cancelQuery:(a,o)=>r.cancelQueries({queryKey:a},o),setQueryData:(a,o,l)=>r.setQueryData(a,o,l),setQueriesData:(a,o,l,u)=>r.setQueriesData((0,Ye.default)((0,Ye.default)({},o),{},{queryKey:a}),l,u),getQueryData:a=>r.getQueryData(a),setInfiniteQueryData:(a,o,l)=>r.setQueryData(a,o,l),getInfiniteQueryData:a=>r.getQueryData(a),setMutationDefaults:(a,o)=>{const l=a[0],u=h=>s.mutation(...en([l,{input:h}],e));return r.setMutationDefaults(a,typeof o=="function"?o({canonicalMutationFn:u}):o)},getMutationDefaults:a=>r.getMutationDefaults(a),isMutating:a=>r.isMutating((0,Ye.default)((0,Ye.default)({},a),{},{exact:!0}))}}var Ee=Hs(fl());const Oq=(e,n)=>new Proxy(e,{get(s,a){return n(a),s[a]}});function zQ(e){var n,r;const s=(n=void 0)!==null&&n!==void 0?n:A=>A.originalFn(),a=(r=void 0)!==null&&r!==void 0?r:jQ,o=TQ,l=A=>{var N;const{abortOnUnmount:O=!1,queryClient:I,ssrContext:k}=A,[R,M]=te.useState((N=A.ssrState)!==null&&N!==void 0?N:!1),D=A.client instanceof Wf?A.client:wC(A.client),z=te.useMemo(()=>PQ({client:D,queryClient:I}),[D,I]),q=te.useMemo(()=>(0,Ee.default)({abortOnUnmount:O,queryClient:I,client:D,ssrContext:k??null,ssrState:R},z),[O,D,z,I,k,R]);return te.useEffect(()=>{M(j=>j?"mounted":!1)},[]),F.jsx(a.Provider,{value:q,children:A.children})};function u(){const A=te.useContext(a);if(!A)throw new Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");return A}function h(A,N){var O;const{queryClient:I,ssrState:k}=u();return k&&k!=="mounted"&&((O=I.getQueryCache().find({queryKey:A}))===null||O===void 0?void 0:O.state.status)==="error"?(0,Ee.default)({retryOnMount:!1},N):N}function f(A,N,O){var I,k,R,M,D;const z=u(),{abortOnUnmount:q,client:j,ssrState:L,queryClient:P,prefetchQuery:H}=z,G=hr(A,N,"query"),V=P.getQueryDefaults(G),B=N===xn;typeof window>"u"&&L==="prepass"&&(O==null||(I=O.trpc)===null||I===void 0?void 0:I.ssr)!==!1&&((k=O==null?void 0:O.enabled)!==null&&k!==void 0?k:V==null?void 0:V.enabled)!==!1&&!B&&!P.getQueryCache().find({queryKey:G})&&H(G,O);const K=h(G,(0,Ee.default)((0,Ee.default)({},V),O)),ne=(R=(M=O==null||(D=O.trpc)===null||D===void 0?void 0:D.abortOnUnmount)!==null&&M!==void 0?M:void 0)!==null&&R!==void 0?R:q,Q=dU((0,Ee.default)((0,Ee.default)({},K),{},{queryKey:G,queryFn:B?N:async J=>{const ie=(0,Ee.default)((0,Ee.default)({},K),{},{trpc:(0,Ee.default)((0,Ee.default)({},K==null?void 0:K.trpc),ne?{signal:J.signal}:{signal:null})}),oe=await j.query(...en(G,ie));return KI(oe)?dD(oe,P,G):oe}}),P);return Q.trpc=Au({path:A}),Q}function p(A,N,O){var I,k,R;const M=u(),D=hr(A,N,"query"),z=N===xn,q=(I=(k=O==null||(R=O.trpc)===null||R===void 0?void 0:R.abortOnUnmount)!==null&&k!==void 0?k:void 0)!==null&&I!==void 0?I:M.abortOnUnmount;yU((0,Ee.default)((0,Ee.default)({},O),{},{queryKey:D,queryFn:z?N:j=>{const L={trpc:(0,Ee.default)((0,Ee.default)({},O==null?void 0:O.trpc),q?{signal:j.signal}:{})};return M.client.query(...en(D,L))}}))}function d(A,N,O){var I,k,R;const M=u(),D=hr(A,N,"query"),z=(I=(k=O==null||(R=O.trpc)===null||R===void 0?void 0:R.abortOnUnmount)!==null&&k!==void 0?k:void 0)!==null&&I!==void 0?I:M.abortOnUnmount,q=pU((0,Ee.default)((0,Ee.default)({},O),{},{queryKey:D,queryFn:j=>{const L=(0,Ee.default)((0,Ee.default)({},O),{},{trpc:(0,Ee.default)((0,Ee.default)({},O==null?void 0:O.trpc),z?{signal:j.signal}:{signal:null})});return M.client.query(...en(D,L))}}),M.queryClient);return q.trpc=Au({path:A}),[q.data,q]}function g(A,N){const{client:O,queryClient:I}=u(),k=Cf(A),R=I.defaultMutationOptions(I.getMutationDefaults(k)),M=bU((0,Ee.default)((0,Ee.default)({},N),{},{mutationKey:k,mutationFn:D=>O.mutation(...en([A,{input:D}],N)),onSuccess(...D){var z,q;return s({originalFn:()=>{var L,P,H;return(L=N==null||(P=N.onSuccess)===null||P===void 0?void 0:P.call(N,...D))!==null&&L!==void 0?L:R==null||(H=R.onSuccess)===null||H===void 0?void 0:H.call(R,...D)},queryClient:I,meta:(z=(q=N==null?void 0:N.meta)!==null&&q!==void 0?q:R==null?void 0:R.meta)!==null&&z!==void 0?z:{}})}}),I);return M.trpc=Au({path:A}),M}const y={data:void 0,error:null,status:"idle"},E={data:void 0,error:null,status:"connecting"};/* istanbul ignore next -- @preserve */function x(A,N,O){var I;const k=(I=O==null?void 0:O.enabled)!==null&&I!==void 0?I:N!==xn,R=Ki(hr(A,N,"any")),{client:M}=u(),D=te.useRef(O);te.useEffect(()=>{D.current=O});const[z]=te.useState(new Set([])),q=te.useCallback(B=>{z.add(B)},[z]),j=te.useRef(null),L=te.useCallback(B=>{const K=H.current,ne=H.current=B(K);let Q=!1;for(const J of z)if(K[J]!==ne[J]){Q=!0;break}Q&&V(Oq(ne,q))},[q,z]),P=te.useCallback(()=>{var B;if((B=j.current)===null||B===void 0||B.unsubscribe(),!k){L(()=>(0,Ee.default)((0,Ee.default)({},y),{},{reset:P}));return}L(()=>(0,Ee.default)((0,Ee.default)({},E),{},{reset:P}));const K=M.subscription(A.join("."),N??void 0,{onStarted:()=>{var ne,Q;(ne=(Q=D.current).onStarted)===null||ne===void 0||ne.call(Q),L(J=>(0,Ee.default)((0,Ee.default)({},J),{},{status:"pending",error:null}))},onData:ne=>{var Q,J;(Q=(J=D.current).onData)===null||Q===void 0||Q.call(J,ne),L(ie=>(0,Ee.default)((0,Ee.default)({},ie),{},{status:"pending",data:ne,error:null}))},onError:ne=>{var Q,J;(Q=(J=D.current).onError)===null||Q===void 0||Q.call(J,ne),L(ie=>(0,Ee.default)((0,Ee.default)({},ie),{},{status:"error",error:ne}))},onConnectionStateChange:ne=>{L(Q=>{switch(ne.state){case"idle":return(0,Ee.default)((0,Ee.default)({},Q),{},{status:ne.state,error:null,data:void 0});case"connecting":return(0,Ee.default)((0,Ee.default)({},Q),{},{error:ne.error,status:ne.state});case"pending":return Q}})},onComplete:()=>{var ne,Q;(ne=(Q=D.current).onComplete)===null||ne===void 0||ne.call(Q),L(J=>(0,Ee.default)((0,Ee.default)({},J),{},{status:"idle",error:null,data:void 0}))}});j.current=K},[M,R,k,L]);te.useEffect(()=>(P(),()=>{var B;(B=j.current)===null||B===void 0||B.unsubscribe()}),[P]);const H=te.useRef(k?(0,Ee.default)((0,Ee.default)({},E),{},{reset:P}):(0,Ee.default)((0,Ee.default)({},y),{},{reset:P})),[G,V]=te.useState(Oq(H.current,q));return G}function v(A,N,O){var I,k,R,M,D;const{client:z,ssrState:q,prefetchInfiniteQuery:j,queryClient:L,abortOnUnmount:P}=u(),H=hr(A,N,"infinite"),G=L.getQueryDefaults(H),V=N===xn;typeof window>"u"&&q==="prepass"&&(O==null||(I=O.trpc)===null||I===void 0?void 0:I.ssr)!==!1&&((k=O==null?void 0:O.enabled)!==null&&k!==void 0?k:G==null?void 0:G.enabled)!==!1&&!V&&!L.getQueryCache().find({queryKey:H})&&j(H,(0,Ee.default)((0,Ee.default)({},G),O));const B=h(H,(0,Ee.default)((0,Ee.default)({},G),O)),K=(R=O==null||(M=O.trpc)===null||M===void 0?void 0:M.abortOnUnmount)!==null&&R!==void 0?R:P,ne=_U((0,Ee.default)((0,Ee.default)({},B),{},{initialPageParam:(D=O.initialCursor)!==null&&D!==void 0?D:null,persister:O.persister,queryKey:H,queryFn:V?N:Q=>{var J;const ie=(0,Ee.default)((0,Ee.default)({},B),{},{trpc:(0,Ee.default)((0,Ee.default)({},B==null?void 0:B.trpc),K?{signal:Q.signal}:{signal:null})});return z.query(...en(H,ie,{pageParam:(J=Q.pageParam)!==null&&J!==void 0?J:O.initialCursor,direction:Q.direction}))}}),L);return ne.trpc=Au({path:A}),ne}function b(A,N,O){var I,k,R;const M=u(),D=hr(A,N,"infinite"),z=M.queryClient.getQueryDefaults(D),q=N===xn,j=h(D,(0,Ee.default)((0,Ee.default)({},z),O)),L=(I=O==null||(k=O.trpc)===null||k===void 0?void 0:k.abortOnUnmount)!==null&&I!==void 0?I:M.abortOnUnmount;vU((0,Ee.default)((0,Ee.default)({},O),{},{initialPageParam:(R=O.initialCursor)!==null&&R!==void 0?R:null,queryKey:D,queryFn:q?N:P=>{var H;const G=(0,Ee.default)((0,Ee.default)({},j),{},{trpc:(0,Ee.default)((0,Ee.default)({},j==null?void 0:j.trpc),L?{signal:P.signal}:{})});return M.client.query(...en(D,G,{pageParam:(H=P.pageParam)!==null&&H!==void 0?H:O.initialCursor,direction:P.direction}))}}))}function w(A,N,O){var I,k,R;const M=u(),D=hr(A,N,"infinite"),z=M.queryClient.getQueryDefaults(D),q=h(D,(0,Ee.default)((0,Ee.default)({},z),O)),j=(I=O==null||(k=O.trpc)===null||k===void 0?void 0:k.abortOnUnmount)!==null&&I!==void 0?I:M.abortOnUnmount,L=mU((0,Ee.default)((0,Ee.default)({},O),{},{initialPageParam:(R=O.initialCursor)!==null&&R!==void 0?R:null,queryKey:D,queryFn:P=>{var H;const G=(0,Ee.default)((0,Ee.default)({},q),{},{trpc:(0,Ee.default)((0,Ee.default)({},q==null?void 0:q.trpc),j?{signal:P.signal}:{})});return M.client.query(...en(D,G,{pageParam:(H=P.pageParam)!==null&&H!==void 0?H:O.initialCursor,direction:P.direction}))}}),M.queryClient);return L.trpc=Au({path:A}),[L.data,L]}return{Provider:l,createClient:o,useContext:u,useUtils:u,useQuery:f,usePrefetchQuery:p,useSuspenseQuery:d,useQueries:(A,N)=>{const{ssrState:O,queryClient:I,prefetchQuery:k,client:R}=u(),M=Rq(R),D=A(M);if(typeof window>"u"&&O==="prepass")for(const q of D){var z;const j=q;((z=j.trpc)===null||z===void 0?void 0:z.ssr)!==!1&&!I.getQueryCache().find({queryKey:j.queryKey})&&k(j.queryKey,j)}return GI({queries:D.map(q=>(0,Ee.default)((0,Ee.default)({},q),{},{queryKey:q.queryKey})),combine:N==null?void 0:N.combine},I)},useSuspenseQueries:A=>{const{queryClient:N,client:O}=u(),I=Rq(O),k=A(I),R=gU({queries:k.map(M=>(0,Ee.default)((0,Ee.default)({},M),{},{queryFn:M.queryFn,queryKey:M.queryKey}))},N);return[R.map(M=>M.data),R]},useMutation:g,useSubscription:x,useInfiniteQuery:v,usePrefetchInfiniteQuery:b,useSuspenseInfiniteQuery:w}}function UQ(e){const n=OQ(e);return bC(r=>r==="useContext"||r==="useUtils"?()=>{const s=e.useUtils();return te.useMemo(()=>IQ(s),[s])}:e.hasOwnProperty(r)?e[r]:n[r])}function QQ(e){const n=zQ();return UQ(n)}const Xn=QQ(),Mq=new lU({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}}),HQ=Xn.createClient({links:[yQ({url:"/trpc"})]}),jq=e=>{let n;const r=new Set,s=(f,p)=>{const d=typeof f=="function"?f(n):f;if(!Object.is(d,n)){const g=n;n=p??(typeof d!="object"||d===null)?d:Object.assign({},n,d),r.forEach(y=>y(n,g))}},a=()=>n,u={setState:s,getState:a,getInitialState:()=>h,subscribe:f=>(r.add(f),()=>r.delete(f))},h=n=e(s,a,u);return u},VQ=(e=>e?jq(e):jq),FQ=e=>e;function GQ(e,n=FQ){const r=Ga.useSyncExternalStore(e.subscribe,Ga.useCallback(()=>n(e.getState()),[e,n]),Ga.useCallback(()=>n(e.getInitialState()),[e,n]));return Ga.useDebugValue(r),r}const Lq=e=>{const n=VQ(e),r=s=>GQ(n,s);return Object.assign(r,n),r},KQ=(e=>e?Lq(e):Lq);function Zn(e,n){return e?`${e}.${n}`:n}const qe=KQ(e=>({connectionId:null,dialect:null,tables:[],crawlResult:null,currentWorkspaceId:null,currentWorkspaceName:null,databaseLabel:null,nodePositions:new Map,collapsedNodes:new Set,nodeWidths:new Map,colorAssignments:{},nodeColorGroups:new Map,crossSchemaExpansion:!0,schemaDiff:null,schemaBaseline:null,pollingEnabled:!0,setConnection:(n,r)=>e({connectionId:n,dialect:r}),clearConnection:()=>e({connectionId:null,dialect:null,tables:[],crawlResult:null,currentWorkspaceId:null,currentWorkspaceName:null,databaseLabel:null,nodePositions:new Map,collapsedNodes:new Set,nodeWidths:new Map,colorAssignments:{},nodeColorGroups:new Map,crossSchemaExpansion:!0,schemaDiff:null,schemaBaseline:null,pollingEnabled:!0}),setTables:n=>e({tables:n}),setCrawlResult:n=>e({crawlResult:n}),addExpandedTable:(n,r,s)=>e(a=>{if(!a.crawlResult)return a;const o=new Set(a.crawlResult.tables.map(h=>h.name));o.add(n.name);const l=a.crawlResult.ghostNodes.filter(h=>h.tableName!==s),u=r.filter(h=>!o.has(h.tableName)&&!l.some(f=>f.tableName===h.tableName));return{crawlResult:{...a.crawlResult,tables:[...a.crawlResult.tables,n],ghostNodes:[...l,...u]}}}),setWorkspace:(n,r)=>e({currentWorkspaceId:n,currentWorkspaceName:r}),clearWorkspace:()=>e({currentWorkspaceId:null,currentWorkspaceName:null,nodePositions:new Map,collapsedNodes:new Set,nodeWidths:new Map,colorAssignments:{},nodeColorGroups:new Map,crossSchemaExpansion:!0}),setDatabaseLabel:n=>e({databaseLabel:n}),updateNodePosition:(n,r)=>e(s=>{const a=new Map(s.nodePositions);return a.set(n,r),{nodePositions:a}}),toggleNodeCollapsed:n=>e(r=>{const s=new Set(r.collapsedNodes);return s.has(n)?s.delete(n):s.add(n),{collapsedNodes:s}}),updateNodeWidth:(n,r)=>e(s=>{const a=new Map(s.nodeWidths);return a.set(n,r),{nodeWidths:a}}),setColorAssignment:(n,r)=>e(s=>({colorAssignments:{...s.colorAssignments,[n]:r}})),setNodeColorGroup:(n,r)=>e(s=>{const a=new Map(s.nodeColorGroups);return a.set(n,r),{nodeColorGroups:a}}),setColorAssignments:n=>e({colorAssignments:n}),setAllNodeColorGroups:n=>e({nodeColorGroups:n}),setCrossSchemaExpansion:n=>e({crossSchemaExpansion:n}),setSchemaDiff:n=>e({schemaDiff:n}),setSchemaBaseline:n=>e({schemaBaseline:n}),setPollingEnabled:n=>e({pollingEnabled:n}),acceptSchemaChanges:()=>e(n=>{var r;return{schemaDiff:null,schemaBaseline:((r=n.crawlResult)==null?void 0:r.tables)??n.schemaBaseline}})})),YQ={postgres:"5432",mysql:"3306",mssql:"1433",oracle:"1521"};function XQ(){const[e,n]=te.useState("postgres"),[r,s]=te.useState("localhost"),[a,o]=te.useState("5432"),[l,u]=te.useState(""),[h,f]=te.useState(""),[p,d]=te.useState(""),[g,y]=te.useState(""),[E,x]=te.useState(""),[v,b]=te.useState(!1),[w,C]=te.useState(null),T=qe(M=>M.setConnection),A=qe(M=>M.setTables),N=qe(M=>M.setDatabaseLabel),O=Xn.connection.connect.useMutation(),I=Xn.useUtils(),k=M=>{n(M),M!=="sqlite"&&o(YQ[M])},R=async()=>{C(null);try{let M;switch(e){case"sqlite":M={dialect:"sqlite",filePath:E};break;case"postgres":M={dialect:"postgres",host:r,port:Number(a),database:l,user:p,password:g};break;case"mysql":M={dialect:"mysql",host:r,port:Number(a),database:l,user:p,password:g};break;case"mssql":M={dialect:"mssql",host:r,port:Number(a),database:l,user:p,password:g,trustServerCertificate:v};break;case"oracle":M={dialect:"oracle",host:r,port:Number(a),serviceName:h,user:p,password:g};break}const{connectionId:D}=await O.mutateAsync(M);T(D,e);const z=e==="sqlite"?E.split("/").pop()??E:e==="oracle"?`${h}@${r}:${a}`:`${l}@${r}:${a}`;N(z);const q=await I.schema.getTables.fetch({connectionId:D});A(q)}catch(M){C(M instanceof Error?M.message:String(M))}};return F.jsxs("div",{className:"connection-form",children:[F.jsx("h2",{children:"Connect to Database"}),F.jsxs("div",{className:"form-group",children:[F.jsx("label",{children:"Dialect"}),F.jsxs("select",{value:e,onChange:M=>k(M.target.value),children:[F.jsx("option",{value:"postgres",children:"PostgreSQL"}),F.jsx("option",{value:"mysql",children:"MySQL"}),F.jsx("option",{value:"mssql",children:"SQL Server"}),F.jsx("option",{value:"oracle",children:"Oracle"}),F.jsx("option",{value:"sqlite",children:"SQLite"})]})]}),e==="sqlite"?F.jsxs("div",{className:"form-group",children:[F.jsx("label",{children:"File Path"}),F.jsx("input",{value:E,onChange:M=>x(M.target.value),placeholder:"/path/to/database.sqlite"})]}):F.jsxs(F.Fragment,{children:[F.jsxs("div",{className:"form-group",children:[F.jsx("label",{children:"Host"}),F.jsx("input",{value:r,onChange:M=>s(M.target.value)})]}),F.jsxs("div",{className:"form-group",children:[F.jsx("label",{children:"Port"}),F.jsx("input",{value:a,onChange:M=>o(M.target.value),type:"number"})]}),e==="oracle"?F.jsxs("div",{className:"form-group",children:[F.jsx("label",{children:"Service Name"}),F.jsx("input",{value:h,onChange:M=>f(M.target.value)})]}):F.jsxs("div",{className:"form-group",children:[F.jsx("label",{children:"Database"}),F.jsx("input",{value:l,onChange:M=>u(M.target.value)})]}),F.jsxs("div",{className:"form-group",children:[F.jsx("label",{children:"User"}),F.jsx("input",{value:p,onChange:M=>d(M.target.value)})]}),F.jsxs("div",{className:"form-group",children:[F.jsx("label",{children:"Password"}),F.jsx("input",{value:g,onChange:M=>y(M.target.value),type:"password"})]}),e==="mssql"&&F.jsx("div",{className:"form-group",children:F.jsxs("label",{children:[F.jsx("input",{type:"checkbox",checked:v,onChange:M=>b(M.target.checked)})," ","Trust Server Certificate"]})})]}),w&&F.jsx("div",{className:"error",children:w}),F.jsx("button",{onClick:R,disabled:O.isPending,children:O.isPending?"Connecting...":"Connect"})]})}function $q(){const e=qe(g=>g.connectionId),n=qe(g=>g.tables),r=qe(g=>g.setCrawlResult),[s,a]=te.useState(""),[o,l]=te.useState(2),[u,h]=te.useState(!1),f=Xn.useUtils(),p=async()=>{if(!(!e||!s)){h(!0);try{const g=await f.schema.crawlFrom.fetch({connectionId:e,tableName:s,maxDepth:o});r(g)}finally{h(!1)}}},d=async()=>{if(e){h(!0);try{const g=await f.schema.crawlSchema.fetch({connectionId:e,schema:null});r(g)}finally{h(!1)}}};return F.jsxs("div",{className:"table-picker",children:[F.jsx("h3",{children:"Explore Schema"}),F.jsxs("div",{className:"form-group",children:[F.jsx("label",{children:"Starting Table"}),F.jsxs("select",{value:s,onChange:g=>a(g.target.value),children:[F.jsx("option",{value:"",children:"Select a table..."}),n.map(g=>F.jsx("option",{value:g.name,children:g.schema?`${g.schema}.${g.name}`:g.name},g.schema?`${g.schema}.${g.name}`:g.name))]})]}),F.jsxs("div",{className:"form-group",children:[F.jsx("label",{children:"Depth"}),F.jsx("input",{type:"number",min:0,max:10,value:o,onChange:g=>l(Number(g.target.value))})]}),F.jsxs("div",{className:"picker-actions",children:[F.jsx("button",{onClick:p,disabled:!s||u,children:u?"Loading...":"Crawl from Table"}),F.jsx("button",{onClick:d,disabled:u,className:"secondary",children:"Load Entire Schema"})]})]})}function jt(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let r=0,s;r<e.length;r++)(s=jt(e[r]))!==""&&(n+=(n&&" ")+s);else for(let r in e)e[r]&&(n+=(n&&" ")+r);return n}var WQ={value:()=>{}};function Jf(){for(var e=0,n=arguments.length,r={},s;e<n;++e){if(!(s=arguments[e]+"")||s in r||/[\s.]/.test(s))throw new Error("illegal type: "+s);r[s]=[]}return new Sf(r)}function Sf(e){this._=e}function JQ(e,n){return e.trim().split(/^|\s+/).map(function(r){var s="",a=r.indexOf(".");if(a>=0&&(s=r.slice(a+1),r=r.slice(0,a)),r&&!n.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:s}})}Sf.prototype=Jf.prototype={constructor:Sf,on:function(e,n){var r=this._,s=JQ(e+"",r),a,o=-1,l=s.length;if(arguments.length<2){for(;++o<l;)if((a=(e=s[o]).type)&&(a=ZQ(r[a],e.name)))return a;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++o<l;)if(a=(e=s[o]).type)r[a]=Iq(r[a],e.name,n);else if(n==null)for(a in r)r[a]=Iq(r[a],e.name,null);return this},copy:function(){var e={},n=this._;for(var r in n)e[r]=n[r].slice();return new Sf(e)},call:function(e,n){if((a=arguments.length-2)>0)for(var r=new Array(a),s=0,a,o;s<a;++s)r[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],s=0,a=o.length;s<a;++s)o[s].value.apply(n,r)},apply:function(e,n,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],a=0,o=s.length;a<o;++a)s[a].value.apply(n,r)}};function ZQ(e,n){for(var r=0,s=e.length,a;r<s;++r)if((a=e[r]).name===n)return a.value}function Iq(e,n,r){for(var s=0,a=e.length;s<a;++s)if(e[s].name===n){e[s]=WQ,e=e.slice(0,s).concat(e.slice(s+1));break}return r!=null&&e.push({name:n,value:r}),e}var YE="http://www.w3.org/1999/xhtml";const Dq={svg:"http://www.w3.org/2000/svg",xhtml:YE,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Zf(e){var n=e+="",r=n.indexOf(":");return r>=0&&(n=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Dq.hasOwnProperty(n)?{space:Dq[n],local:e}:e}function eH(e){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===YE&&n.documentElement.namespaceURI===YE?n.createElement(e):n.createElementNS(r,e)}}function tH(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function pD(e){var n=Zf(e);return(n.local?tH:eH)(n)}function nH(){}function EC(e){return e==null?nH:function(){return this.querySelector(e)}}function rH(e){typeof e!="function"&&(e=EC(e));for(var n=this._groups,r=n.length,s=new Array(r),a=0;a<r;++a)for(var o=n[a],l=o.length,u=s[a]=new Array(l),h,f,p=0;p<l;++p)(h=o[p])&&(f=e.call(h,h.__data__,p,o))&&("__data__"in h&&(f.__data__=h.__data__),u[p]=f);return new Tn(s,this._parents)}function iH(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function sH(){return[]}function mD(e){return e==null?sH:function(){return this.querySelectorAll(e)}}function aH(e){return function(){return iH(e.apply(this,arguments))}}function oH(e){typeof e=="function"?e=aH(e):e=mD(e);for(var n=this._groups,r=n.length,s=[],a=[],o=0;o<r;++o)for(var l=n[o],u=l.length,h,f=0;f<u;++f)(h=l[f])&&(s.push(e.call(h,h.__data__,f,l)),a.push(h));return new Tn(s,a)}function gD(e){return function(){return this.matches(e)}}function yD(e){return function(n){return n.matches(e)}}var uH=Array.prototype.find;function lH(e){return function(){return uH.call(this.children,e)}}function cH(){return this.firstElementChild}function fH(e){return this.select(e==null?cH:lH(typeof e=="function"?e:yD(e)))}var hH=Array.prototype.filter;function dH(){return Array.from(this.children)}function pH(e){return function(){return hH.call(this.children,e)}}function mH(e){return this.selectAll(e==null?dH:pH(typeof e=="function"?e:yD(e)))}function gH(e){typeof e!="function"&&(e=gD(e));for(var n=this._groups,r=n.length,s=new Array(r),a=0;a<r;++a)for(var o=n[a],l=o.length,u=s[a]=[],h,f=0;f<l;++f)(h=o[f])&&e.call(h,h.__data__,f,o)&&u.push(h);return new Tn(s,this._parents)}function vD(e){return new Array(e.length)}function yH(){return new Tn(this._enter||this._groups.map(vD),this._parents)}function Lf(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Lf.prototype={constructor:Lf,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function vH(e){return function(){return e}}function bH(e,n,r,s,a,o){for(var l=0,u,h=n.length,f=o.length;l<f;++l)(u=n[l])?(u.__data__=o[l],s[l]=u):r[l]=new Lf(e,o[l]);for(;l<h;++l)(u=n[l])&&(a[l]=u)}function _H(e,n,r,s,a,o,l){var u,h,f=new Map,p=n.length,d=o.length,g=new Array(p),y;for(u=0;u<p;++u)(h=n[u])&&(g[u]=y=l.call(h,h.__data__,u,n)+"",f.has(y)?a[u]=h:f.set(y,h));for(u=0;u<d;++u)y=l.call(e,o[u],u,o)+"",(h=f.get(y))?(s[u]=h,h.__data__=o[u],f.delete(y)):r[u]=new Lf(e,o[u]);for(u=0;u<p;++u)(h=n[u])&&f.get(g[u])===h&&(a[u]=h)}function wH(e){return e.__data__}function EH(e,n){if(!arguments.length)return Array.from(this,wH);var r=n?_H:bH,s=this._parents,a=this._groups;typeof e!="function"&&(e=vH(e));for(var o=a.length,l=new Array(o),u=new Array(o),h=new Array(o),f=0;f<o;++f){var p=s[f],d=a[f],g=d.length,y=CH(e.call(p,p&&p.__data__,f,s)),E=y.length,x=u[f]=new Array(E),v=l[f]=new Array(E),b=h[f]=new Array(g);r(p,d,x,v,b,y,n);for(var w=0,C=0,T,A;w<E;++w)if(T=x[w]){for(w>=C&&(C=w+1);!(A=v[C])&&++C<E;);T._next=A||null}}return l=new Tn(l,s),l._enter=u,l._exit=h,l}function CH(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function xH(){return new Tn(this._exit||this._groups.map(vD),this._parents)}function SH(e,n,r){var s=this.enter(),a=this,o=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),n!=null&&(a=n(a),a&&(a=a.selection())),r==null?o.remove():r(o),s&&a?s.merge(a).order():a}function TH(e){for(var n=e.selection?e.selection():e,r=this._groups,s=n._groups,a=r.length,o=s.length,l=Math.min(a,o),u=new Array(a),h=0;h<l;++h)for(var f=r[h],p=s[h],d=f.length,g=u[h]=new Array(d),y,E=0;E<d;++E)(y=f[E]||p[E])&&(g[E]=y);for(;h<a;++h)u[h]=r[h];return new Tn(u,this._parents)}function qH(){for(var e=this._groups,n=-1,r=e.length;++n<r;)for(var s=e[n],a=s.length-1,o=s[a],l;--a>=0;)(l=s[a])&&(o&&l.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(l,o),o=l);return this}function AH(e){e||(e=NH);function n(d,g){return d&&g?e(d.__data__,g.__data__):!d-!g}for(var r=this._groups,s=r.length,a=new Array(s),o=0;o<s;++o){for(var l=r[o],u=l.length,h=a[o]=new Array(u),f,p=0;p<u;++p)(f=l[p])&&(h[p]=f);h.sort(n)}return new Tn(a,this._parents).order()}function NH(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function RH(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function OH(){return Array.from(this)}function MH(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var s=e[n],a=0,o=s.length;a<o;++a){var l=s[a];if(l)return l}return null}function jH(){let e=0;for(const n of this)++e;return e}function LH(){return!this.node()}function $H(e){for(var n=this._groups,r=0,s=n.length;r<s;++r)for(var a=n[r],o=0,l=a.length,u;o<l;++o)(u=a[o])&&e.call(u,u.__data__,o,a);return this}function IH(e){return function(){this.removeAttribute(e)}}function DH(e){return function(){this.removeAttributeNS(e.space,e.local)}}function kH(e,n){return function(){this.setAttribute(e,n)}}function BH(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function PH(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function zH(e,n){return function(){var r=n.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function UH(e,n){var r=Zf(e);if(arguments.length<2){var s=this.node();return r.local?s.getAttributeNS(r.space,r.local):s.getAttribute(r)}return this.each((n==null?r.local?DH:IH:typeof n=="function"?r.local?zH:PH:r.local?BH:kH)(r,n))}function bD(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function QH(e){return function(){this.style.removeProperty(e)}}function HH(e,n,r){return function(){this.style.setProperty(e,n,r)}}function VH(e,n,r){return function(){var s=n.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,r)}}function FH(e,n,r){return arguments.length>1?this.each((n==null?QH:typeof n=="function"?VH:HH)(e,n,r??"")):po(this.node(),e)}function po(e,n){return e.style.getPropertyValue(n)||bD(e).getComputedStyle(e,null).getPropertyValue(n)}function GH(e){return function(){delete this[e]}}function KH(e,n){return function(){this[e]=n}}function YH(e,n){return function(){var r=n.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function XH(e,n){return arguments.length>1?this.each((n==null?GH:typeof n=="function"?YH:KH)(e,n)):this.node()[e]}function _D(e){return e.trim().split(/^|\s+/)}function CC(e){return e.classList||new wD(e)}function wD(e){this._node=e,this._names=_D(e.getAttribute("class")||"")}wD.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ED(e,n){for(var r=CC(e),s=-1,a=n.length;++s<a;)r.add(n[s])}function CD(e,n){for(var r=CC(e),s=-1,a=n.length;++s<a;)r.remove(n[s])}function WH(e){return function(){ED(this,e)}}function JH(e){return function(){CD(this,e)}}function ZH(e,n){return function(){(n.apply(this,arguments)?ED:CD)(this,e)}}function e4(e,n){var r=_D(e+"");if(arguments.length<2){for(var s=CC(this.node()),a=-1,o=r.length;++a<o;)if(!s.contains(r[a]))return!1;return!0}return this.each((typeof n=="function"?ZH:n?WH:JH)(r,n))}function t4(){this.textContent=""}function n4(e){return function(){this.textContent=e}}function r4(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function i4(e){return arguments.length?this.each(e==null?t4:(typeof e=="function"?r4:n4)(e)):this.node().textContent}function s4(){this.innerHTML=""}function a4(e){return function(){this.innerHTML=e}}function o4(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function u4(e){return arguments.length?this.each(e==null?s4:(typeof e=="function"?o4:a4)(e)):this.node().innerHTML}function l4(){this.nextSibling&&this.parentNode.appendChild(this)}function c4(){return this.each(l4)}function f4(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function h4(){return this.each(f4)}function d4(e){var n=typeof e=="function"?e:pD(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function p4(){return null}function m4(e,n){var r=typeof e=="function"?e:pD(e),s=n==null?p4:typeof n=="function"?n:EC(n);return this.select(function(){return this.insertBefore(r.apply(this,arguments),s.apply(this,arguments)||null)})}function g4(){var e=this.parentNode;e&&e.removeChild(this)}function y4(){return this.each(g4)}function v4(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function b4(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function _4(e){return this.select(e?b4:v4)}function w4(e){return arguments.length?this.property("__data__",e):this.node().__data__}function E4(e){return function(n){e.call(this,n,this.__data__)}}function C4(e){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");return s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),{type:n,name:r}})}function x4(e){return function(){var n=this.__on;if(n){for(var r=0,s=-1,a=n.length,o;r<a;++r)o=n[r],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):n[++s]=o;++s?n.length=s:delete this.__on}}}function S4(e,n,r){return function(){var s=this.__on,a,o=E4(n);if(s){for(var l=0,u=s.length;l<u;++l)if((a=s[l]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=o,a.options=r),a.value=n;return}}this.addEventListener(e.type,o,r),a={type:e.type,name:e.name,value:n,listener:o,options:r},s?s.push(a):this.__on=[a]}}function T4(e,n,r){var s=C4(e+""),a,o=s.length,l;if(arguments.length<2){var u=this.node().__on;if(u){for(var h=0,f=u.length,p;h<f;++h)for(a=0,p=u[h];a<o;++a)if((l=s[a]).type===p.type&&l.name===p.name)return p.value}return}for(u=n?S4:x4,a=0;a<o;++a)this.each(u(s[a],n,r));return this}function xD(e,n,r){var s=bD(e),a=s.CustomEvent;typeof a=="function"?a=new a(n,r):(a=s.document.createEvent("Event"),r?(a.initEvent(n,r.bubbles,r.cancelable),a.detail=r.detail):a.initEvent(n,!1,!1)),e.dispatchEvent(a)}function q4(e,n){return function(){return xD(this,e,n)}}function A4(e,n){return function(){return xD(this,e,n.apply(this,arguments))}}function N4(e,n){return this.each((typeof n=="function"?A4:q4)(e,n))}function*R4(){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var s=e[n],a=0,o=s.length,l;a<o;++a)(l=s[a])&&(yield l)}var SD=[null];function Tn(e,n){this._groups=e,this._parents=n}function hl(){return new Tn([[document.documentElement]],SD)}function O4(){return this}Tn.prototype=hl.prototype={constructor:Tn,select:rH,selectAll:oH,selectChild:fH,selectChildren:mH,filter:gH,data:EH,enter:yH,exit:xH,join:SH,merge:TH,selection:O4,order:qH,sort:AH,call:RH,nodes:OH,node:MH,size:jH,empty:LH,each:$H,attr:UH,style:FH,property:XH,classed:e4,text:i4,html:u4,raise:c4,lower:h4,append:d4,insert:m4,remove:y4,clone:_4,datum:w4,on:T4,dispatch:N4,[Symbol.iterator]:R4};function Sn(e){return typeof e=="string"?new Tn([[document.querySelector(e)]],[document.documentElement]):new Tn([[e]],SD)}function M4(e){let n;for(;n=e.sourceEvent;)e=n;return e}function Kn(e,n){if(e=M4(e),n===void 0&&(n=e.currentTarget),n){var r=n.ownerSVGElement||n;if(r.createSVGPoint){var s=r.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(n.getScreenCTM().inverse()),[s.x,s.y]}if(n.getBoundingClientRect){var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}}return[e.pageX,e.pageY]}const j4={passive:!1},Qu={capture:!0,passive:!1};function rm(e){e.stopImmediatePropagation()}function Xa(e){e.preventDefault(),e.stopImmediatePropagation()}function TD(e){var n=e.document.documentElement,r=Sn(e).on("dragstart.drag",Xa,Qu);"onselectstart"in n?r.on("selectstart.drag",Xa,Qu):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function qD(e,n){var r=e.document.documentElement,s=Sn(e).on("dragstart.drag",null);n&&(s.on("click.drag",Xa,Qu),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in r?s.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const rf=e=>()=>e;function XE(e,{sourceEvent:n,subject:r,target:s,identifier:a,active:o,x:l,y:u,dx:h,dy:f,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:p}})}XE.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function L4(e){return!e.ctrlKey&&!e.button}function $4(){return this.parentNode}function I4(e,n){return n??{x:e.x,y:e.y}}function D4(){return navigator.maxTouchPoints||"ontouchstart"in this}function AD(){var e=L4,n=$4,r=I4,s=D4,a={},o=Jf("start","drag","end"),l=0,u,h,f,p,d=0;function g(T){T.on("mousedown.drag",y).filter(s).on("touchstart.drag",v).on("touchmove.drag",b,j4).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(T,A){if(!(p||!e.call(this,T,A))){var N=C(this,n.call(this,T,A),T,A,"mouse");N&&(Sn(T.view).on("mousemove.drag",E,Qu).on("mouseup.drag",x,Qu),TD(T.view),rm(T),f=!1,u=T.clientX,h=T.clientY,N("start",T))}}function E(T){if(Xa(T),!f){var A=T.clientX-u,N=T.clientY-h;f=A*A+N*N>d}a.mouse("drag",T)}function x(T){Sn(T.view).on("mousemove.drag mouseup.drag",null),qD(T.view,f),Xa(T),a.mouse("end",T)}function v(T,A){if(e.call(this,T,A)){var N=T.changedTouches,O=n.call(this,T,A),I=N.length,k,R;for(k=0;k<I;++k)(R=C(this,O,T,A,N[k].identifier,N[k]))&&(rm(T),R("start",T,N[k]))}}function b(T){var A=T.changedTouches,N=A.length,O,I;for(O=0;O<N;++O)(I=a[A[O].identifier])&&(Xa(T),I("drag",T,A[O]))}function w(T){var A=T.changedTouches,N=A.length,O,I;for(p&&clearTimeout(p),p=setTimeout(function(){p=null},500),O=0;O<N;++O)(I=a[A[O].identifier])&&(rm(T),I("end",T,A[O]))}function C(T,A,N,O,I,k){var R=o.copy(),M=Kn(k||N,A),D,z,q;if((q=r.call(T,new XE("beforestart",{sourceEvent:N,target:g,identifier:I,active:l,x:M[0],y:M[1],dx:0,dy:0,dispatch:R}),O))!=null)return D=q.x-M[0]||0,z=q.y-M[1]||0,function j(L,P,H){var G=M,V;switch(L){case"start":a[I]=j,V=l++;break;case"end":delete a[I],--l;case"drag":M=Kn(H||P,A),V=l;break}R.call(L,T,new XE(L,{sourceEvent:P,subject:q,target:g,identifier:I,active:V,x:M[0]+D,y:M[1]+z,dx:M[0]-G[0],dy:M[1]-G[1],dispatch:R}),O)}}return g.filter=function(T){return arguments.length?(e=typeof T=="function"?T:rf(!!T),g):e},g.container=function(T){return arguments.length?(n=typeof T=="function"?T:rf(T),g):n},g.subject=function(T){return arguments.length?(r=typeof T=="function"?T:rf(T),g):r},g.touchable=function(T){return arguments.length?(s=typeof T=="function"?T:rf(!!T),g):s},g.on=function(){var T=o.on.apply(o,arguments);return T===o?g:T},g.clickDistance=function(T){return arguments.length?(d=(T=+T)*T,g):Math.sqrt(d)},g}function xC(e,n,r){e.prototype=n.prototype=r,r.constructor=e}function ND(e,n){var r=Object.create(e.prototype);for(var s in n)r[s]=n[s];return r}function dl(){}var Hu=.7,$f=1/Hu,Wa="\\s*([+-]?\\d+)\\s*",Vu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",yr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",k4=/^#([0-9a-f]{3,8})$/,B4=new RegExp(`^rgb\\(${Wa},${Wa},${Wa}\\)$`),P4=new RegExp(`^rgb\\(${yr},${yr},${yr}\\)$`),z4=new RegExp(`^rgba\\(${Wa},${Wa},${Wa},${Vu}\\)$`),U4=new RegExp(`^rgba\\(${yr},${yr},${yr},${Vu}\\)$`),Q4=new RegExp(`^hsl\\(${Vu},${yr},${yr}\\)$`),H4=new RegExp(`^hsla\\(${Vu},${yr},${yr},${Vu}\\)$`),kq={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};xC(dl,Ds,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Bq,formatHex:Bq,formatHex8:V4,formatHsl:F4,formatRgb:Pq,toString:Pq});function Bq(){return this.rgb().formatHex()}function V4(){return this.rgb().formatHex8()}function F4(){return RD(this).formatHsl()}function Pq(){return this.rgb().formatRgb()}function Ds(e){var n,r;return e=(e+"").trim().toLowerCase(),(n=k4.exec(e))?(r=n[1].length,n=parseInt(n[1],16),r===6?zq(n):r===3?new dn(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):r===8?sf(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):r===4?sf(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=B4.exec(e))?new dn(n[1],n[2],n[3],1):(n=P4.exec(e))?new dn(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=z4.exec(e))?sf(n[1],n[2],n[3],n[4]):(n=U4.exec(e))?sf(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=Q4.exec(e))?Hq(n[1],n[2]/100,n[3]/100,1):(n=H4.exec(e))?Hq(n[1],n[2]/100,n[3]/100,n[4]):kq.hasOwnProperty(e)?zq(kq[e]):e==="transparent"?new dn(NaN,NaN,NaN,0):null}function zq(e){return new dn(e>>16&255,e>>8&255,e&255,1)}function sf(e,n,r,s){return s<=0&&(e=n=r=NaN),new dn(e,n,r,s)}function G4(e){return e instanceof dl||(e=Ds(e)),e?(e=e.rgb(),new dn(e.r,e.g,e.b,e.opacity)):new dn}function WE(e,n,r,s){return arguments.length===1?G4(e):new dn(e,n,r,s??1)}function dn(e,n,r,s){this.r=+e,this.g=+n,this.b=+r,this.opacity=+s}xC(dn,WE,ND(dl,{brighter(e){return e=e==null?$f:Math.pow($f,e),new dn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Hu:Math.pow(Hu,e),new dn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new dn(js(this.r),js(this.g),js(this.b),If(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:Uq,formatHex:Uq,formatHex8:K4,formatRgb:Qq,toString:Qq}));function Uq(){return`#${Cs(this.r)}${Cs(this.g)}${Cs(this.b)}`}function K4(){return`#${Cs(this.r)}${Cs(this.g)}${Cs(this.b)}${Cs((isNaN(this.opacity)?1:this.opacity)*255)}`}function Qq(){const e=If(this.opacity);return`${e===1?"rgb(":"rgba("}${js(this.r)}, ${js(this.g)}, ${js(this.b)}${e===1?")":`, ${e})`}`}function If(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function js(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Cs(e){return e=js(e),(e<16?"0":"")+e.toString(16)}function Hq(e,n,r,s){return s<=0?e=n=r=NaN:r<=0||r>=1?e=n=NaN:n<=0&&(e=NaN),new Yn(e,n,r,s)}function RD(e){if(e instanceof Yn)return new Yn(e.h,e.s,e.l,e.opacity);if(e instanceof dl||(e=Ds(e)),!e)return new Yn;if(e instanceof Yn)return e;e=e.rgb();var n=e.r/255,r=e.g/255,s=e.b/255,a=Math.min(n,r,s),o=Math.max(n,r,s),l=NaN,u=o-a,h=(o+a)/2;return u?(n===o?l=(r-s)/u+(r<s)*6:r===o?l=(s-n)/u+2:l=(n-r)/u+4,u/=h<.5?o+a:2-o-a,l*=60):u=h>0&&h<1?0:l,new Yn(l,u,h,e.opacity)}function Y4(e,n,r,s){return arguments.length===1?RD(e):new Yn(e,n,r,s??1)}function Yn(e,n,r,s){this.h=+e,this.s=+n,this.l=+r,this.opacity=+s}xC(Yn,Y4,ND(dl,{brighter(e){return e=e==null?$f:Math.pow($f,e),new Yn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Hu:Math.pow(Hu,e),new Yn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,s=r+(r<.5?r:1-r)*n,a=2*r-s;return new dn(im(e>=240?e-240:e+120,a,s),im(e,a,s),im(e<120?e+240:e-120,a,s),this.opacity)},clamp(){return new Yn(Vq(this.h),af(this.s),af(this.l),If(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=If(this.opacity);return`${e===1?"hsl(":"hsla("}${Vq(this.h)}, ${af(this.s)*100}%, ${af(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Vq(e){return e=(e||0)%360,e<0?e+360:e}function af(e){return Math.max(0,Math.min(1,e||0))}function im(e,n,r){return(e<60?n+(r-n)*e/60:e<180?r:e<240?n+(r-n)*(240-e)/60:n)*255}const SC=e=>()=>e;function X4(e,n){return function(r){return e+r*n}}function W4(e,n,r){return e=Math.pow(e,r),n=Math.pow(n,r)-e,r=1/r,function(s){return Math.pow(e+s*n,r)}}function J4(e){return(e=+e)==1?OD:function(n,r){return r-n?W4(n,r,e):SC(isNaN(n)?r:n)}}function OD(e,n){var r=n-e;return r?X4(e,r):SC(isNaN(e)?n:e)}const Df=(function e(n){var r=J4(n);function s(a,o){var l=r((a=WE(a)).r,(o=WE(o)).r),u=r(a.g,o.g),h=r(a.b,o.b),f=OD(a.opacity,o.opacity);return function(p){return a.r=l(p),a.g=u(p),a.b=h(p),a.opacity=f(p),a+""}}return s.gamma=e,s})(1);function Z4(e,n){n||(n=[]);var r=e?Math.min(n.length,e.length):0,s=n.slice(),a;return function(o){for(a=0;a<r;++a)s[a]=e[a]*(1-o)+n[a]*o;return s}}function e6(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function t6(e,n){var r=n?n.length:0,s=e?Math.min(r,e.length):0,a=new Array(s),o=new Array(r),l;for(l=0;l<s;++l)a[l]=Bu(e[l],n[l]);for(;l<r;++l)o[l]=n[l];return function(u){for(l=0;l<s;++l)o[l]=a[l](u);return o}}function n6(e,n){var r=new Date;return e=+e,n=+n,function(s){return r.setTime(e*(1-s)+n*s),r}}function gr(e,n){return e=+e,n=+n,function(r){return e*(1-r)+n*r}}function r6(e,n){var r={},s={},a;(e===null||typeof e!="object")&&(e={}),(n===null||typeof n!="object")&&(n={});for(a in n)a in e?r[a]=Bu(e[a],n[a]):s[a]=n[a];return function(o){for(a in r)s[a]=r[a](o);return s}}var JE=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sm=new RegExp(JE.source,"g");function i6(e){return function(){return e}}function s6(e){return function(n){return e(n)+""}}function MD(e,n){var r=JE.lastIndex=sm.lastIndex=0,s,a,o,l=-1,u=[],h=[];for(e=e+"",n=n+"";(s=JE.exec(e))&&(a=sm.exec(n));)(o=a.index)>r&&(o=n.slice(r,o),u[l]?u[l]+=o:u[++l]=o),(s=s[0])===(a=a[0])?u[l]?u[l]+=a:u[++l]=a:(u[++l]=null,h.push({i:l,x:gr(s,a)})),r=sm.lastIndex;return r<n.length&&(o=n.slice(r),u[l]?u[l]+=o:u[++l]=o),u.length<2?h[0]?s6(h[0].x):i6(n):(n=h.length,function(f){for(var p=0,d;p<n;++p)u[(d=h[p]).i]=d.x(f);return u.join("")})}function Bu(e,n){var r=typeof n,s;return n==null||r==="boolean"?SC(n):(r==="number"?gr:r==="string"?(s=Ds(n))?(n=s,Df):MD:n instanceof Ds?Df:n instanceof Date?n6:e6(n)?Z4:Array.isArray(n)?t6:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?r6:gr)(e,n)}var Fq=180/Math.PI,ZE={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function jD(e,n,r,s,a,o){var l,u,h;return(l=Math.sqrt(e*e+n*n))&&(e/=l,n/=l),(h=e*r+n*s)&&(r-=e*h,s-=n*h),(u=Math.sqrt(r*r+s*s))&&(r/=u,s/=u,h/=u),e*s<n*r&&(e=-e,n=-n,h=-h,l=-l),{translateX:a,translateY:o,rotate:Math.atan2(n,e)*Fq,skewX:Math.atan(h)*Fq,scaleX:l,scaleY:u}}var of;function a6(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?ZE:jD(n.a,n.b,n.c,n.d,n.e,n.f)}function o6(e){return e==null||(of||(of=document.createElementNS("http://www.w3.org/2000/svg","g")),of.setAttribute("transform",e),!(e=of.transform.baseVal.consolidate()))?ZE:(e=e.matrix,jD(e.a,e.b,e.c,e.d,e.e,e.f))}function LD(e,n,r,s){function a(f){return f.length?f.pop()+" ":""}function o(f,p,d,g,y,E){if(f!==d||p!==g){var x=y.push("translate(",null,n,null,r);E.push({i:x-4,x:gr(f,d)},{i:x-2,x:gr(p,g)})}else(d||g)&&y.push("translate("+d+n+g+r)}function l(f,p,d,g){f!==p?(f-p>180?p+=360:p-f>180&&(f+=360),g.push({i:d.push(a(d)+"rotate(",null,s)-2,x:gr(f,p)})):p&&d.push(a(d)+"rotate("+p+s)}function u(f,p,d,g){f!==p?g.push({i:d.push(a(d)+"skewX(",null,s)-2,x:gr(f,p)}):p&&d.push(a(d)+"skewX("+p+s)}function h(f,p,d,g,y,E){if(f!==d||p!==g){var x=y.push(a(y)+"scale(",null,",",null,")");E.push({i:x-4,x:gr(f,d)},{i:x-2,x:gr(p,g)})}else(d!==1||g!==1)&&y.push(a(y)+"scale("+d+","+g+")")}return function(f,p){var d=[],g=[];return f=e(f),p=e(p),o(f.translateX,f.translateY,p.translateX,p.translateY,d,g),l(f.rotate,p.rotate,d,g),u(f.skewX,p.skewX,d,g),h(f.scaleX,f.scaleY,p.scaleX,p.scaleY,d,g),f=p=null,function(y){for(var E=-1,x=g.length,v;++E<x;)d[(v=g[E]).i]=v.x(y);return d.join("")}}}var u6=LD(a6,"px, ","px)","deg)"),l6=LD(o6,", ",")",")"),c6=1e-12;function Gq(e){return((e=Math.exp(e))+1/e)/2}function f6(e){return((e=Math.exp(e))-1/e)/2}function h6(e){return((e=Math.exp(2*e))-1)/(e+1)}const Tf=(function e(n,r,s){function a(o,l){var u=o[0],h=o[1],f=o[2],p=l[0],d=l[1],g=l[2],y=p-u,E=d-h,x=y*y+E*E,v,b;if(x<c6)b=Math.log(g/f)/n,v=function(O){return[u+O*y,h+O*E,f*Math.exp(n*O*b)]};else{var w=Math.sqrt(x),C=(g*g-f*f+s*x)/(2*f*r*w),T=(g*g-f*f-s*x)/(2*g*r*w),A=Math.log(Math.sqrt(C*C+1)-C),N=Math.log(Math.sqrt(T*T+1)-T);b=(N-A)/n,v=function(O){var I=O*b,k=Gq(A),R=f/(r*w)*(k*h6(n*I+A)-f6(A));return[u+R*y,h+R*E,f*k/Gq(n*I+A)]}}return v.duration=b*1e3*n/Math.SQRT2,v}return a.rho=function(o){var l=Math.max(.001,+o),u=l*l,h=u*u;return e(l,u,h)},a})(Math.SQRT2,2,4);var mo=0,ju=0,Nu=0,$D=1e3,kf,Lu,Bf=0,ks=0,eh=0,Fu=typeof performance=="object"&&performance.now?performance:Date,ID=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function TC(){return ks||(ID(d6),ks=Fu.now()+eh)}function d6(){ks=0}function Pf(){this._call=this._time=this._next=null}Pf.prototype=DD.prototype={constructor:Pf,restart:function(e,n,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?TC():+r)+(n==null?0:+n),!this._next&&Lu!==this&&(Lu?Lu._next=this:kf=this,Lu=this),this._call=e,this._time=r,eC()},stop:function(){this._call&&(this._call=null,this._time=1/0,eC())}};function DD(e,n,r){var s=new Pf;return s.restart(e,n,r),s}function p6(){TC(),++mo;for(var e=kf,n;e;)(n=ks-e._time)>=0&&e._call.call(void 0,n),e=e._next;--mo}function Kq(){ks=(Bf=Fu.now())+eh,mo=ju=0;try{p6()}finally{mo=0,g6(),ks=0}}function m6(){var e=Fu.now(),n=e-Bf;n>$D&&(eh-=n,Bf=e)}function g6(){for(var e,n=kf,r,s=1/0;n;)n._call?(s>n._time&&(s=n._time),e=n,n=n._next):(r=n._next,n._next=null,n=e?e._next=r:kf=r);Lu=e,eC(s)}function eC(e){if(!mo){ju&&(ju=clearTimeout(ju));var n=e-ks;n>24?(e<1/0&&(ju=setTimeout(Kq,e-Fu.now()-eh)),Nu&&(Nu=clearInterval(Nu))):(Nu||(Bf=Fu.now(),Nu=setInterval(m6,$D)),mo=1,ID(Kq))}}function Yq(e,n,r){var s=new Pf;return n=n==null?0:+n,s.restart(a=>{s.stop(),e(a+n)},n,r),s}var y6=Jf("start","end","cancel","interrupt"),v6=[],kD=0,Xq=1,tC=2,qf=3,Wq=4,nC=5,Af=6;function th(e,n,r,s,a,o){var l=e.__transition;if(!l)e.__transition={};else if(r in l)return;b6(e,r,{name:n,index:s,group:a,on:y6,tween:v6,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:kD})}function qC(e,n){var r=rr(e,n);if(r.state>kD)throw new Error("too late; already scheduled");return r}function wr(e,n){var r=rr(e,n);if(r.state>qf)throw new Error("too late; already running");return r}function rr(e,n){var r=e.__transition;if(!r||!(r=r[n]))throw new Error("transition not found");return r}function b6(e,n,r){var s=e.__transition,a;s[n]=r,r.timer=DD(o,0,r.time);function o(f){r.state=Xq,r.timer.restart(l,r.delay,r.time),r.delay<=f&&l(f-r.delay)}function l(f){var p,d,g,y;if(r.state!==Xq)return h();for(p in s)if(y=s[p],y.name===r.name){if(y.state===qf)return Yq(l);y.state===Wq?(y.state=Af,y.timer.stop(),y.on.call("interrupt",e,e.__data__,y.index,y.group),delete s[p]):+p<n&&(y.state=Af,y.timer.stop(),y.on.call("cancel",e,e.__data__,y.index,y.group),delete s[p])}if(Yq(function(){r.state===qf&&(r.state=Wq,r.timer.restart(u,r.delay,r.time),u(f))}),r.state=tC,r.on.call("start",e,e.__data__,r.index,r.group),r.state===tC){for(r.state=qf,a=new Array(g=r.tween.length),p=0,d=-1;p<g;++p)(y=r.tween[p].value.call(e,e.__data__,r.index,r.group))&&(a[++d]=y);a.length=d+1}}function u(f){for(var p=f<r.duration?r.ease.call(null,f/r.duration):(r.timer.restart(h),r.state=nC,1),d=-1,g=a.length;++d<g;)a[d].call(e,p);r.state===nC&&(r.on.call("end",e,e.__data__,r.index,r.group),h())}function h(){r.state=Af,r.timer.stop(),delete s[n];for(var f in s)return;delete e.__transition}}function Nf(e,n){var r=e.__transition,s,a,o=!0,l;if(r){n=n==null?null:n+"";for(l in r){if((s=r[l]).name!==n){o=!1;continue}a=s.state>tC&&s.state<nC,s.state=Af,s.timer.stop(),s.on.call(a?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete r[l]}o&&delete e.__transition}}function _6(e){return this.each(function(){Nf(this,e)})}function w6(e,n){var r,s;return function(){var a=wr(this,e),o=a.tween;if(o!==r){s=r=o;for(var l=0,u=s.length;l<u;++l)if(s[l].name===n){s=s.slice(),s.splice(l,1);break}}a.tween=s}}function E6(e,n,r){var s,a;if(typeof r!="function")throw new Error;return function(){var o=wr(this,e),l=o.tween;if(l!==s){a=(s=l).slice();for(var u={name:n,value:r},h=0,f=a.length;h<f;++h)if(a[h].name===n){a[h]=u;break}h===f&&a.push(u)}o.tween=a}}function C6(e,n){var r=this._id;if(e+="",arguments.length<2){for(var s=rr(this.node(),r).tween,a=0,o=s.length,l;a<o;++a)if((l=s[a]).name===e)return l.value;return null}return this.each((n==null?w6:E6)(r,e,n))}function AC(e,n,r){var s=e._id;return e.each(function(){var a=wr(this,s);(a.value||(a.value={}))[n]=r.apply(this,arguments)}),function(a){return rr(a,s).value[n]}}function BD(e,n){var r;return(typeof n=="number"?gr:n instanceof Ds?Df:(r=Ds(n))?(n=r,Df):MD)(e,n)}function x6(e){return function(){this.removeAttribute(e)}}function S6(e){return function(){this.removeAttributeNS(e.space,e.local)}}function T6(e,n,r){var s,a=r+"",o;return function(){var l=this.getAttribute(e);return l===a?null:l===s?o:o=n(s=l,r)}}function q6(e,n,r){var s,a=r+"",o;return function(){var l=this.getAttributeNS(e.space,e.local);return l===a?null:l===s?o:o=n(s=l,r)}}function A6(e,n,r){var s,a,o;return function(){var l,u=r(this),h;return u==null?void this.removeAttribute(e):(l=this.getAttribute(e),h=u+"",l===h?null:l===s&&h===a?o:(a=h,o=n(s=l,u)))}}function N6(e,n,r){var s,a,o;return function(){var l,u=r(this),h;return u==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),h=u+"",l===h?null:l===s&&h===a?o:(a=h,o=n(s=l,u)))}}function R6(e,n){var r=Zf(e),s=r==="transform"?l6:BD;return this.attrTween(e,typeof n=="function"?(r.local?N6:A6)(r,s,AC(this,"attr."+e,n)):n==null?(r.local?S6:x6)(r):(r.local?q6:T6)(r,s,n))}function O6(e,n){return function(r){this.setAttribute(e,n.call(this,r))}}function M6(e,n){return function(r){this.setAttributeNS(e.space,e.local,n.call(this,r))}}function j6(e,n){var r,s;function a(){var o=n.apply(this,arguments);return o!==s&&(r=(s=o)&&M6(e,o)),r}return a._value=n,a}function L6(e,n){var r,s;function a(){var o=n.apply(this,arguments);return o!==s&&(r=(s=o)&&O6(e,o)),r}return a._value=n,a}function $6(e,n){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(n==null)return this.tween(r,null);if(typeof n!="function")throw new Error;var s=Zf(e);return this.tween(r,(s.local?j6:L6)(s,n))}function I6(e,n){return function(){qC(this,e).delay=+n.apply(this,arguments)}}function D6(e,n){return n=+n,function(){qC(this,e).delay=n}}function k6(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?I6:D6)(n,e)):rr(this.node(),n).delay}function B6(e,n){return function(){wr(this,e).duration=+n.apply(this,arguments)}}function P6(e,n){return n=+n,function(){wr(this,e).duration=n}}function z6(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?B6:P6)(n,e)):rr(this.node(),n).duration}function U6(e,n){if(typeof n!="function")throw new Error;return function(){wr(this,e).ease=n}}function Q6(e){var n=this._id;return arguments.length?this.each(U6(n,e)):rr(this.node(),n).ease}function H6(e,n){return function(){var r=n.apply(this,arguments);if(typeof r!="function")throw new Error;wr(this,e).ease=r}}function V6(e){if(typeof e!="function")throw new Error;return this.each(H6(this._id,e))}function F6(e){typeof e!="function"&&(e=gD(e));for(var n=this._groups,r=n.length,s=new Array(r),a=0;a<r;++a)for(var o=n[a],l=o.length,u=s[a]=[],h,f=0;f<l;++f)(h=o[f])&&e.call(h,h.__data__,f,o)&&u.push(h);return new Jr(s,this._parents,this._name,this._id)}function G6(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,r=e._groups,s=n.length,a=r.length,o=Math.min(s,a),l=new Array(s),u=0;u<o;++u)for(var h=n[u],f=r[u],p=h.length,d=l[u]=new Array(p),g,y=0;y<p;++y)(g=h[y]||f[y])&&(d[y]=g);for(;u<s;++u)l[u]=n[u];return new Jr(l,this._parents,this._name,this._id)}function K6(e){return(e+"").trim().split(/^|\s+/).every(function(n){var r=n.indexOf(".");return r>=0&&(n=n.slice(0,r)),!n||n==="start"})}function Y6(e,n,r){var s,a,o=K6(n)?qC:wr;return function(){var l=o(this,e),u=l.on;u!==s&&(a=(s=u).copy()).on(n,r),l.on=a}}function X6(e,n){var r=this._id;return arguments.length<2?rr(this.node(),r).on.on(e):this.each(Y6(r,e,n))}function W6(e){return function(){var n=this.parentNode;for(var r in this.__transition)if(+r!==e)return;n&&n.removeChild(this)}}function J6(){return this.on("end.remove",W6(this._id))}function Z6(e){var n=this._name,r=this._id;typeof e!="function"&&(e=EC(e));for(var s=this._groups,a=s.length,o=new Array(a),l=0;l<a;++l)for(var u=s[l],h=u.length,f=o[l]=new Array(h),p,d,g=0;g<h;++g)(p=u[g])&&(d=e.call(p,p.__data__,g,u))&&("__data__"in p&&(d.__data__=p.__data__),f[g]=d,th(f[g],n,r,g,f,rr(p,r)));return new Jr(o,this._parents,n,r)}function e5(e){var n=this._name,r=this._id;typeof e!="function"&&(e=mD(e));for(var s=this._groups,a=s.length,o=[],l=[],u=0;u<a;++u)for(var h=s[u],f=h.length,p,d=0;d<f;++d)if(p=h[d]){for(var g=e.call(p,p.__data__,d,h),y,E=rr(p,r),x=0,v=g.length;x<v;++x)(y=g[x])&&th(y,n,r,x,g,E);o.push(g),l.push(p)}return new Jr(o,l,n,r)}var t5=hl.prototype.constructor;function n5(){return new t5(this._groups,this._parents)}function r5(e,n){var r,s,a;return function(){var o=po(this,e),l=(this.style.removeProperty(e),po(this,e));return o===l?null:o===r&&l===s?a:a=n(r=o,s=l)}}function PD(e){return function(){this.style.removeProperty(e)}}function i5(e,n,r){var s,a=r+"",o;return function(){var l=po(this,e);return l===a?null:l===s?o:o=n(s=l,r)}}function s5(e,n,r){var s,a,o;return function(){var l=po(this,e),u=r(this),h=u+"";return u==null&&(h=u=(this.style.removeProperty(e),po(this,e))),l===h?null:l===s&&h===a?o:(a=h,o=n(s=l,u))}}function a5(e,n){var r,s,a,o="style."+n,l="end."+o,u;return function(){var h=wr(this,e),f=h.on,p=h.value[o]==null?u||(u=PD(n)):void 0;(f!==r||a!==p)&&(s=(r=f).copy()).on(l,a=p),h.on=s}}function o5(e,n,r){var s=(e+="")=="transform"?u6:BD;return n==null?this.styleTween(e,r5(e,s)).on("end.style."+e,PD(e)):typeof n=="function"?this.styleTween(e,s5(e,s,AC(this,"style."+e,n))).each(a5(this._id,e)):this.styleTween(e,i5(e,s,n),r).on("end.style."+e,null)}function u5(e,n,r){return function(s){this.style.setProperty(e,n.call(this,s),r)}}function l5(e,n,r){var s,a;function o(){var l=n.apply(this,arguments);return l!==a&&(s=(a=l)&&u5(e,l,r)),s}return o._value=n,o}function c5(e,n,r){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(n==null)return this.tween(s,null);if(typeof n!="function")throw new Error;return this.tween(s,l5(e,n,r??""))}function f5(e){return function(){this.textContent=e}}function h5(e){return function(){var n=e(this);this.textContent=n??""}}function d5(e){return this.tween("text",typeof e=="function"?h5(AC(this,"text",e)):f5(e==null?"":e+""))}function p5(e){return function(n){this.textContent=e.call(this,n)}}function m5(e){var n,r;function s(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&p5(a)),n}return s._value=e,s}function g5(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,m5(e))}function y5(){for(var e=this._name,n=this._id,r=zD(),s=this._groups,a=s.length,o=0;o<a;++o)for(var l=s[o],u=l.length,h,f=0;f<u;++f)if(h=l[f]){var p=rr(h,n);th(h,e,r,f,l,{time:p.time+p.delay+p.duration,delay:0,duration:p.duration,ease:p.ease})}return new Jr(s,this._parents,e,r)}function v5(){var e,n,r=this,s=r._id,a=r.size();return new Promise(function(o,l){var u={value:l},h={value:function(){--a===0&&o()}};r.each(function(){var f=wr(this,s),p=f.on;p!==e&&(n=(e=p).copy(),n._.cancel.push(u),n._.interrupt.push(u),n._.end.push(h)),f.on=n}),a===0&&o()})}var b5=0;function Jr(e,n,r,s){this._groups=e,this._parents=n,this._name=r,this._id=s}function zD(){return++b5}var Hr=hl.prototype;Jr.prototype={constructor:Jr,select:Z6,selectAll:e5,selectChild:Hr.selectChild,selectChildren:Hr.selectChildren,filter:F6,merge:G6,selection:n5,transition:y5,call:Hr.call,nodes:Hr.nodes,node:Hr.node,size:Hr.size,empty:Hr.empty,each:Hr.each,on:X6,attr:R6,attrTween:$6,style:o5,styleTween:c5,text:d5,textTween:g5,remove:J6,tween:C6,delay:k6,duration:z6,ease:Q6,easeVarying:V6,end:v5,[Symbol.iterator]:Hr[Symbol.iterator]};function _5(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var w5={time:null,delay:0,duration:250,ease:_5};function E5(e,n){for(var r;!(r=e.__transition)||!(r=r[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return r}function C5(e){var n,r;e instanceof Jr?(n=e._id,e=e._name):(n=zD(),(r=w5).time=TC(),e=e==null?null:e+"");for(var s=this._groups,a=s.length,o=0;o<a;++o)for(var l=s[o],u=l.length,h,f=0;f<u;++f)(h=l[f])&&th(h,e,n,f,l,r||E5(h,n));return new Jr(s,this._parents,e,n)}hl.prototype.interrupt=_6;hl.prototype.transition=C5;const uf=e=>()=>e;function x5(e,{sourceEvent:n,target:r,transform:s,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:a}})}function Xr(e,n,r){this.k=e,this.x=n,this.y=r}Xr.prototype={constructor:Xr,scale:function(e){return e===1?this:new Xr(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Xr(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var nh=new Xr(1,0,0);UD.prototype=Xr.prototype;function UD(e){for(;!e.__zoom;)if(!(e=e.parentNode))return nh;return e.__zoom}function am(e){e.stopImmediatePropagation()}function Ru(e){e.preventDefault(),e.stopImmediatePropagation()}function S5(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function T5(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Jq(){return this.__zoom||nh}function q5(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function A5(){return navigator.maxTouchPoints||"ontouchstart"in this}function N5(e,n,r){var s=e.invertX(n[0][0])-r[0][0],a=e.invertX(n[1][0])-r[1][0],o=e.invertY(n[0][1])-r[0][1],l=e.invertY(n[1][1])-r[1][1];return e.translate(a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a),l>o?(o+l)/2:Math.min(0,o)||Math.max(0,l))}function QD(){var e=S5,n=T5,r=N5,s=q5,a=A5,o=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],u=250,h=Tf,f=Jf("start","zoom","end"),p,d,g,y=500,E=150,x=0,v=10;function b(q){q.property("__zoom",Jq).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",R).filter(a).on("touchstart.zoom",M).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(q,j,L,P){var H=q.selection?q.selection():q;H.property("__zoom",Jq),q!==H?A(q,j,L,P):H.interrupt().each(function(){N(this,arguments).event(P).start().zoom(null,typeof j=="function"?j.apply(this,arguments):j).end()})},b.scaleBy=function(q,j,L,P){b.scaleTo(q,function(){var H=this.__zoom.k,G=typeof j=="function"?j.apply(this,arguments):j;return H*G},L,P)},b.scaleTo=function(q,j,L,P){b.transform(q,function(){var H=n.apply(this,arguments),G=this.__zoom,V=L==null?T(H):typeof L=="function"?L.apply(this,arguments):L,B=G.invert(V),K=typeof j=="function"?j.apply(this,arguments):j;return r(C(w(G,K),V,B),H,l)},L,P)},b.translateBy=function(q,j,L,P){b.transform(q,function(){return r(this.__zoom.translate(typeof j=="function"?j.apply(this,arguments):j,typeof L=="function"?L.apply(this,arguments):L),n.apply(this,arguments),l)},null,P)},b.translateTo=function(q,j,L,P,H){b.transform(q,function(){var G=n.apply(this,arguments),V=this.__zoom,B=P==null?T(G):typeof P=="function"?P.apply(this,arguments):P;return r(nh.translate(B[0],B[1]).scale(V.k).translate(typeof j=="function"?-j.apply(this,arguments):-j,typeof L=="function"?-L.apply(this,arguments):-L),G,l)},P,H)};function w(q,j){return j=Math.max(o[0],Math.min(o[1],j)),j===q.k?q:new Xr(j,q.x,q.y)}function C(q,j,L){var P=j[0]-L[0]*q.k,H=j[1]-L[1]*q.k;return P===q.x&&H===q.y?q:new Xr(q.k,P,H)}function T(q){return[(+q[0][0]+ +q[1][0])/2,(+q[0][1]+ +q[1][1])/2]}function A(q,j,L,P){q.on("start.zoom",function(){N(this,arguments).event(P).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(P).end()}).tween("zoom",function(){var H=this,G=arguments,V=N(H,G).event(P),B=n.apply(H,G),K=L==null?T(B):typeof L=="function"?L.apply(H,G):L,ne=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),Q=H.__zoom,J=typeof j=="function"?j.apply(H,G):j,ie=h(Q.invert(K).concat(ne/Q.k),J.invert(K).concat(ne/J.k));return function(oe){if(oe===1)oe=J;else{var ee=ie(oe),fe=ne/ee[2];oe=new Xr(fe,K[0]-ee[0]*fe,K[1]-ee[1]*fe)}V.zoom(null,oe)}})}function N(q,j,L){return!L&&q.__zooming||new O(q,j)}function O(q,j){this.that=q,this.args=j,this.active=0,this.sourceEvent=null,this.extent=n.apply(q,j),this.taps=0}O.prototype={event:function(q){return q&&(this.sourceEvent=q),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(q,j){return this.mouse&&q!=="mouse"&&(this.mouse[1]=j.invert(this.mouse[0])),this.touch0&&q!=="touch"&&(this.touch0[1]=j.invert(this.touch0[0])),this.touch1&&q!=="touch"&&(this.touch1[1]=j.invert(this.touch1[0])),this.that.__zoom=j,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(q){var j=Sn(this.that).datum();f.call(q,this.that,new x5(q,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:f}),j)}};function I(q,...j){if(!e.apply(this,arguments))return;var L=N(this,j).event(q),P=this.__zoom,H=Math.max(o[0],Math.min(o[1],P.k*Math.pow(2,s.apply(this,arguments)))),G=Kn(q);if(L.wheel)(L.mouse[0][0]!==G[0]||L.mouse[0][1]!==G[1])&&(L.mouse[1]=P.invert(L.mouse[0]=G)),clearTimeout(L.wheel);else{if(P.k===H)return;L.mouse=[G,P.invert(G)],Nf(this),L.start()}Ru(q),L.wheel=setTimeout(V,E),L.zoom("mouse",r(C(w(P,H),L.mouse[0],L.mouse[1]),L.extent,l));function V(){L.wheel=null,L.end()}}function k(q,...j){if(g||!e.apply(this,arguments))return;var L=q.currentTarget,P=N(this,j,!0).event(q),H=Sn(q.view).on("mousemove.zoom",K,!0).on("mouseup.zoom",ne,!0),G=Kn(q,L),V=q.clientX,B=q.clientY;TD(q.view),am(q),P.mouse=[G,this.__zoom.invert(G)],Nf(this),P.start();function K(Q){if(Ru(Q),!P.moved){var J=Q.clientX-V,ie=Q.clientY-B;P.moved=J*J+ie*ie>x}P.event(Q).zoom("mouse",r(C(P.that.__zoom,P.mouse[0]=Kn(Q,L),P.mouse[1]),P.extent,l))}function ne(Q){H.on("mousemove.zoom mouseup.zoom",null),qD(Q.view,P.moved),Ru(Q),P.event(Q).end()}}function R(q,...j){if(e.apply(this,arguments)){var L=this.__zoom,P=Kn(q.changedTouches?q.changedTouches[0]:q,this),H=L.invert(P),G=L.k*(q.shiftKey?.5:2),V=r(C(w(L,G),P,H),n.apply(this,j),l);Ru(q),u>0?Sn(this).transition().duration(u).call(A,V,P,q):Sn(this).call(b.transform,V,P,q)}}function M(q,...j){if(e.apply(this,arguments)){var L=q.touches,P=L.length,H=N(this,j,q.changedTouches.length===P).event(q),G,V,B,K;for(am(q),V=0;V<P;++V)B=L[V],K=Kn(B,this),K=[K,this.__zoom.invert(K),B.identifier],H.touch0?!H.touch1&&H.touch0[2]!==K[2]&&(H.touch1=K,H.taps=0):(H.touch0=K,G=!0,H.taps=1+!!p);p&&(p=clearTimeout(p)),G&&(H.taps<2&&(d=K[0],p=setTimeout(function(){p=null},y)),Nf(this),H.start())}}function D(q,...j){if(this.__zooming){var L=N(this,j).event(q),P=q.changedTouches,H=P.length,G,V,B,K;for(Ru(q),G=0;G<H;++G)V=P[G],B=Kn(V,this),L.touch0&&L.touch0[2]===V.identifier?L.touch0[0]=B:L.touch1&&L.touch1[2]===V.identifier&&(L.touch1[0]=B);if(V=L.that.__zoom,L.touch1){var ne=L.touch0[0],Q=L.touch0[1],J=L.touch1[0],ie=L.touch1[1],oe=(oe=J[0]-ne[0])*oe+(oe=J[1]-ne[1])*oe,ee=(ee=ie[0]-Q[0])*ee+(ee=ie[1]-Q[1])*ee;V=w(V,Math.sqrt(oe/ee)),B=[(ne[0]+J[0])/2,(ne[1]+J[1])/2],K=[(Q[0]+ie[0])/2,(Q[1]+ie[1])/2]}else if(L.touch0)B=L.touch0[0],K=L.touch0[1];else return;L.zoom("touch",r(C(V,B,K),L.extent,l))}}function z(q,...j){if(this.__zooming){var L=N(this,j).event(q),P=q.changedTouches,H=P.length,G,V;for(am(q),g&&clearTimeout(g),g=setTimeout(function(){g=null},y),G=0;G<H;++G)V=P[G],L.touch0&&L.touch0[2]===V.identifier?delete L.touch0:L.touch1&&L.touch1[2]===V.identifier&&delete L.touch1;if(L.touch1&&!L.touch0&&(L.touch0=L.touch1,delete L.touch1),L.touch0)L.touch0[1]=this.__zoom.invert(L.touch0[0]);else if(L.end(),L.taps===2&&(V=Kn(V,this),Math.hypot(d[0]-V[0],d[1]-V[1])<v)){var B=Sn(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return b.wheelDelta=function(q){return arguments.length?(s=typeof q=="function"?q:uf(+q),b):s},b.filter=function(q){return arguments.length?(e=typeof q=="function"?q:uf(!!q),b):e},b.touchable=function(q){return arguments.length?(a=typeof q=="function"?q:uf(!!q),b):a},b.extent=function(q){return arguments.length?(n=typeof q=="function"?q:uf([[+q[0][0],+q[0][1]],[+q[1][0],+q[1][1]]]),b):n},b.scaleExtent=function(q){return arguments.length?(o[0]=+q[0],o[1]=+q[1],b):[o[0],o[1]]},b.translateExtent=function(q){return arguments.length?(l[0][0]=+q[0][0],l[1][0]=+q[1][0],l[0][1]=+q[0][1],l[1][1]=+q[1][1],b):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},b.constrain=function(q){return arguments.length?(r=q,b):r},b.duration=function(q){return arguments.length?(u=+q,b):u},b.interpolate=function(q){return arguments.length?(h=q,b):h},b.on=function(){var q=f.on.apply(f,arguments);return q===f?b:q},b.clickDistance=function(q){return arguments.length?(x=(q=+q)*q,b):Math.sqrt(x)},b.tapDistance=function(q){return arguments.length?(v=+q,b):v},b}const vr={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:e=>`Node type "${e}" 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:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:n,sourceHandle:r,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?r:s}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Gu=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],HD=["Enter"," ","Escape"],VD={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:n,y:r})=>`Moved selected node ${e}. New position, x: ${n}, y: ${r}`,"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 go;(function(e){e.Strict="strict",e.Loose="loose"})(go||(go={}));var Ls;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ls||(Ls={}));var Ku;(function(e){e.Partial="partial",e.Full="full"})(Ku||(Ku={}));const FD={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var $i;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})($i||($i={}));var zf;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(zf||(zf={}));var Ne;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ne||(Ne={}));const Zq={[Ne.Left]:Ne.Right,[Ne.Right]:Ne.Left,[Ne.Top]:Ne.Bottom,[Ne.Bottom]:Ne.Top};function GD(e){return e===null?null:e?"valid":"invalid"}const KD=e=>"id"in e&&"source"in e&&"target"in e,R5=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),NC=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),pl=(e,n=[0,0])=>{const{width:r,height:s}=Zr(e),a=e.origin??n,o=r*a[0],l=s*a[1];return{x:e.position.x-o,y:e.position.y-l}},O5=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((s,a)=>{const o=typeof a=="string";let l=!n.nodeLookup&&!o?a:void 0;n.nodeLookup&&(l=o?n.nodeLookup.get(a):NC(a)?a:n.nodeLookup.get(a.id));const u=l?Uf(l,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return rh(s,u)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ih(r)},ml=(e,n={})=>{let r={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return e.forEach(a=>{(n.filter===void 0||n.filter(a))&&(r=rh(r,Uf(a)),s=!0)}),s?ih(r):{x:0,y:0,width:0,height:0}},RC=(e,n,[r,s,a]=[0,0,1],o=!1,l=!1)=>{const u={...yl(n,[r,s,a]),width:n.width/a,height:n.height/a},h=[];for(const f of e.values()){const{measured:p,selectable:d=!0,hidden:g=!1}=f;if(l&&!d||g)continue;const y=p.width??f.width??f.initialWidth??null,E=p.height??f.height??f.initialHeight??null,x=Yu(u,vo(f)),v=(y??0)*(E??0),b=o&&x>0;(!f.internals.handleBounds||b||x>=v||f.dragging)&&h.push(f)}return h},M5=(e,n)=>{const r=new Set;return e.forEach(s=>{r.add(s.id)}),n.filter(s=>r.has(s.source)||r.has(s.target))};function j5(e,n){const r=new Map,s=n!=null&&n.nodes?new Set(n.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&((n==null?void 0:n.includeHiddenNodes)||!a.hidden)&&(!s||s.has(a.id))&&r.set(a.id,a)}),r}async function L5({nodes:e,width:n,height:r,panZoom:s,minZoom:a,maxZoom:o},l){if(e.size===0)return Promise.resolve(!0);const u=j5(e,l),h=ml(u),f=OC(h,n,r,(l==null?void 0:l.minZoom)??a,(l==null?void 0:l.maxZoom)??o,(l==null?void 0:l.padding)??.1);return await s.setViewport(f,{duration:l==null?void 0:l.duration,ease:l==null?void 0:l.ease,interpolate:l==null?void 0:l.interpolate}),Promise.resolve(!0)}function YD({nodeId:e,nextPosition:n,nodeLookup:r,nodeOrigin:s=[0,0],nodeExtent:a,onError:o}){const l=r.get(e),u=l.parentId?r.get(l.parentId):void 0,{x:h,y:f}=u?u.internals.positionAbsolute:{x:0,y:0},p=l.origin??s;let d=l.extent||a;if(l.extent==="parent"&&!l.expandParent)if(!u)o==null||o("005",vr.error005());else{const y=u.measured.width,E=u.measured.height;y&&E&&(d=[[h,f],[h+y,f+E]])}else u&&bo(l.extent)&&(d=[[l.extent[0][0]+h,l.extent[0][1]+f],[l.extent[1][0]+h,l.extent[1][1]+f]]);const g=bo(d)?Bs(n,d,l.measured):n;return(l.measured.width===void 0||l.measured.height===void 0)&&(o==null||o("015",vr.error015())),{position:{x:g.x-h+(l.measured.width??0)*p[0],y:g.y-f+(l.measured.height??0)*p[1]},positionAbsolute:g}}async function $5({nodesToRemove:e=[],edgesToRemove:n=[],nodes:r,edges:s,onBeforeDelete:a}){const o=new Set(e.map(g=>g.id)),l=[];for(const g of r){if(g.deletable===!1)continue;const y=o.has(g.id),E=!y&&g.parentId&&l.find(x=>x.id===g.parentId);(y||E)&&l.push(g)}const u=new Set(n.map(g=>g.id)),h=s.filter(g=>g.deletable!==!1),p=M5(l,h);for(const g of h)u.has(g.id)&&!p.find(E=>E.id===g.id)&&p.push(g);if(!a)return{edges:p,nodes:l};const d=await a({nodes:l,edges:p});return typeof d=="boolean"?d?{edges:p,nodes:l}:{edges:[],nodes:[]}:d}const yo=(e,n=0,r=1)=>Math.min(Math.max(e,n),r),Bs=(e={x:0,y:0},n,r)=>({x:yo(e.x,n[0][0],n[1][0]-((r==null?void 0:r.width)??0)),y:yo(e.y,n[0][1],n[1][1]-((r==null?void 0:r.height)??0))});function XD(e,n,r){const{width:s,height:a}=Zr(r),{x:o,y:l}=r.internals.positionAbsolute;return Bs(e,[[o,l],[o+s,l+a]],n)}const eA=(e,n,r)=>e<n?yo(Math.abs(e-n),1,n)/n:e>r?-yo(Math.abs(e-r),1,n)/n:0,WD=(e,n,r=15,s=40)=>{const a=eA(e.x,s,n.width-s)*r,o=eA(e.y,s,n.height-s)*r;return[a,o]},rh=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),rC=({x:e,y:n,width:r,height:s})=>({x:e,y:n,x2:e+r,y2:n+s}),ih=({x:e,y:n,x2:r,y2:s})=>({x:e,y:n,width:r-e,height:s-n}),vo=(e,n=[0,0])=>{var a,o;const{x:r,y:s}=NC(e)?e.internals.positionAbsolute:pl(e,n);return{x:r,y:s,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},Uf=(e,n=[0,0])=>{var a,o;const{x:r,y:s}=NC(e)?e.internals.positionAbsolute:pl(e,n);return{x:r,y:s,x2:r+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:s+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},JD=(e,n)=>ih(rh(rC(e),rC(n))),Yu=(e,n)=>{const r=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),s=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(r*s)},tA=e=>Wn(e.width)&&Wn(e.height)&&Wn(e.x)&&Wn(e.y),Wn=e=>!isNaN(e)&&isFinite(e),I5=(e,n)=>{},gl=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),yl=({x:e,y:n},[r,s,a],o=!1,l=[1,1])=>{const u={x:(e-r)/a,y:(n-s)/a};return o?gl(u,l):u},Qf=({x:e,y:n},[r,s,a])=>({x:e*a+r,y:n*a+s});function Fa(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(r)}if(typeof e=="string"&&e.endsWith("%")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(n*r*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function D5(e,n,r){if(typeof e=="string"||typeof e=="number"){const s=Fa(e,r),a=Fa(e,n);return{top:s,right:a,bottom:s,left:a,x:a*2,y:s*2}}if(typeof e=="object"){const s=Fa(e.top??e.y??0,r),a=Fa(e.bottom??e.y??0,r),o=Fa(e.left??e.x??0,n),l=Fa(e.right??e.x??0,n);return{top:s,right:l,bottom:a,left:o,x:o+l,y:s+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function k5(e,n,r,s,a,o){const{x:l,y:u}=Qf(e,[n,r,s]),{x:h,y:f}=Qf({x:e.x+e.width,y:e.y+e.height},[n,r,s]),p=a-h,d=o-f;return{left:Math.floor(l),top:Math.floor(u),right:Math.floor(p),bottom:Math.floor(d)}}const OC=(e,n,r,s,a,o)=>{const l=D5(o,n,r),u=(n-l.x)/e.width,h=(r-l.y)/e.height,f=Math.min(u,h),p=yo(f,s,a),d=e.x+e.width/2,g=e.y+e.height/2,y=n/2-d*p,E=r/2-g*p,x=k5(e,y,E,p,n,r),v={left:Math.min(x.left-l.left,0),top:Math.min(x.top-l.top,0),right:Math.min(x.right-l.right,0),bottom:Math.min(x.bottom-l.bottom,0)};return{x:y-v.left+v.right,y:E-v.top+v.bottom,zoom:p}},Xu=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function bo(e){return e!=null&&e!=="parent"}function Zr(e){var n,r;return{width:((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth??0,height:((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight??0}}function ZD(e){var n,r;return(((n=e.measured)==null?void 0:n.width)??e.width??e.initialWidth)!==void 0&&(((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight)!==void 0}function ek(e,n={width:0,height:0},r,s,a){const o={...e},l=s.get(r);if(l){const u=l.origin||a;o.x+=l.internals.positionAbsolute.x-(n.width??0)*u[0],o.y+=l.internals.positionAbsolute.y-(n.height??0)*u[1]}return o}function nA(e,n){if(e.size!==n.size)return!1;for(const r of e)if(!n.has(r))return!1;return!0}function B5(){let e,n;return{promise:new Promise((s,a)=>{e=s,n=a}),resolve:e,reject:n}}function P5(e){return{...VD,...e||{}}}function Pu(e,{snapGrid:n=[0,0],snapToGrid:r=!1,transform:s,containerBounds:a}){const{x:o,y:l}=Jn(e),u=yl({x:o-((a==null?void 0:a.left)??0),y:l-((a==null?void 0:a.top)??0)},s),{x:h,y:f}=r?gl(u,n):u;return{xSnapped:h,ySnapped:f,...u}}const MC=e=>({width:e.offsetWidth,height:e.offsetHeight}),tk=e=>{var n;return((n=e==null?void 0:e.getRootNode)==null?void 0:n.call(e))||(window==null?void 0:window.document)},z5=["INPUT","SELECT","TEXTAREA"];function nk(e){var s,a;const n=((a=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:a[0])||e.target;return(n==null?void 0:n.nodeType)!==1?!1:z5.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const rk=e=>"clientX"in e,Jn=(e,n)=>{var o,l;const r=rk(e),s=r?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,a=r?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:s-((n==null?void 0:n.left)??0),y:a-((n==null?void 0:n.top)??0)}},rA=(e,n,r,s,a)=>{const o=n.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(l=>{const u=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:a,position:l.getAttribute("data-handlepos"),x:(u.left-r.left)/s,y:(u.top-r.top)/s,...MC(l)}})};function ik({sourceX:e,sourceY:n,targetX:r,targetY:s,sourceControlX:a,sourceControlY:o,targetControlX:l,targetControlY:u}){const h=e*.125+a*.375+l*.375+r*.125,f=n*.125+o*.375+u*.375+s*.125,p=Math.abs(h-e),d=Math.abs(f-n);return[h,f,p,d]}function lf(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function iA({pos:e,x1:n,y1:r,x2:s,y2:a,c:o}){switch(e){case Ne.Left:return[n-lf(n-s,o),r];case Ne.Right:return[n+lf(s-n,o),r];case Ne.Top:return[n,r-lf(r-a,o)];case Ne.Bottom:return[n,r+lf(a-r,o)]}}function sk({sourceX:e,sourceY:n,sourcePosition:r=Ne.Bottom,targetX:s,targetY:a,targetPosition:o=Ne.Top,curvature:l=.25}){const[u,h]=iA({pos:r,x1:e,y1:n,x2:s,y2:a,c:l}),[f,p]=iA({pos:o,x1:s,y1:a,x2:e,y2:n,c:l}),[d,g,y,E]=ik({sourceX:e,sourceY:n,targetX:s,targetY:a,sourceControlX:u,sourceControlY:h,targetControlX:f,targetControlY:p});return[`M${e},${n} C${u},${h} ${f},${p} ${s},${a}`,d,g,y,E]}function ak({sourceX:e,sourceY:n,targetX:r,targetY:s}){const a=Math.abs(r-e)/2,o=r<e?r+a:r-a,l=Math.abs(s-n)/2,u=s<n?s+l:s-l;return[o,u,a,l]}function U5({sourceNode:e,targetNode:n,selected:r=!1,zIndex:s=0,elevateOnSelect:a=!1,zIndexMode:o="basic"}){if(o==="manual")return s;const l=a&&r?s+1e3:s,u=Math.max(e.parentId||a&&e.selected?e.internals.z:0,n.parentId||a&&n.selected?n.internals.z:0);return l+u}function Q5({sourceNode:e,targetNode:n,width:r,height:s,transform:a}){const o=rh(Uf(e),Uf(n));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const l={x:-a[0]/a[2],y:-a[1]/a[2],width:r/a[2],height:s/a[2]};return Yu(l,ih(o))>0}const H5=({source:e,sourceHandle:n,target:r,targetHandle:s})=>`xy-edge__${e}${n||""}-${r}${s||""}`,V5=(e,n)=>n.some(r=>r.source===e.source&&r.target===e.target&&(r.sourceHandle===e.sourceHandle||!r.sourceHandle&&!e.sourceHandle)&&(r.targetHandle===e.targetHandle||!r.targetHandle&&!e.targetHandle)),F5=(e,n,r={})=>{if(!e.source||!e.target)return n;const s=r.getEdgeId||H5;let a;return KD(e)?a={...e}:a={...e,id:s(e)},V5(a,n)?n:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,n.concat(a))};function ok({sourceX:e,sourceY:n,targetX:r,targetY:s}){const[a,o,l,u]=ak({sourceX:e,sourceY:n,targetX:r,targetY:s});return[`M ${e},${n}L ${r},${s}`,a,o,l,u]}const sA={[Ne.Left]:{x:-1,y:0},[Ne.Right]:{x:1,y:0},[Ne.Top]:{x:0,y:-1},[Ne.Bottom]:{x:0,y:1}},G5=({source:e,sourcePosition:n=Ne.Bottom,target:r})=>n===Ne.Left||n===Ne.Right?e.x<r.x?{x:1,y:0}:{x:-1,y:0}:e.y<r.y?{x:0,y:1}:{x:0,y:-1},aA=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function K5({source:e,sourcePosition:n=Ne.Bottom,target:r,targetPosition:s=Ne.Top,center:a,offset:o,stepPosition:l}){const u=sA[n],h=sA[s],f={x:e.x+u.x*o,y:e.y+u.y*o},p={x:r.x+h.x*o,y:r.y+h.y*o},d=G5({source:f,sourcePosition:n,target:p}),g=d.x!==0?"x":"y",y=d[g];let E=[],x,v;const b={x:0,y:0},w={x:0,y:0},[,,C,T]=ak({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(u[g]*h[g]===-1){g==="x"?(x=a.x??f.x+(p.x-f.x)*l,v=a.y??(f.y+p.y)/2):(x=a.x??(f.x+p.x)/2,v=a.y??f.y+(p.y-f.y)*l);const N=[{x,y:f.y},{x,y:p.y}],O=[{x:f.x,y:v},{x:p.x,y:v}];u[g]===y?E=g==="x"?N:O:E=g==="x"?O:N}else{const N=[{x:f.x,y:p.y}],O=[{x:p.x,y:f.y}];if(g==="x"?E=u.x===y?O:N:E=u.y===y?N:O,n===s){const D=Math.abs(e[g]-r[g]);if(D<=o){const z=Math.min(o-1,o-D);u[g]===y?b[g]=(f[g]>e[g]?-1:1)*z:w[g]=(p[g]>r[g]?-1:1)*z}}if(n!==s){const D=g==="x"?"y":"x",z=u[g]===h[D],q=f[D]>p[D],j=f[D]<p[D];(u[g]===1&&(!z&&q||z&&j)||u[g]!==1&&(!z&&j||z&&q))&&(E=g==="x"?N:O)}const I={x:f.x+b.x,y:f.y+b.y},k={x:p.x+w.x,y:p.y+w.y},R=Math.max(Math.abs(I.x-E[0].x),Math.abs(k.x-E[0].x)),M=Math.max(Math.abs(I.y-E[0].y),Math.abs(k.y-E[0].y));R>=M?(x=(I.x+k.x)/2,v=E[0].y):(x=E[0].x,v=(I.y+k.y)/2)}return[[e,{x:f.x+b.x,y:f.y+b.y},...E,{x:p.x+w.x,y:p.y+w.y},r],x,v,C,T]}function Y5(e,n,r,s){const a=Math.min(aA(e,n)/2,aA(n,r)/2,s),{x:o,y:l}=n;if(e.x===o&&o===r.x||e.y===l&&l===r.y)return`L${o} ${l}`;if(e.y===l){const f=e.x<r.x?-1:1,p=e.y<r.y?1:-1;return`L ${o+a*f},${l}Q ${o},${l} ${o},${l+a*p}`}const u=e.x<r.x?1:-1,h=e.y<r.y?-1:1;return`L ${o},${l+a*h}Q ${o},${l} ${o+a*u},${l}`}function iC({sourceX:e,sourceY:n,sourcePosition:r=Ne.Bottom,targetX:s,targetY:a,targetPosition:o=Ne.Top,borderRadius:l=5,centerX:u,centerY:h,offset:f=20,stepPosition:p=.5}){const[d,g,y,E,x]=K5({source:{x:e,y:n},sourcePosition:r,target:{x:s,y:a},targetPosition:o,center:{x:u,y:h},offset:f,stepPosition:p});return[d.reduce((b,w,C)=>{let T="";return C>0&&C<d.length-1?T=Y5(d[C-1],w,d[C+1],l):T=`${C===0?"M":"L"}${w.x} ${w.y}`,b+=T,b},""),g,y,E,x]}function oA(e){var n;return e&&!!(e.internals.handleBounds||(n=e.handles)!=null&&n.length)&&!!(e.measured.width||e.width||e.initialWidth)}function X5(e){var d;const{sourceNode:n,targetNode:r}=e;if(!oA(n)||!oA(r))return null;const s=n.internals.handleBounds||uA(n.handles),a=r.internals.handleBounds||uA(r.handles),o=lA((s==null?void 0:s.source)??[],e.sourceHandle),l=lA(e.connectionMode===go.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),e.targetHandle);if(!o||!l)return(d=e.onError)==null||d.call(e,"008",vr.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const u=(o==null?void 0:o.position)||Ne.Bottom,h=(l==null?void 0:l.position)||Ne.Top,f=Ps(n,o,u),p=Ps(r,l,h);return{sourceX:f.x,sourceY:f.y,targetX:p.x,targetY:p.y,sourcePosition:u,targetPosition:h}}function uA(e){if(!e)return null;const n=[],r=[];for(const s of e)s.width=s.width??1,s.height=s.height??1,s.type==="source"?n.push(s):s.type==="target"&&r.push(s);return{source:n,target:r}}function Ps(e,n,r=Ne.Left,s=!1){const a=((n==null?void 0:n.x)??0)+e.internals.positionAbsolute.x,o=((n==null?void 0:n.y)??0)+e.internals.positionAbsolute.y,{width:l,height:u}=n??Zr(e);if(s)return{x:a+l/2,y:o+u/2};switch((n==null?void 0:n.position)??r){case Ne.Top:return{x:a+l/2,y:o};case Ne.Right:return{x:a+l,y:o+u/2};case Ne.Bottom:return{x:a+l/2,y:o+u};case Ne.Left:return{x:a,y:o+u/2}}}function lA(e,n){return e&&(n?e.find(r=>r.id===n):e[0])||null}function sC(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function W5(e,{id:n,defaultColor:r,defaultMarkerStart:s,defaultMarkerEnd:a}){const o=new Set;return e.reduce((l,u)=>([u.markerStart||s,u.markerEnd||a].forEach(h=>{if(h&&typeof h=="object"){const f=sC(h,n);o.has(f)||(l.push({id:f,color:h.color||r,...h}),o.add(f))}}),l),[]).sort((l,u)=>l.id.localeCompare(u.id))}const uk=1e3,J5=10,jC={nodeOrigin:[0,0],nodeExtent:Gu,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Z5={...jC,checkEquality:!0};function LC(e,n){const r={...e};for(const s in n)n[s]!==void 0&&(r[s]=n[s]);return r}function e8(e,n,r){const s=LC(jC,r);for(const a of e.values())if(a.parentId)IC(a,e,n,s);else{const o=pl(a,s.nodeOrigin),l=bo(a.extent)?a.extent:s.nodeExtent,u=Bs(o,l,Zr(a));a.internals.positionAbsolute=u}}function t8(e,n){if(!e.handles)return e.measured?n==null?void 0:n.internals.handleBounds:void 0;const r=[],s=[];for(const a of e.handles){const o={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?r.push(o):a.type==="target"&&s.push(o)}return{source:r,target:s}}function $C(e){return e==="manual"}function aC(e,n,r,s={}){var f,p;const a=LC(Z5,s),o={i:0},l=new Map(n),u=a!=null&&a.elevateNodesOnSelect&&!$C(a.zIndexMode)?uk:0;let h=e.length>0;n.clear(),r.clear();for(const d of e){let g=l.get(d.id);if(a.checkEquality&&d===(g==null?void 0:g.internals.userNode))n.set(d.id,g);else{const y=pl(d,a.nodeOrigin),E=bo(d.extent)?d.extent:a.nodeExtent,x=Bs(y,E,Zr(d));g={...a.defaults,...d,measured:{width:(f=d.measured)==null?void 0:f.width,height:(p=d.measured)==null?void 0:p.height},internals:{positionAbsolute:x,handleBounds:t8(d,g),z:lk(d,u,a.zIndexMode),userNode:d}},n.set(d.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(h=!1),d.parentId&&IC(g,n,r,s,o)}return h}function n8(e,n){if(!e.parentId)return;const r=n.get(e.parentId);r?r.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function IC(e,n,r,s,a){const{elevateNodesOnSelect:o,nodeOrigin:l,nodeExtent:u,zIndexMode:h}=LC(jC,s),f=e.parentId,p=n.get(f);if(!p){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}n8(e,r),a&&!p.parentId&&p.internals.rootParentIndex===void 0&&h==="auto"&&(p.internals.rootParentIndex=++a.i,p.internals.z=p.internals.z+a.i*J5),a&&p.internals.rootParentIndex!==void 0&&(a.i=p.internals.rootParentIndex);const d=o&&!$C(h)?uk:0,{x:g,y,z:E}=r8(e,p,l,u,d,h),{positionAbsolute:x}=e.internals,v=g!==x.x||y!==x.y;(v||E!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:v?{x:g,y}:x,z:E}})}function lk(e,n,r){const s=Wn(e.zIndex)?e.zIndex:0;return $C(r)?s:s+(e.selected?n:0)}function r8(e,n,r,s,a,o){const{x:l,y:u}=n.internals.positionAbsolute,h=Zr(e),f=pl(e,r),p=bo(e.extent)?Bs(f,e.extent,h):f;let d=Bs({x:l+p.x,y:u+p.y},s,h);e.extent==="parent"&&(d=XD(d,h,n));const g=lk(e,a,o),y=n.internals.z??0;return{x:d.x,y:d.y,z:y>=g?y+1:g}}function DC(e,n,r,s=[0,0]){var l;const a=[],o=new Map;for(const u of e){const h=n.get(u.parentId);if(!h)continue;const f=((l=o.get(u.parentId))==null?void 0:l.expandedRect)??vo(h),p=JD(f,u.rect);o.set(u.parentId,{expandedRect:p,parent:h})}return o.size>0&&o.forEach(({expandedRect:u,parent:h},f)=>{var C;const p=h.internals.positionAbsolute,d=Zr(h),g=h.origin??s,y=u.x<p.x?Math.round(Math.abs(p.x-u.x)):0,E=u.y<p.y?Math.round(Math.abs(p.y-u.y)):0,x=Math.max(d.width,Math.round(u.width)),v=Math.max(d.height,Math.round(u.height)),b=(x-d.width)*g[0],w=(v-d.height)*g[1];(y>0||E>0||b||w)&&(a.push({id:f,type:"position",position:{x:h.position.x-y+b,y:h.position.y-E+w}}),(C=r.get(f))==null||C.forEach(T=>{e.some(A=>A.id===T.id)||a.push({id:T.id,type:"position",position:{x:T.position.x+y,y:T.position.y+E}})})),(d.width<u.width||d.height<u.height||y||E)&&a.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:x+(y?g[0]*y-b:0),height:v+(E?g[1]*E-w:0)}})}),a}function i8(e,n,r,s,a,o,l){const u=s==null?void 0:s.querySelector(".xyflow__viewport");let h=!1;if(!u)return{changes:[],updatedInternals:h};const f=[],p=window.getComputedStyle(u),{m22:d}=new window.DOMMatrixReadOnly(p.transform),g=[];for(const y of e.values()){const E=n.get(y.id);if(!E)continue;if(E.hidden){n.set(E.id,{...E,internals:{...E.internals,handleBounds:void 0}}),h=!0;continue}const x=MC(y.nodeElement),v=E.measured.width!==x.width||E.measured.height!==x.height;if(!!(x.width&&x.height&&(v||!E.internals.handleBounds||y.force))){const w=y.nodeElement.getBoundingClientRect(),C=bo(E.extent)?E.extent:o;let{positionAbsolute:T}=E.internals;E.parentId&&E.extent==="parent"?T=XD(T,x,n.get(E.parentId)):C&&(T=Bs(T,C,x));const A={...E,measured:x,internals:{...E.internals,positionAbsolute:T,handleBounds:{source:rA("source",y.nodeElement,w,d,E.id),target:rA("target",y.nodeElement,w,d,E.id)}}};n.set(E.id,A),E.parentId&&IC(A,n,r,{nodeOrigin:a,zIndexMode:l}),h=!0,v&&(f.push({id:E.id,type:"dimensions",dimensions:x}),E.expandParent&&E.parentId&&g.push({id:E.id,parentId:E.parentId,rect:vo(A,a)}))}}if(g.length>0){const y=DC(g,n,r,a);f.push(...y)}return{changes:f,updatedInternals:h}}async function s8({delta:e,panZoom:n,transform:r,translateExtent:s,width:a,height:o}){if(!n||!e.x&&!e.y)return Promise.resolve(!1);const l=await n.setViewportConstrained({x:r[0]+e.x,y:r[1]+e.y,zoom:r[2]},[[0,0],[a,o]],s),u=!!l&&(l.x!==r[0]||l.y!==r[1]||l.k!==r[2]);return Promise.resolve(u)}function cA(e,n,r,s,a,o){let l=a;const u=s.get(l)||new Map;s.set(l,u.set(r,n)),l=`${a}-${e}`;const h=s.get(l)||new Map;if(s.set(l,h.set(r,n)),o){l=`${a}-${e}-${o}`;const f=s.get(l)||new Map;s.set(l,f.set(r,n))}}function ck(e,n,r){e.clear(),n.clear();for(const s of r){const{source:a,target:o,sourceHandle:l=null,targetHandle:u=null}=s,h={edgeId:s.id,source:a,target:o,sourceHandle:l,targetHandle:u},f=`${a}-${l}--${o}-${u}`,p=`${o}-${u}--${a}-${l}`;cA("source",h,p,e,a,l),cA("target",h,f,e,o,u),n.set(s.id,s)}}function fk(e,n){if(!e.parentId)return!1;const r=n.get(e.parentId);return r?r.selected?!0:fk(r,n):!1}function fA(e,n,r){var a;let s=e;do{if((a=s==null?void 0:s.matches)!=null&&a.call(s,n))return!0;if(s===r)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function a8(e,n,r,s){const a=new Map;for(const[o,l]of e)if((l.selected||l.id===s)&&(!l.parentId||!fk(l,e))&&(l.draggable||n&&typeof l.draggable>"u")){const u=e.get(o);u&&a.set(o,{id:o,position:u.position||{x:0,y:0},distance:{x:r.x-u.internals.positionAbsolute.x,y:r.y-u.internals.positionAbsolute.y},extent:u.extent,parentId:u.parentId,origin:u.origin,expandParent:u.expandParent,internals:{positionAbsolute:u.internals.positionAbsolute||{x:0,y:0}},measured:{width:u.measured.width??0,height:u.measured.height??0}})}return a}function om({nodeId:e,dragItems:n,nodeLookup:r,dragging:s=!0}){var l,u,h;const a=[];for(const[f,p]of n){const d=(l=r.get(f))==null?void 0:l.internals.userNode;d&&a.push({...d,position:p.position,dragging:s})}if(!e)return[a[0],a];const o=(u=r.get(e))==null?void 0:u.internals.userNode;return[o?{...o,position:((h=n.get(e))==null?void 0:h.position)||o.position,dragging:s}:a[0],a]}function o8({dragItems:e,snapGrid:n,x:r,y:s}){const a=e.values().next().value;if(!a)return null;const o={x:r-a.distance.x,y:s-a.distance.y},l=gl(o,n);return{x:l.x-o.x,y:l.y-o.y}}function u8({onNodeMouseDown:e,getStoreItems:n,onDragStart:r,onDrag:s,onDragStop:a}){let o={x:null,y:null},l=0,u=new Map,h=!1,f={x:0,y:0},p=null,d=!1,g=null,y=!1,E=!1,x=null;function v({noDragClassName:w,handleSelector:C,domNode:T,isSelectable:A,nodeId:N,nodeClickDistance:O=0}){g=Sn(T);function I({x:D,y:z}){const{nodeLookup:q,nodeExtent:j,snapGrid:L,snapToGrid:P,nodeOrigin:H,onNodeDrag:G,onSelectionDrag:V,onError:B,updateNodePositions:K}=n();o={x:D,y:z};let ne=!1;const Q=u.size>1,J=Q&&j?rC(ml(u)):null,ie=Q&&P?o8({dragItems:u,snapGrid:L,x:D,y:z}):null;for(const[oe,ee]of u){if(!q.has(oe))continue;let fe={x:D-ee.distance.x,y:z-ee.distance.y};P&&(fe=ie?{x:Math.round(fe.x+ie.x),y:Math.round(fe.y+ie.y)}:gl(fe,L));let be=null;if(Q&&j&&!ee.extent&&J){const{positionAbsolute:we}=ee.internals,W=we.x-J.x+j[0][0],ae=we.x+ee.measured.width-J.x2+j[1][0],xe=we.y-J.y+j[0][1],Se=we.y+ee.measured.height-J.y2+j[1][1];be=[[W,xe],[ae,Se]]}const{position:ve,positionAbsolute:_e}=YD({nodeId:oe,nextPosition:fe,nodeLookup:q,nodeExtent:be||j,nodeOrigin:H,onError:B});ne=ne||ee.position.x!==ve.x||ee.position.y!==ve.y,ee.position=ve,ee.internals.positionAbsolute=_e}if(E=E||ne,!!ne&&(K(u,!0),x&&(s||G||!N&&V))){const[oe,ee]=om({nodeId:N,dragItems:u,nodeLookup:q});s==null||s(x,u,oe,ee),G==null||G(x,oe,ee),N||V==null||V(x,ee)}}async function k(){if(!p)return;const{transform:D,panBy:z,autoPanSpeed:q,autoPanOnNodeDrag:j}=n();if(!j){h=!1,cancelAnimationFrame(l);return}const[L,P]=WD(f,p,q);(L!==0||P!==0)&&(o.x=(o.x??0)-L/D[2],o.y=(o.y??0)-P/D[2],await z({x:L,y:P})&&I(o)),l=requestAnimationFrame(k)}function R(D){var Q;const{nodeLookup:z,multiSelectionActive:q,nodesDraggable:j,transform:L,snapGrid:P,snapToGrid:H,selectNodesOnDrag:G,onNodeDragStart:V,onSelectionDragStart:B,unselectNodesAndEdges:K}=n();d=!0,(!G||!A)&&!q&&N&&((Q=z.get(N))!=null&&Q.selected||K()),A&&G&&N&&(e==null||e(N));const ne=Pu(D.sourceEvent,{transform:L,snapGrid:P,snapToGrid:H,containerBounds:p});if(o=ne,u=a8(z,j,ne,N),u.size>0&&(r||V||!N&&B)){const[J,ie]=om({nodeId:N,dragItems:u,nodeLookup:z});r==null||r(D.sourceEvent,u,J,ie),V==null||V(D.sourceEvent,J,ie),N||B==null||B(D.sourceEvent,ie)}}const M=AD().clickDistance(O).on("start",D=>{const{domNode:z,nodeDragThreshold:q,transform:j,snapGrid:L,snapToGrid:P}=n();p=(z==null?void 0:z.getBoundingClientRect())||null,y=!1,E=!1,x=D.sourceEvent,q===0&&R(D),o=Pu(D.sourceEvent,{transform:j,snapGrid:L,snapToGrid:P,containerBounds:p}),f=Jn(D.sourceEvent,p)}).on("drag",D=>{const{autoPanOnNodeDrag:z,transform:q,snapGrid:j,snapToGrid:L,nodeDragThreshold:P,nodeLookup:H}=n(),G=Pu(D.sourceEvent,{transform:q,snapGrid:j,snapToGrid:L,containerBounds:p});if(x=D.sourceEvent,(D.sourceEvent.type==="touchmove"&&D.sourceEvent.touches.length>1||N&&!H.has(N))&&(y=!0),!y){if(!h&&z&&d&&(h=!0,k()),!d){const V=Jn(D.sourceEvent,p),B=V.x-f.x,K=V.y-f.y;Math.sqrt(B*B+K*K)>P&&R(D)}(o.x!==G.xSnapped||o.y!==G.ySnapped)&&u&&d&&(f=Jn(D.sourceEvent,p),I(G))}}).on("end",D=>{if(!(!d||y)&&(h=!1,d=!1,cancelAnimationFrame(l),u.size>0)){const{nodeLookup:z,updateNodePositions:q,onNodeDragStop:j,onSelectionDragStop:L}=n();if(E&&(q(u,!1),E=!1),a||j||!N&&L){const[P,H]=om({nodeId:N,dragItems:u,nodeLookup:z,dragging:!1});a==null||a(D.sourceEvent,u,P,H),j==null||j(D.sourceEvent,P,H),N||L==null||L(D.sourceEvent,H)}}}).filter(D=>{const z=D.target;return!D.button&&(!w||!fA(z,`.${w}`,T))&&(!C||fA(z,C,T))});g.call(M)}function b(){g==null||g.on(".drag",null)}return{update:v,destroy:b}}function l8(e,n,r){const s=[],a={x:e.x-r,y:e.y-r,width:r*2,height:r*2};for(const o of n.values())Yu(a,vo(o))>0&&s.push(o);return s}const c8=250;function f8(e,n,r,s){var u,h;let a=[],o=1/0;const l=l8(e,r,n+c8);for(const f of l){const p=[...((u=f.internals.handleBounds)==null?void 0:u.source)??[],...((h=f.internals.handleBounds)==null?void 0:h.target)??[]];for(const d of p){if(s.nodeId===d.nodeId&&s.type===d.type&&s.id===d.id)continue;const{x:g,y}=Ps(f,d,d.position,!0),E=Math.sqrt(Math.pow(g-e.x,2)+Math.pow(y-e.y,2));E>n||(E<o?(a=[{...d,x:g,y}],o=E):E===o&&a.push({...d,x:g,y}))}}if(!a.length)return null;if(a.length>1){const f=s.type==="source"?"target":"source";return a.find(p=>p.type===f)??a[0]}return a[0]}function hk(e,n,r,s,a,o=!1){var f,p,d;const l=s.get(e);if(!l)return null;const u=a==="strict"?(f=l.internals.handleBounds)==null?void 0:f[n]:[...((p=l.internals.handleBounds)==null?void 0:p.source)??[],...((d=l.internals.handleBounds)==null?void 0:d.target)??[]],h=(r?u==null?void 0:u.find(g=>g.id===r):u==null?void 0:u[0])??null;return h&&o?{...h,...Ps(l,h,h.position,!0)}:h}function dk(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function h8(e,n){let r=null;return n?r=!0:e&&!n&&(r=!1),r}const pk=()=>!0;function d8(e,{connectionMode:n,connectionRadius:r,handleId:s,nodeId:a,edgeUpdaterType:o,isTarget:l,domNode:u,nodeLookup:h,lib:f,autoPanOnConnect:p,flowId:d,panBy:g,cancelConnection:y,onConnectStart:E,onConnect:x,onConnectEnd:v,isValidConnection:b=pk,onReconnectEnd:w,updateConnection:C,getTransform:T,getFromHandle:A,autoPanSpeed:N,dragThreshold:O=1,handleDomNode:I}){const k=tk(e.target);let R=0,M;const{x:D,y:z}=Jn(e),q=dk(o,I),j=u==null?void 0:u.getBoundingClientRect();let L=!1;if(!j||!q)return;const P=hk(a,q,s,h,n);if(!P)return;let H=Jn(e,j),G=!1,V=null,B=!1,K=null;function ne(){if(!p||!j)return;const[ve,_e]=WD(H,j,N);g({x:ve,y:_e}),R=requestAnimationFrame(ne)}const Q={...P,nodeId:a,type:q,position:P.position},J=h.get(a);let oe={inProgress:!0,isValid:null,from:Ps(J,Q,Ne.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:J,to:H,toHandle:null,toPosition:Zq[Q.position],toNode:null,pointer:H};function ee(){L=!0,C(oe),E==null||E(e,{nodeId:a,handleId:s,handleType:q})}O===0&&ee();function fe(ve){if(!L){const{x:Se,y:gt}=Jn(ve),ut=Se-D,It=gt-z;if(!(ut*ut+It*It>O*O))return;ee()}if(!A()||!Q){be(ve);return}const _e=T();H=Jn(ve,j),M=f8(yl(H,_e,!1,[1,1]),r,h,Q),G||(ne(),G=!0);const we=mk(ve,{handle:M,connectionMode:n,fromNodeId:a,fromHandleId:s,fromType:l?"target":"source",isValidConnection:b,doc:k,lib:f,flowId:d,nodeLookup:h});K=we.handleDomNode,V=we.connection,B=h8(!!M,we.isValid);const W=h.get(a),ae=W?Ps(W,Q,Ne.Left,!0):oe.from,xe={...oe,from:ae,isValid:B,to:we.toHandle&&B?Qf({x:we.toHandle.x,y:we.toHandle.y},_e):H,toHandle:we.toHandle,toPosition:B&&we.toHandle?we.toHandle.position:Zq[Q.position],toNode:we.toHandle?h.get(we.toHandle.nodeId):null,pointer:H};C(xe),oe=xe}function be(ve){if(!("touches"in ve&&ve.touches.length>0)){if(L){(M||K)&&V&&B&&(x==null||x(V));const{inProgress:_e,...we}=oe,W={...we,toPosition:oe.toHandle?oe.toPosition:null};v==null||v(ve,W),o&&(w==null||w(ve,W))}y(),cancelAnimationFrame(R),G=!1,B=!1,V=null,K=null,k.removeEventListener("mousemove",fe),k.removeEventListener("mouseup",be),k.removeEventListener("touchmove",fe),k.removeEventListener("touchend",be)}}k.addEventListener("mousemove",fe),k.addEventListener("mouseup",be),k.addEventListener("touchmove",fe),k.addEventListener("touchend",be)}function mk(e,{handle:n,connectionMode:r,fromNodeId:s,fromHandleId:a,fromType:o,doc:l,lib:u,flowId:h,isValidConnection:f=pk,nodeLookup:p}){const d=o==="target",g=n?l.querySelector(`.${u}-flow__handle[data-id="${h}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:y,y:E}=Jn(e),x=l.elementFromPoint(y,E),v=x!=null&&x.classList.contains(`${u}-flow__handle`)?x:g,b={handleDomNode:v,isValid:!1,connection:null,toHandle:null};if(v){const w=dk(void 0,v),C=v.getAttribute("data-nodeid"),T=v.getAttribute("data-handleid"),A=v.classList.contains("connectable"),N=v.classList.contains("connectableend");if(!C||!w)return b;const O={source:d?C:s,sourceHandle:d?T:a,target:d?s:C,targetHandle:d?a:T};b.connection=O;const k=A&&N&&(r===go.Strict?d&&w==="source"||!d&&w==="target":C!==s||T!==a);b.isValid=k&&f(O),b.toHandle=hk(C,w,T,p,r,!0)}return b}const oC={onPointerDown:d8,isValid:mk};function p8({domNode:e,panZoom:n,getTransform:r,getViewScale:s}){const a=Sn(e);function o({translateExtent:u,width:h,height:f,zoomStep:p=1,pannable:d=!0,zoomable:g=!0,inversePan:y=!1}){const E=C=>{if(C.sourceEvent.type!=="wheel"||!n)return;const T=r(),A=C.sourceEvent.ctrlKey&&Xu()?10:1,N=-C.sourceEvent.deltaY*(C.sourceEvent.deltaMode===1?.05:C.sourceEvent.deltaMode?1:.002)*p,O=T[2]*Math.pow(2,N*A);n.scaleTo(O)};let x=[0,0];const v=C=>{(C.sourceEvent.type==="mousedown"||C.sourceEvent.type==="touchstart")&&(x=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY])},b=C=>{const T=r();if(C.sourceEvent.type!=="mousemove"&&C.sourceEvent.type!=="touchmove"||!n)return;const A=[C.sourceEvent.clientX??C.sourceEvent.touches[0].clientX,C.sourceEvent.clientY??C.sourceEvent.touches[0].clientY],N=[A[0]-x[0],A[1]-x[1]];x=A;const O=s()*Math.max(T[2],Math.log(T[2]))*(y?-1:1),I={x:T[0]-N[0]*O,y:T[1]-N[1]*O},k=[[0,0],[h,f]];n.setViewportConstrained({x:I.x,y:I.y,zoom:T[2]},k,u)},w=QD().on("start",v).on("zoom",d?b:null).on("zoom.wheel",g?E:null);a.call(w,{})}function l(){a.on("zoom",null)}return{update:o,destroy:l,pointer:Kn}}const sh=e=>({x:e.x,y:e.y,zoom:e.k}),um=({x:e,y:n,zoom:r})=>nh.translate(e,n).scale(r),Ka=(e,n)=>e.target.closest(`.${n}`),gk=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),m8=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,lm=(e,n=0,r=m8,s=()=>{})=>{const a=typeof n=="number"&&n>0;return a||s(),a?e.transition().duration(n).ease(r).on("end",s):e},yk=e=>{const n=e.ctrlKey&&Xu()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function g8({zoomPanValues:e,noWheelClassName:n,d3Selection:r,d3Zoom:s,panOnScrollMode:a,panOnScrollSpeed:o,zoomOnPinch:l,onPanZoomStart:u,onPanZoom:h,onPanZoomEnd:f}){return p=>{if(Ka(p,n))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const d=r.property("__zoom").k||1;if(p.ctrlKey&&l){const v=Kn(p),b=yk(p),w=d*Math.pow(2,b);s.scaleTo(r,w,v,p);return}const g=p.deltaMode===1?20:1;let y=a===Ls.Vertical?0:p.deltaX*g,E=a===Ls.Horizontal?0:p.deltaY*g;!Xu()&&p.shiftKey&&a!==Ls.Vertical&&(y=p.deltaY*g,E=0),s.translateBy(r,-(y/d)*o,-(E/d)*o,{internal:!0});const x=sh(r.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(h==null||h(p,x),e.panScrollTimeout=setTimeout(()=>{f==null||f(p,x),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,u==null||u(p,x))}}function y8({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:r}){return function(s,a){const o=s.type==="wheel",l=!n&&o&&!s.ctrlKey,u=Ka(s,e);if(s.ctrlKey&&o&&u&&s.preventDefault(),l||u)return null;s.preventDefault(),r.call(this,s,a)}}function v8({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:r}){return s=>{var o,l,u;if((o=s.sourceEvent)!=null&&o.internal)return;const a=sh(s.transform);e.mouseButton=((l=s.sourceEvent)==null?void 0:l.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((u=s.sourceEvent)==null?void 0:u.type)==="mousedown"&&n(!0),r&&(r==null||r(s.sourceEvent,a))}}function b8({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:r,onTransformChange:s,onPanZoom:a}){return o=>{var l,u;e.usedRightMouseButton=!!(r&&gk(n,e.mouseButton??0)),(l=o.sourceEvent)!=null&&l.sync||s([o.transform.x,o.transform.y,o.transform.k]),a&&!((u=o.sourceEvent)!=null&&u.internal)&&(a==null||a(o.sourceEvent,sh(o.transform)))}}function _8({zoomPanValues:e,panOnDrag:n,panOnScroll:r,onDraggingChange:s,onPanZoomEnd:a,onPaneContextMenu:o}){return l=>{var u;if(!((u=l.sourceEvent)!=null&&u.internal)&&(e.isZoomingOrPanning=!1,o&&gk(n,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&o(l.sourceEvent),e.usedRightMouseButton=!1,s(!1),a)){const h=sh(l.transform);e.prevViewport=h,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(l.sourceEvent,h)},r?150:0)}}}function w8({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:s,panOnScroll:a,zoomOnDoubleClick:o,userSelectionActive:l,noWheelClassName:u,noPanClassName:h,lib:f,connectionInProgress:p}){return d=>{var v;const g=e||n,y=r&&d.ctrlKey,E=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Ka(d,`${f}-flow__node`)||Ka(d,`${f}-flow__edge`)))return!0;if(!s&&!g&&!a&&!o&&!r||l||p&&!E||Ka(d,u)&&E||Ka(d,h)&&(!E||a&&E&&!e)||!r&&d.ctrlKey&&E)return!1;if(!r&&d.type==="touchstart"&&((v=d.touches)==null?void 0:v.length)>1)return d.preventDefault(),!1;if(!g&&!a&&!y&&E||!s&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(s)&&!s.includes(d.button)&&d.type==="mousedown")return!1;const x=Array.isArray(s)&&s.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||E)&&x}}function E8({domNode:e,minZoom:n,maxZoom:r,translateExtent:s,viewport:a,onPanZoom:o,onPanZoomStart:l,onPanZoomEnd:u,onDraggingChange:h}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),d=QD().scaleExtent([n,r]).translateExtent(s),g=Sn(e).call(d);w({x:a.x,y:a.y,zoom:yo(a.zoom,n,r)},[[0,0],[p.width,p.height]],s);const y=g.on("wheel.zoom"),E=g.on("dblclick.zoom");d.wheelDelta(yk);function x(M,D){return g?new Promise(z=>{d==null||d.interpolate((D==null?void 0:D.interpolate)==="linear"?Bu:Tf).transform(lm(g,D==null?void 0:D.duration,D==null?void 0:D.ease,()=>z(!0)),M)}):Promise.resolve(!1)}function v({noWheelClassName:M,noPanClassName:D,onPaneContextMenu:z,userSelectionActive:q,panOnScroll:j,panOnDrag:L,panOnScrollMode:P,panOnScrollSpeed:H,preventScrolling:G,zoomOnPinch:V,zoomOnScroll:B,zoomOnDoubleClick:K,zoomActivationKeyPressed:ne,lib:Q,onTransformChange:J,connectionInProgress:ie,paneClickDistance:oe,selectionOnDrag:ee}){q&&!f.isZoomingOrPanning&&b();const fe=j&&!ne&&!q;d.clickDistance(ee?1/0:!Wn(oe)||oe<0?0:oe);const be=fe?g8({zoomPanValues:f,noWheelClassName:M,d3Selection:g,d3Zoom:d,panOnScrollMode:P,panOnScrollSpeed:H,zoomOnPinch:V,onPanZoomStart:l,onPanZoom:o,onPanZoomEnd:u}):y8({noWheelClassName:M,preventScrolling:G,d3ZoomHandler:y});if(g.on("wheel.zoom",be,{passive:!1}),!q){const _e=v8({zoomPanValues:f,onDraggingChange:h,onPanZoomStart:l});d.on("start",_e);const we=b8({zoomPanValues:f,panOnDrag:L,onPaneContextMenu:!!z,onPanZoom:o,onTransformChange:J});d.on("zoom",we);const W=_8({zoomPanValues:f,panOnDrag:L,panOnScroll:j,onPaneContextMenu:z,onPanZoomEnd:u,onDraggingChange:h});d.on("end",W)}const ve=w8({zoomActivationKeyPressed:ne,panOnDrag:L,zoomOnScroll:B,panOnScroll:j,zoomOnDoubleClick:K,zoomOnPinch:V,userSelectionActive:q,noPanClassName:D,noWheelClassName:M,lib:Q,connectionInProgress:ie});d.filter(ve),K?g.on("dblclick.zoom",E):g.on("dblclick.zoom",null)}function b(){d.on("zoom",null)}async function w(M,D,z){const q=um(M),j=d==null?void 0:d.constrain()(q,D,z);return j&&await x(j),new Promise(L=>L(j))}async function C(M,D){const z=um(M);return await x(z,D),new Promise(q=>q(z))}function T(M){if(g){const D=um(M),z=g.property("__zoom");(z.k!==M.zoom||z.x!==M.x||z.y!==M.y)&&(d==null||d.transform(g,D,null,{sync:!0}))}}function A(){const M=g?UD(g.node()):{x:0,y:0,k:1};return{x:M.x,y:M.y,zoom:M.k}}function N(M,D){return g?new Promise(z=>{d==null||d.interpolate((D==null?void 0:D.interpolate)==="linear"?Bu:Tf).scaleTo(lm(g,D==null?void 0:D.duration,D==null?void 0:D.ease,()=>z(!0)),M)}):Promise.resolve(!1)}function O(M,D){return g?new Promise(z=>{d==null||d.interpolate((D==null?void 0:D.interpolate)==="linear"?Bu:Tf).scaleBy(lm(g,D==null?void 0:D.duration,D==null?void 0:D.ease,()=>z(!0)),M)}):Promise.resolve(!1)}function I(M){d==null||d.scaleExtent(M)}function k(M){d==null||d.translateExtent(M)}function R(M){const D=!Wn(M)||M<0?0:M;d==null||d.clickDistance(D)}return{update:v,destroy:b,setViewport:C,setViewportConstrained:w,getViewport:A,scaleTo:N,scaleBy:O,setScaleExtent:I,setTranslateExtent:k,syncViewport:T,setClickDistance:R}}var zs;(function(e){e.Line="line",e.Handle="handle"})(zs||(zs={}));const C8=["top-left","top-right","bottom-left","bottom-right"],x8=["top","right","bottom","left"];function S8({width:e,prevWidth:n,height:r,prevHeight:s,affectsX:a,affectsY:o}){const l=e-n,u=r-s,h=[l>0?1:l<0?-1:0,u>0?1:u<0?-1:0];return l&&a&&(h[0]=h[0]*-1),u&&o&&(h[1]=h[1]*-1),h}function hA(e){const n=e.includes("right")||e.includes("left"),r=e.includes("bottom")||e.includes("top"),s=e.includes("left"),a=e.includes("top");return{isHorizontal:n,isVertical:r,affectsX:s,affectsY:a}}function Mi(e,n){return Math.max(0,n-e)}function ji(e,n){return Math.max(0,e-n)}function cf(e,n,r){return Math.max(0,n-e,e-r)}function dA(e,n){return e?!n:n}function T8(e,n,r,s,a,o,l,u){let{affectsX:h,affectsY:f}=n;const{isHorizontal:p,isVertical:d}=n,g=p&&d,{xSnapped:y,ySnapped:E}=r,{minWidth:x,maxWidth:v,minHeight:b,maxHeight:w}=s,{x:C,y:T,width:A,height:N,aspectRatio:O}=e;let I=Math.floor(p?y-e.pointerX:0),k=Math.floor(d?E-e.pointerY:0);const R=A+(h?-I:I),M=N+(f?-k:k),D=-o[0]*A,z=-o[1]*N;let q=cf(R,x,v),j=cf(M,b,w);if(l){let H=0,G=0;h&&I<0?H=Mi(C+I+D,l[0][0]):!h&&I>0&&(H=ji(C+R+D,l[1][0])),f&&k<0?G=Mi(T+k+z,l[0][1]):!f&&k>0&&(G=ji(T+M+z,l[1][1])),q=Math.max(q,H),j=Math.max(j,G)}if(u){let H=0,G=0;h&&I>0?H=ji(C+I,u[0][0]):!h&&I<0&&(H=Mi(C+R,u[1][0])),f&&k>0?G=ji(T+k,u[0][1]):!f&&k<0&&(G=Mi(T+M,u[1][1])),q=Math.max(q,H),j=Math.max(j,G)}if(a){if(p){const H=cf(R/O,b,w)*O;if(q=Math.max(q,H),l){let G=0;!h&&!f||h&&!f&&g?G=ji(T+z+R/O,l[1][1])*O:G=Mi(T+z+(h?I:-I)/O,l[0][1])*O,q=Math.max(q,G)}if(u){let G=0;!h&&!f||h&&!f&&g?G=Mi(T+R/O,u[1][1])*O:G=ji(T+(h?I:-I)/O,u[0][1])*O,q=Math.max(q,G)}}if(d){const H=cf(M*O,x,v)/O;if(j=Math.max(j,H),l){let G=0;!h&&!f||f&&!h&&g?G=ji(C+M*O+D,l[1][0])/O:G=Mi(C+(f?k:-k)*O+D,l[0][0])/O,j=Math.max(j,G)}if(u){let G=0;!h&&!f||f&&!h&&g?G=Mi(C+M*O,u[1][0])/O:G=ji(C+(f?k:-k)*O,u[0][0])/O,j=Math.max(j,G)}}}k=k+(k<0?j:-j),I=I+(I<0?q:-q),a&&(g?R>M*O?k=(dA(h,f)?-I:I)/O:I=(dA(h,f)?-k:k)*O:p?(k=I/O,f=h):(I=k*O,h=f));const L=h?C+I:C,P=f?T+k:T;return{width:A+(h?-I:I),height:N+(f?-k:k),x:o[0]*I*(h?-1:1)+L,y:o[1]*k*(f?-1:1)+P}}const vk={width:0,height:0,x:0,y:0},q8={...vk,pointerX:0,pointerY:0,aspectRatio:1};function A8(e){return[[0,0],[e.measured.width,e.measured.height]]}function N8(e,n,r){const s=n.position.x+e.position.x,a=n.position.y+e.position.y,o=e.measured.width??0,l=e.measured.height??0,u=r[0]*o,h=r[1]*l;return[[s-u,a-h],[s+o-u,a+l-h]]}function R8({domNode:e,nodeId:n,getStoreItems:r,onChange:s,onEnd:a}){const o=Sn(e);let l={controlDirection:hA("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function u({controlPosition:f,boundaries:p,keepAspectRatio:d,resizeDirection:g,onResizeStart:y,onResize:E,onResizeEnd:x,shouldResize:v}){let b={...vk},w={...q8};l={boundaries:p,resizeDirection:g,keepAspectRatio:d,controlDirection:hA(f)};let C,T=null,A=[],N,O,I,k=!1;const R=AD().on("start",M=>{const{nodeLookup:D,transform:z,snapGrid:q,snapToGrid:j,nodeOrigin:L,paneDomNode:P}=r();if(C=D.get(n),!C)return;T=(P==null?void 0:P.getBoundingClientRect())??null;const{xSnapped:H,ySnapped:G}=Pu(M.sourceEvent,{transform:z,snapGrid:q,snapToGrid:j,containerBounds:T});b={width:C.measured.width??0,height:C.measured.height??0,x:C.position.x??0,y:C.position.y??0},w={...b,pointerX:H,pointerY:G,aspectRatio:b.width/b.height},N=void 0,C.parentId&&(C.extent==="parent"||C.expandParent)&&(N=D.get(C.parentId),O=N&&C.extent==="parent"?A8(N):void 0),A=[],I=void 0;for(const[V,B]of D)if(B.parentId===n&&(A.push({id:V,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){const K=N8(B,C,B.origin??L);I?I=[[Math.min(K[0][0],I[0][0]),Math.min(K[0][1],I[0][1])],[Math.max(K[1][0],I[1][0]),Math.max(K[1][1],I[1][1])]]:I=K}y==null||y(M,{...b})}).on("drag",M=>{const{transform:D,snapGrid:z,snapToGrid:q,nodeOrigin:j}=r(),L=Pu(M.sourceEvent,{transform:D,snapGrid:z,snapToGrid:q,containerBounds:T}),P=[];if(!C)return;const{x:H,y:G,width:V,height:B}=b,K={},ne=C.origin??j,{width:Q,height:J,x:ie,y:oe}=T8(w,l.controlDirection,L,l.boundaries,l.keepAspectRatio,ne,O,I),ee=Q!==V,fe=J!==B,be=ie!==H&&ee,ve=oe!==G&&fe;if(!be&&!ve&&!ee&&!fe)return;if((be||ve||ne[0]===1||ne[1]===1)&&(K.x=be?ie:b.x,K.y=ve?oe:b.y,b.x=K.x,b.y=K.y,A.length>0)){const ae=ie-H,xe=oe-G;for(const Se of A)Se.position={x:Se.position.x-ae+ne[0]*(Q-V),y:Se.position.y-xe+ne[1]*(J-B)},P.push(Se)}if((ee||fe)&&(K.width=ee&&(!l.resizeDirection||l.resizeDirection==="horizontal")?Q:b.width,K.height=fe&&(!l.resizeDirection||l.resizeDirection==="vertical")?J:b.height,b.width=K.width,b.height=K.height),N&&C.expandParent){const ae=ne[0]*(K.width??0);K.x&&K.x<ae&&(b.x=ae,w.x=w.x-(K.x-ae));const xe=ne[1]*(K.height??0);K.y&&K.y<xe&&(b.y=xe,w.y=w.y-(K.y-xe))}const _e=S8({width:b.width,prevWidth:V,height:b.height,prevHeight:B,affectsX:l.controlDirection.affectsX,affectsY:l.controlDirection.affectsY}),we={...b,direction:_e};(v==null?void 0:v(M,we))!==!1&&(k=!0,E==null||E(M,we),s(K,P))}).on("end",M=>{k&&(x==null||x(M,{...b}),a==null||a({...b}),k=!1)});o.call(R)}function h(){o.on(".drag",null)}return{update:u,destroy:h}}var cm={exports:{}},fm={},hm={exports:{}},dm={};/**
50
+ * @license React
51
+ * use-sync-external-store-shim.production.js
52
+ *
53
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
54
+ *
55
+ * This source code is licensed under the MIT license found in the
56
+ * LICENSE file in the root directory of this source tree.
57
+ */var pA;function O8(){if(pA)return dm;pA=1;var e=ol();function n(d,g){return d===g&&(d!==0||1/d===1/g)||d!==d&&g!==g}var r=typeof Object.is=="function"?Object.is:n,s=e.useState,a=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function u(d,g){var y=g(),E=s({inst:{value:y,getSnapshot:g}}),x=E[0].inst,v=E[1];return o(function(){x.value=y,x.getSnapshot=g,h(x)&&v({inst:x})},[d,y,g]),a(function(){return h(x)&&v({inst:x}),d(function(){h(x)&&v({inst:x})})},[d]),l(y),y}function h(d){var g=d.getSnapshot;d=d.value;try{var y=g();return!r(d,y)}catch{return!0}}function f(d,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return dm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,dm}var mA;function M8(){return mA||(mA=1,hm.exports=O8()),hm.exports}/**
58
+ * @license React
59
+ * use-sync-external-store-shim/with-selector.production.js
60
+ *
61
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
62
+ *
63
+ * This source code is licensed under the MIT license found in the
64
+ * LICENSE file in the root directory of this source tree.
65
+ */var gA;function j8(){if(gA)return fm;gA=1;var e=ol(),n=M8();function r(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var s=typeof Object.is=="function"?Object.is:r,a=n.useSyncExternalStore,o=e.useRef,l=e.useEffect,u=e.useMemo,h=e.useDebugValue;return fm.useSyncExternalStoreWithSelector=function(f,p,d,g,y){var E=o(null);if(E.current===null){var x={hasValue:!1,value:null};E.current=x}else x=E.current;E=u(function(){function b(N){if(!w){if(w=!0,C=N,N=g(N),y!==void 0&&x.hasValue){var O=x.value;if(y(O,N))return T=O}return T=N}if(O=T,s(C,N))return O;var I=g(N);return y!==void 0&&y(O,I)?(C=N,O):(C=N,T=I)}var w=!1,C,T,A=d===void 0?null:d;return[function(){return b(p())},A===null?void 0:function(){return b(A())}]},[p,d,g,y]);var v=a(f,E[0],E[1]);return l(function(){x.hasValue=!0,x.value=v},[v]),h(v),v},fm}var yA;function L8(){return yA||(yA=1,cm.exports=j8()),cm.exports}var $8=L8();const I8=hC($8),D8={},vA=e=>{let n;const r=new Set,s=(p,d)=>{const g=typeof p=="function"?p(n):p;if(!Object.is(g,n)){const y=n;n=d??(typeof g!="object"||g===null)?g:Object.assign({},n,g),r.forEach(E=>E(n,y))}},a=()=>n,h={setState:s,getState:a,getInitialState:()=>f,subscribe:p=>(r.add(p),()=>r.delete(p)),destroy:()=>{(D8?"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."),r.clear()}},f=n=e(s,a,h);return h},k8=e=>e?vA(e):vA,{useDebugValue:B8}=Ga,{useSyncExternalStoreWithSelector:P8}=I8,z8=e=>e;function bk(e,n=z8,r){const s=P8(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,r);return B8(s),s}const bA=(e,n)=>{const r=k8(e),s=(a,o=n)=>bk(r,a,o);return Object.assign(s,r),s},U8=(e,n)=>e?bA(e,n):bA;function ht(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[s,a]of e)if(!Object.is(a,n.get(s)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const s of e)if(!n.has(s))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(n).length)return!1;for(const s of r)if(!Object.prototype.hasOwnProperty.call(n,s)||!Object.is(e[s],n[s]))return!1;return!0}qI();const ah=te.createContext(null),Q8=ah.Provider,_k=vr.error001();function Ve(e,n){const r=te.useContext(ah);if(r===null)throw new Error(_k);return bk(r,e,n)}function dt(){const e=te.useContext(ah);if(e===null)throw new Error(_k);return te.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const _A={display:"none"},H8={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},wk="react-flow__node-desc",Ek="react-flow__edge-desc",V8="react-flow__aria-live",F8=e=>e.ariaLiveMessage,G8=e=>e.ariaLabelConfig;function K8({rfId:e}){const n=Ve(F8);return F.jsx("div",{id:`${V8}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:H8,children:n})}function Y8({rfId:e,disableKeyboardA11y:n}){const r=Ve(G8);return F.jsxs(F.Fragment,{children:[F.jsx("div",{id:`${wk}-${e}`,style:_A,children:n?r["node.a11yDescription.default"]:r["node.a11yDescription.keyboardDisabled"]}),F.jsx("div",{id:`${Ek}-${e}`,style:_A,children:r["edge.a11yDescription.default"]}),!n&&F.jsx(K8,{rfId:e})]})}const oh=te.forwardRef(({position:e="top-left",children:n,className:r,style:s,...a},o)=>{const l=`${e}`.split("-");return F.jsx("div",{className:jt(["react-flow__panel",r,...l]),style:s,ref:o,...a,children:n})});oh.displayName="Panel";function X8({proOptions:e,position:n="bottom-right"}){return e!=null&&e.hideAttribution?null:F.jsx(oh,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:F.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const W8=e=>{const n=[],r=[];for(const[,s]of e.nodeLookup)s.selected&&n.push(s.internals.userNode);for(const[,s]of e.edgeLookup)s.selected&&r.push(s);return{selectedNodes:n,selectedEdges:r}},ff=e=>e.id;function J8(e,n){return ht(e.selectedNodes.map(ff),n.selectedNodes.map(ff))&&ht(e.selectedEdges.map(ff),n.selectedEdges.map(ff))}function Z8({onSelectionChange:e}){const n=dt(),{selectedNodes:r,selectedEdges:s}=Ve(W8,J8);return te.useEffect(()=>{const a={nodes:r,edges:s};e==null||e(a),n.getState().onSelectionChangeHandlers.forEach(o=>o(a))},[r,s,e]),null}const eV=e=>!!e.onSelectionChangeHandlers;function tV({onSelectionChange:e}){const n=Ve(eV);return e||n?F.jsx(Z8,{onSelectionChange:e}):null}const Ck=[0,0],nV={x:0,y:0,zoom:1},rV=["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"],wA=[...rV,"rfId"],iV=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),EA={translateExtent:Gu,nodeOrigin:Ck,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function sV(e){const{setNodes:n,setEdges:r,setMinZoom:s,setMaxZoom:a,setTranslateExtent:o,setNodeExtent:l,reset:u,setDefaultNodesAndEdges:h}=Ve(iV,ht),f=dt();te.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{p.current=EA,u()}),[]);const p=te.useRef(EA);return te.useEffect(()=>{for(const d of wA){const g=e[d],y=p.current[d];g!==y&&(typeof e[d]>"u"||(d==="nodes"?n(g):d==="edges"?r(g):d==="minZoom"?s(g):d==="maxZoom"?a(g):d==="translateExtent"?o(g):d==="nodeExtent"?l(g):d==="ariaLabelConfig"?f.setState({ariaLabelConfig:P5(g)}):d==="fitView"?f.setState({fitViewQueued:g}):d==="fitViewOptions"?f.setState({fitViewOptions:g}):f.setState({[d]:g})))}p.current=e},wA.map(d=>e[d])),null}function CA(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function aV(e){var s;const[n,r]=te.useState(e==="system"?null:e);return te.useEffect(()=>{if(e!=="system"){r(e);return}const a=CA(),o=()=>r(a!=null&&a.matches?"dark":"light");return o(),a==null||a.addEventListener("change",o),()=>{a==null||a.removeEventListener("change",o)}},[e]),n!==null?n:(s=CA())!=null&&s.matches?"dark":"light"}const xA=typeof document<"u"?document:null;function Wu(e=null,n={target:xA,actInsideInputWithModifier:!0}){const[r,s]=te.useState(!1),a=te.useRef(!1),o=te.useRef(new Set([])),[l,u]=te.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
66
+ `).replace(`
67
+
68
+ `,`
69
+ +`).split(`
70
+ `)),p=f.reduce((d,g)=>d.concat(...g),[]);return[f,p]}return[[],[]]},[e]);return te.useEffect(()=>{const h=(n==null?void 0:n.target)??xA,f=(n==null?void 0:n.actInsideInputWithModifier)??!0;if(e!==null){const p=y=>{var v,b;if(a.current=y.ctrlKey||y.metaKey||y.shiftKey||y.altKey,(!a.current||a.current&&!f)&&nk(y))return!1;const x=TA(y.code,u);if(o.current.add(y[x]),SA(l,o.current,!1)){const w=((b=(v=y.composedPath)==null?void 0:v.call(y))==null?void 0:b[0])||y.target,C=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";n.preventDefault!==!1&&(a.current||!C)&&y.preventDefault(),s(!0)}},d=y=>{const E=TA(y.code,u);SA(l,o.current,!0)?(s(!1),o.current.clear()):o.current.delete(y[E]),y.key==="Meta"&&o.current.clear(),a.current=!1},g=()=>{o.current.clear(),s(!1)};return h==null||h.addEventListener("keydown",p),h==null||h.addEventListener("keyup",d),window.addEventListener("blur",g),window.addEventListener("contextmenu",g),()=>{h==null||h.removeEventListener("keydown",p),h==null||h.removeEventListener("keyup",d),window.removeEventListener("blur",g),window.removeEventListener("contextmenu",g)}}},[e,s]),r}function SA(e,n,r){return e.filter(s=>r||s.length===n.size).some(s=>s.every(a=>n.has(a)))}function TA(e,n){return n.includes(e)?"code":"key"}const oV=()=>{const e=dt();return te.useMemo(()=>({zoomIn:n=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1.2,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},zoomOut:n=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1/1.2,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},zoomTo:(n,r)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(n,{duration:r==null?void 0:r.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(n,r)=>{const{transform:[s,a,o],panZoom:l}=e.getState();return l?(await l.setViewport({x:n.x??s,y:n.y??a,zoom:n.zoom??o},r),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[n,r,s]=e.getState().transform;return{x:n,y:r,zoom:s}},setCenter:async(n,r,s)=>e.getState().setCenter(n,r,s),fitBounds:async(n,r)=>{const{width:s,height:a,minZoom:o,maxZoom:l,panZoom:u}=e.getState(),h=OC(n,s,a,o,l,(r==null?void 0:r.padding)??.1);return u?(await u.setViewport(h,{duration:r==null?void 0:r.duration,ease:r==null?void 0:r.ease,interpolate:r==null?void 0:r.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(n,r={})=>{const{transform:s,snapGrid:a,snapToGrid:o,domNode:l}=e.getState();if(!l)return n;const{x:u,y:h}=l.getBoundingClientRect(),f={x:n.x-u,y:n.y-h},p=r.snapGrid??a,d=r.snapToGrid??o;return yl(f,s,d,p)},flowToScreenPosition:n=>{const{transform:r,domNode:s}=e.getState();if(!s)return n;const{x:a,y:o}=s.getBoundingClientRect(),l=Qf(n,r);return{x:l.x+a,y:l.y+o}}}),[])};function xk(e,n){const r=[],s=new Map,a=[];for(const o of e)if(o.type==="add"){a.push(o);continue}else if(o.type==="remove"||o.type==="replace")s.set(o.id,[o]);else{const l=s.get(o.id);l?l.push(o):s.set(o.id,[o])}for(const o of n){const l=s.get(o.id);if(!l){r.push(o);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){r.push({...l[0].item});continue}const u={...o};for(const h of l)uV(h,u);r.push(u)}return a.length&&a.forEach(o=>{o.index!==void 0?r.splice(o.index,0,{...o.item}):r.push({...o.item})}),r}function uV(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function Sk(e,n){return xk(e,n)}function Tk(e,n){return xk(e,n)}function ws(e,n){return{id:e,type:"select",selected:n}}function Ya(e,n=new Set,r=!1){const s=[];for(const[a,o]of e){const l=n.has(a);!(o.selected===void 0&&!l)&&o.selected!==l&&(r&&(o.selected=l),s.push(ws(o.id,l)))}return s}function qA({items:e=[],lookup:n}){var a;const r=[],s=new Map(e.map(o=>[o.id,o]));for(const[o,l]of e.entries()){const u=n.get(l.id),h=((a=u==null?void 0:u.internals)==null?void 0:a.userNode)??u;h!==void 0&&h!==l&&r.push({id:l.id,item:l,type:"replace"}),h===void 0&&r.push({item:l,type:"add",index:o})}for(const[o]of n)s.get(o)===void 0&&r.push({id:o,type:"remove"});return r}function AA(e){return{id:e.id,type:"remove"}}const NA=e=>R5(e),lV=e=>KD(e);function qk(e){return te.forwardRef(e)}const cV=typeof window<"u"?te.useLayoutEffect:te.useEffect;function RA(e){const[n,r]=te.useState(BigInt(0)),[s]=te.useState(()=>fV(()=>r(a=>a+BigInt(1))));return cV(()=>{const a=s.get();a.length&&(e(a),s.reset())},[n]),s}function fV(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:r=>{n.push(r),e()}}}const Ak=te.createContext(null);function hV({children:e}){const n=dt(),r=te.useCallback(u=>{const{nodes:h=[],setNodes:f,hasDefaultNodes:p,onNodesChange:d,nodeLookup:g,fitViewQueued:y,onNodesChangeMiddlewareMap:E}=n.getState();let x=h;for(const b of u)x=typeof b=="function"?b(x):b;let v=qA({items:x,lookup:g});for(const b of E.values())v=b(v);p&&f(x),v.length>0?d==null||d(v):y&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:w,setNodes:C}=n.getState();b&&C(w)})},[]),s=RA(r),a=te.useCallback(u=>{const{edges:h=[],setEdges:f,hasDefaultEdges:p,onEdgesChange:d,edgeLookup:g}=n.getState();let y=h;for(const E of u)y=typeof E=="function"?E(y):E;p?f(y):d&&d(qA({items:y,lookup:g}))},[]),o=RA(a),l=te.useMemo(()=>({nodeQueue:s,edgeQueue:o}),[]);return F.jsx(Ak.Provider,{value:l,children:e})}function dV(){const e=te.useContext(Ak);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const pV=e=>!!e.panZoom;function kC(){const e=oV(),n=dt(),r=dV(),s=Ve(pV),a=te.useMemo(()=>{const o=d=>n.getState().nodeLookup.get(d),l=d=>{r.nodeQueue.push(d)},u=d=>{r.edgeQueue.push(d)},h=d=>{var b,w;const{nodeLookup:g,nodeOrigin:y}=n.getState(),E=NA(d)?d:g.get(d.id),x=E.parentId?ek(E.position,E.measured,E.parentId,g,y):E.position,v={...E,position:x,width:((b=E.measured)==null?void 0:b.width)??E.width,height:((w=E.measured)==null?void 0:w.height)??E.height};return vo(v)},f=(d,g,y={replace:!1})=>{l(E=>E.map(x=>{if(x.id===d){const v=typeof g=="function"?g(x):g;return y.replace&&NA(v)?v:{...x,...v}}return x}))},p=(d,g,y={replace:!1})=>{u(E=>E.map(x=>{if(x.id===d){const v=typeof g=="function"?g(x):g;return y.replace&&lV(v)?v:{...x,...v}}return x}))};return{getNodes:()=>n.getState().nodes.map(d=>({...d})),getNode:d=>{var g;return(g=o(d))==null?void 0:g.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:d=[]}=n.getState();return d.map(g=>({...g}))},getEdge:d=>n.getState().edgeLookup.get(d),setNodes:l,setEdges:u,addNodes:d=>{const g=Array.isArray(d)?d:[d];r.nodeQueue.push(y=>[...y,...g])},addEdges:d=>{const g=Array.isArray(d)?d:[d];r.edgeQueue.push(y=>[...y,...g])},toObject:()=>{const{nodes:d=[],edges:g=[],transform:y}=n.getState(),[E,x,v]=y;return{nodes:d.map(b=>({...b})),edges:g.map(b=>({...b})),viewport:{x:E,y:x,zoom:v}}},deleteElements:async({nodes:d=[],edges:g=[]})=>{const{nodes:y,edges:E,onNodesDelete:x,onEdgesDelete:v,triggerNodeChanges:b,triggerEdgeChanges:w,onDelete:C,onBeforeDelete:T}=n.getState(),{nodes:A,edges:N}=await $5({nodesToRemove:d,edgesToRemove:g,nodes:y,edges:E,onBeforeDelete:T}),O=N.length>0,I=A.length>0;if(O){const k=N.map(AA);v==null||v(N),w(k)}if(I){const k=A.map(AA);x==null||x(A),b(k)}return(I||O)&&(C==null||C({nodes:A,edges:N})),{deletedNodes:A,deletedEdges:N}},getIntersectingNodes:(d,g=!0,y)=>{const E=tA(d),x=E?d:h(d),v=y!==void 0;return x?(y||n.getState().nodes).filter(b=>{const w=n.getState().nodeLookup.get(b.id);if(w&&!E&&(b.id===d.id||!w.internals.positionAbsolute))return!1;const C=vo(v?b:w),T=Yu(C,x);return g&&T>0||T>=C.width*C.height||T>=x.width*x.height}):[]},isNodeIntersecting:(d,g,y=!0)=>{const x=tA(d)?d:h(d);if(!x)return!1;const v=Yu(x,g);return y&&v>0||v>=g.width*g.height||v>=x.width*x.height},updateNode:f,updateNodeData:(d,g,y={replace:!1})=>{f(d,E=>{const x=typeof g=="function"?g(E):g;return y.replace?{...E,data:x}:{...E,data:{...E.data,...x}}},y)},updateEdge:p,updateEdgeData:(d,g,y={replace:!1})=>{p(d,E=>{const x=typeof g=="function"?g(E):g;return y.replace?{...E,data:x}:{...E,data:{...E.data,...x}}},y)},getNodesBounds:d=>{const{nodeLookup:g,nodeOrigin:y}=n.getState();return O5(d,{nodeLookup:g,nodeOrigin:y})},getHandleConnections:({type:d,id:g,nodeId:y})=>{var E;return Array.from(((E=n.getState().connectionLookup.get(`${y}-${d}${g?`-${g}`:""}`))==null?void 0:E.values())??[])},getNodeConnections:({type:d,handleId:g,nodeId:y})=>{var E;return Array.from(((E=n.getState().connectionLookup.get(`${y}${d?g?`-${d}-${g}`:`-${d}`:""}`))==null?void 0:E.values())??[])},fitView:async d=>{const g=n.getState().fitViewResolver??B5();return n.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:g}),r.nodeQueue.push(y=>[...y]),g.promise}}},[]);return te.useMemo(()=>({...a,...e,viewportInitialized:s}),[s])}const OA=e=>e.selected,mV=typeof window<"u"?window:void 0;function gV({deleteKeyCode:e,multiSelectionKeyCode:n}){const r=dt(),{deleteElements:s}=kC(),a=Wu(e,{actInsideInputWithModifier:!1}),o=Wu(n,{target:mV});te.useEffect(()=>{if(a){const{edges:l,nodes:u}=r.getState();s({nodes:u.filter(OA),edges:l.filter(OA)}),r.setState({nodesSelectionActive:!1})}},[a]),te.useEffect(()=>{r.setState({multiSelectionActive:o})},[o])}function yV(e){const n=dt();te.useEffect(()=>{const r=()=>{var a,o,l,u;if(!e.current||!(((o=(a=e.current).checkVisibility)==null?void 0:o.call(a))??!0))return!1;const s=MC(e.current);(s.height===0||s.width===0)&&((u=(l=n.getState()).onError)==null||u.call(l,"004",vr.error004())),n.setState({width:s.width||500,height:s.height||500})};if(e.current){r(),window.addEventListener("resize",r);const s=new ResizeObserver(()=>r());return s.observe(e.current),()=>{window.removeEventListener("resize",r),s&&e.current&&s.unobserve(e.current)}}},[])}const uh={position:"absolute",width:"100%",height:"100%",top:0,left:0},vV=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function bV({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:r=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:o=Ls.Free,zoomOnDoubleClick:l=!0,panOnDrag:u=!0,defaultViewport:h,translateExtent:f,minZoom:p,maxZoom:d,zoomActivationKeyCode:g,preventScrolling:y=!0,children:E,noWheelClassName:x,noPanClassName:v,onViewportChange:b,isControlledViewport:w,paneClickDistance:C,selectionOnDrag:T}){const A=dt(),N=te.useRef(null),{userSelectionActive:O,lib:I,connectionInProgress:k}=Ve(vV,ht),R=Wu(g),M=te.useRef();yV(N);const D=te.useCallback(z=>{b==null||b({x:z[0],y:z[1],zoom:z[2]}),w||A.setState({transform:z})},[b,w]);return te.useEffect(()=>{if(N.current){M.current=E8({domNode:N.current,minZoom:p,maxZoom:d,translateExtent:f,viewport:h,onDraggingChange:L=>A.setState({paneDragging:L}),onPanZoomStart:(L,P)=>{const{onViewportChangeStart:H,onMoveStart:G}=A.getState();G==null||G(L,P),H==null||H(P)},onPanZoom:(L,P)=>{const{onViewportChange:H,onMove:G}=A.getState();G==null||G(L,P),H==null||H(P)},onPanZoomEnd:(L,P)=>{const{onViewportChangeEnd:H,onMoveEnd:G}=A.getState();G==null||G(L,P),H==null||H(P)}});const{x:z,y:q,zoom:j}=M.current.getViewport();return A.setState({panZoom:M.current,transform:[z,q,j],domNode:N.current.closest(".react-flow")}),()=>{var L;(L=M.current)==null||L.destroy()}}},[]),te.useEffect(()=>{var z;(z=M.current)==null||z.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:r,panOnScroll:s,panOnScrollSpeed:a,panOnScrollMode:o,zoomOnDoubleClick:l,panOnDrag:u,zoomActivationKeyPressed:R,preventScrolling:y,noPanClassName:v,userSelectionActive:O,noWheelClassName:x,lib:I,onTransformChange:D,connectionInProgress:k,selectionOnDrag:T,paneClickDistance:C})},[e,n,r,s,a,o,l,u,R,y,v,O,x,I,D,k,T,C]),F.jsx("div",{className:"react-flow__renderer",ref:N,style:uh,children:E})}const _V=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function wV(){const{userSelectionActive:e,userSelectionRect:n}=Ve(_V,ht);return e&&n?F.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const pm=(e,n)=>r=>{r.target===n.current&&(e==null||e(r))},EV=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function CV({isSelecting:e,selectionKeyPressed:n,selectionMode:r=Ku.Full,panOnDrag:s,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:l,onSelectionEnd:u,onPaneClick:h,onPaneContextMenu:f,onPaneScroll:p,onPaneMouseEnter:d,onPaneMouseMove:g,onPaneMouseLeave:y,children:E}){const x=dt(),{userSelectionActive:v,elementsSelectable:b,dragging:w,connectionInProgress:C}=Ve(EV,ht),T=b&&(e||v),A=te.useRef(null),N=te.useRef(),O=te.useRef(new Set),I=te.useRef(new Set),k=te.useRef(!1),R=H=>{if(k.current||C){k.current=!1;return}h==null||h(H),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},M=H=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){H.preventDefault();return}f==null||f(H)},D=p?H=>p(H):void 0,z=H=>{k.current&&(H.stopPropagation(),k.current=!1)},q=H=>{var J,ie;const{domNode:G}=x.getState();if(N.current=G==null?void 0:G.getBoundingClientRect(),!N.current)return;const V=H.target===A.current;if(!V&&!!H.target.closest(".nokey")||!e||!(o&&V||n)||H.button!==0||!H.isPrimary)return;(ie=(J=H.target)==null?void 0:J.setPointerCapture)==null||ie.call(J,H.pointerId),k.current=!1;const{x:ne,y:Q}=Jn(H.nativeEvent,N.current);x.setState({userSelectionRect:{width:0,height:0,startX:ne,startY:Q,x:ne,y:Q}}),V||(H.stopPropagation(),H.preventDefault())},j=H=>{const{userSelectionRect:G,transform:V,nodeLookup:B,edgeLookup:K,connectionLookup:ne,triggerNodeChanges:Q,triggerEdgeChanges:J,defaultEdgeOptions:ie,resetSelectedElements:oe}=x.getState();if(!N.current||!G)return;const{x:ee,y:fe}=Jn(H.nativeEvent,N.current),{startX:be,startY:ve}=G;if(!k.current){const xe=n?0:a;if(Math.hypot(ee-be,fe-ve)<=xe)return;oe(),l==null||l(H)}k.current=!0;const _e={startX:be,startY:ve,x:ee<be?ee:be,y:fe<ve?fe:ve,width:Math.abs(ee-be),height:Math.abs(fe-ve)},we=O.current,W=I.current;O.current=new Set(RC(B,_e,V,r===Ku.Partial,!0).map(xe=>xe.id)),I.current=new Set;const ae=(ie==null?void 0:ie.selectable)??!0;for(const xe of O.current){const Se=ne.get(xe);if(Se)for(const{edgeId:gt}of Se.values()){const ut=K.get(gt);ut&&(ut.selectable??ae)&&I.current.add(gt)}}if(!nA(we,O.current)){const xe=Ya(B,O.current,!0);Q(xe)}if(!nA(W,I.current)){const xe=Ya(K,I.current);J(xe)}x.setState({userSelectionRect:_e,userSelectionActive:!0,nodesSelectionActive:!1})},L=H=>{var G,V;H.button===0&&((V=(G=H.target)==null?void 0:G.releasePointerCapture)==null||V.call(G,H.pointerId),!v&&H.target===A.current&&x.getState().userSelectionRect&&(R==null||R(H)),x.setState({userSelectionActive:!1,userSelectionRect:null}),k.current&&(u==null||u(H),x.setState({nodesSelectionActive:O.current.size>0})))},P=s===!0||Array.isArray(s)&&s.includes(0);return F.jsxs("div",{className:jt(["react-flow__pane",{draggable:P,dragging:w,selection:e}]),onClick:T?void 0:pm(R,A),onContextMenu:pm(M,A),onWheel:pm(D,A),onPointerEnter:T?void 0:d,onPointerMove:T?j:g,onPointerUp:T?L:void 0,onPointerDownCapture:T?q:void 0,onClickCapture:T?z:void 0,onPointerLeave:y,ref:A,style:uh,children:[E,F.jsx(wV,{})]})}function uC({id:e,store:n,unselect:r=!1,nodeRef:s}){const{addSelectedNodes:a,unselectNodesAndEdges:o,multiSelectionActive:l,nodeLookup:u,onError:h}=n.getState(),f=u.get(e);if(!f){h==null||h("012",vr.error012(e));return}n.setState({nodesSelectionActive:!1}),f.selected?(r||f.selected&&l)&&(o({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var p;return(p=s==null?void 0:s.current)==null?void 0:p.blur()})):a([e])}function Nk({nodeRef:e,disabled:n=!1,noDragClassName:r,handleSelector:s,nodeId:a,isSelectable:o,nodeClickDistance:l}){const u=dt(),[h,f]=te.useState(!1),p=te.useRef();return te.useEffect(()=>{p.current=u8({getStoreItems:()=>u.getState(),onNodeMouseDown:d=>{uC({id:d,store:u,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),te.useEffect(()=>{var d,g;if(n)(d=p.current)==null||d.destroy();else if(e.current)return(g=p.current)==null||g.update({noDragClassName:r,handleSelector:s,domNode:e.current,isSelectable:o,nodeId:a,nodeClickDistance:l}),()=>{var y;(y=p.current)==null||y.destroy()}},[r,s,n,o,e,a]),h}const xV=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function Rk(){const e=dt();return te.useCallback(r=>{const{nodeExtent:s,snapToGrid:a,snapGrid:o,nodesDraggable:l,onError:u,updateNodePositions:h,nodeLookup:f,nodeOrigin:p}=e.getState(),d=new Map,g=xV(l),y=a?o[0]:5,E=a?o[1]:5,x=r.direction.x*y*r.factor,v=r.direction.y*E*r.factor;for(const[,b]of f){if(!g(b))continue;let w={x:b.internals.positionAbsolute.x+x,y:b.internals.positionAbsolute.y+v};a&&(w=gl(w,o));const{position:C,positionAbsolute:T}=YD({nodeId:b.id,nextPosition:w,nodeLookup:f,nodeExtent:s,nodeOrigin:p,onError:u});b.position=C,b.internals.positionAbsolute=T,d.set(b.id,b)}h(d)},[])}const BC=te.createContext(null),SV=BC.Provider;BC.Consumer;const Ok=()=>te.useContext(BC),TV=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),qV=(e,n,r)=>s=>{const{connectionClickStartHandle:a,connectionMode:o,connection:l}=s,{fromHandle:u,toHandle:h,isValid:f}=l,p=(h==null?void 0:h.nodeId)===e&&(h==null?void 0:h.id)===n&&(h==null?void 0:h.type)===r;return{connectingFrom:(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===n&&(u==null?void 0:u.type)===r,connectingTo:p,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===n&&(a==null?void 0:a.type)===r,isPossibleEndHandle:o===go.Strict?(u==null?void 0:u.type)!==r:e!==(u==null?void 0:u.nodeId)||n!==(u==null?void 0:u.id),connectionInProcess:!!u,clickConnectionInProcess:!!a,valid:p&&f}};function AV({type:e="source",position:n=Ne.Top,isValidConnection:r,isConnectable:s=!0,isConnectableStart:a=!0,isConnectableEnd:o=!0,id:l,onConnect:u,children:h,className:f,onMouseDown:p,onTouchStart:d,...g},y){var j,L;const E=l||null,x=e==="target",v=dt(),b=Ok(),{connectOnClick:w,noPanClassName:C,rfId:T}=Ve(TV,ht),{connectingFrom:A,connectingTo:N,clickConnecting:O,isPossibleEndHandle:I,connectionInProcess:k,clickConnectionInProcess:R,valid:M}=Ve(qV(b,E,e),ht);b||(L=(j=v.getState()).onError)==null||L.call(j,"010",vr.error010());const D=P=>{const{defaultEdgeOptions:H,onConnect:G,hasDefaultEdges:V}=v.getState(),B={...H,...P};if(V){const{edges:K,setEdges:ne}=v.getState();ne(F5(B,K))}G==null||G(B),u==null||u(B)},z=P=>{if(!b)return;const H=rk(P.nativeEvent);if(a&&(H&&P.button===0||!H)){const G=v.getState();oC.onPointerDown(P.nativeEvent,{handleDomNode:P.currentTarget,autoPanOnConnect:G.autoPanOnConnect,connectionMode:G.connectionMode,connectionRadius:G.connectionRadius,domNode:G.domNode,nodeLookup:G.nodeLookup,lib:G.lib,isTarget:x,handleId:E,nodeId:b,flowId:G.rfId,panBy:G.panBy,cancelConnection:G.cancelConnection,onConnectStart:G.onConnectStart,onConnectEnd:G.onConnectEnd,updateConnection:G.updateConnection,onConnect:D,isValidConnection:r||G.isValidConnection,getTransform:()=>v.getState().transform,getFromHandle:()=>v.getState().connection.fromHandle,autoPanSpeed:G.autoPanSpeed,dragThreshold:G.connectionDragThreshold})}H?p==null||p(P):d==null||d(P)},q=P=>{const{onClickConnectStart:H,onClickConnectEnd:G,connectionClickStartHandle:V,connectionMode:B,isValidConnection:K,lib:ne,rfId:Q,nodeLookup:J,connection:ie}=v.getState();if(!b||!V&&!a)return;if(!V){H==null||H(P.nativeEvent,{nodeId:b,handleId:E,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:b,type:e,id:E}});return}const oe=tk(P.target),ee=r||K,{connection:fe,isValid:be}=oC.isValid(P.nativeEvent,{handle:{nodeId:b,id:E,type:e},connectionMode:B,fromNodeId:V.nodeId,fromHandleId:V.id||null,fromType:V.type,isValidConnection:ee,flowId:Q,doc:oe,lib:ne,nodeLookup:J});be&&fe&&D(fe);const ve=structuredClone(ie);delete ve.inProgress,ve.toPosition=ve.toHandle?ve.toHandle.position:null,G==null||G(P,ve),v.setState({connectionClickStartHandle:null})};return F.jsx("div",{"data-handleid":E,"data-nodeid":b,"data-handlepos":n,"data-id":`${T}-${b}-${E}-${e}`,className:jt(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",C,f,{source:!x,target:x,connectable:s,connectablestart:a,connectableend:o,clickconnecting:O,connectingfrom:A,connectingto:N,valid:M,connectionindicator:s&&(!k||I)&&(k||R?o:a)}]),onMouseDown:z,onTouchStart:z,onClick:w?q:void 0,ref:y,...g,children:h})}const br=te.memo(qk(AV));function NV({data:e,isConnectable:n,sourcePosition:r=Ne.Bottom}){return F.jsxs(F.Fragment,{children:[e==null?void 0:e.label,F.jsx(br,{type:"source",position:r,isConnectable:n})]})}function RV({data:e,isConnectable:n,targetPosition:r=Ne.Top,sourcePosition:s=Ne.Bottom}){return F.jsxs(F.Fragment,{children:[F.jsx(br,{type:"target",position:r,isConnectable:n}),e==null?void 0:e.label,F.jsx(br,{type:"source",position:s,isConnectable:n})]})}function OV(){return null}function MV({data:e,isConnectable:n,targetPosition:r=Ne.Top}){return F.jsxs(F.Fragment,{children:[F.jsx(br,{type:"target",position:r,isConnectable:n}),e==null?void 0:e.label]})}const Hf={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},MA={input:NV,default:RV,output:MV,group:OV};function jV(e){var n,r,s,a;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((n=e.style)==null?void 0:n.width),height:e.height??e.initialHeight??((r=e.style)==null?void 0:r.height)}:{width:e.width??((s=e.style)==null?void 0:s.width),height:e.height??((a=e.style)==null?void 0:a.height)}}const LV=e=>{const{width:n,height:r,x:s,y:a}=ml(e.nodeLookup,{filter:o=>!!o.selected});return{width:Wn(n)?n:null,height:Wn(r)?r:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${a}px)`}};function $V({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:r}){const s=dt(),{width:a,height:o,transformString:l,userSelectionActive:u}=Ve(LV,ht),h=Rk(),f=te.useRef(null);if(te.useEffect(()=>{var g;r||(g=f.current)==null||g.focus({preventScroll:!0})},[r]),Nk({nodeRef:f}),u||!a||!o)return null;const p=e?g=>{const y=s.getState().nodes.filter(E=>E.selected);e(g,y)}:void 0,d=g=>{Object.prototype.hasOwnProperty.call(Hf,g.key)&&(g.preventDefault(),h({direction:Hf[g.key],factor:g.shiftKey?4:1}))};return F.jsx("div",{className:jt(["react-flow__nodesselection","react-flow__container",n]),style:{transform:l},children:F.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:r?void 0:-1,onKeyDown:r?void 0:d,style:{width:a,height:o}})})}const jA=typeof window<"u"?window:void 0,IV=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Mk({children:e,onPaneClick:n,onPaneMouseEnter:r,onPaneMouseMove:s,onPaneMouseLeave:a,onPaneContextMenu:o,onPaneScroll:l,paneClickDistance:u,deleteKeyCode:h,selectionKeyCode:f,selectionOnDrag:p,selectionMode:d,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:E,panActivationKeyCode:x,zoomActivationKeyCode:v,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:C,panOnScroll:T,panOnScrollSpeed:A,panOnScrollMode:N,zoomOnDoubleClick:O,panOnDrag:I,defaultViewport:k,translateExtent:R,minZoom:M,maxZoom:D,preventScrolling:z,onSelectionContextMenu:q,noWheelClassName:j,noPanClassName:L,disableKeyboardA11y:P,onViewportChange:H,isControlledViewport:G}){const{nodesSelectionActive:V,userSelectionActive:B}=Ve(IV,ht),K=Wu(f,{target:jA}),ne=Wu(x,{target:jA}),Q=ne||I,J=ne||T,ie=p&&Q!==!0,oe=K||B||ie;return gV({deleteKeyCode:h,multiSelectionKeyCode:E}),F.jsx(bV,{onPaneContextMenu:o,elementsSelectable:b,zoomOnScroll:w,zoomOnPinch:C,panOnScroll:J,panOnScrollSpeed:A,panOnScrollMode:N,zoomOnDoubleClick:O,panOnDrag:!K&&Q,defaultViewport:k,translateExtent:R,minZoom:M,maxZoom:D,zoomActivationKeyCode:v,preventScrolling:z,noWheelClassName:j,noPanClassName:L,onViewportChange:H,isControlledViewport:G,paneClickDistance:u,selectionOnDrag:ie,children:F.jsxs(CV,{onSelectionStart:g,onSelectionEnd:y,onPaneClick:n,onPaneMouseEnter:r,onPaneMouseMove:s,onPaneMouseLeave:a,onPaneContextMenu:o,onPaneScroll:l,panOnDrag:Q,isSelecting:!!oe,selectionMode:d,selectionKeyPressed:K,paneClickDistance:u,selectionOnDrag:ie,children:[e,V&&F.jsx($V,{onSelectionContextMenu:q,noPanClassName:L,disableKeyboardA11y:P})]})})}Mk.displayName="FlowRenderer";const DV=te.memo(Mk),kV=e=>n=>e?RC(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(r=>r.id):Array.from(n.nodeLookup.keys());function BV(e){return Ve(te.useCallback(kV(e),[e]),ht)}const PV=e=>e.updateNodeInternals;function zV(){const e=Ve(PV),[n]=te.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(r=>{const s=new Map;r.forEach(a=>{const o=a.target.getAttribute("data-id");s.set(o,{id:o,nodeElement:a.target,force:!0})}),e(s)}));return te.useEffect(()=>()=>{n==null||n.disconnect()},[n]),n}function UV({node:e,nodeType:n,hasDimensions:r,resizeObserver:s}){const a=dt(),o=te.useRef(null),l=te.useRef(null),u=te.useRef(e.sourcePosition),h=te.useRef(e.targetPosition),f=te.useRef(n),p=r&&!!e.internals.handleBounds;return te.useEffect(()=>{o.current&&!e.hidden&&(!p||l.current!==o.current)&&(l.current&&(s==null||s.unobserve(l.current)),s==null||s.observe(o.current),l.current=o.current)},[p,e.hidden]),te.useEffect(()=>()=>{l.current&&(s==null||s.unobserve(l.current),l.current=null)},[]),te.useEffect(()=>{if(o.current){const d=f.current!==n,g=u.current!==e.sourcePosition,y=h.current!==e.targetPosition;(d||g||y)&&(f.current=n,u.current=e.sourcePosition,h.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),o}function QV({id:e,onClick:n,onMouseEnter:r,onMouseMove:s,onMouseLeave:a,onContextMenu:o,onDoubleClick:l,nodesDraggable:u,elementsSelectable:h,nodesConnectable:f,nodesFocusable:p,resizeObserver:d,noDragClassName:g,noPanClassName:y,disableKeyboardA11y:E,rfId:x,nodeTypes:v,nodeClickDistance:b,onError:w}){const{node:C,internals:T,isParent:A}=Ve(ee=>{const fe=ee.nodeLookup.get(e),be=ee.parentLookup.has(e);return{node:fe,internals:fe.internals,isParent:be}},ht);let N=C.type||"default",O=(v==null?void 0:v[N])||MA[N];O===void 0&&(w==null||w("003",vr.error003(N)),N="default",O=(v==null?void 0:v.default)||MA.default);const I=!!(C.draggable||u&&typeof C.draggable>"u"),k=!!(C.selectable||h&&typeof C.selectable>"u"),R=!!(C.connectable||f&&typeof C.connectable>"u"),M=!!(C.focusable||p&&typeof C.focusable>"u"),D=dt(),z=ZD(C),q=UV({node:C,nodeType:N,hasDimensions:z,resizeObserver:d}),j=Nk({nodeRef:q,disabled:C.hidden||!I,noDragClassName:g,handleSelector:C.dragHandle,nodeId:e,isSelectable:k,nodeClickDistance:b}),L=Rk();if(C.hidden)return null;const P=Zr(C),H=jV(C),G=k||I||n||r||s||a,V=r?ee=>r(ee,{...T.userNode}):void 0,B=s?ee=>s(ee,{...T.userNode}):void 0,K=a?ee=>a(ee,{...T.userNode}):void 0,ne=o?ee=>o(ee,{...T.userNode}):void 0,Q=l?ee=>l(ee,{...T.userNode}):void 0,J=ee=>{const{selectNodesOnDrag:fe,nodeDragThreshold:be}=D.getState();k&&(!fe||!I||be>0)&&uC({id:e,store:D,nodeRef:q}),n&&n(ee,{...T.userNode})},ie=ee=>{if(!(nk(ee.nativeEvent)||E)){if(HD.includes(ee.key)&&k){const fe=ee.key==="Escape";uC({id:e,store:D,unselect:fe,nodeRef:q})}else if(I&&C.selected&&Object.prototype.hasOwnProperty.call(Hf,ee.key)){ee.preventDefault();const{ariaLabelConfig:fe}=D.getState();D.setState({ariaLiveMessage:fe["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~T.positionAbsolute.x,y:~~T.positionAbsolute.y})}),L({direction:Hf[ee.key],factor:ee.shiftKey?4:1})}}},oe=()=>{var W;if(E||!((W=q.current)!=null&&W.matches(":focus-visible")))return;const{transform:ee,width:fe,height:be,autoPanOnNodeFocus:ve,setCenter:_e}=D.getState();if(!ve)return;RC(new Map([[e,C]]),{x:0,y:0,width:fe,height:be},ee,!0).length>0||_e(C.position.x+P.width/2,C.position.y+P.height/2,{zoom:ee[2]})};return F.jsx("div",{className:jt(["react-flow__node",`react-flow__node-${N}`,{[y]:I},C.className,{selected:C.selected,selectable:k,parent:A,draggable:I,dragging:j}]),ref:q,style:{zIndex:T.z,transform:`translate(${T.positionAbsolute.x}px,${T.positionAbsolute.y}px)`,pointerEvents:G?"all":"none",visibility:z?"visible":"hidden",...C.style,...H},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:V,onMouseMove:B,onMouseLeave:K,onContextMenu:ne,onClick:J,onDoubleClick:Q,onKeyDown:M?ie:void 0,tabIndex:M?0:void 0,onFocus:M?oe:void 0,role:C.ariaRole??(M?"group":void 0),"aria-roledescription":"node","aria-describedby":E?void 0:`${wk}-${x}`,"aria-label":C.ariaLabel,...C.domAttributes,children:F.jsx(SV,{value:e,children:F.jsx(O,{id:e,data:C.data,type:N,positionAbsoluteX:T.positionAbsolute.x,positionAbsoluteY:T.positionAbsolute.y,selected:C.selected??!1,selectable:k,draggable:I,deletable:C.deletable??!0,isConnectable:R,sourcePosition:C.sourcePosition,targetPosition:C.targetPosition,dragging:j,dragHandle:C.dragHandle,zIndex:T.z,parentId:C.parentId,...P})})})}var HV=te.memo(QV);const VV=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function jk(e){const{nodesDraggable:n,nodesConnectable:r,nodesFocusable:s,elementsSelectable:a,onError:o}=Ve(VV,ht),l=BV(e.onlyRenderVisibleElements),u=zV();return F.jsx("div",{className:"react-flow__nodes",style:uh,children:l.map(h=>F.jsx(HV,{id:h,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:u,nodesDraggable:n,nodesConnectable:r,nodesFocusable:s,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:o},h))})}jk.displayName="NodeRenderer";const FV=te.memo(jk);function GV(e){return Ve(te.useCallback(r=>{if(!e)return r.edges.map(a=>a.id);const s=[];if(r.width&&r.height)for(const a of r.edges){const o=r.nodeLookup.get(a.source),l=r.nodeLookup.get(a.target);o&&l&&Q5({sourceNode:o,targetNode:l,width:r.width,height:r.height,transform:r.transform})&&s.push(a.id)}return s},[e]),ht)}const KV=({color:e="none",strokeWidth:n=1})=>{const r={strokeWidth:n,...e&&{stroke:e}};return F.jsx("polyline",{className:"arrow",style:r,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},YV=({color:e="none",strokeWidth:n=1})=>{const r={strokeWidth:n,...e&&{stroke:e,fill:e}};return F.jsx("polyline",{className:"arrowclosed",style:r,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},LA={[zf.Arrow]:KV,[zf.ArrowClosed]:YV};function XV(e){const n=dt();return te.useMemo(()=>{var a,o;return Object.prototype.hasOwnProperty.call(LA,e)?LA[e]:((o=(a=n.getState()).onError)==null||o.call(a,"009",vr.error009(e)),null)},[e])}const WV=({id:e,type:n,color:r,width:s=12.5,height:a=12.5,markerUnits:o="strokeWidth",strokeWidth:l,orient:u="auto-start-reverse"})=>{const h=XV(n);return h?F.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:u,refX:"0",refY:"0",children:F.jsx(h,{color:r,strokeWidth:l})}):null},Lk=({defaultColor:e,rfId:n})=>{const r=Ve(o=>o.edges),s=Ve(o=>o.defaultEdgeOptions),a=te.useMemo(()=>W5(r,{id:n,defaultColor:e,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[r,s,n,e]);return a.length?F.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:F.jsx("defs",{children:a.map(o=>F.jsx(WV,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};Lk.displayName="MarkerDefinitions";var JV=te.memo(Lk);function $k({x:e,y:n,label:r,labelStyle:s,labelShowBg:a=!0,labelBgStyle:o,labelBgPadding:l=[2,4],labelBgBorderRadius:u=2,children:h,className:f,...p}){const[d,g]=te.useState({x:1,y:0,width:0,height:0}),y=jt(["react-flow__edge-textwrapper",f]),E=te.useRef(null);return te.useEffect(()=>{if(E.current){const x=E.current.getBBox();g({x:x.x,y:x.y,width:x.width,height:x.height})}},[r]),r?F.jsxs("g",{transform:`translate(${e-d.width/2} ${n-d.height/2})`,className:y,visibility:d.width?"visible":"hidden",...p,children:[a&&F.jsx("rect",{width:d.width+2*l[0],x:-l[0],y:-l[1],height:d.height+2*l[1],className:"react-flow__edge-textbg",style:o,rx:u,ry:u}),F.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:E,style:s,children:r}),h]}):null}$k.displayName="EdgeText";const ZV=te.memo($k);function lh({path:e,labelX:n,labelY:r,label:s,labelStyle:a,labelShowBg:o,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:h,interactionWidth:f=20,...p}){return F.jsxs(F.Fragment,{children:[F.jsx("path",{...p,d:e,fill:"none",className:jt(["react-flow__edge-path",p.className])}),f?F.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,s&&Wn(n)&&Wn(r)?F.jsx(ZV,{x:n,y:r,label:s,labelStyle:a,labelShowBg:o,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:h}):null]})}function $A({pos:e,x1:n,y1:r,x2:s,y2:a}){return e===Ne.Left||e===Ne.Right?[.5*(n+s),r]:[n,.5*(r+a)]}function Ik({sourceX:e,sourceY:n,sourcePosition:r=Ne.Bottom,targetX:s,targetY:a,targetPosition:o=Ne.Top}){const[l,u]=$A({pos:r,x1:e,y1:n,x2:s,y2:a}),[h,f]=$A({pos:o,x1:s,y1:a,x2:e,y2:n}),[p,d,g,y]=ik({sourceX:e,sourceY:n,targetX:s,targetY:a,sourceControlX:l,sourceControlY:u,targetControlX:h,targetControlY:f});return[`M${e},${n} C${l},${u} ${h},${f} ${s},${a}`,p,d,g,y]}function Dk(e){return te.memo(({id:n,sourceX:r,sourceY:s,targetX:a,targetY:o,sourcePosition:l,targetPosition:u,label:h,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:y,style:E,markerEnd:x,markerStart:v,interactionWidth:b})=>{const[w,C,T]=Ik({sourceX:r,sourceY:s,sourcePosition:l,targetX:a,targetY:o,targetPosition:u}),A=e.isInternal?void 0:n;return F.jsx(lh,{id:A,path:w,labelX:C,labelY:T,label:h,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:y,style:E,markerEnd:x,markerStart:v,interactionWidth:b})})}const eF=Dk({isInternal:!1}),kk=Dk({isInternal:!0});eF.displayName="SimpleBezierEdge";kk.displayName="SimpleBezierEdgeInternal";function Bk(e){return te.memo(({id:n,sourceX:r,sourceY:s,targetX:a,targetY:o,label:l,labelStyle:u,labelShowBg:h,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:g,sourcePosition:y=Ne.Bottom,targetPosition:E=Ne.Top,markerEnd:x,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[C,T,A]=iC({sourceX:r,sourceY:s,sourcePosition:y,targetX:a,targetY:o,targetPosition:E,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),N=e.isInternal?void 0:n;return F.jsx(lh,{id:N,path:C,labelX:T,labelY:A,label:l,labelStyle:u,labelShowBg:h,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:g,markerEnd:x,markerStart:v,interactionWidth:w})})}const Pk=Bk({isInternal:!1}),zk=Bk({isInternal:!0});Pk.displayName="SmoothStepEdge";zk.displayName="SmoothStepEdgeInternal";function Uk(e){return te.memo(({id:n,...r})=>{var a;const s=e.isInternal?void 0:n;return F.jsx(Pk,{...r,id:s,pathOptions:te.useMemo(()=>{var o;return{borderRadius:0,offset:(o=r.pathOptions)==null?void 0:o.offset}},[(a=r.pathOptions)==null?void 0:a.offset])})})}const tF=Uk({isInternal:!1}),Qk=Uk({isInternal:!0});tF.displayName="StepEdge";Qk.displayName="StepEdgeInternal";function Hk(e){return te.memo(({id:n,sourceX:r,sourceY:s,targetX:a,targetY:o,label:l,labelStyle:u,labelShowBg:h,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:g,markerEnd:y,markerStart:E,interactionWidth:x})=>{const[v,b,w]=ok({sourceX:r,sourceY:s,targetX:a,targetY:o}),C=e.isInternal?void 0:n;return F.jsx(lh,{id:C,path:v,labelX:b,labelY:w,label:l,labelStyle:u,labelShowBg:h,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:g,markerEnd:y,markerStart:E,interactionWidth:x})})}const nF=Hk({isInternal:!1}),Vk=Hk({isInternal:!0});nF.displayName="StraightEdge";Vk.displayName="StraightEdgeInternal";function Fk(e){return te.memo(({id:n,sourceX:r,sourceY:s,targetX:a,targetY:o,sourcePosition:l=Ne.Bottom,targetPosition:u=Ne.Top,label:h,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:y,style:E,markerEnd:x,markerStart:v,pathOptions:b,interactionWidth:w})=>{const[C,T,A]=sk({sourceX:r,sourceY:s,sourcePosition:l,targetX:a,targetY:o,targetPosition:u,curvature:b==null?void 0:b.curvature}),N=e.isInternal?void 0:n;return F.jsx(lh,{id:N,path:C,labelX:T,labelY:A,label:h,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:y,style:E,markerEnd:x,markerStart:v,interactionWidth:w})})}const rF=Fk({isInternal:!1}),Gk=Fk({isInternal:!0});rF.displayName="BezierEdge";Gk.displayName="BezierEdgeInternal";const IA={default:Gk,straight:Vk,step:Qk,smoothstep:zk,simplebezier:kk},DA={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},iF=(e,n,r)=>r===Ne.Left?e-n:r===Ne.Right?e+n:e,sF=(e,n,r)=>r===Ne.Top?e-n:r===Ne.Bottom?e+n:e,kA="react-flow__edgeupdater";function BA({position:e,centerX:n,centerY:r,radius:s=10,onMouseDown:a,onMouseEnter:o,onMouseOut:l,type:u}){return F.jsx("circle",{onMouseDown:a,onMouseEnter:o,onMouseOut:l,className:jt([kA,`${kA}-${u}`]),cx:iF(n,s,e),cy:sF(r,s,e),r:s,stroke:"transparent",fill:"transparent"})}function aF({isReconnectable:e,reconnectRadius:n,edge:r,sourceX:s,sourceY:a,targetX:o,targetY:l,sourcePosition:u,targetPosition:h,onReconnect:f,onReconnectStart:p,onReconnectEnd:d,setReconnecting:g,setUpdateHover:y}){const E=dt(),x=(T,A)=>{if(T.button!==0)return;const{autoPanOnConnect:N,domNode:O,isValidConnection:I,connectionMode:k,connectionRadius:R,lib:M,onConnectStart:D,onConnectEnd:z,cancelConnection:q,nodeLookup:j,rfId:L,panBy:P,updateConnection:H}=E.getState(),G=A.type==="target",V=(ne,Q)=>{g(!1),d==null||d(ne,r,A.type,Q)},B=ne=>f==null?void 0:f(r,ne),K=(ne,Q)=>{g(!0),p==null||p(T,r,A.type),D==null||D(ne,Q)};oC.onPointerDown(T.nativeEvent,{autoPanOnConnect:N,connectionMode:k,connectionRadius:R,domNode:O,handleId:A.id,nodeId:A.nodeId,nodeLookup:j,isTarget:G,edgeUpdaterType:A.type,lib:M,flowId:L,cancelConnection:q,panBy:P,isValidConnection:I,onConnect:B,onConnectStart:K,onConnectEnd:z,onReconnectEnd:V,updateConnection:H,getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,dragThreshold:E.getState().connectionDragThreshold,handleDomNode:T.currentTarget})},v=T=>x(T,{nodeId:r.target,id:r.targetHandle??null,type:"target"}),b=T=>x(T,{nodeId:r.source,id:r.sourceHandle??null,type:"source"}),w=()=>y(!0),C=()=>y(!1);return F.jsxs(F.Fragment,{children:[(e===!0||e==="source")&&F.jsx(BA,{position:u,centerX:s,centerY:a,radius:n,onMouseDown:v,onMouseEnter:w,onMouseOut:C,type:"source"}),(e===!0||e==="target")&&F.jsx(BA,{position:h,centerX:o,centerY:l,radius:n,onMouseDown:b,onMouseEnter:w,onMouseOut:C,type:"target"})]})}function oF({id:e,edgesFocusable:n,edgesReconnectable:r,elementsSelectable:s,onClick:a,onDoubleClick:o,onContextMenu:l,onMouseEnter:u,onMouseMove:h,onMouseLeave:f,reconnectRadius:p,onReconnect:d,onReconnectStart:g,onReconnectEnd:y,rfId:E,edgeTypes:x,noPanClassName:v,onError:b,disableKeyboardA11y:w}){let C=Ve(_e=>_e.edgeLookup.get(e));const T=Ve(_e=>_e.defaultEdgeOptions);C=T?{...T,...C}:C;let A=C.type||"default",N=(x==null?void 0:x[A])||IA[A];N===void 0&&(b==null||b("011",vr.error011(A)),A="default",N=(x==null?void 0:x.default)||IA.default);const O=!!(C.focusable||n&&typeof C.focusable>"u"),I=typeof d<"u"&&(C.reconnectable||r&&typeof C.reconnectable>"u"),k=!!(C.selectable||s&&typeof C.selectable>"u"),R=te.useRef(null),[M,D]=te.useState(!1),[z,q]=te.useState(!1),j=dt(),{zIndex:L,sourceX:P,sourceY:H,targetX:G,targetY:V,sourcePosition:B,targetPosition:K}=Ve(te.useCallback(_e=>{const we=_e.nodeLookup.get(C.source),W=_e.nodeLookup.get(C.target);if(!we||!W)return{zIndex:C.zIndex,...DA};const ae=X5({id:e,sourceNode:we,targetNode:W,sourceHandle:C.sourceHandle||null,targetHandle:C.targetHandle||null,connectionMode:_e.connectionMode,onError:b});return{zIndex:U5({selected:C.selected,zIndex:C.zIndex,sourceNode:we,targetNode:W,elevateOnSelect:_e.elevateEdgesOnSelect,zIndexMode:_e.zIndexMode}),...ae||DA}},[C.source,C.target,C.sourceHandle,C.targetHandle,C.selected,C.zIndex]),ht),ne=te.useMemo(()=>C.markerStart?`url('#${sC(C.markerStart,E)}')`:void 0,[C.markerStart,E]),Q=te.useMemo(()=>C.markerEnd?`url('#${sC(C.markerEnd,E)}')`:void 0,[C.markerEnd,E]);if(C.hidden||P===null||H===null||G===null||V===null)return null;const J=_e=>{var xe;const{addSelectedEdges:we,unselectNodesAndEdges:W,multiSelectionActive:ae}=j.getState();k&&(j.setState({nodesSelectionActive:!1}),C.selected&&ae?(W({nodes:[],edges:[C]}),(xe=R.current)==null||xe.blur()):we([e])),a&&a(_e,C)},ie=o?_e=>{o(_e,{...C})}:void 0,oe=l?_e=>{l(_e,{...C})}:void 0,ee=u?_e=>{u(_e,{...C})}:void 0,fe=h?_e=>{h(_e,{...C})}:void 0,be=f?_e=>{f(_e,{...C})}:void 0,ve=_e=>{var we;if(!w&&HD.includes(_e.key)&&k){const{unselectNodesAndEdges:W,addSelectedEdges:ae}=j.getState();_e.key==="Escape"?((we=R.current)==null||we.blur(),W({edges:[C]})):ae([e])}};return F.jsx("svg",{style:{zIndex:L},children:F.jsxs("g",{className:jt(["react-flow__edge",`react-flow__edge-${A}`,C.className,v,{selected:C.selected,animated:C.animated,inactive:!k&&!a,updating:M,selectable:k}]),onClick:J,onDoubleClick:ie,onContextMenu:oe,onMouseEnter:ee,onMouseMove:fe,onMouseLeave:be,onKeyDown:O?ve:void 0,tabIndex:O?0:void 0,role:C.ariaRole??(O?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":C.ariaLabel===null?void 0:C.ariaLabel||`Edge from ${C.source} to ${C.target}`,"aria-describedby":O?`${Ek}-${E}`:void 0,ref:R,...C.domAttributes,children:[!z&&F.jsx(N,{id:e,source:C.source,target:C.target,type:C.type,selected:C.selected,animated:C.animated,selectable:k,deletable:C.deletable??!0,label:C.label,labelStyle:C.labelStyle,labelShowBg:C.labelShowBg,labelBgStyle:C.labelBgStyle,labelBgPadding:C.labelBgPadding,labelBgBorderRadius:C.labelBgBorderRadius,sourceX:P,sourceY:H,targetX:G,targetY:V,sourcePosition:B,targetPosition:K,data:C.data,style:C.style,sourceHandleId:C.sourceHandle,targetHandleId:C.targetHandle,markerStart:ne,markerEnd:Q,pathOptions:"pathOptions"in C?C.pathOptions:void 0,interactionWidth:C.interactionWidth}),I&&F.jsx(aF,{edge:C,isReconnectable:I,reconnectRadius:p,onReconnect:d,onReconnectStart:g,onReconnectEnd:y,sourceX:P,sourceY:H,targetX:G,targetY:V,sourcePosition:B,targetPosition:K,setUpdateHover:D,setReconnecting:q})]})})}var uF=te.memo(oF);const lF=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Kk({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:r,edgeTypes:s,noPanClassName:a,onReconnect:o,onEdgeContextMenu:l,onEdgeMouseEnter:u,onEdgeMouseMove:h,onEdgeMouseLeave:f,onEdgeClick:p,reconnectRadius:d,onEdgeDoubleClick:g,onReconnectStart:y,onReconnectEnd:E,disableKeyboardA11y:x}){const{edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,onError:C}=Ve(lF,ht),T=GV(n);return F.jsxs("div",{className:"react-flow__edges",children:[F.jsx(JV,{defaultColor:e,rfId:r}),T.map(A=>F.jsx(uF,{id:A,edgesFocusable:v,edgesReconnectable:b,elementsSelectable:w,noPanClassName:a,onReconnect:o,onContextMenu:l,onMouseEnter:u,onMouseMove:h,onMouseLeave:f,onClick:p,reconnectRadius:d,onDoubleClick:g,onReconnectStart:y,onReconnectEnd:E,rfId:r,onError:C,edgeTypes:s,disableKeyboardA11y:x},A))]})}Kk.displayName="EdgeRenderer";const cF=te.memo(Kk),fF=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function hF({children:e}){const n=Ve(fF);return F.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function dF(e){const n=kC(),r=te.useRef(!1);te.useEffect(()=>{!r.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),r.current=!0)},[e,n.viewportInitialized])}const pF=e=>{var n;return(n=e.panZoom)==null?void 0:n.syncViewport};function mF(e){const n=Ve(pF),r=dt();return te.useEffect(()=>{e&&(n==null||n(e),r.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function gF(e){return e.connection.inProgress?{...e.connection,to:yl(e.connection.to,e.transform)}:{...e.connection}}function yF(e){return gF}function vF(e){const n=yF();return Ve(n,ht)}const bF=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function _F({containerStyle:e,style:n,type:r,component:s}){const{nodesConnectable:a,width:o,height:l,isValid:u,inProgress:h}=Ve(bF,ht);return!(o&&a&&h)?null:F.jsx("svg",{style:e,width:o,height:l,className:"react-flow__connectionline react-flow__container",children:F.jsx("g",{className:jt(["react-flow__connection",GD(u)]),children:F.jsx(Yk,{style:n,type:r,CustomComponent:s,isValid:u})})})}const Yk=({style:e,type:n=$i.Bezier,CustomComponent:r,isValid:s})=>{const{inProgress:a,from:o,fromNode:l,fromHandle:u,fromPosition:h,to:f,toNode:p,toHandle:d,toPosition:g,pointer:y}=vF();if(!a)return;if(r)return F.jsx(r,{connectionLineType:n,connectionLineStyle:e,fromNode:l,fromHandle:u,fromX:o.x,fromY:o.y,toX:f.x,toY:f.y,fromPosition:h,toPosition:g,connectionStatus:GD(s),toNode:p,toHandle:d,pointer:y});let E="";const x={sourceX:o.x,sourceY:o.y,sourcePosition:h,targetX:f.x,targetY:f.y,targetPosition:g};switch(n){case $i.Bezier:[E]=sk(x);break;case $i.SimpleBezier:[E]=Ik(x);break;case $i.Step:[E]=iC({...x,borderRadius:0});break;case $i.SmoothStep:[E]=iC(x);break;default:[E]=ok(x)}return F.jsx("path",{d:E,fill:"none",className:"react-flow__connection-path",style:e})};Yk.displayName="ConnectionLine";const wF={};function PA(e=wF){te.useRef(e),dt(),te.useEffect(()=>{},[e])}function EF(){dt(),te.useRef(!1),te.useEffect(()=>{},[])}function Xk({nodeTypes:e,edgeTypes:n,onInit:r,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:o,onEdgeDoubleClick:l,onNodeMouseEnter:u,onNodeMouseMove:h,onNodeMouseLeave:f,onNodeContextMenu:p,onSelectionContextMenu:d,onSelectionStart:g,onSelectionEnd:y,connectionLineType:E,connectionLineStyle:x,connectionLineComponent:v,connectionLineContainerStyle:b,selectionKeyCode:w,selectionOnDrag:C,selectionMode:T,multiSelectionKeyCode:A,panActivationKeyCode:N,zoomActivationKeyCode:O,deleteKeyCode:I,onlyRenderVisibleElements:k,elementsSelectable:R,defaultViewport:M,translateExtent:D,minZoom:z,maxZoom:q,preventScrolling:j,defaultMarkerColor:L,zoomOnScroll:P,zoomOnPinch:H,panOnScroll:G,panOnScrollSpeed:V,panOnScrollMode:B,zoomOnDoubleClick:K,panOnDrag:ne,onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:ie,onPaneMouseLeave:oe,onPaneScroll:ee,onPaneContextMenu:fe,paneClickDistance:be,nodeClickDistance:ve,onEdgeContextMenu:_e,onEdgeMouseEnter:we,onEdgeMouseMove:W,onEdgeMouseLeave:ae,reconnectRadius:xe,onReconnect:Se,onReconnectStart:gt,onReconnectEnd:ut,noDragClassName:It,noWheelClassName:Tt,noPanClassName:qt,disableKeyboardA11y:Fe,nodeExtent:Oe,rfId:Xe,viewport:We,onViewportChange:rt}){return PA(e),PA(n),EF(),dF(r),mF(We),F.jsx(DV,{onPaneClick:Q,onPaneMouseEnter:J,onPaneMouseMove:ie,onPaneMouseLeave:oe,onPaneContextMenu:fe,onPaneScroll:ee,paneClickDistance:be,deleteKeyCode:I,selectionKeyCode:w,selectionOnDrag:C,selectionMode:T,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:A,panActivationKeyCode:N,zoomActivationKeyCode:O,elementsSelectable:R,zoomOnScroll:P,zoomOnPinch:H,zoomOnDoubleClick:K,panOnScroll:G,panOnScrollSpeed:V,panOnScrollMode:B,panOnDrag:ne,defaultViewport:M,translateExtent:D,minZoom:z,maxZoom:q,onSelectionContextMenu:d,preventScrolling:j,noDragClassName:It,noWheelClassName:Tt,noPanClassName:qt,disableKeyboardA11y:Fe,onViewportChange:rt,isControlledViewport:!!We,children:F.jsxs(hF,{children:[F.jsx(cF,{edgeTypes:n,onEdgeClick:a,onEdgeDoubleClick:l,onReconnect:Se,onReconnectStart:gt,onReconnectEnd:ut,onlyRenderVisibleElements:k,onEdgeContextMenu:_e,onEdgeMouseEnter:we,onEdgeMouseMove:W,onEdgeMouseLeave:ae,reconnectRadius:xe,defaultMarkerColor:L,noPanClassName:qt,disableKeyboardA11y:Fe,rfId:Xe}),F.jsx(_F,{style:x,type:E,component:v,containerStyle:b}),F.jsx("div",{className:"react-flow__edgelabel-renderer"}),F.jsx(FV,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:o,onNodeMouseEnter:u,onNodeMouseMove:h,onNodeMouseLeave:f,onNodeContextMenu:p,nodeClickDistance:ve,onlyRenderVisibleElements:k,noPanClassName:qt,noDragClassName:It,disableKeyboardA11y:Fe,nodeExtent:Oe,rfId:Xe}),F.jsx("div",{className:"react-flow__viewport-portal"})]})})}Xk.displayName="GraphView";const CF=te.memo(Xk),zA=({nodes:e,edges:n,defaultNodes:r,defaultEdges:s,width:a,height:o,fitView:l,fitViewOptions:u,minZoom:h=.5,maxZoom:f=2,nodeOrigin:p,nodeExtent:d,zIndexMode:g="basic"}={})=>{const y=new Map,E=new Map,x=new Map,v=new Map,b=s??n??[],w=r??e??[],C=p??[0,0],T=d??Gu;ck(x,v,b);const A=aC(w,y,E,{nodeOrigin:C,nodeExtent:T,zIndexMode:g});let N=[0,0,1];if(l&&a&&o){const O=ml(y,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:I,y:k,zoom:R}=OC(O,a,o,h,f,(u==null?void 0:u.padding)??.1);N=[I,k,R]}return{rfId:"1",width:a??0,height:o??0,transform:N,nodes:w,nodesInitialized:A,nodeLookup:y,parentLookup:E,edges:b,edgeLookup:v,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:r!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:h,maxZoom:f,translateExtent:Gu,nodeExtent:T,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:go.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:C,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:l??!1,fitViewOptions:u,fitViewResolver:null,connection:{...FD},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:I5,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:VD,zIndexMode:g,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},xF=({nodes:e,edges:n,defaultNodes:r,defaultEdges:s,width:a,height:o,fitView:l,fitViewOptions:u,minZoom:h,maxZoom:f,nodeOrigin:p,nodeExtent:d,zIndexMode:g})=>U8((y,E)=>{async function x(){const{nodeLookup:v,panZoom:b,fitViewOptions:w,fitViewResolver:C,width:T,height:A,minZoom:N,maxZoom:O}=E();b&&(await L5({nodes:v,width:T,height:A,panZoom:b,minZoom:N,maxZoom:O},w),C==null||C.resolve(!0),y({fitViewResolver:null}))}return{...zA({nodes:e,edges:n,width:a,height:o,fitView:l,fitViewOptions:u,minZoom:h,maxZoom:f,nodeOrigin:p,nodeExtent:d,defaultNodes:r,defaultEdges:s,zIndexMode:g}),setNodes:v=>{const{nodeLookup:b,parentLookup:w,nodeOrigin:C,elevateNodesOnSelect:T,fitViewQueued:A,zIndexMode:N}=E(),O=aC(v,b,w,{nodeOrigin:C,nodeExtent:d,elevateNodesOnSelect:T,checkEquality:!0,zIndexMode:N});A&&O?(x(),y({nodes:v,nodesInitialized:O,fitViewQueued:!1,fitViewOptions:void 0})):y({nodes:v,nodesInitialized:O})},setEdges:v=>{const{connectionLookup:b,edgeLookup:w}=E();ck(b,w,v),y({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:w}=E();w(v),y({hasDefaultNodes:!0})}if(b){const{setEdges:w}=E();w(b),y({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:w,parentLookup:C,domNode:T,nodeOrigin:A,nodeExtent:N,debug:O,fitViewQueued:I,zIndexMode:k}=E(),{changes:R,updatedInternals:M}=i8(v,w,C,T,A,N,k);M&&(e8(w,C,{nodeOrigin:A,nodeExtent:N,zIndexMode:k}),I?(x(),y({fitViewQueued:!1,fitViewOptions:void 0})):y({}),(R==null?void 0:R.length)>0&&(O&&console.log("React Flow: trigger node changes",R),b==null||b(R)))},updateNodePositions:(v,b=!1)=>{const w=[];let C=[];const{nodeLookup:T,triggerNodeChanges:A,connection:N,updateConnection:O,onNodesChangeMiddlewareMap:I}=E();for(const[k,R]of v){const M=T.get(k),D=!!(M!=null&&M.expandParent&&(M!=null&&M.parentId)&&(R!=null&&R.position)),z={id:k,type:"position",position:D?{x:Math.max(0,R.position.x),y:Math.max(0,R.position.y)}:R.position,dragging:b};if(M&&N.inProgress&&N.fromNode.id===M.id){const q=Ps(M,N.fromHandle,Ne.Left,!0);O({...N,from:q})}D&&M.parentId&&w.push({id:k,parentId:M.parentId,rect:{...R.internals.positionAbsolute,width:R.measured.width??0,height:R.measured.height??0}}),C.push(z)}if(w.length>0){const{parentLookup:k,nodeOrigin:R}=E(),M=DC(w,T,k,R);C.push(...M)}for(const k of I.values())C=k(C);A(C)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:w,nodes:C,hasDefaultNodes:T,debug:A}=E();if(v!=null&&v.length){if(T){const N=Sk(v,C);w(N)}A&&console.log("React Flow: trigger node changes",v),b==null||b(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:w,edges:C,hasDefaultEdges:T,debug:A}=E();if(v!=null&&v.length){if(T){const N=Tk(v,C);w(N)}A&&console.log("React Flow: trigger edge changes",v),b==null||b(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:C,triggerNodeChanges:T,triggerEdgeChanges:A}=E();if(b){const N=v.map(O=>ws(O,!0));T(N);return}T(Ya(C,new Set([...v]),!0)),A(Ya(w))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:w,nodeLookup:C,triggerNodeChanges:T,triggerEdgeChanges:A}=E();if(b){const N=v.map(O=>ws(O,!0));A(N);return}A(Ya(w,new Set([...v]))),T(Ya(C,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:w,nodes:C,nodeLookup:T,triggerNodeChanges:A,triggerEdgeChanges:N}=E(),O=v||C,I=b||w,k=O.map(M=>{const D=T.get(M.id);return D&&(D.selected=!1),ws(M.id,!1)}),R=I.map(M=>ws(M.id,!1));A(k),N(R)},setMinZoom:v=>{const{panZoom:b,maxZoom:w}=E();b==null||b.setScaleExtent([v,w]),y({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:w}=E();b==null||b.setScaleExtent([w,v]),y({maxZoom:v})},setTranslateExtent:v=>{var b;(b=E().panZoom)==null||b.setTranslateExtent(v),y({translateExtent:v})},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:w,triggerEdgeChanges:C,elementsSelectable:T}=E();if(!T)return;const A=b.reduce((O,I)=>I.selected?[...O,ws(I.id,!1)]:O,[]),N=v.reduce((O,I)=>I.selected?[...O,ws(I.id,!1)]:O,[]);w(A),C(N)},setNodeExtent:v=>{const{nodes:b,nodeLookup:w,parentLookup:C,nodeOrigin:T,elevateNodesOnSelect:A,nodeExtent:N,zIndexMode:O}=E();v[0][0]===N[0][0]&&v[0][1]===N[0][1]&&v[1][0]===N[1][0]&&v[1][1]===N[1][1]||(aC(b,w,C,{nodeOrigin:T,nodeExtent:v,elevateNodesOnSelect:A,checkEquality:!1,zIndexMode:O}),y({nodeExtent:v}))},panBy:v=>{const{transform:b,width:w,height:C,panZoom:T,translateExtent:A}=E();return s8({delta:v,panZoom:T,transform:b,translateExtent:A,width:w,height:C})},setCenter:async(v,b,w)=>{const{width:C,height:T,maxZoom:A,panZoom:N}=E();if(!N)return Promise.resolve(!1);const O=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:A;return await N.setViewport({x:C/2-v*O,y:T/2-b*O,zoom:O},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{y({connection:{...FD}})},updateConnection:v=>{y({connection:v})},reset:()=>y({...zA()})}},Object.is);function SF({initialNodes:e,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:a,initialHeight:o,initialMinZoom:l,initialMaxZoom:u,initialFitViewOptions:h,fitView:f,nodeOrigin:p,nodeExtent:d,zIndexMode:g,children:y}){const[E]=te.useState(()=>xF({nodes:e,edges:n,defaultNodes:r,defaultEdges:s,width:a,height:o,fitView:f,minZoom:l,maxZoom:u,fitViewOptions:h,nodeOrigin:p,nodeExtent:d,zIndexMode:g}));return F.jsx(Q8,{value:E,children:F.jsx(hV,{children:y})})}function TF({children:e,nodes:n,edges:r,defaultNodes:s,defaultEdges:a,width:o,height:l,fitView:u,fitViewOptions:h,minZoom:f,maxZoom:p,nodeOrigin:d,nodeExtent:g,zIndexMode:y}){return te.useContext(ah)?F.jsx(F.Fragment,{children:e}):F.jsx(SF,{initialNodes:n,initialEdges:r,defaultNodes:s,defaultEdges:a,initialWidth:o,initialHeight:l,fitView:u,initialFitViewOptions:h,initialMinZoom:f,initialMaxZoom:p,nodeOrigin:d,nodeExtent:g,zIndexMode:y,children:e})}const qF={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function AF({nodes:e,edges:n,defaultNodes:r,defaultEdges:s,className:a,nodeTypes:o,edgeTypes:l,onNodeClick:u,onEdgeClick:h,onInit:f,onMove:p,onMoveStart:d,onMoveEnd:g,onConnect:y,onConnectStart:E,onConnectEnd:x,onClickConnectStart:v,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:C,onNodeMouseLeave:T,onNodeContextMenu:A,onNodeDoubleClick:N,onNodeDragStart:O,onNodeDrag:I,onNodeDragStop:k,onNodesDelete:R,onEdgesDelete:M,onDelete:D,onSelectionChange:z,onSelectionDragStart:q,onSelectionDrag:j,onSelectionDragStop:L,onSelectionContextMenu:P,onSelectionStart:H,onSelectionEnd:G,onBeforeDelete:V,connectionMode:B,connectionLineType:K=$i.Bezier,connectionLineStyle:ne,connectionLineComponent:Q,connectionLineContainerStyle:J,deleteKeyCode:ie="Backspace",selectionKeyCode:oe="Shift",selectionOnDrag:ee=!1,selectionMode:fe=Ku.Full,panActivationKeyCode:be="Space",multiSelectionKeyCode:ve=Xu()?"Meta":"Control",zoomActivationKeyCode:_e=Xu()?"Meta":"Control",snapToGrid:we,snapGrid:W,onlyRenderVisibleElements:ae=!1,selectNodesOnDrag:xe,nodesDraggable:Se,autoPanOnNodeFocus:gt,nodesConnectable:ut,nodesFocusable:It,nodeOrigin:Tt=Ck,edgesFocusable:qt,edgesReconnectable:Fe,elementsSelectable:Oe=!0,defaultViewport:Xe=nV,minZoom:We=.5,maxZoom:rt=2,translateExtent:de=Gu,preventScrolling:X=!0,nodeExtent:Me,defaultMarkerColor:Mo="#b1b1b7",zoomOnScroll:sa=!0,zoomOnPinch:Ft=!0,panOnScroll:yt=!1,panOnScrollSpeed:ar=.5,panOnScrollMode:Wt=Ls.Free,zoomOnDoubleClick:Mh=!0,panOnDrag:jh=!0,onPaneClick:Lh,onPaneMouseEnter:aa,onPaneMouseMove:oa,onPaneMouseLeave:ua,onPaneScroll:Cr,onPaneContextMenu:la,paneClickDistance:Zi=1,nodeClickDistance:$h=0,children:Al,onReconnect:jo,onReconnectStart:es,onReconnectEnd:Ih,onEdgeContextMenu:Nl,onEdgeDoubleClick:Rl,onEdgeMouseEnter:Ol,onEdgeMouseMove:Lo,onEdgeMouseLeave:$o,reconnectRadius:Ml=10,onNodesChange:jl,onEdgesChange:or,noDragClassName:Lt="nodrag",noWheelClassName:Gt="nowheel",noPanClassName:xr="nopan",fitView:ca,fitViewOptions:Ll,connectOnClick:Dh,attributionPosition:$l,proOptions:ts,defaultEdgeOptions:Io,elevateNodesOnSelect:ri=!0,elevateEdgesOnSelect:ii=!1,disableKeyboardA11y:si=!1,autoPanOnConnect:ai,autoPanOnNodeDrag:At,autoPanSpeed:Il,connectionRadius:Dl,isValidConnection:Sr,onError:oi,style:kh,id:Do,nodeDragThreshold:kl,connectionDragThreshold:Bh,viewport:fa,onViewportChange:ha,width:zn,height:nn,colorMode:Bl="light",debug:Ph,onScroll:ui,ariaLabelConfig:Pl,zIndexMode:ns="basic",...zh},rn){const rs=Do||"1",zl=aV(Bl),ko=te.useCallback(Tr=>{Tr.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ui==null||ui(Tr)},[ui]);return F.jsx("div",{"data-testid":"rf__wrapper",...zh,onScroll:ko,style:{...kh,...qF},ref:rn,className:jt(["react-flow",a,zl]),id:Do,role:"application",children:F.jsxs(TF,{nodes:e,edges:n,width:zn,height:nn,fitView:ca,fitViewOptions:Ll,minZoom:We,maxZoom:rt,nodeOrigin:Tt,nodeExtent:Me,zIndexMode:ns,children:[F.jsx(CF,{onInit:f,onNodeClick:u,onEdgeClick:h,onNodeMouseEnter:w,onNodeMouseMove:C,onNodeMouseLeave:T,onNodeContextMenu:A,onNodeDoubleClick:N,nodeTypes:o,edgeTypes:l,connectionLineType:K,connectionLineStyle:ne,connectionLineComponent:Q,connectionLineContainerStyle:J,selectionKeyCode:oe,selectionOnDrag:ee,selectionMode:fe,deleteKeyCode:ie,multiSelectionKeyCode:ve,panActivationKeyCode:be,zoomActivationKeyCode:_e,onlyRenderVisibleElements:ae,defaultViewport:Xe,translateExtent:de,minZoom:We,maxZoom:rt,preventScrolling:X,zoomOnScroll:sa,zoomOnPinch:Ft,zoomOnDoubleClick:Mh,panOnScroll:yt,panOnScrollSpeed:ar,panOnScrollMode:Wt,panOnDrag:jh,onPaneClick:Lh,onPaneMouseEnter:aa,onPaneMouseMove:oa,onPaneMouseLeave:ua,onPaneScroll:Cr,onPaneContextMenu:la,paneClickDistance:Zi,nodeClickDistance:$h,onSelectionContextMenu:P,onSelectionStart:H,onSelectionEnd:G,onReconnect:jo,onReconnectStart:es,onReconnectEnd:Ih,onEdgeContextMenu:Nl,onEdgeDoubleClick:Rl,onEdgeMouseEnter:Ol,onEdgeMouseMove:Lo,onEdgeMouseLeave:$o,reconnectRadius:Ml,defaultMarkerColor:Mo,noDragClassName:Lt,noWheelClassName:Gt,noPanClassName:xr,rfId:rs,disableKeyboardA11y:si,nodeExtent:Me,viewport:fa,onViewportChange:ha}),F.jsx(sV,{nodes:e,edges:n,defaultNodes:r,defaultEdges:s,onConnect:y,onConnectStart:E,onConnectEnd:x,onClickConnectStart:v,onClickConnectEnd:b,nodesDraggable:Se,autoPanOnNodeFocus:gt,nodesConnectable:ut,nodesFocusable:It,edgesFocusable:qt,edgesReconnectable:Fe,elementsSelectable:Oe,elevateNodesOnSelect:ri,elevateEdgesOnSelect:ii,minZoom:We,maxZoom:rt,nodeExtent:Me,onNodesChange:jl,onEdgesChange:or,snapToGrid:we,snapGrid:W,connectionMode:B,translateExtent:de,connectOnClick:Dh,defaultEdgeOptions:Io,fitView:ca,fitViewOptions:Ll,onNodesDelete:R,onEdgesDelete:M,onDelete:D,onNodeDragStart:O,onNodeDrag:I,onNodeDragStop:k,onSelectionDrag:j,onSelectionDragStart:q,onSelectionDragStop:L,onMove:p,onMoveStart:d,onMoveEnd:g,noPanClassName:xr,nodeOrigin:Tt,rfId:rs,autoPanOnConnect:ai,autoPanOnNodeDrag:At,autoPanSpeed:Il,onError:oi,connectionRadius:Dl,isValidConnection:Sr,selectNodesOnDrag:xe,nodeDragThreshold:kl,connectionDragThreshold:Bh,onBeforeDelete:V,debug:Ph,ariaLabelConfig:Pl,zIndexMode:ns}),F.jsx(tV,{onSelectionChange:z}),Al,F.jsx(X8,{proOptions:ts,position:$l}),F.jsx(Y8,{rfId:rs,disableKeyboardA11y:si})]})})}var NF=qk(AF);function RF(e){const[n,r]=te.useState(e),s=te.useCallback(a=>r(o=>Sk(a,o)),[]);return[n,r,s]}function OF(e){const[n,r]=te.useState(e),s=te.useCallback(a=>r(o=>Tk(a,o)),[]);return[n,r,s]}function MF({dimensions:e,lineWidth:n,variant:r,className:s}){return F.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:jt(["react-flow__background-pattern",r,s])})}function jF({radius:e,className:n}){return F.jsx("circle",{cx:e,cy:e,r:e,className:jt(["react-flow__background-pattern","dots",n])})}var Gi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Gi||(Gi={}));const LF={[Gi.Dots]:1,[Gi.Lines]:1,[Gi.Cross]:6},$F=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Wk({id:e,variant:n=Gi.Dots,gap:r=20,size:s,lineWidth:a=1,offset:o=0,color:l,bgColor:u,style:h,className:f,patternClassName:p}){const d=te.useRef(null),{transform:g,patternId:y}=Ve($F,ht),E=s||LF[n],x=n===Gi.Dots,v=n===Gi.Cross,b=Array.isArray(r)?r:[r,r],w=[b[0]*g[2]||1,b[1]*g[2]||1],C=E*g[2],T=Array.isArray(o)?o:[o,o],A=v?[C,C]:w,N=[T[0]*g[2]||1+A[0]/2,T[1]*g[2]||1+A[1]/2],O=`${y}${e||""}`;return F.jsxs("svg",{className:jt(["react-flow__background",f]),style:{...h,...uh,"--xy-background-color-props":u,"--xy-background-pattern-color-props":l},ref:d,"data-testid":"rf__background",children:[F.jsx("pattern",{id:O,x:g[0]%w[0],y:g[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:x?F.jsx(jF,{radius:C/2,className:p}):F.jsx(MF,{dimensions:A,lineWidth:a,variant:n,className:p})}),F.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${O})`})]})}Wk.displayName="Background";const IF=te.memo(Wk);function DF(){return F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:F.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function kF(){return F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:F.jsx("path",{d:"M0 0h32v4.2H0z"})})}function BF(){return F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:F.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function PF(){return F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:F.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function zF(){return F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:F.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function hf({children:e,className:n,...r}){return F.jsx("button",{type:"button",className:jt(["react-flow__controls-button",n]),...r,children:e})}const UF=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Jk({style:e,showZoom:n=!0,showFitView:r=!0,showInteractive:s=!0,fitViewOptions:a,onZoomIn:o,onZoomOut:l,onFitView:u,onInteractiveChange:h,className:f,children:p,position:d="bottom-left",orientation:g="vertical","aria-label":y}){const E=dt(),{isInteractive:x,minZoomReached:v,maxZoomReached:b,ariaLabelConfig:w}=Ve(UF,ht),{zoomIn:C,zoomOut:T,fitView:A}=kC(),N=()=>{C(),o==null||o()},O=()=>{T(),l==null||l()},I=()=>{A(a),u==null||u()},k=()=>{E.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),h==null||h(!x)},R=g==="horizontal"?"horizontal":"vertical";return F.jsxs(oh,{className:jt(["react-flow__controls",R,f]),position:d,style:e,"data-testid":"rf__controls","aria-label":y??w["controls.ariaLabel"],children:[n&&F.jsxs(F.Fragment,{children:[F.jsx(hf,{onClick:N,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:b,children:F.jsx(DF,{})}),F.jsx(hf,{onClick:O,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:v,children:F.jsx(kF,{})})]}),r&&F.jsx(hf,{className:"react-flow__controls-fitview",onClick:I,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:F.jsx(BF,{})}),s&&F.jsx(hf,{className:"react-flow__controls-interactive",onClick:k,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:x?F.jsx(zF,{}):F.jsx(PF,{})}),p]})}Jk.displayName="Controls";const QF=te.memo(Jk);function HF({id:e,x:n,y:r,width:s,height:a,style:o,color:l,strokeColor:u,strokeWidth:h,className:f,borderRadius:p,shapeRendering:d,selected:g,onClick:y}){const{background:E,backgroundColor:x}=o||{},v=l||E||x;return F.jsx("rect",{className:jt(["react-flow__minimap-node",{selected:g},f]),x:n,y:r,rx:p,ry:p,width:s,height:a,style:{fill:v,stroke:u,strokeWidth:h},shapeRendering:d,onClick:y?b=>y(b,e):void 0})}const VF=te.memo(HF),FF=e=>e.nodes.map(n=>n.id),mm=e=>e instanceof Function?e:()=>e;function GF({nodeStrokeColor:e,nodeColor:n,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:o=VF,onClick:l}){const u=Ve(FF,ht),h=mm(n),f=mm(e),p=mm(r),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return F.jsx(F.Fragment,{children:u.map(g=>F.jsx(YF,{id:g,nodeColorFunc:h,nodeStrokeColorFunc:f,nodeClassNameFunc:p,nodeBorderRadius:s,nodeStrokeWidth:a,NodeComponent:o,onClick:l,shapeRendering:d},g))})}function KF({id:e,nodeColorFunc:n,nodeStrokeColorFunc:r,nodeClassNameFunc:s,nodeBorderRadius:a,nodeStrokeWidth:o,shapeRendering:l,NodeComponent:u,onClick:h}){const{node:f,x:p,y:d,width:g,height:y}=Ve(E=>{const{internals:x}=E.nodeLookup.get(e),v=x.userNode,{x:b,y:w}=x.positionAbsolute,{width:C,height:T}=Zr(v);return{node:v,x:b,y:w,width:C,height:T}},ht);return!f||f.hidden||!ZD(f)?null:F.jsx(u,{x:p,y:d,width:g,height:y,style:f.style,selected:!!f.selected,className:s(f),color:n(f),borderRadius:a,strokeColor:r(f),strokeWidth:o,shapeRendering:l,onClick:h,id:f.id})}const YF=te.memo(KF);var XF=te.memo(GF);const WF=200,JF=150,ZF=e=>!e.hidden,eG=e=>{const n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:e.nodeLookup.size>0?JD(ml(e.nodeLookup,{filter:ZF}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},tG="react-flow__minimap-desc";function Zk({style:e,className:n,nodeStrokeColor:r,nodeColor:s,nodeClassName:a="",nodeBorderRadius:o=5,nodeStrokeWidth:l,nodeComponent:u,bgColor:h,maskColor:f,maskStrokeColor:p,maskStrokeWidth:d,position:g="bottom-right",onClick:y,onNodeClick:E,pannable:x=!1,zoomable:v=!1,ariaLabel:b,inversePan:w,zoomStep:C=1,offsetScale:T=5}){const A=dt(),N=te.useRef(null),{boundingRect:O,viewBB:I,rfId:k,panZoom:R,translateExtent:M,flowWidth:D,flowHeight:z,ariaLabelConfig:q}=Ve(eG,ht),j=(e==null?void 0:e.width)??WF,L=(e==null?void 0:e.height)??JF,P=O.width/j,H=O.height/L,G=Math.max(P,H),V=G*j,B=G*L,K=T*G,ne=O.x-(V-O.width)/2-K,Q=O.y-(B-O.height)/2-K,J=V+K*2,ie=B+K*2,oe=`${tG}-${k}`,ee=te.useRef(0),fe=te.useRef();ee.current=G,te.useEffect(()=>{if(N.current&&R)return fe.current=p8({domNode:N.current,panZoom:R,getTransform:()=>A.getState().transform,getViewScale:()=>ee.current}),()=>{var we;(we=fe.current)==null||we.destroy()}},[R]),te.useEffect(()=>{var we;(we=fe.current)==null||we.update({translateExtent:M,width:D,height:z,inversePan:w,pannable:x,zoomStep:C,zoomable:v})},[x,v,w,C,M,D,z]);const be=y?we=>{var xe;const[W,ae]=((xe=fe.current)==null?void 0:xe.pointer(we))||[0,0];y(we,{x:W,y:ae})}:void 0,ve=E?te.useCallback((we,W)=>{const ae=A.getState().nodeLookup.get(W).internals.userNode;E(we,ae)},[]):void 0,_e=b??q["minimap.ariaLabel"];return F.jsx(oh,{position:g,style:{...e,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*G:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:jt(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:F.jsxs("svg",{width:j,height:L,viewBox:`${ne} ${Q} ${J} ${ie}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":oe,ref:N,onClick:be,children:[_e&&F.jsx("title",{id:oe,children:_e}),F.jsx(XF,{onClick:ve,nodeColor:s,nodeStrokeColor:r,nodeBorderRadius:o,nodeClassName:a,nodeStrokeWidth:l,nodeComponent:u}),F.jsx("path",{className:"react-flow__minimap-mask",d:`M${ne-K},${Q-K}h${J+K*2}v${ie+K*2}h${-J-K*2}z
71
+ M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Zk.displayName="MiniMap";te.memo(Zk);const nG=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,rG={[zs.Line]:"right",[zs.Handle]:"bottom-right"};function iG({nodeId:e,position:n,variant:r=zs.Handle,className:s,style:a=void 0,children:o,color:l,minWidth:u=10,minHeight:h=10,maxWidth:f=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:g,autoScale:y=!0,shouldResize:E,onResizeStart:x,onResize:v,onResizeEnd:b}){const w=Ok(),C=typeof e=="string"?e:w,T=dt(),A=te.useRef(null),N=r===zs.Handle,O=Ve(te.useCallback(nG(N&&y),[N,y]),ht),I=te.useRef(null),k=n??rG[r];te.useEffect(()=>{if(!(!A.current||!C))return I.current||(I.current=R8({domNode:A.current,nodeId:C,getStoreItems:()=>{const{nodeLookup:M,transform:D,snapGrid:z,snapToGrid:q,nodeOrigin:j,domNode:L}=T.getState();return{nodeLookup:M,transform:D,snapGrid:z,snapToGrid:q,nodeOrigin:j,paneDomNode:L}},onChange:(M,D)=>{const{triggerNodeChanges:z,nodeLookup:q,parentLookup:j,nodeOrigin:L}=T.getState(),P=[],H={x:M.x,y:M.y},G=q.get(C);if(G&&G.expandParent&&G.parentId){const V=G.origin??L,B=M.width??G.measured.width??0,K=M.height??G.measured.height??0,ne={id:G.id,parentId:G.parentId,rect:{width:B,height:K,...ek({x:M.x??G.position.x,y:M.y??G.position.y},{width:B,height:K},G.parentId,q,V)}},Q=DC([ne],q,j,L);P.push(...Q),H.x=M.x?Math.max(V[0]*B,M.x):void 0,H.y=M.y?Math.max(V[1]*K,M.y):void 0}if(H.x!==void 0&&H.y!==void 0){const V={id:C,type:"position",position:{...H}};P.push(V)}if(M.width!==void 0&&M.height!==void 0){const B={id:C,type:"dimensions",resizing:!0,setAttributes:g?g==="horizontal"?"width":"height":!0,dimensions:{width:M.width,height:M.height}};P.push(B)}for(const V of D){const B={...V,type:"position"};P.push(B)}z(P)},onEnd:({width:M,height:D})=>{const z={id:C,type:"dimensions",resizing:!1,dimensions:{width:M,height:D}};T.getState().triggerNodeChanges([z])}})),I.current.update({controlPosition:k,boundaries:{minWidth:u,minHeight:h,maxWidth:f,maxHeight:p},keepAspectRatio:d,resizeDirection:g,onResizeStart:x,onResize:v,onResizeEnd:b,shouldResize:E}),()=>{var M;(M=I.current)==null||M.destroy()}},[k,u,h,f,p,d,x,v,b,E]);const R=k.split("-");return F.jsx("div",{className:jt(["react-flow__resize-control","nodrag",...R,r,s]),ref:A,style:{...a,scale:O,...l&&{[N?"backgroundColor":"borderColor"]:l}},children:o})}const UA=te.memo(iG);function sG({nodeId:e,isVisible:n=!0,handleClassName:r,handleStyle:s,lineClassName:a,lineStyle:o,color:l,minWidth:u=10,minHeight:h=10,maxWidth:f=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:d=!1,autoScale:g=!0,shouldResize:y,onResizeStart:E,onResize:x,onResizeEnd:v}){return n?F.jsxs(F.Fragment,{children:[x8.map(b=>F.jsx(UA,{className:a,style:o,nodeId:e,position:b,variant:zs.Line,color:l,minWidth:u,minHeight:h,maxWidth:f,maxHeight:p,onResizeStart:E,keepAspectRatio:d,autoScale:g,shouldResize:y,onResize:x,onResizeEnd:v},b)),C8.map(b=>F.jsx(UA,{className:r,style:s,nodeId:e,position:b,color:l,minWidth:u,minHeight:h,maxWidth:f,maxHeight:p,onResizeStart:E,keepAspectRatio:d,autoScale:g,shouldResize:y,onResize:x,onResizeEnd:v},b))]}):null}const aG=te.memo(function({data:n,selected:r}){const{table:s,visibleTableNames:a,columnChanges:o,removedColumns:l,collapsed:u,onToggleCollapse:h,nodeKey:f,headerColor:p}=n,d=te.useCallback(()=>{h&&f&&h(f)},[h,f]);return F.jsxs("div",{className:"table-node",children:[F.jsx(sG,{minWidth:220,minHeight:40,isVisible:r??!1,lineClassName:"table-node-resize-line",handleClassName:"table-node-resize-handle"}),F.jsx(br,{type:"target",position:Ne.Top}),F.jsxs("div",{className:"table-node-header",style:p?{background:p}:void 0,children:[F.jsx("span",{className:"table-node-header-toggle",onClick:d,children:u?"▶":"▼"}),F.jsx("span",{children:s.schema?`${s.schema}.${s.name}`:s.name})]}),u?F.jsxs("div",{className:"table-node-collapsed-summary",children:[s.columns.length," column",s.columns.length!==1?"s":""]}):F.jsxs("div",{className:"table-node-columns",children:[s.columns.map(g=>{const y=s.foreignKeys.find(v=>v.columnName===g.name),E=y?a.has(y.referencedTable):!1,x=o==null?void 0:o.get(g.name);return F.jsxs("div",{className:`table-node-column ${E?"fk-visible":""}`,children:[F.jsxs("span",{className:"col-indicators",children:[g.isPrimaryKey&&F.jsx("span",{className:"pk-badge",title:"Primary Key",children:"PK"}),y&&F.jsx("span",{className:"fk-badge",title:`FK → ${y.referencedTable}`,children:"FK"})]}),F.jsx("span",{className:"col-name",children:g.name}),F.jsx("span",{className:"col-type",children:g.dataType}),x==="added"&&F.jsx("span",{className:"diff-badge diff-badge-new",children:"NEW"}),x==="type-changed"&&F.jsx("span",{className:"diff-badge diff-badge-changed",children:"CHANGED"}),x==="nullability-changed"&&F.jsx("span",{className:"diff-badge diff-badge-changed",children:"CHANGED"})]},g.name)}),l==null?void 0:l.map(g=>F.jsxs("div",{className:"table-node-column diff-removed",children:[F.jsx("span",{className:"col-indicators"}),F.jsx("span",{className:"col-name diff-strikethrough",children:g.name}),F.jsx("span",{className:"col-type diff-strikethrough",children:g.dataType}),F.jsx("span",{className:"diff-badge diff-badge-removed",children:"REMOVED"})]},`removed-${g.name}`))]}),F.jsx(br,{type:"source",position:Ne.Bottom})]})}),oG=te.memo(function({data:n}){const{ghost:r,onExpand:s,blocked:a}=n;return F.jsxs("div",{className:`ghost-node ${a?"ghost-node-blocked":""}`,onClick:()=>!a&&s(r),children:[F.jsx(br,{type:"target",position:Ne.Top}),F.jsxs("div",{className:"ghost-node-name",children:[a&&F.jsx("span",{className:"ghost-node-lock",title:"Cross-schema expansion disabled",children:"🔒 "}),r.schema?`${r.schema}.${r.tableName}`:r.tableName]}),F.jsxs("div",{className:"ghost-node-count",children:[r.referencingEdges.length," reference",r.referencingEdges.length!==1?"s":""]}),F.jsx("div",{className:"ghost-node-hint",children:a?"Cross-schema expansion off":"Click to expand"}),F.jsx(br,{type:"source",position:Ne.Bottom})]})}),uG=te.memo(function({data:n}){const{tableName:r,schema:s,onAcknowledge:a}=n,o=s?`${s}.${r}`:r;return F.jsxs("div",{className:"deleted-table-node",children:[F.jsx(br,{type:"target",position:Ne.Top}),F.jsx("div",{className:"deleted-table-node-header",children:o}),F.jsxs("div",{className:"deleted-table-node-body",children:[F.jsx("p",{children:"Table removed from database"}),F.jsx("button",{className:"deleted-table-acknowledge",onClick:()=>a(r,s),children:"Acknowledge"})]}),F.jsx(br,{type:"source",position:Ne.Bottom})]})});function PC(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var gm,QA;function lG(){if(QA)return gm;QA=1;function e(){this.__data__=[],this.size=0}return gm=e,gm}var ym,HA;function wo(){if(HA)return ym;HA=1;function e(n,r){return n===r||n!==n&&r!==r}return ym=e,ym}var vm,VA;function ch(){if(VA)return vm;VA=1;var e=wo();function n(r,s){for(var a=r.length;a--;)if(e(r[a][0],s))return a;return-1}return vm=n,vm}var bm,FA;function cG(){if(FA)return bm;FA=1;var e=ch(),n=Array.prototype,r=n.splice;function s(a){var o=this.__data__,l=e(o,a);if(l<0)return!1;var u=o.length-1;return l==u?o.pop():r.call(o,l,1),--this.size,!0}return bm=s,bm}var _m,GA;function fG(){if(GA)return _m;GA=1;var e=ch();function n(r){var s=this.__data__,a=e(s,r);return a<0?void 0:s[a][1]}return _m=n,_m}var wm,KA;function hG(){if(KA)return wm;KA=1;var e=ch();function n(r){return e(this.__data__,r)>-1}return wm=n,wm}var Em,YA;function dG(){if(YA)return Em;YA=1;var e=ch();function n(r,s){var a=this.__data__,o=e(a,r);return o<0?(++this.size,a.push([r,s])):a[o][1]=s,this}return Em=n,Em}var Cm,XA;function fh(){if(XA)return Cm;XA=1;var e=lG(),n=cG(),r=fG(),s=hG(),a=dG();function o(l){var u=-1,h=l==null?0:l.length;for(this.clear();++u<h;){var f=l[u];this.set(f[0],f[1])}}return o.prototype.clear=e,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=s,o.prototype.set=a,Cm=o,Cm}var xm,WA;function pG(){if(WA)return xm;WA=1;var e=fh();function n(){this.__data__=new e,this.size=0}return xm=n,xm}var Sm,JA;function mG(){if(JA)return Sm;JA=1;function e(n){var r=this.__data__,s=r.delete(n);return this.size=r.size,s}return Sm=e,Sm}var Tm,ZA;function gG(){if(ZA)return Tm;ZA=1;function e(n){return this.__data__.get(n)}return Tm=e,Tm}var qm,eN;function yG(){if(eN)return qm;eN=1;function e(n){return this.__data__.has(n)}return qm=e,qm}var Am,tN;function eB(){if(tN)return Am;tN=1;var e=typeof Jc=="object"&&Jc&&Jc.Object===Object&&Jc;return Am=e,Am}var Nm,nN;function ir(){if(nN)return Nm;nN=1;var e=eB(),n=typeof self=="object"&&self&&self.Object===Object&&self,r=e||n||Function("return this")();return Nm=r,Nm}var Rm,rN;function Fs(){if(rN)return Rm;rN=1;var e=ir(),n=e.Symbol;return Rm=n,Rm}var Om,iN;function vG(){if(iN)return Om;iN=1;var e=Fs(),n=Object.prototype,r=n.hasOwnProperty,s=n.toString,a=e?e.toStringTag:void 0;function o(l){var u=r.call(l,a),h=l[a];try{l[a]=void 0;var f=!0}catch{}var p=s.call(l);return f&&(u?l[a]=h:delete l[a]),p}return Om=o,Om}var Mm,sN;function bG(){if(sN)return Mm;sN=1;var e=Object.prototype,n=e.toString;function r(s){return n.call(s)}return Mm=r,Mm}var jm,aN;function Gs(){if(aN)return jm;aN=1;var e=Fs(),n=vG(),r=bG(),s="[object Null]",a="[object Undefined]",o=e?e.toStringTag:void 0;function l(u){return u==null?u===void 0?a:s:o&&o in Object(u)?n(u):r(u)}return jm=l,jm}var Lm,oN;function Bn(){if(oN)return Lm;oN=1;function e(n){var r=typeof n;return n!=null&&(r=="object"||r=="function")}return Lm=e,Lm}var $m,uN;function vl(){if(uN)return $m;uN=1;var e=Gs(),n=Bn(),r="[object AsyncFunction]",s="[object Function]",a="[object GeneratorFunction]",o="[object Proxy]";function l(u){if(!n(u))return!1;var h=e(u);return h==s||h==a||h==r||h==o}return $m=l,$m}var Im,lN;function _G(){if(lN)return Im;lN=1;var e=ir(),n=e["__core-js_shared__"];return Im=n,Im}var Dm,cN;function wG(){if(cN)return Dm;cN=1;var e=_G(),n=(function(){var s=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return s?"Symbol(src)_1."+s:""})();function r(s){return!!n&&n in s}return Dm=r,Dm}var km,fN;function tB(){if(fN)return km;fN=1;var e=Function.prototype,n=e.toString;function r(s){if(s!=null){try{return n.call(s)}catch{}try{return s+""}catch{}}return""}return km=r,km}var Bm,hN;function EG(){if(hN)return Bm;hN=1;var e=vl(),n=wG(),r=Bn(),s=tB(),a=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,h=l.toString,f=u.hasOwnProperty,p=RegExp("^"+h.call(f).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(g){if(!r(g)||n(g))return!1;var y=e(g)?p:o;return y.test(s(g))}return Bm=d,Bm}var Pm,dN;function CG(){if(dN)return Pm;dN=1;function e(n,r){return n==null?void 0:n[r]}return Pm=e,Pm}var zm,pN;function Ks(){if(pN)return zm;pN=1;var e=EG(),n=CG();function r(s,a){var o=n(s,a);return e(o)?o:void 0}return zm=r,zm}var Um,mN;function zC(){if(mN)return Um;mN=1;var e=Ks(),n=ir(),r=e(n,"Map");return Um=r,Um}var Qm,gN;function hh(){if(gN)return Qm;gN=1;var e=Ks(),n=e(Object,"create");return Qm=n,Qm}var Hm,yN;function xG(){if(yN)return Hm;yN=1;var e=hh();function n(){this.__data__=e?e(null):{},this.size=0}return Hm=n,Hm}var Vm,vN;function SG(){if(vN)return Vm;vN=1;function e(n){var r=this.has(n)&&delete this.__data__[n];return this.size-=r?1:0,r}return Vm=e,Vm}var Fm,bN;function TG(){if(bN)return Fm;bN=1;var e=hh(),n="__lodash_hash_undefined__",r=Object.prototype,s=r.hasOwnProperty;function a(o){var l=this.__data__;if(e){var u=l[o];return u===n?void 0:u}return s.call(l,o)?l[o]:void 0}return Fm=a,Fm}var Gm,_N;function qG(){if(_N)return Gm;_N=1;var e=hh(),n=Object.prototype,r=n.hasOwnProperty;function s(a){var o=this.__data__;return e?o[a]!==void 0:r.call(o,a)}return Gm=s,Gm}var Km,wN;function AG(){if(wN)return Km;wN=1;var e=hh(),n="__lodash_hash_undefined__";function r(s,a){var o=this.__data__;return this.size+=this.has(s)?0:1,o[s]=e&&a===void 0?n:a,this}return Km=r,Km}var Ym,EN;function NG(){if(EN)return Ym;EN=1;var e=xG(),n=SG(),r=TG(),s=qG(),a=AG();function o(l){var u=-1,h=l==null?0:l.length;for(this.clear();++u<h;){var f=l[u];this.set(f[0],f[1])}}return o.prototype.clear=e,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=s,o.prototype.set=a,Ym=o,Ym}var Xm,CN;function RG(){if(CN)return Xm;CN=1;var e=NG(),n=fh(),r=zC();function s(){this.size=0,this.__data__={hash:new e,map:new(r||n),string:new e}}return Xm=s,Xm}var Wm,xN;function OG(){if(xN)return Wm;xN=1;function e(n){var r=typeof n;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?n!=="__proto__":n===null}return Wm=e,Wm}var Jm,SN;function dh(){if(SN)return Jm;SN=1;var e=OG();function n(r,s){var a=r.__data__;return e(s)?a[typeof s=="string"?"string":"hash"]:a.map}return Jm=n,Jm}var Zm,TN;function MG(){if(TN)return Zm;TN=1;var e=dh();function n(r){var s=e(this,r).delete(r);return this.size-=s?1:0,s}return Zm=n,Zm}var eg,qN;function jG(){if(qN)return eg;qN=1;var e=dh();function n(r){return e(this,r).get(r)}return eg=n,eg}var tg,AN;function LG(){if(AN)return tg;AN=1;var e=dh();function n(r){return e(this,r).has(r)}return tg=n,tg}var ng,NN;function $G(){if(NN)return ng;NN=1;var e=dh();function n(r,s){var a=e(this,r),o=a.size;return a.set(r,s),this.size+=a.size==o?0:1,this}return ng=n,ng}var rg,RN;function UC(){if(RN)return rg;RN=1;var e=RG(),n=MG(),r=jG(),s=LG(),a=$G();function o(l){var u=-1,h=l==null?0:l.length;for(this.clear();++u<h;){var f=l[u];this.set(f[0],f[1])}}return o.prototype.clear=e,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=s,o.prototype.set=a,rg=o,rg}var ig,ON;function IG(){if(ON)return ig;ON=1;var e=fh(),n=zC(),r=UC(),s=200;function a(o,l){var u=this.__data__;if(u instanceof e){var h=u.__data__;if(!n||h.length<s-1)return h.push([o,l]),this.size=++u.size,this;u=this.__data__=new r(h)}return u.set(o,l),this.size=u.size,this}return ig=a,ig}var sg,MN;function ph(){if(MN)return sg;MN=1;var e=fh(),n=pG(),r=mG(),s=gG(),a=yG(),o=IG();function l(u){var h=this.__data__=new e(u);this.size=h.size}return l.prototype.clear=n,l.prototype.delete=r,l.prototype.get=s,l.prototype.has=a,l.prototype.set=o,sg=l,sg}var ag,jN;function QC(){if(jN)return ag;jN=1;function e(n,r){for(var s=-1,a=n==null?0:n.length;++s<a&&r(n[s],s,n)!==!1;);return n}return ag=e,ag}var og,LN;function nB(){if(LN)return og;LN=1;var e=Ks(),n=(function(){try{var r=e(Object,"defineProperty");return r({},"",{}),r}catch{}})();return og=n,og}var ug,$N;function bl(){if($N)return ug;$N=1;var e=nB();function n(r,s,a){s=="__proto__"&&e?e(r,s,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[s]=a}return ug=n,ug}var lg,IN;function _l(){if(IN)return lg;IN=1;var e=bl(),n=wo(),r=Object.prototype,s=r.hasOwnProperty;function a(o,l,u){var h=o[l];(!(s.call(o,l)&&n(h,u))||u===void 0&&!(l in o))&&e(o,l,u)}return lg=a,lg}var cg,DN;function Ys(){if(DN)return cg;DN=1;var e=_l(),n=bl();function r(s,a,o,l){var u=!o;o||(o={});for(var h=-1,f=a.length;++h<f;){var p=a[h],d=l?l(o[p],s[p],p,o,s):void 0;d===void 0&&(d=s[p]),u?n(o,p,d):e(o,p,d)}return o}return cg=r,cg}var fg,kN;function DG(){if(kN)return fg;kN=1;function e(n,r){for(var s=-1,a=Array(n);++s<n;)a[s]=r(s);return a}return fg=e,fg}var hg,BN;function Er(){if(BN)return hg;BN=1;function e(n){return n!=null&&typeof n=="object"}return hg=e,hg}var dg,PN;function kG(){if(PN)return dg;PN=1;var e=Gs(),n=Er(),r="[object Arguments]";function s(a){return n(a)&&e(a)==r}return dg=s,dg}var pg,zN;function wl(){if(zN)return pg;zN=1;var e=kG(),n=Er(),r=Object.prototype,s=r.hasOwnProperty,a=r.propertyIsEnumerable,o=e((function(){return arguments})())?e:function(l){return n(l)&&s.call(l,"callee")&&!a.call(l,"callee")};return pg=o,pg}var mg,UN;function vt(){if(UN)return mg;UN=1;var e=Array.isArray;return mg=e,mg}var $u={exports:{}},gg,QN;function BG(){if(QN)return gg;QN=1;function e(){return!1}return gg=e,gg}$u.exports;var HN;function Eo(){return HN||(HN=1,(function(e,n){var r=ir(),s=BG(),a=n&&!n.nodeType&&n,o=a&&!0&&e&&!e.nodeType&&e,l=o&&o.exports===a,u=l?r.Buffer:void 0,h=u?u.isBuffer:void 0,f=h||s;e.exports=f})($u,$u.exports)),$u.exports}var yg,VN;function mh(){if(VN)return yg;VN=1;var e=9007199254740991,n=/^(?:0|[1-9]\d*)$/;function r(s,a){var o=typeof s;return a=a??e,!!a&&(o=="number"||o!="symbol"&&n.test(s))&&s>-1&&s%1==0&&s<a}return yg=r,yg}var vg,FN;function HC(){if(FN)return vg;FN=1;var e=9007199254740991;function n(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=e}return vg=n,vg}var bg,GN;function PG(){if(GN)return bg;GN=1;var e=Gs(),n=HC(),r=Er(),s="[object Arguments]",a="[object Array]",o="[object Boolean]",l="[object Date]",u="[object Error]",h="[object Function]",f="[object Map]",p="[object Number]",d="[object Object]",g="[object RegExp]",y="[object Set]",E="[object String]",x="[object WeakMap]",v="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",C="[object Float64Array]",T="[object Int8Array]",A="[object Int16Array]",N="[object Int32Array]",O="[object Uint8Array]",I="[object Uint8ClampedArray]",k="[object Uint16Array]",R="[object Uint32Array]",M={};M[w]=M[C]=M[T]=M[A]=M[N]=M[O]=M[I]=M[k]=M[R]=!0,M[s]=M[a]=M[v]=M[o]=M[b]=M[l]=M[u]=M[h]=M[f]=M[p]=M[d]=M[g]=M[y]=M[E]=M[x]=!1;function D(z){return r(z)&&n(z.length)&&!!M[e(z)]}return bg=D,bg}var _g,KN;function gh(){if(KN)return _g;KN=1;function e(n){return function(r){return n(r)}}return _g=e,_g}var Iu={exports:{}};Iu.exports;var YN;function VC(){return YN||(YN=1,(function(e,n){var r=eB(),s=n&&!n.nodeType&&n,a=s&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===s,l=o&&r.process,u=(function(){try{var h=a&&a.require&&a.require("util").types;return h||l&&l.binding&&l.binding("util")}catch{}})();e.exports=u})(Iu,Iu.exports)),Iu.exports}var wg,XN;function Co(){if(XN)return wg;XN=1;var e=PG(),n=gh(),r=VC(),s=r&&r.isTypedArray,a=s?n(s):e;return wg=a,wg}var Eg,WN;function rB(){if(WN)return Eg;WN=1;var e=DG(),n=wl(),r=vt(),s=Eo(),a=mh(),o=Co(),l=Object.prototype,u=l.hasOwnProperty;function h(f,p){var d=r(f),g=!d&&n(f),y=!d&&!g&&s(f),E=!d&&!g&&!y&&o(f),x=d||g||y||E,v=x?e(f.length,String):[],b=v.length;for(var w in f)(p||u.call(f,w))&&!(x&&(w=="length"||y&&(w=="offset"||w=="parent")||E&&(w=="buffer"||w=="byteLength"||w=="byteOffset")||a(w,b)))&&v.push(w);return v}return Eg=h,Eg}var Cg,JN;function El(){if(JN)return Cg;JN=1;var e=Object.prototype;function n(r){var s=r&&r.constructor,a=typeof s=="function"&&s.prototype||e;return r===a}return Cg=n,Cg}var xg,ZN;function iB(){if(ZN)return xg;ZN=1;function e(n,r){return function(s){return n(r(s))}}return xg=e,xg}var Sg,eR;function zG(){if(eR)return Sg;eR=1;var e=iB(),n=e(Object.keys,Object);return Sg=n,Sg}var Tg,tR;function FC(){if(tR)return Tg;tR=1;var e=El(),n=zG(),r=Object.prototype,s=r.hasOwnProperty;function a(o){if(!e(o))return n(o);var l=[];for(var u in Object(o))s.call(o,u)&&u!="constructor"&&l.push(u);return l}return Tg=a,Tg}var qg,nR;function sr(){if(nR)return qg;nR=1;var e=vl(),n=HC();function r(s){return s!=null&&n(s.length)&&!e(s)}return qg=r,qg}var Ag,rR;function ei(){if(rR)return Ag;rR=1;var e=rB(),n=FC(),r=sr();function s(a){return r(a)?e(a):n(a)}return Ag=s,Ag}var Ng,iR;function UG(){if(iR)return Ng;iR=1;var e=Ys(),n=ei();function r(s,a){return s&&e(a,n(a),s)}return Ng=r,Ng}var Rg,sR;function QG(){if(sR)return Rg;sR=1;function e(n){var r=[];if(n!=null)for(var s in Object(n))r.push(s);return r}return Rg=e,Rg}var Og,aR;function HG(){if(aR)return Og;aR=1;var e=Bn(),n=El(),r=QG(),s=Object.prototype,a=s.hasOwnProperty;function o(l){if(!e(l))return r(l);var u=n(l),h=[];for(var f in l)f=="constructor"&&(u||!a.call(l,f))||h.push(f);return h}return Og=o,Og}var Mg,oR;function Xi(){if(oR)return Mg;oR=1;var e=rB(),n=HG(),r=sr();function s(a){return r(a)?e(a,!0):n(a)}return Mg=s,Mg}var jg,uR;function VG(){if(uR)return jg;uR=1;var e=Ys(),n=Xi();function r(s,a){return s&&e(a,n(a),s)}return jg=r,jg}var Du={exports:{}};Du.exports;var lR;function sB(){return lR||(lR=1,(function(e,n){var r=ir(),s=n&&!n.nodeType&&n,a=s&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===s,l=o?r.Buffer:void 0,u=l?l.allocUnsafe:void 0;function h(f,p){if(p)return f.slice();var d=f.length,g=u?u(d):new f.constructor(d);return f.copy(g),g}e.exports=h})(Du,Du.exports)),Du.exports}var Lg,cR;function GC(){if(cR)return Lg;cR=1;function e(n,r){var s=-1,a=n.length;for(r||(r=Array(a));++s<a;)r[s]=n[s];return r}return Lg=e,Lg}var $g,fR;function KC(){if(fR)return $g;fR=1;function e(n,r){for(var s=-1,a=n==null?0:n.length,o=0,l=[];++s<a;){var u=n[s];r(u,s,n)&&(l[o++]=u)}return l}return $g=e,$g}var Ig,hR;function aB(){if(hR)return Ig;hR=1;function e(){return[]}return Ig=e,Ig}var Dg,dR;function YC(){if(dR)return Dg;dR=1;var e=KC(),n=aB(),r=Object.prototype,s=r.propertyIsEnumerable,a=Object.getOwnPropertySymbols,o=a?function(l){return l==null?[]:(l=Object(l),e(a(l),function(u){return s.call(l,u)}))}:n;return Dg=o,Dg}var kg,pR;function FG(){if(pR)return kg;pR=1;var e=Ys(),n=YC();function r(s,a){return e(s,n(s),a)}return kg=r,kg}var Bg,mR;function XC(){if(mR)return Bg;mR=1;function e(n,r){for(var s=-1,a=r.length,o=n.length;++s<a;)n[o+s]=r[s];return n}return Bg=e,Bg}var Pg,gR;function yh(){if(gR)return Pg;gR=1;var e=iB(),n=e(Object.getPrototypeOf,Object);return Pg=n,Pg}var zg,yR;function oB(){if(yR)return zg;yR=1;var e=XC(),n=yh(),r=YC(),s=aB(),a=Object.getOwnPropertySymbols,o=a?function(l){for(var u=[];l;)e(u,r(l)),l=n(l);return u}:s;return zg=o,zg}var Ug,vR;function GG(){if(vR)return Ug;vR=1;var e=Ys(),n=oB();function r(s,a){return e(s,n(s),a)}return Ug=r,Ug}var Qg,bR;function uB(){if(bR)return Qg;bR=1;var e=XC(),n=vt();function r(s,a,o){var l=a(s);return n(s)?l:e(l,o(s))}return Qg=r,Qg}var Hg,_R;function lB(){if(_R)return Hg;_R=1;var e=uB(),n=YC(),r=ei();function s(a){return e(a,r,n)}return Hg=s,Hg}var Vg,wR;function cB(){if(wR)return Vg;wR=1;var e=uB(),n=oB(),r=Xi();function s(a){return e(a,r,n)}return Vg=s,Vg}var Fg,ER;function KG(){if(ER)return Fg;ER=1;var e=Ks(),n=ir(),r=e(n,"DataView");return Fg=r,Fg}var Gg,CR;function YG(){if(CR)return Gg;CR=1;var e=Ks(),n=ir(),r=e(n,"Promise");return Gg=r,Gg}var Kg,xR;function fB(){if(xR)return Kg;xR=1;var e=Ks(),n=ir(),r=e(n,"Set");return Kg=r,Kg}var Yg,SR;function XG(){if(SR)return Yg;SR=1;var e=Ks(),n=ir(),r=e(n,"WeakMap");return Yg=r,Yg}var Xg,TR;function Xs(){if(TR)return Xg;TR=1;var e=KG(),n=zC(),r=YG(),s=fB(),a=XG(),o=Gs(),l=tB(),u="[object Map]",h="[object Object]",f="[object Promise]",p="[object Set]",d="[object WeakMap]",g="[object DataView]",y=l(e),E=l(n),x=l(r),v=l(s),b=l(a),w=o;return(e&&w(new e(new ArrayBuffer(1)))!=g||n&&w(new n)!=u||r&&w(r.resolve())!=f||s&&w(new s)!=p||a&&w(new a)!=d)&&(w=function(C){var T=o(C),A=T==h?C.constructor:void 0,N=A?l(A):"";if(N)switch(N){case y:return g;case E:return u;case x:return f;case v:return p;case b:return d}return T}),Xg=w,Xg}var Wg,qR;function WG(){if(qR)return Wg;qR=1;var e=Object.prototype,n=e.hasOwnProperty;function r(s){var a=s.length,o=new s.constructor(a);return a&&typeof s[0]=="string"&&n.call(s,"index")&&(o.index=s.index,o.input=s.input),o}return Wg=r,Wg}var Jg,AR;function hB(){if(AR)return Jg;AR=1;var e=ir(),n=e.Uint8Array;return Jg=n,Jg}var Zg,NR;function WC(){if(NR)return Zg;NR=1;var e=hB();function n(r){var s=new r.constructor(r.byteLength);return new e(s).set(new e(r)),s}return Zg=n,Zg}var ey,RR;function JG(){if(RR)return ey;RR=1;var e=WC();function n(r,s){var a=s?e(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.byteLength)}return ey=n,ey}var ty,OR;function ZG(){if(OR)return ty;OR=1;var e=/\w*$/;function n(r){var s=new r.constructor(r.source,e.exec(r));return s.lastIndex=r.lastIndex,s}return ty=n,ty}var ny,MR;function e9(){if(MR)return ny;MR=1;var e=Fs(),n=e?e.prototype:void 0,r=n?n.valueOf:void 0;function s(a){return r?Object(r.call(a)):{}}return ny=s,ny}var ry,jR;function dB(){if(jR)return ry;jR=1;var e=WC();function n(r,s){var a=s?e(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.length)}return ry=n,ry}var iy,LR;function t9(){if(LR)return iy;LR=1;var e=WC(),n=JG(),r=ZG(),s=e9(),a=dB(),o="[object Boolean]",l="[object Date]",u="[object Map]",h="[object Number]",f="[object RegExp]",p="[object Set]",d="[object String]",g="[object Symbol]",y="[object ArrayBuffer]",E="[object DataView]",x="[object Float32Array]",v="[object Float64Array]",b="[object Int8Array]",w="[object Int16Array]",C="[object Int32Array]",T="[object Uint8Array]",A="[object Uint8ClampedArray]",N="[object Uint16Array]",O="[object Uint32Array]";function I(k,R,M){var D=k.constructor;switch(R){case y:return e(k);case o:case l:return new D(+k);case E:return n(k,M);case x:case v:case b:case w:case C:case T:case A:case N:case O:return a(k,M);case u:return new D;case h:case d:return new D(k);case f:return r(k);case p:return new D;case g:return s(k)}}return iy=I,iy}var sy,$R;function pB(){if($R)return sy;$R=1;var e=Bn(),n=Object.create,r=(function(){function s(){}return function(a){if(!e(a))return{};if(n)return n(a);s.prototype=a;var o=new s;return s.prototype=void 0,o}})();return sy=r,sy}var ay,IR;function mB(){if(IR)return ay;IR=1;var e=pB(),n=yh(),r=El();function s(a){return typeof a.constructor=="function"&&!r(a)?e(n(a)):{}}return ay=s,ay}var oy,DR;function n9(){if(DR)return oy;DR=1;var e=Xs(),n=Er(),r="[object Map]";function s(a){return n(a)&&e(a)==r}return oy=s,oy}var uy,kR;function r9(){if(kR)return uy;kR=1;var e=n9(),n=gh(),r=VC(),s=r&&r.isMap,a=s?n(s):e;return uy=a,uy}var ly,BR;function i9(){if(BR)return ly;BR=1;var e=Xs(),n=Er(),r="[object Set]";function s(a){return n(a)&&e(a)==r}return ly=s,ly}var cy,PR;function s9(){if(PR)return cy;PR=1;var e=i9(),n=gh(),r=VC(),s=r&&r.isSet,a=s?n(s):e;return cy=a,cy}var fy,zR;function gB(){if(zR)return fy;zR=1;var e=ph(),n=QC(),r=_l(),s=UG(),a=VG(),o=sB(),l=GC(),u=FG(),h=GG(),f=lB(),p=cB(),d=Xs(),g=WG(),y=t9(),E=mB(),x=vt(),v=Eo(),b=r9(),w=Bn(),C=s9(),T=ei(),A=Xi(),N=1,O=2,I=4,k="[object Arguments]",R="[object Array]",M="[object Boolean]",D="[object Date]",z="[object Error]",q="[object Function]",j="[object GeneratorFunction]",L="[object Map]",P="[object Number]",H="[object Object]",G="[object RegExp]",V="[object Set]",B="[object String]",K="[object Symbol]",ne="[object WeakMap]",Q="[object ArrayBuffer]",J="[object DataView]",ie="[object Float32Array]",oe="[object Float64Array]",ee="[object Int8Array]",fe="[object Int16Array]",be="[object Int32Array]",ve="[object Uint8Array]",_e="[object Uint8ClampedArray]",we="[object Uint16Array]",W="[object Uint32Array]",ae={};ae[k]=ae[R]=ae[Q]=ae[J]=ae[M]=ae[D]=ae[ie]=ae[oe]=ae[ee]=ae[fe]=ae[be]=ae[L]=ae[P]=ae[H]=ae[G]=ae[V]=ae[B]=ae[K]=ae[ve]=ae[_e]=ae[we]=ae[W]=!0,ae[z]=ae[q]=ae[ne]=!1;function xe(Se,gt,ut,It,Tt,qt){var Fe,Oe=gt&N,Xe=gt&O,We=gt&I;if(ut&&(Fe=Tt?ut(Se,It,Tt,qt):ut(Se)),Fe!==void 0)return Fe;if(!w(Se))return Se;var rt=x(Se);if(rt){if(Fe=g(Se),!Oe)return l(Se,Fe)}else{var de=d(Se),X=de==q||de==j;if(v(Se))return o(Se,Oe);if(de==H||de==k||X&&!Tt){if(Fe=Xe||X?{}:E(Se),!Oe)return Xe?h(Se,a(Fe,Se)):u(Se,s(Fe,Se))}else{if(!ae[de])return Tt?Se:{};Fe=y(Se,de,Oe)}}qt||(qt=new e);var Me=qt.get(Se);if(Me)return Me;qt.set(Se,Fe),C(Se)?Se.forEach(function(Ft){Fe.add(xe(Ft,gt,ut,Ft,Se,qt))}):b(Se)&&Se.forEach(function(Ft,yt){Fe.set(yt,xe(Ft,gt,ut,yt,Se,qt))});var Mo=We?Xe?p:f:Xe?A:T,sa=rt?void 0:Mo(Se);return n(sa||Se,function(Ft,yt){sa&&(yt=Ft,Ft=Se[yt]),r(Fe,yt,xe(Ft,gt,ut,yt,Se,qt))}),Fe}return fy=xe,fy}var hy,UR;function vh(){if(UR)return hy;UR=1;var e=gB(),n=4;function r(s){return e(s,n)}return hy=r,hy}var dy,QR;function bh(){if(QR)return dy;QR=1;function e(n){return function(){return n}}return dy=e,dy}var py,HR;function a9(){if(HR)return py;HR=1;function e(n){return function(r,s,a){for(var o=-1,l=Object(r),u=a(r),h=u.length;h--;){var f=u[n?h:++o];if(s(l[f],f,l)===!1)break}return r}}return py=e,py}var my,VR;function JC(){if(VR)return my;VR=1;var e=a9(),n=e();return my=n,my}var gy,FR;function ZC(){if(FR)return gy;FR=1;var e=JC(),n=ei();function r(s,a){return s&&e(s,a,n)}return gy=r,gy}var yy,GR;function o9(){if(GR)return yy;GR=1;var e=sr();function n(r,s){return function(a,o){if(a==null)return a;if(!e(a))return r(a,o);for(var l=a.length,u=s?l:-1,h=Object(a);(s?u--:++u<l)&&o(h[u],u,h)!==!1;);return a}}return yy=n,yy}var vy,KR;function xo(){if(KR)return vy;KR=1;var e=ZC(),n=o9(),r=n(e);return vy=r,vy}var by,YR;function tn(){if(YR)return by;YR=1;function e(n){return n}return by=e,by}var _y,XR;function yB(){if(XR)return _y;XR=1;var e=tn();function n(r){return typeof r=="function"?r:e}return _y=n,_y}var wy,WR;function vB(){if(WR)return wy;WR=1;var e=QC(),n=xo(),r=yB(),s=vt();function a(o,l){var u=s(o)?e:n;return u(o,r(l))}return wy=a,wy}var Ey,JR;function Ws(){return JR||(JR=1,Ey=vB()),Ey}var Cy,ZR;function bB(){if(ZR)return Cy;ZR=1;var e=xo();function n(r,s){var a=[];return e(r,function(o,l,u){s(o,l,u)&&a.push(o)}),a}return Cy=n,Cy}var xy,eO;function u9(){if(eO)return xy;eO=1;var e="__lodash_hash_undefined__";function n(r){return this.__data__.set(r,e),this}return xy=n,xy}var Sy,tO;function l9(){if(tO)return Sy;tO=1;function e(n){return this.__data__.has(n)}return Sy=e,Sy}var Ty,nO;function _B(){if(nO)return Ty;nO=1;var e=UC(),n=u9(),r=l9();function s(a){var o=-1,l=a==null?0:a.length;for(this.__data__=new e;++o<l;)this.add(a[o])}return s.prototype.add=s.prototype.push=n,s.prototype.has=r,Ty=s,Ty}var qy,rO;function wB(){if(rO)return qy;rO=1;function e(n,r){for(var s=-1,a=n==null?0:n.length;++s<a;)if(r(n[s],s,n))return!0;return!1}return qy=e,qy}var Ay,iO;function EB(){if(iO)return Ay;iO=1;function e(n,r){return n.has(r)}return Ay=e,Ay}var Ny,sO;function CB(){if(sO)return Ny;sO=1;var e=_B(),n=wB(),r=EB(),s=1,a=2;function o(l,u,h,f,p,d){var g=h&s,y=l.length,E=u.length;if(y!=E&&!(g&&E>y))return!1;var x=d.get(l),v=d.get(u);if(x&&v)return x==u&&v==l;var b=-1,w=!0,C=h&a?new e:void 0;for(d.set(l,u),d.set(u,l);++b<y;){var T=l[b],A=u[b];if(f)var N=g?f(A,T,b,u,l,d):f(T,A,b,l,u,d);if(N!==void 0){if(N)continue;w=!1;break}if(C){if(!n(u,function(O,I){if(!r(C,I)&&(T===O||p(T,O,h,f,d)))return C.push(I)})){w=!1;break}}else if(!(T===A||p(T,A,h,f,d))){w=!1;break}}return d.delete(l),d.delete(u),w}return Ny=o,Ny}var Ry,aO;function xB(){if(aO)return Ry;aO=1;function e(n){var r=-1,s=Array(n.size);return n.forEach(function(a,o){s[++r]=[o,a]}),s}return Ry=e,Ry}var Oy,oO;function _h(){if(oO)return Oy;oO=1;function e(n){var r=-1,s=Array(n.size);return n.forEach(function(a){s[++r]=a}),s}return Oy=e,Oy}var My,uO;function c9(){if(uO)return My;uO=1;var e=Fs(),n=hB(),r=wo(),s=CB(),a=xB(),o=_h(),l=1,u=2,h="[object Boolean]",f="[object Date]",p="[object Error]",d="[object Map]",g="[object Number]",y="[object RegExp]",E="[object Set]",x="[object String]",v="[object Symbol]",b="[object ArrayBuffer]",w="[object DataView]",C=e?e.prototype:void 0,T=C?C.valueOf:void 0;function A(N,O,I,k,R,M,D){switch(I){case w:if(N.byteLength!=O.byteLength||N.byteOffset!=O.byteOffset)return!1;N=N.buffer,O=O.buffer;case b:return!(N.byteLength!=O.byteLength||!M(new n(N),new n(O)));case h:case f:case g:return r(+N,+O);case p:return N.name==O.name&&N.message==O.message;case y:case x:return N==O+"";case d:var z=a;case E:var q=k&l;if(z||(z=o),N.size!=O.size&&!q)return!1;var j=D.get(N);if(j)return j==O;k|=u,D.set(N,O);var L=s(z(N),z(O),k,R,M,D);return D.delete(N),L;case v:if(T)return T.call(N)==T.call(O)}return!1}return My=A,My}var jy,lO;function f9(){if(lO)return jy;lO=1;var e=lB(),n=1,r=Object.prototype,s=r.hasOwnProperty;function a(o,l,u,h,f,p){var d=u&n,g=e(o),y=g.length,E=e(l),x=E.length;if(y!=x&&!d)return!1;for(var v=y;v--;){var b=g[v];if(!(d?b in l:s.call(l,b)))return!1}var w=p.get(o),C=p.get(l);if(w&&C)return w==l&&C==o;var T=!0;p.set(o,l),p.set(l,o);for(var A=d;++v<y;){b=g[v];var N=o[b],O=l[b];if(h)var I=d?h(O,N,b,l,o,p):h(N,O,b,o,l,p);if(!(I===void 0?N===O||f(N,O,u,h,p):I)){T=!1;break}A||(A=b=="constructor")}if(T&&!A){var k=o.constructor,R=l.constructor;k!=R&&"constructor"in o&&"constructor"in l&&!(typeof k=="function"&&k instanceof k&&typeof R=="function"&&R instanceof R)&&(T=!1)}return p.delete(o),p.delete(l),T}return jy=a,jy}var Ly,cO;function h9(){if(cO)return Ly;cO=1;var e=ph(),n=CB(),r=c9(),s=f9(),a=Xs(),o=vt(),l=Eo(),u=Co(),h=1,f="[object Arguments]",p="[object Array]",d="[object Object]",g=Object.prototype,y=g.hasOwnProperty;function E(x,v,b,w,C,T){var A=o(x),N=o(v),O=A?p:a(x),I=N?p:a(v);O=O==f?d:O,I=I==f?d:I;var k=O==d,R=I==d,M=O==I;if(M&&l(x)){if(!l(v))return!1;A=!0,k=!1}if(M&&!k)return T||(T=new e),A||u(x)?n(x,v,b,w,C,T):r(x,v,O,b,w,C,T);if(!(b&h)){var D=k&&y.call(x,"__wrapped__"),z=R&&y.call(v,"__wrapped__");if(D||z){var q=D?x.value():x,j=z?v.value():v;return T||(T=new e),C(q,j,b,w,T)}}return M?(T||(T=new e),s(x,v,b,w,C,T)):!1}return Ly=E,Ly}var $y,fO;function SB(){if(fO)return $y;fO=1;var e=h9(),n=Er();function r(s,a,o,l,u){return s===a?!0:s==null||a==null||!n(s)&&!n(a)?s!==s&&a!==a:e(s,a,o,l,r,u)}return $y=r,$y}var Iy,hO;function d9(){if(hO)return Iy;hO=1;var e=ph(),n=SB(),r=1,s=2;function a(o,l,u,h){var f=u.length,p=f,d=!h;if(o==null)return!p;for(o=Object(o);f--;){var g=u[f];if(d&&g[2]?g[1]!==o[g[0]]:!(g[0]in o))return!1}for(;++f<p;){g=u[f];var y=g[0],E=o[y],x=g[1];if(d&&g[2]){if(E===void 0&&!(y in o))return!1}else{var v=new e;if(h)var b=h(E,x,y,o,l,v);if(!(b===void 0?n(x,E,r|s,h,v):b))return!1}}return!0}return Iy=a,Iy}var Dy,dO;function TB(){if(dO)return Dy;dO=1;var e=Bn();function n(r){return r===r&&!e(r)}return Dy=n,Dy}var ky,pO;function p9(){if(pO)return ky;pO=1;var e=TB(),n=ei();function r(s){for(var a=n(s),o=a.length;o--;){var l=a[o],u=s[l];a[o]=[l,u,e(u)]}return a}return ky=r,ky}var By,mO;function qB(){if(mO)return By;mO=1;function e(n,r){return function(s){return s==null?!1:s[n]===r&&(r!==void 0||n in Object(s))}}return By=e,By}var Py,gO;function m9(){if(gO)return Py;gO=1;var e=d9(),n=p9(),r=qB();function s(a){var o=n(a);return o.length==1&&o[0][2]?r(o[0][0],o[0][1]):function(l){return l===a||e(l,a,o)}}return Py=s,Py}var zy,yO;function So(){if(yO)return zy;yO=1;var e=Gs(),n=Er(),r="[object Symbol]";function s(a){return typeof a=="symbol"||n(a)&&e(a)==r}return zy=s,zy}var Uy,vO;function ex(){if(vO)return Uy;vO=1;var e=vt(),n=So(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;function a(o,l){if(e(o))return!1;var u=typeof o;return u=="number"||u=="symbol"||u=="boolean"||o==null||n(o)?!0:s.test(o)||!r.test(o)||l!=null&&o in Object(l)}return Uy=a,Uy}var Qy,bO;function g9(){if(bO)return Qy;bO=1;var e=UC(),n="Expected a function";function r(s,a){if(typeof s!="function"||a!=null&&typeof a!="function")throw new TypeError(n);var o=function(){var l=arguments,u=a?a.apply(this,l):l[0],h=o.cache;if(h.has(u))return h.get(u);var f=s.apply(this,l);return o.cache=h.set(u,f)||h,f};return o.cache=new(r.Cache||e),o}return r.Cache=e,Qy=r,Qy}var Hy,_O;function y9(){if(_O)return Hy;_O=1;var e=g9(),n=500;function r(s){var a=e(s,function(l){return o.size===n&&o.clear(),l}),o=a.cache;return a}return Hy=r,Hy}var Vy,wO;function v9(){if(wO)return Vy;wO=1;var e=y9(),n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,s=e(function(a){var o=[];return a.charCodeAt(0)===46&&o.push(""),a.replace(n,function(l,u,h,f){o.push(h?f.replace(r,"$1"):u||l)}),o});return Vy=s,Vy}var Fy,EO;function Cl(){if(EO)return Fy;EO=1;function e(n,r){for(var s=-1,a=n==null?0:n.length,o=Array(a);++s<a;)o[s]=r(n[s],s,n);return o}return Fy=e,Fy}var Gy,CO;function b9(){if(CO)return Gy;CO=1;var e=Fs(),n=Cl(),r=vt(),s=So(),a=e?e.prototype:void 0,o=a?a.toString:void 0;function l(u){if(typeof u=="string")return u;if(r(u))return n(u,l)+"";if(s(u))return o?o.call(u):"";var h=u+"";return h=="0"&&1/u==-1/0?"-0":h}return Gy=l,Gy}var Ky,xO;function AB(){if(xO)return Ky;xO=1;var e=b9();function n(r){return r==null?"":e(r)}return Ky=n,Ky}var Yy,SO;function wh(){if(SO)return Yy;SO=1;var e=vt(),n=ex(),r=v9(),s=AB();function a(o,l){return e(o)?o:n(o,l)?[o]:r(s(o))}return Yy=a,Yy}var Xy,TO;function xl(){if(TO)return Xy;TO=1;var e=So();function n(r){if(typeof r=="string"||e(r))return r;var s=r+"";return s=="0"&&1/r==-1/0?"-0":s}return Xy=n,Xy}var Wy,qO;function Eh(){if(qO)return Wy;qO=1;var e=wh(),n=xl();function r(s,a){a=e(a,s);for(var o=0,l=a.length;s!=null&&o<l;)s=s[n(a[o++])];return o&&o==l?s:void 0}return Wy=r,Wy}var Jy,AO;function _9(){if(AO)return Jy;AO=1;var e=Eh();function n(r,s,a){var o=r==null?void 0:e(r,s);return o===void 0?a:o}return Jy=n,Jy}var Zy,NO;function w9(){if(NO)return Zy;NO=1;function e(n,r){return n!=null&&r in Object(n)}return Zy=e,Zy}var ev,RO;function NB(){if(RO)return ev;RO=1;var e=wh(),n=wl(),r=vt(),s=mh(),a=HC(),o=xl();function l(u,h,f){h=e(h,u);for(var p=-1,d=h.length,g=!1;++p<d;){var y=o(h[p]);if(!(g=u!=null&&f(u,y)))break;u=u[y]}return g||++p!=d?g:(d=u==null?0:u.length,!!d&&a(d)&&s(y,d)&&(r(u)||n(u)))}return ev=l,ev}var tv,OO;function RB(){if(OO)return tv;OO=1;var e=w9(),n=NB();function r(s,a){return s!=null&&n(s,a,e)}return tv=r,tv}var nv,MO;function E9(){if(MO)return nv;MO=1;var e=SB(),n=_9(),r=RB(),s=ex(),a=TB(),o=qB(),l=xl(),u=1,h=2;function f(p,d){return s(p)&&a(d)?o(l(p),d):function(g){var y=n(g,p);return y===void 0&&y===d?r(g,p):e(d,y,u|h)}}return nv=f,nv}var rv,jO;function OB(){if(jO)return rv;jO=1;function e(n){return function(r){return r==null?void 0:r[n]}}return rv=e,rv}var iv,LO;function C9(){if(LO)return iv;LO=1;var e=Eh();function n(r){return function(s){return e(s,r)}}return iv=n,iv}var sv,$O;function x9(){if($O)return sv;$O=1;var e=OB(),n=C9(),r=ex(),s=xl();function a(o){return r(o)?e(s(o)):n(o)}return sv=a,sv}var av,IO;function mn(){if(IO)return av;IO=1;var e=m9(),n=E9(),r=tn(),s=vt(),a=x9();function o(l){return typeof l=="function"?l:l==null?r:typeof l=="object"?s(l)?n(l[0],l[1]):e(l):a(l)}return av=o,av}var ov,DO;function tx(){if(DO)return ov;DO=1;var e=KC(),n=bB(),r=mn(),s=vt();function a(o,l){var u=s(o)?e:n;return u(o,r(l,3))}return ov=a,ov}var uv,kO;function S9(){if(kO)return uv;kO=1;var e=Object.prototype,n=e.hasOwnProperty;function r(s,a){return s!=null&&n.call(s,a)}return uv=r,uv}var lv,BO;function To(){if(BO)return lv;BO=1;var e=S9(),n=NB();function r(s,a){return s!=null&&n(s,a,e)}return lv=r,lv}var cv,PO;function qn(){if(PO)return cv;PO=1;var e=FC(),n=Xs(),r=wl(),s=vt(),a=sr(),o=Eo(),l=El(),u=Co(),h="[object Map]",f="[object Set]",p=Object.prototype,d=p.hasOwnProperty;function g(y){if(y==null)return!0;if(a(y)&&(s(y)||typeof y=="string"||typeof y.splice=="function"||o(y)||u(y)||r(y)))return!y.length;var E=n(y);if(E==h||E==f)return!y.size;if(l(y))return!e(y).length;for(var x in y)if(d.call(y,x))return!1;return!0}return cv=g,cv}var fv,zO;function MB(){if(zO)return fv;zO=1;function e(n){return n===void 0}return fv=e,fv}var hv,UO;function jB(){if(UO)return hv;UO=1;var e=xo(),n=sr();function r(s,a){var o=-1,l=n(s)?Array(s.length):[];return e(s,function(u,h,f){l[++o]=a(u,h,f)}),l}return hv=r,hv}var dv,QO;function ti(){if(QO)return dv;QO=1;var e=Cl(),n=mn(),r=jB(),s=vt();function a(o,l){var u=s(o)?e:r;return u(o,n(l,3))}return dv=a,dv}var pv,HO;function T9(){if(HO)return pv;HO=1;function e(n,r,s,a){var o=-1,l=n==null?0:n.length;for(a&&l&&(s=n[++o]);++o<l;)s=r(s,n[o],o,n);return s}return pv=e,pv}var mv,VO;function q9(){if(VO)return mv;VO=1;function e(n,r,s,a,o){return o(n,function(l,u,h){s=a?(a=!1,l):r(s,l,u,h)}),s}return mv=e,mv}var gv,FO;function Js(){if(FO)return gv;FO=1;var e=T9(),n=xo(),r=mn(),s=q9(),a=vt();function o(l,u,h){var f=a(l)?e:s,p=arguments.length<3;return f(l,r(u,4),h,p,n)}return gv=o,gv}var yv,GO;function LB(){if(GO)return yv;GO=1;var e=Gs(),n=vt(),r=Er(),s="[object String]";function a(o){return typeof o=="string"||!n(o)&&r(o)&&e(o)==s}return yv=a,yv}var vv,KO;function A9(){if(KO)return vv;KO=1;var e=OB(),n=e("length");return vv=n,vv}var bv,YO;function $B(){if(YO)return bv;YO=1;var e="\\ud800-\\udfff",n="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",a=n+r+s,o="\\ufe0e\\ufe0f",l="\\u200d",u=RegExp("["+l+e+a+o+"]");function h(f){return u.test(f)}return bv=h,bv}var _v,XO;function N9(){if(XO)return _v;XO=1;var e="\\ud800-\\udfff",n="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",a=n+r+s,o="\\ufe0e\\ufe0f",l="["+e+"]",u="["+a+"]",h="\\ud83c[\\udffb-\\udfff]",f="(?:"+u+"|"+h+")",p="[^"+e+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",y="\\u200d",E=f+"?",x="["+o+"]?",v="(?:"+y+"(?:"+[p,d,g].join("|")+")"+x+E+")*",b=x+E+v,w="(?:"+[p+u+"?",u,d,g,l].join("|")+")",C=RegExp(h+"(?="+h+")|"+w+b,"g");function T(A){for(var N=C.lastIndex=0;C.test(A);)++N;return N}return _v=T,_v}var wv,WO;function R9(){if(WO)return wv;WO=1;var e=A9(),n=$B(),r=N9();function s(a){return n(a)?r(a):e(a)}return wv=s,wv}var Ev,JO;function O9(){if(JO)return Ev;JO=1;var e=FC(),n=Xs(),r=sr(),s=LB(),a=R9(),o="[object Map]",l="[object Set]";function u(h){if(h==null)return 0;if(r(h))return s(h)?a(h):h.length;var f=n(h);return f==o||f==l?h.size:e(h).length}return Ev=u,Ev}var Cv,ZO;function IB(){if(ZO)return Cv;ZO=1;var e=QC(),n=pB(),r=ZC(),s=mn(),a=yh(),o=vt(),l=Eo(),u=vl(),h=Bn(),f=Co();function p(d,g,y){var E=o(d),x=E||l(d)||f(d);if(g=s(g,4),y==null){var v=d&&d.constructor;x?y=E?new v:[]:h(d)?y=u(v)?n(a(d)):{}:y={}}return(x?e:r)(d,function(b,w,C){return g(y,b,w,C)}),y}return Cv=p,Cv}var xv,eM;function M9(){if(eM)return xv;eM=1;var e=Fs(),n=wl(),r=vt(),s=e?e.isConcatSpreadable:void 0;function a(o){return r(o)||n(o)||!!(s&&o&&o[s])}return xv=a,xv}var Sv,tM;function nx(){if(tM)return Sv;tM=1;var e=XC(),n=M9();function r(s,a,o,l,u){var h=-1,f=s.length;for(o||(o=n),u||(u=[]);++h<f;){var p=s[h];a>0&&o(p)?a>1?r(p,a-1,o,l,u):e(u,p):l||(u[u.length]=p)}return u}return Sv=r,Sv}var Tv,nM;function j9(){if(nM)return Tv;nM=1;function e(n,r,s){switch(s.length){case 0:return n.call(r);case 1:return n.call(r,s[0]);case 2:return n.call(r,s[0],s[1]);case 3:return n.call(r,s[0],s[1],s[2])}return n.apply(r,s)}return Tv=e,Tv}var qv,rM;function DB(){if(rM)return qv;rM=1;var e=j9(),n=Math.max;function r(s,a,o){return a=n(a===void 0?s.length-1:a,0),function(){for(var l=arguments,u=-1,h=n(l.length-a,0),f=Array(h);++u<h;)f[u]=l[a+u];u=-1;for(var p=Array(a+1);++u<a;)p[u]=l[u];return p[a]=o(f),e(s,this,p)}}return qv=r,qv}var Av,iM;function L9(){if(iM)return Av;iM=1;var e=bh(),n=nB(),r=tn(),s=n?function(a,o){return n(a,"toString",{configurable:!0,enumerable:!1,value:e(o),writable:!0})}:r;return Av=s,Av}var Nv,sM;function $9(){if(sM)return Nv;sM=1;var e=800,n=16,r=Date.now;function s(a){var o=0,l=0;return function(){var u=r(),h=n-(u-l);if(l=u,h>0){if(++o>=e)return arguments[0]}else o=0;return a.apply(void 0,arguments)}}return Nv=s,Nv}var Rv,aM;function kB(){if(aM)return Rv;aM=1;var e=L9(),n=$9(),r=n(e);return Rv=r,Rv}var Ov,oM;function Sl(){if(oM)return Ov;oM=1;var e=tn(),n=DB(),r=kB();function s(a,o){return r(n(a,o,e),a+"")}return Ov=s,Ov}var Mv,uM;function BB(){if(uM)return Mv;uM=1;function e(n,r,s,a){for(var o=n.length,l=s+(a?1:-1);a?l--:++l<o;)if(r(n[l],l,n))return l;return-1}return Mv=e,Mv}var jv,lM;function I9(){if(lM)return jv;lM=1;function e(n){return n!==n}return jv=e,jv}var Lv,cM;function D9(){if(cM)return Lv;cM=1;function e(n,r,s){for(var a=s-1,o=n.length;++a<o;)if(n[a]===r)return a;return-1}return Lv=e,Lv}var $v,fM;function PB(){if(fM)return $v;fM=1;var e=BB(),n=I9(),r=D9();function s(a,o,l){return o===o?r(a,o,l):e(a,n,l)}return $v=s,$v}var Iv,hM;function k9(){if(hM)return Iv;hM=1;var e=PB();function n(r,s){var a=r==null?0:r.length;return!!a&&e(r,s,0)>-1}return Iv=n,Iv}var Dv,dM;function B9(){if(dM)return Dv;dM=1;function e(n,r,s){for(var a=-1,o=n==null?0:n.length;++a<o;)if(s(r,n[a]))return!0;return!1}return Dv=e,Dv}var kv,pM;function P9(){if(pM)return kv;pM=1;function e(){}return kv=e,kv}var Bv,mM;function z9(){if(mM)return Bv;mM=1;var e=fB(),n=P9(),r=_h(),s=1/0,a=e&&1/r(new e([,-0]))[1]==s?function(o){return new e(o)}:n;return Bv=a,Bv}var Pv,gM;function zB(){if(gM)return Pv;gM=1;var e=_B(),n=k9(),r=B9(),s=EB(),a=z9(),o=_h(),l=200;function u(h,f,p){var d=-1,g=n,y=h.length,E=!0,x=[],v=x;if(p)E=!1,g=r;else if(y>=l){var b=f?null:a(h);if(b)return o(b);E=!1,g=s,v=new e}else v=f?[]:x;e:for(;++d<y;){var w=h[d],C=f?f(w):w;if(w=p||w!==0?w:0,E&&C===C){for(var T=v.length;T--;)if(v[T]===C)continue e;f&&v.push(C),x.push(w)}else g(v,C,p)||(v!==x&&v.push(C),x.push(w))}return x}return Pv=u,Pv}var zv,yM;function UB(){if(yM)return zv;yM=1;var e=sr(),n=Er();function r(s){return n(s)&&e(s)}return zv=r,zv}var Uv,vM;function U9(){if(vM)return Uv;vM=1;var e=nx(),n=Sl(),r=zB(),s=UB(),a=n(function(o){return r(e(o,1,s,!0))});return Uv=a,Uv}var Qv,bM;function Q9(){if(bM)return Qv;bM=1;var e=Cl();function n(r,s){return e(s,function(a){return r[a]})}return Qv=n,Qv}var Hv,_M;function Ch(){if(_M)return Hv;_M=1;var e=Q9(),n=ei();function r(s){return s==null?[]:e(s,n(s))}return Hv=r,Hv}var Vv,wM;function Pn(){if(wM)return Vv;wM=1;var e;if(typeof PC=="function")try{e={clone:vh(),constant:bh(),each:Ws(),filter:tx(),has:To(),isArray:vt(),isEmpty:qn(),isFunction:vl(),isUndefined:MB(),keys:ei(),map:ti(),reduce:Js(),size:O9(),transform:IB(),union:U9(),values:Ch()}}catch{}return e||(e=window._),Vv=e,Vv}var Fv,EM;function rx(){if(EM)return Fv;EM=1;var e=Pn();Fv=a;var n="\0",r="\0",s="";function a(p){this._isDirected=e.has(p,"directed")?p.directed:!0,this._isMultigraph=e.has(p,"multigraph")?p.multigraph:!1,this._isCompound=e.has(p,"compound")?p.compound:!1,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[r]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}a.prototype._nodeCount=0,a.prototype._edgeCount=0,a.prototype.isDirected=function(){return this._isDirected},a.prototype.isMultigraph=function(){return this._isMultigraph},a.prototype.isCompound=function(){return this._isCompound},a.prototype.setGraph=function(p){return this._label=p,this},a.prototype.graph=function(){return this._label},a.prototype.setDefaultNodeLabel=function(p){return e.isFunction(p)||(p=e.constant(p)),this._defaultNodeLabelFn=p,this},a.prototype.nodeCount=function(){return this._nodeCount},a.prototype.nodes=function(){return e.keys(this._nodes)},a.prototype.sources=function(){var p=this;return e.filter(this.nodes(),function(d){return e.isEmpty(p._in[d])})},a.prototype.sinks=function(){var p=this;return e.filter(this.nodes(),function(d){return e.isEmpty(p._out[d])})},a.prototype.setNodes=function(p,d){var g=arguments,y=this;return e.each(p,function(E){g.length>1?y.setNode(E,d):y.setNode(E)}),this},a.prototype.setNode=function(p,d){return e.has(this._nodes,p)?(arguments.length>1&&(this._nodes[p]=d),this):(this._nodes[p]=arguments.length>1?d:this._defaultNodeLabelFn(p),this._isCompound&&(this._parent[p]=r,this._children[p]={},this._children[r][p]=!0),this._in[p]={},this._preds[p]={},this._out[p]={},this._sucs[p]={},++this._nodeCount,this)},a.prototype.node=function(p){return this._nodes[p]},a.prototype.hasNode=function(p){return e.has(this._nodes,p)},a.prototype.removeNode=function(p){var d=this;if(e.has(this._nodes,p)){var g=function(y){d.removeEdge(d._edgeObjs[y])};delete this._nodes[p],this._isCompound&&(this._removeFromParentsChildList(p),delete this._parent[p],e.each(this.children(p),function(y){d.setParent(y)}),delete this._children[p]),e.each(e.keys(this._in[p]),g),delete this._in[p],delete this._preds[p],e.each(e.keys(this._out[p]),g),delete this._out[p],delete this._sucs[p],--this._nodeCount}return this},a.prototype.setParent=function(p,d){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(d))d=r;else{d+="";for(var g=d;!e.isUndefined(g);g=this.parent(g))if(g===p)throw new Error("Setting "+d+" as parent of "+p+" would create a cycle");this.setNode(d)}return this.setNode(p),this._removeFromParentsChildList(p),this._parent[p]=d,this._children[d][p]=!0,this},a.prototype._removeFromParentsChildList=function(p){delete this._children[this._parent[p]][p]},a.prototype.parent=function(p){if(this._isCompound){var d=this._parent[p];if(d!==r)return d}},a.prototype.children=function(p){if(e.isUndefined(p)&&(p=r),this._isCompound){var d=this._children[p];if(d)return e.keys(d)}else{if(p===r)return this.nodes();if(this.hasNode(p))return[]}},a.prototype.predecessors=function(p){var d=this._preds[p];if(d)return e.keys(d)},a.prototype.successors=function(p){var d=this._sucs[p];if(d)return e.keys(d)},a.prototype.neighbors=function(p){var d=this.predecessors(p);if(d)return e.union(d,this.successors(p))},a.prototype.isLeaf=function(p){var d;return this.isDirected()?d=this.successors(p):d=this.neighbors(p),d.length===0},a.prototype.filterNodes=function(p){var d=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});d.setGraph(this.graph());var g=this;e.each(this._nodes,function(x,v){p(v)&&d.setNode(v,x)}),e.each(this._edgeObjs,function(x){d.hasNode(x.v)&&d.hasNode(x.w)&&d.setEdge(x,g.edge(x))});var y={};function E(x){var v=g.parent(x);return v===void 0||d.hasNode(v)?(y[x]=v,v):v in y?y[v]:E(v)}return this._isCompound&&e.each(d.nodes(),function(x){d.setParent(x,E(x))}),d},a.prototype.setDefaultEdgeLabel=function(p){return e.isFunction(p)||(p=e.constant(p)),this._defaultEdgeLabelFn=p,this},a.prototype.edgeCount=function(){return this._edgeCount},a.prototype.edges=function(){return e.values(this._edgeObjs)},a.prototype.setPath=function(p,d){var g=this,y=arguments;return e.reduce(p,function(E,x){return y.length>1?g.setEdge(E,x,d):g.setEdge(E,x),x}),this},a.prototype.setEdge=function(){var p,d,g,y,E=!1,x=arguments[0];typeof x=="object"&&x!==null&&"v"in x?(p=x.v,d=x.w,g=x.name,arguments.length===2&&(y=arguments[1],E=!0)):(p=x,d=arguments[1],g=arguments[3],arguments.length>2&&(y=arguments[2],E=!0)),p=""+p,d=""+d,e.isUndefined(g)||(g=""+g);var v=u(this._isDirected,p,d,g);if(e.has(this._edgeLabels,v))return E&&(this._edgeLabels[v]=y),this;if(!e.isUndefined(g)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(p),this.setNode(d),this._edgeLabels[v]=E?y:this._defaultEdgeLabelFn(p,d,g);var b=h(this._isDirected,p,d,g);return p=b.v,d=b.w,Object.freeze(b),this._edgeObjs[v]=b,o(this._preds[d],p),o(this._sucs[p],d),this._in[d][v]=b,this._out[p][v]=b,this._edgeCount++,this},a.prototype.edge=function(p,d,g){var y=arguments.length===1?f(this._isDirected,arguments[0]):u(this._isDirected,p,d,g);return this._edgeLabels[y]},a.prototype.hasEdge=function(p,d,g){var y=arguments.length===1?f(this._isDirected,arguments[0]):u(this._isDirected,p,d,g);return e.has(this._edgeLabels,y)},a.prototype.removeEdge=function(p,d,g){var y=arguments.length===1?f(this._isDirected,arguments[0]):u(this._isDirected,p,d,g),E=this._edgeObjs[y];return E&&(p=E.v,d=E.w,delete this._edgeLabels[y],delete this._edgeObjs[y],l(this._preds[d],p),l(this._sucs[p],d),delete this._in[d][y],delete this._out[p][y],this._edgeCount--),this},a.prototype.inEdges=function(p,d){var g=this._in[p];if(g){var y=e.values(g);return d?e.filter(y,function(E){return E.v===d}):y}},a.prototype.outEdges=function(p,d){var g=this._out[p];if(g){var y=e.values(g);return d?e.filter(y,function(E){return E.w===d}):y}},a.prototype.nodeEdges=function(p,d){var g=this.inEdges(p,d);if(g)return g.concat(this.outEdges(p,d))};function o(p,d){p[d]?p[d]++:p[d]=1}function l(p,d){--p[d]||delete p[d]}function u(p,d,g,y){var E=""+d,x=""+g;if(!p&&E>x){var v=E;E=x,x=v}return E+s+x+s+(e.isUndefined(y)?n:y)}function h(p,d,g,y){var E=""+d,x=""+g;if(!p&&E>x){var v=E;E=x,x=v}var b={v:E,w:x};return y&&(b.name=y),b}function f(p,d){return u(p,d.v,d.w,d.name)}return Fv}var Gv,CM;function H9(){return CM||(CM=1,Gv="2.1.8"),Gv}var Kv,xM;function V9(){return xM||(xM=1,Kv={Graph:rx(),version:H9()}),Kv}var Yv,SM;function F9(){if(SM)return Yv;SM=1;var e=Pn(),n=rx();Yv={write:r,read:o};function r(l){var u={options:{directed:l.isDirected(),multigraph:l.isMultigraph(),compound:l.isCompound()},nodes:s(l),edges:a(l)};return e.isUndefined(l.graph())||(u.value=e.clone(l.graph())),u}function s(l){return e.map(l.nodes(),function(u){var h=l.node(u),f=l.parent(u),p={v:u};return e.isUndefined(h)||(p.value=h),e.isUndefined(f)||(p.parent=f),p})}function a(l){return e.map(l.edges(),function(u){var h=l.edge(u),f={v:u.v,w:u.w};return e.isUndefined(u.name)||(f.name=u.name),e.isUndefined(h)||(f.value=h),f})}function o(l){var u=new n(l.options).setGraph(l.value);return e.each(l.nodes,function(h){u.setNode(h.v,h.value),h.parent&&u.setParent(h.v,h.parent)}),e.each(l.edges,function(h){u.setEdge({v:h.v,w:h.w,name:h.name},h.value)}),u}return Yv}var Xv,TM;function G9(){if(TM)return Xv;TM=1;var e=Pn();Xv=n;function n(r){var s={},a=[],o;function l(u){e.has(s,u)||(s[u]=!0,o.push(u),e.each(r.successors(u),l),e.each(r.predecessors(u),l))}return e.each(r.nodes(),function(u){o=[],l(u),o.length&&a.push(o)}),a}return Xv}var Wv,qM;function QB(){if(qM)return Wv;qM=1;var e=Pn();Wv=n;function n(){this._arr=[],this._keyIndices={}}return n.prototype.size=function(){return this._arr.length},n.prototype.keys=function(){return this._arr.map(function(r){return r.key})},n.prototype.has=function(r){return e.has(this._keyIndices,r)},n.prototype.priority=function(r){var s=this._keyIndices[r];if(s!==void 0)return this._arr[s].priority},n.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},n.prototype.add=function(r,s){var a=this._keyIndices;if(r=String(r),!e.has(a,r)){var o=this._arr,l=o.length;return a[r]=l,o.push({key:r,priority:s}),this._decrease(l),!0}return!1},n.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var r=this._arr.pop();return delete this._keyIndices[r.key],this._heapify(0),r.key},n.prototype.decrease=function(r,s){var a=this._keyIndices[r];if(s>this._arr[a].priority)throw new Error("New priority is greater than current priority. Key: "+r+" Old: "+this._arr[a].priority+" New: "+s);this._arr[a].priority=s,this._decrease(a)},n.prototype._heapify=function(r){var s=this._arr,a=2*r,o=a+1,l=r;a<s.length&&(l=s[a].priority<s[l].priority?a:l,o<s.length&&(l=s[o].priority<s[l].priority?o:l),l!==r&&(this._swap(r,l),this._heapify(l)))},n.prototype._decrease=function(r){for(var s=this._arr,a=s[r].priority,o;r!==0&&(o=r>>1,!(s[o].priority<a));)this._swap(r,o),r=o},n.prototype._swap=function(r,s){var a=this._arr,o=this._keyIndices,l=a[r],u=a[s];a[r]=u,a[s]=l,o[u.key]=r,o[l.key]=s},Wv}var Jv,AM;function HB(){if(AM)return Jv;AM=1;var e=Pn(),n=QB();Jv=s;var r=e.constant(1);function s(o,l,u,h){return a(o,String(l),u||r,h||function(f){return o.outEdges(f)})}function a(o,l,u,h){var f={},p=new n,d,g,y=function(E){var x=E.v!==d?E.v:E.w,v=f[x],b=u(E),w=g.distance+b;if(b<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+E+" Weight: "+b);w<v.distance&&(v.distance=w,v.predecessor=d,p.decrease(x,w))};for(o.nodes().forEach(function(E){var x=E===l?0:Number.POSITIVE_INFINITY;f[E]={distance:x},p.add(E,x)});p.size()>0&&(d=p.removeMin(),g=f[d],g.distance!==Number.POSITIVE_INFINITY);)h(d).forEach(y);return f}return Jv}var Zv,NM;function K9(){if(NM)return Zv;NM=1;var e=HB(),n=Pn();Zv=r;function r(s,a,o){return n.transform(s.nodes(),function(l,u){l[u]=e(s,u,a,o)},{})}return Zv}var eb,RM;function VB(){if(RM)return eb;RM=1;var e=Pn();eb=n;function n(r){var s=0,a=[],o={},l=[];function u(h){var f=o[h]={onStack:!0,lowlink:s,index:s++};if(a.push(h),r.successors(h).forEach(function(g){e.has(o,g)?o[g].onStack&&(f.lowlink=Math.min(f.lowlink,o[g].index)):(u(g),f.lowlink=Math.min(f.lowlink,o[g].lowlink))}),f.lowlink===f.index){var p=[],d;do d=a.pop(),o[d].onStack=!1,p.push(d);while(h!==d);l.push(p)}}return r.nodes().forEach(function(h){e.has(o,h)||u(h)}),l}return eb}var tb,OM;function Y9(){if(OM)return tb;OM=1;var e=Pn(),n=VB();tb=r;function r(s){return e.filter(n(s),function(a){return a.length>1||a.length===1&&s.hasEdge(a[0],a[0])})}return tb}var nb,MM;function X9(){if(MM)return nb;MM=1;var e=Pn();nb=r;var n=e.constant(1);function r(a,o,l){return s(a,o||n,l||function(u){return a.outEdges(u)})}function s(a,o,l){var u={},h=a.nodes();return h.forEach(function(f){u[f]={},u[f][f]={distance:0},h.forEach(function(p){f!==p&&(u[f][p]={distance:Number.POSITIVE_INFINITY})}),l(f).forEach(function(p){var d=p.v===f?p.w:p.v,g=o(p);u[f][d]={distance:g,predecessor:f}})}),h.forEach(function(f){var p=u[f];h.forEach(function(d){var g=u[d];h.forEach(function(y){var E=g[f],x=p[y],v=g[y],b=E.distance+x.distance;b<v.distance&&(v.distance=b,v.predecessor=x.predecessor)})})}),u}return nb}var rb,jM;function FB(){if(jM)return rb;jM=1;var e=Pn();rb=n,n.CycleException=r;function n(s){var a={},o={},l=[];function u(h){if(e.has(o,h))throw new r;e.has(a,h)||(o[h]=!0,a[h]=!0,e.each(s.predecessors(h),u),delete o[h],l.push(h))}if(e.each(s.sinks(),u),e.size(a)!==s.nodeCount())throw new r;return l}function r(){}return r.prototype=new Error,rb}var ib,LM;function W9(){if(LM)return ib;LM=1;var e=FB();ib=n;function n(r){try{e(r)}catch(s){if(s instanceof e.CycleException)return!1;throw s}return!0}return ib}var sb,$M;function GB(){if($M)return sb;$M=1;var e=Pn();sb=n;function n(s,a,o){e.isArray(a)||(a=[a]);var l=(s.isDirected()?s.successors:s.neighbors).bind(s),u=[],h={};return e.each(a,function(f){if(!s.hasNode(f))throw new Error("Graph does not have node: "+f);r(s,f,o==="post",h,l,u)}),u}function r(s,a,o,l,u,h){e.has(l,a)||(l[a]=!0,o||h.push(a),e.each(u(a),function(f){r(s,f,o,l,u,h)}),o&&h.push(a))}return sb}var ab,IM;function J9(){if(IM)return ab;IM=1;var e=GB();ab=n;function n(r,s){return e(r,s,"post")}return ab}var ob,DM;function Z9(){if(DM)return ob;DM=1;var e=GB();ob=n;function n(r,s){return e(r,s,"pre")}return ob}var ub,kM;function e7(){if(kM)return ub;kM=1;var e=Pn(),n=rx(),r=QB();ub=s;function s(a,o){var l=new n,u={},h=new r,f;function p(g){var y=g.v===f?g.w:g.v,E=h.priority(y);if(E!==void 0){var x=o(g);x<E&&(u[y]=f,h.decrease(y,x))}}if(a.nodeCount()===0)return l;e.each(a.nodes(),function(g){h.add(g,Number.POSITIVE_INFINITY),l.setNode(g)}),h.decrease(a.nodes()[0],0);for(var d=!1;h.size()>0;){if(f=h.removeMin(),e.has(u,f))l.setEdge(f,u[f]);else{if(d)throw new Error("Input graph is not connected: "+a);d=!0}a.nodeEdges(f).forEach(p)}return l}return ub}var lb,BM;function t7(){return BM||(BM=1,lb={components:G9(),dijkstra:HB(),dijkstraAll:K9(),findCycles:Y9(),floydWarshall:X9(),isAcyclic:W9(),postorder:J9(),preorder:Z9(),prim:e7(),tarjan:VB(),topsort:FB()}),lb}var cb,PM;function n7(){if(PM)return cb;PM=1;var e=V9();return cb={Graph:e.Graph,json:F9(),alg:t7(),version:e.version},cb}var fb,zM;function er(){if(zM)return fb;zM=1;var e;if(typeof PC=="function")try{e=n7()}catch{}return e||(e=window.graphlib),fb=e,fb}var hb,UM;function KB(){if(UM)return hb;UM=1;var e=gB(),n=1,r=4;function s(a){return e(a,n|r)}return hb=s,hb}var db,QM;function qo(){if(QM)return db;QM=1;var e=wo(),n=sr(),r=mh(),s=Bn();function a(o,l,u){if(!s(u))return!1;var h=typeof l;return(h=="number"?n(u)&&r(l,u.length):h=="string"&&l in u)?e(u[l],o):!1}return db=a,db}var pb,HM;function ix(){if(HM)return pb;HM=1;var e=Sl(),n=wo(),r=qo(),s=Xi(),a=Object.prototype,o=a.hasOwnProperty,l=e(function(u,h){u=Object(u);var f=-1,p=h.length,d=p>2?h[2]:void 0;for(d&&r(h[0],h[1],d)&&(p=1);++f<p;)for(var g=h[f],y=s(g),E=-1,x=y.length;++E<x;){var v=y[E],b=u[v];(b===void 0||n(b,a[v])&&!o.call(u,v))&&(u[v]=g[v])}return u});return pb=l,pb}var mb,VM;function r7(){if(VM)return mb;VM=1;var e=mn(),n=sr(),r=ei();function s(a){return function(o,l,u){var h=Object(o);if(!n(o)){var f=e(l,3);o=r(o),l=function(d){return f(h[d],d,h)}}var p=a(o,l,u);return p>-1?h[f?o[p]:p]:void 0}}return mb=s,mb}var gb,FM;function i7(){if(FM)return gb;FM=1;var e=/\s/;function n(r){for(var s=r.length;s--&&e.test(r.charAt(s)););return s}return gb=n,gb}var yb,GM;function s7(){if(GM)return yb;GM=1;var e=i7(),n=/^\s+/;function r(s){return s&&s.slice(0,e(s)+1).replace(n,"")}return yb=r,yb}var vb,KM;function a7(){if(KM)return vb;KM=1;var e=s7(),n=Bn(),r=So(),s=NaN,a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;function h(f){if(typeof f=="number")return f;if(r(f))return s;if(n(f)){var p=typeof f.valueOf=="function"?f.valueOf():f;f=n(p)?p+"":p}if(typeof f!="string")return f===0?f:+f;f=e(f);var d=o.test(f);return d||l.test(f)?u(f.slice(2),d?2:8):a.test(f)?s:+f}return vb=h,vb}var bb,YM;function YB(){if(YM)return bb;YM=1;var e=a7(),n=1/0,r=17976931348623157e292;function s(a){if(!a)return a===0?a:0;if(a=e(a),a===n||a===-n){var o=a<0?-1:1;return o*r}return a===a?a:0}return bb=s,bb}var _b,XM;function sx(){if(XM)return _b;XM=1;var e=YB();function n(r){var s=e(r),a=s%1;return s===s?a?s-a:s:0}return _b=n,_b}var wb,WM;function o7(){if(WM)return wb;WM=1;var e=BB(),n=mn(),r=sx(),s=Math.max;function a(o,l,u){var h=o==null?0:o.length;if(!h)return-1;var f=u==null?0:r(u);return f<0&&(f=s(h+f,0)),e(o,n(l,3),f)}return wb=a,wb}var Eb,JM;function u7(){if(JM)return Eb;JM=1;var e=r7(),n=o7(),r=e(n);return Eb=r,Eb}var Cb,ZM;function xh(){if(ZM)return Cb;ZM=1;var e=nx();function n(r){var s=r==null?0:r.length;return s?e(r,1):[]}return Cb=n,Cb}var xb,e2;function l7(){if(e2)return xb;e2=1;var e=JC(),n=yB(),r=Xi();function s(a,o){return a==null?a:e(a,n(o),r)}return xb=s,xb}var Sb,t2;function XB(){if(t2)return Sb;t2=1;function e(n){var r=n==null?0:n.length;return r?n[r-1]:void 0}return Sb=e,Sb}var Tb,n2;function c7(){if(n2)return Tb;n2=1;var e=bl(),n=ZC(),r=mn();function s(a,o){var l={};return o=r(o,3),n(a,function(u,h,f){e(l,h,o(u,h,f))}),l}return Tb=s,Tb}var qb,r2;function ax(){if(r2)return qb;r2=1;var e=So();function n(r,s,a){for(var o=-1,l=r.length;++o<l;){var u=r[o],h=s(u);if(h!=null&&(f===void 0?h===h&&!e(h):a(h,f)))var f=h,p=u}return p}return qb=n,qb}var Ab,i2;function f7(){if(i2)return Ab;i2=1;function e(n,r){return n>r}return Ab=e,Ab}var Nb,s2;function h7(){if(s2)return Nb;s2=1;var e=ax(),n=f7(),r=tn();function s(a){return a&&a.length?e(a,r,n):void 0}return Nb=s,Nb}var Rb,a2;function WB(){if(a2)return Rb;a2=1;var e=bl(),n=wo();function r(s,a,o){(o!==void 0&&!n(s[a],o)||o===void 0&&!(a in s))&&e(s,a,o)}return Rb=r,Rb}var Ob,o2;function Wi(){if(o2)return Ob;o2=1;var e=Gs(),n=yh(),r=Er(),s="[object Object]",a=Function.prototype,o=Object.prototype,l=a.toString,u=o.hasOwnProperty,h=l.call(Object);function f(p){if(!r(p)||e(p)!=s)return!1;var d=n(p);if(d===null)return!0;var g=u.call(d,"constructor")&&d.constructor;return typeof g=="function"&&g instanceof g&&l.call(g)==h}return Ob=f,Ob}var Mb,u2;function JB(){if(u2)return Mb;u2=1;function e(n,r){if(!(r==="constructor"&&typeof n[r]=="function")&&r!="__proto__")return n[r]}return Mb=e,Mb}var jb,l2;function d7(){if(l2)return jb;l2=1;var e=Ys(),n=Xi();function r(s){return e(s,n(s))}return jb=r,jb}var Lb,c2;function p7(){if(c2)return Lb;c2=1;var e=WB(),n=sB(),r=dB(),s=GC(),a=mB(),o=wl(),l=vt(),u=UB(),h=Eo(),f=vl(),p=Bn(),d=Wi(),g=Co(),y=JB(),E=d7();function x(v,b,w,C,T,A,N){var O=y(v,w),I=y(b,w),k=N.get(I);if(k){e(v,w,k);return}var R=A?A(O,I,w+"",v,b,N):void 0,M=R===void 0;if(M){var D=l(I),z=!D&&h(I),q=!D&&!z&&g(I);R=I,D||z||q?l(O)?R=O:u(O)?R=s(O):z?(M=!1,R=n(I,!0)):q?(M=!1,R=r(I,!0)):R=[]:d(I)||o(I)?(R=O,o(O)?R=E(O):(!p(O)||f(O))&&(R=a(I))):M=!1}M&&(N.set(I,R),T(R,I,C,A,N),N.delete(I)),e(v,w,R)}return Lb=x,Lb}var $b,f2;function m7(){if(f2)return $b;f2=1;var e=ph(),n=WB(),r=JC(),s=p7(),a=Bn(),o=Xi(),l=JB();function u(h,f,p,d,g){h!==f&&r(f,function(y,E){if(g||(g=new e),a(y))s(h,f,E,p,u,d,g);else{var x=d?d(l(h,E),y,E+"",h,f,g):void 0;x===void 0&&(x=y),n(h,E,x)}},o)}return $b=u,$b}var Ib,h2;function ox(){if(h2)return Ib;h2=1;var e=Sl(),n=qo();function r(s){return e(function(a,o){var l=-1,u=o.length,h=u>1?o[u-1]:void 0,f=u>2?o[2]:void 0;for(h=s.length>3&&typeof h=="function"?(u--,h):void 0,f&&n(o[0],o[1],f)&&(h=u<3?void 0:h,u=1),a=Object(a);++l<u;){var p=o[l];p&&s(a,p,l,h)}return a})}return Ib=r,Ib}var Db,d2;function ZB(){if(d2)return Db;d2=1;var e=m7(),n=ox(),r=n(function(s,a,o){e(s,a,o)});return Db=r,Db}var kb,p2;function eP(){if(p2)return kb;p2=1;function e(n,r){return n<r}return kb=e,kb}var Bb,m2;function g7(){if(m2)return Bb;m2=1;var e=ax(),n=eP(),r=tn();function s(a){return a&&a.length?e(a,r,n):void 0}return Bb=s,Bb}var Pb,g2;function y7(){if(g2)return Pb;g2=1;var e=ax(),n=mn(),r=eP();function s(a,o){return a&&a.length?e(a,n(o,2),r):void 0}return Pb=s,Pb}var zb,y2;function v7(){if(y2)return zb;y2=1;var e=ir(),n=function(){return e.Date.now()};return zb=n,zb}var Ub,v2;function b7(){if(v2)return Ub;v2=1;var e=_l(),n=wh(),r=mh(),s=Bn(),a=xl();function o(l,u,h,f){if(!s(l))return l;u=n(u,l);for(var p=-1,d=u.length,g=d-1,y=l;y!=null&&++p<d;){var E=a(u[p]),x=h;if(E==="__proto__"||E==="constructor"||E==="prototype")return l;if(p!=g){var v=y[E];x=f?f(v,E,y):void 0,x===void 0&&(x=s(v)?v:r(u[p+1])?[]:{})}e(y,E,x),y=y[E]}return l}return Ub=o,Ub}var Qb,b2;function tP(){if(b2)return Qb;b2=1;var e=Eh(),n=b7(),r=wh();function s(a,o,l){for(var u=-1,h=o.length,f={};++u<h;){var p=o[u],d=e(a,p);l(d,p)&&n(f,r(p,a),d)}return f}return Qb=s,Qb}var Hb,_2;function _7(){if(_2)return Hb;_2=1;var e=tP(),n=RB();function r(s,a){return e(s,a,function(o,l){return n(s,l)})}return Hb=r,Hb}var Vb,w2;function w7(){if(w2)return Vb;w2=1;var e=xh(),n=DB(),r=kB();function s(a){return r(n(a,void 0,e),a+"")}return Vb=s,Vb}var Fb,E2;function E7(){if(E2)return Fb;E2=1;var e=_7(),n=w7(),r=n(function(s,a){return s==null?{}:e(s,a)});return Fb=r,Fb}var Gb,C2;function C7(){if(C2)return Gb;C2=1;var e=Math.ceil,n=Math.max;function r(s,a,o,l){for(var u=-1,h=n(e((a-s)/(o||1)),0),f=Array(h);h--;)f[l?h:++u]=s,s+=o;return f}return Gb=r,Gb}var Kb,x2;function x7(){if(x2)return Kb;x2=1;var e=C7(),n=qo(),r=YB();function s(a){return function(o,l,u){return u&&typeof u!="number"&&n(o,l,u)&&(l=u=void 0),o=r(o),l===void 0?(l=o,o=0):l=r(l),u=u===void 0?o<l?1:-1:r(u),e(o,l,u,a)}}return Kb=s,Kb}var Yb,S2;function S7(){if(S2)return Yb;S2=1;var e=x7(),n=e();return Yb=n,Yb}var Xb,T2;function T7(){if(T2)return Xb;T2=1;function e(n,r){var s=n.length;for(n.sort(r);s--;)n[s]=n[s].value;return n}return Xb=e,Xb}var Wb,q2;function q7(){if(q2)return Wb;q2=1;var e=So();function n(r,s){if(r!==s){var a=r!==void 0,o=r===null,l=r===r,u=e(r),h=s!==void 0,f=s===null,p=s===s,d=e(s);if(!f&&!d&&!u&&r>s||u&&h&&p&&!f&&!d||o&&h&&p||!a&&p||!l)return 1;if(!o&&!u&&!d&&r<s||d&&a&&l&&!o&&!u||f&&a&&l||!h&&l||!p)return-1}return 0}return Wb=n,Wb}var Jb,A2;function A7(){if(A2)return Jb;A2=1;var e=q7();function n(r,s,a){for(var o=-1,l=r.criteria,u=s.criteria,h=l.length,f=a.length;++o<h;){var p=e(l[o],u[o]);if(p){if(o>=f)return p;var d=a[o];return p*(d=="desc"?-1:1)}}return r.index-s.index}return Jb=n,Jb}var Zb,N2;function N7(){if(N2)return Zb;N2=1;var e=Cl(),n=Eh(),r=mn(),s=jB(),a=T7(),o=gh(),l=A7(),u=tn(),h=vt();function f(p,d,g){d.length?d=e(d,function(x){return h(x)?function(v){return n(v,x.length===1?x[0]:x)}:x}):d=[u];var y=-1;d=e(d,o(r));var E=s(p,function(x,v,b){var w=e(d,function(C){return C(x)});return{criteria:w,index:++y,value:x}});return a(E,function(x,v){return l(x,v,g)})}return Zb=f,Zb}var e_,R2;function R7(){if(R2)return e_;R2=1;var e=nx(),n=N7(),r=Sl(),s=qo(),a=r(function(o,l){if(o==null)return[];var u=l.length;return u>1&&s(o,l[0],l[1])?l=[]:u>2&&s(l[0],l[1],l[2])&&(l=[l[0]]),n(o,e(l,1),[])});return e_=a,e_}var t_,O2;function ux(){if(O2)return t_;O2=1;var e=AB(),n=0;function r(s){var a=++n;return e(s)+a}return t_=r,t_}var n_,M2;function O7(){if(M2)return n_;M2=1;function e(n,r,s){for(var a=-1,o=n.length,l=r.length,u={};++a<o;){var h=a<l?r[a]:void 0;s(u,n[a],h)}return u}return n_=e,n_}var r_,j2;function M7(){if(j2)return r_;j2=1;var e=_l(),n=O7();function r(s,a){return n(s||[],a||[],e)}return r_=r,r_}var i_,L2;function pt(){if(L2)return i_;L2=1;var e;if(typeof PC=="function")try{e={cloneDeep:KB(),constant:bh(),defaults:ix(),each:Ws(),filter:tx(),find:u7(),flatten:xh(),forEach:vB(),forIn:l7(),has:To(),isUndefined:MB(),last:XB(),map:ti(),mapValues:c7(),max:h7(),merge:ZB(),min:g7(),minBy:y7(),now:v7(),pick:E7(),range:S7(),reduce:Js(),sortBy:R7(),uniqueId:ux(),values:Ch(),zipObject:M7()}}catch{}return e||(e=window._),i_=e,i_}var s_,$2;function j7(){if($2)return s_;$2=1,s_=e;function e(){var s={};s._next=s._prev=s,this._sentinel=s}e.prototype.dequeue=function(){var s=this._sentinel,a=s._prev;if(a!==s)return n(a),a},e.prototype.enqueue=function(s){var a=this._sentinel;s._prev&&s._next&&n(s),s._next=a._next,a._next._prev=s,a._next=s,s._prev=a},e.prototype.toString=function(){for(var s=[],a=this._sentinel,o=a._prev;o!==a;)s.push(JSON.stringify(o,r)),o=o._prev;return"["+s.join(", ")+"]"};function n(s){s._prev._next=s._next,s._next._prev=s._prev,delete s._next,delete s._prev}function r(s,a){if(s!=="_next"&&s!=="_prev")return a}return s_}var a_,I2;function L7(){if(I2)return a_;I2=1;var e=pt(),n=er().Graph,r=j7();a_=a;var s=e.constant(1);function a(f,p){if(f.nodeCount()<=1)return[];var d=u(f,p||s),g=o(d.graph,d.buckets,d.zeroIdx);return e.flatten(e.map(g,function(y){return f.outEdges(y.v,y.w)}),!0)}function o(f,p,d){for(var g=[],y=p[p.length-1],E=p[0],x;f.nodeCount();){for(;x=E.dequeue();)l(f,p,d,x);for(;x=y.dequeue();)l(f,p,d,x);if(f.nodeCount()){for(var v=p.length-2;v>0;--v)if(x=p[v].dequeue(),x){g=g.concat(l(f,p,d,x,!0));break}}}return g}function l(f,p,d,g,y){var E=y?[]:void 0;return e.forEach(f.inEdges(g.v),function(x){var v=f.edge(x),b=f.node(x.v);y&&E.push({v:x.v,w:x.w}),b.out-=v,h(p,d,b)}),e.forEach(f.outEdges(g.v),function(x){var v=f.edge(x),b=x.w,w=f.node(b);w.in-=v,h(p,d,w)}),f.removeNode(g.v),E}function u(f,p){var d=new n,g=0,y=0;e.forEach(f.nodes(),function(v){d.setNode(v,{v,in:0,out:0})}),e.forEach(f.edges(),function(v){var b=d.edge(v.v,v.w)||0,w=p(v),C=b+w;d.setEdge(v.v,v.w,C),y=Math.max(y,d.node(v.v).out+=w),g=Math.max(g,d.node(v.w).in+=w)});var E=e.range(y+g+3).map(function(){return new r}),x=g+1;return e.forEach(d.nodes(),function(v){h(E,x,d.node(v))}),{graph:d,buckets:E,zeroIdx:x}}function h(f,p,d){d.out?d.in?f[d.out-d.in+p].enqueue(d):f[f.length-1].enqueue(d):f[0].enqueue(d)}return a_}var o_,D2;function $7(){if(D2)return o_;D2=1;var e=pt(),n=L7();o_={run:r,undo:a};function r(o){var l=o.graph().acyclicer==="greedy"?n(o,u(o)):s(o);e.forEach(l,function(h){var f=o.edge(h);o.removeEdge(h),f.forwardName=h.name,f.reversed=!0,o.setEdge(h.w,h.v,f,e.uniqueId("rev"))});function u(h){return function(f){return h.edge(f).weight}}}function s(o){var l=[],u={},h={};function f(p){e.has(h,p)||(h[p]=!0,u[p]=!0,e.forEach(o.outEdges(p),function(d){e.has(u,d.w)?l.push(d):f(d.w)}),delete u[p])}return e.forEach(o.nodes(),f),l}function a(o){e.forEach(o.edges(),function(l){var u=o.edge(l);if(u.reversed){o.removeEdge(l);var h=u.forwardName;delete u.reversed,delete u.forwardName,o.setEdge(l.w,l.v,u,h)}})}return o_}var u_,k2;function pn(){if(k2)return u_;k2=1;var e=pt(),n=er().Graph;u_={addDummyNode:r,simplify:s,asNonCompoundGraph:a,successorWeights:o,predecessorWeights:l,intersectRect:u,buildLayerMatrix:h,normalizeRanks:f,removeEmptyRanks:p,addBorderNode:d,maxRank:g,partition:y,time:E,notime:x};function r(v,b,w,C){var T;do T=e.uniqueId(C);while(v.hasNode(T));return w.dummy=b,v.setNode(T,w),T}function s(v){var b=new n().setGraph(v.graph());return e.forEach(v.nodes(),function(w){b.setNode(w,v.node(w))}),e.forEach(v.edges(),function(w){var C=b.edge(w.v,w.w)||{weight:0,minlen:1},T=v.edge(w);b.setEdge(w.v,w.w,{weight:C.weight+T.weight,minlen:Math.max(C.minlen,T.minlen)})}),b}function a(v){var b=new n({multigraph:v.isMultigraph()}).setGraph(v.graph());return e.forEach(v.nodes(),function(w){v.children(w).length||b.setNode(w,v.node(w))}),e.forEach(v.edges(),function(w){b.setEdge(w,v.edge(w))}),b}function o(v){var b=e.map(v.nodes(),function(w){var C={};return e.forEach(v.outEdges(w),function(T){C[T.w]=(C[T.w]||0)+v.edge(T).weight}),C});return e.zipObject(v.nodes(),b)}function l(v){var b=e.map(v.nodes(),function(w){var C={};return e.forEach(v.inEdges(w),function(T){C[T.v]=(C[T.v]||0)+v.edge(T).weight}),C});return e.zipObject(v.nodes(),b)}function u(v,b){var w=v.x,C=v.y,T=b.x-w,A=b.y-C,N=v.width/2,O=v.height/2;if(!T&&!A)throw new Error("Not possible to find intersection inside of the rectangle");var I,k;return Math.abs(A)*N>Math.abs(T)*O?(A<0&&(O=-O),I=O*T/A,k=O):(T<0&&(N=-N),I=N,k=N*A/T),{x:w+I,y:C+k}}function h(v){var b=e.map(e.range(g(v)+1),function(){return[]});return e.forEach(v.nodes(),function(w){var C=v.node(w),T=C.rank;e.isUndefined(T)||(b[T][C.order]=w)}),b}function f(v){var b=e.min(e.map(v.nodes(),function(w){return v.node(w).rank}));e.forEach(v.nodes(),function(w){var C=v.node(w);e.has(C,"rank")&&(C.rank-=b)})}function p(v){var b=e.min(e.map(v.nodes(),function(A){return v.node(A).rank})),w=[];e.forEach(v.nodes(),function(A){var N=v.node(A).rank-b;w[N]||(w[N]=[]),w[N].push(A)});var C=0,T=v.graph().nodeRankFactor;e.forEach(w,function(A,N){e.isUndefined(A)&&N%T!==0?--C:C&&e.forEach(A,function(O){v.node(O).rank+=C})})}function d(v,b,w,C){var T={width:0,height:0};return arguments.length>=4&&(T.rank=w,T.order=C),r(v,"border",T,b)}function g(v){return e.max(e.map(v.nodes(),function(b){var w=v.node(b).rank;if(!e.isUndefined(w))return w}))}function y(v,b){var w={lhs:[],rhs:[]};return e.forEach(v,function(C){b(C)?w.lhs.push(C):w.rhs.push(C)}),w}function E(v,b){var w=e.now();try{return b()}finally{console.log(v+" time: "+(e.now()-w)+"ms")}}function x(v,b){return b()}return u_}var l_,B2;function I7(){if(B2)return l_;B2=1;var e=pt(),n=pn();l_={run:r,undo:a};function r(o){o.graph().dummyChains=[],e.forEach(o.edges(),function(l){s(o,l)})}function s(o,l){var u=l.v,h=o.node(u).rank,f=l.w,p=o.node(f).rank,d=l.name,g=o.edge(l),y=g.labelRank;if(p!==h+1){o.removeEdge(l);var E,x,v;for(v=0,++h;h<p;++v,++h)g.points=[],x={width:0,height:0,edgeLabel:g,edgeObj:l,rank:h},E=n.addDummyNode(o,"edge",x,"_d"),h===y&&(x.width=g.width,x.height=g.height,x.dummy="edge-label",x.labelpos=g.labelpos),o.setEdge(u,E,{weight:g.weight},d),v===0&&o.graph().dummyChains.push(E),u=E;o.setEdge(u,f,{weight:g.weight},d)}}function a(o){e.forEach(o.graph().dummyChains,function(l){var u=o.node(l),h=u.edgeLabel,f;for(o.setEdge(u.edgeObj,h);u.dummy;)f=o.successors(l)[0],o.removeNode(l),h.points.push({x:u.x,y:u.y}),u.dummy==="edge-label"&&(h.x=u.x,h.y=u.y,h.width=u.width,h.height=u.height),l=f,u=o.node(l)})}return l_}var c_,P2;function Vf(){if(P2)return c_;P2=1;var e=pt();c_={longestPath:n,slack:r};function n(s){var a={};function o(l){var u=s.node(l);if(e.has(a,l))return u.rank;a[l]=!0;var h=e.min(e.map(s.outEdges(l),function(f){return o(f.w)-s.edge(f).minlen}));return(h===Number.POSITIVE_INFINITY||h===void 0||h===null)&&(h=0),u.rank=h}e.forEach(s.sources(),o)}function r(s,a){return s.node(a.w).rank-s.node(a.v).rank-s.edge(a).minlen}return c_}var f_,z2;function nP(){if(z2)return f_;z2=1;var e=pt(),n=er().Graph,r=Vf().slack;f_=s;function s(u){var h=new n({directed:!1}),f=u.nodes()[0],p=u.nodeCount();h.setNode(f,{});for(var d,g;a(h,u)<p;)d=o(h,u),g=h.hasNode(d.v)?r(u,d):-r(u,d),l(h,u,g);return h}function a(u,h){function f(p){e.forEach(h.nodeEdges(p),function(d){var g=d.v,y=p===g?d.w:g;!u.hasNode(y)&&!r(h,d)&&(u.setNode(y,{}),u.setEdge(p,y,{}),f(y))})}return e.forEach(u.nodes(),f),u.nodeCount()}function o(u,h){return e.minBy(h.edges(),function(f){if(u.hasNode(f.v)!==u.hasNode(f.w))return r(h,f)})}function l(u,h,f){e.forEach(u.nodes(),function(p){h.node(p).rank+=f})}return f_}var h_,U2;function D7(){if(U2)return h_;U2=1;var e=pt(),n=nP(),r=Vf().slack,s=Vf().longestPath,a=er().alg.preorder,o=er().alg.postorder,l=pn().simplify;h_=u,u.initLowLimValues=d,u.initCutValues=h,u.calcCutValue=p,u.leaveEdge=y,u.enterEdge=E,u.exchangeEdges=x;function u(C){C=l(C),s(C);var T=n(C);d(T),h(T,C);for(var A,N;A=y(T);)N=E(T,C,A),x(T,C,A,N)}function h(C,T){var A=o(C,C.nodes());A=A.slice(0,A.length-1),e.forEach(A,function(N){f(C,T,N)})}function f(C,T,A){var N=C.node(A),O=N.parent;C.edge(A,O).cutvalue=p(C,T,A)}function p(C,T,A){var N=C.node(A),O=N.parent,I=!0,k=T.edge(A,O),R=0;return k||(I=!1,k=T.edge(O,A)),R=k.weight,e.forEach(T.nodeEdges(A),function(M){var D=M.v===A,z=D?M.w:M.v;if(z!==O){var q=D===I,j=T.edge(M).weight;if(R+=q?j:-j,b(C,A,z)){var L=C.edge(A,z).cutvalue;R+=q?-L:L}}}),R}function d(C,T){arguments.length<2&&(T=C.nodes()[0]),g(C,{},1,T)}function g(C,T,A,N,O){var I=A,k=C.node(N);return T[N]=!0,e.forEach(C.neighbors(N),function(R){e.has(T,R)||(A=g(C,T,A,R,N))}),k.low=I,k.lim=A++,O?k.parent=O:delete k.parent,A}function y(C){return e.find(C.edges(),function(T){return C.edge(T).cutvalue<0})}function E(C,T,A){var N=A.v,O=A.w;T.hasEdge(N,O)||(N=A.w,O=A.v);var I=C.node(N),k=C.node(O),R=I,M=!1;I.lim>k.lim&&(R=k,M=!0);var D=e.filter(T.edges(),function(z){return M===w(C,C.node(z.v),R)&&M!==w(C,C.node(z.w),R)});return e.minBy(D,function(z){return r(T,z)})}function x(C,T,A,N){var O=A.v,I=A.w;C.removeEdge(O,I),C.setEdge(N.v,N.w,{}),d(C),h(C,T),v(C,T)}function v(C,T){var A=e.find(C.nodes(),function(O){return!T.node(O).parent}),N=a(C,A);N=N.slice(1),e.forEach(N,function(O){var I=C.node(O).parent,k=T.edge(O,I),R=!1;k||(k=T.edge(I,O),R=!0),T.node(O).rank=T.node(I).rank+(R?k.minlen:-k.minlen)})}function b(C,T,A){return C.hasEdge(T,A)}function w(C,T,A){return A.low<=T.lim&&T.lim<=A.lim}return h_}var d_,Q2;function k7(){if(Q2)return d_;Q2=1;var e=Vf(),n=e.longestPath,r=nP(),s=D7();d_=a;function a(h){switch(h.graph().ranker){case"network-simplex":u(h);break;case"tight-tree":l(h);break;case"longest-path":o(h);break;default:u(h)}}var o=n;function l(h){n(h),r(h)}function u(h){s(h)}return d_}var p_,H2;function B7(){if(H2)return p_;H2=1;var e=pt();p_=n;function n(a){var o=s(a);e.forEach(a.graph().dummyChains,function(l){for(var u=a.node(l),h=u.edgeObj,f=r(a,o,h.v,h.w),p=f.path,d=f.lca,g=0,y=p[g],E=!0;l!==h.w;){if(u=a.node(l),E){for(;(y=p[g])!==d&&a.node(y).maxRank<u.rank;)g++;y===d&&(E=!1)}if(!E){for(;g<p.length-1&&a.node(y=p[g+1]).minRank<=u.rank;)g++;y=p[g]}a.setParent(l,y),l=a.successors(l)[0]}})}function r(a,o,l,u){var h=[],f=[],p=Math.min(o[l].low,o[u].low),d=Math.max(o[l].lim,o[u].lim),g,y;g=l;do g=a.parent(g),h.push(g);while(g&&(o[g].low>p||d>o[g].lim));for(y=g,g=u;(g=a.parent(g))!==y;)f.push(g);return{path:h.concat(f.reverse()),lca:y}}function s(a){var o={},l=0;function u(h){var f=l;e.forEach(a.children(h),u),o[h]={low:f,lim:l++}}return e.forEach(a.children(),u),o}return p_}var m_,V2;function P7(){if(V2)return m_;V2=1;var e=pt(),n=pn();m_={run:r,cleanup:l};function r(u){var h=n.addDummyNode(u,"root",{},"_root"),f=a(u),p=e.max(e.values(f))-1,d=2*p+1;u.graph().nestingRoot=h,e.forEach(u.edges(),function(y){u.edge(y).minlen*=d});var g=o(u)+1;e.forEach(u.children(),function(y){s(u,h,d,g,p,f,y)}),u.graph().nodeRankFactor=d}function s(u,h,f,p,d,g,y){var E=u.children(y);if(!E.length){y!==h&&u.setEdge(h,y,{weight:0,minlen:f});return}var x=n.addBorderNode(u,"_bt"),v=n.addBorderNode(u,"_bb"),b=u.node(y);u.setParent(x,y),b.borderTop=x,u.setParent(v,y),b.borderBottom=v,e.forEach(E,function(w){s(u,h,f,p,d,g,w);var C=u.node(w),T=C.borderTop?C.borderTop:w,A=C.borderBottom?C.borderBottom:w,N=C.borderTop?p:2*p,O=T!==A?1:d-g[y]+1;u.setEdge(x,T,{weight:N,minlen:O,nestingEdge:!0}),u.setEdge(A,v,{weight:N,minlen:O,nestingEdge:!0})}),u.parent(y)||u.setEdge(h,x,{weight:0,minlen:d+g[y]})}function a(u){var h={};function f(p,d){var g=u.children(p);g&&g.length&&e.forEach(g,function(y){f(y,d+1)}),h[p]=d}return e.forEach(u.children(),function(p){f(p,1)}),h}function o(u){return e.reduce(u.edges(),function(h,f){return h+u.edge(f).weight},0)}function l(u){var h=u.graph();u.removeNode(h.nestingRoot),delete h.nestingRoot,e.forEach(u.edges(),function(f){var p=u.edge(f);p.nestingEdge&&u.removeEdge(f)})}return m_}var g_,F2;function z7(){if(F2)return g_;F2=1;var e=pt(),n=pn();g_=r;function r(a){function o(l){var u=a.children(l),h=a.node(l);if(u.length&&e.forEach(u,o),e.has(h,"minRank")){h.borderLeft=[],h.borderRight=[];for(var f=h.minRank,p=h.maxRank+1;f<p;++f)s(a,"borderLeft","_bl",l,h,f),s(a,"borderRight","_br",l,h,f)}}e.forEach(a.children(),o)}function s(a,o,l,u,h,f){var p={width:0,height:0,rank:f,borderType:o},d=h[o][f-1],g=n.addDummyNode(a,"border",p,l);h[o][f]=g,a.setParent(g,u),d&&a.setEdge(d,g,{weight:1})}return g_}var y_,G2;function U7(){if(G2)return y_;G2=1;var e=pt();y_={adjust:n,undo:r};function n(f){var p=f.graph().rankdir.toLowerCase();(p==="lr"||p==="rl")&&s(f)}function r(f){var p=f.graph().rankdir.toLowerCase();(p==="bt"||p==="rl")&&o(f),(p==="lr"||p==="rl")&&(u(f),s(f))}function s(f){e.forEach(f.nodes(),function(p){a(f.node(p))}),e.forEach(f.edges(),function(p){a(f.edge(p))})}function a(f){var p=f.width;f.width=f.height,f.height=p}function o(f){e.forEach(f.nodes(),function(p){l(f.node(p))}),e.forEach(f.edges(),function(p){var d=f.edge(p);e.forEach(d.points,l),e.has(d,"y")&&l(d)})}function l(f){f.y=-f.y}function u(f){e.forEach(f.nodes(),function(p){h(f.node(p))}),e.forEach(f.edges(),function(p){var d=f.edge(p);e.forEach(d.points,h),e.has(d,"x")&&h(d)})}function h(f){var p=f.x;f.x=f.y,f.y=p}return y_}var v_,K2;function Q7(){if(K2)return v_;K2=1;var e=pt();v_=n;function n(r){var s={},a=e.filter(r.nodes(),function(f){return!r.children(f).length}),o=e.max(e.map(a,function(f){return r.node(f).rank})),l=e.map(e.range(o+1),function(){return[]});function u(f){if(!e.has(s,f)){s[f]=!0;var p=r.node(f);l[p.rank].push(f),e.forEach(r.successors(f),u)}}var h=e.sortBy(a,function(f){return r.node(f).rank});return e.forEach(h,u),l}return v_}var b_,Y2;function H7(){if(Y2)return b_;Y2=1;var e=pt();b_=n;function n(s,a){for(var o=0,l=1;l<a.length;++l)o+=r(s,a[l-1],a[l]);return o}function r(s,a,o){for(var l=e.zipObject(o,e.map(o,function(g,y){return y})),u=e.flatten(e.map(a,function(g){return e.sortBy(e.map(s.outEdges(g),function(y){return{pos:l[y.w],weight:s.edge(y).weight}}),"pos")}),!0),h=1;h<o.length;)h<<=1;var f=2*h-1;h-=1;var p=e.map(new Array(f),function(){return 0}),d=0;return e.forEach(u.forEach(function(g){var y=g.pos+h;p[y]+=g.weight;for(var E=0;y>0;)y%2&&(E+=p[y+1]),y=y-1>>1,p[y]+=g.weight;d+=g.weight*E})),d}return b_}var __,X2;function V7(){if(X2)return __;X2=1;var e=pt();__=n;function n(r,s){return e.map(s,function(a){var o=r.inEdges(a);if(o.length){var l=e.reduce(o,function(u,h){var f=r.edge(h),p=r.node(h.v);return{sum:u.sum+f.weight*p.order,weight:u.weight+f.weight}},{sum:0,weight:0});return{v:a,barycenter:l.sum/l.weight,weight:l.weight}}else return{v:a}})}return __}var w_,W2;function F7(){if(W2)return w_;W2=1;var e=pt();w_=n;function n(a,o){var l={};e.forEach(a,function(h,f){var p=l[h.v]={indegree:0,in:[],out:[],vs:[h.v],i:f};e.isUndefined(h.barycenter)||(p.barycenter=h.barycenter,p.weight=h.weight)}),e.forEach(o.edges(),function(h){var f=l[h.v],p=l[h.w];!e.isUndefined(f)&&!e.isUndefined(p)&&(p.indegree++,f.out.push(l[h.w]))});var u=e.filter(l,function(h){return!h.indegree});return r(u)}function r(a){var o=[];function l(f){return function(p){p.merged||(e.isUndefined(p.barycenter)||e.isUndefined(f.barycenter)||p.barycenter>=f.barycenter)&&s(f,p)}}function u(f){return function(p){p.in.push(f),--p.indegree===0&&a.push(p)}}for(;a.length;){var h=a.pop();o.push(h),e.forEach(h.in.reverse(),l(h)),e.forEach(h.out,u(h))}return e.map(e.filter(o,function(f){return!f.merged}),function(f){return e.pick(f,["vs","i","barycenter","weight"])})}function s(a,o){var l=0,u=0;a.weight&&(l+=a.barycenter*a.weight,u+=a.weight),o.weight&&(l+=o.barycenter*o.weight,u+=o.weight),a.vs=o.vs.concat(a.vs),a.barycenter=l/u,a.weight=u,a.i=Math.min(o.i,a.i),o.merged=!0}return w_}var E_,J2;function G7(){if(J2)return E_;J2=1;var e=pt(),n=pn();E_=r;function r(o,l){var u=n.partition(o,function(x){return e.has(x,"barycenter")}),h=u.lhs,f=e.sortBy(u.rhs,function(x){return-x.i}),p=[],d=0,g=0,y=0;h.sort(a(!!l)),y=s(p,f,y),e.forEach(h,function(x){y+=x.vs.length,p.push(x.vs),d+=x.barycenter*x.weight,g+=x.weight,y=s(p,f,y)});var E={vs:e.flatten(p,!0)};return g&&(E.barycenter=d/g,E.weight=g),E}function s(o,l,u){for(var h;l.length&&(h=e.last(l)).i<=u;)l.pop(),o.push(h.vs),u++;return u}function a(o){return function(l,u){return l.barycenter<u.barycenter?-1:l.barycenter>u.barycenter?1:o?u.i-l.i:l.i-u.i}}return E_}var C_,Z2;function K7(){if(Z2)return C_;Z2=1;var e=pt(),n=V7(),r=F7(),s=G7();C_=a;function a(u,h,f,p){var d=u.children(h),g=u.node(h),y=g?g.borderLeft:void 0,E=g?g.borderRight:void 0,x={};y&&(d=e.filter(d,function(A){return A!==y&&A!==E}));var v=n(u,d);e.forEach(v,function(A){if(u.children(A.v).length){var N=a(u,A.v,f,p);x[A.v]=N,e.has(N,"barycenter")&&l(A,N)}});var b=r(v,f);o(b,x);var w=s(b,p);if(y&&(w.vs=e.flatten([y,w.vs,E],!0),u.predecessors(y).length)){var C=u.node(u.predecessors(y)[0]),T=u.node(u.predecessors(E)[0]);e.has(w,"barycenter")||(w.barycenter=0,w.weight=0),w.barycenter=(w.barycenter*w.weight+C.order+T.order)/(w.weight+2),w.weight+=2}return w}function o(u,h){e.forEach(u,function(f){f.vs=e.flatten(f.vs.map(function(p){return h[p]?h[p].vs:p}),!0)})}function l(u,h){e.isUndefined(u.barycenter)?(u.barycenter=h.barycenter,u.weight=h.weight):(u.barycenter=(u.barycenter*u.weight+h.barycenter*h.weight)/(u.weight+h.weight),u.weight+=h.weight)}return C_}var x_,ej;function Y7(){if(ej)return x_;ej=1;var e=pt(),n=er().Graph;x_=r;function r(a,o,l){var u=s(a),h=new n({compound:!0}).setGraph({root:u}).setDefaultNodeLabel(function(f){return a.node(f)});return e.forEach(a.nodes(),function(f){var p=a.node(f),d=a.parent(f);(p.rank===o||p.minRank<=o&&o<=p.maxRank)&&(h.setNode(f),h.setParent(f,d||u),e.forEach(a[l](f),function(g){var y=g.v===f?g.w:g.v,E=h.edge(y,f),x=e.isUndefined(E)?0:E.weight;h.setEdge(y,f,{weight:a.edge(g).weight+x})}),e.has(p,"minRank")&&h.setNode(f,{borderLeft:p.borderLeft[o],borderRight:p.borderRight[o]}))}),h}function s(a){for(var o;a.hasNode(o=e.uniqueId("_root")););return o}return x_}var S_,tj;function X7(){if(tj)return S_;tj=1;var e=pt();S_=n;function n(r,s,a){var o={},l;e.forEach(a,function(u){for(var h=r.parent(u),f,p;h;){if(f=r.parent(h),f?(p=o[f],o[f]=h):(p=l,l=h),p&&p!==h){s.setEdge(p,h);return}h=f}})}return S_}var T_,nj;function W7(){if(nj)return T_;nj=1;var e=pt(),n=Q7(),r=H7(),s=K7(),a=Y7(),o=X7(),l=er().Graph,u=pn();T_=h;function h(g){var y=u.maxRank(g),E=f(g,e.range(1,y+1),"inEdges"),x=f(g,e.range(y-1,-1,-1),"outEdges"),v=n(g);d(g,v);for(var b=Number.POSITIVE_INFINITY,w,C=0,T=0;T<4;++C,++T){p(C%2?E:x,C%4>=2),v=u.buildLayerMatrix(g);var A=r(g,v);A<b&&(T=0,w=e.cloneDeep(v),b=A)}d(g,w)}function f(g,y,E){return e.map(y,function(x){return a(g,x,E)})}function p(g,y){var E=new l;e.forEach(g,function(x){var v=x.graph().root,b=s(x,v,E,y);e.forEach(b.vs,function(w,C){x.node(w).order=C}),o(x,E,b.vs)})}function d(g,y){e.forEach(y,function(E){e.forEach(E,function(x,v){g.node(x).order=v})})}return T_}var q_,rj;function J7(){if(rj)return q_;rj=1;var e=pt(),n=er().Graph,r=pn();q_={positionX:E,findType1Conflicts:s,findType2Conflicts:a,addConflict:l,hasConflict:u,verticalAlignment:h,horizontalCompaction:f,alignCoordinates:g,findSmallestWidthAlignment:d,balance:y};function s(b,w){var C={};function T(A,N){var O=0,I=0,k=A.length,R=e.last(N);return e.forEach(N,function(M,D){var z=o(b,M),q=z?b.node(z).order:k;(z||M===R)&&(e.forEach(N.slice(I,D+1),function(j){e.forEach(b.predecessors(j),function(L){var P=b.node(L),H=P.order;(H<O||q<H)&&!(P.dummy&&b.node(j).dummy)&&l(C,L,j)})}),I=D+1,O=q)}),N}return e.reduce(w,T),C}function a(b,w){var C={};function T(N,O,I,k,R){var M;e.forEach(e.range(O,I),function(D){M=N[D],b.node(M).dummy&&e.forEach(b.predecessors(M),function(z){var q=b.node(z);q.dummy&&(q.order<k||q.order>R)&&l(C,z,M)})})}function A(N,O){var I=-1,k,R=0;return e.forEach(O,function(M,D){if(b.node(M).dummy==="border"){var z=b.predecessors(M);z.length&&(k=b.node(z[0]).order,T(O,R,D,I,k),R=D,I=k)}T(O,R,O.length,k,N.length)}),O}return e.reduce(w,A),C}function o(b,w){if(b.node(w).dummy)return e.find(b.predecessors(w),function(C){return b.node(C).dummy})}function l(b,w,C){if(w>C){var T=w;w=C,C=T}var A=b[w];A||(b[w]=A={}),A[C]=!0}function u(b,w,C){if(w>C){var T=w;w=C,C=T}return e.has(b[w],C)}function h(b,w,C,T){var A={},N={},O={};return e.forEach(w,function(I){e.forEach(I,function(k,R){A[k]=k,N[k]=k,O[k]=R})}),e.forEach(w,function(I){var k=-1;e.forEach(I,function(R){var M=T(R);if(M.length){M=e.sortBy(M,function(L){return O[L]});for(var D=(M.length-1)/2,z=Math.floor(D),q=Math.ceil(D);z<=q;++z){var j=M[z];N[R]===R&&k<O[j]&&!u(C,R,j)&&(N[j]=R,N[R]=A[R]=A[j],k=O[j])}}})}),{root:A,align:N}}function f(b,w,C,T,A){var N={},O=p(b,w,C,A),I=A?"borderLeft":"borderRight";function k(D,z){for(var q=O.nodes(),j=q.pop(),L={};j;)L[j]?D(j):(L[j]=!0,q.push(j),q=q.concat(z(j))),j=q.pop()}function R(D){N[D]=O.inEdges(D).reduce(function(z,q){return Math.max(z,N[q.v]+O.edge(q))},0)}function M(D){var z=O.outEdges(D).reduce(function(j,L){return Math.min(j,N[L.w]-O.edge(L))},Number.POSITIVE_INFINITY),q=b.node(D);z!==Number.POSITIVE_INFINITY&&q.borderType!==I&&(N[D]=Math.max(N[D],z))}return k(R,O.predecessors.bind(O)),k(M,O.successors.bind(O)),e.forEach(T,function(D){N[D]=N[C[D]]}),N}function p(b,w,C,T){var A=new n,N=b.graph(),O=x(N.nodesep,N.edgesep,T);return e.forEach(w,function(I){var k;e.forEach(I,function(R){var M=C[R];if(A.setNode(M),k){var D=C[k],z=A.edge(D,M);A.setEdge(D,M,Math.max(O(b,R,k),z||0))}k=R})}),A}function d(b,w){return e.minBy(e.values(w),function(C){var T=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY;return e.forIn(C,function(N,O){var I=v(b,O)/2;T=Math.max(N+I,T),A=Math.min(N-I,A)}),T-A})}function g(b,w){var C=e.values(w),T=e.min(C),A=e.max(C);e.forEach(["u","d"],function(N){e.forEach(["l","r"],function(O){var I=N+O,k=b[I],R;if(k!==w){var M=e.values(k);R=O==="l"?T-e.min(M):A-e.max(M),R&&(b[I]=e.mapValues(k,function(D){return D+R}))}})})}function y(b,w){return e.mapValues(b.ul,function(C,T){if(w)return b[w.toLowerCase()][T];var A=e.sortBy(e.map(b,T));return(A[1]+A[2])/2})}function E(b){var w=r.buildLayerMatrix(b),C=e.merge(s(b,w),a(b,w)),T={},A;e.forEach(["u","d"],function(O){A=O==="u"?w:e.values(w).reverse(),e.forEach(["l","r"],function(I){I==="r"&&(A=e.map(A,function(D){return e.values(D).reverse()}));var k=(O==="u"?b.predecessors:b.successors).bind(b),R=h(b,A,C,k),M=f(b,A,R.root,R.align,I==="r");I==="r"&&(M=e.mapValues(M,function(D){return-D})),T[O+I]=M})});var N=d(b,T);return g(T,N),y(T,b.graph().align)}function x(b,w,C){return function(T,A,N){var O=T.node(A),I=T.node(N),k=0,R;if(k+=O.width/2,e.has(O,"labelpos"))switch(O.labelpos.toLowerCase()){case"l":R=-O.width/2;break;case"r":R=O.width/2;break}if(R&&(k+=C?R:-R),R=0,k+=(O.dummy?w:b)/2,k+=(I.dummy?w:b)/2,k+=I.width/2,e.has(I,"labelpos"))switch(I.labelpos.toLowerCase()){case"l":R=I.width/2;break;case"r":R=-I.width/2;break}return R&&(k+=C?R:-R),R=0,k}}function v(b,w){return b.node(w).width}return q_}var A_,ij;function Z7(){if(ij)return A_;ij=1;var e=pt(),n=pn(),r=J7().positionX;A_=s;function s(o){o=n.asNonCompoundGraph(o),a(o),e.forEach(r(o),function(l,u){o.node(u).x=l})}function a(o){var l=n.buildLayerMatrix(o),u=o.graph().ranksep,h=0;e.forEach(l,function(f){var p=e.max(e.map(f,function(d){return o.node(d).height}));e.forEach(f,function(d){o.node(d).y=h+p/2}),h+=p+u})}return A_}var N_,sj;function eK(){if(sj)return N_;sj=1;var e=pt(),n=$7(),r=I7(),s=k7(),a=pn().normalizeRanks,o=B7(),l=pn().removeEmptyRanks,u=P7(),h=z7(),f=U7(),p=W7(),d=Z7(),g=pn(),y=er().Graph;N_=E;function E(Q,J){var ie=J&&J.debugTiming?g.time:g.notime;ie("layout",function(){var oe=ie(" buildLayoutGraph",function(){return k(Q)});ie(" runLayout",function(){x(oe,ie)}),ie(" updateInputGraph",function(){v(Q,oe)})})}function x(Q,J){J(" makeSpaceForEdgeLabels",function(){R(Q)}),J(" removeSelfEdges",function(){G(Q)}),J(" acyclic",function(){n.run(Q)}),J(" nestingGraph.run",function(){u.run(Q)}),J(" rank",function(){s(g.asNonCompoundGraph(Q))}),J(" injectEdgeLabelProxies",function(){M(Q)}),J(" removeEmptyRanks",function(){l(Q)}),J(" nestingGraph.cleanup",function(){u.cleanup(Q)}),J(" normalizeRanks",function(){a(Q)}),J(" assignRankMinMax",function(){D(Q)}),J(" removeEdgeLabelProxies",function(){z(Q)}),J(" normalize.run",function(){r.run(Q)}),J(" parentDummyChains",function(){o(Q)}),J(" addBorderSegments",function(){h(Q)}),J(" order",function(){p(Q)}),J(" insertSelfEdges",function(){V(Q)}),J(" adjustCoordinateSystem",function(){f.adjust(Q)}),J(" position",function(){d(Q)}),J(" positionSelfEdges",function(){B(Q)}),J(" removeBorderNodes",function(){H(Q)}),J(" normalize.undo",function(){r.undo(Q)}),J(" fixupEdgeLabelCoords",function(){L(Q)}),J(" undoCoordinateSystem",function(){f.undo(Q)}),J(" translateGraph",function(){q(Q)}),J(" assignNodeIntersects",function(){j(Q)}),J(" reversePoints",function(){P(Q)}),J(" acyclic.undo",function(){n.undo(Q)})}function v(Q,J){e.forEach(Q.nodes(),function(ie){var oe=Q.node(ie),ee=J.node(ie);oe&&(oe.x=ee.x,oe.y=ee.y,J.children(ie).length&&(oe.width=ee.width,oe.height=ee.height))}),e.forEach(Q.edges(),function(ie){var oe=Q.edge(ie),ee=J.edge(ie);oe.points=ee.points,e.has(ee,"x")&&(oe.x=ee.x,oe.y=ee.y)}),Q.graph().width=J.graph().width,Q.graph().height=J.graph().height}var b=["nodesep","edgesep","ranksep","marginx","marginy"],w={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},C=["acyclicer","ranker","rankdir","align"],T=["width","height"],A={width:0,height:0},N=["minlen","weight","width","height","labeloffset"],O={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},I=["labelpos"];function k(Q){var J=new y({multigraph:!0,compound:!0}),ie=ne(Q.graph());return J.setGraph(e.merge({},w,K(ie,b),e.pick(ie,C))),e.forEach(Q.nodes(),function(oe){var ee=ne(Q.node(oe));J.setNode(oe,e.defaults(K(ee,T),A)),J.setParent(oe,Q.parent(oe))}),e.forEach(Q.edges(),function(oe){var ee=ne(Q.edge(oe));J.setEdge(oe,e.merge({},O,K(ee,N),e.pick(ee,I)))}),J}function R(Q){var J=Q.graph();J.ranksep/=2,e.forEach(Q.edges(),function(ie){var oe=Q.edge(ie);oe.minlen*=2,oe.labelpos.toLowerCase()!=="c"&&(J.rankdir==="TB"||J.rankdir==="BT"?oe.width+=oe.labeloffset:oe.height+=oe.labeloffset)})}function M(Q){e.forEach(Q.edges(),function(J){var ie=Q.edge(J);if(ie.width&&ie.height){var oe=Q.node(J.v),ee=Q.node(J.w),fe={rank:(ee.rank-oe.rank)/2+oe.rank,e:J};g.addDummyNode(Q,"edge-proxy",fe,"_ep")}})}function D(Q){var J=0;e.forEach(Q.nodes(),function(ie){var oe=Q.node(ie);oe.borderTop&&(oe.minRank=Q.node(oe.borderTop).rank,oe.maxRank=Q.node(oe.borderBottom).rank,J=e.max(J,oe.maxRank))}),Q.graph().maxRank=J}function z(Q){e.forEach(Q.nodes(),function(J){var ie=Q.node(J);ie.dummy==="edge-proxy"&&(Q.edge(ie.e).labelRank=ie.rank,Q.removeNode(J))})}function q(Q){var J=Number.POSITIVE_INFINITY,ie=0,oe=Number.POSITIVE_INFINITY,ee=0,fe=Q.graph(),be=fe.marginx||0,ve=fe.marginy||0;function _e(we){var W=we.x,ae=we.y,xe=we.width,Se=we.height;J=Math.min(J,W-xe/2),ie=Math.max(ie,W+xe/2),oe=Math.min(oe,ae-Se/2),ee=Math.max(ee,ae+Se/2)}e.forEach(Q.nodes(),function(we){_e(Q.node(we))}),e.forEach(Q.edges(),function(we){var W=Q.edge(we);e.has(W,"x")&&_e(W)}),J-=be,oe-=ve,e.forEach(Q.nodes(),function(we){var W=Q.node(we);W.x-=J,W.y-=oe}),e.forEach(Q.edges(),function(we){var W=Q.edge(we);e.forEach(W.points,function(ae){ae.x-=J,ae.y-=oe}),e.has(W,"x")&&(W.x-=J),e.has(W,"y")&&(W.y-=oe)}),fe.width=ie-J+be,fe.height=ee-oe+ve}function j(Q){e.forEach(Q.edges(),function(J){var ie=Q.edge(J),oe=Q.node(J.v),ee=Q.node(J.w),fe,be;ie.points?(fe=ie.points[0],be=ie.points[ie.points.length-1]):(ie.points=[],fe=ee,be=oe),ie.points.unshift(g.intersectRect(oe,fe)),ie.points.push(g.intersectRect(ee,be))})}function L(Q){e.forEach(Q.edges(),function(J){var ie=Q.edge(J);if(e.has(ie,"x"))switch((ie.labelpos==="l"||ie.labelpos==="r")&&(ie.width-=ie.labeloffset),ie.labelpos){case"l":ie.x-=ie.width/2+ie.labeloffset;break;case"r":ie.x+=ie.width/2+ie.labeloffset;break}})}function P(Q){e.forEach(Q.edges(),function(J){var ie=Q.edge(J);ie.reversed&&ie.points.reverse()})}function H(Q){e.forEach(Q.nodes(),function(J){if(Q.children(J).length){var ie=Q.node(J),oe=Q.node(ie.borderTop),ee=Q.node(ie.borderBottom),fe=Q.node(e.last(ie.borderLeft)),be=Q.node(e.last(ie.borderRight));ie.width=Math.abs(be.x-fe.x),ie.height=Math.abs(ee.y-oe.y),ie.x=fe.x+ie.width/2,ie.y=oe.y+ie.height/2}}),e.forEach(Q.nodes(),function(J){Q.node(J).dummy==="border"&&Q.removeNode(J)})}function G(Q){e.forEach(Q.edges(),function(J){if(J.v===J.w){var ie=Q.node(J.v);ie.selfEdges||(ie.selfEdges=[]),ie.selfEdges.push({e:J,label:Q.edge(J)}),Q.removeEdge(J)}})}function V(Q){var J=g.buildLayerMatrix(Q);e.forEach(J,function(ie){var oe=0;e.forEach(ie,function(ee,fe){var be=Q.node(ee);be.order=fe+oe,e.forEach(be.selfEdges,function(ve){g.addDummyNode(Q,"selfedge",{width:ve.label.width,height:ve.label.height,rank:be.rank,order:fe+ ++oe,e:ve.e,label:ve.label},"_se")}),delete be.selfEdges})})}function B(Q){e.forEach(Q.nodes(),function(J){var ie=Q.node(J);if(ie.dummy==="selfedge"){var oe=Q.node(ie.e.v),ee=oe.x+oe.width/2,fe=oe.y,be=ie.x-ee,ve=oe.height/2;Q.setEdge(ie.e,ie.label),Q.removeNode(J),ie.label.points=[{x:ee+2*be/3,y:fe-ve},{x:ee+5*be/6,y:fe-ve},{x:ee+be,y:fe},{x:ee+5*be/6,y:fe+ve},{x:ee+2*be/3,y:fe+ve}],ie.label.x=ie.x,ie.label.y=ie.y}})}function K(Q,J){return e.mapValues(e.pick(Q,J),Number)}function ne(Q){var J={};return e.forEach(Q,function(ie,oe){J[oe.toLowerCase()]=ie}),J}return N_}var R_,aj;function tK(){if(aj)return R_;aj=1;var e=pt(),n=pn(),r=er().Graph;R_={debugOrdering:s};function s(a){var o=n.buildLayerMatrix(a),l=new r({compound:!0,multigraph:!0}).setGraph({});return e.forEach(a.nodes(),function(u){l.setNode(u,{label:u}),l.setParent(u,"layer"+a.node(u).rank)}),e.forEach(a.edges(),function(u){l.setEdge(u.v,u.w,{},u.name)}),e.forEach(o,function(u,h){var f="layer"+h;l.setNode(f,{rank:"same"}),e.reduce(u,function(p,d){return l.setEdge(p,d,{style:"invis"}),d})}),l}return R_}var O_,oj;function nK(){return oj||(oj=1,O_="0.8.5"),O_}var M_,uj;function rK(){return uj||(uj=1,M_={graphlib:er(),layout:eK(),debug:tK(),util:{time:pn().time,notime:pn().notime},version:nK()}),M_}var iK=rK();const lj=hC(iK),lC=250,sK=60,aK=24,oK=80,uK=60;function lK(e,n,r){var a,o,l;const s=new lj.graphlib.Graph;s.setDefaultEdgeLabel(()=>({})),s.setGraph({rankdir:"TB",nodesep:60,ranksep:80});for(const u of e){const h=(a=u.data)==null?void 0:a.nodeKey,f=h?(o=r==null?void 0:r.collapsedNodes)==null?void 0:o.has(h):!1,p=(h?(l=r==null?void 0:r.nodeWidths)==null?void 0:l.get(h):void 0)??lC,d=u.type==="ghostNode"?oK:f?uK:sK+u.data.table.columns.length*aK;s.setNode(u.id,{width:p,height:d})}for(const u of n)s.setEdge(u.source,u.target);return lj.layout(s),e.map(u=>{var d,g;const h=s.node(u.id),f=(d=u.data)==null?void 0:d.nodeKey,p=(f?(g=r==null?void 0:r.nodeWidths)==null?void 0:g.get(f):void 0)??lC;return{...u,position:{x:h.x-p/2,y:h.y-h.height/2},style:{...u.style,width:p}}})}function cK(e){const n=new Map,r=new Map;if(!e)return{changesByTable:n,removedByTable:r};for(const s of e.changes)if(s.type==="column-added"){let a=n.get(s.table);a||(a=new Map,n.set(s.table,a)),a.set(s.column,"added")}else if(s.type==="column-removed"){let a=r.get(s.table);a||(a=[],r.set(s.table,a)),a.push({name:s.column,dataType:s.dataType})}else if(s.type==="column-type-changed"){let a=n.get(s.table);a||(a=new Map,n.set(s.table,a)),a.set(s.column,"type-changed")}else if(s.type==="column-nullability-changed"){let a=n.get(s.table);a||(a=new Map,n.set(s.table,a)),a.set(s.column,"nullability-changed")}return{changesByTable:n,removedByTable:r}}function fK(e,n,r){if(!n||!r)return;const s=r.get(e);if(s)return n[s]}function hK(e,n,r,s,a,o){const l=new Set(e.tables.map(w=>w.name)),{changesByTable:u,removedByTable:h}=cK(s??null),f=e.tables.map(w=>{var A,N;const C=Zn(w.schema,w.name),T=((A=o==null?void 0:o.nodeWidths)==null?void 0:A.get(C))??lC;return{id:`table-${w.name}`,type:"tableNode",position:{x:0,y:0},style:{width:T},data:{table:w,visibleTableNames:l,columnChanges:u.get(w.name),removedColumns:h.get(w.name),collapsed:((N=o==null?void 0:o.collapsedNodes)==null?void 0:N.has(C))??!1,onToggleCollapse:o==null?void 0:o.onToggleCollapse,nodeKey:C,headerColor:fK(C,o==null?void 0:o.colorAssignments,o==null?void 0:o.nodeColorGroups)}}}),p=(o==null?void 0:o.crossSchemaExpansion)===!1,d=(o==null?void 0:o.startSchema)??null,g=e.ghostNodes.map(w=>{const C=p&&w.schema!==d;return{id:`ghost-${w.tableName}`,type:"ghostNode",position:{x:0,y:0},data:{ghost:w,onExpand:C?()=>{}:n,blocked:C}}}),y=[];for(const w of e.tables)for(const C of w.foreignKeys){const T=l.has(C.referencedTable)?`table-${C.referencedTable}`:`ghost-${C.referencedTable}`;y.push({id:`fk-${w.name}-${C.columnName}-${C.referencedTable}`,source:`table-${w.name}`,target:T,label:C.constraintName,type:"default"})}for(const w of e.ghostNodes)for(const C of w.referencingEdges)if(l.has(C.fromTable)){const T=`ghost-ref-${C.fromTable}-${C.fromColumn}-${w.tableName}`;y.some(A=>A.id===T)||y.push({id:T,source:`table-${C.fromTable}`,target:`ghost-${w.tableName}`,style:{strokeDasharray:"5 5"},type:"default"})}const E=[];if(s){for(const w of s.changes)if(w.type==="table-removed"){const C=w.schema?`${w.schema}.${w.table}`:w.table;E.push({id:`deleted-${w.table}`,type:"deletedTableNode",position:r.get(C)??{x:0,y:0},data:{tableName:w.table,schema:w.schema,onAcknowledge:a??(()=>{})}})}}const x=[...f,...g];return{nodes:[...lK(x,y,o).map(w=>{let C;if(w.type==="tableNode"){const T=w.data.table;C=Zn(T.schema,T.name)}else if(w.type==="ghostNode"){const T=w.data.ghost;C=Zn(T.schema,T.tableName)}return C&&r.has(C)?{...w,position:r.get(C)}:w}),...E],edges:y}}const dK={tableNode:aG,ghostNode:oG,deletedTableNode:uG};function pK(){const e=qe(D=>D.crawlResult),n=qe(D=>D.connectionId),r=qe(D=>D.addExpandedTable),s=qe(D=>D.nodePositions),a=qe(D=>D.updateNodePosition),o=qe(D=>D.updateNodeWidth),l=qe(D=>D.schemaDiff),u=qe(D=>D.setSchemaBaseline),h=qe(D=>D.setSchemaDiff),f=qe(D=>D.collapsedNodes),p=qe(D=>D.toggleNodeCollapsed),d=qe(D=>D.nodeWidths),g=qe(D=>D.colorAssignments),y=qe(D=>D.nodeColorGroups),E=qe(D=>D.crossSchemaExpansion),x=te.useCallback((D,z)=>{const q=qe.getState().schemaDiff;if(!q)return;const j=q.changes.filter(H=>!(H.type==="table-removed"&&H.table===D)),L=j.filter(H=>H.type==="table-removed").map(H=>H.table);h({...q,changes:j,hasChanges:j.length>0,tablesRemoved:L});const P=qe.getState().schemaBaseline;P&&u(P.filter(H=>H.name!==D))},[h,u]),v=Xn.useUtils(),b=te.useCallback(async D=>{if(!n)return;const z=await v.schema.expandGhostNode.fetch({connectionId:n,tableName:D.tableName,schema:D.schema});if(!z)return;const q=qe.getState().crawlResult;if(!q)return;const j=new Set(q.tables.map(P=>P.name));j.add(z.name);const L=[];for(const P of z.foreignKeys)!j.has(P.referencedTable)&&!q.ghostNodes.some(H=>H.tableName===P.referencedTable)&&L.push({tableName:P.referencedTable,schema:P.referencedSchema,referencingEdges:[{fromTable:z.name,fromColumn:P.columnName,toColumn:P.referencedColumn}]});r(z,L,D.tableName)},[n,v,r]),w=te.useMemo(()=>({collapsedNodes:f,nodeWidths:d,colorAssignments:g,nodeColorGroups:y,onToggleCollapse:p,crossSchemaExpansion:E,startSchema:(e==null?void 0:e.startSchema)??null}),[f,d,g,y,p,E,e==null?void 0:e.startSchema]),{initialNodes:C,initialEdges:T}=te.useMemo(()=>{if(!e)return{initialNodes:[],initialEdges:[]};const{nodes:D,edges:z}=hK(e,b,s,l,x,w);return{initialNodes:D,initialEdges:z}},[e,b,s,l,x,w]),[A,N,O]=RF(C),[I,k,R]=OF(T);te.useEffect(()=>{N(C),k(T)},[C,T,N,k]);const M=te.useCallback(D=>{O(D);for(const z of D){if(z.type==="position"&&z.position&&!z.dragging){const q=z.id,j=qe.getState().crawlResult;if(!j)continue;if(q.startsWith("table-")){const L=q.slice(6),P=j.tables.find(H=>H.name===L);P&&a(Zn(P.schema,P.name),z.position)}else if(q.startsWith("ghost-")){const L=q.slice(6),P=j.ghostNodes.find(H=>H.tableName===L);P&&a(Zn(P.schema,P.tableName),z.position)}}if(z.type==="dimensions"&&z.dimensions&&z.resizing===!1){const q=z.id,j=qe.getState().crawlResult;if(!j)continue;if(q.startsWith("table-")){const L=q.slice(6),P=j.tables.find(H=>H.name===L);P&&o(Zn(P.schema,P.name),z.dimensions.width)}}}},[O,a,o]);return e?F.jsx("div",{className:"canvas-container",children:F.jsxs(NF,{nodes:A,edges:I,onNodesChange:M,onEdgesChange:R,nodeTypes:dK,fitView:!0,minZoom:.1,maxZoom:2,children:[F.jsx(IF,{}),F.jsx(QF,{})]})}):null}const j_=["#58a6ff","#3fb950","#f0883e","#bc8cff","#f778ba","#79c0ff","#56d364","#e3b341"];function L_(e,n){const r=qe.getState(),{crawlResult:s,nodePositions:a,databaseLabel:o,dialect:l,collapsedNodes:u,nodeWidths:h,colorAssignments:f,nodeColorGroups:p,crossSchemaExpansion:d}=r;if(!s||!o||!l)return null;const g=s.tables.map(E=>{const x=Zn(E.schema,E.name),v=a.get(x)??{x:0,y:0};return{tableName:E.name,schema:E.schema,position:v,collapsed:u.has(x),width:h.get(x),colorGroup:p.get(x)}}),y=s.ghostNodes.map(E=>{const x=Zn(E.schema,E.tableName),v=a.get(x)??{x:0,y:0};return{tableName:E.tableName,schema:E.schema,position:v}});return{...n?{id:n}:{},name:e,databaseLabel:o,dialect:l,startTable:s.startTable??"",startSchema:s.startSchema??null,depth:s.depth,nodes:g,ghostNodes:y,schemaSnapshot:s.tables,colorAssignments:Object.keys(f).length>0?f:void 0,crossSchemaExpansion:d}}function mK(){const e=qe(ee=>ee.currentWorkspaceId),n=qe(ee=>ee.currentWorkspaceName),r=qe(ee=>ee.setWorkspace),s=qe(ee=>ee.clearWorkspace),a=qe(ee=>ee.connectionId),o=qe(ee=>ee.setCrawlResult),l=qe(ee=>ee.updateNodePosition),u=qe(ee=>ee.setSchemaBaseline),h=qe(ee=>ee.toggleNodeCollapsed),f=qe(ee=>ee.updateNodeWidth),p=qe(ee=>ee.setColorAssignments),d=qe(ee=>ee.setAllNodeColorGroups),g=qe(ee=>ee.setCrossSchemaExpansion),y=qe(ee=>ee.crossSchemaExpansion),E=qe(ee=>ee.colorAssignments),x=qe(ee=>ee.setColorAssignment),[v,b]=te.useState(""),[w,C]=te.useState(!1),[T,A]=te.useState(!1),[N,O]=te.useState(null),[I,k]=te.useState(null),R=Xn.workspace.list.useQuery(),M=Xn.workspace.save.useMutation(),D=Xn.workspace.delete.useMutation(),z=Xn.useUtils(),q=te.useRef(null),j=qe(ee=>ee.nodePositions),L=qe(ee=>ee.collapsedNodes),P=qe(ee=>ee.nodeWidths),H=qe(ee=>ee.nodeColorGroups);te.useEffect(()=>{if(!(!e||!n))return q.current&&clearTimeout(q.current),q.current=setTimeout(async()=>{const ee=L_(n,e);ee&&(await M.mutateAsync(ee),z.workspace.list.invalidate())},2e3),()=>{q.current&&clearTimeout(q.current)}},[j,L,P,E,H,y,e,n]);const G=qe(ee=>ee.crawlResult),V=te.useRef(!1);te.useEffect(()=>{if(!G||V.current||Object.keys(qe.getState().colorAssignments).length>0)return;const ee=new Set;for(const _e of G.tables)ee.add(_e.schema??"__default__");if(ee.size<=1)return;const fe={},be=new Map;let ve=0;for(const _e of ee)fe[_e]=j_[ve%j_.length],ve++;for(const _e of G.tables){const we=Zn(_e.schema,_e.name);be.set(we,_e.schema??"__default__")}p(fe),d(be),V.current=!0},[G,p,d]);const B=te.useCallback(async()=>{if(e&&n){const ee=L_(n,e);if(!ee)return;await M.mutateAsync(ee),z.workspace.list.invalidate()}else C(!0),A(!1)},[e,n,M,z]),K=te.useCallback(()=>{C(!0),A(!0)},[]),ne=te.useCallback(async()=>{if(!v.trim())return;const ee=T?void 0:e??void 0,fe=L_(v.trim(),ee);if(!fe)return;const be=await M.mutateAsync(fe);r(be.id,be.name),C(!1),b(""),z.workspace.list.invalidate()},[v,T,e,M,r,z]),Q=te.useCallback(async ee=>{if(!a)return;const fe=await z.workspace.get.fetch({id:ee.id});if(fe.startTable){const ve=await z.schema.crawlFrom.fetch({connectionId:a,tableName:fe.startTable,schema:fe.startSchema,maxDepth:fe.depth});o(ve)}fe.schemaSnapshot&&u(fe.schemaSnapshot),s(),r(fe.id,fe.name);const be=new Map;for(const ve of fe.nodes){const _e=Zn(ve.schema,ve.tableName);l(_e,ve.position),ve.collapsed&&h(_e),ve.width&&f(_e,ve.width),ve.colorGroup&&be.set(_e,ve.colorGroup)}for(const ve of fe.ghostNodes)l(Zn(ve.schema,ve.tableName),ve.position);fe.colorAssignments&&p(fe.colorAssignments),be.size>0&&d(be),fe.crossSchemaExpansion!==void 0&&g(fe.crossSchemaExpansion)},[a,z,o,r,s,l,u,h,f,p,d,g]),J=te.useCallback(async ee=>{await D.mutateAsync({id:ee}),e===ee&&s(),O(null),z.workspace.list.invalidate()},[D,e,s,z]),ie=Object.keys(E),oe=R.data??[];return F.jsxs("div",{className:"workspace-panel",children:[F.jsx("h3",{children:"Workspaces"}),n&&F.jsxs("div",{className:"workspace-current",children:["Active: ",F.jsx("strong",{children:n})]}),F.jsxs("div",{className:"workspace-actions",children:[F.jsx("button",{onClick:B,disabled:M.isPending,children:M.isPending?"Saving...":"Save"}),F.jsx("button",{onClick:K,children:"Save As..."})]}),w&&F.jsxs("div",{className:"workspace-name-prompt",children:[F.jsx("input",{value:v,onChange:ee=>b(ee.target.value),placeholder:"Workspace name",onKeyDown:ee=>ee.key==="Enter"&&ne(),autoFocus:!0}),F.jsx("button",{onClick:ne,children:"OK"}),F.jsx("button",{onClick:()=>C(!1),children:"Cancel"})]}),F.jsx("div",{className:"workspace-option",children:F.jsxs("label",{className:"workspace-checkbox",children:[F.jsx("input",{type:"checkbox",checked:y,onChange:ee=>g(ee.target.checked)}),"Allow cross-schema expansion"]})}),ie.length>0&&F.jsxs("div",{className:"workspace-colors",children:[F.jsx("h4",{children:"Schema Colors"}),ie.map(ee=>F.jsxs("div",{className:"workspace-color-row",children:[F.jsx("span",{className:"workspace-color-label",children:ee==="__default__"?"(default)":ee}),F.jsxs("div",{className:"workspace-color-swatch-wrapper",children:[F.jsx("div",{className:"workspace-color-swatch",style:{background:E[ee]},onClick:()=>k(I===ee?null:ee)}),I===ee&&F.jsx("div",{className:"workspace-color-picker",children:j_.map(fe=>F.jsx("div",{className:`workspace-color-option ${fe===E[ee]?"selected":""}`,style:{background:fe},onClick:()=>{x(ee,fe),k(null)}},fe))})]})]},ee))]}),F.jsxs("div",{className:"workspace-list",children:[oe.map(ee=>F.jsxs("div",{className:`workspace-item ${ee.id===e?"active":""}`,children:[F.jsxs("div",{className:"workspace-item-info",onClick:()=>Q(ee),children:[F.jsx("div",{className:"workspace-item-name",children:ee.name}),F.jsxs("div",{className:"workspace-item-meta",children:[ee.databaseLabel," · ",new Date(ee.updatedAt).toLocaleDateString()]})]}),N===ee.id?F.jsxs("div",{className:"workspace-delete-confirm",children:[F.jsx("button",{onClick:()=>J(ee.id),children:"Confirm"}),F.jsx("button",{onClick:()=>O(null),children:"Cancel"})]}):F.jsx("button",{className:"workspace-delete-btn",onClick:()=>O(ee.id),children:"×"})]},ee.id)),oe.length===0&&F.jsx("div",{className:"workspace-empty",children:"No saved workspaces"})]})]})}function gK(){const e=qe(o=>o.schemaDiff),n=qe(o=>o.pollingEnabled),r=qe(o=>o.setPollingEnabled),s=qe(o=>o.acceptSchemaChanges),a=(e==null?void 0:e.changes.length)??0;return F.jsxs("div",{className:"diff-summary",children:[F.jsx("h3",{children:"Schema Sync"}),F.jsx("div",{className:"diff-summary-status",children:e!=null&&e.hasChanges?F.jsxs("span",{className:"diff-summary-changes",children:[a," change",a!==1?"s":""," detected"]}):F.jsx("span",{className:"diff-summary-synced",children:"Schema in sync"})}),F.jsxs("div",{className:"diff-summary-actions",children:[F.jsx("button",{className:"secondary",onClick:()=>r(!n),children:n?"Pause Polling":"Resume Polling"}),(e==null?void 0:e.hasChanges)&&F.jsx("button",{onClick:s,children:"Accept All Changes"})]})]})}var df={exports:{}},pf={},mf={},gf={},cj;function rP(){if(cj)return gf;cj=1,Object.defineProperty(gf,"__esModule",{value:!0});let e=class extends Error{};return gf.TimeoutError=e,gf}var Vn={},yf={},fj;function yK(){if(fj)return yf;fj=1,Object.defineProperty(yf,"__esModule",{value:!0});let e=class{constructor(r){this._value=r.value,this._error=r.error}value(){return this._value}reason(){return this._error}isRejected(){return!!this._error}isFulfilled(){return!!this._value}};return yf.PromiseInspection=e,yf}var hj;function lx(){if(hj)return Vn;hj=1,Object.defineProperty(Vn,"__esModule",{value:!0});const e=yK();function n(){let f=null,p=null;return{promise:new Promise((g,y)=>{f=g,p=y}),resolve:f,reject:p}}Vn.defer=n;function r(){return Date.now()}Vn.now=r;function s(f,p){return Math.abs(p-f)}Vn.duration=s;function a(f){return typeof f>"u"?!0:o(f)}Vn.checkOptionalTime=a;function o(f){return typeof f=="number"&&f===Math.round(f)&&f>0}Vn.checkRequiredTime=o;function l(f){return new Promise(p=>setTimeout(p,f))}Vn.delay=l;function u(f){return f.then(p=>new e.PromiseInspection({value:p})).catch(p=>new e.PromiseInspection({error:p}))}Vn.reflect=u;function h(f){try{const p=f();return Promise.resolve(p)}catch(p){return Promise.reject(p)}}return Vn.tryPromise=h,Vn}var dj;function vK(){if(dj)return mf;dj=1,Object.defineProperty(mf,"__esModule",{value:!0});const e=rP(),n=lx();let r=class{constructor(o){this.timeoutMillis=o,this.deferred=n.defer(),this.possibleTimeoutCause=null,this.isRejected=!1,this.promise=s(this.deferred.promise,o).catch(l=>(l instanceof e.TimeoutError&&(this.possibleTimeoutCause?l=new e.TimeoutError(this.possibleTimeoutCause.message):l=new e.TimeoutError("operation timed out for an unknown reason")),this.isRejected=!0,Promise.reject(l)))}abort(){this.reject(new Error("aborted"))}reject(o){this.deferred.reject(o)}resolve(o){this.deferred.resolve(o)}};mf.PendingOperation=r;function s(a,o){return new Promise((l,u)=>{const h=setTimeout(()=>u(new e.TimeoutError),o);a.then(f=>{clearTimeout(h),l(f)}).catch(f=>{clearTimeout(h),u(f)})})}return mf}var vf={},pj;function bK(){if(pj)return vf;pj=1,Object.defineProperty(vf,"__esModule",{value:!0});const e=lx();let n=class iP{constructor(s){this.resource=s,this.resource=s,this.timestamp=e.now(),this.deferred=e.defer()}get promise(){return this.deferred.promise}resolve(){return this.deferred.resolve(void 0),new iP(this.resource)}};return vf.Resource=n,vf}var bf={exports:{}},mj;function Zs(){if(mj)return bf.exports;mj=1;var e=typeof Reflect=="object"?Reflect:null,n=e&&typeof e.apply=="function"?e.apply:function(A,N,O){return Function.prototype.apply.call(A,N,O)},r;e&&typeof e.ownKeys=="function"?r=e.ownKeys:Object.getOwnPropertySymbols?r=function(A){return Object.getOwnPropertyNames(A).concat(Object.getOwnPropertySymbols(A))}:r=function(A){return Object.getOwnPropertyNames(A)};function s(T){console&&console.warn&&console.warn(T)}var a=Number.isNaN||function(A){return A!==A};function o(){o.init.call(this)}bf.exports=o,bf.exports.once=b,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var l=10;function u(T){if(typeof T!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof T)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(T){if(typeof T!="number"||T<0||a(T))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+T+".");l=T}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(A){if(typeof A!="number"||A<0||a(A))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+A+".");return this._maxListeners=A,this};function h(T){return T._maxListeners===void 0?o.defaultMaxListeners:T._maxListeners}o.prototype.getMaxListeners=function(){return h(this)},o.prototype.emit=function(A){for(var N=[],O=1;O<arguments.length;O++)N.push(arguments[O]);var I=A==="error",k=this._events;if(k!==void 0)I=I&&k.error===void 0;else if(!I)return!1;if(I){var R;if(N.length>0&&(R=N[0]),R instanceof Error)throw R;var M=new Error("Unhandled error."+(R?" ("+R.message+")":""));throw M.context=R,M}var D=k[A];if(D===void 0)return!1;if(typeof D=="function")n(D,this,N);else for(var z=D.length,q=E(D,z),O=0;O<z;++O)n(q[O],this,N);return!0};function f(T,A,N,O){var I,k,R;if(u(N),k=T._events,k===void 0?(k=T._events=Object.create(null),T._eventsCount=0):(k.newListener!==void 0&&(T.emit("newListener",A,N.listener?N.listener:N),k=T._events),R=k[A]),R===void 0)R=k[A]=N,++T._eventsCount;else if(typeof R=="function"?R=k[A]=O?[N,R]:[R,N]:O?R.unshift(N):R.push(N),I=h(T),I>0&&R.length>I&&!R.warned){R.warned=!0;var M=new Error("Possible EventEmitter memory leak detected. "+R.length+" "+String(A)+" listeners added. Use emitter.setMaxListeners() to increase limit");M.name="MaxListenersExceededWarning",M.emitter=T,M.type=A,M.count=R.length,s(M)}return T}o.prototype.addListener=function(A,N){return f(this,A,N,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(A,N){return f(this,A,N,!0)};function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(T,A,N){var O={fired:!1,wrapFn:void 0,target:T,type:A,listener:N},I=p.bind(O);return I.listener=N,O.wrapFn=I,I}o.prototype.once=function(A,N){return u(N),this.on(A,d(this,A,N)),this},o.prototype.prependOnceListener=function(A,N){return u(N),this.prependListener(A,d(this,A,N)),this},o.prototype.removeListener=function(A,N){var O,I,k,R,M;if(u(N),I=this._events,I===void 0)return this;if(O=I[A],O===void 0)return this;if(O===N||O.listener===N)--this._eventsCount===0?this._events=Object.create(null):(delete I[A],I.removeListener&&this.emit("removeListener",A,O.listener||N));else if(typeof O!="function"){for(k=-1,R=O.length-1;R>=0;R--)if(O[R]===N||O[R].listener===N){M=O[R].listener,k=R;break}if(k<0)return this;k===0?O.shift():x(O,k),O.length===1&&(I[A]=O[0]),I.removeListener!==void 0&&this.emit("removeListener",A,M||N)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(A){var N,O,I;if(O=this._events,O===void 0)return this;if(O.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):O[A]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete O[A]),this;if(arguments.length===0){var k=Object.keys(O),R;for(I=0;I<k.length;++I)R=k[I],R!=="removeListener"&&this.removeAllListeners(R);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(N=O[A],typeof N=="function")this.removeListener(A,N);else if(N!==void 0)for(I=N.length-1;I>=0;I--)this.removeListener(A,N[I]);return this};function g(T,A,N){var O=T._events;if(O===void 0)return[];var I=O[A];return I===void 0?[]:typeof I=="function"?N?[I.listener||I]:[I]:N?v(I):E(I,I.length)}o.prototype.listeners=function(A){return g(this,A,!0)},o.prototype.rawListeners=function(A){return g(this,A,!1)},o.listenerCount=function(T,A){return typeof T.listenerCount=="function"?T.listenerCount(A):y.call(T,A)},o.prototype.listenerCount=y;function y(T){var A=this._events;if(A!==void 0){var N=A[T];if(typeof N=="function")return 1;if(N!==void 0)return N.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function E(T,A){for(var N=new Array(A),O=0;O<A;++O)N[O]=T[O];return N}function x(T,A){for(;A+1<T.length;A++)T[A]=T[A+1];T.pop()}function v(T){for(var A=new Array(T.length),N=0;N<A.length;++N)A[N]=T[N].listener||T[N];return A}function b(T,A){return new Promise(function(N,O){function I(R){T.removeListener(A,k),O(R)}function k(){typeof T.removeListener=="function"&&T.removeListener("error",I),N([].slice.call(arguments))}C(T,A,k,{once:!0}),A!=="error"&&w(T,I,{once:!0})})}function w(T,A,N){typeof T.on=="function"&&C(T,"error",A,N)}function C(T,A,N,O){if(typeof T.on=="function")O.once?T.once(A,N):T.on(A,N);else if(typeof T.addEventListener=="function")T.addEventListener(A,function I(k){O.once&&T.removeEventListener(A,I),N(k)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof T)}return bf.exports}const _K={},wK=Object.freeze(Object.defineProperty({__proto__:null,default:_K},Symbol.toStringTag,{value:"Module"})),nt=qz(wK);var gj;function EK(){if(gj)return pf;gj=1,Object.defineProperty(pf,"__esModule",{value:!0});const e=vK(),n=bK(),r=lx(),s=Zs(),a=nt;let o=class{constructor(f){if(this.destroyed=!1,this.emitter=new s.EventEmitter,f=f||{},!f.create)throw new Error("Tarn: opt.create function most be provided");if(!f.destroy)throw new Error("Tarn: opt.destroy function most be provided");if(typeof f.min!="number"||f.min<0||f.min!==Math.round(f.min))throw new Error("Tarn: opt.min must be an integer >= 0");if(typeof f.max!="number"||f.max<=0||f.max!==Math.round(f.max))throw new Error("Tarn: opt.max must be an integer > 0");if(f.min>f.max)throw new Error("Tarn: opt.max is smaller than opt.min");if(!r.checkOptionalTime(f.acquireTimeoutMillis))throw new Error("Tarn: invalid opt.acquireTimeoutMillis "+JSON.stringify(f.acquireTimeoutMillis));if(!r.checkOptionalTime(f.createTimeoutMillis))throw new Error("Tarn: invalid opt.createTimeoutMillis "+JSON.stringify(f.createTimeoutMillis));if(!r.checkOptionalTime(f.destroyTimeoutMillis))throw new Error("Tarn: invalid opt.destroyTimeoutMillis "+JSON.stringify(f.destroyTimeoutMillis));if(!r.checkOptionalTime(f.idleTimeoutMillis))throw new Error("Tarn: invalid opt.idleTimeoutMillis "+JSON.stringify(f.idleTimeoutMillis));if(!r.checkOptionalTime(f.reapIntervalMillis))throw new Error("Tarn: invalid opt.reapIntervalMillis "+JSON.stringify(f.reapIntervalMillis));if(!r.checkOptionalTime(f.createRetryIntervalMillis))throw new Error("Tarn: invalid opt.createRetryIntervalMillis "+JSON.stringify(f.createRetryIntervalMillis));const p={create:!0,validate:!0,destroy:!0,log:!0,min:!0,max:!0,acquireTimeoutMillis:!0,createTimeoutMillis:!0,destroyTimeoutMillis:!0,idleTimeoutMillis:!0,reapIntervalMillis:!0,createRetryIntervalMillis:!0,propagateCreateError:!0};for(const d of Object.keys(f))if(!p[d])throw new Error(`Tarn: unsupported option opt.${d}`);this.creator=f.create,this.destroyer=f.destroy,this.validate=typeof f.validate=="function"?f.validate:()=>!0,this.log=f.log||(()=>{}),this.acquireTimeoutMillis=f.acquireTimeoutMillis||3e4,this.createTimeoutMillis=f.createTimeoutMillis||3e4,this.destroyTimeoutMillis=f.destroyTimeoutMillis||5e3,this.idleTimeoutMillis=f.idleTimeoutMillis||3e4,this.reapIntervalMillis=f.reapIntervalMillis||1e3,this.createRetryIntervalMillis=f.createRetryIntervalMillis||200,this.propagateCreateError=!!f.propagateCreateError,this.min=f.min,this.max=f.max,this.used=[],this.free=[],this.pendingCreates=[],this.pendingAcquires=[],this.pendingDestroys=[],this.pendingValidations=[],this.destroyed=!1,this.interval=null,this.eventId=1}numUsed(){return this.used.length}numFree(){return this.free.length}numPendingAcquires(){return this.pendingAcquires.length}numPendingValidations(){return this.pendingValidations.length}numPendingCreates(){return this.pendingCreates.length}acquire(){const f=this.eventId++;this._executeEventHandlers("acquireRequest",f);const p=new e.PendingOperation(this.acquireTimeoutMillis);return this.pendingAcquires.push(p),p.promise=p.promise.then(d=>(this._executeEventHandlers("acquireSuccess",f,d),d)).catch(d=>(this._executeEventHandlers("acquireFail",f,d),l(this.pendingAcquires,p),Promise.reject(d))),this._tryAcquireOrCreate(),p}release(f){this._executeEventHandlers("release",f);for(let p=0,d=this.used.length;p<d;++p){const g=this.used[p];if(g.resource===f)return this.used.splice(p,1),this.free.push(g.resolve()),this._tryAcquireOrCreate(),!0}return!1}isEmpty(){return[this.numFree(),this.numUsed(),this.numPendingAcquires(),this.numPendingValidations(),this.numPendingCreates()].reduce((f,p)=>f+p)===0}check(){const f=r.now(),p=[],d=this.min-this.used.length,g=this.free.length-d;let y=0;this.free.forEach(E=>{r.duration(f,E.timestamp)>=this.idleTimeoutMillis&&y<g?(y++,this._destroy(E.resource)):p.push(E)}),this.free=p,this.isEmpty()&&this._stopReaping()}destroy(){const f=this.eventId++;return this._executeEventHandlers("poolDestroyRequest",f),this._stopReaping(),this.destroyed=!0,r.reflect(Promise.all(this.pendingCreates.map(p=>r.reflect(p.promise))).then(()=>new Promise((p,d)=>{if(this.numPendingValidations()===0){p();return}const g=setInterval(()=>{this.numPendingValidations()===0&&(a.clearInterval(g),p())},100)})).then(()=>Promise.all(this.used.map(p=>r.reflect(p.promise)))).then(()=>Promise.all(this.pendingAcquires.map(p=>(p.abort(),r.reflect(p.promise))))).then(()=>Promise.all(this.free.map(p=>r.reflect(this._destroy(p.resource))))).then(()=>Promise.all(this.pendingDestroys.map(p=>p.promise))).then(()=>{this.free=[],this.pendingAcquires=[]})).then(p=>(this._executeEventHandlers("poolDestroySuccess",f),this.emitter.removeAllListeners(),p))}on(f,p){this.emitter.on(f,p)}removeListener(f,p){this.emitter.removeListener(f,p)}removeAllListeners(f){this.emitter.removeAllListeners(f)}_tryAcquireOrCreate(){this.destroyed||(this._hasFreeResources()?this._doAcquire():this._shouldCreateMoreResources()&&this._doCreate())}_hasFreeResources(){return this.free.length>0}_doAcquire(){for(;this._canAcquire();){const f=this.pendingAcquires.shift(),p=this.free.pop();if(p===void 0||f===void 0){const g="this.free was empty while trying to acquire resource";throw this.log(`Tarn: ${g}`,"warn"),new Error(`Internal error, should never happen. ${g}`)}this.pendingValidations.push(f),this.used.push(p);const d=new e.PendingOperation(this.acquireTimeoutMillis);f.promise.catch(g=>{d.abort()}),d.promise.catch(g=>(this.log("Tarn: resource validator threw an exception "+g.stack,"warn"),!1)).then(g=>{try{g&&!f.isRejected?(this._startReaping(),f.resolve(p.resource)):(l(this.used,p),g?this.free.push(p):(this._destroy(p.resource),setTimeout(()=>{this._tryAcquireOrCreate()},0)),f.isRejected||this.pendingAcquires.unshift(f))}finally{l(this.pendingValidations,f)}}),this._validateResource(p.resource).then(g=>{d.resolve(g)}).catch(g=>{d.reject(g)})}}_canAcquire(){return this.free.length>0&&this.pendingAcquires.length>0}_validateResource(f){try{return Promise.resolve(this.validate(f))}catch(p){return Promise.reject(p)}}_shouldCreateMoreResources(){return this.used.length+this.pendingCreates.length<this.max&&this.pendingCreates.length<this.pendingAcquires.length}_doCreate(){const f=this.pendingAcquires.slice();this._create().promise.then(()=>(this._tryAcquireOrCreate(),null)).catch(d=>{this.propagateCreateError&&this.pendingAcquires.length!==0&&this.pendingAcquires[0].reject(d),f.forEach(g=>{g.possibleTimeoutCause=d}),r.delay(this.createRetryIntervalMillis).then(()=>this._tryAcquireOrCreate())})}_create(){const f=this.eventId++;this._executeEventHandlers("createRequest",f);const p=new e.PendingOperation(this.createTimeoutMillis);return p.promise=p.promise.catch(d=>{throw l(this.pendingCreates,p)&&this._executeEventHandlers("createFail",f,d),d}),this.pendingCreates.push(p),u(this.creator).then(d=>p.isRejected?(this.destroyer(d),null):(l(this.pendingCreates,p),this.free.push(new n.Resource(d)),p.resolve(d),this._executeEventHandlers("createSuccess",f,d),null)).catch(d=>(p.isRejected||(l(this.pendingCreates,p)&&this._executeEventHandlers("createFail",f,d),p.reject(d)),null)),p}_destroy(f){const p=this.eventId++;this._executeEventHandlers("destroyRequest",p,f);const d=new e.PendingOperation(this.destroyTimeoutMillis);return Promise.resolve().then(()=>this.destroyer(f)).then(()=>{d.resolve(f)}).catch(y=>{d.reject(y)}),this.pendingDestroys.push(d),d.promise.then(y=>(this._executeEventHandlers("destroySuccess",p,f),y)).catch(y=>this._logDestroyerError(p,f,y)).then(y=>{const E=this.pendingDestroys.findIndex(x=>x===d);return this.pendingDestroys.splice(E,1),y})}_logDestroyerError(f,p,d){this._executeEventHandlers("destroyFail",f,p,d),this.log("Tarn: resource destroyer threw an exception "+d.stack,"warn")}_startReaping(){this.interval||(this._executeEventHandlers("startReaping"),this.interval=setInterval(()=>this.check(),this.reapIntervalMillis))}_stopReaping(){this.interval!==null&&(this._executeEventHandlers("stopReaping"),a.clearInterval(this.interval)),this.interval=null}_executeEventHandlers(f,...p){this.emitter.listeners(f).forEach(g=>{try{g(...p)}catch(y){this.log(`Tarn: event handler "${f}" threw an exception ${y.stack}`,"warn")}})}};pf.Pool=o;function l(h,f){const p=h.indexOf(f);return p===-1?!1:(h.splice(p,1),!0)}function u(h){return new Promise((f,p)=>{const d=(g,y)=>{g?p(g):f(y)};r.tryPromise(()=>h(d)).then(g=>{g&&f(g)}).catch(g=>{p(g)})})}return pf}var yj;function CK(){return yj||(yj=1,(function(e,n){Object.defineProperty(n,"__esModule",{value:!0});const r=EK();n.Pool=r.Pool;const s=rP();n.TimeoutError=s.TimeoutError,e.exports={Pool:r.Pool,TimeoutError:s.TimeoutError}})(df,df.exports)),df.exports}var $_,vj;function cx(){if(vj)return $_;vj=1;const e=/[\0\b\t\n\r\x1a"'\\]/g,n={"\0":"\\0","\b":"\\b"," ":"\\t","\n":"\\n","\r":"\\r","":"\\Z",'"':'\\"',"'":"\\'","\\":"\\\\"};function r(d){return function g(y,E={}){return d(y,g,E)}}function s(d={}){const g=d.escapeDate||h,y=d.escapeArray||o,E=d.escapeBuffer||l,x=d.escapeString||u,v=d.escapeObject||a,b=d.wrap||r;function w(C,T,A){if(C==null)return"NULL";switch(typeof C){case"boolean":return C?"true":"false";case"number":return C+"";case"object":if(C instanceof Date)C=g(C,T,A);else return Array.isArray(C)?y(C,T,A):Buffer.isBuffer(C)?E(C,T,A):v(C,T,A)}return x(C,T,A)}return b?b(w):w}function a(d,g,y){return d&&typeof d.toSQL=="function"?d.toSQL(y):JSON.stringify(d)}function o(d,g,y){let E="";for(let x=0;x<d.length;x++){const v=d[x];Array.isArray(v)?E+=(x===0?"":", ")+"("+o(v,g,y)+")":E+=(x===0?"":", ")+g(v,y)}return E}function l(d){return"X"+u(d.toString("hex"))}function u(d,g,y){let E=e.lastIndex=0,x="",v;for(;v=e.exec(d);)x+=d.slice(E,v.index)+n[v[0]],E=e.lastIndex;return E===0?"'"+d+"'":E<d.length?"'"+x+d.slice(E)+"'":"'"+x+"'"}function h(d,g,y={}){const E=y.timeZone||"local",x=new Date(d);let v,b,w,C,T,A,N;if(E==="local")v=x.getFullYear(),b=x.getMonth()+1,w=x.getDate(),C=x.getHours(),T=x.getMinutes(),A=x.getSeconds(),N=x.getMilliseconds();else{const O=p(E);O!==!1&&O!==0&&x.setTime(x.getTime()+O*6e4),v=x.getUTCFullYear(),b=x.getUTCMonth()+1,w=x.getUTCDate(),C=x.getUTCHours(),T=x.getUTCMinutes(),A=x.getUTCSeconds(),N=x.getUTCMilliseconds()}return f(v,4)+"-"+f(b,2)+"-"+f(w,2)+" "+f(C,2)+":"+f(T,2)+":"+f(A,2)+"."+f(N,3)}function f(d,g){for(d=d.toString();d.length<g;)d="0"+d;return d}function p(d){if(d==="Z")return 0;const g=d.match(/([+\-\s])(\d\d):?(\d\d)?/);return g?(g[1]=="-"?-1:1)*(parseInt(g[2],10)+(g[3]?parseInt(g[3],10):0)/60)*60:!1}return $_={arrayToList:o,bufferToString:l,dateToString:h,escapeString:u,charsRegex:e,charsMap:n,escapeObject:a,makeEscape:s},$_}var _f={},bj;function _o(){if(bj)return _f;bj=1;class e extends Error{constructor(s){super(s),this.name="KnexTimeoutError"}}function n(r,s){return new Promise(function(a,o){const l=setTimeout(function(){o(new e("operation timed out"))},s);function u(f){clearTimeout(l),a(f)}function h(f){clearTimeout(l),o(f)}r.then(u,h)})}return _f.KnexTimeoutError=e,_f.timeout=n,_f}var I_,_j;function xK(){if(_j)return I_;_j=1;function e(r){r.client.emit("start",r.builder),r.builder.emit("start",r.builder);const s=r.builder.toSQL();return r.builder._debug&&r.client.logger.debug(s),Array.isArray(s)?r.queryArray(s):r.query(s)}function n(r,s){try{const a=r.builder.toSQL();if(Array.isArray(a)&&s.hasHandler)throw new Error("The stream may only be used with a single query statement.");return r.client.stream(r.connection,a,s.stream,s.options)}catch(a){throw s.stream.emit("error",a),a}}return I_={ensureConnectionCallback:e,ensureConnectionStreamCallback:n},I_}var D_,wj;function SK(){if(wj)return D_;wj=1;const{KnexTimeoutError:e}=_o(),{timeout:n}=_o(),{ensureConnectionCallback:r,ensureConnectionStreamCallback:s}=xK();let a;class o{constructor(u,h){this.client=u,this.builder=h,this.queries=[],this.connection=void 0}async run(){const u=this;try{const h=await this.ensureConnection(r);return u.builder.emit("end"),h}catch(h){throw u.builder._events&&u.builder._events.error&&u.builder.emit("error",h),h}}stream(u,h){const f=typeof u=="function"&&arguments.length===1,p=f?{}:u,d=f?u:h,g=typeof d=="function";a=a||nt.Transform;const y=this.builder.queryContext(),E=new a({objectMode:!0,transform:(v,b,w)=>{w(null,this.client.postProcessResponse(v,y))}});E.on("close",()=>{this.client.releaseConnection(this.connection)}),E.on("pipe",v=>{const b=()=>{v.closed||v.destroy()};E.closed?b():E.on("close",b)});const x=this.ensureConnection(s,{options:p,hasHandler:g,stream:E}).catch(v=>{this.connection||E.emit("error",v)});return g?(d(E),x):E}pipe(u,h){return this.stream(h).pipe(u)}async query(u){const{__knexUid:h,__knexTxId:f}=this.connection;this.builder.emit("query",Object.assign({__knexUid:h,__knexTxId:f},u));const p=this,d=this.builder.queryContext();u!==null&&typeof u=="object"&&(u.queryContext=d);let g=this.client.query(this.connection,u);return u.timeout&&(g=n(g,u.timeout)),g.then(y=>this.client.processResponse(y,p)).then(y=>{const E=this.client.postProcessResponse(y,d);return this.builder.emit("query-response",E,Object.assign({__knexUid:h,__knexTxId:f},u),this.builder),this.client.emit("query-response",E,Object.assign({__knexUid:h,__knexTxId:f},u),this.builder),E}).catch(y=>{if(!(y instanceof e))return Promise.reject(y);const{timeout:E,sql:x,bindings:v}=u;let b;return u.cancelOnTimeout?b=this.client.cancelQuery(this.connection):(this.connection.__knex__disposed=y,b=Promise.resolve()),b.catch(w=>{throw this.connection.__knex__disposed=y,Object.assign(w,{message:`After query timeout of ${E}ms exceeded, cancelling of query failed.`,sql:x,bindings:v,timeout:E})}).then(()=>{throw Object.assign(y,{message:`Defined query timeout of ${E}ms exceeded when running query.`,sql:x,bindings:v,timeout:E})})}).catch(y=>{throw this.builder.emit("query-error",y,Object.assign({__knexUid:h,__knexTxId:f,queryContext:d},u)),y})}async queryArray(u){if(u.length===1){const f=u[0];if(!f.statementsProducer)return this.query(f);const p=await f.statementsProducer(void 0,this.connection),d=p.sql.map(x=>({sql:x,bindings:f.bindings})),g=p.pre.map(x=>({sql:x,bindings:f.bindings})),y=p.post.map(x=>({sql:x,bindings:f.bindings}));let E=[];await this.queryArray(g);try{await this.client.transaction(async x=>{const v=new o(x.client,this.builder);if(v.connection=this.connection,E=await v.queryArray(d),p.check&&(await x.raw(p.check)).length>0)throw new Error("FOREIGN KEY constraint failed")},{connection:this.connection})}finally{await this.queryArray(y)}return E}const h=[];for(const f of u)h.push(await this.queryArray([f]));return h}async ensureConnection(u,h){if(this.builder._connection&&(this.connection=this.builder._connection),this.connection)return u(this,h);let f;try{f=await this.client.acquireConnection()}catch(p){if(!(p instanceof e))return Promise.reject(p);throw this.builder&&(p.sql=this.builder.sql,p.bindings=this.builder.bindings),p}try{return this.connection=f,await u(this,h)}finally{await this.client.releaseConnection(f)}}}return D_=o,D_}var wf={exports:{}},k_,Ej;function TK(){if(Ej)return k_;Ej=1;var e=1e3,n=e*60,r=n*60,s=r*24,a=s*7,o=s*365.25;k_=function(p,d){d=d||{};var g=typeof p;if(g==="string"&&p.length>0)return l(p);if(g==="number"&&isFinite(p))return d.long?h(p):u(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function l(p){if(p=String(p),!(p.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(d){var g=parseFloat(d[1]),y=(d[2]||"ms").toLowerCase();switch(y){case"years":case"year":case"yrs":case"yr":case"y":return g*o;case"weeks":case"week":case"w":return g*a;case"days":case"day":case"d":return g*s;case"hours":case"hour":case"hrs":case"hr":case"h":return g*r;case"minutes":case"minute":case"mins":case"min":case"m":return g*n;case"seconds":case"second":case"secs":case"sec":case"s":return g*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return g;default:return}}}}function u(p){var d=Math.abs(p);return d>=s?Math.round(p/s)+"d":d>=r?Math.round(p/r)+"h":d>=n?Math.round(p/n)+"m":d>=e?Math.round(p/e)+"s":p+"ms"}function h(p){var d=Math.abs(p);return d>=s?f(p,d,s,"day"):d>=r?f(p,d,r,"hour"):d>=n?f(p,d,n,"minute"):d>=e?f(p,d,e,"second"):p+" ms"}function f(p,d,g,y){var E=d>=g*1.5;return Math.round(p/g)+" "+y+(E?"s":"")}return k_}var B_,Cj;function qK(){if(Cj)return B_;Cj=1;function e(n){s.debug=s,s.default=s,s.coerce=f,s.disable=l,s.enable=o,s.enabled=u,s.humanize=TK(),s.destroy=p,Object.keys(n).forEach(d=>{s[d]=n[d]}),s.names=[],s.skips=[],s.formatters={};function r(d){let g=0;for(let y=0;y<d.length;y++)g=(g<<5)-g+d.charCodeAt(y),g|=0;return s.colors[Math.abs(g)%s.colors.length]}s.selectColor=r;function s(d){let g,y=null,E,x;function v(...b){if(!v.enabled)return;const w=v,C=Number(new Date),T=C-(g||C);w.diff=T,w.prev=g,w.curr=C,g=C,b[0]=s.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let A=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(O,I)=>{if(O==="%%")return"%";A++;const k=s.formatters[I];if(typeof k=="function"){const R=b[A];O=k.call(w,R),b.splice(A,1),A--}return O}),s.formatArgs.call(w,b),(w.log||s.log).apply(w,b)}return v.namespace=d,v.useColors=s.useColors(),v.color=s.selectColor(d),v.extend=a,v.destroy=s.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(E!==s.namespaces&&(E=s.namespaces,x=s.enabled(d)),x),set:b=>{y=b}}),typeof s.init=="function"&&s.init(v),v}function a(d,g){const y=s(this.namespace+(typeof g>"u"?":":g)+d);return y.log=this.log,y}function o(d){s.save(d),s.namespaces=d,s.names=[],s.skips=[];let g;const y=(typeof d=="string"?d:"").split(/[\s,]+/),E=y.length;for(g=0;g<E;g++)y[g]&&(d=y[g].replace(/\*/g,".*?"),d[0]==="-"?s.skips.push(new RegExp("^"+d.slice(1)+"$")):s.names.push(new RegExp("^"+d+"$")))}function l(){const d=[...s.names.map(h),...s.skips.map(h).map(g=>"-"+g)].join(",");return s.enable(""),d}function u(d){if(d[d.length-1]==="*")return!0;let g,y;for(g=0,y=s.skips.length;g<y;g++)if(s.skips[g].test(d))return!1;for(g=0,y=s.names.length;g<y;g++)if(s.names[g].test(d))return!0;return!1}function h(d){return d.toString().substring(2,d.toString().length-2).replace(/\.\*\?$/,"*")}function f(d){return d instanceof Error?d.stack||d.message:d}function p(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return s.enable(s.load()),s}return B_=e,B_}var xj;function tr(){return xj||(xj=1,(function(e,n){var r={};n.formatArgs=a,n.save=o,n.load=l,n.useColors=s,n.storage=u(),n.destroy=(()=>{let f=!1;return()=>{f||(f=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function s(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(f){if(f[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+f[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;f.splice(1,0,p,"color: inherit");let d=0,g=0;f[0].replace(/%[a-zA-Z%]/g,y=>{y!=="%%"&&(d++,y==="%c"&&(g=d))}),f.splice(g,0,p)}n.log=console.debug||console.log||(()=>{});function o(f){try{f?n.storage.setItem("debug",f):n.storage.removeItem("debug")}catch{}}function l(){let f;try{f=n.storage.getItem("debug")}catch{}return!f&&typeof process<"u"&&"env"in process&&(f=r.DEBUG),f}function u(){try{return localStorage}catch{}}e.exports=qK()(n);const{formatters:h}=e.exports;h.j=function(f){try{return JSON.stringify(f)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}})(wf,wf.exports)),wf.exports}var P_,Sj;function Ff(){return Sj||(Sj=1,P_=function(){}),P_}var z_,Tj;function AK(){if(Tj)return z_;Tj=1;class e{constructor(r){this.client=r}now(r){return typeof r=="number"?this.client.raw(`CURRENT_TIMESTAMP(${r})`):this.client.raw("CURRENT_TIMESTAMP")}uuid(){switch(this.client.driverName){case"sqlite3":case"better-sqlite3":return this.client.raw("(lower(hex(randomblob(4))) || '-' || lower(hex(randomblob(2))) || '-4' || substr(lower(hex(randomblob(2))),2) || '-' || substr('89ab',abs(random()) % 4 + 1, 1) || substr(lower(hex(randomblob(2))),2) || '-' || lower(hex(randomblob(6))))");case"mssql":return this.client.raw("(NEWID())");case"pg":case"pgnative":case"cockroachdb":return this.client.raw("(gen_random_uuid())");case"oracle":case"oracledb":return this.client.raw("(random_uuid())");case"mysql":case"mysql2":return this.client.raw("(UUID())");default:throw new Error(`${this.client.driverName} does not have a uuid function`)}}uuidToBin(r,s=!0){const a=Buffer.from(r.replace(/-/g,""),"hex");return s?Buffer.concat([a.slice(6,8),a.slice(4,6),a.slice(0,4),a.slice(8,16)]):Buffer.concat([a.slice(0,4),a.slice(4,6),a.slice(6,8),a.slice(8,16)])}binToUuid(r,s=!0){const a=Buffer.from(r,"hex");return s?[a.toString("hex",4,8),a.toString("hex",2,4),a.toString("hex",0,2),a.toString("hex",8,10),a.toString("hex",10,16)].join("-"):[a.toString("hex",0,4),a.toString("hex",4,6),a.toString("hex",6,8),a.toString("hex",8,10),a.toString("hex",10,16)].join("-")}}return z_=e,z_}var U_,qj;function sP(){return qj||(qj=1,U_=["with","withRecursive","withMaterialized","withNotMaterialized","select","as","columns","column","from","fromJS","fromRaw","into","withSchema","table","distinct","join","joinRaw","innerJoin","leftJoin","leftOuterJoin","rightJoin","rightOuterJoin","outerJoin","fullOuterJoin","crossJoin","where","andWhere","orWhere","whereNot","orWhereNot","whereLike","andWhereLike","orWhereLike","whereILike","andWhereILike","orWhereILike","whereRaw","whereWrapped","havingWrapped","orWhereRaw","whereExists","orWhereExists","whereNotExists","orWhereNotExists","whereIn","orWhereIn","whereNotIn","orWhereNotIn","whereNull","orWhereNull","whereNotNull","orWhereNotNull","whereBetween","whereNotBetween","andWhereBetween","andWhereNotBetween","orWhereBetween","orWhereNotBetween","groupBy","groupByRaw","orderBy","orderByRaw","union","unionAll","intersect","except","having","havingRaw","orHaving","orHavingRaw","offset","limit","count","countDistinct","min","max","sum","sumDistinct","avg","avgDistinct","increment","decrement","first","debug","pluck","clearSelect","clearWhere","clearGroup","clearOrder","clearHaving","insert","update","returning","del","delete","truncate","transacting","connection","jsonExtract","jsonSet","jsonInsert","jsonRemove","whereJsonObject","orWhereJsonObject","andWhereJsonObject","whereNotJsonObject","orWhereNotJsonObject","andWhereNotJsonObject","whereJsonPath","orWhereJsonPath","andWhereJsonPath","whereJsonSupersetOf","orWhereJsonSupersetOf","andWhereJsonSupersetOf","whereJsonNotSupersetOf","orWhereJsonNotSupersetOf","andWhereJsonNotSupersetOf","whereJsonSubsetOf","orWhereJsonSubsetOf","andWhereJsonSubsetOf","whereJsonNotSubsetOf","orWhereJsonNotSubsetOf","andWhereJsonNotSubsetOf"]),U_}var Q_,Aj;function aP(){if(Aj)return Q_;Aj=1;function e(n,r,s){var a=-1,o=n.length;r<0&&(r=-r>o?0:o+r),s=s>o?o:s,s<0&&(s+=o),o=r>s?0:s-r>>>0,r>>>=0;for(var l=Array(o);++a<o;)l[a]=n[a+r];return l}return Q_=e,Q_}var H_,Nj;function NK(){if(Nj)return H_;Nj=1;var e=aP(),n=qo(),r=sx(),s=Math.ceil,a=Math.max;function o(l,u,h){(h?n(l,u,h):u===void 0)?u=1:u=a(r(u),0);var f=l==null?0:l.length;if(!f||u<1)return[];for(var p=0,d=0,g=Array(s(f/u));p<f;)g[d++]=e(l,p,p+=u);return g}return H_=o,H_}var V_,Rj;function RK(){return Rj||(Rj=1,V_=e=>new Promise(n=>setTimeout(n,e))),V_}var F_,Oj;function mt(){if(Oj)return F_;Oj=1;function e(l){return typeof l=="string"}function n(l){return typeof l=="number"}function r(l){return typeof l=="boolean"}function s(l){return typeof l>"u"}function a(l){return typeof l=="object"&&l!==null}function o(l){return typeof l=="function"}return F_={isString:e,isNumber:n,isBoolean:r,isUndefined:s,isObject:a,isFunction:o},F_}var G_,Mj;function OK(){if(Mj)return G_;Mj=1;const e=NK(),n=xh(),r=RK(),{isNumber:s}=mt();function a(o,l,u,h=1e3){let f,p=null;if(!s(h)||h<1)throw new TypeError(`Invalid chunkSize: ${h}`);if(!Array.isArray(u))throw new TypeError(`Invalid batch: Expected array, got ${typeof u}`);const d=e(u,h),g=y=>p?y(p):o.transaction(y);return Object.assign(Promise.resolve().then(async()=>(await r(1),g(async y=>{const E=[];for(const x of d)E.push(await y(l).insert(x,f));return n(E)}))),{returning(y){return f=y,this},transacting(y){return p=y,this}})}return G_=a,G_}var K_,jj;function fx(){if(jj)return K_;jj=1;function e(n,r,s="password"){r||(r=n),Object.defineProperty(n,s,{enumerable:!1,value:r[s]})}return K_={setHiddenProperty:e},K_}var Y_,Lj;function oP(){if(Lj)return Y_;Lj=1;const{EventEmitter:e}=Zs(),{Migrator:n}=Ff(),r=Ff(),s=AK(),a=sP(),o=ZB(),l=OK(),{isObject:u}=mt(),{setHiddenProperty:h}=fx(),f={client:{get(){return this.context.client},set(w){this.context.client=w},configurable:!0},userParams:{get(){return this.context.userParams},set(w){this.context.userParams=w},configurable:!0},schema:{get(){return this.client.schemaBuilder()},configurable:!0},migrate:{get(){return new n(this)},configurable:!0},seed:{get(){return new r(this)},configurable:!0},fn:{get(){return new s(this.client)},configurable:!0}},p=["raw","batchInsert","transaction","transactionProvider","initialize","destroy","ref","withUserParams","queryBuilder","disableProcessing","enableProcessing"];for(const w of p)f[w]={value:function(...C){return this.context[w](...C)},configurable:!0};function d(w){function C(T,A){return v(C.context,T,A)}return E(C,w),C}function g(w){const C=w.context||{};Object.assign(C,{queryBuilder(){return this.client.queryBuilder()},raw(){return this.client.raw.apply(this.client,arguments)},batchInsert(T,A,N=1e3){return l(this,T,A,N)},transaction(T,A){!A&&u(T)&&(A=T,T=null);const N=Object.assign({},A);return N.userParams=this.userParams||{},N.doNotRejectOnRollback===void 0&&(N.doNotRejectOnRollback=!0),this._transaction(T,N)},_transaction(T,A,N=null){return T?this.client.transaction(T,A,N):new Promise((O,I)=>{this.client.transaction(O,A,N).catch(I)})},transactionProvider(T){let A;return()=>(A||(A=this.transaction(void 0,T)),A)},initialize(T){return this.client.initializePool(T)},destroy(T){return this.client.destroy(T)},ref(T){return this.client.ref(T)},disableProcessing(){this.userParams.isProcessingDisabled||(this.userParams.wrapIdentifier=this.client.config.wrapIdentifier,this.userParams.postProcessResponse=this.client.config.postProcessResponse,this.client.config.wrapIdentifier=null,this.client.config.postProcessResponse=null,this.userParams.isProcessingDisabled=!0)},enableProcessing(){this.userParams.isProcessingDisabled&&(this.client.config.wrapIdentifier=this.userParams.wrapIdentifier,this.client.config.postProcessResponse=this.userParams.postProcessResponse,this.userParams.isProcessingDisabled=!1)},withUserParams(T){const A=b(w);return this.client&&(A.client=Object.create(this.client.constructor.prototype),o(A.client,this.client),A.client.config=Object.assign({},this.client.config),this.client.config.password&&h(A.client.config,this.client.config)),E(A,A.client),y("query",w,A),y("query-error",w,A),y("query-response",w,A),y("start",w,A),A.userParams=T,A}}),w.context||(w.context=C)}function y(w,C,T){C.listeners(w).forEach(N=>{T.on(w,N)})}function E(w,C){for(let A=0;A<a.length;A++){const N=a[A];w[N]=function(){const O=this.queryBuilder();return O[N].apply(O,arguments)}}Object.defineProperties(w,f),g(w),w.client=C,w.userParams={};const T=new e;for(const A in T)w[A]=T[A];w._internalListeners&&w._internalListeners.forEach(({eventName:A,listener:N})=>{w.client.removeListener(A,N)}),w._internalListeners=[],x(w,"start",A=>{w.emit("start",A)}),x(w,"query",A=>{w.emit("query",A)}),x(w,"query-error",(A,N)=>{w.emit("query-error",A,N)}),x(w,"query-response",(A,N,O)=>{w.emit("query-response",A,N,O)})}function x(w,C,T){w.client.on(C,T),w._internalListeners.push({eventName:C,listener:T})}function v(w,C,T){const A=w.queryBuilder();return C||w.client.logger.warn("calling knex without a tableName is deprecated. Use knex.queryBuilder() instead."),C?A.table(C,T):A}function b(w){const C=Object.create(Object.getPrototypeOf(w),Object.getOwnPropertyDescriptors(w)),T={},N=((O,I)=>v(T,O,I)).bind(C);return Object.assign(N,w),N.context=T,N}return Y_=d,Y_}var X_,$j;function uP(){if($j)return X_;$j=1;const e=Ff(),n=r=>Object.assign(r,{finally(s){return this.then().finally(s)}});return X_=Promise.prototype.finally?n:e,X_}var W_,Ij;function Ji(){if(Ij)return W_;Ij=1;const{EventEmitter:e}=Zs(),n=tr(),r=ux(),{callbackify:s}=nt,a=oP(),{timeout:o,KnexTimeoutError:l}=_o(),u=uP(),h=n("knex:tx");function f(){return{userParams:{},doNotRejectOnRollback:!0}}const p=["read uncommitted","read committed","snapshot","repeatable read","serializable"];class d extends e{constructor(v,b,w=f(),C=null){super(),this.userParams=w.userParams,this.doNotRejectOnRollback=w.doNotRejectOnRollback;const T=this.txid=r("trx");this.client=v,this.logger=v.logger,this.outerTx=C,this.trxClient=void 0,this._completed=!1,this._debug=v.config&&v.config.debug,this.readOnly=w.readOnly,w.isolationLevel&&this.setIsolationLevel(w.isolationLevel),h("%s: Starting %s transaction",T,C?"nested":"top level"),this._lastChild=Promise.resolve();const N=(C?C._lastChild:Promise.resolve()).then(()=>this._evaluateContainer(w,b));this._promise=N.then(O=>O),C&&(C._lastChild=N.catch(()=>{}))}isCompleted(){return this._completed||this.outerTx&&this.outerTx.isCompleted()||!1}begin(v){const b=[this.isolationLevel?`ISOLATION LEVEL ${this.isolationLevel}`:"",this.readOnly?"READ ONLY":""].join(" ").trim();return b.length===0?this.query(v,"BEGIN;"):this.query(v,`SET TRANSACTION ${b};`).then(()=>this.query(v,"BEGIN;"))}savepoint(v){return this.query(v,`SAVEPOINT ${this.txid};`)}commit(v,b){return this.query(v,"COMMIT;",1,b)}release(v,b){return this.query(v,`RELEASE SAVEPOINT ${this.txid};`,1,b)}setIsolationLevel(v){if(!p.includes(v))throw new Error(`Invalid isolationLevel, supported isolation levels are: ${JSON.stringify(p)}`);return this.isolationLevel=v,this}rollback(v,b){return o(this.query(v,"ROLLBACK",2,b),5e3).catch(w=>{if(!(w instanceof l))return Promise.reject(w);this._rejecter(b)})}rollbackTo(v,b){return o(this.query(v,`ROLLBACK TO SAVEPOINT ${this.txid}`,2,b),5e3).catch(w=>{if(!(w instanceof l))return Promise.reject(w);this._rejecter(b)})}query(v,b,w,C){const T=this.trxClient.query(v,b).catch(A=>{w=2,C=A,this._completed=!0,h("%s error running transaction query",this.txid)}).then(A=>{if(w===1&&this._resolver(C),w===2){if(C===void 0){if(this.doNotRejectOnRollback&&/^ROLLBACK\b/i.test(b)){this._resolver();return}C=new Error(`Transaction rejected with non-error: ${C}`)}this._rejecter(C)}return A});return(w===1||w===2)&&(this._completed=!0),T}debug(v){return this._debug=arguments.length?v:!0,this}async _evaluateContainer(v,b){return this.acquireConnection(v,w=>{const C=this.trxClient=y(this,this.client,w),T=this.client.transacting?this.savepoint(w):this.begin(w),A=new Promise((N,O)=>{this._resolver=N,this._rejecter=O});return T.then(()=>g(this,w,C)).then(N=>{this.transactor=N,this.outerTx&&(N.parentTransaction=this.outerTx.transactor),N.executionPromise=A;let O;try{O=b(N)}catch(I){O=Promise.reject(I)}return O&&O.then&&typeof O.then=="function"&&O.then(I=>N.commit(I)).catch(I=>N.rollback(I)),null}).catch(N=>this._rejecter(N)),A})}async acquireConnection(v,b){const w=v&&v.connection,C=w||await this.client.acquireConnection();try{return C.__knexTxId=this.txid,await b(C)}finally{w?h("%s: not releasing external connection",this.txid):(h("%s: releasing connection",this.txid),this.client.releaseConnection(C))}}then(v,b){return this._promise.then(v,b)}catch(...v){return this._promise.catch(...v)}asCallback(v){return s(()=>this._promise)(v),this._promise}}u(d.prototype);function g(x,v,b){const w=a(b);return w.context.withUserParams=()=>{throw new Error("Cannot set user params on a transaction - it can only inherit params from main knex instance")},w.isTransaction=!0,w.userParams=x.userParams||{},w.context.transaction=function(C,T){return T?T.doNotRejectOnRollback===void 0&&(T.doNotRejectOnRollback=!0):T={doNotRejectOnRollback:!0},this._transaction(C,T,x)},w.savepoint=function(C,T){return w.transaction(C,T)},x.client.transacting?(w.commit=C=>x.release(v,C),w.rollback=C=>x.rollbackTo(v,C)):(w.commit=C=>x.commit(v,C),w.rollback=C=>x.rollback(v,C)),w.isCompleted=()=>x.isCompleted(),w}function y(x,v,b){const w=Object.create(v.constructor.prototype);w.version=v.version,w.config=v.config,w.driver=v.driver,w.connectionSettings=v.connectionSettings,w.transacting=!0,w.valueForUndefined=v.valueForUndefined,w.logger=v.logger,w.on("start",function(A){x.emit("start",A),v.emit("start",A)}),w.on("query",function(A){x.emit("query",A),v.emit("query",A)}),w.on("query-error",function(A,N){x.emit("query-error",A,N),v.emit("query-error",A,N)}),w.on("query-response",function(A,N,O){x.emit("query-response",A,N,O),v.emit("query-response",A,N,O)});const C=w.query;w.query=function(A,N){const O=x.isCompleted();return new Promise(function(I,k){try{if(A!==b)throw new Error("Invalid connection for transaction query.");O&&E(x,N),I(C.call(w,A,N))}catch(R){k(R)}})};const T=w.stream;return w.stream=function(A,N,O,I){const k=x.isCompleted();return new Promise(function(R,M){try{if(A!==b)throw new Error("Invalid connection for transaction query.");k&&E(x,N),R(T.call(w,A,N,O,I))}catch(D){M(D)}})},w.acquireConnection=function(){return Promise.resolve(b)},w.releaseConnection=function(){return Promise.resolve()},w}function E(x,v){const b=typeof v=="string"?v:v&&v.sql;throw h("%s: Transaction completed: %s",x.txid,b),new Error("Transaction query already complete, run with DEBUG=knex:tx for more info")}return W_=d,W_}var J_,Dj;function lP(){if(Dj)return J_;Dj=1;const e=tr()("knex:query"),n=tr()("knex:bindings"),r=(u,h)=>e(u.replace(/%/g,"%%"),h),{isString:s}=mt();function a(u,h,f,p){h=h==null?[]:[].concat(h);let d=0;return u.replace(/\\?\?/g,g=>{if(g==="\\?")return"?";if(d===h.length)return g;const y=h[d++];return p._escapeBinding(y,{timeZone:f})})}function o(u,h,f){const p=s(h)?{sql:h}:h;p.bindings=f.prepBindings(p.bindings),p.sql=f.positionBindings(p.sql);const{__knexUid:d,__knexTxId:g}=u;return f.emit("query",Object.assign({__knexUid:d,__knexTxId:g},p)),r(p.sql,g),n(p.bindings,g),p}function l(u,h,f){return f._query(u,h).catch(p=>{throw f.config&&f.config.compileSqlOnError===!1?p.message=h.sql+" - "+p.message:p.message=a(h.sql,h.bindings,void 0,f)+" - "+p.message,f.emit("query-error",p,Object.assign({__knexUid:u.__knexUid,__knexTxId:u.__knexUid},h)),p})}return J_={enrichQueryObject:o,executeQuery:l,formatQuery:a},J_}var Z_,kj;function ea(){if(kj)return Z_;kj=1;var e=_l(),n=Ys(),r=ox(),s=sr(),a=El(),o=ei(),l=Object.prototype,u=l.hasOwnProperty,h=r(function(f,p){if(a(p)||s(p)){n(p,o(p),f);return}for(var d in p)u.call(p,d)&&e(f,d,p[d])});return Z_=h,Z_}var e0,Bj;function cP(){if(Bj)return e0;Bj=1;var e="Expected a function";function n(r){if(typeof r!="function")throw new TypeError(e);return function(){var s=arguments;switch(s.length){case 0:return!r.call(this);case 1:return!r.call(this,s[0]);case 2:return!r.call(this,s[0],s[1]);case 3:return!r.call(this,s[0],s[1],s[2])}return!r.apply(this,s)}}return e0=n,e0}var t0,Pj;function MK(){if(Pj)return t0;Pj=1;var e=KC(),n=bB(),r=mn(),s=vt(),a=cP();function o(l,u){var h=s(l)?e:n;return h(l,a(r(u,3)))}return t0=o,t0}var n0,zj;function Sh(){if(zj)return n0;zj=1;var e=aP();function n(r){var s=r==null?0:r.length;return s?e(r,1,s):[]}return n0=n,n0}var r0,Uj;function jK(){if(Uj)return r0;Uj=1;function e(n){for(var r,s=[];!(r=n.next()).done;)s.push(r.value);return s}return r0=e,r0}var i0,Qj;function LK(){if(Qj)return i0;Qj=1;function e(n){return n.split("")}return i0=e,i0}var s0,Hj;function $K(){if(Hj)return s0;Hj=1;var e="\\ud800-\\udfff",n="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",s="\\u20d0-\\u20ff",a=n+r+s,o="\\ufe0e\\ufe0f",l="["+e+"]",u="["+a+"]",h="\\ud83c[\\udffb-\\udfff]",f="(?:"+u+"|"+h+")",p="[^"+e+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",y="\\u200d",E=f+"?",x="["+o+"]?",v="(?:"+y+"(?:"+[p,d,g].join("|")+")"+x+E+")*",b=x+E+v,w="(?:"+[p+u+"?",u,d,g,l].join("|")+")",C=RegExp(h+"(?="+h+")|"+w+b,"g");function T(A){return A.match(C)||[]}return s0=T,s0}var a0,Vj;function IK(){if(Vj)return a0;Vj=1;var e=LK(),n=$B(),r=$K();function s(a){return n(a)?r(a):e(a)}return a0=s,a0}var o0,Fj;function Tl(){if(Fj)return o0;Fj=1;var e=Fs(),n=GC(),r=Xs(),s=sr(),a=LB(),o=jK(),l=xB(),u=_h(),h=IK(),f=Ch(),p="[object Map]",d="[object Set]",g=e?e.iterator:void 0;function y(E){if(!E)return[];if(s(E))return a(E)?h(E):n(E);if(g&&E[g])return o(E[g]());var x=r(E),v=x==p?l:x==d?u:f;return v(E)}return o0=y,o0}var u0,Gj;function hx(){if(Gj)return u0;Gj=1;const e=Object.freeze({pg:"postgres",postgresql:"postgres",sqlite:"sqlite3"}),n=Object.freeze(["mssql","mysql","mysql2","oracledb","postgres","pgnative","redshift","sqlite3","cockroachdb","better-sqlite3"].concat(Object.keys(e))),r=Object.freeze({MsSQL:"mssql",MySQL:"mysql",MySQL2:"mysql2",Oracle:"oracledb",PostgreSQL:"pg",PgNative:"pgnative",Redshift:"pg-redshift",SQLite:"sqlite3",CockroachDB:"cockroachdb",BetterSQLite3:"better-sqlite3"}),s=Object.freeze(["maxWaitingClients","testOnBorrow","fifo","priorityRange","autostart","evictionRunIntervalMillis","numTestsPerRun","softIdleTimeoutMillis","Promise"]);return u0={CLIENT_ALIASES:e,SUPPORTED_CLIENTS:n,POOL_CONFIG_OPTIONS:s,COMMA_NO_PAREN_REGEX:/,[\s](?![^(]*\))/g,DRIVER_NAMES:r},u0}var l0,Kj;function Qt(){if(Kj)return l0;Kj=1;const e=Wi(),n=Co(),{CLIENT_ALIASES:r}=hx(),{isFunction:s}=mt();function a(...p){return Array.isArray(p[0])?p[0]:p}function o(p){let d=!1;if(n(p))return!1;if(p&&s(p.toSQL))return d;if(Array.isArray(p))for(let g=0;g<p.length&&!d;g++)d=o(p[g]);else e(p)?Object.keys(p).forEach(g=>{d||(d=o(p[g]))}):d=p===void 0;return d}function l(p){const d=[];return Array.isArray(p)?p.forEach((g,y)=>{o(g)&&d.push(y)}):e(p)?Object.keys(p).forEach(g=>{o(p[g])&&d.push(g)}):d.push(0),d}function u(p){p.prototype.queryContext=function(d){return d===void 0?this._queryContext:(this._queryContext=d,this)}}function h(p){return r[p]||p}function f(p,d){if(p==null)return d;const g=parseInt(p,10);return isNaN(g)?d:g}return l0={addQueryContext:u,containsUndefined:o,getUndefinedIndices:l,normalizeArr:a,resolveClientNameWithAliases:h,toNumber:f},l0}var c0,Yj;function fP(){if(Yj)return c0;Yj=1;const e=nt;function n(s,a,o,l,u){if(typeof o=="function")return{type:"onWrapped",value:o,bool:a};switch(arguments.length){case 3:return{type:"onRaw",value:o,bool:a};case 4:return{type:s,column:o,operator:"=",value:l,bool:a};default:return{type:s,column:o,operator:l,value:u,bool:a}}}class r{constructor(a,o,l){this.schema=l,this.table=a,this.joinType=o,this.and=this,this.clauses=[]}get or(){return this._bool("or")}on(a){if(typeof a=="object"&&typeof a.toSQL!="function"){const l=Object.keys(a);let u=-1;const h=this._bool()==="or"?"orOn":"on";for(;++u<l.length;)this[h](l[u],a[l[u]]);return this}const o=n("onBasic",this._bool(),...arguments);return o&&this.clauses.push(o),this}orOn(a,o,l){return this._bool("or").on.apply(this,arguments)}onJsonPathEquals(a,o,l,u){return this.clauses.push({type:"onJsonPathEquals",columnFirst:a,jsonPathFirst:o,columnSecond:l,jsonPathSecond:u,bool:this._bool(),not:this._not()}),this}orOnJsonPathEquals(a,o,l,u){return this._bool("or").onJsonPathEquals.apply(this,arguments)}using(a){return this.clauses.push({type:"onUsing",column:a,bool:this._bool()})}onVal(a){if(typeof a=="object"&&typeof a.toSQL!="function"){const l=Object.keys(a);let u=-1;const h=this._bool()==="or"?"orOnVal":"onVal";for(;++u<l.length;)this[h](l[u],a[l[u]]);return this}const o=n("onVal",this._bool(),...arguments);return o&&this.clauses.push(o),this}andOnVal(){return this.onVal(...arguments)}orOnVal(){return this._bool("or").onVal(...arguments)}onBetween(a,o){return e(Array.isArray(o),"The second argument to onBetween must be an array."),e(o.length===2,"You must specify 2 values for the onBetween clause"),this.clauses.push({type:"onBetween",column:a,value:o,bool:this._bool(),not:this._not()}),this}onNotBetween(a,o){return this._not(!0).onBetween(a,o)}orOnBetween(a,o){return this._bool("or").onBetween(a,o)}orOnNotBetween(a,o){return this._bool("or")._not(!0).onBetween(a,o)}onIn(a,o){return Array.isArray(o)&&o.length===0?this.on(1,"=",0):(this.clauses.push({type:"onIn",column:a,value:o,not:this._not(),bool:this._bool()}),this)}onNotIn(a,o){return this._not(!0).onIn(a,o)}orOnIn(a,o){return this._bool("or").onIn(a,o)}orOnNotIn(a,o){return this._bool("or")._not(!0).onIn(a,o)}onNull(a){return this.clauses.push({type:"onNull",column:a,not:this._not(),bool:this._bool()}),this}orOnNull(a){return this._bool("or").onNull(a)}onNotNull(a){return this._not(!0).onNull(a)}orOnNotNull(a){return this._not(!0)._bool("or").onNull(a)}onExists(a){return this.clauses.push({type:"onExists",value:a,not:this._not(),bool:this._bool()}),this}orOnExists(a){return this._bool("or").onExists(a)}onNotExists(a){return this._not(!0).onExists(a)}orOnNotExists(a){return this._not(!0)._bool("or").onExists(a)}type(a){return this.joinType=a,this}_bool(a){if(arguments.length===1)return this._boolFlag=a,this;const o=this._boolFlag||"and";return this._boolFlag="and",o}_not(a){if(arguments.length===1)return this._notFlag=a,this;const o=this._notFlag;return this._notFlag=!1,o}}return Object.assign(r.prototype,{grouping:"join"}),r.prototype.andOn=r.prototype.on,r.prototype.andOnIn=r.prototype.onIn,r.prototype.andOnNotIn=r.prototype.onNotIn,r.prototype.andOnNull=r.prototype.onNull,r.prototype.andOnNotNull=r.prototype.onNotNull,r.prototype.andOnExists=r.prototype.onExists,r.prototype.andOnNotExists=r.prototype.onNotExists,r.prototype.andOnBetween=r.prototype.onBetween,r.prototype.andOnNotBetween=r.prototype.onNotBetween,r.prototype.andOnJsonPathEquals=r.prototype.onJsonPathEquals,c0=r,c0}var f0,Xj;function DK(){if(Xj)return f0;Xj=1;const e=nt;class n{constructor(s,a,o,l,u){this.schema=a,this.type="analytic",this.method=s,this.order=l||[],this.partitions=u||[],this.alias=o,this.and=this,this.grouping="columns"}partitionBy(s,a){return e(Array.isArray(s)||typeof s=="string",`The argument to an analytic partitionBy function must be either a string
72
+ or an array of string.`),Array.isArray(s)?this.partitions=this.partitions.concat(s):this.partitions.push({column:s,order:a}),this}orderBy(s,a){return e(Array.isArray(s)||typeof s=="string",`The argument to an analytic orderBy function must be either a string
73
+ or an array of string.`),Array.isArray(s)?this.order=this.order.concat(s):this.order.push({column:s,order:a}),this}}return f0=n,f0}var h0,Wj;function dx(){return Wj||(Wj=1,h0=function(n,r){n.client.config.asyncStackTraces&&(n._asyncStack={error:new Error,lines:r})}),h0}var d0,Jj;function kK(){return Jj||(Jj=1,d0={lockMode:{forShare:"forShare",forUpdate:"forUpdate",forNoKeyUpdate:"forNoKeyUpdate",forKeyShare:"forKeyShare"},waitMode:{skipLocked:"skipLocked",noWait:"noWait"}}),d0}var p0,Zj;function px(){if(Zj)return p0;Zj=1;const e=vh(),n=qn(),{callbackify:r}=nt,s=uP(),{formatQuery:a}=lP();function o(l){l.prototype.toQuery=function(u){let h=this.toSQL(this._method,u);return Array.isArray(h)||(h=[h]),h.length?h.map(f=>a(f.sql,f.bindings,u,this.client)).reduce((f,p)=>f.concat(f.endsWith(";")?`
74
+ `:`;
75
+ `,p)):""},l.prototype.then=function(){let u=this.client.runner(this).run();return this.client.config.asyncStackTraces&&(u=u.catch(h=>{h.originalStack=h.stack;const f=h.stack.split(`
76
+ `)[0],{error:p,lines:d}=this._asyncStack,y=p.stack.split(`
77
+ `).slice(d);throw y.unshift(f),h.stack=y.join(`
78
+ `),h})),u.then.apply(u,arguments)},l.prototype.options=function(u){return this._options=this._options||[],this._options.push(e(u)||{}),this},l.prototype.connection=function(u){return this._connection=u,this.client.processPassedConnection(u),this},l.prototype.debug=function(u){return this._debug=arguments.length?u:!0,this},l.prototype.transacting=function(u){if(u&&u.client&&(u.client.transacting?this.client=u.client:u.client.logger.warn(`Invalid transaction value: ${u.client}`)),n(u))throw this.client.logger.error("Invalid value on transacting call, potential bug"),Error("Invalid transacting value (null, undefined or empty object)");return this},l.prototype.stream=function(u){return this.client.runner(this).stream(u)},l.prototype.pipe=function(u,h){return this.client.runner(this).pipe(u,h)},l.prototype.asCallback=function(u){const h=this.then();return r(()=>h)(u),h},l.prototype.catch=function(u){return this.then().catch(u)},Object.defineProperty(l.prototype,Symbol.toStringTag,{get:()=>"object"}),s(l.prototype)}return p0={augmentWithBuilderInterface:o},p0}var m0,eL;function ni(){if(eL)return m0;eL=1;const e=nt,{EventEmitter:n}=Zs(),r=ea(),s=vh(),a=Ws(),o=qn(),l=Wi(),u=XB(),h=MK(),f=Sh(),p=Tl(),{addQueryContext:d,normalizeArr:g}=Qt(),y=fP(),E=DK(),x=dx(),{isBoolean:v,isNumber:b,isObject:w,isString:C,isFunction:T}=mt(),{lockMode:A,waitMode:N}=kK(),{augmentWithBuilderInterface:O}=px(),I=new Set(["pluck","first","select"]),k=new Set(["with","select","columns","hintComments","where","union","join","group","order","having","limit","offset","counter","counters"]),R=new Set([A.forShare,A.forUpdate,A.forNoKeyUpdate,A.forKeyShare]);class M extends n{constructor(q){super(),this.client=q,this.and=this,this._single={},this._comments=[],this._statements=[],this._method="select",q.config&&(x(this,5),this._debug=q.config.debug),this._joinFlag="inner",this._boolFlag="and",this._notFlag=!1,this._asColumnFlag=!1}toString(){return this.toQuery()}toSQL(q,j){return this.client.queryCompiler(this).toSQL(q||this._method,j)}clone(){const q=new this.constructor(this.client);return q._method=this._method,q._single=s(this._single),q._comments=s(this._comments),q._statements=s(this._statements),q._debug=this._debug,this._options!==void 0&&(q._options=s(this._options)),this._queryContext!==void 0&&(q._queryContext=s(this._queryContext)),this._connection!==void 0&&(q._connection=this._connection),q}timeout(q,{cancel:j}={}){return b(q)&&q>0&&(this._timeout=q,j&&(this.client.assertCanCancelQuery(),this._cancelOnTimeout=!0)),this}isValidStatementArg(q){return typeof q=="function"||q instanceof M||q&&q.isRawInstance}_validateWithArgs(q,j,L,P){const[H,G]=typeof L>"u"?[j,void 0]:[L,j];if(typeof q!="string")throw new Error(`${P}() first argument must be a string`);if(this.isValidStatementArg(H)&&typeof G>"u")return;if(!(Array.isArray(G)&&G.length>0&&G.every(B=>typeof B=="string")))throw new Error(`${P}() second argument must be a statement or non-empty column name list.`);if(!this.isValidStatementArg(H))throw new Error(`${P}() third argument must be a function / QueryBuilder or a raw when its second argument is a column name list`)}with(q,j,L){return this._validateWithArgs(q,j,L,"with"),this.withWrapped(q,j,L)}withMaterialized(q,j,L){throw new Error("With materialized is not supported by this dialect")}withNotMaterialized(q,j,L){throw new Error("With materialized is not supported by this dialect")}withWrapped(q,j,L,P){const[H,G]=typeof L>"u"?[j,void 0]:[L,j],V={grouping:"with",type:"withWrapped",alias:q,columnList:G,value:H};return P!==void 0&&(V.materialized=P),this._statements.push(V),this}withRecursive(q,j,L){return this._validateWithArgs(q,j,L,"withRecursive"),this.withRecursiveWrapped(q,j,L)}withRecursiveWrapped(q,j,L){return this.withWrapped(q,j,L),this._statements[this._statements.length-1].recursive=!0,this}columns(q){return!q&&q!==0?this:(this._statements.push({grouping:"columns",value:g(...arguments)}),this)}comment(q){if(!C(q))throw new Error("Comment must be a string");const j=["/*","*/","?"];if(j.some(L=>q.includes(L)))throw new Error(`Cannot include ${j.join(", ")} in comment`);return this._comments.push({comment:q}),this}as(q){return this._single.as=q,this}hintComment(q){if(q=Array.isArray(q)?q:[q],q.some(j=>!C(j)))throw new Error("Hint comment must be a string");if(q.some(j=>j.includes("/*")||j.includes("*/")))throw new Error('Hint comment cannot include "/*" or "*/"');if(q.some(j=>j.includes("?")))throw new Error('Hint comment cannot include "?"');return this._statements.push({grouping:"hintComments",value:q}),this}withSchema(q){return this._single.schema=q,this}table(q,j={}){return this._single.table=q,this._single.only=j.only===!0,this}distinct(...q){return this._statements.push({grouping:"columns",value:g(...q),distinct:!0}),this}distinctOn(...q){if(o(q))throw new Error("distinctOn requires at least on argument");return this._statements.push({grouping:"columns",value:g(...q),distinctOn:!0}),this}join(q,j,...L){let P;const H=q instanceof M||typeof q=="function"?void 0:this._single.schema,G=this._joinType();return typeof j=="function"?(P=new y(q,G,H),j.call(P,P)):G==="raw"?P=new y(this.client.raw(q,j),"raw"):(P=new y(q,G,H),j&&P.on(j,...L)),this._statements.push(P),this}using(q){throw new Error("'using' function is only available in PostgreSQL dialect with Delete statements.")}innerJoin(...q){return this._joinType("inner").join(...q)}leftJoin(...q){return this._joinType("left").join(...q)}leftOuterJoin(...q){return this._joinType("left outer").join(...q)}rightJoin(...q){return this._joinType("right").join(...q)}rightOuterJoin(...q){return this._joinType("right outer").join(...q)}outerJoin(...q){return this._joinType("outer").join(...q)}fullOuterJoin(...q){return this._joinType("full outer").join(...q)}crossJoin(...q){return this._joinType("cross").join(...q)}joinRaw(...q){return this._joinType("raw").join(...q)}get or(){return this._bool("or")}get not(){return this._not(!0)}where(q,j,L){const P=arguments.length;if(q===!1||q===!0)return this.where(1,"=",q?1:0);if(typeof q=="function")return this.whereWrapped(q);if(w(q)&&!q.isRawInstance)return this._objectWhere(q);if(q&&q.isRawInstance&&P===1)return this.whereRaw(q);if(P===2&&(L=j,j="=",L===null))return this.whereNull(q);const H=`${j}`.toLowerCase().trim();if(P===3){if(H==="in"||H==="not in")return this._not(H==="not in").whereIn(q,L);if(H==="between"||H==="not between")return this._not(H==="not between").whereBetween(q,L)}return L===null&&(H==="is"||H==="is not")?this._not(H==="is not").whereNull(q):(this._statements.push({grouping:"where",type:"whereBasic",column:q,operator:j,value:L,not:this._not(),bool:this._bool(),asColumn:this._asColumnFlag}),this)}whereColumn(...q){return this._asColumnFlag=!0,this.where(...q),this._asColumnFlag=!1,this}orWhere(q,...j){this._bool("or");const L=q;return w(L)&&!L.isRawInstance?this.whereWrapped(function(){for(const P in L)this.andWhere(P,L[P])}):this.where(q,...j)}orWhereColumn(q,...j){this._bool("or");const L=q;return w(L)&&!L.isRawInstance?this.whereWrapped(function(){for(const P in L)this.andWhereColumn(P,"=",L[P])}):this.whereColumn(q,...j)}whereNot(q,...j){return j.length>=2&&(j[0]==="in"||j[0]==="between")&&this.client.logger.warn('whereNot is not suitable for "in" and "between" type subqueries. You should use "not in" and "not between" instead.'),this._not(!0).where(q,...j)}whereNotColumn(...q){return this._not(!0).whereColumn(...q)}orWhereNot(...q){return this._bool("or").whereNot(...q)}orWhereNotColumn(...q){return this._bool("or").whereNotColumn(...q)}_objectWhere(q){const j=this._bool(),L=this._not()?"Not":"";for(const P in q)this[j+"Where"+L](P,q[P]);return this}whereRaw(q,j){const L=q.isRawInstance?q:this.client.raw(q,j);return this._statements.push({grouping:"where",type:"whereRaw",value:L,not:this._not(),bool:this._bool()}),this}orWhereRaw(q,j){return this._bool("or").whereRaw(q,j)}whereWrapped(q){return this._statements.push({grouping:"where",type:"whereWrapped",value:q,not:this._not(),bool:this._bool()}),this}whereExists(q){return this._statements.push({grouping:"where",type:"whereExists",value:q,not:this._not(),bool:this._bool()}),this}orWhereExists(q){return this._bool("or").whereExists(q)}whereNotExists(q){return this._not(!0).whereExists(q)}orWhereNotExists(q){return this._bool("or").whereNotExists(q)}whereIn(q,j){return Array.isArray(j)&&o(j)?this.where(this._not()):(this._statements.push({grouping:"where",type:"whereIn",column:q,value:j,not:this._not(),bool:this._bool()}),this)}orWhereIn(q,j){return this._bool("or").whereIn(q,j)}whereNotIn(q,j){return this._not(!0).whereIn(q,j)}orWhereNotIn(q,j){return this._bool("or")._not(!0).whereIn(q,j)}whereNull(q){return this._statements.push({grouping:"where",type:"whereNull",column:q,not:this._not(),bool:this._bool()}),this}orWhereNull(q){return this._bool("or").whereNull(q)}whereNotNull(q){return this._not(!0).whereNull(q)}orWhereNotNull(q){return this._bool("or").whereNotNull(q)}whereBetween(q,j){return e(Array.isArray(j),"The second argument to whereBetween must be an array."),e(j.length===2,"You must specify 2 values for the whereBetween clause"),this._statements.push({grouping:"where",type:"whereBetween",column:q,value:j,not:this._not(),bool:this._bool()}),this}whereNotBetween(q,j){return this._not(!0).whereBetween(q,j)}orWhereBetween(q,j){return this._bool("or").whereBetween(q,j)}orWhereNotBetween(q,j){return this._bool("or").whereNotBetween(q,j)}_whereLike(q,j,L){return this._statements.push({grouping:"where",type:q,column:j,value:L,not:this._not(),bool:this._bool(),asColumn:this._asColumnFlag}),this}whereLike(q,j){return this._whereLike("whereLike",q,j)}orWhereLike(q,j){return this._bool("or")._whereLike("whereLike",q,j)}whereILike(q,j){return this._whereLike("whereILike",q,j)}orWhereILike(q,j){return this._bool("or")._whereLike("whereILike",q,j)}groupBy(q){return q&&q.isRawInstance?this.groupByRaw.apply(this,arguments):(this._statements.push({grouping:"group",type:"groupByBasic",value:g(...arguments)}),this)}groupByRaw(q,j){const L=q.isRawInstance?q:this.client.raw(q,j);return this._statements.push({grouping:"group",type:"groupByRaw",value:L}),this}orderBy(q,j,L=""){return Array.isArray(q)?this._orderByArray(q):(this._statements.push({grouping:"order",type:"orderByBasic",value:q,direction:j,nulls:L}),this)}_orderByArray(q){for(let j=0;j<q.length;j++){const L=q[j];w(L)?this._statements.push({grouping:"order",type:"orderByBasic",value:L.column,direction:L.order,nulls:L.nulls}):(C(L)||b(L))&&this._statements.push({grouping:"order",type:"orderByBasic",value:L})}return this}orderByRaw(q,j){const L=q.isRawInstance?q:this.client.raw(q,j);return this._statements.push({grouping:"order",type:"orderByRaw",value:L}),this}_union(q,j){let L=j[0],P=j[1];if(j.length===1||j.length===2&&v(P)){Array.isArray(L)||(L=[L]);for(let H=0,G=L.length;H<G;H++)this._statements.push({grouping:"union",clause:q,value:L[H],wrap:P||!1})}else L=p(j).slice(0,j.length-1),P=j[j.length-1],v(P)||(L.push(P),P=!1),this._union(q,[L,P]);return this}union(...q){return this._union("union",q)}unionAll(...q){return this._union("union all",q)}intersect(...q){return this._union("intersect",q)}except(...q){return this._union("except",q)}having(q,j,L){return q.isRawInstance&&arguments.length===1?this.havingRaw(q):typeof q=="function"?this.havingWrapped(q):(this._statements.push({grouping:"having",type:"havingBasic",column:q,operator:j,value:L,bool:this._bool(),not:this._not()}),this)}orHaving(q,...j){this._bool("or");const L=q;return w(L)&&!L.isRawInstance?this.havingWrapped(function(){for(const P in L)this.andHaving(P,L[P])}):this.having(q,...j)}havingWrapped(q){return this._statements.push({grouping:"having",type:"havingWrapped",value:q,bool:this._bool(),not:this._not()}),this}havingNull(q){return this._statements.push({grouping:"having",type:"havingNull",column:q,not:this._not(),bool:this._bool()}),this}orHavingNull(q){return this._bool("or").havingNull(q)}havingNotNull(q){return this._not(!0).havingNull(q)}orHavingNotNull(q){return this._not(!0)._bool("or").havingNull(q)}havingExists(q){return this._statements.push({grouping:"having",type:"havingExists",value:q,not:this._not(),bool:this._bool()}),this}orHavingExists(q){return this._bool("or").havingExists(q)}havingNotExists(q){return this._not(!0).havingExists(q)}orHavingNotExists(q){return this._not(!0)._bool("or").havingExists(q)}havingBetween(q,j){return e(Array.isArray(j),"The second argument to havingBetween must be an array."),e(j.length===2,"You must specify 2 values for the havingBetween clause"),this._statements.push({grouping:"having",type:"havingBetween",column:q,value:j,not:this._not(),bool:this._bool()}),this}orHavingBetween(q,j){return this._bool("or").havingBetween(q,j)}havingNotBetween(q,j){return this._not(!0).havingBetween(q,j)}orHavingNotBetween(q,j){return this._not(!0)._bool("or").havingBetween(q,j)}havingIn(q,j){return Array.isArray(j)&&o(j)?this.where(this._not()):(this._statements.push({grouping:"having",type:"havingIn",column:q,value:j,not:this._not(),bool:this._bool()}),this)}orHavingIn(q,j){return this._bool("or").havingIn(q,j)}havingNotIn(q,j){return this._not(!0).havingIn(q,j)}orHavingNotIn(q,j){return this._bool("or")._not(!0).havingIn(q,j)}havingRaw(q,j){const L=q.isRawInstance?q:this.client.raw(q,j);return this._statements.push({grouping:"having",type:"havingRaw",value:L,bool:this._bool(),not:this._not()}),this}orHavingRaw(q,j){return this._bool("or").havingRaw(q,j)}_setSkipBinding(q,j){let L=j;w(j)&&(L=j.skipBinding),this._single.skipBinding=this._single.skipBinding||{},this._single.skipBinding[q]=L}offset(q,j){if(q==null||q.isRawInstance||q instanceof M)this._single.offset=q;else{const L=parseInt(q,10);if(isNaN(L))this.client.logger.warn("A valid integer must be provided to offset");else{if(L<0)throw new Error("A non-negative integer must be provided to offset.");this._single.offset=L}}return this._setSkipBinding("offset",j),this}limit(q,j){const L=parseInt(q,10);return isNaN(L)?this.client.logger.warn("A valid integer must be provided to limit"):(this._single.limit=L,this._setSkipBinding("limit",j)),this}count(q,j){return this._aggregate("count",q||"*",j)}min(q,j){return this._aggregate("min",q,j)}max(q,j){return this._aggregate("max",q,j)}sum(q,j){return this._aggregate("sum",q,j)}avg(q,j){return this._aggregate("avg",q,j)}countDistinct(...q){let j;return q.length>1&&l(u(q))&&([j]=q.splice(q.length-1,1)),q.length?q.length===1&&(q=q[0]):q="*",this._aggregate("count",q,{...j,distinct:!0})}sumDistinct(q,j){return this._aggregate("sum",q,{...j,distinct:!0})}avgDistinct(q,j){return this._aggregate("avg",q,{...j,distinct:!0})}increment(q,j=1){if(w(q)){for(const L in q)this._counter(L,q[L]);return this}return this._counter(q,j)}decrement(q,j=1){if(w(q)){for(const L in q)this._counter(L,-q[L]);return this}return this._counter(q,-j)}clearCounters(){return this._single.counter={},this}first(...q){if(this._method&&this._method!=="select")throw new Error(`Cannot chain .first() on "${this._method}" query`);return this.select(g(...q)),this._method="first",this.limit(1),this}connection(q){return this._connection=q,this.client.processPassedConnection(q),this}pluck(q){if(this._method&&this._method!=="select")throw new Error(`Cannot chain .pluck() on "${this._method}" query`);return this._method="pluck",this._single.pluck=q,this._statements.push({grouping:"columns",type:"pluck",value:q}),this}clearSelect(){return this._clearGrouping("columns"),this}clearWhere(){return this._clearGrouping("where"),this}clearGroup(){return this._clearGrouping("group"),this}clearOrder(){return this._clearGrouping("order"),this}clearHaving(){return this._clearGrouping("having"),this}clear(q){if(!k.has(q))throw new Error(`Knex Error: unknown statement '${q}'`);return q.startsWith("counter")?this.clearCounters():(q==="select"&&(q="columns"),this._clearGrouping(q),this)}insert(q,j,L){return this._method="insert",o(j)||this.returning(j,L),this._single.insert=q,this}update(q,j,L){let P;const H=this._single.update||{};if(this._method="update",C(q))l(j)?H[q]=JSON.stringify(j):H[q]=j,arguments.length>2&&(P=arguments[2]);else{const G=Object.keys(q);this._single.update&&this.client.logger.warn("Update called multiple times with objects.");let V=-1;for(;++V<G.length;)H[G[V]]=q[G[V]];P=arguments[1]}return o(P)||this.returning(P,L),this._single.update=H,this}returning(q,j){return this._single.returning=q,this._single.options=j,this}onConflict(q){return typeof q=="string"&&(q=[q]),new D(this,q||!0)}delete(q,j){return this._method="del",o(q)||this.returning(q,j),this}truncate(q){return this._method="truncate",q&&(this._single.table=q),this}columnInfo(q){return this._method="columnInfo",this._single.columnInfo=q,this}forUpdate(...q){return this._single.lock=A.forUpdate,q.length===1&&Array.isArray(q[0])?this._single.lockTables=q[0]:this._single.lockTables=q,this}forShare(...q){return this._single.lock=A.forShare,this._single.lockTables=q,this}forNoKeyUpdate(...q){return this._single.lock=A.forNoKeyUpdate,this._single.lockTables=q,this}forKeyShare(...q){return this._single.lock=A.forKeyShare,this._single.lockTables=q,this}skipLocked(){if(!this._isSelectQuery())throw new Error(`Cannot chain .skipLocked() on "${this._method}" query!`);if(!this._hasLockMode())throw new Error(".skipLocked() can only be used after a call to .forShare() or .forUpdate()!");if(this._single.waitMode===N.noWait)throw new Error(".skipLocked() cannot be used together with .noWait()!");return this._single.waitMode=N.skipLocked,this}noWait(){if(!this._isSelectQuery())throw new Error(`Cannot chain .noWait() on "${this._method}" query!`);if(!this._hasLockMode())throw new Error(".noWait() can only be used after a call to .forShare() or .forUpdate()!");if(this._single.waitMode===N.skipLocked)throw new Error(".noWait() cannot be used together with .skipLocked()!");return this._single.waitMode=N.noWait,this}fromJS(q){return a(q,(j,L)=>{typeof this[L]!="function"&&this.client.logger.warn(`Knex Error: unknown key ${L}`),Array.isArray(j)?this[L].apply(this,j):this[L](j)}),this}fromRaw(q,j){const L=q.isRawInstance?q:this.client.raw(q,j);return this.from(L)}modify(q){return q.apply(this,[this].concat(f(arguments))),this}upsert(q,j,L){throw new Error(`Upsert is not yet supported for dialect ${this.client.dialect}`)}_json(q,j){return this._statements.push({grouping:"columns",type:"json",method:q,params:j}),this}jsonExtract(){const q=arguments[0];let j,L,P=!0;return arguments.length>=2&&(j=arguments[1]),arguments.length>=3&&(L=arguments[2]),arguments.length===4&&(P=arguments[3]),arguments.length===2&&Array.isArray(arguments[0])&&v(arguments[1])&&(P=arguments[1]),this._json("jsonExtract",{column:q,path:j,alias:L,singleValue:P})}jsonSet(q,j,L,P){return this._json("jsonSet",{column:q,path:j,value:L,alias:P})}jsonInsert(q,j,L,P){return this._json("jsonInsert",{column:q,path:j,value:L,alias:P})}jsonRemove(q,j,L){return this._json("jsonRemove",{column:q,path:j,alias:L})}_isJsonObject(q){return w(q)&&!(q instanceof M)}_whereJsonWrappedValue(q,j,L){const P={grouping:"where",type:q,column:j,value:L,not:this._not(),bool:this._bool(),asColumn:this._asColumnFlag};arguments[3]&&(P.operator=arguments[3]),arguments[4]&&(P.jsonPath=arguments[4]),this._statements.push(P)}whereJsonObject(q,j){return this._whereJsonWrappedValue("whereJsonObject",q,j),this}orWhereJsonObject(q,j){return this._bool("or").whereJsonObject(q,j)}whereNotJsonObject(q,j){return this._not(!0).whereJsonObject(q,j)}orWhereNotJsonObject(q,j){return this._bool("or").whereNotJsonObject(q,j)}whereJsonPath(q,j,L,P){return this._whereJsonWrappedValue("whereJsonPath",q,P,L,j),this}orWhereJsonPath(q,j,L,P){return this._bool("or").whereJsonPath(q,j,L,P)}whereJsonSupersetOf(q,j){return this._whereJsonWrappedValue("whereJsonSupersetOf",q,j),this}whereJsonNotSupersetOf(q,j){return this._not(!0).whereJsonSupersetOf(q,j)}orWhereJsonSupersetOf(q,j){return this._bool("or").whereJsonSupersetOf(q,j)}orWhereJsonNotSupersetOf(q,j){return this._bool("or").whereJsonNotSupersetOf(q,j)}whereJsonSubsetOf(q,j){return this._whereJsonWrappedValue("whereJsonSubsetOf",q,j),this}whereJsonNotSubsetOf(q,j){return this._not(!0).whereJsonSubsetOf(q,j)}orWhereJsonSubsetOf(q,j){return this._bool("or").whereJsonSubsetOf(q,j)}orWhereJsonNotSubsetOf(q,j){return this._bool("or").whereJsonNotSubsetOf(q,j)}whereJsonHasNone(q,j){return this._not(!0).whereJsonHasAll(q,j),this}_analytic(q,j,L){let P;const{schema:H}=this._single,G=this._analyticMethod();if(q=typeof q=="string"?q:null,e(typeof j=="function"||j.isRawInstance||Array.isArray(j)||typeof j=="string"||typeof j=="object",`The second argument to an analytic function must be either a function, a raw,
79
+ an array of string or object, an object or a single string.`),L&&e(Array.isArray(L)||typeof L=="string"||typeof L=="object","The third argument to an analytic function must be either a string, an array of string or object or an object."),T(j))P=new E(G,H,q),j.call(P,P);else if(j.isRawInstance)P={grouping:"columns",type:"analytic",method:G,raw:j,alias:q};else{const V=Array.isArray(j)?j:[j];let B=L||[];B=Array.isArray(B)?B:[B],P={grouping:"columns",type:"analytic",method:G,order:V,alias:q,partitions:B}}return this._statements.push(P),this}rank(...q){return this._analyticMethod("rank")._analytic(...q)}denseRank(...q){return this._analyticMethod("dense_rank")._analytic(...q)}rowNumber(...q){return this._analyticMethod("row_number")._analytic(...q)}_counter(q,j){return j=parseFloat(j),this._method="update",this._single.counter=this._single.counter||{},this._single.counter[q]=j,this}_bool(q){if(arguments.length===1)return this._boolFlag=q,this;const j=this._boolFlag;return this._boolFlag="and",j}_not(q){if(arguments.length===1)return this._notFlag=q,this;const j=this._notFlag;return this._notFlag=!1,j}_joinType(q){if(arguments.length===1)return this._joinFlag=q,this;const j=this._joinFlag||"inner";return this._joinFlag="inner",j}_analyticMethod(q){return arguments.length===1?(this._analyticFlag=q,this):this._analyticFlag||"row_number"}_aggregate(q,j,L={}){return this._statements.push({grouping:"columns",type:j.isRawInstance?"aggregateRaw":"aggregate",method:q,value:j,aggregateDistinct:L.distinct||!1,alias:L.as}),this}_clearGrouping(q){q in this._single?this._single[q]=void 0:this._statements=h(this._statements,{grouping:q})}_isSelectQuery(){return I.has(this._method)}_hasLockMode(){return R.has(this._single.lock)}}M.prototype.select=M.prototype.columns,M.prototype.column=M.prototype.columns,M.prototype.andWhereNot=M.prototype.whereNot,M.prototype.andWhereNotColumn=M.prototype.whereNotColumn,M.prototype.andWhere=M.prototype.where,M.prototype.andWhereColumn=M.prototype.whereColumn,M.prototype.andWhereRaw=M.prototype.whereRaw,M.prototype.andWhereBetween=M.prototype.whereBetween,M.prototype.andWhereNotBetween=M.prototype.whereNotBetween,M.prototype.andWhereJsonObject=M.prototype.whereJsonObject,M.prototype.andWhereNotJsonObject=M.prototype.whereNotJsonObject,M.prototype.andWhereJsonPath=M.prototype.whereJsonPath,M.prototype.andWhereLike=M.prototype.whereLike,M.prototype.andWhereILike=M.prototype.whereILike,M.prototype.andHaving=M.prototype.having,M.prototype.andHavingIn=M.prototype.havingIn,M.prototype.andHavingNotIn=M.prototype.havingNotIn,M.prototype.andHavingNull=M.prototype.havingNull,M.prototype.andHavingNotNull=M.prototype.havingNotNull,M.prototype.andHavingExists=M.prototype.havingExists,M.prototype.andHavingNotExists=M.prototype.havingNotExists,M.prototype.andHavingBetween=M.prototype.havingBetween,M.prototype.andHavingNotBetween=M.prototype.havingNotBetween,M.prototype.from=M.prototype.table,M.prototype.into=M.prototype.table,M.prototype.del=M.prototype.delete,O(M),d(M),M.extend=(z,q)=>{if(Object.prototype.hasOwnProperty.call(M.prototype,z))throw new Error(`Can't extend QueryBuilder with existing method ('${z}').`);r(M.prototype,{[z]:q})};class D{constructor(q,j){this.builder=q,this._columns=j}ignore(){return this.builder._single.onConflict=this._columns,this.builder._single.ignore=!0,this.builder}merge(q){return this.builder._single.onConflict=this._columns,this.builder._single.merge={updates:q},this.builder}then(){throw new Error("Incomplete onConflict clause. .onConflict() must be directly followed by either .merge() or .ignore()")}}return m0=M,m0}var g0,tL;function ta(){if(tL)return g0;tL=1;const{isObject:e}=mt();function n(a,o,l,u){const h=l.queryBuilder();return a.call(h,h),l.queryCompiler(h,u.bindings).toSQL(o||h._method||"select")}function r(a,o,l){const u=o.queryContext();return l.wrapIdentifier((a||"").trim(),u)}function s(a,o,l){return a===void 0?"":a===null?"null":a&&a.isRawInstance?a.toQuery():o==="bool"?(a==="false"&&(a=0),`'${a?1:0}'`):(o==="json"||o==="jsonb")&&e(a)?`'${JSON.stringify(a)}'`:l._escapeBinding(a.toString())}return g0={compileCallback:n,wrapAsIdentifier:r,formatDefault:s},g0}var y0,nL;function Vt(){if(nL)return y0;nL=1;const e=IB(),n=ni(),{compileCallback:r,wrapAsIdentifier:s}=ta(),a=["asc","desc"],o=e(["=","<",">","<=",">=","<>","!=","like","not like","between","not between","ilike","not ilike","exists","not exist","rlike","not rlike","regexp","not regexp","match","&","|","^","<<",">>","~","~=","~*","!~","!~*","#","&&","@>","<@","||","&<","&>","-|-","@@","!!",["?","\\?"],["?|","\\?|"],["?&","\\?&"]],(x,v)=>{Array.isArray(v)?x[v[0]]=v[1]:x[v]=v},{});function l(x,v,b,w){const C=Array.isArray(x)?x:[x];let T="",A=-1;for(;++A<C.length;)A>0&&(T+=", "),T+=u(C[A],void 0,v,b,w);return T}function u(x,v,b,w,C){const T=h(x,v,b,w,C);if(T)return T;switch(typeof x){case"function":return g(r(x,void 0,w,C),!0,b,w);case"object":return d(x,b,w,C);case"number":return x;default:return p(x+"",b,w)}}function h(x,v,b,w,C){let T;if(x instanceof n)return T=w.queryCompiler(x).toSQL(),T.bindings&&C.bindings.push(...T.bindings),g(T,v,b,w);if(x&&x.isRawInstance)return x.client=w,b._queryContext&&(x.queryContext=()=>b._queryContext),T=x.toSQL(),T.bindings&&C.bindings.push(...T.bindings),T.sql;v&&C.bindings.push(x)}function f(x,v,b,w){const C=h(x,void 0,v,b,w);if(C)return C;const T=o[(x||"").toLowerCase()];if(!T)throw new TypeError(`The operator "${x}" is not permitted`);return T}function p(x,v,b){const w=x.toLowerCase().indexOf(" as ");if(w!==-1){const N=x.slice(0,w),O=x.slice(w+4);return b.alias(p(N,v,b),s(O,v,b))}const C=[];let T=-1;const A=x.split(".");for(;++T<A.length;)x=A[T],T===0&&A.length>1?C.push(p((x||"").trim(),v,b)):C.push(s(x,v,b));return C.join(".")}function d(x,v,b,w){const C=[];for(const T in x){const A=x[T];if(typeof A=="function"){const N=r(A,void 0,b,w);N.as=T,C.push(g(N,!0,v,b))}else A instanceof n?C.push(b.alias(`(${u(A,void 0,v,b,w)})`,s(T,v,b))):C.push(b.alias(u(A,void 0,v,b,w),s(T,v,b)))}return C.join(", ")}function g(x,v,b,w){let C=x.sql||"";return C&&(x.method==="select"||x.method==="first")&&(v||x.as)&&(C=`(${C})`,x.as)?w.alias(C,p(x.as,b,w)):C}function y(x,v,b,w,C){return typeof x=="function"?g(r(x,v,w,C),void 0,b,w):h(x,void 0,b,w,C)||""}function E(x,v,b,w){const C=h(x,void 0,v,b,w);return C||(a.indexOf((x||"").toLowerCase())!==-1?x:"asc")}return y0={columnize:l,direction:E,operator:f,outputQuery:g,rawOrFn:y,unwrapRaw:h,wrap:u,wrapString:p},y0}var v0,rL;function BK(){if(rL)return v0;rL=1;const{columnize:e}=Vt();function n(s,a){const o={bindings:[]},l=s,u=s.bindings.length,h=s.bindings;let f=0;const p=s.sql.replace(/\\?\?\??/g,function(d){if(d==="\\?")return d;const g=h[f++];return d==="??"?e(g,l,a,o):a.parameter(g,l,o)});if(u!==f)throw new Error(`Expected ${u} bindings, saw ${f}`);return{method:"raw",sql:p,bindings:o.bindings}}function r(s,a){const o={bindings:[]},l=s,u=s.bindings,h=/\\?(:(\w+):(?=::)|:(\w+):(?!:)|:(\w+))/g;return{method:"raw",sql:s.sql.replace(h,function(p,d,g,y,E){if(p!==d)return d;const x=g||y||E,v=p.trim(),b=v[v.length-1]===":",w=u[x];return w===void 0?(Object.prototype.hasOwnProperty.call(u,x)&&o.bindings.push(w),p):b?p.replace(d,e(w,l,a,o)):p.replace(d,a.parameter(w,l,o))}),bindings:o.bindings}}return v0={replaceKeyBindings:r,replaceRawArrBindings:n},v0}var b0,iL;function mx(){if(iL)return b0;iL=1;const e="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",n="0123456789";function r(a=21){let o="",l=a;for(;l--;)o+=e[Math.random()*64|0];return o}function s(a=21){let o="",l=a;for(;l--;)o+=n[Math.random()*10|0];return o}return b0={nanoid:r,nanonum:s},b0}var _0,sL;function Ao(){if(sL)return _0;sL=1;const{EventEmitter:e}=Zs(),n=tr(),r=ea(),s=Wi(),a=Js(),{replaceRawArrBindings:o,replaceKeyBindings:l}=BK(),u=Qt(),h=dx(),{nanoid:f}=mx(),{isNumber:p,isObject:d}=mt(),{augmentWithBuilderInterface:g}=px(),y=n("knex:bindings");class E extends e{constructor(v){super(),this.client=v,this.sql="",this.bindings=[],this._wrappedBefore=void 0,this._wrappedAfter=void 0,v&&v.config&&(this._debug=v.config.debug,h(this,4))}set(v,b){return this.sql=v,this.bindings=d(b)&&!b.toSQL||b===void 0?b:[b],this}timeout(v,{cancel:b}={}){return p(v)&&v>0&&(this._timeout=v,b&&(this.client.assertCanCancelQuery(),this._cancelOnTimeout=!0)),this}wrap(v,b){return this._wrappedBefore=v,this._wrappedAfter=b,this}toString(){return this.toQuery()}toSQL(v,b){let w;if(Array.isArray(this.bindings)?w=o(this,this.client):this.bindings&&s(this.bindings)?w=l(this,this.client):w={method:"raw",sql:this.sql,bindings:this.bindings===void 0?[]:[this.bindings]},this._wrappedBefore&&(w.sql=this._wrappedBefore+w.sql),this._wrappedAfter&&(w.sql=w.sql+this._wrappedAfter),w.options=a(this._options,r,{}),this._timeout&&(w.timeout=this._timeout,this._cancelOnTimeout&&(w.cancelOnTimeout=this._cancelOnTimeout)),w.bindings=w.bindings||[],u.containsUndefined(w.bindings)){const C=u.getUndefinedIndices(this.bindings);throw y(w.bindings),new Error(`Undefined binding(s) detected for keys [${C}] when compiling RAW query: ${w.sql}`)}return w.__knexQueryUid=f(),Object.defineProperties(w,{toNative:{value:()=>({sql:this.client.positionBindings(w.sql),bindings:this.client.prepBindings(w.bindings)}),enumerable:!1}}),w}}return E.prototype.isRawInstance=!0,g(E),u.addQueryContext(E),_0=E,_0}var w0,aL;function gx(){if(aL)return w0;aL=1;function e(n){for(var r=-1,s=n==null?0:n.length,a=0,o=[];++r<s;){var l=n[r];l&&(o[a++]=l)}return o}return w0=e,w0}var E0,oL;function PK(){if(oL)return E0;oL=1;function e(n,r,s,a){for(var o=-1,l=n==null?0:n.length;++o<l;){var u=n[o];r(a,u,s(u),n)}return a}return E0=e,E0}var C0,uL;function zK(){if(uL)return C0;uL=1;var e=xo();function n(r,s,a,o){return e(r,function(l,u,h){s(o,l,a(l),h)}),o}return C0=n,C0}var x0,lL;function UK(){if(lL)return x0;lL=1;var e=PK(),n=zK(),r=mn(),s=vt();function a(o,l){return function(u,h){var f=s(u)?e:n,p=l?l():{};return f(u,o,r(h,2),p)}}return x0=a,x0}var S0,cL;function Th(){if(cL)return S0;cL=1;var e=bl(),n=UK(),r=Object.prototype,s=r.hasOwnProperty,a=n(function(o,l,u){s.call(o,u)?o[u].push(l):e(o,u,[l])});return S0=a,S0}var T0,fL;function QK(){if(fL)return T0;fL=1;var e=Cl(),n=mn(),r=tP(),s=cB();function a(o,l){if(o==null)return{};var u=e(s(o),function(h){return[h]});return l=n(l),r(o,u,function(h,f){return l(h,f[0])})}return T0=a,T0}var q0,hL;function HK(){if(hL)return q0;hL=1;var e=mn(),n=cP(),r=QK();function s(a,o){return r(a,n(e(o)))}return q0=s,q0}var A0,dL;function na(){if(dL)return A0;dL=1;const e=Qt(),n=Ao(),r=ni(),s=fP(),a=tr(),o=ea(),l=gx(),u=Th(),h=To(),f=qn(),p=ti(),d=HK(),g=Js(),{nanoid:y}=mx(),{isString:E,isUndefined:x}=mt(),{columnize:v,direction:b,operator:w,wrap:C,unwrapRaw:T,rawOrFn:A}=Vt(),N=a("knex:bindings"),O=["comments","columns","join","where","union","group","having","order","limit","offset","lock","waitMode"];class I{constructor(R,M,D){this.client=R,this.method=M._method||"select",this.options=M._options,this.single=M._single,this.queryComments=M._comments,this.timeout=M._timeout||!1,this.cancelOnTimeout=M._cancelOnTimeout||!1,this.grouped=u(M._statements,"grouping"),this.formatter=R.formatter(M),this._emptyInsertValue="default values",this.first=this.select,this.bindings=D||[],this.formatter.bindings=this.bindings,this.bindingsHolder=this,this.builder=this.formatter.builder}toSQL(R,M){this._undefinedInWhereClause=!1,this.undefinedBindingsInfo=[],R=R||this.method;const D=this[R]()||"",z={method:R,options:g(this.options,o,{}),timeout:this.timeout,cancelOnTimeout:this.cancelOnTimeout,bindings:this.bindingsHolder.bindings||[],__knexQueryUid:y()};if(Object.defineProperties(z,{toNative:{value:()=>({sql:this.client.positionBindings(z.sql),bindings:this.client.prepBindings(z.bindings)}),enumerable:!1}}),E(D)?z.sql=D:o(z,D),(R==="select"||R==="first")&&this.single.as&&(z.as=this.single.as),this._undefinedInWhereClause)throw N(z.bindings),new Error(`Undefined binding(s) detected when compiling ${R.toUpperCase()}. Undefined column(s): [${this.undefinedBindingsInfo.join(", ")}] query: ${z.sql}`);return z}select(){let R=this.with(),M="";const D=[],z=[];O.forEach(j=>{const L=this[j](this);switch(j){case"union":M=L;break;case"comments":case"columns":case"join":case"where":D.push(L);break;default:z.push(L);break}});const q=this.grouped.union&&this.grouped.union.map(j=>j.wrap).some(j=>j);if(this.onlyUnions()){const j=l(D.concat(z)).join(" ");R+=M+(j?" "+j:"")}else{const j=(q?"(":"")+l(D).join(" ")+(q?")":""),L=l(z).join(" ");R+=j+(M?" "+M:"")+(L&&" "+L)}return R}pluck(){let R=this.single.pluck;return R.indexOf(".")!==-1&&(R=R.split(".").slice(-1)[0]),{sql:this.select(),pluck:R}}insert(){const R=this.single.insert||[],M=this.with()+`insert into ${this.tableName} `,D=this._insertBody(R);return D===""?"":M+D}_onConflictClause(R){return R instanceof n?this.formatter.wrap(R):`(${this.formatter.columnize(R)})`}_buildInsertValues(R){let M="",D=-1;for(;++D<R.values.length;)D!==0&&(M+="), ("),M+=this.client.parameterize(R.values[D],this.client.valueForUndefined,this.builder,this.bindingsHolder);return M}_insertBody(R){let M="";if(Array.isArray(R)){if(R.length===0)return""}else if(typeof R=="object"&&f(R))return M+this._emptyInsertValue;const D=this._prepInsert(R);return typeof D=="string"?M+=D:D.columns.length?(M+=`(${v(D.columns,this.builder,this.client,this.bindingsHolder)}`,M+=") values ("+this._buildInsertValues(D)+")"):R.length===1&&R[0]?M+=this._emptyInsertValue:M="",M}update(){const R=this.with(),{tableName:M}=this,D=this._prepUpdate(this.single.update),z=this.where();return R+`update ${this.single.only?"only ":""}${M} set `+D.join(", ")+(z?` ${z}`:"")}_hintComments(){let R=this.grouped.hintComments||[];return R=R.map(M=>l(M.value).join(" ")),R=l(R).join(" "),R?`/*+ ${R} */ `:""}columns(){let R="";if(this.onlyUnions())return"";const M=this._hintComments(),D=this.grouped.columns||[];let z=-1,q=[];if(D)for(;++z<D.length;){const L=D[z];if(L.distinct&&(R="distinct "),L.distinctOn){R=this.distinctOn(L.value);continue}L.type==="aggregate"?q.push(...this.aggregate(L)):L.type==="aggregateRaw"?q.push(this.aggregateRaw(L)):L.type==="analytic"?q.push(this.analytic(L)):L.type==="json"?q.push(this.json(L)):L.value&&L.value.length>0&&q.push(v(L.value,this.builder,this.client,this.bindingsHolder))}return q.length===0&&(q=["*"]),`${this.onlyJson()?"":"select "}${M}${R}`+q.join(", ")+(this.tableName?` from ${this.single.only?"only ":""}${this.tableName}`:"")}comments(){return this.queryComments.length?this.queryComments.map(R=>`/* ${R.comment} */`).join(" "):""}_aggregate(R,{aliasSeparator:M=" as ",distinctParentheses:D}={}){const z=R.value,q=R.method,j=R.aggregateDistinct?"distinct ":"",L=ne=>C(ne,void 0,this.builder,this.client,this.bindingsHolder),P=(ne,Q)=>Q?ne+M+L(Q):ne,H=(ne,Q)=>{let J=ne.map(L).join(", ");if(j){const oe=D?"(":" ",ee=D?")":"";J=j.trim()+oe+J+ee}const ie=`${q}(${J})`;return P(ie,Q)},G=(ne,Q)=>{const J=`${q}(${j+L(ne)})`;return P(J,Q)};if(Array.isArray(z))return[H(z)];if(typeof z=="object"){if(R.alias)throw new Error("When using an object explicit alias can not be used");return Object.entries(z).map(([ne,Q])=>Array.isArray(Q)?H(Q,ne):G(Q,ne))}const V=z.toLowerCase().indexOf(" as ");let B=z,{alias:K}=R;if(V!==-1){if(B=z.slice(0,V),K)throw new Error(`Found multiple aliases for same column: ${B}`);K=z.slice(V+4)}return[G(B,K)]}aggregate(R){return this._aggregate(R)}aggregateRaw(R){const M=R.aggregateDistinct?"distinct ":"";return`${R.method}(${M+T(R.value,void 0,this.builder,this.client,this.bindingsHolder)})`}_joinTable(R){return R.schema&&!(R.table instanceof n)?`${R.schema}.${R.table}`:R.table}join(){let R="",M=-1;const D=this.grouped.join;if(!D)return"";for(;++M<D.length;){const z=D[M],q=this._joinTable(z);if(M>0&&(R+=" "),z.joinType==="raw")R+=T(z.table,void 0,this.builder,this.client,this.bindingsHolder);else{R+=z.joinType+" join "+C(q,void 0,this.builder,this.client,this.bindingsHolder);let j=-1;for(;++j<z.clauses.length;){const L=z.clauses[j];j>0?R+=` ${L.bool} `:R+=` ${L.type==="onUsing"?"using":"on"} `;const P=this[L.type](L);P&&(R+=P)}}}return R}onBetween(R){return C(R.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+this._not(R,"between")+" "+R.value.map(M=>this.client.parameter(M,this.builder,this.bindingsHolder)).join(" and ")}onNull(R){return C(R.column,void 0,this.builder,this.client,this.bindingsHolder)+" is "+this._not(R,"null")}onExists(R){return this._not(R,"exists")+" ("+A(R.value,void 0,this.builder,this.client,this.bindingsHolder)+")"}onIn(R){if(Array.isArray(R.column))return this.multiOnIn(R);let M;return R.value instanceof n?M=this.client.parameter(R.value,this.builder,this.formatter):M=this.client.parameterize(R.value,void 0,this.builder,this.bindingsHolder),C(R.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+this._not(R,"in ")+this.wrap(M)}multiOnIn(R){let M=-1,D=`(${v(R.column,this.builder,this.client,this.bindingsHolder)}) `;for(D+=this._not(R,"in ")+"((";++M<R.value.length;)M!==0&&(D+="),("),D+=this.client.parameterize(R.value[M],void 0,this.builder,this.bindingsHolder);return D+"))"}where(){const R=this.grouped.where;if(!R)return;const M=[];let D=-1;for(;++D<R.length;){const z=R[D];Object.prototype.hasOwnProperty.call(z,"value")&&e.containsUndefined(z.value)&&(this.undefinedBindingsInfo.push(z.column),this._undefinedInWhereClause=!0);const q=this[z.type](z);q&&(M.length===0?M[0]="where":M.push(z.bool),M.push(q))}return M.length>1?M.join(" "):""}group(){return this._groupsOrders("group")}order(){return this._groupsOrders("order")}having(){const R=this.grouped.having;if(!R)return"";const M=["having"];for(let D=0,z=R.length;D<z;D++){const q=R[D],j=this[q.type](q);j&&(M.length===0&&(M[0]="where"),(M.length>1||M.length===1&&M[0]!=="having")&&M.push(q.bool),M.push(j))}return M.length>1?M.join(" "):""}havingRaw(R){return this._not(R,"")+T(R.value,void 0,this.builder,this.client,this.bindingsHolder)}havingWrapped(R){const M=A(R.value,"where",this.builder,this.client,this.bindingsHolder);return M&&this._not(R,"")+"("+M.slice(6)+")"||""}havingBasic(R){return this._not(R,"")+C(R.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+w(R.operator,this.builder,this.client,this.bindingsHolder)+" "+this.client.parameter(R.value,this.builder,this.bindingsHolder)}havingNull(R){return C(R.column,void 0,this.builder,this.client,this.bindingsHolder)+" is "+this._not(R,"null")}havingExists(R){return this._not(R,"exists")+" ("+A(R.value,void 0,this.builder,this.client,this.bindingsHolder)+")"}havingBetween(R){return C(R.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+this._not(R,"between")+" "+R.value.map(M=>this.client.parameter(M,this.builder,this.bindingsHolder)).join(" and ")}havingIn(R){return Array.isArray(R.column)?this.multiHavingIn(R):C(R.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+this._not(R,"in ")+this.wrap(this.client.parameterize(R.value,void 0,this.builder,this.bindingsHolder))}multiHavingIn(R){return this.multiOnIn(R)}union(){const R=this.onlyUnions(),M=this.grouped.union;if(!M)return"";let D="";for(let z=0,q=M.length;z<q;z++){const j=M[z];z>0&&(D+=" "),(z>0||!R)&&(D+=j.clause+" ");const L=A(j.value,void 0,this.builder,this.client,this.bindingsHolder);if(L){const P=j.wrap;P&&(D+="("),D+=L,P&&(D+=")")}}return D}onlyUnions(){return(!this.grouped.columns||!!this.grouped.columns[0].value)&&this.grouped.union&&!this.tableName}_getValueOrParameterFromAttribute(R,M){return this.single.skipBinding[R]===!0?M??this.single[R]:this.client.parameter(this.single[R],this.builder,this.bindingsHolder)}onlyJson(){return!this.tableName&&this.grouped.columns&&this.grouped.columns.length===1&&this.grouped.columns[0].type==="json"}limit(){return!this.single.limit&&this.single.limit!==0?"":`limit ${this._getValueOrParameterFromAttribute("limit")}`}offset(){return this.single.offset?`offset ${this._getValueOrParameterFromAttribute("offset")}`:""}del(){const{tableName:R}=this,M=this.with(),D=this.where(),z=this.join(),q=z?R+" ":"";return M+`delete ${q}from ${this.single.only?"only ":""}${R}`+(z?` ${z}`:"")+(D?` ${D}`:"")}truncate(){return`truncate ${this.tableName}`}lock(){if(this.single.lock)return this[this.single.lock]()}waitMode(){if(this.single.waitMode)return this[this.single.waitMode]()}skipLocked(){throw new Error(".skipLocked() is currently only supported on MySQL 8.0+ and PostgreSQL 9.5+")}noWait(){throw new Error(".noWait() is currently only supported on MySQL 8.0+, MariaDB 10.3.0+ and PostgreSQL 9.5+")}distinctOn(R){throw new Error(".distinctOn() is currently only supported on PostgreSQL")}onWrapped(R){const M=this,D=new s;R.value.call(D,D);let z="";for(let q=0;q<D.clauses.length;q++){const j=D.clauses[q];q>0&&(z+=` ${j.bool} `);const L=M[j.type](j);L&&(z+=L)}return z.length?`(${z})`:""}onBasic(R){const M=R.value instanceof r;return C(R.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+w(R.operator,this.builder,this.client,this.bindingsHolder)+" "+(M?"(":"")+C(R.value,void 0,this.builder,this.client,this.bindingsHolder)+(M?")":"")}onVal(R){return C(R.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+w(R.operator,this.builder,this.client,this.bindingsHolder)+" "+this.client.parameter(R.value,this.builder,this.bindingsHolder)}onRaw(R){return T(R.value,void 0,this.builder,this.client,this.bindingsHolder)}onUsing(R){return"("+v(R.column,this.builder,this.client,this.bindingsHolder)+")"}_valueClause(R){return R.asColumn?C(R.value,void 0,this.builder,this.client,this.bindingsHolder):this.client.parameter(R.value,this.builder,this.bindingsHolder)}_columnClause(R){let M;return Array.isArray(R.column)?M=`(${v(R.column,this.builder,this.client,this.bindingsHolder)})`:M=C(R.column,void 0,this.builder,this.client,this.bindingsHolder),M}whereIn(R){const M=this.client.values(R.value,this.builder,this.bindingsHolder);return`${this._columnClause(R)} ${this._not(R,"in ")}${M}`}whereLike(R){return`${this._columnClause(R)} ${this._not(R,"like ")}${this._valueClause(R)}`}whereILike(R){return`${this._columnClause(R)} ${this._not(R,"ilike ")}${this._valueClause(R)}`}whereNull(R){return C(R.column,void 0,this.builder,this.client,this.bindingsHolder)+" is "+this._not(R,"null")}whereBasic(R){return this._not(R,"")+C(R.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+w(R.operator,this.builder,this.client,this.bindingsHolder)+" "+this._valueClause(R)}whereExists(R){return this._not(R,"exists")+" ("+A(R.value,void 0,this.builder,this.client,this.bindingsHolder)+")"}whereWrapped(R){const M=A(R.value,"where",this.builder,this.client,this.bindingsHolder);return M&&this._not(R,"")+"("+M.slice(6)+")"||""}whereBetween(R){return C(R.column,void 0,this.builder,this.client,this.bindingsHolder)+" "+this._not(R,"between")+" "+R.value.map(M=>this.client.parameter(M,this.builder,this.bindingsHolder)).join(" and ")}whereRaw(R){return this._not(R,"")+T(R.value,void 0,this.builder,this.client,this.bindingsHolder)}_jsonWrapValue(R){if(!this.builder._isJsonObject(R))try{return JSON.stringify(JSON.parse(R.replace(/\n|\t/g,"")))}catch{return R}return JSON.stringify(R)}_jsonValueClause(R){return R.value=this._jsonWrapValue(R.value),this._valueClause(R)}whereJsonObject(R){return`${this._columnClause(R)} ${R.not?"!=":"="} ${this._jsonValueClause(R)}`}wrap(R){return R.charAt(0)!=="("?`(${R})`:R}json(R){return this[R.method](R.params)}analytic(R){let M="";const D=this;return M+=R.method+"() over (",R.raw?M+=R.raw:(R.partitions.length&&(M+="partition by ",M+=p(R.partitions,function(z){return E(z)?D.formatter.columnize(z):D.formatter.columnize(z.column)+(z.order?" "+z.order:"")}).join(", ")+" "),M+="order by ",M+=p(R.order,function(z){return E(z)?D.formatter.columnize(z):D.formatter.columnize(z.column)+(z.order?" "+z.order:"")}).join(", ")),M+=")",R.alias&&(M+=" as "+R.alias),M}with(){if(!this.grouped.with||!this.grouped.with.length)return"";const R=this.grouped.with;if(!R)return;const M=[];let D=-1,z=!1;for(;++D<R.length;){const q=R[D];q.recursive&&(z=!0);const j=this[q.type](q);M.push(j)}return`with ${z?"recursive ":""}${M.join(", ")} `}withWrapped(R){const M=A(R.value,void 0,this.builder,this.client,this.bindingsHolder),D=R.columnList?"("+v(R.columnList,this.builder,this.client,this.bindingsHolder)+")":"",z=R.materialized===void 0?"":R.materialized?"materialized ":"not materialized ";return M&&v(R.alias,this.builder,this.client,this.bindingsHolder)+D+" as "+z+"("+M+")"||""}_not(R,M){return R.not?`not ${M}`:M}_prepInsert(R){const M=A(R,void 0,this.builder,this.client,this.bindingsHolder);if(M)return M;let D=[];const z=[];Array.isArray(R)||(R=R?[R]:[]);let q=-1;for(;++q<R.length&&R[q]!=null;){q===0&&(D=Object.keys(R[q]).sort());const j=new Array(D.length),L=Object.keys(R[q]);let P=-1;for(;++P<L.length;){const H=L[P];let G=D.indexOf(H);if(G===-1){D=D.concat(H).sort(),G=D.indexOf(H);let V=-1;for(;++V<z.length;)z[V].splice(G,0,void 0);j.splice(G,0,void 0)}j[G]=R[q][H]}z.push(j)}return{columns:D,values:z}}_prepUpdate(R={}){const{counter:M={}}=this.single;for(const j of Object.keys(M)){if(h(R,j)){this.client.logger.warn("increment/decrement called for a column that has already been specified in main .update() call. Ignoring increment/decrement and using value from .update() call.");continue}let L=M[j];const P=L<0?"-":"+";P==="-"&&(L=-L),R[j]=this.client.raw(`?? ${P} ?`,[j,L])}R=d(R,x);const D=[],z=Object.keys(R);let q=-1;for(;++q<z.length;)D.push(C(z[q],void 0,this.builder,this.client,this.bindingsHolder)+" = "+this.client.parameter(R[z[q]],this.builder,this.bindingsHolder));if(f(D))throw new Error(["Empty .update() call detected!","Update data does not contain any values to update.","This will result in a faulty query.",this.single.table?`Table: ${this.single.table}.`:"",this.single.update?`Columns: ${Object.keys(this.single.update)}.`:""].join(" "));return D}_formatGroupsItemValue(R,M){const{formatter:D}=this;let z="";M==="last"?z=" is null":M==="first"&&(z=" is not null");let q;return R instanceof n?q=T(R,void 0,this.builder,this.client,this.bindingsHolder):R instanceof r||M?q="("+D.columnize(R)+z+")":q=D.columnize(R),q}_basicGroupOrder(R,M){const D=this._formatGroupsItemValue(R.value,R.nulls),z=M==="order"&&R.type!=="orderByRaw"?` ${b(R.direction,this.builder,this.client,this.bindingsHolder)}`:"";return D+z}_groupOrder(R,M){return this._basicGroupOrder(R,M)}_groupOrderNulls(R,M){const D=this._formatGroupsItemValue(R.value),z=M==="order"&&R.type!=="orderByRaw"?` ${b(R.direction,this.builder,this.client,this.bindingsHolder)}`:"";return R.nulls&&!(R.value instanceof n)?`${D}${z||""} nulls ${R.nulls}`:D+z}_groupsOrders(R){const M=this.grouped[R];if(!M)return"";const D=M.map(z=>this._groupOrder(z,R));return D.length?R+" by "+D.join(", "):""}get tableName(){if(!this._tableName){let R=this.single.table;const M=this.single.schema;if(R&&M){const D=R instanceof r,z=R instanceof n;!D&&!z&&!(typeof R=="function")&&(R=`${M}.${R}`)}this._tableName=R?C(R,R instanceof r,this.builder,this.client,this.bindingsHolder):""}return this._tableName}_jsonPathWrap(R){return this.client.parameter(R.path||R[1],this.builder,this.bindingsHolder)}_jsonExtract(R,M){let D;return Array.isArray(M.column)?D=M.column:D=[M],Array.isArray(R)||(R=[R]),D.map(z=>{let q=`${v(z.column||z[0],this.builder,this.client,this.bindingsHolder)}, ${this._jsonPathWrap(z)}`;R.forEach(L=>{q=L+"("+q+")"});const j=z.alias||z[2];return j?this.client.alias(q,this.formatter.wrap(j)):q}).join(", ")}_jsonSet(R,M){const D=`${R}(${v(M.column,this.builder,this.client,this.bindingsHolder)}, ${this.client.parameter(M.path,this.builder,this.bindingsHolder)}, ${this.client.parameter(M.value,this.builder,this.bindingsHolder)})`;return M.alias?this.client.alias(D,this.formatter.wrap(M.alias)):D}_whereJsonPath(R,M){return`${R}(${this._columnClause(M)}, ${this._jsonPathWrap({path:M.jsonPath})}) ${w(M.operator,this.builder,this.client,this.bindingsHolder)} ${this._jsonValueClause(M)}`}_onJsonPathEquals(R,M){return R+"("+C(M.columnFirst,void 0,this.builder,this.client,this.bindingsHolder)+", "+this.client.parameter(M.jsonPathFirst,this.builder,this.bindingsHolder)+") = "+R+"("+C(M.columnSecond,void 0,this.builder,this.client,this.bindingsHolder)+", "+this.client.parameter(M.jsonPathSecond,this.builder,this.bindingsHolder)+")"}}return A0=I,A0}var N0,pL;function hP(){if(pL)return N0;pL=1;const{EventEmitter:e}=Zs(),n=Tl(),r=ea(),{addQueryContext:s}=Qt(),a=dx(),{augmentWithBuilderInterface:o}=px();class l extends e{constructor(h){super(),this.client=h,this._sequence=[],h.config&&(this._debug=h.config.debug,a(this,4))}withSchema(h){return this._schema=h,this}toString(){return this.toQuery()}toSQL(){return this.client.schemaCompiler(this).toSQL()}async generateDdlCommands(){return await this.client.schemaCompiler(this).generateDdlCommands()}}return["createTable","createTableIfNotExists","createTableLike","createView","createViewOrReplace","createMaterializedView","refreshMaterializedView","dropView","dropViewIfExists","dropMaterializedView","dropMaterializedViewIfExists","createSchema","createSchemaIfNotExists","dropSchema","dropSchemaIfExists","createExtension","createExtensionIfNotExists","dropExtension","dropExtensionIfExists","table","alterTable","view","alterView","hasTable","hasColumn","dropTable","renameTable","renameView","dropTableIfExists","raw"].forEach(function(u){l.prototype[u]=function(){return u==="createTableIfNotExists"&&this.client.logger.warn(["Use async .hasTable to check if table exists and then use plain .createTable. Since ",'.createTableIfNotExists actually just generates plain "CREATE TABLE IF NOT EXIST..." ',"query it will not work correctly if there are any alter table queries generated for ","columns afterwards. To not break old migrations this function is left untouched for now",", but it should not be used when writing new code and it is removed from documentation."].join("")),u==="table"&&(u="alterTable"),u==="view"&&(u="alterView"),this._sequence.push({method:u,args:n(arguments)}),this}}),l.extend=(u,h)=>{if(Object.prototype.hasOwnProperty.call(l.prototype,u))throw new Error(`Can't extend SchemaBuilder with existing method ('${u}').`);r(l.prototype,{[u]:h})},o(l),s(l),N0=l,N0}var R0,mL;function qh(){if(mL)return R0;mL=1;const e=Sh(),{isString:n}=mt();function r(o){o&&(n(o)&&(o={sql:o}),o.bindings||(o.bindings=this.bindingsHolder.bindings),this.sequence.push(o),this.formatter=this.client.formatter(this._commonBuilder),this.bindings=[],this.formatter.bindings=this.bindings)}function s(o){const l=new this.constructor(this.client,this.tableCompiler,this.columnBuilder);o.call(l,e(arguments)),this.sequence.additional=(this.sequence.additional||[]).concat(l.sequence)}function a(o){o&&(n(o)&&(o={sql:o}),o.bindings||(o.bindings=this.bindingsHolder.bindings),this.sequence.unshift(o),this.formatter=this.client.formatter(this._commonBuilder),this.bindings=[],this.formatter.bindings=this.bindings)}return R0={pushAdditional:s,pushQuery:r,unshiftQuery:a},R0}var O0,gL;function No(){if(gL)return O0;gL=1;const{pushQuery:e,pushAdditional:n,unshiftQuery:r}=qh();class s{constructor(p,d){this.builder=d,this._commonBuilder=this.builder,this.client=p,this.schema=d._schema,this.bindings=[],this.bindingsHolder=this,this.formatter=p.formatter(d),this.formatter.bindings=this.bindings,this.sequence=[]}createSchema(){h("createSchema")}createSchemaIfNotExists(){h("createSchemaIfNotExists")}dropSchema(){h("dropSchema")}dropSchemaIfExists(){h("dropSchemaIfExists")}dropTable(p){this.pushQuery(this.dropTablePrefix+this.formatter.wrap(u(this.schema,p)))}dropTableIfExists(p){this.pushQuery(this.dropTablePrefix+"if exists "+this.formatter.wrap(u(this.schema,p)))}dropView(p){this._dropView(p,!1,!1)}dropViewIfExists(p){this._dropView(p,!0,!1)}dropMaterializedView(p){throw new Error("materialized views are not supported by this dialect.")}dropMaterializedViewIfExists(p){throw new Error("materialized views are not supported by this dialect.")}renameView(p,d){throw new Error("rename view is not supported by this dialect (instead drop then create another view).")}refreshMaterializedView(){throw new Error("materialized views are not supported by this dialect.")}_dropView(p,d,g){this.pushQuery((g?this.dropMaterializedViewPrefix:this.dropViewPrefix)+(d?"if exists ":"")+this.formatter.wrap(u(this.schema,p)))}raw(p,d){this.sequence.push(this.client.raw(p,d).toSQL())}toSQL(){const p=this.builder._sequence;for(let d=0,g=p.length;d<g;d++){const y=p[d];this[y.method].apply(this,y.args)}return this.sequence}async generateDdlCommands(){const p=this.toSQL();return{pre:[],sql:Array.isArray(p)?p:[p],check:null,post:[]}}}s.prototype.dropTablePrefix="drop table ",s.prototype.dropViewPrefix="drop view ",s.prototype.dropMaterializedViewPrefix="drop materialized view ",s.prototype.alterViewPrefix="alter view ",s.prototype.alterTable=o("alter"),s.prototype.createTable=o("create"),s.prototype.createTableIfNotExists=o("createIfNot"),s.prototype.createTableLike=o("createLike"),s.prototype.createView=l("create"),s.prototype.createViewOrReplace=l("createOrReplace"),s.prototype.createMaterializedView=l("createMaterializedView"),s.prototype.alterView=l("alter"),s.prototype.pushQuery=e,s.prototype.pushAdditional=n,s.prototype.unshiftQuery=r;function a(f){const p=this.builder.queryContext();p!==void 0&&f.queryContext()===void 0&&f.queryContext(p),f.setSchema(this.schema);const d=f.toSQL();for(let g=0,y=d.length;g<y;g++)this.sequence.push(d[g])}function o(f){return f==="createLike"?function(p,d,g){const y=this.client.tableBuilder(f,p,d,g);a.call(this,y)}:function(p,d){const g=this.client.tableBuilder(f,p,null,d);a.call(this,g)}}function l(f){return function(p,d){const g=this.client.viewBuilder(f,p,d);a.call(this,g)}}function u(f,p){return f?`${f}.${p}`:p}function h(f){throw new Error(`${f} is not supported for this dialect (only PostgreSQL supports it currently).`)}return O0=s,O0}var M0,yL;function VK(){if(yL)return M0;yL=1;var e=Ys(),n=ox(),r=Xi(),s=n(function(a,o){e(o,r(o),a)});return M0=s,M0}var j0,vL;function Ah(){return vL||(vL=1,j0=VK()),j0}var L0,bL;function dP(){if(bL)return L0;bL=1;const e=Ws(),n=Ah(),r=ea(),s=Tl(),a=Qt(),{isString:o,isFunction:l,isObject:u}=mt();class h{constructor(y,E,x,v,b){if(this.client=y,this._fn=b,this._method=E,this._schemaName=void 0,this._tableName=x,this._tableNameLike=v,this._statements=[],this._single={},!v&&!l(this._fn))throw new TypeError("A callback function must be supplied to calls against `.createTable` and `.table`")}setSchema(y){this._schemaName=y}toSQL(){return this._method==="alter"&&n(this,d),this._fn&&this._fn.call(this,this),this.client.tableCompiler(this).toSQL()}timestamps(y,E,x){u(y)&&({useTimestamps:y,defaultToNow:E,useCamelCase:x}=y);const v=y===!0?"timestamp":"datetime",b=this[v](x?"createdAt":"created_at"),w=this[v](x?"updatedAt":"updated_at");if(E===!0){const C=this.client.raw("CURRENT_TIMESTAMP");b.notNullable().defaultTo(C),w.notNullable().defaultTo(C)}}comment(y){if(typeof y!="string")throw new TypeError("Table comment must be string");this._single.comment=y}foreign(y,E){const x={column:y,keyName:E};this._statements.push({grouping:"alterTable",method:"foreign",args:[x]});let v={references(b){let w;return o(b)&&(w=b.split(".")),!w||w.length===1?(x.references=w?w[0]:b,{on(C){if(typeof C!="string")throw new TypeError(`Expected tableName to be a string, got: ${typeof C}`);return x.inTable=C,v},inTable(){return this.on.apply(this,arguments)}}):(x.inTable=w[0],x.references=w[1],v)},withKeyName(b){return x.keyName=b,v},onUpdate(b){return x.onUpdate=b,v},onDelete(b){return x.onDelete=b,v},deferrable:b=>{if(["mysql","mssql","redshift","mysql2","oracledb"].indexOf(this.client.dialect)!==-1)throw new Error(`${this.client.dialect} does not support deferrable`);return x.deferrable=b,v},_columnBuilder(b){return n(b,v),v=b,b}};return v}check(y,E,x){return this._statements.push({grouping:"checks",args:[y,E,x]}),this}}["index","primary","unique","dropPrimary","dropUnique","dropIndex","dropForeign"].forEach(g=>{h.prototype[g]=function(){return this._statements.push({grouping:"alterTable",method:g,args:s(arguments)}),this}}),e({mysql:["engine","charset","collate"],postgresql:["inherits"]},function(g,y){g.forEach(function(E){h.prototype[E]=function(x){if(this.client.dialect!==y)throw new Error(`Knex only supports ${E} statement with ${y}.`);if(this._method==="alter")throw new Error(`Knex does not support altering the ${E} outside of create table, please use knex.raw statement.`);this._single[E]=x}})}),a.addQueryContext(h),["tinyint","smallint","mediumint","int","bigint","decimal","float","double","real","bit","boolean","serial","date","datetime","timestamp","time","year","geometry","geography","point","char","varchar","tinytext","tinyText","text","mediumtext","mediumText","longtext","longText","binary","varbinary","tinyblob","tinyBlob","mediumblob","mediumBlob","blob","longblob","longBlob","enum","set","bool","dateTime","increments","bigincrements","bigIncrements","integer","biginteger","bigInteger","string","json","jsonb","uuid","enu","specificType"].forEach(g=>{h.prototype[g]=function(){const y=s(arguments),E=this.client.columnBuilder(this,g,y);return this._statements.push({grouping:"columns",builder:E}),E}});const d={renameColumn(g,y){return this._statements.push({grouping:"alterTable",method:"renameColumn",args:[g,y]}),this},dropTimestamps(){return this.dropColumns(arguments[0]===!0?["createdAt","updatedAt"]:["created_at","updated_at"])},setNullable(g){return this._statements.push({grouping:"alterTable",method:"setNullable",args:[g]}),this},check(g,y,E){this._statements.push({grouping:"alterTable",method:"check",args:[g,y,E]})},dropChecks(){this._statements.push({grouping:"alterTable",method:"dropChecks",args:s(arguments)})},dropNullable(g){return this._statements.push({grouping:"alterTable",method:"dropNullable",args:[g]}),this}};return d.dropColumn=d.dropColumns=function(){return this._statements.push({grouping:"alterTable",method:"dropColumn",args:s(arguments)}),this},h.extend=(g,y)=>{if(Object.prototype.hasOwnProperty.call(h.prototype,g))throw new Error(`Can't extend TableBuilder with existing method ('${g}').`);r(h.prototype,{[g]:y})},L0=h,L0}var $0,_L;function FK(){if(_L)return $0;_L=1;var e=PB(),n=sx(),r=Math.max;function s(a,o,l){var u=a==null?0:a.length;if(!u)return-1;var h=l==null?0:n(l);return h<0&&(h=r(u+h,0)),e(a,o,h)}return $0=s,$0}var I0,wL;function Ro(){if(wL)return I0;wL=1;const{pushAdditional:e,pushQuery:n,unshiftQuery:r}=qh(),s=Qt(),a=Th(),o=FK(),l=qn(),u=Sh(),{normalizeArr:h}=Qt();class f{constructor(d,g){this.client=d,this.tableBuilder=g,this._commonBuilder=this.tableBuilder,this.method=g._method,this.schemaNameRaw=g._schemaName,this.tableNameRaw=g._tableName,this.tableNameLikeRaw=g._tableNameLike,this.single=g._single,this.grouped=a(g._statements,"grouping"),this.formatter=d.formatter(g),this.bindings=[],this.formatter.bindings=this.bindings,this.bindingsHolder=this,this.sequence=[],this._formatting=d.config&&d.config.formatting,this.checksCount=0}toSQL(){return this[this.method](),this.sequence}create(d,g){const E=this.getColumns().map(v=>v.toSQL()),x=this.getColumnTypes(E);this.createAlterTableMethods&&this.alterTableForCreate(x),this.createQuery(x,d,g),this.columnQueries(E),delete this.single.comment,this.alterTable()}createIfNot(){this.create(!0)}createLike(){this.create(!1,!0)}createLikeIfNot(){this.create(!0,!0)}alter(){const g=this.getColumns().map(b=>b.toSQL()),y=this.getColumns("alter"),E=y.map(b=>b.toSQL()),x=this.getColumnTypes(g),v=this.getColumnTypes(E);this.addColumns(x),this.alterColumns(v,y),this.columnQueries(g),this.columnQueries(E),this.alterTable()}foreign(d){if(d.inTable&&d.references){const g=d.keyName?this.formatter.wrap(d.keyName):this._indexCommand("foreign",this.tableNameRaw,d.column),y=this.formatter.columnize(d.column),E=this.formatter.columnize(d.references),x=this.formatter.wrap(d.inTable),v=d.onUpdate?(this.lowerCase?" on update ":" ON UPDATE ")+d.onUpdate:"",b=d.onDelete?(this.lowerCase?" on delete ":" ON DELETE ")+d.onDelete:"",w=d.deferrable?this.lowerCase?` deferrable initially ${d.deferrable.toLowerCase()} `:` DEFERRABLE INITIALLY ${d.deferrable.toUpperCase()} `:"";this.lowerCase?this.pushQuery((this.forCreate?"":`alter table ${this.tableName()} add `)+"constraint "+g+" foreign key ("+y+") references "+x+" ("+E+")"+v+b+w):this.pushQuery((this.forCreate?"":`ALTER TABLE ${this.tableName()} ADD `)+"CONSTRAINT "+g+" FOREIGN KEY ("+y+") REFERENCES "+x+" ("+E+")"+v+b+w)}}getColumnTypes(d){return d.reduce(function(g,y){const E=y[0];return g.sql.push(E.sql),g.bindings.concat(E.bindings),g},{sql:[],bindings:[]})}columnQueries(d){const g=d.reduce(function(y,E){const x=u(E);return l(x)?y:y.concat(x)},[]);for(const y of g)this.pushQuery(y)}addColumns(d,g){if(g=g||this.addColumnsPrefix,d.sql.length>0){const y=d.sql.map(E=>g+E);this.pushQuery({sql:(this.lowerCase?"alter table ":"ALTER TABLE ")+this.tableName()+" "+y.join(", "),bindings:d.bindings})}}alterColumns(d,g){d.sql.length>0&&this.addColumns(d,this.alterColumnsPrefix,g)}getColumns(d){const g=this.grouped.columns||[];d=d||"add";const y=this.tableBuilder.queryContext();return g.filter(E=>E.builder._method===d).map(E=>(y!==void 0&&E.builder.queryContext()===void 0&&E.builder.queryContext(y),this.client.columnCompiler(this,E.builder)))}tableName(){const d=this.schemaNameRaw?`${this.schemaNameRaw}.${this.tableNameRaw}`:this.tableNameRaw;return this.formatter.wrap(d)}tableNameLike(){const d=this.schemaNameRaw?`${this.schemaNameRaw}.${this.tableNameLikeRaw}`:this.tableNameLikeRaw;return this.formatter.wrap(d)}alterTable(){const d=this.grouped.alterTable||[];for(let g=0,y=d.length;g<y;g++){const E=d[g];this[E.method]?this[E.method].apply(this,E.args):this.client.logger.error(`Debug: ${E.method} does not exist`)}for(const g in this.single)typeof this[g]=="function"&&this[g](this.single[g])}alterTableForCreate(d){this.forCreate=!0;const g=this.sequence,y=this.grouped.alterTable||[];this.grouped.alterTable=[];for(let E=0,x=y.length;E<x;E++){const v=y[E];if(o(this.createAlterTableMethods,v.method)<0){this.grouped.alterTable.push(v);continue}this[v.method]?(this.sequence=[],this[v.method].apply(this,v.args),d.sql.push(this.sequence[0].sql)):this.client.logger.error(`Debug: ${v.method} does not exist`)}this.sequence=g,this.forCreate=!1}dropIndex(d){this.pushQuery(`drop index${d}`)}dropUnique(){throw new Error("Method implemented in the dialect driver")}dropForeign(){throw new Error("Method implemented in the dialect driver")}dropColumn(){const d=s.normalizeArr.apply(null,arguments),g=(Array.isArray(d)?d:[d]).map(y=>this.dropColumnPrefix+this.formatter.wrap(y));this.pushQuery((this.lowerCase?"alter table ":"ALTER TABLE ")+this.tableName()+" "+g.join(", "))}_setNullableState(d,g){const y=this.tableName(),E=this.formatter.columnize(d),x=this.alterColumnsPrefix;return this.pushQuery({sql:"SELECT 1",output:()=>this.client.queryBuilder().from(this.tableNameRaw).columnInfo(d).then(v=>{if(l(v))throw new Error(`.setNullable: Column ${E} does not exist in table ${y}.`);const b=g?"null":"not null",w=v.type+(v.maxLength?`(${v.maxLength})`:""),C=v.defaultValue!==null&&v.defaultValue!==void 0?`default '${v.defaultValue}'`:"",T=`alter table ${y} ${x} ${E} ${w} ${b} ${C}`;return this.client.raw(T)})})}setNullable(d){return this._setNullableState(d,!0)}dropNullable(d){return this._setNullableState(d,!1)}dropChecks(d){if(d===void 0)return"";d=h(d);const y=`alter table ${this.tableName()} ${d.map(E=>`drop constraint ${E}`).join(", ")}`;this.pushQuery(y)}check(d,g,y){const E=this.tableName();let x=y;x||(this.checksCount++,x=E+"_"+this.checksCount);const v=`alter table ${E} add constraint ${x} check(${d})`;this.pushQuery(v)}_addChecks(){return this.grouped.checks?", "+this.grouped.checks.map(d=>`${d.args[2]?"constraint "+d.args[2]+" ":""}check (${this.client.raw(d.args[0],d.args[1])})`).join(", "):""}_indexCommand(d,g,y){Array.isArray(y)||(y=y?[y]:[]);const x=(g.replace(/\.|-/g,"_")+"_"+y.join("_")+"_"+d).toLowerCase();return this.formatter.wrap(x)}_getPrimaryKeys(){return(this.grouped.alterTable||[]).filter(d=>d.method==="primary").flatMap(d=>d.args).flat()}_canBeAddPrimaryKey(d){return d.primaryKey&&this._getPrimaryKeys().length===0}_getIncrementsColumnNames(){return this.grouped.columns.filter(d=>d.builder._type==="increments").map(d=>d.builder._args[0])}_getBigIncrementsColumnNames(){return this.grouped.columns.filter(d=>d.builder._type==="bigincrements").map(d=>d.builder._args[0])}}return f.prototype.pushQuery=n,f.prototype.pushAdditional=e,f.prototype.unshiftQuery=r,f.prototype.lowerCase=!0,f.prototype.createAlterTableMethods=null,f.prototype.addColumnsPrefix="add column ",f.prototype.alterColumnsPrefix="alter column ",f.prototype.modifyColumnPrefix="modify column ",f.prototype.dropColumnPrefix="drop column ",I0=f,I0}var D0,EL;function Nh(){if(EL)return D0;EL=1;const e=Ah(),n=ea(),r=Tl(),{addQueryContext:s}=Qt();class a{constructor(p,d,g,y){this.client=p,this._method="add",this._single={},this._modifiers={},this._statements=[],this._type=h[g]||g,this._args=y,this._tableBuilder=d,d._method==="alter"&&e(this,u)}references(p){return this._tableBuilder.foreign.call(this._tableBuilder,this._args[0],void 0,this)._columnBuilder(this).references(p)}}const o=["default","defaultsTo","defaultTo","unsigned","nullable","first","after","comment","collate","check","checkPositive","checkNegative","checkIn","checkNotIn","checkBetween","checkLength","checkRegex"],l={default:"defaultTo",defaultsTo:"defaultTo"};o.forEach(function(f){const p=l[f]||f;a.prototype[f]=function(){return this._modifiers[p]=r(arguments),this}}),s(a),a.prototype.notNull=a.prototype.notNullable=function(){return this.nullable(!1)},["index","primary","unique"].forEach(function(f){a.prototype[f]=function(){return this._type.toLowerCase().indexOf("increments")===-1&&this._tableBuilder[f].apply(this._tableBuilder,[this._args[0]].concat(r(arguments))),this}}),a.extend=(f,p)=>{if(Object.prototype.hasOwnProperty.call(a.prototype,f))throw new Error(`Can't extend ColumnBuilder with existing method ('${f}').`);n(a.prototype,{[f]:p})};const u={};u.drop=function(){return this._single.drop=!0,this},u.alterType=function(f){return this._statements.push({grouping:"alterType",value:f}),this},u.alter=function({alterNullable:f=!0,alterType:p=!0}={}){return this._method="alter",this.alterNullable=f,this.alterType=p,this};const h={float:"floating",enum:"enu",boolean:"bool",string:"varchar",bigint:"bigInteger"};return D0=a,D0}var k0,CL;function GK(){if(CL)return k0;CL=1;function e(n){return n&&n.length?n[0]:void 0}return k0=e,k0}var B0,xL;function KK(){return xL||(xL=1,B0=GK()),B0}var P0,SL;function ra(){if(SL)return P0;SL=1;const e=qh(),n=Th(),r=KK(),s=To(),a=Sh(),{toNumber:o}=Qt(),{formatDefault:l}=ta(),{operator:u}=Vt();class h{constructor(p,d,g){this.client=p,this.tableCompiler=d,this.columnBuilder=g,this._commonBuilder=this.columnBuilder,this.args=g._args,this.type=g._type.toLowerCase(),this.grouped=n(g._statements,"grouping"),this.modified=g._modifiers,this.isIncrements=this.type.indexOf("increments")!==-1,this.formatter=p.formatter(g),this.bindings=[],this.formatter.bindings=this.bindings,this.bindingsHolder=this,this.sequence=[],this.modifiers=[],this.checksCount=0}_addCheckModifiers(){this.modifiers.push("check","checkPositive","checkNegative","checkIn","checkNotIn","checkBetween","checkLength","checkRegex")}defaults(p){if(Object.prototype.hasOwnProperty.call(this._defaultMap,p))return this._defaultMap[p].bind(this)();throw new Error(`There is no default for the specified identifier ${p}`)}toSQL(){return this.pushQuery(this.compileColumn()),this.sequence.additional&&(this.sequence=this.sequence.concat(this.sequence.additional)),this.sequence}compileColumn(){return this.formatter.wrap(this.getColumnName())+" "+this.getColumnType()+this.getModifiers()}getColumnName(){return r(this.args)||this.defaults("columnName")}getColumnType(){if(!this._columnType){const p=this[this.type];this._columnType=typeof p=="function"?p.apply(this,a(this.args)):p}return this._columnType}getModifiers(){const p=[];for(let d=0,g=this.modifiers.length;d<g;d++){const y=this.modifiers[d];if((!this.isIncrements||this.isIncrements&&y==="comment")&&s(this.modified,y)){const E=this[y].apply(this,this.modified[y]);E&&p.push(E)}}return p.length>0?` ${p.join(" ")}`:""}varchar(p){return`varchar(${o(p,255)})`}floating(p,d){return`float(${o(p,8)}, ${o(d,2)})`}decimal(p,d){if(p===null)throw new Error("Specifying no precision on decimal columns is not supported for that SQL dialect.");return`decimal(${o(p,8)}, ${o(d,2)})`}specifictype(p){return p}nullable(p){return p===!1?"not null":"null"}notNullable(){return this.nullable(!1)}defaultTo(p){return`default ${l(p,this.type,this.client)}`}increments(p={primaryKey:!0}){return"integer not null"+(this.tableCompiler._canBeAddPrimaryKey(p)?" primary key":"")+" autoincrement"}bigincrements(p={primaryKey:!0}){return this.increments(p)}_pushAlterCheckQuery(p,d){let g=d;g||(this.checksCount++,g=this.tableCompiler.tableNameRaw+"_"+this.getColumnName()+"_"+this.checksCount),this.pushAdditional(function(){this.pushQuery(`alter table ${this.tableCompiler.tableName()} add constraint ${g} check(${p})`)})}_checkConstraintName(p){return p?`constraint ${p} `:""}_check(p,d){return this.columnBuilder._method==="alter"?(this._pushAlterCheckQuery(p,d),""):`${this._checkConstraintName(d)}check (${p})`}checkPositive(p){return this._check(`${this.formatter.wrap(this.getColumnName())} ${u(">",this.columnBuilder,this.bindingsHolder)} 0`,p)}checkNegative(p){return this._check(`${this.formatter.wrap(this.getColumnName())} ${u("<",this.columnBuilder,this.bindingsHolder)} 0`,p)}_checkIn(p,d,g){return this._check(`${this.formatter.wrap(this.getColumnName())} ${g?"not ":""}in (${p.map(y=>this.client._escapeBinding(y)).join(",")})`,d)}checkIn(p,d){return this._checkIn(p,d)}checkNotIn(p,d){return this._checkIn(p,d,!0)}checkBetween(p,d){p.length===2&&!Array.isArray(p[0])&&!Array.isArray(p[1])&&(p=[p]);const g=p.map(y=>`${this.formatter.wrap(this.getColumnName())} between ${this.client._escapeBinding(y[0])} and ${this.client._escapeBinding(y[1])}`).join(" or ");return this._check(g,d)}checkLength(p,d,g){return this._check(`length(${this.formatter.wrap(this.getColumnName())}) ${u(p,this.columnBuilder,this.bindingsHolder)} ${o(d)}`,g)}}return h.prototype.binary="blob",h.prototype.bool="boolean",h.prototype.date="date",h.prototype.datetime="datetime",h.prototype.time="time",h.prototype.timestamp="timestamp",h.prototype.geometry="geometry",h.prototype.geography="geography",h.prototype.point="point",h.prototype.enu="varchar",h.prototype.bit=h.prototype.json="text",h.prototype.uuid=({useBinaryUuid:f=!1,primaryKey:p=!1}={})=>f?"binary(16)":"char(36)",h.prototype.integer=h.prototype.smallint=h.prototype.mediumint="integer",h.prototype.biginteger="bigint",h.prototype.text="text",h.prototype.tinyint="tinyint",h.prototype.pushQuery=e.pushQuery,h.prototype.pushAdditional=e.pushAdditional,h.prototype.unshiftQuery=e.unshiftQuery,h.prototype._defaultMap={columnName:function(){if(!this.isIncrements)throw new Error(`You did not specify a column name for the ${this.type} column.`);return"id"}},P0=h,P0}var z0,TL;function YK(){if(TL)return z0;TL=1;const e=Ao();class n extends e{constructor(s,a){super(s),this.ref=a,this._schema=null,this._alias=null}withSchema(s){return this._schema=s,this}as(s){return this._alias=s,this}toSQL(){const s=this._schema?`${this._schema}.${this.ref}`:this.ref,a=this.client.formatter(this),o=a.columnize(s),l=this._alias?`${o} as ${a.wrap(this._alias)}`:o;return this.set(l,[]),super.toSQL(...arguments)}}return z0=n,z0}var U0,qL;function Rh(){if(qL)return U0;qL=1;const{columnize:e,wrap:n}=Vt();class r{constructor(a,o){this.client=a,this.builder=o,this.bindings=[]}columnize(a){return e(a,this.builder,this.client,this)}wrap(a,o){return n(a,o,this.builder,this.client,this)}}return U0=r,U0}var $e={},AL;function XK(){if(AL)return $e;AL=1,Object.defineProperty($e,"__esModule",{value:!0});var e=nt;function n(Oe){if(Oe&&Oe.__esModule)return Oe;var Xe=Object.create(null);return Oe&&Object.keys(Oe).forEach(function(We){if(We!=="default"){var rt=Object.getOwnPropertyDescriptor(Oe,We);Object.defineProperty(Xe,We,rt.get?rt:{enumerable:!0,get:function(){return Oe[We]}})}}),Xe.default=Oe,Object.freeze(Xe)}var r=n(e);const{env:s={},argv:a=[],platform:o=""}=typeof process>"u"?{}:process,l="NO_COLOR"in s||a.includes("--no-color"),u="FORCE_COLOR"in s||a.includes("--color"),h=o==="win32",f=s.TERM==="dumb",p=r&&r.isatty&&r.isatty(1)&&s.TERM&&!f,d="CI"in s&&("GITHUB_ACTIONS"in s||"GITLAB_CI"in s||"CIRCLECI"in s),g=!l&&(u||h&&!f||p||d),y=(Oe,Xe,We,rt,de=Xe.substring(0,Oe)+rt,X=Xe.substring(Oe+We.length),Me=X.indexOf(We))=>de+(Me<0?X:y(Me,X,We,rt)),E=(Oe,Xe,We,rt,de)=>Oe<0?We+Xe+rt:We+y(Oe,Xe,rt,de)+rt,x=(Oe,Xe,We=Oe,rt=Oe.length+1)=>de=>de||!(de===""||de===void 0)?E((""+de).indexOf(Xe,rt),de,Oe,Xe,We):"",v=(Oe,Xe,We)=>x(`\x1B[${Oe}m`,`\x1B[${Xe}m`,We),b={reset:v(0,0),bold:v(1,22,"\x1B[22m\x1B[1m"),dim:v(2,22,"\x1B[22m\x1B[2m"),italic:v(3,23),underline:v(4,24),inverse:v(7,27),hidden:v(8,28),strikethrough:v(9,29),black:v(30,39),red:v(31,39),green:v(32,39),yellow:v(33,39),blue:v(34,39),magenta:v(35,39),cyan:v(36,39),white:v(37,39),gray:v(90,39),bgBlack:v(40,49),bgRed:v(41,49),bgGreen:v(42,49),bgYellow:v(43,49),bgBlue:v(44,49),bgMagenta:v(45,49),bgCyan:v(46,49),bgWhite:v(47,49),blackBright:v(90,39),redBright:v(91,39),greenBright:v(92,39),yellowBright:v(93,39),blueBright:v(94,39),magentaBright:v(95,39),cyanBright:v(96,39),whiteBright:v(97,39),bgBlackBright:v(100,49),bgRedBright:v(101,49),bgGreenBright:v(102,49),bgYellowBright:v(103,49),bgBlueBright:v(104,49),bgMagentaBright:v(105,49),bgCyanBright:v(106,49),bgWhiteBright:v(107,49)},w=({useColor:Oe=g}={})=>Oe?b:Object.keys(b).reduce((Xe,We)=>({...Xe,[We]:String}),{}),{reset:C,bold:T,dim:A,italic:N,underline:O,inverse:I,hidden:k,strikethrough:R,black:M,red:D,green:z,yellow:q,blue:j,magenta:L,cyan:P,white:H,gray:G,bgBlack:V,bgRed:B,bgGreen:K,bgYellow:ne,bgBlue:Q,bgMagenta:J,bgCyan:ie,bgWhite:oe,blackBright:ee,redBright:fe,greenBright:be,yellowBright:ve,blueBright:_e,magentaBright:we,cyanBright:W,whiteBright:ae,bgBlackBright:xe,bgRedBright:Se,bgGreenBright:gt,bgYellowBright:ut,bgBlueBright:It,bgMagentaBright:Tt,bgCyanBright:qt,bgWhiteBright:Fe}=w();return $e.bgBlack=V,$e.bgBlackBright=xe,$e.bgBlue=Q,$e.bgBlueBright=It,$e.bgCyan=ie,$e.bgCyanBright=qt,$e.bgGreen=K,$e.bgGreenBright=gt,$e.bgMagenta=J,$e.bgMagentaBright=Tt,$e.bgRed=B,$e.bgRedBright=Se,$e.bgWhite=oe,$e.bgWhiteBright=Fe,$e.bgYellow=ne,$e.bgYellowBright=ut,$e.black=M,$e.blackBright=ee,$e.blue=j,$e.blueBright=_e,$e.bold=T,$e.createColors=w,$e.cyan=P,$e.cyanBright=W,$e.dim=A,$e.gray=G,$e.green=z,$e.greenBright=be,$e.hidden=k,$e.inverse=I,$e.isColorSupported=g,$e.italic=N,$e.magenta=L,$e.magentaBright=we,$e.red=D,$e.redBright=fe,$e.reset=C,$e.strikethrough=R,$e.underline=O,$e.white=H,$e.whiteBright=ae,$e.yellow=q,$e.yellowBright=ve,$e}var Q0,NL;function WK(){if(NL)return Q0;NL=1;const e=XK(),{inspect:n}=nt,{isString:r,isFunction:s}=mt();class a{constructor(u={}){const{log:{debug:h,warn:f,error:p,deprecate:d,inspectionDepth:g,enableColors:y}={}}=u;this._inspectionDepth=g||5,this._enableColors=o(y),this._debug=h,this._warn=f,this._error=p,this._deprecate=d}_log(u,h,f){if(h!=null&&!s(h))throw new TypeError("Extensions to knex logger must be functions!");if(s(h)){h(u);return}r(u)||(u=n(u,{depth:this._inspectionDepth,colors:this._enableColors})),console.log(f?f(u):u)}debug(u){this._log(u,this._debug)}warn(u){this._log(u,this._warn,e.yellow)}error(u){this._log(u,this._error,e.red)}deprecate(u,h){const f=`${u} is deprecated, please use ${h}`;this._log(f,this._deprecate,e.yellow)}}function o(l){return l??(process&&process.stdout?process.stdout.isTTY:!1)}return Q0=a,Q0}var H0,RL;function ql(){if(RL)return H0;RL=1;const e=Qt(),n=Ah(),r=ea();class s{constructor(l,u,h,f){this.client=l,this._method=u,this._schemaName=void 0,this._columns=void 0,this._fn=f,this._viewName=h,this._statements=[],this._single={}}setSchema(l){this._schemaName=l}columns(l){this._columns=l}as(l){this._selectQuery=l}checkOption(){throw new Error("check option definition is not supported by this dialect.")}localCheckOption(){throw new Error("check option definition is not supported by this dialect.")}cascadedCheckOption(){throw new Error("check option definition is not supported by this dialect.")}toSQL(){return this._method==="alter"&&n(this,a),this._fn.call(this,this),this.client.viewCompiler(this).toSQL()}}const a={column(o){const l=this;return{rename:function(u){return l._statements.push({grouping:"alterView",method:"renameColumn",args:[o,u]}),this},defaultTo:function(u){return l._statements.push({grouping:"alterView",method:"defaultTo",args:[o,u]}),this}}}};return e.addQueryContext(s),s.extend=(o,l)=>{if(Object.prototype.hasOwnProperty.call(s.prototype,o))throw new Error(`Can't extend ViewBuilder with existing method ('${o}').`);r(s.prototype,{[o]:l})},H0=s,H0}var V0,OL;function Oo(){if(OL)return V0;OL=1;const{pushQuery:e}=qh(),n=Th(),{columnize:r}=Vt();class s{constructor(o,l){this.client=o,this.viewBuilder=l,this._commonBuilder=this.viewBuilder,this.method=l._method,this.schemaNameRaw=l._schemaName,this.viewNameRaw=l._viewName,this.single=l._single,this.selectQuery=l._selectQuery,this.columns=l._columns,this.grouped=n(l._statements,"grouping"),this.formatter=o.formatter(l),this.bindings=[],this.formatter.bindings=this.bindings,this.bindingsHolder=this,this.sequence=[]}toSQL(){return this[this.method](),this.sequence}create(){this.createQuery(this.columns,this.selectQuery)}createOrReplace(){throw new Error("replace views is not supported by this dialect.")}createMaterializedView(){throw new Error("materialized views are not supported by this dialect.")}createQuery(o,l,u,h){const f="create "+(u?"materialized ":"")+(h?"or replace ":"")+"view ",p=o?" ("+r(o,this.viewBuilder,this.client,this.bindingsHolder)+")":"";let d=f+this.viewName()+p;switch(d+=" as ",d+=l.toString(),this.single.checkOption){case"default_option":d+=" with check option";break;case"local":d+=" with local check option";break;case"cascaded":d+=" with cascaded check option";break}this.pushQuery({sql:d})}renameView(o,l){throw new Error("rename view is not supported by this dialect (instead drop, then create another view).")}refreshMaterializedView(){throw new Error("materialized views are not supported by this dialect.")}alter(){this.alterView()}alterView(){const o=this.grouped.alterView||[];for(let l=0,u=o.length;l<u;l++){const h=o[l];this[h.method]?this[h.method].apply(this,h.args):this.client.logger.error(`Debug: ${h.method} does not exist`)}for(const l in this.single)typeof this[l]=="function"&&this[l](this.single[l])}renameColumn(o,l){throw new Error("rename column of views is not supported by this dialect.")}defaultTo(o,l){throw new Error("change default values of views is not supported by this dialect.")}viewName(){const o=this.schemaNameRaw?`${this.schemaNameRaw}.${this.viewNameRaw}`:this.viewNameRaw;return this.formatter.wrap(o)}}return s.prototype.pushQuery=e,V0=s,V0}var F0,ML;function ia(){if(ML)return F0;ML=1;const{Pool:e,TimeoutError:n}=CK(),{EventEmitter:r}=Zs(),{promisify:s}=nt,{makeEscape:a}=cx(),o=KB(),l=ix(),u=ux(),h=SK(),f=Ji(),{executeQuery:p,enrichQueryObject:d}=lP(),g=ni(),y=na(),E=hP(),x=No(),v=dP(),b=Ro(),w=Nh(),C=ra(),{KnexTimeoutError:T}=_o(),{outputQuery:A,unwrapRaw:N}=Vt(),{compileCallback:O}=ta(),I=Ao(),k=YK(),R=Rh(),M=WK(),{POOL_CONFIG_OPTIONS:D}=hx(),z=ql(),q=Oo(),j=Wi(),{setHiddenProperty:L}=fx(),P=tr()("knex:client");class H extends r{constructor(V={}){if(super(),this.config=V,this.logger=new M(V),this.config.connection&&this.config.connection.password&&L(this.config.connection),this.dialect&&!this.config.client&&this.logger.warn("Using 'this.dialect' to identify the client is deprecated and support for it will be removed in the future. Please use configuration option 'client' instead."),!(this.config.client||this.dialect))throw new Error("knex: Required configuration option 'client' is missing.");V.version&&(this.version=V.version),V.connection&&V.connection instanceof Function?(this.connectionConfigProvider=V.connection,this.connectionConfigExpirationChecker=()=>!0):(this.connectionSettings=o(V.connection||{}),V.connection&&V.connection.password&&L(this.connectionSettings,V.connection),this.connectionConfigExpirationChecker=null),this.driverName&&V.connection&&(this.initializeDriver(),(!V.pool||V.pool&&V.pool.max!==0)&&this.initializePool(V)),this.valueForUndefined=this.raw("DEFAULT"),V.useNullAsDefault&&(this.valueForUndefined=null)}formatter(V){return new R(this,V)}queryBuilder(){return new g(this)}queryCompiler(V,B){return new y(this,V,B)}schemaBuilder(){return new E(this)}schemaCompiler(V){return new x(this,V)}tableBuilder(V,B,K,ne){return new v(this,V,B,K,ne)}viewBuilder(V,B,K){return new z(this,V,B,K)}tableCompiler(V){return new b(this,V)}viewCompiler(V){return new q(this,V)}columnBuilder(V,B,K){return new w(this,V,B,K)}columnCompiler(V,B){return new C(this,V,B)}runner(V){return new h(this,V)}transaction(V,B,K){return new f(this,V,B,K)}raw(){return new I(this).set(...arguments)}ref(){return new k(this,...arguments)}query(V,B){const K=d(V,B,this);return p(V,K,this)}stream(V,B,K,ne){const Q=d(V,B,this);return this._stream(V,Q,K,ne)}prepBindings(V){return V}positionBindings(V){return V}postProcessResponse(V,B){return this.config.postProcessResponse?this.config.postProcessResponse(V,B):V}wrapIdentifier(V,B){return this.customWrapIdentifier(V,this.wrapIdentifierImpl,B)}customWrapIdentifier(V,B,K){return this.config.wrapIdentifier?this.config.wrapIdentifier(V,B,K):B(V)}wrapIdentifierImpl(V){return V!=="*"?`"${V.replace(/"/g,'""')}"`:"*"}initializeDriver(){try{this.driver=this._driver()}catch(V){const B=`Knex: run
80
+ $ npm install ${this.driverName} --save`;throw this.logger.error(`${B}
81
+ ${V.message}
82
+ ${V.stack}`),new Error(`${B}
83
+ ${V.message}`)}}poolDefaults(){return{min:2,max:10,propagateCreateError:!0}}getPoolSettings(V){V=l({},V,this.poolDefaults()),D.forEach(Q=>{Q in V&&this.logger.warn([`Pool config option "${Q}" is no longer supported.`,"See https://github.com/Vincit/tarn.js for possible pool config options."].join(" "))});const B=6e4,K=[this.config.acquireConnectionTimeout,V.acquireTimeoutMillis].filter(Q=>Q!==void 0);K.length||K.push(B),V.acquireTimeoutMillis=Math.min(...K);const ne=async()=>{if(!this.connectionConfigProvider||!this.connectionConfigExpirationChecker||!this.connectionConfigExpirationChecker())return;const Q=await this.connectionConfigProvider();Q.expirationChecker?(this.connectionConfigExpirationChecker=Q.expirationChecker,delete Q.expirationChecker):this.connectionConfigExpirationChecker=null,this.connectionSettings=Q};return Object.assign(V,{create:async()=>{await ne();const Q=await this.acquireRawConnection();return Q.__knexUid=u("__knexUid"),V.afterCreate&&await s(V.afterCreate)(Q),Q},destroy:Q=>{if(Q!==void 0)return this.destroyRawConnection(Q)},validate:Q=>Q.__knex__disposed?(this.logger.warn(`Connection Error: ${Q.__knex__disposed}`),!1):this.validateConnection(Q)})}initializePool(V=this.config){if(this.pool){this.logger.warn("The pool has already been initialized");return}const B={...this.getPoolSettings(V.pool)};B.afterCreate&&delete B.afterCreate,this.pool=new e(B)}validateConnection(V){return!0}async acquireConnection(){if(!this.pool)throw new Error("Unable to acquire a connection");try{const V=await this.pool.acquire().promise;return P("acquired connection from pool: %s",V.__knexUid),V.config&&(V.config.password&&L(V.config),V.config.authentication&&V.config.authentication.options&&V.config.authentication.options.password&&L(V.config.authentication.options)),V}catch(V){let B=V;throw V instanceof n&&(B=new T("Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?")),B}}releaseConnection(V){return P("releasing connection to pool: %s",V.__knexUid),this.pool.release(V)||P("pool refused connection: %s",V.__knexUid),Promise.resolve()}async destroy(V){try{this.pool&&this.pool.destroy&&await this.pool.destroy(),this.pool=void 0,typeof V=="function"&&V()}catch(B){if(typeof V=="function")return V(B);throw B}}database(){return this.connectionSettings.database}toString(){return"[object KnexClient]"}assertCanCancelQuery(){if(!this.canCancelQuery)throw new Error("Query cancelling not supported for this dialect")}cancelQuery(){throw new Error("Query cancelling not supported for this dialect")}alias(V,B){return V+" as "+B}parameter(V,B,K){return typeof V=="function"?A(O(V,void 0,this,K),!0,B,this):N(V,!0,B,this,K)||"?"}parameterize(V,B,K,ne){if(typeof V=="function")return this.parameter(V,K,ne);V=Array.isArray(V)?V:[V];let Q="",J=-1;for(;++J<V.length;){J>0&&(Q+=", ");let ie=V[J];j(ie)&&(ie=JSON.stringify(ie)),Q+=this.parameter(ie===void 0?B:ie,K,ne)}return Q}values(V,B,K){return Array.isArray(V)?Array.isArray(V[0])?`(${V.map(ne=>`(${this.parameterize(ne,void 0,B,K)})`).join(", ")})`:`(${this.parameterize(V,void 0,B,K)})`:V&&V.isRawInstance?`(${this.parameter(V,B,K)})`:this.parameter(V,B,K)}processPassedConnection(V){}toPathForJson(V){return V}}return Object.assign(H.prototype,{_escapeBinding:a({escapeString(G){return`'${G.replace(/'/g,"''")}'`}}),canCancelQuery:!1}),F0=H,F0}var G0,jL;function JK(){if(jL)return G0;jL=1;function e(n){if(n.charAt(0)==="/"){const h=n.split(" ");return{host:h[0],database:h[1]}}const r={};let s,a=!1;/ |%[^a-f0-9]|%[a-f0-9][^a-f0-9]/i.test(n)&&(n=encodeURI(n).replace(/\%25(\d\d)/g,"%$1"));try{s=new URL(n,"postgres://base")}catch{s=new URL(n.replace("@/","@___DUMMY___/"),"postgres://base"),a=!0}for(const h of s.searchParams.entries())r[h[0]]=h[1];if(r.user=r.user||decodeURIComponent(s.username),r.password=r.password||decodeURIComponent(s.password),s.protocol=="socket:")return r.host=decodeURI(s.pathname),r.database=s.searchParams.get("db"),r.client_encoding=s.searchParams.get("encoding"),r;const o=a?"":s.hostname;r.host?o&&/^%2f/i.test(o)&&(s.pathname=o+s.pathname):r.host=decodeURIComponent(o),r.port||(r.port=s.port);const l=s.pathname.slice(1)||null;r.database=l?decodeURI(l):null,(r.ssl==="true"||r.ssl==="1")&&(r.ssl=!0),r.ssl==="0"&&(r.ssl=!1),(r.sslcert||r.sslkey||r.sslrootcert||r.sslmode)&&(r.ssl={});const u=r.sslcert||r.sslkey||r.sslrootcert?nt:null;switch(r.sslcert&&(r.ssl.cert=u.readFileSync(r.sslcert).toString()),r.sslkey&&(r.ssl.key=u.readFileSync(r.sslkey).toString()),r.sslrootcert&&(r.ssl.ca=u.readFileSync(r.sslrootcert).toString()),r.sslmode){case"disable":{r.ssl=!1;break}case"prefer":case"require":case"verify-ca":case"verify-full":break;case"no-verify":{r.ssl.rejectUnauthorized=!1;break}}return r}return G0=e,e.parse=e,G0}var K0,LL;function ZK(){if(LL)return K0;LL=1;const{parse:e}=JK(),n=e,r=process&&process.platform&&process.platform==="win32";function s(o){try{return new URL(o)}catch{return null}}K0=function(l){const u=s(l),h=r&&u&&u.protocol.length===2;if(!u||h)return{client:"sqlite3",connection:{filename:l}};let{protocol:f}=u;f.slice(-1)===":"&&(f=f.slice(0,-1));const p=["postgresql","postgres"].includes(f);return{client:f,connection:p?n(l):a(u)}};function a(o){const l={};let u=o.pathname;if(u[0]==="/"&&(u=u.slice(1)),l.database=u,o.hostname&&(o.protocol.indexOf("mssql")===0?l.server=o.hostname:l.host=o.hostname),o.port&&(l.port=o.port),(o.username||o.password)&&(l.user=decodeURIComponent(o.username)),o.password&&(l.password=decodeURIComponent(o.password)),o.searchParams)for(const[h,f]of o.searchParams.entries())if(["mysql:","mariadb:","mssql:"].includes(o.protocol))try{l[h]=JSON.parse(f)}catch{l[h]=f}else l[h]=f;return l}return K0}var Ou={},Y0,$L;function eY(){if($L)return Y0;$L=1;const e=Ji();class n extends e{begin(s){return this.isolationLevel&&this.client.logger.warn("sqlite3 only supports serializable transactions, ignoring the isolation level param"),this.readOnly&&this.client.logger.warn("sqlite3 implicitly handles read vs write transactions"),this.query(s,"BEGIN;")}}return Y0=n,Y0}var X0,IL;function tY(){if(IL)return X0;IL=1;const e=bh(),n=Ws(),r=tn(),s=qn(),a=Js(),o=na(),l=Ff(),{isString:u}=mt(),{wrapString:h,columnize:f}=Vt(),p=e("");class d extends o{constructor(y,E,x){super(y,E,x),this.forShare=p,this.forKeyShare=p,this.forUpdate=p,this.forNoKeyUpdate=p}insert(){const y=this.single.insert||[];let E=this.with()+`insert into ${this.tableName} `;if(Array.isArray(y)){if(y.length===0)return"";if(y.length===1&&y[0]&&s(y[0]))return{sql:E+this._emptyInsertValue}}else if(typeof y=="object"&&s(y))return{sql:E+this._emptyInsertValue};const x=this._prepInsert(y);if(u(x))return{sql:E+x};if(x.columns.length===0)return{sql:""};if(E+=`(${this.formatter.columnize(x.columns)})`,this.client.valueForUndefined!==null&&x.values.forEach(N=>{n(N,O=>{if(O===void 0)throw new TypeError("`sqlite` does not support inserting default values. Specify values explicitly or use the `useNullAsDefault` config flag. (see docs https://knexjs.org/guide/query-builder.html#insert).")})}),x.values.length===1){const N=this.client.parameterize(x.values[0],this.client.valueForUndefined,this.builder,this.bindingsHolder);E+=` values (${N})`;const{onConflict:O,ignore:I,merge:k}=this.single;if(O&&I)E+=this._ignore(O);else if(O&&k){E+=this._merge(k.updates,O,y);const M=this.where();M&&(E+=` ${M}`)}const{returning:R}=this.single;return R&&(E+=this._returning(R)),{sql:E,returning:R}}const v=[];let b=-1;for(;++b<x.values.length;){let N=-1;const O=v[b]=[];let I=x.values[b];for(I=I===void 0?this.client.valueForUndefined:I;++N<x.columns.length;)O.push(this.client.alias(this.client.parameter(I[N],this.builder,this.bindingsHolder),this.formatter.wrap(x.columns[N])));v[b]=O.join(", ")}E+=" select "+v.join(" union all select ");const{onConflict:w,ignore:C,merge:T}=this.single;w&&C?E+=" where true"+this._ignore(w):w&&T&&(E+=" where true"+this._merge(T.updates,w,y));const{returning:A}=this.single;return A&&(E+=this._returning(A)),{sql:E,returning:A}}update(){const y=this.with(),E=this._prepUpdate(this.single.update),x=this.where(),{returning:v}=this.single;return{sql:y+`update ${this.single.only?"only ":""}${this.tableName} set ${E.join(", ")}`+(x?` ${x}`:"")+this._returning(v),returning:v}}_ignore(y){return y===!0?" on conflict do nothing":` on conflict ${this._onConflictClause(y)} do nothing`}_merge(y,E,x){let v=` on conflict ${this._onConflictClause(E)} do update set `;if(y&&Array.isArray(y))return v+=y.map(b=>h(b.split(".").pop(),this.formatter.builder,this.client,this.formatter)).map(b=>`${b} = excluded.${b}`).join(", "),v;if(y&&typeof y=="object"){const b=this._prepUpdate(y);return typeof b=="string"?v+=b:v+=b.join(","),v}else{const b=this._prepInsert(x);if(typeof b=="string")throw new Error("If using merge with a raw insert query, then updates must be provided");return v+=b.columns.map(w=>h(w.split(".").pop(),this.builder,this.client)).map(w=>`${w} = excluded.${w}`).join(", "),v}}_returning(y){return y?` returning ${this.formatter.columnize(y)}`:""}truncate(){const{table:y}=this.single;return{sql:`delete from ${this.tableName}`,output(){return this.query({sql:`delete from sqlite_sequence where name = '${y}'`}).catch(l)}}}columnInfo(){const y=this.single.columnInfo;return{sql:`PRAGMA table_info(\`${this.client.customWrapIdentifier(this.single.table,r)}\`)`,output(x){const v=/.*\((\d+)\)/,b=a(x,function(w,C){let{type:T}=C,A=T.match(v);return A&&(A=A[1]),T=A?T.split("(")[0]:T,w[C.name]={type:T.toLowerCase(),maxLength:A,nullable:!C.notnull,defaultValue:C.dflt_value},w},{});return y&&b[y]||b}}}limit(){const y=!this.single.limit&&this.single.limit!==0;return y&&!this.single.offset?"":(this.single.limit=y?-1:this.single.limit,`limit ${this._getValueOrParameterFromAttribute("limit")}`)}jsonExtract(y){return this._jsonExtract("json_extract",y)}jsonSet(y){return this._jsonSet("json_set",y)}jsonInsert(y){return this._jsonSet("json_insert",y)}jsonRemove(y){const E=`json_remove(${f(y.column,this.builder,this.client,this.bindingsHolder)},${this.client.parameter(y.path,this.builder,this.bindingsHolder)})`;return y.alias?this.client.alias(E,this.formatter.wrap(y.alias)):E}whereJsonPath(y){return this._whereJsonPath("json_extract",y)}whereJsonSupersetOf(y){throw new Error("Json superset where clause not actually supported by SQLite")}whereJsonSubsetOf(y){throw new Error("Json subset where clause not actually supported by SQLite")}onJsonPathEquals(y){return this._onJsonPathEquals("json_extract",y)}}return X0=d,X0}var W0,DL;function nY(){if(DL)return W0;DL=1;var e=xo();function n(r,s){var a;return e(r,function(o,l,u){return a=s(o,l,u),!a}),!!a}return W0=n,W0}var J0,kL;function rY(){if(kL)return J0;kL=1;var e=wB(),n=mn(),r=nY(),s=vt(),a=qo();function o(l,u,h){var f=s(l)?e:r;return h&&a(l,u,h)&&(u=void 0),f(l,n(u,3))}return J0=o,J0}var Z0,BL;function iY(){if(BL)return Z0;BL=1;const e=No(),n=rY();class r extends e{constructor(a,o){super(a,o)}hasTable(a){const o=`select * from sqlite_master where type = 'table' and name = ${this.client.parameter(this.formatter.wrap(a).replace(/`/g,""),this.builder,this.bindingsHolder)}`;this.pushQuery({sql:o,output:l=>l.length>0})}hasColumn(a,o){this.pushQuery({sql:`PRAGMA table_info(${this.formatter.wrap(a)})`,output(l){return n(l,u=>this.client.wrapIdentifier(u.name.toLowerCase())===this.client.wrapIdentifier(o.toLowerCase()))}})}renameTable(a,o){this.pushQuery(`alter table ${this.formatter.wrap(a)} rename to ${this.formatter.wrap(o)}`)}async generateDdlCommands(){const a=this.builder._sequence;for(let l=0,u=a.length;l<u;l++){const h=a[l];this[h.method].apply(this,h.args)}const o=this.sequence;if(o.length===1&&o[0].statementsProducer)return o[0].statementsProducer();{const l=[];for(const u of o){const h=u.sql;Array.isArray(h)?l.push(...h):l.push(h)}return{pre:[],sql:l,check:null,post:[]}}}}return Z0=r,Z0}var ew,PL;function sY(){if(PL)return ew;PL=1;const e=ra();class n extends e{constructor(){super(...arguments),this.modifiers=["nullable","defaultTo"],this._addCheckModifiers()}enu(s){return`text check (${this.formatter.wrap(this.args[0])} in ('${s.join("', '")}'))`}_pushAlterCheckQuery(s,a){throw new Error("Alter table with to add constraints is not permitted in SQLite")}checkRegex(s,a){return this._check(`${this.formatter.wrap(this.getColumnName())} REGEXP ${this.client._escapeBinding(s)}`,a)}}return n.prototype.json="json",n.prototype.jsonb="json",n.prototype.double=n.prototype.decimal=n.prototype.floating="float",n.prototype.timestamp="datetime",n.prototype.increments=n.prototype.bigincrements="integer not null primary key autoincrement",ew=n,ew}var tw,zL;function aY(){if(zL)return tw;zL=1;const e=tx(),n=Ch(),r=tn(),{isObject:s}=mt(),a=Ro(),{formatDefault:o}=ta();class l extends a{constructor(){super(...arguments)}createQuery(h,f,p){let g=(f?"create table if not exists ":"create table ")+this.tableName();p&&this.tableNameLike()?g+=" as select * from "+this.tableNameLike()+" where 0=1":(g+=" ("+h.sql.join(", "),g+=this.foreignKeys()||"",g+=this.primaryKeys()||"",g+=this._addChecks(),g+=")"),this.pushQuery(g),p&&this.addColumns(h,this.addColumnsPrefix)}addColumns(h,f,p){if(f===this.alterColumnsPrefix){const d=this,g=p.map(y=>{const E=this.client.customWrapIdentifier(y.getColumnName(),r,y.columnBuilder.queryContext()),x=y.getColumnType(),v=y.modified.defaultTo?o(y.modified.defaultTo[0],y.type,this.client):null,b=y.modified.nullable&&y.modified.nullable[0]===!1;return{name:E,type:x,defaultTo:v,notNull:b}});this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,statementsProducer(y,E){return d.client.ddl(d,y,E).alterColumn(g)}})}else for(let d=0,g=h.sql.length;d<g;d++)this.pushQuery({sql:`alter table ${this.tableName()} add column ${h.sql[d]}`,bindings:h.bindings[d]})}dropUnique(h,f){f=f?this.formatter.wrap(f):this._indexCommand("unique",this.tableNameRaw,h),this.pushQuery(`drop index ${f}`)}dropForeign(h,f){const p=this;h=Array.isArray(h)?h:[h],h=h.map(d=>this.client.customWrapIdentifier(d,r)),f=this.client.customWrapIdentifier(f,r),this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,output(d){return p.client.ddl(p,d,this.connection).dropForeign(h,f)}})}dropPrimary(h){const f=this;h=this.client.customWrapIdentifier(h,r),this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,output(p){return f.client.ddl(f,p,this.connection).dropPrimary(h)}})}dropIndex(h,f){f=f?this.formatter.wrap(f):this._indexCommand("index",this.tableNameRaw,h),this.pushQuery(`drop index ${f}`)}unique(h,f){let p,d;s(f)&&({indexName:f,deferrable:p,predicate:d}=f),p&&p!=="not deferrable"&&this.client.logger.warn(`sqlite3: unique index \`${f}\` will not be deferrable ${p} because sqlite3 does not support deferred constraints.`),f=f?this.formatter.wrap(f):this._indexCommand("unique",this.tableNameRaw,h),h=this.formatter.columnize(h);const g=d?" "+this.client.queryCompiler(d).where():"";this.pushQuery(`create unique index ${f} on ${this.tableName()} (${h})${g}`)}index(h,f,p){f=f?this.formatter.wrap(f):this._indexCommand("index",this.tableNameRaw,h),h=this.formatter.columnize(h);let d;s(p)&&({predicate:d}=p);const g=d?" "+this.client.queryCompiler(d).where():"";this.pushQuery(`create index ${f} on ${this.tableName()} (${h})${g}`)}primary(h,f){const p=this;h=Array.isArray(h)?h:[h],h=h.map(g=>this.client.customWrapIdentifier(g,r));let d;s(f)&&({constraintName:f,deferrable:d}=f),d&&d!=="not deferrable"&&this.client.logger.warn(`sqlite3: primary key constraint \`${f}\` will not be deferrable ${d} because sqlite3 does not support deferred constraints.`),f=this.client.customWrapIdentifier(f,r),this.method!=="create"&&this.method!=="createIfNot"&&this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,output(g){return p.client.ddl(p,g,this.connection).primary(h,f)}})}foreign(h){const f=this;this.method!=="create"&&this.method!=="createIfNot"&&(h.column=Array.isArray(h.column)?h.column:[h.column],h.column=h.column.map(p=>this.client.customWrapIdentifier(p,r)),h.inTable=this.client.customWrapIdentifier(h.inTable,r),h.references=Array.isArray(h.references)?h.references:[h.references],h.references=h.references.map(p=>this.client.customWrapIdentifier(p,r)),this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,statementsProducer(p,d){return f.client.ddl(f,p,d).foreign(h)}}))}primaryKeys(){const h=e(this.grouped.alterTable||[],{method:"primary"});if(h.length>0&&h[0].args.length>0){const f=h[0].args[0];let p=h[0].args[1]||"";p&&(p=" constraint "+this.formatter.wrap(p));const d=this.grouped.columns.filter(g=>g.builder._type==="increments").length>0;return`,${p} ${d?"unique":"primary key"} (${this.formatter.columnize(f)})`}}foreignKeys(){let h="";const f=e(this.grouped.alterTable||[],{method:"foreign"});for(let p=0,d=f.length;p<d;p++){const g=f[p].args[0],y=this.formatter.columnize(g.column),E=this.formatter.columnize(g.references),x=this.formatter.wrap(g.inTable);let v=g.keyName||"";v&&(v=" constraint "+this.formatter.wrap(v)),h+=`,${v} foreign key(${y}) references ${x}(${E})`,g.onDelete&&(h+=` on delete ${g.onDelete}`),g.onUpdate&&(h+=` on update ${g.onUpdate}`)}return h}createTableBlock(){return this.getColumns().concat().join(",")}renameColumn(h,f){this.pushQuery({sql:`alter table ${this.tableName()} rename ${this.formatter.wrap(h)} to ${this.formatter.wrap(f)}`})}_setNullableState(h,f){const p=this;this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,statementsProducer(d,g){return p.client.ddl(p,d,g).setNullable(h,f)}})}dropColumn(){const h=this,p=n(arguments).map(d=>this.client.customWrapIdentifier(d,r));this.pushQuery({sql:`PRAGMA table_info(${this.tableName()})`,output(d){return h.client.ddl(h,d,this.connection).dropColumn(p)}})}}return tw=l,tw}var nw,UL;function oY(){if(UL)return nw;UL=1;const e=Oo(),{columnize:n}=Vt();class r extends e{constructor(a,o){super(a,o)}createOrReplace(){const a=this.columns,o=this.selectQuery.toString(),l=this.viewName(),u=a?" ("+n(a,this.viewBuilder,this.client,this.bindingsHolder)+")":"",h=`drop view if exists ${l}`,f=`create view ${l}${u} as ${o}`;this.pushQuery({sql:h}),this.pushQuery({sql:f})}}return nw=r,nw}var rw,QL;function uY(){if(QL)return rw;QL=1;function e(u,h,f){return`INSERT INTO "${h}" SELECT ${f===void 0?"*":f.map(p=>`"${p}"`).join(", ")} FROM "${u}";`}function n(u){return`DROP TABLE "${u}"`}function r(u,h){return`ALTER TABLE "${u}" RENAME TO "${h}"`}function s(u){return`SELECT type, sql FROM sqlite_master WHERE (type='table' OR (type='index' AND sql IS NOT NULL)) AND lower(tbl_name)='${u.toLowerCase()}'`}function a(){return"PRAGMA foreign_keys"}function o(u){return`PRAGMA foreign_keys = ${u?"ON":"OFF"}`}function l(){return"PRAGMA foreign_key_check"}return rw={copyData:e,dropOriginal:n,renameTable:r,getTableSql:s,isForeignCheckEnabled:a,setForeignCheck:o,executeForeignCheck:l},rw}var iw,HL;function lY(){if(HL)return iw;HL=1;function e(n,r){const s=new RegExp(Object.entries(r).map(([l,u])=>`(?<${l}>${u.source})`).join("|"),"yi");let a=0;const o=[];for(;a<n.length;){s.lastIndex=a;const l=n.match(s);if(l!==null){const[u,h]=Object.entries(l.groups).find(([f,p])=>p!==void 0);a+=h.length,u.startsWith("_")||o.push({type:u,text:h})}else throw new Error(`No matching tokenizer rule found at: [${n.substring(a)}]`)}return o}return iw={tokenize:e},iw}var sw,VL;function cY(){if(VL)return sw;VL=1;function e(f,p=d=>d){return function({index:d=0,input:g}){let y=d;const E=[];for(const x of f){const v=x({index:y,input:g});if(v.success)y=v.index,E.push(v.ast);else return v}return{success:!0,ast:p(E),index:y,input:g}}}function n(f,p=d=>d){return function({index:d=0,input:g}){for(const y of f){const E=y({index:d,input:g});if(E.success)return{success:!0,ast:p(E.ast),index:E.index,input:g}}return{success:!1,ast:null,index:d,input:g}}}function r(f,p=d=>d){return function({index:d=0,input:g}){let y={},E=d;const x=[];do y=f({index:E,input:g}),y.success&&(E=y.index,x.push(y.ast));while(y.success);return x.length>0?{success:!0,ast:p(x),index:E,input:g}:{success:!1,ast:null,index:E,input:g}}}function s(f,p=d=>d){return function({index:d=0,input:g}){const y=f({index:d,input:g});return y.success?{success:!0,ast:p(y.ast),index:y.index,input:g}:{success:!0,ast:p(null),index:d,input:g}}}function a(f,p=d=>d){return function({index:d=0,input:g}){const y=f.do({index:d,input:g});return y.success&&f.next({index:y.index,input:g}).success?{success:!0,ast:p(y.ast),index:y.index,input:g}:{success:!1,ast:null,index:d,input:g}}}function o(f,p=d=>d){return function({index:d=0,input:g}){const y=f.do({index:d,input:g});return y.success&&!f.not({index:d,input:g}).success?{success:!0,ast:p(y.ast),index:y.index,input:g}:{success:!1,ast:null,index:d,input:g}}}function l(f,p=d=>d.text){return function({index:d=0,input:g}){const y=g[d];return y!==void 0&&(f.type===void 0||f.type===y.type)&&(f.text===void 0||f.text.toUpperCase()===y.text.toUpperCase())?{success:!0,ast:p(y),index:d+1,input:g}:{success:!1,ast:null,index:d,input:g}}}return sw={s:e,a:n,m:r,o:s,l:a,n:o,t:l,e:function({index:f=0,input:p}){return{success:!0,ast:null,index:f,input:p}},f:function({index:f=0,input:p}){return{success:f===p.length,ast:null,index:f,input:p}}},sw}var aw,FL;function fY(){if(FL)return aw;FL=1;const{tokenize:e}=lY(),{s:n,a:r,m:s,o:a,l:o,n:l,t:u,e:h,f}=cY(),p={keyword:/(?:ABORT|ACTION|ADD|AFTER|ALL|ALTER|ALWAYS|ANALYZE|AND|AS|ASC|ATTACH|AUTOINCREMENT|BEFORE|BEGIN|BETWEEN|BY|CASCADE|CASE|CAST|CHECK|COLLATE|COLUMN|COMMIT|CONFLICT|CONSTRAINT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|DATABASE|DEFAULT|DEFERRED|DEFERRABLE|DELETE|DESC|DETACH|DISTINCT|DO|DROP|END|EACH|ELSE|ESCAPE|EXCEPT|EXCLUSIVE|EXCLUDE|EXISTS|EXPLAIN|FAIL|FILTER|FIRST|FOLLOWING|FOR|FOREIGN|FROM|FULL|GENERATED|GLOB|GROUP|GROUPS|HAVING|IF|IGNORE|IMMEDIATE|IN|INDEX|INDEXED|INITIALLY|INNER|INSERT|INSTEAD|INTERSECT|INTO|IS|ISNULL|JOIN|KEY|LAST|LEFT|LIKE|LIMIT|MATCH|MATERIALIZED|NATURAL|NO|NOT|NOTHING|NOTNULL|NULL|NULLS|OF|OFFSET|ON|OR|ORDER|OTHERS|OUTER|OVER|PARTITION|PLAN|PRAGMA|PRECEDING|PRIMARY|QUERY|RAISE|RANGE|RECURSIVE|REFERENCES|REGEXP|REINDEX|RELEASE|RENAME|REPLACE|RESTRICT|RETURNING|RIGHT|ROLLBACK|ROW|ROWS|SAVEPOINT|SELECT|SET|TABLE|TEMP|TEMPORARY|THEN|TIES|TO|TRANSACTION|TRIGGER|UNBOUNDED|UNION|UNIQUE|UPDATE|USING|VACUUM|VALUES|VIEW|VIRTUAL|WHEN|WHERE|WINDOW|WITH|WITHOUT)(?=\s+|-|\(|\)|;|\+|\*|\/|%|==|=|<=|<>|<<|<|>=|>>|>|!=|,|&|~|\|\||\||\.)/,id:/"[^"]*(?:""[^"]*)*"|`[^`]*(?:``[^`]*)*`|\[[^[\]]*\]|[a-z_][a-z0-9_$]*/,string:/'[^']*(?:''[^']*)*'/,blob:/x'(?:[0-9a-f][0-9a-f])+'/,numeric:/(?:\d+(?:\.\d*)?|\.\d+)(?:e(?:\+|-)?\d+)?|0x[0-9a-f]+/,variable:/\?\d*|[@$:][a-z0-9_$]+/,operator:/-|\(|\)|;|\+|\*|\/|%|==|=|<=|<>|<<|<|>=|>>|>|!=|,|&|~|\|\||\||\./,_ws:/\s+/};function d(de){const X=y({input:e(de,p)});if(!X.success)throw new Error(`Parsing CREATE TABLE failed at [${X.input.slice(X.index).map(Me=>Me.text).join(" ")}] of "${de}"`);return X.ast}function g(de){const X=be({input:e(de,p)});if(!X.success)throw new Error(`Parsing CREATE INDEX failed at [${X.input.slice(X.index).map(Me=>Me.text).join(" ")}] of "${de}"`);return X.ast}function y(de){return n([u({text:"CREATE"},X=>null),E,u({text:"TABLE"},X=>null),_e,we,ae,u({text:"("},X=>null),v,j,u({text:")"},X=>null),x,f],X=>Object.assign({},...X.filter(Me=>Me!==null)))(de)}function E(de){return r([u({text:"TEMP"}),u({text:"TEMPORARY"}),h],X=>({temporary:X!==null}))(de)}function x(de){return a(n([u({text:"WITHOUT"}),u({text:"ROWID"})]),X=>({rowid:X!==null}))(de)}function v(de){return r([n([b,u({text:","}),v],X=>({columns:[X[0]].concat(X[2].columns)})),n([b],X=>({columns:[X[0]]}))])(de)}function b(de){return n([n([Oe],X=>({name:X[0]})),w,C],X=>Object.assign({},...X))(de)}function w(de){return a(n([s(u({type:"id"})),r([n([u({text:"("}),rt,u({text:","}),rt,u({text:")"})],X=>`(${X[1]}, ${X[3]})`),n([u({text:"("}),rt,u({text:")"})],X=>`(${X[1]})`),h])],X=>`${X[0].join(" ")}${X[1]||""}`),X=>({type:X}))(de)}function C(de){return a(s(T),X=>({constraints:Object.assign({primary:null,notnull:null,null:null,unique:null,check:null,default:null,collate:null,references:null,as:null},...X||[])}))(de)}function T(de){return r([A,O,I,k,R,M,D,z,q])(de)}function A(de){return n([fe,u({text:"PRIMARY"},X=>null),u({text:"KEY"},X=>null),Tt,G,N],X=>({primary:Object.assign({},...X.filter(Me=>Me!==null))}))(de)}function N(de){return a(u({text:"AUTOINCREMENT"}),X=>({autoincrement:X!==null}))(de)}function O(de){return n([fe,u({text:"NOT"},X=>null),u({text:"NULL"},X=>null),G],X=>({notnull:Object.assign({},...X.filter(Me=>Me!==null))}))(de)}function I(de){return n([fe,u({text:"NULL"},X=>null),G],X=>({null:Object.assign({},...X.filter(Me=>Me!==null))}))(de)}function k(de){return n([fe,u({text:"UNIQUE"},X=>null),G],X=>({unique:Object.assign({},...X.filter(Me=>Me!==null))}))(de)}function R(de){return n([fe,u({text:"CHECK"},X=>null),u({text:"("},X=>null),n([Fe],X=>({expression:X[0]})),u({text:")"},X=>null)],X=>({check:Object.assign({},...X.filter(Me=>Me!==null))}))(de)}function M(de){return n([fe,u({text:"DEFAULT"},X=>null),r([n([u({text:"("}),Fe,u({text:")"})],X=>({value:X[1],expression:!0})),n([We],X=>({value:X[0],expression:!1})),n([rt],X=>({value:X[0],expression:!1}))])],X=>({default:Object.assign({},...X.filter(Me=>Me!==null))}))(de)}function D(de){return n([fe,u({text:"COLLATE"},X=>null),u({type:"id"},X=>({collation:X.text}))],X=>({collate:Object.assign({},...X.filter(Me=>Me!==null))}))(de)}function z(de){return n([fe,n([K],X=>X[0].references)],X=>({references:Object.assign({},...X.filter(Me=>Me!==null))}))(de)}function q(de){return n([fe,a(n([u({text:"GENERATED"}),u({text:"ALWAYS"})]),X=>({generated:X!==null})),u({text:"AS"},X=>null),u({text:"("},X=>null),n([Fe],X=>({expression:X[0]})),u({text:")"},X=>null),r([u({text:"STORED"}),u({text:"VIRTUAL"}),h],X=>({mode:X?X.toUpperCase():null}))],X=>({as:Object.assign({},...X.filter(Me=>Me!==null))}))(de)}function j(de){return a(s(n([u({text:","}),L],X=>X[1])),X=>({constraints:X||[]}))(de)}function L(de){return r([P,H,V,B])(de)}function P(de){return n([fe,u({text:"PRIMARY"},X=>null),u({text:"KEY"},X=>null),u({text:"("},X=>null),Se,u({text:")"},X=>null),G],X=>Object.assign({type:"PRIMARY KEY"},...X.filter(Me=>Me!==null)))(de)}function H(de){return n([fe,u({text:"UNIQUE"},X=>null),u({text:"("},X=>null),Se,u({text:")"},X=>null),G],X=>Object.assign({type:"UNIQUE"},...X.filter(Me=>Me!==null)))(de)}function G(de){return a(n([u({text:"ON"}),u({text:"CONFLICT"}),r([u({text:"ROLLBACK"}),u({text:"ABORT"}),u({text:"FAIL"}),u({text:"IGNORE"}),u({text:"REPLACE"})])],X=>X[2]),X=>({conflict:X?X.toUpperCase():null}))(de)}function V(de){return n([fe,u({text:"CHECK"},X=>null),u({text:"("},X=>null),n([Fe],X=>({expression:X[0]})),u({text:")"},X=>null)],X=>Object.assign({type:"CHECK"},...X.filter(Me=>Me!==null)))(de)}function B(de){return n([fe,u({text:"FOREIGN"},X=>null),u({text:"KEY"},X=>null),u({text:"("},X=>null),Q,u({text:")"},X=>null),K],X=>Object.assign({type:"FOREIGN KEY"},...X.filter(Me=>Me!==null)))(de)}function K(de){return n([u({text:"REFERENCES"},X=>null),ae,ne,a(s(r([J,ie,oe])),X=>Object.assign({delete:null,update:null,match:null},...X||[])),ee],X=>({references:Object.assign({},...X.filter(Me=>Me!==null))}))(de)}function ne(de){return a(n([u({text:"("}),Q,u({text:")"})],X=>X[1]),X=>({columns:X?X.columns:[]}))(de)}function Q(de){return n([a(s(n([Oe,u({text:","})],X=>X[0])),X=>X!==null?X:[]),Oe],X=>({columns:X[0].concat([X[1]])}))(de)}function J(de){return n([u({text:"ON"}),u({text:"DELETE"}),Xe],X=>({delete:X[2]}))(de)}function ie(de){return n([u({text:"ON"}),u({text:"UPDATE"}),Xe],X=>({update:X[2]}))(de)}function oe(de){return n([u({text:"MATCH"}),r([u({type:"keyword"}),u({type:"id"})])],X=>({match:X[1]}))(de)}function ee(de){return a(n([a(u({text:"NOT"})),u({text:"DEFERRABLE"}),a(n([u({text:"INITIALLY"}),r([u({text:"DEFERRED"}),u({text:"IMMEDIATE"})])],X=>X[1].toUpperCase()))]),X=>({deferrable:X?{not:X[0]!==null,initially:X[2]}:null}))(de)}function fe(de){return a(n([u({text:"CONSTRAINT"}),Oe],X=>X[1]),X=>({name:X}))(de)}function be(de){return n([u({text:"CREATE"},X=>null),ve,u({text:"INDEX"},X=>null),_e,we,W,u({text:"ON"},X=>null),ae,u({text:"("},X=>null),Se,u({text:")"},X=>null),xe,f],X=>Object.assign({},...X.filter(Me=>Me!==null)))(de)}function ve(de){return a(u({text:"UNIQUE"}),X=>({unique:X!==null}))(de)}function _e(de){return a(n([u({text:"IF"}),u({text:"NOT"}),u({text:"EXISTS"})]),X=>({exists:X!==null}))(de)}function we(de){return a(n([Oe,u({text:"."})],X=>X[0]),X=>({schema:X}))(de)}function W(de){return n([Oe],X=>({index:X[0]}))(de)}function ae(de){return n([Oe],X=>({table:X[0]}))(de)}function xe(de){return a(n([u({text:"WHERE"}),Fe],X=>X[1]),X=>({where:X}))(de)}function Se(de){return r([n([gt,u({text:","}),Se],X=>({columns:[X[0]].concat(X[2].columns)})),n([ut,u({text:","}),Se],X=>({columns:[X[0]].concat(X[2].columns)})),o({do:gt,next:u({text:")"})},X=>({columns:[X]})),o({do:ut,next:u({text:")"})},X=>({columns:[X]}))])(de)}function gt(de){return n([n([Oe],X=>({name:X[0],expression:!1})),It,Tt],X=>Object.assign({},...X.filter(Me=>Me!==null)))(de)}function ut(de){return n([n([qt],X=>({name:X[0],expression:!0})),It,Tt],X=>Object.assign({},...X.filter(Me=>Me!==null)))(de)}function It(de){return a(n([u({text:"COLLATE"}),u({type:"id"})],X=>X[1]),X=>({collation:X}))(de)}function Tt(de){return r([u({text:"ASC"}),u({text:"DESC"}),h],X=>({order:X?X.toUpperCase():null}))(de)}function qt(de){return s(r([l({do:u({type:"keyword"}),not:r([u({text:"COLLATE"}),u({text:"ASC"}),u({text:"DESC"})])}),u({type:"id"}),u({type:"string"}),u({type:"blob"}),u({type:"numeric"}),u({type:"variable"}),l({do:u({type:"operator"}),not:r([u({text:"("}),u({text:")"}),u({text:","})])}),n([u({text:"("}),a(Fe),u({text:")"})],X=>X[1]||[])]))(de)}function Fe(de){return s(r([u({type:"keyword"}),u({type:"id"}),u({type:"string"}),u({type:"blob"}),u({type:"numeric"}),u({type:"variable"}),l({do:u({type:"operator"}),not:r([u({text:"("}),u({text:")"})])}),n([u({text:"("}),a(Fe),u({text:")"})],X=>X[1]||[])]))(de)}function Oe(de){return r([u({type:"id"}),u({type:"string"})],X=>/^["`['][^]*["`\]']$/.test(X)?X.substring(1,X.length-1):X)(de)}function Xe(de){return r([n([u({text:"SET"}),u({text:"NULL"})],X=>`${X[0]} ${X[1]}`),n([u({text:"SET"}),u({text:"DEFAULT"})],X=>`${X[0]} ${X[1]}`),u({text:"CASCADE"}),u({text:"RESTRICT"}),n([u({text:"NO"}),u({text:"ACTION"})],X=>`${X[0]} ${X[1]}`)],X=>X.toUpperCase())(de)}function We(de){return r([u({type:"numeric"}),u({type:"string"}),u({type:"id"}),u({type:"blob"}),u({text:"NULL"}),u({text:"TRUE"}),u({text:"FALSE"}),u({text:"CURRENT_TIME"}),u({text:"CURRENT_DATE"}),u({text:"CURRENT_TIMESTAMP"})])(de)}function rt(de){return n([r([u({text:"+"}),u({text:"-"}),h]),u({type:"numeric"})],X=>`${X[0]||""}${X[1]}`)(de)}return aw={parseCreateTable:d,parseCreateIndex:g},aw}var ow,GL;function hY(){if(GL)return ow;GL=1;function e(W,ae=xe=>xe){return r(W,ae)}function n(W,ae=xe=>xe){return G(W,ae)}function r(W,ae){return`CREATE${s(W)} TABLE${B(W)} ${K(W,ae)}${Q(W,ae)} (${o(W,ae)}${C(W,ae)})${a(W)}`}function s(W,ae){return W.temporary?" TEMP":""}function a(W,ae){return W.rowid?" WITHOUT ROWID":""}function o(W,ae){return W.columns.map(xe=>l(xe,ae)).join(", ")}function l(W,ae){return`${we(W.name,ae)}${u(W)}${h(W.constraints,ae)}`}function u(W,ae){return W.type!==null?` ${W.type}`:""}function h(W,ae){return`${f(W,ae)}${d(W,ae)}${g(W,ae)}${y(W,ae)}${E(W,ae)}${x(W,ae)}${v(W,ae)}${b(W,ae)}${w(W,ae)}`}function f(W,ae){return W.primary!==null?` ${H(W.primary,ae)}PRIMARY KEY${be(W.primary)}${O(W.primary)}${p(W.primary)}`:""}function p(W,ae){return W.autoincrement?" AUTOINCREMENT":""}function d(W,ae){return W.notnull!==null?` ${H(W.notnull,ae)}NOT NULL${O(W.notnull)}`:""}function g(W,ae){return W.null!==null?` ${H(W.null,ae)}NULL${O(W.null)}`:""}function y(W,ae){return W.unique!==null?` ${H(W.unique,ae)}UNIQUE${O(W.unique)}`:""}function E(W,ae){return W.check!==null?` ${H(W.check,ae)}CHECK (${_e(W.check.expression)})`:""}function x(W,ae){return W.default!==null?` ${H(W.default,ae)}DEFAULT ${W.default.expression?`(${_e(W.default.value)})`:W.default.value}`:""}function v(W,ae){return W.collate!==null?` ${H(W.collate,ae)}COLLATE ${W.collate.collation}`:""}function b(W,ae){return W.references!==null?` ${H(W.references,ae)}${R(W.references,ae)}`:""}function w(W,ae){return W.as!==null?` ${H(W.as,ae)}${W.as.generated?"GENERATED ALWAYS ":""}AS (${_e(W.as.expression)})${W.as.mode!==null?` ${W.as.mode}`:""}`:""}function C(W,ae){return W.constraints.reduce((xe,Se)=>`${xe}, ${T(Se,ae)}`,"")}function T(W,ae){switch(W.type){case"PRIMARY KEY":return A(W,ae);case"UNIQUE":return N(W,ae);case"CHECK":return I(W,ae);case"FOREIGN KEY":return k(W,ae)}}function A(W,ae){return`${H(W,ae)}PRIMARY KEY (${ie(W,ae)})${O(W)}`}function N(W,ae){return`${H(W,ae)}UNIQUE (${ie(W,ae)})${O(W)}`}function O(W,ae){return W.conflict!==null?` ON CONFLICT ${W.conflict}`:""}function I(W,ae){return`${H(W,ae)}CHECK (${_e(W.expression)})`}function k(W,ae){return`${H(W,ae)}FOREIGN KEY (${D(W,ae)}) ${R(W.references,ae)}`}function R(W,ae){return`REFERENCES ${Q(W,ae)}${M(W,ae)}${z(W)}${P(W.deferrable)}`}function M(W,ae){return W.columns.length>0?` (${D(W,ae)})`:""}function D(W,ae){return W.columns.map(xe=>we(xe,ae)).join(", ")}function z(W,ae){return`${q(W)}${j(W)}${L(W)}`}function q(W,ae){return W.delete!==null?` ON DELETE ${W.delete}`:""}function j(W,ae){return W.update!==null?` ON UPDATE ${W.update}`:""}function L(W,ae){return W.match!==null?` MATCH ${W.match}`:""}function P(W,ae){return W!==null?` ${W.not?"NOT ":""}DEFERRABLE${W.initially!==null?` INITIALLY ${W.initially}`:""}`:""}function H(W,ae){return W.name!==null?`CONSTRAINT ${we(W.name,ae)} `:""}function G(W,ae){return`CREATE${V(W)} INDEX${B(W)} ${K(W,ae)}${ne(W,ae)} on ${Q(W,ae)} (${ie(W,ae)})${J(W)}`}function V(W,ae){return W.unique?" UNIQUE":""}function B(W,ae){return W.exists?" IF NOT EXISTS":""}function K(W,ae){return W.schema!==null?`${we(W.schema,ae)}.`:""}function ne(W,ae){return we(W.index,ae)}function Q(W,ae){return we(W.table,ae)}function J(W,ae){return W.where!==null?` where ${_e(W.where)}`:""}function ie(W,ae){return W.columns.map(xe=>xe.expression?ee(xe):oe(xe,ae)).join(", ")}function oe(W,ae){return`${we(W.name,ae)}${fe(W)}${be(W)}`}function ee(W,ae){return`${ve(W.name)}${fe(W)}${be(W)}`}function fe(W,ae){return W.collation!==null?` COLLATE ${W.collation}`:""}function be(W,ae){return W.order!==null?` ${W.order}`:""}function ve(W,ae){return _e(W)}function _e(W,ae){return W.reduce((xe,Se)=>Array.isArray(Se)?`${xe}(${_e(Se)})`:xe?`${xe} ${Se}`:Se,"")}function we(W,ae){return ae(W)}return ow={compileCreateTable:e,compileCreateIndex:n},ow}var uw,KL;function dY(){if(KL)return uw;KL=1;function e(r,s){return r.toLowerCase()===s.toLowerCase()}function n(r,s){return r.some(a=>e(a,s))}return uw={isEqualId:e,includesId:n},uw}var lw,YL;function pY(){if(YL)return lw;YL=1;const e=tn(),{nanonum:n}=mx(),{copyData:r,dropOriginal:s,renameTable:a,getTableSql:o,isForeignCheckEnabled:l,setForeignCheck:u,executeForeignCheck:h}=uY(),{parseCreateTable:f,parseCreateIndex:p}=fY(),{compileCreateTable:d,compileCreateIndex:g}=hY(),{isEqualId:y,includesId:E}=dY();class x{constructor(b,w,C,T){this.client=b,this.tableCompiler=w,this.pragma=C,this.tableNameRaw=this.tableCompiler.tableNameRaw,this.alteredName=`_knex_temp_alter${n(3)}`,this.connection=T,this.formatter=A=>this.client.customWrapIdentifier(A,e),this.wrap=A=>this.client.wrapIdentifierImpl(A)}tableName(){return this.formatter(this.tableNameRaw)}getTableSql(){const b=this.tableName();return this.client.transaction(async w=>{w.disableProcessing();const C=await w.raw(o(b));return w.enableProcessing(),{createTable:C.filter(T=>T.type==="table")[0].sql,createIndices:C.filter(T=>T.type==="index").map(T=>T.sql)}},{connection:this.connection})}async isForeignCheckEnabled(){return(await this.client.raw(l()).connection(this.connection))[0].foreign_keys===1}async setForeignCheck(b){await this.client.raw(u(b)).connection(this.connection)}renameTable(b){return b.raw(a(this.alteredName,this.tableName()))}dropOriginal(b){return b.raw(s(this.tableName()))}copyData(b,w){return b.raw(r(this.tableName(),this.alteredName,w))}async alterColumn(b){const{createTable:w,createIndices:C}=await this.getTableSql(),T=f(w);T.table=this.alteredName,T.columns=T.columns.map(N=>{const O=b.find(I=>y(I.name,N.name));return O&&(N.type=O.type,N.constraints.default=O.defaultTo!==null?{name:null,value:O.defaultTo,expression:!1}:null,N.constraints.notnull=O.notNull?{name:null,conflict:null}:null,N.constraints.null=O.notNull?null:N.constraints.null),N});const A=d(T,this.wrap);return this.generateAlterCommands(A,C)}async dropColumn(b){const{createTable:w,createIndices:C}=await this.getTableSql(),T=f(w);if(T.table=this.alteredName,T.columns=T.columns.filter(I=>I.expression||!E(b,I.name)),T.columns.length===0)throw new Error("Unable to drop last column from table");T.constraints=T.constraints.filter(I=>I.type==="PRIMARY KEY"||I.type==="UNIQUE"?I.columns.every(k=>k.expression||!E(b,k.name)):I.type==="FOREIGN KEY"?I.columns.every(k=>!E(b,k))&&(I.references.table!==T.table||I.references.columns.every(k=>!E(b,k))):!0);const A=T.columns.map(I=>I.name),N=d(T,this.wrap),O=[];for(const I of C){const k=p(I);k.columns=k.columns.filter(R=>R.expression||!E(b,R.name)),k.columns.length>0&&O.push(g(k,this.wrap))}return this.alter(N,O,A)}async dropForeign(b,w){const{createTable:C,createIndices:T}=await this.getTableSql(),A=f(C);A.table=this.alteredName,w||(A.columns=A.columns.map(O=>({...O,references:E(b,O.name)?null:O.references}))),A.constraints=A.constraints.filter(O=>O.type==="FOREIGN KEY"?w?!O.name||!y(O.name,w):O.columns.every(I=>!E(b,I)):!0);const N=d(A,this.wrap);return this.alter(N,T)}async dropPrimary(b){const{createTable:w,createIndices:C}=await this.getTableSql(),T=f(w);T.table=this.alteredName,T.columns=T.columns.map(N=>({...N,primary:null})),T.constraints=T.constraints.filter(N=>N.type==="PRIMARY KEY"?b?!N.name||!y(N.name,b):!1:!0);const A=d(T,this.wrap);return this.alter(A,C)}async primary(b,w){const{createTable:C,createIndices:T}=await this.getTableSql(),A=f(C);A.table=this.alteredName,A.columns=A.columns.map(O=>({...O,primary:null})),A.constraints=A.constraints.filter(O=>O.type!=="PRIMARY KEY"),A.constraints.push({type:"PRIMARY KEY",name:w||null,columns:b.map(O=>({name:O,expression:!1,collation:null,order:null})),conflict:null});const N=d(A,this.wrap);return this.alter(N,T)}async foreign(b){const{createTable:w,createIndices:C}=await this.getTableSql(),T=f(w);T.table=this.alteredName,T.constraints.push({type:"FOREIGN KEY",name:b.keyName||null,columns:b.column,references:{table:b.inTable,columns:b.references,delete:b.onDelete||null,update:b.onUpdate||null,match:null,deferrable:null}});const A=d(T,this.wrap);return this.generateAlterCommands(A,C)}async setNullable(b,w){const{createTable:C,createIndices:T}=await this.getTableSql(),A=f(C);A.table=this.alteredName;const N=A.columns.find(I=>y(b,I.name));if(!N)throw new Error(`.setNullable: Column ${b} does not exist in table ${this.tableName()}.`);N.constraints.notnull=w?null:{name:null,conflict:null},N.constraints.null=w?N.constraints.null:null;const O=d(A,this.wrap);return this.generateAlterCommands(O,T)}async alter(b,w,C){const T=await this.isForeignCheckEnabled();T&&await this.setForeignCheck(!1);try{await this.client.transaction(async A=>{await A.raw(b),await this.copyData(A,C),await this.dropOriginal(A),await this.renameTable(A);for(const N of w)await A.raw(N);if(T&&(await A.raw(h())).length>0)throw new Error("FOREIGN KEY constraint failed")},{connection:this.connection})}finally{T&&await this.setForeignCheck(!0)}}async generateAlterCommands(b,w,C){const T=[],A=[],N=[];let O=null;T.push(b),T.push(r(this.tableName(),this.alteredName,C)),T.push(s(this.tableName())),T.push(a(this.alteredName,this.tableName()));for(const k of w)T.push(k);return await this.isForeignCheckEnabled()&&(A.push(u(!1)),N.push(u(!0)),O=h()),{pre:A,sql:T,check:O,post:N}}}return lw=x,lw}var cw,XL;function mY(){if(XL)return cw;XL=1;const e=ni();return cw=class extends e{withMaterialized(r,s,a){return this._validateWithArgs(r,s,a,"with"),this.withWrapped(r,s,a,!0)}withNotMaterialized(r,s,a){return this._validateWithArgs(r,s,a,"with"),this.withWrapped(r,s,a,!1)}},cw}var fw,WL;function pP(){if(WL)return fw;WL=1;const e=ix(),n=ti(),{promisify:r}=nt,s=ia(),a=Ao(),o=eY(),l=tY(),u=iY(),h=sY(),f=aY(),p=oY(),d=pY(),g=Rh(),y=mY();class E extends s{constructor(v){super(v),v.connection&&v.connection.filename===void 0&&this.logger.warn("Could not find `connection.filename` in config. Please specify the database path and name to avoid errors. (see docs https://knexjs.org/guide/#configuration-options)"),v.useNullAsDefault===void 0&&this.logger.warn("sqlite does not support inserting default values. Set the `useNullAsDefault` flag to hide this warning. (see docs https://knexjs.org/guide/query-builder.html#insert).")}_driver(){return nt}schemaCompiler(){return new u(this,...arguments)}transaction(){return new o(this,...arguments)}queryCompiler(v,b){return new l(this,v,b)}queryBuilder(){return new y(this)}viewCompiler(v,b){return new p(this,v,b)}columnCompiler(){return new h(this,...arguments)}tableCompiler(){return new f(this,...arguments)}ddl(v,b,w){return new d(this,v,b,w)}wrapIdentifierImpl(v){return v!=="*"?`\`${v.replace(/`/g,"``")}\``:"*"}acquireRawConnection(){return new Promise((v,b)=>{let w=this.driver.OPEN_READWRITE|this.driver.OPEN_CREATE;if(this.connectionSettings.flags){if(!Array.isArray(this.connectionSettings.flags))throw new Error("flags must be an array of strings");this.connectionSettings.flags.forEach(T=>{if(!T.startsWith("OPEN_")||!this.driver[T])throw new Error(`flag ${T} not supported by node-sqlite3`);w=w|this.driver[T]})}const C=new this.driver.Database(this.connectionSettings.filename,w,T=>{if(T)return b(T);v(C)})})}async destroyRawConnection(v){return r(w=>v.close(w))()}_query(v,b){if(!b.sql)throw new Error("The query is empty");const{method:w}=b;let C;switch(w){case"insert":case"update":C=b.returning?"all":"run";break;case"counter":case"del":C="run";break;default:C="all"}return new Promise(function(T,A){if(!v||!v[C])return A(new Error(`Error calling ${C} on connection.`));v[C](b.sql,b.bindings,function(N,O){return N?A(N):(b.response=O,b.context=this,T(b))})})}_stream(v,b,w){if(!b.sql)throw new Error("The query is empty");const C=this;return new Promise(function(T,A){return w.on("error",A),w.on("end",T),C._query(v,b).then(N=>N.response).then(N=>N.forEach(O=>w.write(O))).catch(function(N){w.emit("error",N)}).then(function(){w.end()})})}processResponse(v,b){const w=v.context,{response:C,returning:T}=v;if(v.output)return v.output.call(b,C);switch(v.method){case"select":return C;case"first":return C[0];case"pluck":return n(C,v.pluck);case"insert":return T&&C?C:[w.lastID];case"update":return T&&C?C:w.changes;case"del":case"counter":return w.changes;default:return C}}poolDefaults(){return e({min:1,max:1},super.poolDefaults())}formatter(v){return new g(this,v)}values(v,b,w){return Array.isArray(v)?Array.isArray(v[0])?`( values ${v.map(C=>`(${this.parameterize(C,void 0,b,w)})`).join(", ")})`:`(${this.parameterize(v,void 0,b,w)})`:v instanceof a?`(${this.parameter(v,b,w)})`:this.parameter(v,b,w)}}return Object.assign(E.prototype,{dialect:"sqlite3",driverName:"sqlite3"}),fw=E,fw}var hw,JL;function gY(){if(JL)return hw;JL=1;const e=pP();class n extends e{_driver(){return nt}async acquireRawConnection(){const s=this.connectionSettings.options||{};return new this.driver(this.connectionSettings.filename,{nativeBinding:s.nativeBinding,readonly:!!s.readonly})}async destroyRawConnection(s){return s.close()}async _query(s,a){if(!a.sql)throw new Error("The query is empty");if(!s)throw new Error("No connection provided");const o=s.prepare(a.sql),l=this._formatBindings(a.bindings);if(o.reader){const h=await o.all(l);return a.response=h,a}const u=await o.run(l);return a.response=u,a.context={lastID:u.lastInsertRowid,changes:u.changes},a}_formatBindings(s){return s?s.map(a=>a instanceof Date?a.valueOf():typeof a=="boolean"?Number(a):a):[]}}return Object.assign(n.prototype,{driverName:"better-sqlite3"}),hw=n,hw}var dw,ZL;function mP(){if(ZL)return dw;ZL=1;const e=Ji();class n extends e{begin(s){const a=[this.isolationLevel?`ISOLATION LEVEL ${this.isolationLevel}`:"",this.readOnly?"READ ONLY":""].join(" ").trim();return a.length===0?this.query(s,"BEGIN;"):this.query(s,`BEGIN TRANSACTION ${a};`)}}return dw=n,dw}var pw,e$;function yx(){if(e$)return pw;e$=1;const e=tn(),n=Js(),r=na(),{wrapString:s,columnize:a,operator:o,wrap:l}=Vt();class u extends r{constructor(f,p,d){super(f,p,d),this._defaultInsertValue="default"}truncate(){return`truncate ${this.tableName} restart identity`}insert(){let f=super.insert();if(f==="")return f;const{returning:p,onConflict:d,ignore:g,merge:y,insert:E}=this.single;if(d&&g&&(f+=this._ignore(d)),d&&y){f+=this._merge(y.updates,d,E);const x=this.where();x&&(f+=` ${x}`)}return p&&(f+=this._returning(p)),{sql:f,returning:p}}update(){const f=this.with(),p=this._prepUpdate(this.single.update),d=this.where(),{returning:g,updateFrom:y}=this.single;return{sql:f+`update ${this.single.only?"only ":""}${this.tableName} set ${p.join(", ")}`+this._updateFrom(y)+(d?` ${d}`:"")+this._returning(g),returning:g}}using(){const f=this.single.using;if(!f)return;let p="using ";return Array.isArray(f)?p+=f.map(d=>this.formatter.wrap(d)).join(","):p+=this.formatter.wrap(f),p}del(){const{tableName:f}=this,p=this.with();let d=this.where()||"",g=this.using()||"";const y=this.grouped.join,E=[];if(Array.isArray(y)){for(const b of y){E.push(l(this._joinTable(b),void 0,this.builder,this.client,this.bindingsHolder));const w=[];for(const C of b.clauses)w.push(this.whereBasic({column:C.column,operator:"=",value:C.value,asColumn:!0}));w.length>0&&(d+=(d?" and ":"where ")+w.join(" and "))}E.length>0&&(g+=(g?",":"using ")+E.join(","))}const x=p+`delete from ${this.single.only?"only ":""}${f}`+(g?` ${g}`:"")+(d?` ${d}`:""),{returning:v}=this.single;return{sql:x+this._returning(v),returning:v}}aggregate(f){return this._aggregate(f,{distinctParentheses:!0})}_returning(f){return f?` returning ${this.formatter.columnize(f)}`:""}_updateFrom(f){return f?` from ${this.formatter.wrap(f)}`:""}_ignore(f){return f===!0?" on conflict do nothing":` on conflict ${this._onConflictClause(f)} do nothing`}_merge(f,p,d){let g=` on conflict ${this._onConflictClause(p)} do update set `;if(f&&Array.isArray(f))return g+=f.map(y=>s(y.split(".").pop(),this.formatter.builder,this.client,this.formatter)).map(y=>`${y} = excluded.${y}`).join(", "),g;if(f&&typeof f=="object"){const y=this._prepUpdate(f);return typeof y=="string"?g+=y:g+=y.join(","),g}else{const y=this._prepInsert(d);if(typeof y=="string")throw new Error("If using merge with a raw insert query, then updates must be provided");return g+=y.columns.map(E=>s(E.split(".").pop(),this.builder,this.client)).map(E=>`${E} = excluded.${E}`).join(", "),g}}_tableNames(f){const p=this.single.schema,d=[];for(let g=0;g<f.length;g++){let y=f[g];y&&(p&&(y=`${p}.${y}`),d.push(this.formatter.wrap(y)))}return d.join(", ")}_lockingClause(f){const p=this.single.lockTables||[];return f+(p.length?" of "+this._tableNames(p):"")}_groupOrder(f,p){return super._groupOrderNulls(f,p)}forUpdate(){return this._lockingClause("for update")}forShare(){return this._lockingClause("for share")}forNoKeyUpdate(){return this._lockingClause("for no key update")}forKeyShare(){return this._lockingClause("for key share")}skipLocked(){return"skip locked"}noWait(){return"nowait"}columnInfo(){const f=this.single.columnInfo;let p=this.single.schema;const d=this.client.customWrapIdentifier(this.single.table,e);p&&(p=this.client.customWrapIdentifier(p,e));const g="select * from information_schema.columns where table_name = ? and table_catalog = current_database()",y=[d];return this._buildColumnInfoQuery(p,g,y,f)}_buildColumnInfoQuery(f,p,d,g){return f?(p+=" and table_schema = ?",d.push(f)):p+=" and table_schema = current_schema()",{sql:p,bindings:d,output(y){const E=n(y.rows,function(x,v){return x[v.column_name]={type:v.data_type,maxLength:v.character_maximum_length,nullable:v.is_nullable==="YES",defaultValue:v.column_default},x},{});return g&&E[g]||E}}}distinctOn(f){return"distinct on ("+this.formatter.columnize(f)+") "}jsonExtract(f){return this._jsonExtract("jsonb_path_query",f)}jsonSet(f){return this._jsonSet("jsonb_set",Object.assign({},f,{path:this.client.toPathForJson(f.path)}))}jsonInsert(f){return this._jsonSet("jsonb_insert",Object.assign({},f,{path:this.client.toPathForJson(f.path)}))}jsonRemove(f){const p=`${a(f.column,this.builder,this.client,this.bindingsHolder)} #- ${this.client.parameter(this.client.toPathForJson(f.path),this.builder,this.bindingsHolder)}`;return f.alias?this.client.alias(p,this.formatter.wrap(f.alias)):p}whereJsonPath(f){let p="";return!isNaN(f.value)&&parseInt(f.value)?p="::int":!isNaN(f.value)&&parseFloat(f.value)?p="::float":p=" #>> '{}'",`jsonb_path_query_first(${this._columnClause(f)}, ${this.client.parameter(f.jsonPath,this.builder,this.bindingsHolder)})${p} ${o(f.operator,this.builder,this.client,this.bindingsHolder)} ${this._jsonValueClause(f)}`}whereJsonSupersetOf(f){return this._not(f,`${l(f.column,void 0,this.builder,this.client,this.bindingsHolder)} @> ${this._jsonValueClause(f)}`)}whereJsonSubsetOf(f){return this._not(f,`${a(f.column,this.builder,this.client,this.bindingsHolder)} <@ ${this._jsonValueClause(f)}`)}onJsonPathEquals(f){return this._onJsonPathEquals("jsonb_path_query_first",f)}}return pw=u,pw}var mw,t$;function yY(){if(t$)return mw;t$=1;const e=ni();return mw=class extends e{updateFrom(r){return this._single.updateFrom=r,this}using(r){return this._single.using=r,this}withMaterialized(r,s,a){return this._validateWithArgs(r,s,a,"with"),this.withWrapped(r,s,a,!0)}withNotMaterialized(r,s,a){return this._validateWithArgs(r,s,a,"with"),this.withWrapped(r,s,a,!1)}},mw}var gw,n$;function vx(){if(n$)return gw;n$=1;const e=ra(),{isObject:n}=mt(),{toNumber:r}=Qt(),s=new RegExp("(?<!')'(?!')","g");class a extends e{constructor(u,h,f){super(u,h,f),this.modifiers=["nullable","defaultTo","comment"],this._addCheckModifiers()}bit(u){return u.length!==!1?`bit(${u.length})`:"bit"}enu(u,h){h=h||{};const f=h.useNative&&h.existingType?void 0:u.join("', '");if(h.useNative){let p="";const d=h.schemaName||this.tableCompiler.schemaNameRaw;return d&&(p+=`"${d}".`),p+=`"${h.enumName}"`,h.existingType||this.tableCompiler.unshiftQuery(`create type ${p} as enum ('${f}')`),p}return`text check (${this.formatter.wrap(this.args[0])} in ('${f}'))`}decimal(u,h){return u===null?"decimal":`decimal(${r(u,8)}, ${r(h,2)})`}json(u){return u&&this.client.logger.deprecate("json(true)","jsonb()"),o(this.client,u)}jsonb(){return o(this.client,!0)}checkRegex(u,h){return this._check(`${this.formatter.wrap(this.getColumnName())} ~ ${this.client._escapeBinding(u)}`,h)}datetime(u=!1,h){let f;return n(u)?{useTz:f,precision:h}=u:f=!u,f=typeof f=="boolean"?f:!0,h=h!=null?"("+h+")":"",`${f?"timestamptz":"timestamp"}${h}`}timestamp(u=!1,h){return this.datetime(u,h)}comment(u){const h=this.args[0]||this.defaults("columnName"),f=u?`'${u.replace(s,"''")}'`:"NULL";this.pushAdditional(function(){this.pushQuery(`comment on column ${this.tableCompiler.tableName()}.`+this.formatter.wrap(h)+` is ${f}`)},u)}increments(u={primaryKey:!0}){return"serial"+(this.tableCompiler._canBeAddPrimaryKey(u)?" primary key":"")}bigincrements(u={primaryKey:!0}){return"bigserial"+(this.tableCompiler._canBeAddPrimaryKey(u)?" primary key":"")}uuid(u={primaryKey:!1}){return"uuid"+(this.tableCompiler._canBeAddPrimaryKey(u)?" primary key":"")}}a.prototype.bigint="bigint",a.prototype.binary="bytea",a.prototype.bool="boolean",a.prototype.double="double precision",a.prototype.floating="real",a.prototype.smallint="smallint",a.prototype.tinyint="smallint";function o(l,u){return!l.version||l.config.client==="cockroachdb"||l.config.jsonbSupport===!0||parseFloat(l.version)>=9.2?u?"jsonb":"json":"text"}return gw=a,gw}var yw,r$;function bx(){if(r$)return yw;r$=1;const e=To(),n=Ro(),{isObject:r,isString:s}=mt();class a extends n{constructor(l,u){super(l,u)}renameColumn(l,u){return this.pushQuery({sql:`alter table ${this.tableName()} rename ${this.formatter.wrap(l)} to ${this.formatter.wrap(u)}`})}_setNullableState(l,u){const h=u?"drop not null":"set not null",f=`alter table ${this.tableName()} alter column ${this.formatter.wrap(l)} ${h}`;return this.pushQuery({sql:f})}compileAdd(l){const u=this.formatter.wrap(l),h=this.prefixArray("add column",this.getColumns(l));return this.pushQuery({sql:`alter table ${u} ${h.join(", ")}`})}createQuery(l,u,h){const f=u?"create table if not exists ":"create table ",p=` (${l.sql.join(", ")}${this.primaryKeys()||""}${this._addChecks()})`;let d=f+this.tableName()+(h&&this.tableNameLike()?" (like "+this.tableNameLike()+" including all"+(l.sql.length?", "+l.sql.join(", "):"")+")":p);this.single.inherits&&(d+=` inherits (${this.formatter.wrap(this.single.inherits)})`),this.pushQuery({sql:d,bindings:l.bindings}),e(this.single,"comment")&&this.comment(this.single.comment)}primaryKeys(){const l=(this.grouped.alterTable||[]).filter(u=>u.method==="primary");if(l.length>0&&l[0].args.length>0){const u=l[0].args[0];let h=l[0].args[1]||"",f;return r(h)&&({constraintName:h,deferrable:f}=h),f=f?` deferrable initially ${f}`:"",h=h?this.formatter.wrap(h):this.formatter.wrap(`${this.tableNameRaw}_pkey`),`, constraint ${h} primary key (${this.formatter.columnize(u)})${f}`}}addColumns(l,u,h){if(u===this.alterColumnsPrefix)for(const f of h)this._addColumn(f);else super.addColumns(l,u)}_addColumn(l){const u=this.tableName(),h=l.getColumnType(),f=this.client.wrapIdentifier(l.getColumnName(),l.columnBuilder.queryContext()),p=l.type==="enu";this.pushQuery({sql:`alter table ${u} alter column ${f} drop default`,bindings:[]});const d=l.columnBuilder.alterNullable;d&&this.pushQuery({sql:`alter table ${u} alter column ${f} drop not null`,bindings:[]}),l.columnBuilder.alterType&&this.pushQuery({sql:`alter table ${u} alter column ${f} type ${h} using (${f}${p?"::text::":"::"}${h})`,bindings:[]});const y=l.modified.defaultTo;if(y){const E=l.defaultTo.apply(l,y);this.pushQuery({sql:`alter table ${u} alter column ${f} set ${E}`,bindings:[]})}if(d){const E=l.modified.nullable;E&&E[0]===!1&&this.pushQuery({sql:`alter table ${u} alter column ${f} set not null`,bindings:[]})}}comment(l){this.pushQuery(`comment on table ${this.tableName()} is '${this.single.comment}'`)}primary(l,u){let h;r(u)&&({constraintName:u,deferrable:h}=u),h=h?` deferrable initially ${h}`:"",u=u?this.formatter.wrap(u):this.formatter.wrap(`${this.tableNameRaw}_pkey`),this.method!=="create"&&this.method!=="createIfNot"&&this.pushQuery(`alter table ${this.tableName()} add constraint ${u} primary key (${this.formatter.columnize(l)})${h}`)}unique(l,u){let h,f=!0,p;if(r(u)&&({indexName:u,deferrable:h,useConstraint:f,predicate:p}=u,f===void 0&&(f=!!h||!p)),!f&&h&&h!=="not deferrable")throw new Error("postgres cannot create deferrable index");if(f&&p)throw new Error("postgres cannot create constraint with predicate");if(h=h?` deferrable initially ${h}`:"",u=u?this.formatter.wrap(u):this._indexCommand("unique",this.tableNameRaw,l),f)this.pushQuery(`alter table ${this.tableName()} add constraint ${u} unique (`+this.formatter.columnize(l)+")"+h);else{const d=p?" "+this.client.queryCompiler(p).where():"";this.pushQuery(`create unique index ${u} on ${this.tableName()} (${this.formatter.columnize(l)})${d}`)}}index(l,u,h){u=u?this.formatter.wrap(u):this._indexCommand("index",this.tableNameRaw,l);let f,p,d;s(h)?p=h:r(h)&&({indexType:d,storageEngineIndexType:p,predicate:f}=h);const g=f?" "+this.client.queryCompiler(f).where():"";this.pushQuery(`create${typeof d=="string"&&d.toLowerCase()==="unique"?" unique":""} index ${u} on ${this.tableName()}${p&&` using ${p}`||""} (`+this.formatter.columnize(l)+`)${g}`)}dropPrimary(l){l=l?this.formatter.wrap(l):this.formatter.wrap(this.tableNameRaw+"_pkey"),this.pushQuery(`alter table ${this.tableName()} drop constraint ${l}`)}dropIndex(l,u){u=u?this.formatter.wrap(u):this._indexCommand("index",this.tableNameRaw,l),u=this.schemaNameRaw?`${this.formatter.wrap(this.schemaNameRaw)}.${u}`:u,this.pushQuery(`drop index ${u}`)}dropUnique(l,u){u=u?this.formatter.wrap(u):this._indexCommand("unique",this.tableNameRaw,l),this.pushQuery(`alter table ${this.tableName()} drop constraint ${u}`)}dropForeign(l,u){u=u?this.formatter.wrap(u):this._indexCommand("foreign",this.tableNameRaw,l),this.pushQuery(`alter table ${this.tableName()} drop constraint ${u}`)}}return yw=a,yw}var vw,i$;function _x(){if(i$)return vw;i$=1;const e=Oo();class n extends e{constructor(s,a){super(s,a)}renameColumn(s,a){return this.pushQuery({sql:`alter view ${this.viewName()} rename ${this.formatter.wrap(s)} to ${this.formatter.wrap(a)}`})}defaultTo(s,a){return this.pushQuery({sql:`alter view ${this.viewName()} alter ${this.formatter.wrap(s)} set default ${a}`})}createOrReplace(){this.createQuery(this.columns,this.selectQuery,!1,!0)}createMaterializedView(){this.createQuery(this.columns,this.selectQuery,!0)}}return vw=n,vw}var bw,s$;function vY(){if(s$)return bw;s$=1;const e=ql();class n extends e{constructor(){super(...arguments)}checkOption(){this._single.checkOption="default_option"}localCheckOption(){this._single.checkOption="local"}cascadedCheckOption(){this._single.checkOption="cascaded"}}return bw=n,bw}var _w,a$;function gP(){if(a$)return _w;a$=1;const e=No();class n extends e{constructor(s,a){super(s,a)}hasTable(s){let a="select * from information_schema.tables where table_name = ?";const o=[s];this.schema?(a+=" and table_schema = ?",o.push(this.schema)):a+=" and table_schema = current_schema()",this.pushQuery({sql:a,bindings:o,output(l){return l.rows.length>0}})}hasColumn(s,a){let o="select * from information_schema.columns where table_name = ? and column_name = ?";const l=[s,a];this.schema?(o+=" and table_schema = ?",l.push(this.schema)):o+=" and table_schema = current_schema()",this.pushQuery({sql:o,bindings:l,output(u){return u.rows.length>0}})}qualifiedTableName(s){const a=this.schema?`${this.schema}.${s}`:s;return this.formatter.wrap(a)}renameTable(s,a){this.pushQuery(`alter table ${this.qualifiedTableName(s)} rename to ${this.formatter.wrap(a)}`)}createSchema(s){this.pushQuery(`create schema ${this.formatter.wrap(s)}`)}createSchemaIfNotExists(s){this.pushQuery(`create schema if not exists ${this.formatter.wrap(s)}`)}dropSchema(s,a=!1){this.pushQuery(`drop schema ${this.formatter.wrap(s)}${a?" cascade":""}`)}dropSchemaIfExists(s,a=!1){this.pushQuery(`drop schema if exists ${this.formatter.wrap(s)}${a?" cascade":""}`)}dropExtension(s){this.pushQuery(`drop extension ${this.formatter.wrap(s)}`)}dropExtensionIfExists(s){this.pushQuery(`drop extension if exists ${this.formatter.wrap(s)}`)}createExtension(s){this.pushQuery(`create extension ${this.formatter.wrap(s)}`)}createExtensionIfNotExists(s){this.pushQuery(`create extension if not exists ${this.formatter.wrap(s)}`)}renameView(s,a){this.pushQuery(this.alterViewPrefix+`${this.formatter.wrap(s)} rename to ${this.formatter.wrap(a)}`)}refreshMaterializedView(s,a=!1){this.pushQuery({sql:`refresh materialized view${a?" concurrently":""} ${this.formatter.wrap(s)}`})}dropMaterializedView(s){this._dropView(s,!1,!0)}dropMaterializedViewIfExists(s){this._dropView(s,!0,!0)}}return _w=n,_w}var ww,o$;function Oh(){if(o$)return ww;o$=1;const e=Ah(),n=ti(),{promisify:r}=nt,s=ia(),a=mP(),o=yx(),l=yY(),u=vx(),h=bx(),f=_x(),p=vY(),d=gP(),{makeEscape:g}=cx(),{isString:y}=mt();class E extends s{constructor(b){super(b),b.returning&&(this.defaultReturning=b.returning),b.searchPath&&(this.searchPath=b.searchPath)}transaction(){return new a(this,...arguments)}queryBuilder(){return new l(this)}queryCompiler(b,w){return new o(this,b,w)}columnCompiler(){return new u(this,...arguments)}schemaCompiler(){return new d(this,...arguments)}tableCompiler(){return new h(this,...arguments)}viewCompiler(){return new f(this,...arguments)}viewBuilder(){return new p(this,...arguments)}_driver(){return nt}wrapIdentifierImpl(b){if(b==="*")return b;let w="";const C=b.match(/(.*?)(\[[0-9]+\])/);return C&&(b=C[1],w=C[2]),`"${b.replace(/"/g,'""')}"${w}`}_acquireOnlyConnection(){const b=new this.driver.Client(this.connectionSettings);return b.on("error",w=>{b.__knex__disposed=w}),b.on("end",w=>{b.__knex__disposed=w||"Connection ended unexpectedly"}),b.connect().then(()=>b)}acquireRawConnection(){const b=this;return this._acquireOnlyConnection().then(function(w){return b.version?w:b.checkVersion(w).then(function(C){return b.version=C,w})}).then(async function(C){return await b.setSchemaSearchPath(C),C})}async destroyRawConnection(b){return r(C=>b.end(C))()}checkVersion(b){return new Promise((w,C)=>{b.query("select version();",(T,A)=>{if(T)return C(T);w(this._parseVersion(A.rows[0].version))})})}_parseVersion(b){return/^PostgreSQL (.*?)( |$)/.exec(b)[1]}positionBindings(b){let w=0;return b.replace(/(\\*)(\?)/g,function(C,T){return T.length%2?"?":(w++,`$${w}`)})}setSchemaSearchPath(b,w){let C=w||this.searchPath;if(!C)return Promise.resolve(!0);if(!Array.isArray(C)&&!y(C))throw new TypeError(`knex: Expected searchPath to be Array/String, got: ${typeof C}`);if(y(C)){if(C.includes(",")){const A=`[${C.split(",").map(N=>`'${N}'`).join(", ")}]`;this.logger.warn(`Detected comma in searchPath "${C}".If you are trying to specify multiple schemas, use Array syntax: ${A}`)}C=[C]}return C=C.map(T=>`"${T}"`).join(","),new Promise(function(T,A){b.query(`set search_path to ${C}`,function(N){if(N)return A(N);T(!0)})})}_stream(b,w,C,T){if(!w.sql)throw new Error("The query is empty");const A=process.browser?void 0:nt,N=w.sql;return new Promise(function(O,I){const k=b.query(new A(N,w.bindings,T),R=>{I(R)});k.on("error",function(R){I(R),C.emit("error",R)}),C.on("end",O),k.pipe(C)})}_query(b,w){if(!w.sql)throw new Error("The query is empty");let C={text:w.sql,values:w.bindings||[]};return w.options&&(C=e(C,w.options)),new Promise(function(T,A){b.query(C,function(N,O){if(N)return A(N);w.response=O,T(w)})})}processResponse(b,w){const C=b.response;if(b.output)return b.output.call(w,C);if(b.method==="raw")return C;const{returning:T}=b;if(C.command==="SELECT")return b.method==="first"?C.rows[0]:b.method==="pluck"?n(C.rows,b.pluck):C.rows;if(T){const A=[];for(let N=0,O=C.rows.length;N<O;N++){const I=C.rows[N];A[N]=I}return A}return C.command==="UPDATE"||C.command==="DELETE"?C.rowCount:C}async cancelQuery(b){const w=await this.acquireRawConnection();try{return await this._wrappedCancelQueryCall(w,b)}finally{await this.destroyRawConnection(w).catch(C=>{this.logger.warn(`Connection Error: ${C}`)})}}_wrappedCancelQueryCall(b,w){return this._query(b,{sql:"SELECT pg_cancel_backend($1);",bindings:[w.processID],options:{}})}toPathForJson(b){const w=/^{.*}$/;return b.match(w)?b:"{"+b.replace(/^(\$\.)/,"").replace(".",",").replace(/\[([0-9]+)]/,",$1")+"}"}}Object.assign(E.prototype,{dialect:"postgresql",driverName:"pg",canCancelQuery:!0,_escapeBinding:g({escapeArray(v,b){return b(x(v,b))},escapeString(v){let b=!1,w="'";for(let C=0;C<v.length;C++){const T=v[C];T==="'"?w+=T+T:T==="\\"?(w+=T+T,b=!0):w+=T}return w+="'",b===!0&&(w="E"+w),w},escapeObject(v,b,w,C=[]){if(v&&typeof v.toPostgres=="function"){if(C=C||[],C.indexOf(v)!==-1)throw new Error(`circular reference detected while preparing "${v}" for query`);return C.push(v),b(v.toPostgres(b),C)}return JSON.stringify(v)}})});function x(v,b){let w="{";for(let C=0;C<v.length;C++){C>0&&(w+=",");const T=v[C];T===null||typeof T>"u"?w+="NULL":Array.isArray(T)?w+=x(T,b):typeof T=="number"?w+=T:w+=JSON.stringify(typeof T=="string"?T:b(T))}return w+"}"}return ww=E,ww}var Ew,u$;function bY(){if(u$)return Ew;u$=1;const e=yx(),{columnize:n,wrap:r,operator:s}=Vt();class a extends e{truncate(){return`truncate ${this.tableName}`}upsert(){let l=this._upsert();if(l==="")return l;const{returning:u}=this.single;return u&&(l+=this._returning(u)),{sql:l,returning:u}}_upsert(){const l=this.single.upsert||[],u=this.with()+`upsert into ${this.tableName} `,h=this._insertBody(l);return h===""?"":u+h}_groupOrder(l,u){return this._basicGroupOrder(l,u)}whereJsonPath(l){let u="";return!isNaN(l.value)&&parseInt(l.value)?u="::int":!isNaN(l.value)&&parseFloat(l.value)?u="::float":u=" #>> '{}'",`json_extract_path(${this._columnClause(l)}, ${this.client.toArrayPathFromJsonPath(l.jsonPath,this.builder,this.bindingsHolder)})${u} ${s(l.operator,this.builder,this.client,this.bindingsHolder)} ${this._jsonValueClause(l)}`}_jsonExtract(l,u){let h;return Array.isArray(u.column)?h=u.column:h=[u],h.map(f=>{const p=`json_extract_path(${n(f.column||f[0],this.builder,this.client,this.bindingsHolder)}, ${this.client.toArrayPathFromJsonPath(f.path||f[1],this.builder,this.bindingsHolder)})`,d=f.alias||f[2];return d?this.client.alias(p,this.formatter.wrap(d)):p}).join(", ")}_onJsonPathEquals(l,u){return"json_extract_path("+r(u.columnFirst,void 0,this.builder,this.client,this.bindingsHolder)+", "+this.client.toArrayPathFromJsonPath(u.jsonPathFirst,this.builder,this.bindingsHolder)+") = json_extract_path("+r(u.columnSecond,void 0,this.builder,this.client,this.bindingsHolder)+", "+this.client.toArrayPathFromJsonPath(u.jsonPathSecond,this.builder,this.bindingsHolder)+")"}}return Ew=a,Ew}var Cw,l$;function _Y(){if(l$)return Cw;l$=1;const e=vx();class n extends e{uuid(s={primaryKey:!1}){return"uuid"+(this.tableCompiler._canBeAddPrimaryKey(s)?" primary key default gen_random_uuid()":"")}}return Cw=n,Cw}var xw,c$;function wY(){if(c$)return xw;c$=1;const e=bx();class n extends e{constructor(s,a){super(s,a)}addColumns(s,a,o){if(a===this.alterColumnsPrefix)for(const l of o)this.client.logger.warn("Experimental alter column in use, see issue: https://github.com/cockroachdb/cockroach/issues/49329"),this.pushQuery({sql:"SET enable_experimental_alter_column_type_general = true",bindings:[]}),super._addColumn(l);else super.addColumns(s,a)}dropUnique(s,a){a=a?this.formatter.wrap(a):this._indexCommand("unique",this.tableNameRaw,s),this.pushQuery(`drop index ${this.tableName()}@${a} cascade `)}}return xw=n,xw}var Sw,f$;function EY(){if(f$)return Sw;f$=1;const e=_x();class n extends e{renameColumn(s,a){throw new Error("rename column of views is not supported by this dialect.")}defaultTo(s,a){throw new Error("change default values of views is not supported by this dialect.")}}return Sw=n,Sw}var Tw,h$;function CY(){if(h$)return Tw;h$=1;const e=ni(),n=qn();return Tw=class extends e{upsert(s,a,o){return this._method="upsert",n(a)||this.returning(a,o),this._single.upsert=s,this}},Tw}var qw,d$;function xY(){if(d$)return qw;d$=1;const e=Oh(),n=mP(),r=bY(),s=_Y(),a=wY(),o=EY(),l=CY();class u extends e{transaction(){return new n(this,...arguments)}queryCompiler(f,p){return new r(this,f,p)}columnCompiler(){return new s(this,...arguments)}tableCompiler(){return new a(this,...arguments)}viewCompiler(){return new o(this,...arguments)}queryBuilder(){return new l(this)}_parseVersion(f){return f.split(" ")[2]}async cancelQuery(f){try{return await this._wrappedCancelQueryCall(null,f)}catch(p){throw this.logger.warn(`Connection Error: ${p}`),p}}_wrappedCancelQueryCall(f,p){if(!(p.activeQuery.processID===0&&p.activeQuery.secretKey===0))return p.cancel(p,p.activeQuery)}toArrayPathFromJsonPath(f,p,d){return f.replace(/^(\$\.)/,"").replace(/\[([0-9]+)]/,".$1").split(".").map((function(g){return this.parameter(g,p,d)}).bind(this)).join(", ")}}return Object.assign(u.prototype,{driverName:"cockroachdb"}),qw=u,qw}var Aw,p$;function SY(){if(p$)return Aw;p$=1;function e(n){return n==null}return Aw=e,Aw}var Nw,m$;function TY(){if(m$)return Nw;m$=1;const e=Rh();class n extends e{columnizeWithPrefix(s,a){const o=typeof a=="string"?[a]:a;let l="",u=-1;for(;++u<o.length;)u>0&&(l+=", "),l+=s+this.wrap(o[u]);return l}escapingStringDelimiters(s){return(s||"").replace(/'/g,"''")}}return Nw=n,Nw}var Rw,g$;function qY(){if(g$)return Rw;g$=1;const e=Ji(),n=tr()("knex:tx");class r extends e{begin(u){return n("transaction::begin id=%s",this.txid),new Promise((h,f)=>{u.beginTransaction(p=>{if(p)return n("transaction::begin error id=%s message=%s",this.txid,p.message),f(p);h()},this.outerTx?this.txid:void 0,s(this.isolationLevel))}).then(this._resolver,this._rejecter)}savepoint(u){return n("transaction::savepoint id=%s",this.txid),new Promise((h,f)=>{u.saveTransaction(p=>{if(p)return n("transaction::savepoint id=%s message=%s",this.txid,p.message),f(p);this.trxClient.emit("query",{__knexUid:this.trxClient.__knexUid,__knexTxId:this.trxClient.__knexTxId,autogenerated:!0,sql:this.outerTx?`SAVE TRANSACTION [${this.txid}]`:"SAVE TRANSACTION"}),h()},this.outerTx?this.txid:void 0)})}commit(u,h){return n("transaction::commit id=%s",this.txid),new Promise((f,p)=>{u.commitTransaction(d=>{if(d)return n("transaction::commit error id=%s message=%s",this.txid,d.message),p(d);this._completed=!0,f(h)},this.outerTx?this.txid:void 0)}).then(()=>this._resolver(h),this._rejecter)}release(u,h){return this._resolver(h)}rollback(u,h){return this._completed=!0,n("transaction::rollback id=%s",this.txid),new Promise((f,p)=>{if(!u.inTransaction)return p(h||new Error("Transaction rejected with non-error: undefined"));if(u.state.name!=="LoggedIn")return p(new Error("Can't rollback transaction. There is a request in progress"));u.rollbackTransaction(d=>{d&&n("transaction::rollback error id=%s message=%s",this.txid,d.message),p(d||h||new Error("Transaction rejected with non-error: undefined"))},this.outerTx?this.txid:void 0)}).catch(f=>{if(!h&&this.doNotRejectOnRollback){this._resolver();return}if(h)try{f.originalError=h}catch{}this._rejecter(f)})}rollbackTo(u,h){return this.rollback(u,h).then(()=>void this.trxClient.emit("query",{__knexUid:this.trxClient.__knexUid,__knexTxId:this.trxClient.__knexTxId,autogenerated:!0,sql:"ROLLBACK TRANSACTION"}))}}Rw=r;function s(l){if(!l)return;l=l.toUpperCase().replace(" ","_");const u=a[l];if(!u)throw new Error(`Unknown Isolation level, was expecting one of: ${JSON.stringify(o)}`);return u}const a={READ_UNCOMMITTED:1,READ_COMMITTED:2,REPEATABLE_READ:3,SERIALIZABLE:4,SNAPSHOT:5},o=Object.keys(a).map(l=>l.toLowerCase().replace("_"," "));return Rw}var Ow,y$;function AY(){if(y$)return Ow;y$=1;const e=na(),n=gx(),r=tn(),s=qn(),a=Ao(),{columnize:o}=Vt(),l=["comments","columns","join","lock","where","union","group","having","order","limit","offset"];class u extends e{constructor(f,p,d){super(f,p,d);const{onConflict:g}=this.single;if(g)throw new Error(".onConflict() is not supported for mssql.");this._emptyInsertValue="default values"}with(){const f=[];if(this.grouped.with)for(const d of this.grouped.with)d.recursive&&(f.push(d),d.recursive=!1);const p=super.with();for(const d of f)d.recursive=!0;return p}select(){const f=this.with(),p=l.map(d=>this[d](this));return f+n(p).join(" ")}insert(){return this.single.options&&this.single.options.includeTriggerModifications?this.insertWithTriggers():this.standardInsert()}insertWithTriggers(){const f=this.single.insert||[],{returning:p}=this.single;let d=this.with()+`${this._buildTempTable(p)}insert into ${this.tableName} `;const g=p?this._returning("insert",p,!0)+" ":"";if(Array.isArray(f)){if(f.length===0)return""}else if(typeof f=="object"&&s(f))return{sql:d+g+this._emptyInsertValue+this._buildReturningSelect(p),returning:p};return d+=this._buildInsertData(f,g),p&&(d+=this._buildReturningSelect(p)),{sql:d,returning:p}}_buildInsertData(f,p){let d="";const g=this._prepInsert(f);if(typeof g=="string")d+=g;else if(g.columns.length)d+=`(${this.formatter.columnize(g.columns)}`,d+=`) ${p}values (`+this._buildInsertValues(g)+")";else if(f.length===1&&f[0])d+=p+this._emptyInsertValue;else return"";return d}standardInsert(){const f=this.single.insert||[];let p=this.with()+`insert into ${this.tableName} `;const{returning:d}=this.single,g=d?this._returning("insert",d)+" ":"";if(Array.isArray(f)){if(f.length===0)return""}else if(typeof f=="object"&&s(f))return{sql:p+g+this._emptyInsertValue,returning:d};return p+=this._buildInsertData(f,g),{sql:p,returning:d}}update(){return this.single.options&&this.single.options.includeTriggerModifications?this.updateWithTriggers():this.standardUpdate()}updateWithTriggers(){const f=this.top(),p=this.with(),d=this._prepUpdate(this.single.update),g=this.join(),y=this.where(),E=this.order(),{returning:x}=this.single,v=this._buildTempTable(x);return{sql:p+v+`update ${f?f+" ":""}${this.tableName} set `+d.join(", ")+(x?` ${this._returning("update",x,!0)}`:"")+(g?` from ${this.tableName} ${g}`:"")+(y?` ${y}`:"")+(E?` ${E}`:"")+(x?this._buildReturningSelect(x):this._returning("rowcount","@@rowcount")),returning:x||"@@rowcount"}}_formatGroupsItemValue(f,p){const d=super._formatGroupsItemValue(f);if(p&&!(f instanceof a)){const g=`IIF(${d} is null,`;if(p==="first")return`${g}0,1)`;if(p==="last")return`${g}1,0)`}return d}standardUpdate(){const f=this.top(),p=this.with(),d=this._prepUpdate(this.single.update),g=this.join(),y=this.where(),E=this.order(),{returning:x}=this.single;return{sql:p+`update ${f?f+" ":""}${this.tableName} set `+d.join(", ")+(x?` ${this._returning("update",x)}`:"")+(g?` from ${this.tableName} ${g}`:"")+(y?` ${y}`:"")+(E?` ${E}`:"")+(x?"":this._returning("rowcount","@@rowcount")),returning:x||"@@rowcount"}}del(){return this.single.options&&this.single.options.includeTriggerModifications?this.deleteWithTriggers():this.standardDelete()}deleteWithTriggers(){const f=this.with(),{tableName:p}=this,d=this.where(),g=this.join(),{returning:y}=this.single,E=y?` ${this._returning("del",y,!0)}`:"",x=g?`${p}${E} `:"";return{sql:f+`${this._buildTempTable(y)}delete ${x}from ${p}`+(g?"":E)+(g?` ${g}`:"")+(d?` ${d}`:"")+(y?this._buildReturningSelect(y):this._returning("rowcount","@@rowcount")),returning:y||"@@rowcount"}}standardDelete(){const f=this.with(),{tableName:p}=this,d=this.where(),g=this.join(),{returning:y}=this.single,E=y?` ${this._returning("del",y)}`:"",x=g?`${p}${E} `:"";return{sql:f+`delete ${x}from ${p}`+(g?"":E)+(g?` ${g}`:"")+(d?` ${d}`:"")+(y?"":this._returning("rowcount","@@rowcount")),returning:y||"@@rowcount"}}columns(){let f="";if(this.onlyUnions())return"";const p=this.top(),d=this._hintComments(),g=this.grouped.columns||[];let y=-1,E=[];if(g)for(;++y<g.length;){const v=g[y];if(v.distinct&&(f="distinct "),v.distinctOn){f=this.distinctOn(v.value);continue}v.type==="aggregate"?E.push(...this.aggregate(v)):v.type==="aggregateRaw"?E.push(this.aggregateRaw(v)):v.type==="analytic"?E.push(this.analytic(v)):v.type==="json"?E.push(this.json(v)):v.value&&v.value.length>0&&E.push(this.formatter.columnize(v.value))}return E.length===0&&(E=["*"]),`${this.onlyJson()?"":"select "}${d}${f}`+(p?p+" ":"")+E.join(", ")+(this.tableName?` from ${this.tableName}`:"")}_returning(f,p,d){switch(f){case"update":case"insert":return p?`output ${this.formatter.columnizeWithPrefix("inserted.",p)}${d?" into #out":""}`:"";case"del":return p?`output ${this.formatter.columnizeWithPrefix("deleted.",p)}${d?" into #out":""}`:"";case"rowcount":return p?";select @@rowcount":""}}_buildTempTable(f){if(f&&f.length>0){let p="";Array.isArray(f)?p=f.map(g=>`[t].${this.formatter.columnize(g)}`).join(","):p=`[t].${this.formatter.columnize(f)}`;let d=`select top(0) ${p} into #out `;return d+=`from ${this.tableName} as t `,d+=`left join ${this.tableName} on 0=1;`,d}return""}_buildReturningSelect(f){if(f&&f.length>0){let p="";Array.isArray(f)?p=f.map(g=>`${this.formatter.columnize(g)}`).join(","):p=this.formatter.columnize(f);let d=`; select ${p} from #out; `;return d+="drop table #out;",d}return""}truncate(){return`truncate table ${this.tableName}`}forUpdate(){return"with (UPDLOCK)"}forShare(){return"with (HOLDLOCK)"}columnInfo(){const f=this.single.columnInfo;let p=this.single.schema;const d=this.client.customWrapIdentifier(this.single.table,r);p&&(p=this.client.customWrapIdentifier(p,r));let g="select [COLUMN_NAME], [COLUMN_DEFAULT], [DATA_TYPE], [CHARACTER_MAXIMUM_LENGTH], [IS_NULLABLE] from INFORMATION_SCHEMA.COLUMNS where table_name = ? and table_catalog = ?";const y=[d,this.client.database()];return p?(g+=" and table_schema = ?",y.push(p)):g+=" and table_schema = 'dbo'",{sql:g,bindings:y,output(E){const x=E.reduce((v,b)=>(v[b[0].value]={defaultValue:b[1].value,type:b[2].value,maxLength:b[3].value,nullable:b[4].value==="YES"},v),{});return f&&x[f]||x}}}top(){const f=!this.single.limit&&this.single.limit!==0,p=!this.single.offset;return f||!p?"":`top (${this._getValueOrParameterFromAttribute("limit")})`}limit(){return""}offset(){const f=!this.single.limit&&this.single.limit!==0,p=!this.single.offset;if(p)return"";let d=`offset ${p?"0":this._getValueOrParameterFromAttribute("offset")} rows`;return f||(d+=` fetch next ${this._getValueOrParameterFromAttribute("limit")} rows only`),d}whereLike(f){return`${this._columnClause(f)} collate SQL_Latin1_General_CP1_CS_AS ${this._not(f,"like ")}${this._valueClause(f)}`}whereILike(f){return`${this._columnClause(f)} collate SQL_Latin1_General_CP1_CI_AS ${this._not(f,"like ")}${this._valueClause(f)}`}jsonExtract(f){return this._jsonExtract(f.singleValue?"JSON_VALUE":"JSON_QUERY",f)}jsonSet(f){return this._jsonSet("JSON_MODIFY",f)}jsonInsert(f){return this._jsonSet("JSON_MODIFY",f)}jsonRemove(f){const p=`JSON_MODIFY(${o(f.column,this.builder,this.client,this.bindingsHolder)},${this.client.parameter(f.path,this.builder,this.bindingsHolder)}, NULL)`;return f.alias?this.client.alias(p,this.formatter.wrap(f.alias)):p}whereJsonPath(f){return this._whereJsonPath("JSON_VALUE",f)}whereJsonSupersetOf(f){throw new Error("Json superset where clause not actually supported by MSSQL")}whereJsonSubsetOf(f){throw new Error("Json subset where clause not actually supported by MSSQL")}_getExtracts(f,p){const d=o(f.column,this.builder,this.client,this.bindingsHolder);return(Array.isArray(f.values)?f.values:[f.values]).map(function(g){return"JSON_VALUE("+d+","+this.client.parameter(g,this.builder,this.bindingsHolder)+")"},this).join(p)}onJsonPathEquals(f){return this._onJsonPathEquals("JSON_VALUE",f)}}return Ow=u,Ow}var Mw,v$;function NY(){if(v$)return Mw;v$=1;const e=No();class n extends e{constructor(a,o){super(a,o)}dropTableIfExists(a){const o=this.formatter.wrap(r(this.schema,a));this.pushQuery(`if object_id('${o}', 'U') is not null DROP TABLE ${o}`)}dropViewIfExists(a){const o=this.formatter.wrap(r(this.schema,a));this.pushQuery(`if object_id('${o}', 'V') is not null DROP VIEW ${o}`)}renameTable(a,o){this.pushQuery(`exec sp_rename ${this.client.parameter(r(this.schema,a),this.builder,this.bindingsHolder)}, ${this.client.parameter(o,this.builder,this.bindingsHolder)}`)}renameView(a,o){this.pushQuery(`exec sp_rename ${this.client.parameter(r(this.schema,a),this.builder,this.bindingsHolder)}, ${this.client.parameter(o,this.builder,this.bindingsHolder)}`)}hasTable(a){const o=this.client.parameter(r(this.schema,a),this.builder,this.bindingsHolder),l=[a];let u=`SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = ${o}`;this.schema&&(u+=" AND TABLE_SCHEMA = ?",l.push(this.schema)),this.pushQuery({sql:u,bindings:l,output:h=>h.length>0})}hasColumn(a,o){const l=this.client.parameter(o,this.builder,this.bindingsHolder),u=this.client.parameter(this.formatter.wrap(r(this.schema,a)),this.builder,this.bindingsHolder),h=`select object_id from sys.columns where name = ${l} and object_id = object_id(${u})`;this.pushQuery({sql:h,output:f=>f.length>0})}}n.prototype.dropTablePrefix="DROP TABLE ";function r(s,a){return s?`${s}.${a}`:a}return Mw=n,Mw}var jw,b$;function RY(){if(b$)return jw;b$=1;const e=Ro(),n=Qt(),{isObject:r}=mt();class s extends e{constructor(o,l){super(o,l)}createQuery(o,l,u){let h=l?`if object_id('${this.tableName()}', 'U') is null `:"";u?h+=`SELECT * INTO ${this.tableName()} FROM ${this.tableNameLike()} WHERE 0=1`:h+="CREATE TABLE "+this.tableName()+(this._formatting?` (
84
+ `:" (")+o.sql.join(this._formatting?`,
85
+ `:", ")+this._addChecks()+")",this.pushQuery(h),this.single.comment&&this.comment(this.single.comment),u&&this.addColumns(o,this.addColumnsPrefix)}comment(o){if(!o)return;o.length>7500/2&&this.client.logger.warn("Your comment might be longer than the max comment length for MSSQL of 7,500 bytes.");const l=this.formatter.escapingStringDelimiters(o),u=this.formatter.escapingStringDelimiters(this.schemaNameRaw||"dbo"),h=this.formatter.escapingStringDelimiters(this.tableNameRaw),f=`N'MS_Description', N'${l}', N'Schema', N'${u}', N'Table', N'${h}'`,p=`EXISTS(SELECT * FROM sys.fn_listextendedproperty(N'MS_Description', N'Schema', N'${u}', N'Table', N'${h}', NULL, NULL))`;this.pushQuery(`IF ${p}
86
+ EXEC sys.sp_updateextendedproperty ${f}
87
+ ELSE
88
+ EXEC sys.sp_addextendedproperty ${f}`)}addColumns(o,l){l=l||this.addColumnsPrefix,o.sql.length>0&&this.pushQuery({sql:(this.lowerCase?"alter table ":"ALTER TABLE ")+this.tableName()+" "+l+o.sql.join(", "),bindings:o.bindings})}alterColumns(o,l){for(let u=0,h=l.length;u<h;u++){const f=l[u];if(f.modified.defaultTo){const d=`
89
+ DECLARE @constraint varchar(100) = (SELECT default_constraints.name
90
+ FROM sys.all_columns
91
+ INNER JOIN sys.tables
92
+ ON all_columns.object_id = tables.object_id
93
+ INNER JOIN sys.schemas
94
+ ON tables.schema_id = schemas.schema_id
95
+ INNER JOIN sys.default_constraints
96
+ ON all_columns.default_object_id = default_constraints.object_id
97
+ WHERE schemas.name = '${this.schemaNameRaw||"dbo"}'
98
+ AND tables.name = '${this.tableNameRaw}'
99
+ AND all_columns.name = '${f.getColumnName()}')
100
+
101
+ IF @constraint IS NOT NULL EXEC('ALTER TABLE ${this.tableNameRaw} DROP CONSTRAINT ' + @constraint)`;this.pushQuery(d)}}o.sql.forEach(u=>{this.pushQuery({sql:(this.lowerCase?"alter table ":"ALTER TABLE ")+this.tableName()+" "+(this.lowerCase?this.alterColumnPrefix.toLowerCase():this.alterColumnPrefix)+u,bindings:o.bindings})})}dropColumn(){const o=this,l=n.normalizeArr.apply(null,arguments),h=(Array.isArray(l)?l:[l]).map(p=>o.formatter.wrap(p)),f=this.schemaNameRaw||"dbo";for(const p of l){const d=`
102
+ DECLARE @constraint varchar(100) = (SELECT default_constraints.name
103
+ FROM sys.all_columns
104
+ INNER JOIN sys.tables
105
+ ON all_columns.object_id = tables.object_id
106
+ INNER JOIN sys.schemas
107
+ ON tables.schema_id = schemas.schema_id
108
+ INNER JOIN sys.default_constraints
109
+ ON all_columns.default_object_id = default_constraints.object_id
110
+ WHERE schemas.name = '${f}'
111
+ AND tables.name = '${this.tableNameRaw}'
112
+ AND all_columns.name = '${p}')
113
+
114
+ IF @constraint IS NOT NULL EXEC('ALTER TABLE ${this.tableNameRaw} DROP CONSTRAINT ' + @constraint)`;this.pushQuery(d)}this.pushQuery((this.lowerCase?"alter table ":"ALTER TABLE ")+this.tableName()+" "+this.dropColumnPrefix+h.join(", "))}changeType(){}renameColumn(o,l){this.pushQuery(`exec sp_rename ${this.client.parameter(this.tableName()+"."+o,this.tableBuilder,this.bindingsHolder)}, ${this.client.parameter(l,this.tableBuilder,this.bindingsHolder)}, 'COLUMN'`)}dropFKRefs(o,l){const u=this.client.formatter(this.tableBuilder);return Promise.all(l.map(function(h){const f=u.wrap(h.CONSTRAINT_NAME),p=u.wrap(h.TABLE_NAME);return o.query({sql:`ALTER TABLE ${p} DROP CONSTRAINT ${f}`})}))}createFKRefs(o,l){const u=this.client.formatter(this.tableBuilder);return Promise.all(l.map(function(h){const f=u.wrap(h.TABLE_NAME),p=u.wrap(h.CONSTRAINT_NAME),d=u.columnize(h.COLUMN_NAME),g=u.columnize(h.REFERENCED_COLUMN_NAME),y=u.wrap(h.REFERENCED_TABLE_NAME),E=` ON UPDATE ${h.UPDATE_RULE}`,x=` ON DELETE ${h.DELETE_RULE}`;return o.query({sql:`ALTER TABLE ${f} ADD CONSTRAINT ${p} FOREIGN KEY (`+d+") REFERENCES "+y+" ("+g+")"+E+x})}))}index(o,l,u){l=l?this.formatter.wrap(l):this._indexCommand("index",this.tableNameRaw,o);let h;r(u)&&({predicate:h}=u);const f=h?" "+this.client.queryCompiler(h).where():"";this.pushQuery(`CREATE INDEX ${l} ON ${this.tableName()} (${this.formatter.columnize(o)})${f}`)}primary(o,l){let u;r(l)&&({constraintName:l,deferrable:u}=l),u&&u!=="not deferrable"&&this.client.logger.warn(`mssql: primary key constraint [${l}] will not be deferrable ${u} because mssql does not support deferred constraints.`),l=l?this.formatter.wrap(l):this.formatter.wrap(`${this.tableNameRaw}_pkey`),this.forCreate?this.pushQuery(`CONSTRAINT ${l} PRIMARY KEY (${this.formatter.columnize(o)})`):this.pushQuery(`ALTER TABLE ${this.tableName()} ADD CONSTRAINT ${l} PRIMARY KEY (${this.formatter.columnize(o)})`)}unique(o,l){let u,h=!1,f;if(r(l)&&({indexName:l,deferrable:u,useConstraint:h,predicate:f}=l),u&&u!=="not deferrable"&&this.client.logger.warn(`mssql: unique index [${l}] will not be deferrable ${u} because mssql does not support deferred constraints.`),h&&f)throw new Error("mssql cannot create constraint with predicate");if(l=l?this.formatter.wrap(l):this._indexCommand("unique",this.tableNameRaw,o),Array.isArray(o)||(o=[o]),h)this.pushQuery(`ALTER TABLE ${this.tableName()} ADD CONSTRAINT ${l} UNIQUE (${this.formatter.columnize(o)})`);else{const p=f?" "+this.client.queryCompiler(f).where():" WHERE "+o.map(d=>this.formatter.columnize(d)+" IS NOT NULL").join(" AND ");this.pushQuery(`CREATE UNIQUE INDEX ${l} ON ${this.tableName()} (${this.formatter.columnize(o)})${p}`)}}dropIndex(o,l){l=l?this.formatter.wrap(l):this._indexCommand("index",this.tableNameRaw,o),this.pushQuery(`DROP INDEX ${l} ON ${this.tableName()}`)}dropForeign(o,l){l=l?this.formatter.wrap(l):this._indexCommand("foreign",this.tableNameRaw,o),this.pushQuery(`ALTER TABLE ${this.tableName()} DROP CONSTRAINT ${l}`)}dropPrimary(o){o=o?this.formatter.wrap(o):this.formatter.wrap(`${this.tableNameRaw}_pkey`),this.pushQuery(`ALTER TABLE ${this.tableName()} DROP CONSTRAINT ${o}`)}dropUnique(o,l){l=l?this.formatter.wrap(l):this._indexCommand("unique",this.tableNameRaw,o),this.pushQuery(`DROP INDEX ${l} ON ${this.tableName()}`)}}return s.prototype.createAlterTableMethods=["foreign","primary"],s.prototype.lowerCase=!1,s.prototype.addColumnsPrefix="ADD ",s.prototype.dropColumnPrefix="DROP COLUMN ",s.prototype.alterColumnPrefix="ALTER COLUMN ",jw=s,jw}var Lw,_$;function OY(){if(_$)return Lw;_$=1;const e=Oo(),{columnize:n}=Vt();class r extends e{constructor(a,o){super(a,o)}createQuery(a,o,l,u){let f="CREATE "+(u?"OR ALTER ":"")+"VIEW "+this.viewName();const p=a?" ("+n(a,this.viewBuilder,this.client,this.bindingsHolder)+")":"";f+=p,f+=" AS ",f+=o.toString(),this.pushQuery({sql:f})}renameColumn(a,o){this.pushQuery(`exec sp_rename ${this.client.parameter(this.viewName()+"."+a,this.viewBuilder,this.bindingsHolder)}, ${this.client.parameter(o,this.viewBuilder,this.bindingsHolder)}, 'COLUMN'`)}createOrReplace(){this.createQuery(this.columns,this.selectQuery,!1,!0)}}return Lw=r,Lw}var $w,w$;function MY(){if(w$)return $w;w$=1;const e=ra(),{toNumber:n}=Qt(),{formatDefault:r}=ta(),{operator:s}=Vt();class a extends e{constructor(l,u,h){super(l,u,h),this.modifiers=["nullable","defaultTo","first","after","comment"],this._addCheckModifiers()}double(l,u){return"float"}floating(l,u){return"float"}integer(){return"int"}tinyint(){return"tinyint"}varchar(l){return`nvarchar(${n(l,255)})`}timestamp({useTz:l=!1}={}){return l?"datetimeoffset":"datetime2"}bit(l){return l>1&&this.client.logger.warn("Bit field is exactly 1 bit length for MSSQL"),"bit"}binary(l){return l?`varbinary(${n(l)})`:"varbinary(max)"}first(){return this.client.logger.warn("Column first modifier not available for MSSQL"),""}after(l){return this.client.logger.warn("Column after modifier not available for MSSQL"),""}defaultTo(l,{constraintName:u}={}){const h=r(l,this.type,this.client);return u=typeof u<"u"?u:`${this.tableCompiler.tableNameRaw}_${this.getColumnName()}_default`.toLowerCase(),this.columnBuilder._method==="alter"?(this.pushAdditional(function(){this.pushQuery(`ALTER TABLE ${this.tableCompiler.tableName()} ADD CONSTRAINT ${this.formatter.wrap(u)} DEFAULT ${h} FOR ${this.formatter.wrap(this.getColumnName())}`)}),""):u?`CONSTRAINT ${this.formatter.wrap(u)} DEFAULT ${h}`:`DEFAULT ${h}`}comment(l){if(!l)return;l&&l.length>7500/2&&this.client.logger.warn("Your comment might be longer than the max comment length for MSSQL of 7,500 bytes.");const u=this.formatter.escapingStringDelimiters(l),h=this.tableCompiler.schemaNameRaw||"dbo",f=this.formatter.escapingStringDelimiters(this.tableCompiler.tableNameRaw),p=this.formatter.escapingStringDelimiters(this.args[0]||this.defaults("columnName")),d=`N'MS_Description', N'${u}', N'Schema', N'${h}', N'Table', N'${f}', N'Column', N'${p}'`;return this.pushAdditional(function(){const g=`EXISTS(SELECT * FROM sys.fn_listextendedproperty(N'MS_Description', N'Schema', N'${h}', N'Table', N'${f}', N'Column', N'${p}'))`;this.pushQuery(`IF ${g}
115
+ EXEC sys.sp_updateextendedproperty ${d}
116
+ ELSE
117
+ EXEC sys.sp_addextendedproperty ${d}`)}),""}checkLength(l,u,h){return this._check(`LEN(${this.formatter.wrap(this.getColumnName())}) ${s(l,this.columnBuilder,this.bindingsHolder)} ${n(u)}`,h)}checkRegex(l,u){return this._check(`${this.formatter.wrap(this.getColumnName())} LIKE ${this.client._escapeBinding("%"+l+"%")}`,u)}increments(l={primaryKey:!0}){return"int identity(1,1) not null"+(this.tableCompiler._canBeAddPrimaryKey(l)?" primary key":"")}bigincrements(l={primaryKey:!0}){return"bigint identity(1,1) not null"+(this.tableCompiler._canBeAddPrimaryKey(l)?" primary key":"")}}return a.prototype.bigint="bigint",a.prototype.mediumint="int",a.prototype.smallint="smallint",a.prototype.text="nvarchar(max)",a.prototype.mediumtext="nvarchar(max)",a.prototype.longtext="nvarchar(max)",a.prototype.json=a.prototype.jsonb="nvarchar(max)",a.prototype.enu="nvarchar(100)",a.prototype.uuid=({useBinaryUuid:o=!1}={})=>o?"binary(16)":"uniqueidentifier",a.prototype.datetime="datetime2",a.prototype.bool="bit",$w=a,$w}var Iw,E$;function jY(){if(E$)return Iw;E$=1;const e=ti(),n=SY(),r=ia(),s=TY(),a=qY(),o=AY(),l=NY(),u=RY(),h=OY(),f=MY(),p=ni(),{setHiddenProperty:d}=fx(),g=tr()("knex:mssql"),y={MIN:-2147483648,MAX:2147483647},E={MIN:-9007199254740991,MAX:9007199254740991};class x extends r{constructor(b={}){super(b)}_generateConnection(){const b=this.connectionSettings;b.options=b.options||{};const w={authentication:{type:b.type||"default",options:{userName:b.userName||b.user,password:b.password,domain:b.domain,token:b.token,clientId:b.clientId,clientSecret:b.clientSecret,tenantId:b.tenantId,msiEndpoint:b.msiEndpoint}},server:b.server||b.host,options:{database:b.database,encrypt:b.encrypt||!1,port:b.port||1433,connectTimeout:b.connectionTimeout||b.timeout||15e3,requestTimeout:n(b.requestTimeout)?15e3:b.requestTimeout,rowCollectionOnDone:!1,rowCollectionOnRequestCompletion:!1,useColumnNames:!1,tdsVersion:b.options.tdsVersion||"7_4",appName:b.options.appName||"knex",trustServerCertificate:!1,...b.options}};return w.authentication.options.password&&d(w.authentication.options),w.options.instanceName&&delete w.options.port,isNaN(w.options.requestTimeout)&&(w.options.requestTimeout=15e3),w.options.requestTimeout===1/0&&(w.options.requestTimeout=0),w.options.requestTimeout<0&&(w.options.requestTimeout=0),b.debug&&(w.options.debug={packet:!0,token:!0,data:!0,payload:!0}),w}_driver(){return nt}formatter(){return new s(this,...arguments)}transaction(){return new a(this,...arguments)}queryCompiler(){return new o(this,...arguments)}schemaCompiler(){return new l(this,...arguments)}tableCompiler(){return new u(this,...arguments)}viewCompiler(){return new h(this,...arguments)}queryBuilder(){return new p(this)}columnCompiler(){return new f(this,...arguments)}wrapIdentifierImpl(b){return b==="*"?"*":`[${b.replace(/[[\]]+/g,"")}]`}acquireRawConnection(){return new Promise((b,w)=>{g("connection::connection new connection requested");const C=this._driver(),T=Object.assign({},this._generateConnection()),A=new C.Connection(T);A.connect(N=>N?(g("connection::connect error: %s",N.message),w(N)):(g("connection::connect connected to server"),A.connected=!0,A.on("error",O=>{g("connection::error message=%s",O.message),A.__knex__disposed=O,A.connected=!1}),A.once("end",()=>{A.connected=!1,A.__knex__disposed="Connection to server was terminated.",g("connection::end connection ended.")}),b(A)))})}validateConnection(b){return b&&b.connected}destroyRawConnection(b){return g("connection::destroy"),new Promise(w=>{b.once("end",()=>{w()}),b.close()})}positionBindings(b){let w=-1;return b.replace(/\\?\?/g,C=>C==="\\?"?"?":(w+=1,`@p${w}`))}_chomp(b){if(b.state.name==="LoggedIn"){const w=this.requestQueue.pop();w&&(g("connection::query executing query, %d more in queue",this.requestQueue.length),b.execSql(w))}}_enqueueRequest(b,w){this.requestQueue.push(b),this._chomp(w)}_makeRequest(b,w){const C=this._driver(),T=typeof b=="string"?b:b.sql;let A=0;if(!T)throw new Error("The query is empty");g("request::request sql=%s",T);const N=new C.Request(T,(O,I)=>{if(O)return g("request::error message=%s",O.message),w(O);A=I,g("request::callback rowCount=%d",A)});return N.on("prepared",()=>{g("request %s::request prepared",this.id)}),N.on("done",(O,I)=>{g("request::done rowCount=%d more=%s",O,I)}),N.on("doneProc",(O,I)=>{g("request::doneProc id=%s rowCount=%d more=%s",N.id,O,I)}),N.on("doneInProc",(O,I)=>{g("request::doneInProc id=%s rowCount=%d more=%s",N.id,O,I)}),N.once("requestCompleted",()=>(g("request::completed id=%s",N.id),w(null,A))),N.on("error",O=>(g("request::error id=%s message=%s",N.id,O.message),w(O))),N}_stream(b,w,C){return new Promise((T,A)=>{const N=this._makeRequest(w,O=>{if(O)return C.emit("error",O),A(O);T()});N.on("row",O=>{C.write(O.reduce((I,k)=>({...I,[k.metadata.colName]:k.value}),{}))}),N.on("error",O=>{C.emit("error",O),A(O)}),N.once("requestCompleted",()=>{C.end(),T()}),this._assignBindings(N,w.bindings),this._enqueueRequest(N,b)})}_assignBindings(b,w){if(Array.isArray(w))for(let C=0;C<w.length;C++){const T=w[C];this._setReqInput(b,C,T)}}_scaleForBinding(b){if(b%1===0)throw new Error(`The binding value ${b} must be a decimal number.`);return{scale:10}}_typeForBinding(b){const w=this._driver();if(this.connectionSettings.options&&this.connectionSettings.options.mapBinding){const C=this.connectionSettings.options.mapBinding(b);if(C)return[C.value,C.type]}switch(typeof b){case"string":return[b,w.TYPES.NVarChar];case"boolean":return[b,w.TYPES.Bit];case"number":{if(b%1!==0)return[b,w.TYPES.Float];if(b<y.MIN||b>y.MAX){if(b<E.MIN||b>E.MAX)throw new Error(`Bigint must be safe integer or must be passed as string, saw ${b}`);return[b,w.TYPES.BigInt]}return[b,w.TYPES.Int]}default:return b instanceof Date?[b,w.TYPES.DateTime]:b instanceof Buffer?[b,w.TYPES.VarBinary]:[b,w.TYPES.NVarChar]}}_query(b,w){return new Promise((C,T)=>{const A=[],N=this._makeRequest(w,(O,I)=>{if(O)return T(O);w.response=A,process.nextTick(()=>this._chomp(b)),C(w)});N.on("row",O=>{g("request::row"),A.push(O)}),this._assignBindings(N,w.bindings),this._enqueueRequest(N,b)})}_setReqInput(b,w,C){const[T,A]=this._typeForBinding(C),N="p".concat(w);let O;typeof T=="number"&&T%1!==0&&(O=this._scaleForBinding(T)),g("request::binding pos=%d type=%s value=%s",w,A.name,T),Buffer.isBuffer(T)&&(O={length:"max"}),b.addParameter(N,A,T,O)}processResponse(b,w){if(b==null)return;let{response:C}=b;const{method:T}=b;if(b.output||(C=C.map(A=>A.reduce((N,O)=>{const I=O.metadata.colName;return N[I]?(Array.isArray(N[I])||(N[I]=[N[I]]),N[I].push(O.value)):N[I]=O.value,N},{})),b.output))return b.output.call(w,C);switch(T){case"select":return C;case"first":return C[0];case"pluck":return e(C,b.pluck);case"insert":case"del":case"update":case"counter":return b.returning&&b.returning==="@@rowcount"?C[0][""]:C;default:return C}}}return Object.assign(x.prototype,{requestQueue:[],dialect:"mssql",driverName:"mssql"}),Iw=x,Iw}var Dw,C$;function LY(){if(C$)return Dw;C$=1;var e="Expected a function";function n(r,s,a){if(typeof r!="function")throw new TypeError(e);return setTimeout(function(){r.apply(void 0,a)},s)}return Dw=n,Dw}var kw,x$;function $Y(){if(x$)return kw;x$=1;var e=LY(),n=Sl(),r=n(function(s,a){return e(s,1,a)});return kw=r,kw}var Bw,S$;function IY(){if(S$)return Bw;S$=1;const e=Ji(),r=tr()("knex:tx");class s extends e{query(o,l,u,h){const f=this,p=this.trxClient.query(o,l).catch(d=>{if(d.errno===1305){this.trxClient.logger.warn("Transaction was implicitly committed, do not mix transactions and DDL with MySQL (#805)");return}u=2,h=d,f._completed=!0,r("%s error running transaction query",f.txid)}).then(function(d){if(u===1&&f._resolver(h),u===2){if(h===void 0){if(f.doNotRejectOnRollback&&/^ROLLBACK\b/i.test(l)){f._resolver();return}h=new Error(`Transaction rejected with non-error: ${h}`)}f._rejecter(h)}return d});return(u===1||u===2)&&(f._completed=!0),p}}return Bw=s,Bw}var Pw,T$;function DY(){if(T$)return Pw;T$=1;const e=ni(),n=qn();return Pw=class extends e{upsert(s,a,o){return this._method="upsert",n(a)||this.returning(a,o),this._single.upsert=s,this}},Pw}var zw,q$;function kY(){if(q$)return zw;q$=1;const e=nt,n=tn(),r=Wi(),s=qn(),a=na(),{wrapAsIdentifier:o}=ta(),{columnize:l,wrap:u}=Vt(),h=p=>r(p)||Array.isArray(p);class f extends a{constructor(d,g,y){super(d,g,y);const{returning:E}=this.single;E&&this.client.logger.warn(".returning() is not supported by mysql and will not have any effect."),this._emptyInsertValue="() values ()"}del(){const d=super.del();if(d==="")return d;const g=this.comments();return(g===""?"":g+" ")+d}insert(){let d=super.insert();if(d==="")return d;const g=this.comments();d=(g===""?"":g+" ")+d;const{ignore:y,merge:E,insert:x}=this.single;if(y&&(d=d.replace("insert into","insert ignore into")),E&&(d+=this._merge(E.updates,x),this.where()))throw new Error(".onConflict().merge().where() is not supported for mysql");return d}upsert(){const d=this.single.upsert||[],g=this.with()+`replace into ${this.tableName} `,y=this._insertBody(d);return y===""?"":g+y}_merge(d,g){const y=" on duplicate key update ";if(d&&Array.isArray(d))return y+d.map(E=>o(E,this.formatter.builder,this.client)).map(E=>`${E} = values(${E})`).join(", ");if(d&&typeof d=="object"){const E=this._prepUpdate(d);return y+E.join(",")}else{const E=this._prepInsert(g);if(typeof E=="string")throw new Error("If using merge with a raw insert query, then updates must be provided");return y+E.columns.map(x=>o(x,this.builder,this.client)).map(x=>`${x} = values(${x})`).join(", ")}}update(){const d=this.comments(),g=this.with(),y=this.join(),E=this._prepUpdate(this.single.update),x=this.where(),v=this.order(),b=this.limit();return(d===""?"":d+" ")+g+`update ${this.tableName}`+(y?` ${y}`:"")+" set "+E.join(", ")+(x?` ${x}`:"")+(v?` ${v}`:"")+(b?` ${b}`:"")}forUpdate(){return"for update"}forShare(){return"lock in share mode"}skipLocked(){return"skip locked"}noWait(){return"nowait"}columnInfo(){const d=this.single.columnInfo;return{sql:"select * from information_schema.columns where table_name = ? and table_schema = ?",bindings:[this.client.customWrapIdentifier(this.single.table,n),this.client.database()],output(y){const E=y.reduce(function(x,v){return x[v.COLUMN_NAME]={defaultValue:v.COLUMN_DEFAULT==="NULL"?null:v.COLUMN_DEFAULT,type:v.DATA_TYPE,maxLength:v.CHARACTER_MAXIMUM_LENGTH,nullable:v.IS_NULLABLE==="YES"},x},{});return d&&E[d]||E}}}limit(){const d=!this.single.limit&&this.single.limit!==0;return d&&!this.single.offset?"":`limit ${this.single.offset&&d?"18446744073709551615":this._getValueOrParameterFromAttribute("limit")}`}whereBasic(d){return e(!h(d.value),"The values in where clause must not be object or array."),super.whereBasic(d)}whereRaw(d){return e(s(d.value.bindings)||!Object.values(d.value.bindings).some(h),"The values in where clause must not be object or array."),super.whereRaw(d)}whereLike(d){return`${this._columnClause(d)} ${this._not(d,"like ")}${this._valueClause(d)} COLLATE utf8_bin`}whereILike(d){return`${this._columnClause(d)} ${this._not(d,"like ")}${this._valueClause(d)}`}jsonExtract(d){return this._jsonExtract(["json_extract","json_unquote"],d)}jsonSet(d){return this._jsonSet("json_set",d)}jsonInsert(d){return this._jsonSet("json_insert",d)}jsonRemove(d){const g=`json_remove(${l(d.column,this.builder,this.client,this.bindingsHolder)},${this.client.parameter(d.path,this.builder,this.bindingsHolder)})`;return d.alias?this.client.alias(g,this.formatter.wrap(d.alias)):g}whereJsonObject(d){return this._not(d,`json_contains(${this._columnClause(d)}, ${this._jsonValueClause(d)})`)}whereJsonPath(d){return this._whereJsonPath("json_extract",d)}whereJsonSupersetOf(d){return this._not(d,`json_contains(${u(d.column,void 0,this.builder,this.client,this.bindingsHolder)},${this._jsonValueClause(d)})`)}whereJsonSubsetOf(d){return this._not(d,`json_contains(${this._jsonValueClause(d)},${u(d.column,void 0,this.builder,this.client,this.bindingsHolder)})`)}onJsonPathEquals(d){return this._onJsonPathEquals("json_extract",d)}}return zw=f,zw}var Uw,A$;function BY(){if(A$)return Uw;A$=1;const e=No();class n extends e{constructor(s,a){super(s,a)}renameTable(s,a){this.pushQuery(`rename table ${this.formatter.wrap(s)} to ${this.formatter.wrap(a)}`)}renameView(s,a){this.renameTable(s,a)}hasTable(s){let a="select * from information_schema.tables where table_name = ?";const o=[s];this.schema?(a+=" and table_schema = ?",o.push(this.schema)):a+=" and table_schema = database()",this.pushQuery({sql:a,bindings:o,output:function(u){return u.length>0}})}hasColumn(s,a){this.pushQuery({sql:`show columns from ${this.formatter.wrap(s)}`,output(o){return o.some(l=>this.client.wrapIdentifier(l.Field.toLowerCase())===this.client.wrapIdentifier(a.toLowerCase()))}})}}return Uw=n,Uw}var Qw,N$;function PY(){if(N$)return Qw;N$=1;const e=Ro(),{isObject:n,isString:r}=mt();class s extends e{constructor(o,l){super(o,l)}createQuery(o,l,u){const h=l?"create table if not exists ":"create table ",{client:f}=this;let p={},d=" ("+o.sql.join(", ");d+=this.primaryKeys()||"",d+=this._addChecks(),d+=")";let g=h+this.tableName()+(u&&this.tableNameLike()?" like "+this.tableNameLike():d);f.connectionSettings&&(p=f.connectionSettings);const y=this.single.charset||p.charset||"",E=this.single.collate||p.collate||"",x=this.single.engine||"";if(y&&!u&&(g+=` default character set ${y}`),E&&(g+=` collate ${E}`),x&&(g+=` engine = ${x}`),this.single.comment){const v=this.single.comment||"",b=1024;v.length>b&&this.client.logger.warn(`The max length for a table comment is ${b} characters`),g+=` comment = '${v}'`}this.pushQuery(g),u&&this.addColumns(o,this.addColumnsPrefix)}comment(o){this.pushQuery(`alter table ${this.tableName()} comment = '${o}'`)}changeType(){}renameColumn(o,l){const u=this,h=this.tableName(),f=this.formatter.wrap(o)+" "+this.formatter.wrap(l);this.pushQuery({sql:`show full fields from ${h} where field = `+this.client.parameter(o,this.tableBuilder,this.bindingsHolder),output(p){const d=p[0],g=this;return u.getFKRefs(g).then(([y])=>new Promise((E,x)=>{try{y.length||E(),E(u.dropFKRefs(g,y))}catch(v){x(v)}}).then(function(){let E=`alter table ${h} change ${f} ${d.Type}`;return String(d.Null).toUpperCase()!=="YES"?E+=" NOT NULL":E+=" NULL",d.Default!==void 0&&d.Default!==null&&(E+=` DEFAULT '${d.Default}'`),d.Collation!==void 0&&d.Collation!==null&&(E+=` COLLATE '${d.Collation}'`),d.Extra=="auto_increment"&&(E+=" AUTO_INCREMENT"),g.query({sql:E})}).then(function(){if(y.length)return u.createFKRefs(g,y.map(function(E){return E.REFERENCED_COLUMN_NAME===o&&(E.REFERENCED_COLUMN_NAME=l),E.COLUMN_NAME===o&&(E.COLUMN_NAME=l),E}))}))}})}primaryKeys(){const o=(this.grouped.alterTable||[]).filter(l=>l.method==="primary");if(o.length>0&&o[0].args.length>0){const l=o[0].args[0];let u=o[0].args[1]||"";if(u&&(u=" constraint "+this.formatter.wrap(u)),this.grouped.columns){const h=this._getIncrementsColumnNames();h.length&&h.forEach(p=>{l.includes(p)||l.unshift(p)});const f=this._getBigIncrementsColumnNames();f.length&&f.forEach(p=>{l.includes(p)||l.unshift(p)})}return`,${u} primary key (${this.formatter.columnize(l)})`}}getFKRefs(o){const l={bindings:[]},u="SELECT KCU.CONSTRAINT_NAME, KCU.TABLE_NAME, KCU.COLUMN_NAME, KCU.REFERENCED_TABLE_NAME, KCU.REFERENCED_COLUMN_NAME, RC.UPDATE_RULE, RC.DELETE_RULE FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS KCU JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS AS RC USING(CONSTRAINT_NAME)WHERE KCU.REFERENCED_TABLE_NAME = "+this.client.parameter(this.tableNameRaw,this.tableBuilder,l)+" AND KCU.CONSTRAINT_SCHEMA = "+this.client.parameter(this.client.database(),this.tableBuilder,l)+" AND RC.CONSTRAINT_SCHEMA = "+this.client.parameter(this.client.database(),this.tableBuilder,l);return o.query({sql:u,bindings:l.bindings})}dropFKRefs(o,l){const u=this.client.formatter(this.tableBuilder);return Promise.all(l.map(function(h){const f=u.wrap(h.CONSTRAINT_NAME),p=u.wrap(h.TABLE_NAME);return o.query({sql:`alter table ${p} drop foreign key ${f}`})}))}createFKRefs(o,l){const u=this.client.formatter(this.tableBuilder);return Promise.all(l.map(function(h){const f=u.wrap(h.TABLE_NAME),p=u.wrap(h.CONSTRAINT_NAME),d=u.columnize(h.COLUMN_NAME),g=u.columnize(h.REFERENCED_COLUMN_NAME),y=u.wrap(h.REFERENCED_TABLE_NAME),E=` ON UPDATE ${h.UPDATE_RULE}`,x=` ON DELETE ${h.DELETE_RULE}`;return o.query({sql:`alter table ${f} add constraint ${p} foreign key (`+d+") references "+y+" ("+g+")"+E+x})}))}index(o,l,u){let h,f;r(u)?f=u:n(u)&&({indexType:f,storageEngineIndexType:h}=u),l=l?this.formatter.wrap(l):this._indexCommand("index",this.tableNameRaw,o),h=h?` using ${h}`:"",this.pushQuery(`alter table ${this.tableName()} add${f?` ${f}`:""} index ${l}(${this.formatter.columnize(o)})${h}`)}primary(o,l){let u;n(l)&&({constraintName:l,deferrable:u}=l),u&&u!=="not deferrable"&&this.client.logger.warn(`mysql: primary key constraint \`${l}\` will not be deferrable ${u} because mysql does not support deferred constraints.`),l=l?this.formatter.wrap(l):this.formatter.wrap(`${this.tableNameRaw}_pkey`);const h=o;let f=[],p=[];this.grouped.columns&&(f=this._getIncrementsColumnNames(),f&&f.forEach(d=>{h.includes(d)||h.unshift(d)}),p=this._getBigIncrementsColumnNames(),p&&p.forEach(d=>{h.includes(d)||h.unshift(d)})),this.method!=="create"&&this.method!=="createIfNot"&&this.pushQuery(`alter table ${this.tableName()} add primary key ${l}(${this.formatter.columnize(h)})`),f.length&&this.pushQuery(`alter table ${this.tableName()} modify column ${this.formatter.columnize(f)} int unsigned not null auto_increment`),p.length&&this.pushQuery(`alter table ${this.tableName()} modify column ${this.formatter.columnize(p)} bigint unsigned not null auto_increment`)}unique(o,l){let u,h;n(l)&&({indexName:l,deferrable:h,storageEngineIndexType:u}=l),h&&h!=="not deferrable"&&this.client.logger.warn(`mysql: unique index \`${l}\` will not be deferrable ${h} because mysql does not support deferred constraints.`),l=l?this.formatter.wrap(l):this._indexCommand("unique",this.tableNameRaw,o),u=u?` using ${u}`:"",this.pushQuery(`alter table ${this.tableName()} add unique ${l}(${this.formatter.columnize(o)})${u}`)}dropIndex(o,l){l=l?this.formatter.wrap(l):this._indexCommand("index",this.tableNameRaw,o),this.pushQuery(`alter table ${this.tableName()} drop index ${l}`)}dropForeign(o,l){l=l?this.formatter.wrap(l):this._indexCommand("foreign",this.tableNameRaw,o),this.pushQuery(`alter table ${this.tableName()} drop foreign key ${l}`)}dropPrimary(){this.pushQuery(`alter table ${this.tableName()} drop primary key`)}dropUnique(o,l){l=l?this.formatter.wrap(l):this._indexCommand("unique",this.tableNameRaw,o),this.pushQuery(`alter table ${this.tableName()} drop index ${l}`)}}return s.prototype.addColumnsPrefix="add ",s.prototype.alterColumnsPrefix="modify ",s.prototype.dropColumnPrefix="drop ",Qw=s,Qw}var Hw,R$;function zY(){if(R$)return Hw;R$=1;const e=ra(),{isObject:n}=mt(),{toNumber:r}=Qt(),s=new RegExp("(?<!\\\\)'","g");class a extends e{constructor(l,u,h){super(l,u,h),this.modifiers=["unsigned","nullable","defaultTo","comment","collate","first","after"],this._addCheckModifiers()}double(l,u){return l?`double(${r(l,8)}, ${r(u,2)})`:"double"}integer(l){return l=l?`(${r(l,11)})`:"",`int${l}`}tinyint(l){return l=l?`(${r(l,1)})`:"",`tinyint${l}`}text(l){switch(l){case"medium":case"mediumtext":return"mediumtext";case"long":case"longtext":return"longtext";default:return"text"}}mediumtext(){return this.text("medium")}longtext(){return this.text("long")}enu(l){return`enum('${l.join("', '")}')`}datetime(l){return n(l)&&({precision:l}=l),typeof l=="number"?`datetime(${l})`:"datetime"}timestamp(l){return n(l)&&({precision:l}=l),typeof l=="number"?`timestamp(${l})`:"timestamp"}time(l){return n(l)&&({precision:l}=l),typeof l=="number"?`time(${l})`:"time"}bit(l){return l?`bit(${r(l)})`:"bit"}binary(l){return l?`varbinary(${r(l)})`:"blob"}json(){return"json"}jsonb(){return"json"}defaultTo(l){if(l==null)return;if((this.type==="json"||this.type==="jsonb")&&n(l))return`default ('${JSON.stringify(l)}')`;const u=super.defaultTo.apply(this,arguments);return this.type!=="blob"&&this.type.indexOf("text")===-1?u:""}unsigned(){return"unsigned"}comment(l){return l&&l.length>255&&this.client.logger.warn("Your comment is longer than the max comment length for MySQL"),l&&`comment '${l.replace(s,"\\'")}'`}first(){return"first"}after(l){return`after ${this.formatter.wrap(l)}`}collate(l){return l&&`collate '${l}'`}checkRegex(l,u){return this._check(`${this.formatter.wrap(this.getColumnName())} REGEXP ${this.client._escapeBinding(l)}`,u)}increments(l={primaryKey:!0}){return"int unsigned not null"+(this.tableCompiler._canBeAddPrimaryKey(l)?" auto_increment primary key":"")}bigincrements(l={primaryKey:!0}){return"bigint unsigned not null"+(this.tableCompiler._canBeAddPrimaryKey(l)?" auto_increment primary key":"")}}return a.prototype.bigint="bigint",a.prototype.mediumint="mediumint",a.prototype.smallint="smallint",Hw=a,Hw}var Vw,O$;function UY(){if(O$)return Vw;O$=1;const e=Oo();class n extends e{constructor(s,a){super(s,a)}createOrReplace(){this.createQuery(this.columns,this.selectQuery,!1,!0)}}return Vw=n,Vw}var Fw,M$;function QY(){if(M$)return Fw;M$=1;const e=ql();class n extends e{constructor(){super(...arguments)}checkOption(){this._single.checkOption="default_option"}localCheckOption(){this._single.checkOption="local"}cascadedCheckOption(){this._single.checkOption="cascaded"}}return Fw=n,Fw}var Gw,j$;function yP(){if(j$)return Gw;j$=1;const e=$Y(),n=ti(),{promisify:r}=nt,s=ia(),a=IY(),o=DY(),l=kY(),u=BY(),h=PY(),f=zY(),{makeEscape:p}=cx(),d=UY(),g=QY();class y extends s{_driver(){return nt}queryBuilder(){return new o(this)}queryCompiler(x,v){return new l(this,x,v)}schemaCompiler(){return new u(this,...arguments)}tableCompiler(){return new h(this,...arguments)}viewCompiler(){return new d(this,...arguments)}viewBuilder(){return new g(this,...arguments)}columnCompiler(){return new f(this,...arguments)}transaction(){return new a(this,...arguments)}wrapIdentifierImpl(x){return x!=="*"?`\`${x.replace(/`/g,"``")}\``:"*"}acquireRawConnection(){return new Promise((x,v)=>{const b=this.driver.createConnection(this.connectionSettings);b.on("error",w=>{b.__knex__disposed=w}),b.connect(w=>{if(w)return b.removeAllListeners(),v(w);x(b)})})}async destroyRawConnection(x){try{return await r(b=>x.end(b))()}catch(v){x.__knex__disposed=v}finally{e(()=>x.removeAllListeners())}}validateConnection(x){return x.state==="connected"||x.state==="authenticated"}_stream(x,v,b,w){if(!v.sql)throw new Error("The query is empty");w=w||{};const C=Object.assign({sql:v.sql},v.options);return new Promise((T,A)=>{b.on("error",A),b.on("end",T);const N=x.query(C,v.bindings).stream(w);N.on("error",O=>{A(O),b.emit("error",O)}),N.pipe(b)})}_query(x,v){if((!v||typeof v=="string")&&(v={sql:v}),!v.sql)throw new Error("The query is empty");return new Promise(function(b,w){if(!v.sql){b();return}const C=Object.assign({sql:v.sql},v.options);x.query(C,v.bindings,function(T,A,N){if(T)return w(T);v.response=[A,N],b(v)})})}processResponse(x,v){if(x==null)return;const{response:b}=x,{method:w}=x,C=b[0],T=b[1];if(x.output)return x.output.call(v,C,T);switch(w){case"select":return C;case"first":return C[0];case"pluck":return n(C,x.pluck);case"insert":return[C.insertId];case"del":case"update":case"counter":return C.affectedRows;default:return b}}async cancelQuery(x){const v=await this.acquireRawConnection();try{return await this._wrappedCancelQueryCall(v,x)}finally{await this.destroyRawConnection(v),v.__knex__disposed&&this.logger.warn(`Connection Error: ${v.__knex__disposed}`)}}_wrappedCancelQueryCall(x,v){return this._query(x,{sql:"KILL QUERY ?",bindings:[v.threadId],options:{}})}}return Object.assign(y.prototype,{dialect:"mysql",driverName:"mysql",_escapeBinding:p(),canCancelQuery:!0}),Gw=y,Gw}var Kw,L$;function HY(){if(L$)return Kw;L$=1;const e=Ji(),n=tr()("knex:tx");class r extends e{query(a,o,l,u){const h=this,f=this.trxClient.query(a,o).catch(p=>{if(p.code==="ER_SP_DOES_NOT_EXIST"){this.trxClient.logger.warn("Transaction was implicitly committed, do not mix transactions and DDL with MySQL (#805)");return}l=2,u=p,h._completed=!0,n("%s error running transaction query",h.txid)}).then(function(p){if(l===1&&h._resolver(u),l===2){if(u===void 0){if(h.doNotRejectOnRollback&&/^ROLLBACK\b/i.test(o)){h._resolver();return}u=new Error(`Transaction rejected with non-error: ${u}`)}return h._rejecter(u),p}});return(l===1||l===2)&&(h._completed=!0),f}}return Kw=r,Kw}var Yw,$$;function VY(){if($$)return Yw;$$=1;const e=yP(),n=HY();class r extends e{transaction(){return new n(this,...arguments)}_driver(){return nt}initializeDriver(){try{this.driver=this._driver()}catch(a){let o=`Knex: run
118
+ $ npm install ${this.driverName}`;throw process.version.replace(/^v/,"").split(".")[0]<=12&&(o+="@3.2.0",this.logger.error("Mysql2 version 3.2.0 is the latest version to support Node.js 12 or lower.")),o+=" --save",this.logger.error(`${o}
119
+ ${a.message}
120
+ ${a.stack}`),new Error(`${o}
121
+ ${a.message}`)}}validateConnection(a){return a&&!a._fatalError&&!a._protocolError&&!a._closing&&!a.stream.destroyed}}return Object.assign(r.prototype,{driverName:"mysql2"}),Yw=r,Yw}var Xw,I$;function Us(){if(I$)return Xw;I$=1;class e{constructor(o){this.oracleVersion=o;const l=o.split(".").map(u=>parseInt(u));l[0]>12||l[0]===12&&l[1]>=2?this.limit=128:this.limit=30}generateCombinedName(o,l,u,h){const f=nt;Array.isArray(h)||(h=h?[h]:[]);const p=u.replace(/\.|-/g,"_"),d=h.join("_");let g=`${p}_${d.length?d+"_":""}${l}`.toLowerCase();return g.length>this.limit&&(o.warn(`Automatically generated name "${g}" exceeds ${this.limit} character limit for Oracle Database ${this.oracleVersion}. Using base64 encoded sha1 of that name instead.`),g=f.createHash("sha1").update(g).digest("base64").replace("=","")),g}}function n(a,o){return`begin execute immediate '${a.replace(/'/g,"''")}'; exception when others then if sqlcode != ${o} then raise; end if; end;`}function r(a){this.columnName=a}r.prototype.toString=function(){return`[object ReturningHelper:${this.columnName}]`};function s(a){return["DPI-1010","DPI-1080","ORA-03114","ORA-03113","ORA-03135","ORA-12514","ORA-00022","ORA-00028","ORA-00031","ORA-00045","ORA-00378","ORA-00602","ORA-00603","ORA-00609","ORA-01012","ORA-01041","ORA-01043","ORA-01089","ORA-01092","ORA-02396","ORA-03122","ORA-12153","ORA-12537","ORA-12547","ORA-12570","ORA-12583","ORA-27146","ORA-28511","ORA-56600","NJS-024","NJS-003"].some(function(o){return a.message.indexOf(o)===0})}return Xw={NameHelper:e,isConnectionError:s,wrapSqlWithCatch:n,ReturningHelper:r},Xw}var Ww,D$;function wx(){if(D$)return Ww;D$=1;const{NameHelper:e}=Us();class n{constructor(s){this.nameHelper=new e(s)}renameColumnTrigger(s,a,o,l){const u=this.nameHelper.generateCombinedName(s,"autoinc_trg",a),h=this.nameHelper.generateCombinedName(s,"seq",a);return`DECLARE PK_NAME VARCHAR(200); IS_AUTOINC NUMBER := 0; BEGIN EXECUTE IMMEDIATE ('ALTER TABLE "${a}" RENAME COLUMN "${o}" TO "${l}"'); SELECT COUNT(*) INTO IS_AUTOINC from "USER_TRIGGERS" where trigger_name = '${u}'; IF (IS_AUTOINC > 0) THEN SELECT cols.column_name INTO PK_NAME FROM all_constraints cons, all_cons_columns cols WHERE cons.constraint_type = 'P' AND cons.constraint_name = cols.constraint_name AND cons.owner = cols.owner AND cols.table_name = '${a}'; IF ('${l}' = PK_NAME) THEN EXECUTE IMMEDIATE ('DROP TRIGGER "${u}"'); EXECUTE IMMEDIATE ('create or replace trigger "${u}" BEFORE INSERT on "${a}" for each row declare checking number := 1; begin if (:new."${l}" is null) then while checking >= 1 loop select "${h}".nextval into :new."${l}" from dual; select count("${l}") into checking from "${a}" where "${l}" = :new."${l}"; end loop; end if; end;'); end if; end if;END;`}createAutoIncrementTrigger(s,a,o){const l=`"${a}"`,u=a,h=o?`"${o}".`:"",f=o?`'${o}'`:"cols.owner",p=this.nameHelper.generateCombinedName(s,"autoinc_trg",a),g=`"${this.nameHelper.generateCombinedName(s,"seq",a)}"`;return`DECLARE PK_NAME VARCHAR(200); BEGIN EXECUTE IMMEDIATE ('CREATE SEQUENCE ${h}${g}'); SELECT cols.column_name INTO PK_NAME FROM all_constraints cons, all_cons_columns cols WHERE cons.constraint_type = 'P' AND cons.constraint_name = cols.constraint_name AND cons.owner = ${f} AND cols.table_name = '${u}'; execute immediate ('create or replace trigger ${h}"${p}" BEFORE INSERT on ${h}${l} for each row declare checking number := 1; begin if (:new."' || PK_NAME || '" is null) then while checking >= 1 loop select ${h}${g}.nextval into :new."' || PK_NAME || '" from dual; select count("' || PK_NAME || '") into checking from ${h}${l} where "' || PK_NAME || '" = :new."' || PK_NAME || '"; end loop; end if; end;'); END;`}renameTableAndAutoIncrementTrigger(s,a,o){const l=this.nameHelper.generateCombinedName(s,"autoinc_trg",a),u=this.nameHelper.generateCombinedName(s,"seq",a),h=this.nameHelper.generateCombinedName(s,"autoinc_trg",o),f=this.nameHelper.generateCombinedName(s,"seq",o);return`DECLARE PK_NAME VARCHAR(200); IS_AUTOINC NUMBER := 0; BEGIN EXECUTE IMMEDIATE ('RENAME "${a}" TO "${o}"'); SELECT COUNT(*) INTO IS_AUTOINC from "USER_TRIGGERS" where trigger_name = '${l}'; IF (IS_AUTOINC > 0) THEN EXECUTE IMMEDIATE ('DROP TRIGGER "${l}"'); EXECUTE IMMEDIATE ('RENAME "${u}" TO "${f}"'); SELECT cols.column_name INTO PK_NAME FROM all_constraints cons, all_cons_columns cols WHERE cons.constraint_type = 'P' AND cons.constraint_name = cols.constraint_name AND cons.owner = cols.owner AND cols.table_name = '${o}'; EXECUTE IMMEDIATE ('create or replace trigger "${h}" BEFORE INSERT on "${o}" for each row declare checking number := 1; begin if (:new."' || PK_NAME || '" is null) then while checking >= 1 loop select "${f}".nextval into :new."' || PK_NAME || '" from dual; select count("' || PK_NAME || '") into checking from "${o}" where "' || PK_NAME || '" = :new."' || PK_NAME || '"; end loop; end if; end;'); end if;END;`}}return Ww=n,Ww}var Jw,k$;function FY(){if(k$)return Jw;k$=1;const e=No(),n=Us(),r=wx();class s extends e{constructor(){super(...arguments)}renameTable(o,l){const h=new r(this.client.version).renameTableAndAutoIncrementTrigger(this.client.logger,o,l);this.pushQuery(h)}hasTable(o){this.pushQuery({sql:"select TABLE_NAME from USER_TABLES where TABLE_NAME = "+this.client.parameter(o,this.builder,this.bindingsHolder),output(l){return l.length>0}})}hasColumn(o,l){const u=`select COLUMN_NAME from ALL_TAB_COLUMNS where TABLE_NAME = ${this.client.parameter(o,this.builder,this.bindingsHolder)} and COLUMN_NAME = ${this.client.parameter(l,this.builder,this.bindingsHolder)}`;this.pushQuery({sql:u,output:h=>h.length>0})}dropSequenceIfExists(o){const l=this.schema?`"${this.schema}".`:"";this.pushQuery(n.wrapSqlWithCatch(`drop sequence ${l}${this.formatter.wrap(o)}`,-2289))}_dropRelatedSequenceIfExists(o){const u=new n.NameHelper(this.client.version).generateCombinedName(this.client.logger,"seq",o);this.dropSequenceIfExists(u)}dropTable(o){const l=this.schema?`"${this.schema}".`:"";this.pushQuery(`drop table ${l}${this.formatter.wrap(o)}`),this._dropRelatedSequenceIfExists(o)}dropTableIfExists(o){this.dropObject(o,"table")}dropViewIfExists(o){this.dropObject(o,"view")}dropObject(o,l){const u=this.schema?`"${this.schema}".`:"";let h=-942;l==="materialized view"&&(h=-12003),this.pushQuery(n.wrapSqlWithCatch(`drop ${l} ${u}${this.formatter.wrap(o)}`,h)),this._dropRelatedSequenceIfExists(o)}refreshMaterializedView(o){return this.pushQuery({sql:`BEGIN DBMS_MVIEW.REFRESH('${this.schemaNameRaw?this.schemaNameRaw+".":""}${o}'); END;`})}dropMaterializedView(o){this._dropView(o,!1,!0)}dropMaterializedViewIfExists(o){this.dropObject(o,"materialized view")}}return Jw=s,Jw}var Zw,B$;function GY(){if(B$)return Zw;B$=1;const e=Nh(),n=Tl();class r extends e{constructor(){super(...arguments)}checkIn(){return this._modifiers.checkIn=n(arguments),this}}return Zw=r,Zw}var eE,P$;function KY(){if(P$)return eE;P$=1;var e=zB();function n(r){return r&&r.length?e(r):[]}return eE=n,eE}var tE,z$;function YY(){if(z$)return tE;z$=1;const e=wx();function n(r){const s=new e(r.client.version);r.pushAdditional(function(){const a=this.tableCompiler.tableNameRaw,o=this.tableCompiler.schemaNameRaw,l=s.createAutoIncrementTrigger(this.client.logger,a,o);this.pushQuery(l)})}return tE={createAutoIncrementTriggerAndSequence:n},tE}var nE,U$;function vP(){if(U$)return nE;U$=1;const e=KY(),n=Ao(),r=ra(),{createAutoIncrementTriggerAndSequence:s}=YY(),{toNumber:a}=Qt();class o extends r{constructor(){super(...arguments),this.modifiers=["defaultTo","checkIn","nullable","comment"]}increments(u={primaryKey:!0}){return s(this),"integer not null"+(this.tableCompiler._canBeAddPrimaryKey(u)?" primary key":"")}bigincrements(u={primaryKey:!0}){return s(this),"number(20, 0) not null"+(this.tableCompiler._canBeAddPrimaryKey(u)?" primary key":"")}floating(u){const h=a(u,0);return`float${h?`(${h})`:""}`}double(u,h){return`number(${a(u,8)}, ${a(h,2)})`}decimal(u,h){return u===null?"decimal":`decimal(${a(u,8)}, ${a(h,2)})`}integer(u){return u?`number(${a(u,11)})`:"integer"}enu(u){u=e(u);const h=(u||[]).reduce((f,p)=>Math.max(f,String(p).length),1);return this.columnBuilder._modifiers.checkIn=[u],`varchar2(${h})`}datetime(u){return u?"timestamp":"timestamp with time zone"}timestamp(u){return u?"timestamp":"timestamp with time zone"}bool(){return this.columnBuilder._modifiers.checkIn=[[0,1]],"number(1, 0)"}varchar(u){return`varchar2(${a(u,255)})`}comment(u){const h=this.args[0]||this.defaults("columnName");this.pushAdditional(function(){this.pushQuery(`comment on column ${this.tableCompiler.tableName()}.`+this.formatter.wrap(h)+" is '"+(u||"")+"'")},u)}checkIn(u){return u===void 0?"":(u instanceof n?u=u.toQuery():Array.isArray(u)?u=u.map(h=>`'${h}'`).join(", "):u=`'${u}'`,`check (${this.formatter.wrap(this.args[0])} in (${u}))`)}}return o.prototype.tinyint="smallint",o.prototype.smallint="smallint",o.prototype.mediumint="integer",o.prototype.biginteger="number(20, 0)",o.prototype.text="clob",o.prototype.time="timestamp with time zone",o.prototype.bit="clob",o.prototype.json="clob",nE=o,nE}var rE,Q$;function bP(){if(Q$)return rE;Q$=1;const e=Us(),n=Ro(),r=Qt(),s=wx(),{isObject:a}=mt();class o extends n{constructor(){super(...arguments)}addColumns(u,h){if(u.sql.length>0){h=h||this.addColumnsPrefix;const f=u.sql;let d=`${this.lowerCase?"alter table ":"ALTER TABLE "}${this.tableName()} ${h}`;u.sql.length>1?d+=`(${f.join(", ")})`:d+=f.join(", "),this.pushQuery({sql:d,bindings:u.bindings})}}renameColumn(u,h){const f=this.tableName().slice(1,-1),p=new s(this.client.version);return this.pushQuery(p.renameColumnTrigger(this.client.logger,f,u,h))}compileAdd(u){const h=this.formatter.wrap(u),f=this.prefixArray("add column",this.getColumns(u));return this.pushQuery({sql:`alter table ${h} ${f.join(", ")}`})}createQuery(u,h,f){const p=f&&this.tableNameLike()?" as (select * from "+this.tableNameLike()+" where 0=1)":" ("+u.sql.join(", ")+this._addChecks()+")",d=`create table ${this.tableName()}${p}`;this.pushQuery({sql:h?e.wrapSqlWithCatch(d,-955):d,bindings:u.bindings}),this.single.comment&&this.comment(this.single.comment),f&&this.addColumns(u,this.addColumnsPrefix)}comment(u){this.pushQuery(`comment on table ${this.tableName()} is '${u}'`)}dropColumn(){const u=r.normalizeArr.apply(null,arguments);this.pushQuery(`alter table ${this.tableName()} drop (${this.formatter.columnize(u)})`)}_indexCommand(u,h,f){const p=new e.NameHelper(this.client.version);return this.formatter.wrap(p.generateCombinedName(this.client.logger,u,h,f))}primary(u,h){let f;a(h)&&({constraintName:h,deferrable:f}=h),f=f?` deferrable initially ${f}`:"",h=h?this.formatter.wrap(h):this.formatter.wrap(`${this.tableNameRaw}_pkey`);const p=u;let d=[];this.grouped.columns&&(d=this._getIncrementsColumnNames(),d&&d.forEach(g=>{p.includes(g)||p.unshift(g)})),this.pushQuery(`alter table ${this.tableName()} add constraint ${h} primary key (${this.formatter.columnize(p)})${f}`)}dropPrimary(u){u=u?this.formatter.wrap(u):this.formatter.wrap(this.tableNameRaw+"_pkey"),this.pushQuery(`alter table ${this.tableName()} drop constraint ${u}`)}index(u,h){h=h?this.formatter.wrap(h):this._indexCommand("index",this.tableNameRaw,u),this.pushQuery(`create index ${h} on ${this.tableName()} (`+this.formatter.columnize(u)+")")}dropIndex(u,h){h=h?this.formatter.wrap(h):this._indexCommand("index",this.tableNameRaw,u),this.pushQuery(`drop index ${h}`)}unique(u,h){let f;a(h)&&({indexName:h,deferrable:f}=h),f=f?` deferrable initially ${f}`:"",h=h?this.formatter.wrap(h):this._indexCommand("unique",this.tableNameRaw,u),this.pushQuery(`alter table ${this.tableName()} add constraint ${h} unique (`+this.formatter.columnize(u)+")"+f)}dropUnique(u,h){h=h?this.formatter.wrap(h):this._indexCommand("unique",this.tableNameRaw,u),this.pushQuery(`alter table ${this.tableName()} drop constraint ${h}`)}dropForeign(u,h){h=h?this.formatter.wrap(h):this._indexCommand("foreign",this.tableNameRaw,u),this.pushQuery(`alter table ${this.tableName()} drop constraint ${h}`)}}return o.prototype.addColumnsPrefix="add ",o.prototype.alterColumnsPrefix="modify ",rE=o,rE}var iE,H$;function _P(){if(H$)return iE;H$=1;const{ReturningHelper:e}=Us(),{isConnectionError:n}=Us(),r=ia(),s=FY(),a=GY(),o=vP(),l=bP();class u extends r{schemaCompiler(){return new s(this,...arguments)}columnBuilder(){return new a(this,...arguments)}columnCompiler(){return new o(this,...arguments)}tableCompiler(){return new l(this,...arguments)}database(){return this.connectionSettings.database}positionBindings(f){let p=0;return f.replace(/\?/g,function(){return p+=1,`:${p}`})}_stream(f,p,d,g){if(!p.sql)throw new Error("The query is empty");return new Promise(function(y,E){d.on("error",v=>{n(v)&&(f.__knex__disposed=v),E(v)}),d.on("end",y);const x=f.queryStream(p.sql,p.bindings,g);x.pipe(d),x.on("error",function(v){E(v),d.emit("error",v)})})}alias(f,p){return f+" "+p}parameter(f,p,d){return f instanceof e&&this.driver?f=new this.driver.OutParam(this.driver.OCCISTRING):typeof f=="boolean"&&(f=f?1:0),super.parameter(f,p,d)}}return Object.assign(u.prototype,{dialect:"oracle",driverName:"oracle"}),iE=u,iE}var sE,V$;function XY(){if(V$)return sE;V$=1;const e=gx(),n=tn(),r=qn(),s=Wi(),a=Js(),o=na(),{ReturningHelper:l}=Us(),{isString:u}=mt(),h=["comments","columns","join","where","union","group","having","order","lock"];class f extends o{constructor(d,g,y){super(d,g,y);const{onConflict:E}=this.single;if(E)throw new Error(".onConflict() is not supported for oracledb.");this.first=this.select}insert(){let d=this.single.insert||[],{returning:g}=this.single;if(!Array.isArray(d)&&s(this.single.insert)&&(d=[this.single.insert]),g&&!Array.isArray(g)&&(g=[g]),Array.isArray(d)&&d.length===1&&r(d[0]))return this._addReturningToSqlAndConvert(`insert into ${this.tableName} (${this.formatter.wrap(this.single.returning)}) values (default)`,g,this.tableName);if(r(this.single.insert)&&typeof this.single.insert!="function")return"";const y=this._prepInsert(d),E={};if(u(y))return this._addReturningToSqlAndConvert(`insert into ${this.tableName} ${y}`,g);if(y.values.length===1)return this._addReturningToSqlAndConvert(`insert into ${this.tableName} (${this.formatter.columnize(y.columns)}) values (${this.client.parameterize(y.values[0],void 0,this.builder,this.bindingsHolder)})`,g,this.tableName);const x=y.columns.length===0;return E.sql="begin "+y.values.map(v=>{let b;const w=x?"":this.client.parameterize(v,this.client.valueForUndefined,this.builder,this.bindingsHolder),C=Array.isArray(g)?g:[g];let T=`insert into ${this.tableName} `;g&&(b=new l(C.join(":")),E.outParams=(E.outParams||[]).concat(b)),x?T+=`(${this.formatter.wrap(this.single.returning)}) values (default)`:T+=`(${this.formatter.columnize(y.columns)}) values (${w})`,T+=g?` returning ROWID into ${this.client.parameter(b,this.builder,this.bindingsHolder)}`:"",T=this.formatter.client.positionBindings(T);const A=w.replace("DEFAULT, ","").replace(", DEFAULT","");return`execute immediate '${T.replace(/'/g,"''")}`+(A||g?"' using ":"")+A+(A&&g?", ":"")+(g?"out ?":"")+";"}).join(" ")+"end;",g&&(E.returning=g,E.returningSql=`select ${this.formatter.columnize(g)} from `+this.tableName+" where ROWID in ("+E.outParams.map((v,b)=>`:${b+1}`).join(", ")+") order by case ROWID "+E.outParams.map((v,b)=>`when CHARTOROWID(:${b+1}) then ${b}`).join(" ")+" end"),E}update(){const d=this._prepUpdate(this.single.update),g=this.where();let{returning:y}=this.single;const E=`update ${this.tableName} set `+d.join(", ")+(g?` ${g}`:"");return y?(Array.isArray(y)||(y=[y]),this._addReturningToSqlAndConvert(E,y,this.tableName)):E}truncate(){return`truncate table ${this.tableName}`}forUpdate(){return"for update"}forShare(){return this.client.logger.warn("lock for share is not supported by oracle dialect"),""}columnInfo(){const d=this.single.columnInfo;return{sql:`select * from xmltable( '/ROWSET/ROW'
122
+ passing dbms_xmlgen.getXMLType('
123
+ select char_col_decl_length, column_name, data_type, data_default, nullable
124
+ from all_tab_columns where table_name = ''${this.client.customWrapIdentifier(this.single.table,n)}'' ')
125
+ columns
126
+ CHAR_COL_DECL_LENGTH number, COLUMN_NAME varchar2(200), DATA_TYPE varchar2(106),
127
+ DATA_DEFAULT clob, NULLABLE varchar2(1))`,output(E){const x=a(E,function(v,b){return v[b.COLUMN_NAME]={type:b.DATA_TYPE,defaultValue:b.DATA_DEFAULT,maxLength:b.CHAR_COL_DECL_LENGTH,nullable:b.NULLABLE==="Y"},v},{});return d&&x[d]||x}}}select(){let d=this.with();const g=h.map(y=>this[y]());return d+=e(g).join(" "),this._surroundQueryWithLimitAndOffset(d)}aggregate(d){return this._aggregate(d,{aliasSeparator:" "})}_addReturningToSqlAndConvert(d,g,y){const E={sql:d};if(!g)return E;const x=Array.isArray(g)?g:[g],v=new l(x.join(":"));return E.sql=d+" returning ROWID into "+this.client.parameter(v,this.builder,this.bindingsHolder),E.returningSql=`select ${this.formatter.columnize(g)} from ${y} where ROWID = :1`,E.outParams=[v],E.returning=g,E}_surroundQueryWithLimitAndOffset(d){let{limit:g}=this.single;const{offset:y}=this.single,E=g||g===0||g==="0";if(g=+g,!E&&!y)return d;if(d=d||"",E&&!y)return`select * from (${d}) where rownum <= ${this._getValueOrParameterFromAttribute("limit",g)}`;const x=+y+(E?g:1e13);return"select * from (select row_.*, ROWNUM rownum_ from ("+d+") row_ where rownum <= "+(this.single.skipBinding.offset?x:this.client.parameter(x,this.builder,this.bindingsHolder))+") where rownum_ > "+this._getValueOrParameterFromAttribute("offset",y)}}return sE=f,sE}var aE,F$;function cC(){if(F$)return aE;F$=1;const e=Us(),{promisify:n}=nt,r=nt;function s(u,h){this.columnName=u,this.value=h,this.returning=!1}s.prototype.toString=function(){return"[object BlobHelper:"+this.columnName+"]"};function a(u,h){return new Promise((f,p)=>{let d=h==="string"?"":Buffer.alloc(0);u.on("error",function(g){p(g)}),u.on("data",function(g){h==="string"?d+=g:d=Buffer.concat([d,g])}),u.on("end",function(){f(d)})})}const o=function(u){const h=nt;let f;if(u.type)u.type===h.BLOB?f="buffer":u.type===h.CLOB&&(f="string");else if(u.iLob)u.iLob.type===h.CLOB?f="string":u.iLob.type===h.BLOB&&(f="buffer");else throw new Error("Unrecognized oracledb lob stream type");return f==="string"&&u.setEncoding("utf-8"),a(u,f)};function l(u,h){if(u.executeAsync)return;u.commitAsync=function(){return new Promise((p,d)=>{this.commit(function(g){if(g)return d(g);p()})})},u.rollbackAsync=function(){return new Promise((p,d)=>{this.rollback(function(g){if(g)return d(g);p()})})};const f=n(function(p,d,g,y){if(g=g||{},g.outFormat=h.driver.OUT_FORMAT_OBJECT||h.driver.OBJECT,!g.outFormat)throw new Error("not found oracledb.outFormat constants");g.resultSet?u.execute(p,d||[],g,function(E,x){if(E)return e.isConnectionError(E)&&(u.close().catch(function(C){}),u.__knex__disposed=E),y(E);const v={rows:[],resultSet:x.resultSet},b=100,w=function(C,T,A){T.getRows(A,function(N,O){if(N)e.isConnectionError(N)&&(C.close().catch(function(I){}),C.__knex__disposed=N),T.close(function(){return y(N)});else{if(O.length===0)return y(null,v);if(O.length>0)if(O.length===A)v.rows=v.rows.concat(O),w(C,T,A);else return v.rows=v.rows.concat(O),y(null,v)}})};w(u,x.resultSet,b)}):u.execute(p,d||[],g,function(E,x){return E?(e.isConnectionError(E)&&(u.close().catch(function(v){}),u.__knex__disposed=E),y(E)):y(null,x)})});u.executeAsync=function(p,d,g){return f(p,d,g).then(async y=>{const E=()=>y.resultSet?n(y.resultSet.close).call(y.resultSet):Promise.resolve(),x=[];if(y.rows&&Array.isArray(y.rows))for(let v=0;v<y.rows.length;v++){const b=y.rows[v];for(const w in b)b[w]instanceof r.Readable&&x.push({index:v,key:w,stream:b[w]})}try{for(const v of x)y.rows[v.index][v.key]=await o(v.stream)}catch(v){throw await E().catch(()=>{}),v}return await E(),y})}}return e.BlobHelper=s,e.monkeyPatchConnection=l,aE=e,aE}var oE,G$;function WY(){if(G$)return oE;G$=1;const e=vh(),n=Ws(),r=qn(),s=Wi(),a=XY(),o=cC().ReturningHelper,l=cC().BlobHelper,{isString:u}=mt(),{columnize:h}=Vt();class f extends a{insert(){const d=this,g=this._prepOutbindings(this.single.insert,this.single.returning),y=g.outBinding,E=g.returning,x=g.values;if(Array.isArray(x)&&x.length===1&&r(x[0])){const C=this.single.returning?" ("+this.formatter.wrap(this.single.returning)+")":"";return this._addReturningToSqlAndConvert("insert into "+this.tableName+C+" values (default)",y[0],this.tableName,E)}if(r(this.single.insert)&&typeof this.single.insert!="function")return"";const v=this._prepInsert(x),b={};if(u(v))return this._addReturningToSqlAndConvert("insert into "+this.tableName+" "+v,y[0],this.tableName,E);if(v.values.length===1)return this._addReturningToSqlAndConvert("insert into "+this.tableName+" ("+this.formatter.columnize(v.columns)+") values ("+this.client.parameterize(v.values[0],void 0,this.builder,this.bindingsHolder)+")",y[0],this.tableName,E);const w=v.columns.length===0;return b.returning=E,b.sql="begin "+v.values.map(function(C,T){const A=w?"":d.client.parameterize(C,d.client.valueForUndefined,d.builder,d.bindingsHolder);let N="insert into "+d.tableName;w?N+=" ("+d.formatter.wrap(d.single.returning)+") values (default)":N+=" ("+d.formatter.columnize(v.columns)+") values ("+A+")";let O="",I="",k="",R="";n(C,function(D){D instanceof l||(k+=" ?,")}),k=k.slice(0,-1),y[T].forEach(function(D){const z=D.columnName||D;if(O+=d.formatter.wrap(z)+",",I+=" ?,",R+=" out ?,",D instanceof l)return d.formatter.bindings.push(D);d.formatter.bindings.push(new o(z))}),O=O.slice(0,-1),I=I.slice(0,-1),R=R.slice(0,-1),O&&I&&(N+=" returning "+O+" into"+I),N=d.formatter.client.positionBindings(N);const M=A.replace(/DEFAULT, /g,"").replace(/, DEFAULT/g,"").replace("EMPTY_BLOB(), ","").replace(", EMPTY_BLOB()","");return"execute immediate '"+N.replace(/'/g,"''")+(M||C?"' using ":"")+M+(M&&R?",":"")+R+";"}).join(" ")+"end;",b.outBinding=y,E[0]==="*"&&(b.returningSql=function(){return"select * from "+d.tableName+" where ROWID in ("+this.outBinding.map(function(C,T){return":"+(T+1)}).join(", ")+") order by case ROWID "+this.outBinding.map(function(C,T){return"when CHARTOROWID(:"+(T+1)+") then "+T}).join(" ")+" end"}),b}with(){const d=[];if(this.grouped.with)for(const y of this.grouped.with)y.recursive&&(d.push(y),y.recursive=!1);const g=super.with();for(const y of d)y.recursive=!0;return g}_addReturningToSqlAndConvert(d,g,y,E){const x=this,v={sql:d};if(!g)return v;const b=Array.isArray(g)?g:[g];let w="",C="";return b.forEach(function(T){const A=T.columnName||T;if(w+=x.formatter.wrap(A)+",",C+="?,",T instanceof l)return x.formatter.bindings.push(T);x.formatter.bindings.push(new o(A))}),v.sql=d,w=w.slice(0,-1),C=C.slice(0,-1),w&&C&&(v.sql+=" returning "+w+" into "+C),v.outBinding=[g],E[0]==="*"&&(v.returningSql=function(){return"select * from "+x.tableName+" where ROWID = :1"}),v.returning=E,v}_prepOutbindings(d,g){const y={};let E=d||[],x=g||[];!Array.isArray(E)&&s(d)&&(E=[E]),x&&!Array.isArray(x)&&(x=[x]);const v=[];return n(E,function(b,w){x[0]==="*"?v[w]=["ROWID"]:v[w]=e(x),n(b,function(C,T){if(C instanceof Buffer){b[T]=new l(T,C);const A=v[w].indexOf(T);A>=0&&(v[w].splice(A,1),b[T].returning=!0),v[w].push(b[T])}C===void 0&&delete E[w][T]})}),y.returning=x,y.outBinding=v,y.values=E,y}_groupOrder(d,g){return super._groupOrderNulls(d,g)}update(){const d=this,g={},y=this._prepOutbindings(this.single.update||this.single.counter,this.single.returning),E=y.outBinding,x=y.returning,v=this._prepUpdate(this.single.update),b=this.where();let w="",C="";return r(v)&&typeof this.single.update!="function"?"":(E.forEach(function(T){T.forEach(function(A){const N=A.columnName||A;if(w+=d.formatter.wrap(N)+",",C+=" ?,",A instanceof l)return d.formatter.bindings.push(A);d.formatter.bindings.push(new o(N))})}),w=w.slice(0,-1),C=C.slice(0,-1),g.outBinding=E,g.returning=x,g.sql="update "+this.tableName+" set "+v.join(", ")+(b?" "+b:""),E.length&&!r(E[0])&&(g.sql+=" returning "+w+" into"+C),x[0]==="*"&&(g.returningSql=function(){let T="select * from "+d.tableName;const A=this.rowsAffected.length||this.rowsAffected;let N=" where ROWID in (",O=") order by case ROWID ";for(let I=0;I<A;I++)this.returning[0]==="*"&&(N+=":"+(I+1)+", ",O+="when CHARTOROWID(:"+(I+1)+") then "+I+" ");return this.returning[0]==="*"&&(this.returning=this.returning.slice(0,-1),N=N.slice(0,-2),O=O.slice(0,-1)),T+=N+O+" end"}),g)}_jsonPathWrap(d){return`'${d.path||d[1]}'`}jsonExtract(d){return this._jsonExtract(d.singleValue?"json_value":"json_query",d)}jsonSet(d){return`json_transform(${h(d.column,this.builder,this.client,this.bindingsHolder)}, set ${this.client.parameter(d.path,this.builder,this.bindingsHolder)} = ${this.client.parameter(d.value,this.builder,this.bindingsHolder)})`}jsonInsert(d){return`json_transform(${h(d.column,this.builder,this.client,this.bindingsHolder)}, insert ${this.client.parameter(d.path,this.builder,this.bindingsHolder)} = ${this.client.parameter(d.value,this.builder,this.bindingsHolder)})`}jsonRemove(d){const g=`json_transform(${h(d.column,this.builder,this.client,this.bindingsHolder)}, remove ${this.client.parameter(d.path,this.builder,this.bindingsHolder)})`;return d.alias?this.client.alias(g,this.formatter.wrap(d.alias)):g}whereJsonPath(d){return this._whereJsonPath("json_value",d)}whereJsonSupersetOf(d){throw new Error("Json superset where clause not actually supported by Oracle")}whereJsonSubsetOf(d){throw new Error("Json subset where clause not actually supported by Oracle")}onJsonPathEquals(d){return this._onJsonPathEquals("json_value",d)}}return oE=f,oE}var uE,K$;function JY(){if(K$)return uE;K$=1;const e=bP();class n extends e{constructor(s,a){super(s,a)}_setNullableState(s,a){const o=a?"NULL":"NOT NULL",l=`alter table ${this.tableName()} modify (${this.formatter.wrap(s)} ${o})`;return this.pushQuery({sql:l})}}return uE=n,uE}var lE,Y$;function ZY(){if(Y$)return lE;Y$=1;const e=vP(),{isObject:n}=mt();class r extends e{constructor(){super(...arguments),this.modifiers=["defaultTo","nullable","comment","checkJson"],this._addCheckModifiers()}datetime(a){let o;return n(a)?{useTz:o}=a:o=!a,o?"timestamp with local time zone":"timestamp"}timestamp(a){let o;return n(a)?{useTz:o}=a:o=!a,o?"timestamp with local time zone":"timestamp"}checkRegex(a,o){return this._check(`REGEXP_LIKE(${this.formatter.wrap(this.getColumnName())},${this.client._escapeBinding(a)})`,o)}json(){return this.columnBuilder._modifiers.checkJson=[this.formatter.columnize(this.getColumnName())],"varchar2(4000)"}jsonb(){return this.json()}checkJson(a){return`check (${a} is json)`}}return r.prototype.time="timestamp with local time zone",r.prototype.uuid=({useBinaryUuid:s=!1}={})=>s?"raw(16)":"char(36)",lE=r,lE}var cE,X$;function eX(){if(X$)return cE;X$=1;const e=Oo();class n extends e{constructor(s,a){super(s,a)}createOrReplace(){this.createQuery(this.columns,this.selectQuery,!1,!0)}createMaterializedView(){this.createQuery(this.columns,this.selectQuery,!0)}}return cE=n,cE}var fE,W$;function tX(){if(W$)return fE;W$=1;const e=ql();class n extends e{constructor(){super(...arguments)}checkOption(){this._single.checkOption="default_option"}}return fE=n,fE}var hE,J$;function nX(){if(J$)return hE;J$=1;const e=Ji(),{timeout:n,KnexTimeoutError:r}=_o(),s=tr()("knex:tx");return hE=class extends e{begin(o){return this.isolationLevel&&this.client.logger.warn("Transaction isolation is not currently supported for Oracle"),Promise.resolve()}async commit(o,l){this._completed=!0;try{await o.commitAsync(),this._resolver(l)}catch(u){this._rejecter(u)}}release(o,l){return this._resolver(l)}rollback(o,l){return this._completed=!0,s("%s: rolling back",this.txid),n(o.rollbackAsync(),5e3).catch(u=>{if(!(u instanceof r))return Promise.reject(u);this._rejecter(u)}).then(()=>{if(l===void 0){if(this.doNotRejectOnRollback){this._resolver();return}l=new Error(`Transaction rejected with non-error: ${l}`)}this._rejecter(l)})}savepoint(o){return this.query(o,`SAVEPOINT ${this.txid}`)}async acquireConnection(o,l){const u=o&&o.connection,h=u||await this.client.acquireConnection();try{return h.__knexTxId=this.txid,h.isTransaction=!0,await l(h)}finally{s("%s: releasing connection",this.txid),h.isTransaction=!1;try{await h.commitAsync()}catch(f){this._rejecter(f)}finally{u?s("%s: not releasing external connection",this.txid):await this.client.releaseConnection(h)}}}},hE}var dE,Z$;function rX(){if(Z$)return dE;Z$=1;var e={};const n=Ws(),r=xh(),s=qn(),a=ti(),o=Rh(),l=WY(),u=JY(),h=ZY(),{BlobHelper:f,ReturningHelper:p,monkeyPatchConnection:d}=cC(),g=eX(),y=tX(),E=nX(),x=_P(),{isString:v}=mt(),{outputQuery:b,unwrapRaw:w}=Vt(),{compileCallback:C}=ta();class T extends x{constructor(I){super(I),this.version&&(this.version=A(this.version)),this.driver&&(e.UV_THREADPOOL_SIZE=e.UV_THREADPOOL_SIZE||1,e.UV_THREADPOOL_SIZE=parseInt(e.UV_THREADPOOL_SIZE)+this.driver.poolMax)}_driver(){const I=this,k=nt;return I.fetchAsString=[],this.config.fetchAsString&&Array.isArray(this.config.fetchAsString)&&this.config.fetchAsString.forEach(function(R){v(R)&&(R=R.toUpperCase(),k[R]&&(R!=="NUMBER"&&R!=="DATE"&&R!=="CLOB"&&R!=="BUFFER"&&this.logger.warn('Only "date", "number", "clob" and "buffer" are supported for fetchAsString'),I.fetchAsString.push(k[R])))}),k}queryCompiler(I,k){return new l(this,I,k)}tableCompiler(){return new u(this,...arguments)}columnCompiler(){return new h(this,...arguments)}viewBuilder(){return new y(this,...arguments)}viewCompiler(){return new g(this,...arguments)}formatter(I){return new o(this,I)}transaction(){return new E(this,...arguments)}prepBindings(I){return a(I,k=>k instanceof f&&this.driver?{type:this.driver.BLOB,dir:this.driver.BIND_OUT}:k instanceof p&&this.driver?{type:this.driver.STRING,dir:this.driver.BIND_OUT}:typeof k=="boolean"?k?1:0:k)}parameter(I,k,R){return typeof I=="function"?b(C(I,void 0,this,R),!0,k,this):I instanceof f?(R.bindings.push(I.value),"?"):w(I,!0,k,this,R)||"?"}acquireRawConnection(){return new Promise((I,k)=>{const R=this.connectionSettings.externalAuth?{externalAuth:this.connectionSettings.externalAuth}:{user:this.connectionSettings.user,password:this.connectionSettings.password};R.connectString=N(this.connectionSettings),this.connectionSettings.prefetchRowCount&&(R.prefetchRows=this.connectionSettings.prefetchRowCount),this.connectionSettings.stmtCacheSize!==void 0&&(R.stmtCacheSize=this.connectionSettings.stmtCacheSize),this.driver.fetchAsString=this.fetchAsString,this.driver.getConnection(R,(M,D)=>{if(M)return k(M);d(D,this),I(D)})})}destroyRawConnection(I){return I.release()}async acquireConnection(){const I=await super.acquireConnection();return this.checkVersion(I),I}checkVersion(I){if(this.version)return this.version;const k=A(I.oracleServerVersionString);if(!k)throw new Error(this.version===null?"Invalid Oracledb version number format passed to knex. Unable to successfully auto-detect as fallback. Please specify a valid oracledb version.":"Unable to detect Oracledb version number automatically. Please specify the version in knex configuration.");return this.version=k,k}_query(I,k){if(!k.sql)throw new Error("The query is empty");const R=Object.assign({},k.options,{autoCommit:!1});return k.method==="select"&&(R.resultSet=!0),I.executeAsync(k.sql,k.bindings,R).then(async function(M){let D=r(M.outBinds);if(k.response=M.rows||[],k.rowsAffected=M.rows?M.rows.rowsAffected:M.rowsAffected,k.method==="raw"&&D.length>0)return{response:D};if(k.method==="update"){const j=k.rowsAffected.length||k.rowsAffected,L=[],P=[],H=G=>function(V,B){const K=B*j;P.push(D[G+K])};for(let G=0;G<j;G++)L.push(k.outBinding[0]),n(k.outBinding[0],H(G));D=P,k.outBinding=L}if(!k.returning&&D.length===0)return I.isTransaction||await I.commitAsync(),k;const z=[];let q=0;for(let j=0;j<k.outBinding.length;j++){const L=k.outBinding[j];q=q+(k.outBinding[j-1]?k.outBinding[j-1].length:0);for(let P=0;P<L.length;P++){const H=L[P];await new Promise(function(G,V){if(H instanceof f){const B=D[P+q];H.returning&&(k.response[j]=k.response[j]||{},k.response[j][H.columnName]=H.value),B.on("error",function(K){V(K)}),B.on("finish",function(){G()}),B.write(H.value),B.end()}else k.outBinding[j][P]==="ROWID"?(z.push(D[P+q]),G()):(k.response[j]=k.response[j]||{},k.response[j][H]=D[P+q],G())})}}if(k.returningSql){const j=await I.executeAsync(k.returningSql(),z,{resultSet:!0});k.response=j.rows}return I.isTransaction||await I.commitAsync(),k})}processResponse(I,k){const{response:R}=I;if(I.output)return I.output.call(k,R);switch(I.method){case"select":return R;case"first":return R[0];case"pluck":return a(R,I.pluck);case"insert":case"del":case"update":case"counter":return I.returning&&!s(I.returning)||I.returningSql?R:I.rowsAffected!==void 0?I.rowsAffected:1;default:return R}}processPassedConnection(I){this.checkVersion(I),d(I,this)}}T.prototype.driverName="oracledb";function A(O){try{const I=O.split(".").slice(0,2);I.forEach((R,M)=>{I[M]=R.replace(/\D$/,"")});const k=I.join(".");return k.match(/^\d+\.?\d*$/)?k:null}catch{return null}}function N(O){return O.connectString?O.connectString:O.port?O.host+":"+O.port+"/"+O.database:O.host+"/"+O.database}return dE=T,dE}var pE,eI;function iX(){if(eI)return pE;eI=1;const e=Oh();class n extends e{constructor(...s){super(...s),this.driverName="pgnative",this.canCancelQuery=!0}_driver(){return nt.native}_stream(s,a,o,l){if(!a.sql)throw new Error("The query is empty");const u=this;return new Promise((h,f)=>(o.on("error",f),o.on("end",h),u._query(s,a).then(p=>p.response).then(({rows:p})=>p.forEach(d=>o.write(d))).catch(function(p){o.emit("error",p)}).then(function(){o.end()})))}async cancelQuery(s){try{return await this._wrappedCancelQueryCall(null,s)}catch(a){throw this.logger.warn(`Connection Error: ${a}`),a}}_wrappedCancelQueryCall(s,a){return new Promise(function(o,l){a.native.cancel(function(u){if(u){l(u);return}o(!0)})})}}return pE=n,pE}var mE,tI;function sX(){if(tI)return mE;tI=1;const e=Ji();return mE=class extends e{begin(r){const s=[this.isolationLevel?`ISOLATION LEVEL ${this.isolationLevel}`:"",this.readOnly?"READ ONLY":""].join(" ").trim();return s.length===0?this.query(r,"BEGIN;"):this.query(r,`BEGIN ${s};`)}savepoint(r){return this.trxClient.logger("Redshift does not support savepoints."),Promise.resolve()}release(r,s){return this.trxClient.logger("Redshift does not support savepoints."),Promise.resolve()}rollbackTo(r,s){return this.trxClient.logger("Redshift does not support savepoints."),Promise.resolve()}},mE}var gE,nI;function aX(){if(nI)return gE;nI=1;const e=na(),n=yx(),r=tn(),{columnize:s}=Vt();class a extends n{truncate(){return`truncate ${this.tableName.toLowerCase()}`}insert(){const l=e.prototype.insert.apply(this,arguments);return l===""?l:(this._slightReturn(),{sql:l})}update(){const l=e.prototype.update.apply(this,arguments);return this._slightReturn(),{sql:l}}del(){const l=e.prototype.del.apply(this,arguments);return this._slightReturn(),{sql:l}}_slightReturn(){this.single.isReturning&&this.client.logger.warn("insert/update/delete returning is not supported by redshift dialect")}forUpdate(){return this.client.logger.warn("table lock is not supported by redshift dialect"),""}forShare(){return this.client.logger.warn("lock for share is not supported by redshift dialect"),""}forNoKeyUpdate(){return this.client.logger.warn("table lock is not supported by redshift dialect"),""}forKeyShare(){return this.client.logger.warn("lock for share is not supported by redshift dialect"),""}columnInfo(){const l=this.single.columnInfo;let u=this.single.schema;const h=this.client.customWrapIdentifier(this.single.table,r);u&&(u=this.client.customWrapIdentifier(u,r));const f="select * from information_schema.columns where table_name = ? and table_catalog = ?",p=[h.toLowerCase(),this.client.database().toLowerCase()];return this._buildColumnInfoQuery(u,f,p,l)}jsonExtract(l){let u;return Array.isArray(l.column)?u=l.column:u=[l],u.map(h=>{const f=`json_extract_path_text(${s(h.column||h[0],this.builder,this.client,this.bindingsHolder)}, ${this.client.toPathForJson(l.path||h[1],this.builder,this.bindingsHolder)})`,p=h.alias||h[2];return p?this.client.alias(f,this.formatter.wrap(p)):f}).join(", ")}jsonSet(l){throw new Error("Json set is not supported by Redshift")}jsonInsert(l){throw new Error("Json insert is not supported by Redshift")}jsonRemove(l){throw new Error("Json remove is not supported by Redshift")}whereJsonPath(l){return this._whereJsonPath("json_extract_path_text",Object.assign({},l,{path:this.client.toPathForJson(l.path)}))}whereJsonSupersetOf(l){throw new Error("Json superset is not supported by Redshift")}whereJsonSubsetOf(l){throw new Error("Json subset is not supported by Redshift")}onJsonPathEquals(l){return this._onJsonPathEquals("json_extract_path_text",l)}}return gE=a,gE}var yE,rI;function oX(){if(rI)return yE;rI=1;const e=Nh();class n extends e{constructor(){super(...arguments)}primary(){return this.notNullable(),super.primary(...arguments)}index(){return this.client.logger.warn("Redshift does not support the creation of indexes."),this}}return yE=n,yE}var vE,iI;function uX(){if(iI)return vE;iI=1;const e=vx(),n=ra();class r extends e{constructor(){super(...arguments)}bit(a){return a.length!==!1?`char(${a.length})`:"char(1)"}datetime(a){return a?"timestamp":"timestamptz"}timestamp(a){return a?"timestamp":"timestamptz"}comment(a){this.pushAdditional(function(){this.pushQuery(`comment on column ${this.tableCompiler.tableName()}.`+this.formatter.wrap(this.args[0])+" is "+(a?`'${a}'`:"NULL"))},a)}}return r.prototype.increments=({primaryKey:s=!0}={})=>"integer identity(1,1)"+(s?" primary key":"")+" not null",r.prototype.bigincrements=({primaryKey:s=!0}={})=>"bigint identity(1,1)"+(s?" primary key":"")+" not null",r.prototype.binary="varchar(max)",r.prototype.blob="varchar(max)",r.prototype.enu="varchar(255)",r.prototype.enum="varchar(255)",r.prototype.json="varchar(max)",r.prototype.jsonb="varchar(max)",r.prototype.longblob="varchar(max)",r.prototype.mediumblob="varchar(16777218)",r.prototype.set="text",r.prototype.text="varchar(max)",r.prototype.tinyblob="varchar(256)",r.prototype.uuid=n.prototype.uuid,r.prototype.varbinary="varchar(max)",r.prototype.bigint="bigint",r.prototype.bool="boolean",r.prototype.double="double precision",r.prototype.floating="real",r.prototype.smallint="smallint",r.prototype.tinyint="smallint",vE=r,vE}var bE,sI;function lX(){if(sI)return bE;sI=1;const e=To(),n=bx();class r extends n{constructor(){super(...arguments)}index(a,o,l){this.client.logger.warn("Redshift does not support the creation of indexes.")}dropIndex(a,o){this.client.logger.warn("Redshift does not support the deletion of indexes.")}createQuery(a,o,l){const u=o?"create table if not exists ":"create table ",h=" ("+a.sql.join(", ")+this._addChecks()+")";let f=u+this.tableName()+(l&&this.tableNameLike()?" (like "+this.tableNameLike()+")":h);this.single.inherits&&(f+=` like (${this.formatter.wrap(this.single.inherits)})`),this.pushQuery({sql:f,bindings:a.bindings}),e(this.single,"comment")&&this.comment(this.single.comment),l&&this.addColumns(a,this.addColumnsPrefix)}primary(a,o){const l=this;o=o?l.formatter.wrap(o):l.formatter.wrap(`${this.tableNameRaw}_pkey`),a.constructor!==Array&&(a=[a]);const u=l.grouped.columns;if(u)for(let h=0;h<a.length;h++){let f=u.find(d=>d.grouping==="columns"&&d.builder&&d.builder._method==="add"&&d.builder._args&&d.builder._args.indexOf(a[h])>-1);if(f&&(f=f.builder),!(f&&f._modifiers&&f._modifiers.nullable&&f._modifiers.nullable[0]===!1))return f?this.client.logger.warn("Redshift does not allow primary keys to contain nullable columns."):this.client.logger.warn("Redshift does not allow primary keys to contain nonexistent columns.")}return l.pushQuery(`alter table ${l.tableName()} add constraint ${o} primary key (${l.formatter.columnize(a)})`)}addColumns(a,o,l){if(o===this.alterColumnsPrefix)super.addColumns(a,o,l);else{o=o||this.addColumnsPrefix,l=l||this.getColumns();for(const u of l){const h=this.tableName(),f=u.compileColumn();this.pushQuery({sql:`alter table ${h} ${o}${f}`,bindings:[]})}}}}return bE=r,bE}var _E,aI;function cX(){if(aI)return _E;aI=1;const e=gP();class n extends e{constructor(){super(...arguments)}}return _E=n,_E}var wE,oI;function fX(){if(oI)return wE;oI=1;const e=_x();class n extends e{constructor(s,a){super(s,a)}}return wE=n,wE}var EE,uI;function hX(){if(uI)return EE;uI=1;const e=Oh(),n=ti(),r=sX(),s=aX(),a=oX(),o=uX(),l=lX(),u=cX(),h=fX();class f extends e{transaction(){return new r(this,...arguments)}queryCompiler(d,g){return new s(this,d,g)}columnBuilder(){return new a(this,...arguments)}columnCompiler(){return new o(this,...arguments)}tableCompiler(){return new l(this,...arguments)}schemaCompiler(){return new u(this,...arguments)}viewCompiler(){return new h(this,...arguments)}_driver(){return nt}processResponse(d,g){const y=d.response;return d.output?d.output.call(g,y):d.method==="raw"?y:y.command==="SELECT"?d.method==="first"?y.rows[0]:d.method==="pluck"?n(y.rows,d.pluck):y.rows:y.command==="INSERT"||y.command==="UPDATE"||y.command==="DELETE"?y.rowCount:y}toPathForJson(d,g,y){return d.replace(/^(\$\.)/,"").split(".").map((function(E){return this.parameter(E,g,y)}).bind(this)).join(", ")}}return Object.assign(f.prototype,{dialect:"redshift",driverName:"pg-redshift"}),EE=f,EE}var lI;function dX(){if(lI)return Ou;lI=1,Object.defineProperty(Ou,"__esModule",{value:!0}),Ou.getDialectByNameOrAlias=void 0;const{resolveClientNameWithAliases:e}=Qt(),n=Object.freeze({"better-sqlite3":()=>gY(),cockroachdb:()=>xY(),mssql:()=>jY(),mysql:()=>yP(),mysql2:()=>VY(),oracle:()=>_P(),oracledb:()=>rX(),pgnative:()=>iX(),postgres:()=>Oh(),redshift:()=>hX(),sqlite3:()=>pP()});function r(s){const a=e(s),o=n[a];if(!o)throw new Error(`Invalid clientName given: ${s}`);return o()}return Ou.getDialectByNameOrAlias=r,Ou}var CE,cI;function pX(){if(cI)return CE;cI=1;const e=ia(),{SUPPORTED_CLIENTS:n}=hx(),r=ZK(),{getDialectByNameOrAlias:s}=dX();function a(o){let l,u;const h=typeof o=="string"?Object.assign(r(o),arguments[2]):o;if(arguments.length===0||!h.client&&!h.dialect)l=e;else if(typeof h.client=="function")l=h.client;else{const f=h.client||h.dialect;if(!n.includes(f))throw new Error(`knex: Unknown configuration option 'client' value ${f}. Note that it is case-sensitive, check documentation for supported values.`);l=s(f)}return typeof h.connection=="string"?u=Object.assign({},h,{connection:r(h.connection).connection}):u=Object.assign({},h),{resolvedConfig:u,Dialect:l}}return CE={resolveConfig:a},CE}var xE,fI;function mX(){if(fI)return xE;fI=1;const e=ia(),n=ni(),r=sP(),s=oP(),{KnexTimeoutError:a}=_o(),{resolveConfig:o}=pX(),l=hP(),u=ql(),h=Nh(),f=dP();function p(d){const{resolvedConfig:g,Dialect:y}=o(...arguments),E=s(new y(g));return g.userParams&&(E.userParams=g.userParams),E}return p.Client=e,p.KnexTimeoutError=a,p.QueryBuilder={extend:function(d,g){n.extend(d,g),r.push(d)}},p.SchemaBuilder={extend:function(d,g){l.extend(d,g)}},p.ViewBuilder={extend:function(d,g){u.extend(d,g)}},p.ColumnBuilder={extend:function(d,g){h.extend(d,g)}},p.TableBuilder={extend:function(d,g){f.extend(d,g)}},xE=p,xE}var SE,hI;function gX(){return hI||(hI=1,SE=mX()),SE}gX();function dI(e){return e.schema?`${e.schema}.${e.name}`:e.name}function pI(e,n){return`${e}:${n}`}function yX(e,n){const r=[],s=new Map;for(const f of e)s.set(dI(f),f);const a=new Map;for(const f of n)a.set(dI(f),f);for(const[f,p]of s)a.has(f)||r.push({type:"table-removed",table:p.name,schema:p.schema});for(const[f,p]of a)s.has(f)||r.push({type:"table-added",table:p.name,schema:p.schema});for(const[f,p]of s){const d=a.get(f);if(!d)continue;const g=new Map(p.columns.map(v=>[v.name,v])),y=new Map(d.columns.map(v=>[v.name,v]));for(const[v,b]of g){const w=y.get(v);if(!w){r.push({type:"column-removed",table:p.name,schema:p.schema,column:v,dataType:b.dataType});continue}b.dataType!==w.dataType&&r.push({type:"column-type-changed",table:p.name,schema:p.schema,column:v,oldType:b.dataType,newType:w.dataType}),b.nullable!==w.nullable&&r.push({type:"column-nullability-changed",table:p.name,schema:p.schema,column:v,nullable:w.nullable})}for(const[v,b]of y)g.has(v)||r.push({type:"column-added",table:p.name,schema:p.schema,column:v,dataType:b.dataType});const E=new Map(p.foreignKeys.map(v=>[pI(p.name,v.constraintName),v])),x=new Map(d.foreignKeys.map(v=>[pI(d.name,v.constraintName),v]));for(const[v,b]of E)x.has(v)||r.push({type:"fk-removed",table:p.name,schema:p.schema,constraintName:b.constraintName,columnName:b.columnName,referencedTable:b.referencedTable});for(const[v,b]of x)E.has(v)||r.push({type:"fk-added",table:d.name,schema:d.schema,constraintName:b.constraintName,columnName:b.columnName,referencedTable:b.referencedTable})}const o=r.filter(f=>f.type==="table-added").map(f=>f.table),l=r.filter(f=>f.type==="table-removed").map(f=>f.table),u=r.filter(f=>f.type==="column-added").length,h=r.filter(f=>f.type==="column-type-changed"||f.type==="column-nullability-changed").length;return{changes:r,hasChanges:r.length>0,tablesAdded:o,tablesRemoved:l,columnsAdded:u,columnsModified:h}}function vX(){const e=qe(d=>d.connectionId),n=qe(d=>d.crawlResult),r=qe(d=>d.pollingEnabled),s=qe(d=>d.schemaBaseline),a=qe(d=>d.setSchemaDiff),o=(n==null?void 0:n.startTable)??"",l=(n==null?void 0:n.startSchema)??null,u=(n==null?void 0:n.depth)??1,h=!!(e&&n&&r&&s),f=Xn.schema.crawlFrom.useQuery({connectionId:e??"",tableName:o,schema:l,maxDepth:u},{enabled:h,refetchInterval:h?3e4:!1,refetchOnWindowFocus:!1}),p=te.useRef(f.data);te.useEffect(()=>{if(!f.data||f.data===p.current)return;p.current=f.data;const d=qe.getState().schemaBaseline;if(!d)return;const g=yX(d,f.data.tables);g.hasChanges&&a(g)},[f.data,a])}function bX(){const e=qe(s=>s.connectionId),n=qe(s=>s.crawlResult),r=qe(s=>s.setSchemaBaseline);return te.useEffect(()=>{n!=null&&n.tables&&r(n.tables)},[n,r]),vX(),e?n?F.jsxs("div",{className:"app-exploring",children:[F.jsxs("aside",{className:"sidebar",children:[F.jsx("h2",{children:"SchemaLens"}),F.jsx($q,{}),F.jsx(gK,{}),F.jsx(mK,{})]}),F.jsx("main",{className:"canvas-main",children:F.jsx(pK,{})})]}):F.jsxs("div",{className:"app-centered",children:[F.jsx("h1",{children:"SchemaLens"}),F.jsx($q,{})]}):F.jsxs("div",{className:"app-centered",children:[F.jsx("h1",{children:"SchemaLens"}),F.jsx("p",{children:"Living architecture diagrams from your database schema."}),F.jsx(XQ,{})]})}function _X(){return F.jsx(Xn.Provider,{client:HQ,queryClient:Mq,children:F.jsx(cU,{client:Mq,children:F.jsx(bX,{})})})}Dz.createRoot(document.getElementById("root")).render(F.jsx(te.StrictMode,{children:F.jsx(_X,{})}));