fakebase-studio 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/package.json +1 -1
- package/server/dist/db.d.ts +4 -0
- package/server/dist/db.d.ts.map +1 -1
- package/server/dist/db.js +43 -0
- package/server/dist/db.js.map +1 -1
- package/server/dist/index.d.ts.map +1 -1
- package/server/dist/index.js +14 -2
- package/server/dist/index.js.map +1 -1
- package/server/dist/routes/connect.d.ts.map +1 -1
- package/server/dist/routes/connect.js +0 -3
- package/server/dist/routes/connect.js.map +1 -1
- package/server/dist/routes/connections.d.ts.map +1 -1
- package/server/dist/routes/connections.js +0 -3
- package/server/dist/routes/connections.js.map +1 -1
- package/server/dist/routes/indexes.d.ts.map +1 -1
- package/server/dist/routes/indexes.js +0 -3
- package/server/dist/routes/indexes.js.map +1 -1
- package/server/dist/routes/schema.d.ts.map +1 -1
- package/server/dist/routes/schema.js +0 -4
- package/server/dist/routes/schema.js.map +1 -1
- package/server/dist/routes/tables.d.ts.map +1 -1
- package/server/dist/routes/tables.js +5 -7
- package/server/dist/routes/tables.js.map +1 -1
- package/server/dist/services/connections.service.d.ts.map +1 -1
- package/server/dist/services/connections.service.js +3 -2
- package/server/dist/services/connections.service.js.map +1 -1
- package/ui/dist/assets/index-C58yNoTI.js +71 -0
- package/ui/dist/assets/index-CmWCu1wa.css +1 -0
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/index-3A4u6lT6.css +0 -1
- package/ui/dist/assets/index-g7U-HL5c.js +0 -71
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
function d4(t,e){for(var n=0;n<e.length;n++){const o=e[n];if(typeof o!="string"&&!Array.isArray(o)){for(const a in o)if(a!=="default"&&!(a in t)){const i=Object.getOwnPropertyDescriptor(o,a);i&&Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:()=>o[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&o(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();function h0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Cg={exports:{}},ec={};var jb;function f4(){if(jb)return ec;jb=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(o,a,i){var l=null;if(i!==void 0&&(l=""+i),a.key!==void 0&&(l=""+a.key),"key"in a){i={};for(var u in a)u!=="key"&&(i[u]=a[u])}else i=a;return a=i.ref,{$$typeof:t,type:o,key:l,ref:a!==void 0?a:null,props:i}}return ec.Fragment=e,ec.jsx=n,ec.jsxs=n,ec}var zb;function h4(){return zb||(zb=1,Cg.exports=f4()),Cg.exports}var y=h4(),Eg={exports:{}},it={};var Ib;function m4(){if(Ib)return it;Ib=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),p=Symbol.iterator;function v(P){return P===null||typeof P!="object"?null:(P=p&&P[p]||P["@@iterator"],typeof P=="function"?P:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,w={};function M(P,z,V){this.props=P,this.context=z,this.refs=w,this.updater=V||S}M.prototype.isReactComponent={},M.prototype.setState=function(P,z){if(typeof P!="object"&&typeof P!="function"&&P!=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,P,z,"setState")},M.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function R(){}R.prototype=M.prototype;function E(P,z,V){this.props=P,this.context=z,this.refs=w,this.updater=V||S}var N=E.prototype=new R;N.constructor=E,C(N,M.prototype),N.isPureReactComponent=!0;var D=Array.isArray;function T(){}var k={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function B(P,z,V){var q=V.ref;return{$$typeof:t,type:P,key:z,ref:q!==void 0?q:null,props:V}}function W(P,z){return B(P.type,z,P.props)}function U(P){return typeof P=="object"&&P!==null&&P.$$typeof===t}function Y(P){var z={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(V){return z[V]})}var Z=/\/+/g;function I(P,z){return typeof P=="object"&&P!==null&&P.key!=null?Y(""+P.key):z.toString(36)}function G(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(T,T):(P.status="pending",P.then(function(z){P.status==="pending"&&(P.status="fulfilled",P.value=z)},function(z){P.status==="pending"&&(P.status="rejected",P.reason=z)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function j(P,z,V,q,J){var oe=typeof P;(oe==="undefined"||oe==="boolean")&&(P=null);var K=!1;if(P===null)K=!0;else switch(oe){case"bigint":case"string":case"number":K=!0;break;case"object":switch(P.$$typeof){case t:case e:K=!0;break;case g:return K=P._init,j(K(P._payload),z,V,q,J)}}if(K)return J=J(P),K=q===""?"."+I(P,0):q,D(J)?(V="",K!=null&&(V=K.replace(Z,"$&/")+"/"),j(J,z,V,"",function(ce){return ce})):J!=null&&(U(J)&&(J=W(J,V+(J.key==null||P&&P.key===J.key?"":(""+J.key).replace(Z,"$&/")+"/")+K)),z.push(J)),1;K=0;var ee=q===""?".":q+":";if(D(P))for(var ae=0;ae<P.length;ae++)q=P[ae],oe=ee+I(q,ae),K+=j(q,z,V,oe,J);else if(ae=v(P),typeof ae=="function")for(P=ae.call(P),ae=0;!(q=P.next()).done;)q=q.value,oe=ee+I(q,ae++),K+=j(q,z,V,oe,J);else if(oe==="object"){if(typeof P.then=="function")return j(G(P),z,V,q,J);throw z=String(P),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return K}function L(P,z,V){if(P==null)return P;var q=[],J=0;return j(P,q,"","",function(oe){return z.call(V,oe,J++)}),q}function $(P){if(P._status===-1){var z=P._result;z=z(),z.then(function(V){(P._status===0||P._status===-1)&&(P._status=1,P._result=V)},function(V){(P._status===0||P._status===-1)&&(P._status=2,P._result=V)}),P._status===-1&&(P._status=0,P._result=z)}if(P._status===1)return P._result.default;throw P._result}var H=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof P=="object"&&P!==null&&typeof P.message=="string"?String(P.message):String(P),error:P});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},X={map:L,forEach:function(P,z,V){L(P,function(){z.apply(this,arguments)},V)},count:function(P){var z=0;return L(P,function(){z++}),z},toArray:function(P){return L(P,function(z){return z})||[]},only:function(P){if(!U(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return it.Activity=m,it.Children=X,it.Component=M,it.Fragment=n,it.Profiler=a,it.PureComponent=E,it.StrictMode=o,it.Suspense=d,it.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,it.__COMPILER_RUNTIME={__proto__:null,c:function(P){return k.H.useMemoCache(P)}},it.cache=function(P){return function(){return P.apply(null,arguments)}},it.cacheSignal=function(){return null},it.cloneElement=function(P,z,V){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var q=C({},P.props),J=P.key;if(z!=null)for(oe in z.key!==void 0&&(J=""+z.key),z)!A.call(z,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&z.ref===void 0||(q[oe]=z[oe]);var oe=arguments.length-2;if(oe===1)q.children=V;else if(1<oe){for(var K=Array(oe),ee=0;ee<oe;ee++)K[ee]=arguments[ee+2];q.children=K}return B(P.type,J,q)},it.createContext=function(P){return P={$$typeof:l,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:i,_context:P},P},it.createElement=function(P,z,V){var q,J={},oe=null;if(z!=null)for(q in z.key!==void 0&&(oe=""+z.key),z)A.call(z,q)&&q!=="key"&&q!=="__self"&&q!=="__source"&&(J[q]=z[q]);var K=arguments.length-2;if(K===1)J.children=V;else if(1<K){for(var ee=Array(K),ae=0;ae<K;ae++)ee[ae]=arguments[ae+2];J.children=ee}if(P&&P.defaultProps)for(q in K=P.defaultProps,K)J[q]===void 0&&(J[q]=K[q]);return B(P,oe,J)},it.createRef=function(){return{current:null}},it.forwardRef=function(P){return{$$typeof:u,render:P}},it.isValidElement=U,it.lazy=function(P){return{$$typeof:g,_payload:{_status:-1,_result:P},_init:$}},it.memo=function(P,z){return{$$typeof:f,type:P,compare:z===void 0?null:z}},it.startTransition=function(P){var z=k.T,V={};k.T=V;try{var q=P(),J=k.S;J!==null&&J(V,q),typeof q=="object"&&q!==null&&typeof q.then=="function"&&q.then(T,H)}catch(oe){H(oe)}finally{z!==null&&V.types!==null&&(z.types=V.types),k.T=z}},it.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()},it.use=function(P){return k.H.use(P)},it.useActionState=function(P,z,V){return k.H.useActionState(P,z,V)},it.useCallback=function(P,z){return k.H.useCallback(P,z)},it.useContext=function(P){return k.H.useContext(P)},it.useDebugValue=function(){},it.useDeferredValue=function(P,z){return k.H.useDeferredValue(P,z)},it.useEffect=function(P,z){return k.H.useEffect(P,z)},it.useEffectEvent=function(P){return k.H.useEffectEvent(P)},it.useId=function(){return k.H.useId()},it.useImperativeHandle=function(P,z,V){return k.H.useImperativeHandle(P,z,V)},it.useInsertionEffect=function(P,z){return k.H.useInsertionEffect(P,z)},it.useLayoutEffect=function(P,z){return k.H.useLayoutEffect(P,z)},it.useMemo=function(P,z){return k.H.useMemo(P,z)},it.useOptimistic=function(P,z){return k.H.useOptimistic(P,z)},it.useReducer=function(P,z,V){return k.H.useReducer(P,z,V)},it.useRef=function(P){return k.H.useRef(P)},it.useState=function(P){return k.H.useState(P)},it.useSyncExternalStore=function(P,z,V){return k.H.useSyncExternalStore(P,z,V)},it.useTransition=function(){return k.H.useTransition()},it.version="19.2.4",it}var Pb;function Qi(){return Pb||(Pb=1,Eg.exports=m4()),Eg.exports}var x=Qi();const de=h0(x),OC=d4({__proto__:null,default:de},[x]);var _g={exports:{}},tc={},Mg={exports:{}},Ng={};var $b;function g4(){return $b||($b=1,(function(t){function e(j,L){var $=j.length;j.push(L);e:for(;0<$;){var H=$-1>>>1,X=j[H];if(0<a(X,L))j[H]=L,j[$]=X,$=H;else break e}}function n(j){return j.length===0?null:j[0]}function o(j){if(j.length===0)return null;var L=j[0],$=j.pop();if($!==L){j[0]=$;e:for(var H=0,X=j.length,P=X>>>1;H<P;){var z=2*(H+1)-1,V=j[z],q=z+1,J=j[q];if(0>a(V,$))q<X&&0>a(J,V)?(j[H]=J,j[q]=$,H=q):(j[H]=V,j[z]=$,H=z);else if(q<X&&0>a(J,$))j[H]=J,j[q]=$,H=q;else break e}}return L}function a(j,L){var $=j.sortIndex-L.sortIndex;return $!==0?$:j.id-L.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();t.unstable_now=function(){return l.now()-u}}var d=[],f=[],g=1,m=null,p=3,v=!1,S=!1,C=!1,w=!1,M=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function N(j){for(var L=n(f);L!==null;){if(L.callback===null)o(f);else if(L.startTime<=j)o(f),L.sortIndex=L.expirationTime,e(d,L);else break;L=n(f)}}function D(j){if(C=!1,N(j),!S)if(n(d)!==null)S=!0,T||(T=!0,Y());else{var L=n(f);L!==null&&G(D,L.startTime-j)}}var T=!1,k=-1,A=5,B=-1;function W(){return w?!0:!(t.unstable_now()-B<A)}function U(){if(w=!1,T){var j=t.unstable_now();B=j;var L=!0;try{e:{S=!1,C&&(C=!1,R(k),k=-1),v=!0;var $=p;try{t:{for(N(j),m=n(d);m!==null&&!(m.expirationTime>j&&W());){var H=m.callback;if(typeof H=="function"){m.callback=null,p=m.priorityLevel;var X=H(m.expirationTime<=j);if(j=t.unstable_now(),typeof X=="function"){m.callback=X,N(j),L=!0;break t}m===n(d)&&o(d),N(j)}else o(d);m=n(d)}if(m!==null)L=!0;else{var P=n(f);P!==null&&G(D,P.startTime-j),L=!1}}break e}finally{m=null,p=$,v=!1}L=void 0}}finally{L?Y():T=!1}}}var Y;if(typeof E=="function")Y=function(){E(U)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,I=Z.port2;Z.port1.onmessage=U,Y=function(){I.postMessage(null)}}else Y=function(){M(U,0)};function G(j,L){k=M(function(){j(t.unstable_now())},L)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(j){j.callback=null},t.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<j?Math.floor(1e3/j):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_next=function(j){switch(p){case 1:case 2:case 3:var L=3;break;default:L=p}var $=p;p=L;try{return j()}finally{p=$}},t.unstable_requestPaint=function(){w=!0},t.unstable_runWithPriority=function(j,L){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var $=p;p=j;try{return L()}finally{p=$}},t.unstable_scheduleCallback=function(j,L,$){var H=t.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?H+$:H):$=H,j){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=$+X,j={id:g++,callback:L,priorityLevel:j,startTime:$,expirationTime:X,sortIndex:-1},$>H?(j.sortIndex=$,e(f,j),n(d)===null&&j===n(f)&&(C?(R(k),k=-1):C=!0,G(D,$-H))):(j.sortIndex=X,e(d,j),S||v||(S=!0,T||(T=!0,Y()))),j},t.unstable_shouldYield=W,t.unstable_wrapCallback=function(j){var L=p;return function(){var $=p;p=L;try{return j.apply(this,arguments)}finally{p=$}}}})(Ng)),Ng}var Lb;function p4(){return Lb||(Lb=1,Mg.exports=g4()),Mg.exports}var Rg={exports:{}},Gn={};var Hb;function y4(){if(Hb)return Gn;Hb=1;var t=Qi();function e(d){var f="https://react.dev/errors/"+d;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)f+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+d+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var o={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function i(d,f,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:m==null?null:""+m,children:d,containerInfo:f,implementation:g}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(d,f){if(d==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Gn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Gn.createPortal=function(d,f){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(e(299));return i(d,f,null,g)},Gn.flushSync=function(d){var f=l.T,g=o.p;try{if(l.T=null,o.p=2,d)return d()}finally{l.T=f,o.p=g,o.d.f()}},Gn.preconnect=function(d,f){typeof d=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,o.d.C(d,f))},Gn.prefetchDNS=function(d){typeof d=="string"&&o.d.D(d)},Gn.preinit=function(d,f){if(typeof d=="string"&&f&&typeof f.as=="string"){var g=f.as,m=u(g,f.crossOrigin),p=typeof f.integrity=="string"?f.integrity:void 0,v=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;g==="style"?o.d.S(d,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:p,fetchPriority:v}):g==="script"&&o.d.X(d,{crossOrigin:m,integrity:p,fetchPriority:v,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Gn.preinitModule=function(d,f){if(typeof d=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var g=u(f.as,f.crossOrigin);o.d.M(d,{crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&o.d.M(d)},Gn.preload=function(d,f){if(typeof d=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var g=f.as,m=u(g,f.crossOrigin);o.d.L(d,g,{crossOrigin:m,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})}},Gn.preloadModule=function(d,f){if(typeof d=="string")if(f){var g=u(f.as,f.crossOrigin);o.d.m(d,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else o.d.m(d)},Gn.requestFormReset=function(d){o.d.r(d)},Gn.unstable_batchedUpdates=function(d,f){return d(f)},Gn.useFormState=function(d,f,g){return l.H.useFormState(d,f,g)},Gn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Gn.version="19.2.4",Gn}var Bb;function AC(){if(Bb)return Rg.exports;Bb=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Rg.exports=y4(),Rg.exports}var Vb;function v4(){if(Vb)return tc;Vb=1;var t=p4(),e=Qi(),n=AC();function o(r){var s="https://react.dev/errors/"+r;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)s+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+r+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function i(r){var s=r,c=r;if(r.alternate)for(;s.return;)s=s.return;else{r=s;do s=r,(s.flags&4098)!==0&&(c=s.return),r=s.return;while(r)}return s.tag===3?c:null}function l(r){if(r.tag===13){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function u(r){if(r.tag===31){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function d(r){if(i(r)!==r)throw Error(o(188))}function f(r){var s=r.alternate;if(!s){if(s=i(r),s===null)throw Error(o(188));return s!==r?null:r}for(var c=r,h=s;;){var b=c.return;if(b===null)break;var _=b.alternate;if(_===null){if(h=b.return,h!==null){c=h;continue}break}if(b.child===_.child){for(_=b.child;_;){if(_===c)return d(b),r;if(_===h)return d(b),s;_=_.sibling}throw Error(o(188))}if(c.return!==h.return)c=b,h=_;else{for(var O=!1,F=b.child;F;){if(F===c){O=!0,c=b,h=_;break}if(F===h){O=!0,h=b,c=_;break}F=F.sibling}if(!O){for(F=_.child;F;){if(F===c){O=!0,c=_,h=b;break}if(F===h){O=!0,h=_,c=b;break}F=F.sibling}if(!O)throw Error(o(189))}}if(c.alternate!==h)throw Error(o(190))}if(c.tag!==3)throw Error(o(188));return c.stateNode.current===c?r:s}function g(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r;for(r=r.child;r!==null;){if(s=g(r),s!==null)return s;r=r.sibling}return null}var m=Object.assign,p=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),E=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function Y(r){return r===null||typeof r!="object"?null:(r=U&&r[U]||r["@@iterator"],typeof r=="function"?r:null)}var Z=Symbol.for("react.client.reference");function I(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===Z?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case C:return"Fragment";case M:return"Profiler";case w:return"StrictMode";case D:return"Suspense";case T:return"SuspenseList";case B:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case E:return r.displayName||"Context";case R:return(r._context.displayName||"Context")+".Consumer";case N:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case k:return s=r.displayName||null,s!==null?s:I(r.type)||"Memo";case A:s=r._payload,r=r._init;try{return I(r(s))}catch{}}return null}var G=Array.isArray,j=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},H=[],X=-1;function P(r){return{current:r}}function z(r){0>X||(r.current=H[X],H[X]=null,X--)}function V(r,s){X++,H[X]=r.current,r.current=s}var q=P(null),J=P(null),oe=P(null),K=P(null);function ee(r,s){switch(V(oe,s),V(J,r),V(q,null),s.nodeType){case 9:case 11:r=(r=s.documentElement)&&(r=r.namespaceURI)?ob(r):0;break;default:if(r=s.tagName,s=s.namespaceURI)s=ob(s),r=rb(s,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}z(q),V(q,r)}function ae(){z(q),z(J),z(oe)}function ce(r){r.memoizedState!==null&&V(K,r);var s=q.current,c=rb(s,r.type);s!==c&&(V(J,r),V(q,c))}function ge(r){J.current===r&&(z(q),z(J)),K.current===r&&(z(K),Xl._currentValue=$)}var se,ve;function De(r){if(se===void 0)try{throw Error()}catch(c){var s=c.stack.trim().match(/\n( *(at )?)/);se=s&&s[1]||"",ve=-1<c.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+se+r+ve}var Be=!1;function Ie(r,s){if(!r||Be)return"";Be=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(s){var Ee=function(){throw Error()};if(Object.defineProperty(Ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ee,[])}catch(me){var he=me}Reflect.construct(r,[],Ee)}else{try{Ee.call()}catch(me){he=me}r.call(Ee.prototype)}}else{try{throw Error()}catch(me){he=me}(Ee=r())&&typeof Ee.catch=="function"&&Ee.catch(function(){})}}catch(me){if(me&&he&&typeof me.stack=="string")return[me.stack,he.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=h.DetermineComponentFrameRoot(),O=_[0],F=_[1];if(O&&F){var te=O.split(`
|
|
4
|
-
`),fe=F.split(`
|
|
5
|
-
`);for(b=h=0;h<te.length&&!te[h].includes("DetermineComponentFrameRoot");)h++;for(;b<fe.length&&!fe[b].includes("DetermineComponentFrameRoot");)b++;if(h===te.length||b===fe.length)for(h=te.length-1,b=fe.length-1;1<=h&&0<=b&&te[h]!==fe[b];)b--;for(;1<=h&&0<=b;h--,b--)if(te[h]!==fe[b]){if(h!==1||b!==1)do if(h--,b--,0>b||te[h]!==fe[b]){var pe=`
|
|
6
|
-
`+te[h].replace(" at new "," at ");return r.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",r.displayName)),pe}while(1<=h&&0<=b);break}}}finally{Be=!1,Error.prepareStackTrace=c}return(c=r?r.displayName||r.name:"")?De(c):""}function lt(r,s){switch(r.tag){case 26:case 27:case 5:return De(r.type);case 16:return De("Lazy");case 13:return r.child!==s&&s!==null?De("Suspense Fallback"):De("Suspense");case 19:return De("SuspenseList");case 0:case 15:return Ie(r.type,!1);case 11:return Ie(r.type.render,!1);case 1:return Ie(r.type,!0);case 31:return De("Activity");default:return""}}function ln(r){try{var s="",c=null;do s+=lt(r,c),c=r,r=r.return;while(r);return s}catch(h){return`
|
|
7
|
-
Error generating stack: `+h.message+`
|
|
8
|
-
`+h.stack}}var ht=Object.prototype.hasOwnProperty,bn=t.unstable_scheduleCallback,cn=t.unstable_cancelCallback,Vt=t.unstable_shouldYield,mn=t.unstable_requestPaint,zt=t.unstable_now,Nn=t.unstable_getCurrentPriorityLevel,yn=t.unstable_ImmediatePriority,In=t.unstable_UserBlockingPriority,jn=t.unstable_NormalPriority,_e=t.unstable_LowPriority,Ue=t.unstable_IdlePriority,Et=t.log,Xe=t.unstable_setDisableYieldValue,at=null,gt=null;function qt(r){if(typeof Et=="function"&&Xe(r),gt&&typeof gt.setStrictMode=="function")try{gt.setStrictMode(at,r)}catch{}}var Wt=Math.clz32?Math.clz32:Ve,Qn=Math.log,_t=Math.LN2;function Ve(r){return r>>>=0,r===0?32:31-(Qn(r)/_t|0)|0}var nt=256,Ye=262144,st=4194304;function $t(r){var s=r&42;if(s!==0)return s;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Te(r,s,c){var h=r.pendingLanes;if(h===0)return 0;var b=0,_=r.suspendedLanes,O=r.pingedLanes;r=r.warmLanes;var F=h&134217727;return F!==0?(h=F&~_,h!==0?b=$t(h):(O&=F,O!==0?b=$t(O):c||(c=F&~r,c!==0&&(b=$t(c))))):(F=h&~_,F!==0?b=$t(F):O!==0?b=$t(O):c||(c=h&~r,c!==0&&(b=$t(c)))),b===0?0:s!==0&&s!==b&&(s&_)===0&&(_=b&-b,c=s&-s,_>=c||_===32&&(c&4194048)!==0)?s:b}function Ot(r,s){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&s)===0}function Kt(r,s){switch(r){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 un(){var r=st;return st<<=1,(st&62914560)===0&&(st=4194304),r}function Pn(r){for(var s=[],c=0;31>c;c++)s.push(r);return s}function Dt(r,s){r.pendingLanes|=s,s!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Rn(r,s,c,h,b,_){var O=r.pendingLanes;r.pendingLanes=c,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=c,r.entangledLanes&=c,r.errorRecoveryDisabledLanes&=c,r.shellSuspendCounter=0;var F=r.entanglements,te=r.expirationTimes,fe=r.hiddenUpdates;for(c=O&~c;0<c;){var pe=31-Wt(c),Ee=1<<pe;F[pe]=0,te[pe]=-1;var he=fe[pe];if(he!==null)for(fe[pe]=null,pe=0;pe<he.length;pe++){var me=he[pe];me!==null&&(me.lane&=-536870913)}c&=~Ee}h!==0&&Uo(r,h,0),_!==0&&b===0&&r.tag!==0&&(r.suspendedLanes|=_&~(O&~s))}function Uo(r,s,c){r.pendingLanes|=s,r.suspendedLanes&=~s;var h=31-Wt(s);r.entangledLanes|=s,r.entanglements[h]=r.entanglements[h]|1073741824|c&261930}function vt(r,s){var c=r.entangledLanes|=s;for(r=r.entanglements;c;){var h=31-Wt(c),b=1<<h;b&s|r[h]&s&&(r[h]|=s),c&=~b}}function Dn(r,s){var c=s&-s;return c=(c&42)!==0?1:Do(c),(c&(r.suspendedLanes|s))!==0?0:c}function Do(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Un(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function lo(){var r=L.p;return r!==0?r:(r=window.event,r===void 0?32:Nb(r.type))}function Dr(r,s){var c=L.p;try{return L.p=r,s()}finally{L.p=c}}var co=Math.random().toString(36).slice(2),dn="__reactFiber$"+co,Tn="__reactProps$"+co,To="__reactContainer$"+co,Tr="__reactEvents$"+co,rs="__reactListeners$"+co,Q="__reactHandles$"+co,ne="__reactResources$"+co,le="__reactMarker$"+co;function ye(r){delete r[dn],delete r[Tn],delete r[Tr],delete r[rs],delete r[Q]}function we(r){var s=r[dn];if(s)return s;for(var c=r.parentNode;c;){if(s=c[To]||c[dn]){if(c=s.alternate,s.child!==null||c!==null&&c.child!==null)for(r=db(r);r!==null;){if(c=r[dn])return c;r=db(r)}return s}r=c,c=r.parentNode}return null}function Ne(r){if(r=r[dn]||r[To]){var s=r.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return r}return null}function Pe(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r.stateNode;throw Error(o(33))}function je(r){var s=r[ne];return s||(s=r[ne]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Se(r){r[le]=!0}var Re=new Set,ke={};function Ae(r,s){xe(r,s),xe(r+"Capture",s)}function xe(r,s){for(ke[r]=s,r=0;r<s.length;r++)Re.add(s[r])}var Oe=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]*$"),ot={},Ct={};function Mt(r){return ht.call(Ct,r)?!0:ht.call(ot,r)?!1:Oe.test(r)?Ct[r]=!0:(ot[r]=!0,!1)}function ct(r,s,c){if(Mt(s))if(c===null)r.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":r.removeAttribute(s);return;case"boolean":var h=s.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){r.removeAttribute(s);return}}r.setAttribute(s,""+c)}}function It(r,s,c){if(c===null)r.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttribute(s,""+c)}}function rt(r,s,c,h){if(h===null)r.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(c);return}r.setAttributeNS(s,c,""+h)}}function mt(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Pt(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Yn(r,s,c){var h=Object.getOwnPropertyDescriptor(r.constructor.prototype,s);if(!r.hasOwnProperty(s)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var b=h.get,_=h.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return b.call(this)},set:function(O){c=""+O,_.call(this,O)}}),Object.defineProperty(r,s,{enumerable:h.enumerable}),{getValue:function(){return c},setValue:function(O){c=""+O},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function kn(r){if(!r._valueTracker){var s=Pt(r)?"checked":"value";r._valueTracker=Yn(r,s,""+r[s])}}function $n(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var c=s.getValue(),h="";return r&&(h=Pt(r)?r.checked?"true":"false":r.value),r=h,r!==c?(s.setValue(r),!0):!1}function Qt(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var kr=/[\n"\\]/g;function Ze(r){return r.replace(kr,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function uo(r,s,c,h,b,_,O,F){r.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?r.type=O:r.removeAttribute("type"),s!=null?O==="number"?(s===0&&r.value===""||r.value!=s)&&(r.value=""+mt(s)):r.value!==""+mt(s)&&(r.value=""+mt(s)):O!=="submit"&&O!=="reset"||r.removeAttribute("value"),s!=null?as(r,O,mt(s)):c!=null?as(r,O,mt(c)):h!=null&&r.removeAttribute("value"),b==null&&_!=null&&(r.defaultChecked=!!_),b!=null&&(r.checked=b&&typeof b!="function"&&typeof b!="symbol"),F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?r.name=""+mt(F):r.removeAttribute("name")}function ir(r,s,c,h,b,_,O,F){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(r.type=_),s!=null||c!=null){if(!(_!=="submit"&&_!=="reset"||s!=null)){kn(r);return}c=c!=null?""+mt(c):"",s=s!=null?""+mt(s):c,F||s===r.value||(r.value=s),r.defaultValue=s}h=h??b,h=typeof h!="function"&&typeof h!="symbol"&&!!h,r.checked=F?r.checked:!!h,r.defaultChecked=!!h,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(r.name=O),kn(r)}function as(r,s,c){s==="number"&&Qt(r.ownerDocument)===r||r.defaultValue===""+c||(r.defaultValue=""+c)}function At(r,s,c,h){if(r=r.options,s){s={};for(var b=0;b<c.length;b++)s["$"+c[b]]=!0;for(c=0;c<r.length;c++)b=s.hasOwnProperty("$"+r[c].value),r[c].selected!==b&&(r[c].selected=b),b&&h&&(r[c].defaultSelected=!0)}else{for(c=""+mt(c),s=null,b=0;b<r.length;b++){if(r[b].value===c){r[b].selected=!0,h&&(r[b].defaultSelected=!0);return}s!==null||r[b].disabled||(s=r[b])}s!==null&&(s.selected=!0)}}function Jn(r,s,c){if(s!=null&&(s=""+mt(s),s!==r.value&&(r.value=s),c==null)){r.defaultValue!==s&&(r.defaultValue=s);return}r.defaultValue=c!=null?""+mt(c):""}function Xt(r,s,c,h){if(s==null){if(h!=null){if(c!=null)throw Error(o(92));if(G(h)){if(1<h.length)throw Error(o(93));h=h[0]}c=h}c==null&&(c=""),s=c}c=mt(s),r.defaultValue=c,h=r.textContent,h===c&&h!==""&&h!==null&&(r.value=h),kn(r)}function Nt(r,s){if(s){var c=r.firstChild;if(c&&c===r.lastChild&&c.nodeType===3){c.nodeValue=s;return}}r.textContent=s}var ha=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 Or(r,s,c){var h=s.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?h?r.setProperty(s,""):s==="float"?r.cssFloat="":r[s]="":h?r.setProperty(s,c):typeof c!="number"||c===0||ha.has(s)?s==="float"?r.cssFloat=c:r[s]=(""+c).trim():r[s]=c+"px"}function hu(r,s,c){if(s!=null&&typeof s!="object")throw Error(o(62));if(r=r.style,c!=null){for(var h in c)!c.hasOwnProperty(h)||s!=null&&s.hasOwnProperty(h)||(h.indexOf("--")===0?r.setProperty(h,""):h==="float"?r.cssFloat="":r[h]="");for(var b in s)h=s[b],s.hasOwnProperty(b)&&c[b]!==h&&Or(r,b,h)}else for(var _ in s)s.hasOwnProperty(_)&&Or(r,_,s[_])}function xh(r){if(r.indexOf("-")===-1)return!1;switch(r){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 i3=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"]]),l3=/^[\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 mu(r){return l3.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Ar(){}var bh=null;function wh(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Vs=null,Fs=null;function nv(r){var s=Ne(r);if(s&&(r=s.stateNode)){var c=r[Tn]||null;e:switch(r=s.stateNode,s.type){case"input":if(uo(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),s=c.name,c.type==="radio"&&s!=null){for(c=r;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Ze(""+s)+'"][type="radio"]'),s=0;s<c.length;s++){var h=c[s];if(h!==r&&h.form===r.form){var b=h[Tn]||null;if(!b)throw Error(o(90));uo(h,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(s=0;s<c.length;s++)h=c[s],h.form===r.form&&$n(h)}break e;case"textarea":Jn(r,c.value,c.defaultValue);break e;case"select":s=c.value,s!=null&&At(r,!!c.multiple,s,!1)}}}var Sh=!1;function ov(r,s,c){if(Sh)return r(s,c);Sh=!0;try{var h=r(s);return h}finally{if(Sh=!1,(Vs!==null||Fs!==null)&&(td(),Vs&&(s=Vs,r=Fs,Fs=Vs=null,nv(s),r)))for(s=0;s<r.length;s++)nv(r[s])}}function hl(r,s){var c=r.stateNode;if(c===null)return null;var h=c[Tn]||null;if(h===null)return null;c=h[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(r=r.type,h=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!h;break e;default:r=!1}if(r)return null;if(c&&typeof c!="function")throw Error(o(231,s,typeof c));return c}var jr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ch=!1;if(jr)try{var ml={};Object.defineProperty(ml,"passive",{get:function(){Ch=!0}}),window.addEventListener("test",ml,ml),window.removeEventListener("test",ml,ml)}catch{Ch=!1}var ma=null,Eh=null,gu=null;function rv(){if(gu)return gu;var r,s=Eh,c=s.length,h,b="value"in ma?ma.value:ma.textContent,_=b.length;for(r=0;r<c&&s[r]===b[r];r++);var O=c-r;for(h=1;h<=O&&s[c-h]===b[_-h];h++);return gu=b.slice(r,1<h?1-h:void 0)}function pu(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function yu(){return!0}function av(){return!1}function eo(r){function s(c,h,b,_,O){this._reactName=c,this._targetInst=b,this.type=h,this.nativeEvent=_,this.target=O,this.currentTarget=null;for(var F in r)r.hasOwnProperty(F)&&(c=r[F],this[F]=c?c(_):_[F]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?yu:av,this.isPropagationStopped=av,this}return m(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=yu)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=yu)},persist:function(){},isPersistent:yu}),s}var ss={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vu=eo(ss),gl=m({},ss,{view:0,detail:0}),c3=eo(gl),_h,Mh,pl,xu=m({},gl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rh,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==pl&&(pl&&r.type==="mousemove"?(_h=r.screenX-pl.screenX,Mh=r.screenY-pl.screenY):Mh=_h=0,pl=r),_h)},movementY:function(r){return"movementY"in r?r.movementY:Mh}}),sv=eo(xu),u3=m({},xu,{dataTransfer:0}),d3=eo(u3),f3=m({},gl,{relatedTarget:0}),Nh=eo(f3),h3=m({},ss,{animationName:0,elapsedTime:0,pseudoElement:0}),m3=eo(h3),g3=m({},ss,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),p3=eo(g3),y3=m({},ss,{data:0}),iv=eo(y3),v3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},x3={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"},b3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function w3(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=b3[r])?!!s[r]:!1}function Rh(){return w3}var S3=m({},gl,{key:function(r){if(r.key){var s=v3[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=pu(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?x3[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rh,charCode:function(r){return r.type==="keypress"?pu(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?pu(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),C3=eo(S3),E3=m({},xu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lv=eo(E3),_3=m({},gl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rh}),M3=eo(_3),N3=m({},ss,{propertyName:0,elapsedTime:0,pseudoElement:0}),R3=eo(N3),D3=m({},xu,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),T3=eo(D3),k3=m({},ss,{newState:0,oldState:0}),O3=eo(k3),A3=[9,13,27,32],Dh=jr&&"CompositionEvent"in window,yl=null;jr&&"documentMode"in document&&(yl=document.documentMode);var j3=jr&&"TextEvent"in window&&!yl,cv=jr&&(!Dh||yl&&8<yl&&11>=yl),uv=" ",dv=!1;function fv(r,s){switch(r){case"keyup":return A3.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hv(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Us=!1;function z3(r,s){switch(r){case"compositionend":return hv(s);case"keypress":return s.which!==32?null:(dv=!0,uv);case"textInput":return r=s.data,r===uv&&dv?null:r;default:return null}}function I3(r,s){if(Us)return r==="compositionend"||!Dh&&fv(r,s)?(r=rv(),gu=Eh=ma=null,Us=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return cv&&s.locale!=="ko"?null:s.data;default:return null}}var P3={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 mv(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!P3[r.type]:s==="textarea"}function gv(r,s,c,h){Vs?Fs?Fs.push(h):Fs=[h]:Vs=h,s=ld(s,"onChange"),0<s.length&&(c=new vu("onChange","change",null,c,h),r.push({event:c,listeners:s}))}var vl=null,xl=null;function $3(r){Z1(r,0)}function bu(r){var s=Pe(r);if($n(s))return r}function pv(r,s){if(r==="change")return s}var yv=!1;if(jr){var Th;if(jr){var kh="oninput"in document;if(!kh){var vv=document.createElement("div");vv.setAttribute("oninput","return;"),kh=typeof vv.oninput=="function"}Th=kh}else Th=!1;yv=Th&&(!document.documentMode||9<document.documentMode)}function xv(){vl&&(vl.detachEvent("onpropertychange",bv),xl=vl=null)}function bv(r){if(r.propertyName==="value"&&bu(xl)){var s=[];gv(s,xl,r,wh(r)),ov($3,s)}}function L3(r,s,c){r==="focusin"?(xv(),vl=s,xl=c,vl.attachEvent("onpropertychange",bv)):r==="focusout"&&xv()}function H3(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return bu(xl)}function B3(r,s){if(r==="click")return bu(s)}function V3(r,s){if(r==="input"||r==="change")return bu(s)}function F3(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var fo=typeof Object.is=="function"?Object.is:F3;function bl(r,s){if(fo(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var c=Object.keys(r),h=Object.keys(s);if(c.length!==h.length)return!1;for(h=0;h<c.length;h++){var b=c[h];if(!ht.call(s,b)||!fo(r[b],s[b]))return!1}return!0}function wv(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Sv(r,s){var c=wv(r);r=0;for(var h;c;){if(c.nodeType===3){if(h=r+c.textContent.length,r<=s&&h>=s)return{node:c,offset:s-r};r=h}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=wv(c)}}function Cv(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?Cv(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function Ev(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var s=Qt(r.document);s instanceof r.HTMLIFrameElement;){try{var c=typeof s.contentWindow.location.href=="string"}catch{c=!1}if(c)r=s.contentWindow;else break;s=Qt(r.document)}return s}function Oh(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}var U3=jr&&"documentMode"in document&&11>=document.documentMode,Ys=null,Ah=null,wl=null,jh=!1;function _v(r,s,c){var h=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;jh||Ys==null||Ys!==Qt(h)||(h=Ys,"selectionStart"in h&&Oh(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),wl&&bl(wl,h)||(wl=h,h=ld(Ah,"onSelect"),0<h.length&&(s=new vu("onSelect","select",null,s,c),r.push({event:s,listeners:h}),s.target=Ys)))}function is(r,s){var c={};return c[r.toLowerCase()]=s.toLowerCase(),c["Webkit"+r]="webkit"+s,c["Moz"+r]="moz"+s,c}var Gs={animationend:is("Animation","AnimationEnd"),animationiteration:is("Animation","AnimationIteration"),animationstart:is("Animation","AnimationStart"),transitionrun:is("Transition","TransitionRun"),transitionstart:is("Transition","TransitionStart"),transitioncancel:is("Transition","TransitionCancel"),transitionend:is("Transition","TransitionEnd")},zh={},Mv={};jr&&(Mv=document.createElement("div").style,"AnimationEvent"in window||(delete Gs.animationend.animation,delete Gs.animationiteration.animation,delete Gs.animationstart.animation),"TransitionEvent"in window||delete Gs.transitionend.transition);function ls(r){if(zh[r])return zh[r];if(!Gs[r])return r;var s=Gs[r],c;for(c in s)if(s.hasOwnProperty(c)&&c in Mv)return zh[r]=s[c];return r}var Nv=ls("animationend"),Rv=ls("animationiteration"),Dv=ls("animationstart"),Y3=ls("transitionrun"),G3=ls("transitionstart"),q3=ls("transitioncancel"),Tv=ls("transitionend"),kv=new Map,Ih="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(" ");Ih.push("scrollEnd");function Yo(r,s){kv.set(r,s),Ae(s,[r])}var wu=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},ko=[],qs=0,Ph=0;function Su(){for(var r=qs,s=Ph=qs=0;s<r;){var c=ko[s];ko[s++]=null;var h=ko[s];ko[s++]=null;var b=ko[s];ko[s++]=null;var _=ko[s];if(ko[s++]=null,h!==null&&b!==null){var O=h.pending;O===null?b.next=b:(b.next=O.next,O.next=b),h.pending=b}_!==0&&Ov(c,b,_)}}function Cu(r,s,c,h){ko[qs++]=r,ko[qs++]=s,ko[qs++]=c,ko[qs++]=h,Ph|=h,r.lanes|=h,r=r.alternate,r!==null&&(r.lanes|=h)}function $h(r,s,c,h){return Cu(r,s,c,h),Eu(r)}function cs(r,s){return Cu(r,null,null,s),Eu(r)}function Ov(r,s,c){r.lanes|=c;var h=r.alternate;h!==null&&(h.lanes|=c);for(var b=!1,_=r.return;_!==null;)_.childLanes|=c,h=_.alternate,h!==null&&(h.childLanes|=c),_.tag===22&&(r=_.stateNode,r===null||r._visibility&1||(b=!0)),r=_,_=_.return;return r.tag===3?(_=r.stateNode,b&&s!==null&&(b=31-Wt(c),r=_.hiddenUpdates,h=r[b],h===null?r[b]=[s]:h.push(s),s.lane=c|536870912),_):null}function Eu(r){if(50<Fl)throw Fl=0,qm=null,Error(o(185));for(var s=r.return;s!==null;)r=s,s=r.return;return r.tag===3?r.stateNode:null}var Ws={};function W3(r,s,c,h){this.tag=r,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=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ho(r,s,c,h){return new W3(r,s,c,h)}function Lh(r){return r=r.prototype,!(!r||!r.isReactComponent)}function zr(r,s){var c=r.alternate;return c===null?(c=ho(r.tag,s,r.key,r.mode),c.elementType=r.elementType,c.type=r.type,c.stateNode=r.stateNode,c.alternate=r,r.alternate=c):(c.pendingProps=s,c.type=r.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=r.flags&65011712,c.childLanes=r.childLanes,c.lanes=r.lanes,c.child=r.child,c.memoizedProps=r.memoizedProps,c.memoizedState=r.memoizedState,c.updateQueue=r.updateQueue,s=r.dependencies,c.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},c.sibling=r.sibling,c.index=r.index,c.ref=r.ref,c.refCleanup=r.refCleanup,c}function Av(r,s){r.flags&=65011714;var c=r.alternate;return c===null?(r.childLanes=0,r.lanes=s,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=c.childLanes,r.lanes=c.lanes,r.child=c.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=c.memoizedProps,r.memoizedState=c.memoizedState,r.updateQueue=c.updateQueue,r.type=c.type,s=c.dependencies,r.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),r}function _u(r,s,c,h,b,_){var O=0;if(h=r,typeof r=="function")Lh(r)&&(O=1);else if(typeof r=="string")O=JD(r,c,q.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case B:return r=ho(31,c,s,b),r.elementType=B,r.lanes=_,r;case C:return us(c.children,b,_,s);case w:O=8,b|=24;break;case M:return r=ho(12,c,s,b|2),r.elementType=M,r.lanes=_,r;case D:return r=ho(13,c,s,b),r.elementType=D,r.lanes=_,r;case T:return r=ho(19,c,s,b),r.elementType=T,r.lanes=_,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case E:O=10;break e;case R:O=9;break e;case N:O=11;break e;case k:O=14;break e;case A:O=16,h=null;break e}O=29,c=Error(o(130,r===null?"null":typeof r,"")),h=null}return s=ho(O,c,s,b),s.elementType=r,s.type=h,s.lanes=_,s}function us(r,s,c,h){return r=ho(7,r,h,s),r.lanes=c,r}function Hh(r,s,c){return r=ho(6,r,null,s),r.lanes=c,r}function jv(r){var s=ho(18,null,null,0);return s.stateNode=r,s}function Bh(r,s,c){return s=ho(4,r.children!==null?r.children:[],r.key,s),s.lanes=c,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}var zv=new WeakMap;function Oo(r,s){if(typeof r=="object"&&r!==null){var c=zv.get(r);return c!==void 0?c:(s={value:r,source:s,stack:ln(s)},zv.set(r,s),s)}return{value:r,source:s,stack:ln(s)}}var Ks=[],Xs=0,Mu=null,Sl=0,Ao=[],jo=0,ga=null,lr=1,cr="";function Ir(r,s){Ks[Xs++]=Sl,Ks[Xs++]=Mu,Mu=r,Sl=s}function Iv(r,s,c){Ao[jo++]=lr,Ao[jo++]=cr,Ao[jo++]=ga,ga=r;var h=lr;r=cr;var b=32-Wt(h)-1;h&=~(1<<b),c+=1;var _=32-Wt(s)+b;if(30<_){var O=b-b%5;_=(h&(1<<O)-1).toString(32),h>>=O,b-=O,lr=1<<32-Wt(s)+b|c<<b|h,cr=_+r}else lr=1<<_|c<<b|h,cr=r}function Vh(r){r.return!==null&&(Ir(r,1),Iv(r,1,0))}function Fh(r){for(;r===Mu;)Mu=Ks[--Xs],Ks[Xs]=null,Sl=Ks[--Xs],Ks[Xs]=null;for(;r===ga;)ga=Ao[--jo],Ao[jo]=null,cr=Ao[--jo],Ao[jo]=null,lr=Ao[--jo],Ao[jo]=null}function Pv(r,s){Ao[jo++]=lr,Ao[jo++]=cr,Ao[jo++]=ga,lr=s.id,cr=s.overflow,ga=r}var Ln=null,Jt=null,wt=!1,pa=null,zo=!1,Uh=Error(o(519));function ya(r){var s=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Cl(Oo(s,r)),Uh}function $v(r){var s=r.stateNode,c=r.type,h=r.memoizedProps;switch(s[dn]=r,s[Tn]=h,c){case"dialog":yt("cancel",s),yt("close",s);break;case"iframe":case"object":case"embed":yt("load",s);break;case"video":case"audio":for(c=0;c<Yl.length;c++)yt(Yl[c],s);break;case"source":yt("error",s);break;case"img":case"image":case"link":yt("error",s),yt("load",s);break;case"details":yt("toggle",s);break;case"input":yt("invalid",s),ir(s,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":yt("invalid",s);break;case"textarea":yt("invalid",s),Xt(s,h.value,h.defaultValue,h.children)}c=h.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||s.textContent===""+c||h.suppressHydrationWarning===!0||tb(s.textContent,c)?(h.popover!=null&&(yt("beforetoggle",s),yt("toggle",s)),h.onScroll!=null&&yt("scroll",s),h.onScrollEnd!=null&&yt("scrollend",s),h.onClick!=null&&(s.onclick=Ar),s=!0):s=!1,s||ya(r,!0)}function Lv(r){for(Ln=r.return;Ln;)switch(Ln.tag){case 5:case 31:case 13:zo=!1;return;case 27:case 3:zo=!0;return;default:Ln=Ln.return}}function Zs(r){if(r!==Ln)return!1;if(!wt)return Lv(r),wt=!0,!1;var s=r.tag,c;if((c=s!==3&&s!==27)&&((c=s===5)&&(c=r.type,c=!(c!=="form"&&c!=="button")||lg(r.type,r.memoizedProps)),c=!c),c&&Jt&&ya(r),Lv(r),s===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(o(317));Jt=ub(r)}else if(s===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(o(317));Jt=ub(r)}else s===27?(s=Jt,ka(r.type)?(r=hg,hg=null,Jt=r):Jt=s):Jt=Ln?Po(r.stateNode.nextSibling):null;return!0}function ds(){Jt=Ln=null,wt=!1}function Yh(){var r=pa;return r!==null&&(ro===null?ro=r:ro.push.apply(ro,r),pa=null),r}function Cl(r){pa===null?pa=[r]:pa.push(r)}var Gh=P(null),fs=null,Pr=null;function va(r,s,c){V(Gh,s._currentValue),s._currentValue=c}function $r(r){r._currentValue=Gh.current,z(Gh)}function qh(r,s,c){for(;r!==null;){var h=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,h!==null&&(h.childLanes|=s)):h!==null&&(h.childLanes&s)!==s&&(h.childLanes|=s),r===c)break;r=r.return}}function Wh(r,s,c,h){var b=r.child;for(b!==null&&(b.return=r);b!==null;){var _=b.dependencies;if(_!==null){var O=b.child;_=_.firstContext;e:for(;_!==null;){var F=_;_=b;for(var te=0;te<s.length;te++)if(F.context===s[te]){_.lanes|=c,F=_.alternate,F!==null&&(F.lanes|=c),qh(_.return,c,r),h||(O=null);break e}_=F.next}}else if(b.tag===18){if(O=b.return,O===null)throw Error(o(341));O.lanes|=c,_=O.alternate,_!==null&&(_.lanes|=c),qh(O,c,r),O=null}else O=b.child;if(O!==null)O.return=b;else for(O=b;O!==null;){if(O===r){O=null;break}if(b=O.sibling,b!==null){b.return=O.return,O=b;break}O=O.return}b=O}}function Qs(r,s,c,h){r=null;for(var b=s,_=!1;b!==null;){if(!_){if((b.flags&524288)!==0)_=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var O=b.alternate;if(O===null)throw Error(o(387));if(O=O.memoizedProps,O!==null){var F=b.type;fo(b.pendingProps.value,O.value)||(r!==null?r.push(F):r=[F])}}else if(b===K.current){if(O=b.alternate,O===null)throw Error(o(387));O.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(r!==null?r.push(Xl):r=[Xl])}b=b.return}r!==null&&Wh(s,r,c,h),s.flags|=262144}function Nu(r){for(r=r.firstContext;r!==null;){if(!fo(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function hs(r){fs=r,Pr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Hn(r){return Hv(fs,r)}function Ru(r,s){return fs===null&&hs(r),Hv(r,s)}function Hv(r,s){var c=s._currentValue;if(s={context:s,memoizedValue:c,next:null},Pr===null){if(r===null)throw Error(o(308));Pr=s,r.dependencies={lanes:0,firstContext:s},r.flags|=524288}else Pr=Pr.next=s;return c}var K3=typeof AbortController<"u"?AbortController:function(){var r=[],s=this.signal={aborted:!1,addEventListener:function(c,h){r.push(h)}};this.abort=function(){s.aborted=!0,r.forEach(function(c){return c()})}},X3=t.unstable_scheduleCallback,Z3=t.unstable_NormalPriority,wn={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Kh(){return{controller:new K3,data:new Map,refCount:0}}function El(r){r.refCount--,r.refCount===0&&X3(Z3,function(){r.controller.abort()})}var _l=null,Xh=0,Js=0,ei=null;function Q3(r,s){if(_l===null){var c=_l=[];Xh=0,Js=Jm(),ei={status:"pending",value:void 0,then:function(h){c.push(h)}}}return Xh++,s.then(Bv,Bv),s}function Bv(){if(--Xh===0&&_l!==null){ei!==null&&(ei.status="fulfilled");var r=_l;_l=null,Js=0,ei=null;for(var s=0;s<r.length;s++)(0,r[s])()}}function J3(r,s){var c=[],h={status:"pending",value:null,reason:null,then:function(b){c.push(b)}};return r.then(function(){h.status="fulfilled",h.value=s;for(var b=0;b<c.length;b++)(0,c[b])(s)},function(b){for(h.status="rejected",h.reason=b,b=0;b<c.length;b++)(0,c[b])(void 0)}),h}var Vv=j.S;j.S=function(r,s){_1=zt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&Q3(r,s),Vv!==null&&Vv(r,s)};var ms=P(null);function Zh(){var r=ms.current;return r!==null?r:Zt.pooledCache}function Du(r,s){s===null?V(ms,ms.current):V(ms,s.pool)}function Fv(){var r=Zh();return r===null?null:{parent:wn._currentValue,pool:r}}var ti=Error(o(460)),Qh=Error(o(474)),Tu=Error(o(542)),ku={then:function(){}};function Uv(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Yv(r,s,c){switch(c=r[c],c===void 0?r.push(s):c!==s&&(s.then(Ar,Ar),s=c),s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,qv(r),r;default:if(typeof s.status=="string")s.then(Ar,Ar);else{if(r=Zt,r!==null&&100<r.shellSuspendCounter)throw Error(o(482));r=s,r.status="pending",r.then(function(h){if(s.status==="pending"){var b=s;b.status="fulfilled",b.value=h}},function(h){if(s.status==="pending"){var b=s;b.status="rejected",b.reason=h}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,qv(r),r}throw ps=s,ti}}function gs(r){try{var s=r._init;return s(r._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(ps=c,ti):c}}var ps=null;function Gv(){if(ps===null)throw Error(o(459));var r=ps;return ps=null,r}function qv(r){if(r===ti||r===Tu)throw Error(o(483))}var ni=null,Ml=0;function Ou(r){var s=Ml;return Ml+=1,ni===null&&(ni=[]),Yv(ni,r,s)}function Nl(r,s){s=s.props.ref,r.ref=s!==void 0?s:null}function Au(r,s){throw s.$$typeof===p?Error(o(525)):(r=Object.prototype.toString.call(s),Error(o(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r)))}function Wv(r){function s(ie,re){if(r){var ue=ie.deletions;ue===null?(ie.deletions=[re],ie.flags|=16):ue.push(re)}}function c(ie,re){if(!r)return null;for(;re!==null;)s(ie,re),re=re.sibling;return null}function h(ie){for(var re=new Map;ie!==null;)ie.key!==null?re.set(ie.key,ie):re.set(ie.index,ie),ie=ie.sibling;return re}function b(ie,re){return ie=zr(ie,re),ie.index=0,ie.sibling=null,ie}function _(ie,re,ue){return ie.index=ue,r?(ue=ie.alternate,ue!==null?(ue=ue.index,ue<re?(ie.flags|=67108866,re):ue):(ie.flags|=67108866,re)):(ie.flags|=1048576,re)}function O(ie){return r&&ie.alternate===null&&(ie.flags|=67108866),ie}function F(ie,re,ue,Ce){return re===null||re.tag!==6?(re=Hh(ue,ie.mode,Ce),re.return=ie,re):(re=b(re,ue),re.return=ie,re)}function te(ie,re,ue,Ce){var We=ue.type;return We===C?pe(ie,re,ue.props.children,Ce,ue.key):re!==null&&(re.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===A&&gs(We)===re.type)?(re=b(re,ue.props),Nl(re,ue),re.return=ie,re):(re=_u(ue.type,ue.key,ue.props,null,ie.mode,Ce),Nl(re,ue),re.return=ie,re)}function fe(ie,re,ue,Ce){return re===null||re.tag!==4||re.stateNode.containerInfo!==ue.containerInfo||re.stateNode.implementation!==ue.implementation?(re=Bh(ue,ie.mode,Ce),re.return=ie,re):(re=b(re,ue.children||[]),re.return=ie,re)}function pe(ie,re,ue,Ce,We){return re===null||re.tag!==7?(re=us(ue,ie.mode,Ce,We),re.return=ie,re):(re=b(re,ue),re.return=ie,re)}function Ee(ie,re,ue){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return re=Hh(""+re,ie.mode,ue),re.return=ie,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case v:return ue=_u(re.type,re.key,re.props,null,ie.mode,ue),Nl(ue,re),ue.return=ie,ue;case S:return re=Bh(re,ie.mode,ue),re.return=ie,re;case A:return re=gs(re),Ee(ie,re,ue)}if(G(re)||Y(re))return re=us(re,ie.mode,ue,null),re.return=ie,re;if(typeof re.then=="function")return Ee(ie,Ou(re),ue);if(re.$$typeof===E)return Ee(ie,Ru(ie,re),ue);Au(ie,re)}return null}function he(ie,re,ue,Ce){var We=re!==null?re.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return We!==null?null:F(ie,re,""+ue,Ce);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:return ue.key===We?te(ie,re,ue,Ce):null;case S:return ue.key===We?fe(ie,re,ue,Ce):null;case A:return ue=gs(ue),he(ie,re,ue,Ce)}if(G(ue)||Y(ue))return We!==null?null:pe(ie,re,ue,Ce,null);if(typeof ue.then=="function")return he(ie,re,Ou(ue),Ce);if(ue.$$typeof===E)return he(ie,re,Ru(ie,ue),Ce);Au(ie,ue)}return null}function me(ie,re,ue,Ce,We){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number"||typeof Ce=="bigint")return ie=ie.get(ue)||null,F(re,ie,""+Ce,We);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case v:return ie=ie.get(Ce.key===null?ue:Ce.key)||null,te(re,ie,Ce,We);case S:return ie=ie.get(Ce.key===null?ue:Ce.key)||null,fe(re,ie,Ce,We);case A:return Ce=gs(Ce),me(ie,re,ue,Ce,We)}if(G(Ce)||Y(Ce))return ie=ie.get(ue)||null,pe(re,ie,Ce,We,null);if(typeof Ce.then=="function")return me(ie,re,ue,Ou(Ce),We);if(Ce.$$typeof===E)return me(ie,re,ue,Ru(re,Ce),We);Au(re,Ce)}return null}function $e(ie,re,ue,Ce){for(var We=null,Tt=null,Fe=re,dt=re=0,bt=null;Fe!==null&&dt<ue.length;dt++){Fe.index>dt?(bt=Fe,Fe=null):bt=Fe.sibling;var kt=he(ie,Fe,ue[dt],Ce);if(kt===null){Fe===null&&(Fe=bt);break}r&&Fe&&kt.alternate===null&&s(ie,Fe),re=_(kt,re,dt),Tt===null?We=kt:Tt.sibling=kt,Tt=kt,Fe=bt}if(dt===ue.length)return c(ie,Fe),wt&&Ir(ie,dt),We;if(Fe===null){for(;dt<ue.length;dt++)Fe=Ee(ie,ue[dt],Ce),Fe!==null&&(re=_(Fe,re,dt),Tt===null?We=Fe:Tt.sibling=Fe,Tt=Fe);return wt&&Ir(ie,dt),We}for(Fe=h(Fe);dt<ue.length;dt++)bt=me(Fe,ie,dt,ue[dt],Ce),bt!==null&&(r&&bt.alternate!==null&&Fe.delete(bt.key===null?dt:bt.key),re=_(bt,re,dt),Tt===null?We=bt:Tt.sibling=bt,Tt=bt);return r&&Fe.forEach(function(Ia){return s(ie,Ia)}),wt&&Ir(ie,dt),We}function Ke(ie,re,ue,Ce){if(ue==null)throw Error(o(151));for(var We=null,Tt=null,Fe=re,dt=re=0,bt=null,kt=ue.next();Fe!==null&&!kt.done;dt++,kt=ue.next()){Fe.index>dt?(bt=Fe,Fe=null):bt=Fe.sibling;var Ia=he(ie,Fe,kt.value,Ce);if(Ia===null){Fe===null&&(Fe=bt);break}r&&Fe&&Ia.alternate===null&&s(ie,Fe),re=_(Ia,re,dt),Tt===null?We=Ia:Tt.sibling=Ia,Tt=Ia,Fe=bt}if(kt.done)return c(ie,Fe),wt&&Ir(ie,dt),We;if(Fe===null){for(;!kt.done;dt++,kt=ue.next())kt=Ee(ie,kt.value,Ce),kt!==null&&(re=_(kt,re,dt),Tt===null?We=kt:Tt.sibling=kt,Tt=kt);return wt&&Ir(ie,dt),We}for(Fe=h(Fe);!kt.done;dt++,kt=ue.next())kt=me(Fe,ie,dt,kt.value,Ce),kt!==null&&(r&&kt.alternate!==null&&Fe.delete(kt.key===null?dt:kt.key),re=_(kt,re,dt),Tt===null?We=kt:Tt.sibling=kt,Tt=kt);return r&&Fe.forEach(function(u4){return s(ie,u4)}),wt&&Ir(ie,dt),We}function Yt(ie,re,ue,Ce){if(typeof ue=="object"&&ue!==null&&ue.type===C&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:e:{for(var We=ue.key;re!==null;){if(re.key===We){if(We=ue.type,We===C){if(re.tag===7){c(ie,re.sibling),Ce=b(re,ue.props.children),Ce.return=ie,ie=Ce;break e}}else if(re.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===A&&gs(We)===re.type){c(ie,re.sibling),Ce=b(re,ue.props),Nl(Ce,ue),Ce.return=ie,ie=Ce;break e}c(ie,re);break}else s(ie,re);re=re.sibling}ue.type===C?(Ce=us(ue.props.children,ie.mode,Ce,ue.key),Ce.return=ie,ie=Ce):(Ce=_u(ue.type,ue.key,ue.props,null,ie.mode,Ce),Nl(Ce,ue),Ce.return=ie,ie=Ce)}return O(ie);case S:e:{for(We=ue.key;re!==null;){if(re.key===We)if(re.tag===4&&re.stateNode.containerInfo===ue.containerInfo&&re.stateNode.implementation===ue.implementation){c(ie,re.sibling),Ce=b(re,ue.children||[]),Ce.return=ie,ie=Ce;break e}else{c(ie,re);break}else s(ie,re);re=re.sibling}Ce=Bh(ue,ie.mode,Ce),Ce.return=ie,ie=Ce}return O(ie);case A:return ue=gs(ue),Yt(ie,re,ue,Ce)}if(G(ue))return $e(ie,re,ue,Ce);if(Y(ue)){if(We=Y(ue),typeof We!="function")throw Error(o(150));return ue=We.call(ue),Ke(ie,re,ue,Ce)}if(typeof ue.then=="function")return Yt(ie,re,Ou(ue),Ce);if(ue.$$typeof===E)return Yt(ie,re,Ru(ie,ue),Ce);Au(ie,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,re!==null&&re.tag===6?(c(ie,re.sibling),Ce=b(re,ue),Ce.return=ie,ie=Ce):(c(ie,re),Ce=Hh(ue,ie.mode,Ce),Ce.return=ie,ie=Ce),O(ie)):c(ie,re)}return function(ie,re,ue,Ce){try{Ml=0;var We=Yt(ie,re,ue,Ce);return ni=null,We}catch(Fe){if(Fe===ti||Fe===Tu)throw Fe;var Tt=ho(29,Fe,null,ie.mode);return Tt.lanes=Ce,Tt.return=ie,Tt}}}var ys=Wv(!0),Kv=Wv(!1),xa=!1;function Jh(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function em(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function ba(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function wa(r,s,c){var h=r.updateQueue;if(h===null)return null;if(h=h.shared,(jt&2)!==0){var b=h.pending;return b===null?s.next=s:(s.next=b.next,b.next=s),h.pending=s,s=Eu(r),Ov(r,null,c),s}return Cu(r,h,s,c),Eu(r)}function Rl(r,s,c){if(s=s.updateQueue,s!==null&&(s=s.shared,(c&4194048)!==0)){var h=s.lanes;h&=r.pendingLanes,c|=h,s.lanes=c,vt(r,c)}}function tm(r,s){var c=r.updateQueue,h=r.alternate;if(h!==null&&(h=h.updateQueue,c===h)){var b=null,_=null;if(c=c.firstBaseUpdate,c!==null){do{var O={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};_===null?b=_=O:_=_.next=O,c=c.next}while(c!==null);_===null?b=_=s:_=_.next=s}else b=_=s;c={baseState:h.baseState,firstBaseUpdate:b,lastBaseUpdate:_,shared:h.shared,callbacks:h.callbacks},r.updateQueue=c;return}r=c.lastBaseUpdate,r===null?c.firstBaseUpdate=s:r.next=s,c.lastBaseUpdate=s}var nm=!1;function Dl(){if(nm){var r=ei;if(r!==null)throw r}}function Tl(r,s,c,h){nm=!1;var b=r.updateQueue;xa=!1;var _=b.firstBaseUpdate,O=b.lastBaseUpdate,F=b.shared.pending;if(F!==null){b.shared.pending=null;var te=F,fe=te.next;te.next=null,O===null?_=fe:O.next=fe,O=te;var pe=r.alternate;pe!==null&&(pe=pe.updateQueue,F=pe.lastBaseUpdate,F!==O&&(F===null?pe.firstBaseUpdate=fe:F.next=fe,pe.lastBaseUpdate=te))}if(_!==null){var Ee=b.baseState;O=0,pe=fe=te=null,F=_;do{var he=F.lane&-536870913,me=he!==F.lane;if(me?(xt&he)===he:(h&he)===he){he!==0&&he===Js&&(nm=!0),pe!==null&&(pe=pe.next={lane:0,tag:F.tag,payload:F.payload,callback:null,next:null});e:{var $e=r,Ke=F;he=s;var Yt=c;switch(Ke.tag){case 1:if($e=Ke.payload,typeof $e=="function"){Ee=$e.call(Yt,Ee,he);break e}Ee=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=Ke.payload,he=typeof $e=="function"?$e.call(Yt,Ee,he):$e,he==null)break e;Ee=m({},Ee,he);break e;case 2:xa=!0}}he=F.callback,he!==null&&(r.flags|=64,me&&(r.flags|=8192),me=b.callbacks,me===null?b.callbacks=[he]:me.push(he))}else me={lane:he,tag:F.tag,payload:F.payload,callback:F.callback,next:null},pe===null?(fe=pe=me,te=Ee):pe=pe.next=me,O|=he;if(F=F.next,F===null){if(F=b.shared.pending,F===null)break;me=F,F=me.next,me.next=null,b.lastBaseUpdate=me,b.shared.pending=null}}while(!0);pe===null&&(te=Ee),b.baseState=te,b.firstBaseUpdate=fe,b.lastBaseUpdate=pe,_===null&&(b.shared.lanes=0),Ma|=O,r.lanes=O,r.memoizedState=Ee}}function Xv(r,s){if(typeof r!="function")throw Error(o(191,r));r.call(s)}function Zv(r,s){var c=r.callbacks;if(c!==null)for(r.callbacks=null,r=0;r<c.length;r++)Xv(c[r],s)}var oi=P(null),ju=P(0);function Qv(r,s){r=qr,V(ju,r),V(oi,s),qr=r|s.baseLanes}function om(){V(ju,qr),V(oi,oi.current)}function rm(){qr=ju.current,z(oi),z(ju)}var mo=P(null),Io=null;function Sa(r){var s=r.alternate;V(vn,vn.current&1),V(mo,r),Io===null&&(s===null||oi.current!==null||s.memoizedState!==null)&&(Io=r)}function am(r){V(vn,vn.current),V(mo,r),Io===null&&(Io=r)}function Jv(r){r.tag===22?(V(vn,vn.current),V(mo,r),Io===null&&(Io=r)):Ca()}function Ca(){V(vn,vn.current),V(mo,mo.current)}function go(r){z(mo),Io===r&&(Io=null),z(vn)}var vn=P(0);function zu(r){for(var s=r;s!==null;){if(s.tag===13){var c=s.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||dg(c)||fg(c)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Lr=0,ut=null,Ft=null,Sn=null,Iu=!1,ri=!1,vs=!1,Pu=0,kl=0,ai=null,eD=0;function gn(){throw Error(o(321))}function sm(r,s){if(s===null)return!1;for(var c=0;c<s.length&&c<r.length;c++)if(!fo(r[c],s[c]))return!1;return!0}function im(r,s,c,h,b,_){return Lr=_,ut=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,j.H=r===null||r.memoizedState===null?Ix:Sm,vs=!1,_=c(h,b),vs=!1,ri&&(_=tx(s,c,h,b)),ex(r),_}function ex(r){j.H=jl;var s=Ft!==null&&Ft.next!==null;if(Lr=0,Sn=Ft=ut=null,Iu=!1,kl=0,ai=null,s)throw Error(o(300));r===null||Cn||(r=r.dependencies,r!==null&&Nu(r)&&(Cn=!0))}function tx(r,s,c,h){ut=r;var b=0;do{if(ri&&(ai=null),kl=0,ri=!1,25<=b)throw Error(o(301));if(b+=1,Sn=Ft=null,r.updateQueue!=null){var _=r.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}j.H=Px,_=s(c,h)}while(ri);return _}function tD(){var r=j.H,s=r.useState()[0];return s=typeof s.then=="function"?Ol(s):s,r=r.useState()[0],(Ft!==null?Ft.memoizedState:null)!==r&&(ut.flags|=1024),s}function lm(){var r=Pu!==0;return Pu=0,r}function cm(r,s,c){s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~c}function um(r){if(Iu){for(r=r.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Iu=!1}Lr=0,Sn=Ft=ut=null,ri=!1,kl=Pu=0,ai=null}function Xn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Sn===null?ut.memoizedState=Sn=r:Sn=Sn.next=r,Sn}function xn(){if(Ft===null){var r=ut.alternate;r=r!==null?r.memoizedState:null}else r=Ft.next;var s=Sn===null?ut.memoizedState:Sn.next;if(s!==null)Sn=s,Ft=r;else{if(r===null)throw ut.alternate===null?Error(o(467)):Error(o(310));Ft=r,r={memoizedState:Ft.memoizedState,baseState:Ft.baseState,baseQueue:Ft.baseQueue,queue:Ft.queue,next:null},Sn===null?ut.memoizedState=Sn=r:Sn=Sn.next=r}return Sn}function $u(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ol(r){var s=kl;return kl+=1,ai===null&&(ai=[]),r=Yv(ai,r,s),s=ut,(Sn===null?s.memoizedState:Sn.next)===null&&(s=s.alternate,j.H=s===null||s.memoizedState===null?Ix:Sm),r}function Lu(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Ol(r);if(r.$$typeof===E)return Hn(r)}throw Error(o(438,String(r)))}function dm(r){var s=null,c=ut.updateQueue;if(c!==null&&(s=c.memoCache),s==null){var h=ut.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(s={data:h.data.map(function(b){return b.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),c===null&&(c=$u(),ut.updateQueue=c),c.memoCache=s,c=s.data[s.index],c===void 0)for(c=s.data[s.index]=Array(r),h=0;h<r;h++)c[h]=W;return s.index++,c}function Hr(r,s){return typeof s=="function"?s(r):s}function Hu(r){var s=xn();return fm(s,Ft,r)}function fm(r,s,c){var h=r.queue;if(h===null)throw Error(o(311));h.lastRenderedReducer=c;var b=r.baseQueue,_=h.pending;if(_!==null){if(b!==null){var O=b.next;b.next=_.next,_.next=O}s.baseQueue=b=_,h.pending=null}if(_=r.baseState,b===null)r.memoizedState=_;else{s=b.next;var F=O=null,te=null,fe=s,pe=!1;do{var Ee=fe.lane&-536870913;if(Ee!==fe.lane?(xt&Ee)===Ee:(Lr&Ee)===Ee){var he=fe.revertLane;if(he===0)te!==null&&(te=te.next={lane:0,revertLane:0,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null}),Ee===Js&&(pe=!0);else if((Lr&he)===he){fe=fe.next,he===Js&&(pe=!0);continue}else Ee={lane:0,revertLane:fe.revertLane,gesture:null,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},te===null?(F=te=Ee,O=_):te=te.next=Ee,ut.lanes|=he,Ma|=he;Ee=fe.action,vs&&c(_,Ee),_=fe.hasEagerState?fe.eagerState:c(_,Ee)}else he={lane:Ee,revertLane:fe.revertLane,gesture:fe.gesture,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null},te===null?(F=te=he,O=_):te=te.next=he,ut.lanes|=Ee,Ma|=Ee;fe=fe.next}while(fe!==null&&fe!==s);if(te===null?O=_:te.next=F,!fo(_,r.memoizedState)&&(Cn=!0,pe&&(c=ei,c!==null)))throw c;r.memoizedState=_,r.baseState=O,r.baseQueue=te,h.lastRenderedState=_}return b===null&&(h.lanes=0),[r.memoizedState,h.dispatch]}function hm(r){var s=xn(),c=s.queue;if(c===null)throw Error(o(311));c.lastRenderedReducer=r;var h=c.dispatch,b=c.pending,_=s.memoizedState;if(b!==null){c.pending=null;var O=b=b.next;do _=r(_,O.action),O=O.next;while(O!==b);fo(_,s.memoizedState)||(Cn=!0),s.memoizedState=_,s.baseQueue===null&&(s.baseState=_),c.lastRenderedState=_}return[_,h]}function nx(r,s,c){var h=ut,b=xn(),_=wt;if(_){if(c===void 0)throw Error(o(407));c=c()}else c=s();var O=!fo((Ft||b).memoizedState,c);if(O&&(b.memoizedState=c,Cn=!0),b=b.queue,pm(ax.bind(null,h,b,r),[r]),b.getSnapshot!==s||O||Sn!==null&&Sn.memoizedState.tag&1){if(h.flags|=2048,si(9,{destroy:void 0},rx.bind(null,h,b,c,s),null),Zt===null)throw Error(o(349));_||(Lr&127)!==0||ox(h,s,c)}return c}function ox(r,s,c){r.flags|=16384,r={getSnapshot:s,value:c},s=ut.updateQueue,s===null?(s=$u(),ut.updateQueue=s,s.stores=[r]):(c=s.stores,c===null?s.stores=[r]:c.push(r))}function rx(r,s,c,h){s.value=c,s.getSnapshot=h,sx(s)&&ix(r)}function ax(r,s,c){return c(function(){sx(s)&&ix(r)})}function sx(r){var s=r.getSnapshot;r=r.value;try{var c=s();return!fo(r,c)}catch{return!0}}function ix(r){var s=cs(r,2);s!==null&&ao(s,r,2)}function mm(r){var s=Xn();if(typeof r=="function"){var c=r;if(r=c(),vs){qt(!0);try{c()}finally{qt(!1)}}}return s.memoizedState=s.baseState=r,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:r},s}function lx(r,s,c,h){return r.baseState=c,fm(r,Ft,typeof h=="function"?h:Hr)}function nD(r,s,c,h,b){if(Fu(r))throw Error(o(485));if(r=s.action,r!==null){var _={payload:b,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){_.listeners.push(O)}};j.T!==null?c(!0):_.isTransition=!1,h(_),c=s.pending,c===null?(_.next=s.pending=_,cx(s,_)):(_.next=c.next,s.pending=c.next=_)}}function cx(r,s){var c=s.action,h=s.payload,b=r.state;if(s.isTransition){var _=j.T,O={};j.T=O;try{var F=c(b,h),te=j.S;te!==null&&te(O,F),ux(r,s,F)}catch(fe){gm(r,s,fe)}finally{_!==null&&O.types!==null&&(_.types=O.types),j.T=_}}else try{_=c(b,h),ux(r,s,_)}catch(fe){gm(r,s,fe)}}function ux(r,s,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(h){dx(r,s,h)},function(h){return gm(r,s,h)}):dx(r,s,c)}function dx(r,s,c){s.status="fulfilled",s.value=c,fx(s),r.state=c,s=r.pending,s!==null&&(c=s.next,c===s?r.pending=null:(c=c.next,s.next=c,cx(r,c)))}function gm(r,s,c){var h=r.pending;if(r.pending=null,h!==null){h=h.next;do s.status="rejected",s.reason=c,fx(s),s=s.next;while(s!==h)}r.action=null}function fx(r){r=r.listeners;for(var s=0;s<r.length;s++)(0,r[s])()}function hx(r,s){return s}function mx(r,s){if(wt){var c=Zt.formState;if(c!==null){e:{var h=ut;if(wt){if(Jt){t:{for(var b=Jt,_=zo;b.nodeType!==8;){if(!_){b=null;break t}if(b=Po(b.nextSibling),b===null){b=null;break t}}_=b.data,b=_==="F!"||_==="F"?b:null}if(b){Jt=Po(b.nextSibling),h=b.data==="F!";break e}}ya(h)}h=!1}h&&(s=c[0])}}return c=Xn(),c.memoizedState=c.baseState=s,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hx,lastRenderedState:s},c.queue=h,c=Ax.bind(null,ut,h),h.dispatch=c,h=mm(!1),_=wm.bind(null,ut,!1,h.queue),h=Xn(),b={state:s,dispatch:null,action:r,pending:null},h.queue=b,c=nD.bind(null,ut,b,_,c),b.dispatch=c,h.memoizedState=r,[s,c,!1]}function gx(r){var s=xn();return px(s,Ft,r)}function px(r,s,c){if(s=fm(r,s,hx)[0],r=Hu(Hr)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var h=Ol(s)}catch(O){throw O===ti?Tu:O}else h=s;s=xn();var b=s.queue,_=b.dispatch;return c!==s.memoizedState&&(ut.flags|=2048,si(9,{destroy:void 0},oD.bind(null,b,c),null)),[h,_,r]}function oD(r,s){r.action=s}function yx(r){var s=xn(),c=Ft;if(c!==null)return px(s,c,r);xn(),s=s.memoizedState,c=xn();var h=c.queue.dispatch;return c.memoizedState=r,[s,h,!1]}function si(r,s,c,h){return r={tag:r,create:c,deps:h,inst:s,next:null},s=ut.updateQueue,s===null&&(s=$u(),ut.updateQueue=s),c=s.lastEffect,c===null?s.lastEffect=r.next=r:(h=c.next,c.next=r,r.next=h,s.lastEffect=r),r}function vx(){return xn().memoizedState}function Bu(r,s,c,h){var b=Xn();ut.flags|=r,b.memoizedState=si(1|s,{destroy:void 0},c,h===void 0?null:h)}function Vu(r,s,c,h){var b=xn();h=h===void 0?null:h;var _=b.memoizedState.inst;Ft!==null&&h!==null&&sm(h,Ft.memoizedState.deps)?b.memoizedState=si(s,_,c,h):(ut.flags|=r,b.memoizedState=si(1|s,_,c,h))}function xx(r,s){Bu(8390656,8,r,s)}function pm(r,s){Vu(2048,8,r,s)}function rD(r){ut.flags|=4;var s=ut.updateQueue;if(s===null)s=$u(),ut.updateQueue=s,s.events=[r];else{var c=s.events;c===null?s.events=[r]:c.push(r)}}function bx(r){var s=xn().memoizedState;return rD({ref:s,nextImpl:r}),function(){if((jt&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}function wx(r,s){return Vu(4,2,r,s)}function Sx(r,s){return Vu(4,4,r,s)}function Cx(r,s){if(typeof s=="function"){r=r();var c=s(r);return function(){typeof c=="function"?c():s(null)}}if(s!=null)return r=r(),s.current=r,function(){s.current=null}}function Ex(r,s,c){c=c!=null?c.concat([r]):null,Vu(4,4,Cx.bind(null,s,r),c)}function ym(){}function _x(r,s){var c=xn();s=s===void 0?null:s;var h=c.memoizedState;return s!==null&&sm(s,h[1])?h[0]:(c.memoizedState=[r,s],r)}function Mx(r,s){var c=xn();s=s===void 0?null:s;var h=c.memoizedState;if(s!==null&&sm(s,h[1]))return h[0];if(h=r(),vs){qt(!0);try{r()}finally{qt(!1)}}return c.memoizedState=[h,s],h}function vm(r,s,c){return c===void 0||(Lr&1073741824)!==0&&(xt&261930)===0?r.memoizedState=s:(r.memoizedState=c,r=N1(),ut.lanes|=r,Ma|=r,c)}function Nx(r,s,c,h){return fo(c,s)?c:oi.current!==null?(r=vm(r,c,h),fo(r,s)||(Cn=!0),r):(Lr&42)===0||(Lr&1073741824)!==0&&(xt&261930)===0?(Cn=!0,r.memoizedState=c):(r=N1(),ut.lanes|=r,Ma|=r,s)}function Rx(r,s,c,h,b){var _=L.p;L.p=_!==0&&8>_?_:8;var O=j.T,F={};j.T=F,wm(r,!1,s,c);try{var te=b(),fe=j.S;if(fe!==null&&fe(F,te),te!==null&&typeof te=="object"&&typeof te.then=="function"){var pe=J3(te,h);Al(r,s,pe,vo(r))}else Al(r,s,h,vo(r))}catch(Ee){Al(r,s,{then:function(){},status:"rejected",reason:Ee},vo())}finally{L.p=_,O!==null&&F.types!==null&&(O.types=F.types),j.T=O}}function aD(){}function xm(r,s,c,h){if(r.tag!==5)throw Error(o(476));var b=Dx(r).queue;Rx(r,b,s,$,c===null?aD:function(){return Tx(r),c(h)})}function Dx(r){var s=r.memoizedState;if(s!==null)return s;s={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:$},next:null};var c={};return s.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hr,lastRenderedState:c},next:null},r.memoizedState=s,r=r.alternate,r!==null&&(r.memoizedState=s),s}function Tx(r){var s=Dx(r);s.next===null&&(s=r.alternate.memoizedState),Al(r,s.next.queue,{},vo())}function bm(){return Hn(Xl)}function kx(){return xn().memoizedState}function Ox(){return xn().memoizedState}function sD(r){for(var s=r.return;s!==null;){switch(s.tag){case 24:case 3:var c=vo();r=ba(c);var h=wa(s,r,c);h!==null&&(ao(h,s,c),Rl(h,s,c)),s={cache:Kh()},r.payload=s;return}s=s.return}}function iD(r,s,c){var h=vo();c={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Fu(r)?jx(s,c):(c=$h(r,s,c,h),c!==null&&(ao(c,r,h),zx(c,s,h)))}function Ax(r,s,c){var h=vo();Al(r,s,c,h)}function Al(r,s,c,h){var b={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Fu(r))jx(s,b);else{var _=r.alternate;if(r.lanes===0&&(_===null||_.lanes===0)&&(_=s.lastRenderedReducer,_!==null))try{var O=s.lastRenderedState,F=_(O,c);if(b.hasEagerState=!0,b.eagerState=F,fo(F,O))return Cu(r,s,b,0),Zt===null&&Su(),!1}catch{}if(c=$h(r,s,b,h),c!==null)return ao(c,r,h),zx(c,s,h),!0}return!1}function wm(r,s,c,h){if(h={lane:2,revertLane:Jm(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Fu(r)){if(s)throw Error(o(479))}else s=$h(r,c,h,2),s!==null&&ao(s,r,2)}function Fu(r){var s=r.alternate;return r===ut||s!==null&&s===ut}function jx(r,s){ri=Iu=!0;var c=r.pending;c===null?s.next=s:(s.next=c.next,c.next=s),r.pending=s}function zx(r,s,c){if((c&4194048)!==0){var h=s.lanes;h&=r.pendingLanes,c|=h,s.lanes=c,vt(r,c)}}var jl={readContext:Hn,use:Lu,useCallback:gn,useContext:gn,useEffect:gn,useImperativeHandle:gn,useLayoutEffect:gn,useInsertionEffect:gn,useMemo:gn,useReducer:gn,useRef:gn,useState:gn,useDebugValue:gn,useDeferredValue:gn,useTransition:gn,useSyncExternalStore:gn,useId:gn,useHostTransitionStatus:gn,useFormState:gn,useActionState:gn,useOptimistic:gn,useMemoCache:gn,useCacheRefresh:gn};jl.useEffectEvent=gn;var Ix={readContext:Hn,use:Lu,useCallback:function(r,s){return Xn().memoizedState=[r,s===void 0?null:s],r},useContext:Hn,useEffect:xx,useImperativeHandle:function(r,s,c){c=c!=null?c.concat([r]):null,Bu(4194308,4,Cx.bind(null,s,r),c)},useLayoutEffect:function(r,s){return Bu(4194308,4,r,s)},useInsertionEffect:function(r,s){Bu(4,2,r,s)},useMemo:function(r,s){var c=Xn();s=s===void 0?null:s;var h=r();if(vs){qt(!0);try{r()}finally{qt(!1)}}return c.memoizedState=[h,s],h},useReducer:function(r,s,c){var h=Xn();if(c!==void 0){var b=c(s);if(vs){qt(!0);try{c(s)}finally{qt(!1)}}}else b=s;return h.memoizedState=h.baseState=b,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:b},h.queue=r,r=r.dispatch=iD.bind(null,ut,r),[h.memoizedState,r]},useRef:function(r){var s=Xn();return r={current:r},s.memoizedState=r},useState:function(r){r=mm(r);var s=r.queue,c=Ax.bind(null,ut,s);return s.dispatch=c,[r.memoizedState,c]},useDebugValue:ym,useDeferredValue:function(r,s){var c=Xn();return vm(c,r,s)},useTransition:function(){var r=mm(!1);return r=Rx.bind(null,ut,r.queue,!0,!1),Xn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,s,c){var h=ut,b=Xn();if(wt){if(c===void 0)throw Error(o(407));c=c()}else{if(c=s(),Zt===null)throw Error(o(349));(xt&127)!==0||ox(h,s,c)}b.memoizedState=c;var _={value:c,getSnapshot:s};return b.queue=_,xx(ax.bind(null,h,_,r),[r]),h.flags|=2048,si(9,{destroy:void 0},rx.bind(null,h,_,c,s),null),c},useId:function(){var r=Xn(),s=Zt.identifierPrefix;if(wt){var c=cr,h=lr;c=(h&~(1<<32-Wt(h)-1)).toString(32)+c,s="_"+s+"R_"+c,c=Pu++,0<c&&(s+="H"+c.toString(32)),s+="_"}else c=eD++,s="_"+s+"r_"+c.toString(32)+"_";return r.memoizedState=s},useHostTransitionStatus:bm,useFormState:mx,useActionState:mx,useOptimistic:function(r){var s=Xn();s.memoizedState=s.baseState=r;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=c,s=wm.bind(null,ut,!0,c),c.dispatch=s,[r,s]},useMemoCache:dm,useCacheRefresh:function(){return Xn().memoizedState=sD.bind(null,ut)},useEffectEvent:function(r){var s=Xn(),c={impl:r};return s.memoizedState=c,function(){if((jt&2)!==0)throw Error(o(440));return c.impl.apply(void 0,arguments)}}},Sm={readContext:Hn,use:Lu,useCallback:_x,useContext:Hn,useEffect:pm,useImperativeHandle:Ex,useInsertionEffect:wx,useLayoutEffect:Sx,useMemo:Mx,useReducer:Hu,useRef:vx,useState:function(){return Hu(Hr)},useDebugValue:ym,useDeferredValue:function(r,s){var c=xn();return Nx(c,Ft.memoizedState,r,s)},useTransition:function(){var r=Hu(Hr)[0],s=xn().memoizedState;return[typeof r=="boolean"?r:Ol(r),s]},useSyncExternalStore:nx,useId:kx,useHostTransitionStatus:bm,useFormState:gx,useActionState:gx,useOptimistic:function(r,s){var c=xn();return lx(c,Ft,r,s)},useMemoCache:dm,useCacheRefresh:Ox};Sm.useEffectEvent=bx;var Px={readContext:Hn,use:Lu,useCallback:_x,useContext:Hn,useEffect:pm,useImperativeHandle:Ex,useInsertionEffect:wx,useLayoutEffect:Sx,useMemo:Mx,useReducer:hm,useRef:vx,useState:function(){return hm(Hr)},useDebugValue:ym,useDeferredValue:function(r,s){var c=xn();return Ft===null?vm(c,r,s):Nx(c,Ft.memoizedState,r,s)},useTransition:function(){var r=hm(Hr)[0],s=xn().memoizedState;return[typeof r=="boolean"?r:Ol(r),s]},useSyncExternalStore:nx,useId:kx,useHostTransitionStatus:bm,useFormState:yx,useActionState:yx,useOptimistic:function(r,s){var c=xn();return Ft!==null?lx(c,Ft,r,s):(c.baseState=r,[r,c.queue.dispatch])},useMemoCache:dm,useCacheRefresh:Ox};Px.useEffectEvent=bx;function Cm(r,s,c,h){s=r.memoizedState,c=c(h,s),c=c==null?s:m({},s,c),r.memoizedState=c,r.lanes===0&&(r.updateQueue.baseState=c)}var Em={enqueueSetState:function(r,s,c){r=r._reactInternals;var h=vo(),b=ba(h);b.payload=s,c!=null&&(b.callback=c),s=wa(r,b,h),s!==null&&(ao(s,r,h),Rl(s,r,h))},enqueueReplaceState:function(r,s,c){r=r._reactInternals;var h=vo(),b=ba(h);b.tag=1,b.payload=s,c!=null&&(b.callback=c),s=wa(r,b,h),s!==null&&(ao(s,r,h),Rl(s,r,h))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var c=vo(),h=ba(c);h.tag=2,s!=null&&(h.callback=s),s=wa(r,h,c),s!==null&&(ao(s,r,c),Rl(s,r,c))}};function $x(r,s,c,h,b,_,O){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(h,_,O):s.prototype&&s.prototype.isPureReactComponent?!bl(c,h)||!bl(b,_):!0}function Lx(r,s,c,h){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(c,h),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(c,h),s.state!==r&&Em.enqueueReplaceState(s,s.state,null)}function xs(r,s){var c=s;if("ref"in s){c={};for(var h in s)h!=="ref"&&(c[h]=s[h])}if(r=r.defaultProps){c===s&&(c=m({},c));for(var b in r)c[b]===void 0&&(c[b]=r[b])}return c}function Hx(r){wu(r)}function Bx(r){console.error(r)}function Vx(r){wu(r)}function Uu(r,s){try{var c=r.onUncaughtError;c(s.value,{componentStack:s.stack})}catch(h){setTimeout(function(){throw h})}}function Fx(r,s,c){try{var h=r.onCaughtError;h(c.value,{componentStack:c.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function _m(r,s,c){return c=ba(c),c.tag=3,c.payload={element:null},c.callback=function(){Uu(r,s)},c}function Ux(r){return r=ba(r),r.tag=3,r}function Yx(r,s,c,h){var b=c.type.getDerivedStateFromError;if(typeof b=="function"){var _=h.value;r.payload=function(){return b(_)},r.callback=function(){Fx(s,c,h)}}var O=c.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(r.callback=function(){Fx(s,c,h),typeof b!="function"&&(Na===null?Na=new Set([this]):Na.add(this));var F=h.stack;this.componentDidCatch(h.value,{componentStack:F!==null?F:""})})}function lD(r,s,c,h,b){if(c.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(s=c.alternate,s!==null&&Qs(s,c,b,!0),c=mo.current,c!==null){switch(c.tag){case 31:case 13:return Io===null?nd():c.alternate===null&&pn===0&&(pn=3),c.flags&=-257,c.flags|=65536,c.lanes=b,h===ku?c.flags|=16384:(s=c.updateQueue,s===null?c.updateQueue=new Set([h]):s.add(h),Xm(r,h,b)),!1;case 22:return c.flags|=65536,h===ku?c.flags|=16384:(s=c.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([h])},c.updateQueue=s):(c=s.retryQueue,c===null?s.retryQueue=new Set([h]):c.add(h)),Xm(r,h,b)),!1}throw Error(o(435,c.tag))}return Xm(r,h,b),nd(),!1}if(wt)return s=mo.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=b,h!==Uh&&(r=Error(o(422),{cause:h}),Cl(Oo(r,c)))):(h!==Uh&&(s=Error(o(423),{cause:h}),Cl(Oo(s,c))),r=r.current.alternate,r.flags|=65536,b&=-b,r.lanes|=b,h=Oo(h,c),b=_m(r.stateNode,h,b),tm(r,b),pn!==4&&(pn=2)),!1;var _=Error(o(520),{cause:h});if(_=Oo(_,c),Vl===null?Vl=[_]:Vl.push(_),pn!==4&&(pn=2),s===null)return!0;h=Oo(h,c),c=s;do{switch(c.tag){case 3:return c.flags|=65536,r=b&-b,c.lanes|=r,r=_m(c.stateNode,h,r),tm(c,r),!1;case 1:if(s=c.type,_=c.stateNode,(c.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Na===null||!Na.has(_))))return c.flags|=65536,b&=-b,c.lanes|=b,b=Ux(b),Yx(b,r,c,h),tm(c,b),!1}c=c.return}while(c!==null);return!1}var Mm=Error(o(461)),Cn=!1;function Bn(r,s,c,h){s.child=r===null?Kv(s,null,c,h):ys(s,r.child,c,h)}function Gx(r,s,c,h,b){c=c.render;var _=s.ref;if("ref"in h){var O={};for(var F in h)F!=="ref"&&(O[F]=h[F])}else O=h;return hs(s),h=im(r,s,c,O,_,b),F=lm(),r!==null&&!Cn?(cm(r,s,b),Br(r,s,b)):(wt&&F&&Vh(s),s.flags|=1,Bn(r,s,h,b),s.child)}function qx(r,s,c,h,b){if(r===null){var _=c.type;return typeof _=="function"&&!Lh(_)&&_.defaultProps===void 0&&c.compare===null?(s.tag=15,s.type=_,Wx(r,s,_,h,b)):(r=_u(c.type,null,h,s,s.mode,b),r.ref=s.ref,r.return=s,s.child=r)}if(_=r.child,!jm(r,b)){var O=_.memoizedProps;if(c=c.compare,c=c!==null?c:bl,c(O,h)&&r.ref===s.ref)return Br(r,s,b)}return s.flags|=1,r=zr(_,h),r.ref=s.ref,r.return=s,s.child=r}function Wx(r,s,c,h,b){if(r!==null){var _=r.memoizedProps;if(bl(_,h)&&r.ref===s.ref)if(Cn=!1,s.pendingProps=h=_,jm(r,b))(r.flags&131072)!==0&&(Cn=!0);else return s.lanes=r.lanes,Br(r,s,b)}return Nm(r,s,c,h,b)}function Kx(r,s,c,h){var b=h.children,_=r!==null?r.memoizedState:null;if(r===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((s.flags&128)!==0){if(_=_!==null?_.baseLanes|c:c,r!==null){for(h=s.child=r.child,b=0;h!==null;)b=b|h.lanes|h.childLanes,h=h.sibling;h=b&~_}else h=0,s.child=null;return Xx(r,s,_,c,h)}if((c&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},r!==null&&Du(s,_!==null?_.cachePool:null),_!==null?Qv(s,_):om(),Jv(s);else return h=s.lanes=536870912,Xx(r,s,_!==null?_.baseLanes|c:c,c,h)}else _!==null?(Du(s,_.cachePool),Qv(s,_),Ca(),s.memoizedState=null):(r!==null&&Du(s,null),om(),Ca());return Bn(r,s,b,c),s.child}function zl(r,s){return r!==null&&r.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function Xx(r,s,c,h,b){var _=Zh();return _=_===null?null:{parent:wn._currentValue,pool:_},s.memoizedState={baseLanes:c,cachePool:_},r!==null&&Du(s,null),om(),Jv(s),r!==null&&Qs(r,s,h,!0),s.childLanes=b,null}function Yu(r,s){return s=qu({mode:s.mode,children:s.children},r.mode),s.ref=r.ref,r.child=s,s.return=r,s}function Zx(r,s,c){return ys(s,r.child,null,c),r=Yu(s,s.pendingProps),r.flags|=2,go(s),s.memoizedState=null,r}function cD(r,s,c){var h=s.pendingProps,b=(s.flags&128)!==0;if(s.flags&=-129,r===null){if(wt){if(h.mode==="hidden")return r=Yu(s,h),s.lanes=536870912,zl(null,r);if(am(s),(r=Jt)?(r=cb(r,zo),r=r!==null&&r.data==="&"?r:null,r!==null&&(s.memoizedState={dehydrated:r,treeContext:ga!==null?{id:lr,overflow:cr}:null,retryLane:536870912,hydrationErrors:null},c=jv(r),c.return=s,s.child=c,Ln=s,Jt=null)):r=null,r===null)throw ya(s);return s.lanes=536870912,null}return Yu(s,h)}var _=r.memoizedState;if(_!==null){var O=_.dehydrated;if(am(s),b)if(s.flags&256)s.flags&=-257,s=Zx(r,s,c);else if(s.memoizedState!==null)s.child=r.child,s.flags|=128,s=null;else throw Error(o(558));else if(Cn||Qs(r,s,c,!1),b=(c&r.childLanes)!==0,Cn||b){if(h=Zt,h!==null&&(O=Dn(h,c),O!==0&&O!==_.retryLane))throw _.retryLane=O,cs(r,O),ao(h,r,O),Mm;nd(),s=Zx(r,s,c)}else r=_.treeContext,Jt=Po(O.nextSibling),Ln=s,wt=!0,pa=null,zo=!1,r!==null&&Pv(s,r),s=Yu(s,h),s.flags|=4096;return s}return r=zr(r.child,{mode:h.mode,children:h.children}),r.ref=s.ref,s.child=r,r.return=s,r}function Gu(r,s){var c=s.ref;if(c===null)r!==null&&r.ref!==null&&(s.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(o(284));(r===null||r.ref!==c)&&(s.flags|=4194816)}}function Nm(r,s,c,h,b){return hs(s),c=im(r,s,c,h,void 0,b),h=lm(),r!==null&&!Cn?(cm(r,s,b),Br(r,s,b)):(wt&&h&&Vh(s),s.flags|=1,Bn(r,s,c,b),s.child)}function Qx(r,s,c,h,b,_){return hs(s),s.updateQueue=null,c=tx(s,h,c,b),ex(r),h=lm(),r!==null&&!Cn?(cm(r,s,_),Br(r,s,_)):(wt&&h&&Vh(s),s.flags|=1,Bn(r,s,c,_),s.child)}function Jx(r,s,c,h,b){if(hs(s),s.stateNode===null){var _=Ws,O=c.contextType;typeof O=="object"&&O!==null&&(_=Hn(O)),_=new c(h,_),s.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=Em,s.stateNode=_,_._reactInternals=s,_=s.stateNode,_.props=h,_.state=s.memoizedState,_.refs={},Jh(s),O=c.contextType,_.context=typeof O=="object"&&O!==null?Hn(O):Ws,_.state=s.memoizedState,O=c.getDerivedStateFromProps,typeof O=="function"&&(Cm(s,c,O,h),_.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(O=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),O!==_.state&&Em.enqueueReplaceState(_,_.state,null),Tl(s,h,_,b),Dl(),_.state=s.memoizedState),typeof _.componentDidMount=="function"&&(s.flags|=4194308),h=!0}else if(r===null){_=s.stateNode;var F=s.memoizedProps,te=xs(c,F);_.props=te;var fe=_.context,pe=c.contextType;O=Ws,typeof pe=="object"&&pe!==null&&(O=Hn(pe));var Ee=c.getDerivedStateFromProps;pe=typeof Ee=="function"||typeof _.getSnapshotBeforeUpdate=="function",F=s.pendingProps!==F,pe||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(F||fe!==O)&&Lx(s,_,h,O),xa=!1;var he=s.memoizedState;_.state=he,Tl(s,h,_,b),Dl(),fe=s.memoizedState,F||he!==fe||xa?(typeof Ee=="function"&&(Cm(s,c,Ee,h),fe=s.memoizedState),(te=xa||$x(s,c,te,h,he,fe,O))?(pe||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(s.flags|=4194308)):(typeof _.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=h,s.memoizedState=fe),_.props=h,_.state=fe,_.context=O,h=te):(typeof _.componentDidMount=="function"&&(s.flags|=4194308),h=!1)}else{_=s.stateNode,em(r,s),O=s.memoizedProps,pe=xs(c,O),_.props=pe,Ee=s.pendingProps,he=_.context,fe=c.contextType,te=Ws,typeof fe=="object"&&fe!==null&&(te=Hn(fe)),F=c.getDerivedStateFromProps,(fe=typeof F=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(O!==Ee||he!==te)&&Lx(s,_,h,te),xa=!1,he=s.memoizedState,_.state=he,Tl(s,h,_,b),Dl();var me=s.memoizedState;O!==Ee||he!==me||xa||r!==null&&r.dependencies!==null&&Nu(r.dependencies)?(typeof F=="function"&&(Cm(s,c,F,h),me=s.memoizedState),(pe=xa||$x(s,c,pe,h,he,me,te)||r!==null&&r.dependencies!==null&&Nu(r.dependencies))?(fe||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(h,me,te),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(h,me,te)),typeof _.componentDidUpdate=="function"&&(s.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof _.componentDidUpdate!="function"||O===r.memoizedProps&&he===r.memoizedState||(s.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||O===r.memoizedProps&&he===r.memoizedState||(s.flags|=1024),s.memoizedProps=h,s.memoizedState=me),_.props=h,_.state=me,_.context=te,h=pe):(typeof _.componentDidUpdate!="function"||O===r.memoizedProps&&he===r.memoizedState||(s.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||O===r.memoizedProps&&he===r.memoizedState||(s.flags|=1024),h=!1)}return _=h,Gu(r,s),h=(s.flags&128)!==0,_||h?(_=s.stateNode,c=h&&typeof c.getDerivedStateFromError!="function"?null:_.render(),s.flags|=1,r!==null&&h?(s.child=ys(s,r.child,null,b),s.child=ys(s,null,c,b)):Bn(r,s,c,b),s.memoizedState=_.state,r=s.child):r=Br(r,s,b),r}function e1(r,s,c,h){return ds(),s.flags|=256,Bn(r,s,c,h),s.child}var Rm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Dm(r){return{baseLanes:r,cachePool:Fv()}}function Tm(r,s,c){return r=r!==null?r.childLanes&~c:0,s&&(r|=yo),r}function t1(r,s,c){var h=s.pendingProps,b=!1,_=(s.flags&128)!==0,O;if((O=_)||(O=r!==null&&r.memoizedState===null?!1:(vn.current&2)!==0),O&&(b=!0,s.flags&=-129),O=(s.flags&32)!==0,s.flags&=-33,r===null){if(wt){if(b?Sa(s):Ca(),(r=Jt)?(r=cb(r,zo),r=r!==null&&r.data!=="&"?r:null,r!==null&&(s.memoizedState={dehydrated:r,treeContext:ga!==null?{id:lr,overflow:cr}:null,retryLane:536870912,hydrationErrors:null},c=jv(r),c.return=s,s.child=c,Ln=s,Jt=null)):r=null,r===null)throw ya(s);return fg(r)?s.lanes=32:s.lanes=536870912,null}var F=h.children;return h=h.fallback,b?(Ca(),b=s.mode,F=qu({mode:"hidden",children:F},b),h=us(h,b,c,null),F.return=s,h.return=s,F.sibling=h,s.child=F,h=s.child,h.memoizedState=Dm(c),h.childLanes=Tm(r,O,c),s.memoizedState=Rm,zl(null,h)):(Sa(s),km(s,F))}var te=r.memoizedState;if(te!==null&&(F=te.dehydrated,F!==null)){if(_)s.flags&256?(Sa(s),s.flags&=-257,s=Om(r,s,c)):s.memoizedState!==null?(Ca(),s.child=r.child,s.flags|=128,s=null):(Ca(),F=h.fallback,b=s.mode,h=qu({mode:"visible",children:h.children},b),F=us(F,b,c,null),F.flags|=2,h.return=s,F.return=s,h.sibling=F,s.child=h,ys(s,r.child,null,c),h=s.child,h.memoizedState=Dm(c),h.childLanes=Tm(r,O,c),s.memoizedState=Rm,s=zl(null,h));else if(Sa(s),fg(F)){if(O=F.nextSibling&&F.nextSibling.dataset,O)var fe=O.dgst;O=fe,h=Error(o(419)),h.stack="",h.digest=O,Cl({value:h,source:null,stack:null}),s=Om(r,s,c)}else if(Cn||Qs(r,s,c,!1),O=(c&r.childLanes)!==0,Cn||O){if(O=Zt,O!==null&&(h=Dn(O,c),h!==0&&h!==te.retryLane))throw te.retryLane=h,cs(r,h),ao(O,r,h),Mm;dg(F)||nd(),s=Om(r,s,c)}else dg(F)?(s.flags|=192,s.child=r.child,s=null):(r=te.treeContext,Jt=Po(F.nextSibling),Ln=s,wt=!0,pa=null,zo=!1,r!==null&&Pv(s,r),s=km(s,h.children),s.flags|=4096);return s}return b?(Ca(),F=h.fallback,b=s.mode,te=r.child,fe=te.sibling,h=zr(te,{mode:"hidden",children:h.children}),h.subtreeFlags=te.subtreeFlags&65011712,fe!==null?F=zr(fe,F):(F=us(F,b,c,null),F.flags|=2),F.return=s,h.return=s,h.sibling=F,s.child=h,zl(null,h),h=s.child,F=r.child.memoizedState,F===null?F=Dm(c):(b=F.cachePool,b!==null?(te=wn._currentValue,b=b.parent!==te?{parent:te,pool:te}:b):b=Fv(),F={baseLanes:F.baseLanes|c,cachePool:b}),h.memoizedState=F,h.childLanes=Tm(r,O,c),s.memoizedState=Rm,zl(r.child,h)):(Sa(s),c=r.child,r=c.sibling,c=zr(c,{mode:"visible",children:h.children}),c.return=s,c.sibling=null,r!==null&&(O=s.deletions,O===null?(s.deletions=[r],s.flags|=16):O.push(r)),s.child=c,s.memoizedState=null,c)}function km(r,s){return s=qu({mode:"visible",children:s},r.mode),s.return=r,r.child=s}function qu(r,s){return r=ho(22,r,null,s),r.lanes=0,r}function Om(r,s,c){return ys(s,r.child,null,c),r=km(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function n1(r,s,c){r.lanes|=s;var h=r.alternate;h!==null&&(h.lanes|=s),qh(r.return,s,c)}function Am(r,s,c,h,b,_){var O=r.memoizedState;O===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:c,tailMode:b,treeForkCount:_}:(O.isBackwards=s,O.rendering=null,O.renderingStartTime=0,O.last=h,O.tail=c,O.tailMode=b,O.treeForkCount=_)}function o1(r,s,c){var h=s.pendingProps,b=h.revealOrder,_=h.tail;h=h.children;var O=vn.current,F=(O&2)!==0;if(F?(O=O&1|2,s.flags|=128):O&=1,V(vn,O),Bn(r,s,h,c),h=wt?Sl:0,!F&&r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&n1(r,c,s);else if(r.tag===19)n1(r,c,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(b){case"forwards":for(c=s.child,b=null;c!==null;)r=c.alternate,r!==null&&zu(r)===null&&(b=c),c=c.sibling;c=b,c===null?(b=s.child,s.child=null):(b=c.sibling,c.sibling=null),Am(s,!1,b,c,_,h);break;case"backwards":case"unstable_legacy-backwards":for(c=null,b=s.child,s.child=null;b!==null;){if(r=b.alternate,r!==null&&zu(r)===null){s.child=b;break}r=b.sibling,b.sibling=c,c=b,b=r}Am(s,!0,c,null,_,h);break;case"together":Am(s,!1,null,null,void 0,h);break;default:s.memoizedState=null}return s.child}function Br(r,s,c){if(r!==null&&(s.dependencies=r.dependencies),Ma|=s.lanes,(c&s.childLanes)===0)if(r!==null){if(Qs(r,s,c,!1),(c&s.childLanes)===0)return null}else return null;if(r!==null&&s.child!==r.child)throw Error(o(153));if(s.child!==null){for(r=s.child,c=zr(r,r.pendingProps),s.child=c,c.return=s;r.sibling!==null;)r=r.sibling,c=c.sibling=zr(r,r.pendingProps),c.return=s;c.sibling=null}return s.child}function jm(r,s){return(r.lanes&s)!==0?!0:(r=r.dependencies,!!(r!==null&&Nu(r)))}function uD(r,s,c){switch(s.tag){case 3:ee(s,s.stateNode.containerInfo),va(s,wn,r.memoizedState.cache),ds();break;case 27:case 5:ce(s);break;case 4:ee(s,s.stateNode.containerInfo);break;case 10:va(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,am(s),null;break;case 13:var h=s.memoizedState;if(h!==null)return h.dehydrated!==null?(Sa(s),s.flags|=128,null):(c&s.child.childLanes)!==0?t1(r,s,c):(Sa(s),r=Br(r,s,c),r!==null?r.sibling:null);Sa(s);break;case 19:var b=(r.flags&128)!==0;if(h=(c&s.childLanes)!==0,h||(Qs(r,s,c,!1),h=(c&s.childLanes)!==0),b){if(h)return o1(r,s,c);s.flags|=128}if(b=s.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),V(vn,vn.current),h)break;return null;case 22:return s.lanes=0,Kx(r,s,c,s.pendingProps);case 24:va(s,wn,r.memoizedState.cache)}return Br(r,s,c)}function r1(r,s,c){if(r!==null)if(r.memoizedProps!==s.pendingProps)Cn=!0;else{if(!jm(r,c)&&(s.flags&128)===0)return Cn=!1,uD(r,s,c);Cn=(r.flags&131072)!==0}else Cn=!1,wt&&(s.flags&1048576)!==0&&Iv(s,Sl,s.index);switch(s.lanes=0,s.tag){case 16:e:{var h=s.pendingProps;if(r=gs(s.elementType),s.type=r,typeof r=="function")Lh(r)?(h=xs(r,h),s.tag=1,s=Jx(null,s,r,h,c)):(s.tag=0,s=Nm(null,s,r,h,c));else{if(r!=null){var b=r.$$typeof;if(b===N){s.tag=11,s=Gx(null,s,r,h,c);break e}else if(b===k){s.tag=14,s=qx(null,s,r,h,c);break e}}throw s=I(r)||r,Error(o(306,s,""))}}return s;case 0:return Nm(r,s,s.type,s.pendingProps,c);case 1:return h=s.type,b=xs(h,s.pendingProps),Jx(r,s,h,b,c);case 3:e:{if(ee(s,s.stateNode.containerInfo),r===null)throw Error(o(387));h=s.pendingProps;var _=s.memoizedState;b=_.element,em(r,s),Tl(s,h,null,c);var O=s.memoizedState;if(h=O.cache,va(s,wn,h),h!==_.cache&&Wh(s,[wn],c,!0),Dl(),h=O.element,_.isDehydrated)if(_={element:h,isDehydrated:!1,cache:O.cache},s.updateQueue.baseState=_,s.memoizedState=_,s.flags&256){s=e1(r,s,h,c);break e}else if(h!==b){b=Oo(Error(o(424)),s),Cl(b),s=e1(r,s,h,c);break e}else for(r=s.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,Jt=Po(r.firstChild),Ln=s,wt=!0,pa=null,zo=!0,c=Kv(s,null,h,c),s.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(ds(),h===b){s=Br(r,s,c);break e}Bn(r,s,h,c)}s=s.child}return s;case 26:return Gu(r,s),r===null?(c=gb(s.type,null,s.pendingProps,null))?s.memoizedState=c:wt||(c=s.type,r=s.pendingProps,h=cd(oe.current).createElement(c),h[dn]=s,h[Tn]=r,Vn(h,c,r),Se(h),s.stateNode=h):s.memoizedState=gb(s.type,r.memoizedProps,s.pendingProps,r.memoizedState),null;case 27:return ce(s),r===null&&wt&&(h=s.stateNode=fb(s.type,s.pendingProps,oe.current),Ln=s,zo=!0,b=Jt,ka(s.type)?(hg=b,Jt=Po(h.firstChild)):Jt=b),Bn(r,s,s.pendingProps.children,c),Gu(r,s),r===null&&(s.flags|=4194304),s.child;case 5:return r===null&&wt&&((b=h=Jt)&&(h=HD(h,s.type,s.pendingProps,zo),h!==null?(s.stateNode=h,Ln=s,Jt=Po(h.firstChild),zo=!1,b=!0):b=!1),b||ya(s)),ce(s),b=s.type,_=s.pendingProps,O=r!==null?r.memoizedProps:null,h=_.children,lg(b,_)?h=null:O!==null&&lg(b,O)&&(s.flags|=32),s.memoizedState!==null&&(b=im(r,s,tD,null,null,c),Xl._currentValue=b),Gu(r,s),Bn(r,s,h,c),s.child;case 6:return r===null&&wt&&((r=c=Jt)&&(c=BD(c,s.pendingProps,zo),c!==null?(s.stateNode=c,Ln=s,Jt=null,r=!0):r=!1),r||ya(s)),null;case 13:return t1(r,s,c);case 4:return ee(s,s.stateNode.containerInfo),h=s.pendingProps,r===null?s.child=ys(s,null,h,c):Bn(r,s,h,c),s.child;case 11:return Gx(r,s,s.type,s.pendingProps,c);case 7:return Bn(r,s,s.pendingProps,c),s.child;case 8:return Bn(r,s,s.pendingProps.children,c),s.child;case 12:return Bn(r,s,s.pendingProps.children,c),s.child;case 10:return h=s.pendingProps,va(s,s.type,h.value),Bn(r,s,h.children,c),s.child;case 9:return b=s.type._context,h=s.pendingProps.children,hs(s),b=Hn(b),h=h(b),s.flags|=1,Bn(r,s,h,c),s.child;case 14:return qx(r,s,s.type,s.pendingProps,c);case 15:return Wx(r,s,s.type,s.pendingProps,c);case 19:return o1(r,s,c);case 31:return cD(r,s,c);case 22:return Kx(r,s,c,s.pendingProps);case 24:return hs(s),h=Hn(wn),r===null?(b=Zh(),b===null&&(b=Zt,_=Kh(),b.pooledCache=_,_.refCount++,_!==null&&(b.pooledCacheLanes|=c),b=_),s.memoizedState={parent:h,cache:b},Jh(s),va(s,wn,b)):((r.lanes&c)!==0&&(em(r,s),Tl(s,null,null,c),Dl()),b=r.memoizedState,_=s.memoizedState,b.parent!==h?(b={parent:h,cache:h},s.memoizedState=b,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=b),va(s,wn,h)):(h=_.cache,va(s,wn,h),h!==b.cache&&Wh(s,[wn],c,!0))),Bn(r,s,s.pendingProps.children,c),s.child;case 29:throw s.pendingProps}throw Error(o(156,s.tag))}function Vr(r){r.flags|=4}function zm(r,s,c,h,b){if((s=(r.mode&32)!==0)&&(s=!1),s){if(r.flags|=16777216,(b&335544128)===b)if(r.stateNode.complete)r.flags|=8192;else if(k1())r.flags|=8192;else throw ps=ku,Qh}else r.flags&=-16777217}function a1(r,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!bb(s))if(k1())r.flags|=8192;else throw ps=ku,Qh}function Wu(r,s){s!==null&&(r.flags|=4),r.flags&16384&&(s=r.tag!==22?un():536870912,r.lanes|=s,ui|=s)}function Il(r,s){if(!wt)switch(r.tailMode){case"hidden":s=r.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?r.tail=null:c.sibling=null;break;case"collapsed":c=r.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:h.sibling=null}}function en(r){var s=r.alternate!==null&&r.alternate.child===r.child,c=0,h=0;if(s)for(var b=r.child;b!==null;)c|=b.lanes|b.childLanes,h|=b.subtreeFlags&65011712,h|=b.flags&65011712,b.return=r,b=b.sibling;else for(b=r.child;b!==null;)c|=b.lanes|b.childLanes,h|=b.subtreeFlags,h|=b.flags,b.return=r,b=b.sibling;return r.subtreeFlags|=h,r.childLanes=c,s}function dD(r,s,c){var h=s.pendingProps;switch(Fh(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return en(s),null;case 1:return en(s),null;case 3:return c=s.stateNode,h=null,r!==null&&(h=r.memoizedState.cache),s.memoizedState.cache!==h&&(s.flags|=2048),$r(wn),ae(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(Zs(s)?Vr(s):r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Yh())),en(s),null;case 26:var b=s.type,_=s.memoizedState;return r===null?(Vr(s),_!==null?(en(s),a1(s,_)):(en(s),zm(s,b,null,h,c))):_?_!==r.memoizedState?(Vr(s),en(s),a1(s,_)):(en(s),s.flags&=-16777217):(r=r.memoizedProps,r!==h&&Vr(s),en(s),zm(s,b,r,h,c)),null;case 27:if(ge(s),c=oe.current,b=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==h&&Vr(s);else{if(!h){if(s.stateNode===null)throw Error(o(166));return en(s),null}r=q.current,Zs(s)?$v(s):(r=fb(b,h,c),s.stateNode=r,Vr(s))}return en(s),null;case 5:if(ge(s),b=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==h&&Vr(s);else{if(!h){if(s.stateNode===null)throw Error(o(166));return en(s),null}if(_=q.current,Zs(s))$v(s);else{var O=cd(oe.current);switch(_){case 1:_=O.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:_=O.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":_=O.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":_=O.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":_=O.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof h.is=="string"?O.createElement("select",{is:h.is}):O.createElement("select"),h.multiple?_.multiple=!0:h.size&&(_.size=h.size);break;default:_=typeof h.is=="string"?O.createElement(b,{is:h.is}):O.createElement(b)}}_[dn]=s,_[Tn]=h;e:for(O=s.child;O!==null;){if(O.tag===5||O.tag===6)_.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===s)break e;for(;O.sibling===null;){if(O.return===null||O.return===s)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}s.stateNode=_;e:switch(Vn(_,b,h),b){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&Vr(s)}}return en(s),zm(s,s.type,r===null?null:r.memoizedProps,s.pendingProps,c),null;case 6:if(r&&s.stateNode!=null)r.memoizedProps!==h&&Vr(s);else{if(typeof h!="string"&&s.stateNode===null)throw Error(o(166));if(r=oe.current,Zs(s)){if(r=s.stateNode,c=s.memoizedProps,h=null,b=Ln,b!==null)switch(b.tag){case 27:case 5:h=b.memoizedProps}r[dn]=s,r=!!(r.nodeValue===c||h!==null&&h.suppressHydrationWarning===!0||tb(r.nodeValue,c)),r||ya(s,!0)}else r=cd(r).createTextNode(h),r[dn]=s,s.stateNode=r}return en(s),null;case 31:if(c=s.memoizedState,r===null||r.memoizedState!==null){if(h=Zs(s),c!==null){if(r===null){if(!h)throw Error(o(318));if(r=s.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(o(557));r[dn]=s}else ds(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;en(s),r=!1}else c=Yh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=c),r=!0;if(!r)return s.flags&256?(go(s),s):(go(s),null);if((s.flags&128)!==0)throw Error(o(558))}return en(s),null;case 13:if(h=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(b=Zs(s),h!==null&&h.dehydrated!==null){if(r===null){if(!b)throw Error(o(318));if(b=s.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(o(317));b[dn]=s}else ds(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;en(s),b=!1}else b=Yh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=b),b=!0;if(!b)return s.flags&256?(go(s),s):(go(s),null)}return go(s),(s.flags&128)!==0?(s.lanes=c,s):(c=h!==null,r=r!==null&&r.memoizedState!==null,c&&(h=s.child,b=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(b=h.alternate.memoizedState.cachePool.pool),_=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(_=h.memoizedState.cachePool.pool),_!==b&&(h.flags|=2048)),c!==r&&c&&(s.child.flags|=8192),Wu(s,s.updateQueue),en(s),null);case 4:return ae(),r===null&&og(s.stateNode.containerInfo),en(s),null;case 10:return $r(s.type),en(s),null;case 19:if(z(vn),h=s.memoizedState,h===null)return en(s),null;if(b=(s.flags&128)!==0,_=h.rendering,_===null)if(b)Il(h,!1);else{if(pn!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(_=zu(r),_!==null){for(s.flags|=128,Il(h,!1),r=_.updateQueue,s.updateQueue=r,Wu(s,r),s.subtreeFlags=0,r=c,c=s.child;c!==null;)Av(c,r),c=c.sibling;return V(vn,vn.current&1|2),wt&&Ir(s,h.treeForkCount),s.child}r=r.sibling}h.tail!==null&&zt()>Ju&&(s.flags|=128,b=!0,Il(h,!1),s.lanes=4194304)}else{if(!b)if(r=zu(_),r!==null){if(s.flags|=128,b=!0,r=r.updateQueue,s.updateQueue=r,Wu(s,r),Il(h,!0),h.tail===null&&h.tailMode==="hidden"&&!_.alternate&&!wt)return en(s),null}else 2*zt()-h.renderingStartTime>Ju&&c!==536870912&&(s.flags|=128,b=!0,Il(h,!1),s.lanes=4194304);h.isBackwards?(_.sibling=s.child,s.child=_):(r=h.last,r!==null?r.sibling=_:s.child=_,h.last=_)}return h.tail!==null?(r=h.tail,h.rendering=r,h.tail=r.sibling,h.renderingStartTime=zt(),r.sibling=null,c=vn.current,V(vn,b?c&1|2:c&1),wt&&Ir(s,h.treeForkCount),r):(en(s),null);case 22:case 23:return go(s),rm(),h=s.memoizedState!==null,r!==null?r.memoizedState!==null!==h&&(s.flags|=8192):h&&(s.flags|=8192),h?(c&536870912)!==0&&(s.flags&128)===0&&(en(s),s.subtreeFlags&6&&(s.flags|=8192)):en(s),c=s.updateQueue,c!==null&&Wu(s,c.retryQueue),c=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==c&&(s.flags|=2048),r!==null&&z(ms),null;case 24:return c=null,r!==null&&(c=r.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),$r(wn),en(s),null;case 25:return null;case 30:return null}throw Error(o(156,s.tag))}function fD(r,s){switch(Fh(s),s.tag){case 1:return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return $r(wn),ae(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 26:case 27:case 5:return ge(s),null;case 31:if(s.memoizedState!==null){if(go(s),s.alternate===null)throw Error(o(340));ds()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 13:if(go(s),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(o(340));ds()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return z(vn),null;case 4:return ae(),null;case 10:return $r(s.type),null;case 22:case 23:return go(s),rm(),r!==null&&z(ms),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 24:return $r(wn),null;case 25:return null;default:return null}}function s1(r,s){switch(Fh(s),s.tag){case 3:$r(wn),ae();break;case 26:case 27:case 5:ge(s);break;case 4:ae();break;case 31:s.memoizedState!==null&&go(s);break;case 13:go(s);break;case 19:z(vn);break;case 10:$r(s.type);break;case 22:case 23:go(s),rm(),r!==null&&z(ms);break;case 24:$r(wn)}}function Pl(r,s){try{var c=s.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var b=h.next;c=b;do{if((c.tag&r)===r){h=void 0;var _=c.create,O=c.inst;h=_(),O.destroy=h}c=c.next}while(c!==b)}}catch(F){Ht(s,s.return,F)}}function Ea(r,s,c){try{var h=s.updateQueue,b=h!==null?h.lastEffect:null;if(b!==null){var _=b.next;h=_;do{if((h.tag&r)===r){var O=h.inst,F=O.destroy;if(F!==void 0){O.destroy=void 0,b=s;var te=c,fe=F;try{fe()}catch(pe){Ht(b,te,pe)}}}h=h.next}while(h!==_)}}catch(pe){Ht(s,s.return,pe)}}function i1(r){var s=r.updateQueue;if(s!==null){var c=r.stateNode;try{Zv(s,c)}catch(h){Ht(r,r.return,h)}}}function l1(r,s,c){c.props=xs(r.type,r.memoizedProps),c.state=r.memoizedState;try{c.componentWillUnmount()}catch(h){Ht(r,s,h)}}function $l(r,s){try{var c=r.ref;if(c!==null){switch(r.tag){case 26:case 27:case 5:var h=r.stateNode;break;case 30:h=r.stateNode;break;default:h=r.stateNode}typeof c=="function"?r.refCleanup=c(h):c.current=h}}catch(b){Ht(r,s,b)}}function ur(r,s){var c=r.ref,h=r.refCleanup;if(c!==null)if(typeof h=="function")try{h()}catch(b){Ht(r,s,b)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(b){Ht(r,s,b)}else c.current=null}function c1(r){var s=r.type,c=r.memoizedProps,h=r.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":c.autoFocus&&h.focus();break e;case"img":c.src?h.src=c.src:c.srcSet&&(h.srcset=c.srcSet)}}catch(b){Ht(r,r.return,b)}}function Im(r,s,c){try{var h=r.stateNode;jD(h,r.type,c,s),h[Tn]=s}catch(b){Ht(r,r.return,b)}}function u1(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&ka(r.type)||r.tag===4}function Pm(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||u1(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&ka(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function $m(r,s,c){var h=r.tag;if(h===5||h===6)r=r.stateNode,s?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(r,s):(s=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,s.appendChild(r),c=c._reactRootContainer,c!=null||s.onclick!==null||(s.onclick=Ar));else if(h!==4&&(h===27&&ka(r.type)&&(c=r.stateNode,s=null),r=r.child,r!==null))for($m(r,s,c),r=r.sibling;r!==null;)$m(r,s,c),r=r.sibling}function Ku(r,s,c){var h=r.tag;if(h===5||h===6)r=r.stateNode,s?c.insertBefore(r,s):c.appendChild(r);else if(h!==4&&(h===27&&ka(r.type)&&(c=r.stateNode),r=r.child,r!==null))for(Ku(r,s,c),r=r.sibling;r!==null;)Ku(r,s,c),r=r.sibling}function d1(r){var s=r.stateNode,c=r.memoizedProps;try{for(var h=r.type,b=s.attributes;b.length;)s.removeAttributeNode(b[0]);Vn(s,h,c),s[dn]=r,s[Tn]=c}catch(_){Ht(r,r.return,_)}}var Fr=!1,En=!1,Lm=!1,f1=typeof WeakSet=="function"?WeakSet:Set,zn=null;function hD(r,s){if(r=r.containerInfo,sg=pd,r=Ev(r),Oh(r)){if("selectionStart"in r)var c={start:r.selectionStart,end:r.selectionEnd};else e:{c=(c=r.ownerDocument)&&c.defaultView||window;var h=c.getSelection&&c.getSelection();if(h&&h.rangeCount!==0){c=h.anchorNode;var b=h.anchorOffset,_=h.focusNode;h=h.focusOffset;try{c.nodeType,_.nodeType}catch{c=null;break e}var O=0,F=-1,te=-1,fe=0,pe=0,Ee=r,he=null;t:for(;;){for(var me;Ee!==c||b!==0&&Ee.nodeType!==3||(F=O+b),Ee!==_||h!==0&&Ee.nodeType!==3||(te=O+h),Ee.nodeType===3&&(O+=Ee.nodeValue.length),(me=Ee.firstChild)!==null;)he=Ee,Ee=me;for(;;){if(Ee===r)break t;if(he===c&&++fe===b&&(F=O),he===_&&++pe===h&&(te=O),(me=Ee.nextSibling)!==null)break;Ee=he,he=Ee.parentNode}Ee=me}c=F===-1||te===-1?null:{start:F,end:te}}else c=null}c=c||{start:0,end:0}}else c=null;for(ig={focusedElem:r,selectionRange:c},pd=!1,zn=s;zn!==null;)if(s=zn,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,zn=r;else for(;zn!==null;){switch(s=zn,_=s.alternate,r=s.flags,s.tag){case 0:if((r&4)!==0&&(r=s.updateQueue,r=r!==null?r.events:null,r!==null))for(c=0;c<r.length;c++)b=r[c],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&_!==null){r=void 0,c=s,b=_.memoizedProps,_=_.memoizedState,h=c.stateNode;try{var $e=xs(c.type,b);r=h.getSnapshotBeforeUpdate($e,_),h.__reactInternalSnapshotBeforeUpdate=r}catch(Ke){Ht(c,c.return,Ke)}}break;case 3:if((r&1024)!==0){if(r=s.stateNode.containerInfo,c=r.nodeType,c===9)ug(r);else if(c===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":ug(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(o(163))}if(r=s.sibling,r!==null){r.return=s.return,zn=r;break}zn=s.return}}function h1(r,s,c){var h=c.flags;switch(c.tag){case 0:case 11:case 15:Yr(r,c),h&4&&Pl(5,c);break;case 1:if(Yr(r,c),h&4)if(r=c.stateNode,s===null)try{r.componentDidMount()}catch(O){Ht(c,c.return,O)}else{var b=xs(c.type,s.memoizedProps);s=s.memoizedState;try{r.componentDidUpdate(b,s,r.__reactInternalSnapshotBeforeUpdate)}catch(O){Ht(c,c.return,O)}}h&64&&i1(c),h&512&&$l(c,c.return);break;case 3:if(Yr(r,c),h&64&&(r=c.updateQueue,r!==null)){if(s=null,c.child!==null)switch(c.child.tag){case 27:case 5:s=c.child.stateNode;break;case 1:s=c.child.stateNode}try{Zv(r,s)}catch(O){Ht(c,c.return,O)}}break;case 27:s===null&&h&4&&d1(c);case 26:case 5:Yr(r,c),s===null&&h&4&&c1(c),h&512&&$l(c,c.return);break;case 12:Yr(r,c);break;case 31:Yr(r,c),h&4&&p1(r,c);break;case 13:Yr(r,c),h&4&&y1(r,c),h&64&&(r=c.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(c=SD.bind(null,c),VD(r,c))));break;case 22:if(h=c.memoizedState!==null||Fr,!h){s=s!==null&&s.memoizedState!==null||En,b=Fr;var _=En;Fr=h,(En=s)&&!_?Gr(r,c,(c.subtreeFlags&8772)!==0):Yr(r,c),Fr=b,En=_}break;case 30:break;default:Yr(r,c)}}function m1(r){var s=r.alternate;s!==null&&(r.alternate=null,m1(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&ye(s)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var on=null,to=!1;function Ur(r,s,c){for(c=c.child;c!==null;)g1(r,s,c),c=c.sibling}function g1(r,s,c){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(at,c)}catch{}switch(c.tag){case 26:En||ur(c,s),Ur(r,s,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:En||ur(c,s);var h=on,b=to;ka(c.type)&&(on=c.stateNode,to=!1),Ur(r,s,c),ql(c.stateNode),on=h,to=b;break;case 5:En||ur(c,s);case 6:if(h=on,b=to,on=null,Ur(r,s,c),on=h,to=b,on!==null)if(to)try{(on.nodeType===9?on.body:on.nodeName==="HTML"?on.ownerDocument.body:on).removeChild(c.stateNode)}catch(_){Ht(c,s,_)}else try{on.removeChild(c.stateNode)}catch(_){Ht(c,s,_)}break;case 18:on!==null&&(to?(r=on,ib(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,c.stateNode),vi(r)):ib(on,c.stateNode));break;case 4:h=on,b=to,on=c.stateNode.containerInfo,to=!0,Ur(r,s,c),on=h,to=b;break;case 0:case 11:case 14:case 15:Ea(2,c,s),En||Ea(4,c,s),Ur(r,s,c);break;case 1:En||(ur(c,s),h=c.stateNode,typeof h.componentWillUnmount=="function"&&l1(c,s,h)),Ur(r,s,c);break;case 21:Ur(r,s,c);break;case 22:En=(h=En)||c.memoizedState!==null,Ur(r,s,c),En=h;break;default:Ur(r,s,c)}}function p1(r,s){if(s.memoizedState===null&&(r=s.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{vi(r)}catch(c){Ht(s,s.return,c)}}}function y1(r,s){if(s.memoizedState===null&&(r=s.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{vi(r)}catch(c){Ht(s,s.return,c)}}function mD(r){switch(r.tag){case 31:case 13:case 19:var s=r.stateNode;return s===null&&(s=r.stateNode=new f1),s;case 22:return r=r.stateNode,s=r._retryCache,s===null&&(s=r._retryCache=new f1),s;default:throw Error(o(435,r.tag))}}function Xu(r,s){var c=mD(r);s.forEach(function(h){if(!c.has(h)){c.add(h);var b=CD.bind(null,r,h);h.then(b,b)}})}function no(r,s){var c=s.deletions;if(c!==null)for(var h=0;h<c.length;h++){var b=c[h],_=r,O=s,F=O;e:for(;F!==null;){switch(F.tag){case 27:if(ka(F.type)){on=F.stateNode,to=!1;break e}break;case 5:on=F.stateNode,to=!1;break e;case 3:case 4:on=F.stateNode.containerInfo,to=!0;break e}F=F.return}if(on===null)throw Error(o(160));g1(_,O,b),on=null,to=!1,_=b.alternate,_!==null&&(_.return=null),b.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)v1(s,r),s=s.sibling}var Go=null;function v1(r,s){var c=r.alternate,h=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:no(s,r),oo(r),h&4&&(Ea(3,r,r.return),Pl(3,r),Ea(5,r,r.return));break;case 1:no(s,r),oo(r),h&512&&(En||c===null||ur(c,c.return)),h&64&&Fr&&(r=r.updateQueue,r!==null&&(h=r.callbacks,h!==null&&(c=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=c===null?h:c.concat(h))));break;case 26:var b=Go;if(no(s,r),oo(r),h&512&&(En||c===null||ur(c,c.return)),h&4){var _=c!==null?c.memoizedState:null;if(h=r.memoizedState,c===null)if(h===null)if(r.stateNode===null){e:{h=r.type,c=r.memoizedProps,b=b.ownerDocument||b;t:switch(h){case"title":_=b.getElementsByTagName("title")[0],(!_||_[le]||_[dn]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=b.createElement(h),b.head.insertBefore(_,b.querySelector("head > title"))),Vn(_,h,c),_[dn]=r,Se(_),h=_;break e;case"link":var O=vb("link","href",b).get(h+(c.href||""));if(O){for(var F=0;F<O.length;F++)if(_=O[F],_.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&_.getAttribute("rel")===(c.rel==null?null:c.rel)&&_.getAttribute("title")===(c.title==null?null:c.title)&&_.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){O.splice(F,1);break t}}_=b.createElement(h),Vn(_,h,c),b.head.appendChild(_);break;case"meta":if(O=vb("meta","content",b).get(h+(c.content||""))){for(F=0;F<O.length;F++)if(_=O[F],_.getAttribute("content")===(c.content==null?null:""+c.content)&&_.getAttribute("name")===(c.name==null?null:c.name)&&_.getAttribute("property")===(c.property==null?null:c.property)&&_.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&_.getAttribute("charset")===(c.charSet==null?null:c.charSet)){O.splice(F,1);break t}}_=b.createElement(h),Vn(_,h,c),b.head.appendChild(_);break;default:throw Error(o(468,h))}_[dn]=r,Se(_),h=_}r.stateNode=h}else xb(b,r.type,r.stateNode);else r.stateNode=yb(b,h,r.memoizedProps);else _!==h?(_===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):_.count--,h===null?xb(b,r.type,r.stateNode):yb(b,h,r.memoizedProps)):h===null&&r.stateNode!==null&&Im(r,r.memoizedProps,c.memoizedProps)}break;case 27:no(s,r),oo(r),h&512&&(En||c===null||ur(c,c.return)),c!==null&&h&4&&Im(r,r.memoizedProps,c.memoizedProps);break;case 5:if(no(s,r),oo(r),h&512&&(En||c===null||ur(c,c.return)),r.flags&32){b=r.stateNode;try{Nt(b,"")}catch($e){Ht(r,r.return,$e)}}h&4&&r.stateNode!=null&&(b=r.memoizedProps,Im(r,b,c!==null?c.memoizedProps:b)),h&1024&&(Lm=!0);break;case 6:if(no(s,r),oo(r),h&4){if(r.stateNode===null)throw Error(o(162));h=r.memoizedProps,c=r.stateNode;try{c.nodeValue=h}catch($e){Ht(r,r.return,$e)}}break;case 3:if(fd=null,b=Go,Go=ud(s.containerInfo),no(s,r),Go=b,oo(r),h&4&&c!==null&&c.memoizedState.isDehydrated)try{vi(s.containerInfo)}catch($e){Ht(r,r.return,$e)}Lm&&(Lm=!1,x1(r));break;case 4:h=Go,Go=ud(r.stateNode.containerInfo),no(s,r),oo(r),Go=h;break;case 12:no(s,r),oo(r);break;case 31:no(s,r),oo(r),h&4&&(h=r.updateQueue,h!==null&&(r.updateQueue=null,Xu(r,h)));break;case 13:no(s,r),oo(r),r.child.flags&8192&&r.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Qu=zt()),h&4&&(h=r.updateQueue,h!==null&&(r.updateQueue=null,Xu(r,h)));break;case 22:b=r.memoizedState!==null;var te=c!==null&&c.memoizedState!==null,fe=Fr,pe=En;if(Fr=fe||b,En=pe||te,no(s,r),En=pe,Fr=fe,oo(r),h&8192)e:for(s=r.stateNode,s._visibility=b?s._visibility&-2:s._visibility|1,b&&(c===null||te||Fr||En||bs(r)),c=null,s=r;;){if(s.tag===5||s.tag===26){if(c===null){te=c=s;try{if(_=te.stateNode,b)O=_.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{F=te.stateNode;var Ee=te.memoizedProps.style,he=Ee!=null&&Ee.hasOwnProperty("display")?Ee.display:null;F.style.display=he==null||typeof he=="boolean"?"":(""+he).trim()}}catch($e){Ht(te,te.return,$e)}}}else if(s.tag===6){if(c===null){te=s;try{te.stateNode.nodeValue=b?"":te.memoizedProps}catch($e){Ht(te,te.return,$e)}}}else if(s.tag===18){if(c===null){te=s;try{var me=te.stateNode;b?lb(me,!0):lb(te.stateNode,!1)}catch($e){Ht(te,te.return,$e)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===r)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break e;for(;s.sibling===null;){if(s.return===null||s.return===r)break e;c===s&&(c=null),s=s.return}c===s&&(c=null),s.sibling.return=s.return,s=s.sibling}h&4&&(h=r.updateQueue,h!==null&&(c=h.retryQueue,c!==null&&(h.retryQueue=null,Xu(r,c))));break;case 19:no(s,r),oo(r),h&4&&(h=r.updateQueue,h!==null&&(r.updateQueue=null,Xu(r,h)));break;case 30:break;case 21:break;default:no(s,r),oo(r)}}function oo(r){var s=r.flags;if(s&2){try{for(var c,h=r.return;h!==null;){if(u1(h)){c=h;break}h=h.return}if(c==null)throw Error(o(160));switch(c.tag){case 27:var b=c.stateNode,_=Pm(r);Ku(r,_,b);break;case 5:var O=c.stateNode;c.flags&32&&(Nt(O,""),c.flags&=-33);var F=Pm(r);Ku(r,F,O);break;case 3:case 4:var te=c.stateNode.containerInfo,fe=Pm(r);$m(r,fe,te);break;default:throw Error(o(161))}}catch(pe){Ht(r,r.return,pe)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function x1(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var s=r;x1(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),r=r.sibling}}function Yr(r,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)h1(r,s.alternate,s),s=s.sibling}function bs(r){for(r=r.child;r!==null;){var s=r;switch(s.tag){case 0:case 11:case 14:case 15:Ea(4,s,s.return),bs(s);break;case 1:ur(s,s.return);var c=s.stateNode;typeof c.componentWillUnmount=="function"&&l1(s,s.return,c),bs(s);break;case 27:ql(s.stateNode);case 26:case 5:ur(s,s.return),bs(s);break;case 22:s.memoizedState===null&&bs(s);break;case 30:bs(s);break;default:bs(s)}r=r.sibling}}function Gr(r,s,c){for(c=c&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var h=s.alternate,b=r,_=s,O=_.flags;switch(_.tag){case 0:case 11:case 15:Gr(b,_,c),Pl(4,_);break;case 1:if(Gr(b,_,c),h=_,b=h.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(fe){Ht(h,h.return,fe)}if(h=_,b=h.updateQueue,b!==null){var F=h.stateNode;try{var te=b.shared.hiddenCallbacks;if(te!==null)for(b.shared.hiddenCallbacks=null,b=0;b<te.length;b++)Xv(te[b],F)}catch(fe){Ht(h,h.return,fe)}}c&&O&64&&i1(_),$l(_,_.return);break;case 27:d1(_);case 26:case 5:Gr(b,_,c),c&&h===null&&O&4&&c1(_),$l(_,_.return);break;case 12:Gr(b,_,c);break;case 31:Gr(b,_,c),c&&O&4&&p1(b,_);break;case 13:Gr(b,_,c),c&&O&4&&y1(b,_);break;case 22:_.memoizedState===null&&Gr(b,_,c),$l(_,_.return);break;case 30:break;default:Gr(b,_,c)}s=s.sibling}}function Hm(r,s){var c=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),r=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(r=s.memoizedState.cachePool.pool),r!==c&&(r!=null&&r.refCount++,c!=null&&El(c))}function Bm(r,s){r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&El(r))}function qo(r,s,c,h){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)b1(r,s,c,h),s=s.sibling}function b1(r,s,c,h){var b=s.flags;switch(s.tag){case 0:case 11:case 15:qo(r,s,c,h),b&2048&&Pl(9,s);break;case 1:qo(r,s,c,h);break;case 3:qo(r,s,c,h),b&2048&&(r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&El(r)));break;case 12:if(b&2048){qo(r,s,c,h),r=s.stateNode;try{var _=s.memoizedProps,O=_.id,F=_.onPostCommit;typeof F=="function"&&F(O,s.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(te){Ht(s,s.return,te)}}else qo(r,s,c,h);break;case 31:qo(r,s,c,h);break;case 13:qo(r,s,c,h);break;case 23:break;case 22:_=s.stateNode,O=s.alternate,s.memoizedState!==null?_._visibility&2?qo(r,s,c,h):Ll(r,s):_._visibility&2?qo(r,s,c,h):(_._visibility|=2,ii(r,s,c,h,(s.subtreeFlags&10256)!==0||!1)),b&2048&&Hm(O,s);break;case 24:qo(r,s,c,h),b&2048&&Bm(s.alternate,s);break;default:qo(r,s,c,h)}}function ii(r,s,c,h,b){for(b=b&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var _=r,O=s,F=c,te=h,fe=O.flags;switch(O.tag){case 0:case 11:case 15:ii(_,O,F,te,b),Pl(8,O);break;case 23:break;case 22:var pe=O.stateNode;O.memoizedState!==null?pe._visibility&2?ii(_,O,F,te,b):Ll(_,O):(pe._visibility|=2,ii(_,O,F,te,b)),b&&fe&2048&&Hm(O.alternate,O);break;case 24:ii(_,O,F,te,b),b&&fe&2048&&Bm(O.alternate,O);break;default:ii(_,O,F,te,b)}s=s.sibling}}function Ll(r,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var c=r,h=s,b=h.flags;switch(h.tag){case 22:Ll(c,h),b&2048&&Hm(h.alternate,h);break;case 24:Ll(c,h),b&2048&&Bm(h.alternate,h);break;default:Ll(c,h)}s=s.sibling}}var Hl=8192;function li(r,s,c){if(r.subtreeFlags&Hl)for(r=r.child;r!==null;)w1(r,s,c),r=r.sibling}function w1(r,s,c){switch(r.tag){case 26:li(r,s,c),r.flags&Hl&&r.memoizedState!==null&&e4(c,Go,r.memoizedState,r.memoizedProps);break;case 5:li(r,s,c);break;case 3:case 4:var h=Go;Go=ud(r.stateNode.containerInfo),li(r,s,c),Go=h;break;case 22:r.memoizedState===null&&(h=r.alternate,h!==null&&h.memoizedState!==null?(h=Hl,Hl=16777216,li(r,s,c),Hl=h):li(r,s,c));break;default:li(r,s,c)}}function S1(r){var s=r.alternate;if(s!==null&&(r=s.child,r!==null)){s.child=null;do s=r.sibling,r.sibling=null,r=s;while(r!==null)}}function Bl(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var c=0;c<s.length;c++){var h=s[c];zn=h,E1(h,r)}S1(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)C1(r),r=r.sibling}function C1(r){switch(r.tag){case 0:case 11:case 15:Bl(r),r.flags&2048&&Ea(9,r,r.return);break;case 3:Bl(r);break;case 12:Bl(r);break;case 22:var s=r.stateNode;r.memoizedState!==null&&s._visibility&2&&(r.return===null||r.return.tag!==13)?(s._visibility&=-3,Zu(r)):Bl(r);break;default:Bl(r)}}function Zu(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var c=0;c<s.length;c++){var h=s[c];zn=h,E1(h,r)}S1(r)}for(r=r.child;r!==null;){switch(s=r,s.tag){case 0:case 11:case 15:Ea(8,s,s.return),Zu(s);break;case 22:c=s.stateNode,c._visibility&2&&(c._visibility&=-3,Zu(s));break;default:Zu(s)}r=r.sibling}}function E1(r,s){for(;zn!==null;){var c=zn;switch(c.tag){case 0:case 11:case 15:Ea(8,c,s);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var h=c.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:El(c.memoizedState.cache)}if(h=c.child,h!==null)h.return=c,zn=h;else e:for(c=r;zn!==null;){h=zn;var b=h.sibling,_=h.return;if(m1(h),h===c){zn=null;break e}if(b!==null){b.return=_,zn=b;break e}zn=_}}}var gD={getCacheForType:function(r){var s=Hn(wn),c=s.data.get(r);return c===void 0&&(c=r(),s.data.set(r,c)),c},cacheSignal:function(){return Hn(wn).controller.signal}},pD=typeof WeakMap=="function"?WeakMap:Map,jt=0,Zt=null,pt=null,xt=0,Lt=0,po=null,_a=!1,ci=!1,Vm=!1,qr=0,pn=0,Ma=0,ws=0,Fm=0,yo=0,ui=0,Vl=null,ro=null,Um=!1,Qu=0,_1=0,Ju=1/0,ed=null,Na=null,On=0,Ra=null,di=null,Wr=0,Ym=0,Gm=null,M1=null,Fl=0,qm=null;function vo(){return(jt&2)!==0&&xt!==0?xt&-xt:j.T!==null?Jm():lo()}function N1(){if(yo===0)if((xt&536870912)===0||wt){var r=Ye;Ye<<=1,(Ye&3932160)===0&&(Ye=262144),yo=r}else yo=536870912;return r=mo.current,r!==null&&(r.flags|=32),yo}function ao(r,s,c){(r===Zt&&(Lt===2||Lt===9)||r.cancelPendingCommit!==null)&&(fi(r,0),Da(r,xt,yo,!1)),Dt(r,c),((jt&2)===0||r!==Zt)&&(r===Zt&&((jt&2)===0&&(ws|=c),pn===4&&Da(r,xt,yo,!1)),dr(r))}function R1(r,s,c){if((jt&6)!==0)throw Error(o(327));var h=!c&&(s&127)===0&&(s&r.expiredLanes)===0||Ot(r,s),b=h?xD(r,s):Km(r,s,!0),_=h;do{if(b===0){ci&&!h&&Da(r,s,0,!1);break}else{if(c=r.current.alternate,_&&!yD(c)){b=Km(r,s,!1),_=!1;continue}if(b===2){if(_=s,r.errorRecoveryDisabledLanes&_)var O=0;else O=r.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){s=O;e:{var F=r;b=Vl;var te=F.current.memoizedState.isDehydrated;if(te&&(fi(F,O).flags|=256),O=Km(F,O,!1),O!==2){if(Vm&&!te){F.errorRecoveryDisabledLanes|=_,ws|=_,b=4;break e}_=ro,ro=b,_!==null&&(ro===null?ro=_:ro.push.apply(ro,_))}b=O}if(_=!1,b!==2)continue}}if(b===1){fi(r,0),Da(r,s,0,!0);break}e:{switch(h=r,_=b,_){case 0:case 1:throw Error(o(345));case 4:if((s&4194048)!==s)break;case 6:Da(h,s,yo,!_a);break e;case 2:ro=null;break;case 3:case 5:break;default:throw Error(o(329))}if((s&62914560)===s&&(b=Qu+300-zt(),10<b)){if(Da(h,s,yo,!_a),Te(h,0,!0)!==0)break e;Wr=s,h.timeoutHandle=ab(D1.bind(null,h,c,ro,ed,Um,s,yo,ws,ui,_a,_,"Throttled",-0,0),b);break e}D1(h,c,ro,ed,Um,s,yo,ws,ui,_a,_,null,-0,0)}}break}while(!0);dr(r)}function D1(r,s,c,h,b,_,O,F,te,fe,pe,Ee,he,me){if(r.timeoutHandle=-1,Ee=s.subtreeFlags,Ee&8192||(Ee&16785408)===16785408){Ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ar},w1(s,_,Ee);var $e=(_&62914560)===_?Qu-zt():(_&4194048)===_?_1-zt():0;if($e=t4(Ee,$e),$e!==null){Wr=_,r.cancelPendingCommit=$e(P1.bind(null,r,s,_,c,h,b,O,F,te,pe,Ee,null,he,me)),Da(r,_,O,!fe);return}}P1(r,s,_,c,h,b,O,F,te)}function yD(r){for(var s=r;;){var c=s.tag;if((c===0||c===11||c===15)&&s.flags&16384&&(c=s.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var h=0;h<c.length;h++){var b=c[h],_=b.getSnapshot;b=b.value;try{if(!fo(_(),b))return!1}catch{return!1}}if(c=s.child,s.subtreeFlags&16384&&c!==null)c.return=s,s=c;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Da(r,s,c,h){s&=~Fm,s&=~ws,r.suspendedLanes|=s,r.pingedLanes&=~s,h&&(r.warmLanes|=s),h=r.expirationTimes;for(var b=s;0<b;){var _=31-Wt(b),O=1<<_;h[_]=-1,b&=~O}c!==0&&Uo(r,c,s)}function td(){return(jt&6)===0?(Ul(0),!1):!0}function Wm(){if(pt!==null){if(Lt===0)var r=pt.return;else r=pt,Pr=fs=null,um(r),ni=null,Ml=0,r=pt;for(;r!==null;)s1(r.alternate,r),r=r.return;pt=null}}function fi(r,s){var c=r.timeoutHandle;c!==-1&&(r.timeoutHandle=-1,PD(c)),c=r.cancelPendingCommit,c!==null&&(r.cancelPendingCommit=null,c()),Wr=0,Wm(),Zt=r,pt=c=zr(r.current,null),xt=s,Lt=0,po=null,_a=!1,ci=Ot(r,s),Vm=!1,ui=yo=Fm=ws=Ma=pn=0,ro=Vl=null,Um=!1,(s&8)!==0&&(s|=s&32);var h=r.entangledLanes;if(h!==0)for(r=r.entanglements,h&=s;0<h;){var b=31-Wt(h),_=1<<b;s|=r[b],h&=~_}return qr=s,Su(),c}function T1(r,s){ut=null,j.H=jl,s===ti||s===Tu?(s=Gv(),Lt=3):s===Qh?(s=Gv(),Lt=4):Lt=s===Mm?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,po=s,pt===null&&(pn=1,Uu(r,Oo(s,r.current)))}function k1(){var r=mo.current;return r===null?!0:(xt&4194048)===xt?Io===null:(xt&62914560)===xt||(xt&536870912)!==0?r===Io:!1}function O1(){var r=j.H;return j.H=jl,r===null?jl:r}function A1(){var r=j.A;return j.A=gD,r}function nd(){pn=4,_a||(xt&4194048)!==xt&&mo.current!==null||(ci=!0),(Ma&134217727)===0&&(ws&134217727)===0||Zt===null||Da(Zt,xt,yo,!1)}function Km(r,s,c){var h=jt;jt|=2;var b=O1(),_=A1();(Zt!==r||xt!==s)&&(ed=null,fi(r,s)),s=!1;var O=pn;e:do try{if(Lt!==0&&pt!==null){var F=pt,te=po;switch(Lt){case 8:Wm(),O=6;break e;case 3:case 2:case 9:case 6:mo.current===null&&(s=!0);var fe=Lt;if(Lt=0,po=null,hi(r,F,te,fe),c&&ci){O=0;break e}break;default:fe=Lt,Lt=0,po=null,hi(r,F,te,fe)}}vD(),O=pn;break}catch(pe){T1(r,pe)}while(!0);return s&&r.shellSuspendCounter++,Pr=fs=null,jt=h,j.H=b,j.A=_,pt===null&&(Zt=null,xt=0,Su()),O}function vD(){for(;pt!==null;)j1(pt)}function xD(r,s){var c=jt;jt|=2;var h=O1(),b=A1();Zt!==r||xt!==s?(ed=null,Ju=zt()+500,fi(r,s)):ci=Ot(r,s);e:do try{if(Lt!==0&&pt!==null){s=pt;var _=po;t:switch(Lt){case 1:Lt=0,po=null,hi(r,s,_,1);break;case 2:case 9:if(Uv(_)){Lt=0,po=null,z1(s);break}s=function(){Lt!==2&&Lt!==9||Zt!==r||(Lt=7),dr(r)},_.then(s,s);break e;case 3:Lt=7;break e;case 4:Lt=5;break e;case 7:Uv(_)?(Lt=0,po=null,z1(s)):(Lt=0,po=null,hi(r,s,_,7));break;case 5:var O=null;switch(pt.tag){case 26:O=pt.memoizedState;case 5:case 27:var F=pt;if(O?bb(O):F.stateNode.complete){Lt=0,po=null;var te=F.sibling;if(te!==null)pt=te;else{var fe=F.return;fe!==null?(pt=fe,od(fe)):pt=null}break t}}Lt=0,po=null,hi(r,s,_,5);break;case 6:Lt=0,po=null,hi(r,s,_,6);break;case 8:Wm(),pn=6;break e;default:throw Error(o(462))}}bD();break}catch(pe){T1(r,pe)}while(!0);return Pr=fs=null,j.H=h,j.A=b,jt=c,pt!==null?0:(Zt=null,xt=0,Su(),pn)}function bD(){for(;pt!==null&&!Vt();)j1(pt)}function j1(r){var s=r1(r.alternate,r,qr);r.memoizedProps=r.pendingProps,s===null?od(r):pt=s}function z1(r){var s=r,c=s.alternate;switch(s.tag){case 15:case 0:s=Qx(c,s,s.pendingProps,s.type,void 0,xt);break;case 11:s=Qx(c,s,s.pendingProps,s.type.render,s.ref,xt);break;case 5:um(s);default:s1(c,s),s=pt=Av(s,qr),s=r1(c,s,qr)}r.memoizedProps=r.pendingProps,s===null?od(r):pt=s}function hi(r,s,c,h){Pr=fs=null,um(s),ni=null,Ml=0;var b=s.return;try{if(lD(r,b,s,c,xt)){pn=1,Uu(r,Oo(c,r.current)),pt=null;return}}catch(_){if(b!==null)throw pt=b,_;pn=1,Uu(r,Oo(c,r.current)),pt=null;return}s.flags&32768?(wt||h===1?r=!0:ci||(xt&536870912)!==0?r=!1:(_a=r=!0,(h===2||h===9||h===3||h===6)&&(h=mo.current,h!==null&&h.tag===13&&(h.flags|=16384))),I1(s,r)):od(s)}function od(r){var s=r;do{if((s.flags&32768)!==0){I1(s,_a);return}r=s.return;var c=dD(s.alternate,s,qr);if(c!==null){pt=c;return}if(s=s.sibling,s!==null){pt=s;return}pt=s=r}while(s!==null);pn===0&&(pn=5)}function I1(r,s){do{var c=fD(r.alternate,r);if(c!==null){c.flags&=32767,pt=c;return}if(c=r.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!s&&(r=r.sibling,r!==null)){pt=r;return}pt=r=c}while(r!==null);pn=6,pt=null}function P1(r,s,c,h,b,_,O,F,te){r.cancelPendingCommit=null;do rd();while(On!==0);if((jt&6)!==0)throw Error(o(327));if(s!==null){if(s===r.current)throw Error(o(177));if(_=s.lanes|s.childLanes,_|=Ph,Rn(r,c,_,O,F,te),r===Zt&&(pt=Zt=null,xt=0),di=s,Ra=r,Wr=c,Ym=_,Gm=b,M1=h,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,ED(jn,function(){return V1(),null})):(r.callbackNode=null,r.callbackPriority=0),h=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||h){h=j.T,j.T=null,b=L.p,L.p=2,O=jt,jt|=4;try{hD(r,s,c)}finally{jt=O,L.p=b,j.T=h}}On=1,$1(),L1(),H1()}}function $1(){if(On===1){On=0;var r=Ra,s=di,c=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||c){c=j.T,j.T=null;var h=L.p;L.p=2;var b=jt;jt|=4;try{v1(s,r);var _=ig,O=Ev(r.containerInfo),F=_.focusedElem,te=_.selectionRange;if(O!==F&&F&&F.ownerDocument&&Cv(F.ownerDocument.documentElement,F)){if(te!==null&&Oh(F)){var fe=te.start,pe=te.end;if(pe===void 0&&(pe=fe),"selectionStart"in F)F.selectionStart=fe,F.selectionEnd=Math.min(pe,F.value.length);else{var Ee=F.ownerDocument||document,he=Ee&&Ee.defaultView||window;if(he.getSelection){var me=he.getSelection(),$e=F.textContent.length,Ke=Math.min(te.start,$e),Yt=te.end===void 0?Ke:Math.min(te.end,$e);!me.extend&&Ke>Yt&&(O=Yt,Yt=Ke,Ke=O);var ie=Sv(F,Ke),re=Sv(F,Yt);if(ie&&re&&(me.rangeCount!==1||me.anchorNode!==ie.node||me.anchorOffset!==ie.offset||me.focusNode!==re.node||me.focusOffset!==re.offset)){var ue=Ee.createRange();ue.setStart(ie.node,ie.offset),me.removeAllRanges(),Ke>Yt?(me.addRange(ue),me.extend(re.node,re.offset)):(ue.setEnd(re.node,re.offset),me.addRange(ue))}}}}for(Ee=[],me=F;me=me.parentNode;)me.nodeType===1&&Ee.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof F.focus=="function"&&F.focus(),F=0;F<Ee.length;F++){var Ce=Ee[F];Ce.element.scrollLeft=Ce.left,Ce.element.scrollTop=Ce.top}}pd=!!sg,ig=sg=null}finally{jt=b,L.p=h,j.T=c}}r.current=s,On=2}}function L1(){if(On===2){On=0;var r=Ra,s=di,c=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||c){c=j.T,j.T=null;var h=L.p;L.p=2;var b=jt;jt|=4;try{h1(r,s.alternate,s)}finally{jt=b,L.p=h,j.T=c}}On=3}}function H1(){if(On===4||On===3){On=0,mn();var r=Ra,s=di,c=Wr,h=M1;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?On=5:(On=0,di=Ra=null,B1(r,r.pendingLanes));var b=r.pendingLanes;if(b===0&&(Na=null),Un(c),s=s.stateNode,gt&&typeof gt.onCommitFiberRoot=="function")try{gt.onCommitFiberRoot(at,s,void 0,(s.current.flags&128)===128)}catch{}if(h!==null){s=j.T,b=L.p,L.p=2,j.T=null;try{for(var _=r.onRecoverableError,O=0;O<h.length;O++){var F=h[O];_(F.value,{componentStack:F.stack})}}finally{j.T=s,L.p=b}}(Wr&3)!==0&&rd(),dr(r),b=r.pendingLanes,(c&261930)!==0&&(b&42)!==0?r===qm?Fl++:(Fl=0,qm=r):Fl=0,Ul(0)}}function B1(r,s){(r.pooledCacheLanes&=s)===0&&(s=r.pooledCache,s!=null&&(r.pooledCache=null,El(s)))}function rd(){return $1(),L1(),H1(),V1()}function V1(){if(On!==5)return!1;var r=Ra,s=Ym;Ym=0;var c=Un(Wr),h=j.T,b=L.p;try{L.p=32>c?32:c,j.T=null,c=Gm,Gm=null;var _=Ra,O=Wr;if(On=0,di=Ra=null,Wr=0,(jt&6)!==0)throw Error(o(331));var F=jt;if(jt|=4,C1(_.current),b1(_,_.current,O,c),jt=F,Ul(0,!1),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(at,_)}catch{}return!0}finally{L.p=b,j.T=h,B1(r,s)}}function F1(r,s,c){s=Oo(c,s),s=_m(r.stateNode,s,2),r=wa(r,s,2),r!==null&&(Dt(r,2),dr(r))}function Ht(r,s,c){if(r.tag===3)F1(r,r,c);else for(;s!==null;){if(s.tag===3){F1(s,r,c);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Na===null||!Na.has(h))){r=Oo(c,r),c=Ux(2),h=wa(s,c,2),h!==null&&(Yx(c,h,s,r),Dt(h,2),dr(h));break}}s=s.return}}function Xm(r,s,c){var h=r.pingCache;if(h===null){h=r.pingCache=new pD;var b=new Set;h.set(s,b)}else b=h.get(s),b===void 0&&(b=new Set,h.set(s,b));b.has(c)||(Vm=!0,b.add(c),r=wD.bind(null,r,s,c),s.then(r,r))}function wD(r,s,c){var h=r.pingCache;h!==null&&h.delete(s),r.pingedLanes|=r.suspendedLanes&c,r.warmLanes&=~c,Zt===r&&(xt&c)===c&&(pn===4||pn===3&&(xt&62914560)===xt&&300>zt()-Qu?(jt&2)===0&&fi(r,0):Fm|=c,ui===xt&&(ui=0)),dr(r)}function U1(r,s){s===0&&(s=un()),r=cs(r,s),r!==null&&(Dt(r,s),dr(r))}function SD(r){var s=r.memoizedState,c=0;s!==null&&(c=s.retryLane),U1(r,c)}function CD(r,s){var c=0;switch(r.tag){case 31:case 13:var h=r.stateNode,b=r.memoizedState;b!==null&&(c=b.retryLane);break;case 19:h=r.stateNode;break;case 22:h=r.stateNode._retryCache;break;default:throw Error(o(314))}h!==null&&h.delete(s),U1(r,c)}function ED(r,s){return bn(r,s)}var ad=null,mi=null,Zm=!1,sd=!1,Qm=!1,Ta=0;function dr(r){r!==mi&&r.next===null&&(mi===null?ad=mi=r:mi=mi.next=r),sd=!0,Zm||(Zm=!0,MD())}function Ul(r,s){if(!Qm&&sd){Qm=!0;do for(var c=!1,h=ad;h!==null;){if(r!==0){var b=h.pendingLanes;if(b===0)var _=0;else{var O=h.suspendedLanes,F=h.pingedLanes;_=(1<<31-Wt(42|r)+1)-1,_&=b&~(O&~F),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(c=!0,W1(h,_))}else _=xt,_=Te(h,h===Zt?_:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(_&3)===0||Ot(h,_)||(c=!0,W1(h,_));h=h.next}while(c);Qm=!1}}function _D(){Y1()}function Y1(){sd=Zm=!1;var r=0;Ta!==0&&ID()&&(r=Ta);for(var s=zt(),c=null,h=ad;h!==null;){var b=h.next,_=G1(h,s);_===0?(h.next=null,c===null?ad=b:c.next=b,b===null&&(mi=c)):(c=h,(r!==0||(_&3)!==0)&&(sd=!0)),h=b}On!==0&&On!==5||Ul(r),Ta!==0&&(Ta=0)}function G1(r,s){for(var c=r.suspendedLanes,h=r.pingedLanes,b=r.expirationTimes,_=r.pendingLanes&-62914561;0<_;){var O=31-Wt(_),F=1<<O,te=b[O];te===-1?((F&c)===0||(F&h)!==0)&&(b[O]=Kt(F,s)):te<=s&&(r.expiredLanes|=F),_&=~F}if(s=Zt,c=xt,c=Te(r,r===s?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),h=r.callbackNode,c===0||r===s&&(Lt===2||Lt===9)||r.cancelPendingCommit!==null)return h!==null&&h!==null&&cn(h),r.callbackNode=null,r.callbackPriority=0;if((c&3)===0||Ot(r,c)){if(s=c&-c,s===r.callbackPriority)return s;switch(h!==null&&cn(h),Un(c)){case 2:case 8:c=In;break;case 32:c=jn;break;case 268435456:c=Ue;break;default:c=jn}return h=q1.bind(null,r),c=bn(c,h),r.callbackPriority=s,r.callbackNode=c,s}return h!==null&&h!==null&&cn(h),r.callbackPriority=2,r.callbackNode=null,2}function q1(r,s){if(On!==0&&On!==5)return r.callbackNode=null,r.callbackPriority=0,null;var c=r.callbackNode;if(rd()&&r.callbackNode!==c)return null;var h=xt;return h=Te(r,r===Zt?h:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),h===0?null:(R1(r,h,s),G1(r,zt()),r.callbackNode!=null&&r.callbackNode===c?q1.bind(null,r):null)}function W1(r,s){if(rd())return null;R1(r,s,!0)}function MD(){$D(function(){(jt&6)!==0?bn(yn,_D):Y1()})}function Jm(){if(Ta===0){var r=Js;r===0&&(r=nt,nt<<=1,(nt&261888)===0&&(nt=256)),Ta=r}return Ta}function K1(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:mu(""+r)}function X1(r,s){var c=s.ownerDocument.createElement("input");return c.name=s.name,c.value=s.value,r.id&&c.setAttribute("form",r.id),s.parentNode.insertBefore(c,s),r=new FormData(r),c.parentNode.removeChild(c),r}function ND(r,s,c,h,b){if(s==="submit"&&c&&c.stateNode===b){var _=K1((b[Tn]||null).action),O=h.submitter;O&&(s=(s=O[Tn]||null)?K1(s.formAction):O.getAttribute("formAction"),s!==null&&(_=s,O=null));var F=new vu("action","action",null,h,b);r.push({event:F,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Ta!==0){var te=O?X1(b,O):new FormData(b);xm(c,{pending:!0,data:te,method:b.method,action:_},null,te)}}else typeof _=="function"&&(F.preventDefault(),te=O?X1(b,O):new FormData(b),xm(c,{pending:!0,data:te,method:b.method,action:_},_,te))},currentTarget:b}]})}}for(var eg=0;eg<Ih.length;eg++){var tg=Ih[eg],RD=tg.toLowerCase(),DD=tg[0].toUpperCase()+tg.slice(1);Yo(RD,"on"+DD)}Yo(Nv,"onAnimationEnd"),Yo(Rv,"onAnimationIteration"),Yo(Dv,"onAnimationStart"),Yo("dblclick","onDoubleClick"),Yo("focusin","onFocus"),Yo("focusout","onBlur"),Yo(Y3,"onTransitionRun"),Yo(G3,"onTransitionStart"),Yo(q3,"onTransitionCancel"),Yo(Tv,"onTransitionEnd"),xe("onMouseEnter",["mouseout","mouseover"]),xe("onMouseLeave",["mouseout","mouseover"]),xe("onPointerEnter",["pointerout","pointerover"]),xe("onPointerLeave",["pointerout","pointerover"]),Ae("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ae("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ae("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ae("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ae("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ae("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yl="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(" "),TD=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yl));function Z1(r,s){s=(s&4)!==0;for(var c=0;c<r.length;c++){var h=r[c],b=h.event;h=h.listeners;e:{var _=void 0;if(s)for(var O=h.length-1;0<=O;O--){var F=h[O],te=F.instance,fe=F.currentTarget;if(F=F.listener,te!==_&&b.isPropagationStopped())break e;_=F,b.currentTarget=fe;try{_(b)}catch(pe){wu(pe)}b.currentTarget=null,_=te}else for(O=0;O<h.length;O++){if(F=h[O],te=F.instance,fe=F.currentTarget,F=F.listener,te!==_&&b.isPropagationStopped())break e;_=F,b.currentTarget=fe;try{_(b)}catch(pe){wu(pe)}b.currentTarget=null,_=te}}}}function yt(r,s){var c=s[Tr];c===void 0&&(c=s[Tr]=new Set);var h=r+"__bubble";c.has(h)||(Q1(s,r,2,!1),c.add(h))}function ng(r,s,c){var h=0;s&&(h|=4),Q1(c,r,h,s)}var id="_reactListening"+Math.random().toString(36).slice(2);function og(r){if(!r[id]){r[id]=!0,Re.forEach(function(c){c!=="selectionchange"&&(TD.has(c)||ng(c,!1,r),ng(c,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[id]||(s[id]=!0,ng("selectionchange",!1,s))}}function Q1(r,s,c,h){switch(Nb(s)){case 2:var b=r4;break;case 8:b=a4;break;default:b=vg}c=b.bind(null,s,c,r),b=void 0,!Ch||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(b=!0),h?b!==void 0?r.addEventListener(s,c,{capture:!0,passive:b}):r.addEventListener(s,c,!0):b!==void 0?r.addEventListener(s,c,{passive:b}):r.addEventListener(s,c,!1)}function rg(r,s,c,h,b){var _=h;if((s&1)===0&&(s&2)===0&&h!==null)e:for(;;){if(h===null)return;var O=h.tag;if(O===3||O===4){var F=h.stateNode.containerInfo;if(F===b)break;if(O===4)for(O=h.return;O!==null;){var te=O.tag;if((te===3||te===4)&&O.stateNode.containerInfo===b)return;O=O.return}for(;F!==null;){if(O=we(F),O===null)return;if(te=O.tag,te===5||te===6||te===26||te===27){h=_=O;continue e}F=F.parentNode}}h=h.return}ov(function(){var fe=_,pe=wh(c),Ee=[];e:{var he=kv.get(r);if(he!==void 0){var me=vu,$e=r;switch(r){case"keypress":if(pu(c)===0)break e;case"keydown":case"keyup":me=C3;break;case"focusin":$e="focus",me=Nh;break;case"focusout":$e="blur",me=Nh;break;case"beforeblur":case"afterblur":me=Nh;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":me=sv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=d3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=M3;break;case Nv:case Rv:case Dv:me=m3;break;case Tv:me=R3;break;case"scroll":case"scrollend":me=c3;break;case"wheel":me=T3;break;case"copy":case"cut":case"paste":me=p3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=lv;break;case"toggle":case"beforetoggle":me=O3}var Ke=(s&4)!==0,Yt=!Ke&&(r==="scroll"||r==="scrollend"),ie=Ke?he!==null?he+"Capture":null:he;Ke=[];for(var re=fe,ue;re!==null;){var Ce=re;if(ue=Ce.stateNode,Ce=Ce.tag,Ce!==5&&Ce!==26&&Ce!==27||ue===null||ie===null||(Ce=hl(re,ie),Ce!=null&&Ke.push(Gl(re,Ce,ue))),Yt)break;re=re.return}0<Ke.length&&(he=new me(he,$e,null,c,pe),Ee.push({event:he,listeners:Ke}))}}if((s&7)===0){e:{if(he=r==="mouseover"||r==="pointerover",me=r==="mouseout"||r==="pointerout",he&&c!==bh&&($e=c.relatedTarget||c.fromElement)&&(we($e)||$e[To]))break e;if((me||he)&&(he=pe.window===pe?pe:(he=pe.ownerDocument)?he.defaultView||he.parentWindow:window,me?($e=c.relatedTarget||c.toElement,me=fe,$e=$e?we($e):null,$e!==null&&(Yt=i($e),Ke=$e.tag,$e!==Yt||Ke!==5&&Ke!==27&&Ke!==6)&&($e=null)):(me=null,$e=fe),me!==$e)){if(Ke=sv,Ce="onMouseLeave",ie="onMouseEnter",re="mouse",(r==="pointerout"||r==="pointerover")&&(Ke=lv,Ce="onPointerLeave",ie="onPointerEnter",re="pointer"),Yt=me==null?he:Pe(me),ue=$e==null?he:Pe($e),he=new Ke(Ce,re+"leave",me,c,pe),he.target=Yt,he.relatedTarget=ue,Ce=null,we(pe)===fe&&(Ke=new Ke(ie,re+"enter",$e,c,pe),Ke.target=ue,Ke.relatedTarget=Yt,Ce=Ke),Yt=Ce,me&&$e)t:{for(Ke=kD,ie=me,re=$e,ue=0,Ce=ie;Ce;Ce=Ke(Ce))ue++;Ce=0;for(var We=re;We;We=Ke(We))Ce++;for(;0<ue-Ce;)ie=Ke(ie),ue--;for(;0<Ce-ue;)re=Ke(re),Ce--;for(;ue--;){if(ie===re||re!==null&&ie===re.alternate){Ke=ie;break t}ie=Ke(ie),re=Ke(re)}Ke=null}else Ke=null;me!==null&&J1(Ee,he,me,Ke,!1),$e!==null&&Yt!==null&&J1(Ee,Yt,$e,Ke,!0)}}e:{if(he=fe?Pe(fe):window,me=he.nodeName&&he.nodeName.toLowerCase(),me==="select"||me==="input"&&he.type==="file")var Tt=pv;else if(mv(he))if(yv)Tt=V3;else{Tt=H3;var Fe=L3}else me=he.nodeName,!me||me.toLowerCase()!=="input"||he.type!=="checkbox"&&he.type!=="radio"?fe&&xh(fe.elementType)&&(Tt=pv):Tt=B3;if(Tt&&(Tt=Tt(r,fe))){gv(Ee,Tt,c,pe);break e}Fe&&Fe(r,he,fe),r==="focusout"&&fe&&he.type==="number"&&fe.memoizedProps.value!=null&&as(he,"number",he.value)}switch(Fe=fe?Pe(fe):window,r){case"focusin":(mv(Fe)||Fe.contentEditable==="true")&&(Ys=Fe,Ah=fe,wl=null);break;case"focusout":wl=Ah=Ys=null;break;case"mousedown":jh=!0;break;case"contextmenu":case"mouseup":case"dragend":jh=!1,_v(Ee,c,pe);break;case"selectionchange":if(U3)break;case"keydown":case"keyup":_v(Ee,c,pe)}var dt;if(Dh)e:{switch(r){case"compositionstart":var bt="onCompositionStart";break e;case"compositionend":bt="onCompositionEnd";break e;case"compositionupdate":bt="onCompositionUpdate";break e}bt=void 0}else Us?fv(r,c)&&(bt="onCompositionEnd"):r==="keydown"&&c.keyCode===229&&(bt="onCompositionStart");bt&&(cv&&c.locale!=="ko"&&(Us||bt!=="onCompositionStart"?bt==="onCompositionEnd"&&Us&&(dt=rv()):(ma=pe,Eh="value"in ma?ma.value:ma.textContent,Us=!0)),Fe=ld(fe,bt),0<Fe.length&&(bt=new iv(bt,r,null,c,pe),Ee.push({event:bt,listeners:Fe}),dt?bt.data=dt:(dt=hv(c),dt!==null&&(bt.data=dt)))),(dt=j3?z3(r,c):I3(r,c))&&(bt=ld(fe,"onBeforeInput"),0<bt.length&&(Fe=new iv("onBeforeInput","beforeinput",null,c,pe),Ee.push({event:Fe,listeners:bt}),Fe.data=dt)),ND(Ee,r,fe,c,pe)}Z1(Ee,s)})}function Gl(r,s,c){return{instance:r,listener:s,currentTarget:c}}function ld(r,s){for(var c=s+"Capture",h=[];r!==null;){var b=r,_=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||_===null||(b=hl(r,c),b!=null&&h.unshift(Gl(r,b,_)),b=hl(r,s),b!=null&&h.push(Gl(r,b,_))),r.tag===3)return h;r=r.return}return[]}function kD(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function J1(r,s,c,h,b){for(var _=s._reactName,O=[];c!==null&&c!==h;){var F=c,te=F.alternate,fe=F.stateNode;if(F=F.tag,te!==null&&te===h)break;F!==5&&F!==26&&F!==27||fe===null||(te=fe,b?(fe=hl(c,_),fe!=null&&O.unshift(Gl(c,fe,te))):b||(fe=hl(c,_),fe!=null&&O.push(Gl(c,fe,te)))),c=c.return}O.length!==0&&r.push({event:s,listeners:O})}var OD=/\r\n?/g,AD=/\u0000|\uFFFD/g;function eb(r){return(typeof r=="string"?r:""+r).replace(OD,`
|
|
9
|
-
`).replace(AD,"")}function tb(r,s){return s=eb(s),eb(r)===s}function Ut(r,s,c,h,b,_){switch(c){case"children":typeof h=="string"?s==="body"||s==="textarea"&&h===""||Nt(r,h):(typeof h=="number"||typeof h=="bigint")&&s!=="body"&&Nt(r,""+h);break;case"className":It(r,"class",h);break;case"tabIndex":It(r,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":It(r,c,h);break;case"style":hu(r,h,_);break;case"data":if(s!=="object"){It(r,"data",h);break}case"src":case"href":if(h===""&&(s!=="a"||c!=="href")){r.removeAttribute(c);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){r.removeAttribute(c);break}h=mu(""+h),r.setAttribute(c,h);break;case"action":case"formAction":if(typeof h=="function"){r.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 _=="function"&&(c==="formAction"?(s!=="input"&&Ut(r,s,"name",b.name,b,null),Ut(r,s,"formEncType",b.formEncType,b,null),Ut(r,s,"formMethod",b.formMethod,b,null),Ut(r,s,"formTarget",b.formTarget,b,null)):(Ut(r,s,"encType",b.encType,b,null),Ut(r,s,"method",b.method,b,null),Ut(r,s,"target",b.target,b,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){r.removeAttribute(c);break}h=mu(""+h),r.setAttribute(c,h);break;case"onClick":h!=null&&(r.onclick=Ar);break;case"onScroll":h!=null&&yt("scroll",r);break;case"onScrollEnd":h!=null&&yt("scrollend",r);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(o(61));if(c=h.__html,c!=null){if(b.children!=null)throw Error(o(60));r.innerHTML=c}}break;case"multiple":r.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":r.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){r.removeAttribute("xlink:href");break}c=mu(""+h),r.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":h!=null&&typeof h!="function"&&typeof h!="symbol"?r.setAttribute(c,""+h):r.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":h&&typeof h!="function"&&typeof h!="symbol"?r.setAttribute(c,""):r.removeAttribute(c);break;case"capture":case"download":h===!0?r.setAttribute(c,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?r.setAttribute(c,h):r.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?r.setAttribute(c,h):r.removeAttribute(c);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?r.removeAttribute(c):r.setAttribute(c,h);break;case"popover":yt("beforetoggle",r),yt("toggle",r),ct(r,"popover",h);break;case"xlinkActuate":rt(r,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":rt(r,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":rt(r,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":rt(r,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":rt(r,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":rt(r,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":rt(r,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":rt(r,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":rt(r,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":ct(r,"is",h);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=i3.get(c)||c,ct(r,c,h))}}function ag(r,s,c,h,b,_){switch(c){case"style":hu(r,h,_);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(o(61));if(c=h.__html,c!=null){if(b.children!=null)throw Error(o(60));r.innerHTML=c}}break;case"children":typeof h=="string"?Nt(r,h):(typeof h=="number"||typeof h=="bigint")&&Nt(r,""+h);break;case"onScroll":h!=null&&yt("scroll",r);break;case"onScrollEnd":h!=null&&yt("scrollend",r);break;case"onClick":h!=null&&(r.onclick=Ar);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ke.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(b=c.endsWith("Capture"),s=c.slice(2,b?c.length-7:void 0),_=r[Tn]||null,_=_!=null?_[c]:null,typeof _=="function"&&r.removeEventListener(s,_,b),typeof h=="function")){typeof _!="function"&&_!==null&&(c in r?r[c]=null:r.hasAttribute(c)&&r.removeAttribute(c)),r.addEventListener(s,h,b);break e}c in r?r[c]=h:h===!0?r.setAttribute(c,""):ct(r,c,h)}}}function Vn(r,s,c){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":yt("error",r),yt("load",r);var h=!1,b=!1,_;for(_ in c)if(c.hasOwnProperty(_)){var O=c[_];if(O!=null)switch(_){case"src":h=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,s));default:Ut(r,s,_,O,c,null)}}b&&Ut(r,s,"srcSet",c.srcSet,c,null),h&&Ut(r,s,"src",c.src,c,null);return;case"input":yt("invalid",r);var F=_=O=b=null,te=null,fe=null;for(h in c)if(c.hasOwnProperty(h)){var pe=c[h];if(pe!=null)switch(h){case"name":b=pe;break;case"type":O=pe;break;case"checked":te=pe;break;case"defaultChecked":fe=pe;break;case"value":_=pe;break;case"defaultValue":F=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(o(137,s));break;default:Ut(r,s,h,pe,c,null)}}ir(r,_,F,te,fe,O,b,!1);return;case"select":yt("invalid",r),h=O=_=null;for(b in c)if(c.hasOwnProperty(b)&&(F=c[b],F!=null))switch(b){case"value":_=F;break;case"defaultValue":O=F;break;case"multiple":h=F;default:Ut(r,s,b,F,c,null)}s=_,c=O,r.multiple=!!h,s!=null?At(r,!!h,s,!1):c!=null&&At(r,!!h,c,!0);return;case"textarea":yt("invalid",r),_=b=h=null;for(O in c)if(c.hasOwnProperty(O)&&(F=c[O],F!=null))switch(O){case"value":h=F;break;case"defaultValue":b=F;break;case"children":_=F;break;case"dangerouslySetInnerHTML":if(F!=null)throw Error(o(91));break;default:Ut(r,s,O,F,c,null)}Xt(r,h,b,_);return;case"option":for(te in c)c.hasOwnProperty(te)&&(h=c[te],h!=null)&&(te==="selected"?r.selected=h&&typeof h!="function"&&typeof h!="symbol":Ut(r,s,te,h,c,null));return;case"dialog":yt("beforetoggle",r),yt("toggle",r),yt("cancel",r),yt("close",r);break;case"iframe":case"object":yt("load",r);break;case"video":case"audio":for(h=0;h<Yl.length;h++)yt(Yl[h],r);break;case"image":yt("error",r),yt("load",r);break;case"details":yt("toggle",r);break;case"embed":case"source":case"link":yt("error",r),yt("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(fe in c)if(c.hasOwnProperty(fe)&&(h=c[fe],h!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,s));default:Ut(r,s,fe,h,c,null)}return;default:if(xh(s)){for(pe in c)c.hasOwnProperty(pe)&&(h=c[pe],h!==void 0&&ag(r,s,pe,h,c,void 0));return}}for(F in c)c.hasOwnProperty(F)&&(h=c[F],h!=null&&Ut(r,s,F,h,c,null))}function jD(r,s,c,h){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,_=null,O=null,F=null,te=null,fe=null,pe=null;for(me in c){var Ee=c[me];if(c.hasOwnProperty(me)&&Ee!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":te=Ee;default:h.hasOwnProperty(me)||Ut(r,s,me,null,h,Ee)}}for(var he in h){var me=h[he];if(Ee=c[he],h.hasOwnProperty(he)&&(me!=null||Ee!=null))switch(he){case"type":_=me;break;case"name":b=me;break;case"checked":fe=me;break;case"defaultChecked":pe=me;break;case"value":O=me;break;case"defaultValue":F=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(o(137,s));break;default:me!==Ee&&Ut(r,s,he,me,h,Ee)}}uo(r,O,F,te,fe,pe,_,b);return;case"select":me=O=F=he=null;for(_ in c)if(te=c[_],c.hasOwnProperty(_)&&te!=null)switch(_){case"value":break;case"multiple":me=te;default:h.hasOwnProperty(_)||Ut(r,s,_,null,h,te)}for(b in h)if(_=h[b],te=c[b],h.hasOwnProperty(b)&&(_!=null||te!=null))switch(b){case"value":he=_;break;case"defaultValue":F=_;break;case"multiple":O=_;default:_!==te&&Ut(r,s,b,_,h,te)}s=F,c=O,h=me,he!=null?At(r,!!c,he,!1):!!h!=!!c&&(s!=null?At(r,!!c,s,!0):At(r,!!c,c?[]:"",!1));return;case"textarea":me=he=null;for(F in c)if(b=c[F],c.hasOwnProperty(F)&&b!=null&&!h.hasOwnProperty(F))switch(F){case"value":break;case"children":break;default:Ut(r,s,F,null,h,b)}for(O in h)if(b=h[O],_=c[O],h.hasOwnProperty(O)&&(b!=null||_!=null))switch(O){case"value":he=b;break;case"defaultValue":me=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(o(91));break;default:b!==_&&Ut(r,s,O,b,h,_)}Jn(r,he,me);return;case"option":for(var $e in c)he=c[$e],c.hasOwnProperty($e)&&he!=null&&!h.hasOwnProperty($e)&&($e==="selected"?r.selected=!1:Ut(r,s,$e,null,h,he));for(te in h)he=h[te],me=c[te],h.hasOwnProperty(te)&&he!==me&&(he!=null||me!=null)&&(te==="selected"?r.selected=he&&typeof he!="function"&&typeof he!="symbol":Ut(r,s,te,he,h,me));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 Ke in c)he=c[Ke],c.hasOwnProperty(Ke)&&he!=null&&!h.hasOwnProperty(Ke)&&Ut(r,s,Ke,null,h,he);for(fe in h)if(he=h[fe],me=c[fe],h.hasOwnProperty(fe)&&he!==me&&(he!=null||me!=null))switch(fe){case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(o(137,s));break;default:Ut(r,s,fe,he,h,me)}return;default:if(xh(s)){for(var Yt in c)he=c[Yt],c.hasOwnProperty(Yt)&&he!==void 0&&!h.hasOwnProperty(Yt)&&ag(r,s,Yt,void 0,h,he);for(pe in h)he=h[pe],me=c[pe],!h.hasOwnProperty(pe)||he===me||he===void 0&&me===void 0||ag(r,s,pe,he,h,me);return}}for(var ie in c)he=c[ie],c.hasOwnProperty(ie)&&he!=null&&!h.hasOwnProperty(ie)&&Ut(r,s,ie,null,h,he);for(Ee in h)he=h[Ee],me=c[Ee],!h.hasOwnProperty(Ee)||he===me||he==null&&me==null||Ut(r,s,Ee,he,h,me)}function nb(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function zD(){if(typeof performance.getEntriesByType=="function"){for(var r=0,s=0,c=performance.getEntriesByType("resource"),h=0;h<c.length;h++){var b=c[h],_=b.transferSize,O=b.initiatorType,F=b.duration;if(_&&F&&nb(O)){for(O=0,F=b.responseEnd,h+=1;h<c.length;h++){var te=c[h],fe=te.startTime;if(fe>F)break;var pe=te.transferSize,Ee=te.initiatorType;pe&&nb(Ee)&&(te=te.responseEnd,O+=pe*(te<F?1:(F-fe)/(te-fe)))}if(--h,s+=8*(_+O)/(b.duration/1e3),r++,10<r)break}}if(0<r)return s/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var sg=null,ig=null;function cd(r){return r.nodeType===9?r:r.ownerDocument}function ob(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function rb(r,s){if(r===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&s==="foreignObject"?0:r}function lg(r,s){return r==="textarea"||r==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var cg=null;function ID(){var r=window.event;return r&&r.type==="popstate"?r===cg?!1:(cg=r,!0):(cg=null,!1)}var ab=typeof setTimeout=="function"?setTimeout:void 0,PD=typeof clearTimeout=="function"?clearTimeout:void 0,sb=typeof Promise=="function"?Promise:void 0,$D=typeof queueMicrotask=="function"?queueMicrotask:typeof sb<"u"?function(r){return sb.resolve(null).then(r).catch(LD)}:ab;function LD(r){setTimeout(function(){throw r})}function ka(r){return r==="head"}function ib(r,s){var c=s,h=0;do{var b=c.nextSibling;if(r.removeChild(c),b&&b.nodeType===8)if(c=b.data,c==="/$"||c==="/&"){if(h===0){r.removeChild(b),vi(s);return}h--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")h++;else if(c==="html")ql(r.ownerDocument.documentElement);else if(c==="head"){c=r.ownerDocument.head,ql(c);for(var _=c.firstChild;_;){var O=_.nextSibling,F=_.nodeName;_[le]||F==="SCRIPT"||F==="STYLE"||F==="LINK"&&_.rel.toLowerCase()==="stylesheet"||c.removeChild(_),_=O}}else c==="body"&&ql(r.ownerDocument.body);c=b}while(c);vi(s)}function lb(r,s){var c=r;r=0;do{var h=c.nextSibling;if(c.nodeType===1?s?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(s?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),h&&h.nodeType===8)if(c=h.data,c==="/$"){if(r===0)break;r--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||r++;c=h}while(c)}function ug(r){var s=r.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var c=s;switch(s=s.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":ug(c),ye(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function HD(r,s,c,h){for(;r.nodeType===1;){var b=c;if(r.nodeName.toLowerCase()!==s.toLowerCase()){if(!h&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(h){if(!r[le])switch(s){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(_=r.getAttribute("rel"),_==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(_!==b.rel||r.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||r.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||r.getAttribute("title")!==(b.title==null?null:b.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(_=r.getAttribute("src"),(_!==(b.src==null?null:b.src)||r.getAttribute("type")!==(b.type==null?null:b.type)||r.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&_&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(s==="input"&&r.type==="hidden"){var _=b.name==null?null:""+b.name;if(b.type==="hidden"&&r.getAttribute("name")===_)return r}else return r;if(r=Po(r.nextSibling),r===null)break}return null}function BD(r,s,c){if(s==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!c||(r=Po(r.nextSibling),r===null))return null;return r}function cb(r,s){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=Po(r.nextSibling),r===null))return null;return r}function dg(r){return r.data==="$?"||r.data==="$~"}function fg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function VD(r,s){var c=r.ownerDocument;if(r.data==="$~")r._reactRetry=s;else if(r.data!=="$?"||c.readyState!=="loading")s();else{var h=function(){s(),c.removeEventListener("DOMContentLoaded",h)};c.addEventListener("DOMContentLoaded",h),r._reactRetry=h}}function Po(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return r}var hg=null;function ub(r){r=r.nextSibling;for(var s=0;r;){if(r.nodeType===8){var c=r.data;if(c==="/$"||c==="/&"){if(s===0)return Po(r.nextSibling);s--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||s++}r=r.nextSibling}return null}function db(r){r=r.previousSibling;for(var s=0;r;){if(r.nodeType===8){var c=r.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(s===0)return r;s--}else c!=="/$"&&c!=="/&"||s++}r=r.previousSibling}return null}function fb(r,s,c){switch(s=cd(c),r){case"html":if(r=s.documentElement,!r)throw Error(o(452));return r;case"head":if(r=s.head,!r)throw Error(o(453));return r;case"body":if(r=s.body,!r)throw Error(o(454));return r;default:throw Error(o(451))}}function ql(r){for(var s=r.attributes;s.length;)r.removeAttributeNode(s[0]);ye(r)}var $o=new Map,hb=new Set;function ud(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Kr=L.d;L.d={f:FD,r:UD,D:YD,C:GD,L:qD,m:WD,X:XD,S:KD,M:ZD};function FD(){var r=Kr.f(),s=td();return r||s}function UD(r){var s=Ne(r);s!==null&&s.tag===5&&s.type==="form"?Tx(s):Kr.r(r)}var gi=typeof document>"u"?null:document;function mb(r,s,c){var h=gi;if(h&&typeof s=="string"&&s){var b=Ze(s);b='link[rel="'+r+'"][href="'+b+'"]',typeof c=="string"&&(b+='[crossorigin="'+c+'"]'),hb.has(b)||(hb.add(b),r={rel:r,crossOrigin:c,href:s},h.querySelector(b)===null&&(s=h.createElement("link"),Vn(s,"link",r),Se(s),h.head.appendChild(s)))}}function YD(r){Kr.D(r),mb("dns-prefetch",r,null)}function GD(r,s){Kr.C(r,s),mb("preconnect",r,s)}function qD(r,s,c){Kr.L(r,s,c);var h=gi;if(h&&r&&s){var b='link[rel="preload"][as="'+Ze(s)+'"]';s==="image"&&c&&c.imageSrcSet?(b+='[imagesrcset="'+Ze(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(b+='[imagesizes="'+Ze(c.imageSizes)+'"]')):b+='[href="'+Ze(r)+'"]';var _=b;switch(s){case"style":_=pi(r);break;case"script":_=yi(r)}$o.has(_)||(r=m({rel:"preload",href:s==="image"&&c&&c.imageSrcSet?void 0:r,as:s},c),$o.set(_,r),h.querySelector(b)!==null||s==="style"&&h.querySelector(Wl(_))||s==="script"&&h.querySelector(Kl(_))||(s=h.createElement("link"),Vn(s,"link",r),Se(s),h.head.appendChild(s)))}}function WD(r,s){Kr.m(r,s);var c=gi;if(c&&r){var h=s&&typeof s.as=="string"?s.as:"script",b='link[rel="modulepreload"][as="'+Ze(h)+'"][href="'+Ze(r)+'"]',_=b;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=yi(r)}if(!$o.has(_)&&(r=m({rel:"modulepreload",href:r},s),$o.set(_,r),c.querySelector(b)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Kl(_)))return}h=c.createElement("link"),Vn(h,"link",r),Se(h),c.head.appendChild(h)}}}function KD(r,s,c){Kr.S(r,s,c);var h=gi;if(h&&r){var b=je(h).hoistableStyles,_=pi(r);s=s||"default";var O=b.get(_);if(!O){var F={loading:0,preload:null};if(O=h.querySelector(Wl(_)))F.loading=5;else{r=m({rel:"stylesheet",href:r,"data-precedence":s},c),(c=$o.get(_))&&mg(r,c);var te=O=h.createElement("link");Se(te),Vn(te,"link",r),te._p=new Promise(function(fe,pe){te.onload=fe,te.onerror=pe}),te.addEventListener("load",function(){F.loading|=1}),te.addEventListener("error",function(){F.loading|=2}),F.loading|=4,dd(O,s,h)}O={type:"stylesheet",instance:O,count:1,state:F},b.set(_,O)}}}function XD(r,s){Kr.X(r,s);var c=gi;if(c&&r){var h=je(c).hoistableScripts,b=yi(r),_=h.get(b);_||(_=c.querySelector(Kl(b)),_||(r=m({src:r,async:!0},s),(s=$o.get(b))&&gg(r,s),_=c.createElement("script"),Se(_),Vn(_,"link",r),c.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},h.set(b,_))}}function ZD(r,s){Kr.M(r,s);var c=gi;if(c&&r){var h=je(c).hoistableScripts,b=yi(r),_=h.get(b);_||(_=c.querySelector(Kl(b)),_||(r=m({src:r,async:!0,type:"module"},s),(s=$o.get(b))&&gg(r,s),_=c.createElement("script"),Se(_),Vn(_,"link",r),c.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},h.set(b,_))}}function gb(r,s,c,h){var b=(b=oe.current)?ud(b):null;if(!b)throw Error(o(446));switch(r){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(s=pi(c.href),c=je(b).hoistableStyles,h=c.get(s),h||(h={type:"style",instance:null,count:0,state:null},c.set(s,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){r=pi(c.href);var _=je(b).hoistableStyles,O=_.get(r);if(O||(b=b.ownerDocument||b,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(r,O),(_=b.querySelector(Wl(r)))&&!_._p&&(O.instance=_,O.state.loading=5),$o.has(r)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},$o.set(r,c),_||QD(b,r,c,O.state))),s&&h===null)throw Error(o(528,""));return O}if(s&&h!==null)throw Error(o(529,""));return null;case"script":return s=c.async,c=c.src,typeof c=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=yi(c),c=je(b).hoistableScripts,h=c.get(s),h||(h={type:"script",instance:null,count:0,state:null},c.set(s,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,r))}}function pi(r){return'href="'+Ze(r)+'"'}function Wl(r){return'link[rel="stylesheet"]['+r+"]"}function pb(r){return m({},r,{"data-precedence":r.precedence,precedence:null})}function QD(r,s,c,h){r.querySelector('link[rel="preload"][as="style"]['+s+"]")?h.loading=1:(s=r.createElement("link"),h.preload=s,s.addEventListener("load",function(){return h.loading|=1}),s.addEventListener("error",function(){return h.loading|=2}),Vn(s,"link",c),Se(s),r.head.appendChild(s))}function yi(r){return'[src="'+Ze(r)+'"]'}function Kl(r){return"script[async]"+r}function yb(r,s,c){if(s.count++,s.instance===null)switch(s.type){case"style":var h=r.querySelector('style[data-href~="'+Ze(c.href)+'"]');if(h)return s.instance=h,Se(h),h;var b=m({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return h=(r.ownerDocument||r).createElement("style"),Se(h),Vn(h,"style",b),dd(h,c.precedence,r),s.instance=h;case"stylesheet":b=pi(c.href);var _=r.querySelector(Wl(b));if(_)return s.state.loading|=4,s.instance=_,Se(_),_;h=pb(c),(b=$o.get(b))&&mg(h,b),_=(r.ownerDocument||r).createElement("link"),Se(_);var O=_;return O._p=new Promise(function(F,te){O.onload=F,O.onerror=te}),Vn(_,"link",h),s.state.loading|=4,dd(_,c.precedence,r),s.instance=_;case"script":return _=yi(c.src),(b=r.querySelector(Kl(_)))?(s.instance=b,Se(b),b):(h=c,(b=$o.get(_))&&(h=m({},c),gg(h,b)),r=r.ownerDocument||r,b=r.createElement("script"),Se(b),Vn(b,"link",h),r.head.appendChild(b),s.instance=b);case"void":return null;default:throw Error(o(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(h=s.instance,s.state.loading|=4,dd(h,c.precedence,r));return s.instance}function dd(r,s,c){for(var h=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=h.length?h[h.length-1]:null,_=b,O=0;O<h.length;O++){var F=h[O];if(F.dataset.precedence===s)_=F;else if(_!==b)break}_?_.parentNode.insertBefore(r,_.nextSibling):(s=c.nodeType===9?c.head:c,s.insertBefore(r,s.firstChild))}function mg(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.title==null&&(r.title=s.title)}function gg(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.integrity==null&&(r.integrity=s.integrity)}var fd=null;function vb(r,s,c){if(fd===null){var h=new Map,b=fd=new Map;b.set(c,h)}else b=fd,h=b.get(c),h||(h=new Map,b.set(c,h));if(h.has(r))return h;for(h.set(r,null),c=c.getElementsByTagName(r),b=0;b<c.length;b++){var _=c[b];if(!(_[le]||_[dn]||r==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var O=_.getAttribute(s)||"";O=r+O;var F=h.get(O);F?F.push(_):h.set(O,[_])}}return h}function xb(r,s,c){r=r.ownerDocument||r,r.head.insertBefore(c,s==="title"?r.querySelector("head > title"):null)}function JD(r,s,c){if(c===1||s.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(r=s.disabled,typeof s.precedence=="string"&&r==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function bb(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function e4(r,s,c,h){if(c.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var b=pi(h.href),_=s.querySelector(Wl(b));if(_){s=_._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(r.count++,r=hd.bind(r),s.then(r,r)),c.state.loading|=4,c.instance=_,Se(_);return}_=s.ownerDocument||s,h=pb(h),(b=$o.get(b))&&mg(h,b),_=_.createElement("link"),Se(_);var O=_;O._p=new Promise(function(F,te){O.onload=F,O.onerror=te}),Vn(_,"link",h),c.instance=_}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(c,s),(s=c.state.preload)&&(c.state.loading&3)===0&&(r.count++,c=hd.bind(r),s.addEventListener("load",c),s.addEventListener("error",c))}}var pg=0;function t4(r,s){return r.stylesheets&&r.count===0&&gd(r,r.stylesheets),0<r.count||0<r.imgCount?function(c){var h=setTimeout(function(){if(r.stylesheets&&gd(r,r.stylesheets),r.unsuspend){var _=r.unsuspend;r.unsuspend=null,_()}},6e4+s);0<r.imgBytes&&pg===0&&(pg=62500*zD());var b=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&gd(r,r.stylesheets),r.unsuspend)){var _=r.unsuspend;r.unsuspend=null,_()}},(r.imgBytes>pg?50:800)+s);return r.unsuspend=c,function(){r.unsuspend=null,clearTimeout(h),clearTimeout(b)}}:null}function hd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var md=null;function gd(r,s){r.stylesheets=null,r.unsuspend!==null&&(r.count++,md=new Map,s.forEach(n4,r),md=null,hd.call(r))}function n4(r,s){if(!(s.state.loading&4)){var c=md.get(r);if(c)var h=c.get(null);else{c=new Map,md.set(r,c);for(var b=r.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<b.length;_++){var O=b[_];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(c.set(O.dataset.precedence,O),h=O)}h&&c.set(null,h)}b=s.instance,O=b.getAttribute("data-precedence"),_=c.get(O)||h,_===h&&c.set(null,b),c.set(O,b),this.count++,h=hd.bind(this),b.addEventListener("load",h),b.addEventListener("error",h),_?_.parentNode.insertBefore(b,_.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(b,r.firstChild)),s.state.loading|=4}}var Xl={$$typeof:E,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function o4(r,s,c,h,b,_,O,F,te){this.tag=1,this.containerInfo=r,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=Pn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pn(0),this.hiddenUpdates=Pn(null),this.identifierPrefix=h,this.onUncaughtError=b,this.onCaughtError=_,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=te,this.incompleteTransitions=new Map}function wb(r,s,c,h,b,_,O,F,te,fe,pe,Ee){return r=new o4(r,s,c,O,te,fe,pe,Ee,F),s=1,_===!0&&(s|=24),_=ho(3,null,null,s),r.current=_,_.stateNode=r,s=Kh(),s.refCount++,r.pooledCache=s,s.refCount++,_.memoizedState={element:h,isDehydrated:c,cache:s},Jh(_),r}function Sb(r){return r?(r=Ws,r):Ws}function Cb(r,s,c,h,b,_){b=Sb(b),h.context===null?h.context=b:h.pendingContext=b,h=ba(s),h.payload={element:c},_=_===void 0?null:_,_!==null&&(h.callback=_),c=wa(r,h,s),c!==null&&(ao(c,r,s),Rl(c,r,s))}function Eb(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<s?c:s}}function yg(r,s){Eb(r,s),(r=r.alternate)&&Eb(r,s)}function _b(r){if(r.tag===13||r.tag===31){var s=cs(r,67108864);s!==null&&ao(s,r,67108864),yg(r,67108864)}}function Mb(r){if(r.tag===13||r.tag===31){var s=vo();s=Do(s);var c=cs(r,s);c!==null&&ao(c,r,s),yg(r,s)}}var pd=!0;function r4(r,s,c,h){var b=j.T;j.T=null;var _=L.p;try{L.p=2,vg(r,s,c,h)}finally{L.p=_,j.T=b}}function a4(r,s,c,h){var b=j.T;j.T=null;var _=L.p;try{L.p=8,vg(r,s,c,h)}finally{L.p=_,j.T=b}}function vg(r,s,c,h){if(pd){var b=xg(h);if(b===null)rg(r,s,h,yd,c),Rb(r,h);else if(i4(b,r,s,c,h))h.stopPropagation();else if(Rb(r,h),s&4&&-1<s4.indexOf(r)){for(;b!==null;){var _=Ne(b);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var O=$t(_.pendingLanes);if(O!==0){var F=_;for(F.pendingLanes|=2,F.entangledLanes|=2;O;){var te=1<<31-Wt(O);F.entanglements[1]|=te,O&=~te}dr(_),(jt&6)===0&&(Ju=zt()+500,Ul(0))}}break;case 31:case 13:F=cs(_,2),F!==null&&ao(F,_,2),td(),yg(_,2)}if(_=xg(h),_===null&&rg(r,s,h,yd,c),_===b)break;b=_}b!==null&&h.stopPropagation()}else rg(r,s,h,null,c)}}function xg(r){return r=wh(r),bg(r)}var yd=null;function bg(r){if(yd=null,r=we(r),r!==null){var s=i(r);if(s===null)r=null;else{var c=s.tag;if(c===13){if(r=l(s),r!==null)return r;r=null}else if(c===31){if(r=u(s),r!==null)return r;r=null}else if(c===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;r=null}else s!==r&&(r=null)}}return yd=r,null}function Nb(r){switch(r){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(Nn()){case yn:return 2;case In:return 8;case jn:case _e:return 32;case Ue:return 268435456;default:return 32}default:return 32}}var wg=!1,Oa=null,Aa=null,ja=null,Zl=new Map,Ql=new Map,za=[],s4="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 Rb(r,s){switch(r){case"focusin":case"focusout":Oa=null;break;case"dragenter":case"dragleave":Aa=null;break;case"mouseover":case"mouseout":ja=null;break;case"pointerover":case"pointerout":Zl.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ql.delete(s.pointerId)}}function Jl(r,s,c,h,b,_){return r===null||r.nativeEvent!==_?(r={blockedOn:s,domEventName:c,eventSystemFlags:h,nativeEvent:_,targetContainers:[b]},s!==null&&(s=Ne(s),s!==null&&_b(s)),r):(r.eventSystemFlags|=h,s=r.targetContainers,b!==null&&s.indexOf(b)===-1&&s.push(b),r)}function i4(r,s,c,h,b){switch(s){case"focusin":return Oa=Jl(Oa,r,s,c,h,b),!0;case"dragenter":return Aa=Jl(Aa,r,s,c,h,b),!0;case"mouseover":return ja=Jl(ja,r,s,c,h,b),!0;case"pointerover":var _=b.pointerId;return Zl.set(_,Jl(Zl.get(_)||null,r,s,c,h,b)),!0;case"gotpointercapture":return _=b.pointerId,Ql.set(_,Jl(Ql.get(_)||null,r,s,c,h,b)),!0}return!1}function Db(r){var s=we(r.target);if(s!==null){var c=i(s);if(c!==null){if(s=c.tag,s===13){if(s=l(c),s!==null){r.blockedOn=s,Dr(r.priority,function(){Mb(c)});return}}else if(s===31){if(s=u(c),s!==null){r.blockedOn=s,Dr(r.priority,function(){Mb(c)});return}}else if(s===3&&c.stateNode.current.memoizedState.isDehydrated){r.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}r.blockedOn=null}function vd(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var c=xg(r.nativeEvent);if(c===null){c=r.nativeEvent;var h=new c.constructor(c.type,c);bh=h,c.target.dispatchEvent(h),bh=null}else return s=Ne(c),s!==null&&_b(s),r.blockedOn=c,!1;s.shift()}return!0}function Tb(r,s,c){vd(r)&&c.delete(s)}function l4(){wg=!1,Oa!==null&&vd(Oa)&&(Oa=null),Aa!==null&&vd(Aa)&&(Aa=null),ja!==null&&vd(ja)&&(ja=null),Zl.forEach(Tb),Ql.forEach(Tb)}function xd(r,s){r.blockedOn===s&&(r.blockedOn=null,wg||(wg=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,l4)))}var bd=null;function kb(r){bd!==r&&(bd=r,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){bd===r&&(bd=null);for(var s=0;s<r.length;s+=3){var c=r[s],h=r[s+1],b=r[s+2];if(typeof h!="function"){if(bg(h||c)===null)continue;break}var _=Ne(c);_!==null&&(r.splice(s,3),s-=3,xm(_,{pending:!0,data:b,method:c.method,action:h},h,b))}}))}function vi(r){function s(te){return xd(te,r)}Oa!==null&&xd(Oa,r),Aa!==null&&xd(Aa,r),ja!==null&&xd(ja,r),Zl.forEach(s),Ql.forEach(s);for(var c=0;c<za.length;c++){var h=za[c];h.blockedOn===r&&(h.blockedOn=null)}for(;0<za.length&&(c=za[0],c.blockedOn===null);)Db(c),c.blockedOn===null&&za.shift();if(c=(r.ownerDocument||r).$$reactFormReplay,c!=null)for(h=0;h<c.length;h+=3){var b=c[h],_=c[h+1],O=b[Tn]||null;if(typeof _=="function")O||kb(c);else if(O){var F=null;if(_&&_.hasAttribute("formAction")){if(b=_,O=_[Tn]||null)F=O.formAction;else if(bg(b)!==null)continue}else F=O.action;typeof F=="function"?c[h+1]=F:(c.splice(h,3),h-=3),kb(c)}}}function Ob(){function r(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(O){return b=O})},focusReset:"manual",scroll:"manual"})}function s(){b!==null&&(b(),b=null),h||setTimeout(c,20)}function c(){if(!h&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,b=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(c,100),function(){h=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),b!==null&&(b(),b=null)}}}function Sg(r){this._internalRoot=r}wd.prototype.render=Sg.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(o(409));var c=s.current,h=vo();Cb(c,h,r,s,null,null)},wd.prototype.unmount=Sg.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;Cb(r.current,2,null,r,null,null),td(),s[To]=null}};function wd(r){this._internalRoot=r}wd.prototype.unstable_scheduleHydration=function(r){if(r){var s=lo();r={blockedOn:null,target:r,priority:s};for(var c=0;c<za.length&&s!==0&&s<za[c].priority;c++);za.splice(c,0,r),c===0&&Db(r)}};var Ab=e.version;if(Ab!=="19.2.4")throw Error(o(527,Ab,"19.2.4"));L.findDOMNode=function(r){var s=r._reactInternals;if(s===void 0)throw typeof r.render=="function"?Error(o(188)):(r=Object.keys(r).join(","),Error(o(268,r)));return r=f(s),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var c4={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Sd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Sd.isDisabled&&Sd.supportsFiber)try{at=Sd.inject(c4),gt=Sd}catch{}}return tc.createRoot=function(r,s){if(!a(r))throw Error(o(299));var c=!1,h="",b=Hx,_=Bx,O=Vx;return s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onUncaughtError!==void 0&&(b=s.onUncaughtError),s.onCaughtError!==void 0&&(_=s.onCaughtError),s.onRecoverableError!==void 0&&(O=s.onRecoverableError)),s=wb(r,1,!1,null,null,c,h,null,b,_,O,Ob),r[To]=s.current,og(r),new Sg(s)},tc.hydrateRoot=function(r,s,c){if(!a(r))throw Error(o(299));var h=!1,b="",_=Hx,O=Bx,F=Vx,te=null;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(b=c.identifierPrefix),c.onUncaughtError!==void 0&&(_=c.onUncaughtError),c.onCaughtError!==void 0&&(O=c.onCaughtError),c.onRecoverableError!==void 0&&(F=c.onRecoverableError),c.formState!==void 0&&(te=c.formState)),s=wb(r,1,!0,s,c??null,h,b,te,_,O,F,Ob),s.context=Sb(null),c=s.current,h=vo(),h=Do(h),b=ba(h),b.callback=null,wa(c,b,h),c=h,s.current.lanes=c,Dt(s,c),dr(s),r[To]=s.current,og(r),new wd(s)},tc.version="19.2.4",tc}var Fb;function x4(){if(Fb)return _g.exports;Fb=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),_g.exports=v4(),_g.exports}var b4=x4();var Ub="popstate";function w4(t={}){function e(o,a){let{pathname:i,search:l,hash:u}=o.location;return Ep("",{pathname:i,search:l,hash:u},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(o,a){return typeof a=="string"?a:Sc(a)}return C4(e,n,null,t)}function rn(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function nr(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function S4(){return Math.random().toString(36).substring(2,10)}function Yb(t,e){return{usr:t.state,key:t.key,idx:e}}function Ep(t,e,n=null,o){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?Ji(e):e,state:n,key:e&&e.key||o||S4()}}function Sc({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Ji(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let o=t.indexOf("?");o>=0&&(e.search=t.substring(o),t=t.substring(0,o)),t&&(e.pathname=t)}return e}function C4(t,e,n,o={}){let{window:a=document.defaultView,v5Compat:i=!1}=o,l=a.history,u="POP",d=null,f=g();f==null&&(f=0,l.replaceState({...l.state,idx:f},""));function g(){return(l.state||{idx:null}).idx}function m(){u="POP";let w=g(),M=w==null?null:w-f;f=w,d&&d({action:u,location:C.location,delta:M})}function p(w,M){u="PUSH";let R=Ep(C.location,w,M);f=g()+1;let E=Yb(R,f),N=C.createHref(R);try{l.pushState(E,"",N)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;a.location.assign(N)}i&&d&&d({action:u,location:C.location,delta:1})}function v(w,M){u="REPLACE";let R=Ep(C.location,w,M);f=g();let E=Yb(R,f),N=C.createHref(R);l.replaceState(E,"",N),i&&d&&d({action:u,location:C.location,delta:0})}function S(w){return E4(w)}let C={get action(){return u},get location(){return t(a,l)},listen(w){if(d)throw new Error("A history only accepts one active listener");return a.addEventListener(Ub,m),d=w,()=>{a.removeEventListener(Ub,m),d=null}},createHref(w){return e(a,w)},createURL:S,encodeLocation(w){let M=S(w);return{pathname:M.pathname,search:M.search,hash:M.hash}},push:p,replace:v,go(w){return l.go(w)}};return C}function E4(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),rn(n,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:Sc(t);return o=o.replace(/ $/,"%20"),!e&&o.startsWith("//")&&(o=n+o),new URL(o,n)}function jC(t,e,n="/"){return _4(t,e,n,!1)}function _4(t,e,n,o){let a=typeof e=="string"?Ji(e):e,i=ra(a.pathname||"/",n);if(i==null)return null;let l=zC(t);M4(l);let u=null;for(let d=0;u==null&&d<l.length;++d){let f=P4(i);u=z4(l[d],f,o)}return u}function zC(t,e=[],n=[],o="",a=!1){let i=(l,u,d=a,f)=>{let g={relativePath:f===void 0?l.path||"":f,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(o)&&d)return;rn(g.relativePath.startsWith(o),`Absolute route path "${g.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(o.length)}let m=na([o,g.relativePath]),p=n.concat(g);l.children&&l.children.length>0&&(rn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),zC(l.children,e,p,m,d)),!(l.path==null&&!l.index)&&e.push({path:m,score:A4(m,l.index),routesMeta:p})};return t.forEach((l,u)=>{if(l.path===""||!l.path?.includes("?"))i(l,u);else for(let d of IC(l.path))i(l,u,!0,d)}),e}function IC(t){let e=t.split("/");if(e.length===0)return[];let[n,...o]=e,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(o.length===0)return a?[i,""]:[i];let l=IC(o.join("/")),u=[];return u.push(...l.map(d=>d===""?i:[i,d].join("/"))),a&&u.push(...l),u.map(d=>t.startsWith("/")&&d===""?"/":d)}function M4(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:j4(e.routesMeta.map(o=>o.childrenIndex),n.routesMeta.map(o=>o.childrenIndex)))}var N4=/^:[\w-]+$/,R4=3,D4=2,T4=1,k4=10,O4=-2,Gb=t=>t==="*";function A4(t,e){let n=t.split("/"),o=n.length;return n.some(Gb)&&(o+=O4),e&&(o+=D4),n.filter(a=>!Gb(a)).reduce((a,i)=>a+(N4.test(i)?R4:i===""?T4:k4),o)}function j4(t,e){return t.length===e.length&&t.slice(0,-1).every((o,a)=>o===e[a])?t[t.length-1]-e[e.length-1]:0}function z4(t,e,n=!1){let{routesMeta:o}=t,a={},i="/",l=[];for(let u=0;u<o.length;++u){let d=o[u],f=u===o.length-1,g=i==="/"?e:e.slice(i.length)||"/",m=nf({path:d.relativePath,caseSensitive:d.caseSensitive,end:f},g),p=d.route;if(!m&&f&&n&&!o[o.length-1].route.index&&(m=nf({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},g)),!m)return null;Object.assign(a,m.params),l.push({params:a,pathname:na([i,m.pathname]),pathnameBase:B4(na([i,m.pathnameBase])),route:p}),m.pathnameBase!=="/"&&(i=na([i,m.pathnameBase]))}return l}function nf(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,o]=I4(t.path,t.caseSensitive,t.end),a=e.match(n);if(!a)return null;let i=a[0],l=i.replace(/(.)\/+$/,"$1"),u=a.slice(1);return{params:o.reduce((f,{paramName:g,isOptional:m},p)=>{if(g==="*"){let S=u[p]||"";l=i.slice(0,i.length-S.length).replace(/(.)\/+$/,"$1")}const v=u[p];return m&&!v?f[g]=void 0:f[g]=(v||"").replace(/%2F/g,"/"),f},{}),pathname:i,pathnameBase:l,pattern:t}}function I4(t,e=!1,n=!0){nr(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let o=[],a="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,d)=>(o.push({paramName:u,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(o.push({paramName:"*"}),a+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":t!==""&&t!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,e?void 0:"i"),o]}function P4(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return nr(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function ra(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,o=t.charAt(n);return o&&o!=="/"?null:t.slice(n)||"/"}var $4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function L4(t,e="/"){let{pathname:n,search:o="",hash:a=""}=typeof t=="string"?Ji(t):t,i;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?i=qb(n.substring(1),"/"):i=qb(n,e)):i=e,{pathname:i,search:V4(o),hash:F4(a)}}function qb(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Dg(t,e,n,o){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function H4(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function m0(t){let e=H4(t);return e.map((n,o)=>o===e.length-1?n.pathname:n.pathnameBase)}function g0(t,e,n,o=!1){let a;typeof t=="string"?a=Ji(t):(a={...t},rn(!a.pathname||!a.pathname.includes("?"),Dg("?","pathname","search",a)),rn(!a.pathname||!a.pathname.includes("#"),Dg("#","pathname","hash",a)),rn(!a.search||!a.search.includes("#"),Dg("#","search","hash",a)));let i=t===""||a.pathname==="",l=i?"/":a.pathname,u;if(l==null)u=n;else{let m=e.length-1;if(!o&&l.startsWith("..")){let p=l.split("/");for(;p[0]==="..";)p.shift(),m-=1;a.pathname=p.join("/")}u=m>=0?e[m]:"/"}let d=L4(a,u),f=l&&l!=="/"&&l.endsWith("/"),g=(i||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(f||g)&&(d.pathname+="/"),d}var na=t=>t.join("/").replace(/\/\/+/g,"/"),B4=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),V4=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,F4=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,U4=class{constructor(t,e,n,o=!1){this.status=t,this.statusText=e||"",this.internal=o,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Y4(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function G4(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var PC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $C(t,e){let n=t;if(typeof n!="string"||!$4.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let o=n,a=!1;if(PC)try{let i=new URL(window.location.href),l=n.startsWith("//")?new URL(i.protocol+n):new URL(n),u=ra(l.pathname,e);l.origin===i.origin&&u!=null?n=u+l.search+l.hash:a=!0}catch{nr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:a,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var LC=["POST","PUT","PATCH","DELETE"];new Set(LC);var q4=["GET",...LC];new Set(q4);var el=x.createContext(null);el.displayName="DataRouter";var _f=x.createContext(null);_f.displayName="DataRouterState";var W4=x.createContext(!1),HC=x.createContext({isTransitioning:!1});HC.displayName="ViewTransition";var K4=x.createContext(new Map);K4.displayName="Fetchers";var X4=x.createContext(null);X4.displayName="Await";var No=x.createContext(null);No.displayName="Navigation";var Fc=x.createContext(null);Fc.displayName="Location";var Er=x.createContext({outlet:null,matches:[],isDataRoute:!1});Er.displayName="Route";var p0=x.createContext(null);p0.displayName="RouteError";var BC="REACT_ROUTER_ERROR",Z4="REDIRECT",Q4="ROUTE_ERROR_RESPONSE";function J4(t){if(t.startsWith(`${BC}:${Z4}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function eT(t){if(t.startsWith(`${BC}:${Q4}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new U4(e.status,e.statusText,e.data)}catch{}}function tT(t,{relative:e}={}){rn(tl(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:o}=x.useContext(No),{hash:a,pathname:i,search:l}=Uc(t,{relative:e}),u=i;return n!=="/"&&(u=i==="/"?n:na([n,i])),o.createHref({pathname:u,search:l,hash:a})}function tl(){return x.useContext(Fc)!=null}function ua(){return rn(tl(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(Fc).location}var VC="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function FC(t){x.useContext(No).static||x.useLayoutEffect(t)}function UC(){let{isDataRoute:t}=x.useContext(Er);return t?mT():nT()}function nT(){rn(tl(),"useNavigate() may be used only in the context of a <Router> component.");let t=x.useContext(el),{basename:e,navigator:n}=x.useContext(No),{matches:o}=x.useContext(Er),{pathname:a}=ua(),i=JSON.stringify(m0(o)),l=x.useRef(!1);return FC(()=>{l.current=!0}),x.useCallback((d,f={})=>{if(nr(l.current,VC),!l.current)return;if(typeof d=="number"){n.go(d);return}let g=g0(d,JSON.parse(i),a,f.relative==="path");t==null&&e!=="/"&&(g.pathname=g.pathname==="/"?e:na([e,g.pathname])),(f.replace?n.replace:n.push)(g,f.state,f)},[e,n,i,a,t])}x.createContext(null);function Uc(t,{relative:e}={}){let{matches:n}=x.useContext(Er),{pathname:o}=ua(),a=JSON.stringify(m0(n));return x.useMemo(()=>g0(t,JSON.parse(a),o,e==="path"),[t,a,o,e])}function oT(t,e){return YC(t,e)}function YC(t,e,n,o,a){rn(tl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=x.useContext(No),{matches:l}=x.useContext(Er),u=l[l.length-1],d=u?u.params:{},f=u?u.pathname:"/",g=u?u.pathnameBase:"/",m=u&&u.route;{let R=m&&m.path||"";qC(f,!m||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${R}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
10
|
-
|
|
11
|
-
Please change the parent <Route path="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let p=ua(),v;if(e){let R=typeof e=="string"?Ji(e):e;rn(g==="/"||R.pathname?.startsWith(g),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${g}" but pathname "${R.pathname}" was given in the \`location\` prop.`),v=R}else v=p;let S=v.pathname||"/",C=S;if(g!=="/"){let R=g.replace(/^\//,"").split("/");C="/"+S.replace(/^\//,"").split("/").slice(R.length).join("/")}let w=jC(t,{pathname:C});nr(m||w!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),nr(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let M=lT(w&&w.map(R=>Object.assign({},R,{params:Object.assign({},d,R.params),pathname:na([g,i.encodeLocation?i.encodeLocation(R.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?g:na([g,i.encodeLocation?i.encodeLocation(R.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),l,n,o,a);return e&&M?x.createElement(Fc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},M):M}function rT(){let t=hT(),e=Y4(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,o="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:o},i={padding:"2px 4px",backgroundColor:o},l=null;return console.error("Error handled by React Router default ErrorBoundary:",t),l=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:i},"ErrorBoundary")," or"," ",x.createElement("code",{style:i},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},e),n?x.createElement("pre",{style:a},n):null,l)}var aT=x.createElement(rT,null),GC=class extends x.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=eT(t.digest);n&&(t=n)}let e=t!==void 0?x.createElement(Er.Provider,{value:this.props.routeContext},x.createElement(p0.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?x.createElement(sT,{error:t},e):e}};GC.contextType=W4;var Tg=new WeakMap;function sT({children:t,error:e}){let{basename:n}=x.useContext(No);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let o=J4(e.digest);if(o){let a=Tg.get(e);if(a)throw a;let i=$C(o.location,n);if(PC&&!Tg.get(e))if(i.isExternal||o.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:o.replace}));throw Tg.set(e,l),l}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return t}function iT({routeContext:t,match:e,children:n}){let o=x.useContext(el);return o&&o.static&&o.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=e.route.id),x.createElement(Er.Provider,{value:t},n)}function lT(t,e=[],n=null,o=null,a=null){if(t==null){if(!n)return null;if(n.errors)t=n.matches;else if(e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let i=t,l=n?.errors;if(l!=null){let g=i.findIndex(m=>m.route.id&&l?.[m.route.id]!==void 0);rn(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),i=i.slice(0,Math.min(i.length,g+1))}let u=!1,d=-1;if(n)for(let g=0;g<i.length;g++){let m=i[g];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=g),m.route.id){let{loaderData:p,errors:v}=n,S=m.route.loader&&!p.hasOwnProperty(m.route.id)&&(!v||v[m.route.id]===void 0);if(m.route.lazy||S){u=!0,d>=0?i=i.slice(0,d+1):i=[i[0]];break}}}let f=n&&o?(g,m)=>{o(g,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:G4(n.matches),errorInfo:m})}:void 0;return i.reduceRight((g,m,p)=>{let v,S=!1,C=null,w=null;n&&(v=l&&m.route.id?l[m.route.id]:void 0,C=m.route.errorElement||aT,u&&(d<0&&p===0?(qC("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,w=null):d===p&&(S=!0,w=m.route.hydrateFallbackElement||null)));let M=e.concat(i.slice(0,p+1)),R=()=>{let E;return v?E=C:S?E=w:m.route.Component?E=x.createElement(m.route.Component,null):m.route.element?E=m.route.element:E=g,x.createElement(iT,{match:m,routeContext:{outlet:g,matches:M,isDataRoute:n!=null},children:E})};return n&&(m.route.ErrorBoundary||m.route.errorElement||p===0)?x.createElement(GC,{location:n.location,revalidation:n.revalidation,component:C,error:v,children:R(),routeContext:{outlet:null,matches:M,isDataRoute:!0},onError:f}):R()},null)}function y0(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cT(t){let e=x.useContext(el);return rn(e,y0(t)),e}function uT(t){let e=x.useContext(_f);return rn(e,y0(t)),e}function dT(t){let e=x.useContext(Er);return rn(e,y0(t)),e}function v0(t){let e=dT(t),n=e.matches[e.matches.length-1];return rn(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function fT(){return v0("useRouteId")}function hT(){let t=x.useContext(p0),e=uT("useRouteError"),n=v0("useRouteError");return t!==void 0?t:e.errors?.[n]}function mT(){let{router:t}=cT("useNavigate"),e=v0("useNavigate"),n=x.useRef(!1);return FC(()=>{n.current=!0}),x.useCallback(async(a,i={})=>{nr(n.current,VC),n.current&&(typeof a=="number"?await t.navigate(a):await t.navigate(a,{fromRouteId:e,...i}))},[t,e])}var Wb={};function qC(t,e,n){!e&&!Wb[t]&&(Wb[t]=!0,nr(!1,n))}x.memo(gT);function gT({routes:t,future:e,state:n,onError:o}){return YC(t,void 0,n,o,e)}function pT({to:t,replace:e,state:n,relative:o}){rn(tl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a}=x.useContext(No);nr(!a,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=x.useContext(Er),{pathname:l}=ua(),u=UC(),d=g0(t,m0(i),l,o==="path"),f=JSON.stringify(d);return x.useEffect(()=>{u(JSON.parse(f),{replace:e,state:n,relative:o})},[u,f,o,e,n]),null}function dc(t){rn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function yT({basename:t="/",children:e=null,location:n,navigationType:o="POP",navigator:a,static:i=!1,unstable_useTransitions:l}){rn(!tl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=t.replace(/^\/*/,"/"),d=x.useMemo(()=>({basename:u,navigator:a,static:i,unstable_useTransitions:l,future:{}}),[u,a,i,l]);typeof n=="string"&&(n=Ji(n));let{pathname:f="/",search:g="",hash:m="",state:p=null,key:v="default"}=n,S=x.useMemo(()=>{let C=ra(f,u);return C==null?null:{location:{pathname:C,search:g,hash:m,state:p,key:v},navigationType:o}},[u,f,g,m,p,v,o]);return nr(S!=null,`<Router basename="${u}"> is not able to match the URL "${f}${g}${m}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:x.createElement(No.Provider,{value:d},x.createElement(Fc.Provider,{children:e,value:S}))}function vT({children:t,location:e}){return oT(_p(t),e)}function _p(t,e=[]){let n=[];return x.Children.forEach(t,(o,a)=>{if(!x.isValidElement(o))return;let i=[...e,a];if(o.type===x.Fragment){n.push.apply(n,_p(o.props.children,i));return}rn(o.type===dc,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),rn(!o.props.index||!o.props.children,"An index route cannot have child routes.");let l={id:o.props.id||i.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(l.children=_p(o.props.children,i)),n.push(l)}),n}var Yd="get",Gd="application/x-www-form-urlencoded";function Mf(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function xT(t){return Mf(t)&&t.tagName.toLowerCase()==="button"}function bT(t){return Mf(t)&&t.tagName.toLowerCase()==="form"}function wT(t){return Mf(t)&&t.tagName.toLowerCase()==="input"}function ST(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function CT(t,e){return t.button===0&&(!e||e==="_self")&&!ST(t)}var Cd=null;function ET(){if(Cd===null)try{new FormData(document.createElement("form"),0),Cd=!1}catch{Cd=!0}return Cd}var _T=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function kg(t){return t!=null&&!_T.has(t)?(nr(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Gd}"`),null):t}function MT(t,e){let n,o,a,i,l;if(bT(t)){let u=t.getAttribute("action");o=u?ra(u,e):null,n=t.getAttribute("method")||Yd,a=kg(t.getAttribute("enctype"))||Gd,i=new FormData(t)}else if(xT(t)||wT(t)&&(t.type==="submit"||t.type==="image")){let u=t.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=t.getAttribute("formaction")||u.getAttribute("action");if(o=d?ra(d,e):null,n=t.getAttribute("formmethod")||u.getAttribute("method")||Yd,a=kg(t.getAttribute("formenctype"))||kg(u.getAttribute("enctype"))||Gd,i=new FormData(u,t),!ET()){let{name:f,type:g,value:m}=t;if(g==="image"){let p=f?`${f}.`:"";i.append(`${p}x`,"0"),i.append(`${p}y`,"0")}else f&&i.append(f,m)}}else{if(Mf(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Yd,o=null,a=Gd,l=t}return i&&a==="text/plain"&&(l=i,i=void 0),{action:o,method:n.toLowerCase(),encType:a,formData:i,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function x0(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function NT(t,e,n,o){let a=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${o}`:a.pathname=`${a.pathname}.${o}`:a.pathname==="/"?a.pathname=`_root.${o}`:e&&ra(a.pathname,e)==="/"?a.pathname=`${e.replace(/\/$/,"")}/_root.${o}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${o}`,a}async function RT(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function DT(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function TT(t,e,n){let o=await Promise.all(t.map(async a=>{let i=e.routes[a.route.id];if(i){let l=await RT(i,n);return l.links?l.links():[]}return[]}));return jT(o.flat(1).filter(DT).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function Kb(t,e,n,o,a,i){let l=(d,f)=>n[f]?d.route.id!==n[f].route.id:!0,u=(d,f)=>n[f].pathname!==d.pathname||n[f].route.path?.endsWith("*")&&n[f].params["*"]!==d.params["*"];return i==="assets"?e.filter((d,f)=>l(d,f)||u(d,f)):i==="data"?e.filter((d,f)=>{let g=o.routes[d.route.id];if(!g||!g.hasLoader)return!1;if(l(d,f)||u(d,f))return!0;if(d.route.shouldRevalidate){let m=d.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(t,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function kT(t,e,{includeHydrateFallback:n}={}){return OT(t.map(o=>{let a=e.routes[o.route.id];if(!a)return[];let i=[a.module];return a.clientActionModule&&(i=i.concat(a.clientActionModule)),a.clientLoaderModule&&(i=i.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(i=i.concat(a.hydrateFallbackModule)),a.imports&&(i=i.concat(a.imports)),i}).flat(1))}function OT(t){return[...new Set(t)]}function AT(t){let e={},n=Object.keys(t).sort();for(let o of n)e[o]=t[o];return e}function jT(t,e){let n=new Set;return new Set(e),t.reduce((o,a)=>{let i=JSON.stringify(AT(a));return n.has(i)||(n.add(i),o.push({key:i,link:a})),o},[])}function WC(){let t=x.useContext(el);return x0(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function zT(){let t=x.useContext(_f);return x0(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var b0=x.createContext(void 0);b0.displayName="FrameworkContext";function KC(){let t=x.useContext(b0);return x0(t,"You must render this element inside a <HydratedRouter> element"),t}function IT(t,e){let n=x.useContext(b0),[o,a]=x.useState(!1),[i,l]=x.useState(!1),{onFocus:u,onBlur:d,onMouseEnter:f,onMouseLeave:g,onTouchStart:m}=e,p=x.useRef(null);x.useEffect(()=>{if(t==="render"&&l(!0),t==="viewport"){let C=M=>{M.forEach(R=>{l(R.isIntersecting)})},w=new IntersectionObserver(C,{threshold:.5});return p.current&&w.observe(p.current),()=>{w.disconnect()}}},[t]),x.useEffect(()=>{if(o){let C=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(C)}}},[o]);let v=()=>{a(!0)},S=()=>{a(!1),l(!1)};return n?t!=="intent"?[i,p,{}]:[i,p,{onFocus:nc(u,v),onBlur:nc(d,S),onMouseEnter:nc(f,v),onMouseLeave:nc(g,S),onTouchStart:nc(m,v)}]:[!1,p,{}]}function nc(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function PT({page:t,...e}){let{router:n}=WC(),o=x.useMemo(()=>jC(n.routes,t,n.basename),[n.routes,t,n.basename]);return o?x.createElement(LT,{page:t,matches:o,...e}):null}function $T(t){let{manifest:e,routeModules:n}=KC(),[o,a]=x.useState([]);return x.useEffect(()=>{let i=!1;return TT(t,e,n).then(l=>{i||a(l)}),()=>{i=!0}},[t,e,n]),o}function LT({page:t,matches:e,...n}){let o=ua(),{future:a,manifest:i,routeModules:l}=KC(),{basename:u}=WC(),{loaderData:d,matches:f}=zT(),g=x.useMemo(()=>Kb(t,e,f,i,o,"data"),[t,e,f,i,o]),m=x.useMemo(()=>Kb(t,e,f,i,o,"assets"),[t,e,f,i,o]),p=x.useMemo(()=>{if(t===o.pathname+o.search+o.hash)return[];let C=new Set,w=!1;if(e.forEach(R=>{let E=i.routes[R.route.id];!E||!E.hasLoader||(!g.some(N=>N.route.id===R.route.id)&&R.route.id in d&&l[R.route.id]?.shouldRevalidate||E.hasClientLoader?w=!0:C.add(R.route.id))}),C.size===0)return[];let M=NT(t,u,a.unstable_trailingSlashAwareDataRequests,"data");return w&&C.size>0&&M.searchParams.set("_routes",e.filter(R=>C.has(R.route.id)).map(R=>R.route.id).join(",")),[M.pathname+M.search]},[u,a.unstable_trailingSlashAwareDataRequests,d,o,i,g,e,t,l]),v=x.useMemo(()=>kT(m,i),[m,i]),S=$T(m);return x.createElement(x.Fragment,null,p.map(C=>x.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...n})),v.map(C=>x.createElement("link",{key:C,rel:"modulepreload",href:C,...n})),S.map(({key:C,link:w})=>x.createElement("link",{key:C,nonce:n.nonce,...w,crossOrigin:w.crossOrigin??n.crossOrigin})))}function HT(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var BT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{BT&&(window.__reactRouterVersion="7.13.0")}catch{}function VT({basename:t,children:e,unstable_useTransitions:n,window:o}){let a=x.useRef();a.current==null&&(a.current=w4({window:o,v5Compat:!0}));let i=a.current,[l,u]=x.useState({action:i.action,location:i.location}),d=x.useCallback(f=>{n===!1?u(f):x.startTransition(()=>u(f))},[n]);return x.useLayoutEffect(()=>i.listen(d),[i,d]),x.createElement(yT,{basename:t,children:e,location:l.location,navigationType:l.action,navigator:i,unstable_useTransitions:n})}var XC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,w0=x.forwardRef(function({onClick:e,discover:n="render",prefetch:o="none",relative:a,reloadDocument:i,replace:l,state:u,target:d,to:f,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:p,...v},S){let{basename:C,unstable_useTransitions:w}=x.useContext(No),M=typeof f=="string"&&XC.test(f),R=$C(f,C);f=R.to;let E=tT(f,{relative:a}),[N,D,T]=IT(o,v),k=GT(f,{replace:l,state:u,target:d,preventScrollReset:g,relative:a,viewTransition:m,unstable_defaultShouldRevalidate:p,unstable_useTransitions:w});function A(W){e&&e(W),W.defaultPrevented||k(W)}let B=x.createElement("a",{...v,...T,href:R.absoluteURL||E,onClick:R.isExternal||i?e:A,ref:HT(S,D),target:d,"data-discover":!M&&n==="render"?"true":void 0});return N&&!M?x.createElement(x.Fragment,null,B,x.createElement(PT,{page:E})):B});w0.displayName="Link";var FT=x.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:o="",end:a=!1,style:i,to:l,viewTransition:u,children:d,...f},g){let m=Uc(l,{relative:f.relative}),p=ua(),v=x.useContext(_f),{navigator:S,basename:C}=x.useContext(No),w=v!=null&&ZT(m)&&u===!0,M=S.encodeLocation?S.encodeLocation(m).pathname:m.pathname,R=p.pathname,E=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(R=R.toLowerCase(),E=E?E.toLowerCase():null,M=M.toLowerCase()),E&&C&&(E=ra(E,C)||E);const N=M!=="/"&&M.endsWith("/")?M.length-1:M.length;let D=R===M||!a&&R.startsWith(M)&&R.charAt(N)==="/",T=E!=null&&(E===M||!a&&E.startsWith(M)&&E.charAt(M.length)==="/"),k={isActive:D,isPending:T,isTransitioning:w},A=D?e:void 0,B;typeof o=="function"?B=o(k):B=[o,D?"active":null,T?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let W=typeof i=="function"?i(k):i;return x.createElement(w0,{...f,"aria-current":A,className:B,ref:g,style:W,to:l,viewTransition:u},typeof d=="function"?d(k):d)});FT.displayName="NavLink";var UT=x.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:o,replace:a,state:i,method:l=Yd,action:u,onSubmit:d,relative:f,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:p,...v},S)=>{let{unstable_useTransitions:C}=x.useContext(No),w=KT(),M=XT(u,{relative:f}),R=l.toLowerCase()==="get"?"get":"post",E=typeof u=="string"&&XC.test(u),N=D=>{if(d&&d(D),D.defaultPrevented)return;D.preventDefault();let T=D.nativeEvent.submitter,k=T?.getAttribute("formmethod")||l,A=()=>w(T||D.currentTarget,{fetcherKey:e,method:k,navigate:n,replace:a,state:i,relative:f,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:p});C&&n!==!1?x.startTransition(()=>A()):A()};return x.createElement("form",{ref:S,method:R,action:M,onSubmit:o?d:N,...v,"data-discover":!E&&t==="render"?"true":void 0})});UT.displayName="Form";function YT(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ZC(t){let e=x.useContext(el);return rn(e,YT(t)),e}function GT(t,{target:e,replace:n,state:o,preventScrollReset:a,relative:i,viewTransition:l,unstable_defaultShouldRevalidate:u,unstable_useTransitions:d}={}){let f=UC(),g=ua(),m=Uc(t,{relative:i});return x.useCallback(p=>{if(CT(p,e)){p.preventDefault();let v=n!==void 0?n:Sc(g)===Sc(m),S=()=>f(t,{replace:v,state:o,preventScrollReset:a,relative:i,viewTransition:l,unstable_defaultShouldRevalidate:u});d?x.startTransition(()=>S()):S()}},[g,f,m,n,o,e,t,a,i,l,u,d])}var qT=0,WT=()=>`__${String(++qT)}__`;function KT(){let{router:t}=ZC("useSubmit"),{basename:e}=x.useContext(No),n=fT(),o=t.fetch,a=t.navigate;return x.useCallback(async(i,l={})=>{let{action:u,method:d,encType:f,formData:g,body:m}=MT(i,e);if(l.navigate===!1){let p=l.fetcherKey||WT();await o(p,n,l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:m,formMethod:l.method||d,formEncType:l.encType||f,flushSync:l.flushSync})}else await a(l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:m,formMethod:l.method||d,formEncType:l.encType||f,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[o,a,e,n])}function XT(t,{relative:e}={}){let{basename:n}=x.useContext(No),o=x.useContext(Er);rn(o,"useFormAction must be used inside a RouteContext");let[a]=o.matches.slice(-1),i={...Uc(t||".",{relative:e})},l=ua();if(t==null){i.search=l.search;let u=new URLSearchParams(i.search),d=u.getAll("index");if(d.some(g=>g==="")){u.delete("index"),d.filter(m=>m).forEach(m=>u.append("index",m));let g=u.toString();i.search=g?`?${g}`:""}}return(!t||t===".")&&a.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:na([n,i.pathname])),Sc(i)}function ZT(t,{relative:e}={}){let n=x.useContext(HC);rn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=ZC("useViewTransitionState"),a=Uc(t,{relative:e});if(!n.isTransitioning)return!1;let i=ra(n.currentLocation.pathname,o)||n.currentLocation.pathname,l=ra(n.nextLocation.pathname,o)||n.nextLocation.pathname;return nf(a.pathname,l)!=null||nf(a.pathname,i)!=null}var nl=AC();const QC=h0(nl);var Og={exports:{}},Ag={};var Xb;function QT(){if(Xb)return Ag;Xb=1;var t=Qi().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Ag.c=function(e){return t.H.useMemoCache(e)},Ag}var Zb;function JT(){return Zb||(Zb=1,Og.exports=QT()),Og.exports}var be=JT();function ek(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}const tk=t=>{switch(t){case"success":return rk;case"info":return sk;case"warning":return ak;case"error":return ik;default:return null}},nk=Array(12).fill(0),ok=({visible:t,className:e})=>de.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},de.createElement("div",{className:"sonner-spinner"},nk.map((n,o)=>de.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),rk=de.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},de.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),ak=de.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},de.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),sk=de.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},de.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),ik=de.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},de.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),lk=de.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},de.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),de.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),ck=()=>{const[t,e]=de.useState(document.hidden);return de.useEffect(()=>{const n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t};let Mp=1;class uk{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;const{message:o,...a}=e,i=typeof e?.id=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:Mp++,l=this.toasts.find(d=>d.id===i),u=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),l?this.toasts=this.toasts.map(d=>d.id===i?(this.publish({...d,...e,id:i,title:o}),{...d,...e,id:i,dismissible:u,title:o}):d):this.addToast({title:o,...a,dismissible:u,id:i}),i},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:e,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(o=>o({id:n.id,dismiss:!0}))}),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let o;n.loading!==void 0&&(o=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const a=Promise.resolve(e instanceof Function?e():e);let i=o!==void 0,l;const u=a.then(async f=>{if(l=["resolve",f],de.isValidElement(f))i=!1,this.create({id:o,type:"default",message:f});else if(fk(f)&&!f.ok){i=!1;const m=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,S=typeof m=="object"&&!de.isValidElement(m)?m:{message:m};this.create({id:o,type:"error",description:p,...S})}else if(f instanceof Error){i=!1;const m=typeof n.error=="function"?await n.error(f):n.error,p=typeof n.description=="function"?await n.description(f):n.description,S=typeof m=="object"&&!de.isValidElement(m)?m:{message:m};this.create({id:o,type:"error",description:p,...S})}else if(n.success!==void 0){i=!1;const m=typeof n.success=="function"?await n.success(f):n.success,p=typeof n.description=="function"?await n.description(f):n.description,S=typeof m=="object"&&!de.isValidElement(m)?m:{message:m};this.create({id:o,type:"success",description:p,...S})}}).catch(async f=>{if(l=["reject",f],n.error!==void 0){i=!1;const g=typeof n.error=="function"?await n.error(f):n.error,m=typeof n.description=="function"?await n.description(f):n.description,v=typeof g=="object"&&!de.isValidElement(g)?g:{message:g};this.create({id:o,type:"error",description:m,...v})}}).finally(()=>{i&&(this.dismiss(o),o=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((f,g)=>u.then(()=>l[0]==="reject"?g(l[1]):f(l[1])).catch(g));return typeof o!="string"&&typeof o!="number"?{unwrap:d}:Object.assign(o,{unwrap:d})},this.custom=(e,n)=>{const o=n?.id||Mp++;return this.create({jsx:e(o),id:o,...n}),o},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const so=new uk,dk=(t,e)=>{const n=e?.id||Mp++;return so.addToast({title:t,...e,id:n}),n},fk=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",hk=dk,mk=()=>so.toasts,gk=()=>so.getActiveToasts(),hn=Object.assign(hk,{success:so.success,info:so.info,warning:so.warning,error:so.error,custom:so.custom,message:so.message,promise:so.promise,dismiss:so.dismiss,loading:so.loading},{getHistory:mk,getToasts:gk});ek("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Ed(t){return t.label!==void 0}const pk=3,yk="24px",vk="16px",Qb=4e3,xk=356,bk=14,wk=45,Sk=200;function fr(...t){return t.filter(Boolean).join(" ")}function Ck(t){const[e,n]=t.split("-"),o=[];return e&&o.push(e),n&&o.push(n),o}const Ek=t=>{var e,n,o,a,i,l,u,d,f;const{invert:g,toast:m,unstyled:p,interacting:v,setHeights:S,visibleToasts:C,heights:w,index:M,toasts:R,expanded:E,removeToast:N,defaultRichColors:D,closeButton:T,style:k,cancelButtonStyle:A,actionButtonStyle:B,className:W="",descriptionClassName:U="",duration:Y,position:Z,gap:I,expandByDefault:G,classNames:j,icons:L,closeButtonAriaLabel:$="Close toast"}=t,[H,X]=de.useState(null),[P,z]=de.useState(null),[V,q]=de.useState(!1),[J,oe]=de.useState(!1),[K,ee]=de.useState(!1),[ae,ce]=de.useState(!1),[ge,se]=de.useState(!1),[ve,De]=de.useState(0),[Be,Ie]=de.useState(0),lt=de.useRef(m.duration||Y||Qb),ln=de.useRef(null),ht=de.useRef(null),bn=M===0,cn=M+1<=C,Vt=m.type,mn=m.dismissible!==!1,zt=m.className||"",Nn=m.descriptionClassName||"",yn=de.useMemo(()=>w.findIndex(Te=>Te.toastId===m.id)||0,[w,m.id]),In=de.useMemo(()=>{var Te;return(Te=m.closeButton)!=null?Te:T},[m.closeButton,T]),jn=de.useMemo(()=>m.duration||Y||Qb,[m.duration,Y]),_e=de.useRef(0),Ue=de.useRef(0),Et=de.useRef(0),Xe=de.useRef(null),[at,gt]=Z.split("-"),qt=de.useMemo(()=>w.reduce((Te,Ot,Kt)=>Kt>=yn?Te:Te+Ot.height,0),[w,yn]),Wt=ck(),Qn=m.invert||g,_t=Vt==="loading";Ue.current=de.useMemo(()=>yn*I+qt,[yn,qt]),de.useEffect(()=>{lt.current=jn},[jn]),de.useEffect(()=>{q(!0)},[]),de.useEffect(()=>{const Te=ht.current;if(Te){const Ot=Te.getBoundingClientRect().height;return Ie(Ot),S(Kt=>[{toastId:m.id,height:Ot,position:m.position},...Kt]),()=>S(Kt=>Kt.filter(un=>un.toastId!==m.id))}},[S,m.id]),de.useLayoutEffect(()=>{if(!V)return;const Te=ht.current,Ot=Te.style.height;Te.style.height="auto";const Kt=Te.getBoundingClientRect().height;Te.style.height=Ot,Ie(Kt),S(un=>un.find(Dt=>Dt.toastId===m.id)?un.map(Dt=>Dt.toastId===m.id?{...Dt,height:Kt}:Dt):[{toastId:m.id,height:Kt,position:m.position},...un])},[V,m.title,m.description,S,m.id,m.jsx,m.action,m.cancel]);const Ve=de.useCallback(()=>{oe(!0),De(Ue.current),S(Te=>Te.filter(Ot=>Ot.toastId!==m.id)),setTimeout(()=>{N(m)},Sk)},[m,N,S,Ue]);de.useEffect(()=>{if(m.promise&&Vt==="loading"||m.duration===1/0||m.type==="loading")return;let Te;return E||v||Wt?(()=>{if(Et.current<_e.current){const un=new Date().getTime()-_e.current;lt.current=lt.current-un}Et.current=new Date().getTime()})():lt.current!==1/0&&(_e.current=new Date().getTime(),Te=setTimeout(()=>{m.onAutoClose==null||m.onAutoClose.call(m,m),Ve()},lt.current)),()=>clearTimeout(Te)},[E,v,m,Vt,Wt,Ve]),de.useEffect(()=>{m.delete&&(Ve(),m.onDismiss==null||m.onDismiss.call(m,m))},[Ve,m.delete]);function nt(){var Te;if(L?.loading){var Ot;return de.createElement("div",{className:fr(j?.loader,m==null||(Ot=m.classNames)==null?void 0:Ot.loader,"sonner-loader"),"data-visible":Vt==="loading"},L.loading)}return de.createElement(ok,{className:fr(j?.loader,m==null||(Te=m.classNames)==null?void 0:Te.loader),visible:Vt==="loading"})}const Ye=m.icon||L?.[Vt]||tk(Vt);var st,$t;return de.createElement("li",{tabIndex:0,ref:ht,className:fr(W,zt,j?.toast,m==null||(e=m.classNames)==null?void 0:e.toast,j?.default,j?.[Vt],m==null||(n=m.classNames)==null?void 0:n[Vt]),"data-sonner-toast":"","data-rich-colors":(st=m.richColors)!=null?st:D,"data-styled":!(m.jsx||m.unstyled||p),"data-mounted":V,"data-promise":!!m.promise,"data-swiped":ge,"data-removed":J,"data-visible":cn,"data-y-position":at,"data-x-position":gt,"data-index":M,"data-front":bn,"data-swiping":K,"data-dismissible":mn,"data-type":Vt,"data-invert":Qn,"data-swipe-out":ae,"data-swipe-direction":P,"data-expanded":!!(E||G&&V),"data-testid":m.testId,style:{"--index":M,"--toasts-before":M,"--z-index":R.length-M,"--offset":`${J?ve:Ue.current}px`,"--initial-height":G?"auto":`${Be}px`,...k,...m.style},onDragEnd:()=>{ee(!1),X(null),Xe.current=null},onPointerDown:Te=>{Te.button!==2&&(_t||!mn||(ln.current=new Date,De(Ue.current),Te.target.setPointerCapture(Te.pointerId),Te.target.tagName!=="BUTTON"&&(ee(!0),Xe.current={x:Te.clientX,y:Te.clientY})))},onPointerUp:()=>{var Te,Ot,Kt;if(ae||!mn)return;Xe.current=null;const un=Number(((Te=ht.current)==null?void 0:Te.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Pn=Number(((Ot=ht.current)==null?void 0:Ot.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Dt=new Date().getTime()-((Kt=ln.current)==null?void 0:Kt.getTime()),Rn=H==="x"?un:Pn,Uo=Math.abs(Rn)/Dt;if(Math.abs(Rn)>=wk||Uo>.11){De(Ue.current),m.onDismiss==null||m.onDismiss.call(m,m),z(H==="x"?un>0?"right":"left":Pn>0?"down":"up"),Ve(),ce(!0);return}else{var vt,Dn;(vt=ht.current)==null||vt.style.setProperty("--swipe-amount-x","0px"),(Dn=ht.current)==null||Dn.style.setProperty("--swipe-amount-y","0px")}se(!1),ee(!1),X(null)},onPointerMove:Te=>{var Ot,Kt,un;if(!Xe.current||!mn||((Ot=window.getSelection())==null?void 0:Ot.toString().length)>0)return;const Dt=Te.clientY-Xe.current.y,Rn=Te.clientX-Xe.current.x;var Uo;const vt=(Uo=t.swipeDirections)!=null?Uo:Ck(Z);!H&&(Math.abs(Rn)>1||Math.abs(Dt)>1)&&X(Math.abs(Rn)>Math.abs(Dt)?"x":"y");let Dn={x:0,y:0};const Do=Un=>1/(1.5+Math.abs(Un)/20);if(H==="y"){if(vt.includes("top")||vt.includes("bottom"))if(vt.includes("top")&&Dt<0||vt.includes("bottom")&&Dt>0)Dn.y=Dt;else{const Un=Dt*Do(Dt);Dn.y=Math.abs(Un)<Math.abs(Dt)?Un:Dt}}else if(H==="x"&&(vt.includes("left")||vt.includes("right")))if(vt.includes("left")&&Rn<0||vt.includes("right")&&Rn>0)Dn.x=Rn;else{const Un=Rn*Do(Rn);Dn.x=Math.abs(Un)<Math.abs(Rn)?Un:Rn}(Math.abs(Dn.x)>0||Math.abs(Dn.y)>0)&&se(!0),(Kt=ht.current)==null||Kt.style.setProperty("--swipe-amount-x",`${Dn.x}px`),(un=ht.current)==null||un.style.setProperty("--swipe-amount-y",`${Dn.y}px`)}},In&&!m.jsx&&Vt!=="loading"?de.createElement("button",{"aria-label":$,"data-disabled":_t,"data-close-button":!0,onClick:_t||!mn?()=>{}:()=>{Ve(),m.onDismiss==null||m.onDismiss.call(m,m)},className:fr(j?.closeButton,m==null||(o=m.classNames)==null?void 0:o.closeButton)},($t=L?.close)!=null?$t:lk):null,(Vt||m.icon||m.promise)&&m.icon!==null&&(L?.[Vt]!==null||m.icon)?de.createElement("div",{"data-icon":"",className:fr(j?.icon,m==null||(a=m.classNames)==null?void 0:a.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||nt():null,m.type!=="loading"?Ye:null):null,de.createElement("div",{"data-content":"",className:fr(j?.content,m==null||(i=m.classNames)==null?void 0:i.content)},de.createElement("div",{"data-title":"",className:fr(j?.title,m==null||(l=m.classNames)==null?void 0:l.title)},m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title),m.description?de.createElement("div",{"data-description":"",className:fr(U,Nn,j?.description,m==null||(u=m.classNames)==null?void 0:u.description)},typeof m.description=="function"?m.description():m.description):null),de.isValidElement(m.cancel)?m.cancel:m.cancel&&Ed(m.cancel)?de.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||A,onClick:Te=>{Ed(m.cancel)&&mn&&(m.cancel.onClick==null||m.cancel.onClick.call(m.cancel,Te),Ve())},className:fr(j?.cancelButton,m==null||(d=m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,de.isValidElement(m.action)?m.action:m.action&&Ed(m.action)?de.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||B,onClick:Te=>{Ed(m.action)&&(m.action.onClick==null||m.action.onClick.call(m.action,Te),!Te.defaultPrevented&&Ve())},className:fr(j?.actionButton,m==null||(f=m.classNames)==null?void 0:f.actionButton)},m.action.label):null)};function Jb(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function _k(t,e){const n={};return[t,e].forEach((o,a)=>{const i=a===1,l=i?"--mobile-offset":"--offset",u=i?vk:yk;function d(f){["top","right","bottom","left"].forEach(g=>{n[`${l}-${g}`]=typeof f=="number"?`${f}px`:f})}typeof o=="number"||typeof o=="string"?d(o):typeof o=="object"?["top","right","bottom","left"].forEach(f=>{o[f]===void 0?n[`${l}-${f}`]=u:n[`${l}-${f}`]=typeof o[f]=="number"?`${o[f]}px`:o[f]}):d(u)}),n}const Mk=de.forwardRef(function(e,n){const{id:o,invert:a,position:i="bottom-right",hotkey:l=["altKey","KeyT"],expand:u,closeButton:d,className:f,offset:g,mobileOffset:m,theme:p="light",richColors:v,duration:S,style:C,visibleToasts:w=pk,toastOptions:M,dir:R=Jb(),gap:E=bk,icons:N,containerAriaLabel:D="Notifications"}=e,[T,k]=de.useState([]),A=de.useMemo(()=>o?T.filter(V=>V.toasterId===o):T.filter(V=>!V.toasterId),[T,o]),B=de.useMemo(()=>Array.from(new Set([i].concat(A.filter(V=>V.position).map(V=>V.position)))),[A,i]),[W,U]=de.useState([]),[Y,Z]=de.useState(!1),[I,G]=de.useState(!1),[j,L]=de.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=de.useRef(null),H=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),X=de.useRef(null),P=de.useRef(!1),z=de.useCallback(V=>{k(q=>{var J;return(J=q.find(oe=>oe.id===V.id))!=null&&J.delete||so.dismiss(V.id),q.filter(({id:oe})=>oe!==V.id)})},[]);return de.useEffect(()=>so.subscribe(V=>{if(V.dismiss){requestAnimationFrame(()=>{k(q=>q.map(J=>J.id===V.id?{...J,delete:!0}:J))});return}setTimeout(()=>{QC.flushSync(()=>{k(q=>{const J=q.findIndex(oe=>oe.id===V.id);return J!==-1?[...q.slice(0,J),{...q[J],...V},...q.slice(J+1)]:[V,...q]})})})}),[T]),de.useEffect(()=>{if(p!=="system"){L(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),typeof window>"u")return;const V=window.matchMedia("(prefers-color-scheme: dark)");try{V.addEventListener("change",({matches:q})=>{L(q?"dark":"light")})}catch{V.addListener(({matches:J})=>{try{L(J?"dark":"light")}catch(oe){console.error(oe)}})}},[p]),de.useEffect(()=>{T.length<=1&&Z(!1)},[T]),de.useEffect(()=>{const V=q=>{var J;if(l.every(ee=>q[ee]||q.code===ee)){var K;Z(!0),(K=$.current)==null||K.focus()}q.code==="Escape"&&(document.activeElement===$.current||(J=$.current)!=null&&J.contains(document.activeElement))&&Z(!1)};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[l]),de.useEffect(()=>{if($.current)return()=>{X.current&&(X.current.focus({preventScroll:!0}),X.current=null,P.current=!1)}},[$.current]),de.createElement("section",{ref:n,"aria-label":`${D} ${H}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},B.map((V,q)=>{var J;const[oe,K]=V.split("-");return A.length?de.createElement("ol",{key:V,dir:R==="auto"?Jb():R,tabIndex:-1,ref:$,className:f,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":oe,"data-x-position":K,style:{"--front-toast-height":`${((J=W[0])==null?void 0:J.height)||0}px`,"--width":`${xk}px`,"--gap":`${E}px`,...C,..._k(g,m)},onBlur:ee=>{P.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(P.current=!1,X.current&&(X.current.focus({preventScroll:!0}),X.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||P.current||(P.current=!0,X.current=ee.relatedTarget)},onMouseEnter:()=>Z(!0),onMouseMove:()=>Z(!0),onMouseLeave:()=>{I||Z(!1)},onDragEnd:()=>Z(!1),onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||G(!0)},onPointerUp:()=>G(!1)},A.filter(ee=>!ee.position&&q===0||ee.position===V).map((ee,ae)=>{var ce,ge;return de.createElement(Ek,{key:ee.id,icons:N,index:ae,toast:ee,defaultRichColors:v,duration:(ce=M?.duration)!=null?ce:S,className:M?.className,descriptionClassName:M?.descriptionClassName,invert:a,visibleToasts:w,closeButton:(ge=M?.closeButton)!=null?ge:d,interacting:I,position:V,style:M?.style,unstyled:M?.unstyled,classNames:M?.classNames,cancelButtonStyle:M?.cancelButtonStyle,actionButtonStyle:M?.actionButtonStyle,closeButtonAriaLabel:M?.closeButtonAriaLabel,removeToast:z,toasts:A.filter(se=>se.position==ee.position),heights:W.filter(se=>se.position==ee.position),setHeights:U,expandByDefault:u,gap:E,expanded:Y,swipeDirections:e.swipeDirections})})):null}))});function JC(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(n=JC(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function e2(){for(var t,e,n=0,o="",a=arguments.length;n<a;n++)(t=arguments[n])&&(e=JC(t))&&(o&&(o+=" "),o+=e);return o}const ew=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,tw=e2,Nf=(t,e)=>n=>{var o;if(e?.variants==null)return tw(t,n?.class,n?.className);const{variants:a,defaultVariants:i}=e,l=Object.keys(a).map(f=>{const g=n?.[f],m=i?.[f];if(g===null)return null;const p=ew(g)||ew(m);return a[f][p]}),u=n&&Object.entries(n).reduce((f,g)=>{let[m,p]=g;return p===void 0||(f[m]=p),f},{}),d=e==null||(o=e.compoundVariants)===null||o===void 0?void 0:o.reduce((f,g)=>{let{class:m,className:p,...v}=g;return Object.entries(v).every(S=>{let[C,w]=S;return Array.isArray(w)?w.includes({...i,...u}[C]):{...i,...u}[C]===w})?[...f,m,p]:f},[]);return tw(t,l,d,n?.class,n?.className)};function nw(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function aa(...t){return e=>{let n=!1;const o=t.map(a=>{const i=nw(a,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<o.length;a++){const i=o[a];typeof i=="function"?i():nw(t[a],null)}}}}function Rt(...t){return x.useCallback(aa(...t),t)}function Ga(t){const e=Nk(t),n=x.forwardRef((o,a)=>{const{children:i,...l}=o,u=x.Children.toArray(i),d=u.find(Dk);if(d){const f=d.props.children,g=u.map(m=>m===d?x.Children.count(f)>1?x.Children.only(null):x.isValidElement(f)?f.props.children:null:m);return y.jsx(e,{...l,ref:a,children:x.isValidElement(f)?x.cloneElement(f,void 0,g):null})}return y.jsx(e,{...l,ref:a,children:i})});return n.displayName=`${t}.Slot`,n}var Rf=Ga("Slot");function Nk(t){const e=x.forwardRef((n,o)=>{const{children:a,...i}=n;if(x.isValidElement(a)){const l=kk(a),u=Tk(i,a.props);return a.type!==x.Fragment&&(u.ref=o?aa(o,l):l),x.cloneElement(a,u)}return x.Children.count(a)>1?x.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var t2=Symbol("radix.slottable");function Rk(t){const e=({children:n})=>y.jsx(y.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=t2,e}function Dk(t){return x.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===t2}function Tk(t,e){const n={...e};for(const o in e){const a=t[o],i=e[o];/^on[A-Z]/.test(o)?a&&i?n[o]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(n[o]=a):o==="style"?n[o]={...a,...i}:o==="className"&&(n[o]=[a,i].filter(Boolean).join(" "))}return{...t,...n}}function kk(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Ok=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],et=Ok.reduce((t,e)=>{const n=Ga(`Primitive.${e}`),o=x.forwardRef((a,i)=>{const{asChild:l,...u}=a,d=l?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(d,{...u,ref:i})});return o.displayName=`Primitive.${e}`,{...t,[e]:o}},{});function n2(t,e){t&&nl.flushSync(()=>t.dispatchEvent(e))}var o2=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Ak="VisuallyHidden",r2=x.forwardRef((t,e)=>y.jsx(et.span,{...t,ref:e,style:{...o2,...t.style}}));r2.displayName=Ak;var jk=r2;function zk(t,e){const n=x.createContext(e),o=i=>{const{children:l,...u}=i,d=x.useMemo(()=>u,Object.values(u));return y.jsx(n.Provider,{value:d,children:l})};o.displayName=t+"Provider";function a(i){const l=x.useContext(n);if(l)return l;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[o,a]}function _r(t,e=[]){let n=[];function o(i,l){const u=x.createContext(l),d=n.length;n=[...n,l];const f=m=>{const{scope:p,children:v,...S}=m,C=p?.[t]?.[d]||u,w=x.useMemo(()=>S,Object.values(S));return y.jsx(C.Provider,{value:w,children:v})};f.displayName=i+"Provider";function g(m,p){const v=p?.[t]?.[d]||u,S=x.useContext(v);if(S)return S;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${i}\``)}return[f,g]}const a=()=>{const i=n.map(l=>x.createContext(l));return function(u){const d=u?.[t]||i;return x.useMemo(()=>({[`__scope${t}`]:{...u,[t]:d}}),[u,d])}};return a.scopeName=t,[o,Ik(a,...e)]}function Ik(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const o=t.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const l=o.reduce((u,{useScope:d,scopeName:f})=>{const m=d(i)[`__scope${f}`];return{...u,...m}},{});return x.useMemo(()=>({[`__scope${e.scopeName}`]:l}),[l])}};return n.scopeName=e.scopeName,n}function S0(t){const e=t+"CollectionProvider",[n,o]=_r(e),[a,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),l=C=>{const{scope:w,children:M}=C,R=de.useRef(null),E=de.useRef(new Map).current;return y.jsx(a,{scope:w,itemMap:E,collectionRef:R,children:M})};l.displayName=e;const u=t+"CollectionSlot",d=Ga(u),f=de.forwardRef((C,w)=>{const{scope:M,children:R}=C,E=i(u,M),N=Rt(w,E.collectionRef);return y.jsx(d,{ref:N,children:R})});f.displayName=u;const g=t+"CollectionItemSlot",m="data-radix-collection-item",p=Ga(g),v=de.forwardRef((C,w)=>{const{scope:M,children:R,...E}=C,N=de.useRef(null),D=Rt(w,N),T=i(g,M);return de.useEffect(()=>(T.itemMap.set(N,{ref:N,...E}),()=>{T.itemMap.delete(N)})),y.jsx(p,{[m]:"",ref:D,children:R})});v.displayName=g;function S(C){const w=i(t+"CollectionConsumer",C);return de.useCallback(()=>{const R=w.collectionRef.current;if(!R)return[];const E=Array.from(R.querySelectorAll(`[${m}]`));return Array.from(w.itemMap.values()).sort((T,k)=>E.indexOf(T.ref.current)-E.indexOf(k.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:l,Slot:f,ItemSlot:v},S,o]}function ze(t,e,{checkForDefaultPrevented:n=!0}={}){return function(a){if(t?.(a),n===!1||!a.defaultPrevented)return e?.(a)}}var Kn=globalThis?.document?x.useLayoutEffect:()=>{},Pk=OC[" useInsertionEffect ".trim().toString()]||Kn;function qa({prop:t,defaultProp:e,onChange:n=()=>{},caller:o}){const[a,i,l]=$k({defaultProp:e,onChange:n}),u=t!==void 0,d=u?t:a;{const g=x.useRef(t!==void 0);x.useEffect(()=>{const m=g.current;m!==u&&console.warn(`${o} is changing from ${m?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=u},[u,o])}const f=x.useCallback(g=>{if(u){const m=Lk(g)?g(t):g;m!==t&&l.current?.(m)}else i(g)},[u,t,i,l]);return[d,f]}function $k({defaultProp:t,onChange:e}){const[n,o]=x.useState(t),a=x.useRef(n),i=x.useRef(e);return Pk(()=>{i.current=e},[e]),x.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,o,i]}function Lk(t){return typeof t=="function"}function Hk(t,e){return x.useReducer((n,o)=>e[n][o]??n,t)}var Ro=t=>{const{present:e,children:n}=t,o=Bk(e),a=typeof n=="function"?n({present:o.isPresent}):x.Children.only(n),i=Rt(o.ref,Vk(a));return typeof n=="function"||o.isPresent?x.cloneElement(a,{ref:i}):null};Ro.displayName="Presence";function Bk(t){const[e,n]=x.useState(),o=x.useRef(null),a=x.useRef(t),i=x.useRef("none"),l=t?"mounted":"unmounted",[u,d]=Hk(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const f=_d(o.current);i.current=u==="mounted"?f:"none"},[u]),Kn(()=>{const f=o.current,g=a.current;if(g!==t){const p=i.current,v=_d(f);t?d("MOUNT"):v==="none"||f?.display==="none"?d("UNMOUNT"):d(g&&p!==v?"ANIMATION_OUT":"UNMOUNT"),a.current=t}},[t,d]),Kn(()=>{if(e){let f;const g=e.ownerDocument.defaultView??window,m=v=>{const C=_d(o.current).includes(CSS.escape(v.animationName));if(v.target===e&&C&&(d("ANIMATION_END"),!a.current)){const w=e.style.animationFillMode;e.style.animationFillMode="forwards",f=g.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=w)})}},p=v=>{v.target===e&&(i.current=_d(o.current))};return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{g.clearTimeout(f),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[e,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:x.useCallback(f=>{o.current=f?getComputedStyle(f):null,n(f)},[])}}function _d(t){return t?.animationName||"none"}function Vk(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Fk=OC[" useId ".trim().toString()]||(()=>{}),Uk=0;function Fn(t){const[e,n]=x.useState(Fk());return Kn(()=>{n(o=>o??String(Uk++))},[t]),t||(e?`radix-${e}`:"")}var Yk=x.createContext(void 0);function Df(t){const e=x.useContext(Yk);return t||e||"ltr"}function wr(t){const e=x.useRef(t);return x.useEffect(()=>{e.current=t}),x.useMemo(()=>(...n)=>e.current?.(...n),[])}function Gk(t,e=globalThis?.document){const n=wr(t);x.useEffect(()=>{const o=a=>{a.key==="Escape"&&n(a)};return e.addEventListener("keydown",o,{capture:!0}),()=>e.removeEventListener("keydown",o,{capture:!0})},[n,e])}var qk="DismissableLayer",Np="dismissableLayer.update",Wk="dismissableLayer.pointerDownOutside",Kk="dismissableLayer.focusOutside",ow,a2=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ol=x.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:u,...d}=t,f=x.useContext(a2),[g,m]=x.useState(null),p=g?.ownerDocument??globalThis?.document,[,v]=x.useState({}),S=Rt(e,k=>m(k)),C=Array.from(f.layers),[w]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),M=C.indexOf(w),R=g?C.indexOf(g):-1,E=f.layersWithOutsidePointerEventsDisabled.size>0,N=R>=M,D=Qk(k=>{const A=k.target,B=[...f.branches].some(W=>W.contains(A));!N||B||(a?.(k),l?.(k),k.defaultPrevented||u?.())},p),T=Jk(k=>{const A=k.target;[...f.branches].some(W=>W.contains(A))||(i?.(k),l?.(k),k.defaultPrevented||u?.())},p);return Gk(k=>{R===f.layers.size-1&&(o?.(k),!k.defaultPrevented&&u&&(k.preventDefault(),u()))},p),x.useEffect(()=>{if(g)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(ow=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(g)),f.layers.add(g),rw(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=ow)}},[g,p,n,f]),x.useEffect(()=>()=>{g&&(f.layers.delete(g),f.layersWithOutsidePointerEventsDisabled.delete(g),rw())},[g,f]),x.useEffect(()=>{const k=()=>v({});return document.addEventListener(Np,k),()=>document.removeEventListener(Np,k)},[]),y.jsx(et.div,{...d,ref:S,style:{pointerEvents:E?N?"auto":"none":void 0,...t.style},onFocusCapture:ze(t.onFocusCapture,T.onFocusCapture),onBlurCapture:ze(t.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ze(t.onPointerDownCapture,D.onPointerDownCapture)})});ol.displayName=qk;var Xk="DismissableLayerBranch",Zk=x.forwardRef((t,e)=>{const n=x.useContext(a2),o=x.useRef(null),a=Rt(e,o);return x.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),y.jsx(et.div,{...t,ref:a})});Zk.displayName=Xk;function Qk(t,e=globalThis?.document){const n=wr(t),o=x.useRef(!1),a=x.useRef(()=>{});return x.useEffect(()=>{const i=u=>{if(u.target&&!o.current){let d=function(){s2(Wk,n,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(e.removeEventListener("click",a.current),a.current=d,e.addEventListener("click",a.current,{once:!0})):d()}else e.removeEventListener("click",a.current);o.current=!1},l=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),e.removeEventListener("pointerdown",i),e.removeEventListener("click",a.current)}},[e,n]),{onPointerDownCapture:()=>o.current=!0}}function Jk(t,e=globalThis?.document){const n=wr(t),o=x.useRef(!1);return x.useEffect(()=>{const a=i=>{i.target&&!o.current&&s2(Kk,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",a),()=>e.removeEventListener("focusin",a)},[e,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function rw(){const t=new CustomEvent(Np);document.dispatchEvent(t)}function s2(t,e,n,{discrete:o}){const a=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&a.addEventListener(t,e,{once:!0}),o?n2(a,i):a.dispatchEvent(i)}var jg="focusScope.autoFocusOnMount",zg="focusScope.autoFocusOnUnmount",aw={bubbles:!1,cancelable:!0},e5="FocusScope",Yc=x.forwardRef((t,e)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=t,[u,d]=x.useState(null),f=wr(a),g=wr(i),m=x.useRef(null),p=Rt(e,C=>d(C)),v=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(o){let C=function(E){if(v.paused||!u)return;const N=E.target;u.contains(N)?m.current=N:Ba(m.current,{select:!0})},w=function(E){if(v.paused||!u)return;const N=E.relatedTarget;N!==null&&(u.contains(N)||Ba(m.current,{select:!0}))},M=function(E){if(document.activeElement===document.body)for(const D of E)D.removedNodes.length>0&&Ba(u)};document.addEventListener("focusin",C),document.addEventListener("focusout",w);const R=new MutationObserver(M);return u&&R.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",w),R.disconnect()}}},[o,u,v.paused]),x.useEffect(()=>{if(u){iw.add(v);const C=document.activeElement;if(!u.contains(C)){const M=new CustomEvent(jg,aw);u.addEventListener(jg,f),u.dispatchEvent(M),M.defaultPrevented||(t5(s5(i2(u)),{select:!0}),document.activeElement===C&&Ba(u))}return()=>{u.removeEventListener(jg,f),setTimeout(()=>{const M=new CustomEvent(zg,aw);u.addEventListener(zg,g),u.dispatchEvent(M),M.defaultPrevented||Ba(C??document.body,{select:!0}),u.removeEventListener(zg,g),iw.remove(v)},0)}}},[u,f,g,v]);const S=x.useCallback(C=>{if(!n&&!o||v.paused)return;const w=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,M=document.activeElement;if(w&&M){const R=C.currentTarget,[E,N]=n5(R);E&&N?!C.shiftKey&&M===N?(C.preventDefault(),n&&Ba(E,{select:!0})):C.shiftKey&&M===E&&(C.preventDefault(),n&&Ba(N,{select:!0})):M===R&&C.preventDefault()}},[n,o,v.paused]);return y.jsx(et.div,{tabIndex:-1,...l,ref:p,onKeyDown:S})});Yc.displayName=e5;function t5(t,{select:e=!1}={}){const n=document.activeElement;for(const o of t)if(Ba(o,{select:e}),document.activeElement!==n)return}function n5(t){const e=i2(t),n=sw(e,t),o=sw(e.reverse(),t);return[n,o]}function i2(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const a=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||a?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function sw(t,e){for(const n of t)if(!o5(n,{upTo:e}))return n}function o5(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function r5(t){return t instanceof HTMLInputElement&&"select"in t}function Ba(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&r5(t)&&e&&t.select()}}var iw=a5();function a5(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=lw(t,e),t.unshift(e)},remove(e){t=lw(t,e),t[0]?.resume()}}}function lw(t,e){const n=[...t],o=n.indexOf(e);return o!==-1&&n.splice(o,1),n}function s5(t){return t.filter(e=>e.tagName!=="A")}var i5="Portal",rl=x.forwardRef((t,e)=>{const{container:n,...o}=t,[a,i]=x.useState(!1);Kn(()=>i(!0),[]);const l=n||a&&globalThis?.document?.body;return l?QC.createPortal(y.jsx(et.div,{...o,ref:e}),l):null});rl.displayName=i5;var Ig=0;function Tf(){x.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??cw()),document.body.insertAdjacentElement("beforeend",t[1]??cw()),Ig++,()=>{Ig===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Ig--}},[])}function cw(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var pr=function(){return pr=Object.assign||function(e){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},pr.apply(this,arguments)};function l2(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(t);a<o.length;a++)e.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(n[o[a]]=t[o[a]]);return n}function l5(t,e,n){if(n||arguments.length===2)for(var o=0,a=e.length,i;o<a;o++)(i||!(o in e))&&(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))}var qd="right-scroll-bar-position",Wd="width-before-scroll-bar",c5="with-scroll-bars-hidden",u5="--removed-body-scroll-bar-size";function Pg(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function d5(t,e){var n=x.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(o){var a=n.value;a!==o&&(n.value=o,n.callback(o,a))}}}})[0];return n.callback=e,n.facade}var f5=typeof window<"u"?x.useLayoutEffect:x.useEffect,uw=new WeakMap;function h5(t,e){var n=d5(null,function(o){return t.forEach(function(a){return Pg(a,o)})});return f5(function(){var o=uw.get(n);if(o){var a=new Set(o),i=new Set(t),l=n.current;a.forEach(function(u){i.has(u)||Pg(u,null)}),i.forEach(function(u){a.has(u)||Pg(u,l)})}uw.set(n,t)},[t]),n}function m5(t){return t}function g5(t,e){e===void 0&&(e=m5);var n=[],o=!1,a={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var l=e(i,o);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(i){for(o=!0;n.length;){var l=n;n=[],l.forEach(i)}n={push:function(u){return i(u)},filter:function(){return n}}},assignMedium:function(i){o=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(i),l=n}var d=function(){var g=l;l=[],g.forEach(i)},f=function(){return Promise.resolve().then(d)};f(),n={push:function(g){l.push(g),f()},filter:function(g){return l=l.filter(g),n}}}};return a}function p5(t){t===void 0&&(t={});var e=g5(null);return e.options=pr({async:!0,ssr:!1},t),e}var c2=function(t){var e=t.sideCar,n=l2(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=e.read();if(!o)throw new Error("Sidecar medium not found");return x.createElement(o,pr({},n))};c2.isSideCarExport=!0;function y5(t,e){return t.useMedium(e),c2}var u2=p5(),$g=function(){},kf=x.forwardRef(function(t,e){var n=x.useRef(null),o=x.useState({onScrollCapture:$g,onWheelCapture:$g,onTouchMoveCapture:$g}),a=o[0],i=o[1],l=t.forwardProps,u=t.children,d=t.className,f=t.removeScrollBar,g=t.enabled,m=t.shards,p=t.sideCar,v=t.noRelative,S=t.noIsolation,C=t.inert,w=t.allowPinchZoom,M=t.as,R=M===void 0?"div":M,E=t.gapMode,N=l2(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=p,T=h5([n,e]),k=pr(pr({},N),a);return x.createElement(x.Fragment,null,g&&x.createElement(D,{sideCar:u2,removeScrollBar:f,shards:m,noRelative:v,noIsolation:S,inert:C,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:E}),l?x.cloneElement(x.Children.only(u),pr(pr({},k),{ref:T})):x.createElement(R,pr({},k,{className:d,ref:T}),u))});kf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};kf.classNames={fullWidth:Wd,zeroRight:qd};var v5=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function x5(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=v5();return e&&t.setAttribute("nonce",e),t}function b5(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function w5(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var S5=function(){var t=0,e=null;return{add:function(n){t==0&&(e=x5())&&(b5(e,n),w5(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},C5=function(){var t=S5();return function(e,n){x.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},d2=function(){var t=C5(),e=function(n){var o=n.styles,a=n.dynamic;return t(o,a),null};return e},E5={left:0,top:0,right:0,gap:0},Lg=function(t){return parseInt(t||"",10)||0},_5=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],o=e[t==="padding"?"paddingTop":"marginTop"],a=e[t==="padding"?"paddingRight":"marginRight"];return[Lg(n),Lg(o),Lg(a)]},M5=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return E5;var e=_5(t),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,o-n+e[2]-e[0])}},N5=d2(),ji="data-scroll-locked",R5=function(t,e,n,o){var a=t.left,i=t.top,l=t.right,u=t.gap;return n===void 0&&(n="margin"),`
|
|
12
|
-
.`.concat(c5,` {
|
|
13
|
-
overflow: hidden `).concat(o,`;
|
|
14
|
-
padding-right: `).concat(u,"px ").concat(o,`;
|
|
15
|
-
}
|
|
16
|
-
body[`).concat(ji,`] {
|
|
17
|
-
overflow: hidden `).concat(o,`;
|
|
18
|
-
overscroll-behavior: contain;
|
|
19
|
-
`).concat([e&&"position: relative ".concat(o,";"),n==="margin"&&`
|
|
20
|
-
padding-left: `.concat(a,`px;
|
|
21
|
-
padding-top: `).concat(i,`px;
|
|
22
|
-
padding-right: `).concat(l,`px;
|
|
23
|
-
margin-left:0;
|
|
24
|
-
margin-top:0;
|
|
25
|
-
margin-right: `).concat(u,"px ").concat(o,`;
|
|
26
|
-
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(o,";")].filter(Boolean).join(""),`
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.`).concat(qd,` {
|
|
30
|
-
right: `).concat(u,"px ").concat(o,`;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.`).concat(Wd,` {
|
|
34
|
-
margin-right: `).concat(u,"px ").concat(o,`;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.`).concat(qd," .").concat(qd,` {
|
|
38
|
-
right: 0 `).concat(o,`;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.`).concat(Wd," .").concat(Wd,` {
|
|
42
|
-
margin-right: 0 `).concat(o,`;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
body[`).concat(ji,`] {
|
|
46
|
-
`).concat(u5,": ").concat(u,`px;
|
|
47
|
-
}
|
|
48
|
-
`)},dw=function(){var t=parseInt(document.body.getAttribute(ji)||"0",10);return isFinite(t)?t:0},D5=function(){x.useEffect(function(){return document.body.setAttribute(ji,(dw()+1).toString()),function(){var t=dw()-1;t<=0?document.body.removeAttribute(ji):document.body.setAttribute(ji,t.toString())}},[])},T5=function(t){var e=t.noRelative,n=t.noImportant,o=t.gapMode,a=o===void 0?"margin":o;D5();var i=x.useMemo(function(){return M5(a)},[a]);return x.createElement(N5,{styles:R5(i,!e,a,n?"":"!important")})},Rp=!1;if(typeof window<"u")try{var Md=Object.defineProperty({},"passive",{get:function(){return Rp=!0,!0}});window.addEventListener("test",Md,Md),window.removeEventListener("test",Md,Md)}catch{Rp=!1}var xi=Rp?{passive:!1}:!1,k5=function(t){return t.tagName==="TEXTAREA"},f2=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!k5(t)&&n[e]==="visible")},O5=function(t){return f2(t,"overflowY")},A5=function(t){return f2(t,"overflowX")},fw=function(t,e){var n=e.ownerDocument,o=e;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var a=h2(t,o);if(a){var i=m2(t,o),l=i[1],u=i[2];if(l>u)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},j5=function(t){var e=t.scrollTop,n=t.scrollHeight,o=t.clientHeight;return[e,n,o]},z5=function(t){var e=t.scrollLeft,n=t.scrollWidth,o=t.clientWidth;return[e,n,o]},h2=function(t,e){return t==="v"?O5(e):A5(e)},m2=function(t,e){return t==="v"?j5(e):z5(e)},I5=function(t,e){return t==="h"&&e==="rtl"?-1:1},P5=function(t,e,n,o,a){var i=I5(t,window.getComputedStyle(e).direction),l=i*o,u=n.target,d=e.contains(u),f=!1,g=l>0,m=0,p=0;do{if(!u)break;var v=m2(t,u),S=v[0],C=v[1],w=v[2],M=C-w-i*S;(S||M)&&h2(t,u)&&(m+=M,p+=S);var R=u.parentNode;u=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!d&&u!==document.body||d&&(e.contains(u)||e===u));return(g&&Math.abs(m)<1||!g&&Math.abs(p)<1)&&(f=!0),f},Nd=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},hw=function(t){return[t.deltaX,t.deltaY]},mw=function(t){return t&&"current"in t?t.current:t},$5=function(t,e){return t[0]===e[0]&&t[1]===e[1]},L5=function(t){return`
|
|
49
|
-
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
50
|
-
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
51
|
-
`)},H5=0,bi=[];function B5(t){var e=x.useRef([]),n=x.useRef([0,0]),o=x.useRef(),a=x.useState(H5++)[0],i=x.useState(d2)[0],l=x.useRef(t);x.useEffect(function(){l.current=t},[t]),x.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(a));var C=l5([t.lockRef.current],(t.shards||[]).map(mw),!0).filter(Boolean);return C.forEach(function(w){return w.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),C.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(a))})}}},[t.inert,t.lockRef.current,t.shards]);var u=x.useCallback(function(C,w){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!l.current.allowPinchZoom;var M=Nd(C),R=n.current,E="deltaX"in C?C.deltaX:R[0]-M[0],N="deltaY"in C?C.deltaY:R[1]-M[1],D,T=C.target,k=Math.abs(E)>Math.abs(N)?"h":"v";if("touches"in C&&k==="h"&&T.type==="range")return!1;var A=window.getSelection(),B=A&&A.anchorNode,W=B?B===T||B.contains(T):!1;if(W)return!1;var U=fw(k,T);if(!U)return!0;if(U?D=k:(D=k==="v"?"h":"v",U=fw(k,T)),!U)return!1;if(!o.current&&"changedTouches"in C&&(E||N)&&(o.current=D),!D)return!0;var Y=o.current||D;return P5(Y,w,C,Y==="h"?E:N)},[]),d=x.useCallback(function(C){var w=C;if(!(!bi.length||bi[bi.length-1]!==i)){var M="deltaY"in w?hw(w):Nd(w),R=e.current.filter(function(D){return D.name===w.type&&(D.target===w.target||w.target===D.shadowParent)&&$5(D.delta,M)})[0];if(R&&R.should){w.cancelable&&w.preventDefault();return}if(!R){var E=(l.current.shards||[]).map(mw).filter(Boolean).filter(function(D){return D.contains(w.target)}),N=E.length>0?u(w,E[0]):!l.current.noIsolation;N&&w.cancelable&&w.preventDefault()}}},[]),f=x.useCallback(function(C,w,M,R){var E={name:C,delta:w,target:M,should:R,shadowParent:V5(M)};e.current.push(E),setTimeout(function(){e.current=e.current.filter(function(N){return N!==E})},1)},[]),g=x.useCallback(function(C){n.current=Nd(C),o.current=void 0},[]),m=x.useCallback(function(C){f(C.type,hw(C),C.target,u(C,t.lockRef.current))},[]),p=x.useCallback(function(C){f(C.type,Nd(C),C.target,u(C,t.lockRef.current))},[]);x.useEffect(function(){return bi.push(i),t.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:p}),document.addEventListener("wheel",d,xi),document.addEventListener("touchmove",d,xi),document.addEventListener("touchstart",g,xi),function(){bi=bi.filter(function(C){return C!==i}),document.removeEventListener("wheel",d,xi),document.removeEventListener("touchmove",d,xi),document.removeEventListener("touchstart",g,xi)}},[]);var v=t.removeScrollBar,S=t.inert;return x.createElement(x.Fragment,null,S?x.createElement(i,{styles:L5(a)}):null,v?x.createElement(T5,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function V5(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const F5=y5(u2,B5);var Gc=x.forwardRef(function(t,e){return x.createElement(kf,pr({},t,{ref:e,sideCar:F5}))});Gc.classNames=kf.classNames;var U5=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},wi=new WeakMap,Rd=new WeakMap,Dd={},Hg=0,g2=function(t){return t&&(t.host||g2(t.parentNode))},Y5=function(t,e){return e.map(function(n){if(t.contains(n))return n;var o=g2(n);return o&&t.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},G5=function(t,e,n,o){var a=Y5(e,Array.isArray(t)?t:[t]);Dd[n]||(Dd[n]=new WeakMap);var i=Dd[n],l=[],u=new Set,d=new Set(a),f=function(m){!m||u.has(m)||(u.add(m),f(m.parentNode))};a.forEach(f);var g=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(p){if(u.has(p))g(p);else try{var v=p.getAttribute(o),S=v!==null&&v!=="false",C=(wi.get(p)||0)+1,w=(i.get(p)||0)+1;wi.set(p,C),i.set(p,w),l.push(p),C===1&&S&&Rd.set(p,!0),w===1&&p.setAttribute(n,"true"),S||p.setAttribute(o,"true")}catch(M){console.error("aria-hidden: cannot operate on ",p,M)}})};return g(e),u.clear(),Hg++,function(){l.forEach(function(m){var p=wi.get(m)-1,v=i.get(m)-1;wi.set(m,p),i.set(m,v),p||(Rd.has(m)||m.removeAttribute(o),Rd.delete(m)),v||m.removeAttribute(n)}),Hg--,Hg||(wi=new WeakMap,wi=new WeakMap,Rd=new WeakMap,Dd={})}},Of=function(t,e,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(t)?t:[t]),a=U5(t);return a?(o.push.apply(o,Array.from(a.querySelectorAll("[aria-live], script"))),G5(o,a,n,"aria-hidden")):function(){return null}},Af="Dialog",[p2]=_r(Af),[q5,ar]=p2(Af),y2=t=>{const{__scopeDialog:e,children:n,open:o,defaultOpen:a,onOpenChange:i,modal:l=!0}=t,u=x.useRef(null),d=x.useRef(null),[f,g]=qa({prop:o,defaultProp:a??!1,onChange:i,caller:Af});return y.jsx(q5,{scope:e,triggerRef:u,contentRef:d,contentId:Fn(),titleId:Fn(),descriptionId:Fn(),open:f,onOpenChange:g,onOpenToggle:x.useCallback(()=>g(m=>!m),[g]),modal:l,children:n})};y2.displayName=Af;var v2="DialogTrigger",x2=x.forwardRef((t,e)=>{const{__scopeDialog:n,...o}=t,a=ar(v2,n),i=Rt(e,a.triggerRef);return y.jsx(et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":_0(a.open),...o,ref:i,onClick:ze(t.onClick,a.onOpenToggle)})});x2.displayName=v2;var C0="DialogPortal",[W5,b2]=p2(C0,{forceMount:void 0}),w2=t=>{const{__scopeDialog:e,forceMount:n,children:o,container:a}=t,i=ar(C0,e);return y.jsx(W5,{scope:e,forceMount:n,children:x.Children.map(o,l=>y.jsx(Ro,{present:n||i.open,children:y.jsx(rl,{asChild:!0,container:a,children:l})}))})};w2.displayName=C0;var of="DialogOverlay",S2=x.forwardRef((t,e)=>{const n=b2(of,t.__scopeDialog),{forceMount:o=n.forceMount,...a}=t,i=ar(of,t.__scopeDialog);return i.modal?y.jsx(Ro,{present:o||i.open,children:y.jsx(X5,{...a,ref:e})}):null});S2.displayName=of;var K5=Ga("DialogOverlay.RemoveScroll"),X5=x.forwardRef((t,e)=>{const{__scopeDialog:n,...o}=t,a=ar(of,n);return y.jsx(Gc,{as:K5,allowPinchZoom:!0,shards:[a.contentRef],children:y.jsx(et.div,{"data-state":_0(a.open),...o,ref:e,style:{pointerEvents:"auto",...o.style}})})}),Ts="DialogContent",C2=x.forwardRef((t,e)=>{const n=b2(Ts,t.__scopeDialog),{forceMount:o=n.forceMount,...a}=t,i=ar(Ts,t.__scopeDialog);return y.jsx(Ro,{present:o||i.open,children:i.modal?y.jsx(Z5,{...a,ref:e}):y.jsx(Q5,{...a,ref:e})})});C2.displayName=Ts;var Z5=x.forwardRef((t,e)=>{const n=ar(Ts,t.__scopeDialog),o=x.useRef(null),a=Rt(e,n.contentRef,o);return x.useEffect(()=>{const i=o.current;if(i)return Of(i)},[]),y.jsx(E2,{...t,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ze(t.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ze(t.onPointerDownOutside,i=>{const l=i.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&i.preventDefault()}),onFocusOutside:ze(t.onFocusOutside,i=>i.preventDefault())})}),Q5=x.forwardRef((t,e)=>{const n=ar(Ts,t.__scopeDialog),o=x.useRef(!1),a=x.useRef(!1);return y.jsx(E2,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(o.current||n.triggerRef.current?.focus(),i.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;n.triggerRef.current?.contains(l)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),E2=x.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,...l}=t,u=ar(Ts,n),d=x.useRef(null),f=Rt(e,d);return Tf(),y.jsxs(y.Fragment,{children:[y.jsx(Yc,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i,children:y.jsx(ol,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":_0(u.open),...l,ref:f,onDismiss:()=>u.onOpenChange(!1)})}),y.jsxs(y.Fragment,{children:[y.jsx(J5,{titleId:u.titleId}),y.jsx(tO,{contentRef:d,descriptionId:u.descriptionId})]})]})}),E0="DialogTitle",_2=x.forwardRef((t,e)=>{const{__scopeDialog:n,...o}=t,a=ar(E0,n);return y.jsx(et.h2,{id:a.titleId,...o,ref:e})});_2.displayName=E0;var M2="DialogDescription",N2=x.forwardRef((t,e)=>{const{__scopeDialog:n,...o}=t,a=ar(M2,n);return y.jsx(et.p,{id:a.descriptionId,...o,ref:e})});N2.displayName=M2;var R2="DialogClose",D2=x.forwardRef((t,e)=>{const{__scopeDialog:n,...o}=t,a=ar(R2,n);return y.jsx(et.button,{type:"button",...o,ref:e,onClick:ze(t.onClick,()=>a.onOpenChange(!1))})});D2.displayName=R2;function _0(t){return t?"open":"closed"}var T2="DialogTitleWarning",[mK,k2]=zk(T2,{contentName:Ts,titleName:E0,docsSlug:"dialog"}),J5=({titleId:t})=>{const e=k2(T2),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
52
|
-
|
|
53
|
-
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
54
|
-
|
|
55
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return x.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},eO="DialogDescriptionWarning",tO=({contentRef:t,descriptionId:e})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${k2(eO).contentName}}.`;return x.useEffect(()=>{const a=t.current?.getAttribute("aria-describedby");e&&a&&(document.getElementById(e)||console.warn(o))},[o,t,e]),null},M0=y2,nO=x2,N0=w2,R0=S2,D0=C2,O2=_2,A2=N2,T0=D2,Bg={exports:{}},Vg={};var gw;function oO(){if(gw)return Vg;gw=1;var t=Qi();function e(m,p){return m===p&&(m!==0||1/m===1/p)||m!==m&&p!==p}var n=typeof Object.is=="function"?Object.is:e,o=t.useState,a=t.useEffect,i=t.useLayoutEffect,l=t.useDebugValue;function u(m,p){var v=p(),S=o({inst:{value:v,getSnapshot:p}}),C=S[0].inst,w=S[1];return i(function(){C.value=v,C.getSnapshot=p,d(C)&&w({inst:C})},[m,v,p]),a(function(){return d(C)&&w({inst:C}),m(function(){d(C)&&w({inst:C})})},[m]),l(v),v}function d(m){var p=m.getSnapshot;m=m.value;try{var v=p();return!n(m,v)}catch{return!0}}function f(m,p){return p()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return Vg.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:g,Vg}var pw;function rO(){return pw||(pw=1,Bg.exports=oO()),Bg.exports}function j2(t){const e=x.useRef({value:t,previous:t});return x.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function z2(t){const[e,n]=x.useState(void 0);return Kn(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const o=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let l,u;if("borderBoxSize"in i){const d=i.borderBoxSize,f=Array.isArray(d)?d[0]:d;l=f.inlineSize,u=f.blockSize}else l=t.offsetWidth,u=t.offsetHeight;n({width:l,height:u})});return o.observe(t,{box:"border-box"}),()=>o.unobserve(t)}else n(void 0)},[t]),e}var jf="Checkbox",[aO]=_r(jf),[sO,k0]=aO(jf);function iO(t){const{__scopeCheckbox:e,checked:n,children:o,defaultChecked:a,disabled:i,form:l,name:u,onCheckedChange:d,required:f,value:g="on",internal_do_not_use_render:m}=t,[p,v]=qa({prop:n,defaultProp:a??!1,onChange:d,caller:jf}),[S,C]=x.useState(null),[w,M]=x.useState(null),R=x.useRef(!1),E=S?!!l||!!S.closest("form"):!0,N={checked:p,disabled:i,setChecked:v,control:S,setControl:C,name:u,form:l,value:g,hasConsumerStoppedPropagationRef:R,required:f,defaultChecked:Ua(a)?!1:a,isFormControl:E,bubbleInput:w,setBubbleInput:M};return y.jsx(sO,{scope:e,...N,children:lO(m)?m(N):o})}var I2="CheckboxTrigger",P2=x.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:n,...o},a)=>{const{control:i,value:l,disabled:u,checked:d,required:f,setControl:g,setChecked:m,hasConsumerStoppedPropagationRef:p,isFormControl:v,bubbleInput:S}=k0(I2,t),C=Rt(a,g),w=x.useRef(d);return x.useEffect(()=>{const M=i?.form;if(M){const R=()=>m(w.current);return M.addEventListener("reset",R),()=>M.removeEventListener("reset",R)}},[i,m]),y.jsx(et.button,{type:"button",role:"checkbox","aria-checked":Ua(d)?"mixed":d,"aria-required":f,"data-state":F2(d),"data-disabled":u?"":void 0,disabled:u,value:l,...o,ref:C,onKeyDown:ze(e,M=>{M.key==="Enter"&&M.preventDefault()}),onClick:ze(n,M=>{m(R=>Ua(R)?!0:!R),S&&v&&(p.current=M.isPropagationStopped(),p.current||M.stopPropagation())})})});P2.displayName=I2;var $2=x.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:o,checked:a,defaultChecked:i,required:l,disabled:u,value:d,onCheckedChange:f,form:g,...m}=t;return y.jsx(iO,{__scopeCheckbox:n,checked:a,defaultChecked:i,disabled:u,required:l,onCheckedChange:f,name:o,form:g,value:d,internal_do_not_use_render:({isFormControl:p})=>y.jsxs(y.Fragment,{children:[y.jsx(P2,{...m,ref:e,__scopeCheckbox:n}),p&&y.jsx(V2,{__scopeCheckbox:n})]})})});$2.displayName=jf;var L2="CheckboxIndicator",H2=x.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:o,...a}=t,i=k0(L2,n);return y.jsx(Ro,{present:o||Ua(i.checked)||i.checked===!0,children:y.jsx(et.span,{"data-state":F2(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:e,style:{pointerEvents:"none",...t.style}})})});H2.displayName=L2;var B2="CheckboxBubbleInput",V2=x.forwardRef(({__scopeCheckbox:t,...e},n)=>{const{control:o,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:l,required:u,disabled:d,name:f,value:g,form:m,bubbleInput:p,setBubbleInput:v}=k0(B2,t),S=Rt(n,v),C=j2(i),w=z2(o);x.useEffect(()=>{const R=p;if(!R)return;const E=window.HTMLInputElement.prototype,D=Object.getOwnPropertyDescriptor(E,"checked").set,T=!a.current;if(C!==i&&D){const k=new Event("click",{bubbles:T});R.indeterminate=Ua(i),D.call(R,Ua(i)?!1:i),R.dispatchEvent(k)}},[p,C,i,a]);const M=x.useRef(Ua(i)?!1:i);return y.jsx(et.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??M.current,required:u,disabled:d,name:f,value:g,form:m,...e,tabIndex:-1,ref:S,style:{...e.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});V2.displayName=B2;function lO(t){return typeof t=="function"}function Ua(t){return t==="indeterminate"}function F2(t){return Ua(t)?"indeterminate":t?"checked":"unchecked"}const cO=["top","right","bottom","left"],Wa=Math.min,wo=Math.max,rf=Math.round,Td=Math.floor,xr=t=>({x:t,y:t}),uO={left:"right",right:"left",bottom:"top",top:"bottom"},dO={start:"end",end:"start"};function Dp(t,e,n){return wo(t,Wa(e,n))}function sa(t,e){return typeof t=="function"?t(e):t}function ia(t){return t.split("-")[0]}function al(t){return t.split("-")[1]}function O0(t){return t==="x"?"y":"x"}function A0(t){return t==="y"?"height":"width"}const fO=new Set(["top","bottom"]);function yr(t){return fO.has(ia(t))?"y":"x"}function j0(t){return O0(yr(t))}function hO(t,e,n){n===void 0&&(n=!1);const o=al(t),a=j0(t),i=A0(a);let l=a==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(l=af(l)),[l,af(l)]}function mO(t){const e=af(t);return[Tp(t),e,Tp(e)]}function Tp(t){return t.replace(/start|end/g,e=>dO[e])}const yw=["left","right"],vw=["right","left"],gO=["top","bottom"],pO=["bottom","top"];function yO(t,e,n){switch(t){case"top":case"bottom":return n?e?vw:yw:e?yw:vw;case"left":case"right":return e?gO:pO;default:return[]}}function vO(t,e,n,o){const a=al(t);let i=yO(ia(t),n==="start",o);return a&&(i=i.map(l=>l+"-"+a),e&&(i=i.concat(i.map(Tp)))),i}function af(t){return t.replace(/left|right|bottom|top/g,e=>uO[e])}function xO(t){return{top:0,right:0,bottom:0,left:0,...t}}function U2(t){return typeof t!="number"?xO(t):{top:t,right:t,bottom:t,left:t}}function sf(t){const{x:e,y:n,width:o,height:a}=t;return{width:o,height:a,top:n,left:e,right:e+o,bottom:n+a,x:e,y:n}}function xw(t,e,n){let{reference:o,floating:a}=t;const i=yr(e),l=j0(e),u=A0(l),d=ia(e),f=i==="y",g=o.x+o.width/2-a.width/2,m=o.y+o.height/2-a.height/2,p=o[u]/2-a[u]/2;let v;switch(d){case"top":v={x:g,y:o.y-a.height};break;case"bottom":v={x:g,y:o.y+o.height};break;case"right":v={x:o.x+o.width,y:m};break;case"left":v={x:o.x-a.width,y:m};break;default:v={x:o.x,y:o.y}}switch(al(e)){case"start":v[l]-=p*(n&&f?-1:1);break;case"end":v[l]+=p*(n&&f?-1:1);break}return v}const bO=async(t,e,n)=>{const{placement:o="bottom",strategy:a="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(e));let f=await l.getElementRects({reference:t,floating:e,strategy:a}),{x:g,y:m}=xw(f,o,d),p=o,v={},S=0;for(let C=0;C<u.length;C++){const{name:w,fn:M}=u[C],{x:R,y:E,data:N,reset:D}=await M({x:g,y:m,initialPlacement:o,placement:p,strategy:a,middlewareData:v,rects:f,platform:l,elements:{reference:t,floating:e}});g=R??g,m=E??m,v={...v,[w]:{...v[w],...N}},D&&S<=50&&(S++,typeof D=="object"&&(D.placement&&(p=D.placement),D.rects&&(f=D.rects===!0?await l.getElementRects({reference:t,floating:e,strategy:a}):D.rects),{x:g,y:m}=xw(f,p,d)),C=-1)}return{x:g,y:m,placement:p,strategy:a,middlewareData:v}};async function Cc(t,e){var n;e===void 0&&(e={});const{x:o,y:a,platform:i,rects:l,elements:u,strategy:d}=t,{boundary:f="clippingAncestors",rootBoundary:g="viewport",elementContext:m="floating",altBoundary:p=!1,padding:v=0}=sa(e,t),S=U2(v),w=u[p?m==="floating"?"reference":"floating":m],M=sf(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:f,rootBoundary:g,strategy:d})),R=m==="floating"?{x:o,y:a,width:l.floating.width,height:l.floating.height}:l.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),N=await(i.isElement==null?void 0:i.isElement(E))?await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1}:{x:1,y:1},D=sf(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:R,offsetParent:E,strategy:d}):R);return{top:(M.top-D.top+S.top)/N.y,bottom:(D.bottom-M.bottom+S.bottom)/N.y,left:(M.left-D.left+S.left)/N.x,right:(D.right-M.right+S.right)/N.x}}const wO=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:a,rects:i,platform:l,elements:u,middlewareData:d}=e,{element:f,padding:g=0}=sa(t,e)||{};if(f==null)return{};const m=U2(g),p={x:n,y:o},v=j0(a),S=A0(v),C=await l.getDimensions(f),w=v==="y",M=w?"top":"left",R=w?"bottom":"right",E=w?"clientHeight":"clientWidth",N=i.reference[S]+i.reference[v]-p[v]-i.floating[S],D=p[v]-i.reference[v],T=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let k=T?T[E]:0;(!k||!await(l.isElement==null?void 0:l.isElement(T)))&&(k=u.floating[E]||i.floating[S]);const A=N/2-D/2,B=k/2-C[S]/2-1,W=Wa(m[M],B),U=Wa(m[R],B),Y=W,Z=k-C[S]-U,I=k/2-C[S]/2+A,G=Dp(Y,I,Z),j=!d.arrow&&al(a)!=null&&I!==G&&i.reference[S]/2-(I<Y?W:U)-C[S]/2<0,L=j?I<Y?I-Y:I-Z:0;return{[v]:p[v]+L,data:{[v]:G,centerOffset:I-G-L,...j&&{alignmentOffset:L}},reset:j}}}),SO=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:a,middlewareData:i,rects:l,initialPlacement:u,platform:d,elements:f}=e,{mainAxis:g=!0,crossAxis:m=!0,fallbackPlacements:p,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:C=!0,...w}=sa(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const M=ia(a),R=yr(u),E=ia(u)===u,N=await(d.isRTL==null?void 0:d.isRTL(f.floating)),D=p||(E||!C?[af(u)]:mO(u)),T=S!=="none";!p&&T&&D.push(...vO(u,C,S,N));const k=[u,...D],A=await Cc(e,w),B=[];let W=((o=i.flip)==null?void 0:o.overflows)||[];if(g&&B.push(A[M]),m){const I=hO(a,l,N);B.push(A[I[0]],A[I[1]])}if(W=[...W,{placement:a,overflows:B}],!B.every(I=>I<=0)){var U,Y;const I=(((U=i.flip)==null?void 0:U.index)||0)+1,G=k[I];if(G&&(!(m==="alignment"?R!==yr(G):!1)||W.every($=>yr($.placement)===R?$.overflows[0]>0:!0)))return{data:{index:I,overflows:W},reset:{placement:G}};let j=(Y=W.filter(L=>L.overflows[0]<=0).sort((L,$)=>L.overflows[1]-$.overflows[1])[0])==null?void 0:Y.placement;if(!j)switch(v){case"bestFit":{var Z;const L=(Z=W.filter($=>{if(T){const H=yr($.placement);return H===R||H==="y"}return!0}).map($=>[$.placement,$.overflows.filter(H=>H>0).reduce((H,X)=>H+X,0)]).sort(($,H)=>$[1]-H[1])[0])==null?void 0:Z[0];L&&(j=L);break}case"initialPlacement":j=u;break}if(a!==j)return{reset:{placement:j}}}return{}}}};function bw(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function ww(t){return cO.some(e=>t[e]>=0)}const CO=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...a}=sa(t,e);switch(o){case"referenceHidden":{const i=await Cc(e,{...a,elementContext:"reference"}),l=bw(i,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:ww(l)}}}case"escaped":{const i=await Cc(e,{...a,altBoundary:!0}),l=bw(i,n.floating);return{data:{escapedOffsets:l,escaped:ww(l)}}}default:return{}}}}},Y2=new Set(["left","top"]);async function EO(t,e){const{placement:n,platform:o,elements:a}=t,i=await(o.isRTL==null?void 0:o.isRTL(a.floating)),l=ia(n),u=al(n),d=yr(n)==="y",f=Y2.has(l)?-1:1,g=i&&d?-1:1,m=sa(e,t);let{mainAxis:p,crossAxis:v,alignmentAxis:S}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof S=="number"&&(v=u==="end"?S*-1:S),d?{x:v*g,y:p*f}:{x:p*f,y:v*g}}const _O=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:a,y:i,placement:l,middlewareData:u}=e,d=await EO(e,t);return l===((n=u.offset)==null?void 0:n.placement)&&(o=u.arrow)!=null&&o.alignmentOffset?{}:{x:a+d.x,y:i+d.y,data:{...d,placement:l}}}}},MO=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:a}=e,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:w=>{let{x:M,y:R}=w;return{x:M,y:R}}},...d}=sa(t,e),f={x:n,y:o},g=await Cc(e,d),m=yr(ia(a)),p=O0(m);let v=f[p],S=f[m];if(i){const w=p==="y"?"top":"left",M=p==="y"?"bottom":"right",R=v+g[w],E=v-g[M];v=Dp(R,v,E)}if(l){const w=m==="y"?"top":"left",M=m==="y"?"bottom":"right",R=S+g[w],E=S-g[M];S=Dp(R,S,E)}const C=u.fn({...e,[p]:v,[m]:S});return{...C,data:{x:C.x-n,y:C.y-o,enabled:{[p]:i,[m]:l}}}}}},NO=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:a,rects:i,middlewareData:l}=e,{offset:u=0,mainAxis:d=!0,crossAxis:f=!0}=sa(t,e),g={x:n,y:o},m=yr(a),p=O0(m);let v=g[p],S=g[m];const C=sa(u,e),w=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(d){const E=p==="y"?"height":"width",N=i.reference[p]-i.floating[E]+w.mainAxis,D=i.reference[p]+i.reference[E]-w.mainAxis;v<N?v=N:v>D&&(v=D)}if(f){var M,R;const E=p==="y"?"width":"height",N=Y2.has(ia(a)),D=i.reference[m]-i.floating[E]+(N&&((M=l.offset)==null?void 0:M[m])||0)+(N?0:w.crossAxis),T=i.reference[m]+i.reference[E]+(N?0:((R=l.offset)==null?void 0:R[m])||0)-(N?w.crossAxis:0);S<D?S=D:S>T&&(S=T)}return{[p]:v,[m]:S}}}},RO=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:a,rects:i,platform:l,elements:u}=e,{apply:d=()=>{},...f}=sa(t,e),g=await Cc(e,f),m=ia(a),p=al(a),v=yr(a)==="y",{width:S,height:C}=i.floating;let w,M;m==="top"||m==="bottom"?(w=m,M=p===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(M=m,w=p==="end"?"top":"bottom");const R=C-g.top-g.bottom,E=S-g.left-g.right,N=Wa(C-g[w],R),D=Wa(S-g[M],E),T=!e.middlewareData.shift;let k=N,A=D;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(A=E),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(k=R),T&&!p){const W=wo(g.left,0),U=wo(g.right,0),Y=wo(g.top,0),Z=wo(g.bottom,0);v?A=S-2*(W!==0||U!==0?W+U:wo(g.left,g.right)):k=C-2*(Y!==0||Z!==0?Y+Z:wo(g.top,g.bottom))}await d({...e,availableWidth:A,availableHeight:k});const B=await l.getDimensions(u.floating);return S!==B.width||C!==B.height?{reset:{rects:!0}}:{}}}};function zf(){return typeof window<"u"}function sl(t){return G2(t)?(t.nodeName||"").toLowerCase():"#document"}function Co(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Mr(t){var e;return(e=(G2(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function G2(t){return zf()?t instanceof Node||t instanceof Co(t).Node:!1}function or(t){return zf()?t instanceof Element||t instanceof Co(t).Element:!1}function Sr(t){return zf()?t instanceof HTMLElement||t instanceof Co(t).HTMLElement:!1}function Sw(t){return!zf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Co(t).ShadowRoot}const DO=new Set(["inline","contents"]);function qc(t){const{overflow:e,overflowX:n,overflowY:o,display:a}=rr(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!DO.has(a)}const TO=new Set(["table","td","th"]);function kO(t){return TO.has(sl(t))}const OO=[":popover-open",":modal"];function If(t){return OO.some(e=>{try{return t.matches(e)}catch{return!1}})}const AO=["transform","translate","scale","rotate","perspective"],jO=["transform","translate","scale","rotate","perspective","filter"],zO=["paint","layout","strict","content"];function z0(t){const e=I0(),n=or(t)?rr(t):t;return AO.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||jO.some(o=>(n.willChange||"").includes(o))||zO.some(o=>(n.contain||"").includes(o))}function IO(t){let e=Ka(t);for(;Sr(e)&&!$i(e);){if(z0(e))return e;if(If(e))return null;e=Ka(e)}return null}function I0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const PO=new Set(["html","body","#document"]);function $i(t){return PO.has(sl(t))}function rr(t){return Co(t).getComputedStyle(t)}function Pf(t){return or(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ka(t){if(sl(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Sw(t)&&t.host||Mr(t);return Sw(e)?e.host:e}function q2(t){const e=Ka(t);return $i(e)?t.ownerDocument?t.ownerDocument.body:t.body:Sr(e)&&qc(e)?e:q2(e)}function Ec(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const a=q2(t),i=a===((o=t.ownerDocument)==null?void 0:o.body),l=Co(a);if(i){const u=kp(l);return e.concat(l,l.visualViewport||[],qc(a)?a:[],u&&n?Ec(u):[])}return e.concat(a,Ec(a,[],n))}function kp(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function W2(t){const e=rr(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const a=Sr(t),i=a?t.offsetWidth:n,l=a?t.offsetHeight:o,u=rf(n)!==i||rf(o)!==l;return u&&(n=i,o=l),{width:n,height:o,$:u}}function P0(t){return or(t)?t:t.contextElement}function zi(t){const e=P0(t);if(!Sr(e))return xr(1);const n=e.getBoundingClientRect(),{width:o,height:a,$:i}=W2(e);let l=(i?rf(n.width):n.width)/o,u=(i?rf(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const $O=xr(0);function K2(t){const e=Co(t);return!I0()||!e.visualViewport?$O:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function LO(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Co(t)?!1:e}function ks(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const a=t.getBoundingClientRect(),i=P0(t);let l=xr(1);e&&(o?or(o)&&(l=zi(o)):l=zi(t));const u=LO(i,n,o)?K2(i):xr(0);let d=(a.left+u.x)/l.x,f=(a.top+u.y)/l.y,g=a.width/l.x,m=a.height/l.y;if(i){const p=Co(i),v=o&&or(o)?Co(o):o;let S=p,C=kp(S);for(;C&&o&&v!==S;){const w=zi(C),M=C.getBoundingClientRect(),R=rr(C),E=M.left+(C.clientLeft+parseFloat(R.paddingLeft))*w.x,N=M.top+(C.clientTop+parseFloat(R.paddingTop))*w.y;d*=w.x,f*=w.y,g*=w.x,m*=w.y,d+=E,f+=N,S=Co(C),C=kp(S)}}return sf({width:g,height:m,x:d,y:f})}function $f(t,e){const n=Pf(t).scrollLeft;return e?e.left+n:ks(Mr(t)).left+n}function X2(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-$f(t,n),a=n.top+e.scrollTop;return{x:o,y:a}}function HO(t){let{elements:e,rect:n,offsetParent:o,strategy:a}=t;const i=a==="fixed",l=Mr(o),u=e?If(e.floating):!1;if(o===l||u&&i)return n;let d={scrollLeft:0,scrollTop:0},f=xr(1);const g=xr(0),m=Sr(o);if((m||!m&&!i)&&((sl(o)!=="body"||qc(l))&&(d=Pf(o)),Sr(o))){const v=ks(o);f=zi(o),g.x=v.x+o.clientLeft,g.y=v.y+o.clientTop}const p=l&&!m&&!i?X2(l,d):xr(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-d.scrollLeft*f.x+g.x+p.x,y:n.y*f.y-d.scrollTop*f.y+g.y+p.y}}function BO(t){return Array.from(t.getClientRects())}function VO(t){const e=Mr(t),n=Pf(t),o=t.ownerDocument.body,a=wo(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=wo(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+$f(t);const u=-n.scrollTop;return rr(o).direction==="rtl"&&(l+=wo(e.clientWidth,o.clientWidth)-a),{width:a,height:i,x:l,y:u}}const Cw=25;function FO(t,e){const n=Co(t),o=Mr(t),a=n.visualViewport;let i=o.clientWidth,l=o.clientHeight,u=0,d=0;if(a){i=a.width,l=a.height;const g=I0();(!g||g&&e==="fixed")&&(u=a.offsetLeft,d=a.offsetTop)}const f=$f(o);if(f<=0){const g=o.ownerDocument,m=g.body,p=getComputedStyle(m),v=g.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,S=Math.abs(o.clientWidth-m.clientWidth-v);S<=Cw&&(i-=S)}else f<=Cw&&(i+=f);return{width:i,height:l,x:u,y:d}}const UO=new Set(["absolute","fixed"]);function YO(t,e){const n=ks(t,!0,e==="fixed"),o=n.top+t.clientTop,a=n.left+t.clientLeft,i=Sr(t)?zi(t):xr(1),l=t.clientWidth*i.x,u=t.clientHeight*i.y,d=a*i.x,f=o*i.y;return{width:l,height:u,x:d,y:f}}function Ew(t,e,n){let o;if(e==="viewport")o=FO(t,n);else if(e==="document")o=VO(Mr(t));else if(or(e))o=YO(e,n);else{const a=K2(t);o={x:e.x-a.x,y:e.y-a.y,width:e.width,height:e.height}}return sf(o)}function Z2(t,e){const n=Ka(t);return n===e||!or(n)||$i(n)?!1:rr(n).position==="fixed"||Z2(n,e)}function GO(t,e){const n=e.get(t);if(n)return n;let o=Ec(t,[],!1).filter(u=>or(u)&&sl(u)!=="body"),a=null;const i=rr(t).position==="fixed";let l=i?Ka(t):t;for(;or(l)&&!$i(l);){const u=rr(l),d=z0(l);!d&&u.position==="fixed"&&(a=null),(i?!d&&!a:!d&&u.position==="static"&&!!a&&UO.has(a.position)||qc(l)&&!d&&Z2(t,l))?o=o.filter(g=>g!==l):a=u,l=Ka(l)}return e.set(t,o),o}function qO(t){let{element:e,boundary:n,rootBoundary:o,strategy:a}=t;const l=[...n==="clippingAncestors"?If(e)?[]:GO(e,this._c):[].concat(n),o],u=l[0],d=l.reduce((f,g)=>{const m=Ew(e,g,a);return f.top=wo(m.top,f.top),f.right=Wa(m.right,f.right),f.bottom=Wa(m.bottom,f.bottom),f.left=wo(m.left,f.left),f},Ew(e,u,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function WO(t){const{width:e,height:n}=W2(t);return{width:e,height:n}}function KO(t,e,n){const o=Sr(e),a=Mr(e),i=n==="fixed",l=ks(t,!0,i,e);let u={scrollLeft:0,scrollTop:0};const d=xr(0);function f(){d.x=$f(a)}if(o||!o&&!i)if((sl(e)!=="body"||qc(a))&&(u=Pf(e)),o){const v=ks(e,!0,i,e);d.x=v.x+e.clientLeft,d.y=v.y+e.clientTop}else a&&f();i&&!o&&a&&f();const g=a&&!o&&!i?X2(a,u):xr(0),m=l.left+u.scrollLeft-d.x-g.x,p=l.top+u.scrollTop-d.y-g.y;return{x:m,y:p,width:l.width,height:l.height}}function Fg(t){return rr(t).position==="static"}function _w(t,e){if(!Sr(t)||rr(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Mr(t)===n&&(n=n.ownerDocument.body),n}function Q2(t,e){const n=Co(t);if(If(t))return n;if(!Sr(t)){let a=Ka(t);for(;a&&!$i(a);){if(or(a)&&!Fg(a))return a;a=Ka(a)}return n}let o=_w(t,e);for(;o&&kO(o)&&Fg(o);)o=_w(o,e);return o&&$i(o)&&Fg(o)&&!z0(o)?n:o||IO(t)||n}const XO=async function(t){const e=this.getOffsetParent||Q2,n=this.getDimensions,o=await n(t.floating);return{reference:KO(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function ZO(t){return rr(t).direction==="rtl"}const QO={convertOffsetParentRelativeRectToViewportRelativeRect:HO,getDocumentElement:Mr,getClippingRect:qO,getOffsetParent:Q2,getElementRects:XO,getClientRects:BO,getDimensions:WO,getScale:zi,isElement:or,isRTL:ZO};function J2(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function JO(t,e){let n=null,o;const a=Mr(t);function i(){var u;clearTimeout(o),(u=n)==null||u.disconnect(),n=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),i();const f=t.getBoundingClientRect(),{left:g,top:m,width:p,height:v}=f;if(u||e(),!p||!v)return;const S=Td(m),C=Td(a.clientWidth-(g+p)),w=Td(a.clientHeight-(m+v)),M=Td(g),E={rootMargin:-S+"px "+-C+"px "+-w+"px "+-M+"px",threshold:wo(0,Wa(1,d))||1};let N=!0;function D(T){const k=T[0].intersectionRatio;if(k!==d){if(!N)return l();k?l(!1,k):o=setTimeout(()=>{l(!1,1e-7)},1e3)}k===1&&!J2(f,t.getBoundingClientRect())&&l(),N=!1}try{n=new IntersectionObserver(D,{...E,root:a.ownerDocument})}catch{n=new IntersectionObserver(D,E)}n.observe(t)}return l(!0),i}function eA(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,f=P0(t),g=a||i?[...f?Ec(f):[],...Ec(e)]:[];g.forEach(M=>{a&&M.addEventListener("scroll",n,{passive:!0}),i&&M.addEventListener("resize",n)});const m=f&&u?JO(f,n):null;let p=-1,v=null;l&&(v=new ResizeObserver(M=>{let[R]=M;R&&R.target===f&&v&&(v.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var E;(E=v)==null||E.observe(e)})),n()}),f&&!d&&v.observe(f),v.observe(e));let S,C=d?ks(t):null;d&&w();function w(){const M=ks(t);C&&!J2(C,M)&&n(),C=M,S=requestAnimationFrame(w)}return n(),()=>{var M;g.forEach(R=>{a&&R.removeEventListener("scroll",n),i&&R.removeEventListener("resize",n)}),m?.(),(M=v)==null||M.disconnect(),v=null,d&&cancelAnimationFrame(S)}}const tA=_O,nA=MO,oA=SO,rA=RO,aA=CO,Mw=wO,sA=NO,iA=(t,e,n)=>{const o=new Map,a={platform:QO,...n},i={...a.platform,_c:o};return bO(t,e,{...a,platform:i})};var lA=typeof document<"u",cA=function(){},Kd=lA?x.useLayoutEffect:cA;function lf(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,o,a;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;o--!==0;)if(!lf(t[o],e[o]))return!1;return!0}if(a=Object.keys(t),n=a.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(e,a[o]))return!1;for(o=n;o--!==0;){const i=a[o];if(!(i==="_owner"&&t.$$typeof)&&!lf(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function eE(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Nw(t,e){const n=eE(t);return Math.round(e*n)/n}function Ug(t){const e=x.useRef(t);return Kd(()=>{e.current=t}),e}function uA(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:o=[],platform:a,elements:{reference:i,floating:l}={},transform:u=!0,whileElementsMounted:d,open:f}=t,[g,m]=x.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[p,v]=x.useState(o);lf(p,o)||v(o);const[S,C]=x.useState(null),[w,M]=x.useState(null),R=x.useCallback($=>{$!==T.current&&(T.current=$,C($))},[]),E=x.useCallback($=>{$!==k.current&&(k.current=$,M($))},[]),N=i||S,D=l||w,T=x.useRef(null),k=x.useRef(null),A=x.useRef(g),B=d!=null,W=Ug(d),U=Ug(a),Y=Ug(f),Z=x.useCallback(()=>{if(!T.current||!k.current)return;const $={placement:e,strategy:n,middleware:p};U.current&&($.platform=U.current),iA(T.current,k.current,$).then(H=>{const X={...H,isPositioned:Y.current!==!1};I.current&&!lf(A.current,X)&&(A.current=X,nl.flushSync(()=>{m(X)}))})},[p,e,n,U,Y]);Kd(()=>{f===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,m($=>({...$,isPositioned:!1})))},[f]);const I=x.useRef(!1);Kd(()=>(I.current=!0,()=>{I.current=!1}),[]),Kd(()=>{if(N&&(T.current=N),D&&(k.current=D),N&&D){if(W.current)return W.current(N,D,Z);Z()}},[N,D,Z,W,B]);const G=x.useMemo(()=>({reference:T,floating:k,setReference:R,setFloating:E}),[R,E]),j=x.useMemo(()=>({reference:N,floating:D}),[N,D]),L=x.useMemo(()=>{const $={position:n,left:0,top:0};if(!j.floating)return $;const H=Nw(j.floating,g.x),X=Nw(j.floating,g.y);return u?{...$,transform:"translate("+H+"px, "+X+"px)",...eE(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:H,top:X}},[n,u,j.floating,g.x,g.y]);return x.useMemo(()=>({...g,update:Z,refs:G,elements:j,floatingStyles:L}),[g,Z,G,j,L])}const dA=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:o,padding:a}=typeof t=="function"?t(n):t;return o&&e(o)?o.current!=null?Mw({element:o.current,padding:a}).fn(n):{}:o?Mw({element:o,padding:a}).fn(n):{}}}},fA=(t,e)=>({...tA(t),options:[t,e]}),hA=(t,e)=>({...nA(t),options:[t,e]}),mA=(t,e)=>({...sA(t),options:[t,e]}),gA=(t,e)=>({...oA(t),options:[t,e]}),pA=(t,e)=>({...rA(t),options:[t,e]}),yA=(t,e)=>({...aA(t),options:[t,e]}),vA=(t,e)=>({...dA(t),options:[t,e]});var xA="Arrow",tE=x.forwardRef((t,e)=>{const{children:n,width:o=10,height:a=5,...i}=t;return y.jsx(et.svg,{...i,ref:e,width:o,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:y.jsx("polygon",{points:"0,0 30,0 15,10"})})});tE.displayName=xA;var bA=tE,$0="Popper",[nE,Qa]=_r($0),[wA,oE]=nE($0),rE=t=>{const{__scopePopper:e,children:n}=t,[o,a]=x.useState(null);return y.jsx(wA,{scope:e,anchor:o,onAnchorChange:a,children:n})};rE.displayName=$0;var aE="PopperAnchor",sE=x.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:o,...a}=t,i=oE(aE,n),l=x.useRef(null),u=Rt(e,l),d=x.useRef(null);return x.useEffect(()=>{const f=d.current;d.current=o?.current||l.current,f!==d.current&&i.onAnchorChange(d.current)}),o?null:y.jsx(et.div,{...a,ref:u})});sE.displayName=aE;var L0="PopperContent",[SA,CA]=nE(L0),iE=x.forwardRef((t,e)=>{const{__scopePopper:n,side:o="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:g=0,sticky:m="partial",hideWhenDetached:p=!1,updatePositionStrategy:v="optimized",onPlaced:S,...C}=t,w=oE(L0,n),[M,R]=x.useState(null),E=Rt(e,K=>R(K)),[N,D]=x.useState(null),T=z2(N),k=T?.width??0,A=T?.height??0,B=o+(i!=="center"?"-"+i:""),W=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},U=Array.isArray(f)?f:[f],Y=U.length>0,Z={padding:W,boundary:U.filter(_A),altBoundary:Y},{refs:I,floatingStyles:G,placement:j,isPositioned:L,middlewareData:$}=uA({strategy:"fixed",placement:B,whileElementsMounted:(...K)=>eA(...K,{animationFrame:v==="always"}),elements:{reference:w.anchor},middleware:[fA({mainAxis:a+A,alignmentAxis:l}),d&&hA({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?mA():void 0,...Z}),d&&gA({...Z}),pA({...Z,apply:({elements:K,rects:ee,availableWidth:ae,availableHeight:ce})=>{const{width:ge,height:se}=ee.reference,ve=K.floating.style;ve.setProperty("--radix-popper-available-width",`${ae}px`),ve.setProperty("--radix-popper-available-height",`${ce}px`),ve.setProperty("--radix-popper-anchor-width",`${ge}px`),ve.setProperty("--radix-popper-anchor-height",`${se}px`)}}),N&&vA({element:N,padding:u}),MA({arrowWidth:k,arrowHeight:A}),p&&yA({strategy:"referenceHidden",...Z})]}),[H,X]=uE(j),P=wr(S);Kn(()=>{L&&P?.()},[L,P]);const z=$.arrow?.x,V=$.arrow?.y,q=$.arrow?.centerOffset!==0,[J,oe]=x.useState();return Kn(()=>{M&&oe(window.getComputedStyle(M).zIndex)},[M]),y.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:L?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[$.transformOrigin?.x,$.transformOrigin?.y].join(" "),...$.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:y.jsx(SA,{scope:n,placedSide:H,onArrowChange:D,arrowX:z,arrowY:V,shouldHideArrow:q,children:y.jsx(et.div,{"data-side":H,"data-align":X,...C,ref:E,style:{...C.style,animation:L?void 0:"none"}})})})});iE.displayName=L0;var lE="PopperArrow",EA={top:"bottom",right:"left",bottom:"top",left:"right"},cE=x.forwardRef(function(e,n){const{__scopePopper:o,...a}=e,i=CA(lE,o),l=EA[i.placedSide];return y.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:y.jsx(bA,{...a,ref:n,style:{...a.style,display:"block"}})})});cE.displayName=lE;function _A(t){return t!==null}var MA=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:o,middlewareData:a}=e,l=a.arrow?.centerOffset!==0,u=l?0:t.arrowWidth,d=l?0:t.arrowHeight,[f,g]=uE(n),m={start:"0%",center:"50%",end:"100%"}[g],p=(a.arrow?.x??0)+u/2,v=(a.arrow?.y??0)+d/2;let S="",C="";return f==="bottom"?(S=l?m:`${p}px`,C=`${-d}px`):f==="top"?(S=l?m:`${p}px`,C=`${o.floating.height+d}px`):f==="right"?(S=`${-d}px`,C=l?m:`${v}px`):f==="left"&&(S=`${o.floating.width+d}px`,C=l?m:`${v}px`),{data:{x:S,y:C}}}});function uE(t){const[e,n="center"]=t.split("-");return[e,n]}var Lf=rE,Wc=sE,Hf=iE,Bf=cE,Yg="rovingFocusGroup.onEntryFocus",NA={bubbles:!1,cancelable:!0},Kc="RovingFocusGroup",[Op,dE,RA]=S0(Kc),[DA,fE]=_r(Kc,[RA]),[TA,kA]=DA(Kc),hE=x.forwardRef((t,e)=>y.jsx(Op.Provider,{scope:t.__scopeRovingFocusGroup,children:y.jsx(Op.Slot,{scope:t.__scopeRovingFocusGroup,children:y.jsx(OA,{...t,ref:e})})}));hE.displayName=Kc;var OA=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:a=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:g=!1,...m}=t,p=x.useRef(null),v=Rt(e,p),S=Df(i),[C,w]=qa({prop:l,defaultProp:u??null,onChange:d,caller:Kc}),[M,R]=x.useState(!1),E=wr(f),N=dE(n),D=x.useRef(!1),[T,k]=x.useState(0);return x.useEffect(()=>{const A=p.current;if(A)return A.addEventListener(Yg,E),()=>A.removeEventListener(Yg,E)},[E]),y.jsx(TA,{scope:n,orientation:o,dir:S,loop:a,currentTabStopId:C,onItemFocus:x.useCallback(A=>w(A),[w]),onItemShiftTab:x.useCallback(()=>R(!0),[]),onFocusableItemAdd:x.useCallback(()=>k(A=>A+1),[]),onFocusableItemRemove:x.useCallback(()=>k(A=>A-1),[]),children:y.jsx(et.div,{tabIndex:M||T===0?-1:0,"data-orientation":o,...m,ref:v,style:{outline:"none",...t.style},onMouseDown:ze(t.onMouseDown,()=>{D.current=!0}),onFocus:ze(t.onFocus,A=>{const B=!D.current;if(A.target===A.currentTarget&&B&&!M){const W=new CustomEvent(Yg,NA);if(A.currentTarget.dispatchEvent(W),!W.defaultPrevented){const U=N().filter(j=>j.focusable),Y=U.find(j=>j.active),Z=U.find(j=>j.id===C),G=[Y,Z,...U].filter(Boolean).map(j=>j.ref.current);pE(G,g)}}D.current=!1}),onBlur:ze(t.onBlur,()=>R(!1))})})}),mE="RovingFocusGroupItem",gE=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:a=!1,tabStopId:i,children:l,...u}=t,d=Fn(),f=i||d,g=kA(mE,n),m=g.currentTabStopId===f,p=dE(n),{onFocusableItemAdd:v,onFocusableItemRemove:S,currentTabStopId:C}=g;return x.useEffect(()=>{if(o)return v(),()=>S()},[o,v,S]),y.jsx(Op.ItemSlot,{scope:n,id:f,focusable:o,active:a,children:y.jsx(et.span,{tabIndex:m?0:-1,"data-orientation":g.orientation,...u,ref:e,onMouseDown:ze(t.onMouseDown,w=>{o?g.onItemFocus(f):w.preventDefault()}),onFocus:ze(t.onFocus,()=>g.onItemFocus(f)),onKeyDown:ze(t.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){g.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const M=zA(w,g.orientation,g.dir);if(M!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let E=p().filter(N=>N.focusable).map(N=>N.ref.current);if(M==="last")E.reverse();else if(M==="prev"||M==="next"){M==="prev"&&E.reverse();const N=E.indexOf(w.currentTarget);E=g.loop?IA(E,N+1):E.slice(N+1)}setTimeout(()=>pE(E))}}),children:typeof l=="function"?l({isCurrentTabStop:m,hasTabStop:C!=null}):l})})});gE.displayName=mE;var AA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function jA(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function zA(t,e,n){const o=jA(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return AA[o]}function pE(t,e=!1){const n=document.activeElement;for(const o of t)if(o===n||(o.focus({preventScroll:e}),document.activeElement!==n))return}function IA(t,e){return t.map((n,o)=>t[(e+o)%t.length])}var PA=hE,$A=gE,Ap=["Enter"," "],LA=["ArrowDown","PageUp","Home"],yE=["ArrowUp","PageDown","End"],HA=[...LA,...yE],BA={ltr:[...Ap,"ArrowRight"],rtl:[...Ap,"ArrowLeft"]},VA={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Xc="Menu",[_c,FA,UA]=S0(Xc),[Ls,vE]=_r(Xc,[UA,Qa,fE]),Vf=Qa(),xE=fE(),[YA,Hs]=Ls(Xc),[GA,Zc]=Ls(Xc),bE=t=>{const{__scopeMenu:e,open:n=!1,children:o,dir:a,onOpenChange:i,modal:l=!0}=t,u=Vf(e),[d,f]=x.useState(null),g=x.useRef(!1),m=wr(i),p=Df(a);return x.useEffect(()=>{const v=()=>{g.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>g.current=!1;return document.addEventListener("keydown",v,{capture:!0}),()=>{document.removeEventListener("keydown",v,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),y.jsx(Lf,{...u,children:y.jsx(YA,{scope:e,open:n,onOpenChange:m,content:d,onContentChange:f,children:y.jsx(GA,{scope:e,onClose:x.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:g,dir:p,modal:l,children:o})})})};bE.displayName=Xc;var qA="MenuAnchor",H0=x.forwardRef((t,e)=>{const{__scopeMenu:n,...o}=t,a=Vf(n);return y.jsx(Wc,{...a,...o,ref:e})});H0.displayName=qA;var B0="MenuPortal",[WA,wE]=Ls(B0,{forceMount:void 0}),SE=t=>{const{__scopeMenu:e,forceMount:n,children:o,container:a}=t,i=Hs(B0,e);return y.jsx(WA,{scope:e,forceMount:n,children:y.jsx(Ro,{present:n||i.open,children:y.jsx(rl,{asChild:!0,container:a,children:o})})})};SE.displayName=B0;var Fo="MenuContent",[KA,V0]=Ls(Fo),CE=x.forwardRef((t,e)=>{const n=wE(Fo,t.__scopeMenu),{forceMount:o=n.forceMount,...a}=t,i=Hs(Fo,t.__scopeMenu),l=Zc(Fo,t.__scopeMenu);return y.jsx(_c.Provider,{scope:t.__scopeMenu,children:y.jsx(Ro,{present:o||i.open,children:y.jsx(_c.Slot,{scope:t.__scopeMenu,children:l.modal?y.jsx(XA,{...a,ref:e}):y.jsx(ZA,{...a,ref:e})})})})}),XA=x.forwardRef((t,e)=>{const n=Hs(Fo,t.__scopeMenu),o=x.useRef(null),a=Rt(e,o);return x.useEffect(()=>{const i=o.current;if(i)return Of(i)},[]),y.jsx(F0,{...t,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ze(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),ZA=x.forwardRef((t,e)=>{const n=Hs(Fo,t.__scopeMenu);return y.jsx(F0,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),QA=Ga("MenuContent.ScrollLock"),F0=x.forwardRef((t,e)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:f,onPointerDownOutside:g,onFocusOutside:m,onInteractOutside:p,onDismiss:v,disableOutsideScroll:S,...C}=t,w=Hs(Fo,n),M=Zc(Fo,n),R=Vf(n),E=xE(n),N=FA(n),[D,T]=x.useState(null),k=x.useRef(null),A=Rt(e,k,w.onContentChange),B=x.useRef(0),W=x.useRef(""),U=x.useRef(0),Y=x.useRef(null),Z=x.useRef("right"),I=x.useRef(0),G=S?Gc:x.Fragment,j=S?{as:QA,allowPinchZoom:!0}:void 0,L=H=>{const X=W.current+H,P=N().filter(K=>!K.disabled),z=document.activeElement,V=P.find(K=>K.ref.current===z)?.textValue,q=P.map(K=>K.textValue),J=uj(q,X,V),oe=P.find(K=>K.textValue===J)?.ref.current;(function K(ee){W.current=ee,window.clearTimeout(B.current),ee!==""&&(B.current=window.setTimeout(()=>K(""),1e3))})(X),oe&&setTimeout(()=>oe.focus())};x.useEffect(()=>()=>window.clearTimeout(B.current),[]),Tf();const $=x.useCallback(H=>Z.current===Y.current?.side&&fj(H,Y.current?.area),[]);return y.jsx(KA,{scope:n,searchRef:W,onItemEnter:x.useCallback(H=>{$(H)&&H.preventDefault()},[$]),onItemLeave:x.useCallback(H=>{$(H)||(k.current?.focus(),T(null))},[$]),onTriggerLeave:x.useCallback(H=>{$(H)&&H.preventDefault()},[$]),pointerGraceTimerRef:U,onPointerGraceIntentChange:x.useCallback(H=>{Y.current=H},[]),children:y.jsx(G,{...j,children:y.jsx(Yc,{asChild:!0,trapped:a,onMountAutoFocus:ze(i,H=>{H.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:y.jsx(ol,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:f,onPointerDownOutside:g,onFocusOutside:m,onInteractOutside:p,onDismiss:v,children:y.jsx(PA,{asChild:!0,...E,dir:M.dir,orientation:"vertical",loop:o,currentTabStopId:D,onCurrentTabStopIdChange:T,onEntryFocus:ze(d,H=>{M.isUsingKeyboardRef.current||H.preventDefault()}),preventScrollOnEntryFocus:!0,children:y.jsx(Hf,{role:"menu","aria-orientation":"vertical","data-state":LE(w.open),"data-radix-menu-content":"",dir:M.dir,...R,...C,ref:A,style:{outline:"none",...C.style},onKeyDown:ze(C.onKeyDown,H=>{const P=H.target.closest("[data-radix-menu-content]")===H.currentTarget,z=H.ctrlKey||H.altKey||H.metaKey,V=H.key.length===1;P&&(H.key==="Tab"&&H.preventDefault(),!z&&V&&L(H.key));const q=k.current;if(H.target!==q||!HA.includes(H.key))return;H.preventDefault();const oe=N().filter(K=>!K.disabled).map(K=>K.ref.current);yE.includes(H.key)&&oe.reverse(),lj(oe)}),onBlur:ze(t.onBlur,H=>{H.currentTarget.contains(H.target)||(window.clearTimeout(B.current),W.current="")}),onPointerMove:ze(t.onPointerMove,Mc(H=>{const X=H.target,P=I.current!==H.clientX;if(H.currentTarget.contains(X)&&P){const z=H.clientX>I.current?"right":"left";Z.current=z,I.current=H.clientX}}))})})})})})})});CE.displayName=Fo;var JA="MenuGroup",U0=x.forwardRef((t,e)=>{const{__scopeMenu:n,...o}=t;return y.jsx(et.div,{role:"group",...o,ref:e})});U0.displayName=JA;var ej="MenuLabel",EE=x.forwardRef((t,e)=>{const{__scopeMenu:n,...o}=t;return y.jsx(et.div,{...o,ref:e})});EE.displayName=ej;var cf="MenuItem",Rw="menu.itemSelect",Ff=x.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:o,...a}=t,i=x.useRef(null),l=Zc(cf,t.__scopeMenu),u=V0(cf,t.__scopeMenu),d=Rt(e,i),f=x.useRef(!1),g=()=>{const m=i.current;if(!n&&m){const p=new CustomEvent(Rw,{bubbles:!0,cancelable:!0});m.addEventListener(Rw,v=>o?.(v),{once:!0}),n2(m,p),p.defaultPrevented?f.current=!1:l.onClose()}};return y.jsx(_E,{...a,ref:d,disabled:n,onClick:ze(t.onClick,g),onPointerDown:m=>{t.onPointerDown?.(m),f.current=!0},onPointerUp:ze(t.onPointerUp,m=>{f.current||m.currentTarget?.click()}),onKeyDown:ze(t.onKeyDown,m=>{const p=u.searchRef.current!=="";n||p&&m.key===" "||Ap.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});Ff.displayName=cf;var _E=x.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:o=!1,textValue:a,...i}=t,l=V0(cf,n),u=xE(n),d=x.useRef(null),f=Rt(e,d),[g,m]=x.useState(!1),[p,v]=x.useState("");return x.useEffect(()=>{const S=d.current;S&&v((S.textContent??"").trim())},[i.children]),y.jsx(_c.ItemSlot,{scope:n,disabled:o,textValue:a??p,children:y.jsx($A,{asChild:!0,...u,focusable:!o,children:y.jsx(et.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:f,onPointerMove:ze(t.onPointerMove,Mc(S=>{o?l.onItemLeave(S):(l.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ze(t.onPointerLeave,Mc(S=>l.onItemLeave(S))),onFocus:ze(t.onFocus,()=>m(!0)),onBlur:ze(t.onBlur,()=>m(!1))})})})}),tj="MenuCheckboxItem",ME=x.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:o,...a}=t;return y.jsx(kE,{scope:t.__scopeMenu,checked:n,children:y.jsx(Ff,{role:"menuitemcheckbox","aria-checked":uf(n)?"mixed":n,...a,ref:e,"data-state":G0(n),onSelect:ze(a.onSelect,()=>o?.(uf(n)?!0:!n),{checkForDefaultPrevented:!1})})})});ME.displayName=tj;var NE="MenuRadioGroup",[nj,oj]=Ls(NE,{value:void 0,onValueChange:()=>{}}),RE=x.forwardRef((t,e)=>{const{value:n,onValueChange:o,...a}=t,i=wr(o);return y.jsx(nj,{scope:t.__scopeMenu,value:n,onValueChange:i,children:y.jsx(U0,{...a,ref:e})})});RE.displayName=NE;var DE="MenuRadioItem",TE=x.forwardRef((t,e)=>{const{value:n,...o}=t,a=oj(DE,t.__scopeMenu),i=n===a.value;return y.jsx(kE,{scope:t.__scopeMenu,checked:i,children:y.jsx(Ff,{role:"menuitemradio","aria-checked":i,...o,ref:e,"data-state":G0(i),onSelect:ze(o.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});TE.displayName=DE;var Y0="MenuItemIndicator",[kE,rj]=Ls(Y0,{checked:!1}),OE=x.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:o,...a}=t,i=rj(Y0,n);return y.jsx(Ro,{present:o||uf(i.checked)||i.checked===!0,children:y.jsx(et.span,{...a,ref:e,"data-state":G0(i.checked)})})});OE.displayName=Y0;var aj="MenuSeparator",AE=x.forwardRef((t,e)=>{const{__scopeMenu:n,...o}=t;return y.jsx(et.div,{role:"separator","aria-orientation":"horizontal",...o,ref:e})});AE.displayName=aj;var sj="MenuArrow",jE=x.forwardRef((t,e)=>{const{__scopeMenu:n,...o}=t,a=Vf(n);return y.jsx(Bf,{...a,...o,ref:e})});jE.displayName=sj;var ij="MenuSub",[gK,zE]=Ls(ij),fc="MenuSubTrigger",IE=x.forwardRef((t,e)=>{const n=Hs(fc,t.__scopeMenu),o=Zc(fc,t.__scopeMenu),a=zE(fc,t.__scopeMenu),i=V0(fc,t.__scopeMenu),l=x.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:d}=i,f={__scopeMenu:t.__scopeMenu},g=x.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return x.useEffect(()=>g,[g]),x.useEffect(()=>{const m=u.current;return()=>{window.clearTimeout(m),d(null)}},[u,d]),y.jsx(H0,{asChild:!0,...f,children:y.jsx(_E,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":LE(n.open),...t,ref:aa(e,a.onTriggerChange),onClick:m=>{t.onClick?.(m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ze(t.onPointerMove,Mc(m=>{i.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!n.open&&!l.current&&(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),g()},100))})),onPointerLeave:ze(t.onPointerLeave,Mc(m=>{g();const p=n.content?.getBoundingClientRect();if(p){const v=n.content?.dataset.side,S=v==="right",C=S?-5:5,w=p[S?"left":"right"],M=p[S?"right":"left"];i.onPointerGraceIntentChange({area:[{x:m.clientX+C,y:m.clientY},{x:w,y:p.top},{x:M,y:p.top},{x:M,y:p.bottom},{x:w,y:p.bottom}],side:v}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(m),m.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ze(t.onKeyDown,m=>{const p=i.searchRef.current!=="";t.disabled||p&&m.key===" "||BA[o.dir].includes(m.key)&&(n.onOpenChange(!0),n.content?.focus(),m.preventDefault())})})})});IE.displayName=fc;var PE="MenuSubContent",$E=x.forwardRef((t,e)=>{const n=wE(Fo,t.__scopeMenu),{forceMount:o=n.forceMount,...a}=t,i=Hs(Fo,t.__scopeMenu),l=Zc(Fo,t.__scopeMenu),u=zE(PE,t.__scopeMenu),d=x.useRef(null),f=Rt(e,d);return y.jsx(_c.Provider,{scope:t.__scopeMenu,children:y.jsx(Ro,{present:o||i.open,children:y.jsx(_c.Slot,{scope:t.__scopeMenu,children:y.jsx(F0,{id:u.contentId,"aria-labelledby":u.triggerId,...a,ref:f,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{l.isUsingKeyboardRef.current&&d.current?.focus(),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:ze(t.onFocusOutside,g=>{g.target!==u.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ze(t.onEscapeKeyDown,g=>{l.onClose(),g.preventDefault()}),onKeyDown:ze(t.onKeyDown,g=>{const m=g.currentTarget.contains(g.target),p=VA[l.dir].includes(g.key);m&&p&&(i.onOpenChange(!1),u.trigger?.focus(),g.preventDefault())})})})})})});$E.displayName=PE;function LE(t){return t?"open":"closed"}function uf(t){return t==="indeterminate"}function G0(t){return uf(t)?"indeterminate":t?"checked":"unchecked"}function lj(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function cj(t,e){return t.map((n,o)=>t[(e+o)%t.length])}function uj(t,e,n){const a=e.length>1&&Array.from(e).every(f=>f===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let l=cj(t,Math.max(i,0));a.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function dj(t,e){const{x:n,y:o}=t;let a=!1;for(let i=0,l=e.length-1;i<e.length;l=i++){const u=e[i],d=e[l],f=u.x,g=u.y,m=d.x,p=d.y;g>o!=p>o&&n<(m-f)*(o-g)/(p-g)+f&&(a=!a)}return a}function fj(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return dj(n,e)}function Mc(t){return e=>e.pointerType==="mouse"?t(e):void 0}var hj=bE,mj=H0,gj=SE,pj=CE,yj=U0,vj=EE,xj=Ff,bj=ME,wj=RE,Sj=TE,Cj=OE,Ej=AE,_j=jE,Mj=IE,Nj=$E,Uf="DropdownMenu",[Rj]=_r(Uf,[vE]),Zn=vE(),[Dj,HE]=Rj(Uf),BE=t=>{const{__scopeDropdownMenu:e,children:n,dir:o,open:a,defaultOpen:i,onOpenChange:l,modal:u=!0}=t,d=Zn(e),f=x.useRef(null),[g,m]=qa({prop:a,defaultProp:i??!1,onChange:l,caller:Uf});return y.jsx(Dj,{scope:e,triggerId:Fn(),triggerRef:f,contentId:Fn(),open:g,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(p=>!p),[m]),modal:u,children:y.jsx(hj,{...d,open:g,onOpenChange:m,dir:o,modal:u,children:n})})};BE.displayName=Uf;var VE="DropdownMenuTrigger",FE=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...a}=t,i=HE(VE,n),l=Zn(n);return y.jsx(mj,{asChild:!0,...l,children:y.jsx(et.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...a,ref:aa(e,i.triggerRef),onPointerDown:ze(t.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:ze(t.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});FE.displayName=VE;var Tj="DropdownMenuPortal",UE=t=>{const{__scopeDropdownMenu:e,...n}=t,o=Zn(e);return y.jsx(gj,{...o,...n})};UE.displayName=Tj;var YE="DropdownMenuContent",GE=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=HE(YE,n),i=Zn(n),l=x.useRef(!1);return y.jsx(pj,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...o,ref:e,onCloseAutoFocus:ze(t.onCloseAutoFocus,u=>{l.current||a.triggerRef.current?.focus(),l.current=!1,u.preventDefault()}),onInteractOutside:ze(t.onInteractOutside,u=>{const d=u.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,g=d.button===2||f;(!a.modal||g)&&(l.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});GE.displayName=YE;var kj="DropdownMenuGroup",Oj=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(yj,{...a,...o,ref:e})});Oj.displayName=kj;var Aj="DropdownMenuLabel",jj=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(vj,{...a,...o,ref:e})});jj.displayName=Aj;var zj="DropdownMenuItem",qE=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(xj,{...a,...o,ref:e})});qE.displayName=zj;var Ij="DropdownMenuCheckboxItem",WE=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(bj,{...a,...o,ref:e})});WE.displayName=Ij;var Pj="DropdownMenuRadioGroup",$j=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(wj,{...a,...o,ref:e})});$j.displayName=Pj;var Lj="DropdownMenuRadioItem",Hj=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(Sj,{...a,...o,ref:e})});Hj.displayName=Lj;var Bj="DropdownMenuItemIndicator",KE=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(Cj,{...a,...o,ref:e})});KE.displayName=Bj;var Vj="DropdownMenuSeparator",XE=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(Ej,{...a,...o,ref:e})});XE.displayName=Vj;var Fj="DropdownMenuArrow",Uj=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(_j,{...a,...o,ref:e})});Uj.displayName=Fj;var Yj="DropdownMenuSubTrigger",Gj=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(Mj,{...a,...o,ref:e})});Gj.displayName=Yj;var qj="DropdownMenuSubContent",Wj=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...o}=t,a=Zn(n);return y.jsx(Nj,{...a,...o,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Wj.displayName=qj;var Kj=BE,Xj=FE,Zj=UE,Qj=GE,Jj=qE,ez=WE,tz=KE,nz=XE,oz="Label",ZE=x.forwardRef((t,e)=>y.jsx(et.label,{...t,ref:e,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(t.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));ZE.displayName=oz;var rz=ZE;function Dw(t,[e,n]){return Math.min(n,Math.max(e,t))}var Yf="Popover",[QE]=_r(Yf,[Qa]),Qc=Qa(),[az,Ja]=QE(Yf),JE=t=>{const{__scopePopover:e,children:n,open:o,defaultOpen:a,onOpenChange:i,modal:l=!1}=t,u=Qc(e),d=x.useRef(null),[f,g]=x.useState(!1),[m,p]=qa({prop:o,defaultProp:a??!1,onChange:i,caller:Yf});return y.jsx(Lf,{...u,children:y.jsx(az,{scope:e,contentId:Fn(),triggerRef:d,open:m,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(v=>!v),[p]),hasCustomAnchor:f,onCustomAnchorAdd:x.useCallback(()=>g(!0),[]),onCustomAnchorRemove:x.useCallback(()=>g(!1),[]),modal:l,children:n})})};JE.displayName=Yf;var e_="PopoverAnchor",t_=x.forwardRef((t,e)=>{const{__scopePopover:n,...o}=t,a=Ja(e_,n),i=Qc(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=a;return x.useEffect(()=>(l(),()=>u()),[l,u]),y.jsx(Wc,{...i,...o,ref:e})});t_.displayName=e_;var n_="PopoverTrigger",o_=x.forwardRef((t,e)=>{const{__scopePopover:n,...o}=t,a=Ja(n_,n),i=Qc(n),l=Rt(e,a.triggerRef),u=y.jsx(et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":l_(a.open),...o,ref:l,onClick:ze(t.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:y.jsx(Wc,{asChild:!0,...i,children:u})});o_.displayName=n_;var q0="PopoverPortal",[sz,iz]=QE(q0,{forceMount:void 0}),r_=t=>{const{__scopePopover:e,forceMount:n,children:o,container:a}=t,i=Ja(q0,e);return y.jsx(sz,{scope:e,forceMount:n,children:y.jsx(Ro,{present:n||i.open,children:y.jsx(rl,{asChild:!0,container:a,children:o})})})};r_.displayName=q0;var Li="PopoverContent",a_=x.forwardRef((t,e)=>{const n=iz(Li,t.__scopePopover),{forceMount:o=n.forceMount,...a}=t,i=Ja(Li,t.__scopePopover);return y.jsx(Ro,{present:o||i.open,children:i.modal?y.jsx(cz,{...a,ref:e}):y.jsx(uz,{...a,ref:e})})});a_.displayName=Li;var lz=Ga("PopoverContent.RemoveScroll"),cz=x.forwardRef((t,e)=>{const n=Ja(Li,t.__scopePopover),o=x.useRef(null),a=Rt(e,o),i=x.useRef(!1);return x.useEffect(()=>{const l=o.current;if(l)return Of(l)},[]),y.jsx(Gc,{as:lz,allowPinchZoom:!0,children:y.jsx(s_,{...t,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ze(t.onCloseAutoFocus,l=>{l.preventDefault(),i.current||n.triggerRef.current?.focus()}),onPointerDownOutside:ze(t.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,f=u.button===2||d;i.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:ze(t.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),uz=x.forwardRef((t,e)=>{const n=Ja(Li,t.__scopePopover),o=x.useRef(!1),a=x.useRef(!1);return y.jsx(s_,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(o.current||n.triggerRef.current?.focus(),i.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;n.triggerRef.current?.contains(l)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),s_=x.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:g,...m}=t,p=Ja(Li,n),v=Qc(n);return Tf(),y.jsx(Yc,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i,children:y.jsx(ol,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:g,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onDismiss:()=>p.onOpenChange(!1),children:y.jsx(Hf,{"data-state":l_(p.open),role:"dialog",id:p.contentId,...v,...m,ref:e,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),i_="PopoverClose",dz=x.forwardRef((t,e)=>{const{__scopePopover:n,...o}=t,a=Ja(i_,n);return y.jsx(et.button,{type:"button",...o,ref:e,onClick:ze(t.onClick,()=>a.onOpenChange(!1))})});dz.displayName=i_;var fz="PopoverArrow",hz=x.forwardRef((t,e)=>{const{__scopePopover:n,...o}=t,a=Qc(n);return y.jsx(Bf,{...a,...o,ref:e})});hz.displayName=fz;function l_(t){return t?"open":"closed"}var mz=JE,gz=t_,pz=o_,yz=r_,vz=a_,xz=[" ","Enter","ArrowUp","ArrowDown"],bz=[" ","Enter"],Os="Select",[Gf,qf,wz]=S0(Os),[il]=_r(Os,[wz,Qa]),Wf=Qa(),[Sz,es]=il(Os),[Cz,Ez]=il(Os),c_=t=>{const{__scopeSelect:e,children:n,open:o,defaultOpen:a,onOpenChange:i,value:l,defaultValue:u,onValueChange:d,dir:f,name:g,autoComplete:m,disabled:p,required:v,form:S}=t,C=Wf(e),[w,M]=x.useState(null),[R,E]=x.useState(null),[N,D]=x.useState(!1),T=Df(f),[k,A]=qa({prop:o,defaultProp:a??!1,onChange:i,caller:Os}),[B,W]=qa({prop:l,defaultProp:u,onChange:d,caller:Os}),U=x.useRef(null),Y=w?S||!!w.closest("form"):!0,[Z,I]=x.useState(new Set),G=Array.from(Z).map(j=>j.props.value).join(";");return y.jsx(Lf,{...C,children:y.jsxs(Sz,{required:v,scope:e,trigger:w,onTriggerChange:M,valueNode:R,onValueNodeChange:E,valueNodeHasChildren:N,onValueNodeHasChildrenChange:D,contentId:Fn(),value:B,onValueChange:W,open:k,onOpenChange:A,dir:T,triggerPointerDownPosRef:U,disabled:p,children:[y.jsx(Gf.Provider,{scope:e,children:y.jsx(Cz,{scope:t.__scopeSelect,onNativeOptionAdd:x.useCallback(j=>{I(L=>new Set(L).add(j))},[]),onNativeOptionRemove:x.useCallback(j=>{I(L=>{const $=new Set(L);return $.delete(j),$})},[]),children:n})}),Y?y.jsxs(k_,{"aria-hidden":!0,required:v,tabIndex:-1,name:g,autoComplete:m,value:B,onChange:j=>W(j.target.value),disabled:p,form:S,children:[B===void 0?y.jsx("option",{value:""}):null,Array.from(Z)]},G):null]})})};c_.displayName=Os;var u_="SelectTrigger",d_=x.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:o=!1,...a}=t,i=Wf(n),l=es(u_,n),u=l.disabled||o,d=Rt(e,l.onTriggerChange),f=qf(n),g=x.useRef("touch"),[m,p,v]=A_(C=>{const w=f().filter(E=>!E.disabled),M=w.find(E=>E.value===l.value),R=j_(w,C,M);R!==void 0&&l.onValueChange(R.value)}),S=C=>{u||(l.onOpenChange(!0),v()),C&&(l.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})};return y.jsx(Wc,{asChild:!0,...i,children:y.jsx(et.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":O_(l.value)?"":void 0,...a,ref:d,onClick:ze(a.onClick,C=>{C.currentTarget.focus(),g.current!=="mouse"&&S(C)}),onPointerDown:ze(a.onPointerDown,C=>{g.current=C.pointerType;const w=C.target;w.hasPointerCapture(C.pointerId)&&w.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(S(C),C.preventDefault())}),onKeyDown:ze(a.onKeyDown,C=>{const w=m.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&p(C.key),!(w&&C.key===" ")&&xz.includes(C.key)&&(S(),C.preventDefault())})})})});d_.displayName=u_;var f_="SelectValue",h_=x.forwardRef((t,e)=>{const{__scopeSelect:n,className:o,style:a,children:i,placeholder:l="",...u}=t,d=es(f_,n),{onValueNodeHasChildrenChange:f}=d,g=i!==void 0,m=Rt(e,d.onValueNodeChange);return Kn(()=>{f(g)},[f,g]),y.jsx(et.span,{...u,ref:m,style:{pointerEvents:"none"},children:O_(d.value)?y.jsx(y.Fragment,{children:l}):i})});h_.displayName=f_;var _z="SelectIcon",m_=x.forwardRef((t,e)=>{const{__scopeSelect:n,children:o,...a}=t;return y.jsx(et.span,{"aria-hidden":!0,...a,ref:e,children:o||"▼"})});m_.displayName=_z;var Mz="SelectPortal",g_=t=>y.jsx(rl,{asChild:!0,...t});g_.displayName=Mz;var As="SelectContent",p_=x.forwardRef((t,e)=>{const n=es(As,t.__scopeSelect),[o,a]=x.useState();if(Kn(()=>{a(new DocumentFragment)},[]),!n.open){const i=o;return i?nl.createPortal(y.jsx(y_,{scope:t.__scopeSelect,children:y.jsx(Gf.Slot,{scope:t.__scopeSelect,children:y.jsx("div",{children:t.children})})}),i):null}return y.jsx(v_,{...t,ref:e})});p_.displayName=As;var Ko=10,[y_,ts]=il(As),Nz="SelectContentImpl",Rz=Ga("SelectContent.RemoveScroll"),v_=x.forwardRef((t,e)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:l,side:u,sideOffset:d,align:f,alignOffset:g,arrowPadding:m,collisionBoundary:p,collisionPadding:v,sticky:S,hideWhenDetached:C,avoidCollisions:w,...M}=t,R=es(As,n),[E,N]=x.useState(null),[D,T]=x.useState(null),k=Rt(e,K=>N(K)),[A,B]=x.useState(null),[W,U]=x.useState(null),Y=qf(n),[Z,I]=x.useState(!1),G=x.useRef(!1);x.useEffect(()=>{if(E)return Of(E)},[E]),Tf();const j=x.useCallback(K=>{const[ee,...ae]=Y().map(se=>se.ref.current),[ce]=ae.slice(-1),ge=document.activeElement;for(const se of K)if(se===ge||(se?.scrollIntoView({block:"nearest"}),se===ee&&D&&(D.scrollTop=0),se===ce&&D&&(D.scrollTop=D.scrollHeight),se?.focus(),document.activeElement!==ge))return},[Y,D]),L=x.useCallback(()=>j([A,E]),[j,A,E]);x.useEffect(()=>{Z&&L()},[Z,L]);const{onOpenChange:$,triggerPointerDownPosRef:H}=R;x.useEffect(()=>{if(E){let K={x:0,y:0};const ee=ce=>{K={x:Math.abs(Math.round(ce.pageX)-(H.current?.x??0)),y:Math.abs(Math.round(ce.pageY)-(H.current?.y??0))}},ae=ce=>{K.x<=10&&K.y<=10?ce.preventDefault():E.contains(ce.target)||$(!1),document.removeEventListener("pointermove",ee),H.current=null};return H.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",ae,{capture:!0})}}},[E,$,H]),x.useEffect(()=>{const K=()=>$(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[$]);const[X,P]=A_(K=>{const ee=Y().filter(ge=>!ge.disabled),ae=ee.find(ge=>ge.ref.current===document.activeElement),ce=j_(ee,K,ae);ce&&setTimeout(()=>ce.ref.current.focus())}),z=x.useCallback((K,ee,ae)=>{const ce=!G.current&&!ae;(R.value!==void 0&&R.value===ee||ce)&&(B(K),ce&&(G.current=!0))},[R.value]),V=x.useCallback(()=>E?.focus(),[E]),q=x.useCallback((K,ee,ae)=>{const ce=!G.current&&!ae;(R.value!==void 0&&R.value===ee||ce)&&U(K)},[R.value]),J=o==="popper"?jp:x_,oe=J===jp?{side:u,sideOffset:d,align:f,alignOffset:g,arrowPadding:m,collisionBoundary:p,collisionPadding:v,sticky:S,hideWhenDetached:C,avoidCollisions:w}:{};return y.jsx(y_,{scope:n,content:E,viewport:D,onViewportChange:T,itemRefCallback:z,selectedItem:A,onItemLeave:V,itemTextRefCallback:q,focusSelectedItem:L,selectedItemText:W,position:o,isPositioned:Z,searchRef:X,children:y.jsx(Gc,{as:Rz,allowPinchZoom:!0,children:y.jsx(Yc,{asChild:!0,trapped:R.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:ze(a,K=>{R.trigger?.focus({preventScroll:!0}),K.preventDefault()}),children:y.jsx(ol,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:y.jsx(J,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:K=>K.preventDefault(),...M,...oe,onPlaced:()=>I(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...M.style},onKeyDown:ze(M.onKeyDown,K=>{const ee=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!ee&&K.key.length===1&&P(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let ce=Y().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);if(["ArrowUp","End"].includes(K.key)&&(ce=ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const ge=K.target,se=ce.indexOf(ge);ce=ce.slice(se+1)}setTimeout(()=>j(ce)),K.preventDefault()}})})})})})})});v_.displayName=Nz;var Dz="SelectItemAlignedPosition",x_=x.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:o,...a}=t,i=es(As,n),l=ts(As,n),[u,d]=x.useState(null),[f,g]=x.useState(null),m=Rt(e,k=>g(k)),p=qf(n),v=x.useRef(!1),S=x.useRef(!0),{viewport:C,selectedItem:w,selectedItemText:M,focusSelectedItem:R}=l,E=x.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&f&&C&&w&&M){const k=i.trigger.getBoundingClientRect(),A=f.getBoundingClientRect(),B=i.valueNode.getBoundingClientRect(),W=M.getBoundingClientRect();if(i.dir!=="rtl"){const ge=W.left-A.left,se=B.left-ge,ve=k.left-se,De=k.width+ve,Be=Math.max(De,A.width),Ie=window.innerWidth-Ko,lt=Dw(se,[Ko,Math.max(Ko,Ie-Be)]);u.style.minWidth=De+"px",u.style.left=lt+"px"}else{const ge=A.right-W.right,se=window.innerWidth-B.right-ge,ve=window.innerWidth-k.right-se,De=k.width+ve,Be=Math.max(De,A.width),Ie=window.innerWidth-Ko,lt=Dw(se,[Ko,Math.max(Ko,Ie-Be)]);u.style.minWidth=De+"px",u.style.right=lt+"px"}const U=p(),Y=window.innerHeight-Ko*2,Z=C.scrollHeight,I=window.getComputedStyle(f),G=parseInt(I.borderTopWidth,10),j=parseInt(I.paddingTop,10),L=parseInt(I.borderBottomWidth,10),$=parseInt(I.paddingBottom,10),H=G+j+Z+$+L,X=Math.min(w.offsetHeight*5,H),P=window.getComputedStyle(C),z=parseInt(P.paddingTop,10),V=parseInt(P.paddingBottom,10),q=k.top+k.height/2-Ko,J=Y-q,oe=w.offsetHeight/2,K=w.offsetTop+oe,ee=G+j+K,ae=H-ee;if(ee<=q){const ge=U.length>0&&w===U[U.length-1].ref.current;u.style.bottom="0px";const se=f.clientHeight-C.offsetTop-C.offsetHeight,ve=Math.max(J,oe+(ge?V:0)+se+L),De=ee+ve;u.style.height=De+"px"}else{const ge=U.length>0&&w===U[0].ref.current;u.style.top="0px";const ve=Math.max(q,G+C.offsetTop+(ge?z:0)+oe)+ae;u.style.height=ve+"px",C.scrollTop=ee-q+C.offsetTop}u.style.margin=`${Ko}px 0`,u.style.minHeight=X+"px",u.style.maxHeight=Y+"px",o?.(),requestAnimationFrame(()=>v.current=!0)}},[p,i.trigger,i.valueNode,u,f,C,w,M,i.dir,o]);Kn(()=>E(),[E]);const[N,D]=x.useState();Kn(()=>{f&&D(window.getComputedStyle(f).zIndex)},[f]);const T=x.useCallback(k=>{k&&S.current===!0&&(E(),R?.(),S.current=!1)},[E,R]);return y.jsx(kz,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:v,onScrollButtonChange:T,children:y.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:y.jsx(et.div,{...a,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});x_.displayName=Dz;var Tz="SelectPopperPosition",jp=x.forwardRef((t,e)=>{const{__scopeSelect:n,align:o="start",collisionPadding:a=Ko,...i}=t,l=Wf(n);return y.jsx(Hf,{...l,...i,ref:e,align:o,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});jp.displayName=Tz;var[kz,W0]=il(As,{}),zp="SelectViewport",b_=x.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:o,...a}=t,i=ts(zp,n),l=W0(zp,n),u=Rt(e,i.onViewportChange),d=x.useRef(0);return y.jsxs(y.Fragment,{children:[y.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),y.jsx(Gf.Slot,{scope:n,children:y.jsx(et.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:ze(a.onScroll,f=>{const g=f.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:p}=l;if(p?.current&&m){const v=Math.abs(d.current-g.scrollTop);if(v>0){const S=window.innerHeight-Ko*2,C=parseFloat(m.style.minHeight),w=parseFloat(m.style.height),M=Math.max(C,w);if(M<S){const R=M+v,E=Math.min(S,R),N=R-E;m.style.height=E+"px",m.style.bottom==="0px"&&(g.scrollTop=N>0?N:0,m.style.justifyContent="flex-end")}}}d.current=g.scrollTop})})})]})});b_.displayName=zp;var w_="SelectGroup",[Oz,Az]=il(w_),jz=x.forwardRef((t,e)=>{const{__scopeSelect:n,...o}=t,a=Fn();return y.jsx(Oz,{scope:n,id:a,children:y.jsx(et.div,{role:"group","aria-labelledby":a,...o,ref:e})})});jz.displayName=w_;var S_="SelectLabel",zz=x.forwardRef((t,e)=>{const{__scopeSelect:n,...o}=t,a=Az(S_,n);return y.jsx(et.div,{id:a.id,...o,ref:e})});zz.displayName=S_;var df="SelectItem",[Iz,C_]=il(df),E_=x.forwardRef((t,e)=>{const{__scopeSelect:n,value:o,disabled:a=!1,textValue:i,...l}=t,u=es(df,n),d=ts(df,n),f=u.value===o,[g,m]=x.useState(i??""),[p,v]=x.useState(!1),S=Rt(e,R=>d.itemRefCallback?.(R,o,a)),C=Fn(),w=x.useRef("touch"),M=()=>{a||(u.onValueChange(o),u.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return y.jsx(Iz,{scope:n,value:o,disabled:a,textId:C,isSelected:f,onItemTextChange:x.useCallback(R=>{m(E=>E||(R?.textContent??"").trim())},[]),children:y.jsx(Gf.ItemSlot,{scope:n,value:o,disabled:a,textValue:g,children:y.jsx(et.div,{role:"option","aria-labelledby":C,"data-highlighted":p?"":void 0,"aria-selected":f&&p,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:S,onFocus:ze(l.onFocus,()=>v(!0)),onBlur:ze(l.onBlur,()=>v(!1)),onClick:ze(l.onClick,()=>{w.current!=="mouse"&&M()}),onPointerUp:ze(l.onPointerUp,()=>{w.current==="mouse"&&M()}),onPointerDown:ze(l.onPointerDown,R=>{w.current=R.pointerType}),onPointerMove:ze(l.onPointerMove,R=>{w.current=R.pointerType,a?d.onItemLeave?.():w.current==="mouse"&&R.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ze(l.onPointerLeave,R=>{R.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:ze(l.onKeyDown,R=>{d.searchRef?.current!==""&&R.key===" "||(bz.includes(R.key)&&M(),R.key===" "&&R.preventDefault())})})})})});E_.displayName=df;var hc="SelectItemText",__=x.forwardRef((t,e)=>{const{__scopeSelect:n,className:o,style:a,...i}=t,l=es(hc,n),u=ts(hc,n),d=C_(hc,n),f=Ez(hc,n),[g,m]=x.useState(null),p=Rt(e,M=>m(M),d.onItemTextChange,M=>u.itemTextRefCallback?.(M,d.value,d.disabled)),v=g?.textContent,S=x.useMemo(()=>y.jsx("option",{value:d.value,disabled:d.disabled,children:v},d.value),[d.disabled,d.value,v]),{onNativeOptionAdd:C,onNativeOptionRemove:w}=f;return Kn(()=>(C(S),()=>w(S)),[C,w,S]),y.jsxs(y.Fragment,{children:[y.jsx(et.span,{id:d.textId,...i,ref:p}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?nl.createPortal(i.children,l.valueNode):null]})});__.displayName=hc;var M_="SelectItemIndicator",N_=x.forwardRef((t,e)=>{const{__scopeSelect:n,...o}=t;return C_(M_,n).isSelected?y.jsx(et.span,{"aria-hidden":!0,...o,ref:e}):null});N_.displayName=M_;var Ip="SelectScrollUpButton",R_=x.forwardRef((t,e)=>{const n=ts(Ip,t.__scopeSelect),o=W0(Ip,t.__scopeSelect),[a,i]=x.useState(!1),l=Rt(e,o.onScrollButtonChange);return Kn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const f=d.scrollTop>0;i(f)};const d=n.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),a?y.jsx(T_,{...t,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null});R_.displayName=Ip;var Pp="SelectScrollDownButton",D_=x.forwardRef((t,e)=>{const n=ts(Pp,t.__scopeSelect),o=W0(Pp,t.__scopeSelect),[a,i]=x.useState(!1),l=Rt(e,o.onScrollButtonChange);return Kn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const f=d.scrollHeight-d.clientHeight,g=Math.ceil(d.scrollTop)<f;i(g)};const d=n.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),a?y.jsx(T_,{...t,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null});D_.displayName=Pp;var T_=x.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:o,...a}=t,i=ts("SelectScrollButton",n),l=x.useRef(null),u=qf(n),d=x.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return x.useEffect(()=>()=>d(),[d]),Kn(()=>{u().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),y.jsx(et.div,{"aria-hidden":!0,...a,ref:e,style:{flexShrink:0,...a.style},onPointerDown:ze(a.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(o,50))}),onPointerMove:ze(a.onPointerMove,()=>{i.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(o,50))}),onPointerLeave:ze(a.onPointerLeave,()=>{d()})})}),Pz="SelectSeparator",$z=x.forwardRef((t,e)=>{const{__scopeSelect:n,...o}=t;return y.jsx(et.div,{"aria-hidden":!0,...o,ref:e})});$z.displayName=Pz;var $p="SelectArrow",Lz=x.forwardRef((t,e)=>{const{__scopeSelect:n,...o}=t,a=Wf(n),i=es($p,n),l=ts($p,n);return i.open&&l.position==="popper"?y.jsx(Bf,{...a,...o,ref:e}):null});Lz.displayName=$p;var Hz="SelectBubbleInput",k_=x.forwardRef(({__scopeSelect:t,value:e,...n},o)=>{const a=x.useRef(null),i=Rt(o,a),l=j2(e);return x.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==e&&g){const m=new Event("change",{bubbles:!0});g.call(u,e),u.dispatchEvent(m)}},[l,e]),y.jsx(et.select,{...n,style:{...o2,...n.style},ref:i,defaultValue:e})});k_.displayName=Hz;function O_(t){return t===""||t===void 0}function A_(t){const e=wr(t),n=x.useRef(""),o=x.useRef(0),a=x.useCallback(l=>{const u=n.current+l;e(u),(function d(f){n.current=f,window.clearTimeout(o.current),f!==""&&(o.current=window.setTimeout(()=>d(""),1e3))})(u)},[e]),i=x.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,a,i]}function j_(t,e,n){const a=e.length>1&&Array.from(e).every(f=>f===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let l=Bz(t,Math.max(i,0));a.length===1&&(l=l.filter(f=>f!==n));const d=l.find(f=>f.textValue.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function Bz(t,e){return t.map((n,o)=>t[(e+o)%t.length])}var Vz=c_,Fz=d_,Uz=h_,Yz=m_,Gz=g_,qz=p_,Wz=b_,Kz=E_,Xz=__,Zz=N_,Qz=R_,Jz=D_,[Kf]=_r("Tooltip",[Qa]),Xf=Qa(),z_="TooltipProvider",e6=700,Lp="tooltip.open",[t6,K0]=Kf(z_),I_=t=>{const{__scopeTooltip:e,delayDuration:n=e6,skipDelayDuration:o=300,disableHoverableContent:a=!1,children:i}=t,l=x.useRef(!0),u=x.useRef(!1),d=x.useRef(0);return x.useEffect(()=>{const f=d.current;return()=>window.clearTimeout(f)},[]),y.jsx(t6,{scope:e,isOpenDelayedRef:l,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,o)},[o]),isPointerInTransitRef:u,onPointerInTransitChange:x.useCallback(f=>{u.current=f},[]),disableHoverableContent:a,children:i})};I_.displayName=z_;var Nc="Tooltip",[n6,Jc]=Kf(Nc),P_=t=>{const{__scopeTooltip:e,children:n,open:o,defaultOpen:a,onOpenChange:i,disableHoverableContent:l,delayDuration:u}=t,d=K0(Nc,t.__scopeTooltip),f=Xf(e),[g,m]=x.useState(null),p=Fn(),v=x.useRef(0),S=l??d.disableHoverableContent,C=u??d.delayDuration,w=x.useRef(!1),[M,R]=qa({prop:o,defaultProp:a??!1,onChange:k=>{k?(d.onOpen(),document.dispatchEvent(new CustomEvent(Lp))):d.onClose(),i?.(k)},caller:Nc}),E=x.useMemo(()=>M?w.current?"delayed-open":"instant-open":"closed",[M]),N=x.useCallback(()=>{window.clearTimeout(v.current),v.current=0,w.current=!1,R(!0)},[R]),D=x.useCallback(()=>{window.clearTimeout(v.current),v.current=0,R(!1)},[R]),T=x.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{w.current=!0,R(!0),v.current=0},C)},[C,R]);return x.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),y.jsx(Lf,{...f,children:y.jsx(n6,{scope:e,contentId:p,open:M,stateAttribute:E,trigger:g,onTriggerChange:m,onTriggerEnter:x.useCallback(()=>{d.isOpenDelayedRef.current?T():N()},[d.isOpenDelayedRef,T,N]),onTriggerLeave:x.useCallback(()=>{S?D():(window.clearTimeout(v.current),v.current=0)},[D,S]),onOpen:N,onClose:D,disableHoverableContent:S,children:n})})};P_.displayName=Nc;var Hp="TooltipTrigger",$_=x.forwardRef((t,e)=>{const{__scopeTooltip:n,...o}=t,a=Jc(Hp,n),i=K0(Hp,n),l=Xf(n),u=x.useRef(null),d=Rt(e,u,a.onTriggerChange),f=x.useRef(!1),g=x.useRef(!1),m=x.useCallback(()=>f.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),y.jsx(Wc,{asChild:!0,...l,children:y.jsx(et.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...o,ref:d,onPointerMove:ze(t.onPointerMove,p=>{p.pointerType!=="touch"&&!g.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),g.current=!0)}),onPointerLeave:ze(t.onPointerLeave,()=>{a.onTriggerLeave(),g.current=!1}),onPointerDown:ze(t.onPointerDown,()=>{a.open&&a.onClose(),f.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:ze(t.onFocus,()=>{f.current||a.onOpen()}),onBlur:ze(t.onBlur,a.onClose),onClick:ze(t.onClick,a.onClose)})})});$_.displayName=Hp;var X0="TooltipPortal",[o6,r6]=Kf(X0,{forceMount:void 0}),L_=t=>{const{__scopeTooltip:e,forceMount:n,children:o,container:a}=t,i=Jc(X0,e);return y.jsx(o6,{scope:e,forceMount:n,children:y.jsx(Ro,{present:n||i.open,children:y.jsx(rl,{asChild:!0,container:a,children:o})})})};L_.displayName=X0;var Hi="TooltipContent",H_=x.forwardRef((t,e)=>{const n=r6(Hi,t.__scopeTooltip),{forceMount:o=n.forceMount,side:a="top",...i}=t,l=Jc(Hi,t.__scopeTooltip);return y.jsx(Ro,{present:o||l.open,children:l.disableHoverableContent?y.jsx(B_,{side:a,...i,ref:e}):y.jsx(a6,{side:a,...i,ref:e})})}),a6=x.forwardRef((t,e)=>{const n=Jc(Hi,t.__scopeTooltip),o=K0(Hi,t.__scopeTooltip),a=x.useRef(null),i=Rt(e,a),[l,u]=x.useState(null),{trigger:d,onClose:f}=n,g=a.current,{onPointerInTransitChange:m}=o,p=x.useCallback(()=>{u(null),m(!1)},[m]),v=x.useCallback((S,C)=>{const w=S.currentTarget,M={x:S.clientX,y:S.clientY},R=c6(M,w.getBoundingClientRect()),E=u6(M,R),N=d6(C.getBoundingClientRect()),D=h6([...E,...N]);u(D),m(!0)},[m]);return x.useEffect(()=>()=>p(),[p]),x.useEffect(()=>{if(d&&g){const S=w=>v(w,g),C=w=>v(w,d);return d.addEventListener("pointerleave",S),g.addEventListener("pointerleave",C),()=>{d.removeEventListener("pointerleave",S),g.removeEventListener("pointerleave",C)}}},[d,g,v,p]),x.useEffect(()=>{if(l){const S=C=>{const w=C.target,M={x:C.clientX,y:C.clientY},R=d?.contains(w)||g?.contains(w),E=!f6(M,l);R?p():E&&(p(),f())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[d,g,l,f,p]),y.jsx(B_,{...t,ref:i})}),[s6,i6]=Kf(Nc,{isInside:!1}),l6=Rk("TooltipContent"),B_=x.forwardRef((t,e)=>{const{__scopeTooltip:n,children:o,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:l,...u}=t,d=Jc(Hi,n),f=Xf(n),{onClose:g}=d;return x.useEffect(()=>(document.addEventListener(Lp,g),()=>document.removeEventListener(Lp,g)),[g]),x.useEffect(()=>{if(d.trigger){const m=p=>{p.target?.contains(d.trigger)&&g()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[d.trigger,g]),y.jsx(ol,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:m=>m.preventDefault(),onDismiss:g,children:y.jsxs(Hf,{"data-state":d.stateAttribute,...f,...u,ref:e,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[y.jsx(l6,{children:o}),y.jsx(s6,{scope:n,isInside:!0,children:y.jsx(jk,{id:d.contentId,role:"tooltip",children:a||o})})]})})});H_.displayName=Hi;var V_="TooltipArrow",F_=x.forwardRef((t,e)=>{const{__scopeTooltip:n,...o}=t,a=Xf(n);return i6(V_,n).isInside?null:y.jsx(Bf,{...a,...o,ref:e})});F_.displayName=V_;function c6(t,e){const n=Math.abs(e.top-t.y),o=Math.abs(e.bottom-t.y),a=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,o,a,i)){case i:return"left";case a:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function u6(t,e,n=5){const o=[];switch(e){case"top":o.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":o.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":o.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":o.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return o}function d6(t){const{top:e,right:n,bottom:o,left:a}=t;return[{x:a,y:e},{x:n,y:e},{x:n,y:o},{x:a,y:o}]}function f6(t,e){const{x:n,y:o}=t;let a=!1;for(let i=0,l=e.length-1;i<e.length;l=i++){const u=e[i],d=e[l],f=u.x,g=u.y,m=d.x,p=d.y;g>o!=p>o&&n<(m-f)*(o-g)/(p-g)+f&&(a=!a)}return a}function h6(t){const e=t.slice();return e.sort((n,o)=>n.x<o.x?-1:n.x>o.x?1:n.y<o.y?-1:n.y>o.y?1:0),m6(e)}function m6(t){if(t.length<=1)return t.slice();const e=[];for(let o=0;o<t.length;o++){const a=t[o];for(;e.length>=2;){const i=e[e.length-1],l=e[e.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))e.pop();else break}e.push(a)}e.pop();const n=[];for(let o=t.length-1;o>=0;o--){const a=t[o];for(;n.length>=2;){const i=n[n.length-1],l=n[n.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))n.pop();else break}n.push(a)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var g6=I_,p6=P_,y6=$_,v6=L_,x6=H_,b6=F_;const w6=(t,e)=>{const n=new Array(t.length+e.length);for(let o=0;o<t.length;o++)n[o]=t[o];for(let o=0;o<e.length;o++)n[t.length+o]=e[o];return n},S6=(t,e)=>({classGroupId:t,validator:e}),U_=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),ff="-",Tw=[],C6="arbitrary..",E6=t=>{const e=M6(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=t;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return _6(l);const u=l.split(ff),d=u[0]===""&&u.length>1?1:0;return Y_(u,d,e)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=o[l],f=n[l];return d?f?w6(f,d):d:f||Tw}return n[l]||Tw}}},Y_=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const a=t[e],i=n.nextPart.get(a);if(i){const f=Y_(t,e+1,i);if(f)return f}const l=n.validators;if(l===null)return;const u=e===0?t.join(ff):t.slice(e).join(ff),d=l.length;for(let f=0;f<d;f++){const g=l[f];if(g.validator(u))return g.classGroupId}},_6=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),o=e.slice(0,n);return o?C6+o:void 0})(),M6=t=>{const{theme:e,classGroups:n}=t;return N6(n,e)},N6=(t,e)=>{const n=U_();for(const o in t){const a=t[o];Z0(a,n,o,e)}return n},Z0=(t,e,n,o)=>{const a=t.length;for(let i=0;i<a;i++){const l=t[i];R6(l,e,n,o)}},R6=(t,e,n,o)=>{if(typeof t=="string"){D6(t,e,n);return}if(typeof t=="function"){T6(t,e,n,o);return}k6(t,e,n,o)},D6=(t,e,n)=>{const o=t===""?e:G_(e,t);o.classGroupId=n},T6=(t,e,n,o)=>{if(O6(t)){Z0(t(o),e,n,o);return}e.validators===null&&(e.validators=[]),e.validators.push(S6(n,t))},k6=(t,e,n,o)=>{const a=Object.entries(t),i=a.length;for(let l=0;l<i;l++){const[u,d]=a[l];Z0(d,G_(e,u),n,o)}},G_=(t,e)=>{let n=t;const o=e.split(ff),a=o.length;for(let i=0;i<a;i++){const l=o[i];let u=n.nextPart.get(l);u||(u=U_(),n.nextPart.set(l,u)),n=u}return n},O6=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,A6=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),o=Object.create(null);const a=(i,l)=>{n[i]=l,e++,e>t&&(e=0,o=n,n=Object.create(null))};return{get(i){let l=n[i];if(l!==void 0)return l;if((l=o[i])!==void 0)return a(i,l),l},set(i,l){i in n?n[i]=l:a(i,l)}}},Bp="!",kw=":",j6=[],Ow=(t,e,n,o,a)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:o,isExternal:a}),z6=t=>{const{prefix:e,experimentalParseClassName:n}=t;let o=a=>{const i=[];let l=0,u=0,d=0,f;const g=a.length;for(let C=0;C<g;C++){const w=a[C];if(l===0&&u===0){if(w===kw){i.push(a.slice(d,C)),d=C+1;continue}if(w==="/"){f=C;continue}}w==="["?l++:w==="]"?l--:w==="("?u++:w===")"&&u--}const m=i.length===0?a:a.slice(d);let p=m,v=!1;m.endsWith(Bp)?(p=m.slice(0,-1),v=!0):m.startsWith(Bp)&&(p=m.slice(1),v=!0);const S=f&&f>d?f-d:void 0;return Ow(i,v,p,S)};if(e){const a=e+kw,i=o;o=l=>l.startsWith(a)?i(l.slice(a.length)):Ow(j6,!1,l,void 0,!0)}if(n){const a=o;o=i=>n({className:i,parseClassName:a})}return o},I6=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,o)=>{e.set(n,1e6+o)}),n=>{const o=[];let a=[];for(let i=0;i<n.length;i++){const l=n[i],u=l[0]==="[",d=e.has(l);u||d?(a.length>0&&(a.sort(),o.push(...a),a=[]),o.push(l)):a.push(l)}return a.length>0&&(a.sort(),o.push(...a)),o}},P6=t=>({cache:A6(t.cacheSize),parseClassName:z6(t),sortModifiers:I6(t),...E6(t)}),$6=/\s+/,L6=(t,e)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:a,sortModifiers:i}=e,l=[],u=t.trim().split($6);let d="";for(let f=u.length-1;f>=0;f-=1){const g=u[f],{isExternal:m,modifiers:p,hasImportantModifier:v,baseClassName:S,maybePostfixModifierPosition:C}=n(g);if(m){d=g+(d.length>0?" "+d:d);continue}let w=!!C,M=o(w?S.substring(0,C):S);if(!M){if(!w){d=g+(d.length>0?" "+d:d);continue}if(M=o(S),!M){d=g+(d.length>0?" "+d:d);continue}w=!1}const R=p.length===0?"":p.length===1?p[0]:i(p).join(":"),E=v?R+Bp:R,N=E+M;if(l.indexOf(N)>-1)continue;l.push(N);const D=a(M,w);for(let T=0;T<D.length;++T){const k=D[T];l.push(E+k)}d=g+(d.length>0?" "+d:d)}return d},H6=(...t)=>{let e=0,n,o,a="";for(;e<t.length;)(n=t[e++])&&(o=q_(n))&&(a&&(a+=" "),a+=o);return a},q_=t=>{if(typeof t=="string")return t;let e,n="";for(let o=0;o<t.length;o++)t[o]&&(e=q_(t[o]))&&(n&&(n+=" "),n+=e);return n},B6=(t,...e)=>{let n,o,a,i;const l=d=>{const f=e.reduce((g,m)=>m(g),t());return n=P6(f),o=n.cache.get,a=n.cache.set,i=u,u(d)},u=d=>{const f=o(d);if(f)return f;const g=L6(d,n);return a(d,g),g};return i=l,(...d)=>i(H6(...d))},V6=[],An=t=>{const e=n=>n[t]||V6;return e.isThemeGetter=!0,e},W_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,K_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,F6=/^\d+\/\d+$/,U6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Y6=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,G6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,q6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,W6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Si=t=>F6.test(t),ft=t=>!!t&&!Number.isNaN(Number(t)),Pa=t=>!!t&&Number.isInteger(Number(t)),Gg=t=>t.endsWith("%")&&ft(t.slice(0,-1)),Xr=t=>U6.test(t),K6=()=>!0,X6=t=>Y6.test(t)&&!G6.test(t),X_=()=>!1,Z6=t=>q6.test(t),Q6=t=>W6.test(t),J6=t=>!Le(t)&&!He(t),e8=t=>ll(t,J_,X_),Le=t=>W_.test(t),Ss=t=>ll(t,eM,X6),qg=t=>ll(t,a8,ft),Aw=t=>ll(t,Z_,X_),t8=t=>ll(t,Q_,Q6),kd=t=>ll(t,tM,Z6),He=t=>K_.test(t),oc=t=>cl(t,eM),n8=t=>cl(t,s8),jw=t=>cl(t,Z_),o8=t=>cl(t,J_),r8=t=>cl(t,Q_),Od=t=>cl(t,tM,!0),ll=(t,e,n)=>{const o=W_.exec(t);return o?o[1]?e(o[1]):n(o[2]):!1},cl=(t,e,n=!1)=>{const o=K_.exec(t);return o?o[1]?e(o[1]):n:!1},Z_=t=>t==="position"||t==="percentage",Q_=t=>t==="image"||t==="url",J_=t=>t==="length"||t==="size"||t==="bg-size",eM=t=>t==="length",a8=t=>t==="number",s8=t=>t==="family-name",tM=t=>t==="shadow",i8=()=>{const t=An("color"),e=An("font"),n=An("text"),o=An("font-weight"),a=An("tracking"),i=An("leading"),l=An("breakpoint"),u=An("container"),d=An("spacing"),f=An("radius"),g=An("shadow"),m=An("inset-shadow"),p=An("text-shadow"),v=An("drop-shadow"),S=An("blur"),C=An("perspective"),w=An("aspect"),M=An("ease"),R=An("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...N(),He,Le],T=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],A=()=>[He,Le,d],B=()=>[Si,"full","auto",...A()],W=()=>[Pa,"none","subgrid",He,Le],U=()=>["auto",{span:["full",Pa,He,Le]},Pa,He,Le],Y=()=>[Pa,"auto",He,Le],Z=()=>["auto","min","max","fr",He,Le],I=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...A()],L=()=>[Si,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],$=()=>[t,He,Le],H=()=>[...N(),jw,Aw,{position:[He,Le]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],P=()=>["auto","cover","contain",o8,e8,{size:[He,Le]}],z=()=>[Gg,oc,Ss],V=()=>["","none","full",f,He,Le],q=()=>["",ft,oc,Ss],J=()=>["solid","dashed","dotted","double"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>[ft,Gg,jw,Aw],ee=()=>["","none",S,He,Le],ae=()=>["none",ft,He,Le],ce=()=>["none",ft,He,Le],ge=()=>[ft,He,Le],se=()=>[Si,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Xr],breakpoint:[Xr],color:[K6],container:[Xr],"drop-shadow":[Xr],ease:["in","out","in-out"],font:[J6],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Xr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Xr],shadow:[Xr],spacing:["px",ft],text:[Xr],"text-shadow":[Xr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Si,Le,He,w]}],container:["container"],columns:[{columns:[ft,Le,He,u]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{start:B()}],end:[{end:B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[Pa,"auto",He,Le]}],basis:[{basis:[Si,"full","auto",u,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ft,Si,"auto","initial","none",Le]}],grow:[{grow:["",ft,He,Le]}],shrink:[{shrink:["",ft,He,Le]}],order:[{order:[Pa,"first","last","none",He,Le]}],"grid-cols":[{"grid-cols":W()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":W()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Z()}],"auto-rows":[{"auto-rows":Z()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...I(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...I()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":I()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:L()}],w:[{w:[u,"screen",...L()]}],"min-w":[{"min-w":[u,"screen","none",...L()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...L()]}],h:[{h:["screen","lh",...L()]}],"min-h":[{"min-h":["screen","lh","none",...L()]}],"max-h":[{"max-h":["screen","lh",...L()]}],"font-size":[{text:["base",n,oc,Ss]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,He,qg]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Gg,Le]}],"font-family":[{font:[n8,Le,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,He,Le]}],"line-clamp":[{"line-clamp":[ft,"none",He,qg]}],leading:[{leading:[i,...A()]}],"list-image":[{"list-image":["none",He,Le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",He,Le]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[ft,"from-font","auto",He,Ss]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[ft,"auto",He,Le]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",He,Le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",He,Le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:H()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Pa,He,Le],radial:["",He,Le],conic:[Pa,He,Le]},r8,t8]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:z()}],"gradient-via-pos":[{via:z()}],"gradient-to-pos":[{to:z()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:V()}],"rounded-s":[{"rounded-s":V()}],"rounded-e":[{"rounded-e":V()}],"rounded-t":[{"rounded-t":V()}],"rounded-r":[{"rounded-r":V()}],"rounded-b":[{"rounded-b":V()}],"rounded-l":[{"rounded-l":V()}],"rounded-ss":[{"rounded-ss":V()}],"rounded-se":[{"rounded-se":V()}],"rounded-ee":[{"rounded-ee":V()}],"rounded-es":[{"rounded-es":V()}],"rounded-tl":[{"rounded-tl":V()}],"rounded-tr":[{"rounded-tr":V()}],"rounded-br":[{"rounded-br":V()}],"rounded-bl":[{"rounded-bl":V()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ft,He,Le]}],"outline-w":[{outline:["",ft,oc,Ss]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",g,Od,kd]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",m,Od,kd]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[ft,Ss]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",p,Od,kd]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[ft,He,Le]}],"mix-blend":[{"mix-blend":[...oe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":oe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ft]}],"mask-image-linear-from-pos":[{"mask-linear-from":K()}],"mask-image-linear-to-pos":[{"mask-linear-to":K()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":K()}],"mask-image-t-to-pos":[{"mask-t-to":K()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":K()}],"mask-image-r-to-pos":[{"mask-r-to":K()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":K()}],"mask-image-b-to-pos":[{"mask-b-to":K()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":K()}],"mask-image-l-to-pos":[{"mask-l-to":K()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":K()}],"mask-image-x-to-pos":[{"mask-x-to":K()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":K()}],"mask-image-y-to-pos":[{"mask-y-to":K()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[He,Le]}],"mask-image-radial-from-pos":[{"mask-radial-from":K()}],"mask-image-radial-to-pos":[{"mask-radial-to":K()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":N()}],"mask-image-conic-pos":[{"mask-conic":[ft]}],"mask-image-conic-from-pos":[{"mask-conic-from":K()}],"mask-image-conic-to-pos":[{"mask-conic-to":K()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:H()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",He,Le]}],filter:[{filter:["","none",He,Le]}],blur:[{blur:ee()}],brightness:[{brightness:[ft,He,Le]}],contrast:[{contrast:[ft,He,Le]}],"drop-shadow":[{"drop-shadow":["","none",v,Od,kd]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",ft,He,Le]}],"hue-rotate":[{"hue-rotate":[ft,He,Le]}],invert:[{invert:["",ft,He,Le]}],saturate:[{saturate:[ft,He,Le]}],sepia:[{sepia:["",ft,He,Le]}],"backdrop-filter":[{"backdrop-filter":["","none",He,Le]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[ft,He,Le]}],"backdrop-contrast":[{"backdrop-contrast":[ft,He,Le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ft,He,Le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ft,He,Le]}],"backdrop-invert":[{"backdrop-invert":["",ft,He,Le]}],"backdrop-opacity":[{"backdrop-opacity":[ft,He,Le]}],"backdrop-saturate":[{"backdrop-saturate":[ft,He,Le]}],"backdrop-sepia":[{"backdrop-sepia":["",ft,He,Le]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",He,Le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ft,"initial",He,Le]}],ease:[{ease:["linear","initial",M,He,Le]}],delay:[{delay:[ft,He,Le]}],animate:[{animate:["none",R,He,Le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,He,Le]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":["scale-3d"],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],transform:[{transform:[He,Le,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:se()}],"translate-x":[{"translate-x":se()}],"translate-y":[{"translate-y":se()}],"translate-z":[{"translate-z":se()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",He,Le]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",He,Le]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[ft,oc,Ss,qg]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},l8=B6(i8);function Me(...t){return l8(e2(t))}const Vp=Nf("focus-visible:border-ring cursor-pointer focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground shadow-xs",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",destructive:"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",lg:"h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-9","icon-xs":"size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function nn(t){const e=be.c(16);let n,o,a,i,l;e[0]!==t?({className:n,variant:a,size:i,asChild:l,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5]);const u=a===void 0?"default":a,d=i===void 0?"default":i,g=(l===void 0?!1:l)?Rf:"button";let m;e[6]!==n||e[7]!==d||e[8]!==u?(m=Me(Vp({variant:u,size:d,className:n})),e[6]=n,e[7]=d,e[8]=u,e[9]=m):m=e[9];let p;return e[10]!==g||e[11]!==o||e[12]!==d||e[13]!==m||e[14]!==u?(p=y.jsx(g,{"data-slot":"button","data-variant":u,"data-size":d,className:m,...o}),e[10]=g,e[11]=o,e[12]=d,e[13]=m,e[14]=u,e[15]=p):p=e[15],p}function Bi(t){const e=be.c(10);let n,o,a;e[0]!==t?({className:n,type:a,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a):(n=e[1],o=e[2],a=e[3]);let i;e[4]!==n?(i=Me("dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-9 rounded-md border bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] file:h-7 file:text-sm file:font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",n),e[4]=n,e[5]=i):i=e[5];let l;return e[6]!==o||e[7]!==i||e[8]!==a?(l=y.jsx("input",{type:a,"data-slot":"input",className:i,...o}),e[6]=o,e[7]=i,e[8]=a,e[9]=l):l=e[9],l}const nM=(...t)=>t.filter((e,n,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===n).join(" ").trim();const c8=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const u8=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,o)=>o?o.toUpperCase():n.toLowerCase());const zw=t=>{const e=u8(t);return e.charAt(0).toUpperCase()+e.slice(1)};var d8={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const f8=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};const h8=x.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:a="",children:i,iconNode:l,...u},d)=>x.createElement("svg",{ref:d,...d8,width:e,height:e,stroke:t,strokeWidth:o?Number(n)*24/Number(e):n,className:nM("lucide",a),...!i&&!f8(u)&&{"aria-hidden":"true"},...u},[...l.map(([f,g])=>x.createElement(f,g)),...Array.isArray(i)?i:[i]]));const tt=(t,e)=>{const n=x.forwardRef(({className:o,...a},i)=>x.createElement(h8,{ref:i,iconNode:e,className:nM(`lucide-${c8(zw(t))}`,`lucide-${t}`,o),...a}));return n.displayName=zw(t),n};const m8=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],g8=tt("arrow-right",m8);const p8=[["path",{d:"M4 20h16",key:"14thso"}],["path",{d:"m6 16 6-12 6 12",key:"1b4byz"}],["path",{d:"M8 12h8",key:"1wcyev"}]],y8=tt("baseline",p8);const v8=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],x8=tt("calendar",v8);const b8=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ns=tt("check",b8);const w8=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],la=tt("chevron-down",w8);const S8=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],oM=tt("chevron-left",S8);const C8=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],rM=tt("chevron-right",C8);const E8=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Zf=tt("chevron-up",E8);const _8=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Q0=tt("copy",_8);const M8=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],J0=tt("database",M8);const N8=[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]],R8=tt("eraser",N8);const D8=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],aM=tt("eye-off",D8);const T8=[["path",{d:"M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5",key:"4pqfef"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 12v-1",key:"1ej8lb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M8 7V6",key:"1nbb54"}],["circle",{cx:"8",cy:"20",r:"2",key:"ckkr5m"}]],k8=tt("file-archive",T8);const O8=[["path",{d:"M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343",key:"1vfytu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0",key:"1etmh7"}]],A8=tt("file-headphone",O8);const j8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],z8=tt("file-image",j8);const I8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z",key:"1tzo1f"}]],P8=tt("file-play",I8);const $8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],L8=tt("file-spreadsheet",$8);const H8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Iw=tt("file-text",H8);const B8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],sM=tt("file",B8);const V8=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],F8=tt("git-branch",V8);const U8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Y8=tt("grid-3x3",U8);const G8=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],q8=tt("hash",G8);const W8=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],iM=tt("key",W8);const K8=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],X8=tt("link",K8);const Z8=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],Q8=tt("list-checks",Z8);const J8=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],eI=tt("list",J8);const tI=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],nI=tt("loader",tI);const oI=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],rI=tt("lock-open",oI);const aI=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],sI=tt("lock",aI);const iI=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]],Pw=tt("pin-off",iI);const lI=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],$w=tt("pin",lI);const cI=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ey=tt("plus",cI);const uI=[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]],dI=tt("presentation",uI);const fI=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]],hI=tt("scissors",fI);const mI=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Qf=tt("search",mI);const gI=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],pI=tt("shield-check",gI);const yI=[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]],vI=tt("shield-off",yI);const xI=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],bI=tt("square-check-big",xI);const wI=[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]],Jf=tt("table-2",wI);const SI=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],CI=tt("table",SI);const EI=[["path",{d:"M15 5h6",key:"1pr8yx"}],["path",{d:"M15 12h6",key:"upa0zy"}],["path",{d:"M3 19h18",key:"awlh7x"}],["path",{d:"m3 12 3.553-7.724a.5.5 0 0 1 .894 0L11 12",key:"6lvno8"}],["path",{d:"M3.92 10h6.16",key:"1tl8ex"}]],_I=tt("text-initial",EI);const MI=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],lM=tt("trash-2",MI);const NI=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],RI=tt("trending-up",NI);const DI=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Lw=tt("upload",DI);const TI=[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]],kI=tt("waves",TI);const OI=[["path",{d:"m10.586 5.414-5.172 5.172",key:"4mc350"}],["path",{d:"m18.586 13.414-5.172 5.172",key:"8c96vv"}],["path",{d:"M6 12h12",key:"8npq4p"}],["circle",{cx:"12",cy:"20",r:"2",key:"144qzu"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}],["circle",{cx:"20",cy:"12",r:"2",key:"1xzzfp"}],["circle",{cx:"4",cy:"12",r:"2",key:"1hvhnz"}]],AI=tt("waypoints",OI);const jI=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],zI=tt("workflow",jI);const II=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],os=tt("x",II);function ty(t){const e=be.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(M0,{"data-slot":"sheet",...n}),e[2]=n,e[3]=o):o=e[3],o}function PI(t){const e=be.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(N0,{"data-slot":"sheet-portal",...n}),e[2]=n,e[3]=o):o=e[3],o}function $I(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-[100]",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(R0,{"data-slot":"sheet-overlay",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function ny(t){const e=be.c(17);let n,o,a,i,l;e[0]!==t?({className:o,children:n,side:i,showCloseButton:l,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5]);const u=i===void 0?"right":i,d=l===void 0?!0:l;let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=y.jsx($I,{}),e[6]=f):f=e[6];let g;e[7]!==o?(g=Me("bg-background data-open:animate-in data-closed:animate-out data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 fixed z-[100] flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",o),e[7]=o,e[8]=g):g=e[8];let m;e[9]!==d?(m=d&&y.jsx(T0,{"data-slot":"sheet-close",asChild:!0,children:y.jsxs(nn,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm",children:[y.jsx(os,{}),y.jsx("span",{className:"sr-only",children:"Close"})]})}),e[9]=d,e[10]=m):m=e[10];let p;return e[11]!==n||e[12]!==a||e[13]!==u||e[14]!==g||e[15]!==m?(p=y.jsxs(PI,{children:[f,y.jsxs(D0,{"data-slot":"sheet-content","data-side":u,className:g,...a,children:[n,m]})]}),e[11]=n,e[12]=a,e[13]=u,e[14]=g,e[15]=m,e[16]=p):p=e[16],p}function oy(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("gap-1.5 p-4 flex flex-col",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("div",{"data-slot":"sheet-header",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function LI(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("gap-2 p-4 mt-auto flex flex-col",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("div",{"data-slot":"sheet-footer",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function ry(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("text-foreground font-medium",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(O2,{"data-slot":"sheet-title",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function HI(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("text-muted-foreground text-sm",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(A2,{"data-slot":"sheet-description",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function BI(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("bg-muted rounded-md animate-pulse",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("div",{"data-slot":"skeleton",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function VI(t){const e=be.c(6);let n,o;e[0]!==t?({delayDuration:o,...n}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);const a=o===void 0?0:o;let i;return e[3]!==a||e[4]!==n?(i=y.jsx(g6,{"data-slot":"tooltip-provider",delayDuration:a,...n}),e[3]=a,e[4]=n,e[5]=i):i=e[5],i}function ay(t){const e=be.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(VI,{children:y.jsx(p6,{"data-slot":"tooltip",...n})}),e[2]=n,e[3]=o):o=e[3],o}function sy(t){const e=be.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(y6,{"data-slot":"tooltip-trigger",...n}),e[2]=n,e[3]=o):o=e[3],o}function iy(t){const e=be.c(13);let n,o,a,i;e[0]!==t?({className:o,sideOffset:i,children:n,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i):(n=e[1],o=e[2],a=e[3],i=e[4]);const l=i===void 0?0:i;let u;e[5]!==o?(u=Me("data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs bg-popover text-popover-foreground border border-border ring-1 ring-foreground/10 z-50 w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin)",o),e[5]=o,e[6]=u):u=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=y.jsx(b6,{className:"size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-popover fill-popover border-border z-50 translate-y-[calc(-50%_-_2px)]"}),e[7]=d):d=e[7];let f;return e[8]!==n||e[9]!==a||e[10]!==l||e[11]!==u?(f=y.jsx(v6,{children:y.jsxs(x6,{"data-slot":"tooltip-content",sideOffset:l,className:u,...a,children:[n,d]})}),e[8]=n,e[9]=a,e[10]=l,e[11]=u,e[12]=f):f=e[12],f}const Wg=768;function FI(){const t=be.c(2),[e,n]=x.useState(void 0);let o,a;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{const i=window.matchMedia(`(max-width: ${Wg-1}px)`),l=()=>{n(window.innerWidth<Wg)};return i.addEventListener("change",l),n(window.innerWidth<Wg),()=>i.removeEventListener("change",l)},a=[],t[0]=o,t[1]=a):(o=t[0],a=t[1]),x.useEffect(o,a),!!e}const UI="sidebar_state",YI=3600*24*7,GI="16rem",qI="18rem",WI="3rem",KI="b",cM=x.createContext(null);function uM(){const t=x.useContext(cM);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function XI(t){const e=be.c(36);let n,o,a,i,l,u,d;e[0]!==t?({defaultOpen:d,open:a,onOpenChange:l,className:o,style:u,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l,e[6]=u,e[7]=d):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5],u=e[6],d=e[7]);const f=d===void 0?!0:d,g=FI(),[m,p]=x.useState(!1),[v,S]=x.useState(f),C=a??v;let w;e[8]!==C||e[9]!==l?(w=I=>{const G=typeof I=="function"?I(C):I;l?l(G):S(G),document.cookie=`${UI}=${G}; path=/; max-age=${YI}`},e[8]=C,e[9]=l,e[10]=w):w=e[10];const M=w;let R;e[11]!==g||e[12]!==M?(R=()=>g?p(QI):M(ZI),e[11]=g,e[12]=M,e[13]=R):R=e[13];const E=R;let N,D;e[14]!==E?(N=()=>{const I=G=>{G.key===KI&&(G.metaKey||G.ctrlKey)&&(G.preventDefault(),E())};return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)},D=[E],e[14]=E,e[15]=N,e[16]=D):(N=e[15],D=e[16]),x.useEffect(N,D);const T=C?"expanded":"collapsed";let k;e[17]!==g||e[18]!==C||e[19]!==m||e[20]!==M||e[21]!==T||e[22]!==E?(k={state:T,open:C,setOpen:M,isMobile:g,openMobile:m,setOpenMobile:p,toggleSidebar:E},e[17]=g,e[18]=C,e[19]=m,e[20]=M,e[21]=T,e[22]=E,e[23]=k):k=e[23];const A=k;let B;e[24]!==u?(B={"--sidebar-width":GI,"--sidebar-width-icon":WI,...u},e[24]=u,e[25]=B):B=e[25];const W=B;let U;e[26]!==o?(U=Me("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",o),e[26]=o,e[27]=U):U=e[27];let Y;e[28]!==n||e[29]!==i||e[30]!==W||e[31]!==U?(Y=y.jsx("div",{"data-slot":"sidebar-wrapper",style:W,className:U,...i,children:n}),e[28]=n,e[29]=i,e[30]=W,e[31]=U,e[32]=Y):Y=e[32];let Z;return e[33]!==A||e[34]!==Y?(Z=y.jsx(cM.Provider,{value:A,children:Y}),e[33]=A,e[34]=Y,e[35]=Z):Z=e[35],Z}function ZI(t){return!t}function QI(t){return!t}function JI(t){const e=be.c(54);let n,o,a,i,l,u;e[0]!==t?({side:i,variant:l,collapsible:u,className:o,children:n,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l,e[6]=u):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5],u=e[6]);const d=i===void 0?"left":i,f=l===void 0?"sidebar":l,g=u===void 0?"offcanvas":u,{isMobile:m,state:p,setOpen:v,openMobile:S,setOpenMobile:C}=uM(),w=x.useRef(!1);let M;e[7]!==g||e[8]!==v||e[9]!==p?(M=()=>{g==="icon"&&p==="collapsed"&&(w.current=!0,v(!0))},e[7]=g,e[8]=v,e[9]=p,e[10]=M):M=e[10];const R=M;let E;e[11]!==v?(E=()=>{w.current&&(w.current=!1,v(!1))},e[11]=v,e[12]=E):E=e[12];const N=E;if(g==="none"){let L;e[13]!==o?(L=Me("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",o),e[13]=o,e[14]=L):L=e[14];let $;return e[15]!==n||e[16]!==a||e[17]!==L?($=y.jsx("div",{"data-slot":"sidebar",className:L,...a,children:n}),e[15]=n,e[16]=a,e[17]=L,e[18]=$):$=e[18],$}if(m){let L;e[19]===Symbol.for("react.memo_cache_sentinel")?(L={"--sidebar-width":qI},e[19]=L):L=e[19];let $;e[20]===Symbol.for("react.memo_cache_sentinel")?($=y.jsxs(oy,{className:"sr-only",children:[y.jsx(ry,{children:"Sidebar"}),y.jsx(HI,{children:"Displays the mobile sidebar."})]}),e[20]=$):$=e[20];let H;e[21]!==n?(H=y.jsx("div",{className:"flex h-full w-full flex-col",children:n}),e[21]=n,e[22]=H):H=e[22];let X;e[23]!==d||e[24]!==H?(X=y.jsxs(ny,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:L,side:d,children:[$,H]}),e[23]=d,e[24]=H,e[25]=X):X=e[25];let P;return e[26]!==S||e[27]!==a||e[28]!==C||e[29]!==X?(P=y.jsx(ty,{open:S,onOpenChange:C,...a,children:X}),e[26]=S,e[27]=a,e[28]=C,e[29]=X,e[30]=P):P=e[30],P}const D=p==="collapsed"?g:"",T=f==="floating"||f==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let k;e[31]!==T?(k=Me("transition-[width] duration-200 ease-linear relative w-(--sidebar-width) bg-transparent","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",T),e[31]=T,e[32]=k):k=e[32];let A;e[33]!==k?(A=y.jsx("div",{"data-slot":"sidebar-gap",className:k}),e[33]=k,e[34]=A):A=e[34];const B=d==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",W=f==="floating"||f==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l";let U;e[35]!==o||e[36]!==B||e[37]!==W?(U=Me("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",B,W,o),e[35]=o,e[36]=B,e[37]=W,e[38]=U):U=e[38];const Y=g==="icon"?R:void 0,Z=g==="icon"?N:void 0;let I;e[39]!==n?(I=y.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:ring-sidebar-border group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col",children:n}),e[39]=n,e[40]=I):I=e[40];let G;e[41]!==a||e[42]!==U||e[43]!==Y||e[44]!==Z||e[45]!==I?(G=y.jsx("div",{"data-slot":"sidebar-container",className:U,onMouseEnter:Y,onMouseLeave:Z,...a,children:I}),e[41]=a,e[42]=U,e[43]=Y,e[44]=Z,e[45]=I,e[46]=G):G=e[46];let j;return e[47]!==d||e[48]!==p||e[49]!==G||e[50]!==D||e[51]!==A||e[52]!==f?(j=y.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":p,"data-collapsible":D,"data-variant":f,"data-side":d,"data-slot":"sidebar",children:[A,G]}),e[47]=d,e[48]=p,e[49]=G,e[50]=D,e[51]=A,e[52]=f,e[53]=j):j=e[53],j}function e7(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("gap-2 p-2 flex flex-col",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function t7(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("no-scrollbar gap-2 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function n7(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("p-2 relative flex w-full min-w-0 flex-col",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function o7(t){const e=be.c(10);let n,o,a;e[0]!==t?({className:n,asChild:a,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a):(n=e[1],o=e[2],a=e[3]);const l=(a===void 0?!1:a)?Rf:"div";let u;e[4]!==n?(u=Me("text-sidebar-foreground/70 ring-sidebar-ring h-8 rounded-md px-2 text-xs font-medium transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 flex shrink-0 items-center outline-hidden [&>svg]:shrink-0",n),e[4]=n,e[5]=u):u=e[5];let d;return e[6]!==l||e[7]!==o||e[8]!==u?(d=y.jsx(l,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:u,...o}),e[6]=l,e[7]=o,e[8]=u,e[9]=d):d=e[9],d}function r7(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("text-sm w-full",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function a7(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("gap-1 flex w-full min-w-0 flex-col",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function s7(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("group/menu-item relative",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}const i7=Nf("ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground gap-2 rounded-md p-2 text-left text-sm transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 data-active:font-medium peer/menu-button flex w-full items-center overflow-hidden outline-hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function l7(t){const e=be.c(28);let n,o,a,i,l,u,d;e[0]!==t?({asChild:a,isActive:i,variant:l,size:u,tooltip:d,className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l,e[6]=u,e[7]=d):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5],u=e[6],d=e[7]);const f=a===void 0?!1:a,g=i===void 0?!1:i,m=l===void 0?"default":l,p=u===void 0?"default":u,v=f?Rf:"button",{isMobile:S,state:C}=uM();let w;e[8]!==n||e[9]!==p||e[10]!==m?(w=Me(i7({variant:m,size:p}),n),e[8]=n,e[9]=p,e[10]=m,e[11]=w):w=e[11];let M;e[12]!==v||e[13]!==g||e[14]!==o||e[15]!==p||e[16]!==w?(M=y.jsx(v,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":p,"data-active":g,className:w,...o}),e[12]=v,e[13]=g,e[14]=o,e[15]=p,e[16]=w,e[17]=M):M=e[17];const R=M;if(!d)return R;if(typeof d=="string"){let k;e[18]!==d?(k={children:d},e[18]=d,e[19]=k):k=e[19],d=k}let E;e[20]!==R?(E=y.jsx(sy,{asChild:!0,children:R}),e[20]=R,e[21]=E):E=e[21];const N=C!=="collapsed"||S;let D;e[22]!==N||e[23]!==d?(D=y.jsx(iy,{side:"right",align:"center",hidden:N,...d}),e[22]=N,e[23]=d,e[24]=D):D=e[24];let T;return e[25]!==E||e[26]!==D?(T=y.jsxs(ay,{children:[E,D]}),e[25]=E,e[26]=D,e[27]=T):T=e[27],T}function ly(t){const e=be.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(M0,{"data-slot":"dialog",...n}),e[2]=n,e[3]=o):o=e[3],o}function c7(t){const e=be.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(nO,{"data-slot":"dialog-trigger",...n}),e[2]=n,e[3]=o):o=e[3],o}function u7(t){const e=be.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(N0,{"data-slot":"dialog-portal",...n}),e[2]=n,e[3]=o):o=e[3],o}function d7(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(R0,{"data-slot":"dialog-overlay",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function cy(t){const e=be.c(15);let n,o,a,i;e[0]!==t?({className:o,children:n,showCloseButton:i,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i):(n=e[1],o=e[2],a=e[3],i=e[4]);const l=i===void 0?!0:i;let u;e[5]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsx(d7,{}),e[5]=u):u=e[5];let d;e[6]!==o?(d=Me("bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-6 rounded-xl p-6 text-sm ring-1 duration-100 sm:max-w-md fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2",o),e[6]=o,e[7]=d):d=e[7];let f;e[8]!==l?(f=l&&y.jsx(T0,{"data-slot":"dialog-close",asChild:!0,children:y.jsxs(nn,{variant:"ghost",className:"absolute top-4 right-4",size:"icon-sm",children:[y.jsx(os,{}),y.jsx("span",{className:"sr-only",children:"Close"})]})}),e[8]=l,e[9]=f):f=e[9];let g;return e[10]!==n||e[11]!==a||e[12]!==d||e[13]!==f?(g=y.jsxs(u7,{children:[u,y.jsxs(D0,{"data-slot":"dialog-content",className:d,...a,children:[n,f]})]}),e[10]=n,e[11]=a,e[12]=d,e[13]=f,e[14]=g):g=e[14],g}function uy(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("gap-2 flex flex-col",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("div",{"data-slot":"dialog-header",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function dM(t){const e=be.c(14);let n,o,a,i;e[0]!==t?({className:o,showCloseButton:i,children:n,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i):(n=e[1],o=e[2],a=e[3],i=e[4]);const l=i===void 0?!1:i;let u;e[5]!==o?(u=Me("gap-2 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",o),e[5]=o,e[6]=u):u=e[6];let d;e[7]!==l?(d=l&&y.jsx(T0,{asChild:!0,children:y.jsx(nn,{variant:"outline",children:"Close"})}),e[7]=l,e[8]=d):d=e[8];let f;return e[9]!==n||e[10]!==a||e[11]!==u||e[12]!==d?(f=y.jsxs("div",{"data-slot":"dialog-footer",className:u,...a,children:[n,d]}),e[9]=n,e[10]=a,e[11]=u,e[12]=d,e[13]=f):f=e[13],f}function dy(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("leading-none font-medium",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(O2,{"data-slot":"dialog-title",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function fy(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(A2,{"data-slot":"dialog-description",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}const f7=Nf("h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive overflow-hidden group/badge",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function oa(t){const e=be.c(13);let n,o,a,i;e[0]!==t?({className:n,variant:a,asChild:i,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i):(n=e[1],o=e[2],a=e[3],i=e[4]);const l=a===void 0?"default":a,d=(i===void 0?!1:i)?Rf:"span";let f;e[5]!==n||e[6]!==l?(f=Me(f7({variant:l}),n),e[5]=n,e[6]=l,e[7]=f):f=e[7];let g;return e[8]!==d||e[9]!==o||e[10]!==f||e[11]!==l?(g=y.jsx(d,{"data-slot":"badge","data-variant":l,className:f,...o}),e[8]=d,e[9]=o,e[10]=f,e[11]=l,e[12]=g):g=e[12],g}const hy="";let Rc=null,rc=null;async function h7(){try{const e=await(await fetch(`${hy}/api/connections`)).json();return e.success?(Rc=e.data,e.data):(console.error("Failed to fetch connections:",e.error),[])}catch(t){return console.error("Failed to fetch connections:",t),[]}}async function my(){if(Rc!==null)return Rc;if(rc)return rc;rc=h7();const t=await rc;return rc=null,t}async function mc(t,e=!1,n,o){try{const i=await(await fetch(`${hy}/api/connections`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionString:t,success:e,databaseName:n,name:o})})).json();i.success?Rc=null:console.error("Failed to save connection:",i.error)}catch(a){console.error("Failed to save connection:",a)}}async function m7(t){const e=await fetch(`${hy}/api/connections/${encodeURIComponent(t)}`,{method:"DELETE"});let n={};try{n=await e.json()}catch{}if(e.ok&&n.success)Rc=null;else throw new Error(n.error||"Failed to remove connection")}function g7(t){const e=be.c(19),{open:n,onOpenChange:o,trigger:a}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=[],e[0]=i):i=e[0];const[l,u]=x.useState(i),[d,f]=x.useState(null),g=p7;let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m=async()=>{const T=await my();u(T)},e[1]=m):m=e[1];const p=m;let v;e[2]===Symbol.for("react.memo_cache_sentinel")?(v=async T=>{try{await m7(T),f(null),await p(),hn.success("Connection removed")}catch(k){const A=k;hn.error(A instanceof Error?A.message:"Failed to remove connection")}},e[2]=v):v=e[2];const S=v;let C,w;e[3]!==n?(C=()=>{n?p():f(null)},w=[n,p],e[3]=n,e[4]=C,e[5]=w):(C=e[4],w=e[5]),x.useEffect(C,w);let M;e[6]!==a?(M=y.jsx(c7,{asChild:!0,children:a}),e[6]=a,e[7]=M):M=e[7];let R;e[8]===Symbol.for("react.memo_cache_sentinel")?(R=y.jsxs(uy,{children:[y.jsx(dy,{children:"Saved Database Connections"}),y.jsx(fy,{children:"View and manage your saved database connections."})]}),e[8]=R):R=e[8];let E;e[9]!==d||e[10]!==l?(E=l.length===0?y.jsx("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No saved connections yet"}):l.map(T=>y.jsxs("div",{className:"p-4 rounded-md border text-card-foreground cursor-pointer",children:[y.jsxs("div",{className:"flex items-center justify-between gap-4 mb-2",children:[y.jsx("div",{className:"text-base font-medium text-foreground",children:T.name||"Unnamed"}),d===T.id?y.jsx(nn,{variant:"destructive",size:"sm",onClick:()=>S(T.id),children:"Confirm removal"}):y.jsx(nn,{variant:"ghost",size:"icon",className:"text-muted-foreground hover:text-destructive","aria-label":"Delete connection",onClick:()=>f(T.id),children:y.jsx(lM,{className:"size-4"})})]}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsx("div",{className:"mb-2",children:T.success?y.jsx(oa,{variant:"secondary",className:"bg-primary/10 text-primary",children:"Success"}):y.jsx(oa,{variant:"secondary",className:"bg-destructive/10 text-destructive",children:"Failed"})}),y.jsxs(ay,{children:[y.jsx(sy,{asChild:!0,children:y.jsx("button",{type:"button",onClick:()=>g(T.connectionString),className:"text-sm font-mono text-muted-foreground hover:text-foreground truncate text-left w-full transition-colors cursor-pointer",children:T.connectionString})}),y.jsx(iy,{children:"Copy"})]}),T.databaseName&&y.jsxs("div",{className:"text-xs text-muted-foreground mt-2",children:["Database: ",T.databaseName]}),y.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Last used:"," ",new Date(T.lastUsed||T.timestamp).toLocaleString()]})]})]},T.id)),e[9]=d,e[10]=l,e[11]=E):E=e[11];let N;e[12]!==E?(N=y.jsxs(cy,{className:"w-[calc(100%-2rem)] sm:max-w-2xl ",children:[R,y.jsx("div",{className:"space-y-2 max-h-[60vh] overflow-y-auto",children:E})]}),e[12]=E,e[13]=N):N=e[13];let D;return e[14]!==o||e[15]!==n||e[16]!==M||e[17]!==N?(D=y.jsxs(ly,{open:n,onOpenChange:o,children:[M,N]}),e[14]=o,e[15]=n,e[16]=M,e[17]=N,e[18]=D):D=e[18],D}function p7(t){navigator.clipboard.writeText(t),hn.success("URL Copied")}const y7=[{title:"Schema",icon:J0,url:"/schema"},{title:"Tables",icon:CI,url:"/tables"},{title:"Indexes",icon:iM,url:"/indexes"}];function v7(){const t=be.c(11),e=ua(),[n,o]=x.useState(!1);let a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(o7,{children:"Database"}),t[0]=a):a=t[0];let i;t[1]!==e?(i=y7.map(g=>y.jsx(s7,{children:y.jsx(l7,{asChild:!0,isActive:e.pathname===g.url,children:y.jsxs(w0,{to:g.url,children:[y.jsx(g.icon,{}),y.jsx("span",{children:g.title})]})})},g.title)),t[1]=e,t[2]=i):i=t[2];let l;t[3]!==i?(l=y.jsx(t7,{children:y.jsxs(n7,{children:[a,y.jsx(r7,{children:y.jsx(a7,{children:i})})]})}),t[3]=i,t[4]=l):l=t[4];let u;t[5]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsxs(nn,{variant:"ghost",className:"w-full justify-start group-data-[collapsible=icon]:w-8 group-data-[collapsible=icon]:p-2 group-data-[collapsible=icon]:[&>span]:hidden",children:[y.jsx(J0,{}),y.jsx("span",{children:"My Connections"})]}),t[5]=u):u=t[5];let d;t[6]!==n?(d=y.jsx(e7,{children:y.jsx(g7,{open:n,onOpenChange:o,trigger:u})}),t[6]=n,t[7]=d):d=t[7];let f;return t[8]!==l||t[9]!==d?(f=y.jsxs(JI,{collapsible:"icon",className:"!top-14 !h-[calc(100vh-3.5rem)]",children:[l,d]}),t[8]=l,t[9]=d,t[10]=f):f=t[10],f}function gy(t){const e=be.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(Kj,{"data-slot":"dropdown-menu",...n}),e[2]=n,e[3]=o):o=e[3],o}function py(t){const e=be.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(Xj,{"data-slot":"dropdown-menu-trigger",...n}),e[2]=n,e[3]=o):o=e[3],o}function yy(t){const e=be.c(12);let n,o,a,i;e[0]!==t?({className:n,align:a,sideOffset:i,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i):(n=e[1],o=e[2],a=e[3],i=e[4]);const l=a===void 0?"start":a,u=i===void 0?4:i;let d;e[5]!==n?(d=Me("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-md p-1 shadow-md ring-1 duration-100 z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto data-[state=closed]:overflow-hidden",n),e[5]=n,e[6]=d):d=e[6];let f;return e[7]!==l||e[8]!==o||e[9]!==u||e[10]!==d?(f=y.jsx(Zj,{children:y.jsx(Qj,{"data-slot":"dropdown-menu-content",sideOffset:u,align:l,className:d,...o})}),e[7]=l,e[8]=o,e[9]=u,e[10]=d,e[11]=f):f=e[11],f}function Vo(t){const e=be.c(12);let n,o,a,i;e[0]!==t?({className:n,inset:o,variant:i,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i):(n=e[1],o=e[2],a=e[3],i=e[4]);const l=i===void 0?"default":i;let u;e[5]!==n?(u=Me("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm px-2 py-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",n),e[5]=n,e[6]=u):u=e[6];let d;return e[7]!==o||e[8]!==a||e[9]!==u||e[10]!==l?(d=y.jsx(Jj,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":l,className:u,...a}),e[7]=o,e[8]=a,e[9]=u,e[10]=l,e[11]=d):d=e[11],d}function Hw(t){const e=be.c(13);let n,o,a,i;e[0]!==t?({className:a,children:o,checked:n,...i}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i):(n=e[1],o=e[2],a=e[3],i=e[4]);let l;e[5]!==a?(l=Me("focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",a),e[5]=a,e[6]=l):l=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center pointer-events-none","data-slot":"dropdown-menu-checkbox-item-indicator",children:y.jsx(tz,{children:y.jsx(ns,{})})}),e[7]=u):u=e[7];let d;return e[8]!==n||e[9]!==o||e[10]!==i||e[11]!==l?(d=y.jsxs(ez,{"data-slot":"dropdown-menu-checkbox-item",className:l,checked:n,...i,children:[u,o]}),e[8]=n,e[9]=o,e[10]=i,e[11]=l,e[12]=d):d=e[12],d}function hf(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("bg-border -mx-1 my-1 h-px",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(nz,{"data-slot":"dropdown-menu-separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function Bw(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("gap-2 text-sm leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(rz,{"data-slot":"label",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function x7({open:t,onOpenChange:e,onSuccess:n,onConnectionSaved:o}){const[a,i]=x.useState(""),[l,u]=x.useState(""),[d,f]=x.useState(null),[g,m]=x.useState(!1),[p,v]=x.useState(!1),S=t!==void 0?t:p,C=e||v,w=async M=>{M.preventDefault(),f(null),m(!0),await mc(a,!1,void 0,l||void 0),o?.();try{const R=await fetch("/api/connect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionString:a})});let E;try{E=await R.json()}catch{throw new Error(`Server error: ${R.status} ${R.statusText}`)}E.success?(f(null),await mc(a,!0,E.databaseName,l||void 0),o?.(),C(!1),u(""),i(""),n?.(E.databaseName)):(f(E.error||"Failed to connect to database"),await mc(a,!1,void 0,l||void 0),o?.())}catch(R){const E=R instanceof Error?R.message:"Failed to connect to database";f(E),await mc(a,!1,void 0,l||void 0),o?.()}finally{m(!1)}};return y.jsx(ly,{open:S,onOpenChange:C,children:y.jsxs(cy,{children:[y.jsxs(uy,{children:[y.jsx(dy,{children:"Connect to Database"}),y.jsx(fy,{children:"Enter your PostgreSQL connection string to connect to your database."})]}),y.jsxs("form",{onSubmit:w,children:[y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"space-y-2",children:[y.jsx(Bw,{htmlFor:"connection-name",children:"Connection Name (Optional)"}),y.jsx(Bi,{id:"connection-name",type:"text",value:l,onChange:M=>u(M.target.value),placeholder:"My Database Connection",disabled:g})]}),y.jsxs("div",{className:"space-y-2",children:[y.jsx(Bw,{htmlFor:"connection-string",children:"Connection String"}),y.jsx(Bi,{id:"connection-string",type:"text",value:a,onChange:M=>i(M.target.value),placeholder:"postgresql://user:password@host:5432/database",required:!0,disabled:g})]}),d&&y.jsx("div",{className:"bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-md text-sm",children:d})]}),y.jsxs(dM,{className:"mt-6",children:[y.jsx(nn,{type:"button",variant:"outline",onClick:()=>C(!1),disabled:g,children:"Cancel"}),y.jsx(nn,{type:"submit",disabled:g,children:g?"Connecting...":"Connect"})]})]})]})})}function b7(t){const e=be.c(47),{selectedConnection:n,onConnectionSelect:o}=t,[a,i]=x.useState(!1),[l,u]=x.useState("");let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d=[],e[0]=d):d=e[0];const[f,g]=x.useState(d),[m,p]=x.useState(!1);let v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=async()=>{const q=await my();g(q)},e[1]=v):v=e[1];const S=v;let C;e[2]===Symbol.for("react.memo_cache_sentinel")?(C=()=>{S()},e[2]=C):C=e[2];let w;e[3]!==m||e[4]!==a?(w=[S,a,m],e[3]=m,e[4]=a,e[5]=w):w=e[5],x.useEffect(C,w);let M;e:{if(!l){M=f;break e}let q;if(e[6]!==f||e[7]!==l){const J=l.toLowerCase();q=f.filter(oe=>oe.name?.toLowerCase().includes(J)||oe.connectionString.toLowerCase().includes(J)||oe.databaseName?.toLowerCase().includes(J)),e[6]=f,e[7]=l,e[8]=q}else q=e[8];M=q}const R=M;let E;e[9]!==o?(E=async q=>{await mc(q.connectionString,q.success||!1,q.databaseName,q.name),o?.(q),i(!1),u(""),await S()},e[9]=o,e[10]=E):E=e[10];const N=E,D=n?.name||n?.databaseName||"No connection";let T;e[11]===Symbol.for("react.memo_cache_sentinel")?(T=y.jsx("span",{className:"text-muted-foreground",children:"/"}),e[11]=T):T=e[11];let k;e[12]===Symbol.for("react.memo_cache_sentinel")?(k=y.jsx(J0,{className:"h-4 w-4"}),e[12]=k):k=e[12];let A;e[13]!==D?(A=y.jsx("span",{children:D}),e[13]=D,e[14]=A):A=e[14];let B;e[15]!==a?(B=a?y.jsx(Zf,{className:"h-4 w-4"}):y.jsx(la,{className:"h-4 w-4"}),e[15]=a,e[16]=B):B=e[16];let W;e[17]!==B||e[18]!==A?(W=y.jsx(py,{asChild:!0,children:y.jsxs(nn,{variant:"ghost",className:"h-auto px-2 py-1 text-sm font-normal hover:bg-accent flex items-center gap-1.5",children:[k,A,B]})}),e[17]=B,e[18]=A,e[19]=W):W=e[19];let U;e[20]===Symbol.for("react.memo_cache_sentinel")?(U=y.jsx(Qf,{className:"absolute left-2 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e[20]=U):U=e[20];let Y;e[21]===Symbol.for("react.memo_cache_sentinel")?(Y=q=>u(q.target.value),e[21]=Y):Y=e[21];let Z;e[22]!==l?(Z=y.jsx("div",{className:"p-2 border-b",children:y.jsxs("div",{className:"relative",children:[U,y.jsx(Bi,{placeholder:"Find connection...",value:l,onChange:Y,className:"pl-8 h-8",autoFocus:!0})]})}),e[22]=l,e[23]=Z):Z=e[23];let I;e[24]!==R||e[25]!==N||e[26]!==l||e[27]!==n?.connectionString?(I=R.length===0?y.jsx("div",{className:"p-4 text-center text-sm text-muted-foreground",children:l?"No connections found":"No saved connections"}):R.map((q,J)=>y.jsxs(Vo,{onClick:()=>N(q),className:"flex items-center justify-between cursor-pointer",children:[y.jsxs("div",{className:"flex-1 min-w-0",children:[q.name&&y.jsx("div",{className:"font-medium truncate",children:q.name}),y.jsx("div",{className:"text-xs text-muted-foreground truncate",children:q.databaseName||q.connectionString})]}),n?.connectionString===q.connectionString&&y.jsx(ns,{className:"h-4 w-4 ml-2 shrink-0"})]},J)),e[24]=R,e[25]=N,e[26]=l,e[27]=n?.connectionString,e[28]=I):I=e[28];let G;e[29]!==I?(G=y.jsx("div",{className:"max-h-64 overflow-y-auto",children:I}),e[29]=I,e[30]=G):G=e[30];let j;e[31]===Symbol.for("react.memo_cache_sentinel")?(j=y.jsx(hf,{}),e[31]=j):j=e[31];let L;e[32]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{i(!1),p(!0)},e[32]=L):L=e[32];let $;e[33]===Symbol.for("react.memo_cache_sentinel")?($=y.jsxs(Vo,{onClick:L,className:"cursor-pointer",children:[y.jsx(ey,{className:"h-4 w-4 mr-2"}),y.jsx("span",{children:"New connection"})]}),e[33]=$):$=e[33];let H;e[34]!==Z||e[35]!==G?(H=y.jsxs(yy,{align:"start",className:"w-80 p-0 z-[70]",onCloseAutoFocus:w7,children:[Z,G,j,$]}),e[34]=Z,e[35]=G,e[36]=H):H=e[36];let X;e[37]!==a||e[38]!==W||e[39]!==H?(X=y.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[T,y.jsxs(gy,{open:a,onOpenChange:i,children:[W,H]})]}),e[37]=a,e[38]=W,e[39]=H,e[40]=X):X=e[40];let P;e[41]===Symbol.for("react.memo_cache_sentinel")?(P=()=>{S()},e[41]=P):P=e[41];let z;e[42]!==m?(z=y.jsx(x7,{open:m,onOpenChange:p,onConnectionSaved:P}),e[42]=m,e[43]=z):z=e[43];let V;return e[44]!==X||e[45]!==z?(V=y.jsxs(y.Fragment,{children:[X,z]}),e[44]=X,e[45]=z,e[46]=V):V=e[46],V}function w7(t){return t.preventDefault()}const fM=x.createContext(void 0);function S7({children:t}){const[e,n]=x.useState(null),[o,a]=x.useState(!0);return x.useEffect(()=>{async function i(){console.log("ConnectionProvider: Loading connections..."),a(!0);try{const l=await my();if(console.log("ConnectionProvider: Found connections:",l.length),l.length>0){const d=l.find(f=>f.success)||l[0];console.log("ConnectionProvider: Setting selected connection:",d.name||d.databaseName||"unnamed"),n(d)}else console.log("ConnectionProvider: No connections found")}catch(l){console.error("ConnectionProvider: Failed to load connections:",l)}finally{a(!1)}}i()},[]),y.jsx(fM.Provider,{value:{selectedConnection:e,setSelectedConnection:n,isLoadingConnections:o},children:t})}function eh(){const t=x.useContext(fM);if(t===void 0)throw new Error("useConnection must be used within a ConnectionProvider");return t}function C7(){const t=be.c(4),{selectedConnection:e,setSelectedConnection:n}=eh();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=y.jsx("div",{className:"flex items-center gap-2",children:y.jsx("h1",{className:"text-sm font-semibold",children:"Fakebase Studio"})}),t[0]=o):o=t[0];let a;return t[1]!==e||t[2]!==n?(a=y.jsx("header",{className:"fixed top-0 left-0 right-0 z-[60] w-full border-b bg-background",children:y.jsxs("div",{className:"flex h-14 items-center px-4 gap-4",children:[o,y.jsx(b7,{selectedConnection:e,onConnectionSelect:n})]})}),t[1]=e,t[2]=n,t[3]=a):a=t[3],a}function E7(t){const e=be.c(5),{children:n}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=y.jsx(Mk,{}),e[0]=o):o=e[0];let a,i;e[1]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(C7,{}),i=y.jsx(v7,{}),e[1]=a,e[2]=i):(a=e[1],i=e[2]);let l;return e[3]!==n?(l=y.jsxs(S7,{children:[o,y.jsxs(XI,{defaultOpen:!1,children:[a,i,y.jsx("div",{className:"flex pt-14 min-h-screen w-full overflow-hidden",children:y.jsx("div",{className:"w-full h-[calc(100vh-3.5rem)] flex flex-col overflow-hidden",children:n})})]})]}),e[3]=n,e[4]=l):l=e[4],l}function Mn(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n=0,o;n<t.length;n++)(o=Mn(t[n]))!==""&&(e+=(e&&" ")+o);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}var _7={value:()=>{}};function th(){for(var t=0,e=arguments.length,n={},o;t<e;++t){if(!(o=arguments[t]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Xd(n)}function Xd(t){this._=t}function M7(t,e){return t.trim().split(/^|\s+/).map(function(n){var o="",a=n.indexOf(".");if(a>=0&&(o=n.slice(a+1),n=n.slice(0,a)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Xd.prototype=th.prototype={constructor:Xd,on:function(t,e){var n=this._,o=M7(t+"",n),a,i=-1,l=o.length;if(arguments.length<2){for(;++i<l;)if((a=(t=o[i]).type)&&(a=N7(n[a],t.name)))return a;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++i<l;)if(a=(t=o[i]).type)n[a]=Vw(n[a],t.name,e);else if(e==null)for(a in n)n[a]=Vw(n[a],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Xd(t)},call:function(t,e){if((a=arguments.length-2)>0)for(var n=new Array(a),o=0,a,i;o<a;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=this._[t],o=0,a=i.length;o<a;++o)i[o].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var o=this._[t],a=0,i=o.length;a<i;++a)o[a].value.apply(e,n)}};function N7(t,e){for(var n=0,o=t.length,a;n<o;++n)if((a=t[n]).name===e)return a.value}function Vw(t,e,n){for(var o=0,a=t.length;o<a;++o)if(t[o].name===e){t[o]=_7,t=t.slice(0,o).concat(t.slice(o+1));break}return n!=null&&t.push({name:e,value:n}),t}var Fp="http://www.w3.org/1999/xhtml";const Fw={svg:"http://www.w3.org/2000/svg",xhtml:Fp,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function nh(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Fw.hasOwnProperty(e)?{space:Fw[e],local:t}:t}function R7(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Fp&&e.documentElement.namespaceURI===Fp?e.createElement(t):e.createElementNS(n,t)}}function D7(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function hM(t){var e=nh(t);return(e.local?D7:R7)(e)}function T7(){}function vy(t){return t==null?T7:function(){return this.querySelector(t)}}function k7(t){typeof t!="function"&&(t=vy(t));for(var e=this._groups,n=e.length,o=new Array(n),a=0;a<n;++a)for(var i=e[a],l=i.length,u=o[a]=new Array(l),d,f,g=0;g<l;++g)(d=i[g])&&(f=t.call(d,d.__data__,g,i))&&("__data__"in d&&(f.__data__=d.__data__),u[g]=f);return new Eo(o,this._parents)}function O7(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function A7(){return[]}function mM(t){return t==null?A7:function(){return this.querySelectorAll(t)}}function j7(t){return function(){return O7(t.apply(this,arguments))}}function z7(t){typeof t=="function"?t=j7(t):t=mM(t);for(var e=this._groups,n=e.length,o=[],a=[],i=0;i<n;++i)for(var l=e[i],u=l.length,d,f=0;f<u;++f)(d=l[f])&&(o.push(t.call(d,d.__data__,f,l)),a.push(d));return new Eo(o,a)}function gM(t){return function(){return this.matches(t)}}function pM(t){return function(e){return e.matches(t)}}var I7=Array.prototype.find;function P7(t){return function(){return I7.call(this.children,t)}}function $7(){return this.firstElementChild}function L7(t){return this.select(t==null?$7:P7(typeof t=="function"?t:pM(t)))}var H7=Array.prototype.filter;function B7(){return Array.from(this.children)}function V7(t){return function(){return H7.call(this.children,t)}}function F7(t){return this.selectAll(t==null?B7:V7(typeof t=="function"?t:pM(t)))}function U7(t){typeof t!="function"&&(t=gM(t));for(var e=this._groups,n=e.length,o=new Array(n),a=0;a<n;++a)for(var i=e[a],l=i.length,u=o[a]=[],d,f=0;f<l;++f)(d=i[f])&&t.call(d,d.__data__,f,i)&&u.push(d);return new Eo(o,this._parents)}function yM(t){return new Array(t.length)}function Y7(){return new Eo(this._enter||this._groups.map(yM),this._parents)}function mf(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}mf.prototype={constructor:mf,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function G7(t){return function(){return t}}function q7(t,e,n,o,a,i){for(var l=0,u,d=e.length,f=i.length;l<f;++l)(u=e[l])?(u.__data__=i[l],o[l]=u):n[l]=new mf(t,i[l]);for(;l<d;++l)(u=e[l])&&(a[l]=u)}function W7(t,e,n,o,a,i,l){var u,d,f=new Map,g=e.length,m=i.length,p=new Array(g),v;for(u=0;u<g;++u)(d=e[u])&&(p[u]=v=l.call(d,d.__data__,u,e)+"",f.has(v)?a[u]=d:f.set(v,d));for(u=0;u<m;++u)v=l.call(t,i[u],u,i)+"",(d=f.get(v))?(o[u]=d,d.__data__=i[u],f.delete(v)):n[u]=new mf(t,i[u]);for(u=0;u<g;++u)(d=e[u])&&f.get(p[u])===d&&(a[u]=d)}function K7(t){return t.__data__}function X7(t,e){if(!arguments.length)return Array.from(this,K7);var n=e?W7:q7,o=this._parents,a=this._groups;typeof t!="function"&&(t=G7(t));for(var i=a.length,l=new Array(i),u=new Array(i),d=new Array(i),f=0;f<i;++f){var g=o[f],m=a[f],p=m.length,v=Z7(t.call(g,g&&g.__data__,f,o)),S=v.length,C=u[f]=new Array(S),w=l[f]=new Array(S),M=d[f]=new Array(p);n(g,m,C,w,M,v,e);for(var R=0,E=0,N,D;R<S;++R)if(N=C[R]){for(R>=E&&(E=R+1);!(D=w[E])&&++E<S;);N._next=D||null}}return l=new Eo(l,o),l._enter=u,l._exit=d,l}function Z7(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Q7(){return new Eo(this._exit||this._groups.map(yM),this._parents)}function J7(t,e,n){var o=this.enter(),a=this,i=this.exit();return typeof t=="function"?(o=t(o),o&&(o=o.selection())):o=o.append(t+""),e!=null&&(a=e(a),a&&(a=a.selection())),n==null?i.remove():n(i),o&&a?o.merge(a).order():a}function eP(t){for(var e=t.selection?t.selection():t,n=this._groups,o=e._groups,a=n.length,i=o.length,l=Math.min(a,i),u=new Array(a),d=0;d<l;++d)for(var f=n[d],g=o[d],m=f.length,p=u[d]=new Array(m),v,S=0;S<m;++S)(v=f[S]||g[S])&&(p[S]=v);for(;d<a;++d)u[d]=n[d];return new Eo(u,this._parents)}function tP(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var o=t[e],a=o.length-1,i=o[a],l;--a>=0;)(l=o[a])&&(i&&l.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(l,i),i=l);return this}function nP(t){t||(t=oP);function e(m,p){return m&&p?t(m.__data__,p.__data__):!m-!p}for(var n=this._groups,o=n.length,a=new Array(o),i=0;i<o;++i){for(var l=n[i],u=l.length,d=a[i]=new Array(u),f,g=0;g<u;++g)(f=l[g])&&(d[g]=f);d.sort(e)}return new Eo(a,this._parents).order()}function oP(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function rP(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function aP(){return Array.from(this)}function sP(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],a=0,i=o.length;a<i;++a){var l=o[a];if(l)return l}return null}function iP(){let t=0;for(const e of this)++t;return t}function lP(){return!this.node()}function cP(t){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var a=e[n],i=0,l=a.length,u;i<l;++i)(u=a[i])&&t.call(u,u.__data__,i,a);return this}function uP(t){return function(){this.removeAttribute(t)}}function dP(t){return function(){this.removeAttributeNS(t.space,t.local)}}function fP(t,e){return function(){this.setAttribute(t,e)}}function hP(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function mP(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function gP(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function pP(t,e){var n=nh(t);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((e==null?n.local?dP:uP:typeof e=="function"?n.local?gP:mP:n.local?hP:fP)(n,e))}function vM(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function yP(t){return function(){this.style.removeProperty(t)}}function vP(t,e,n){return function(){this.style.setProperty(t,e,n)}}function xP(t,e,n){return function(){var o=e.apply(this,arguments);o==null?this.style.removeProperty(t):this.style.setProperty(t,o,n)}}function bP(t,e,n){return arguments.length>1?this.each((e==null?yP:typeof e=="function"?xP:vP)(t,e,n??"")):Vi(this.node(),t)}function Vi(t,e){return t.style.getPropertyValue(e)||vM(t).getComputedStyle(t,null).getPropertyValue(e)}function wP(t){return function(){delete this[t]}}function SP(t,e){return function(){this[t]=e}}function CP(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function EP(t,e){return arguments.length>1?this.each((e==null?wP:typeof e=="function"?CP:SP)(t,e)):this.node()[t]}function xM(t){return t.trim().split(/^|\s+/)}function xy(t){return t.classList||new bM(t)}function bM(t){this._node=t,this._names=xM(t.getAttribute("class")||"")}bM.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function wM(t,e){for(var n=xy(t),o=-1,a=e.length;++o<a;)n.add(e[o])}function SM(t,e){for(var n=xy(t),o=-1,a=e.length;++o<a;)n.remove(e[o])}function _P(t){return function(){wM(this,t)}}function MP(t){return function(){SM(this,t)}}function NP(t,e){return function(){(e.apply(this,arguments)?wM:SM)(this,t)}}function RP(t,e){var n=xM(t+"");if(arguments.length<2){for(var o=xy(this.node()),a=-1,i=n.length;++a<i;)if(!o.contains(n[a]))return!1;return!0}return this.each((typeof e=="function"?NP:e?_P:MP)(n,e))}function DP(){this.textContent=""}function TP(t){return function(){this.textContent=t}}function kP(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function OP(t){return arguments.length?this.each(t==null?DP:(typeof t=="function"?kP:TP)(t)):this.node().textContent}function AP(){this.innerHTML=""}function jP(t){return function(){this.innerHTML=t}}function zP(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function IP(t){return arguments.length?this.each(t==null?AP:(typeof t=="function"?zP:jP)(t)):this.node().innerHTML}function PP(){this.nextSibling&&this.parentNode.appendChild(this)}function $P(){return this.each(PP)}function LP(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function HP(){return this.each(LP)}function BP(t){var e=typeof t=="function"?t:hM(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function VP(){return null}function FP(t,e){var n=typeof t=="function"?t:hM(t),o=e==null?VP:typeof e=="function"?e:vy(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function UP(){var t=this.parentNode;t&&t.removeChild(this)}function YP(){return this.each(UP)}function GP(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function qP(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function WP(t){return this.select(t?qP:GP)}function KP(t){return arguments.length?this.property("__data__",t):this.node().__data__}function XP(t){return function(e){t.call(this,e,this.__data__)}}function ZP(t){return t.trim().split(/^|\s+/).map(function(e){var n="",o=e.indexOf(".");return o>=0&&(n=e.slice(o+1),e=e.slice(0,o)),{type:e,name:n}})}function QP(t){return function(){var e=this.__on;if(e){for(var n=0,o=-1,a=e.length,i;n<a;++n)i=e[n],(!t.type||i.type===t.type)&&i.name===t.name?this.removeEventListener(i.type,i.listener,i.options):e[++o]=i;++o?e.length=o:delete this.__on}}}function JP(t,e,n){return function(){var o=this.__on,a,i=XP(e);if(o){for(var l=0,u=o.length;l<u;++l)if((a=o[l]).type===t.type&&a.name===t.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=i,a.options=n),a.value=e;return}}this.addEventListener(t.type,i,n),a={type:t.type,name:t.name,value:e,listener:i,options:n},o?o.push(a):this.__on=[a]}}function e$(t,e,n){var o=ZP(t+""),a,i=o.length,l;if(arguments.length<2){var u=this.node().__on;if(u){for(var d=0,f=u.length,g;d<f;++d)for(a=0,g=u[d];a<i;++a)if((l=o[a]).type===g.type&&l.name===g.name)return g.value}return}for(u=e?JP:QP,a=0;a<i;++a)this.each(u(o[a],e,n));return this}function CM(t,e,n){var o=vM(t),a=o.CustomEvent;typeof a=="function"?a=new a(e,n):(a=o.document.createEvent("Event"),n?(a.initEvent(e,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(e,!1,!1)),t.dispatchEvent(a)}function t$(t,e){return function(){return CM(this,t,e)}}function n$(t,e){return function(){return CM(this,t,e.apply(this,arguments))}}function o$(t,e){return this.each((typeof e=="function"?n$:t$)(t,e))}function*r$(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var o=t[e],a=0,i=o.length,l;a<i;++a)(l=o[a])&&(yield l)}var EM=[null];function Eo(t,e){this._groups=t,this._parents=e}function eu(){return new Eo([[document.documentElement]],EM)}function a$(){return this}Eo.prototype=eu.prototype={constructor:Eo,select:k7,selectAll:z7,selectChild:L7,selectChildren:F7,filter:U7,data:X7,enter:Y7,exit:Q7,join:J7,merge:eP,selection:a$,order:tP,sort:nP,call:rP,nodes:aP,node:sP,size:iP,empty:lP,each:cP,attr:pP,style:bP,property:EP,classed:RP,text:OP,html:IP,raise:$P,lower:HP,append:BP,insert:FP,remove:YP,clone:WP,datum:KP,on:e$,dispatch:o$,[Symbol.iterator]:r$};function So(t){return typeof t=="string"?new Eo([[document.querySelector(t)]],[document.documentElement]):new Eo([[t]],EM)}function s$(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Xo(t,e){if(t=s$(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=t.clientX,o.y=t.clientY,o=o.matrixTransform(e.getScreenCTM().inverse()),[o.x,o.y]}if(e.getBoundingClientRect){var a=e.getBoundingClientRect();return[t.clientX-a.left-e.clientLeft,t.clientY-a.top-e.clientTop]}}return[t.pageX,t.pageY]}const i$={passive:!1},Dc={capture:!0,passive:!1};function Kg(t){t.stopImmediatePropagation()}function Ii(t){t.preventDefault(),t.stopImmediatePropagation()}function _M(t){var e=t.document.documentElement,n=So(t).on("dragstart.drag",Ii,Dc);"onselectstart"in e?n.on("selectstart.drag",Ii,Dc):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function MM(t,e){var n=t.document.documentElement,o=So(t).on("dragstart.drag",null);e&&(o.on("click.drag",Ii,Dc),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Ad=t=>()=>t;function Up(t,{sourceEvent:e,subject:n,target:o,identifier:a,active:i,x:l,y:u,dx:d,dy:f,dispatch:g}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:g}})}Up.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function l$(t){return!t.ctrlKey&&!t.button}function c$(){return this.parentNode}function u$(t,e){return e??{x:t.x,y:t.y}}function d$(){return navigator.maxTouchPoints||"ontouchstart"in this}function NM(){var t=l$,e=c$,n=u$,o=d$,a={},i=th("start","drag","end"),l=0,u,d,f,g,m=0;function p(N){N.on("mousedown.drag",v).filter(o).on("touchstart.drag",w).on("touchmove.drag",M,i$).on("touchend.drag touchcancel.drag",R).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(N,D){if(!(g||!t.call(this,N,D))){var T=E(this,e.call(this,N,D),N,D,"mouse");T&&(So(N.view).on("mousemove.drag",S,Dc).on("mouseup.drag",C,Dc),_M(N.view),Kg(N),f=!1,u=N.clientX,d=N.clientY,T("start",N))}}function S(N){if(Ii(N),!f){var D=N.clientX-u,T=N.clientY-d;f=D*D+T*T>m}a.mouse("drag",N)}function C(N){So(N.view).on("mousemove.drag mouseup.drag",null),MM(N.view,f),Ii(N),a.mouse("end",N)}function w(N,D){if(t.call(this,N,D)){var T=N.changedTouches,k=e.call(this,N,D),A=T.length,B,W;for(B=0;B<A;++B)(W=E(this,k,N,D,T[B].identifier,T[B]))&&(Kg(N),W("start",N,T[B]))}}function M(N){var D=N.changedTouches,T=D.length,k,A;for(k=0;k<T;++k)(A=a[D[k].identifier])&&(Ii(N),A("drag",N,D[k]))}function R(N){var D=N.changedTouches,T=D.length,k,A;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),k=0;k<T;++k)(A=a[D[k].identifier])&&(Kg(N),A("end",N,D[k]))}function E(N,D,T,k,A,B){var W=i.copy(),U=Xo(B||T,D),Y,Z,I;if((I=n.call(N,new Up("beforestart",{sourceEvent:T,target:p,identifier:A,active:l,x:U[0],y:U[1],dx:0,dy:0,dispatch:W}),k))!=null)return Y=I.x-U[0]||0,Z=I.y-U[1]||0,function G(j,L,$){var H=U,X;switch(j){case"start":a[A]=G,X=l++;break;case"end":delete a[A],--l;case"drag":U=Xo($||L,D),X=l;break}W.call(j,N,new Up(j,{sourceEvent:L,subject:I,target:p,identifier:A,active:X,x:U[0]+Y,y:U[1]+Z,dx:U[0]-H[0],dy:U[1]-H[1],dispatch:W}),k)}}return p.filter=function(N){return arguments.length?(t=typeof N=="function"?N:Ad(!!N),p):t},p.container=function(N){return arguments.length?(e=typeof N=="function"?N:Ad(N),p):e},p.subject=function(N){return arguments.length?(n=typeof N=="function"?N:Ad(N),p):n},p.touchable=function(N){return arguments.length?(o=typeof N=="function"?N:Ad(!!N),p):o},p.on=function(){var N=i.on.apply(i,arguments);return N===i?p:N},p.clickDistance=function(N){return arguments.length?(m=(N=+N)*N,p):Math.sqrt(m)},p}function by(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function RM(t,e){var n=Object.create(t.prototype);for(var o in e)n[o]=e[o];return n}function tu(){}var Tc=.7,gf=1/Tc,Pi="\\s*([+-]?\\d+)\\s*",kc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",br="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",f$=/^#([0-9a-f]{3,8})$/,h$=new RegExp(`^rgb\\(${Pi},${Pi},${Pi}\\)$`),m$=new RegExp(`^rgb\\(${br},${br},${br}\\)$`),g$=new RegExp(`^rgba\\(${Pi},${Pi},${Pi},${kc}\\)$`),p$=new RegExp(`^rgba\\(${br},${br},${br},${kc}\\)$`),y$=new RegExp(`^hsl\\(${kc},${br},${br}\\)$`),v$=new RegExp(`^hsla\\(${kc},${br},${br},${kc}\\)$`),Uw={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};by(tu,js,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Yw,formatHex:Yw,formatHex8:x$,formatHsl:b$,formatRgb:Gw,toString:Gw});function Yw(){return this.rgb().formatHex()}function x$(){return this.rgb().formatHex8()}function b$(){return DM(this).formatHsl()}function Gw(){return this.rgb().formatRgb()}function js(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=f$.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?qw(e):n===3?new io(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?jd(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?jd(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=h$.exec(t))?new io(e[1],e[2],e[3],1):(e=m$.exec(t))?new io(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=g$.exec(t))?jd(e[1],e[2],e[3],e[4]):(e=p$.exec(t))?jd(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=y$.exec(t))?Xw(e[1],e[2]/100,e[3]/100,1):(e=v$.exec(t))?Xw(e[1],e[2]/100,e[3]/100,e[4]):Uw.hasOwnProperty(t)?qw(Uw[t]):t==="transparent"?new io(NaN,NaN,NaN,0):null}function qw(t){return new io(t>>16&255,t>>8&255,t&255,1)}function jd(t,e,n,o){return o<=0&&(t=e=n=NaN),new io(t,e,n,o)}function w$(t){return t instanceof tu||(t=js(t)),t?(t=t.rgb(),new io(t.r,t.g,t.b,t.opacity)):new io}function Yp(t,e,n,o){return arguments.length===1?w$(t):new io(t,e,n,o??1)}function io(t,e,n,o){this.r=+t,this.g=+e,this.b=+n,this.opacity=+o}by(io,Yp,RM(tu,{brighter(t){return t=t==null?gf:Math.pow(gf,t),new io(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Tc:Math.pow(Tc,t),new io(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new io(Rs(this.r),Rs(this.g),Rs(this.b),pf(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:Ww,formatHex:Ww,formatHex8:S$,formatRgb:Kw,toString:Kw}));function Ww(){return`#${Ms(this.r)}${Ms(this.g)}${Ms(this.b)}`}function S$(){return`#${Ms(this.r)}${Ms(this.g)}${Ms(this.b)}${Ms((isNaN(this.opacity)?1:this.opacity)*255)}`}function Kw(){const t=pf(this.opacity);return`${t===1?"rgb(":"rgba("}${Rs(this.r)}, ${Rs(this.g)}, ${Rs(this.b)}${t===1?")":`, ${t})`}`}function pf(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Rs(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ms(t){return t=Rs(t),(t<16?"0":"")+t.toString(16)}function Xw(t,e,n,o){return o<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Zo(t,e,n,o)}function DM(t){if(t instanceof Zo)return new Zo(t.h,t.s,t.l,t.opacity);if(t instanceof tu||(t=js(t)),!t)return new Zo;if(t instanceof Zo)return t;t=t.rgb();var e=t.r/255,n=t.g/255,o=t.b/255,a=Math.min(e,n,o),i=Math.max(e,n,o),l=NaN,u=i-a,d=(i+a)/2;return u?(e===i?l=(n-o)/u+(n<o)*6:n===i?l=(o-e)/u+2:l=(e-n)/u+4,u/=d<.5?i+a:2-i-a,l*=60):u=d>0&&d<1?0:l,new Zo(l,u,d,t.opacity)}function C$(t,e,n,o){return arguments.length===1?DM(t):new Zo(t,e,n,o??1)}function Zo(t,e,n,o){this.h=+t,this.s=+e,this.l=+n,this.opacity=+o}by(Zo,C$,RM(tu,{brighter(t){return t=t==null?gf:Math.pow(gf,t),new Zo(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Tc:Math.pow(Tc,t),new Zo(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*e,a=2*n-o;return new io(Xg(t>=240?t-240:t+120,a,o),Xg(t,a,o),Xg(t<120?t+240:t-120,a,o),this.opacity)},clamp(){return new Zo(Zw(this.h),zd(this.s),zd(this.l),pf(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=pf(this.opacity);return`${t===1?"hsl(":"hsla("}${Zw(this.h)}, ${zd(this.s)*100}%, ${zd(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Zw(t){return t=(t||0)%360,t<0?t+360:t}function zd(t){return Math.max(0,Math.min(1,t||0))}function Xg(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const wy=t=>()=>t;function E$(t,e){return function(n){return t+n*e}}function _$(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(o){return Math.pow(t+o*e,n)}}function M$(t){return(t=+t)==1?TM:function(e,n){return n-e?_$(e,n,t):wy(isNaN(e)?n:e)}}function TM(t,e){var n=e-t;return n?E$(t,n):wy(isNaN(t)?e:t)}const yf=(function t(e){var n=M$(e);function o(a,i){var l=n((a=Yp(a)).r,(i=Yp(i)).r),u=n(a.g,i.g),d=n(a.b,i.b),f=TM(a.opacity,i.opacity);return function(g){return a.r=l(g),a.g=u(g),a.b=d(g),a.opacity=f(g),a+""}}return o.gamma=t,o})(1);function N$(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,o=e.slice(),a;return function(i){for(a=0;a<n;++a)o[a]=t[a]*(1-i)+e[a]*i;return o}}function R$(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function D$(t,e){var n=e?e.length:0,o=t?Math.min(n,t.length):0,a=new Array(o),i=new Array(n),l;for(l=0;l<o;++l)a[l]=xc(t[l],e[l]);for(;l<n;++l)i[l]=e[l];return function(u){for(l=0;l<o;++l)i[l]=a[l](u);return i}}function T$(t,e){var n=new Date;return t=+t,e=+e,function(o){return n.setTime(t*(1-o)+e*o),n}}function mr(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function k$(t,e){var n={},o={},a;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(a in e)a in t?n[a]=xc(t[a],e[a]):o[a]=e[a];return function(i){for(a in n)o[a]=n[a](i);return o}}var Gp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Zg=new RegExp(Gp.source,"g");function O$(t){return function(){return t}}function A$(t){return function(e){return t(e)+""}}function kM(t,e){var n=Gp.lastIndex=Zg.lastIndex=0,o,a,i,l=-1,u=[],d=[];for(t=t+"",e=e+"";(o=Gp.exec(t))&&(a=Zg.exec(e));)(i=a.index)>n&&(i=e.slice(n,i),u[l]?u[l]+=i:u[++l]=i),(o=o[0])===(a=a[0])?u[l]?u[l]+=a:u[++l]=a:(u[++l]=null,d.push({i:l,x:mr(o,a)})),n=Zg.lastIndex;return n<e.length&&(i=e.slice(n),u[l]?u[l]+=i:u[++l]=i),u.length<2?d[0]?A$(d[0].x):O$(e):(e=d.length,function(f){for(var g=0,m;g<e;++g)u[(m=d[g]).i]=m.x(f);return u.join("")})}function xc(t,e){var n=typeof e,o;return e==null||n==="boolean"?wy(e):(n==="number"?mr:n==="string"?(o=js(e))?(e=o,yf):kM:e instanceof js?yf:e instanceof Date?T$:R$(e)?N$:Array.isArray(e)?D$:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?k$:mr)(t,e)}var Qw=180/Math.PI,qp={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function OM(t,e,n,o,a,i){var l,u,d;return(l=Math.sqrt(t*t+e*e))&&(t/=l,e/=l),(d=t*n+e*o)&&(n-=t*d,o-=e*d),(u=Math.sqrt(n*n+o*o))&&(n/=u,o/=u,d/=u),t*o<e*n&&(t=-t,e=-e,d=-d,l=-l),{translateX:a,translateY:i,rotate:Math.atan2(e,t)*Qw,skewX:Math.atan(d)*Qw,scaleX:l,scaleY:u}}var Id;function j$(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?qp:OM(e.a,e.b,e.c,e.d,e.e,e.f)}function z$(t){return t==null||(Id||(Id=document.createElementNS("http://www.w3.org/2000/svg","g")),Id.setAttribute("transform",t),!(t=Id.transform.baseVal.consolidate()))?qp:(t=t.matrix,OM(t.a,t.b,t.c,t.d,t.e,t.f))}function AM(t,e,n,o){function a(f){return f.length?f.pop()+" ":""}function i(f,g,m,p,v,S){if(f!==m||g!==p){var C=v.push("translate(",null,e,null,n);S.push({i:C-4,x:mr(f,m)},{i:C-2,x:mr(g,p)})}else(m||p)&&v.push("translate("+m+e+p+n)}function l(f,g,m,p){f!==g?(f-g>180?g+=360:g-f>180&&(f+=360),p.push({i:m.push(a(m)+"rotate(",null,o)-2,x:mr(f,g)})):g&&m.push(a(m)+"rotate("+g+o)}function u(f,g,m,p){f!==g?p.push({i:m.push(a(m)+"skewX(",null,o)-2,x:mr(f,g)}):g&&m.push(a(m)+"skewX("+g+o)}function d(f,g,m,p,v,S){if(f!==m||g!==p){var C=v.push(a(v)+"scale(",null,",",null,")");S.push({i:C-4,x:mr(f,m)},{i:C-2,x:mr(g,p)})}else(m!==1||p!==1)&&v.push(a(v)+"scale("+m+","+p+")")}return function(f,g){var m=[],p=[];return f=t(f),g=t(g),i(f.translateX,f.translateY,g.translateX,g.translateY,m,p),l(f.rotate,g.rotate,m,p),u(f.skewX,g.skewX,m,p),d(f.scaleX,f.scaleY,g.scaleX,g.scaleY,m,p),f=g=null,function(v){for(var S=-1,C=p.length,w;++S<C;)m[(w=p[S]).i]=w.x(v);return m.join("")}}}var I$=AM(j$,"px, ","px)","deg)"),P$=AM(z$,", ",")",")"),$$=1e-12;function Jw(t){return((t=Math.exp(t))+1/t)/2}function L$(t){return((t=Math.exp(t))-1/t)/2}function H$(t){return((t=Math.exp(2*t))-1)/(t+1)}const Zd=(function t(e,n,o){function a(i,l){var u=i[0],d=i[1],f=i[2],g=l[0],m=l[1],p=l[2],v=g-u,S=m-d,C=v*v+S*S,w,M;if(C<$$)M=Math.log(p/f)/e,w=function(k){return[u+k*v,d+k*S,f*Math.exp(e*k*M)]};else{var R=Math.sqrt(C),E=(p*p-f*f+o*C)/(2*f*n*R),N=(p*p-f*f-o*C)/(2*p*n*R),D=Math.log(Math.sqrt(E*E+1)-E),T=Math.log(Math.sqrt(N*N+1)-N);M=(T-D)/e,w=function(k){var A=k*M,B=Jw(D),W=f/(n*R)*(B*H$(e*A+D)-L$(D));return[u+W*v,d+W*S,f*B/Jw(e*A+D)]}}return w.duration=M*1e3*e/Math.SQRT2,w}return a.rho=function(i){var l=Math.max(.001,+i),u=l*l,d=u*u;return t(l,u,d)},a})(Math.SQRT2,2,4);var Fi=0,gc=0,ac=0,jM=1e3,vf,pc,xf=0,zs=0,oh=0,Oc=typeof performance=="object"&&performance.now?performance:Date,zM=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Sy(){return zs||(zM(B$),zs=Oc.now()+oh)}function B$(){zs=0}function bf(){this._call=this._time=this._next=null}bf.prototype=IM.prototype={constructor:bf,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?Sy():+n)+(e==null?0:+e),!this._next&&pc!==this&&(pc?pc._next=this:vf=this,pc=this),this._call=t,this._time=n,Wp()},stop:function(){this._call&&(this._call=null,this._time=1/0,Wp())}};function IM(t,e,n){var o=new bf;return o.restart(t,e,n),o}function V$(){Sy(),++Fi;for(var t=vf,e;t;)(e=zs-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Fi}function eS(){zs=(xf=Oc.now())+oh,Fi=gc=0;try{V$()}finally{Fi=0,U$(),zs=0}}function F$(){var t=Oc.now(),e=t-xf;e>jM&&(oh-=e,xf=t)}function U$(){for(var t,e=vf,n,o=1/0;e;)e._call?(o>e._time&&(o=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:vf=n);pc=t,Wp(o)}function Wp(t){if(!Fi){gc&&(gc=clearTimeout(gc));var e=t-zs;e>24?(t<1/0&&(gc=setTimeout(eS,t-Oc.now()-oh)),ac&&(ac=clearInterval(ac))):(ac||(xf=Oc.now(),ac=setInterval(F$,jM)),Fi=1,zM(eS))}}function tS(t,e,n){var o=new bf;return e=e==null?0:+e,o.restart(a=>{o.stop(),t(a+e)},e,n),o}var Y$=th("start","end","cancel","interrupt"),G$=[],PM=0,nS=1,Kp=2,Qd=3,oS=4,Xp=5,Jd=6;function rh(t,e,n,o,a,i){var l=t.__transition;if(!l)t.__transition={};else if(n in l)return;q$(t,n,{name:e,index:o,group:a,on:Y$,tween:G$,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:PM})}function Cy(t,e){var n=sr(t,e);if(n.state>PM)throw new Error("too late; already scheduled");return n}function Nr(t,e){var n=sr(t,e);if(n.state>Qd)throw new Error("too late; already running");return n}function sr(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function q$(t,e,n){var o=t.__transition,a;o[e]=n,n.timer=IM(i,0,n.time);function i(f){n.state=nS,n.timer.restart(l,n.delay,n.time),n.delay<=f&&l(f-n.delay)}function l(f){var g,m,p,v;if(n.state!==nS)return d();for(g in o)if(v=o[g],v.name===n.name){if(v.state===Qd)return tS(l);v.state===oS?(v.state=Jd,v.timer.stop(),v.on.call("interrupt",t,t.__data__,v.index,v.group),delete o[g]):+g<e&&(v.state=Jd,v.timer.stop(),v.on.call("cancel",t,t.__data__,v.index,v.group),delete o[g])}if(tS(function(){n.state===Qd&&(n.state=oS,n.timer.restart(u,n.delay,n.time),u(f))}),n.state=Kp,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Kp){for(n.state=Qd,a=new Array(p=n.tween.length),g=0,m=-1;g<p;++g)(v=n.tween[g].value.call(t,t.__data__,n.index,n.group))&&(a[++m]=v);a.length=m+1}}function u(f){for(var g=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(d),n.state=Xp,1),m=-1,p=a.length;++m<p;)a[m].call(t,g);n.state===Xp&&(n.on.call("end",t,t.__data__,n.index,n.group),d())}function d(){n.state=Jd,n.timer.stop(),delete o[e];for(var f in o)return;delete t.__transition}}function ef(t,e){var n=t.__transition,o,a,i=!0,l;if(n){e=e==null?null:e+"";for(l in n){if((o=n[l]).name!==e){i=!1;continue}a=o.state>Kp&&o.state<Xp,o.state=Jd,o.timer.stop(),o.on.call(a?"interrupt":"cancel",t,t.__data__,o.index,o.group),delete n[l]}i&&delete t.__transition}}function W$(t){return this.each(function(){ef(this,t)})}function K$(t,e){var n,o;return function(){var a=Nr(this,t),i=a.tween;if(i!==n){o=n=i;for(var l=0,u=o.length;l<u;++l)if(o[l].name===e){o=o.slice(),o.splice(l,1);break}}a.tween=o}}function X$(t,e,n){var o,a;if(typeof n!="function")throw new Error;return function(){var i=Nr(this,t),l=i.tween;if(l!==o){a=(o=l).slice();for(var u={name:e,value:n},d=0,f=a.length;d<f;++d)if(a[d].name===e){a[d]=u;break}d===f&&a.push(u)}i.tween=a}}function Z$(t,e){var n=this._id;if(t+="",arguments.length<2){for(var o=sr(this.node(),n).tween,a=0,i=o.length,l;a<i;++a)if((l=o[a]).name===t)return l.value;return null}return this.each((e==null?K$:X$)(n,t,e))}function Ey(t,e,n){var o=t._id;return t.each(function(){var a=Nr(this,o);(a.value||(a.value={}))[e]=n.apply(this,arguments)}),function(a){return sr(a,o).value[e]}}function $M(t,e){var n;return(typeof e=="number"?mr:e instanceof js?yf:(n=js(e))?(e=n,yf):kM)(t,e)}function Q$(t){return function(){this.removeAttribute(t)}}function J$(t){return function(){this.removeAttributeNS(t.space,t.local)}}function eL(t,e,n){var o,a=n+"",i;return function(){var l=this.getAttribute(t);return l===a?null:l===o?i:i=e(o=l,n)}}function tL(t,e,n){var o,a=n+"",i;return function(){var l=this.getAttributeNS(t.space,t.local);return l===a?null:l===o?i:i=e(o=l,n)}}function nL(t,e,n){var o,a,i;return function(){var l,u=n(this),d;return u==null?void this.removeAttribute(t):(l=this.getAttribute(t),d=u+"",l===d?null:l===o&&d===a?i:(a=d,i=e(o=l,u)))}}function oL(t,e,n){var o,a,i;return function(){var l,u=n(this),d;return u==null?void this.removeAttributeNS(t.space,t.local):(l=this.getAttributeNS(t.space,t.local),d=u+"",l===d?null:l===o&&d===a?i:(a=d,i=e(o=l,u)))}}function rL(t,e){var n=nh(t),o=n==="transform"?P$:$M;return this.attrTween(t,typeof e=="function"?(n.local?oL:nL)(n,o,Ey(this,"attr."+t,e)):e==null?(n.local?J$:Q$)(n):(n.local?tL:eL)(n,o,e))}function aL(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function sL(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function iL(t,e){var n,o;function a(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&sL(t,i)),n}return a._value=e,a}function lL(t,e){var n,o;function a(){var i=e.apply(this,arguments);return i!==o&&(n=(o=i)&&aL(t,i)),n}return a._value=e,a}function cL(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var o=nh(t);return this.tween(n,(o.local?iL:lL)(o,e))}function uL(t,e){return function(){Cy(this,t).delay=+e.apply(this,arguments)}}function dL(t,e){return e=+e,function(){Cy(this,t).delay=e}}function fL(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?uL:dL)(e,t)):sr(this.node(),e).delay}function hL(t,e){return function(){Nr(this,t).duration=+e.apply(this,arguments)}}function mL(t,e){return e=+e,function(){Nr(this,t).duration=e}}function gL(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?hL:mL)(e,t)):sr(this.node(),e).duration}function pL(t,e){if(typeof e!="function")throw new Error;return function(){Nr(this,t).ease=e}}function yL(t){var e=this._id;return arguments.length?this.each(pL(e,t)):sr(this.node(),e).ease}function vL(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;Nr(this,t).ease=n}}function xL(t){if(typeof t!="function")throw new Error;return this.each(vL(this._id,t))}function bL(t){typeof t!="function"&&(t=gM(t));for(var e=this._groups,n=e.length,o=new Array(n),a=0;a<n;++a)for(var i=e[a],l=i.length,u=o[a]=[],d,f=0;f<l;++f)(d=i[f])&&t.call(d,d.__data__,f,i)&&u.push(d);return new ca(o,this._parents,this._name,this._id)}function wL(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,o=e.length,a=n.length,i=Math.min(o,a),l=new Array(o),u=0;u<i;++u)for(var d=e[u],f=n[u],g=d.length,m=l[u]=new Array(g),p,v=0;v<g;++v)(p=d[v]||f[v])&&(m[v]=p);for(;u<o;++u)l[u]=e[u];return new ca(l,this._parents,this._name,this._id)}function SL(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function CL(t,e,n){var o,a,i=SL(e)?Cy:Nr;return function(){var l=i(this,t),u=l.on;u!==o&&(a=(o=u).copy()).on(e,n),l.on=a}}function EL(t,e){var n=this._id;return arguments.length<2?sr(this.node(),n).on.on(t):this.each(CL(n,t,e))}function _L(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function ML(){return this.on("end.remove",_L(this._id))}function NL(t){var e=this._name,n=this._id;typeof t!="function"&&(t=vy(t));for(var o=this._groups,a=o.length,i=new Array(a),l=0;l<a;++l)for(var u=o[l],d=u.length,f=i[l]=new Array(d),g,m,p=0;p<d;++p)(g=u[p])&&(m=t.call(g,g.__data__,p,u))&&("__data__"in g&&(m.__data__=g.__data__),f[p]=m,rh(f[p],e,n,p,f,sr(g,n)));return new ca(i,this._parents,e,n)}function RL(t){var e=this._name,n=this._id;typeof t!="function"&&(t=mM(t));for(var o=this._groups,a=o.length,i=[],l=[],u=0;u<a;++u)for(var d=o[u],f=d.length,g,m=0;m<f;++m)if(g=d[m]){for(var p=t.call(g,g.__data__,m,d),v,S=sr(g,n),C=0,w=p.length;C<w;++C)(v=p[C])&&rh(v,e,n,C,p,S);i.push(p),l.push(g)}return new ca(i,l,e,n)}var DL=eu.prototype.constructor;function TL(){return new DL(this._groups,this._parents)}function kL(t,e){var n,o,a;return function(){var i=Vi(this,t),l=(this.style.removeProperty(t),Vi(this,t));return i===l?null:i===n&&l===o?a:a=e(n=i,o=l)}}function LM(t){return function(){this.style.removeProperty(t)}}function OL(t,e,n){var o,a=n+"",i;return function(){var l=Vi(this,t);return l===a?null:l===o?i:i=e(o=l,n)}}function AL(t,e,n){var o,a,i;return function(){var l=Vi(this,t),u=n(this),d=u+"";return u==null&&(d=u=(this.style.removeProperty(t),Vi(this,t))),l===d?null:l===o&&d===a?i:(a=d,i=e(o=l,u))}}function jL(t,e){var n,o,a,i="style."+e,l="end."+i,u;return function(){var d=Nr(this,t),f=d.on,g=d.value[i]==null?u||(u=LM(e)):void 0;(f!==n||a!==g)&&(o=(n=f).copy()).on(l,a=g),d.on=o}}function zL(t,e,n){var o=(t+="")=="transform"?I$:$M;return e==null?this.styleTween(t,kL(t,o)).on("end.style."+t,LM(t)):typeof e=="function"?this.styleTween(t,AL(t,o,Ey(this,"style."+t,e))).each(jL(this._id,t)):this.styleTween(t,OL(t,o,e),n).on("end.style."+t,null)}function IL(t,e,n){return function(o){this.style.setProperty(t,e.call(this,o),n)}}function PL(t,e,n){var o,a;function i(){var l=e.apply(this,arguments);return l!==a&&(o=(a=l)&&IL(t,l,n)),o}return i._value=e,i}function $L(t,e,n){var o="style."+(t+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(e==null)return this.tween(o,null);if(typeof e!="function")throw new Error;return this.tween(o,PL(t,e,n??""))}function LL(t){return function(){this.textContent=t}}function HL(t){return function(){var e=t(this);this.textContent=e??""}}function BL(t){return this.tween("text",typeof t=="function"?HL(Ey(this,"text",t)):LL(t==null?"":t+""))}function VL(t){return function(e){this.textContent=t.call(this,e)}}function FL(t){var e,n;function o(){var a=t.apply(this,arguments);return a!==n&&(e=(n=a)&&VL(a)),e}return o._value=t,o}function UL(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,FL(t))}function YL(){for(var t=this._name,e=this._id,n=HM(),o=this._groups,a=o.length,i=0;i<a;++i)for(var l=o[i],u=l.length,d,f=0;f<u;++f)if(d=l[f]){var g=sr(d,e);rh(d,t,n,f,l,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new ca(o,this._parents,t,n)}function GL(){var t,e,n=this,o=n._id,a=n.size();return new Promise(function(i,l){var u={value:l},d={value:function(){--a===0&&i()}};n.each(function(){var f=Nr(this,o),g=f.on;g!==t&&(e=(t=g).copy(),e._.cancel.push(u),e._.interrupt.push(u),e._.end.push(d)),f.on=e}),a===0&&i()})}var qL=0;function ca(t,e,n,o){this._groups=t,this._parents=e,this._name=n,this._id=o}function HM(){return++qL}var Zr=eu.prototype;ca.prototype={constructor:ca,select:NL,selectAll:RL,selectChild:Zr.selectChild,selectChildren:Zr.selectChildren,filter:bL,merge:wL,selection:TL,transition:YL,call:Zr.call,nodes:Zr.nodes,node:Zr.node,size:Zr.size,empty:Zr.empty,each:Zr.each,on:EL,attr:rL,attrTween:cL,style:zL,styleTween:$L,text:BL,textTween:UL,remove:ML,tween:Z$,delay:fL,duration:gL,ease:yL,easeVarying:xL,end:GL,[Symbol.iterator]:Zr[Symbol.iterator]};function WL(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var KL={time:null,delay:0,duration:250,ease:WL};function XL(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function ZL(t){var e,n;t instanceof ca?(e=t._id,t=t._name):(e=HM(),(n=KL).time=Sy(),t=t==null?null:t+"");for(var o=this._groups,a=o.length,i=0;i<a;++i)for(var l=o[i],u=l.length,d,f=0;f<u;++f)(d=l[f])&&rh(d,t,e,f,l,n||XL(d,e));return new ca(o,this._parents,t,e)}eu.prototype.interrupt=W$;eu.prototype.transition=ZL;const Pd=t=>()=>t;function QL(t,{sourceEvent:e,target:n,transform:o,dispatch:a}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:a}})}function Jr(t,e,n){this.k=t,this.x=e,this.y=n}Jr.prototype={constructor:Jr,scale:function(t){return t===1?this:new Jr(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Jr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ah=new Jr(1,0,0);BM.prototype=Jr.prototype;function BM(t){for(;!t.__zoom;)if(!(t=t.parentNode))return ah;return t.__zoom}function Qg(t){t.stopImmediatePropagation()}function sc(t){t.preventDefault(),t.stopImmediatePropagation()}function JL(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function e9(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function rS(){return this.__zoom||ah}function t9(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function n9(){return navigator.maxTouchPoints||"ontouchstart"in this}function o9(t,e,n){var o=t.invertX(e[0][0])-n[0][0],a=t.invertX(e[1][0])-n[1][0],i=t.invertY(e[0][1])-n[0][1],l=t.invertY(e[1][1])-n[1][1];return t.translate(a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a),l>i?(i+l)/2:Math.min(0,i)||Math.max(0,l))}function VM(){var t=JL,e=e9,n=o9,o=t9,a=n9,i=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],u=250,d=Zd,f=th("start","zoom","end"),g,m,p,v=500,S=150,C=0,w=10;function M(I){I.property("__zoom",rS).on("wheel.zoom",A,{passive:!1}).on("mousedown.zoom",B).on("dblclick.zoom",W).filter(a).on("touchstart.zoom",U).on("touchmove.zoom",Y).on("touchend.zoom touchcancel.zoom",Z).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}M.transform=function(I,G,j,L){var $=I.selection?I.selection():I;$.property("__zoom",rS),I!==$?D(I,G,j,L):$.interrupt().each(function(){T(this,arguments).event(L).start().zoom(null,typeof G=="function"?G.apply(this,arguments):G).end()})},M.scaleBy=function(I,G,j,L){M.scaleTo(I,function(){var $=this.__zoom.k,H=typeof G=="function"?G.apply(this,arguments):G;return $*H},j,L)},M.scaleTo=function(I,G,j,L){M.transform(I,function(){var $=e.apply(this,arguments),H=this.__zoom,X=j==null?N($):typeof j=="function"?j.apply(this,arguments):j,P=H.invert(X),z=typeof G=="function"?G.apply(this,arguments):G;return n(E(R(H,z),X,P),$,l)},j,L)},M.translateBy=function(I,G,j,L){M.transform(I,function(){return n(this.__zoom.translate(typeof G=="function"?G.apply(this,arguments):G,typeof j=="function"?j.apply(this,arguments):j),e.apply(this,arguments),l)},null,L)},M.translateTo=function(I,G,j,L,$){M.transform(I,function(){var H=e.apply(this,arguments),X=this.__zoom,P=L==null?N(H):typeof L=="function"?L.apply(this,arguments):L;return n(ah.translate(P[0],P[1]).scale(X.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof j=="function"?-j.apply(this,arguments):-j),H,l)},L,$)};function R(I,G){return G=Math.max(i[0],Math.min(i[1],G)),G===I.k?I:new Jr(G,I.x,I.y)}function E(I,G,j){var L=G[0]-j[0]*I.k,$=G[1]-j[1]*I.k;return L===I.x&&$===I.y?I:new Jr(I.k,L,$)}function N(I){return[(+I[0][0]+ +I[1][0])/2,(+I[0][1]+ +I[1][1])/2]}function D(I,G,j,L){I.on("start.zoom",function(){T(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(L).end()}).tween("zoom",function(){var $=this,H=arguments,X=T($,H).event(L),P=e.apply($,H),z=j==null?N(P):typeof j=="function"?j.apply($,H):j,V=Math.max(P[1][0]-P[0][0],P[1][1]-P[0][1]),q=$.__zoom,J=typeof G=="function"?G.apply($,H):G,oe=d(q.invert(z).concat(V/q.k),J.invert(z).concat(V/J.k));return function(K){if(K===1)K=J;else{var ee=oe(K),ae=V/ee[2];K=new Jr(ae,z[0]-ee[0]*ae,z[1]-ee[1]*ae)}X.zoom(null,K)}})}function T(I,G,j){return!j&&I.__zooming||new k(I,G)}function k(I,G){this.that=I,this.args=G,this.active=0,this.sourceEvent=null,this.extent=e.apply(I,G),this.taps=0}k.prototype={event:function(I){return I&&(this.sourceEvent=I),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(I,G){return this.mouse&&I!=="mouse"&&(this.mouse[1]=G.invert(this.mouse[0])),this.touch0&&I!=="touch"&&(this.touch0[1]=G.invert(this.touch0[0])),this.touch1&&I!=="touch"&&(this.touch1[1]=G.invert(this.touch1[0])),this.that.__zoom=G,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(I){var G=So(this.that).datum();f.call(I,this.that,new QL(I,{sourceEvent:this.sourceEvent,target:M,transform:this.that.__zoom,dispatch:f}),G)}};function A(I,...G){if(!t.apply(this,arguments))return;var j=T(this,G).event(I),L=this.__zoom,$=Math.max(i[0],Math.min(i[1],L.k*Math.pow(2,o.apply(this,arguments)))),H=Xo(I);if(j.wheel)(j.mouse[0][0]!==H[0]||j.mouse[0][1]!==H[1])&&(j.mouse[1]=L.invert(j.mouse[0]=H)),clearTimeout(j.wheel);else{if(L.k===$)return;j.mouse=[H,L.invert(H)],ef(this),j.start()}sc(I),j.wheel=setTimeout(X,S),j.zoom("mouse",n(E(R(L,$),j.mouse[0],j.mouse[1]),j.extent,l));function X(){j.wheel=null,j.end()}}function B(I,...G){if(p||!t.apply(this,arguments))return;var j=I.currentTarget,L=T(this,G,!0).event(I),$=So(I.view).on("mousemove.zoom",z,!0).on("mouseup.zoom",V,!0),H=Xo(I,j),X=I.clientX,P=I.clientY;_M(I.view),Qg(I),L.mouse=[H,this.__zoom.invert(H)],ef(this),L.start();function z(q){if(sc(q),!L.moved){var J=q.clientX-X,oe=q.clientY-P;L.moved=J*J+oe*oe>C}L.event(q).zoom("mouse",n(E(L.that.__zoom,L.mouse[0]=Xo(q,j),L.mouse[1]),L.extent,l))}function V(q){$.on("mousemove.zoom mouseup.zoom",null),MM(q.view,L.moved),sc(q),L.event(q).end()}}function W(I,...G){if(t.apply(this,arguments)){var j=this.__zoom,L=Xo(I.changedTouches?I.changedTouches[0]:I,this),$=j.invert(L),H=j.k*(I.shiftKey?.5:2),X=n(E(R(j,H),L,$),e.apply(this,G),l);sc(I),u>0?So(this).transition().duration(u).call(D,X,L,I):So(this).call(M.transform,X,L,I)}}function U(I,...G){if(t.apply(this,arguments)){var j=I.touches,L=j.length,$=T(this,G,I.changedTouches.length===L).event(I),H,X,P,z;for(Qg(I),X=0;X<L;++X)P=j[X],z=Xo(P,this),z=[z,this.__zoom.invert(z),P.identifier],$.touch0?!$.touch1&&$.touch0[2]!==z[2]&&($.touch1=z,$.taps=0):($.touch0=z,H=!0,$.taps=1+!!g);g&&(g=clearTimeout(g)),H&&($.taps<2&&(m=z[0],g=setTimeout(function(){g=null},v)),ef(this),$.start())}}function Y(I,...G){if(this.__zooming){var j=T(this,G).event(I),L=I.changedTouches,$=L.length,H,X,P,z;for(sc(I),H=0;H<$;++H)X=L[H],P=Xo(X,this),j.touch0&&j.touch0[2]===X.identifier?j.touch0[0]=P:j.touch1&&j.touch1[2]===X.identifier&&(j.touch1[0]=P);if(X=j.that.__zoom,j.touch1){var V=j.touch0[0],q=j.touch0[1],J=j.touch1[0],oe=j.touch1[1],K=(K=J[0]-V[0])*K+(K=J[1]-V[1])*K,ee=(ee=oe[0]-q[0])*ee+(ee=oe[1]-q[1])*ee;X=R(X,Math.sqrt(K/ee)),P=[(V[0]+J[0])/2,(V[1]+J[1])/2],z=[(q[0]+oe[0])/2,(q[1]+oe[1])/2]}else if(j.touch0)P=j.touch0[0],z=j.touch0[1];else return;j.zoom("touch",n(E(X,P,z),j.extent,l))}}function Z(I,...G){if(this.__zooming){var j=T(this,G).event(I),L=I.changedTouches,$=L.length,H,X;for(Qg(I),p&&clearTimeout(p),p=setTimeout(function(){p=null},v),H=0;H<$;++H)X=L[H],j.touch0&&j.touch0[2]===X.identifier?delete j.touch0:j.touch1&&j.touch1[2]===X.identifier&&delete j.touch1;if(j.touch1&&!j.touch0&&(j.touch0=j.touch1,delete j.touch1),j.touch0)j.touch0[1]=this.__zoom.invert(j.touch0[0]);else if(j.end(),j.taps===2&&(X=Xo(X,this),Math.hypot(m[0]-X[0],m[1]-X[1])<w)){var P=So(this).on("dblclick.zoom");P&&P.apply(this,arguments)}}}return M.wheelDelta=function(I){return arguments.length?(o=typeof I=="function"?I:Pd(+I),M):o},M.filter=function(I){return arguments.length?(t=typeof I=="function"?I:Pd(!!I),M):t},M.touchable=function(I){return arguments.length?(a=typeof I=="function"?I:Pd(!!I),M):a},M.extent=function(I){return arguments.length?(e=typeof I=="function"?I:Pd([[+I[0][0],+I[0][1]],[+I[1][0],+I[1][1]]]),M):e},M.scaleExtent=function(I){return arguments.length?(i[0]=+I[0],i[1]=+I[1],M):[i[0],i[1]]},M.translateExtent=function(I){return arguments.length?(l[0][0]=+I[0][0],l[1][0]=+I[1][0],l[0][1]=+I[0][1],l[1][1]=+I[1][1],M):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},M.constrain=function(I){return arguments.length?(n=I,M):n},M.duration=function(I){return arguments.length?(u=+I,M):u},M.interpolate=function(I){return arguments.length?(d=I,M):d},M.on=function(){var I=f.on.apply(f,arguments);return I===f?M:I},M.clickDistance=function(I){return arguments.length?(C=(I=+I)*I,M):Math.sqrt(C)},M.tapDistance=function(I){return arguments.length?(w=+I,M):w},M}const Cr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${t} handle id: "${t==="source"?n:o}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Ac=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],FM=["Enter"," ","Escape"],UM={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:e,y:n})=>`Moved selected node ${t}. New position, x: ${e}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Ui;(function(t){t.Strict="strict",t.Loose="loose"})(Ui||(Ui={}));var Ds;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(Ds||(Ds={}));var jc;(function(t){t.Partial="partial",t.Full="full"})(jc||(jc={}));const YM={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Va;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(Va||(Va={}));var wf;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(wf||(wf={}));var qe;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(qe||(qe={}));const aS={[qe.Left]:qe.Right,[qe.Right]:qe.Left,[qe.Top]:qe.Bottom,[qe.Bottom]:qe.Top};function GM(t){return t===null?null:t?"valid":"invalid"}const qM=t=>"id"in t&&"source"in t&&"target"in t,r9=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),_y=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),nu=(t,e=[0,0])=>{const{width:n,height:o}=da(t),a=t.origin??e,i=n*a[0],l=o*a[1];return{x:t.position.x-i,y:t.position.y-l}},a9=(t,e={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const n=t.reduce((o,a)=>{const i=typeof a=="string";let l=!e.nodeLookup&&!i?a:void 0;e.nodeLookup&&(l=i?e.nodeLookup.get(a):_y(a)?a:e.nodeLookup.get(a.id));const u=l?Sf(l,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return sh(o,u)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return ih(n)},ou=(t,e={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},o=!1;return t.forEach(a=>{(e.filter===void 0||e.filter(a))&&(n=sh(n,Sf(a)),o=!0)}),o?ih(n):{x:0,y:0,width:0,height:0}},My=(t,e,[n,o,a]=[0,0,1],i=!1,l=!1)=>{const u={...au(e,[n,o,a]),width:e.width/a,height:e.height/a},d=[];for(const f of t.values()){const{measured:g,selectable:m=!0,hidden:p=!1}=f;if(l&&!m||p)continue;const v=g.width??f.width??f.initialWidth??null,S=g.height??f.height??f.initialHeight??null,C=zc(u,Gi(f)),w=(v??0)*(S??0),M=i&&C>0;(!f.internals.handleBounds||M||C>=w||f.dragging)&&d.push(f)}return d},s9=(t,e)=>{const n=new Set;return t.forEach(o=>{n.add(o.id)}),e.filter(o=>n.has(o.source)||n.has(o.target))};function i9(t,e){const n=new Map,o=e?.nodes?new Set(e.nodes.map(a=>a.id)):null;return t.forEach(a=>{a.measured.width&&a.measured.height&&(e?.includeHiddenNodes||!a.hidden)&&(!o||o.has(a.id))&&n.set(a.id,a)}),n}async function l9({nodes:t,width:e,height:n,panZoom:o,minZoom:a,maxZoom:i},l){if(t.size===0)return Promise.resolve(!0);const u=i9(t,l),d=ou(u),f=Ny(d,e,n,l?.minZoom??a,l?.maxZoom??i,l?.padding??.1);return await o.setViewport(f,{duration:l?.duration,ease:l?.ease,interpolate:l?.interpolate}),Promise.resolve(!0)}function WM({nodeId:t,nextPosition:e,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:a,onError:i}){const l=n.get(t),u=l.parentId?n.get(l.parentId):void 0,{x:d,y:f}=u?u.internals.positionAbsolute:{x:0,y:0},g=l.origin??o;let m=l.extent||a;if(l.extent==="parent"&&!l.expandParent)if(!u)i?.("005",Cr.error005());else{const v=u.measured.width,S=u.measured.height;v&&S&&(m=[[d,f],[d+v,f+S]])}else u&&qi(l.extent)&&(m=[[l.extent[0][0]+d,l.extent[0][1]+f],[l.extent[1][0]+d,l.extent[1][1]+f]]);const p=qi(m)?Is(e,m,l.measured):e;return(l.measured.width===void 0||l.measured.height===void 0)&&i?.("015",Cr.error015()),{position:{x:p.x-d+(l.measured.width??0)*g[0],y:p.y-f+(l.measured.height??0)*g[1]},positionAbsolute:p}}async function c9({nodesToRemove:t=[],edgesToRemove:e=[],nodes:n,edges:o,onBeforeDelete:a}){const i=new Set(t.map(p=>p.id)),l=[];for(const p of n){if(p.deletable===!1)continue;const v=i.has(p.id),S=!v&&p.parentId&&l.find(C=>C.id===p.parentId);(v||S)&&l.push(p)}const u=new Set(e.map(p=>p.id)),d=o.filter(p=>p.deletable!==!1),g=s9(l,d);for(const p of d)u.has(p.id)&&!g.find(S=>S.id===p.id)&&g.push(p);if(!a)return{edges:g,nodes:l};const m=await a({nodes:l,edges:g});return typeof m=="boolean"?m?{edges:g,nodes:l}:{edges:[],nodes:[]}:m}const Yi=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),Is=(t={x:0,y:0},e,n)=>({x:Yi(t.x,e[0][0],e[1][0]-(n?.width??0)),y:Yi(t.y,e[0][1],e[1][1]-(n?.height??0))});function KM(t,e,n){const{width:o,height:a}=da(n),{x:i,y:l}=n.internals.positionAbsolute;return Is(t,[[i,l],[i+o,l+a]],e)}const sS=(t,e,n)=>t<e?Yi(Math.abs(t-e),1,e)/e:t>n?-Yi(Math.abs(t-n),1,e)/e:0,XM=(t,e,n=15,o=40)=>{const a=sS(t.x,o,e.width-o)*n,i=sS(t.y,o,e.height-o)*n;return[a,i]},sh=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),Zp=({x:t,y:e,width:n,height:o})=>({x:t,y:e,x2:t+n,y2:e+o}),ih=({x:t,y:e,x2:n,y2:o})=>({x:t,y:e,width:n-t,height:o-e}),Gi=(t,e=[0,0])=>{const{x:n,y:o}=_y(t)?t.internals.positionAbsolute:nu(t,e);return{x:n,y:o,width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}},Sf=(t,e=[0,0])=>{const{x:n,y:o}=_y(t)?t.internals.positionAbsolute:nu(t,e);return{x:n,y:o,x2:n+(t.measured?.width??t.width??t.initialWidth??0),y2:o+(t.measured?.height??t.height??t.initialHeight??0)}},ZM=(t,e)=>ih(sh(Zp(t),Zp(e))),zc=(t,e)=>{const n=Math.max(0,Math.min(t.x+t.width,e.x+e.width)-Math.max(t.x,e.x)),o=Math.max(0,Math.min(t.y+t.height,e.y+e.height)-Math.max(t.y,e.y));return Math.ceil(n*o)},iS=t=>Qo(t.width)&&Qo(t.height)&&Qo(t.x)&&Qo(t.y),Qo=t=>!isNaN(t)&&isFinite(t),u9=(t,e)=>{},ru=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),au=({x:t,y:e},[n,o,a],i=!1,l=[1,1])=>{const u={x:(t-n)/a,y:(e-o)/a};return i?ru(u,l):u},Cf=({x:t,y:e},[n,o,a])=>({x:t*a+n,y:e*a+o});function Ci(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(n)}if(typeof t=="string"&&t.endsWith("%")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return console.error(`[React Flow] The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function d9(t,e,n){if(typeof t=="string"||typeof t=="number"){const o=Ci(t,n),a=Ci(t,e);return{top:o,right:a,bottom:o,left:a,x:a*2,y:o*2}}if(typeof t=="object"){const o=Ci(t.top??t.y??0,n),a=Ci(t.bottom??t.y??0,n),i=Ci(t.left??t.x??0,e),l=Ci(t.right??t.x??0,e);return{top:o,right:l,bottom:a,left:i,x:i+l,y:o+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function f9(t,e,n,o,a,i){const{x:l,y:u}=Cf(t,[e,n,o]),{x:d,y:f}=Cf({x:t.x+t.width,y:t.y+t.height},[e,n,o]),g=a-d,m=i-f;return{left:Math.floor(l),top:Math.floor(u),right:Math.floor(g),bottom:Math.floor(m)}}const Ny=(t,e,n,o,a,i)=>{const l=d9(i,e,n),u=(e-l.x)/t.width,d=(n-l.y)/t.height,f=Math.min(u,d),g=Yi(f,o,a),m=t.x+t.width/2,p=t.y+t.height/2,v=e/2-m*g,S=n/2-p*g,C=f9(t,v,S,g,e,n),w={left:Math.min(C.left-l.left,0),top:Math.min(C.top-l.top,0),right:Math.min(C.right-l.right,0),bottom:Math.min(C.bottom-l.bottom,0)};return{x:v-w.left+w.right,y:S-w.top+w.bottom,zoom:g}},Ic=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function qi(t){return t!=null&&t!=="parent"}function da(t){return{width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}}function Ry(t){return(t.measured?.width??t.width??t.initialWidth)!==void 0&&(t.measured?.height??t.height??t.initialHeight)!==void 0}function QM(t,e={width:0,height:0},n,o,a){const i={...t},l=o.get(n);if(l){const u=l.origin||a;i.x+=l.internals.positionAbsolute.x-(e.width??0)*u[0],i.y+=l.internals.positionAbsolute.y-(e.height??0)*u[1]}return i}function lS(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function h9(){let t,e;return{promise:new Promise((o,a)=>{t=o,e=a}),resolve:t,reject:e}}function m9(t){return{...UM,...t||{}}}function bc(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:o,containerBounds:a}){const{x:i,y:l}=Jo(t),u=au({x:i-(a?.left??0),y:l-(a?.top??0)},o),{x:d,y:f}=n?ru(u,e):u;return{xSnapped:d,ySnapped:f,...u}}const Dy=t=>({width:t.offsetWidth,height:t.offsetHeight}),JM=t=>t?.getRootNode?.()||window?.document,g9=["INPUT","SELECT","TEXTAREA"];function eN(t){const e=t.composedPath?.()?.[0]||t.target;return e?.nodeType!==1?!1:g9.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const tN=t=>"clientX"in t,Jo=(t,e)=>{const n=tN(t),o=n?t.clientX:t.touches?.[0].clientX,a=n?t.clientY:t.touches?.[0].clientY;return{x:o-(e?.left??0),y:a-(e?.top??0)}},cS=(t,e,n,o,a)=>{const i=e.querySelectorAll(`.${t}`);return!i||!i.length?null:Array.from(i).map(l=>{const u=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:t,nodeId:a,position:l.getAttribute("data-handlepos"),x:(u.left-n.left)/o,y:(u.top-n.top)/o,...Dy(l)}})};function nN({sourceX:t,sourceY:e,targetX:n,targetY:o,sourceControlX:a,sourceControlY:i,targetControlX:l,targetControlY:u}){const d=t*.125+a*.375+l*.375+n*.125,f=e*.125+i*.375+u*.375+o*.125,g=Math.abs(d-t),m=Math.abs(f-e);return[d,f,g,m]}function $d(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function uS({pos:t,x1:e,y1:n,x2:o,y2:a,c:i}){switch(t){case qe.Left:return[e-$d(e-o,i),n];case qe.Right:return[e+$d(o-e,i),n];case qe.Top:return[e,n-$d(n-a,i)];case qe.Bottom:return[e,n+$d(a-n,i)]}}function oN({sourceX:t,sourceY:e,sourcePosition:n=qe.Bottom,targetX:o,targetY:a,targetPosition:i=qe.Top,curvature:l=.25}){const[u,d]=uS({pos:n,x1:t,y1:e,x2:o,y2:a,c:l}),[f,g]=uS({pos:i,x1:o,y1:a,x2:t,y2:e,c:l}),[m,p,v,S]=nN({sourceX:t,sourceY:e,targetX:o,targetY:a,sourceControlX:u,sourceControlY:d,targetControlX:f,targetControlY:g});return[`M${t},${e} C${u},${d} ${f},${g} ${o},${a}`,m,p,v,S]}function rN({sourceX:t,sourceY:e,targetX:n,targetY:o}){const a=Math.abs(n-t)/2,i=n<t?n+a:n-a,l=Math.abs(o-e)/2,u=o<e?o+l:o-l;return[i,u,a,l]}function p9({sourceNode:t,targetNode:e,selected:n=!1,zIndex:o=0,elevateOnSelect:a=!1,zIndexMode:i="basic"}){if(i==="manual")return o;const l=a&&n?o+1e3:o,u=Math.max(t.parentId||a&&t.selected?t.internals.z:0,e.parentId||a&&e.selected?e.internals.z:0);return l+u}function y9({sourceNode:t,targetNode:e,width:n,height:o,transform:a}){const i=sh(Sf(t),Sf(e));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const l={x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:o/a[2]};return zc(l,ih(i))>0}const v9=({source:t,sourceHandle:e,target:n,targetHandle:o})=>`xy-edge__${t}${e||""}-${n}${o||""}`,x9=(t,e)=>e.some(n=>n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle)),b9=(t,e,n={})=>{if(!t.source||!t.target)return e;const o=n.getEdgeId||v9;let a;return qM(t)?a={...t}:a={...t,id:o(t)},x9(a,e)?e:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,e.concat(a))};function aN({sourceX:t,sourceY:e,targetX:n,targetY:o}){const[a,i,l,u]=rN({sourceX:t,sourceY:e,targetX:n,targetY:o});return[`M ${t},${e}L ${n},${o}`,a,i,l,u]}const dS={[qe.Left]:{x:-1,y:0},[qe.Right]:{x:1,y:0},[qe.Top]:{x:0,y:-1},[qe.Bottom]:{x:0,y:1}},w9=({source:t,sourcePosition:e=qe.Bottom,target:n})=>e===qe.Left||e===qe.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1},fS=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function S9({source:t,sourcePosition:e=qe.Bottom,target:n,targetPosition:o=qe.Top,center:a,offset:i,stepPosition:l}){const u=dS[e],d=dS[o],f={x:t.x+u.x*i,y:t.y+u.y*i},g={x:n.x+d.x*i,y:n.y+d.y*i},m=w9({source:f,sourcePosition:e,target:g}),p=m.x!==0?"x":"y",v=m[p];let S=[],C,w;const M={x:0,y:0},R={x:0,y:0},[,,E,N]=rN({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(u[p]*d[p]===-1){p==="x"?(C=a.x??f.x+(g.x-f.x)*l,w=a.y??(f.y+g.y)/2):(C=a.x??(f.x+g.x)/2,w=a.y??f.y+(g.y-f.y)*l);const T=[{x:C,y:f.y},{x:C,y:g.y}],k=[{x:f.x,y:w},{x:g.x,y:w}];u[p]===v?S=p==="x"?T:k:S=p==="x"?k:T}else{const T=[{x:f.x,y:g.y}],k=[{x:g.x,y:f.y}];if(p==="x"?S=u.x===v?k:T:S=u.y===v?T:k,e===o){const Y=Math.abs(t[p]-n[p]);if(Y<=i){const Z=Math.min(i-1,i-Y);u[p]===v?M[p]=(f[p]>t[p]?-1:1)*Z:R[p]=(g[p]>n[p]?-1:1)*Z}}if(e!==o){const Y=p==="x"?"y":"x",Z=u[p]===d[Y],I=f[Y]>g[Y],G=f[Y]<g[Y];(u[p]===1&&(!Z&&I||Z&&G)||u[p]!==1&&(!Z&&G||Z&&I))&&(S=p==="x"?T:k)}const A={x:f.x+M.x,y:f.y+M.y},B={x:g.x+R.x,y:g.y+R.y},W=Math.max(Math.abs(A.x-S[0].x),Math.abs(B.x-S[0].x)),U=Math.max(Math.abs(A.y-S[0].y),Math.abs(B.y-S[0].y));W>=U?(C=(A.x+B.x)/2,w=S[0].y):(C=S[0].x,w=(A.y+B.y)/2)}return[[t,{x:f.x+M.x,y:f.y+M.y},...S,{x:g.x+R.x,y:g.y+R.y},n],C,w,E,N]}function C9(t,e,n,o){const a=Math.min(fS(t,e)/2,fS(e,n)/2,o),{x:i,y:l}=e;if(t.x===i&&i===n.x||t.y===l&&l===n.y)return`L${i} ${l}`;if(t.y===l){const f=t.x<n.x?-1:1,g=t.y<n.y?1:-1;return`L ${i+a*f},${l}Q ${i},${l} ${i},${l+a*g}`}const u=t.x<n.x?1:-1,d=t.y<n.y?-1:1;return`L ${i},${l+a*d}Q ${i},${l} ${i+a*u},${l}`}function Qp({sourceX:t,sourceY:e,sourcePosition:n=qe.Bottom,targetX:o,targetY:a,targetPosition:i=qe.Top,borderRadius:l=5,centerX:u,centerY:d,offset:f=20,stepPosition:g=.5}){const[m,p,v,S,C]=S9({source:{x:t,y:e},sourcePosition:n,target:{x:o,y:a},targetPosition:i,center:{x:u,y:d},offset:f,stepPosition:g});return[m.reduce((M,R,E)=>{let N="";return E>0&&E<m.length-1?N=C9(m[E-1],R,m[E+1],l):N=`${E===0?"M":"L"}${R.x} ${R.y}`,M+=N,M},""),p,v,S,C]}function hS(t){return t&&!!(t.internals.handleBounds||t.handles?.length)&&!!(t.measured.width||t.width||t.initialWidth)}function E9(t){const{sourceNode:e,targetNode:n}=t;if(!hS(e)||!hS(n))return null;const o=e.internals.handleBounds||mS(e.handles),a=n.internals.handleBounds||mS(n.handles),i=gS(o?.source??[],t.sourceHandle),l=gS(t.connectionMode===Ui.Strict?a?.target??[]:(a?.target??[]).concat(a?.source??[]),t.targetHandle);if(!i||!l)return t.onError?.("008",Cr.error008(i?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const u=i?.position||qe.Bottom,d=l?.position||qe.Top,f=Ps(e,i,u),g=Ps(n,l,d);return{sourceX:f.x,sourceY:f.y,targetX:g.x,targetY:g.y,sourcePosition:u,targetPosition:d}}function mS(t){if(!t)return null;const e=[],n=[];for(const o of t)o.width=o.width??1,o.height=o.height??1,o.type==="source"?e.push(o):o.type==="target"&&n.push(o);return{source:e,target:n}}function Ps(t,e,n=qe.Left,o=!1){const a=(e?.x??0)+t.internals.positionAbsolute.x,i=(e?.y??0)+t.internals.positionAbsolute.y,{width:l,height:u}=e??da(t);if(o)return{x:a+l/2,y:i+u/2};switch(e?.position??n){case qe.Top:return{x:a+l/2,y:i};case qe.Right:return{x:a+l,y:i+u/2};case qe.Bottom:return{x:a+l/2,y:i+u};case qe.Left:return{x:a,y:i+u/2}}}function gS(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}function Jp(t,e){return t?typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(o=>`${o}=${t[o]}`).join("&")}`:""}function _9(t,{id:e,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:a}){const i=new Set;return t.reduce((l,u)=>([u.markerStart||o,u.markerEnd||a].forEach(d=>{if(d&&typeof d=="object"){const f=Jp(d,e);i.has(f)||(l.push({id:f,color:d.color||n,...d}),i.add(f))}}),l),[]).sort((l,u)=>l.id.localeCompare(u.id))}const sN=1e3,M9=10,Ty={nodeOrigin:[0,0],nodeExtent:Ac,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},N9={...Ty,checkEquality:!0};function ky(t,e){const n={...t};for(const o in e)e[o]!==void 0&&(n[o]=e[o]);return n}function R9(t,e,n){const o=ky(Ty,n);for(const a of t.values())if(a.parentId)Ay(a,t,e,o);else{const i=nu(a,o.nodeOrigin),l=qi(a.extent)?a.extent:o.nodeExtent,u=Is(i,l,da(a));a.internals.positionAbsolute=u}}function D9(t,e){if(!t.handles)return t.measured?e?.internals.handleBounds:void 0;const n=[],o=[];for(const a of t.handles){const i={id:a.id,width:a.width??1,height:a.height??1,nodeId:t.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(i):a.type==="target"&&o.push(i)}return{source:n,target:o}}function Oy(t){return t==="manual"}function e0(t,e,n,o={}){const a=ky(N9,o),i={i:0},l=new Map(e),u=a?.elevateNodesOnSelect&&!Oy(a.zIndexMode)?sN:0;let d=t.length>0;e.clear(),n.clear();for(const f of t){let g=l.get(f.id);if(a.checkEquality&&f===g?.internals.userNode)e.set(f.id,g);else{const m=nu(f,a.nodeOrigin),p=qi(f.extent)?f.extent:a.nodeExtent,v=Is(m,p,da(f));g={...a.defaults,...f,measured:{width:f.measured?.width,height:f.measured?.height},internals:{positionAbsolute:v,handleBounds:D9(f,g),z:iN(f,u,a.zIndexMode),userNode:f}},e.set(f.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(d=!1),f.parentId&&Ay(g,e,n,o,i)}return d}function T9(t,e){if(!t.parentId)return;const n=e.get(t.parentId);n?n.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]]))}function Ay(t,e,n,o,a){const{elevateNodesOnSelect:i,nodeOrigin:l,nodeExtent:u,zIndexMode:d}=ky(Ty,o),f=t.parentId,g=e.get(f);if(!g){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}T9(t,n),a&&!g.parentId&&g.internals.rootParentIndex===void 0&&d==="auto"&&(g.internals.rootParentIndex=++a.i,g.internals.z=g.internals.z+a.i*M9),a&&g.internals.rootParentIndex!==void 0&&(a.i=g.internals.rootParentIndex);const m=i&&!Oy(d)?sN:0,{x:p,y:v,z:S}=k9(t,g,l,u,m,d),{positionAbsolute:C}=t.internals,w=p!==C.x||v!==C.y;(w||S!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:w?{x:p,y:v}:C,z:S}})}function iN(t,e,n){const o=Qo(t.zIndex)?t.zIndex:0;return Oy(n)?o:o+(t.selected?e:0)}function k9(t,e,n,o,a,i){const{x:l,y:u}=e.internals.positionAbsolute,d=da(t),f=nu(t,n),g=qi(t.extent)?Is(f,t.extent,d):f;let m=Is({x:l+g.x,y:u+g.y},o,d);t.extent==="parent"&&(m=KM(m,d,e));const p=iN(t,a,i),v=e.internals.z??0;return{x:m.x,y:m.y,z:v>=p?v+1:p}}function jy(t,e,n,o=[0,0]){const a=[],i=new Map;for(const l of t){const u=e.get(l.parentId);if(!u)continue;const d=i.get(l.parentId)?.expandedRect??Gi(u),f=ZM(d,l.rect);i.set(l.parentId,{expandedRect:f,parent:u})}return i.size>0&&i.forEach(({expandedRect:l,parent:u},d)=>{const f=u.internals.positionAbsolute,g=da(u),m=u.origin??o,p=l.x<f.x?Math.round(Math.abs(f.x-l.x)):0,v=l.y<f.y?Math.round(Math.abs(f.y-l.y)):0,S=Math.max(g.width,Math.round(l.width)),C=Math.max(g.height,Math.round(l.height)),w=(S-g.width)*m[0],M=(C-g.height)*m[1];(p>0||v>0||w||M)&&(a.push({id:d,type:"position",position:{x:u.position.x-p+w,y:u.position.y-v+M}}),n.get(d)?.forEach(R=>{t.some(E=>E.id===R.id)||a.push({id:R.id,type:"position",position:{x:R.position.x+p,y:R.position.y+v}})})),(g.width<l.width||g.height<l.height||p||v)&&a.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:S+(p?m[0]*p-w:0),height:C+(v?m[1]*v-M:0)}})}),a}function O9(t,e,n,o,a,i,l){const u=o?.querySelector(".xyflow__viewport");let d=!1;if(!u)return{changes:[],updatedInternals:d};const f=[],g=window.getComputedStyle(u),{m22:m}=new window.DOMMatrixReadOnly(g.transform),p=[];for(const v of t.values()){const S=e.get(v.id);if(!S)continue;if(S.hidden){e.set(S.id,{...S,internals:{...S.internals,handleBounds:void 0}}),d=!0;continue}const C=Dy(v.nodeElement),w=S.measured.width!==C.width||S.measured.height!==C.height;if(!!(C.width&&C.height&&(w||!S.internals.handleBounds||v.force))){const R=v.nodeElement.getBoundingClientRect(),E=qi(S.extent)?S.extent:i;let{positionAbsolute:N}=S.internals;S.parentId&&S.extent==="parent"?N=KM(N,C,e.get(S.parentId)):E&&(N=Is(N,E,C));const D={...S,measured:C,internals:{...S.internals,positionAbsolute:N,handleBounds:{source:cS("source",v.nodeElement,R,m,S.id),target:cS("target",v.nodeElement,R,m,S.id)}}};e.set(S.id,D),S.parentId&&Ay(D,e,n,{nodeOrigin:a,zIndexMode:l}),d=!0,w&&(f.push({id:S.id,type:"dimensions",dimensions:C}),S.expandParent&&S.parentId&&p.push({id:S.id,parentId:S.parentId,rect:Gi(D,a)}))}}if(p.length>0){const v=jy(p,e,n,a);f.push(...v)}return{changes:f,updatedInternals:d}}async function A9({delta:t,panZoom:e,transform:n,translateExtent:o,width:a,height:i}){if(!e||!t.x&&!t.y)return Promise.resolve(!1);const l=await e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[a,i]],o),u=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(u)}function pS(t,e,n,o,a,i){let l=a;const u=o.get(l)||new Map;o.set(l,u.set(n,e)),l=`${a}-${t}`;const d=o.get(l)||new Map;if(o.set(l,d.set(n,e)),i){l=`${a}-${t}-${i}`;const f=o.get(l)||new Map;o.set(l,f.set(n,e))}}function lN(t,e,n){t.clear(),e.clear();for(const o of n){const{source:a,target:i,sourceHandle:l=null,targetHandle:u=null}=o,d={edgeId:o.id,source:a,target:i,sourceHandle:l,targetHandle:u},f=`${a}-${l}--${i}-${u}`,g=`${i}-${u}--${a}-${l}`;pS("source",d,g,t,a,l),pS("target",d,f,t,i,u),e.set(o.id,o)}}function cN(t,e){if(!t.parentId)return!1;const n=e.get(t.parentId);return n?n.selected?!0:cN(n,e):!1}function yS(t,e,n){let o=t;do{if(o?.matches?.(e))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function j9(t,e,n,o){const a=new Map;for(const[i,l]of t)if((l.selected||l.id===o)&&(!l.parentId||!cN(l,t))&&(l.draggable||e&&typeof l.draggable>"u")){const u=t.get(i);u&&a.set(i,{id:i,position:u.position||{x:0,y:0},distance:{x:n.x-u.internals.positionAbsolute.x,y:n.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 Jg({nodeId:t,dragItems:e,nodeLookup:n,dragging:o=!0}){const a=[];for(const[l,u]of e){const d=n.get(l)?.internals.userNode;d&&a.push({...d,position:u.position,dragging:o})}if(!t)return[a[0],a];const i=n.get(t)?.internals.userNode;return[i?{...i,position:e.get(t)?.position||i.position,dragging:o}:a[0],a]}function z9({dragItems:t,snapGrid:e,x:n,y:o}){const a=t.values().next().value;if(!a)return null;const i={x:n-a.distance.x,y:o-a.distance.y},l=ru(i,e);return{x:l.x-i.x,y:l.y-i.y}}function I9({onNodeMouseDown:t,getStoreItems:e,onDragStart:n,onDrag:o,onDragStop:a}){let i={x:null,y:null},l=0,u=new Map,d=!1,f={x:0,y:0},g=null,m=!1,p=null,v=!1,S=!1,C=null;function w({noDragClassName:R,handleSelector:E,domNode:N,isSelectable:D,nodeId:T,nodeClickDistance:k=0}){p=So(N);function A({x:Y,y:Z}){const{nodeLookup:I,nodeExtent:G,snapGrid:j,snapToGrid:L,nodeOrigin:$,onNodeDrag:H,onSelectionDrag:X,onError:P,updateNodePositions:z}=e();i={x:Y,y:Z};let V=!1;const q=u.size>1,J=q&&G?Zp(ou(u)):null,oe=q&&L?z9({dragItems:u,snapGrid:j,x:Y,y:Z}):null;for(const[K,ee]of u){if(!I.has(K))continue;let ae={x:Y-ee.distance.x,y:Z-ee.distance.y};L&&(ae=oe?{x:Math.round(ae.x+oe.x),y:Math.round(ae.y+oe.y)}:ru(ae,j));let ce=null;if(q&&G&&!ee.extent&&J){const{positionAbsolute:ve}=ee.internals,De=ve.x-J.x+G[0][0],Be=ve.x+ee.measured.width-J.x2+G[1][0],Ie=ve.y-J.y+G[0][1],lt=ve.y+ee.measured.height-J.y2+G[1][1];ce=[[De,Ie],[Be,lt]]}const{position:ge,positionAbsolute:se}=WM({nodeId:K,nextPosition:ae,nodeLookup:I,nodeExtent:ce||G,nodeOrigin:$,onError:P});V=V||ee.position.x!==ge.x||ee.position.y!==ge.y,ee.position=ge,ee.internals.positionAbsolute=se}if(S=S||V,!!V&&(z(u,!0),C&&(o||H||!T&&X))){const[K,ee]=Jg({nodeId:T,dragItems:u,nodeLookup:I});o?.(C,u,K,ee),H?.(C,K,ee),T||X?.(C,ee)}}async function B(){if(!g)return;const{transform:Y,panBy:Z,autoPanSpeed:I,autoPanOnNodeDrag:G}=e();if(!G){d=!1,cancelAnimationFrame(l);return}const[j,L]=XM(f,g,I);(j!==0||L!==0)&&(i.x=(i.x??0)-j/Y[2],i.y=(i.y??0)-L/Y[2],await Z({x:j,y:L})&&A(i)),l=requestAnimationFrame(B)}function W(Y){const{nodeLookup:Z,multiSelectionActive:I,nodesDraggable:G,transform:j,snapGrid:L,snapToGrid:$,selectNodesOnDrag:H,onNodeDragStart:X,onSelectionDragStart:P,unselectNodesAndEdges:z}=e();m=!0,(!H||!D)&&!I&&T&&(Z.get(T)?.selected||z()),D&&H&&T&&t?.(T);const V=bc(Y.sourceEvent,{transform:j,snapGrid:L,snapToGrid:$,containerBounds:g});if(i=V,u=j9(Z,G,V,T),u.size>0&&(n||X||!T&&P)){const[q,J]=Jg({nodeId:T,dragItems:u,nodeLookup:Z});n?.(Y.sourceEvent,u,q,J),X?.(Y.sourceEvent,q,J),T||P?.(Y.sourceEvent,J)}}const U=NM().clickDistance(k).on("start",Y=>{const{domNode:Z,nodeDragThreshold:I,transform:G,snapGrid:j,snapToGrid:L}=e();g=Z?.getBoundingClientRect()||null,v=!1,S=!1,C=Y.sourceEvent,I===0&&W(Y),i=bc(Y.sourceEvent,{transform:G,snapGrid:j,snapToGrid:L,containerBounds:g}),f=Jo(Y.sourceEvent,g)}).on("drag",Y=>{const{autoPanOnNodeDrag:Z,transform:I,snapGrid:G,snapToGrid:j,nodeDragThreshold:L,nodeLookup:$}=e(),H=bc(Y.sourceEvent,{transform:I,snapGrid:G,snapToGrid:j,containerBounds:g});if(C=Y.sourceEvent,(Y.sourceEvent.type==="touchmove"&&Y.sourceEvent.touches.length>1||T&&!$.has(T))&&(v=!0),!v){if(!d&&Z&&m&&(d=!0,B()),!m){const X=Jo(Y.sourceEvent,g),P=X.x-f.x,z=X.y-f.y;Math.sqrt(P*P+z*z)>L&&W(Y)}(i.x!==H.xSnapped||i.y!==H.ySnapped)&&u&&m&&(f=Jo(Y.sourceEvent,g),A(H))}}).on("end",Y=>{if(!(!m||v)&&(d=!1,m=!1,cancelAnimationFrame(l),u.size>0)){const{nodeLookup:Z,updateNodePositions:I,onNodeDragStop:G,onSelectionDragStop:j}=e();if(S&&(I(u,!1),S=!1),a||G||!T&&j){const[L,$]=Jg({nodeId:T,dragItems:u,nodeLookup:Z,dragging:!1});a?.(Y.sourceEvent,u,L,$),G?.(Y.sourceEvent,L,$),T||j?.(Y.sourceEvent,$)}}}).filter(Y=>{const Z=Y.target;return!Y.button&&(!R||!yS(Z,`.${R}`,N))&&(!E||yS(Z,E,N))});p.call(U)}function M(){p?.on(".drag",null)}return{update:w,destroy:M}}function P9(t,e,n){const o=[],a={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(const i of e.values())zc(a,Gi(i))>0&&o.push(i);return o}const $9=250;function L9(t,e,n,o){let a=[],i=1/0;const l=P9(t,n,e+$9);for(const u of l){const d=[...u.internals.handleBounds?.source??[],...u.internals.handleBounds?.target??[]];for(const f of d){if(o.nodeId===f.nodeId&&o.type===f.type&&o.id===f.id)continue;const{x:g,y:m}=Ps(u,f,f.position,!0),p=Math.sqrt(Math.pow(g-t.x,2)+Math.pow(m-t.y,2));p>e||(p<i?(a=[{...f,x:g,y:m}],i=p):p===i&&a.push({...f,x:g,y:m}))}}if(!a.length)return null;if(a.length>1){const u=o.type==="source"?"target":"source";return a.find(d=>d.type===u)??a[0]}return a[0]}function uN(t,e,n,o,a,i=!1){const l=o.get(t);if(!l)return null;const u=a==="strict"?l.internals.handleBounds?.[e]:[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]],d=(n?u?.find(f=>f.id===n):u?.[0])??null;return d&&i?{...d,...Ps(l,d,d.position,!0)}:d}function dN(t,e){return t||(e?.classList.contains("target")?"target":e?.classList.contains("source")?"source":null)}function H9(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}const fN=()=>!0;function B9(t,{connectionMode:e,connectionRadius:n,handleId:o,nodeId:a,edgeUpdaterType:i,isTarget:l,domNode:u,nodeLookup:d,lib:f,autoPanOnConnect:g,flowId:m,panBy:p,cancelConnection:v,onConnectStart:S,onConnect:C,onConnectEnd:w,isValidConnection:M=fN,onReconnectEnd:R,updateConnection:E,getTransform:N,getFromHandle:D,autoPanSpeed:T,dragThreshold:k=1,handleDomNode:A}){const B=JM(t.target);let W=0,U;const{x:Y,y:Z}=Jo(t),I=dN(i,A),G=u?.getBoundingClientRect();let j=!1;if(!G||!I)return;const L=uN(a,I,o,d,e);if(!L)return;let $=Jo(t,G),H=!1,X=null,P=!1,z=null;function V(){if(!g||!G)return;const[ge,se]=XM($,G,T);p({x:ge,y:se}),W=requestAnimationFrame(V)}const q={...L,nodeId:a,type:I,position:L.position},J=d.get(a);let K={inProgress:!0,isValid:null,from:Ps(J,q,qe.Left,!0),fromHandle:q,fromPosition:q.position,fromNode:J,to:$,toHandle:null,toPosition:aS[q.position],toNode:null,pointer:$};function ee(){j=!0,E(K),S?.(t,{nodeId:a,handleId:o,handleType:I})}k===0&&ee();function ae(ge){if(!j){const{x:lt,y:ln}=Jo(ge),ht=lt-Y,bn=ln-Z;if(!(ht*ht+bn*bn>k*k))return;ee()}if(!D()||!q){ce(ge);return}const se=N();$=Jo(ge,G),U=L9(au($,se,!1,[1,1]),n,d,q),H||(V(),H=!0);const ve=hN(ge,{handle:U,connectionMode:e,fromNodeId:a,fromHandleId:o,fromType:l?"target":"source",isValidConnection:M,doc:B,lib:f,flowId:m,nodeLookup:d});z=ve.handleDomNode,X=ve.connection,P=H9(!!U,ve.isValid);const De=d.get(a),Be=De?Ps(De,q,qe.Left,!0):K.from,Ie={...K,from:Be,isValid:P,to:ve.toHandle&&P?Cf({x:ve.toHandle.x,y:ve.toHandle.y},se):$,toHandle:ve.toHandle,toPosition:P&&ve.toHandle?ve.toHandle.position:aS[q.position],toNode:ve.toHandle?d.get(ve.toHandle.nodeId):null,pointer:$};E(Ie),K=Ie}function ce(ge){if(!("touches"in ge&&ge.touches.length>0)){if(j){(U||z)&&X&&P&&C?.(X);const{inProgress:se,...ve}=K,De={...ve,toPosition:K.toHandle?K.toPosition:null};w?.(ge,De),i&&R?.(ge,De)}v(),cancelAnimationFrame(W),H=!1,P=!1,X=null,z=null,B.removeEventListener("mousemove",ae),B.removeEventListener("mouseup",ce),B.removeEventListener("touchmove",ae),B.removeEventListener("touchend",ce)}}B.addEventListener("mousemove",ae),B.addEventListener("mouseup",ce),B.addEventListener("touchmove",ae),B.addEventListener("touchend",ce)}function hN(t,{handle:e,connectionMode:n,fromNodeId:o,fromHandleId:a,fromType:i,doc:l,lib:u,flowId:d,isValidConnection:f=fN,nodeLookup:g}){const m=i==="target",p=e?l.querySelector(`.${u}-flow__handle[data-id="${d}-${e?.nodeId}-${e?.id}-${e?.type}"]`):null,{x:v,y:S}=Jo(t),C=l.elementFromPoint(v,S),w=C?.classList.contains(`${u}-flow__handle`)?C:p,M={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const R=dN(void 0,w),E=w.getAttribute("data-nodeid"),N=w.getAttribute("data-handleid"),D=w.classList.contains("connectable"),T=w.classList.contains("connectableend");if(!E||!R)return M;const k={source:m?E:o,sourceHandle:m?N:a,target:m?o:E,targetHandle:m?a:N};M.connection=k;const B=D&&T&&(n===Ui.Strict?m&&R==="source"||!m&&R==="target":E!==o||N!==a);M.isValid=B&&f(k),M.toHandle=uN(E,R,N,g,n,!0)}return M}const t0={onPointerDown:B9,isValid:hN};function V9({domNode:t,panZoom:e,getTransform:n,getViewScale:o}){const a=So(t);function i({translateExtent:u,width:d,height:f,zoomStep:g=1,pannable:m=!0,zoomable:p=!0,inversePan:v=!1}){const S=E=>{if(E.sourceEvent.type!=="wheel"||!e)return;const N=n(),D=E.sourceEvent.ctrlKey&&Ic()?10:1,T=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*g,k=N[2]*Math.pow(2,T*D);e.scaleTo(k)};let C=[0,0];const w=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(C=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},M=E=>{const N=n();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!e)return;const D=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],T=[D[0]-C[0],D[1]-C[1]];C=D;const k=o()*Math.max(N[2],Math.log(N[2]))*(v?-1:1),A={x:N[0]-T[0]*k,y:N[1]-T[1]*k},B=[[0,0],[d,f]];e.setViewportConstrained({x:A.x,y:A.y,zoom:N[2]},B,u)},R=VM().on("start",w).on("zoom",m?M:null).on("zoom.wheel",p?S:null);a.call(R,{})}function l(){a.on("zoom",null)}return{update:i,destroy:l,pointer:Xo}}const lh=t=>({x:t.x,y:t.y,zoom:t.k}),ep=({x:t,y:e,zoom:n})=>ah.translate(t,e).scale(n),Oi=(t,e)=>t.target.closest(`.${e}`),mN=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),F9=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,tp=(t,e=0,n=F9,o=()=>{})=>{const a=typeof e=="number"&&e>0;return a||o(),a?t.transition().duration(e).ease(n).on("end",o):t},gN=t=>{const e=t.ctrlKey&&Ic()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e};function U9({zoomPanValues:t,noWheelClassName:e,d3Selection:n,d3Zoom:o,panOnScrollMode:a,panOnScrollSpeed:i,zoomOnPinch:l,onPanZoomStart:u,onPanZoom:d,onPanZoomEnd:f}){return g=>{if(Oi(g,e))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const m=n.property("__zoom").k||1;if(g.ctrlKey&&l){const w=Xo(g),M=gN(g),R=m*Math.pow(2,M);o.scaleTo(n,R,w,g);return}const p=g.deltaMode===1?20:1;let v=a===Ds.Vertical?0:g.deltaX*p,S=a===Ds.Horizontal?0:g.deltaY*p;!Ic()&&g.shiftKey&&a!==Ds.Vertical&&(v=g.deltaY*p,S=0),o.translateBy(n,-(v/m)*i,-(S/m)*i,{internal:!0});const C=lh(n.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(d?.(g,C),t.panScrollTimeout=setTimeout(()=>{f?.(g,C),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,u?.(g,C))}}function Y9({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(o,a){const i=o.type==="wheel",l=!e&&i&&!o.ctrlKey,u=Oi(o,t);if(o.ctrlKey&&i&&u&&o.preventDefault(),l||u)return null;o.preventDefault(),n.call(this,o,a)}}function G9({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const a=lh(o.transform);t.mouseButton=o.sourceEvent?.button||0,t.isZoomingOrPanning=!0,t.prevViewport=a,o.sourceEvent?.type==="mousedown"&&e(!0),n&&n?.(o.sourceEvent,a)}}function q9({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:o,onPanZoom:a}){return i=>{t.usedRightMouseButton=!!(n&&mN(e,t.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),a&&!i.sourceEvent?.internal&&a?.(i.sourceEvent,lh(i.transform))}}function W9({zoomPanValues:t,panOnDrag:e,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:a,onPaneContextMenu:i}){return l=>{if(!l.sourceEvent?.internal&&(t.isZoomingOrPanning=!1,i&&mN(e,t.mouseButton??0)&&!t.usedRightMouseButton&&l.sourceEvent&&i(l.sourceEvent),t.usedRightMouseButton=!1,o(!1),a)){const u=lh(l.transform);t.prevViewport=u,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{a?.(l.sourceEvent,u)},n?150:0)}}}function K9({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:n,panOnDrag:o,panOnScroll:a,zoomOnDoubleClick:i,userSelectionActive:l,noWheelClassName:u,noPanClassName:d,lib:f,connectionInProgress:g}){return m=>{const p=t||e,v=n&&m.ctrlKey,S=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(Oi(m,`${f}-flow__node`)||Oi(m,`${f}-flow__edge`)))return!0;if(!o&&!p&&!a&&!i&&!n||l||g&&!S||Oi(m,u)&&S||Oi(m,d)&&(!S||a&&S&&!t)||!n&&m.ctrlKey&&S)return!1;if(!n&&m.type==="touchstart"&&m.touches?.length>1)return m.preventDefault(),!1;if(!p&&!a&&!v&&S||!o&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(o)&&!o.includes(m.button)&&m.type==="mousedown")return!1;const C=Array.isArray(o)&&o.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||S)&&C}}function X9({domNode:t,minZoom:e,maxZoom:n,translateExtent:o,viewport:a,onPanZoom:i,onPanZoomStart:l,onPanZoomEnd:u,onDraggingChange:d}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=t.getBoundingClientRect(),m=VM().scaleExtent([e,n]).translateExtent(o),p=So(t).call(m);R({x:a.x,y:a.y,zoom:Yi(a.zoom,e,n)},[[0,0],[g.width,g.height]],o);const v=p.on("wheel.zoom"),S=p.on("dblclick.zoom");m.wheelDelta(gN);function C(U,Y){return p?new Promise(Z=>{m?.interpolate(Y?.interpolate==="linear"?xc:Zd).transform(tp(p,Y?.duration,Y?.ease,()=>Z(!0)),U)}):Promise.resolve(!1)}function w({noWheelClassName:U,noPanClassName:Y,onPaneContextMenu:Z,userSelectionActive:I,panOnScroll:G,panOnDrag:j,panOnScrollMode:L,panOnScrollSpeed:$,preventScrolling:H,zoomOnPinch:X,zoomOnScroll:P,zoomOnDoubleClick:z,zoomActivationKeyPressed:V,lib:q,onTransformChange:J,connectionInProgress:oe,paneClickDistance:K,selectionOnDrag:ee}){I&&!f.isZoomingOrPanning&&M();const ae=G&&!V&&!I;m.clickDistance(ee?1/0:!Qo(K)||K<0?0:K);const ce=ae?U9({zoomPanValues:f,noWheelClassName:U,d3Selection:p,d3Zoom:m,panOnScrollMode:L,panOnScrollSpeed:$,zoomOnPinch:X,onPanZoomStart:l,onPanZoom:i,onPanZoomEnd:u}):Y9({noWheelClassName:U,preventScrolling:H,d3ZoomHandler:v});if(p.on("wheel.zoom",ce,{passive:!1}),!I){const se=G9({zoomPanValues:f,onDraggingChange:d,onPanZoomStart:l});m.on("start",se);const ve=q9({zoomPanValues:f,panOnDrag:j,onPaneContextMenu:!!Z,onPanZoom:i,onTransformChange:J});m.on("zoom",ve);const De=W9({zoomPanValues:f,panOnDrag:j,panOnScroll:G,onPaneContextMenu:Z,onPanZoomEnd:u,onDraggingChange:d});m.on("end",De)}const ge=K9({zoomActivationKeyPressed:V,panOnDrag:j,zoomOnScroll:P,panOnScroll:G,zoomOnDoubleClick:z,zoomOnPinch:X,userSelectionActive:I,noPanClassName:Y,noWheelClassName:U,lib:q,connectionInProgress:oe});m.filter(ge),z?p.on("dblclick.zoom",S):p.on("dblclick.zoom",null)}function M(){m.on("zoom",null)}async function R(U,Y,Z){const I=ep(U),G=m?.constrain()(I,Y,Z);return G&&await C(G),new Promise(j=>j(G))}async function E(U,Y){const Z=ep(U);return await C(Z,Y),new Promise(I=>I(Z))}function N(U){if(p){const Y=ep(U),Z=p.property("__zoom");(Z.k!==U.zoom||Z.x!==U.x||Z.y!==U.y)&&m?.transform(p,Y,null,{sync:!0})}}function D(){const U=p?BM(p.node()):{x:0,y:0,k:1};return{x:U.x,y:U.y,zoom:U.k}}function T(U,Y){return p?new Promise(Z=>{m?.interpolate(Y?.interpolate==="linear"?xc:Zd).scaleTo(tp(p,Y?.duration,Y?.ease,()=>Z(!0)),U)}):Promise.resolve(!1)}function k(U,Y){return p?new Promise(Z=>{m?.interpolate(Y?.interpolate==="linear"?xc:Zd).scaleBy(tp(p,Y?.duration,Y?.ease,()=>Z(!0)),U)}):Promise.resolve(!1)}function A(U){m?.scaleExtent(U)}function B(U){m?.translateExtent(U)}function W(U){const Y=!Qo(U)||U<0?0:U;m?.clickDistance(Y)}return{update:w,destroy:M,setViewport:E,setViewportConstrained:R,getViewport:D,scaleTo:T,scaleBy:k,setScaleExtent:A,setTranslateExtent:B,syncViewport:N,setClickDistance:W}}var Wi;(function(t){t.Line="line",t.Handle="handle"})(Wi||(Wi={}));function Z9({width:t,prevWidth:e,height:n,prevHeight:o,affectsX:a,affectsY:i}){const l=t-e,u=n-o,d=[l>0?1:l<0?-1:0,u>0?1:u<0?-1:0];return l&&a&&(d[0]=d[0]*-1),u&&i&&(d[1]=d[1]*-1),d}function vS(t){const e=t.includes("right")||t.includes("left"),n=t.includes("bottom")||t.includes("top"),o=t.includes("left"),a=t.includes("top");return{isHorizontal:e,isVertical:n,affectsX:o,affectsY:a}}function $a(t,e){return Math.max(0,e-t)}function La(t,e){return Math.max(0,t-e)}function Ld(t,e,n){return Math.max(0,e-t,t-n)}function xS(t,e){return t?!e:e}function Q9(t,e,n,o,a,i,l,u){let{affectsX:d,affectsY:f}=e;const{isHorizontal:g,isVertical:m}=e,p=g&&m,{xSnapped:v,ySnapped:S}=n,{minWidth:C,maxWidth:w,minHeight:M,maxHeight:R}=o,{x:E,y:N,width:D,height:T,aspectRatio:k}=t;let A=Math.floor(g?v-t.pointerX:0),B=Math.floor(m?S-t.pointerY:0);const W=D+(d?-A:A),U=T+(f?-B:B),Y=-i[0]*D,Z=-i[1]*T;let I=Ld(W,C,w),G=Ld(U,M,R);if(l){let $=0,H=0;d&&A<0?$=$a(E+A+Y,l[0][0]):!d&&A>0&&($=La(E+W+Y,l[1][0])),f&&B<0?H=$a(N+B+Z,l[0][1]):!f&&B>0&&(H=La(N+U+Z,l[1][1])),I=Math.max(I,$),G=Math.max(G,H)}if(u){let $=0,H=0;d&&A>0?$=La(E+A,u[0][0]):!d&&A<0&&($=$a(E+W,u[1][0])),f&&B>0?H=La(N+B,u[0][1]):!f&&B<0&&(H=$a(N+U,u[1][1])),I=Math.max(I,$),G=Math.max(G,H)}if(a){if(g){const $=Ld(W/k,M,R)*k;if(I=Math.max(I,$),l){let H=0;!d&&!f||d&&!f&&p?H=La(N+Z+W/k,l[1][1])*k:H=$a(N+Z+(d?A:-A)/k,l[0][1])*k,I=Math.max(I,H)}if(u){let H=0;!d&&!f||d&&!f&&p?H=$a(N+W/k,u[1][1])*k:H=La(N+(d?A:-A)/k,u[0][1])*k,I=Math.max(I,H)}}if(m){const $=Ld(U*k,C,w)/k;if(G=Math.max(G,$),l){let H=0;!d&&!f||f&&!d&&p?H=La(E+U*k+Y,l[1][0])/k:H=$a(E+(f?B:-B)*k+Y,l[0][0])/k,G=Math.max(G,H)}if(u){let H=0;!d&&!f||f&&!d&&p?H=$a(E+U*k,u[1][0])/k:H=La(E+(f?B:-B)*k,u[0][0])/k,G=Math.max(G,H)}}}B=B+(B<0?G:-G),A=A+(A<0?I:-I),a&&(p?W>U*k?B=(xS(d,f)?-A:A)/k:A=(xS(d,f)?-B:B)*k:g?(B=A/k,f=d):(A=B*k,d=f));const j=d?E+A:E,L=f?N+B:N;return{width:D+(d?-A:A),height:T+(f?-B:B),x:i[0]*A*(d?-1:1)+j,y:i[1]*B*(f?-1:1)+L}}const pN={width:0,height:0,x:0,y:0},J9={...pN,pointerX:0,pointerY:0,aspectRatio:1};function eH(t){return[[0,0],[t.measured.width,t.measured.height]]}function tH(t,e,n){const o=e.position.x+t.position.x,a=e.position.y+t.position.y,i=t.measured.width??0,l=t.measured.height??0,u=n[0]*i,d=n[1]*l;return[[o-u,a-d],[o+i-u,a+l-d]]}function nH({domNode:t,nodeId:e,getStoreItems:n,onChange:o,onEnd:a}){const i=So(t);let l={controlDirection:vS("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:g,keepAspectRatio:m,resizeDirection:p,onResizeStart:v,onResize:S,onResizeEnd:C,shouldResize:w}){let M={...pN},R={...J9};l={boundaries:g,resizeDirection:p,keepAspectRatio:m,controlDirection:vS(f)};let E,N=null,D=[],T,k,A,B=!1;const W=NM().on("start",U=>{const{nodeLookup:Y,transform:Z,snapGrid:I,snapToGrid:G,nodeOrigin:j,paneDomNode:L}=n();if(E=Y.get(e),!E)return;N=L?.getBoundingClientRect()??null;const{xSnapped:$,ySnapped:H}=bc(U.sourceEvent,{transform:Z,snapGrid:I,snapToGrid:G,containerBounds:N});M={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},R={...M,pointerX:$,pointerY:H,aspectRatio:M.width/M.height},T=void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(T=Y.get(E.parentId),k=T&&E.extent==="parent"?eH(T):void 0),D=[],A=void 0;for(const[X,P]of Y)if(P.parentId===e&&(D.push({id:X,position:{...P.position},extent:P.extent}),P.extent==="parent"||P.expandParent)){const z=tH(P,E,P.origin??j);A?A=[[Math.min(z[0][0],A[0][0]),Math.min(z[0][1],A[0][1])],[Math.max(z[1][0],A[1][0]),Math.max(z[1][1],A[1][1])]]:A=z}v?.(U,{...M})}).on("drag",U=>{const{transform:Y,snapGrid:Z,snapToGrid:I,nodeOrigin:G}=n(),j=bc(U.sourceEvent,{transform:Y,snapGrid:Z,snapToGrid:I,containerBounds:N}),L=[];if(!E)return;const{x:$,y:H,width:X,height:P}=M,z={},V=E.origin??G,{width:q,height:J,x:oe,y:K}=Q9(R,l.controlDirection,j,l.boundaries,l.keepAspectRatio,V,k,A),ee=q!==X,ae=J!==P,ce=oe!==$&&ee,ge=K!==H&&ae;if(!ce&&!ge&&!ee&&!ae)return;if((ce||ge||V[0]===1||V[1]===1)&&(z.x=ce?oe:M.x,z.y=ge?K:M.y,M.x=z.x,M.y=z.y,D.length>0)){const Be=oe-$,Ie=K-H;for(const lt of D)lt.position={x:lt.position.x-Be+V[0]*(q-X),y:lt.position.y-Ie+V[1]*(J-P)},L.push(lt)}if((ee||ae)&&(z.width=ee&&(!l.resizeDirection||l.resizeDirection==="horizontal")?q:M.width,z.height=ae&&(!l.resizeDirection||l.resizeDirection==="vertical")?J:M.height,M.width=z.width,M.height=z.height),T&&E.expandParent){const Be=V[0]*(z.width??0);z.x&&z.x<Be&&(M.x=Be,R.x=R.x-(z.x-Be));const Ie=V[1]*(z.height??0);z.y&&z.y<Ie&&(M.y=Ie,R.y=R.y-(z.y-Ie))}const se=Z9({width:M.width,prevWidth:X,height:M.height,prevHeight:P,affectsX:l.controlDirection.affectsX,affectsY:l.controlDirection.affectsY}),ve={...M,direction:se};w?.(U,ve)!==!1&&(B=!0,S?.(U,ve),o(z,L))}).on("end",U=>{B&&(C?.(U,{...M}),a?.({...M}),B=!1)});i.call(W)}function d(){i.on(".drag",null)}return{update:u,destroy:d}}var np={exports:{}},op={};var bS;function oH(){if(bS)return op;bS=1;var t=Qi(),e=rO();function n(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var o=typeof Object.is=="function"?Object.is:n,a=e.useSyncExternalStore,i=t.useRef,l=t.useEffect,u=t.useMemo,d=t.useDebugValue;return op.useSyncExternalStoreWithSelector=function(f,g,m,p,v){var S=i(null);if(S.current===null){var C={hasValue:!1,value:null};S.current=C}else C=S.current;S=u(function(){function M(T){if(!R){if(R=!0,E=T,T=p(T),v!==void 0&&C.hasValue){var k=C.value;if(v(k,T))return N=k}return N=T}if(k=N,o(E,T))return k;var A=p(T);return v!==void 0&&v(k,A)?(E=T,k):(E=T,N=A)}var R=!1,E,N,D=m===void 0?null:m;return[function(){return M(g())},D===null?void 0:function(){return M(D())}]},[g,m,p,v]);var w=a(f,S[0],S[1]);return l(function(){C.hasValue=!0,C.value=w},[w]),d(w),w},op}var wS;function rH(){return wS||(wS=1,np.exports=oH()),np.exports}var aH=rH();const sH=h0(aH),iH={},SS=t=>{let e;const n=new Set,o=(g,m)=>{const p=typeof g=="function"?g(e):g;if(!Object.is(p,e)){const v=e;e=m??(typeof p!="object"||p===null)?p:Object.assign({},e,p),n.forEach(S=>S(e,v))}},a=()=>e,d={setState:o,getState:a,getInitialState:()=>f,subscribe:g=>(n.add(g),()=>n.delete(g)),destroy:()=>{(iH?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=e=t(o,a,d);return d},lH=t=>t?SS(t):SS,{useDebugValue:cH}=de,{useSyncExternalStoreWithSelector:uH}=sH,dH=t=>t;function yN(t,e=dH,n){const o=uH(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return cH(o),o}const CS=(t,e)=>{const n=lH(t),o=(a,i=e)=>yN(n,a,i);return Object.assign(o,n),o},fH=(t,e)=>t?CS(t,e):CS;function an(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[o,a]of t)if(!Object.is(a,e.get(o)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const o of t)if(!e.has(o))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(e,o)||!Object.is(t[o],e[o]))return!1;return!0}const ch=x.createContext(null),hH=ch.Provider,vN=Cr.error001();function St(t,e){const n=x.useContext(ch);if(n===null)throw new Error(vN);return yN(n,t,e)}function sn(){const t=x.useContext(ch);if(t===null)throw new Error(vN);return x.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const ES={display:"none"},mH={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},xN="react-flow__node-desc",bN="react-flow__edge-desc",gH="react-flow__aria-live",pH=t=>t.ariaLiveMessage,yH=t=>t.ariaLabelConfig;function vH({rfId:t}){const e=St(pH);return y.jsx("div",{id:`${gH}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:mH,children:e})}function xH({rfId:t,disableKeyboardA11y:e}){const n=St(yH);return y.jsxs(y.Fragment,{children:[y.jsx("div",{id:`${xN}-${t}`,style:ES,children:e?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),y.jsx("div",{id:`${bN}-${t}`,style:ES,children:n["edge.a11yDescription.default"]}),!e&&y.jsx(vH,{rfId:t})]})}const uh=x.forwardRef(({position:t="top-left",children:e,className:n,style:o,...a},i)=>{const l=`${t}`.split("-");return y.jsx("div",{className:Mn(["react-flow__panel",n,...l]),style:o,ref:i,...a,children:e})});uh.displayName="Panel";function bH({proOptions:t,position:e="bottom-right"}){return t?.hideAttribution?null:y.jsx(uh,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:y.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const wH=t=>{const e=[],n=[];for(const[,o]of t.nodeLookup)o.selected&&e.push(o.internals.userNode);for(const[,o]of t.edgeLookup)o.selected&&n.push(o);return{selectedNodes:e,selectedEdges:n}},Hd=t=>t.id;function SH(t,e){return an(t.selectedNodes.map(Hd),e.selectedNodes.map(Hd))&&an(t.selectedEdges.map(Hd),e.selectedEdges.map(Hd))}function CH({onSelectionChange:t}){const e=sn(),{selectedNodes:n,selectedEdges:o}=St(wH,SH);return x.useEffect(()=>{const a={nodes:n,edges:o};t?.(a),e.getState().onSelectionChangeHandlers.forEach(i=>i(a))},[n,o,t]),null}const EH=t=>!!t.onSelectionChangeHandlers;function _H({onSelectionChange:t}){const e=St(EH);return t||e?y.jsx(CH,{onSelectionChange:t}):null}const wN=[0,0],MH={x:0,y:0,zoom:1},NH=["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"],_S=[...NH,"rfId"],RH=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),MS={translateExtent:Ac,nodeOrigin:wN,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function DH(t){const{setNodes:e,setEdges:n,setMinZoom:o,setMaxZoom:a,setTranslateExtent:i,setNodeExtent:l,reset:u,setDefaultNodesAndEdges:d}=St(RH,an),f=sn();x.useEffect(()=>(d(t.defaultNodes,t.defaultEdges),()=>{g.current=MS,u()}),[]);const g=x.useRef(MS);return x.useEffect(()=>{for(const m of _S){const p=t[m],v=g.current[m];p!==v&&(typeof t[m]>"u"||(m==="nodes"?e(p):m==="edges"?n(p):m==="minZoom"?o(p):m==="maxZoom"?a(p):m==="translateExtent"?i(p):m==="nodeExtent"?l(p):m==="ariaLabelConfig"?f.setState({ariaLabelConfig:m9(p)}):m==="fitView"?f.setState({fitViewQueued:p}):m==="fitViewOptions"?f.setState({fitViewOptions:p}):f.setState({[m]:p})))}g.current=t},_S.map(m=>t[m])),null}function NS(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function TH(t){const[e,n]=x.useState(t==="system"?null:t);return x.useEffect(()=>{if(t!=="system"){n(t);return}const o=NS(),a=()=>n(o?.matches?"dark":"light");return a(),o?.addEventListener("change",a),()=>{o?.removeEventListener("change",a)}},[t]),e!==null?e:NS()?.matches?"dark":"light"}const RS=typeof document<"u"?document:null;function Pc(t=null,e={target:RS,actInsideInputWithModifier:!0}){const[n,o]=x.useState(!1),a=x.useRef(!1),i=x.useRef(new Set([])),[l,u]=x.useMemo(()=>{if(t!==null){const f=(Array.isArray(t)?t:[t]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
|
|
56
|
-
`).replace(`
|
|
57
|
-
|
|
58
|
-
`,`
|
|
59
|
-
+`).split(`
|
|
60
|
-
`)),g=f.reduce((m,p)=>m.concat(...p),[]);return[f,g]}return[[],[]]},[t]);return x.useEffect(()=>{const d=e?.target??RS,f=e?.actInsideInputWithModifier??!0;if(t!==null){const g=v=>{if(a.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!a.current||a.current&&!f)&&eN(v))return!1;const C=TS(v.code,u);if(i.current.add(v[C]),DS(l,i.current,!1)){const w=v.composedPath?.()?.[0]||v.target,M=w?.nodeName==="BUTTON"||w?.nodeName==="A";e.preventDefault!==!1&&(a.current||!M)&&v.preventDefault(),o(!0)}},m=v=>{const S=TS(v.code,u);DS(l,i.current,!0)?(o(!1),i.current.clear()):i.current.delete(v[S]),v.key==="Meta"&&i.current.clear(),a.current=!1},p=()=>{i.current.clear(),o(!1)};return d?.addEventListener("keydown",g),d?.addEventListener("keyup",m),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{d?.removeEventListener("keydown",g),d?.removeEventListener("keyup",m),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[t,o]),n}function DS(t,e,n){return t.filter(o=>n||o.length===e.size).some(o=>o.every(a=>e.has(a)))}function TS(t,e){return e.includes(t)?"code":"key"}const kH=()=>{const t=sn();return x.useMemo(()=>({zoomIn:e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1.2,{duration:e?.duration}):Promise.resolve(!1)},zoomOut:e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1/1.2,{duration:e?.duration}):Promise.resolve(!1)},zoomTo:(e,n)=>{const{panZoom:o}=t.getState();return o?o.scaleTo(e,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(e,n)=>{const{transform:[o,a,i],panZoom:l}=t.getState();return l?(await l.setViewport({x:e.x??o,y:e.y??a,zoom:e.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[e,n,o]=t.getState().transform;return{x:e,y:n,zoom:o}},setCenter:async(e,n,o)=>t.getState().setCenter(e,n,o),fitBounds:async(e,n)=>{const{width:o,height:a,minZoom:i,maxZoom:l,panZoom:u}=t.getState(),d=Ny(e,o,a,i,l,n?.padding??.1);return u?(await u.setViewport(d,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(e,n={})=>{const{transform:o,snapGrid:a,snapToGrid:i,domNode:l}=t.getState();if(!l)return e;const{x:u,y:d}=l.getBoundingClientRect(),f={x:e.x-u,y:e.y-d},g=n.snapGrid??a,m=n.snapToGrid??i;return au(f,o,m,g)},flowToScreenPosition:e=>{const{transform:n,domNode:o}=t.getState();if(!o)return e;const{x:a,y:i}=o.getBoundingClientRect(),l=Cf(e,n);return{x:l.x+a,y:l.y+i}}}),[])};function SN(t,e){const n=[],o=new Map,a=[];for(const i of t)if(i.type==="add"){a.push(i);continue}else if(i.type==="remove"||i.type==="replace")o.set(i.id,[i]);else{const l=o.get(i.id);l?l.push(i):o.set(i.id,[i])}for(const i of e){const l=o.get(i.id);if(!l){n.push(i);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const u={...i};for(const d of l)OH(d,u);n.push(u)}return a.length&&a.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function OH(t,e){switch(t.type){case"select":{e.selected=t.selected;break}case"position":{typeof t.position<"u"&&(e.position=t.position),typeof t.dragging<"u"&&(e.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(e.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(e.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(e.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(e.resizing=t.resizing);break}}}function CN(t,e){return SN(t,e)}function EN(t,e){return SN(t,e)}function Cs(t,e){return{id:t,type:"select",selected:e}}function Ai(t,e=new Set,n=!1){const o=[];for(const[a,i]of t){const l=e.has(a);!(i.selected===void 0&&!l)&&i.selected!==l&&(n&&(i.selected=l),o.push(Cs(i.id,l)))}return o}function kS({items:t=[],lookup:e}){const n=[],o=new Map(t.map(a=>[a.id,a]));for(const[a,i]of t.entries()){const l=e.get(i.id),u=l?.internals?.userNode??l;u!==void 0&&u!==i&&n.push({id:i.id,item:i,type:"replace"}),u===void 0&&n.push({item:i,type:"add",index:a})}for(const[a]of e)o.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function OS(t){return{id:t.id,type:"remove"}}const AS=t=>r9(t),AH=t=>qM(t);function _N(t){return x.forwardRef(t)}const jH=typeof window<"u"?x.useLayoutEffect:x.useEffect;function jS(t){const[e,n]=x.useState(BigInt(0)),[o]=x.useState(()=>zH(()=>n(a=>a+BigInt(1))));return jH(()=>{const a=o.get();a.length&&(t(a),o.reset())},[e]),o}function zH(t){let e=[];return{get:()=>e,reset:()=>{e=[]},push:n=>{e.push(n),t()}}}const MN=x.createContext(null);function IH({children:t}){const e=sn(),n=x.useCallback(u=>{const{nodes:d=[],setNodes:f,hasDefaultNodes:g,onNodesChange:m,nodeLookup:p,fitViewQueued:v,onNodesChangeMiddlewareMap:S}=e.getState();let C=d;for(const M of u)C=typeof M=="function"?M(C):M;let w=kS({items:C,lookup:p});for(const M of S.values())w=M(w);g&&f(C),w.length>0?m?.(w):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:M,nodes:R,setNodes:E}=e.getState();M&&E(R)})},[]),o=jS(n),a=x.useCallback(u=>{const{edges:d=[],setEdges:f,hasDefaultEdges:g,onEdgesChange:m,edgeLookup:p}=e.getState();let v=d;for(const S of u)v=typeof S=="function"?S(v):S;g?f(v):m&&m(kS({items:v,lookup:p}))},[]),i=jS(a),l=x.useMemo(()=>({nodeQueue:o,edgeQueue:i}),[]);return y.jsx(MN.Provider,{value:l,children:t})}function PH(){const t=x.useContext(MN);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const $H=t=>!!t.panZoom;function dh(){const t=kH(),e=sn(),n=PH(),o=St($H),a=x.useMemo(()=>{const i=m=>e.getState().nodeLookup.get(m),l=m=>{n.nodeQueue.push(m)},u=m=>{n.edgeQueue.push(m)},d=m=>{const{nodeLookup:p,nodeOrigin:v}=e.getState(),S=AS(m)?m:p.get(m.id),C=S.parentId?QM(S.position,S.measured,S.parentId,p,v):S.position,w={...S,position:C,width:S.measured?.width??S.width,height:S.measured?.height??S.height};return Gi(w)},f=(m,p,v={replace:!1})=>{l(S=>S.map(C=>{if(C.id===m){const w=typeof p=="function"?p(C):p;return v.replace&&AS(w)?w:{...C,...w}}return C}))},g=(m,p,v={replace:!1})=>{u(S=>S.map(C=>{if(C.id===m){const w=typeof p=="function"?p(C):p;return v.replace&&AH(w)?w:{...C,...w}}return C}))};return{getNodes:()=>e.getState().nodes.map(m=>({...m})),getNode:m=>i(m)?.internals.userNode,getInternalNode:i,getEdges:()=>{const{edges:m=[]}=e.getState();return m.map(p=>({...p}))},getEdge:m=>e.getState().edgeLookup.get(m),setNodes:l,setEdges:u,addNodes:m=>{const p=Array.isArray(m)?m:[m];n.nodeQueue.push(v=>[...v,...p])},addEdges:m=>{const p=Array.isArray(m)?m:[m];n.edgeQueue.push(v=>[...v,...p])},toObject:()=>{const{nodes:m=[],edges:p=[],transform:v}=e.getState(),[S,C,w]=v;return{nodes:m.map(M=>({...M})),edges:p.map(M=>({...M})),viewport:{x:S,y:C,zoom:w}}},deleteElements:async({nodes:m=[],edges:p=[]})=>{const{nodes:v,edges:S,onNodesDelete:C,onEdgesDelete:w,triggerNodeChanges:M,triggerEdgeChanges:R,onDelete:E,onBeforeDelete:N}=e.getState(),{nodes:D,edges:T}=await c9({nodesToRemove:m,edgesToRemove:p,nodes:v,edges:S,onBeforeDelete:N}),k=T.length>0,A=D.length>0;if(k){const B=T.map(OS);w?.(T),R(B)}if(A){const B=D.map(OS);C?.(D),M(B)}return(A||k)&&E?.({nodes:D,edges:T}),{deletedNodes:D,deletedEdges:T}},getIntersectingNodes:(m,p=!0,v)=>{const S=iS(m),C=S?m:d(m),w=v!==void 0;return C?(v||e.getState().nodes).filter(M=>{const R=e.getState().nodeLookup.get(M.id);if(R&&!S&&(M.id===m.id||!R.internals.positionAbsolute))return!1;const E=Gi(w?M:R),N=zc(E,C);return p&&N>0||N>=E.width*E.height||N>=C.width*C.height}):[]},isNodeIntersecting:(m,p,v=!0)=>{const C=iS(m)?m:d(m);if(!C)return!1;const w=zc(C,p);return v&&w>0||w>=p.width*p.height||w>=C.width*C.height},updateNode:f,updateNodeData:(m,p,v={replace:!1})=>{f(m,S=>{const C=typeof p=="function"?p(S):p;return v.replace?{...S,data:C}:{...S,data:{...S.data,...C}}},v)},updateEdge:g,updateEdgeData:(m,p,v={replace:!1})=>{g(m,S=>{const C=typeof p=="function"?p(S):p;return v.replace?{...S,data:C}:{...S,data:{...S.data,...C}}},v)},getNodesBounds:m=>{const{nodeLookup:p,nodeOrigin:v}=e.getState();return a9(m,{nodeLookup:p,nodeOrigin:v})},getHandleConnections:({type:m,id:p,nodeId:v})=>Array.from(e.getState().connectionLookup.get(`${v}-${m}${p?`-${p}`:""}`)?.values()??[]),getNodeConnections:({type:m,handleId:p,nodeId:v})=>Array.from(e.getState().connectionLookup.get(`${v}${m?p?`-${m}-${p}`:`-${m}`:""}`)?.values()??[]),fitView:async m=>{const p=e.getState().fitViewResolver??h9();return e.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:p}),n.nodeQueue.push(v=>[...v]),p.promise}}},[]);return x.useMemo(()=>({...a,...t,viewportInitialized:o}),[o])}const zS=t=>t.selected,LH=typeof window<"u"?window:void 0;function HH({deleteKeyCode:t,multiSelectionKeyCode:e}){const n=sn(),{deleteElements:o}=dh(),a=Pc(t,{actInsideInputWithModifier:!1}),i=Pc(e,{target:LH});x.useEffect(()=>{if(a){const{edges:l,nodes:u}=n.getState();o({nodes:u.filter(zS),edges:l.filter(zS)}),n.setState({nodesSelectionActive:!1})}},[a]),x.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function BH(t){const e=sn();x.useEffect(()=>{const n=()=>{if(!t.current||!(t.current.checkVisibility?.()??!0))return!1;const o=Dy(t.current);(o.height===0||o.width===0)&&e.getState().onError?.("004",Cr.error004()),e.setState({width:o.width||500,height:o.height||500})};if(t.current){n(),window.addEventListener("resize",n);const o=new ResizeObserver(()=>n());return o.observe(t.current),()=>{window.removeEventListener("resize",n),o&&t.current&&o.unobserve(t.current)}}},[])}const fh={position:"absolute",width:"100%",height:"100%",top:0,left:0},VH=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function FH({onPaneContextMenu:t,zoomOnScroll:e=!0,zoomOnPinch:n=!0,panOnScroll:o=!1,panOnScrollSpeed:a=.5,panOnScrollMode:i=Ds.Free,zoomOnDoubleClick:l=!0,panOnDrag:u=!0,defaultViewport:d,translateExtent:f,minZoom:g,maxZoom:m,zoomActivationKeyCode:p,preventScrolling:v=!0,children:S,noWheelClassName:C,noPanClassName:w,onViewportChange:M,isControlledViewport:R,paneClickDistance:E,selectionOnDrag:N}){const D=sn(),T=x.useRef(null),{userSelectionActive:k,lib:A,connectionInProgress:B}=St(VH,an),W=Pc(p),U=x.useRef();BH(T);const Y=x.useCallback(Z=>{M?.({x:Z[0],y:Z[1],zoom:Z[2]}),R||D.setState({transform:Z})},[M,R]);return x.useEffect(()=>{if(T.current){U.current=X9({domNode:T.current,minZoom:g,maxZoom:m,translateExtent:f,viewport:d,onDraggingChange:j=>D.setState({paneDragging:j}),onPanZoomStart:(j,L)=>{const{onViewportChangeStart:$,onMoveStart:H}=D.getState();H?.(j,L),$?.(L)},onPanZoom:(j,L)=>{const{onViewportChange:$,onMove:H}=D.getState();H?.(j,L),$?.(L)},onPanZoomEnd:(j,L)=>{const{onViewportChangeEnd:$,onMoveEnd:H}=D.getState();H?.(j,L),$?.(L)}});const{x:Z,y:I,zoom:G}=U.current.getViewport();return D.setState({panZoom:U.current,transform:[Z,I,G],domNode:T.current.closest(".react-flow")}),()=>{U.current?.destroy()}}},[]),x.useEffect(()=>{U.current?.update({onPaneContextMenu:t,zoomOnScroll:e,zoomOnPinch:n,panOnScroll:o,panOnScrollSpeed:a,panOnScrollMode:i,zoomOnDoubleClick:l,panOnDrag:u,zoomActivationKeyPressed:W,preventScrolling:v,noPanClassName:w,userSelectionActive:k,noWheelClassName:C,lib:A,onTransformChange:Y,connectionInProgress:B,selectionOnDrag:N,paneClickDistance:E})},[t,e,n,o,a,i,l,u,W,v,w,k,C,A,Y,B,N,E]),y.jsx("div",{className:"react-flow__renderer",ref:T,style:fh,children:S})}const UH=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function YH(){const{userSelectionActive:t,userSelectionRect:e}=St(UH,an);return t&&e?y.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}const rp=(t,e)=>n=>{n.target===e.current&&t?.(n)},GH=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function qH({isSelecting:t,selectionKeyPressed:e,selectionMode:n=jc.Full,panOnDrag:o,paneClickDistance:a,selectionOnDrag:i,onSelectionStart:l,onSelectionEnd:u,onPaneClick:d,onPaneContextMenu:f,onPaneScroll:g,onPaneMouseEnter:m,onPaneMouseMove:p,onPaneMouseLeave:v,children:S}){const C=sn(),{userSelectionActive:w,elementsSelectable:M,dragging:R,connectionInProgress:E}=St(GH,an),N=M&&(t||w),D=x.useRef(null),T=x.useRef(),k=x.useRef(new Set),A=x.useRef(new Set),B=x.useRef(!1),W=$=>{if(B.current||E){B.current=!1;return}d?.($),C.getState().resetSelectedElements(),C.setState({nodesSelectionActive:!1})},U=$=>{if(Array.isArray(o)&&o?.includes(2)){$.preventDefault();return}f?.($)},Y=g?$=>g($):void 0,Z=$=>{B.current&&($.stopPropagation(),B.current=!1)},I=$=>{const{domNode:H}=C.getState();if(T.current=H?.getBoundingClientRect(),!T.current)return;const X=$.target===D.current;if(!X&&!!$.target.closest(".nokey")||!t||!(i&&X||e)||$.button!==0||!$.isPrimary)return;$.target?.setPointerCapture?.($.pointerId),B.current=!1;const{x:V,y:q}=Jo($.nativeEvent,T.current);C.setState({userSelectionRect:{width:0,height:0,startX:V,startY:q,x:V,y:q}}),X||($.stopPropagation(),$.preventDefault())},G=$=>{const{userSelectionRect:H,transform:X,nodeLookup:P,edgeLookup:z,connectionLookup:V,triggerNodeChanges:q,triggerEdgeChanges:J,defaultEdgeOptions:oe,resetSelectedElements:K}=C.getState();if(!T.current||!H)return;const{x:ee,y:ae}=Jo($.nativeEvent,T.current),{startX:ce,startY:ge}=H;if(!B.current){const Ie=e?0:a;if(Math.hypot(ee-ce,ae-ge)<=Ie)return;K(),l?.($)}B.current=!0;const se={startX:ce,startY:ge,x:ee<ce?ee:ce,y:ae<ge?ae:ge,width:Math.abs(ee-ce),height:Math.abs(ae-ge)},ve=k.current,De=A.current;k.current=new Set(My(P,se,X,n===jc.Partial,!0).map(Ie=>Ie.id)),A.current=new Set;const Be=oe?.selectable??!0;for(const Ie of k.current){const lt=V.get(Ie);if(lt)for(const{edgeId:ln}of lt.values()){const ht=z.get(ln);ht&&(ht.selectable??Be)&&A.current.add(ln)}}if(!lS(ve,k.current)){const Ie=Ai(P,k.current,!0);q(Ie)}if(!lS(De,A.current)){const Ie=Ai(z,A.current);J(Ie)}C.setState({userSelectionRect:se,userSelectionActive:!0,nodesSelectionActive:!1})},j=$=>{$.button===0&&($.target?.releasePointerCapture?.($.pointerId),!w&&$.target===D.current&&C.getState().userSelectionRect&&W?.($),C.setState({userSelectionActive:!1,userSelectionRect:null}),B.current&&(u?.($),C.setState({nodesSelectionActive:k.current.size>0})))},L=o===!0||Array.isArray(o)&&o.includes(0);return y.jsxs("div",{className:Mn(["react-flow__pane",{draggable:L,dragging:R,selection:t}]),onClick:N?void 0:rp(W,D),onContextMenu:rp(U,D),onWheel:rp(Y,D),onPointerEnter:N?void 0:m,onPointerMove:N?G:p,onPointerUp:N?j:void 0,onPointerDownCapture:N?I:void 0,onClickCapture:N?Z:void 0,onPointerLeave:v,ref:D,style:fh,children:[S,y.jsx(YH,{})]})}function n0({id:t,store:e,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:a,unselectNodesAndEdges:i,multiSelectionActive:l,nodeLookup:u,onError:d}=e.getState(),f=u.get(t);if(!f){d?.("012",Cr.error012(t));return}e.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&l)&&(i({nodes:[f],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):a([t])}function NN({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:o,nodeId:a,isSelectable:i,nodeClickDistance:l}){const u=sn(),[d,f]=x.useState(!1),g=x.useRef();return x.useEffect(()=>{g.current=I9({getStoreItems:()=>u.getState(),onNodeMouseDown:m=>{n0({id:m,store:u,nodeRef:t})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),x.useEffect(()=>{if(e)g.current?.destroy();else if(t.current)return g.current?.update({noDragClassName:n,handleSelector:o,domNode:t.current,isSelectable:i,nodeId:a,nodeClickDistance:l}),()=>{g.current?.destroy()}},[n,o,e,i,t,a]),d}const WH=t=>e=>e.selected&&(e.draggable||t&&typeof e.draggable>"u");function RN(){const t=sn();return x.useCallback(n=>{const{nodeExtent:o,snapToGrid:a,snapGrid:i,nodesDraggable:l,onError:u,updateNodePositions:d,nodeLookup:f,nodeOrigin:g}=t.getState(),m=new Map,p=WH(l),v=a?i[0]:5,S=a?i[1]:5,C=n.direction.x*v*n.factor,w=n.direction.y*S*n.factor;for(const[,M]of f){if(!p(M))continue;let R={x:M.internals.positionAbsolute.x+C,y:M.internals.positionAbsolute.y+w};a&&(R=ru(R,i));const{position:E,positionAbsolute:N}=WM({nodeId:M.id,nextPosition:R,nodeLookup:f,nodeExtent:o,nodeOrigin:g,onError:u});M.position=E,M.internals.positionAbsolute=N,m.set(M.id,M)}d(m)},[])}const zy=x.createContext(null),KH=zy.Provider;zy.Consumer;const DN=()=>x.useContext(zy),XH=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),ZH=(t,e,n)=>o=>{const{connectionClickStartHandle:a,connectionMode:i,connection:l}=o,{fromHandle:u,toHandle:d,isValid:f}=l,g=d?.nodeId===t&&d?.id===e&&d?.type===n;return{connectingFrom:u?.nodeId===t&&u?.id===e&&u?.type===n,connectingTo:g,clickConnecting:a?.nodeId===t&&a?.id===e&&a?.type===n,isPossibleEndHandle:i===Ui.Strict?u?.type!==n:t!==u?.nodeId||e!==u?.id,connectionInProcess:!!u,clickConnectionInProcess:!!a,valid:g&&f}};function QH({type:t="source",position:e=qe.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:a=!0,isConnectableEnd:i=!0,id:l,onConnect:u,children:d,className:f,onMouseDown:g,onTouchStart:m,...p},v){const S=l||null,C=t==="target",w=sn(),M=DN(),{connectOnClick:R,noPanClassName:E,rfId:N}=St(XH,an),{connectingFrom:D,connectingTo:T,clickConnecting:k,isPossibleEndHandle:A,connectionInProcess:B,clickConnectionInProcess:W,valid:U}=St(ZH(M,S,t),an);M||w.getState().onError?.("010",Cr.error010());const Y=G=>{const{defaultEdgeOptions:j,onConnect:L,hasDefaultEdges:$}=w.getState(),H={...j,...G};if($){const{edges:X,setEdges:P}=w.getState();P(b9(H,X))}L?.(H),u?.(H)},Z=G=>{if(!M)return;const j=tN(G.nativeEvent);if(a&&(j&&G.button===0||!j)){const L=w.getState();t0.onPointerDown(G.nativeEvent,{handleDomNode:G.currentTarget,autoPanOnConnect:L.autoPanOnConnect,connectionMode:L.connectionMode,connectionRadius:L.connectionRadius,domNode:L.domNode,nodeLookup:L.nodeLookup,lib:L.lib,isTarget:C,handleId:S,nodeId:M,flowId:L.rfId,panBy:L.panBy,cancelConnection:L.cancelConnection,onConnectStart:L.onConnectStart,onConnectEnd:L.onConnectEnd,updateConnection:L.updateConnection,onConnect:Y,isValidConnection:n||L.isValidConnection,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:L.autoPanSpeed,dragThreshold:L.connectionDragThreshold})}j?g?.(G):m?.(G)},I=G=>{const{onClickConnectStart:j,onClickConnectEnd:L,connectionClickStartHandle:$,connectionMode:H,isValidConnection:X,lib:P,rfId:z,nodeLookup:V,connection:q}=w.getState();if(!M||!$&&!a)return;if(!$){j?.(G.nativeEvent,{nodeId:M,handleId:S,handleType:t}),w.setState({connectionClickStartHandle:{nodeId:M,type:t,id:S}});return}const J=JM(G.target),oe=n||X,{connection:K,isValid:ee}=t0.isValid(G.nativeEvent,{handle:{nodeId:M,id:S,type:t},connectionMode:H,fromNodeId:$.nodeId,fromHandleId:$.id||null,fromType:$.type,isValidConnection:oe,flowId:z,doc:J,lib:P,nodeLookup:V});ee&&K&&Y(K);const ae=structuredClone(q);delete ae.inProgress,ae.toPosition=ae.toHandle?ae.toHandle.position:null,L?.(G,ae),w.setState({connectionClickStartHandle:null})};return y.jsx("div",{"data-handleid":S,"data-nodeid":M,"data-handlepos":e,"data-id":`${N}-${M}-${S}-${t}`,className:Mn(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",E,f,{source:!C,target:C,connectable:o,connectablestart:a,connectableend:i,clickconnecting:k,connectingfrom:D,connectingto:T,valid:U,connectionindicator:o&&(!B||A)&&(B||W?i:a)}]),onMouseDown:Z,onTouchStart:Z,onClick:R?I:void 0,ref:v,...p,children:d})}const Ki=x.memo(_N(QH));function JH({data:t,isConnectable:e,sourcePosition:n=qe.Bottom}){return y.jsxs(y.Fragment,{children:[t?.label,y.jsx(Ki,{type:"source",position:n,isConnectable:e})]})}function eB({data:t,isConnectable:e,targetPosition:n=qe.Top,sourcePosition:o=qe.Bottom}){return y.jsxs(y.Fragment,{children:[y.jsx(Ki,{type:"target",position:n,isConnectable:e}),t?.label,y.jsx(Ki,{type:"source",position:o,isConnectable:e})]})}function tB(){return null}function nB({data:t,isConnectable:e,targetPosition:n=qe.Top}){return y.jsxs(y.Fragment,{children:[y.jsx(Ki,{type:"target",position:n,isConnectable:e}),t?.label]})}const Ef={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},IS={input:JH,default:eB,output:nB,group:tB};function oB(t){return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??t.style?.width,height:t.height??t.initialHeight??t.style?.height}:{width:t.width??t.style?.width,height:t.height??t.style?.height}}const rB=t=>{const{width:e,height:n,x:o,y:a}=ou(t.nodeLookup,{filter:i=>!!i.selected});return{width:Qo(e)?e:null,height:Qo(n)?n:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${o}px,${a}px)`}};function aB({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const o=sn(),{width:a,height:i,transformString:l,userSelectionActive:u}=St(rB,an),d=RN(),f=x.useRef(null);if(x.useEffect(()=>{n||f.current?.focus({preventScroll:!0})},[n]),NN({nodeRef:f}),u||!a||!i)return null;const g=t?p=>{const v=o.getState().nodes.filter(S=>S.selected);t(p,v)}:void 0,m=p=>{Object.prototype.hasOwnProperty.call(Ef,p.key)&&(p.preventDefault(),d({direction:Ef[p.key],factor:p.shiftKey?4:1}))};return y.jsx("div",{className:Mn(["react-flow__nodesselection","react-flow__container",e]),style:{transform:l},children:y.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:n?void 0:-1,onKeyDown:n?void 0:m,style:{width:a,height:i}})})}const PS=typeof window<"u"?window:void 0,sB=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function TN({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:l,paneClickDistance:u,deleteKeyCode:d,selectionKeyCode:f,selectionOnDrag:g,selectionMode:m,onSelectionStart:p,onSelectionEnd:v,multiSelectionKeyCode:S,panActivationKeyCode:C,zoomActivationKeyCode:w,elementsSelectable:M,zoomOnScroll:R,zoomOnPinch:E,panOnScroll:N,panOnScrollSpeed:D,panOnScrollMode:T,zoomOnDoubleClick:k,panOnDrag:A,defaultViewport:B,translateExtent:W,minZoom:U,maxZoom:Y,preventScrolling:Z,onSelectionContextMenu:I,noWheelClassName:G,noPanClassName:j,disableKeyboardA11y:L,onViewportChange:$,isControlledViewport:H}){const{nodesSelectionActive:X,userSelectionActive:P}=St(sB,an),z=Pc(f,{target:PS}),V=Pc(C,{target:PS}),q=V||A,J=V||N,oe=g&&q!==!0,K=z||P||oe;return HH({deleteKeyCode:d,multiSelectionKeyCode:S}),y.jsx(FH,{onPaneContextMenu:i,elementsSelectable:M,zoomOnScroll:R,zoomOnPinch:E,panOnScroll:J,panOnScrollSpeed:D,panOnScrollMode:T,zoomOnDoubleClick:k,panOnDrag:!z&&q,defaultViewport:B,translateExtent:W,minZoom:U,maxZoom:Y,zoomActivationKeyCode:w,preventScrolling:Z,noWheelClassName:G,noPanClassName:j,onViewportChange:$,isControlledViewport:H,paneClickDistance:u,selectionOnDrag:oe,children:y.jsxs(qH,{onSelectionStart:p,onSelectionEnd:v,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:l,panOnDrag:q,isSelecting:!!K,selectionMode:m,selectionKeyPressed:z,paneClickDistance:u,selectionOnDrag:oe,children:[t,X&&y.jsx(aB,{onSelectionContextMenu:I,noPanClassName:j,disableKeyboardA11y:L})]})})}TN.displayName="FlowRenderer";const iB=x.memo(TN),lB=t=>e=>t?My(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(n=>n.id):Array.from(e.nodeLookup.keys());function cB(t){return St(x.useCallback(lB(t),[t]),an)}const uB=t=>t.updateNodeInternals;function dB(){const t=St(uB),[e]=x.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const o=new Map;n.forEach(a=>{const i=a.target.getAttribute("data-id");o.set(i,{id:i,nodeElement:a.target,force:!0})}),t(o)}));return x.useEffect(()=>()=>{e?.disconnect()},[e]),e}function fB({node:t,nodeType:e,hasDimensions:n,resizeObserver:o}){const a=sn(),i=x.useRef(null),l=x.useRef(null),u=x.useRef(t.sourcePosition),d=x.useRef(t.targetPosition),f=x.useRef(e),g=n&&!!t.internals.handleBounds;return x.useEffect(()=>{i.current&&!t.hidden&&(!g||l.current!==i.current)&&(l.current&&o?.unobserve(l.current),o?.observe(i.current),l.current=i.current)},[g,t.hidden]),x.useEffect(()=>()=>{l.current&&(o?.unobserve(l.current),l.current=null)},[]),x.useEffect(()=>{if(i.current){const m=f.current!==e,p=u.current!==t.sourcePosition,v=d.current!==t.targetPosition;(m||p||v)&&(f.current=e,u.current=t.sourcePosition,d.current=t.targetPosition,a.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:i.current,force:!0}]])))}},[t.id,e,t.sourcePosition,t.targetPosition]),i}function hB({id:t,onClick:e,onMouseEnter:n,onMouseMove:o,onMouseLeave:a,onContextMenu:i,onDoubleClick:l,nodesDraggable:u,elementsSelectable:d,nodesConnectable:f,nodesFocusable:g,resizeObserver:m,noDragClassName:p,noPanClassName:v,disableKeyboardA11y:S,rfId:C,nodeTypes:w,nodeClickDistance:M,onError:R}){const{node:E,internals:N,isParent:D}=St(ee=>{const ae=ee.nodeLookup.get(t),ce=ee.parentLookup.has(t);return{node:ae,internals:ae.internals,isParent:ce}},an);let T=E.type||"default",k=w?.[T]||IS[T];k===void 0&&(R?.("003",Cr.error003(T)),T="default",k=w?.default||IS.default);const A=!!(E.draggable||u&&typeof E.draggable>"u"),B=!!(E.selectable||d&&typeof E.selectable>"u"),W=!!(E.connectable||f&&typeof E.connectable>"u"),U=!!(E.focusable||g&&typeof E.focusable>"u"),Y=sn(),Z=Ry(E),I=fB({node:E,nodeType:T,hasDimensions:Z,resizeObserver:m}),G=NN({nodeRef:I,disabled:E.hidden||!A,noDragClassName:p,handleSelector:E.dragHandle,nodeId:t,isSelectable:B,nodeClickDistance:M}),j=RN();if(E.hidden)return null;const L=da(E),$=oB(E),H=B||A||e||n||o||a,X=n?ee=>n(ee,{...N.userNode}):void 0,P=o?ee=>o(ee,{...N.userNode}):void 0,z=a?ee=>a(ee,{...N.userNode}):void 0,V=i?ee=>i(ee,{...N.userNode}):void 0,q=l?ee=>l(ee,{...N.userNode}):void 0,J=ee=>{const{selectNodesOnDrag:ae,nodeDragThreshold:ce}=Y.getState();B&&(!ae||!A||ce>0)&&n0({id:t,store:Y,nodeRef:I}),e&&e(ee,{...N.userNode})},oe=ee=>{if(!(eN(ee.nativeEvent)||S)){if(FM.includes(ee.key)&&B){const ae=ee.key==="Escape";n0({id:t,store:Y,unselect:ae,nodeRef:I})}else if(A&&E.selected&&Object.prototype.hasOwnProperty.call(Ef,ee.key)){ee.preventDefault();const{ariaLabelConfig:ae}=Y.getState();Y.setState({ariaLiveMessage:ae["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~N.positionAbsolute.x,y:~~N.positionAbsolute.y})}),j({direction:Ef[ee.key],factor:ee.shiftKey?4:1})}}},K=()=>{if(S||!I.current?.matches(":focus-visible"))return;const{transform:ee,width:ae,height:ce,autoPanOnNodeFocus:ge,setCenter:se}=Y.getState();if(!ge)return;My(new Map([[t,E]]),{x:0,y:0,width:ae,height:ce},ee,!0).length>0||se(E.position.x+L.width/2,E.position.y+L.height/2,{zoom:ee[2]})};return y.jsx("div",{className:Mn(["react-flow__node",`react-flow__node-${T}`,{[v]:A},E.className,{selected:E.selected,selectable:B,parent:D,draggable:A,dragging:G}]),ref:I,style:{zIndex:N.z,transform:`translate(${N.positionAbsolute.x}px,${N.positionAbsolute.y}px)`,pointerEvents:H?"all":"none",visibility:Z?"visible":"hidden",...E.style,...$},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:X,onMouseMove:P,onMouseLeave:z,onContextMenu:V,onClick:J,onDoubleClick:q,onKeyDown:U?oe:void 0,tabIndex:U?0:void 0,onFocus:U?K:void 0,role:E.ariaRole??(U?"group":void 0),"aria-roledescription":"node","aria-describedby":S?void 0:`${xN}-${C}`,"aria-label":E.ariaLabel,...E.domAttributes,children:y.jsx(KH,{value:t,children:y.jsx(k,{id:t,data:E.data,type:T,positionAbsoluteX:N.positionAbsolute.x,positionAbsoluteY:N.positionAbsolute.y,selected:E.selected??!1,selectable:B,draggable:A,deletable:E.deletable??!0,isConnectable:W,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:G,dragHandle:E.dragHandle,zIndex:N.z,parentId:E.parentId,...L})})})}var mB=x.memo(hB);const gB=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function kN(t){const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:o,elementsSelectable:a,onError:i}=St(gB,an),l=cB(t.onlyRenderVisibleElements),u=dB();return y.jsx("div",{className:"react-flow__nodes",style:fh,children:l.map(d=>y.jsx(mB,{id:d,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:u,nodesDraggable:e,nodesConnectable:n,nodesFocusable:o,elementsSelectable:a,nodeClickDistance:t.nodeClickDistance,onError:i},d))})}kN.displayName="NodeRenderer";const pB=x.memo(kN);function yB(t){return St(x.useCallback(n=>{if(!t)return n.edges.map(a=>a.id);const o=[];if(n.width&&n.height)for(const a of n.edges){const i=n.nodeLookup.get(a.source),l=n.nodeLookup.get(a.target);i&&l&&y9({sourceNode:i,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&o.push(a.id)}return o},[t]),an)}const vB=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t}};return y.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},xB=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t,fill:t}};return y.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},$S={[wf.Arrow]:vB,[wf.ArrowClosed]:xB};function bB(t){const e=sn();return x.useMemo(()=>Object.prototype.hasOwnProperty.call($S,t)?$S[t]:(e.getState().onError?.("009",Cr.error009(t)),null),[t])}const wB=({id:t,type:e,color:n,width:o=12.5,height:a=12.5,markerUnits:i="strokeWidth",strokeWidth:l,orient:u="auto-start-reverse"})=>{const d=bB(e);return d?y.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${o}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:u,refX:"0",refY:"0",children:y.jsx(d,{color:n,strokeWidth:l})}):null},ON=({defaultColor:t,rfId:e})=>{const n=St(i=>i.edges),o=St(i=>i.defaultEdgeOptions),a=x.useMemo(()=>_9(n,{id:e,defaultColor:t,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[n,o,e,t]);return a.length?y.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:y.jsx("defs",{children:a.map(i=>y.jsx(wB,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};ON.displayName="MarkerDefinitions";var SB=x.memo(ON);function AN({x:t,y:e,label:n,labelStyle:o,labelShowBg:a=!0,labelBgStyle:i,labelBgPadding:l=[2,4],labelBgBorderRadius:u=2,children:d,className:f,...g}){const[m,p]=x.useState({x:1,y:0,width:0,height:0}),v=Mn(["react-flow__edge-textwrapper",f]),S=x.useRef(null);return x.useEffect(()=>{if(S.current){const C=S.current.getBBox();p({x:C.x,y:C.y,width:C.width,height:C.height})}},[n]),n?y.jsxs("g",{transform:`translate(${t-m.width/2} ${e-m.height/2})`,className:v,visibility:m.width?"visible":"hidden",...g,children:[a&&y.jsx("rect",{width:m.width+2*l[0],x:-l[0],y:-l[1],height:m.height+2*l[1],className:"react-flow__edge-textbg",style:i,rx:u,ry:u}),y.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:S,style:o,children:n}),d]}):null}AN.displayName="EdgeText";const CB=x.memo(AN);function hh({path:t,labelX:e,labelY:n,label:o,labelStyle:a,labelShowBg:i,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,interactionWidth:f=20,...g}){return y.jsxs(y.Fragment,{children:[y.jsx("path",{...g,d:t,fill:"none",className:Mn(["react-flow__edge-path",g.className])}),f?y.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,o&&Qo(e)&&Qo(n)?y.jsx(CB,{x:e,y:n,label:o,labelStyle:a,labelShowBg:i,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d}):null]})}function LS({pos:t,x1:e,y1:n,x2:o,y2:a}){return t===qe.Left||t===qe.Right?[.5*(e+o),n]:[e,.5*(n+a)]}function jN({sourceX:t,sourceY:e,sourcePosition:n=qe.Bottom,targetX:o,targetY:a,targetPosition:i=qe.Top}){const[l,u]=LS({pos:n,x1:t,y1:e,x2:o,y2:a}),[d,f]=LS({pos:i,x1:o,y1:a,x2:t,y2:e}),[g,m,p,v]=nN({sourceX:t,sourceY:e,targetX:o,targetY:a,sourceControlX:l,sourceControlY:u,targetControlX:d,targetControlY:f});return[`M${t},${e} C${l},${u} ${d},${f} ${o},${a}`,g,m,p,v]}function zN(t){return x.memo(({id:e,sourceX:n,sourceY:o,targetX:a,targetY:i,sourcePosition:l,targetPosition:u,label:d,labelStyle:f,labelShowBg:g,labelBgStyle:m,labelBgPadding:p,labelBgBorderRadius:v,style:S,markerEnd:C,markerStart:w,interactionWidth:M})=>{const[R,E,N]=jN({sourceX:n,sourceY:o,sourcePosition:l,targetX:a,targetY:i,targetPosition:u}),D=t.isInternal?void 0:e;return y.jsx(hh,{id:D,path:R,labelX:E,labelY:N,label:d,labelStyle:f,labelShowBg:g,labelBgStyle:m,labelBgPadding:p,labelBgBorderRadius:v,style:S,markerEnd:C,markerStart:w,interactionWidth:M})})}const EB=zN({isInternal:!1}),IN=zN({isInternal:!0});EB.displayName="SimpleBezierEdge";IN.displayName="SimpleBezierEdgeInternal";function PN(t){return x.memo(({id:e,sourceX:n,sourceY:o,targetX:a,targetY:i,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:m,style:p,sourcePosition:v=qe.Bottom,targetPosition:S=qe.Top,markerEnd:C,markerStart:w,pathOptions:M,interactionWidth:R})=>{const[E,N,D]=Qp({sourceX:n,sourceY:o,sourcePosition:v,targetX:a,targetY:i,targetPosition:S,borderRadius:M?.borderRadius,offset:M?.offset,stepPosition:M?.stepPosition}),T=t.isInternal?void 0:e;return y.jsx(hh,{id:T,path:E,labelX:N,labelY:D,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:m,style:p,markerEnd:C,markerStart:w,interactionWidth:R})})}const $N=PN({isInternal:!1}),LN=PN({isInternal:!0});$N.displayName="SmoothStepEdge";LN.displayName="SmoothStepEdgeInternal";function HN(t){return x.memo(({id:e,...n})=>{const o=t.isInternal?void 0:e;return y.jsx($N,{...n,id:o,pathOptions:x.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const _B=HN({isInternal:!1}),BN=HN({isInternal:!0});_B.displayName="StepEdge";BN.displayName="StepEdgeInternal";function VN(t){return x.memo(({id:e,sourceX:n,sourceY:o,targetX:a,targetY:i,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:m,style:p,markerEnd:v,markerStart:S,interactionWidth:C})=>{const[w,M,R]=aN({sourceX:n,sourceY:o,targetX:a,targetY:i}),E=t.isInternal?void 0:e;return y.jsx(hh,{id:E,path:w,labelX:M,labelY:R,label:l,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:m,style:p,markerEnd:v,markerStart:S,interactionWidth:C})})}const MB=VN({isInternal:!1}),FN=VN({isInternal:!0});MB.displayName="StraightEdge";FN.displayName="StraightEdgeInternal";function UN(t){return x.memo(({id:e,sourceX:n,sourceY:o,targetX:a,targetY:i,sourcePosition:l=qe.Bottom,targetPosition:u=qe.Top,label:d,labelStyle:f,labelShowBg:g,labelBgStyle:m,labelBgPadding:p,labelBgBorderRadius:v,style:S,markerEnd:C,markerStart:w,pathOptions:M,interactionWidth:R})=>{const[E,N,D]=oN({sourceX:n,sourceY:o,sourcePosition:l,targetX:a,targetY:i,targetPosition:u,curvature:M?.curvature}),T=t.isInternal?void 0:e;return y.jsx(hh,{id:T,path:E,labelX:N,labelY:D,label:d,labelStyle:f,labelShowBg:g,labelBgStyle:m,labelBgPadding:p,labelBgBorderRadius:v,style:S,markerEnd:C,markerStart:w,interactionWidth:R})})}const NB=UN({isInternal:!1}),YN=UN({isInternal:!0});NB.displayName="BezierEdge";YN.displayName="BezierEdgeInternal";const HS={default:YN,straight:FN,step:BN,smoothstep:LN,simplebezier:IN},BS={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},RB=(t,e,n)=>n===qe.Left?t-e:n===qe.Right?t+e:t,DB=(t,e,n)=>n===qe.Top?t-e:n===qe.Bottom?t+e:t,VS="react-flow__edgeupdater";function FS({position:t,centerX:e,centerY:n,radius:o=10,onMouseDown:a,onMouseEnter:i,onMouseOut:l,type:u}){return y.jsx("circle",{onMouseDown:a,onMouseEnter:i,onMouseOut:l,className:Mn([VS,`${VS}-${u}`]),cx:RB(e,o,t),cy:DB(n,o,t),r:o,stroke:"transparent",fill:"transparent"})}function TB({isReconnectable:t,reconnectRadius:e,edge:n,sourceX:o,sourceY:a,targetX:i,targetY:l,sourcePosition:u,targetPosition:d,onReconnect:f,onReconnectStart:g,onReconnectEnd:m,setReconnecting:p,setUpdateHover:v}){const S=sn(),C=(N,D)=>{if(N.button!==0)return;const{autoPanOnConnect:T,domNode:k,isValidConnection:A,connectionMode:B,connectionRadius:W,lib:U,onConnectStart:Y,onConnectEnd:Z,cancelConnection:I,nodeLookup:G,rfId:j,panBy:L,updateConnection:$}=S.getState(),H=D.type==="target",X=(V,q)=>{p(!1),m?.(V,n,D.type,q)},P=V=>f?.(n,V),z=(V,q)=>{p(!0),g?.(N,n,D.type),Y?.(V,q)};t0.onPointerDown(N.nativeEvent,{autoPanOnConnect:T,connectionMode:B,connectionRadius:W,domNode:k,handleId:D.id,nodeId:D.nodeId,nodeLookup:G,isTarget:H,edgeUpdaterType:D.type,lib:U,flowId:j,cancelConnection:I,panBy:L,isValidConnection:A,onConnect:P,onConnectStart:z,onConnectEnd:Z,onReconnectEnd:X,updateConnection:$,getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,dragThreshold:S.getState().connectionDragThreshold,handleDomNode:N.currentTarget})},w=N=>C(N,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),M=N=>C(N,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),R=()=>v(!0),E=()=>v(!1);return y.jsxs(y.Fragment,{children:[(t===!0||t==="source")&&y.jsx(FS,{position:u,centerX:o,centerY:a,radius:e,onMouseDown:w,onMouseEnter:R,onMouseOut:E,type:"source"}),(t===!0||t==="target")&&y.jsx(FS,{position:d,centerX:i,centerY:l,radius:e,onMouseDown:M,onMouseEnter:R,onMouseOut:E,type:"target"})]})}function kB({id:t,edgesFocusable:e,edgesReconnectable:n,elementsSelectable:o,onClick:a,onDoubleClick:i,onContextMenu:l,onMouseEnter:u,onMouseMove:d,onMouseLeave:f,reconnectRadius:g,onReconnect:m,onReconnectStart:p,onReconnectEnd:v,rfId:S,edgeTypes:C,noPanClassName:w,onError:M,disableKeyboardA11y:R}){let E=St(se=>se.edgeLookup.get(t));const N=St(se=>se.defaultEdgeOptions);E=N?{...N,...E}:E;let D=E.type||"default",T=C?.[D]||HS[D];T===void 0&&(M?.("011",Cr.error011(D)),D="default",T=C?.default||HS.default);const k=!!(E.focusable||e&&typeof E.focusable>"u"),A=typeof m<"u"&&(E.reconnectable||n&&typeof E.reconnectable>"u"),B=!!(E.selectable||o&&typeof E.selectable>"u"),W=x.useRef(null),[U,Y]=x.useState(!1),[Z,I]=x.useState(!1),G=sn(),{zIndex:j,sourceX:L,sourceY:$,targetX:H,targetY:X,sourcePosition:P,targetPosition:z}=St(x.useCallback(se=>{const ve=se.nodeLookup.get(E.source),De=se.nodeLookup.get(E.target);if(!ve||!De)return{zIndex:E.zIndex,...BS};const Be=E9({id:t,sourceNode:ve,targetNode:De,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:se.connectionMode,onError:M});return{zIndex:p9({selected:E.selected,zIndex:E.zIndex,sourceNode:ve,targetNode:De,elevateOnSelect:se.elevateEdgesOnSelect,zIndexMode:se.zIndexMode}),...Be||BS}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),an),V=x.useMemo(()=>E.markerStart?`url('#${Jp(E.markerStart,S)}')`:void 0,[E.markerStart,S]),q=x.useMemo(()=>E.markerEnd?`url('#${Jp(E.markerEnd,S)}')`:void 0,[E.markerEnd,S]);if(E.hidden||L===null||$===null||H===null||X===null)return null;const J=se=>{const{addSelectedEdges:ve,unselectNodesAndEdges:De,multiSelectionActive:Be}=G.getState();B&&(G.setState({nodesSelectionActive:!1}),E.selected&&Be?(De({nodes:[],edges:[E]}),W.current?.blur()):ve([t])),a&&a(se,E)},oe=i?se=>{i(se,{...E})}:void 0,K=l?se=>{l(se,{...E})}:void 0,ee=u?se=>{u(se,{...E})}:void 0,ae=d?se=>{d(se,{...E})}:void 0,ce=f?se=>{f(se,{...E})}:void 0,ge=se=>{if(!R&&FM.includes(se.key)&&B){const{unselectNodesAndEdges:ve,addSelectedEdges:De}=G.getState();se.key==="Escape"?(W.current?.blur(),ve({edges:[E]})):De([t])}};return y.jsx("svg",{style:{zIndex:j},children:y.jsxs("g",{className:Mn(["react-flow__edge",`react-flow__edge-${D}`,E.className,w,{selected:E.selected,animated:E.animated,inactive:!B&&!a,updating:U,selectable:B}]),onClick:J,onDoubleClick:oe,onContextMenu:K,onMouseEnter:ee,onMouseMove:ae,onMouseLeave:ce,onKeyDown:k?ge:void 0,tabIndex:k?0:void 0,role:E.ariaRole??(k?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":k?`${bN}-${S}`:void 0,ref:W,...E.domAttributes,children:[!Z&&y.jsx(T,{id:t,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:B,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:L,sourceY:$,targetX:H,targetY:X,sourcePosition:P,targetPosition:z,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:V,markerEnd:q,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),A&&y.jsx(TB,{edge:E,isReconnectable:A,reconnectRadius:g,onReconnect:m,onReconnectStart:p,onReconnectEnd:v,sourceX:L,sourceY:$,targetX:H,targetY:X,sourcePosition:P,targetPosition:z,setUpdateHover:Y,setReconnecting:I})]})})}var OB=x.memo(kB);const AB=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function GN({defaultMarkerColor:t,onlyRenderVisibleElements:e,rfId:n,edgeTypes:o,noPanClassName:a,onReconnect:i,onEdgeContextMenu:l,onEdgeMouseEnter:u,onEdgeMouseMove:d,onEdgeMouseLeave:f,onEdgeClick:g,reconnectRadius:m,onEdgeDoubleClick:p,onReconnectStart:v,onReconnectEnd:S,disableKeyboardA11y:C}){const{edgesFocusable:w,edgesReconnectable:M,elementsSelectable:R,onError:E}=St(AB,an),N=yB(e);return y.jsxs("div",{className:"react-flow__edges",children:[y.jsx(SB,{defaultColor:t,rfId:n}),N.map(D=>y.jsx(OB,{id:D,edgesFocusable:w,edgesReconnectable:M,elementsSelectable:R,noPanClassName:a,onReconnect:i,onContextMenu:l,onMouseEnter:u,onMouseMove:d,onMouseLeave:f,onClick:g,reconnectRadius:m,onDoubleClick:p,onReconnectStart:v,onReconnectEnd:S,rfId:n,onError:E,edgeTypes:o,disableKeyboardA11y:C},D))]})}GN.displayName="EdgeRenderer";const jB=x.memo(GN),zB=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function IB({children:t}){const e=St(zB);return y.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:e},children:t})}function PB(t){const e=dh(),n=x.useRef(!1);x.useEffect(()=>{!n.current&&e.viewportInitialized&&t&&(setTimeout(()=>t(e),1),n.current=!0)},[t,e.viewportInitialized])}const $B=t=>t.panZoom?.syncViewport;function LB(t){const e=St($B),n=sn();return x.useEffect(()=>{t&&(e?.(t),n.setState({transform:[t.x,t.y,t.zoom]}))},[t,e]),null}function HB(t){return t.connection.inProgress?{...t.connection,to:au(t.connection.to,t.transform)}:{...t.connection}}function BB(t){return HB}function VB(t){const e=BB();return St(e,an)}const FB=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function UB({containerStyle:t,style:e,type:n,component:o}){const{nodesConnectable:a,width:i,height:l,isValid:u,inProgress:d}=St(FB,an);return!(i&&a&&d)?null:y.jsx("svg",{style:t,width:i,height:l,className:"react-flow__connectionline react-flow__container",children:y.jsx("g",{className:Mn(["react-flow__connection",GM(u)]),children:y.jsx(qN,{style:e,type:n,CustomComponent:o,isValid:u})})})}const qN=({style:t,type:e=Va.Bezier,CustomComponent:n,isValid:o})=>{const{inProgress:a,from:i,fromNode:l,fromHandle:u,fromPosition:d,to:f,toNode:g,toHandle:m,toPosition:p,pointer:v}=VB();if(!a)return;if(n)return y.jsx(n,{connectionLineType:e,connectionLineStyle:t,fromNode:l,fromHandle:u,fromX:i.x,fromY:i.y,toX:f.x,toY:f.y,fromPosition:d,toPosition:p,connectionStatus:GM(o),toNode:g,toHandle:m,pointer:v});let S="";const C={sourceX:i.x,sourceY:i.y,sourcePosition:d,targetX:f.x,targetY:f.y,targetPosition:p};switch(e){case Va.Bezier:[S]=oN(C);break;case Va.SimpleBezier:[S]=jN(C);break;case Va.Step:[S]=Qp({...C,borderRadius:0});break;case Va.SmoothStep:[S]=Qp(C);break;default:[S]=aN(C)}return y.jsx("path",{d:S,fill:"none",className:"react-flow__connection-path",style:t})};qN.displayName="ConnectionLine";const YB={};function US(t=YB){x.useRef(t),sn(),x.useEffect(()=>{},[t])}function GB(){sn(),x.useRef(!1),x.useEffect(()=>{},[])}function WN({nodeTypes:t,edgeTypes:e,onInit:n,onNodeClick:o,onEdgeClick:a,onNodeDoubleClick:i,onEdgeDoubleClick:l,onNodeMouseEnter:u,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:g,onSelectionContextMenu:m,onSelectionStart:p,onSelectionEnd:v,connectionLineType:S,connectionLineStyle:C,connectionLineComponent:w,connectionLineContainerStyle:M,selectionKeyCode:R,selectionOnDrag:E,selectionMode:N,multiSelectionKeyCode:D,panActivationKeyCode:T,zoomActivationKeyCode:k,deleteKeyCode:A,onlyRenderVisibleElements:B,elementsSelectable:W,defaultViewport:U,translateExtent:Y,minZoom:Z,maxZoom:I,preventScrolling:G,defaultMarkerColor:j,zoomOnScroll:L,zoomOnPinch:$,panOnScroll:H,panOnScrollSpeed:X,panOnScrollMode:P,zoomOnDoubleClick:z,panOnDrag:V,onPaneClick:q,onPaneMouseEnter:J,onPaneMouseMove:oe,onPaneMouseLeave:K,onPaneScroll:ee,onPaneContextMenu:ae,paneClickDistance:ce,nodeClickDistance:ge,onEdgeContextMenu:se,onEdgeMouseEnter:ve,onEdgeMouseMove:De,onEdgeMouseLeave:Be,reconnectRadius:Ie,onReconnect:lt,onReconnectStart:ln,onReconnectEnd:ht,noDragClassName:bn,noWheelClassName:cn,noPanClassName:Vt,disableKeyboardA11y:mn,nodeExtent:zt,rfId:Nn,viewport:yn,onViewportChange:In}){return US(t),US(e),GB(),PB(n),LB(yn),y.jsx(iB,{onPaneClick:q,onPaneMouseEnter:J,onPaneMouseMove:oe,onPaneMouseLeave:K,onPaneContextMenu:ae,onPaneScroll:ee,paneClickDistance:ce,deleteKeyCode:A,selectionKeyCode:R,selectionOnDrag:E,selectionMode:N,onSelectionStart:p,onSelectionEnd:v,multiSelectionKeyCode:D,panActivationKeyCode:T,zoomActivationKeyCode:k,elementsSelectable:W,zoomOnScroll:L,zoomOnPinch:$,zoomOnDoubleClick:z,panOnScroll:H,panOnScrollSpeed:X,panOnScrollMode:P,panOnDrag:V,defaultViewport:U,translateExtent:Y,minZoom:Z,maxZoom:I,onSelectionContextMenu:m,preventScrolling:G,noDragClassName:bn,noWheelClassName:cn,noPanClassName:Vt,disableKeyboardA11y:mn,onViewportChange:In,isControlledViewport:!!yn,children:y.jsxs(IB,{children:[y.jsx(jB,{edgeTypes:e,onEdgeClick:a,onEdgeDoubleClick:l,onReconnect:lt,onReconnectStart:ln,onReconnectEnd:ht,onlyRenderVisibleElements:B,onEdgeContextMenu:se,onEdgeMouseEnter:ve,onEdgeMouseMove:De,onEdgeMouseLeave:Be,reconnectRadius:Ie,defaultMarkerColor:j,noPanClassName:Vt,disableKeyboardA11y:mn,rfId:Nn}),y.jsx(UB,{style:C,type:S,component:w,containerStyle:M}),y.jsx("div",{className:"react-flow__edgelabel-renderer"}),y.jsx(pB,{nodeTypes:t,onNodeClick:o,onNodeDoubleClick:i,onNodeMouseEnter:u,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:g,nodeClickDistance:ge,onlyRenderVisibleElements:B,noPanClassName:Vt,noDragClassName:bn,disableKeyboardA11y:mn,nodeExtent:zt,rfId:Nn}),y.jsx("div",{className:"react-flow__viewport-portal"})]})})}WN.displayName="GraphView";const qB=x.memo(WN),YS=({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,width:a,height:i,fitView:l,fitViewOptions:u,minZoom:d=.5,maxZoom:f=2,nodeOrigin:g,nodeExtent:m,zIndexMode:p="basic"}={})=>{const v=new Map,S=new Map,C=new Map,w=new Map,M=o??e??[],R=n??t??[],E=g??[0,0],N=m??Ac;lN(C,w,M);const D=e0(R,v,S,{nodeOrigin:E,nodeExtent:N,zIndexMode:p});let T=[0,0,1];if(l&&a&&i){const k=ou(v,{filter:U=>!!((U.width||U.initialWidth)&&(U.height||U.initialHeight))}),{x:A,y:B,zoom:W}=Ny(k,a,i,d,f,u?.padding??.1);T=[A,B,W]}return{rfId:"1",width:a??0,height:i??0,transform:T,nodes:R,nodesInitialized:D,nodeLookup:v,parentLookup:S,edges:M,edgeLookup:w,connectionLookup:C,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:d,maxZoom:f,translateExtent:Ac,nodeExtent:N,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Ui.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,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:{...YM},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:u9,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:UM,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},WB=({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,width:a,height:i,fitView:l,fitViewOptions:u,minZoom:d,maxZoom:f,nodeOrigin:g,nodeExtent:m,zIndexMode:p})=>fH((v,S)=>{async function C(){const{nodeLookup:w,panZoom:M,fitViewOptions:R,fitViewResolver:E,width:N,height:D,minZoom:T,maxZoom:k}=S();M&&(await l9({nodes:w,width:N,height:D,panZoom:M,minZoom:T,maxZoom:k},R),E?.resolve(!0),v({fitViewResolver:null}))}return{...YS({nodes:t,edges:e,width:a,height:i,fitView:l,fitViewOptions:u,minZoom:d,maxZoom:f,nodeOrigin:g,nodeExtent:m,defaultNodes:n,defaultEdges:o,zIndexMode:p}),setNodes:w=>{const{nodeLookup:M,parentLookup:R,nodeOrigin:E,elevateNodesOnSelect:N,fitViewQueued:D,zIndexMode:T}=S(),k=e0(w,M,R,{nodeOrigin:E,nodeExtent:m,elevateNodesOnSelect:N,checkEquality:!0,zIndexMode:T});D&&k?(C(),v({nodes:w,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0})):v({nodes:w,nodesInitialized:k})},setEdges:w=>{const{connectionLookup:M,edgeLookup:R}=S();lN(M,R,w),v({edges:w})},setDefaultNodesAndEdges:(w,M)=>{if(w){const{setNodes:R}=S();R(w),v({hasDefaultNodes:!0})}if(M){const{setEdges:R}=S();R(M),v({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:M,nodeLookup:R,parentLookup:E,domNode:N,nodeOrigin:D,nodeExtent:T,debug:k,fitViewQueued:A,zIndexMode:B}=S(),{changes:W,updatedInternals:U}=O9(w,R,E,N,D,T,B);U&&(R9(R,E,{nodeOrigin:D,nodeExtent:T,zIndexMode:B}),A?(C(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),W?.length>0&&(k&&console.log("React Flow: trigger node changes",W),M?.(W)))},updateNodePositions:(w,M=!1)=>{const R=[];let E=[];const{nodeLookup:N,triggerNodeChanges:D,connection:T,updateConnection:k,onNodesChangeMiddlewareMap:A}=S();for(const[B,W]of w){const U=N.get(B),Y=!!(U?.expandParent&&U?.parentId&&W?.position),Z={id:B,type:"position",position:Y?{x:Math.max(0,W.position.x),y:Math.max(0,W.position.y)}:W.position,dragging:M};if(U&&T.inProgress&&T.fromNode.id===U.id){const I=Ps(U,T.fromHandle,qe.Left,!0);k({...T,from:I})}Y&&U.parentId&&R.push({id:B,parentId:U.parentId,rect:{...W.internals.positionAbsolute,width:W.measured.width??0,height:W.measured.height??0}}),E.push(Z)}if(R.length>0){const{parentLookup:B,nodeOrigin:W}=S(),U=jy(R,N,B,W);E.push(...U)}for(const B of A.values())E=B(E);D(E)},triggerNodeChanges:w=>{const{onNodesChange:M,setNodes:R,nodes:E,hasDefaultNodes:N,debug:D}=S();if(w?.length){if(N){const T=CN(w,E);R(T)}D&&console.log("React Flow: trigger node changes",w),M?.(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:M,setEdges:R,edges:E,hasDefaultEdges:N,debug:D}=S();if(w?.length){if(N){const T=EN(w,E);R(T)}D&&console.log("React Flow: trigger edge changes",w),M?.(w)}},addSelectedNodes:w=>{const{multiSelectionActive:M,edgeLookup:R,nodeLookup:E,triggerNodeChanges:N,triggerEdgeChanges:D}=S();if(M){const T=w.map(k=>Cs(k,!0));N(T);return}N(Ai(E,new Set([...w]),!0)),D(Ai(R))},addSelectedEdges:w=>{const{multiSelectionActive:M,edgeLookup:R,nodeLookup:E,triggerNodeChanges:N,triggerEdgeChanges:D}=S();if(M){const T=w.map(k=>Cs(k,!0));D(T);return}D(Ai(R,new Set([...w]))),N(Ai(E,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:M}={})=>{const{edges:R,nodes:E,nodeLookup:N,triggerNodeChanges:D,triggerEdgeChanges:T}=S(),k=w||E,A=M||R,B=k.map(U=>{const Y=N.get(U.id);return Y&&(Y.selected=!1),Cs(U.id,!1)}),W=A.map(U=>Cs(U.id,!1));D(B),T(W)},setMinZoom:w=>{const{panZoom:M,maxZoom:R}=S();M?.setScaleExtent([w,R]),v({minZoom:w})},setMaxZoom:w=>{const{panZoom:M,minZoom:R}=S();M?.setScaleExtent([R,w]),v({maxZoom:w})},setTranslateExtent:w=>{S().panZoom?.setTranslateExtent(w),v({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:M,triggerNodeChanges:R,triggerEdgeChanges:E,elementsSelectable:N}=S();if(!N)return;const D=M.reduce((k,A)=>A.selected?[...k,Cs(A.id,!1)]:k,[]),T=w.reduce((k,A)=>A.selected?[...k,Cs(A.id,!1)]:k,[]);R(D),E(T)},setNodeExtent:w=>{const{nodes:M,nodeLookup:R,parentLookup:E,nodeOrigin:N,elevateNodesOnSelect:D,nodeExtent:T,zIndexMode:k}=S();w[0][0]===T[0][0]&&w[0][1]===T[0][1]&&w[1][0]===T[1][0]&&w[1][1]===T[1][1]||(e0(M,R,E,{nodeOrigin:N,nodeExtent:w,elevateNodesOnSelect:D,checkEquality:!1,zIndexMode:k}),v({nodeExtent:w}))},panBy:w=>{const{transform:M,width:R,height:E,panZoom:N,translateExtent:D}=S();return A9({delta:w,panZoom:N,transform:M,translateExtent:D,width:R,height:E})},setCenter:async(w,M,R)=>{const{width:E,height:N,maxZoom:D,panZoom:T}=S();if(!T)return Promise.resolve(!1);const k=typeof R?.zoom<"u"?R.zoom:D;return await T.setViewport({x:E/2-w*k,y:N/2-M*k,zoom:k},{duration:R?.duration,ease:R?.ease,interpolate:R?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{v({connection:{...YM}})},updateConnection:w=>{v({connection:w})},reset:()=>v({...YS()})}},Object.is);function KB({initialNodes:t,initialEdges:e,defaultNodes:n,defaultEdges:o,initialWidth:a,initialHeight:i,initialMinZoom:l,initialMaxZoom:u,initialFitViewOptions:d,fitView:f,nodeOrigin:g,nodeExtent:m,zIndexMode:p,children:v}){const[S]=x.useState(()=>WB({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,width:a,height:i,fitView:f,minZoom:l,maxZoom:u,fitViewOptions:d,nodeOrigin:g,nodeExtent:m,zIndexMode:p}));return y.jsx(hH,{value:S,children:y.jsx(IH,{children:v})})}function XB({children:t,nodes:e,edges:n,defaultNodes:o,defaultEdges:a,width:i,height:l,fitView:u,fitViewOptions:d,minZoom:f,maxZoom:g,nodeOrigin:m,nodeExtent:p,zIndexMode:v}){return x.useContext(ch)?y.jsx(y.Fragment,{children:t}):y.jsx(KB,{initialNodes:e,initialEdges:n,defaultNodes:o,defaultEdges:a,initialWidth:i,initialHeight:l,fitView:u,initialFitViewOptions:d,initialMinZoom:f,initialMaxZoom:g,nodeOrigin:m,nodeExtent:p,zIndexMode:v,children:t})}const ZB={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function QB({nodes:t,edges:e,defaultNodes:n,defaultEdges:o,className:a,nodeTypes:i,edgeTypes:l,onNodeClick:u,onEdgeClick:d,onInit:f,onMove:g,onMoveStart:m,onMoveEnd:p,onConnect:v,onConnectStart:S,onConnectEnd:C,onClickConnectStart:w,onClickConnectEnd:M,onNodeMouseEnter:R,onNodeMouseMove:E,onNodeMouseLeave:N,onNodeContextMenu:D,onNodeDoubleClick:T,onNodeDragStart:k,onNodeDrag:A,onNodeDragStop:B,onNodesDelete:W,onEdgesDelete:U,onDelete:Y,onSelectionChange:Z,onSelectionDragStart:I,onSelectionDrag:G,onSelectionDragStop:j,onSelectionContextMenu:L,onSelectionStart:$,onSelectionEnd:H,onBeforeDelete:X,connectionMode:P,connectionLineType:z=Va.Bezier,connectionLineStyle:V,connectionLineComponent:q,connectionLineContainerStyle:J,deleteKeyCode:oe="Backspace",selectionKeyCode:K="Shift",selectionOnDrag:ee=!1,selectionMode:ae=jc.Full,panActivationKeyCode:ce="Space",multiSelectionKeyCode:ge=Ic()?"Meta":"Control",zoomActivationKeyCode:se=Ic()?"Meta":"Control",snapToGrid:ve,snapGrid:De,onlyRenderVisibleElements:Be=!1,selectNodesOnDrag:Ie,nodesDraggable:lt,autoPanOnNodeFocus:ln,nodesConnectable:ht,nodesFocusable:bn,nodeOrigin:cn=wN,edgesFocusable:Vt,edgesReconnectable:mn,elementsSelectable:zt=!0,defaultViewport:Nn=MH,minZoom:yn=.5,maxZoom:In=2,translateExtent:jn=Ac,preventScrolling:_e=!0,nodeExtent:Ue,defaultMarkerColor:Et="#b1b1b7",zoomOnScroll:Xe=!0,zoomOnPinch:at=!0,panOnScroll:gt=!1,panOnScrollSpeed:qt=.5,panOnScrollMode:Wt=Ds.Free,zoomOnDoubleClick:Qn=!0,panOnDrag:_t=!0,onPaneClick:Ve,onPaneMouseEnter:nt,onPaneMouseMove:Ye,onPaneMouseLeave:st,onPaneScroll:$t,onPaneContextMenu:Te,paneClickDistance:Ot=1,nodeClickDistance:Kt=0,children:un,onReconnect:Pn,onReconnectStart:Dt,onReconnectEnd:Rn,onEdgeContextMenu:Uo,onEdgeDoubleClick:vt,onEdgeMouseEnter:Dn,onEdgeMouseMove:Do,onEdgeMouseLeave:Un,reconnectRadius:lo=10,onNodesChange:Dr,onEdgesChange:co,noDragClassName:dn="nodrag",noWheelClassName:Tn="nowheel",noPanClassName:To="nopan",fitView:Tr,fitViewOptions:rs,connectOnClick:Q,attributionPosition:ne,proOptions:le,defaultEdgeOptions:ye,elevateNodesOnSelect:we=!0,elevateEdgesOnSelect:Ne=!1,disableKeyboardA11y:Pe=!1,autoPanOnConnect:je,autoPanOnNodeDrag:Se,autoPanSpeed:Re,connectionRadius:ke,isValidConnection:Ae,onError:xe,style:Oe,id:ot,nodeDragThreshold:Ct,connectionDragThreshold:Mt,viewport:ct,onViewportChange:It,width:rt,height:mt,colorMode:Pt="light",debug:Yn,onScroll:kn,ariaLabelConfig:$n,zIndexMode:Qt="basic",...kr},Ze){const uo=ot||"1",ir=TH(Pt),as=x.useCallback(At=>{At.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),kn?.(At)},[kn]);return y.jsx("div",{"data-testid":"rf__wrapper",...kr,onScroll:as,style:{...Oe,...ZB},ref:Ze,className:Mn(["react-flow",a,ir]),id:ot,role:"application",children:y.jsxs(XB,{nodes:t,edges:e,width:rt,height:mt,fitView:Tr,fitViewOptions:rs,minZoom:yn,maxZoom:In,nodeOrigin:cn,nodeExtent:Ue,zIndexMode:Qt,children:[y.jsx(qB,{onInit:f,onNodeClick:u,onEdgeClick:d,onNodeMouseEnter:R,onNodeMouseMove:E,onNodeMouseLeave:N,onNodeContextMenu:D,onNodeDoubleClick:T,nodeTypes:i,edgeTypes:l,connectionLineType:z,connectionLineStyle:V,connectionLineComponent:q,connectionLineContainerStyle:J,selectionKeyCode:K,selectionOnDrag:ee,selectionMode:ae,deleteKeyCode:oe,multiSelectionKeyCode:ge,panActivationKeyCode:ce,zoomActivationKeyCode:se,onlyRenderVisibleElements:Be,defaultViewport:Nn,translateExtent:jn,minZoom:yn,maxZoom:In,preventScrolling:_e,zoomOnScroll:Xe,zoomOnPinch:at,zoomOnDoubleClick:Qn,panOnScroll:gt,panOnScrollSpeed:qt,panOnScrollMode:Wt,panOnDrag:_t,onPaneClick:Ve,onPaneMouseEnter:nt,onPaneMouseMove:Ye,onPaneMouseLeave:st,onPaneScroll:$t,onPaneContextMenu:Te,paneClickDistance:Ot,nodeClickDistance:Kt,onSelectionContextMenu:L,onSelectionStart:$,onSelectionEnd:H,onReconnect:Pn,onReconnectStart:Dt,onReconnectEnd:Rn,onEdgeContextMenu:Uo,onEdgeDoubleClick:vt,onEdgeMouseEnter:Dn,onEdgeMouseMove:Do,onEdgeMouseLeave:Un,reconnectRadius:lo,defaultMarkerColor:Et,noDragClassName:dn,noWheelClassName:Tn,noPanClassName:To,rfId:uo,disableKeyboardA11y:Pe,nodeExtent:Ue,viewport:ct,onViewportChange:It}),y.jsx(DH,{nodes:t,edges:e,defaultNodes:n,defaultEdges:o,onConnect:v,onConnectStart:S,onConnectEnd:C,onClickConnectStart:w,onClickConnectEnd:M,nodesDraggable:lt,autoPanOnNodeFocus:ln,nodesConnectable:ht,nodesFocusable:bn,edgesFocusable:Vt,edgesReconnectable:mn,elementsSelectable:zt,elevateNodesOnSelect:we,elevateEdgesOnSelect:Ne,minZoom:yn,maxZoom:In,nodeExtent:Ue,onNodesChange:Dr,onEdgesChange:co,snapToGrid:ve,snapGrid:De,connectionMode:P,translateExtent:jn,connectOnClick:Q,defaultEdgeOptions:ye,fitView:Tr,fitViewOptions:rs,onNodesDelete:W,onEdgesDelete:U,onDelete:Y,onNodeDragStart:k,onNodeDrag:A,onNodeDragStop:B,onSelectionDrag:G,onSelectionDragStart:I,onSelectionDragStop:j,onMove:g,onMoveStart:m,onMoveEnd:p,noPanClassName:To,nodeOrigin:cn,rfId:uo,autoPanOnConnect:je,autoPanOnNodeDrag:Se,autoPanSpeed:Re,onError:xe,connectionRadius:ke,isValidConnection:Ae,selectNodesOnDrag:Ie,nodeDragThreshold:Ct,connectionDragThreshold:Mt,onBeforeDelete:X,debug:Yn,ariaLabelConfig:$n,zIndexMode:Qt}),y.jsx(_H,{onSelectionChange:Z}),un,y.jsx(bH,{proOptions:le,position:ne}),y.jsx(xH,{rfId:uo,disableKeyboardA11y:Pe})]})})}var JB=_N(QB);function eV(t){const[e,n]=x.useState(t),o=x.useCallback(a=>n(i=>CN(a,i)),[]);return[e,n,o]}function tV(t){const[e,n]=x.useState(t),o=x.useCallback(a=>n(i=>EN(a,i)),[]);return[e,n,o]}const nV=t=>e=>{if(!t.includeHiddenNodes)return e.nodesInitialized;if(e.nodeLookup.size===0)return!1;for(const[,{internals:n}]of e.nodeLookup)if(n.handleBounds===void 0||!Ry(n.userNode))return!1;return!0};function oV(t={includeHiddenNodes:!1}){return St(nV(t))}function rV({dimensions:t,lineWidth:e,variant:n,className:o}){return y.jsx("path",{strokeWidth:e,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:Mn(["react-flow__background-pattern",n,o])})}function aV({radius:t,className:e}){return y.jsx("circle",{cx:t,cy:t,r:t,className:Mn(["react-flow__background-pattern","dots",e])})}var Ya;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Ya||(Ya={}));const sV={[Ya.Dots]:1,[Ya.Lines]:1,[Ya.Cross]:6},iV=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function KN({id:t,variant:e=Ya.Dots,gap:n=20,size:o,lineWidth:a=1,offset:i=0,color:l,bgColor:u,style:d,className:f,patternClassName:g}){const m=x.useRef(null),{transform:p,patternId:v}=St(iV,an),S=o||sV[e],C=e===Ya.Dots,w=e===Ya.Cross,M=Array.isArray(n)?n:[n,n],R=[M[0]*p[2]||1,M[1]*p[2]||1],E=S*p[2],N=Array.isArray(i)?i:[i,i],D=w?[E,E]:R,T=[N[0]*p[2]||1+D[0]/2,N[1]*p[2]||1+D[1]/2],k=`${v}${t||""}`;return y.jsxs("svg",{className:Mn(["react-flow__background",f]),style:{...d,...fh,"--xy-background-color-props":u,"--xy-background-pattern-color-props":l},ref:m,"data-testid":"rf__background",children:[y.jsx("pattern",{id:k,x:p[0]%R[0],y:p[1]%R[1],width:R[0],height:R[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:C?y.jsx(aV,{radius:E/2,className:g}):y.jsx(rV,{dimensions:D,lineWidth:a,variant:e,className:g})}),y.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${k})`})]})}KN.displayName="Background";const lV=x.memo(KN);function cV(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:y.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function uV(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:y.jsx("path",{d:"M0 0h32v4.2H0z"})})}function dV(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:y.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 fV(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.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 hV(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.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 Bd({children:t,className:e,...n}){return y.jsx("button",{type:"button",className:Mn(["react-flow__controls-button",e]),...n,children:t})}const mV=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function XN({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:a,onZoomIn:i,onZoomOut:l,onFitView:u,onInteractiveChange:d,className:f,children:g,position:m="bottom-left",orientation:p="vertical","aria-label":v}){const S=sn(),{isInteractive:C,minZoomReached:w,maxZoomReached:M,ariaLabelConfig:R}=St(mV,an),{zoomIn:E,zoomOut:N,fitView:D}=dh(),T=()=>{E(),i?.()},k=()=>{N(),l?.()},A=()=>{D(a),u?.()},B=()=>{S.setState({nodesDraggable:!C,nodesConnectable:!C,elementsSelectable:!C}),d?.(!C)},W=p==="horizontal"?"horizontal":"vertical";return y.jsxs(uh,{className:Mn(["react-flow__controls",W,f]),position:m,style:t,"data-testid":"rf__controls","aria-label":v??R["controls.ariaLabel"],children:[e&&y.jsxs(y.Fragment,{children:[y.jsx(Bd,{onClick:T,className:"react-flow__controls-zoomin",title:R["controls.zoomIn.ariaLabel"],"aria-label":R["controls.zoomIn.ariaLabel"],disabled:M,children:y.jsx(cV,{})}),y.jsx(Bd,{onClick:k,className:"react-flow__controls-zoomout",title:R["controls.zoomOut.ariaLabel"],"aria-label":R["controls.zoomOut.ariaLabel"],disabled:w,children:y.jsx(uV,{})})]}),n&&y.jsx(Bd,{className:"react-flow__controls-fitview",onClick:A,title:R["controls.fitView.ariaLabel"],"aria-label":R["controls.fitView.ariaLabel"],children:y.jsx(dV,{})}),o&&y.jsx(Bd,{className:"react-flow__controls-interactive",onClick:B,title:R["controls.interactive.ariaLabel"],"aria-label":R["controls.interactive.ariaLabel"],children:C?y.jsx(hV,{}):y.jsx(fV,{})}),g]})}XN.displayName="Controls";x.memo(XN);function gV({id:t,x:e,y:n,width:o,height:a,style:i,color:l,strokeColor:u,strokeWidth:d,className:f,borderRadius:g,shapeRendering:m,selected:p,onClick:v}){const{background:S,backgroundColor:C}=i||{},w=l||S||C;return y.jsx("rect",{className:Mn(["react-flow__minimap-node",{selected:p},f]),x:e,y:n,rx:g,ry:g,width:o,height:a,style:{fill:w,stroke:u,strokeWidth:d},shapeRendering:m,onClick:v?M=>v(M,t):void 0})}const pV=x.memo(gV),yV=t=>t.nodes.map(e=>e.id),ap=t=>t instanceof Function?t:()=>t;function vV({nodeStrokeColor:t,nodeColor:e,nodeClassName:n="",nodeBorderRadius:o=5,nodeStrokeWidth:a,nodeComponent:i=pV,onClick:l}){const u=St(yV,an),d=ap(e),f=ap(t),g=ap(n),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return y.jsx(y.Fragment,{children:u.map(p=>y.jsx(bV,{id:p,nodeColorFunc:d,nodeStrokeColorFunc:f,nodeClassNameFunc:g,nodeBorderRadius:o,nodeStrokeWidth:a,NodeComponent:i,onClick:l,shapeRendering:m},p))})}function xV({id:t,nodeColorFunc:e,nodeStrokeColorFunc:n,nodeClassNameFunc:o,nodeBorderRadius:a,nodeStrokeWidth:i,shapeRendering:l,NodeComponent:u,onClick:d}){const{node:f,x:g,y:m,width:p,height:v}=St(S=>{const{internals:C}=S.nodeLookup.get(t),w=C.userNode,{x:M,y:R}=C.positionAbsolute,{width:E,height:N}=da(w);return{node:w,x:M,y:R,width:E,height:N}},an);return!f||f.hidden||!Ry(f)?null:y.jsx(u,{x:g,y:m,width:p,height:v,style:f.style,selected:!!f.selected,className:o(f),color:e(f),borderRadius:a,strokeColor:n(f),strokeWidth:i,shapeRendering:l,onClick:d,id:f.id})}const bV=x.memo(xV);var wV=x.memo(vV);const SV=200,CV=150,EV=t=>!t.hidden,_V=t=>{const e={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:e,boundingRect:t.nodeLookup.size>0?ZM(ou(t.nodeLookup,{filter:EV}),e):e,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},MV="react-flow__minimap-desc";function ZN({style:t,className:e,nodeStrokeColor:n,nodeColor:o,nodeClassName:a="",nodeBorderRadius:i=5,nodeStrokeWidth:l,nodeComponent:u,bgColor:d,maskColor:f,maskStrokeColor:g,maskStrokeWidth:m,position:p="bottom-right",onClick:v,onNodeClick:S,pannable:C=!1,zoomable:w=!1,ariaLabel:M,inversePan:R,zoomStep:E=1,offsetScale:N=5}){const D=sn(),T=x.useRef(null),{boundingRect:k,viewBB:A,rfId:B,panZoom:W,translateExtent:U,flowWidth:Y,flowHeight:Z,ariaLabelConfig:I}=St(_V,an),G=t?.width??SV,j=t?.height??CV,L=k.width/G,$=k.height/j,H=Math.max(L,$),X=H*G,P=H*j,z=N*H,V=k.x-(X-k.width)/2-z,q=k.y-(P-k.height)/2-z,J=X+z*2,oe=P+z*2,K=`${MV}-${B}`,ee=x.useRef(0),ae=x.useRef();ee.current=H,x.useEffect(()=>{if(T.current&&W)return ae.current=V9({domNode:T.current,panZoom:W,getTransform:()=>D.getState().transform,getViewScale:()=>ee.current}),()=>{ae.current?.destroy()}},[W]),x.useEffect(()=>{ae.current?.update({translateExtent:U,width:Y,height:Z,inversePan:R,pannable:C,zoomStep:E,zoomable:w})},[C,w,R,E,U,Y,Z]);const ce=v?ve=>{const[De,Be]=ae.current?.pointer(ve)||[0,0];v(ve,{x:De,y:Be})}:void 0,ge=S?x.useCallback((ve,De)=>{const Be=D.getState().nodeLookup.get(De).internals.userNode;S(ve,Be)},[]):void 0,se=M??I["minimap.ariaLabel"];return y.jsx(uh,{position:p,style:{...t,"--xy-minimap-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-width-props":typeof m=="number"?m*H:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:Mn(["react-flow__minimap",e]),"data-testid":"rf__minimap",children:y.jsxs("svg",{width:G,height:j,viewBox:`${V} ${q} ${J} ${oe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":K,ref:T,onClick:ce,children:[se&&y.jsx("title",{id:K,children:se}),y.jsx(wV,{onClick:ge,nodeColor:o,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:a,nodeStrokeWidth:l,nodeComponent:u}),y.jsx("path",{className:"react-flow__minimap-mask",d:`M${V-z},${q-z}h${J+z*2}v${oe+z*2}h${-J-z*2}z
|
|
61
|
-
M${A.x},${A.y}h${A.width}v${A.height}h${-A.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}ZN.displayName="MiniMap";x.memo(ZN);const NV=t=>e=>t?`${Math.max(1/e.transform[2],1)}`:void 0,RV={[Wi.Line]:"right",[Wi.Handle]:"bottom-right"};function DV({nodeId:t,position:e,variant:n=Wi.Handle,className:o,style:a=void 0,children:i,color:l,minWidth:u=10,minHeight:d=10,maxWidth:f=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:p,autoScale:v=!0,shouldResize:S,onResizeStart:C,onResize:w,onResizeEnd:M}){const R=DN(),E=typeof t=="string"?t:R,N=sn(),D=x.useRef(null),T=n===Wi.Handle,k=St(x.useCallback(NV(T&&v),[T,v]),an),A=x.useRef(null),B=e??RV[n];x.useEffect(()=>{if(!(!D.current||!E))return A.current||(A.current=nH({domNode:D.current,nodeId:E,getStoreItems:()=>{const{nodeLookup:U,transform:Y,snapGrid:Z,snapToGrid:I,nodeOrigin:G,domNode:j}=N.getState();return{nodeLookup:U,transform:Y,snapGrid:Z,snapToGrid:I,nodeOrigin:G,paneDomNode:j}},onChange:(U,Y)=>{const{triggerNodeChanges:Z,nodeLookup:I,parentLookup:G,nodeOrigin:j}=N.getState(),L=[],$={x:U.x,y:U.y},H=I.get(E);if(H&&H.expandParent&&H.parentId){const X=H.origin??j,P=U.width??H.measured.width??0,z=U.height??H.measured.height??0,V={id:H.id,parentId:H.parentId,rect:{width:P,height:z,...QM({x:U.x??H.position.x,y:U.y??H.position.y},{width:P,height:z},H.parentId,I,X)}},q=jy([V],I,G,j);L.push(...q),$.x=U.x?Math.max(X[0]*P,U.x):void 0,$.y=U.y?Math.max(X[1]*z,U.y):void 0}if($.x!==void 0&&$.y!==void 0){const X={id:E,type:"position",position:{...$}};L.push(X)}if(U.width!==void 0&&U.height!==void 0){const P={id:E,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:U.width,height:U.height}};L.push(P)}for(const X of Y){const P={...X,type:"position"};L.push(P)}Z(L)},onEnd:({width:U,height:Y})=>{const Z={id:E,type:"dimensions",resizing:!1,dimensions:{width:U,height:Y}};N.getState().triggerNodeChanges([Z])}})),A.current.update({controlPosition:B,boundaries:{minWidth:u,minHeight:d,maxWidth:f,maxHeight:g},keepAspectRatio:m,resizeDirection:p,onResizeStart:C,onResize:w,onResizeEnd:M,shouldResize:S}),()=>{A.current?.destroy()}},[B,u,d,f,g,m,C,w,M,S]);const W=B.split("-");return y.jsx("div",{className:Mn(["react-flow__resize-control","nodrag",...W,n,o]),ref:D,style:{...a,scale:k,...l&&{[T?"backgroundColor":"borderColor"]:l}},children:i})}x.memo(DV);const TV={timestamptz:"timestamp with time zone",bool:"boolean",bytea:"bytea",jsonb:"jsonb",text:"text",varchar:"character varying",uuid:"uuid",date:"date",time:"time without time zone",timetz:"time with time zone",timestamp:"timestamp without time zone",int2:"smallint",int4:"integer",int8:"bigint",float4:"real",float8:"double precision",numeric:"numeric"};function su(t){if(t==null||t==="")return"";const e=t.trim().toLowerCase();return TV[e]??t}function kV(t){const e=be.c(14),{data:n}=t,{table:o}=n;let a;e[0]!==o.schema?(a=y.jsx("div",{className:"text-xs opacity-80",children:o.schema}),e[0]=o.schema,e[1]=a):a=e[1];let i;e[2]!==o.name?(i=y.jsx("div",{className:"text-base",children:o.name}),e[2]=o.name,e[3]=i):i=e[3];let l;e[4]!==a||e[5]!==i?(l=y.jsxs("div",{className:"bg-primary text-primary-foreground px-3 py-2 rounded-t-lg font-semibold",children:[a,i]}),e[4]=a,e[5]=i,e[6]=l):l=e[6];let u;e[7]!==o.columns?(u=o.columns.map(OV),e[7]=o.columns,e[8]=u):u=e[8];let d;e[9]!==u?(d=y.jsx("div",{className:"divide-y divide-border",children:u}),e[9]=u,e[10]=d):d=e[10];let f;return e[11]!==l||e[12]!==d?(f=y.jsxs("div",{className:"bg-card border border-border rounded-lg shadow-lg w-[250px]",children:[l,d]}),e[11]=l,e[12]=d,e[13]=f):f=e[13],f}function OV(t){return y.jsxs("div",{className:"px-3 py-1.5 text-sm flex items-center justify-between gap-2 hover:bg-accent/50 transition-colors relative",children:[y.jsxs("div",{className:"min-w-0 flex-1",children:[y.jsx("div",{className:"font-medium truncate text-card-foreground",children:t.name}),y.jsxs("div",{className:"text-xs text-muted-foreground truncate",children:[su(t.type),t.nullable?" (nullable)":" (not null)"]})]}),y.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[t.isPrimaryKey&&y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500",style:{boxShadow:"0 0 4px 1px rgba(16, 185, 129, 0.6), 0 0 8px 3px rgba(16, 185, 129, 0.3)"},title:"Primary Key"}),t.foreignKey&&y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400",style:{boxShadow:"0 0 4px 1px rgba(251, 191, 36, 0.6), 0 0 8px 3px rgba(251, 191, 36, 0.3)"},title:"Foreign Key"})]}),t.foreignKey&&y.jsx(Ki,{type:"source",position:qe.Right,id:`${t.name}-source`,className:"!w-2 !h-2 !border-0 !opacity-0",style:{background:"transparent",top:"50%",transform:"translateY(-50%)",right:0}}),t.isPrimaryKey&&y.jsx(Ki,{type:"target",position:qe.Left,id:`${t.name}-target`,className:"!w-2 !h-2 !border-0 !opacity-0",style:{background:"transparent",top:"50%",transform:"translateY(-50%)",left:0}})]},t.name)}function $c(t){const e=be.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(Vz,{"data-slot":"select",...n}),e[2]=n,e[3]=o):o=e[3],o}function Xi(t){const e=be.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(Uz,{"data-slot":"select-value",...n}),e[2]=n,e[3]=o):o=e[3],o}function Lc(t){const e=be.c(13);let n,o,a,i;e[0]!==t?({className:o,size:i,children:n,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i):(n=e[1],o=e[2],a=e[3],i=e[4]);const l=i===void 0?"default":i;let u;e[5]!==o?(u=Me("border-input data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border bg-transparent py-2 pr-2 pl-2.5 text-sm shadow-xs transition-[color,box-shadow] focus-visible:ring-[3px] aria-invalid:ring-[3px] data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",o),e[5]=o,e[6]=u):u=e[6];let d;e[7]===Symbol.for("react.memo_cache_sentinel")?(d=y.jsx(Yz,{asChild:!0,children:y.jsx(la,{className:"text-muted-foreground size-4 pointer-events-none"})}),e[7]=d):d=e[7];let f;return e[8]!==n||e[9]!==a||e[10]!==l||e[11]!==u?(f=y.jsxs(Fz,{"data-slot":"select-trigger","data-size":l,className:u,...a,children:[n,d]}),e[8]=n,e[9]=a,e[10]=l,e[11]=u,e[12]=f):f=e[12],f}function Hc(t){const e=be.c(28);let n,o,a,i,l,u,d;e[0]!==t?({className:o,children:n,position:i,align:l,side:u,avoidCollisions:d,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l,e[6]=u,e[7]=d):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5],u=e[6],d=e[7]);const f=i===void 0?"popper":i,g=l===void 0?"start":l,m=u===void 0?"bottom":u,p=d===void 0?!1:d,v=f==="item-aligned",S=f==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let C;e[8]!==o||e[9]!==S?(C=Me("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-36 rounded-md shadow-md ring-1 duration-100 relative z-50 max-h-(--radix-select-content-available-height) origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto data-[align-trigger=true]:animate-none",S,o),e[8]=o,e[9]=S,e[10]=C):C=e[10];let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=y.jsx(AV,{}),e[11]=w):w=e[11];const M=f==="popper"&&"";let R;e[12]!==M?(R=Me("data-[position=popper]:h-[var(--radix-select-trigger-height)] data-[position=popper]:w-full data-[position=popper]:min-w-[var(--radix-select-trigger-width)]",M),e[12]=M,e[13]=R):R=e[13];let E;e[14]!==n||e[15]!==f||e[16]!==R?(E=y.jsx(Wz,{"data-position":f,className:R,children:n}),e[14]=n,e[15]=f,e[16]=R,e[17]=E):E=e[17];let N;e[18]===Symbol.for("react.memo_cache_sentinel")?(N=y.jsx(jV,{}),e[18]=N):N=e[18];let D;return e[19]!==g||e[20]!==p||e[21]!==f||e[22]!==a||e[23]!==m||e[24]!==E||e[25]!==v||e[26]!==C?(D=y.jsx(Gz,{children:y.jsxs(qz,{"data-slot":"select-content","data-align-trigger":v,className:C,position:f,align:g,side:m,avoidCollisions:p,...a,children:[w,E,N]})}),e[19]=g,e[20]=p,e[21]=f,e[22]=a,e[23]=m,e[24]=E,e[25]=v,e[26]=C,e[27]=D):D=e[27],D}function gr(t){const e=be.c(13);let n,o,a;e[0]!==t?({className:o,children:n,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a):(n=e[1],o=e[2],a=e[3]);let i;e[4]!==o?(i=Me("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-sm py-1 pr-8 pl-2 text-sm [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",o),e[4]=o,e[5]=i):i=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:y.jsx(Zz,{children:y.jsx(ns,{className:"pointer-events-none"})})}),e[6]=l):l=e[6];let u;e[7]!==n?(u=y.jsx(Xz,{children:n}),e[7]=n,e[8]=u):u=e[8];let d;return e[9]!==a||e[10]!==i||e[11]!==u?(d=y.jsxs(Kz,{"data-slot":"select-item",className:i,...a,children:[l,u]}),e[9]=a,e[10]=i,e[11]=u,e[12]=d):d=e[12],d}function AV(t){const e=be.c(9);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4",n),e[3]=n,e[4]=a):a=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=y.jsx(Zf,{}),e[5]=i):i=e[5];let l;return e[6]!==o||e[7]!==a?(l=y.jsx(Qz,{"data-slot":"select-scroll-up-button",className:a,...o,children:i}),e[6]=o,e[7]=a,e[8]=l):l=e[8],l}function jV(t){const e=be.c(9);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4",n),e[3]=n,e[4]=a):a=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=y.jsx(la,{}),e[5]=i):i=e[5];let l;return e[6]!==o||e[7]!==a?(l=y.jsx(Jz,{"data-slot":"select-scroll-down-button",className:a,...o,children:i}),e[6]=o,e[7]=a,e[8]=l):l=e[8],l}function zV(t){const e=be.c(43),{nodesDraggable:n,onNodesDraggableChange:o,edgeType:a,onEdgeTypeChange:i,layoutType:l,onLayoutTypeChange:u,onAutoLayout:d,onHide:f}=t;let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=y.jsx("div",{className:"text-xs font-semibold text-card-foreground uppercase tracking-wide",children:"Layout Controls"}),e[0]=g):g=e[0];let m;e[1]===Symbol.for("react.memo_cache_sentinel")?(m=y.jsx("span",{className:"text-sm text-muted-foreground",children:"Draggable"}),e[1]=m):m=e[1];const p=n?"default":"secondary";let v;e[2]!==n||e[3]!==o?(v=()=>o(!n),e[2]=n,e[3]=o,e[4]=v):v=e[4];let S;e[5]!==n?(S=n?y.jsx(rI,{className:"h-4 w-4"}):y.jsx(sI,{className:"h-4 w-4"}),e[5]=n,e[6]=S):S=e[6];let C;e[7]!==p||e[8]!==v||e[9]!==S?(C=y.jsxs("div",{className:"flex items-center justify-between",children:[m,y.jsx(nn,{size:"sm",variant:p,onClick:v,className:"h-8 w-8 p-0",children:S})]}),e[7]=p,e[8]=v,e[9]=S,e[10]=C):C=e[10];let w;e[11]===Symbol.for("react.memo_cache_sentinel")?(w=y.jsx("span",{className:"text-sm text-muted-foreground",children:"Layout Mode"}),e[11]=w):w=e[11];let M;e[12]!==u?(M=H=>u(H),e[12]=u,e[13]=M):M=e[13];let R;e[14]===Symbol.for("react.memo_cache_sentinel")?(R=y.jsx(Lc,{size:"sm",className:"w-full",children:y.jsx(Xi,{})}),e[14]=R):R=e[14];let E;e[15]===Symbol.for("react.memo_cache_sentinel")?(E=y.jsx(gr,{value:"strict",children:y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(Y8,{className:"h-3 w-3"}),y.jsx("span",{children:"Strict Grid"})]})}),e[15]=E):E=e[15];let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=y.jsxs(Hc,{position:"popper",children:[E,y.jsx(gr,{value:"adapted",children:y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(F8,{className:"h-3 w-3"}),y.jsx("span",{children:"Adapted"})]})})]}),e[16]=N):N=e[16];let D;e[17]!==l||e[18]!==M?(D=y.jsxs("div",{className:"space-y-1.5",children:[w,y.jsxs($c,{value:l,onValueChange:M,children:[R,N]})]}),e[17]=l,e[18]=M,e[19]=D):D=e[19];let T;e[20]===Symbol.for("react.memo_cache_sentinel")?(T=y.jsx("span",{className:"text-sm text-muted-foreground",children:"Edge Type"}),e[20]=T):T=e[20];let k;e[21]!==i?(k=H=>i(H),e[21]=i,e[22]=k):k=e[22];let A;e[23]===Symbol.for("react.memo_cache_sentinel")?(A=y.jsx(Lc,{size:"sm",className:"w-full",children:y.jsx(Xi,{})}),e[23]=A):A=e[23];let B;e[24]===Symbol.for("react.memo_cache_sentinel")?(B=y.jsx(gr,{value:"default",children:y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(kI,{className:"h-3 w-3"}),y.jsx("span",{children:"Bezier"})]})}),e[24]=B):B=e[24];let W;e[25]===Symbol.for("react.memo_cache_sentinel")?(W=y.jsx(gr,{value:"straight",children:y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(g8,{className:"h-3 w-3"}),y.jsx("span",{children:"Straight"})]})}),e[25]=W):W=e[25];let U;e[26]===Symbol.for("react.memo_cache_sentinel")?(U=y.jsx(gr,{value:"step",children:y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(RI,{className:"h-3 w-3"}),y.jsx("span",{children:"Step"})]})}),e[26]=U):U=e[26];let Y;e[27]===Symbol.for("react.memo_cache_sentinel")?(Y=y.jsxs(Hc,{position:"popper",children:[B,W,U,y.jsx(gr,{value:"smoothstep",children:y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(AI,{className:"h-3 w-3"}),y.jsx("span",{children:"Smooth Step"})]})})]}),e[27]=Y):Y=e[27];let Z;e[28]!==a||e[29]!==k?(Z=y.jsxs("div",{className:"space-y-1.5",children:[T,y.jsxs($c,{value:a,onValueChange:k,children:[A,Y]})]}),e[28]=a,e[29]=k,e[30]=Z):Z=e[30];let I;e[31]===Symbol.for("react.memo_cache_sentinel")?(I=y.jsx(zI,{className:"h-4 w-4 mr-2"}),e[31]=I):I=e[31];let G;e[32]!==d?(G=y.jsxs(nn,{size:"sm",variant:"secondary",onClick:d,className:"w-full",children:[I,"Auto Layout"]}),e[32]=d,e[33]=G):G=e[33];let j;e[34]===Symbol.for("react.memo_cache_sentinel")?(j=y.jsx(aM,{className:"h-4 w-4 mr-2"}),e[34]=j):j=e[34];let L;e[35]!==f?(L=y.jsxs(nn,{size:"sm",variant:"outline",onClick:f,className:"w-full",children:[j,"Hide"]}),e[35]=f,e[36]=L):L=e[36];let $;return e[37]!==D||e[38]!==Z||e[39]!==G||e[40]!==L||e[41]!==C?($=y.jsx("div",{className:"absolute top-4 right-4 z-10",children:y.jsxs("div",{className:"bg-card/80 backdrop-blur-md border border-border/50 rounded-lg shadow-lg p-3 space-y-3 min-w-[200px]",children:[g,C,D,Z,G,L]})}),e[37]=D,e[38]=Z,e[39]=G,e[40]=L,e[41]=C,e[42]=$):$=e[42],$}function QN(){const t=be.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=y.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-2",children:"Legend"}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 shrink-0",style:{boxShadow:"0 0 4px 1px rgba(16, 185, 129, 0.6), 0 0 8px 3px rgba(16, 185, 129, 0.3)"}}),y.jsx("span",{className:"text-xs text-card-foreground",children:"Primary Key"})]}),t[1]=n):n=t[1];let o;return t[2]===Symbol.for("react.memo_cache_sentinel")?(o=y.jsxs("div",{className:"bg-card/80 backdrop-blur-md border border-border/50 rounded-lg shadow-lg px-3 py-2",children:[e,y.jsxs("div",{className:"flex flex-col gap-1.5",children:[n,y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 shrink-0",style:{boxShadow:"0 0 4px 1px rgba(251, 191, 36, 0.6), 0 0 8px 3px rgba(251, 191, 36, 0.3)"}}),y.jsx("span",{className:"text-xs text-card-foreground",children:"Foreign Key"})]})]})]}),t[2]=o):o=t[2],o}function IV(t){const e=be.c(39),{table:n,onClose:o,onVisibilityChange:a,showLegend:i}=t,[l,u]=x.useState(!1),[d,f]=x.useState(!1),[g,m]=x.useState(null);let p,v;e[0]!==a||e[1]!==n?(p=()=>{n&&(m(n),requestAnimationFrame(()=>{u(!0),f(!1),a?.(!0)}))},v=[n,a],e[0]=a,e[1]=n,e[2]=p,e[3]=v):(p=e[2],v=e[3]),x.useEffect(p,v);let S;e[4]!==o||e[5]!==a?(S=()=>{f(!0),u(!1),a?.(!1),setTimeout(()=>{m(null),o()},200)},e[4]=o,e[5]=a,e[6]=S):S=e[6];const C=S;if(!g)return null;const w=`absolute bottom-0 left-0 right-0 z-20 transition-transform duration-200 ease-out ${l&&!d?"translate-y-0":"translate-y-full"}`;let M;e[7]!==i?(M=i&&y.jsx("div",{className:"absolute bottom-full left-4 mb-4",children:y.jsx(QN,{})}),e[7]=i,e[8]=M):M=e[8];let R;e[9]===Symbol.for("react.memo_cache_sentinel")?(R={maxHeight:"60vh",minHeight:"250px"},e[9]=R):R=e[9];let E;e[10]!==g.schema?(E=y.jsx("span",{className:"text-xs text-muted-foreground",children:g.schema}),e[10]=g.schema,e[11]=E):E=e[11];let N;e[12]!==g.name?(N=y.jsx("h2",{className:"text-lg font-semibold text-card-foreground",children:g.name}),e[12]=g.name,e[13]=N):N=e[13];let D;e[14]!==E||e[15]!==N?(D=y.jsxs("div",{children:[E,N]}),e[14]=E,e[15]=N,e[16]=D):D=e[16];let T;e[17]===Symbol.for("react.memo_cache_sentinel")?(T=y.jsx(os,{className:"w-5 h-5 text-muted-foreground"}),e[17]=T):T=e[17];let k;e[18]!==C?(k=y.jsx("button",{onClick:C,className:"p-2 rounded-md hover:bg-accent transition-colors","aria-label":"Close panel",children:T}),e[18]=C,e[19]=k):k=e[19];let A;e[20]!==k||e[21]!==D?(A=y.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border shrink-0",children:[D,k]}),e[20]=k,e[21]=D,e[22]=A):A=e[22];let B;e[23]!==g.columns.length?(B=y.jsxs("div",{className:"text-sm text-muted-foreground mb-4",children:[g.columns.length," columns"]}),e[23]=g.columns.length,e[24]=B):B=e[24];let W;e[25]!==g.columns?(W=g.columns.map(PV),e[25]=g.columns,e[26]=W):W=e[26];let U;e[27]!==W?(U=y.jsx("div",{className:"space-y-2",children:W}),e[27]=W,e[28]=U):U=e[28];let Y;e[29]!==B||e[30]!==U?(Y=y.jsxs("div",{className:"flex-1 overflow-y-auto p-4 min-h-0",children:[B,U]}),e[29]=B,e[30]=U,e[31]=Y):Y=e[31];let Z;e[32]!==A||e[33]!==Y?(Z=y.jsxs("div",{className:"bg-card border-t border-border shadow-2xl flex flex-col",style:R,children:[A,Y]}),e[32]=A,e[33]=Y,e[34]=Z):Z=e[34];let I;return e[35]!==Z||e[36]!==w||e[37]!==M?(I=y.jsxs("div",{className:w,children:[M,Z]}),e[35]=Z,e[36]=w,e[37]=M,e[38]=I):I=e[38],I}function PV(t){return y.jsxs("div",{className:"flex items-center justify-between py-2 px-3 rounded-md bg-accent/30 hover:bg-accent/60 transition-colors cursor-default",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"font-medium text-card-foreground",children:t.name}),y.jsxs("div",{className:"flex items-center gap-1",children:[t.isPrimaryKey&&y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500",style:{boxShadow:"0 0 4px 1px rgba(16, 185, 129, 0.6)"},title:"Primary Key"}),t.foreignKey&&y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400",style:{boxShadow:"0 0 4px 1px rgba(251, 191, 36, 0.6)"},title:"Foreign Key"})]})]}),y.jsxs("div",{className:"text-sm text-muted-foreground",children:[su(t.type),t.nullable&&y.jsx("span",{className:"ml-1 opacity-60",children:"(nullable)"})]})]},t.name)}const $V={table:kV};function o0(t){return 60+t.columns.length*52+20}function GS(t,e){const n=new Map;if(t.length===0)return n;const o=240,a=40,i=40,l=o+a,u=50,d=50,f=t.map(p=>({id:`${p.schema}.${p.name}`,table:p,height:o0(p)}));f.sort((p,v)=>v.height-p.height);const g=Math.max(4,Math.ceil(Math.sqrt(t.length*1.5))),m=new Array(g).fill(d);return f.forEach(({id:p,height:v})=>{let S=0,C=m[0];for(let R=1;R<g;R++)m[R]<C&&(C=m[R],S=R);const w=u+S*l,M=m[S];n.set(p,{x:w,y:M}),m[S]=M+v+i}),n}const qS={padding:.2};function LV(t){const e=be.c(8),{layoutVersion:n}=t,{fitView:o}=dh(),a=oV();let i,l;e[0]!==o||e[1]!==a?(i=()=>{if(!a)return;const f=requestAnimationFrame(()=>{o(qS)});return()=>cancelAnimationFrame(f)},l=[a,o],e[0]=o,e[1]=a,e[2]=i,e[3]=l):(i=e[2],l=e[3]),x.useEffect(i,l);let u,d;return e[4]!==o||e[5]!==n?(u=()=>{if(n===0)return;const f=requestAnimationFrame(()=>{o(qS)});return()=>cancelAnimationFrame(f)},d=[n,o],e[4]=o,e[5]=n,e[6]=u,e[7]=d):(u=e[6],d=e[7]),x.useEffect(u,d),null}function HV(t){const e=be.c(60),{schemaData:n,nodesDraggable:o,onNodesDraggableChange:a,edgeType:i,onEdgeTypeChange:l,layoutType:u,onLayoutTypeChange:d,controlsVisible:f,onControlsVisibleChange:g}=t;let m;e:{if(u==="adapted"){let ge;if(e[0]!==n.foreignKeys||e[1]!==n.tables){const se=GS(n.tables,n.foreignKeys);ge=n.tables.map(ve=>{const De=`${ve.schema}.${ve.name}`,Be=se.get(De)||{x:50,y:50};return{id:De,type:"table",position:Be,data:{table:ve}}}),e[0]=n.foreignKeys,e[1]=n.tables,e[2]=ge}else ge=e[2];m=ge;break e}let ee;e[3]!==n.tables.length?(ee=Math.sqrt(n.tables.length),e[3]=n.tables.length,e[4]=ee):ee=e[4];const ae=Math.ceil(ee);let ce;if(e[5]!==ae||e[6]!==n.tables){const ge=[];for(let ve=0;ve<ae;ve++)ge.push([]);n.tables.forEach((ve,De)=>{ge[De%ae].push(ve)});const se=new Map;ge.forEach((ve,De)=>{let Be=50;ve.forEach(Ie=>{const lt=`${Ie.schema}.${Ie.name}`;se.set(lt,{x:De*320+50,y:Be}),Be=Be+(o0(Ie)+60)})}),ce=n.tables.map(ve=>{const De=`${ve.schema}.${ve.name}`,Be=se.get(De)||{x:50,y:50};return{id:De,type:"table",position:Be,data:{table:ve}}}),e[5]=ae,e[6]=n.tables,e[7]=ce}else ce=e[7];m=ce}const p=m;let v;if(e[8]!==i||e[9]!==n.foreignKeys||e[10]!==n.tables){let ee;e[12]!==n.tables?(ee=ce=>{const ge=n.tables.find(ve=>`${ve.schema}.${ve.name}`===ce.fromTable),se=n.tables.find(ve=>`${ve.schema}.${ve.name}`===ce.toTable);return!ge||!se?(console.warn(`Skipping edge: table not found for FK ${ce.constraintName}`),!1):!0},e[12]=n.tables,e[13]=ee):ee=e[13];let ae;e[14]!==i?(ae=(ce,ge)=>({id:`edge-${ge}-${ce.constraintName}`,source:ce.fromTable,target:ce.toTable,sourceHandle:`${ce.fromColumn}-source`,targetHandle:`${ce.toColumn}-target`,type:i,style:{stroke:"oklch(1 0 0 / 25%)",strokeWidth:2},animated:!0}),e[14]=i,e[15]=ae):ae=e[15],v=n.foreignKeys.filter(ee).map(ae),e[8]=i,e[9]=n.foreignKeys,e[10]=n.tables,e[11]=v}else v=e[11];const S=v,[C,w,M]=eV(p),[R,E,N]=tV(S),[D,T]=x.useState(null),[k,A]=x.useState(!1),[B,W]=x.useState(0);let U,Y;e[16]!==p||e[17]!==w?(U=()=>{w(p)},Y=[p,w],e[16]=p,e[17]=w,e[18]=U,e[19]=Y):(U=e[18],Y=e[19]),x.useEffect(U,Y);let Z,I;e[20]!==S||e[21]!==E?(Z=()=>{E(S)},I=[S,E],e[20]=S,e[21]=E,e[22]=Z,e[23]=I):(Z=e[22],I=e[23]),x.useEffect(Z,I);let G;e[24]===Symbol.for("react.memo_cache_sentinel")?(G=(ee,ae)=>{const ce=ae.data.table;T(ce)},e[24]=G):G=e[24];const j=G;let L;e[25]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{T(null)},e[25]=L):L=e[25];const $=L;let H;e[26]!==u||e[27]!==n.foreignKeys||e[28]!==n.tables||e[29]!==w?(H=()=>{if(u==="adapted"){const ee=GS(n.tables,n.foreignKeys);w(ae=>ae.map(ce=>({...ce,position:ee.get(ce.id)||ce.position})))}else{const ee=Math.ceil(Math.sqrt(n.tables.length)),ae=new Map;n.tables.forEach(ce=>{ae.set(`${ce.schema}.${ce.name}`,ce)}),w(ce=>{const ge=[];for(let ve=0;ve<ee;ve++)ge.push([]);ce.forEach((ve,De)=>{ge[De%ee].push(ve)});const se=new Map;return ge.forEach((ve,De)=>{let Be=50;ve.forEach(Ie=>{se.set(Ie.id,{x:De*320+50,y:Be});const lt=ae.get(Ie.id);lt?Be=Be+(o0(lt)+60):Be=Be+260})}),ce.map(ve=>({...ve,position:se.get(ve.id)||ve.position}))})}W(BV)},e[26]=u,e[27]=n.foreignKeys,e[28]=n.tables,e[29]=w,e[30]=H):H=e[30];const X=H;let P;e[31]===Symbol.for("react.memo_cache_sentinel")?(P={hideAttribution:!0},e[31]=P):P=e[31];let z;e[32]!==B?(z=y.jsx(LV,{layoutVersion:B}),e[32]=B,e[33]=z):z=e[33];let V;e[34]===Symbol.for("react.memo_cache_sentinel")?(V=y.jsx(lV,{gap:20,size:1,color:"var(--muted-foreground)"}),e[34]=V):V=e[34];let q;e[35]!==R||e[36]!==C||e[37]!==o||e[38]!==N||e[39]!==M||e[40]!==z?(q=y.jsxs(JB,{nodes:C,edges:R,nodeTypes:$V,onNodesChange:M,onEdgesChange:N,onNodeClick:j,nodesDraggable:o,nodesConnectable:!1,proOptions:P,className:"bg-background",children:[z,V]}),e[35]=R,e[36]=C,e[37]=o,e[38]=N,e[39]=M,e[40]=z,e[41]=q):q=e[41];let J;e[42]!==f||e[43]!==i||e[44]!==X||e[45]!==k||e[46]!==u||e[47]!==o||e[48]!==g||e[49]!==l||e[50]!==d||e[51]!==a?(J=f&&y.jsxs(y.Fragment,{children:[y.jsx(zV,{nodesDraggable:o,onNodesDraggableChange:a,edgeType:i,onEdgeTypeChange:l,layoutType:u,onLayoutTypeChange:d,onAutoLayout:X,onHide:()=>g(!1)}),y.jsx("div",{className:`absolute left-4 z-20 transition-all duration-200 ease-out ${k?"opacity-0 pointer-events-none":"bottom-4 opacity-100"}`,children:y.jsx(QN,{})})]}),e[42]=f,e[43]=i,e[44]=X,e[45]=k,e[46]=u,e[47]=o,e[48]=g,e[49]=l,e[50]=d,e[51]=a,e[52]=J):J=e[52];let oe;e[53]!==k||e[54]!==D?(oe=y.jsx(IV,{table:D,onClose:$,onVisibilityChange:A,showLegend:k}),e[53]=k,e[54]=D,e[55]=oe):oe=e[55];let K;return e[56]!==q||e[57]!==J||e[58]!==oe?(K=y.jsxs("div",{className:"w-full h-full bg-background relative",children:[q,J,oe]}),e[56]=q,e[57]=J,e[58]=oe,e[59]=K):K=e[59],K}function BV(t){return t+1}async function VV(t){const e=await fetch("/api/schema",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionString:t})});if(!e.ok){let o=`HTTP error! status: ${e.status}`;try{const a=await e.json();o=a.error||o,console.error("API error response:",a)}catch{const i=await e.text().catch(()=>"");console.error("Failed to parse error response. Raw response:",i)}throw new Error(o)}const n=await e.json();if(!n.success||!n.data)throw new Error(n.error||"Failed to fetch schema data");return n.data}function JN({connection:t}){const[e,n]=x.useState(null),[o,a]=x.useState(!1),[i,l]=x.useState(null),u=x.useCallback(async()=>{if(t?.connectionString){a(!0),l(null);try{const d=await VV(t.connectionString);n(d)}catch(d){const f=d instanceof Error?d.message:"Failed to load schema data";l(f),console.error("Error loading schema data:",d),n(null)}finally{a(!1)}}},[t?.connectionString]);return x.useEffect(()=>{t?.connectionString&&u()},[t?.connectionString,u]),{schemaData:e,loading:o,error:i,refetch:u}}function FV(t){const e=be.c(28),{schemaData:n,selectedSchemas:o,setSelectedSchemas:a}=t;let i;e:{if(!n){let S;e[0]===Symbol.for("react.memo_cache_sentinel")?(S=[],e[0]=S):S=e[0],i=S;break e}let v;if(e[1]!==n.tables){const S=new Set(n.tables.map(GV));v=Array.from(S).sort(),e[1]=n.tables,e[2]=v}else v=e[2];i=v}const l=i;let u,d;e[3]!==n||e[4]!==o||e[5]!==a?(u=()=>{if(!n||o.length===0)return;const v=new Set(n.tables.map(YV));o.some(C=>!v.has(C))&&a(C=>C.filter(w=>v.has(w)))},d=[n,o,a],e[3]=n,e[4]=o,e[5]=a,e[6]=u,e[7]=d):(u=e[6],d=e[7]),x.useEffect(u,d);let f;e:{if(!n){f=null;break e}if(o.length===0){f=n;break e}let v;e[8]!==o?(v=new Set(o),e[8]=o,e[9]=v):v=e[9];const S=v;let C,w;if(e[10]!==n.tables||e[11]!==S){let D;e[14]!==S?(D=T=>S.has(T.schema),e[14]=S,e[15]=D):D=e[15],C=n.tables.filter(D),w=new Set(C.map(UV)),e[10]=n.tables,e[11]=S,e[12]=C,e[13]=w}else C=e[12],w=e[13];const M=w;let R;if(e[16]!==n.foreignKeys||e[17]!==M){let D;e[19]!==M?(D=T=>M.has(T.fromTable)&&M.has(T.toTable),e[19]=M,e[20]=D):D=e[20],R=n.foreignKeys.filter(D),e[16]=n.foreignKeys,e[17]=M,e[18]=R}else R=e[18];const E=R;let N;e[21]!==E||e[22]!==C?(N={tables:C,foreignKeys:E},e[21]=E,e[22]=C,e[23]=N):N=e[23],f=N}const g=f,m=g?.tables.length??0;let p;return e[24]!==l||e[25]!==g||e[26]!==m?(p={availableSchemas:l,filteredSchemaData:g,filteredTableCount:m},e[24]=l,e[25]=g,e[26]=m,e[27]=p):p=e[27],p}function UV(t){return`${t.schema}.${t.name}`}function YV(t){return t.schema}function GV(t){return t.schema}function Iy(t,e,n){const o=JSON.stringify,a=JSON.parse,i=n?.validate,[l,u]=x.useState(()=>{try{const f=localStorage.getItem(t);if(f!==null){const g=a(f);return i&&i(g),g}}catch(f){console.warn(`Failed to read localStorage key "${t}":`,f)}return e});x.useEffect(()=>{try{localStorage.setItem(t,o(l))}catch(f){console.warn(`Failed to write localStorage key "${t}":`,f)}},[t,l,o]);const d=x.useCallback(f=>{u(g=>f instanceof Function?f(g):f)},[]);return[l,d]}const qV=["default","straight","step","smoothstep"],WV=["strict","adapted"],Es={selectedSchemas:[],nodesDraggable:!0,edgeType:"default",layoutType:"strict",controlsVisible:!0};function Ei(t){if(!t||typeof t!="object")return Es;const e=t;let n=Es.selectedSchemas;return Array.isArray(e.selectedSchemas)&&e.selectedSchemas.every(o=>typeof o=="string")?n=e.selectedSchemas:typeof e.selectedSchema=="string"&&e.selectedSchema!=="all"&&(n=[e.selectedSchema]),{selectedSchemas:n,nodesDraggable:typeof e.nodesDraggable=="boolean"?e.nodesDraggable:Es.nodesDraggable,edgeType:qV.includes(e.edgeType)?e.edgeType:Es.edgeType,layoutType:WV.includes(e.layoutType)?e.layoutType:Es.layoutType,controlsVisible:typeof e.controlsVisible=="boolean"?e.controlsVisible:Es.controlsVisible}}function KV(){const t=be.c(19),[e,n]=Iy("fb-schema-view",Es);let o;t[0]!==e?(o=Ei(e),t[0]=e,t[1]=o):o=t[1];const a=o;let i;t[2]!==n?(i=w=>{n(M=>{const R=Ei(M),E=typeof w=="function"?w(R.selectedSchemas):w;return{...R,selectedSchemas:E}})},t[2]=n,t[3]=i):i=t[3];const l=i;let u;t[4]!==n?(u=w=>{n(M=>({...Ei(M),nodesDraggable:w}))},t[4]=n,t[5]=u):u=t[5];const d=u;let f;t[6]!==n?(f=w=>{n(M=>({...Ei(M),edgeType:w}))},t[6]=n,t[7]=f):f=t[7];const g=f;let m;t[8]!==n?(m=w=>{n(M=>({...Ei(M),layoutType:w}))},t[8]=n,t[9]=m):m=t[9];const p=m;let v;t[10]!==n?(v=w=>{n(M=>({...Ei(M),controlsVisible:w}))},t[10]=n,t[11]=v):v=t[11];const S=v;let C;return t[12]!==S||t[13]!==g||t[14]!==p||t[15]!==d||t[16]!==l||t[17]!==a?(C={viewState:a,setSelectedSchemas:l,setNodesDraggable:d,setEdgeType:g,setLayoutType:p,setControlsVisible:S},t[12]=S,t[13]=g,t[14]=p,t[15]=d,t[16]=l,t[17]=a,t[18]=C):C=t[18],C}function ul(t){const e=be.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(mz,{"data-slot":"popover",...n}),e[2]=n,e[3]=o):o=e[3],o}function eR(t){const e=be.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(pz,{"data-slot":"popover-trigger",...n}),e[2]=n,e[3]=o):o=e[3],o}function dl(t){const e=be.c(12);let n,o,a,i;e[0]!==t?({className:n,align:a,sideOffset:i,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i):(n=e[1],o=e[2],a=e[3],i=e[4]);const l=a===void 0?"center":a,u=i===void 0?4:i;let d;e[5]!==n?(d=Me("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 flex flex-col gap-4 rounded-md p-4 text-sm shadow-md ring-1 duration-100 z-50 w-72 origin-(--radix-popover-content-transform-origin) outline-hidden",n),e[5]=n,e[6]=d):d=e[6];let f;return e[7]!==l||e[8]!==o||e[9]!==u||e[10]!==d?(f=y.jsx(yz,{children:y.jsx(vz,{"data-slot":"popover-content",align:l,sideOffset:u,className:d,...o})}),e[7]=l,e[8]=o,e[9]=u,e[10]=d,e[11]=f):f=e[11],f}function mh(t){const e=be.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let o;return e[2]!==n?(o=y.jsx(gz,{"data-slot":"popover-anchor",...n}),e[2]=n,e[3]=o):o=e[3],o}function Py(t){const e=be.c(9);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 flex size-4 items-center justify-center rounded-[4px] border shadow-xs transition-shadow group-has-disabled/field:opacity-50 focus-visible:ring-[3px] aria-invalid:ring-[3px] peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50",n),e[3]=n,e[4]=a):a=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=y.jsx(H2,{"data-slot":"checkbox-indicator",className:"[&>svg]:size-3.5 grid place-content-center text-current transition-none",children:y.jsx(ns,{})}),e[5]=i):i=e[5];let l;return e[6]!==o||e[7]!==a?(l=y.jsx($2,{"data-slot":"checkbox",className:a,...o,children:i}),e[6]=o,e[7]=a,e[8]=l):l=e[8],l}function XV(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("size-4 animate-spin",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(nI,{role:"status","aria-label":"Loading",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function iu(){const t=be.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=y.jsx("div",{className:"flex items-center gap-4",children:y.jsx(XV,{})}),t[0]=e):e=t[0],e}function ZV(){const t=be.c(37),{selectedConnection:e}=eh();let n;t[0]!==e?(n={connection:e},t[0]=e,t[1]=n):n=t[1];const{schemaData:o,loading:a,error:i}=JN(n),{viewState:l,setSelectedSchemas:u,setNodesDraggable:d,setEdgeType:f,setLayoutType:g,setControlsVisible:m}=KV();let p;t[2]!==o||t[3]!==u||t[4]!==l.selectedSchemas?(p={schemaData:o,selectedSchemas:l.selectedSchemas,setSelectedSchemas:u},t[2]=o,t[3]=u,t[4]=l.selectedSchemas,t[5]=p):p=t[5];const{availableSchemas:v,filteredSchemaData:S,filteredTableCount:C}=FV(p);if(!e){let N;return t[6]===Symbol.for("react.memo_cache_sentinel")?(N=y.jsx("div",{className:"h-full flex items-center justify-center",children:y.jsx("p",{className:"text-muted-foreground",children:"Please select a database connection to view schema"})}),t[6]=N):N=t[6],N}if(!e.connectionString){let N;return t[7]===Symbol.for("react.memo_cache_sentinel")?(N=y.jsx("div",{className:"h-full flex items-center justify-center",children:y.jsx("p",{className:"text-muted-foreground",children:"Connection selected but missing connection string"})}),t[7]=N):N=t[7],N}if(a){let N;return t[8]===Symbol.for("react.memo_cache_sentinel")?(N=y.jsx("div",{className:"h-full flex items-center justify-center",children:y.jsx(iu,{})}),t[8]=N):N=t[8],N}if(i){let N;return t[9]!==i?(N=y.jsx("div",{className:"h-full flex items-center justify-center p-6",children:y.jsx("div",{className:"bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-md",children:i})}),t[9]=i,t[10]=N):N=t[10],N}if(!S)return null;let w;t[11]!==S||t[12]!==m||t[13]!==f||t[14]!==g||t[15]!==d||t[16]!==l.controlsVisible||t[17]!==l.edgeType||t[18]!==l.layoutType||t[19]!==l.nodesDraggable?(w=y.jsx(HV,{schemaData:S,nodesDraggable:l.nodesDraggable,onNodesDraggableChange:d,edgeType:l.edgeType,onEdgeTypeChange:f,layoutType:l.layoutType,onLayoutTypeChange:g,controlsVisible:l.controlsVisible,onControlsVisibleChange:m}),t[11]=S,t[12]=m,t[13]=f,t[14]=g,t[15]=d,t[16]=l.controlsVisible,t[17]=l.edgeType,t[18]=l.layoutType,t[19]=l.nodesDraggable,t[20]=w):w=t[20];let M;t[21]!==v||t[22]!==S||t[23]!==C||t[24]!==e.databaseName||t[25]!==e.name||t[26]!==u||t[27]!==l.controlsVisible||t[28]!==l.selectedSchemas?(M=l.controlsVisible&&y.jsx("div",{className:"absolute top-4 left-4 z-10",children:y.jsxs("div",{className:"bg-card/80 backdrop-blur-md border border-border/50 rounded-lg shadow-lg px-4 py-3",children:[y.jsxs("div",{className:"flex items-center justify-between gap-4 mb-2",children:[y.jsx("h1",{className:"text-xl font-bold text-card-foreground",children:"Database Schema"}),v.length>1&&y.jsxs(ul,{children:[y.jsx(eR,{asChild:!0,children:y.jsxs(nn,{variant:"outline",size:"sm",className:Me("w-[200px] justify-between font-normal",l.selectedSchemas.length>0&&"border-primary/50"),children:[y.jsx("span",{className:"truncate",children:l.selectedSchemas.length===0||l.selectedSchemas.length===v.length?"All schemas":l.selectedSchemas.length===1?l.selectedSchemas[0]:`${l.selectedSchemas.length} schemas`}),y.jsx(la,{className:"ml-2 size-4 shrink-0 opacity-50"})]})}),y.jsx(dl,{className:"w-[200px] p-2",align:"start",children:y.jsx("div",{className:"flex flex-col gap-1",children:v.map(N=>{const D=l.selectedSchemas.length===0||l.selectedSchemas.includes(N);return y.jsxs("label",{className:"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent",children:[y.jsx(Py,{checked:D,onCheckedChange:T=>{u(T?k=>{const A=k.length===0?[N]:[...k,N];return A.length===v.length?[]:A}:k=>k.length===0?v.filter(A=>A!==N):k.filter(A=>A!==N))}}),y.jsx("span",{children:N})]},N)})})})]})]}),y.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.name||e.databaseName||"Unnamed connection",y.jsxs("span",{className:"ml-1",children:["• ",C," ",C===1?"table":"tables"," • ",S.foreignKeys.length," relationships"]})]})]})}),t[21]=v,t[22]=S,t[23]=C,t[24]=e.databaseName,t[25]=e.name,t[26]=u,t[27]=l.controlsVisible,t[28]=l.selectedSchemas,t[29]=M):M=t[29];let R;t[30]!==m||t[31]!==l.controlsVisible?(R=!l.controlsVisible&&y.jsx("div",{className:"absolute top-4 right-4 z-10",children:y.jsx(nn,{variant:"outline",size:"sm",onClick:()=>m(!0),className:"bg-card/80 backdrop-blur-md border-border/50",children:"Show Controller"})}),t[30]=m,t[31]=l.controlsVisible,t[32]=R):R=t[32];let E;return t[33]!==w||t[34]!==M||t[35]!==R?(E=y.jsxs("div",{className:"h-full w-full relative",children:[w,M,R]}),t[33]=w,t[34]=M,t[35]=R,t[36]=E):E=t[36],E}function QV(t){const e=be.c(48),{tables:n,selectedTable:o,selectedSchema:a,onSchemaChange:i,onSingleClick:l,onDoubleClick:u}=t,[d,f]=x.useState("");let g;if(e[0]!==n){const k=new Set(n.map(tF));g=Array.from(k).sort(),e[0]=n,e[1]=g}else g=e[1];const m=g;let p;if(e[2]!==d||e[3]!==a||e[4]!==n){let k;e[6]!==d||e[7]!==a?(k=A=>{const B=A.name.toLowerCase().includes(d.toLowerCase()),W=a==="all"||A.schema===a;return B&&W},e[6]=d,e[7]=a,e[8]=k):k=e[8],p=n.filter(k),e[2]=d,e[3]=a,e[4]=n,e[5]=p}else p=e[5];const v=p;let S,C,w,M;if(e[9]!==m||e[10]!==v||e[11]!==u||e[12]!==i||e[13]!==l||e[14]!==d||e[15]!==a||e[16]!==o?.name||e[17]!==o?.schema){const k=v.reduce(eF,{}),A=Object.keys(k).sort();w="h-full flex flex-col bg-card border-r border-border";let B;e[22]===Symbol.for("react.memo_cache_sentinel")?(B=y.jsx("h2",{className:"text-sm font-semibold text-card-foreground",children:"Tables"}),e[22]=B):B=e[22];let W;e[23]!==m||e[24]!==i||e[25]!==a?(W=m.length>1&&y.jsxs($c,{value:a,onValueChange:i,children:[y.jsx(Lc,{className:"w-full h-8 text-sm",children:y.jsx(Xi,{placeholder:"All schemas"})}),y.jsxs(Hc,{position:"popper",sideOffset:4,align:"start",children:[y.jsx(gr,{value:"all",children:"All schemas"}),m.map(JV)]})]}),e[23]=m,e[24]=i,e[25]=a,e[26]=W):W=e[26];let U;e[27]===Symbol.for("react.memo_cache_sentinel")?(U=y.jsx(Qf,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e[27]=U):U=e[27];let Y;e[28]===Symbol.for("react.memo_cache_sentinel")?(Y=I=>f(I.target.value),e[28]=Y):Y=e[28];let Z;e[29]!==d?(Z=y.jsxs("div",{className:"relative",children:[U,y.jsx(Bi,{placeholder:"Search tables...",value:d,onChange:Y,className:"pl-8 h-8 text-sm"})]}),e[29]=d,e[30]=Z):Z=e[30],e[31]!==Z||e[32]!==W?(M=y.jsxs("div",{className:"p-3 border-b border-border shrink-0 space-y-2",children:[B,W,Z]}),e[31]=Z,e[32]=W,e[33]=M):M=e[33],S="flex-1 overflow-y-auto p-2",C=A.map(I=>y.jsxs("div",{className:"mb-2",children:[A.length>1&&y.jsx("div",{className:"px-2 py-1 text-xs font-medium text-muted-foreground uppercase tracking-wider",children:I}),y.jsx("div",{className:"space-y-0.5",children:k[I].map(G=>{const j=o?.name===G.name&&o?.schema===G.schema;return y.jsxs("button",{onClick:()=>l(G),onDoubleClick:()=>u(G),className:`w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-sm transition-colors text-left ${j?"bg-primary text-primary-foreground":"hover:bg-accent text-card-foreground"}`,children:[y.jsx(Jf,{className:"w-4 h-4 shrink-0"}),y.jsx("span",{className:"truncate flex-1",children:G.name}),j&&y.jsx(rM,{className:"w-4 h-4 shrink-0"})]},`${G.schema}.${G.name}`)})})]},I)),e[9]=m,e[10]=v,e[11]=u,e[12]=i,e[13]=l,e[14]=d,e[15]=a,e[16]=o?.name,e[17]=o?.schema,e[18]=S,e[19]=C,e[20]=w,e[21]=M}else S=e[18],C=e[19],w=e[20],M=e[21];let R;e[34]!==v.length?(R=v.length===0&&y.jsx("div",{className:"px-2 py-4 text-sm text-muted-foreground text-center",children:"No tables found"}),e[34]=v.length,e[35]=R):R=e[35];let E;e[36]!==S||e[37]!==C||e[38]!==R?(E=y.jsxs("div",{className:S,children:[C,R]}),e[36]=S,e[37]=C,e[38]=R,e[39]=E):E=e[39];const N=v.length===1?"table":"tables";let D;e[40]!==v.length||e[41]!==N?(D=y.jsx("div",{className:"p-3 border-t border-border shrink-0",children:y.jsxs("p",{className:"text-xs text-muted-foreground",children:[v.length," ",N]})}),e[40]=v.length,e[41]=N,e[42]=D):D=e[42];let T;return e[43]!==D||e[44]!==w||e[45]!==M||e[46]!==E?(T=y.jsxs("div",{className:w,children:[M,E,D]}),e[43]=D,e[44]=w,e[45]=M,e[46]=E,e[47]=T):T=e[47],T}function JV(t){return y.jsx(gr,{value:t,children:t},t)}function eF(t,e){return t[e.schema]||(t[e.schema]=[]),t[e.schema].push(e),t}function tF(t){return t.schema}function tR(t,e){return typeof t=="string"?t:t?.(e)}function WS(t){return!!t&&typeof t=="object"&&"id"in t&&"name"in t&&"size"in t&&"type"in t}function KS(t,e){return e.find(n=>n.value===t||n.value.toLowerCase()===t.toLowerCase()||n.label.toLowerCase()===t.toLowerCase())?.value}function tn(t,e){return`${t}:${e}`}function Ho(t){const e=t.split(":"),n=e[0],o=e[1];if(n&&o){const a=parseInt(n,10);if(!Number.isNaN(a))return{rowIndex:a,columnId:o}}return{rowIndex:0,columnId:""}}function r0(t){return{short:36,medium:56,tall:76,"extra-tall":96}[t]}function nR(t){return{short:1,medium:2,tall:3,"extra-tall":4}[t]}function oR(t){const{column:e,nextColumn:n,isLastColumn:o}=t,a=e.getIsPinned(),i=a==="right"&&e.getIsFirstColumn("right"),l=a==="right"&&e.getIsLastColumn("right");return{showEndBorder:!(n?.getIsPinned()==="right"&&n?.getIsFirstColumn("right"))&&(o||!l),showStartBorder:i}}function rR(t){const{column:e,dir:n="ltr",withBorder:o=!1}=t,a=e.getIsPinned(),i=a==="left"&&e.getIsLastColumn("left"),l=a==="right"&&e.getIsFirstColumn("right"),u=n==="rtl",d=a==="left"?`${e.getStart("left")}px`:void 0,f=a==="right"?`${e.getAfter("right")}px`:void 0;return{boxShadow:o?i?u?"4px 0 4px -4px var(--border) inset":"-4px 0 4px -4px var(--border) inset":l?u?"-4px 0 4px -4px var(--border) inset":"4px 0 4px -4px var(--border) inset":void 0:void 0,left:u?f:d,right:u?d:f,opacity:a?.97:1,position:a?"sticky":"relative",background:"var(--background)",width:e.getSize(),zIndex:a?1:void 0}}function XS(t){if(t==="left"||t==="right"||t==="home"||t==="end")return t;if(t==="pageleft")return"left";if(t==="pageright")return"right"}function _i(t){const{container:e,targetCell:n,tableRef:o,direction:a,viewportOffset:i,isRtl:l}=t,u=e.getBoundingClientRect(),d=n.getBoundingClientRect(),f=e.scrollLeft<0,g=l||f,m=o.current,p=m?.getLeftVisibleLeafColumns()??[],v=m?.getRightVisibleLeafColumns()??[],S=p.reduce((T,k)=>T+k.getSize(),0),C=v.reduce((T,k)=>T+k.getSize(),0),w=g?u.left+C+i:u.left+S+i,M=g?u.right-S-i:u.right-C-i;if(d.left>=w&&d.right<=M)return;const E=d.left<w,N=d.right>M;let D=0;a?(g?a==="right"||a==="home":a==="right"||a==="end")?D=d.right-M:D=-(w-d.left):N?D=d.right-M:E&&(D=-(w-d.left)),e.scrollLeft+=D}function ZS(t){return t instanceof Element&&(t.closest("[data-grid-cell-editor]")||t.closest("[data-grid-popover]"))!==null}function nF(t){switch(t){case"short-text":return{label:"Short text",icon:y8};case"long-text":return{label:"Long text",icon:_I};case"number":return{label:"Number",icon:q8};case"url":return{label:"URL",icon:X8};case"checkbox":return{label:"Checkbox",icon:bI};case"select":return{label:"Select",icon:eI};case"multi-select":return{label:"Multi-select",icon:Q8};case"date":return{label:"Date",icon:x8};case"file":return{label:"File",icon:sM};default:return null}}function QS(t){if(!t||t.trim()==="")return"";const e=t.trim();return/^(javascript|data|vbscript|file):/i.test(e)?"":e.startsWith("http://")||e.startsWith("https://")?e:`http://${e}`}function aR(t){if(!t)return null;if(t instanceof Date)return t;if(typeof t!="string")return null;const[e,n,o]=t.split("-").map(Number);if(!e||!n||!o)return null;const a=new Date(e,n-1,o);return a.getFullYear()!==e||a.getMonth()!==n-1||a.getDate()!==o?null:a}function oF(t){const e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0");return`${e}-${n}-${o}`}function rF(t){if(!t)return"";const e=aR(t);return e?e.toLocaleDateString():typeof t=="string"?t:""}function sp(t){if(t<=0||!Number.isFinite(t))return"0 B";const e=1024,n=["B","KB","MB","GB"],o=Math.min(n.length-1,Math.floor(Math.log(t)/Math.log(e)));return`${Number.parseFloat((t/e**o).toFixed(1))} ${n[o]}`}function JS(t){return t.startsWith("image/")?z8:t.startsWith("video/")?P8:t.startsWith("audio/")?A8:t.includes("pdf")?Iw:t.includes("zip")||t.includes("rar")?k8:t.includes("word")||t.includes("document")||t.includes("doc")?Iw:t.includes("sheet")||t.includes("excel")||t.includes("xls")?L8:t.includes("presentation")||t.includes("powerpoint")||t.includes("ppt")?dI:sM}function aF(t){const e=be.c(88);let n,o,a,i,l;e[0]!==t?({header:o,table:l,className:n,onPointerDown:a,...i}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5]);const u=o.column,d=u.columnDef.meta?.label?u.columnDef.meta.label:typeof u.columnDef.header=="string"?u.columnDef.header:u.id;let f,g,m,p,v,S,C,w,M,R,E,N,D,T;if(e[6]!==n||e[7]!==u||e[8]!==a||e[9]!==l){const H=l.getState().columnSizingInfo.isResizingColumn,P=u.columnDef.meta?.cell?.variant;let z;e[24]!==P?(z=nF(P),e[24]=P,e[25]=z):z=e[25],p=z,m=u.columnDef.meta?.columnType;let V;e[26]!==u?(V=u.getIsPinned(),e[26]=u,e[27]=V):V=e[27];const q=V;v=q==="left",S=q==="right";let J;e[28]!==u.id||e[29]!==l?(J=ge=>{l.setSorting(se=>{const ve=se.findIndex(Be=>Be.id===u.id),De={id:u.id,desc:ge==="desc"};if(ve>=0){const Be=[...se];return Be[ve]=De,Be}else return[...se,De]})},e[28]=u.id,e[29]=l,e[30]=J):J=e[30],R=J;let oe;e[31]!==u.id||e[32]!==l?(oe=()=>{l.setSorting(ge=>ge.filter(se=>se.id!==u.id))},e[31]=u.id,e[32]=l,e[33]=oe):oe=e[33],M=oe;let K;e[34]!==u?(K=()=>{u.pin("left")},e[34]=u,e[35]=K):K=e[35],C=K;let ee;e[36]!==u?(ee=()=>{u.pin("right")},e[36]=u,e[37]=ee):ee=e[37],w=ee;let ae;e[38]!==u?(ae=()=>{u.pin(!1)},e[38]=u,e[39]=ae):ae=e[39],N=ae;let ce;e[40]!==u.id||e[41]!==a||e[42]!==l.options.meta?(ce=ge=>{a?.(ge),!ge.defaultPrevented&&ge.button===0&&l.options.meta?.onColumnClick?.(u.id)},e[40]=u.id,e[41]=a,e[42]=l.options.meta,e[43]=ce):ce=e[43],E=ce,g=gy,T=!1,f=py,D=Me("flex size-full items-center justify-between gap-2 p-2 text-sm hover:bg-accent/40 data-[state=open]:bg-accent/40 [&_svg]:size-4",H&&"pointer-events-none",n),e[6]=n,e[7]=u,e[8]=a,e[9]=l,e[10]=f,e[11]=g,e[12]=m,e[13]=p,e[14]=v,e[15]=S,e[16]=C,e[17]=w,e[18]=M,e[19]=R,e[20]=E,e[21]=N,e[22]=D,e[23]=T}else f=e[10],g=e[11],m=e[12],p=e[13],v=e[14],S=e[15],C=e[16],w=e[17],M=e[18],R=e[19],E=e[20],N=e[21],D=e[22],T=e[23];let k;e[44]!==d?(k=y.jsx("span",{className:"shrink-0 whitespace-nowrap font-medium",children:d}),e[44]=d,e[45]=k):k=e[45];let A;e[46]!==m||e[47]!==p?(A=m?y.jsx("span",{className:"min-w-0 shrink truncate text-xs text-muted-foreground",children:su(m)}):p&&y.jsxs(ay,{delayDuration:100,children:[y.jsx(sy,{asChild:!0,children:y.jsx(p.icon,{className:"size-3.5 shrink-0 text-muted-foreground"})}),y.jsx(iy,{side:"top",children:y.jsx("p",{children:p.label})})]}),e[46]=m,e[47]=p,e[48]=A):A=e[48];let B;e[49]!==k||e[50]!==A?(B=y.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden",children:[k,A]}),e[49]=k,e[50]=A,e[51]=B):B=e[51];let W;e[52]===Symbol.for("react.memo_cache_sentinel")?(W=y.jsx(la,{className:"shrink-0 text-muted-foreground"}),e[52]=W):W=e[52];let U;e[53]!==f||e[54]!==E||e[55]!==i||e[56]!==D||e[57]!==B?(U=y.jsxs(f,{className:D,onPointerDown:E,...i,children:[B,W]}),e[53]=f,e[54]=E,e[55]=i,e[56]=D,e[57]=B,e[58]=U):U=e[58];let Y;e[59]!==u||e[60]!==M||e[61]!==R?(Y=u.getCanSort()&&y.jsxs(y.Fragment,{children:[y.jsxs(Hw,{className:"relative ltr:pr-8 ltr:pl-2 rtl:pr-2 rtl:pl-8 [&>span:first-child]:ltr:right-2 [&>span:first-child]:ltr:left-auto [&>span:first-child]:rtl:right-auto [&>span:first-child]:rtl:left-2 [&_svg]:text-muted-foreground",checked:u.getIsSorted()==="asc",onSelect:()=>R("asc"),children:[y.jsx(Zf,{}),"Sort asc"]}),y.jsxs(Hw,{className:"relative ltr:pr-8 ltr:pl-2 rtl:pr-2 rtl:pl-8 [&>span:first-child]:ltr:right-2 [&>span:first-child]:ltr:left-auto [&>span:first-child]:rtl:right-auto [&>span:first-child]:rtl:left-2 [&_svg]:text-muted-foreground",checked:u.getIsSorted()==="desc",onSelect:()=>R("desc"),children:[y.jsx(la,{}),"Sort desc"]}),u.getIsSorted()&&y.jsxs(Vo,{onSelect:M,children:[y.jsx(os,{}),"Remove sort"]})]}),e[59]=u,e[60]=M,e[61]=R,e[62]=Y):Y=e[62];let Z;e[63]!==u||e[64]!==v||e[65]!==S||e[66]!==C||e[67]!==w||e[68]!==N?(Z=u.getCanPin()&&y.jsxs(y.Fragment,{children:[u.getCanSort()&&y.jsx(hf,{}),v?y.jsxs(Vo,{className:"[&_svg]:text-muted-foreground",onSelect:N,children:[y.jsx(Pw,{}),"Unpin from left"]}):y.jsxs(Vo,{className:"[&_svg]:text-muted-foreground",onSelect:C,children:[y.jsx($w,{}),"Pin to left"]}),S?y.jsxs(Vo,{className:"[&_svg]:text-muted-foreground",onSelect:N,children:[y.jsx(Pw,{}),"Unpin from right"]}):y.jsxs(Vo,{className:"[&_svg]:text-muted-foreground",onSelect:w,children:[y.jsx($w,{}),"Pin to right"]})]}),e[63]=u,e[64]=v,e[65]=S,e[66]=C,e[67]=w,e[68]=N,e[69]=Z):Z=e[69];let I;e[70]!==u?(I=u.getCanHide()&&y.jsxs(y.Fragment,{children:[y.jsx(hf,{}),y.jsxs(Vo,{className:"[&_svg]:text-muted-foreground",onSelect:()=>u.toggleVisibility(!1),children:[y.jsx(aM,{}),"Hide column"]})]}),e[70]=u,e[71]=I):I=e[71];let G;e[72]!==I||e[73]!==Y||e[74]!==Z?(G=y.jsxs(yy,{align:"start",sideOffset:0,className:"w-60",children:[Y,Z,I]}),e[72]=I,e[73]=Y,e[74]=Z,e[75]=G):G=e[75];let j;e[76]!==g||e[77]!==G||e[78]!==T||e[79]!==U?(j=y.jsxs(g,{modal:T,children:[U,G]}),e[76]=g,e[77]=G,e[78]=T,e[79]=U,e[80]=j):j=e[80];let L;e[81]!==o||e[82]!==d||e[83]!==l?(L=o.column.getCanResize()&&y.jsx(sF,{header:o,table:l,label:d}),e[81]=o,e[82]=d,e[83]=l,e[84]=L):L=e[84];let $;return e[85]!==j||e[86]!==L?($=y.jsxs(y.Fragment,{children:[j,L]}),e[85]=j,e[86]=L,e[87]=$):$=e[87],$}const sF=x.memo(iF,(t,e)=>{const n=t.header.column,o=e.header.column;return!(n.getIsResizing()!==o.getIsResizing()||n.getSize()!==o.getSize()||t.label!==e.label)});function iF(t){const e=be.c(23),{header:n,table:o,label:a}=t;let i;e[0]!==o?(i=o._getDefaultColumnDef(),e[0]=o,e[1]=i):i=e[1];const l=i;let u;e[2]!==n.column?(u=()=>{n.column.resetSize()},e[2]=n.column,e[3]=u):u=e[3];const d=u,f=`Resize ${a} column`;let g;e[4]!==n.column?(g=n.column.getSize(),e[4]=n.column,e[5]=g):g=e[5];const m=l.minSize,p=l.maxSize;let v;e[6]!==n.column?(v=n.column.getIsResizing()?"bg-primary":"opacity-0 hover:opacity-100",e[6]=n.column,e[7]=v):v=e[7];let S;e[8]!==v?(S=Me("absolute -end-px top-0 z-50 h-full w-0.5 cursor-ew-resize touch-none select-none bg-border transition-opacity after:absolute after:inset-y-0 after:start-1/2 after:h-full after:w-[18px] after:-translate-x-1/2 after:content-[''] hover:bg-primary focus:bg-primary focus:outline-none",v),e[8]=v,e[9]=S):S=e[9];let C;e[10]!==n?(C=n.getResizeHandler(),e[10]=n,e[11]=C):C=e[11];let w;e[12]!==n?(w=n.getResizeHandler(),e[12]=n,e[13]=w):w=e[13];let M;return e[14]!==l.maxSize||e[15]!==l.minSize||e[16]!==d||e[17]!==w||e[18]!==f||e[19]!==g||e[20]!==S||e[21]!==C?(M=y.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":f,"aria-valuenow":g,"aria-valuemin":m,"aria-valuemax":p,tabIndex:0,className:S,onDoubleClick:d,onMouseDown:C,onTouchStart:w}),e[14]=l.maxSize,e[15]=l.minSize,e[16]=d,e[17]=w,e[18]=f,e[19]=g,e[20]=S,e[21]=C,e[22]=M):M=e[22],M}const sR=typeof window<"u"?x.useLayoutEffect:x.useEffect;function lu(t){const e=be.c(2),n=x.useRef(t);let o;return e[0]!==t?(o=()=>{n.current=t},e[0]=t,e[1]=o):o=e[1],sR(o),n}function lF(t){const e=be.c(11),{tableMeta:n,columns:o,contextMenu:a}=t,i=n?.onContextMenuOpenChange,l=n?.selectionState,u=n?.dataGridRef,d=n?.onDataUpdate,f=n?.onRowsDelete,g=n?.onCellsCopy,m=n?.onCellsCut;if(!a.open)return null;let p;return e[0]!==o||e[1]!==a||e[2]!==u||e[3]!==g||e[4]!==m||e[5]!==i||e[6]!==d||e[7]!==f||e[8]!==l||e[9]!==n?(p=y.jsx(cF,{tableMeta:n,columns:o,dataGridRef:u,contextMenu:a,onContextMenuOpenChange:i,selectionState:l,onDataUpdate:d,onRowsDelete:f,onCellsCopy:g,onCellsCut:m}),e[0]=o,e[1]=a,e[2]=u,e[3]=g,e[4]=m,e[5]=i,e[6]=d,e[7]=f,e[8]=l,e[9]=n,e[10]=p):p=e[10],p}const cF=x.memo(uF,(t,e)=>{if(t.contextMenu.open!==e.contextMenu.open)return!1;if(!e.contextMenu.open)return!0;if(t.contextMenu.x!==e.contextMenu.x||t.contextMenu.y!==e.contextMenu.y)return!1;const n=t.selectionState?.selectedCells?.size??0,o=e.selectionState?.selectedCells?.size??0;return n===o});function uF(t){const e=be.c(48),{tableMeta:n,columns:o,dataGridRef:a,contextMenu:i,onContextMenuOpenChange:l,selectionState:u,onDataUpdate:d,onRowsDelete:f,onCellsCopy:g,onCellsCut:m}=t;let p;e[0]!==o||e[1]!==a||e[2]!==g||e[3]!==m||e[4]!==d||e[5]!==f||e[6]!==u?(p={dataGridRef:a,selectionState:u,onDataUpdate:d,onRowsDelete:f,onCellsCopy:g,onCellsCut:m,columns:o},e[0]=o,e[1]=a,e[2]=g,e[3]=m,e[4]=d,e[5]=f,e[6]=u,e[7]=p):p=e[7];const v=lu(p),S=`${i.x}px`,C=`${i.y}px`;let w;e[8]!==S||e[9]!==C?(w={position:"fixed",left:S,top:C,width:"1px",height:"1px",padding:0,margin:0,border:"none",background:"transparent",pointerEvents:"none",opacity:0},e[8]=S,e[9]=C,e[10]=w):w=e[10];const M=w;let R;e[11]!==v?(R=q=>{q.preventDefault(),v.current.dataGridRef?.current?.focus()},e[11]=v,e[12]=R):R=e[12];const E=R;let N;e[13]!==v?(N=()=>{v.current.onCellsCopy?.()},e[13]=v,e[14]=N):N=e[14];const D=N;let T;e[15]!==v?(T=()=>{v.current.onCellsCut?.()},e[15]=v,e[16]=T):T=e[16];const k=T;let A;e[17]!==v?(A=()=>{const{selectionState:q,columns:J,onDataUpdate:oe}=v.current;if(!q?.selectedCells||q.selectedCells.size===0)return;const K=[];for(const ee of q.selectedCells){const{rowIndex:ae,columnId:ce}=Ho(ee),se=J.find(De=>De.id?De.id===ce:"accessorKey"in De?De.accessorKey===ce:!1)?.meta?.cell?.variant;let ve="";se==="multi-select"||se==="file"?ve=[]:se==="number"||se==="date"?ve=null:se==="checkbox"&&(ve=!1),K.push({rowIndex:ae,columnId:ce,value:ve})}oe?.(K),hn.success(`${K.length} cell${K.length!==1?"s":""} cleared`)},e[17]=v,e[18]=A):A=e[18];const B=A;let W;e[19]!==v?(W=async()=>{const{selectionState:q,onRowsDelete:J}=v.current;if(!q?.selectedCells||q.selectedCells.size===0)return;const oe=new Set;for(const ae of q.selectedCells){const{rowIndex:ce}=Ho(ae);oe.add(ce)}const K=Array.from(oe).sort(dF),ee=K.length;await J?.(K),hn.success(`${ee} row${ee!==1?"s":""} deleted`)},e[19]=v,e[20]=W):W=e[20];const U=W;let Y;e[21]!==M?(Y=y.jsx(py,{style:M}),e[21]=M,e[22]=Y):Y=e[22];let Z;e[23]===Symbol.for("react.memo_cache_sentinel")?(Z=y.jsx(Q0,{}),e[23]=Z):Z=e[23];let I;e[24]!==D?(I=y.jsxs(Vo,{onSelect:D,children:[Z,"Copy"]}),e[24]=D,e[25]=I):I=e[25];const G=n?.readOnly;let j;e[26]===Symbol.for("react.memo_cache_sentinel")?(j=y.jsx(hI,{}),e[26]=j):j=e[26];let L;e[27]!==k||e[28]!==G?(L=y.jsxs(Vo,{onSelect:k,disabled:G,children:[j,"Cut"]}),e[27]=k,e[28]=G,e[29]=L):L=e[29];const $=n?.readOnly;let H;e[30]===Symbol.for("react.memo_cache_sentinel")?(H=y.jsx(R8,{}),e[30]=H):H=e[30];let X;e[31]!==B||e[32]!==$?(X=y.jsxs(Vo,{onSelect:B,disabled:$,children:[H,"Clear"]}),e[31]=B,e[32]=$,e[33]=X):X=e[33];let P;e[34]!==U||e[35]!==f?(P=f&&y.jsxs(y.Fragment,{children:[y.jsx(hf,{}),y.jsxs(Vo,{variant:"destructive",onSelect:U,children:[y.jsx(lM,{}),"Delete rows"]})]}),e[34]=U,e[35]=f,e[36]=P):P=e[36];let z;e[37]!==E||e[38]!==I||e[39]!==L||e[40]!==X||e[41]!==P?(z=y.jsxs(yy,{"data-grid-popover":"",align:"start",className:"w-48",onCloseAutoFocus:E,children:[I,L,X,P]}),e[37]=E,e[38]=I,e[39]=L,e[40]=X,e[41]=P,e[42]=z):z=e[42];let V;return e[43]!==i.open||e[44]!==l||e[45]!==Y||e[46]!==z?(V=y.jsxs(gy,{open:i.open,onOpenChange:l,children:[Y,z]}),e[43]=i.open,e[44]=l,e[45]=Y,e[46]=z,e[47]=V):V=e[47],V}function dF(t,e){return t-e}function fF(t){const e=be.c(4),{tableMeta:n,pasteDialog:o}=t,a=n?.onPasteDialogOpenChange,i=n?.onCellsPaste;if(!o.open)return null;let l;return e[0]!==i||e[1]!==a||e[2]!==o?(l=y.jsx(hF,{pasteDialog:o,onPasteDialogOpenChange:a,onCellsPaste:i}),e[0]=i,e[1]=a,e[2]=o,e[3]=l):l=e[3],l}const hF=x.memo(mF,(t,e)=>t.pasteDialog.open!==e.pasteDialog.open?!1:e.pasteDialog.open?t.pasteDialog.rowsNeeded===e.pasteDialog.rowsNeeded:!0);function mF(t){const e=be.c(39),{pasteDialog:n,onPasteDialogOpenChange:o,onCellsPaste:a}=t;let i;e[0]!==a||e[1]!==o?(i={onPasteDialogOpenChange:o,onCellsPaste:a},e[0]=a,e[1]=o,e[2]=i):i=e[2];const l=lu(i),u=x.useRef(null);let d;e[3]!==l?(d=I=>{l.current.onPasteDialogOpenChange?.(I)},e[3]=l,e[4]=d):d=e[4];const f=d;let g;e[5]!==l?(g=()=>{l.current.onPasteDialogOpenChange?.(!1)},e[5]=l,e[6]=g):g=e[6];const m=g;let p;e[7]!==l?(p=()=>{l.current.onCellsPaste?.(u.current?.checked??!1)},e[7]=l,e[8]=p):p=e[8];const v=p;let S;e[9]===Symbol.for("react.memo_cache_sentinel")?(S=y.jsx(dy,{children:"Do you want to add more rows?"}),e[9]=S):S=e[9];let C;e[10]!==n.rowsNeeded?(C=y.jsx("strong",{children:n.rowsNeeded}),e[10]=n.rowsNeeded,e[11]=C):C=e[11];const w=n.rowsNeeded!==1?"s":"";let M;e[12]!==C||e[13]!==w?(M=y.jsxs(uy,{children:[S,y.jsxs(fy,{children:["We need ",C," additional row",w," to paste everything from your clipboard."]})]}),e[12]=C,e[13]=w,e[14]=M):M=e[14];let R;e[15]===Symbol.for("react.memo_cache_sentinel")?(R=y.jsx(eC,{ref:u,name:"expand-option",value:"expand",defaultChecked:!0}),e[15]=R):R=e[15];let E;e[16]===Symbol.for("react.memo_cache_sentinel")?(E=y.jsx("span",{className:"font-medium text-sm leading-none",children:"Create new rows"}),e[16]=E):E=e[16];const N=n.rowsNeeded!==1?"s":"";let D;e[17]!==n.rowsNeeded||e[18]!==N?(D=y.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[R,y.jsxs("div",{className:"flex flex-col gap-1",children:[E,y.jsxs("span",{className:"text-muted-foreground text-sm",children:["Add ",n.rowsNeeded," new row",N," to the table and paste all data"]})]})]}),e[17]=n.rowsNeeded,e[18]=N,e[19]=D):D=e[19];let T;e[20]===Symbol.for("react.memo_cache_sentinel")?(T=y.jsx(eC,{name:"expand-option",value:"no-expand"}),e[20]=T):T=e[20];let k;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=y.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[T,y.jsxs("div",{className:"flex flex-col gap-1",children:[y.jsx("span",{className:"font-medium text-sm leading-none",children:"Keep current rows"}),y.jsx("span",{className:"text-muted-foreground text-sm",children:"Paste only what fits in the existing rows"})]})]}),e[21]=k):k=e[21];let A;e[22]!==D?(A=y.jsxs("div",{className:"flex flex-col gap-3 py-1",children:[D,k]}),e[22]=D,e[23]=A):A=e[23];let B;e[24]!==m?(B=y.jsx(nn,{variant:"outline",onClick:m,children:"Cancel"}),e[24]=m,e[25]=B):B=e[25];let W;e[26]!==v?(W=y.jsx(nn,{onClick:v,children:"Continue"}),e[26]=v,e[27]=W):W=e[27];let U;e[28]!==B||e[29]!==W?(U=y.jsxs(dM,{children:[B,W]}),e[28]=B,e[29]=W,e[30]=U):U=e[30];let Y;e[31]!==A||e[32]!==U||e[33]!==M?(Y=y.jsxs(cy,{"data-grid-popover":"",children:[M,A,U]}),e[31]=A,e[32]=U,e[33]=M,e[34]=Y):Y=e[34];let Z;return e[35]!==f||e[36]!==n.open||e[37]!==Y?(Z=y.jsx(ly,{open:n.open,onOpenChange:f,children:Y}),e[35]=f,e[36]=n.open,e[37]=Y,e[38]=Z):Z=e[38],Z}function eC(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("relative size-4 shrink-0 appearance-none rounded-full border border-input bg-background shadow-xs outline-none transition-[color,box-shadow]","text-primary focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","disabled:cursor-not-allowed disabled:opacity-50","checked:before:absolute checked:before:start-1/2 checked:before:top-1/2 checked:before:size-2 checked:before:-translate-x-1/2 checked:before:-translate-y-1/2 checked:before:rounded-full checked:before:bg-primary checked:before:content-['']","dark:bg-input/30",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("input",{type:"radio",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function tC(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function gF(...t){return e=>{let n=!1;const o=t.map(a=>{const i=tC(a,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<o.length;a++){const i=o[a];typeof i=="function"?i():tC(t[a],null)}}}}function iR(...t){return x.useCallback(gF(...t),t)}function fa(t){const e=be.c(85);let n,o,a,i,l,u,d,f,g,m,p,v,S,C,w;e[0]!==t?({tableMeta:w,rowIndex:C,columnId:o,isEditing:i,isFocused:l,isSelected:d,isSearchMatch:u,isActiveSearchMatch:a,readOnly:p,rowHeight:S,className:n,onClick:f,onKeyDown:g,ref:v,...m}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l,e[6]=u,e[7]=d,e[8]=f,e[9]=g,e[10]=m,e[11]=p,e[12]=v,e[13]=S,e[14]=C,e[15]=w):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5],u=e[6],d=e[7],f=e[8],g=e[9],m=e[10],p=e[11],v=e[12],S=e[13],C=e[14],w=e[15]);const M=w?.cellMapRef;let R;e[16]!==M||e[17]!==o||e[18]!==C?(R=se=>{if(!M)return;const ve=tn(C,o);se?M.current.set(ve,se):M.current.delete(ve)},e[16]=M,e[17]=o,e[18]=C,e[19]=R):R=e[19];const N=iR(v,R);let D;e[20]!==o||e[21]!==i||e[22]!==l||e[23]!==f||e[24]!==p||e[25]!==C||e[26]!==w?(D=se=>{i||(se.preventDefault(),f?.(se),l&&!p?w?.onCellEditingStart?.(C,o):w?.onCellClick?.(C,o,se))},e[20]=o,e[21]=i,e[22]=l,e[23]=f,e[24]=p,e[25]=C,e[26]=w,e[27]=D):D=e[27];const T=D;let k;e[28]!==o||e[29]!==i||e[30]!==C||e[31]!==w?(k=se=>{i||w?.onCellContextMenu?.(C,o,se)},e[28]=o,e[29]=i,e[30]=C,e[31]=w,e[32]=k):k=e[32];const A=k;let B;e[33]!==o||e[34]!==i||e[35]!==C||e[36]!==w?(B=se=>{i||(se.preventDefault(),w?.onCellDoubleClick?.(C,o))},e[33]=o,e[34]=i,e[35]=C,e[36]=w,e[37]=B):B=e[37];const W=B;let U;e[38]!==o||e[39]!==i||e[40]!==l||e[41]!==g||e[42]!==p||e[43]!==C||e[44]!==w?(U=se=>{if(g?.(se),!se.defaultPrevented&&!(se.key==="ArrowUp"||se.key==="ArrowDown"||se.key==="ArrowLeft"||se.key==="ArrowRight"||se.key==="Home"||se.key==="End"||se.key==="PageUp"||se.key==="PageDown"||se.key==="Tab")&&l&&!i&&!p){if(se.key==="F2"||se.key==="Enter"){se.preventDefault(),se.stopPropagation(),w?.onCellEditingStart?.(C,o);return}if(se.key===" "){se.preventDefault(),se.stopPropagation(),w?.onCellEditingStart?.(C,o);return}se.key.length===1&&!se.ctrlKey&&!se.metaKey&&(se.preventDefault(),se.stopPropagation(),w?.onCellEditingStart?.(C,o))}},e[38]=o,e[39]=i,e[40]=l,e[41]=g,e[42]=p,e[43]=C,e[44]=w,e[45]=U):U=e[45];const Y=U;let Z;e[46]!==o||e[47]!==i||e[48]!==C||e[49]!==w?(Z=se=>{i||w?.onCellMouseDown?.(C,o,se)},e[46]=o,e[47]=i,e[48]=C,e[49]=w,e[50]=Z):Z=e[50];const I=Z;let G;e[51]!==o||e[52]!==i||e[53]!==C||e[54]!==w?(G=()=>{i||w?.onCellMouseEnter?.(C,o)},e[51]=o,e[52]=i,e[53]=C,e[54]=w,e[55]=G):G=e[55];const j=G;let L;e[56]!==i||e[57]!==w?(L=()=>{i||w?.onCellMouseUp?.()},e[56]=i,e[57]=w,e[58]=L):L=e[58];const $=L,H=i?"":void 0,X=l?"":void 0,P=d?"":void 0,z=l&&!i?0:-1,V=u&&!a,q=d&&!i,J=!i,oe=!i&&S==="short",K=!i&&S==="medium",ee=!i&&S==="tall",ae=!i&&S==="extra-tall";let ce;e[59]!==n||e[60]!==a||e[61]!==l||e[62]!==V||e[63]!==q||e[64]!==J||e[65]!==oe||e[66]!==K||e[67]!==ee||e[68]!==ae?(ce=Me("size-full px-2 py-1.5 text-start text-sm outline-none has-data-[slot=checkbox]:pt-2.5",{"ring-1 ring-ring ring-inset":l,"bg-yellow-100 dark:bg-yellow-900/30":V,"bg-orange-200 dark:bg-orange-900/50":a,"bg-primary/10":q,"cursor-default":J,"**:data-[slot=grid-cell-content]:line-clamp-1":oe,"**:data-[slot=grid-cell-content]:line-clamp-2":K,"**:data-[slot=grid-cell-content]:line-clamp-3":ee,"**:data-[slot=grid-cell-content]:line-clamp-4":ae},n),e[59]=n,e[60]=a,e[61]=l,e[62]=V,e[63]=q,e[64]=J,e[65]=oe,e[66]=K,e[67]=ee,e[68]=ae,e[69]=ce):ce=e[69];let ge;return e[70]!==N||e[71]!==T||e[72]!==A||e[73]!==W||e[74]!==Y||e[75]!==I||e[76]!==j||e[77]!==$||e[78]!==m||e[79]!==X||e[80]!==P||e[81]!==z||e[82]!==ce||e[83]!==H?(ge=y.jsx("div",{role:"button","data-slot":"grid-cell-wrapper","data-editing":H,"data-focused":X,"data-selected":P,tabIndex:z,...m,ref:N,className:ce,onClick:T,onContextMenu:A,onDoubleClick:W,onMouseDown:I,onMouseEnter:j,onMouseUp:$,onKeyDown:Y}),e[70]=N,e[71]=T,e[72]=A,e[73]=W,e[74]=Y,e[75]=I,e[76]=j,e[77]=$,e[78]=m,e[79]=X,e[80]=P,e[81]=z,e[82]=ce,e[83]=H,e[84]=ge):ge=e[84],ge}function pF(t,e,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:t,timeZoneName:n}).format(e).split(/\s/g).slice(2).join(" ")}const yF={},yc={};function Ns(t,e){try{const o=(yF[t]||=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).format)(e).split("GMT")[1];return o in yc?yc[o]:nC(o,o.split(":"))}catch{if(t in yc)return yc[t];const n=t?.match(vF);return n?nC(t,n.slice(1)):NaN}}const vF=/([+-]\d\d):?(\d\d)?/;function nC(t,e){const n=+(e[0]||0),o=+(e[1]||0),a=+(e[2]||0)/60;return yc[t]=n*60+o>0?n*60+o+a:n*60-o-a}class vr extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Ns(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),lR(this),a0(this)):this.setTime(Date.now())}static tz(e,...n){return n.length?new vr(...n,e):new vr(Date.now(),e)}withTimeZone(e){return new vr(+this,e)}getTimezoneOffset(){const e=-Ns(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),a0(this),+this}[Symbol.for("constructDateFrom")](e){return new vr(+new Date(e),this.timeZone)}}const oC=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!oC.test(t))return;const e=t.replace(oC,"$1UTC");vr.prototype[e]&&(t.startsWith("get")?vr.prototype[t]=function(){return this.internal[e]()}:(vr.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),xF(this),+this},vr.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),a0(this),+this}))});function a0(t){t.internal.setTime(+t),t.internal.setUTCSeconds(t.internal.getUTCSeconds()-Math.round(-Ns(t.timeZone,t)*60))}function xF(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),lR(t)}function lR(t){const e=Ns(t.timeZone,t),n=e>0?Math.floor(e):Math.ceil(e),o=new Date(+t);o.setUTCHours(o.getUTCHours()-1);const a=-new Date(+t).getTimezoneOffset(),i=-new Date(+o).getTimezoneOffset(),l=a-i,u=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();l&&u&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+l);const d=a-n;d&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+d);const f=new Date(+t);f.setUTCSeconds(0);const g=a>0?f.getSeconds():(f.getSeconds()-60)%60,m=Math.round(-(Ns(t.timeZone,t)*60))%60;(m||g)&&(t.internal.setUTCSeconds(t.internal.getUTCSeconds()+m),Date.prototype.setUTCSeconds.call(t,Date.prototype.getUTCSeconds.call(t)+m+g));const p=Ns(t.timeZone,t),v=p>0?Math.floor(p):Math.ceil(p),C=-new Date(+t).getTimezoneOffset()-v,w=v!==n,M=C-d;if(w&&M){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+M);const R=Ns(t.timeZone,t),E=R>0?Math.floor(R):Math.ceil(R),N=v-E;N&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+N),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+N))}}class Wn extends vr{static tz(e,...n){return n.length?new Wn(...n,e):new Wn(Date.now(),e)}toISOString(){const[e,n,o]=this.tzComponents(),a=`${e}${n}:${o}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,n,o,a]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${o} ${n} ${a}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[n,o,a]=this.tzComponents();return`${e} GMT${n}${o}${a} (${pF(this.timeZone,this)})`}toLocaleString(e,n){return Date.prototype.toLocaleString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleDateString(e,n){return Date.prototype.toLocaleDateString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}toLocaleTimeString(e,n){return Date.prototype.toLocaleTimeString.call(this,e,{...n,timeZone:n?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset(),n=e>0?"-":"+",o=String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),a=String(Math.abs(e)%60).padStart(2,"0");return[n,o,a]}withTimeZone(e){return new Wn(+this,e)}[Symbol.for("constructDateFrom")](e){return new Wn(+new Date(e),this.timeZone)}}const cR=6048e5,bF=864e5,rC=Symbol.for("constructDateFrom");function _n(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&rC in t?t[rC](e):t instanceof Date?new t.constructor(e):new Date(e)}function Gt(t,e){return _n(e||t,t)}function uR(t,e,n){const o=Gt(t,n?.in);return isNaN(e)?_n(t,NaN):(e&&o.setDate(o.getDate()+e),o)}function dR(t,e,n){const o=Gt(t,n?.in);if(isNaN(e))return _n(t,NaN);if(!e)return o;const a=o.getDate(),i=_n(t,o.getTime());i.setMonth(o.getMonth()+e+1,0);const l=i.getDate();return a>=l?i:(o.setFullYear(i.getFullYear(),i.getMonth(),a),o)}let wF={};function cu(){return wF}function Zi(t,e){const n=cu(),o=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Gt(t,e?.in),i=a.getDay(),l=(i<o?7:0)+i-o;return a.setDate(a.getDate()-l),a.setHours(0,0,0,0),a}function Bc(t,e){return Zi(t,{...e,weekStartsOn:1})}function fR(t,e){const n=Gt(t,e?.in),o=n.getFullYear(),a=_n(n,0);a.setFullYear(o+1,0,4),a.setHours(0,0,0,0);const i=Bc(a),l=_n(n,0);l.setFullYear(o,0,4),l.setHours(0,0,0,0);const u=Bc(l);return n.getTime()>=i.getTime()?o+1:n.getTime()>=u.getTime()?o:o-1}function aC(t){const e=Gt(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function fl(t,...e){const n=_n.bind(null,e.find(o=>typeof o=="object"));return e.map(n)}function Vc(t,e){const n=Gt(t,e?.in);return n.setHours(0,0,0,0),n}function $y(t,e,n){const[o,a]=fl(n?.in,t,e),i=Vc(o),l=Vc(a),u=+i-aC(i),d=+l-aC(l);return Math.round((u-d)/bF)}function SF(t,e){const n=fR(t,e),o=_n(t,0);return o.setFullYear(n,0,4),o.setHours(0,0,0,0),Bc(o)}function CF(t,e,n){return uR(t,e*7,n)}function EF(t,e,n){return dR(t,e*12,n)}function _F(t,e){let n,o=e?.in;return t.forEach(a=>{!o&&typeof a=="object"&&(o=_n.bind(null,a));const i=Gt(a,o);(!n||n<i||isNaN(+i))&&(n=i)}),_n(o,n||NaN)}function MF(t,e){let n,o=e?.in;return t.forEach(a=>{!o&&typeof a=="object"&&(o=_n.bind(null,a));const i=Gt(a,o);(!n||n>i||isNaN(+i))&&(n=i)}),_n(o,n||NaN)}function NF(t,e,n){const[o,a]=fl(n?.in,t,e);return+Vc(o)==+Vc(a)}function hR(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function RF(t){return!(!hR(t)&&typeof t!="number"||isNaN(+Gt(t)))}function mR(t,e,n){const[o,a]=fl(n?.in,t,e),i=o.getFullYear()-a.getFullYear(),l=o.getMonth()-a.getMonth();return i*12+l}function DF(t,e){const n=Gt(t,e?.in),o=n.getMonth();return n.setFullYear(n.getFullYear(),o+1,0),n.setHours(23,59,59,999),n}function gR(t,e){const[n,o]=fl(t,e.start,e.end);return{start:n,end:o}}function TF(t,e){const{start:n,end:o}=gR(e?.in,t);let a=+n>+o;const i=a?+n:+o,l=a?o:n;l.setHours(0,0,0,0),l.setDate(1);let u=1;const d=[];for(;+l<=i;)d.push(_n(n,l)),l.setMonth(l.getMonth()+u);return a?d.reverse():d}function kF(t,e){const n=Gt(t,e?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function OF(t,e){const n=Gt(t,e?.in),o=n.getFullYear();return n.setFullYear(o+1,0,0),n.setHours(23,59,59,999),n}function pR(t,e){const n=Gt(t,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function AF(t,e){const{start:n,end:o}=gR(e?.in,t);let a=+n>+o;const i=a?+n:+o,l=a?o:n;l.setHours(0,0,0,0),l.setMonth(0,1);let u=1;const d=[];for(;+l<=i;)d.push(_n(n,l)),l.setFullYear(l.getFullYear()+u);return a?d.reverse():d}function yR(t,e){const n=cu(),o=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=Gt(t,e?.in),i=a.getDay(),l=(i<o?-7:0)+6-(i-o);return a.setDate(a.getDate()+l),a.setHours(23,59,59,999),a}function jF(t,e){return yR(t,{...e,weekStartsOn:1})}const zF={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},IF=(t,e,n)=>{let o;const a=zF[t];return typeof a=="string"?o=a:e===1?o=a.one:o=a.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+o:o+" ago":o};function ip(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const PF={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},$F={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},LF={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},HF={date:ip({formats:PF,defaultWidth:"full"}),time:ip({formats:$F,defaultWidth:"full"}),dateTime:ip({formats:LF,defaultWidth:"full"})},BF={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},VF=(t,e,n,o)=>BF[t];function ic(t){return(e,n)=>{const o=n?.context?String(n.context):"standalone";let a;if(o==="formatting"&&t.formattingValues){const l=t.defaultFormattingWidth||t.defaultWidth,u=n?.width?String(n.width):l;a=t.formattingValues[u]||t.formattingValues[l]}else{const l=t.defaultWidth,u=n?.width?String(n.width):t.defaultWidth;a=t.values[u]||t.values[l]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const FF={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},UF={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},YF={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},GF={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},qF={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},WF={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},KF=(t,e)=>{const n=Number(t),o=n%100;if(o>20||o<10)switch(o%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},XF={ordinalNumber:KF,era:ic({values:FF,defaultWidth:"wide"}),quarter:ic({values:UF,defaultWidth:"wide",argumentCallback:t=>t-1}),month:ic({values:YF,defaultWidth:"wide"}),day:ic({values:GF,defaultWidth:"wide"}),dayPeriod:ic({values:qF,defaultWidth:"wide",formattingValues:WF,defaultFormattingWidth:"wide"})};function lc(t){return(e,n={})=>{const o=n.width,a=o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const l=i[0],u=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth],d=Array.isArray(u)?QF(u,m=>m.test(l)):ZF(u,m=>m.test(l));let f;f=t.valueCallback?t.valueCallback(d):d,f=n.valueCallback?n.valueCallback(f):f;const g=e.slice(l.length);return{value:f,rest:g}}}function ZF(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function QF(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function JF(t){return(e,n={})=>{const o=e.match(t.matchPattern);if(!o)return null;const a=o[0],i=e.match(t.parsePattern);if(!i)return null;let l=t.valueCallback?t.valueCallback(i[0]):i[0];l=n.valueCallback?n.valueCallback(l):l;const u=e.slice(a.length);return{value:l,rest:u}}}const eU=/^(\d+)(th|st|nd|rd)?/i,tU=/\d+/i,nU={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},oU={any:[/^b/i,/^(a|c)/i]},rU={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},aU={any:[/1/i,/2/i,/3/i,/4/i]},sU={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},iU={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},lU={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},cU={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},uU={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},dU={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},fU={ordinalNumber:JF({matchPattern:eU,parsePattern:tU,valueCallback:t=>parseInt(t,10)}),era:lc({matchPatterns:nU,defaultMatchWidth:"wide",parsePatterns:oU,defaultParseWidth:"any"}),quarter:lc({matchPatterns:rU,defaultMatchWidth:"wide",parsePatterns:aU,defaultParseWidth:"any",valueCallback:t=>t+1}),month:lc({matchPatterns:sU,defaultMatchWidth:"wide",parsePatterns:iU,defaultParseWidth:"any"}),day:lc({matchPatterns:lU,defaultMatchWidth:"wide",parsePatterns:cU,defaultParseWidth:"any"}),dayPeriod:lc({matchPatterns:uU,defaultMatchWidth:"any",parsePatterns:dU,defaultParseWidth:"any"})},Di={code:"en-US",formatDistance:IF,formatLong:HF,formatRelative:VF,localize:XF,match:fU,options:{weekStartsOn:0,firstWeekContainsDate:1}};function hU(t,e){const n=Gt(t,e?.in);return $y(n,pR(n))+1}function Ly(t,e){const n=Gt(t,e?.in),o=+Bc(n)-+SF(n);return Math.round(o/cR)+1}function vR(t,e){const n=Gt(t,e?.in),o=n.getFullYear(),a=cu(),i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,l=_n(e?.in||t,0);l.setFullYear(o+1,0,i),l.setHours(0,0,0,0);const u=Zi(l,e),d=_n(e?.in||t,0);d.setFullYear(o,0,i),d.setHours(0,0,0,0);const f=Zi(d,e);return+n>=+u?o+1:+n>=+f?o:o-1}function mU(t,e){const n=cu(),o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=vR(t,e),i=_n(e?.in||t,0);return i.setFullYear(a,0,o),i.setHours(0,0,0,0),Zi(i,e)}function Hy(t,e){const n=Gt(t,e?.in),o=+Zi(n,e)-+mU(n,e);return Math.round(o/cR)+1}function Bt(t,e){const n=t<0?"-":"",o=Math.abs(t).toString().padStart(e,"0");return n+o}const Ha={y(t,e){const n=t.getFullYear(),o=n>0?n:1-n;return Bt(e==="yy"?o%100:o,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):Bt(n+1,2)},d(t,e){return Bt(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(t,e){return Bt(t.getHours()%12||12,e.length)},H(t,e){return Bt(t.getHours(),e.length)},m(t,e){return Bt(t.getMinutes(),e.length)},s(t,e){return Bt(t.getSeconds(),e.length)},S(t,e){const n=e.length,o=t.getMilliseconds(),a=Math.trunc(o*Math.pow(10,n-3));return Bt(a,e.length)}},Mi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sC={G:function(t,e,n){const o=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(o,{width:"abbreviated"});case"GGGGG":return n.era(o,{width:"narrow"});default:return n.era(o,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const o=t.getFullYear(),a=o>0?o:1-o;return n.ordinalNumber(a,{unit:"year"})}return Ha.y(t,e)},Y:function(t,e,n,o){const a=vR(t,o),i=a>0?a:1-a;if(e==="YY"){const l=i%100;return Bt(l,2)}return e==="Yo"?n.ordinalNumber(i,{unit:"year"}):Bt(i,e.length)},R:function(t,e){const n=fR(t);return Bt(n,e.length)},u:function(t,e){const n=t.getFullYear();return Bt(n,e.length)},Q:function(t,e,n){const o=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(o);case"QQ":return Bt(o,2);case"Qo":return n.ordinalNumber(o,{unit:"quarter"});case"QQQ":return n.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(o,{width:"narrow",context:"formatting"});default:return n.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,e,n){const o=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(o);case"qq":return Bt(o,2);case"qo":return n.ordinalNumber(o,{unit:"quarter"});case"qqq":return n.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(o,{width:"narrow",context:"standalone"});default:return n.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,e,n){const o=t.getMonth();switch(e){case"M":case"MM":return Ha.M(t,e);case"Mo":return n.ordinalNumber(o+1,{unit:"month"});case"MMM":return n.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(o,{width:"narrow",context:"formatting"});default:return n.month(o,{width:"wide",context:"formatting"})}},L:function(t,e,n){const o=t.getMonth();switch(e){case"L":return String(o+1);case"LL":return Bt(o+1,2);case"Lo":return n.ordinalNumber(o+1,{unit:"month"});case"LLL":return n.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(o,{width:"narrow",context:"standalone"});default:return n.month(o,{width:"wide",context:"standalone"})}},w:function(t,e,n,o){const a=Hy(t,o);return e==="wo"?n.ordinalNumber(a,{unit:"week"}):Bt(a,e.length)},I:function(t,e,n){const o=Ly(t);return e==="Io"?n.ordinalNumber(o,{unit:"week"}):Bt(o,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Ha.d(t,e)},D:function(t,e,n){const o=hU(t);return e==="Do"?n.ordinalNumber(o,{unit:"dayOfYear"}):Bt(o,e.length)},E:function(t,e,n){const o=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},e:function(t,e,n,o){const a=t.getDay(),i=(a-o.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return Bt(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,o){const a=t.getDay(),i=(a-o.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return Bt(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const o=t.getDay(),a=o===0?7:o;switch(e){case"i":return String(a);case"ii":return Bt(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},a:function(t,e,n){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,n){const o=t.getHours();let a;switch(o===12?a=Mi.noon:o===0?a=Mi.midnight:a=o/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const o=t.getHours();let a;switch(o>=17?a=Mi.evening:o>=12?a=Mi.afternoon:o>=4?a=Mi.morning:a=Mi.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let o=t.getHours()%12;return o===0&&(o=12),n.ordinalNumber(o,{unit:"hour"})}return Ha.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Ha.H(t,e)},K:function(t,e,n){const o=t.getHours()%12;return e==="Ko"?n.ordinalNumber(o,{unit:"hour"}):Bt(o,e.length)},k:function(t,e,n){let o=t.getHours();return o===0&&(o=24),e==="ko"?n.ordinalNumber(o,{unit:"hour"}):Bt(o,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Ha.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Ha.s(t,e)},S:function(t,e){return Ha.S(t,e)},X:function(t,e,n){const o=t.getTimezoneOffset();if(o===0)return"Z";switch(e){case"X":return lC(o);case"XXXX":case"XX":return _s(o);default:return _s(o,":")}},x:function(t,e,n){const o=t.getTimezoneOffset();switch(e){case"x":return lC(o);case"xxxx":case"xx":return _s(o);default:return _s(o,":")}},O:function(t,e,n){const o=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+iC(o,":");default:return"GMT"+_s(o,":")}},z:function(t,e,n){const o=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+iC(o,":");default:return"GMT"+_s(o,":")}},t:function(t,e,n){const o=Math.trunc(+t/1e3);return Bt(o,e.length)},T:function(t,e,n){return Bt(+t,e.length)}};function iC(t,e=""){const n=t>0?"-":"+",o=Math.abs(t),a=Math.trunc(o/60),i=o%60;return i===0?n+String(a):n+String(a)+e+Bt(i,2)}function lC(t,e){return t%60===0?(t>0?"-":"+")+Bt(Math.abs(t)/60,2):_s(t,e)}function _s(t,e=""){const n=t>0?"-":"+",o=Math.abs(t),a=Bt(Math.trunc(o/60),2),i=Bt(o%60,2);return n+a+e+i}const cC=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},xR=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},gU=(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],o=n[1],a=n[2];if(!a)return cC(t,e);let i;switch(o){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",cC(o,e)).replace("{{time}}",xR(a,e))},pU={p:xR,P:gU},yU=/^D+$/,vU=/^Y+$/,xU=["D","DD","YY","YYYY"];function bU(t){return yU.test(t)}function wU(t){return vU.test(t)}function SU(t,e,n){const o=CU(t,e,n);if(console.warn(o),xU.includes(t))throw new RangeError(o)}function CU(t,e,n){const o=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${o} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const EU=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_U=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,MU=/^'([^]*?)'?$/,NU=/''/g,RU=/[a-zA-Z]/;function vc(t,e,n){const o=cu(),a=n?.locale??o.locale??Di,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,l=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,u=Gt(t,n?.in);if(!RF(u))throw new RangeError("Invalid time value");let d=e.match(_U).map(g=>{const m=g[0];if(m==="p"||m==="P"){const p=pU[m];return p(g,a.formatLong)}return g}).join("").match(EU).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const m=g[0];if(m==="'")return{isToken:!1,value:DU(g)};if(sC[m])return{isToken:!0,value:g};if(m.match(RU))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:g}});a.localize.preprocessor&&(d=a.localize.preprocessor(u,d));const f={firstWeekContainsDate:i,weekStartsOn:l,locale:a};return d.map(g=>{if(!g.isToken)return g.value;const m=g.value;(!n?.useAdditionalWeekYearTokens&&wU(m)||!n?.useAdditionalDayOfYearTokens&&bU(m))&&SU(m,e,String(t));const p=sC[m[0]];return p(u,m,a.localize,f)}).join("")}function DU(t){const e=t.match(MU);return e?e[1].replace(NU,"'"):t}function TU(t,e){const n=Gt(t,e?.in),o=n.getFullYear(),a=n.getMonth(),i=_n(n,0);return i.setFullYear(o,a+1,0),i.setHours(0,0,0,0),i.getDate()}function kU(t,e){return Gt(t,e?.in).getMonth()}function OU(t,e){return Gt(t,e?.in).getFullYear()}function AU(t,e){return+Gt(t)>+Gt(e)}function jU(t,e){return+Gt(t)<+Gt(e)}function zU(t,e,n){const[o,a]=fl(n?.in,t,e);return o.getFullYear()===a.getFullYear()&&o.getMonth()===a.getMonth()}function IU(t,e,n){const[o,a]=fl(n?.in,t,e);return o.getFullYear()===a.getFullYear()}function PU(t,e,n){const o=Gt(t,n?.in),a=o.getFullYear(),i=o.getDate(),l=_n(t,0);l.setFullYear(a,e,15),l.setHours(0,0,0,0);const u=TU(l);return o.setMonth(e,Math.min(i,u)),o}function $U(t,e,n){const o=Gt(t,n?.in);return isNaN(+o)?_n(t,NaN):(o.setFullYear(e),o)}const uC=5,LU=4;function HU(t,e){const n=e.startOfMonth(t),o=n.getDay()>0?n.getDay():7,a=e.addDays(t,-o+1),i=e.addDays(a,uC*7-1);return e.getMonth(t)===e.getMonth(i)?uC:LU}function bR(t,e){const n=e.startOfMonth(t),o=n.getDay();return o===1?n:o===0?e.addDays(n,-6):e.addDays(n,-1*(o-1))}function BU(t,e){const n=bR(t,e),o=HU(t,e);return e.addDays(n,o*7-1)}const wR={...Di,labels:{labelDayButton:(t,e,n,o)=>{let a;o&&typeof o.format=="function"?a=o.format.bind(o):a=(l,u)=>vc(l,u,{locale:Di,...n});let i=a(t,"PPPP");return e.today&&(i=`Today, ${i}`),e.selected&&(i=`${i}, selected`),i},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:t=>`Week ${t}`,labelYearDropdown:"Choose the Year",labelGrid:(t,e,n)=>{let o;return n&&typeof n.format=="function"?o=n.format.bind(n):o=(a,i)=>vc(a,i,{locale:Di,...e}),o(t,"LLLL yyyy")},labelGridcell:(t,e,n,o)=>{let a;o&&typeof o.format=="function"?a=o.format.bind(o):a=(l,u)=>vc(l,u,{locale:Di,...n});let i=a(t,"PPPP");return e?.today&&(i=`Today, ${i}`),i},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(t,e,n)=>{let o;return n&&typeof n.format=="function"?o=n.format.bind(n):o=(a,i)=>vc(a,i,{locale:Di,...e}),o(t,"cccc")}}};class _o{constructor(e,n){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?Wn.tz(this.options.timeZone):new this.Date,this.newDate=(o,a,i)=>this.overrides?.newDate?this.overrides.newDate(o,a,i):this.options.timeZone?new Wn(o,a,i,this.options.timeZone):new Date(o,a,i),this.addDays=(o,a)=>this.overrides?.addDays?this.overrides.addDays(o,a):uR(o,a),this.addMonths=(o,a)=>this.overrides?.addMonths?this.overrides.addMonths(o,a):dR(o,a),this.addWeeks=(o,a)=>this.overrides?.addWeeks?this.overrides.addWeeks(o,a):CF(o,a),this.addYears=(o,a)=>this.overrides?.addYears?this.overrides.addYears(o,a):EF(o,a),this.differenceInCalendarDays=(o,a)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(o,a):$y(o,a),this.differenceInCalendarMonths=(o,a)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(o,a):mR(o,a),this.eachMonthOfInterval=o=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(o):TF(o),this.eachYearOfInterval=o=>{const a=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(o):AF(o),i=new Set(a.map(u=>this.getYear(u)));if(i.size===a.length)return a;const l=[];return i.forEach(u=>{l.push(new Date(u,0,1))}),l},this.endOfBroadcastWeek=o=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(o):BU(o,this),this.endOfISOWeek=o=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(o):jF(o),this.endOfMonth=o=>this.overrides?.endOfMonth?this.overrides.endOfMonth(o):DF(o),this.endOfWeek=(o,a)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(o,a):yR(o,this.options),this.endOfYear=o=>this.overrides?.endOfYear?this.overrides.endOfYear(o):OF(o),this.format=(o,a,i)=>{const l=this.overrides?.format?this.overrides.format(o,a,this.options):vc(o,a,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(l):l},this.getISOWeek=o=>this.overrides?.getISOWeek?this.overrides.getISOWeek(o):Ly(o),this.getMonth=(o,a)=>this.overrides?.getMonth?this.overrides.getMonth(o,this.options):kU(o,this.options),this.getYear=(o,a)=>this.overrides?.getYear?this.overrides.getYear(o,this.options):OU(o,this.options),this.getWeek=(o,a)=>this.overrides?.getWeek?this.overrides.getWeek(o,this.options):Hy(o,this.options),this.isAfter=(o,a)=>this.overrides?.isAfter?this.overrides.isAfter(o,a):AU(o,a),this.isBefore=(o,a)=>this.overrides?.isBefore?this.overrides.isBefore(o,a):jU(o,a),this.isDate=o=>this.overrides?.isDate?this.overrides.isDate(o):hR(o),this.isSameDay=(o,a)=>this.overrides?.isSameDay?this.overrides.isSameDay(o,a):NF(o,a),this.isSameMonth=(o,a)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(o,a):zU(o,a),this.isSameYear=(o,a)=>this.overrides?.isSameYear?this.overrides.isSameYear(o,a):IU(o,a),this.max=o=>this.overrides?.max?this.overrides.max(o):_F(o),this.min=o=>this.overrides?.min?this.overrides.min(o):MF(o),this.setMonth=(o,a)=>this.overrides?.setMonth?this.overrides.setMonth(o,a):PU(o,a),this.setYear=(o,a)=>this.overrides?.setYear?this.overrides.setYear(o,a):$U(o,a),this.startOfBroadcastWeek=(o,a)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(o,this):bR(o,this),this.startOfDay=o=>this.overrides?.startOfDay?this.overrides.startOfDay(o):Vc(o),this.startOfISOWeek=o=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(o):Bc(o),this.startOfMonth=o=>this.overrides?.startOfMonth?this.overrides.startOfMonth(o):kF(o),this.startOfWeek=(o,a)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(o,this.options):Zi(o,this.options),this.startOfYear=o=>this.overrides?.startOfYear?this.overrides.startOfYear(o):pR(o),this.options={locale:wR,...e},this.overrides=n}getDigitMap(){const{numerals:e="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:e}),o={};for(let a=0;a<10;a++)o[a.toString()]=n.format(a);return o}replaceDigits(e){const n=this.getDigitMap();return e.replace(/\d/g,o=>n[o]||o)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){const e=this.options.locale?.code;return e&&_o.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:n,timeZone:o,numerals:a}=this.options,i=n?.code;if(i&&_o.yearFirstLocales.has(i))try{return new Intl.DateTimeFormat(i,{month:"long",year:"numeric",timeZone:o,numberingSystem:a}).format(e)}catch{}const l=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(e,l)}}_o.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Rr=new _o;class SR{constructor(e,n,o=Rr){this.date=e,this.displayMonth=n,this.outside=!!(n&&!o.isSameMonth(e,n)),this.dateLib=o,this.isoDate=o.format(e,"yyyy-MM-dd"),this.displayMonthId=o.format(n,"yyyy-MM"),this.dateMonthId=o.format(e,"yyyy-MM")}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class VU{constructor(e,n){this.date=e,this.weeks=n}}class FU{constructor(e,n){this.days=n,this.weekNumber=e}}function UU(t){return de.createElement("button",{...t})}function YU(t){return de.createElement("span",{...t})}function GU(t){const{size:e=24,orientation:n="left",className:o}=t;return de.createElement("svg",{className:o,width:e,height:e,viewBox:"0 0 24 24"},n==="up"&&de.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&de.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&de.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&de.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function qU(t){const{day:e,modifiers:n,...o}=t;return de.createElement("td",{...o})}function WU(t){const{day:e,modifiers:n,...o}=t,a=de.useRef(null);return de.useEffect(()=>{n.focused&&a.current?.focus()},[n.focused]),de.createElement("button",{ref:a,...o})}var Ge;(function(t){t.Root="root",t.Chevron="chevron",t.Day="day",t.DayButton="day_button",t.CaptionLabel="caption_label",t.Dropdowns="dropdowns",t.Dropdown="dropdown",t.DropdownRoot="dropdown_root",t.Footer="footer",t.MonthGrid="month_grid",t.MonthCaption="month_caption",t.MonthsDropdown="months_dropdown",t.Month="month",t.Months="months",t.Nav="nav",t.NextMonthButton="button_next",t.PreviousMonthButton="button_previous",t.Week="week",t.Weeks="weeks",t.Weekday="weekday",t.Weekdays="weekdays",t.WeekNumber="week_number",t.WeekNumberHeader="week_number_header",t.YearsDropdown="years_dropdown"})(Ge||(Ge={}));var fn;(function(t){t.disabled="disabled",t.hidden="hidden",t.outside="outside",t.focused="focused",t.today="today"})(fn||(fn={}));var er;(function(t){t.range_end="range_end",t.range_middle="range_middle",t.range_start="range_start",t.selected="selected"})(er||(er={}));var bo;(function(t){t.weeks_before_enter="weeks_before_enter",t.weeks_before_exit="weeks_before_exit",t.weeks_after_enter="weeks_after_enter",t.weeks_after_exit="weeks_after_exit",t.caption_after_enter="caption_after_enter",t.caption_after_exit="caption_after_exit",t.caption_before_enter="caption_before_enter",t.caption_before_exit="caption_before_exit"})(bo||(bo={}));function KU(t){const{options:e,className:n,components:o,classNames:a,...i}=t,l=[a[Ge.Dropdown],n].join(" "),u=e?.find(({value:d})=>d===i.value);return de.createElement("span",{"data-disabled":i.disabled,className:a[Ge.DropdownRoot]},de.createElement(o.Select,{className:l,...i},e?.map(({value:d,label:f,disabled:g})=>de.createElement(o.Option,{key:d,value:d,disabled:g},f))),de.createElement("span",{className:a[Ge.CaptionLabel],"aria-hidden":!0},u?.label,de.createElement(o.Chevron,{orientation:"down",size:18,className:a[Ge.Chevron]})))}function XU(t){return de.createElement("div",{...t})}function ZU(t){return de.createElement("div",{...t})}function QU(t){const{calendarMonth:e,displayIndex:n,...o}=t;return de.createElement("div",{...o},t.children)}function JU(t){const{calendarMonth:e,displayIndex:n,...o}=t;return de.createElement("div",{...o})}function eY(t){return de.createElement("table",{...t})}function tY(t){return de.createElement("div",{...t})}const CR=x.createContext(void 0);function uu(){const t=x.useContext(CR);if(t===void 0)throw new Error("useDayPicker() must be used within a custom component.");return t}function nY(t){const{components:e}=uu();return de.createElement(e.Dropdown,{...t})}function oY(t){const{onPreviousClick:e,onNextClick:n,previousMonth:o,nextMonth:a,...i}=t,{components:l,classNames:u,labels:{labelPrevious:d,labelNext:f}}=uu(),g=x.useCallback(p=>{a&&n?.(p)},[a,n]),m=x.useCallback(p=>{o&&e?.(p)},[o,e]);return de.createElement("nav",{...i},de.createElement(l.PreviousMonthButton,{type:"button",className:u[Ge.PreviousMonthButton],tabIndex:o?void 0:-1,"aria-disabled":o?void 0:!0,"aria-label":d(o),onClick:m},de.createElement(l.Chevron,{disabled:o?void 0:!0,className:u[Ge.Chevron],orientation:"left"})),de.createElement(l.NextMonthButton,{type:"button",className:u[Ge.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":a?void 0:!0,"aria-label":f(a),onClick:g},de.createElement(l.Chevron,{disabled:a?void 0:!0,orientation:"right",className:u[Ge.Chevron]})))}function rY(t){const{components:e}=uu();return de.createElement(e.Button,{...t})}function aY(t){return de.createElement("option",{...t})}function sY(t){const{components:e}=uu();return de.createElement(e.Button,{...t})}function iY(t){const{rootRef:e,...n}=t;return de.createElement("div",{...n,ref:e})}function lY(t){return de.createElement("select",{...t})}function cY(t){const{week:e,...n}=t;return de.createElement("tr",{...n})}function uY(t){return de.createElement("th",{...t})}function dY(t){return de.createElement("thead",{"aria-hidden":!0},de.createElement("tr",{...t}))}function fY(t){const{week:e,...n}=t;return de.createElement("th",{...n})}function hY(t){return de.createElement("th",{...t})}function mY(t){return de.createElement("tbody",{...t})}function gY(t){const{components:e}=uu();return de.createElement(e.Dropdown,{...t})}const pY=Object.freeze(Object.defineProperty({__proto__:null,Button:UU,CaptionLabel:YU,Chevron:GU,Day:qU,DayButton:WU,Dropdown:KU,DropdownNav:XU,Footer:ZU,Month:QU,MonthCaption:JU,MonthGrid:eY,Months:tY,MonthsDropdown:nY,Nav:oY,NextMonthButton:rY,Option:aY,PreviousMonthButton:sY,Root:iY,Select:lY,Week:cY,WeekNumber:fY,WeekNumberHeader:hY,Weekday:uY,Weekdays:dY,Weeks:mY,YearsDropdown:gY},Symbol.toStringTag,{value:"Module"}));function ea(t,e,n=!1,o=Rr){let{from:a,to:i}=t;const{differenceInCalendarDays:l,isSameDay:u}=o;return a&&i?(l(i,a)<0&&([a,i]=[i,a]),l(e,a)>=(n?1:0)&&l(i,e)>=(n?1:0)):!n&&i?u(i,e):!n&&a?u(a,e):!1}function By(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function gh(t){return!!(t&&typeof t=="object"&&"from"in t)}function Vy(t){return!!(t&&typeof t=="object"&&"after"in t)}function Fy(t){return!!(t&&typeof t=="object"&&"before"in t)}function ER(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function _R(t,e){return Array.isArray(t)&&t.every(e.isDate)}function ta(t,e,n=Rr){const o=Array.isArray(e)?e:[e],{isSameDay:a,differenceInCalendarDays:i,isAfter:l}=n;return o.some(u=>{if(typeof u=="boolean")return u;if(n.isDate(u))return a(t,u);if(_R(u,n))return u.some(d=>a(t,d));if(gh(u))return ea(u,t,!1,n);if(ER(u))return Array.isArray(u.dayOfWeek)?u.dayOfWeek.includes(t.getDay()):u.dayOfWeek===t.getDay();if(By(u)){const d=i(u.before,t),f=i(u.after,t),g=d>0,m=f<0;return l(u.before,u.after)?m&&g:g||m}return Vy(u)?i(t,u.after)>0:Fy(u)?i(u.before,t)>0:typeof u=="function"?u(t):!1})}function yY(t,e,n,o,a){const{disabled:i,hidden:l,modifiers:u,showOutsideDays:d,broadcastCalendar:f,today:g=a.today()}=e,{isSameDay:m,isSameMonth:p,startOfMonth:v,isBefore:S,endOfMonth:C,isAfter:w}=a,M=n&&v(n),R=o&&C(o),E={[fn.focused]:[],[fn.outside]:[],[fn.disabled]:[],[fn.hidden]:[],[fn.today]:[]},N={};for(const D of t){const{date:T,displayMonth:k}=D,A=!!(k&&!p(T,k)),B=!!(M&&S(T,M)),W=!!(R&&w(T,R)),U=!!(i&&ta(T,i,a)),Y=!!(l&&ta(T,l,a))||B||W||!f&&!d&&A||f&&d===!1&&A,Z=m(T,g);A&&E.outside.push(D),U&&E.disabled.push(D),Y&&E.hidden.push(D),Z&&E.today.push(D),u&&Object.keys(u).forEach(I=>{const G=u?.[I];G&&ta(T,G,a)&&(N[I]?N[I].push(D):N[I]=[D])})}return D=>{const T={[fn.focused]:!1,[fn.disabled]:!1,[fn.hidden]:!1,[fn.outside]:!1,[fn.today]:!1},k={};for(const A in E){const B=E[A];T[A]=B.some(W=>W===D)}for(const A in N)k[A]=N[A].some(B=>B===D);return{...T,...k}}}function vY(t,e,n={}){return Object.entries(t).filter(([,a])=>a===!0).reduce((a,[i])=>(n[i]?a.push(n[i]):e[fn[i]]?a.push(e[fn[i]]):e[er[i]]&&a.push(e[er[i]]),a),[e[Ge.Day]])}function xY(t){return{...pY,...t}}function bY(t){const e={"data-mode":t.mode??void 0,"data-required":"required"in t?t.required:void 0,"data-multiple-months":t.numberOfMonths&&t.numberOfMonths>1||void 0,"data-week-numbers":t.showWeekNumber||void 0,"data-broadcast-calendar":t.broadcastCalendar||void 0,"data-nav-layout":t.navLayout||void 0};return Object.entries(t).forEach(([n,o])=>{n.startsWith("data-")&&(e[n]=o)}),e}function Uy(){const t={};for(const e in Ge)t[Ge[e]]=`rdp-${Ge[e]}`;for(const e in fn)t[fn[e]]=`rdp-${fn[e]}`;for(const e in er)t[er[e]]=`rdp-${er[e]}`;for(const e in bo)t[bo[e]]=`rdp-${bo[e]}`;return t}function MR(t,e,n){return(n??new _o(e)).formatMonthYear(t)}const wY=MR;function SY(t,e,n){return(n??new _o(e)).format(t,"d")}function CY(t,e=Rr){return e.format(t,"LLLL")}function EY(t,e,n){return(n??new _o(e)).format(t,"cccccc")}function _Y(t,e=Rr){return t<10?e.formatNumber(`0${t.toLocaleString()}`):e.formatNumber(`${t.toLocaleString()}`)}function MY(){return""}function NR(t,e=Rr){return e.format(t,"yyyy")}const NY=NR,RY=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:MR,formatDay:SY,formatMonthCaption:wY,formatMonthDropdown:CY,formatWeekNumber:_Y,formatWeekNumberHeader:MY,formatWeekdayName:EY,formatYearCaption:NY,formatYearDropdown:NR},Symbol.toStringTag,{value:"Module"}));function DY(t){return t?.formatMonthCaption&&!t.formatCaption&&(t.formatCaption=t.formatMonthCaption),t?.formatYearCaption&&!t.formatYearDropdown&&(t.formatYearDropdown=t.formatYearCaption),{...RY,...t}}function Yy(t,e,n,o){let a=(o??new _o(n)).format(t,"PPPP");return e.today&&(a=`Today, ${a}`),e.selected&&(a=`${a}, selected`),a}const TY=Yy;function Gy(t,e,n){return(n??new _o(e)).formatMonthYear(t)}const kY=Gy;function RR(t,e,n,o){let a=(o??new _o(n)).format(t,"PPPP");return e?.today&&(a=`Today, ${a}`),a}function DR(t){return"Choose the Month"}function TR(){return""}const OY="Go to the Next Month";function kR(t,e){return OY}function OR(t){return"Go to the Previous Month"}function AR(t,e,n){return(n??new _o(e)).format(t,"cccc")}function jR(t,e){return`Week ${t}`}function zR(t){return"Week Number"}function IR(t){return"Choose the Year"}const AY=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:kY,labelDay:TY,labelDayButton:Yy,labelGrid:Gy,labelGridcell:RR,labelMonthDropdown:DR,labelNav:TR,labelNext:kR,labelPrevious:OR,labelWeekNumber:jR,labelWeekNumberHeader:zR,labelWeekday:AR,labelYearDropdown:IR},Symbol.toStringTag,{value:"Module"})),Wo=(t,e,n)=>e||(n?typeof n=="function"?n:(...o)=>n:t);function jY(t,e){const n=e.locale?.labels??{};return{...AY,...t??{},labelDayButton:Wo(Yy,t?.labelDayButton,n.labelDayButton),labelMonthDropdown:Wo(DR,t?.labelMonthDropdown,n.labelMonthDropdown),labelNext:Wo(kR,t?.labelNext,n.labelNext),labelPrevious:Wo(OR,t?.labelPrevious,n.labelPrevious),labelWeekNumber:Wo(jR,t?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:Wo(IR,t?.labelYearDropdown,n.labelYearDropdown),labelGrid:Wo(Gy,t?.labelGrid,n.labelGrid),labelGridcell:Wo(RR,t?.labelGridcell,n.labelGridcell),labelNav:Wo(TR,t?.labelNav,n.labelNav),labelWeekNumberHeader:Wo(zR,t?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:Wo(AR,t?.labelWeekday,n.labelWeekday)}}function zY(t,e,n,o,a){const{startOfMonth:i,startOfYear:l,endOfYear:u,eachMonthOfInterval:d,getMonth:f}=a;return d({start:l(t),end:u(t)}).map(p=>{const v=o.formatMonthDropdown(p,a),S=f(p),C=e&&p<i(e)||n&&p>i(n)||!1;return{value:S,label:v,disabled:C}})}function IY(t,e={},n={}){let o={...e?.[Ge.Day]};return Object.entries(t).filter(([,a])=>a===!0).forEach(([a])=>{o={...o,...n?.[a]}}),o}function PY(t,e,n,o){const a=o??t.today(),i=n?t.startOfBroadcastWeek(a,t):e?t.startOfISOWeek(a):t.startOfWeek(a),l=[];for(let u=0;u<7;u++){const d=t.addDays(i,u);l.push(d)}return l}function $Y(t,e,n,o,a=!1){if(!t||!e)return;const{startOfYear:i,endOfYear:l,eachYearOfInterval:u,getYear:d}=o,f=i(t),g=l(e),m=u({start:f,end:g});return a&&m.reverse(),m.map(p=>{const v=n.formatYearDropdown(p,o);return{value:d(p),label:v,disabled:!1}})}function LY(t,e={}){const{weekStartsOn:n,locale:o}=e,a=n??o?.options?.weekStartsOn??0,i=u=>{const d=typeof u=="number"||typeof u=="string"?new Date(u):u;return new Wn(d.getFullYear(),d.getMonth(),d.getDate(),12,0,0,t)},l=u=>{const d=i(u);return new Date(d.getFullYear(),d.getMonth(),d.getDate(),0,0,0,0)};return{today:()=>i(Wn.tz(t)),newDate:(u,d,f)=>new Wn(u,d,f,12,0,0,t),startOfDay:u=>i(u),startOfWeek:(u,d)=>{const f=i(u),g=d?.weekStartsOn??a,m=(f.getDay()-g+7)%7;return f.setDate(f.getDate()-m),f},startOfISOWeek:u=>{const d=i(u),f=(d.getDay()-1+7)%7;return d.setDate(d.getDate()-f),d},startOfMonth:u=>{const d=i(u);return d.setDate(1),d},startOfYear:u=>{const d=i(u);return d.setMonth(0,1),d},endOfWeek:(u,d)=>{const f=i(u),p=(((d?.weekStartsOn??a)+6)%7-f.getDay()+7)%7;return f.setDate(f.getDate()+p),f},endOfISOWeek:u=>{const d=i(u),f=(7-d.getDay())%7;return d.setDate(d.getDate()+f),d},endOfMonth:u=>{const d=i(u);return d.setMonth(d.getMonth()+1,0),d},endOfYear:u=>{const d=i(u);return d.setMonth(11,31),d},eachMonthOfInterval:u=>{const d=i(u.start),f=i(u.end),g=[],m=new Wn(d.getFullYear(),d.getMonth(),1,12,0,0,t),p=f.getFullYear()*12+f.getMonth();for(;m.getFullYear()*12+m.getMonth()<=p;)g.push(new Wn(m,t)),m.setMonth(m.getMonth()+1,1);return g},addDays:(u,d)=>{const f=i(u);return f.setDate(f.getDate()+d),f},addWeeks:(u,d)=>{const f=i(u);return f.setDate(f.getDate()+d*7),f},addMonths:(u,d)=>{const f=i(u);return f.setMonth(f.getMonth()+d),f},addYears:(u,d)=>{const f=i(u);return f.setFullYear(f.getFullYear()+d),f},eachYearOfInterval:u=>{const d=i(u.start),f=i(u.end),g=[],m=new Wn(d.getFullYear(),0,1,12,0,0,t);for(;m.getFullYear()<=f.getFullYear();)g.push(new Wn(m,t)),m.setFullYear(m.getFullYear()+1,0,1);return g},getWeek:(u,d)=>{const f=l(u);return Hy(f,{weekStartsOn:d?.weekStartsOn??a,firstWeekContainsDate:d?.firstWeekContainsDate??o?.options?.firstWeekContainsDate??1})},getISOWeek:u=>{const d=l(u);return Ly(d)},differenceInCalendarDays:(u,d)=>{const f=l(u),g=l(d);return $y(f,g)},differenceInCalendarMonths:(u,d)=>{const f=l(u),g=l(d);return mR(f,g)}}}const du=t=>t instanceof HTMLElement?t:null,lp=t=>[...t.querySelectorAll("[data-animated-month]")??[]],HY=t=>du(t.querySelector("[data-animated-month]")),cp=t=>du(t.querySelector("[data-animated-caption]")),up=t=>du(t.querySelector("[data-animated-weeks]")),BY=t=>du(t.querySelector("[data-animated-nav]")),VY=t=>du(t.querySelector("[data-animated-weekdays]"));function FY(t,e,{classNames:n,months:o,focused:a,dateLib:i}){const l=x.useRef(null),u=x.useRef(o),d=x.useRef(!1);x.useLayoutEffect(()=>{const f=u.current;if(u.current=o,!e||!t.current||!(t.current instanceof HTMLElement)||o.length===0||f.length===0||o.length!==f.length)return;const g=i.isSameMonth(o[0].date,f[0].date),m=i.isAfter(o[0].date,f[0].date),p=m?n[bo.caption_after_enter]:n[bo.caption_before_enter],v=m?n[bo.weeks_after_enter]:n[bo.weeks_before_enter],S=l.current,C=t.current.cloneNode(!0);if(C instanceof HTMLElement?(lp(C).forEach(E=>{if(!(E instanceof HTMLElement))return;const N=HY(E);N&&E.contains(N)&&E.removeChild(N);const D=cp(E);D&&D.classList.remove(p);const T=up(E);T&&T.classList.remove(v)}),l.current=C):l.current=null,d.current||g||a)return;const w=S instanceof HTMLElement?lp(S):[],M=lp(t.current);if(M?.every(R=>R instanceof HTMLElement)&&w&&w.every(R=>R instanceof HTMLElement)){d.current=!0,t.current.style.isolation="isolate";const R=BY(t.current);R&&(R.style.zIndex="1"),M.forEach((E,N)=>{const D=w[N];if(!D)return;E.style.position="relative",E.style.overflow="hidden";const T=cp(E);T&&T.classList.add(p);const k=up(E);k&&k.classList.add(v);const A=()=>{d.current=!1,t.current&&(t.current.style.isolation=""),R&&(R.style.zIndex=""),T&&T.classList.remove(p),k&&k.classList.remove(v),E.style.position="",E.style.overflow="",E.contains(D)&&E.removeChild(D)};D.style.pointerEvents="none",D.style.position="absolute",D.style.overflow="hidden",D.setAttribute("aria-hidden","true");const B=VY(D);B&&(B.style.opacity="0");const W=cp(D);W&&(W.classList.add(m?n[bo.caption_before_exit]:n[bo.caption_after_exit]),W.addEventListener("animationend",A));const U=up(D);U&&U.classList.add(m?n[bo.weeks_before_exit]:n[bo.weeks_after_exit]),E.insertBefore(D,E.firstChild)})}})}function UY(t,e,n,o){const a=t[0],i=t[t.length-1],{ISOWeek:l,fixedWeeks:u,broadcastCalendar:d}=n??{},{addDays:f,differenceInCalendarDays:g,differenceInCalendarMonths:m,endOfBroadcastWeek:p,endOfISOWeek:v,endOfMonth:S,endOfWeek:C,isAfter:w,startOfBroadcastWeek:M,startOfISOWeek:R,startOfWeek:E}=o,N=d?M(a,o):l?R(a):E(a),D=d?p(i):l?v(S(i)):C(S(i)),T=e&&(d?p(e):l?v(e):C(e)),k=T&&w(D,T)?T:D,A=g(k,N),B=m(i,a)+1,W=[];for(let Z=0;Z<=A;Z++){const I=f(N,Z);W.push(I)}const Y=(d?35:42)*B;if(u&&W.length<Y){const Z=Y-W.length;for(let I=0;I<Z;I++){const G=f(W[W.length-1],1);W.push(G)}}return W}function YY(t){const e=[];return t.reduce((n,o)=>{const a=o.weeks.reduce((i,l)=>i.concat(l.days.slice()),e.slice());return n.concat(a.slice())},e.slice())}function GY(t,e,n,o){const{numberOfMonths:a=1}=n,i=[];for(let l=0;l<a;l++){const u=o.addMonths(t,l);if(e&&u>e)break;i.push(u)}return i}function dC(t,e,n,o){const{month:a,defaultMonth:i,today:l=o.today(),numberOfMonths:u=1}=t;let d=a||i||l;const{differenceInCalendarMonths:f,addMonths:g,startOfMonth:m}=o;if(n&&f(n,d)<u-1){const p=-1*(u-1);d=g(n,p)}return e&&f(d,e)<0&&(d=e),m(d)}function qY(t,e,n,o){const{addDays:a,endOfBroadcastWeek:i,endOfISOWeek:l,endOfMonth:u,endOfWeek:d,getISOWeek:f,getWeek:g,startOfBroadcastWeek:m,startOfISOWeek:p,startOfWeek:v}=o,S=t.reduce((C,w)=>{const M=n.broadcastCalendar?m(w,o):n.ISOWeek?p(w):v(w),R=n.broadcastCalendar?i(w):n.ISOWeek?l(u(w)):d(u(w)),E=e.filter(k=>k>=M&&k<=R),N=n.broadcastCalendar?35:42;if(n.fixedWeeks&&E.length<N){const k=e.filter(A=>{const B=N-E.length;return A>R&&A<=a(R,B)});E.push(...k)}const D=E.reduce((k,A)=>{const B=n.ISOWeek?f(A):g(A),W=k.find(Y=>Y.weekNumber===B),U=new SR(A,w,o);return W?W.days.push(U):k.push(new FU(B,[U])),k},[]),T=new VU(w,D);return C.push(T),C},[]);return n.reverseMonths?S.reverse():S}function WY(t,e){let{startMonth:n,endMonth:o}=t;const{startOfYear:a,startOfDay:i,startOfMonth:l,endOfMonth:u,addYears:d,endOfYear:f,newDate:g,today:m}=e,{fromYear:p,toYear:v,fromMonth:S,toMonth:C}=t;!n&&S&&(n=S),!n&&p&&(n=e.newDate(p,0,1)),!o&&C&&(o=C),!o&&v&&(o=g(v,11,31));const w=t.captionLayout==="dropdown"||t.captionLayout==="dropdown-years";return n?n=l(n):p?n=g(p,0,1):!n&&w&&(n=a(d(t.today??m(),-100))),o?o=u(o):v?o=g(v,11,31):!o&&w&&(o=f(t.today??m())),[n&&i(n),o&&i(o)]}function KY(t,e,n,o){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:i=1}=n,{startOfMonth:l,addMonths:u,differenceInCalendarMonths:d}=o,f=a?i:1,g=l(t);if(!e)return u(g,f);if(!(d(e,t)<i))return u(g,f)}function XY(t,e,n,o){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:i}=n,{startOfMonth:l,addMonths:u,differenceInCalendarMonths:d}=o,f=a?i??1:1,g=l(t);if(!e)return u(g,-f);if(!(d(g,e)<=0))return u(g,-f)}function ZY(t){const e=[];return t.reduce((n,o)=>n.concat(o.weeks.slice()),e.slice())}function ph(t,e){const[n,o]=x.useState(t);return[e===void 0?n:e,o]}function QY(t,e){const[n,o]=WY(t,e),{startOfMonth:a,endOfMonth:i}=e,l=dC(t,n,o,e),[u,d]=ph(l,t.month?l:void 0);x.useEffect(()=>{const N=dC(t,n,o,e);d(N)},[t.timeZone]);const{months:f,weeks:g,days:m,previousMonth:p,nextMonth:v}=x.useMemo(()=>{const N=GY(u,o,{numberOfMonths:t.numberOfMonths},e),D=UY(N,t.endMonth?i(t.endMonth):void 0,{ISOWeek:t.ISOWeek,fixedWeeks:t.fixedWeeks,broadcastCalendar:t.broadcastCalendar},e),T=qY(N,D,{broadcastCalendar:t.broadcastCalendar,fixedWeeks:t.fixedWeeks,ISOWeek:t.ISOWeek,reverseMonths:t.reverseMonths},e),k=ZY(T),A=YY(T),B=XY(u,n,t,e),W=KY(u,o,t,e);return{months:T,weeks:k,days:A,previousMonth:B,nextMonth:W}},[e,u.getTime(),o?.getTime(),n?.getTime(),t.disableNavigation,t.broadcastCalendar,t.endMonth?.getTime(),t.fixedWeeks,t.ISOWeek,t.numberOfMonths,t.pagedNavigation,t.reverseMonths]),{disableNavigation:S,onMonthChange:C}=t,w=N=>g.some(D=>D.days.some(T=>T.isEqualTo(N))),M=N=>{if(S)return;let D=a(N);n&&D<a(n)&&(D=a(n)),o&&D>a(o)&&(D=a(o)),d(D),C?.(D)};return{months:f,weeks:g,days:m,navStart:n,navEnd:o,previousMonth:p,nextMonth:v,goToMonth:M,goToDay:N=>{w(N)||M(N.date)}}}var hr;(function(t){t[t.Today=0]="Today",t[t.Selected=1]="Selected",t[t.LastFocused=2]="LastFocused",t[t.FocusedModifier=3]="FocusedModifier"})(hr||(hr={}));function fC(t){return!t[fn.disabled]&&!t[fn.hidden]&&!t[fn.outside]}function JY(t,e,n,o){let a,i=-1;for(const l of t){const u=e(l);fC(u)&&(u[fn.focused]&&i<hr.FocusedModifier?(a=l,i=hr.FocusedModifier):o?.isEqualTo(l)&&i<hr.LastFocused?(a=l,i=hr.LastFocused):n(l.date)&&i<hr.Selected?(a=l,i=hr.Selected):u[fn.today]&&i<hr.Today&&(a=l,i=hr.Today))}return a||(a=t.find(l=>fC(e(l)))),a}function eG(t,e,n,o,a,i,l){const{ISOWeek:u,broadcastCalendar:d}=i,{addDays:f,addMonths:g,addWeeks:m,addYears:p,endOfBroadcastWeek:v,endOfISOWeek:S,endOfWeek:C,max:w,min:M,startOfBroadcastWeek:R,startOfISOWeek:E,startOfWeek:N}=l;let T={day:f,week:m,month:g,year:p,startOfWeek:k=>d?R(k,l):u?E(k):N(k),endOfWeek:k=>d?v(k):u?S(k):C(k)}[t](n,e==="after"?1:-1);return e==="before"&&o?T=w([o,T]):e==="after"&&a&&(T=M([a,T])),T}function PR(t,e,n,o,a,i,l,u=0){if(u>365)return;const d=eG(t,e,n.date,o,a,i,l),f=!!(i.disabled&&ta(d,i.disabled,l)),g=!!(i.hidden&&ta(d,i.hidden,l)),m=d,p=new SR(d,m,l);return!f&&!g?p:PR(t,e,p,o,a,i,l,u+1)}function tG(t,e,n,o,a){const{autoFocus:i}=t,[l,u]=x.useState(),d=JY(e.days,n,o||(()=>!1),l),[f,g]=x.useState(i?d:void 0);return{isFocusTarget:C=>!!d?.isEqualTo(C),setFocused:g,focused:f,blur:()=>{u(f),g(void 0)},moveFocus:(C,w)=>{if(!f)return;const M=PR(C,w,f,e.navStart,e.navEnd,t,a);M&&(t.disableNavigation&&!e.days.some(E=>E.isEqualTo(M))||(e.goToDay(M),g(M)))}}}function nG(t,e){const{selected:n,required:o,onSelect:a}=t,[i,l]=ph(n,a?n:void 0),u=a?n:i,{isSameDay:d}=e,f=v=>u?.some(S=>d(S,v))??!1,{min:g,max:m}=t;return{selected:u,select:(v,S,C)=>{let w=[...u??[]];if(f(v)){if(u?.length===g||o&&u?.length===1)return;w=u?.filter(M=>!d(M,v))}else u?.length===m?w=[v]:w=[...w,v];return a||l(w),a?.(w,v,S,C),w},isSelected:f}}function oG(t,e,n=0,o=0,a=!1,i=Rr){const{from:l,to:u}=e||{},{isSameDay:d,isAfter:f,isBefore:g}=i;let m;if(!l&&!u)m={from:t,to:n>0?void 0:t};else if(l&&!u)d(l,t)?n===0?m={from:l,to:t}:a?m={from:l,to:void 0}:m=void 0:g(t,l)?m={from:t,to:l}:m={from:l,to:t};else if(l&&u)if(d(l,t)&&d(u,t))a?m={from:l,to:u}:m=void 0;else if(d(l,t))m={from:l,to:n>0?void 0:t};else if(d(u,t))m={from:t,to:n>0?void 0:t};else if(g(t,l))m={from:t,to:u};else if(f(t,l))m={from:l,to:t};else if(f(t,u))m={from:l,to:t};else throw new Error("Invalid range");if(m?.from&&m?.to){const p=i.differenceInCalendarDays(m.to,m.from);o>0&&p>o?m={from:t,to:void 0}:n>1&&p<n&&(m={from:t,to:void 0})}return m}function rG(t,e,n=Rr){const o=Array.isArray(e)?e:[e];let a=t.from;const i=n.differenceInCalendarDays(t.to,t.from),l=Math.min(i,6);for(let u=0;u<=l;u++){if(o.includes(a.getDay()))return!0;a=n.addDays(a,1)}return!1}function hC(t,e,n=Rr){return ea(t,e.from,!1,n)||ea(t,e.to,!1,n)||ea(e,t.from,!1,n)||ea(e,t.to,!1,n)}function aG(t,e,n=Rr){const o=Array.isArray(e)?e:[e];if(o.filter(u=>typeof u!="function").some(u=>typeof u=="boolean"?u:n.isDate(u)?ea(t,u,!1,n):_R(u,n)?u.some(d=>ea(t,d,!1,n)):gh(u)?u.from&&u.to?hC(t,{from:u.from,to:u.to},n):!1:ER(u)?rG(t,u.dayOfWeek,n):By(u)?n.isAfter(u.before,u.after)?hC(t,{from:n.addDays(u.after,1),to:n.addDays(u.before,-1)},n):ta(t.from,u,n)||ta(t.to,u,n):Vy(u)||Fy(u)?ta(t.from,u,n)||ta(t.to,u,n):!1))return!0;const l=o.filter(u=>typeof u=="function");if(l.length){let u=t.from;const d=n.differenceInCalendarDays(t.to,t.from);for(let f=0;f<=d;f++){if(l.some(g=>g(u)))return!0;u=n.addDays(u,1)}}return!1}function sG(t,e){const{disabled:n,excludeDisabled:o,selected:a,required:i,onSelect:l}=t,[u,d]=ph(a,l?a:void 0),f=l?a:u;return{selected:f,select:(p,v,S)=>{const{min:C,max:w}=t,M=p?oG(p,f,C,w,i,e):void 0;return o&&n&&M?.from&&M.to&&aG({from:M.from,to:M.to},n,e)&&(M.from=p,M.to=void 0),l||d(M),l?.(M,p,v,S),M},isSelected:p=>f&&ea(f,p,!1,e)}}function iG(t,e){const{selected:n,required:o,onSelect:a}=t,[i,l]=ph(n,a?n:void 0),u=a?n:i,{isSameDay:d}=e;return{selected:u,select:(m,p,v)=>{let S=m;return!o&&u&&u&&d(m,u)&&(S=void 0),a||l(S),a?.(S,m,p,v),S},isSelected:m=>u?d(u,m):!1}}function lG(t,e){const n=iG(t,e),o=nG(t,e),a=sG(t,e);switch(t.mode){case"single":return n;case"multiple":return o;case"range":return a;default:return}}function Bo(t,e){return t instanceof Wn&&t.timeZone===e?t:new Wn(t,e)}function Ni(t,e,n){return Bo(t,e)}function mC(t,e,n){return typeof t=="boolean"||typeof t=="function"?t:t instanceof Date?Ni(t,e):Array.isArray(t)?t.map(o=>o instanceof Date?Ni(o,e):o):gh(t)?{...t,from:t.from?Bo(t.from,e):t.from,to:t.to?Bo(t.to,e):t.to}:By(t)?{before:Ni(t.before,e),after:Ni(t.after,e)}:Vy(t)?{after:Ni(t.after,e)}:Fy(t)?{before:Ni(t.before,e)}:t}function dp(t,e,n){return t&&(Array.isArray(t)?t.map(o=>mC(o,e)):mC(t,e))}function cG(t){let e=t;const n=e.timeZone;if(n&&(e={...t,timeZone:n},e.today&&(e.today=Bo(e.today,n)),e.month&&(e.month=Bo(e.month,n)),e.defaultMonth&&(e.defaultMonth=Bo(e.defaultMonth,n)),e.startMonth&&(e.startMonth=Bo(e.startMonth,n)),e.endMonth&&(e.endMonth=Bo(e.endMonth,n)),e.mode==="single"&&e.selected?e.selected=Bo(e.selected,n):e.mode==="multiple"&&e.selected?e.selected=e.selected?.map(Ve=>Bo(Ve,n)):e.mode==="range"&&e.selected&&(e.selected={from:e.selected.from?Bo(e.selected.from,n):e.selected.from,to:e.selected.to?Bo(e.selected.to,n):e.selected.to}),e.disabled!==void 0&&(e.disabled=dp(e.disabled,n)),e.hidden!==void 0&&(e.hidden=dp(e.hidden,n)),e.modifiers)){const Ve={};Object.keys(e.modifiers).forEach(nt=>{Ve[nt]=dp(e.modifiers?.[nt],n)}),e.modifiers=Ve}const{components:o,formatters:a,labels:i,dateLib:l,locale:u,classNames:d}=x.useMemo(()=>{const Ve={...wR,...e.locale},nt=e.broadcastCalendar?1:e.weekStartsOn,Ye=e.noonSafe&&e.timeZone?LY(e.timeZone,{weekStartsOn:nt,locale:Ve}):void 0,st=e.dateLib&&Ye?{...Ye,...e.dateLib}:e.dateLib??Ye,$t=new _o({locale:Ve,weekStartsOn:nt,firstWeekContainsDate:e.firstWeekContainsDate,useAdditionalWeekYearTokens:e.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:e.useAdditionalDayOfYearTokens,timeZone:e.timeZone,numerals:e.numerals},st);return{dateLib:$t,components:xY(e.components),formatters:DY(e.formatters),labels:jY(e.labels,$t.options),locale:Ve,classNames:{...Uy(),...e.classNames}}},[e.locale,e.broadcastCalendar,e.weekStartsOn,e.firstWeekContainsDate,e.useAdditionalWeekYearTokens,e.useAdditionalDayOfYearTokens,e.timeZone,e.numerals,e.dateLib,e.noonSafe,e.components,e.formatters,e.labels,e.classNames]);e.today||(e={...e,today:l.today()});const{captionLayout:f,mode:g,navLayout:m,numberOfMonths:p=1,onDayBlur:v,onDayClick:S,onDayFocus:C,onDayKeyDown:w,onDayMouseEnter:M,onDayMouseLeave:R,onNextClick:E,onPrevClick:N,showWeekNumber:D,styles:T}=e,{formatCaption:k,formatDay:A,formatMonthDropdown:B,formatWeekNumber:W,formatWeekNumberHeader:U,formatWeekdayName:Y,formatYearDropdown:Z}=a,I=QY(e,l),{days:G,months:j,navStart:L,navEnd:$,previousMonth:H,nextMonth:X,goToMonth:P}=I,z=yY(G,e,L,$,l),{isSelected:V,select:q,selected:J}=lG(e,l)??{},{blur:oe,focused:K,isFocusTarget:ee,moveFocus:ae,setFocused:ce}=tG(e,I,z,V??(()=>!1),l),{labelDayButton:ge,labelGridcell:se,labelGrid:ve,labelMonthDropdown:De,labelNav:Be,labelPrevious:Ie,labelNext:lt,labelWeekday:ln,labelWeekNumber:ht,labelWeekNumberHeader:bn,labelYearDropdown:cn}=i,Vt=x.useMemo(()=>PY(l,e.ISOWeek,e.broadcastCalendar,e.today),[l,e.ISOWeek,e.broadcastCalendar,e.today]),mn=g!==void 0||S!==void 0,zt=x.useCallback(()=>{H&&(P(H),N?.(H))},[H,P,N]),Nn=x.useCallback(()=>{X&&(P(X),E?.(X))},[P,X,E]),yn=x.useCallback((Ve,nt)=>Ye=>{Ye.preventDefault(),Ye.stopPropagation(),ce(Ve),!nt.disabled&&(q?.(Ve.date,nt,Ye),S?.(Ve.date,nt,Ye))},[q,S,ce]),In=x.useCallback((Ve,nt)=>Ye=>{ce(Ve),C?.(Ve.date,nt,Ye)},[C,ce]),jn=x.useCallback((Ve,nt)=>Ye=>{oe(),v?.(Ve.date,nt,Ye)},[oe,v]),_e=x.useCallback((Ve,nt)=>Ye=>{const st={ArrowLeft:[Ye.shiftKey?"month":"day",e.dir==="rtl"?"after":"before"],ArrowRight:[Ye.shiftKey?"month":"day",e.dir==="rtl"?"before":"after"],ArrowDown:[Ye.shiftKey?"year":"week","after"],ArrowUp:[Ye.shiftKey?"year":"week","before"],PageUp:[Ye.shiftKey?"year":"month","before"],PageDown:[Ye.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(st[Ye.key]){Ye.preventDefault(),Ye.stopPropagation();const[$t,Te]=st[Ye.key];ae($t,Te)}w?.(Ve.date,nt,Ye)},[ae,w,e.dir]),Ue=x.useCallback((Ve,nt)=>Ye=>{M?.(Ve.date,nt,Ye)},[M]),Et=x.useCallback((Ve,nt)=>Ye=>{R?.(Ve.date,nt,Ye)},[R]),Xe=x.useCallback(Ve=>nt=>{const Ye=Number(nt.target.value),st=l.setMonth(l.startOfMonth(Ve),Ye);P(st)},[l,P]),at=x.useCallback(Ve=>nt=>{const Ye=Number(nt.target.value),st=l.setYear(l.startOfMonth(Ve),Ye);P(st)},[l,P]),{className:gt,style:qt}=x.useMemo(()=>({className:[d[Ge.Root],e.className].filter(Boolean).join(" "),style:{...T?.[Ge.Root],...e.style}}),[d,e.className,e.style,T]),Wt=bY(e),Qn=x.useRef(null);FY(Qn,!!e.animate,{classNames:d,months:j,focused:K,dateLib:l});const _t={dayPickerProps:e,selected:J,select:q,isSelected:V,months:j,nextMonth:X,previousMonth:H,goToMonth:P,getModifiers:z,components:o,classNames:d,styles:T,labels:i,formatters:a};return de.createElement(CR.Provider,{value:_t},de.createElement(o.Root,{rootRef:e.animate?Qn:void 0,className:gt,style:qt,dir:e.dir,id:e.id,lang:e.lang,nonce:e.nonce,title:e.title,role:e.role,"aria-label":e["aria-label"],"aria-labelledby":e["aria-labelledby"],...Wt},de.createElement(o.Months,{className:d[Ge.Months],style:T?.[Ge.Months]},!e.hideNavigation&&!m&&de.createElement(o.Nav,{"data-animated-nav":e.animate?"true":void 0,className:d[Ge.Nav],style:T?.[Ge.Nav],"aria-label":Be(),onPreviousClick:zt,onNextClick:Nn,previousMonth:H,nextMonth:X}),j.map((Ve,nt)=>de.createElement(o.Month,{"data-animated-month":e.animate?"true":void 0,className:d[Ge.Month],style:T?.[Ge.Month],key:nt,displayIndex:nt,calendarMonth:Ve},m==="around"&&!e.hideNavigation&&nt===0&&de.createElement(o.PreviousMonthButton,{type:"button",className:d[Ge.PreviousMonthButton],tabIndex:H?void 0:-1,"aria-disabled":H?void 0:!0,"aria-label":Ie(H),onClick:zt,"data-animated-button":e.animate?"true":void 0},de.createElement(o.Chevron,{disabled:H?void 0:!0,className:d[Ge.Chevron],orientation:e.dir==="rtl"?"right":"left"})),de.createElement(o.MonthCaption,{"data-animated-caption":e.animate?"true":void 0,className:d[Ge.MonthCaption],style:T?.[Ge.MonthCaption],calendarMonth:Ve,displayIndex:nt},f?.startsWith("dropdown")?de.createElement(o.DropdownNav,{className:d[Ge.Dropdowns],style:T?.[Ge.Dropdowns]},(()=>{const Ye=f==="dropdown"||f==="dropdown-months"?de.createElement(o.MonthsDropdown,{key:"month",className:d[Ge.MonthsDropdown],"aria-label":De(),classNames:d,components:o,disabled:!!e.disableNavigation,onChange:Xe(Ve.date),options:zY(Ve.date,L,$,a,l),style:T?.[Ge.Dropdown],value:l.getMonth(Ve.date)}):de.createElement("span",{key:"month"},B(Ve.date,l)),st=f==="dropdown"||f==="dropdown-years"?de.createElement(o.YearsDropdown,{key:"year",className:d[Ge.YearsDropdown],"aria-label":cn(l.options),classNames:d,components:o,disabled:!!e.disableNavigation,onChange:at(Ve.date),options:$Y(L,$,a,l,!!e.reverseYears),style:T?.[Ge.Dropdown],value:l.getYear(Ve.date)}):de.createElement("span",{key:"year"},Z(Ve.date,l));return l.getMonthYearOrder()==="year-first"?[st,Ye]:[Ye,st]})(),de.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},k(Ve.date,l.options,l))):de.createElement(o.CaptionLabel,{className:d[Ge.CaptionLabel],role:"status","aria-live":"polite"},k(Ve.date,l.options,l))),m==="around"&&!e.hideNavigation&&nt===p-1&&de.createElement(o.NextMonthButton,{type:"button",className:d[Ge.NextMonthButton],tabIndex:X?void 0:-1,"aria-disabled":X?void 0:!0,"aria-label":lt(X),onClick:Nn,"data-animated-button":e.animate?"true":void 0},de.createElement(o.Chevron,{disabled:X?void 0:!0,className:d[Ge.Chevron],orientation:e.dir==="rtl"?"left":"right"})),nt===p-1&&m==="after"&&!e.hideNavigation&&de.createElement(o.Nav,{"data-animated-nav":e.animate?"true":void 0,className:d[Ge.Nav],style:T?.[Ge.Nav],"aria-label":Be(),onPreviousClick:zt,onNextClick:Nn,previousMonth:H,nextMonth:X}),de.createElement(o.MonthGrid,{role:"grid","aria-multiselectable":g==="multiple"||g==="range","aria-label":ve(Ve.date,l.options,l)||void 0,className:d[Ge.MonthGrid],style:T?.[Ge.MonthGrid]},!e.hideWeekdays&&de.createElement(o.Weekdays,{"data-animated-weekdays":e.animate?"true":void 0,className:d[Ge.Weekdays],style:T?.[Ge.Weekdays]},D&&de.createElement(o.WeekNumberHeader,{"aria-label":bn(l.options),className:d[Ge.WeekNumberHeader],style:T?.[Ge.WeekNumberHeader],scope:"col"},U()),Vt.map(Ye=>de.createElement(o.Weekday,{"aria-label":ln(Ye,l.options,l),className:d[Ge.Weekday],key:String(Ye),style:T?.[Ge.Weekday],scope:"col"},Y(Ye,l.options,l)))),de.createElement(o.Weeks,{"data-animated-weeks":e.animate?"true":void 0,className:d[Ge.Weeks],style:T?.[Ge.Weeks]},Ve.weeks.map(Ye=>de.createElement(o.Week,{className:d[Ge.Week],key:Ye.weekNumber,style:T?.[Ge.Week],week:Ye},D&&de.createElement(o.WeekNumber,{week:Ye,style:T?.[Ge.WeekNumber],"aria-label":ht(Ye.weekNumber,{locale:u}),className:d[Ge.WeekNumber],scope:"row",role:"rowheader"},W(Ye.weekNumber,l)),Ye.days.map(st=>{const{date:$t}=st,Te=z(st);if(Te[fn.focused]=!Te.hidden&&!!K?.isEqualTo(st),Te[er.selected]=V?.($t)||Te.selected,gh(J)){const{from:Pn,to:Dt}=J;Te[er.range_start]=!!(Pn&&Dt&&l.isSameDay($t,Pn)),Te[er.range_end]=!!(Pn&&Dt&&l.isSameDay($t,Dt)),Te[er.range_middle]=ea(J,$t,!0,l)}const Ot=IY(Te,T,e.modifiersStyles),Kt=vY(Te,d,e.modifiersClassNames),un=!mn&&!Te.hidden?se($t,Te,l.options,l):void 0;return de.createElement(o.Day,{key:`${st.isoDate}_${st.displayMonthId}`,day:st,modifiers:Te,className:Kt.join(" "),style:Ot,role:"gridcell","aria-selected":Te.selected||void 0,"aria-label":un,"data-day":st.isoDate,"data-month":st.outside?st.dateMonthId:void 0,"data-selected":Te.selected||void 0,"data-disabled":Te.disabled||void 0,"data-hidden":Te.hidden||void 0,"data-outside":st.outside||void 0,"data-focused":Te.focused||void 0,"data-today":Te.today||void 0},!Te.hidden&&mn?de.createElement(o.DayButton,{className:d[Ge.DayButton],style:T?.[Ge.DayButton],type:"button",day:st,modifiers:Te,disabled:!Te.focused&&Te.disabled||void 0,"aria-disabled":Te.focused&&Te.disabled||void 0,tabIndex:ee(st)?0:-1,"aria-label":ge($t,Te,l.options,l),onClick:yn(st,Te),onBlur:jn(st,Te),onFocus:In(st,Te),onKeyDown:_e(st,Te),onMouseEnter:Ue(st,Te),onMouseLeave:Et(st,Te)},A($t,l.options,l)):!Te.hidden&&A(st.date,l.options,l))})))))))),e.footer&&de.createElement(o.Footer,{className:d[Ge.Footer],style:T?.[Ge.Footer],role:"status","aria-live":"polite"},e.footer)))}function uG({className:t,classNames:e,showOutsideDays:n=!0,captionLayout:o="label",buttonVariant:a="ghost",locale:i,formatters:l,components:u,...d}){const f=Uy();return y.jsx(cG,{showOutsideDays:n,className:Me("p-3 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(8)] bg-background group/calendar [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,t),captionLayout:o,locale:i,formatters:{formatMonthDropdown:g=>g.toLocaleString(i?.code,{month:"short"}),...l},classNames:{root:Me("w-fit",f.root),months:Me("flex gap-4 flex-col md:flex-row relative",f.months),month:Me("flex flex-col w-full gap-4",f.month),nav:Me("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",f.nav),button_previous:Me(Vp({variant:a}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",f.button_previous),button_next:Me(Vp({variant:a}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",f.button_next),month_caption:Me("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",f.month_caption),dropdowns:Me("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",f.dropdowns),dropdown_root:Me("relative rounded-(--cell-radius)",f.dropdown_root),dropdown:Me("absolute bg-popover inset-0 opacity-0",f.dropdown),caption_label:Me("select-none font-medium",o==="label"?"text-sm":"rounded-(--cell-radius) flex items-center gap-1 text-sm [&>svg]:text-muted-foreground [&>svg]:size-3.5",f.caption_label),table:"w-full border-collapse",weekdays:Me("flex",f.weekdays),weekday:Me("text-muted-foreground rounded-(--cell-radius) flex-1 font-normal text-[0.8rem] select-none",f.weekday),week:Me("flex w-full mt-2",f.week),week_number_header:Me("select-none w-(--cell-size)",f.week_number_header),week_number:Me("text-[0.8rem] select-none text-muted-foreground",f.week_number),day:Me("relative w-full rounded-(--cell-radius) h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius) group/day aspect-square select-none",d.showWeekNumber?"[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)":"[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)",f.day),range_start:Me("rounded-l-(--cell-radius) bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:right-0 -z-0 isolate",f.range_start),range_middle:Me("rounded-none",f.range_middle),range_end:Me("rounded-r-(--cell-radius) bg-muted relative after:bg-muted after:absolute after:inset-y-0 after:w-4 after:left-0 -z-0 isolate",f.range_end),today:Me("bg-muted text-foreground rounded-(--cell-radius) data-[selected=true]:rounded-none",f.today),outside:Me("text-muted-foreground aria-selected:text-muted-foreground",f.outside),disabled:Me("text-muted-foreground opacity-50",f.disabled),hidden:Me("invisible",f.hidden),...e},components:{Root:({className:g,rootRef:m,...p})=>y.jsx("div",{"data-slot":"calendar",ref:m,className:Me(g),...p}),Chevron:({className:g,orientation:m,...p})=>m==="left"?y.jsx(oM,{className:Me("size-4",g),...p}):m==="right"?y.jsx(rM,{className:Me("size-4",g),...p}):y.jsx(la,{className:Me("size-4",g),...p}),DayButton:({...g})=>y.jsx(dG,{locale:i,...g}),WeekNumber:({children:g,...m})=>y.jsx("td",{...m,children:y.jsx("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:g})}),...u},...d})}function dG(t){const e=be.c(21);let n,o,a,i,l;e[0]!==t?({className:n,day:o,modifiers:i,locale:a,...l}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5]);const u=Uy(),d=x.useRef(null);let f,g;e[6]!==i.focused?(f=()=>{i.focused&&d.current?.focus()},g=[i.focused],e[6]=i.focused,e[7]=f,e[8]=g):(f=e[7],g=e[8]),x.useEffect(f,g);const m=nn,p="ghost",v="icon";let S;e[9]!==o.date||e[10]!==a?.code?(S=o.date.toLocaleDateString(a?.code),e[9]=o.date,e[10]=a?.code,e[11]=S):S=e[11];const C=i.selected&&!i.range_start&&!i.range_end&&!i.range_middle,w=i.range_start,M=i.range_end,R=i.range_middle,E=Me("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-foreground relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) [&>span]:text-xs [&>span]:opacity-70",u.day,n);let N;return e[12]!==m||e[13]!==i.range_end||e[14]!==i.range_middle||e[15]!==i.range_start||e[16]!==l||e[17]!==E||e[18]!==S||e[19]!==C?(N=y.jsx(m,{ref:d,variant:p,size:v,"data-day":S,"data-selected-single":C,"data-range-start":w,"data-range-end":M,"data-range-middle":R,className:E,...l}),e[12]=m,e[13]=i.range_end,e[14]=i.range_middle,e[15]=i.range_start,e[16]=l,e[17]=E,e[18]=S,e[19]=C,e[20]=N):N=e[20],N}var gC=1,fG=.9,hG=.8,mG=.17,fp=.1,hp=.999,gG=.9999,pG=.99,yG=/[\\\/_+.#"@\[\(\{&]/,vG=/[\\\/_+.#"@\[\(\{&]/g,xG=/[\s-]/,$R=/[\s-]/g;function s0(t,e,n,o,a,i,l){if(i===e.length)return a===t.length?gC:pG;var u=`${a},${i}`;if(l[u]!==void 0)return l[u];for(var d=o.charAt(i),f=n.indexOf(d,a),g=0,m,p,v,S;f>=0;)m=s0(t,e,n,o,f+1,i+1,l),m>g&&(f===a?m*=gC:yG.test(t.charAt(f-1))?(m*=hG,v=t.slice(a,f-1).match(vG),v&&a>0&&(m*=Math.pow(hp,v.length))):xG.test(t.charAt(f-1))?(m*=fG,S=t.slice(a,f-1).match($R),S&&a>0&&(m*=Math.pow(hp,S.length))):(m*=mG,a>0&&(m*=Math.pow(hp,f-a))),t.charAt(f)!==e.charAt(i)&&(m*=gG)),(m<fp&&n.charAt(f-1)===o.charAt(i+1)||o.charAt(i+1)===o.charAt(i)&&n.charAt(f-1)!==o.charAt(i))&&(p=s0(t,e,n,o,f+1,i+2,l),p*fp>m&&(m=p*fp)),m>g&&(g=m),f=n.indexOf(d,f+1);return l[u]=g,g}function pC(t){return t.toLowerCase().replace($R," ")}function bG(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,s0(t,e,pC(t),pC(e),0,0,{})}var cc='[cmdk-group=""]',mp='[cmdk-group-items=""]',wG='[cmdk-group-heading=""]',LR='[cmdk-item=""]',yC=`${LR}:not([aria-disabled="true"])`,i0="cmdk-item-select",Ti="data-value",SG=(t,e,n)=>bG(t,e,n),HR=x.createContext(void 0),fu=()=>x.useContext(HR),BR=x.createContext(void 0),qy=()=>x.useContext(BR),VR=x.createContext(void 0),FR=x.forwardRef((t,e)=>{let n=ki(()=>{var z,V;return{search:"",value:(V=(z=t.value)!=null?z:t.defaultValue)!=null?V:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=ki(()=>new Set),a=ki(()=>new Map),i=ki(()=>new Map),l=ki(()=>new Set),u=UR(t),{label:d,children:f,value:g,onValueChange:m,filter:p,shouldFilter:v,loop:S,disablePointerSelection:C=!1,vimBindings:w=!0,...M}=t,R=Fn(),E=Fn(),N=Fn(),D=x.useRef(null),T=AG();$s(()=>{if(g!==void 0){let z=g.trim();n.current.value=z,k.emit()}},[g]),$s(()=>{T(6,Z)},[]);let k=x.useMemo(()=>({subscribe:z=>(l.current.add(z),()=>l.current.delete(z)),snapshot:()=>n.current,setState:(z,V,q)=>{var J,oe,K,ee;if(!Object.is(n.current[z],V)){if(n.current[z]=V,z==="search")Y(),W(),T(1,U);else if(z==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ae=document.getElementById(N);ae?ae.focus():(J=document.getElementById(R))==null||J.focus()}if(T(7,()=>{var ae;n.current.selectedItemId=(ae=I())==null?void 0:ae.id,k.emit()}),q||T(5,Z),((oe=u.current)==null?void 0:oe.value)!==void 0){let ae=V??"";(ee=(K=u.current).onValueChange)==null||ee.call(K,ae);return}}k.emit()}},emit:()=>{l.current.forEach(z=>z())}}),[]),A=x.useMemo(()=>({value:(z,V,q)=>{var J;V!==((J=i.current.get(z))==null?void 0:J.value)&&(i.current.set(z,{value:V,keywords:q}),n.current.filtered.items.set(z,B(V,q)),T(2,()=>{W(),k.emit()}))},item:(z,V)=>(o.current.add(z),V&&(a.current.has(V)?a.current.get(V).add(z):a.current.set(V,new Set([z]))),T(3,()=>{Y(),W(),n.current.value||U(),k.emit()}),()=>{i.current.delete(z),o.current.delete(z),n.current.filtered.items.delete(z);let q=I();T(4,()=>{Y(),q?.getAttribute("id")===z&&U(),k.emit()})}),group:z=>(a.current.has(z)||a.current.set(z,new Set),()=>{i.current.delete(z),a.current.delete(z)}),filter:()=>u.current.shouldFilter,label:d||t["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:R,inputId:N,labelId:E,listInnerRef:D}),[]);function B(z,V){var q,J;let oe=(J=(q=u.current)==null?void 0:q.filter)!=null?J:SG;return z?oe(z,n.current.search,V):0}function W(){if(!n.current.search||u.current.shouldFilter===!1)return;let z=n.current.filtered.items,V=[];n.current.filtered.groups.forEach(J=>{let oe=a.current.get(J),K=0;oe.forEach(ee=>{let ae=z.get(ee);K=Math.max(ae,K)}),V.push([J,K])});let q=D.current;G().sort((J,oe)=>{var K,ee;let ae=J.getAttribute("id"),ce=oe.getAttribute("id");return((K=z.get(ce))!=null?K:0)-((ee=z.get(ae))!=null?ee:0)}).forEach(J=>{let oe=J.closest(mp);oe?oe.appendChild(J.parentElement===oe?J:J.closest(`${mp} > *`)):q.appendChild(J.parentElement===q?J:J.closest(`${mp} > *`))}),V.sort((J,oe)=>oe[1]-J[1]).forEach(J=>{var oe;let K=(oe=D.current)==null?void 0:oe.querySelector(`${cc}[${Ti}="${encodeURIComponent(J[0])}"]`);K?.parentElement.appendChild(K)})}function U(){let z=G().find(q=>q.getAttribute("aria-disabled")!=="true"),V=z?.getAttribute(Ti);k.setState("value",V||void 0)}function Y(){var z,V,q,J;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=o.current.size;return}n.current.filtered.groups=new Set;let oe=0;for(let K of o.current){let ee=(V=(z=i.current.get(K))==null?void 0:z.value)!=null?V:"",ae=(J=(q=i.current.get(K))==null?void 0:q.keywords)!=null?J:[],ce=B(ee,ae);n.current.filtered.items.set(K,ce),ce>0&&oe++}for(let[K,ee]of a.current)for(let ae of ee)if(n.current.filtered.items.get(ae)>0){n.current.filtered.groups.add(K);break}n.current.filtered.count=oe}function Z(){var z,V,q;let J=I();J&&(((z=J.parentElement)==null?void 0:z.firstChild)===J&&((q=(V=J.closest(cc))==null?void 0:V.querySelector(wG))==null||q.scrollIntoView({block:"nearest"})),J.scrollIntoView({block:"nearest"}))}function I(){var z;return(z=D.current)==null?void 0:z.querySelector(`${LR}[aria-selected="true"]`)}function G(){var z;return Array.from(((z=D.current)==null?void 0:z.querySelectorAll(yC))||[])}function j(z){let V=G()[z];V&&k.setState("value",V.getAttribute(Ti))}function L(z){var V;let q=I(),J=G(),oe=J.findIndex(ee=>ee===q),K=J[oe+z];(V=u.current)!=null&&V.loop&&(K=oe+z<0?J[J.length-1]:oe+z===J.length?J[0]:J[oe+z]),K&&k.setState("value",K.getAttribute(Ti))}function $(z){let V=I(),q=V?.closest(cc),J;for(;q&&!J;)q=z>0?kG(q,cc):OG(q,cc),J=q?.querySelector(yC);J?k.setState("value",J.getAttribute(Ti)):L(z)}let H=()=>j(G().length-1),X=z=>{z.preventDefault(),z.metaKey?H():z.altKey?$(1):L(1)},P=z=>{z.preventDefault(),z.metaKey?j(0):z.altKey?$(-1):L(-1)};return x.createElement(et.div,{ref:e,tabIndex:-1,...M,"cmdk-root":"",onKeyDown:z=>{var V;(V=M.onKeyDown)==null||V.call(M,z);let q=z.nativeEvent.isComposing||z.keyCode===229;if(!(z.defaultPrevented||q))switch(z.key){case"n":case"j":{w&&z.ctrlKey&&X(z);break}case"ArrowDown":{X(z);break}case"p":case"k":{w&&z.ctrlKey&&P(z);break}case"ArrowUp":{P(z);break}case"Home":{z.preventDefault(),j(0);break}case"End":{z.preventDefault(),H();break}case"Enter":{z.preventDefault();let J=I();if(J){let oe=new Event(i0);J.dispatchEvent(oe)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:zG},d),yh(t,z=>x.createElement(BR.Provider,{value:k},x.createElement(HR.Provider,{value:A},z))))}),CG=x.forwardRef((t,e)=>{var n,o;let a=Fn(),i=x.useRef(null),l=x.useContext(VR),u=fu(),d=UR(t),f=(o=(n=d.current)==null?void 0:n.forceMount)!=null?o:l?.forceMount;$s(()=>{if(!f)return u.item(a,l?.id)},[f]);let g=YR(a,i,[t.value,t.children,i],t.keywords),m=qy(),p=Xa(T=>T.value&&T.value===g.current),v=Xa(T=>f||u.filter()===!1?!0:T.search?T.filtered.items.get(a)>0:!0);x.useEffect(()=>{let T=i.current;if(!(!T||t.disabled))return T.addEventListener(i0,S),()=>T.removeEventListener(i0,S)},[v,t.onSelect,t.disabled]);function S(){var T,k;C(),(k=(T=d.current).onSelect)==null||k.call(T,g.current)}function C(){m.setState("value",g.current,!0)}if(!v)return null;let{disabled:w,value:M,onSelect:R,forceMount:E,keywords:N,...D}=t;return x.createElement(et.div,{ref:aa(i,e),...D,id:a,"cmdk-item":"",role:"option","aria-disabled":!!w,"aria-selected":!!p,"data-disabled":!!w,"data-selected":!!p,onPointerMove:w||u.getDisablePointerSelection()?void 0:C,onClick:w?void 0:S},t.children)}),EG=x.forwardRef((t,e)=>{let{heading:n,children:o,forceMount:a,...i}=t,l=Fn(),u=x.useRef(null),d=x.useRef(null),f=Fn(),g=fu(),m=Xa(v=>a||g.filter()===!1?!0:v.search?v.filtered.groups.has(l):!0);$s(()=>g.group(l),[]),YR(l,u,[t.value,t.heading,d]);let p=x.useMemo(()=>({id:l,forceMount:a}),[a]);return x.createElement(et.div,{ref:aa(u,e),...i,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&x.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),yh(t,v=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},x.createElement(VR.Provider,{value:p},v))))}),_G=x.forwardRef((t,e)=>{let{alwaysRender:n,...o}=t,a=x.useRef(null),i=Xa(l=>!l.search);return!n&&!i?null:x.createElement(et.div,{ref:aa(a,e),...o,"cmdk-separator":"",role:"separator"})}),MG=x.forwardRef((t,e)=>{let{onValueChange:n,...o}=t,a=t.value!=null,i=qy(),l=Xa(f=>f.search),u=Xa(f=>f.selectedItemId),d=fu();return x.useEffect(()=>{t.value!=null&&i.setState("search",t.value)},[t.value]),x.createElement(et.input,{ref:e,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":u,id:d.inputId,type:"text",value:a?t.value:l,onChange:f=>{a||i.setState("search",f.target.value),n?.(f.target.value)}})}),NG=x.forwardRef((t,e)=>{let{children:n,label:o="Suggestions",...a}=t,i=x.useRef(null),l=x.useRef(null),u=Xa(f=>f.selectedItemId),d=fu();return x.useEffect(()=>{if(l.current&&i.current){let f=l.current,g=i.current,m,p=new ResizeObserver(()=>{m=requestAnimationFrame(()=>{let v=f.offsetHeight;g.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return p.observe(f),()=>{cancelAnimationFrame(m),p.unobserve(f)}}},[]),x.createElement(et.div,{ref:aa(i,e),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":o,id:d.listId},yh(t,f=>x.createElement("div",{ref:aa(l,d.listInnerRef),"cmdk-list-sizer":""},f)))}),RG=x.forwardRef((t,e)=>{let{open:n,onOpenChange:o,overlayClassName:a,contentClassName:i,container:l,...u}=t;return x.createElement(M0,{open:n,onOpenChange:o},x.createElement(N0,{container:l},x.createElement(R0,{"cmdk-overlay":"",className:a}),x.createElement(D0,{"aria-label":t.label,"cmdk-dialog":"",className:i},x.createElement(FR,{ref:e,...u}))))}),DG=x.forwardRef((t,e)=>Xa(n=>n.filtered.count===0)?x.createElement(et.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),TG=x.forwardRef((t,e)=>{let{progress:n,children:o,label:a="Loading...",...i}=t;return x.createElement(et.div,{ref:e,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},yh(t,l=>x.createElement("div",{"aria-hidden":!0},l)))}),Bs=Object.assign(FR,{List:NG,Item:CG,Input:MG,Group:EG,Separator:_G,Dialog:RG,Empty:DG,Loading:TG});function kG(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function OG(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function UR(t){let e=x.useRef(t);return $s(()=>{e.current=t}),e}var $s=typeof window>"u"?x.useEffect:x.useLayoutEffect;function ki(t){let e=x.useRef();return e.current===void 0&&(e.current=t()),e}function Xa(t){let e=qy(),n=()=>t(e.snapshot());return x.useSyncExternalStore(e.subscribe,n,n)}function YR(t,e,n,o=[]){let a=x.useRef(),i=fu();return $s(()=>{var l;let u=(()=>{var f;for(let g of n){if(typeof g=="string")return g.trim();if(typeof g=="object"&&"current"in g)return g.current?(f=g.current.textContent)==null?void 0:f.trim():a.current}})(),d=o.map(f=>f.trim());i.value(t,u,d),(l=e.current)==null||l.setAttribute(Ti,u),a.current=u}),a}var AG=()=>{let[t,e]=x.useState(),n=ki(()=>new Map);return $s(()=>{n.current.forEach(o=>o()),n.current=new Map},[t]),(o,a)=>{n.current.set(o,a),e({})}};function jG(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function yh({asChild:t,children:e},n){return t&&x.isValidElement(e)?x.cloneElement(jG(e),{ref:e.ref},n(e.props.children)):n(e)}var zG={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function IG(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border bg-transparent px-2.5 py-2 text-base shadow-xs transition-[color,box-shadow] focus-visible:ring-[3px] aria-invalid:ring-[3px] md:text-sm placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("textarea",{"data-slot":"textarea",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function PG(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("border-input dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 h-9 rounded-md border shadow-xs transition-[color,box-shadow] has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot][aria-invalid=true]]:ring-[3px] has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("div",{"data-slot":"input-group",role:"group",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}const $G=Nf("text-muted-foreground h-auto gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4 flex cursor-text items-center justify-center select-none",{variants:{align:{"inline-start":"pl-2 has-[>button]:ml-[-0.25rem] has-[>kbd]:ml-[-0.15rem] order-first","inline-end":"pr-2 has-[>button]:mr-[-0.25rem] has-[>kbd]:mr-[-0.15rem] order-last","block-start":"px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start","block-end":"px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start"}},defaultVariants:{align:"inline-start"}});function LG(t){const e=be.c(11);let n,o,a;e[0]!==t?({className:n,align:a,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a):(n=e[1],o=e[2],a=e[3]);const i=a===void 0?"inline-start":a;let l;e[4]!==i||e[5]!==n?(l=Me($G({align:i}),n),e[4]=i,e[5]=n,e[6]=l):l=e[6];let u;return e[7]!==i||e[8]!==o||e[9]!==l?(u=y.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":i,className:l,onClick:HG,...o}),e[7]=i,e[8]=o,e[9]=l,e[10]=u):u=e[10],u}function HG(t){t.target.closest("button")||t.currentTarget.parentElement?.querySelector("input")?.focus()}function BG(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("bg-popover text-popover-foreground rounded-xl! p-1 flex size-full flex-col overflow-hidden",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(Bs,{"data-slot":"command",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function VG(t){const e=be.c(11);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",n),e[3]=n,e[4]=a):a=e[4];let i;e[5]!==o||e[6]!==a?(i=y.jsx(Bs.Input,{"data-slot":"command-input",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7];let l;e[8]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx(LG,{children:y.jsx(Qf,{className:"size-4 shrink-0 opacity-50"})}),e[8]=l):l=e[8];let u;return e[9]!==i?(u=y.jsx("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:y.jsxs(PG,{className:"bg-input/30 border-input/30 h-8! rounded-lg! shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[i,l]})}),e[9]=i,e[10]=u):u=e[10],u}function FG(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("no-scrollbar max-h-72 scroll-py-1 outline-none overflow-x-hidden overflow-y-auto",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(Bs.List,{"data-slot":"command-list",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function UG(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("py-6 text-center text-sm",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(Bs.Empty,{"data-slot":"command-empty",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function vC(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(Bs.Group,{"data-slot":"command-group",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function YG(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("bg-border -mx-1 h-px w-auto",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx(Bs.Separator,{"data-slot":"command-separator",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function xC(t){const e=be.c(11);let n,o,a;e[0]!==t?({className:o,children:n,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a):(n=e[1],o=e[2],a=e[3]);let i;e[4]!==o?(i=Me("data-selected:bg-muted data-selected:text-foreground data-selected:**:[svg]:text-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none [&_svg:not([class*='size-'])]:size-4 [[data-slot=dialog-content]_&]:rounded-lg! group/command-item data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",o),e[4]=o,e[5]=i):i=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=y.jsx(ns,{className:"ml-auto opacity-0 group-has-[[data-slot=command-shortcut]]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"}),e[6]=l):l=e[6];let u;return e[7]!==n||e[8]!==a||e[9]!==i?(u=y.jsxs(Bs.Item,{"data-slot":"command-item",className:i,...a,children:[n,l]}),e[7]=n,e[8]=a,e[9]=i,e[10]=u):u=e[10],u}const bC=new Map,GG=16,qG=4,WG=40;function KG({label:t,cacheKey:e,iconSize:n,maxWidth:o,className:a}){const i=bC.get(e);if(i!==void 0)return i;const l=document.createElement("div");if(l.className=`inline-flex items-center rounded-md border px-1.5 text-xs font-semibold h-5 gap-1 shrink-0 absolute invisible pointer-events-none ${a??""}`,l.style.whiteSpace="nowrap",n){const d=document.createElement("span");d.className="shrink-0",d.style.width=`${n}px`,d.style.height=`${n}px`,l.appendChild(d)}if(o){const d=document.createElement("span");d.className="truncate",d.style.maxWidth=`${o}px`,d.textContent=t,l.appendChild(d)}else l.textContent=t;document.body.appendChild(l);const u=l.offsetWidth;return document.body.removeChild(l),bC.set(e,u),u}function GR(t){const e=be.c(25),{items:n,getLabel:o,containerRef:a,lineCount:i,cacheKeyPrefix:l,containerPadding:u,badgeGap:d,overflowBadgeWidth:f,iconSize:g,maxWidth:m,className:p}=t,v=l===void 0?"":l,S=u===void 0?GG:u,C=d===void 0?qG:d,w=f===void 0?WG:f,[M,R]=x.useState(0);let E,N;e[0]!==S||e[1]!==a?(E=()=>{if(!a.current)return;const k=function(){if(a.current){const W=a.current.clientWidth-S;R(W)}};k();const A=new ResizeObserver(k);return A.observe(a.current),()=>{A.disconnect()}},N=[a,S],e[0]=S,e[1]=a,e[2]=E,e[3]=N):(E=e[2],N=e[3]),x.useEffect(E,N);let D;e:{if(!M||n.length===0){let Y;e[4]!==M||e[5]!==n?(Y={visibleItems:n,hiddenCount:0,containerWidth:M},e[4]=M,e[5]=n,e[6]=Y):Y=e[6],D=Y;break e}let k=0,A=1,B;if(e[7]!==C||e[8]!==v||e[9]!==p||e[10]!==M||e[11]!==A||e[12]!==k||e[13]!==o||e[14]!==g||e[15]!==n||e[16]!==i||e[17]!==m||e[18]!==w){B=[];for(const Y of n){const Z=o(Y),I=v?`${v}:${Z}`:Z,j=KG({label:Z,cacheKey:I,iconSize:g,maxWidth:m,className:p})+C;if(k+j<=M)k=k+j,B.push(Y);else if(A<i)A++,k=j,B.push(Y);else{k+w>M&&B.length>0&&B.pop();break}}e[7]=C,e[8]=v,e[9]=p,e[10]=M,e[11]=A,e[12]=k,e[13]=o,e[14]=g,e[15]=n,e[16]=i,e[17]=m,e[18]=w,e[19]=B,e[20]=k}else B=e[19],k=e[20];const W=Math.max(0,n.length-B.length);let U;e[21]!==M||e[22]!==W||e[23]!==B?(U={visibleItems:B,hiddenCount:W,containerWidth:M},e[21]=M,e[22]=W,e[23]=B,e[24]=U):U=e[24],D=U}return D}function XG(t){const e=be.c(3),n=x.useRef(t);let o;e[0]!==t?(o=()=>{n.current=t},e[0]=t,e[1]=o):o=e[1],x.useEffect(o);let a;return e[2]===Symbol.for("react.memo_cache_sentinel")?(a=(...i)=>{const l=i;return n.current?.(...l)},e[2]=a):a=e[2],a}function qR(t,e){const n=be.c(5),o=XG(t),a=x.useRef(0);let i,l;n[0]===Symbol.for("react.memo_cache_sentinel")?(i=()=>()=>window.clearTimeout(a.current),l=[],n[0]=i,n[1]=l):(i=n[0],l=n[1]),x.useEffect(i,l);let u;return n[2]!==e||n[3]!==o?(u=(...f)=>{const g=f;window.clearTimeout(a.current),a.current=window.setTimeout(()=>o(...g),e)},n[2]=e,n[3]=o,n[4]=u):u=n[4],u}function WR(t){return t==null?"":typeof t=="object"?JSON.stringify(t):String(t)}function wC({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:i,isFocused:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=WR(t.getValue()),[p,v]=x.useState(m),S=x.useRef(null),C=x.useRef(null),w=x.useRef(m);m!==w.current&&(w.current=m,v(m),S.current&&!i&&(S.current.textContent=m));const M=x.useCallback(()=>{const D=S.current?.textContent??"";!g&&D!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:D}),e?.onCellEditingStop?.()},[e,n,o,m,g]),R=x.useCallback(D=>{const T=D.currentTarget.textContent??"";v(T)},[]),E=x.useCallback(D=>{if(i)if(D.key==="Enter"){D.preventDefault();const T=S.current?.textContent??"";T!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:T}),e?.onCellEditingStop?.({moveToNextRow:!0})}else if(D.key==="Tab"){D.preventDefault();const T=S.current?.textContent??"";T!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:T}),e?.onCellEditingStop?.({direction:D.shiftKey?"left":"right"})}else D.key==="Escape"&&(D.preventDefault(),v(m),S.current?.blur());else l&&D.key.length===1&&!D.ctrlKey&&!D.metaKey&&(v(D.key),queueMicrotask(()=>{if(S.current&&S.current.contentEditable==="true"){S.current.textContent=D.key;const T=document.createRange(),k=window.getSelection();T.selectNodeContents(S.current),T.collapse(!1),k?.removeAllRanges(),k?.addRange(T)}}))},[i,l,m,e,n,o]);x.useEffect(()=>{if(i&&S.current&&(S.current.focus(),!S.current.textContent&&p&&(S.current.textContent=p),S.current.textContent)){const D=document.createRange(),T=window.getSelection();D.selectNodeContents(S.current),D.collapse(!1),T?.removeAllRanges(),T?.addRange(D)}},[i,p]);const N=i?"":p??"";return y.jsx(fa,{ref:C,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:i,isFocused:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,onKeyDown:E,children:y.jsx("div",{role:"textbox","data-slot":"grid-cell-content",contentEditable:i,tabIndex:-1,ref:S,onBlur:M,onInput:R,suppressContentEditableWarning:!0,className:Me("size-full overflow-hidden outline-none",{"whitespace-nowrap **:inline **:whitespace-nowrap [&_br]:hidden":i}),children:N})})}function ZG({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isFocused:i,isEditing:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=WR(t.getValue()),[p,v]=x.useState(m),S=x.useRef(null),C=x.useRef(null),w=x.useRef(null),M=-(C.current?.clientHeight??0),R=x.useRef(m);m!==R.current&&(R.current=m,v(m));const E=qR(Y=>{g||e?.onDataUpdate?.({rowIndex:n,columnId:o,value:Y})},300),N=x.useCallback(()=>{!g&&p!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:p}),e?.onCellEditingStop?.()},[e,p,m,n,o,g]),D=x.useCallback(()=>{v(m??""),g||e?.onDataUpdate?.({rowIndex:n,columnId:o,value:m}),e?.onCellEditingStop?.()},[e,m,n,o,g]),T=x.useCallback(Y=>{Y&&!g?e?.onCellEditingStart?.(n,o):(!g&&p!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:p}),e?.onCellEditingStop?.())},[e,p,m,n,o,g]),k=x.useCallback(Y=>{if(Y.preventDefault(),S.current){S.current.focus();const Z=S.current.value.length;if(S.current.setSelectionRange(Z,Z),w.current){const I=w.current;w.current=null,requestAnimationFrame(()=>{S.current&&document.activeElement===S.current&&(document.execCommand("insertText",!1,I),S.current.scrollTop=S.current.scrollHeight)})}else S.current.scrollTop=S.current.scrollHeight}},[]),A=x.useCallback(Y=>{i&&!l&&!g&&Y.key.length===1&&!Y.ctrlKey&&!Y.metaKey&&(w.current=Y.key)},[i,l,g]),B=x.useCallback(()=>{!g&&p!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:p}),e?.onCellEditingStop?.()},[e,p,m,n,o,g]),W=x.useCallback(Y=>{const Z=Y.target.value;v(Z),E(Z)},[E]),U=x.useCallback(Y=>{if(Y.key==="Escape")Y.preventDefault(),D();else if(Y.key==="Enter"&&(Y.ctrlKey||Y.metaKey))Y.preventDefault(),N();else if(Y.key==="Tab"){Y.preventDefault(),p!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:p}),e?.onCellEditingStop?.({direction:Y.shiftKey?"left":"right"});return}Y.stopPropagation()},[N,D,p,m,e,n,o]);return y.jsxs(ul,{open:l,onOpenChange:T,children:[y.jsx(mh,{asChild:!0,children:y.jsx(fa,{ref:C,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:l,isFocused:i,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,onKeyDown:A,children:y.jsx("span",{"data-slot":"grid-cell-content",children:p})})}),y.jsx(dl,{"data-grid-cell-editor":"",align:"start",side:"bottom",sideOffset:M,className:"w-[400px] rounded-none p-0",onOpenAutoFocus:k,children:y.jsx(IG,{placeholder:"Enter text...",className:"max-h-[300px] min-h-[150px] resize-none overflow-y-auto rounded-none border-0 shadow-none focus-visible:ring-1 focus-visible:ring-ring",ref:S,value:p,onBlur:B,onChange:W,onKeyDown:U})})]})}function QG({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isFocused:i,isEditing:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=t.getValue(),[p,v]=x.useState(String(m??"")),S=x.useRef(null),C=x.useRef(null),w=t.column.columnDef.meta?.cell,M=w?.variant==="number"?w:null,R=M?.min,E=M?.max,N=M?.step,D=x.useRef(l),T=x.useRef(m);m!==T.current&&(T.current=m,v(String(m??"")));const k=x.useCallback(()=>{const W=p===""?null:Number(p);!g&&W!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:W}),e?.onCellEditingStop?.()},[e,n,o,m,p,g]),A=x.useCallback(W=>{v(W.target.value)},[]),B=x.useCallback(W=>{if(l)if(W.key==="Enter"){W.preventDefault();const U=p===""?null:Number(p);U!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:U}),e?.onCellEditingStop?.({moveToNextRow:!0})}else if(W.key==="Tab"){W.preventDefault();const U=p===""?null:Number(p);U!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:U}),e?.onCellEditingStop?.({direction:W.shiftKey?"left":"right"})}else W.key==="Escape"&&(W.preventDefault(),v(String(m??"")),S.current?.blur());else i&&(W.key==="Backspace"?v(""):W.key.length===1&&!W.ctrlKey&&!W.metaKey&&v(W.key))},[l,i,m,e,n,o,p]);return x.useEffect(()=>{const W=D.current;D.current=l,l&&!W&&S.current&&S.current.focus()},[l]),y.jsx(fa,{ref:C,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:l,isFocused:i,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,onKeyDown:B,children:l?y.jsx("input",{type:"number",ref:S,value:p,min:R,max:E,step:N,className:"w-full border-none bg-transparent p-0 outline-none [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",onBlur:k,onChange:A}):y.jsx("span",{"data-slot":"grid-cell-content",children:p})})}function JG({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:i,isFocused:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=t.getValue(),[p,v]=x.useState(m??""),S=x.useRef(null),C=x.useRef(null),w=x.useRef(m);m!==w.current&&(w.current=m,v(m??""),S.current&&!i&&(S.current.textContent=m??""));const M=x.useCallback(()=>{const A=S.current?.textContent?.trim()??"";!g&&A!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:A||null}),e?.onCellEditingStop?.()},[e,n,o,m,g]),R=x.useCallback(A=>{const B=A.currentTarget.textContent??"";v(B)},[]),E=x.useCallback(A=>{if(i)if(A.key==="Enter"){A.preventDefault();const B=S.current?.textContent?.trim()??"";!g&&B!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:B||null}),e?.onCellEditingStop?.({moveToNextRow:!0})}else if(A.key==="Tab"){A.preventDefault();const B=S.current?.textContent?.trim()??"";!g&&B!==m&&e?.onDataUpdate?.({rowIndex:n,columnId:o,value:B||null}),e?.onCellEditingStop?.({direction:A.shiftKey?"left":"right"})}else A.key==="Escape"&&(A.preventDefault(),v(m??""),S.current?.blur());else l&&!g&&A.key.length===1&&!A.ctrlKey&&!A.metaKey&&(v(A.key),queueMicrotask(()=>{if(S.current&&S.current.contentEditable==="true"){S.current.textContent=A.key;const B=document.createRange(),W=window.getSelection();B.selectNodeContents(S.current),B.collapse(!1),W?.removeAllRanges(),W?.addRange(B)}}))},[i,l,m,e,n,o,g]),N=x.useCallback(A=>{if(i){A.preventDefault();return}if(!QS(p)){A.preventDefault(),hn.error("Invalid URL",{description:"URL contains a dangerous protocol (javascript:, data:, vbscript:, or file:)"});return}A.stopPropagation()},[i,p]);x.useEffect(()=>{if(i&&S.current&&(S.current.focus(),!S.current.textContent&&p&&(S.current.textContent=p),S.current.textContent)){const A=document.createRange(),B=window.getSelection();A.selectNodeContents(S.current),A.collapse(!1),B?.removeAllRanges(),B?.addRange(A)}},[i,p]);const D=i?"":p??"",T=D?QS(D):"",k=D&&!T;return y.jsx(fa,{ref:C,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:i,isFocused:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,onKeyDown:E,children:!i&&D?y.jsx("div",{"data-slot":"grid-cell-content",className:"size-full overflow-hidden",children:y.jsx("a",{"data-focused":l&&!k?"":void 0,"data-invalid":k?"":void 0,href:T,target:"_blank",rel:"noopener noreferrer",className:"truncate text-primary underline decoration-primary/30 underline-offset-2 hover:decoration-primary/60 data-invalid:cursor-not-allowed data-focused:text-foreground data-invalid:text-destructive data-focused:decoration-foreground/50 data-invalid:decoration-destructive/50 data-focused:hover:decoration-foreground/70 data-invalid:hover:decoration-destructive/70",onClick:N,children:D})}):y.jsx("div",{role:"textbox","data-slot":"grid-cell-content",contentEditable:i,tabIndex:-1,ref:S,onBlur:M,onInput:R,suppressContentEditableWarning:!0,className:Me("size-full overflow-hidden outline-none",{"whitespace-nowrap **:inline **:whitespace-nowrap [&_br]:hidden":i}),children:D})})}function eq({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isFocused:i,isSelected:l,isSearchMatch:u,isActiveSearchMatch:d,readOnly:f}){const g=t.getValue(),[m,p]=x.useState(!!g),v=x.useRef(null),S=x.useRef(g);g!==S.current&&(S.current=g,p(!!g));const C=x.useCallback(D=>{f||(p(D),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:D}))},[e,n,o,f]),w=x.useCallback(D=>{i&&!f&&(D.key===" "||D.key==="Enter")?(D.preventDefault(),D.stopPropagation(),C(!m)):i&&D.key==="Tab"&&(D.preventDefault(),e?.onCellEditingStop?.({direction:D.shiftKey?"left":"right"}))},[i,m,C,e,f]),M=x.useCallback(D=>{i&&!f&&(D.preventDefault(),D.stopPropagation(),C(!m))},[i,m,C,f]),R=x.useCallback(D=>{D.stopPropagation()},[]),E=x.useCallback(D=>{D.stopPropagation()},[]),N=x.useCallback(D=>{D.stopPropagation()},[]);return y.jsx(fa,{ref:v,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:!1,isFocused:i,isSelected:l,isSearchMatch:u,isActiveSearchMatch:d,readOnly:f,className:"flex size-full justify-center",onClick:M,onKeyDown:w,children:y.jsx(Py,{checked:m,onCheckedChange:C,disabled:f,className:"border-primary",onClick:R,onMouseDown:E,onDoubleClick:N})})}function tq({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isFocused:i,isEditing:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=t.getValue(),[p,v]=x.useState(m),S=x.useRef(null),C=t.column.columnDef.meta?.cell,w=C?.variant==="select"?C.options:[],M=x.useRef(m);m!==M.current&&(M.current=m,v(m));const R=x.useCallback(T=>{g||(v(T),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:T}),e?.onCellEditingStop?.())},[e,n,o,g]),E=x.useCallback(T=>{T&&!g?e?.onCellEditingStart?.(n,o):e?.onCellEditingStop?.()},[e,n,o,g]),N=x.useCallback(T=>{l&&T.key==="Escape"?(T.preventDefault(),v(m),e?.onCellEditingStop?.()):i&&T.key==="Tab"&&(T.preventDefault(),e?.onCellEditingStop?.({direction:T.shiftKey?"left":"right"}))},[l,i,m,e]),D=w.find(T=>T.value===p)?.label??p;return y.jsx(fa,{ref:S,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:l,isFocused:i,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,onKeyDown:N,children:l?y.jsxs($c,{value:p,onValueChange:R,open:l,onOpenChange:E,children:[y.jsx(Lc,{size:"sm",className:"size-full items-start border-none p-0 shadow-none focus-visible:ring-0 dark:bg-transparent [&_svg]:hidden",children:D?y.jsx(oa,{variant:"secondary",className:"whitespace-pre-wrap px-1.5 py-px",children:y.jsx(Xi,{})}):y.jsx(Xi,{})}),y.jsx(Hc,{"data-grid-cell-editor":"",align:"start",alignOffset:-8,sideOffset:-8,className:"min-w-[calc(var(--radix-select-trigger-width)+16px)]",children:w.map(T=>y.jsx(gr,{value:T.value,children:T.label},T.value))})]}):D?y.jsx(oa,{"data-slot":"grid-cell-content",variant:"secondary",className:"whitespace-pre-wrap px-1.5 py-px",children:D}):null})}function nq({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isFocused:i,isEditing:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=x.useMemo(()=>t.getValue()??[],[t]),p=tn(n,o),v=x.useRef(p),[S,C]=x.useState(m),[w,M]=x.useState(""),R=x.useRef(null),E=x.useRef(null),N=t.column.columnDef.meta?.cell,D=N?.variant==="multi-select"?N.options:[],T=-(R.current?.clientHeight??0),k=x.useRef(m);m!==k.current&&(k.current=m,C(m)),v.current!==p&&(v.current=p,M(""));const A=x.useCallback(H=>{if(g)return;const X=S.includes(H)?S.filter(P=>P!==H):[...S,H];C(X),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:X}),M(""),queueMicrotask(()=>E.current?.focus())},[S,e,n,o,g]),B=x.useCallback((H,X)=>{if(g)return;X?.stopPropagation(),X?.preventDefault();const P=S.filter(z=>z!==H);C(P),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:P}),setTimeout(()=>E.current?.focus(),0)},[S,e,n,o,g]),W=x.useCallback(()=>{g||(C([]),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:[]}),queueMicrotask(()=>E.current?.focus()))},[e,n,o,g]),U=x.useCallback(H=>{H&&!g?e?.onCellEditingStart?.(n,o):(M(""),e?.onCellEditingStop?.())},[e,n,o,g]),Y=x.useCallback(H=>{H.preventDefault(),E.current?.focus()},[]),Z=x.useCallback(H=>{l&&H.key==="Escape"?(H.preventDefault(),C(m),M(""),e?.onCellEditingStop?.()):i&&H.key==="Tab"&&(H.preventDefault(),M(""),e?.onCellEditingStop?.({direction:H.shiftKey?"left":"right"}))},[l,i,m,e]),I=x.useCallback(H=>{if(H.key==="Backspace"&&w===""&&S.length>0){H.preventDefault();const X=S[S.length-1];X&&B(X)}H.key==="Escape"&&H.stopPropagation()},[w,S,B]),G=S.map(H=>D.find(X=>X.value===H)?.label??H).filter(Boolean),j=nR(a),{visibleItems:L,hiddenCount:$}=GR({items:G,getLabel:H=>H,containerRef:R,lineCount:j});return y.jsxs(fa,{ref:R,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:l,isFocused:i,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,onKeyDown:Z,children:[l?y.jsxs(ul,{open:l,onOpenChange:U,children:[y.jsx(mh,{asChild:!0,children:y.jsx("div",{className:"absolute inset-0"})}),y.jsx(dl,{"data-grid-cell-editor":"",align:"start",sideOffset:T,className:"w-[300px] rounded-none p-0",onOpenAutoFocus:Y,children:y.jsxs(BG,{className:"**:data-[slot=command-input-wrapper]:h-auto **:data-[slot=command-input-wrapper]:border-none **:data-[slot=command-input-wrapper]:p-0 [&_[data-slot=command-input-wrapper]_svg]:hidden",children:[y.jsxs("div",{className:"flex min-h-9 flex-wrap items-center gap-1 border-b px-3 py-1.5",children:[S.map(H=>{const P=D.find(z=>z.value===H)?.label??H;return y.jsxs(oa,{variant:"secondary",className:"gap-1 px-1.5 py-px",children:[P,y.jsx("button",{type:"button",onClick:z=>B(H,z),onPointerDown:z=>{z.preventDefault(),z.stopPropagation()},children:y.jsx(os,{className:"size-3"})})]},H)}),y.jsx(VG,{ref:E,value:w,onValueChange:M,onKeyDown:I,placeholder:"Search...",className:"h-auto flex-1 p-0"})]}),y.jsxs(FG,{className:"max-h-full",children:[y.jsx(UG,{children:"No options found."}),y.jsx(vC,{className:"max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden",children:D.map(H=>{const X=S.includes(H.value);return y.jsxs(xC,{value:H.label,onSelect:()=>A(H.value),children:[y.jsx("div",{className:Me("flex size-4 items-center justify-center rounded-sm border border-primary",X?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:y.jsx(ns,{className:"size-3"})}),y.jsx("span",{children:H.label})]},H.value)})}),S.length>0&&y.jsxs(y.Fragment,{children:[y.jsx(YG,{}),y.jsx(vC,{children:y.jsx(xC,{onSelect:W,className:"justify-center text-muted-foreground",children:"Clear all"})})]})]})]})})]}):null,G.length>0?y.jsxs("div",{className:"flex flex-wrap items-center gap-1 overflow-hidden",children:[L.map((H,X)=>y.jsx(oa,{variant:"secondary",className:"px-1.5 py-px",children:H},S[X])),$>0&&y.jsxs(oa,{variant:"outline",className:"px-1.5 py-px text-muted-foreground",children:["+",$]})]}):null]})}function oq({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isFocused:i,isEditing:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=t.getValue(),[p,v]=x.useState(m??""),S=x.useRef(null),C=x.useRef(m);m!==C.current&&(C.current=m,v(m??""));const w=p?aR(p)??void 0:void 0,M=x.useCallback(N=>{if(!N||g)return;const D=oF(N);v(D),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:D}),e?.onCellEditingStop?.()},[e,n,o,g]),R=x.useCallback(N=>{N&&!g?e?.onCellEditingStart?.(n,o):e?.onCellEditingStop?.()},[e,n,o,g]),E=x.useCallback(N=>{l&&N.key==="Escape"?(N.preventDefault(),v(m),e?.onCellEditingStop?.()):i&&N.key==="Tab"&&(N.preventDefault(),e?.onCellEditingStop?.({direction:N.shiftKey?"left":"right"}))},[l,i,m,e]);return y.jsx(fa,{ref:S,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:l,isFocused:i,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,onKeyDown:E,children:y.jsxs(ul,{open:l,onOpenChange:R,children:[y.jsx(mh,{asChild:!0,children:y.jsx("span",{"data-slot":"grid-cell-content",children:rF(p)})}),l&&y.jsx(dl,{"data-grid-cell-editor":"",align:"start",alignOffset:-8,className:"w-auto p-0",children:y.jsx(uG,{autoFocus:!0,captionLayout:"dropdown",mode:"single",defaultMonth:w??new Date,selected:w,onSelect:M})})]})})}function rq({cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isFocused:i,isEditing:l,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g}){const m=x.useMemo(()=>t.getValue()??[],[t]),p=tn(n,o),v=x.useRef(p),S=x.useId(),C=x.useId(),[w,M]=x.useState(m),[R,E]=x.useState(new Set),[N,D]=x.useState(new Set),[T,k]=x.useState(!1),[A,B]=x.useState(!1),[W,U]=x.useState(null),Y=R.size>0,Z=N.size>0,I=Y||Z,G=x.useRef(null),j=x.useRef(null),L=x.useRef(null),$=t.column.columnDef.meta?.cell,H=-(G.current?.clientHeight??0),X=$?.variant==="file"?$:null,P=X?.maxFileSize??10*1024*1024,z=X?.maxFiles??10,V=X?.accept,q=X?.multiple??!1,J=x.useMemo(()=>V?V.split(",").map(_e=>_e.trim()):null,[V]),oe=x.useRef(m);if(m!==oe.current){oe.current=m;for(const _e of w)_e.url&&URL.revokeObjectURL(_e.url);M(m),U(null)}v.current!==p&&(v.current=p,U(null));const K=x.useCallback(_e=>{if(P&&_e.size>P)return`File size exceeds ${sp(P)}`;if(J){const Ue=`.${_e.name.split(".").pop()}`;if(!J.some(Xe=>{if(Xe.endsWith("/*")){const at=Xe.slice(0,-2);return _e.type.startsWith(`${at}/`)}return Xe.startsWith(".")?Ue.toLowerCase()===Xe.toLowerCase():_e.type===Xe}))return"File type not accepted"}return null},[P,J]),ee=x.useCallback(async(_e,Ue=!1)=>{if(g||I)return;if(U(null),z&&w.length+_e.length>z){const at=`Maximum ${z} files allowed`;U(at),hn(at),setTimeout(()=>{U(null)},2e3);return}const Et=[],Xe=[];for(const at of _e){const gt=K(at);if(gt){Et.push({name:at.name,reason:gt});continue}Xe.push(at)}if(Et.length>0){const at=Et[0];if(at){U(at.reason);const gt=at.name.length>20?`${at.name.slice(0,20)}...`:at.name;Et.length===1?hn(at.reason,{description:`"${gt}" has been rejected`}):hn(at.reason,{description:`"${gt}" and ${Et.length-1} more rejected`}),setTimeout(()=>{U(null)},2e3)}}if(Xe.length>0)if(Ue){const at=Xe.map(qt=>({id:crypto.randomUUID(),name:qt.name,size:qt.size,type:qt.type,url:URL.createObjectURL(qt)})),gt=[...w,...at];M(gt),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:gt})}else{const at=Xe.map(_t=>({id:crypto.randomUUID(),name:_t.name,size:_t.size,type:_t.type,url:void 0})),gt=[...w,...at];M(gt);const qt=new Set(at.map(_t=>_t.id));E(qt);let Wt=[];if(e?.onFilesUpload)try{Wt=await e.onFilesUpload({files:Xe,rowIndex:n,columnId:o})}catch(_t){hn.error(_t instanceof Error?_t.message:`Failed to upload ${Xe.length} file${Xe.length!==1?"s":""}`),M(Ve=>Ve.filter(nt=>!qt.has(nt.id))),E(new Set);return}else Wt=Xe.map((_t,Ve)=>({id:at[Ve]?.id??crypto.randomUUID(),name:_t.name,size:_t.size,type:_t.type,url:URL.createObjectURL(_t)}));const Qn=gt.map(_t=>qt.has(_t.id)?Wt.find(Ve=>Ve.name===_t.name)??_t:_t).filter(_t=>_t.url!==void 0);M(Qn),E(new Set),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:Qn})}},[w,z,K,e,n,o,g,I]),ae=x.useCallback(async _e=>{if(g||I)return;U(null);const Ue=w.find(Xe=>Xe.id===_e);if(!Ue)return;if(D(Xe=>new Set(Xe).add(_e)),e?.onFilesDelete)try{await e.onFilesDelete({fileIds:[_e],rowIndex:n,columnId:o})}catch(Xe){hn.error(Xe instanceof Error?Xe.message:`Failed to delete ${Ue.name}`),D(at=>{const gt=new Set(at);return gt.delete(_e),gt});return}Ue.url?.startsWith("blob:")&&URL.revokeObjectURL(Ue.url);const Et=w.filter(Xe=>Xe.id!==_e);M(Et),D(Xe=>{const at=new Set(Xe);return at.delete(_e),at}),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:Et})},[w,e,n,o,g,I]),ce=x.useCallback(async()=>{if(g||I)return;U(null);const _e=w.map(Ue=>Ue.id);if(D(new Set(_e)),e?.onFilesDelete&&w.length>0)try{await e.onFilesDelete({fileIds:_e,rowIndex:n,columnId:o})}catch(Ue){hn.error(Ue instanceof Error?Ue.message:"Failed to delete files"),D(new Set);return}for(const Ue of w)Ue.url?.startsWith("blob:")&&URL.revokeObjectURL(Ue.url);M([]),D(new Set),e?.onDataUpdate?.({rowIndex:n,columnId:o,value:[]})},[w,e,n,o,g,I]),ge=x.useCallback(_e=>{_e.preventDefault(),_e.stopPropagation(),_e.dataTransfer.types.includes("Files")&&k(!0)},[]),se=x.useCallback(_e=>{_e.preventDefault(),_e.stopPropagation();const Ue=_e.currentTarget.getBoundingClientRect(),Et=_e.clientX,Xe=_e.clientY;(Et<=Ue.left||Et>=Ue.right||Xe<=Ue.top||Xe>=Ue.bottom)&&k(!1)},[]),ve=x.useCallback(_e=>{_e.preventDefault(),_e.stopPropagation()},[]),De=x.useCallback(_e=>{_e.preventDefault(),_e.stopPropagation(),k(!1);const Ue=Array.from(_e.dataTransfer.files);Ue.length>0&&ee(Ue,!1)},[ee]),Be=x.useCallback(_e=>{_e.preventDefault(),_e.stopPropagation(),B(!0)},[]),Ie=x.useCallback(_e=>{_e.preventDefault(),_e.stopPropagation();const Ue=_e.currentTarget.getBoundingClientRect(),Et=_e.clientX,Xe=_e.clientY;(Et<=Ue.left||Et>=Ue.right||Xe<=Ue.top||Xe>=Ue.bottom)&&B(!1)},[]),lt=x.useCallback(_e=>{_e.preventDefault(),_e.stopPropagation()},[]),ln=x.useCallback(_e=>{_e.preventDefault(),_e.stopPropagation(),B(!1);const Ue=Array.from(_e.dataTransfer.files);ee(Ue,!1)},[ee]),ht=x.useCallback(()=>{j.current?.click()},[]),bn=x.useCallback(_e=>{(_e.key==="Enter"||_e.key===" ")&&(_e.preventDefault(),ht())},[ht]),cn=x.useCallback(_e=>{const Ue=Array.from(_e.target.files??[]);ee(Ue,!1),_e.target.value=""},[ee]),Vt=x.useCallback(_e=>{_e&&!g?(U(null),e?.onCellEditingStart?.(n,o)):(U(null),e?.onCellEditingStop?.())},[e,n,o,g]),mn=x.useCallback(_e=>{_e.stopPropagation()},[]),zt=x.useCallback(_e=>{_e.preventDefault(),queueMicrotask(()=>{L.current?.focus()})},[]),Nn=x.useCallback(_e=>{l?_e.key==="Escape"?(_e.preventDefault(),M(m),U(null),e?.onCellEditingStop?.()):_e.key===" "?(_e.preventDefault(),ht()):_e.key==="Tab"&&(_e.preventDefault(),e?.onCellEditingStop?.({direction:_e.shiftKey?"left":"right"})):i&&_e.key==="Enter"?(_e.preventDefault(),e?.onCellEditingStart?.(n,o)):i&&_e.key==="Tab"&&(_e.preventDefault(),e?.onCellEditingStop?.({direction:_e.shiftKey?"left":"right"}))},[l,i,m,e,ht,n,o]);x.useEffect(()=>()=>{for(const _e of w)_e.url&&URL.revokeObjectURL(_e.url)},[w]);const yn=nR(a),{visibleItems:In,hiddenCount:jn}=GR({items:w,getLabel:_e=>_e.name,containerRef:G,lineCount:yn,cacheKeyPrefix:"file",iconSize:12,maxWidth:100});return y.jsxs(fa,{ref:G,cell:t,tableMeta:e,rowIndex:n,columnId:o,rowHeight:a,isEditing:l,isFocused:i,isSelected:u,isSearchMatch:d,isActiveSearchMatch:f,readOnly:g,className:Me({"ring-1 ring-primary/80 ring-inset":T}),onDragEnter:ge,onDragLeave:se,onDragOver:ve,onDrop:De,onKeyDown:Nn,children:[l?y.jsxs(ul,{open:l,onOpenChange:Vt,children:[y.jsx(mh,{asChild:!0,children:y.jsx("div",{className:"absolute inset-0"})}),y.jsx(dl,{"data-grid-cell-editor":"",align:"start",sideOffset:H,className:"w-[400px] rounded-none p-0",onEscapeKeyDown:mn,onOpenAutoFocus:zt,children:y.jsxs("div",{className:"flex flex-col gap-2 p-3",children:[y.jsx("span",{id:S,className:"sr-only",children:"File upload"}),y.jsxs("div",{role:"region","aria-labelledby":S,"aria-describedby":C,"aria-invalid":!!W,"aria-disabled":I,"data-dragging":A?"":void 0,"data-invalid":W?"":void 0,"data-disabled":I?"":void 0,tabIndex:A||I?-1:0,className:"flex cursor-pointer flex-col items-center justify-center gap-2 rounded-md border-2 border-dashed p-6 outline-none transition-colors hover:bg-accent/30 focus-visible:border-ring/50 data-disabled:pointer-events-none data-dragging:border-primary/30 data-invalid:border-destructive data-dragging:bg-accent/30 data-disabled:opacity-50 data-invalid:ring-destructive/20",ref:L,onClick:ht,onDragEnter:Be,onDragLeave:Ie,onDragOver:lt,onDrop:ln,onKeyDown:bn,children:[y.jsx(Lw,{className:"size-8 text-muted-foreground"}),y.jsxs("div",{className:"text-center text-sm",children:[y.jsx("p",{className:"font-medium",children:A?"Drop files here":"Drag files here"}),y.jsx("p",{className:"text-muted-foreground text-xs",children:"or click to browse"})]}),y.jsx("p",{id:C,className:"text-muted-foreground text-xs",children:P?`Max size: ${sp(P)}${z?` • Max ${z} files`:""}`:z?`Max ${z} files`:"Select files to upload"})]}),y.jsx("input",{type:"file","aria-labelledby":S,"aria-describedby":C,multiple:q,accept:V,className:"sr-only",ref:j,onChange:cn}),w.length>0&&y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsxs("p",{className:"font-medium text-muted-foreground text-xs",children:[w.length," ",w.length===1?"file":"files"]}),y.jsx(nn,{type:"button",variant:"ghost",size:"sm",className:"h-6 text-muted-foreground text-xs",onClick:ce,disabled:I,children:"Clear all"})]}),y.jsx("div",{className:"max-h-[200px] space-y-1 overflow-y-auto",children:w.map(_e=>{const Ue=JS(_e.type),Et=R.has(_e.id),Xe=N.has(_e.id),at=Et||Xe;return y.jsxs("div",{"data-pending":at?"":void 0,className:"flex items-center gap-2 rounded-md border bg-muted/50 px-2 py-1.5 data-pending:opacity-60",children:[Ue&&y.jsx(Ue,{className:"size-4 shrink-0 text-muted-foreground"}),y.jsxs("div",{className:"flex-1 overflow-hidden",children:[y.jsx("p",{className:"truncate text-sm",children:_e.name}),y.jsx("p",{className:"text-muted-foreground text-xs",children:Et?"Uploading...":Xe?"Deleting...":sp(_e.size)})]}),y.jsx(nn,{type:"button",variant:"ghost",size:"icon",className:"size-5 rounded-sm",onClick:()=>ae(_e.id),disabled:I,children:y.jsx(os,{className:"size-3"})})]},_e.id)})})]})]})})]}):null,T?y.jsxs("div",{className:"flex items-center justify-center gap-2 text-primary text-sm",children:[y.jsx(Lw,{className:"size-4"}),y.jsx("span",{children:"Drop files here"})]}):w.length>0?y.jsxs("div",{className:"flex flex-wrap items-center gap-1 overflow-hidden",children:[In.map(_e=>{if(R.has(_e.id))return y.jsx(BI,{className:"h-5 shrink-0 px-1.5",style:{width:`${Math.min(_e.name.length*8+30,100)}px`}},_e.id);const Et=JS(_e.type);return y.jsxs(oa,{variant:"secondary",className:"gap-1 px-1.5 py-px",children:[Et&&y.jsx(Et,{className:"size-3 shrink-0"}),y.jsx("span",{className:"max-w-[100px] truncate",children:_e.name})]},_e.id)}),jn>0&&y.jsxs(oa,{variant:"outline",className:"px-1.5 py-px text-muted-foreground",children:["+",jn]})]}):null]})}const aq=x.memo(sq,(t,e)=>{if(t.isFocused!==e.isFocused||t.isEditing!==e.isEditing||t.isSelected!==e.isSelected||t.isSearchMatch!==e.isSearchMatch||t.isActiveSearchMatch!==e.isActiveSearchMatch||t.readOnly!==e.readOnly||t.rowIndex!==e.rowIndex||t.columnId!==e.columnId||t.rowHeight!==e.rowHeight)return!1;const n=t.cell.row.original[t.columnId],o=e.cell.row.original[e.columnId];return!(n!==o||t.cell.row.id!==e.cell.row.id)});function sq(t){const e=be.c(13),{cell:n,tableMeta:o,rowIndex:a,columnId:i,isFocused:l,isEditing:u,isSelected:d,isSearchMatch:f,isActiveSearchMatch:g,readOnly:m,rowHeight:p}=t,S=n.column.columnDef.meta?.cell?.variant??"text";let C;e:switch(S){case"short-text":{C=wC;break e}case"long-text":{C=ZG;break e}case"number":{C=QG;break e}case"url":{C=JG;break e}case"checkbox":{C=eq;break e}case"select":{C=tq;break e}case"multi-select":{C=nq;break e}case"date":{C=oq;break e}case"file":{C=rq;break e}default:C=wC}let w;return e[0]!==C||e[1]!==n||e[2]!==i||e[3]!==g||e[4]!==u||e[5]!==l||e[6]!==f||e[7]!==d||e[8]!==m||e[9]!==p||e[10]!==a||e[11]!==o?(w=y.jsx(C,{cell:n,tableMeta:o,rowIndex:a,columnId:i,rowHeight:p,isEditing:u,isFocused:l,isSelected:d,isSearchMatch:f,isActiveSearchMatch:g,readOnly:m}),e[0]=C,e[1]=n,e[2]=i,e[3]=g,e[4]=u,e[5]=l,e[6]=f,e[7]=d,e[8]=m,e[9]=p,e[10]=a,e[11]=o,e[12]=w):w=e[12],w}const iq=x.memo(lq,(t,e)=>{const n=t.virtualItem.index,o=e.virtualItem.index;if(t.row.id!==e.row.id||t.row.original!==e.row.original||t.virtualItem.start!==e.virtualItem.start)return!1;const a=t.focusedCell?.rowIndex===n,i=e.focusedCell?.rowIndex===o;if(a!==i||i&&a&&t.focusedCell?.columnId!==e.focusedCell?.columnId)return!1;const l=t.editingCell?.rowIndex===n,u=e.editingCell?.rowIndex===o;return!(l!==u||u&&l&&t.editingCell?.columnId!==e.editingCell?.columnId||t.cellSelectionKeys!==e.cellSelectionKeys||t.columnVisibility!==e.columnVisibility||t.rowHeight!==e.rowHeight||t.columnPinning!==e.columnPinning||t.readOnly!==e.readOnly||t.searchMatchColumns!==e.searchMatchColumns||t.activeSearchMatch?.columnId!==e.activeSearchMatch?.columnId||t.dir!==e.dir||t.adjustLayout!==e.adjustLayout||t.stretchColumns!==e.stretchColumns)});function lq(t){const e=be.c(63);let n,o,a,i,l,u,d,f,g,m,p,v,S,C,w,M,R,E,N,D,T;e[0]!==t?({row:C,tableMeta:D,virtualItem:T,measureElement:m,rowMapRef:M,rowHeight:w,columnVisibility:u,columnPinning:l,focusedCell:g,editingCell:f,cellSelectionKeys:a,searchMatchColumns:R,activeSearchMatch:n,dir:d,readOnly:v,stretchColumns:E,adjustLayout:o,className:i,style:N,ref:S,...p}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l,e[6]=u,e[7]=d,e[8]=f,e[9]=g,e[10]=m,e[11]=p,e[12]=v,e[13]=S,e[14]=C,e[15]=w,e[16]=M,e[17]=R,e[18]=E,e[19]=N,e[20]=D,e[21]=T):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5],u=e[6],d=e[7],f=e[8],g=e[9],m=e[10],p=e[11],v=e[12],S=e[13],C=e[14],w=e[15],M=e[16],R=e[17],E=e[18],N=e[19],D=e[20],T=e[21]);const k=T.index;let A;e[22]!==m||e[23]!==M||e[24]!==k?(A=Y=>{typeof k>"u"||(Y?(m(Y),M.current?.set(k,Y)):M.current?.delete(k))},e[22]=m,e[23]=M,e[24]=k,e[25]=A):A=e[25];const W=iR(S,A);let U;if(e[26]!==n?.columnId||e[27]!==o||e[28]!==a||e[29]!==i||e[30]!==l||e[31]!==u||e[32]!==d||e[33]!==f?.columnId||e[34]!==f?.rowIndex||e[35]!==g?.columnId||e[36]!==g?.rowIndex||e[37]!==p||e[38]!==v||e[39]!==C||e[40]!==w||e[41]!==W||e[42]!==R||e[43]!==E||e[44]!==N||e[45]!==D||e[46]!==T.start||e[47]!==k){const Y=C.getIsSelected();let Z;e[49]!==C?(Z=C.getVisibleCells(),e[49]=C,e[50]=Z):Z=e[50];const I=Z,G=C.id,j=!o&&"will-change-transform";let L;e[51]!==i||e[52]!==j?(L=Me("absolute flex w-full border-b",j,i),e[51]=i,e[52]=j,e[53]=L):L=e[53];let $;e[54]!==w?($=r0(w),e[54]=w,e[55]=$):$=e[55];const H=`${$}px`;let X;e[56]!==o||e[57]!==T.start?(X=o?{top:`${T.start}px`}:{transform:`translateY(${T.start}px)`},e[56]=o,e[57]=T.start,e[58]=X):X=e[58];let P;e[59]!==N||e[60]!==H||e[61]!==X?(P={height:H,...X,...N},e[59]=N,e[60]=H,e[61]=X,e[62]=P):P=e[62],U=y.jsx("div",{role:"row","aria-rowindex":k+2,"aria-selected":Y,"data-index":k,"data-slot":"grid-row",tabIndex:-1,...p,ref:W,className:L,style:P,children:I.map((z,V)=>{const q=z.column.id,J=g?.rowIndex===k&&g?.columnId===q,oe=f?.rowIndex===k&&f?.columnId===q,K=a?.has(tn(k,q))??!1,ee=R?.has(q)??!1,ae=n?.columnId===q,ce=I[V+1],ge=V===I.length-1,{showEndBorder:se,showStartBorder:ve}=oR({column:z.column,nextColumn:ce?.column,isLastColumn:ge});return y.jsx("div",{role:"gridcell","aria-colindex":V+1,"data-highlighted":J?"":void 0,"data-slot":"grid-cell",tabIndex:-1,className:Me({grow:E&&q!=="select","border-e":se&&q!=="select","border-s":ve&&q!=="select"}),style:{...rR({column:z.column,dir:d}),width:`calc(var(--col-${q}-size) * 1px)`},children:typeof z.column.columnDef.header=="function"?y.jsx("div",{className:Me("size-full px-3 py-1.5",{"bg-primary/10":Y}),children:tR(z.column.columnDef.cell,z.getContext())}):y.jsx(aq,{cell:z,tableMeta:D,rowIndex:k,columnId:q,rowHeight:w,isFocused:J,isEditing:oe,isSelected:K,isSearchMatch:ee,isActiveSearchMatch:ae,readOnly:v})},z.id)})},G),e[26]=n?.columnId,e[27]=o,e[28]=a,e[29]=i,e[30]=l,e[31]=u,e[32]=d,e[33]=f?.columnId,e[34]=f?.rowIndex,e[35]=g?.columnId,e[36]=g?.rowIndex,e[37]=p,e[38]=v,e[39]=C,e[40]=w,e[41]=W,e[42]=R,e[43]=E,e[44]=N,e[45]=D,e[46]=T.start,e[47]=k,e[48]=U}else U=e[48];return U}const cq=x.memo(uq,(t,e)=>{if(t.searchOpen!==e.searchOpen)return!1;if(!e.searchOpen)return!0;if(t.searchQuery!==e.searchQuery||t.matchIndex!==e.matchIndex||t.searchMatches.length!==e.searchMatches.length)return!1;for(let n=0;n<t.searchMatches.length;n++){const o=t.searchMatches[n],a=e.searchMatches[n];if(!o||!a||o.rowIndex!==a.rowIndex||o.columnId!==a.columnId)return!1}return!0});function uq(t){const e=be.c(57),{searchMatches:n,matchIndex:o,searchOpen:a,onSearchOpenChange:i,searchQuery:l,onSearchQueryChange:u,onSearch:d,onNavigateToNextMatch:f,onNavigateToPrevMatch:g}=t;let m;e[0]!==f||e[1]!==g||e[2]!==d||e[3]!==i||e[4]!==u?(m={onSearchOpenChange:i,onSearchQueryChange:u,onSearch:d,onNavigateToNextMatch:f,onNavigateToPrevMatch:g},e[0]=f,e[1]=g,e[2]=d,e[3]=i,e[4]=u,e[5]=m):m=e[5];const p=lu(m),v=x.useRef(null);let S,C;e[6]!==a?(S=()=>{a&&requestAnimationFrame(()=>{v.current?.focus()})},C=[a],e[6]=a,e[7]=S,e[8]=C):(S=e[7],C=e[8]),x.useEffect(S,C);let w,M;e[9]!==p||e[10]!==a?(w=()=>{if(!a)return;const se=function(De){De.key==="Escape"&&(De.preventDefault(),p.current.onSearchOpenChange(!1))};return document.addEventListener("keydown",se),()=>document.removeEventListener("keydown",se)},M=[a,p],e[9]=p,e[10]=a,e[11]=w,e[12]=M):(w=e[11],M=e[12]),x.useEffect(w,M);let R;e[13]!==p?(R=se=>{se.stopPropagation(),se.key==="Enter"&&(se.preventDefault(),se.shiftKey?p.current.onNavigateToPrevMatch():p.current.onNavigateToNextMatch())},e[13]=p,e[14]=R):R=e[14];const E=R;let N;e[15]!==p?(N=se=>{p.current.onSearch(se)},e[15]=p,e[16]=N):N=e[16];const D=qR(N,150);let T;e[17]!==D||e[18]!==p?(T=se=>{const ve=se.target.value;p.current.onSearchQueryChange(ve),D(ve)},e[17]=D,e[18]=p,e[19]=T):T=e[19];const k=T,A=dq;let B;e[20]===Symbol.for("react.memo_cache_sentinel")?(B=se=>A(se),e[20]=B):B=e[20];const W=B;let U;e[21]===Symbol.for("react.memo_cache_sentinel")?(U=se=>A(se),e[21]=U):U=e[21];const Y=U;let Z;e[22]!==p?(Z=()=>{p.current.onSearchOpenChange(!1)},e[22]=p,e[23]=Z):Z=e[23];const I=Z;let G;e[24]!==p?(G=()=>{p.current.onNavigateToPrevMatch()},e[24]=p,e[25]=G):G=e[25];const j=G;let L;e[26]!==p?(L=()=>{p.current.onNavigateToNextMatch()},e[26]=p,e[27]=L):L=e[27];const $=L;if(!a)return null;let H;e[28]!==k||e[29]!==E||e[30]!==l?(H=y.jsx(Bi,{autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,placeholder:"Find in table...",className:"h-8 w-64",ref:v,value:l,onChange:k,onKeyDown:E}),e[28]=k,e[29]=E,e[30]=l,e[31]=H):H=e[31];const X=n.length===0;let P;e[32]===Symbol.for("react.memo_cache_sentinel")?(P=y.jsx(Zf,{}),e[32]=P):P=e[32];let z;e[33]!==j||e[34]!==X?(z=y.jsx(nn,{"aria-label":"Previous match",variant:"ghost",size:"icon",className:"size-7",onClick:j,onPointerDown:W,disabled:X,children:P}),e[33]=j,e[34]=X,e[35]=z):z=e[35];const V=n.length===0;let q;e[36]===Symbol.for("react.memo_cache_sentinel")?(q=y.jsx(la,{}),e[36]=q):q=e[36];let J;e[37]!==$||e[38]!==V?(J=y.jsx(nn,{"aria-label":"Next match",variant:"ghost",size:"icon",className:"size-7",onClick:$,onPointerDown:Y,disabled:V,children:q}),e[37]=$,e[38]=V,e[39]=J):J=e[39];let oe;e[40]===Symbol.for("react.memo_cache_sentinel")?(oe=y.jsx(os,{}),e[40]=oe):oe=e[40];let K;e[41]!==I?(K=y.jsx(nn,{"aria-label":"Close search",variant:"ghost",size:"icon",className:"size-7",onClick:I,children:oe}),e[41]=I,e[42]=K):K=e[42];let ee;e[43]!==z||e[44]!==J||e[45]!==K?(ee=y.jsxs("div",{className:"flex items-center gap-1",children:[z,J,K]}),e[43]=z,e[44]=J,e[45]=K,e[46]=ee):ee=e[46];let ae;e[47]!==H||e[48]!==ee?(ae=y.jsxs("div",{className:"flex items-center gap-2",children:[H,ee]}),e[47]=H,e[48]=ee,e[49]=ae):ae=e[49];let ce;e[50]!==o||e[51]!==n.length||e[52]!==l?(ce=y.jsx("div",{className:"flex items-center gap-1 whitespace-nowrap text-muted-foreground text-xs",children:n.length>0?y.jsxs("span",{children:[o+1," of ",n.length]}):l?y.jsx("span",{children:"No results"}):y.jsx("span",{children:"Type to search"})}),e[50]=o,e[51]=n.length,e[52]=l,e[53]=ce):ce=e[53];let ge;return e[54]!==ae||e[55]!==ce?(ge=y.jsxs("div",{role:"search","data-slot":"grid-search",className:"fade-in-0 slide-in-from-top-2 absolute end-4 top-4 z-50 flex animate-in flex-col gap-2 rounded-lg border bg-background p-2 shadow-lg",children:[ae,ce]}),e[54]=ae,e[55]=ce,e[56]=ge):ge=e[56],ge}function dq(t){const e=t.target;e instanceof HTMLElement&&(e.hasPointerCapture(t.pointerId)&&e.releasePointerCapture(t.pointerId),t.button===0&&t.ctrlKey===!1&&t.pointerType==="mouse"&&!(t.target instanceof HTMLInputElement)&&t.preventDefault())}const fq=new Set;function hq({dataGridRef:t,headerRef:e,rowMapRef:n,footerRef:o,dir:a="ltr",table:i,tableMeta:l,virtualTotalSize:u,virtualItems:d,measureElement:f,columns:g,columnSizeVars:m,searchState:p,searchMatchesByRow:v,activeSearchMatch:S,cellSelectionMap:C,focusedCell:w,editingCell:M,rowHeight:R,contextMenu:E,pasteDialog:N,onRowAdd:D,height:T=600,width:k,stretchColumns:A=!1,adjustLayout:B=!1,className:W,...U}){const Y=i.getRowModel().rows,Z=l?.readOnly??!1,I=i.getState().columnVisibility,G=i.getState().columnPinning,j=lu(D),L=x.useCallback(X=>{j.current?.(X)},[j]),$=x.useCallback(X=>{X.preventDefault()},[]),H=x.useCallback(X=>{j.current&&(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),j.current())},[j]);return y.jsxs("div",{"data-slot":"grid-wrapper",dir:a,...U,className:Me("relative flex min-w-0 min-h-0 flex-col",W),style:{width:k??"100%",maxWidth:k??"100%",height:"100%"},children:[p&&y.jsx(cq,{...p}),y.jsx(lF,{tableMeta:l,columns:g,contextMenu:E}),y.jsx(fF,{tableMeta:l,pasteDialog:N}),y.jsx("div",{role:"grid","aria-label":"Data grid","aria-rowcount":Y.length+(D?1:0),"aria-colcount":g.length,"data-slot":"grid",tabIndex:0,ref:t,className:"relative select-none overflow-x-auto overflow-y-auto rounded-md border focus:outline-none scrollbar-hide",style:{...m,maxHeight:`${T}px`,width:k??"100%",maxWidth:k??"100%",minWidth:0},onContextMenu:$,children:y.jsxs("div",{className:"grid",style:{width:i.getTotalSize(),minWidth:i.getTotalSize()},children:[y.jsx("div",{role:"rowgroup","data-slot":"grid-header",ref:e,className:"sticky top-0 z-10 grid border-b bg-background",children:i.getHeaderGroups().map((X,P)=>y.jsx("div",{role:"row","aria-rowindex":P+1,"data-slot":"grid-header-row",tabIndex:-1,className:"flex w-full",children:X.headers.map((z,V)=>{const J=i.getState().sorting.find(ge=>ge.id===z.column.id),oe=z.column.getCanSort(),K=X.headers[V+1],ee=V===X.headers.length-1,{showEndBorder:ae,showStartBorder:ce}=oR({column:z.column,nextColumn:K?.column,isLastColumn:ee});return y.jsx("div",{role:"columnheader","aria-colindex":V+1,"aria-sort":J?.desc===!1?"ascending":J?.desc===!0?"descending":oe?"none":void 0,"data-slot":"grid-header-cell",tabIndex:-1,className:Me("relative",{grow:A&&z.column.id!=="select","border-e":ae&&z.column.id!=="select","border-s":ce&&z.column.id!=="select"}),style:{...rR({column:z.column,dir:a}),width:`calc(var(--header-${z.id}-size) * 1px)`},children:z.isPlaceholder?null:typeof z.column.columnDef.header=="function"?y.jsx("div",{className:"size-full px-3 py-1.5",children:tR(z.column.columnDef.header,z.getContext())}):y.jsx(aF,{header:z,table:i})},z.id)})},X.id))}),y.jsx("div",{role:"rowgroup","data-slot":"grid-body",className:"relative grid",style:{height:`${u}px`,contain:B?"layout paint":"strict"},children:d.map(X=>{const P=Y[X.index];if(!P)return null;const z=C?.get(X.index)??fq,V=v?.get(X.index)??null,q=S?.rowIndex===X.index;return y.jsx(iq,{row:P,tableMeta:l,rowMapRef:n,virtualItem:X,measureElement:f,rowHeight:R,columnVisibility:I,columnPinning:G,focusedCell:w,editingCell:M,cellSelectionKeys:z,searchMatchColumns:V,activeSearchMatch:q?S:null,dir:a,adjustLayout:B,stretchColumns:A,readOnly:Z},P.id)})}),!Z&&L&&y.jsx("div",{role:"rowgroup","data-slot":"grid-footer",ref:o,className:"sticky bottom-0 z-10 grid border-t bg-background",children:y.jsx("div",{role:"row","aria-rowindex":Y.length+2,"data-slot":"grid-add-row",tabIndex:-1,className:"flex w-full",children:y.jsx("div",{role:"gridcell",tabIndex:0,className:"relative flex h-9 grow items-center bg-muted/30 transition-colors hover:bg-muted/50 focus:bg-muted/50 focus:outline-none",style:{width:i.getTotalSize(),minWidth:i.getTotalSize()},onClick:L,onKeyDown:H,children:y.jsxs("div",{className:"sticky start-0 flex items-center gap-2 px-3 text-muted-foreground",children:[y.jsx(ey,{className:"size-3.5"}),y.jsx("span",{className:"text-sm",children:"Add row"})]})})})})]})})]})}function Fa(t,e){return typeof t=="function"?t(e):t}function Mo(t,e){return n=>{e.setState(o=>({...o,[t]:Fa(n,o[t])}))}}function vh(t){return t instanceof Function}function mq(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function gq(t,e){const n=[],o=a=>{a.forEach(i=>{n.push(i);const l=e(i);l!=null&&l.length&&o(l)})};return o(t),n}function Qe(t,e,n){let o=[],a;return i=>{let l;n.key&&n.debug&&(l=Date.now());const u=t(i);if(!(u.length!==o.length||u.some((g,m)=>o[m]!==g)))return a;o=u;let f;if(n.key&&n.debug&&(f=Date.now()),a=e(...u),n==null||n.onChange==null||n.onChange(a),n.key&&n.debug&&n!=null&&n.debug()){const g=Math.round((Date.now()-l)*100)/100,m=Math.round((Date.now()-f)*100)/100,p=m/16,v=(S,C)=>{for(S=String(S);S.length<C;)S=" "+S;return S};console.info(`%c⏱ ${v(m,5)} /${v(g,5)} ms`,`
|
|
62
|
-
font-size: .6rem;
|
|
63
|
-
font-weight: bold;
|
|
64
|
-
color: hsl(${Math.max(0,Math.min(120-120*p,120))}deg 100% 31%);`,n?.key)}return a}}function Je(t,e,n,o){return{debug:()=>{var a;return(a=t?.debugAll)!=null?a:t[e]},key:!1,onChange:o}}function pq(t,e,n,o){const a=()=>{var l;return(l=i.getValue())!=null?l:t.options.renderFallbackValue},i={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(o),renderValue:a,getContext:Qe(()=>[t,n,e,i],(l,u,d,f)=>({table:l,column:u,row:d,cell:f,getValue:f.getValue,renderValue:f.renderValue}),Je(t.options,"debugCells"))};return t._features.forEach(l=>{l.createCell==null||l.createCell(i,n,e,t)},{}),i}function yq(t,e,n,o){var a,i;const u={...t._getDefaultColumnDef(),...e},d=u.accessorKey;let f=(a=(i=u.id)!=null?i:d?typeof String.prototype.replaceAll=="function"?d.replaceAll(".","_"):d.replace(/\./g,"_"):void 0)!=null?a:typeof u.header=="string"?u.header:void 0,g;if(u.accessorFn?g=u.accessorFn:d&&(d.includes(".")?g=p=>{let v=p;for(const C of d.split(".")){var S;v=(S=v)==null?void 0:S[C]}return v}:g=p=>p[u.accessorKey]),!f)throw new Error;let m={id:`${String(f)}`,accessorFn:g,parent:o,depth:n,columnDef:u,columns:[],getFlatColumns:Qe(()=>[!0],()=>{var p;return[m,...(p=m.columns)==null?void 0:p.flatMap(v=>v.getFlatColumns())]},Je(t.options,"debugColumns")),getLeafColumns:Qe(()=>[t._getOrderColumnsFn()],p=>{var v;if((v=m.columns)!=null&&v.length){let S=m.columns.flatMap(C=>C.getLeafColumns());return p(S)}return[m]},Je(t.options,"debugColumns"))};for(const p of t._features)p.createColumn==null||p.createColumn(m,t);return m}const qn="debugHeaders";function SC(t,e,n){var o;let i={id:(o=n.id)!=null?o:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const l=[],u=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(u),l.push(d)};return u(i),l},getContext:()=>({table:t,header:i,column:e})};return t._features.forEach(l=>{l.createHeader==null||l.createHeader(i,t)}),i}const vq={createTable:t=>{t.getHeaderGroups=Qe(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o,a)=>{var i,l;const u=(i=o?.map(m=>n.find(p=>p.id===m)).filter(Boolean))!=null?i:[],d=(l=a?.map(m=>n.find(p=>p.id===m)).filter(Boolean))!=null?l:[],f=n.filter(m=>!(o!=null&&o.includes(m.id))&&!(a!=null&&a.includes(m.id)));return Vd(e,[...u,...f,...d],t)},Je(t.options,qn)),t.getCenterHeaderGroups=Qe(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o,a)=>(n=n.filter(i=>!(o!=null&&o.includes(i.id))&&!(a!=null&&a.includes(i.id))),Vd(e,n,t,"center")),Je(t.options,qn)),t.getLeftHeaderGroups=Qe(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,o)=>{var a;const i=(a=o?.map(l=>n.find(u=>u.id===l)).filter(Boolean))!=null?a:[];return Vd(e,i,t,"left")},Je(t.options,qn)),t.getRightHeaderGroups=Qe(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,o)=>{var a;const i=(a=o?.map(l=>n.find(u=>u.id===l)).filter(Boolean))!=null?a:[];return Vd(e,i,t,"right")},Je(t.options,qn)),t.getFooterGroups=Qe(()=>[t.getHeaderGroups()],e=>[...e].reverse(),Je(t.options,qn)),t.getLeftFooterGroups=Qe(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),Je(t.options,qn)),t.getCenterFooterGroups=Qe(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),Je(t.options,qn)),t.getRightFooterGroups=Qe(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),Je(t.options,qn)),t.getFlatHeaders=Qe(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),Je(t.options,qn)),t.getLeftFlatHeaders=Qe(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),Je(t.options,qn)),t.getCenterFlatHeaders=Qe(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),Je(t.options,qn)),t.getRightFlatHeaders=Qe(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),Je(t.options,qn)),t.getCenterLeafHeaders=Qe(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),Je(t.options,qn)),t.getLeftLeafHeaders=Qe(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),Je(t.options,qn)),t.getRightLeafHeaders=Qe(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),Je(t.options,qn)),t.getLeafHeaders=Qe(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,o)=>{var a,i,l,u,d,f;return[...(a=(i=e[0])==null?void 0:i.headers)!=null?a:[],...(l=(u=n[0])==null?void 0:u.headers)!=null?l:[],...(d=(f=o[0])==null?void 0:f.headers)!=null?d:[]].map(g=>g.getLeafHeaders()).flat()},Je(t.options,qn))}};function Vd(t,e,n,o){var a,i;let l=0;const u=function(p,v){v===void 0&&(v=1),l=Math.max(l,v),p.filter(S=>S.getIsVisible()).forEach(S=>{var C;(C=S.columns)!=null&&C.length&&u(S.columns,v+1)},0)};u(t);let d=[];const f=(p,v)=>{const S={depth:v,id:[o,`${v}`].filter(Boolean).join("_"),headers:[]},C=[];p.forEach(w=>{const M=[...C].reverse()[0],R=w.column.depth===S.depth;let E,N=!1;if(R&&w.column.parent?E=w.column.parent:(E=w.column,N=!0),M&&M?.column===E)M.subHeaders.push(w);else{const D=SC(n,E,{id:[o,v,E.id,w?.id].filter(Boolean).join("_"),isPlaceholder:N,placeholderId:N?`${C.filter(T=>T.column===E).length}`:void 0,depth:v,index:C.length});D.subHeaders.push(w),C.push(D)}S.headers.push(w),w.headerGroup=S}),d.push(S),v>0&&f(C,v-1)},g=e.map((p,v)=>SC(n,p,{depth:l,index:v}));f(g,l-1),d.reverse();const m=p=>p.filter(S=>S.column.getIsVisible()).map(S=>{let C=0,w=0,M=[0];S.subHeaders&&S.subHeaders.length?(M=[],m(S.subHeaders).forEach(E=>{let{colSpan:N,rowSpan:D}=E;C+=N,M.push(D)})):C=1;const R=Math.min(...M);return w=w+R,S.colSpan=C,S.rowSpan=w,{colSpan:C,rowSpan:w}});return m((a=(i=d[0])==null?void 0:i.headers)!=null?a:[]),d}const Wy=(t,e,n,o,a,i,l)=>{let u={id:e,index:o,original:n,depth:a,parentId:l,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(u._valuesCache.hasOwnProperty(d))return u._valuesCache[d];const f=t.getColumn(d);if(f!=null&&f.accessorFn)return u._valuesCache[d]=f.accessorFn(u.original,o),u._valuesCache[d]},getUniqueValues:d=>{if(u._uniqueValuesCache.hasOwnProperty(d))return u._uniqueValuesCache[d];const f=t.getColumn(d);if(f!=null&&f.accessorFn)return f.columnDef.getUniqueValues?(u._uniqueValuesCache[d]=f.columnDef.getUniqueValues(u.original,o),u._uniqueValuesCache[d]):(u._uniqueValuesCache[d]=[u.getValue(d)],u._uniqueValuesCache[d])},renderValue:d=>{var f;return(f=u.getValue(d))!=null?f:t.options.renderFallbackValue},subRows:[],getLeafRows:()=>gq(u.subRows,d=>d.subRows),getParentRow:()=>u.parentId?t.getRow(u.parentId,!0):void 0,getParentRows:()=>{let d=[],f=u;for(;;){const g=f.getParentRow();if(!g)break;d.push(g),f=g}return d.reverse()},getAllCells:Qe(()=>[t.getAllLeafColumns()],d=>d.map(f=>pq(t,u,f,f.id)),Je(t.options,"debugRows")),_getAllCellsByColumnId:Qe(()=>[u.getAllCells()],d=>d.reduce((f,g)=>(f[g.column.id]=g,f),{}),Je(t.options,"debugRows"))};for(let d=0;d<t._features.length;d++){const f=t._features[d];f==null||f.createRow==null||f.createRow(u,t)}return u},xq={createColumn:(t,e)=>{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}}},KR=(t,e,n)=>{var o,a;const i=n==null||(o=n.toString())==null?void 0:o.toLowerCase();return!!(!((a=t.getValue(e))==null||(a=a.toString())==null||(a=a.toLowerCase())==null)&&a.includes(i))};KR.autoRemove=t=>tr(t);const XR=(t,e,n)=>{var o;return!!(!((o=t.getValue(e))==null||(o=o.toString())==null)&&o.includes(n))};XR.autoRemove=t=>tr(t);const ZR=(t,e,n)=>{var o;return((o=t.getValue(e))==null||(o=o.toString())==null?void 0:o.toLowerCase())===n?.toLowerCase()};ZR.autoRemove=t=>tr(t);const QR=(t,e,n)=>{var o;return(o=t.getValue(e))==null?void 0:o.includes(n)};QR.autoRemove=t=>tr(t);const JR=(t,e,n)=>!n.some(o=>{var a;return!((a=t.getValue(e))!=null&&a.includes(o))});JR.autoRemove=t=>tr(t)||!(t!=null&&t.length);const e3=(t,e,n)=>n.some(o=>{var a;return(a=t.getValue(e))==null?void 0:a.includes(o)});e3.autoRemove=t=>tr(t)||!(t!=null&&t.length);const t3=(t,e,n)=>t.getValue(e)===n;t3.autoRemove=t=>tr(t);const n3=(t,e,n)=>t.getValue(e)==n;n3.autoRemove=t=>tr(t);const Ky=(t,e,n)=>{let[o,a]=n;const i=t.getValue(e);return i>=o&&i<=a};Ky.resolveFilterValue=t=>{let[e,n]=t,o=typeof e!="number"?parseFloat(e):e,a=typeof n!="number"?parseFloat(n):n,i=e===null||Number.isNaN(o)?-1/0:o,l=n===null||Number.isNaN(a)?1/0:a;if(i>l){const u=i;i=l,l=u}return[i,l]};Ky.autoRemove=t=>tr(t)||tr(t[0])&&tr(t[1]);const Qr={includesString:KR,includesStringSensitive:XR,equalsString:ZR,arrIncludes:QR,arrIncludesAll:JR,arrIncludesSome:e3,equals:t3,weakEquals:n3,inNumberRange:Ky};function tr(t){return t==null||t===""}const bq={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:Mo("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],o=n?.getValue(t.id);return typeof o=="string"?Qr.includesString:typeof o=="number"?Qr.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Qr.equals:Array.isArray(o)?Qr.arrIncludes:Qr.weakEquals},t.getFilterFn=()=>{var n,o;return vh(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(o=e.options.filterFns)==null?void 0:o[t.columnDef.filterFn])!=null?n:Qr[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,o,a;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((o=e.options.enableColumnFilters)!=null?o:!0)&&((a=e.options.enableFilters)!=null?a:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(o=>o.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,o;return(n=(o=e.getState().columnFilters)==null?void 0:o.findIndex(a=>a.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(o=>{const a=t.getFilterFn(),i=o?.find(g=>g.id===t.id),l=Fa(n,i?i.value:void 0);if(CC(a,l,t)){var u;return(u=o?.filter(g=>g.id!==t.id))!=null?u:[]}const d={id:t.id,value:l};if(i){var f;return(f=o?.map(g=>g.id===t.id?d:g))!=null?f:[]}return o!=null&&o.length?[...o,d]:[d]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),o=a=>{var i;return(i=Fa(e,a))==null?void 0:i.filter(l=>{const u=n.find(d=>d.id===l.id);if(u){const d=u.getFilterFn();if(CC(d,l.value,u))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(o)},t.resetColumnFilters=e=>{var n,o;t.setColumnFilters(e?[]:(n=(o=t.initialState)==null?void 0:o.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())}};function CC(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const wq=(t,e,n)=>n.reduce((o,a)=>{const i=a.getValue(t);return o+(typeof i=="number"?i:0)},0),Sq=(t,e,n)=>{let o;return n.forEach(a=>{const i=a.getValue(t);i!=null&&(o>i||o===void 0&&i>=i)&&(o=i)}),o},Cq=(t,e,n)=>{let o;return n.forEach(a=>{const i=a.getValue(t);i!=null&&(o<i||o===void 0&&i>=i)&&(o=i)}),o},Eq=(t,e,n)=>{let o,a;return n.forEach(i=>{const l=i.getValue(t);l!=null&&(o===void 0?l>=l&&(o=a=l):(o>l&&(o=l),a<l&&(a=l)))}),[o,a]},_q=(t,e)=>{let n=0,o=0;if(e.forEach(a=>{let i=a.getValue(t);i!=null&&(i=+i)>=i&&(++n,o+=i)}),n)return o/n},Mq=(t,e)=>{if(!e.length)return;const n=e.map(i=>i.getValue(t));if(!mq(n))return;if(n.length===1)return n[0];const o=Math.floor(n.length/2),a=n.sort((i,l)=>i-l);return n.length%2!==0?a[o]:(a[o-1]+a[o])/2},Nq=(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),Rq=(t,e)=>new Set(e.map(n=>n.getValue(t))).size,Dq=(t,e)=>e.length,gp={sum:wq,min:Sq,max:Cq,extent:Eq,mean:_q,median:Mq,unique:Nq,uniqueCount:Rq,count:Dq},Tq={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:Mo("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(o=>o!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,o;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((o=e.options.enableGrouping)!=null?o:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],o=n?.getValue(t.id);if(typeof o=="number")return gp.sum;if(Object.prototype.toString.call(o)==="[object Date]")return gp.extent},t.getAggregationFn=()=>{var n,o;if(!t)throw new Error;return vh(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(o=e.options.aggregationFns)==null?void 0:o[t.columnDef.aggregationFn])!=null?n:gp[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,o;t.setGrouping(e?[]:(n=(o=t.initialState)==null?void 0:o.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const o=e.getColumn(n);return o!=null&&o.columnDef.getGroupingValue?(t._groupingValuesCache[n]=o.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,o)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var a;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((a=n.subRows)!=null&&a.length)}}};function kq(t,e,n){if(!(e!=null&&e.length)||!n)return t;const o=t.filter(i=>!e.includes(i.id));return n==="remove"?o:[...e.map(i=>t.find(l=>l.id===i)).filter(Boolean),...o]}const Oq={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:Mo("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=Qe(n=>[wc(e,n)],n=>n.findIndex(o=>o.id===t.id),Je(e.options,"debugColumns")),t.getIsFirstColumn=n=>{var o;return((o=wc(e,n)[0])==null?void 0:o.id)===t.id},t.getIsLastColumn=n=>{var o;const a=wc(e,n);return((o=a[a.length-1])==null?void 0:o.id)===t.id}},createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=Qe(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,o)=>a=>{let i=[];if(!(e!=null&&e.length))i=a;else{const l=[...e],u=[...a];for(;u.length&&l.length;){const d=l.shift(),f=u.findIndex(g=>g.id===d);f>-1&&i.push(u.splice(f,1)[0])}i=[...i,...u]}return kq(i,n,o)},Je(t.options,"debugTable"))}},pp=()=>({left:[],right:[]}),Aq={getInitialState:t=>({columnPinning:pp(),...t}),getDefaultOptions:t=>({onColumnPinningChange:Mo("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const o=t.getLeafColumns().map(a=>a.id).filter(Boolean);e.setColumnPinning(a=>{var i,l;if(n==="right"){var u,d;return{left:((u=a?.left)!=null?u:[]).filter(m=>!(o!=null&&o.includes(m))),right:[...((d=a?.right)!=null?d:[]).filter(m=>!(o!=null&&o.includes(m))),...o]}}if(n==="left"){var f,g;return{left:[...((f=a?.left)!=null?f:[]).filter(m=>!(o!=null&&o.includes(m))),...o],right:((g=a?.right)!=null?g:[]).filter(m=>!(o!=null&&o.includes(m)))}}return{left:((i=a?.left)!=null?i:[]).filter(m=>!(o!=null&&o.includes(m))),right:((l=a?.right)!=null?l:[]).filter(m=>!(o!=null&&o.includes(m)))}})},t.getCanPin=()=>t.getLeafColumns().some(o=>{var a,i,l;return((a=o.columnDef.enablePinning)!=null?a:!0)&&((i=(l=e.options.enableColumnPinning)!=null?l:e.options.enablePinning)!=null?i:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(u=>u.id),{left:o,right:a}=e.getState().columnPinning,i=n.some(u=>o?.includes(u)),l=n.some(u=>a?.includes(u));return i?"left":l?"right":!1},t.getPinnedIndex=()=>{var n,o;const a=t.getIsPinned();return a?(n=(o=e.getState().columnPinning)==null||(o=o[a])==null?void 0:o.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.getCenterVisibleCells=Qe(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,o,a)=>{const i=[...o??[],...a??[]];return n.filter(l=>!i.includes(l.column.id))},Je(e.options,"debugRows")),t.getLeftVisibleCells=Qe(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,o)=>(o??[]).map(i=>n.find(l=>l.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),Je(e.options,"debugRows")),t.getRightVisibleCells=Qe(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,o)=>(o??[]).map(i=>n.find(l=>l.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),Je(e.options,"debugRows"))},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,o;return t.setColumnPinning(e?pp():(n=(o=t.initialState)==null?void 0:o.columnPinning)!=null?n:pp())},t.getIsSomeColumnsPinned=e=>{var n;const o=t.getState().columnPinning;if(!e){var a,i;return!!((a=o.left)!=null&&a.length||(i=o.right)!=null&&i.length)}return!!((n=o[e])!=null&&n.length)},t.getLeftLeafColumns=Qe(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(o=>e.find(a=>a.id===o)).filter(Boolean),Je(t.options,"debugColumns")),t.getRightLeafColumns=Qe(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(o=>e.find(a=>a.id===o)).filter(Boolean),Je(t.options,"debugColumns")),t.getCenterLeafColumns=Qe(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,o)=>{const a=[...n??[],...o??[]];return e.filter(i=>!a.includes(i.id))},Je(t.options,"debugColumns"))}};function jq(t){return t||(typeof document<"u"?document:null)}const Fd={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},yp=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),zq={getDefaultColumnDef:()=>Fd,getInitialState:t=>({columnSizing:{},columnSizingInfo:yp(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Mo("columnSizing",t),onColumnSizingInfoChange:Mo("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,o,a;const i=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:Fd.minSize,(o=i??t.columnDef.size)!=null?o:Fd.size),(a=t.columnDef.maxSize)!=null?a:Fd.maxSize)},t.getStart=Qe(n=>[n,wc(e,n),e.getState().columnSizing],(n,o)=>o.slice(0,t.getIndex(n)).reduce((a,i)=>a+i.getSize(),0),Je(e.options,"debugColumns")),t.getAfter=Qe(n=>[n,wc(e,n),e.getState().columnSizing],(n,o)=>o.slice(t.getIndex(n)+1).reduce((a,i)=>a+i.getSize(),0),Je(e.options,"debugColumns")),t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:o,...a}=n;return a})},t.getCanResize=()=>{var n,o;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((o=e.options.enableColumnResizing)!=null?o:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const o=a=>{if(a.subHeaders.length)a.subHeaders.forEach(o);else{var i;n+=(i=a.column.getSize())!=null?i:0}};return o(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=n=>{const o=e.getColumn(t.column.id),a=o?.getCanResize();return i=>{if(!o||!a||(i.persist==null||i.persist(),vp(i)&&i.touches&&i.touches.length>1))return;const l=t.getSize(),u=t?t.getLeafHeaders().map(M=>[M.column.id,M.column.getSize()]):[[o.id,o.getSize()]],d=vp(i)?Math.round(i.touches[0].clientX):i.clientX,f={},g=(M,R)=>{typeof R=="number"&&(e.setColumnSizingInfo(E=>{var N,D;const T=e.options.columnResizeDirection==="rtl"?-1:1,k=(R-((N=E?.startOffset)!=null?N:0))*T,A=Math.max(k/((D=E?.startSize)!=null?D:0),-.999999);return E.columnSizingStart.forEach(B=>{let[W,U]=B;f[W]=Math.round(Math.max(U+U*A,0)*100)/100}),{...E,deltaOffset:k,deltaPercentage:A}}),(e.options.columnResizeMode==="onChange"||M==="end")&&e.setColumnSizing(E=>({...E,...f})))},m=M=>g("move",M),p=M=>{g("end",M),e.setColumnSizingInfo(R=>({...R,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},v=jq(n),S={moveHandler:M=>m(M.clientX),upHandler:M=>{v?.removeEventListener("mousemove",S.moveHandler),v?.removeEventListener("mouseup",S.upHandler),p(M.clientX)}},C={moveHandler:M=>(M.cancelable&&(M.preventDefault(),M.stopPropagation()),m(M.touches[0].clientX),!1),upHandler:M=>{var R;v?.removeEventListener("touchmove",C.moveHandler),v?.removeEventListener("touchend",C.upHandler),M.cancelable&&(M.preventDefault(),M.stopPropagation()),p((R=M.touches[0])==null?void 0:R.clientX)}},w=Iq()?{passive:!1}:!1;vp(i)?(v?.addEventListener("touchmove",C.moveHandler,w),v?.addEventListener("touchend",C.upHandler,w)):(v?.addEventListener("mousemove",S.moveHandler,w),v?.addEventListener("mouseup",S.upHandler,w)),e.setColumnSizingInfo(M=>({...M,startOffset:d,startSize:l,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,isResizingColumn:o.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?yp():(n=t.initialState.columnSizingInfo)!=null?n:yp())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((o,a)=>o+a.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((o,a)=>o+a.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((o,a)=>o+a.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((o,a)=>o+a.getSize(),0))!=null?e:0}}};let Ud=null;function Iq(){if(typeof Ud=="boolean")return Ud;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return Ud=t,Ud}function vp(t){return t.type==="touchstart"}const Pq={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:Mo("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(o=>({...o,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,o;const a=t.columns;return(n=a.length?a.some(i=>i.getIsVisible()):(o=e.getState().columnVisibility)==null?void 0:o[t.id])!=null?n:!0},t.getCanHide=()=>{var n,o;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((o=e.options.enableHiding)!=null?o:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=Qe(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(o=>o.column.getIsVisible()),Je(e.options,"debugRows")),t.getVisibleCells=Qe(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,o,a)=>[...n,...o,...a],Je(e.options,"debugRows"))},createTable:t=>{const e=(n,o)=>Qe(()=>[o(),o().filter(a=>a.getIsVisible()).map(a=>a.id).join("_")],a=>a.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),Je(t.options,"debugColumns"));t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var o;t.setColumnVisibility(n?{}:(o=t.initialState.columnVisibility)!=null?o:{})},t.toggleAllColumnsVisible=n=>{var o;n=(o=n)!=null?o:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((a,i)=>({...a,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var o;t.toggleAllColumnsVisible((o=n.target)==null?void 0:o.checked)}}};function wc(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const $q={createTable:t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}},Lq={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:Mo("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const o=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(t,e)=>{t.getCanGlobalFilter=()=>{var n,o,a,i;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((o=e.options.enableGlobalFilter)!=null?o:!0)&&((a=e.options.enableFilters)!=null?a:!0)&&((i=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?i:!0)&&!!t.accessorFn}},createTable:t=>{t.getGlobalAutoFilterFn=()=>Qr.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:o}=t.options;return vh(o)?o:o==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[o])!=null?e:Qr[o]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},Hq={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:Mo("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var o,a;if(!e){t._queue(()=>{e=!0});return}if((o=(a=t.options.autoResetAll)!=null?a:t.options.autoResetExpanded)!=null?o:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=o=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(o),t.toggleAllRowsExpanded=o=>{o??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=o=>{var a,i;t.setExpanded(o?{}:(a=(i=t.initialState)==null?void 0:i.expanded)!=null?a:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const o=t.getState().expanded;return o===!0||Object.values(o).some(Boolean)},t.getIsAllRowsExpanded=()=>{const o=t.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||t.getRowModel().flatRows.some(a=>!a.getIsExpanded()))},t.getExpandedDepth=()=>{let o=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(i=>{const l=i.split(".");o=Math.max(o,l.length)}),o},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(o=>{var a;const i=o===!0?!0:!!(o!=null&&o[t.id]);let l={};if(o===!0?Object.keys(e.getRowModel().rowsById).forEach(u=>{l[u]=!0}):l=o,n=(a=n)!=null?a:!i,!i&&n)return{...l,[t.id]:!0};if(i&&!n){const{[t.id]:u,...d}=l;return d}return o})},t.getIsExpanded=()=>{var n;const o=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:o===!0||o?.[t.id])},t.getCanExpand=()=>{var n,o,a;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((o=e.options.enableExpanding)!=null?o:!0)&&!!((a=t.subRows)!=null&&a.length)},t.getIsAllParentsExpanded=()=>{let n=!0,o=t;for(;n&&o.parentId;)o=e.getRow(o.parentId,!0),n=o.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},l0=0,c0=10,xp=()=>({pageIndex:l0,pageSize:c0}),Bq={getInitialState:t=>({...t,pagination:{...xp(),...t?.pagination}}),getDefaultOptions:t=>({onPaginationChange:Mo("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var o,a;if(!e){t._queue(()=>{e=!0});return}if((o=(a=t.options.autoResetAll)!=null?a:t.options.autoResetPageIndex)!=null?o:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=o=>{const a=i=>Fa(o,i);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(a)},t.resetPagination=o=>{var a;t.setPagination(o?xp():(a=t.initialState.pagination)!=null?a:xp())},t.setPageIndex=o=>{t.setPagination(a=>{let i=Fa(o,a.pageIndex);const l=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return i=Math.max(0,Math.min(i,l)),{...a,pageIndex:i}})},t.resetPageIndex=o=>{var a,i;t.setPageIndex(o?l0:(a=(i=t.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?a:l0)},t.resetPageSize=o=>{var a,i;t.setPageSize(o?c0:(a=(i=t.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?a:c0)},t.setPageSize=o=>{t.setPagination(a=>{const i=Math.max(1,Fa(o,a.pageSize)),l=a.pageSize*a.pageIndex,u=Math.floor(l/i);return{...a,pageIndex:u,pageSize:i}})},t.setPageCount=o=>t.setPagination(a=>{var i;let l=Fa(o,(i=t.options.pageCount)!=null?i:-1);return typeof l=="number"&&(l=Math.max(-1,l)),{...a,pageCount:l}}),t.getPageOptions=Qe(()=>[t.getPageCount()],o=>{let a=[];return o&&o>0&&(a=[...new Array(o)].fill(null).map((i,l)=>l)),a},Je(t.options,"debugTable")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:o}=t.getState().pagination,a=t.getPageCount();return a===-1?!0:a===0?!1:o<a-1},t.previousPage=()=>t.setPageIndex(o=>o-1),t.nextPage=()=>t.setPageIndex(o=>o+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var o;return(o=t.options.pageCount)!=null?o:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var o;return(o=t.options.rowCount)!=null?o:t.getPrePaginationRowModel().rows.length}}},bp=()=>({top:[],bottom:[]}),Vq={getInitialState:t=>({rowPinning:bp(),...t}),getDefaultOptions:t=>({onRowPinningChange:Mo("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,o,a)=>{const i=o?t.getLeafRows().map(d=>{let{id:f}=d;return f}):[],l=a?t.getParentRows().map(d=>{let{id:f}=d;return f}):[],u=new Set([...l,t.id,...i]);e.setRowPinning(d=>{var f,g;if(n==="bottom"){var m,p;return{top:((m=d?.top)!=null?m:[]).filter(C=>!(u!=null&&u.has(C))),bottom:[...((p=d?.bottom)!=null?p:[]).filter(C=>!(u!=null&&u.has(C))),...Array.from(u)]}}if(n==="top"){var v,S;return{top:[...((v=d?.top)!=null?v:[]).filter(C=>!(u!=null&&u.has(C))),...Array.from(u)],bottom:((S=d?.bottom)!=null?S:[]).filter(C=>!(u!=null&&u.has(C)))}}return{top:((f=d?.top)!=null?f:[]).filter(C=>!(u!=null&&u.has(C))),bottom:((g=d?.bottom)!=null?g:[]).filter(C=>!(u!=null&&u.has(C)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:o,enablePinning:a}=e.options;return typeof o=="function"?o(t):(n=o??a)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:o,bottom:a}=e.getState().rowPinning,i=n.some(u=>o?.includes(u)),l=n.some(u=>a?.includes(u));return i?"top":l?"bottom":!1},t.getPinnedIndex=()=>{var n,o;const a=t.getIsPinned();if(!a)return-1;const i=(n=a==="top"?e.getTopRows():e.getBottomRows())==null?void 0:n.map(l=>{let{id:u}=l;return u});return(o=i?.indexOf(t.id))!=null?o:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,o;return t.setRowPinning(e?bp():(n=(o=t.initialState)==null?void 0:o.rowPinning)!=null?n:bp())},t.getIsSomeRowsPinned=e=>{var n;const o=t.getState().rowPinning;if(!e){var a,i;return!!((a=o.top)!=null&&a.length||(i=o.bottom)!=null&&i.length)}return!!((n=o[e])!=null&&n.length)},t._getPinnedRows=(e,n,o)=>{var a;return((a=t.options.keepPinnedRows)==null||a?(n??[]).map(l=>{const u=t.getRow(l,!0);return u.getIsAllParentsExpanded()?u:null}):(n??[]).map(l=>e.find(u=>u.id===l))).filter(Boolean).map(l=>({...l,position:o}))},t.getTopRows=Qe(()=>[t.getRowModel().rows,t.getState().rowPinning.top],(e,n)=>t._getPinnedRows(e,n,"top"),Je(t.options,"debugRows")),t.getBottomRows=Qe(()=>[t.getRowModel().rows,t.getState().rowPinning.bottom],(e,n)=>t._getPinnedRows(e,n,"bottom"),Je(t.options,"debugRows")),t.getCenterRows=Qe(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,o)=>{const a=new Set([...n??[],...o??[]]);return e.filter(i=>!a.has(i.id))},Je(t.options,"debugRows"))}},Fq={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:Mo("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const o={...n},a=t.getPreGroupedRowModel().flatRows;return e?a.forEach(i=>{i.getCanSelect()&&(o[i.id]=!0)}):a.forEach(i=>{delete o[i.id]}),o})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const o=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),a={...n};return t.getRowModel().rows.forEach(i=>{u0(a,i.id,o,!0,t)}),a}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=Qe(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?wp(t,n):{rows:[],flatRows:[],rowsById:{}},Je(t.options,"debugTable")),t.getFilteredSelectedRowModel=Qe(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?wp(t,n):{rows:[],flatRows:[],rowsById:{}},Je(t.options,"debugTable")),t.getGroupedSelectedRowModel=Qe(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?wp(t,n):{rows:[],flatRows:[],rowsById:{}},Je(t.options,"debugTable")),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let o=!!(e.length&&Object.keys(n).length);return o&&e.some(a=>a.getCanSelect()&&!n[a.id])&&(o=!1),o},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(a=>a.getCanSelect()),{rowSelection:n}=t.getState();let o=!!e.length;return o&&e.some(a=>!n[a.id])&&(o=!1),o},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,o)=>{const a=t.getIsSelected();e.setRowSelection(i=>{var l;if(n=typeof n<"u"?n:!a,t.getCanSelect()&&a===n)return i;const u={...i};return u0(u,t.id,n,(l=o?.selectChildren)!=null?l:!0,e),u})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return Xy(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return d0(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return d0(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return o=>{var a;n&&t.toggleSelected((a=o.target)==null?void 0:a.checked)}}}},u0=(t,e,n,o,a)=>{var i;const l=a.getRow(e,!0);n?(l.getCanMultiSelect()||Object.keys(t).forEach(u=>delete t[u]),l.getCanSelect()&&(t[e]=!0)):delete t[e],o&&(i=l.subRows)!=null&&i.length&&l.getCanSelectSubRows()&&l.subRows.forEach(u=>u0(t,u.id,n,o,a))};function wp(t,e){const n=t.getState().rowSelection,o=[],a={},i=function(l,u){return l.map(d=>{var f;const g=Xy(d,n);if(g&&(o.push(d),a[d.id]=d),(f=d.subRows)!=null&&f.length&&(d={...d,subRows:i(d.subRows)}),g)return d}).filter(Boolean)};return{rows:i(e.rows),flatRows:o,rowsById:a}}function Xy(t,e){var n;return(n=e[t.id])!=null?n:!1}function d0(t,e,n){var o;if(!((o=t.subRows)!=null&&o.length))return!1;let a=!0,i=!1;return t.subRows.forEach(l=>{if(!(i&&!a)&&(l.getCanSelect()&&(Xy(l,e)?i=!0:a=!1),l.subRows&&l.subRows.length)){const u=d0(l,e);u==="all"?i=!0:(u==="some"&&(i=!0),a=!1)}}),a?"all":i?"some":!1}const f0=/([0-9]+)/gm,Uq=(t,e,n)=>o3(Za(t.getValue(n)).toLowerCase(),Za(e.getValue(n)).toLowerCase()),Yq=(t,e,n)=>o3(Za(t.getValue(n)),Za(e.getValue(n))),Gq=(t,e,n)=>Zy(Za(t.getValue(n)).toLowerCase(),Za(e.getValue(n)).toLowerCase()),qq=(t,e,n)=>Zy(Za(t.getValue(n)),Za(e.getValue(n))),Wq=(t,e,n)=>{const o=t.getValue(n),a=e.getValue(n);return o>a?1:o<a?-1:0},Kq=(t,e,n)=>Zy(t.getValue(n),e.getValue(n));function Zy(t,e){return t===e?0:t>e?1:-1}function Za(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function o3(t,e){const n=t.split(f0).filter(Boolean),o=e.split(f0).filter(Boolean);for(;n.length&&o.length;){const a=n.shift(),i=o.shift(),l=parseInt(a,10),u=parseInt(i,10),d=[l,u].sort();if(isNaN(d[0])){if(a>i)return 1;if(i>a)return-1;continue}if(isNaN(d[1]))return isNaN(l)?-1:1;if(l>u)return 1;if(u>l)return-1}return n.length-o.length}const uc={alphanumeric:Uq,alphanumericCaseSensitive:Yq,text:Gq,textCaseSensitive:qq,datetime:Wq,basic:Kq},Xq={getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:Mo("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const a of n){const i=a?.getValue(t.id);if(Object.prototype.toString.call(i)==="[object Date]")return uc.datetime;if(typeof i=="string"&&(o=!0,i.split(f0).length>1))return uc.alphanumeric}return o?uc.text:uc.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof n?.getValue(t.id)=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,o;if(!t)throw new Error;return vh(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(o=e.options.sortingFns)==null?void 0:o[t.columnDef.sortingFn])!=null?n:uc[t.columnDef.sortingFn]},t.toggleSorting=(n,o)=>{const a=t.getNextSortingOrder(),i=typeof n<"u"&&n!==null;e.setSorting(l=>{const u=l?.find(v=>v.id===t.id),d=l?.findIndex(v=>v.id===t.id);let f=[],g,m=i?n:a==="desc";if(l!=null&&l.length&&t.getCanMultiSort()&&o?u?g="toggle":g="add":l!=null&&l.length&&d!==l.length-1?g="replace":u?g="toggle":g="replace",g==="toggle"&&(i||a||(g="remove")),g==="add"){var p;f=[...l,{id:t.id,desc:m}],f.splice(0,f.length-((p=e.options.maxMultiSortColCount)!=null?p:Number.MAX_SAFE_INTEGER))}else g==="toggle"?f=l.map(v=>v.id===t.id?{...v,desc:m}:v):g==="remove"?f=l.filter(v=>v.id!==t.id):f=[{id:t.id,desc:m}];return f})},t.getFirstSortDir=()=>{var n,o;return((n=(o=t.columnDef.sortDescFirst)!=null?o:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var o,a;const i=t.getFirstSortDir(),l=t.getIsSorted();return l?l!==i&&((o=e.options.enableSortingRemoval)==null||o)&&(!(n&&(a=e.options.enableMultiRemove)!=null)||a)?!1:l==="desc"?"asc":"desc":i},t.getCanSort=()=>{var n,o;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((o=e.options.enableSorting)!=null?o:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,o;return(n=(o=t.columnDef.enableMultiSort)!=null?o:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const o=(n=e.getState().sorting)==null?void 0:n.find(a=>a.id===t.id);return o?o.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,o;return(n=(o=e.getState().sorting)==null?void 0:o.findIndex(a=>a.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(o=>o.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return o=>{n&&(o.persist==null||o.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(o):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,o;t.setSorting(e?[]:(n=(o=t.initialState)==null?void 0:o.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},Zq=[vq,Pq,Oq,Aq,xq,bq,$q,Lq,Xq,Tq,Hq,Bq,Vq,Fq,zq];function Qq(t){var e,n;const o=[...Zq,...(e=t._features)!=null?e:[]];let a={_features:o};const i=a._features.reduce((p,v)=>Object.assign(p,v.getDefaultOptions==null?void 0:v.getDefaultOptions(a)),{}),l=p=>a.options.mergeOptions?a.options.mergeOptions(i,p):{...i,...p};let d={...{},...(n=t.initialState)!=null?n:{}};a._features.forEach(p=>{var v;d=(v=p.getInitialState==null?void 0:p.getInitialState(d))!=null?v:d});const f=[];let g=!1;const m={_features:o,options:{...i,...t},initialState:d,_queue:p=>{f.push(p),g||(g=!0,Promise.resolve().then(()=>{for(;f.length;)f.shift()();g=!1}).catch(v=>setTimeout(()=>{throw v})))},reset:()=>{a.setState(a.initialState)},setOptions:p=>{const v=Fa(p,a.options);a.options=l(v)},getState:()=>a.options.state,setState:p=>{a.options.onStateChange==null||a.options.onStateChange(p)},_getRowId:(p,v,S)=>{var C;return(C=a.options.getRowId==null?void 0:a.options.getRowId(p,v,S))!=null?C:`${S?[S.id,v].join("."):v}`},getCoreRowModel:()=>(a._getCoreRowModel||(a._getCoreRowModel=a.options.getCoreRowModel(a)),a._getCoreRowModel()),getRowModel:()=>a.getPaginationRowModel(),getRow:(p,v)=>{let S=(v?a.getPrePaginationRowModel():a.getRowModel()).rowsById[p];if(!S&&(S=a.getCoreRowModel().rowsById[p],!S))throw new Error;return S},_getDefaultColumnDef:Qe(()=>[a.options.defaultColumn],p=>{var v;return p=(v=p)!=null?v:{},{header:S=>{const C=S.header.column.columnDef;return C.accessorKey?C.accessorKey:C.accessorFn?C.id:null},cell:S=>{var C,w;return(C=(w=S.renderValue())==null||w.toString==null?void 0:w.toString())!=null?C:null},...a._features.reduce((S,C)=>Object.assign(S,C.getDefaultColumnDef==null?void 0:C.getDefaultColumnDef()),{}),...p}},Je(t,"debugColumns")),_getColumnDefs:()=>a.options.columns,getAllColumns:Qe(()=>[a._getColumnDefs()],p=>{const v=function(S,C,w){return w===void 0&&(w=0),S.map(M=>{const R=yq(a,M,w,C),E=M;return R.columns=E.columns?v(E.columns,R,w+1):[],R})};return v(p)},Je(t,"debugColumns")),getAllFlatColumns:Qe(()=>[a.getAllColumns()],p=>p.flatMap(v=>v.getFlatColumns()),Je(t,"debugColumns")),_getAllFlatColumnsById:Qe(()=>[a.getAllFlatColumns()],p=>p.reduce((v,S)=>(v[S.id]=S,v),{}),Je(t,"debugColumns")),getAllLeafColumns:Qe(()=>[a.getAllColumns(),a._getOrderColumnsFn()],(p,v)=>{let S=p.flatMap(C=>C.getLeafColumns());return v(S)},Je(t,"debugColumns")),getColumn:p=>a._getAllFlatColumnsById()[p]};Object.assign(a,m);for(let p=0;p<a._features.length;p++){const v=a._features[p];v==null||v.createTable==null||v.createTable(a)}return a}function Jq(){return t=>Qe(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(a,i,l){i===void 0&&(i=0);const u=[];for(let f=0;f<a.length;f++){const g=Wy(t,t._getRowId(a[f],f,l),a[f],f,i,void 0,l?.id);if(n.flatRows.push(g),n.rowsById[g.id]=g,u.push(g),t.options.getSubRows){var d;g.originalSubRows=t.options.getSubRows(a[f],f),(d=g.originalSubRows)!=null&&d.length&&(g.subRows=o(g.originalSubRows,i+1,g))}}return u};return n.rows=o(e),n},Je(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function eW(t,e,n){return n.options.filterFromLeafRows?tW(t,e,n):nW(t,e,n)}function tW(t,e,n){var o;const a=[],i={},l=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,u=function(d,f){f===void 0&&(f=0);const g=[];for(let p=0;p<d.length;p++){var m;let v=d[p];const S=Wy(n,v.id,v.original,v.index,v.depth,void 0,v.parentId);if(S.columnFilters=v.columnFilters,(m=v.subRows)!=null&&m.length&&f<l){if(S.subRows=u(v.subRows,f+1),v=S,e(v)&&!S.subRows.length){g.push(v),i[v.id]=v,a.push(v);continue}if(e(v)||S.subRows.length){g.push(v),i[v.id]=v,a.push(v);continue}}else v=S,e(v)&&(g.push(v),i[v.id]=v,a.push(v))}return g};return{rows:u(t),flatRows:a,rowsById:i}}function nW(t,e,n){var o;const a=[],i={},l=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,u=function(d,f){f===void 0&&(f=0);const g=[];for(let p=0;p<d.length;p++){let v=d[p];if(e(v)){var m;if((m=v.subRows)!=null&&m.length&&f<l){const C=Wy(n,v.id,v.original,v.index,v.depth,void 0,v.parentId);C.subRows=u(v.subRows,f+1),v=C}g.push(v),a.push(v),i[v.id]=v}}return g};return{rows:u(t),flatRows:a,rowsById:i}}function oW(){return t=>Qe(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter],(e,n,o)=>{if(!e.rows.length||!(n!=null&&n.length)&&!o){for(let p=0;p<e.flatRows.length;p++)e.flatRows[p].columnFilters={},e.flatRows[p].columnFiltersMeta={};return e}const a=[],i=[];(n??[]).forEach(p=>{var v;const S=t.getColumn(p.id);if(!S)return;const C=S.getFilterFn();C&&a.push({id:p.id,filterFn:C,resolvedValue:(v=C.resolveFilterValue==null?void 0:C.resolveFilterValue(p.value))!=null?v:p.value})});const l=(n??[]).map(p=>p.id),u=t.getGlobalFilterFn(),d=t.getAllLeafColumns().filter(p=>p.getCanGlobalFilter());o&&u&&d.length&&(l.push("__global__"),d.forEach(p=>{var v;i.push({id:p.id,filterFn:u,resolvedValue:(v=u.resolveFilterValue==null?void 0:u.resolveFilterValue(o))!=null?v:o})}));let f,g;for(let p=0;p<e.flatRows.length;p++){const v=e.flatRows[p];if(v.columnFilters={},a.length)for(let S=0;S<a.length;S++){f=a[S];const C=f.id;v.columnFilters[C]=f.filterFn(v,C,f.resolvedValue,w=>{v.columnFiltersMeta[C]=w})}if(i.length){for(let S=0;S<i.length;S++){g=i[S];const C=g.id;if(g.filterFn(v,C,g.resolvedValue,w=>{v.columnFiltersMeta[C]=w})){v.columnFilters.__global__=!0;break}}v.columnFilters.__global__!==!0&&(v.columnFilters.__global__=!1)}}const m=p=>{for(let v=0;v<l.length;v++)if(p.columnFilters[l[v]]===!1)return!1;return!0};return eW(e.rows,m,t)},Je(t.options,"debugTable","getFilteredRowModel",()=>t._autoResetPageIndex()))}function rW(){return t=>Qe(()=>[t.getState().sorting,t.getPreSortedRowModel()],(e,n)=>{if(!n.rows.length||!(e!=null&&e.length))return n;const o=t.getState().sorting,a=[],i=o.filter(d=>{var f;return(f=t.getColumn(d.id))==null?void 0:f.getCanSort()}),l={};i.forEach(d=>{const f=t.getColumn(d.id);f&&(l[d.id]={sortUndefined:f.columnDef.sortUndefined,invertSorting:f.columnDef.invertSorting,sortingFn:f.getSortingFn()})});const u=d=>{const f=d.map(g=>({...g}));return f.sort((g,m)=>{for(let v=0;v<i.length;v+=1){var p;const S=i[v],C=l[S.id],w=C.sortUndefined,M=(p=S?.desc)!=null?p:!1;let R=0;if(w){const E=g.getValue(S.id),N=m.getValue(S.id),D=E===void 0,T=N===void 0;if(D||T){if(w==="first")return D?-1:1;if(w==="last")return D?1:-1;R=D&&T?0:D?w:-w}}if(R===0&&(R=C.sortingFn(g,m,S.id)),R!==0)return M&&(R*=-1),C.invertSorting&&(R*=-1),R}return g.index-m.index}),f.forEach(g=>{var m;a.push(g),(m=g.subRows)!=null&&m.length&&(g.subRows=u(g.subRows))}),f};return{rows:u(n.rows),flatRows:a,rowsById:n.rowsById}},Je(t.options,"debugTable","getSortedRowModel",()=>t._autoResetPageIndex()))}function aW(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=x.useState(()=>({current:Qq(e)})),[o,a]=x.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...t,state:{...o,...t.state},onStateChange:l=>{a(l),t.onStateChange==null||t.onStateChange(l)}})),n.current}function Ri(t,e,n){let o=n.initialDeps??[],a,i=!0;function l(){var u,d,f;let g;n.key&&((u=n.debug)!=null&&u.call(n))&&(g=Date.now());const m=t();if(!(m.length!==o.length||m.some((S,C)=>o[C]!==S)))return a;o=m;let v;if(n.key&&((d=n.debug)!=null&&d.call(n))&&(v=Date.now()),a=e(...m),n.key&&((f=n.debug)!=null&&f.call(n))){const S=Math.round((Date.now()-g)*100)/100,C=Math.round((Date.now()-v)*100)/100,w=C/16,M=(R,E)=>{for(R=String(R);R.length<E;)R=" "+R;return R};console.info(`%c⏱ ${M(C,5)} /${M(S,5)} ms`,`
|
|
65
|
-
font-size: .6rem;
|
|
66
|
-
font-weight: bold;
|
|
67
|
-
color: hsl(${Math.max(0,Math.min(120-120*w,120))}deg 100% 31%);`,n?.key)}return n?.onChange&&!(i&&n.skipInitialOnChange)&&n.onChange(a),i=!1,a}return l.updateDeps=u=>{o=u},l}function EC(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const sW=(t,e)=>Math.abs(t-e)<1.01,iW=(t,e,n)=>{let o;return function(...a){t.clearTimeout(o),o=t.setTimeout(()=>e.apply(this,a),n)}},_C=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},lW=t=>t,cW=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),o=[];for(let a=e;a<=n;a++)o.push(a);return o},uW=(t,e)=>{const n=t.scrollElement;if(!n)return;const o=t.targetWindow;if(!o)return;const a=l=>{const{width:u,height:d}=l;e({width:Math.round(u),height:Math.round(d)})};if(a(_C(n)),!o.ResizeObserver)return()=>{};const i=new o.ResizeObserver(l=>{const u=()=>{const d=l[0];if(d?.borderBoxSize){const f=d.borderBoxSize[0];if(f){a({width:f.inlineSize,height:f.blockSize});return}}a(_C(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(u):u()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},MC={passive:!0},NC=typeof window>"u"?!0:"onscrollend"in window,dW=(t,e)=>{const n=t.scrollElement;if(!n)return;const o=t.targetWindow;if(!o)return;let a=0;const i=t.options.useScrollendEvent&&NC?()=>{}:iW(o,()=>{e(a,!1)},t.options.isScrollingResetDelay),l=g=>()=>{const{horizontal:m,isRtl:p}=t.options;a=m?n.scrollLeft*(p&&-1||1):n.scrollTop,i(),e(a,g)},u=l(!0),d=l(!1);n.addEventListener("scroll",u,MC);const f=t.options.useScrollendEvent&&NC;return f&&n.addEventListener("scrollend",d,MC),()=>{n.removeEventListener("scroll",u),f&&n.removeEventListener("scrollend",d)}},fW=(t,e,n)=>{if(e?.borderBoxSize){const o=e.borderBoxSize[0];if(o)return Math.round(o[n.options.horizontal?"inlineSize":"blockSize"])}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},hW=(t,{adjustments:e=0,behavior:n},o)=>{var a,i;const l=t+e;(i=(a=o.scrollElement)==null?void 0:a.scrollTo)==null||i.call(a,{[o.options.horizontal?"left":"top"]:l,behavior:n})};class mW{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const o=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(a=>{a.forEach(i=>{const l=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()})}));return{disconnect:()=>{var a;(a=o())==null||a.disconnect(),n=null},observe:a=>{var i;return(i=o())==null?void 0:i.observe(a,{box:"border-box"})},unobserve:a=>{var i;return(i=o())==null?void 0:i.unobserve(a)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([o,a])=>{typeof a>"u"&&delete n[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:lW,rangeExtractor:cW,onChange:()=>{},measureElement:fW,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var o,a;(a=(o=this.options).onChange)==null||a.call(o,this,n)},this.maybeNotify=Ri(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(a=>{this.observer.observe(a)}),this.unsubs.push(this.options.observeElementRect(this,a=>{this.scrollRect=a,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(a,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<a?"forward":"backward":null,this.scrollOffset=a,this.isScrolling=i,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,o)=>{const a=new Map,i=new Map;for(let l=o-1;l>=0;l--){const u=n[l];if(a.has(u.lane))continue;const d=i.get(u.lane);if(d==null||u.end>d.end?i.set(u.lane,u):u.end<d.end&&a.set(u.lane,!0),a.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((l,u)=>l.end===u.end?l.index-u.index:l.end-u.end)[0]:void 0},this.getMeasurementOptions=Ri(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,o,a,i,l,u)=>(this.prevLanes!==void 0&&this.prevLanes!==u&&(this.lanesChangedFlag=!0),this.prevLanes=u,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:o,scrollMargin:a,getItemKey:i,enabled:l,lanes:u}),{key:!1}),this.getMeasurements=Ri(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:o,scrollMargin:a,getItemKey:i,enabled:l,lanes:u},d)=>{if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const p of this.laneAssignments.keys())p>=n&&this.laneAssignments.delete(p);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(p=>{this.itemSizeCache.set(p.key,p.size)}));const f=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const g=this.measurementsCache.slice(0,f),m=new Array(u).fill(void 0);for(let p=0;p<f;p++){const v=g[p];v&&(m[v.lane]=p)}for(let p=f;p<n;p++){const v=i(p),S=this.laneAssignments.get(p);let C,w;if(S!==void 0&&this.options.lanes>1){C=S;const N=m[C],D=N!==void 0?g[N]:void 0;w=D?D.end+this.options.gap:o+a}else{const N=this.options.lanes===1?g[p-1]:this.getFurthestMeasurement(g,p);w=N?N.end+this.options.gap:o+a,C=N?N.lane:p%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(p,C)}const M=d.get(v),R=typeof M=="number"?M:this.options.estimateSize(p),E=w+R;g[p]={index:p,start:w,size:R,end:E,key:v,lane:C},m[C]=p}return this.measurementsCache=g,g},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Ri(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,o,a,i)=>this.range=n.length>0&&o>0?gW({measurements:n,outerSize:o,scrollOffset:a,lanes:i}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ri(()=>{let n=null,o=null;const a=this.calculateRange();return a&&(n=a.startIndex,o=a.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,o]},(n,o,a,i,l)=>i===null||l===null?[]:n({startIndex:i,endIndex:l,overscan:o,count:a}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const o=this.options.indexAttribute,a=n.getAttribute(o);return a?parseInt(a,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(n,o)=>{const a=this.indexFromElement(n),i=this.measurementsCache[a];if(!i)return;const l=i.key,u=this.elementsCache.get(l);u!==n&&(u&&this.observer.unobserve(u),this.observer.observe(n),this.elementsCache.set(l,n)),n.isConnected&&this.resizeItem(a,this.options.measureElement(n,o,this))},this.resizeItem=(n,o)=>{const a=this.measurementsCache[n];if(!a)return;const i=this.itemSizeCache.get(a.key)??a.size,l=o-i;l!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(a,l,this):a.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=l,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(a.index),this.itemSizeCache=new Map(this.itemSizeCache.set(a.key,o)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((o,a)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(a))});return}this._measureElement(n,void 0)},this.getVirtualItems=Ri(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,o)=>{const a=[];for(let i=0,l=n.length;i<l;i++){const u=n[i],d=o[u];a.push(d)}return a},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const o=this.getMeasurements();if(o.length!==0)return EC(o[r3(0,o.length-1,a=>EC(o[a]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,o,a=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),l=this.getScrollOffset();o==="auto"&&(o=n>=l+i?"end":"start"),o==="center"?n+=(a-i)/2:o==="end"&&(n-=i);const u=this.getMaxScrollOffset();return Math.max(Math.min(u,n),0)},this.getOffsetForIndex=(n,o="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const a=this.measurementsCache[n];if(!a)return;const i=this.getSize(),l=this.getScrollOffset();if(o==="auto")if(a.end>=l+i-this.options.scrollPaddingEnd)o="end";else if(a.start<=l+this.options.scrollPaddingStart)o="start";else return[l,o];if(o==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),o];const u=o==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(u,o,a.size),o]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:o="start",behavior:a}={})=>{a==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,o),{adjustments:void 0,behavior:a})},this.scrollToIndex=(n,{align:o="auto",behavior:a}={})=>{a==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1)),this.currentScrollToIndex=n;let i=0;const l=10,u=f=>{if(!this.targetWindow)return;const g=this.getOffsetForIndex(n,f);if(!g){console.warn("Failed to get offset for index:",n);return}const[m,p]=g;this._scrollToOffset(m,{adjustments:void 0,behavior:a}),this.targetWindow.requestAnimationFrame(()=>{const v=()=>{if(this.currentScrollToIndex!==n)return;const S=this.getScrollOffset(),C=this.getOffsetForIndex(n,p);if(!C){console.warn("Failed to get offset for index:",n);return}sW(C[0],S)||d(p)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(v):v()})},d=f=>{this.targetWindow&&this.currentScrollToIndex===n&&(i++,i<l?this.targetWindow.requestAnimationFrame(()=>u(f)):console.warn(`Failed to scroll to index ${n} after ${l} attempts.`))};u(o)},this.scrollBy=(n,{behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var n;const o=this.getMeasurements();let a;if(o.length===0)a=this.options.paddingStart;else if(this.options.lanes===1)a=((n=o[o.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let l=o.length-1;for(;l>=0&&i.some(u=>u===null);){const u=o[l];i[u.lane]===null&&(i[u.lane]=u.end),l--}a=Math.max(...i.filter(u=>u!==null))}return Math.max(a-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:o,behavior:a})=>{this.options.scrollToFn(n,{behavior:a,adjustments:o},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}}const r3=(t,e,n,o)=>{for(;t<=e;){const a=(t+e)/2|0,i=n(a);if(i<o)t=a+1;else if(i>o)e=a-1;else return a}return t>0?t-1:0};function gW({measurements:t,outerSize:e,scrollOffset:n,lanes:o}){const a=t.length-1,i=d=>t[d].start;if(t.length<=o)return{startIndex:0,endIndex:a};let l=r3(0,a,i,n),u=l;if(o===1)for(;u<a&&t[u].end<n+e;)u++;else if(o>1){const d=Array(o).fill(0);for(;u<a&&d.some(g=>g<n+e);){const g=t[u];d[g.lane]=g.end,u++}const f=Array(o).fill(n+e);for(;l>=0&&f.some(g=>g>=n);){const g=t[l];f[g.lane]=g.start,l--}l=Math.max(0,l-l%o),u=Math.min(a,u+(o-1-u%o))}return{startIndex:l,endIndex:u}}const RC=typeof document<"u"?x.useLayoutEffect:x.useEffect;function pW({useFlushSync:t=!0,...e}){const n=x.useReducer(()=>({}),{})[1],o={...e,onChange:(i,l)=>{var u;t&&l?nl.flushSync(n):n(),(u=e.onChange)==null||u.call(e,i,l)}},[a]=x.useState(()=>new mW(o));return a.setOptions(o),RC(()=>a._didMount(),[]),RC(()=>a._willUpdate()),a}function yW(t){return pW({observeElementRect:uW,observeElementOffset:dW,scrollToFn:hW,...t})}function Sp(t){const e=be.c(2),n=x.useRef(null);if(n.current===null){let o;e[0]!==t?(o=t(),e[0]=t,e[1]=o):o=e[1],n.current=o}return n}const vW="short",xW=6,Lo=1,DC=5,bW=16,wW=60,SW=800,TC="f",kC=["select","actions"],CW=/^[\w.-]+\.[a-z]{2,}(\/\S*)?$/i,EW=/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}.*)?$/,_W=new Set(["true","1","yes","checked"]),MW=new Set(["true","false","1","0","yes","no","checked","unchecked"]);function xo(t,e){const n=be.c(3);let o;n[0]!==e||n[1]!==t?(o=()=>e(t.getState()),n[0]=e,n[1]=t,n[2]=o):o=n[2];const a=o;return x.useSyncExternalStore(t.subscribe,a,a)}function NW({data:t,columns:e,rowHeight:n=vW,overscan:o=xW,dir:a,initialState:i,...l}){const u=Df(a),d=x.useRef(null),f=x.useRef(null),g=x.useRef(null),m=x.useRef(null),p=x.useRef(new Map),v=x.useRef(new Map),S=x.useRef(null),C=x.useRef(!1),w=lu({...l,data:t,columns:e,initialState:i}),M=Sp(()=>new Set),R=Sp(()=>({sorting:i?.sorting??[],columnFilters:i?.columnFilters??[],rowHeight:n,rowSelection:i?.rowSelection??{},selectionState:{selectedCells:new Set,selectionRange:null,isSelecting:!1},focusedCell:null,editingCell:null,cutCells:new Set,contextMenu:{open:!1,x:0,y:0},searchQuery:"",searchMatches:[],matchIndex:-1,searchOpen:!1,lastClickedRowIndex:null,pasteDialog:{open:!1,rowsNeeded:0,clipboardText:""}})),E=x.useMemo(()=>{let Q=!1,ne=!1;return{subscribe:le=>(M.current.add(le),()=>M.current.delete(le)),getState:()=>R.current,setState:(le,ye)=>{Object.is(R.current[le],ye)||(R.current[le]=ye,Q?ne=!0:ne||(ne=!0,queueMicrotask(()=>{ne=!1,E.notify()})))},notify:()=>{for(const le of M.current)le()},batch:le=>{if(Q){le();return}Q=!0;const ye=ne;ne=!1;try{le()}finally{Q=!1,(ne||ye)&&(ne=!1,E.notify())}}}},[M,R]),N=xo(E,Q=>Q.focusedCell),D=xo(E,Q=>Q.editingCell),T=xo(E,Q=>Q.selectionState),k=xo(E,Q=>Q.searchQuery),A=xo(E,Q=>Q.searchMatches),B=xo(E,Q=>Q.matchIndex),W=xo(E,Q=>Q.searchOpen),U=xo(E,Q=>Q.sorting),Y=xo(E,Q=>Q.columnFilters),Z=xo(E,Q=>Q.rowSelection),I=xo(E,Q=>Q.rowHeight),G=xo(E,Q=>Q.contextMenu),j=xo(E,Q=>Q.pasteDialog),L=r0(I),$=Sp(()=>new Map),H=x.useMemo(()=>{const Q=T.selectedCells;if(Q.size===0)return $.current.clear(),null;const ne=new Map;for(const ye of Q){const{rowIndex:we}=Ho(ye);let Ne=ne.get(we);Ne||(Ne=new Set,ne.set(we,Ne)),Ne.add(ye)}const le=new Map;for(const[ye,we]of ne){const Ne=$.current.get(ye);Ne&&Ne.size===we.size&&[...we].every(Pe=>Ne.has(Pe))?le.set(ye,Ne):le.set(ye,we)}return $.current=le,le},[T.selectedCells,$]),X=x.useRef(null),P=x.useCallback(Q=>{const ne=f.current?.getRowModel().rows;if(ne){if(X.current?.rows!==ne){const le=new Map;for(const[ye,we]of ne.entries())le.set(we.id,ye+1);X.current={rows:ne,map:le}}return X.current.map.get(Q)}},[]),z=x.useMemo(()=>e.map(Q=>{if(Q.id)return Q.id;if("accessorKey"in Q)return Q.accessorKey}).filter(Q=>!!Q),[e]),V=x.useMemo(()=>z.filter(Q=>!kC.includes(Q)),[z]),q=x.useCallback(Q=>{if(w.current.readOnly)return;const ne=Array.isArray(Q)?Q:[Q];if(ne.length===0)return;const le=f.current,ye=w.current.data,we=le?.getRowModel().rows,Ne=new Map;for(const Se of ne)if(!we||!le){const Re=Ne.get(Se.rowIndex)??[];Re.push({columnId:Se.columnId,value:Se.value}),Ne.set(Se.rowIndex,Re)}else{const Re=we[Se.rowIndex];if(!Re)continue;const ke=Re.original,Ae=ye.indexOf(ke),xe=Ae!==-1?Ae:Se.rowIndex,Oe=Ne.get(xe)??[];Oe.push({columnId:Se.columnId,value:Se.value}),Ne.set(xe,Oe)}const Pe=we?.length??ye.length,je=new Array(Pe);for(let Se=0;Se<Pe;Se++){const Re=Ne.get(Se),ke=ye[Se],Ae=we?.[Se];if(Re){const Oe={...ke??Ae?.original??{}};for(const{columnId:ot,value:Ct}of Re)Oe[ot]=Ct;je[Se]=Oe}else je[Se]=ke??Ae?.original??{}}w.current.onDataChange?.(je)},[w]),J=x.useCallback((Q,ne)=>E.getState().selectionState.selectedCells.has(tn(Q,ne)),[E]),oe=x.useCallback(()=>{E.batch(()=>{E.setState("selectionState",{selectedCells:new Set,selectionRange:null,isSelecting:!1}),E.setState("rowSelection",{})})},[E]),K=x.useCallback(()=>{const Q=new Set,ye=(f.current?.getRowModel().rows??[]).length??w.current.data.length;for(let Pe=0;Pe<ye;Pe++)for(const je of z)Q.add(tn(Pe,je));const we=z[0],Ne=z[z.length-1];E.setState("selectionState",{selectedCells:Q,selectionRange:z.length>0&&ye>0&&we&&Ne?{start:{rowIndex:0,columnId:we},end:{rowIndex:ye-1,columnId:Ne}}:null,isSelecting:!1})},[z,w,E]),ee=x.useCallback(Q=>{const ye=(f.current?.getRowModel().rows??[]).length??w.current.data.length;if(ye===0)return;const we=new Set;for(let Ne=0;Ne<ye;Ne++)we.add(tn(Ne,Q));E.setState("selectionState",{selectedCells:we,selectionRange:{start:{rowIndex:0,columnId:Q},end:{rowIndex:ye-1,columnId:Q}},isSelecting:!1})},[w,E]),ae=x.useCallback((Q,ne,le=!1)=>{const ye=z.indexOf(Q.columnId),we=z.indexOf(ne.columnId),Ne=Math.min(Q.rowIndex,ne.rowIndex),Pe=Math.max(Q.rowIndex,ne.rowIndex),je=Math.min(ye,we),Se=Math.max(ye,we),Re=new Set;for(let ke=Ne;ke<=Pe;ke++)for(let Ae=je;Ae<=Se;Ae++){const xe=z[Ae];xe&&Re.add(tn(ke,xe))}E.setState("selectionState",{selectedCells:Re,selectionRange:{start:Q,end:ne},isSelecting:le})},[z,E]),ce=x.useCallback(async()=>{const Q=E.getState();let ne;if(Q.selectionState.selectedCells.size)ne=Array.from(Q.selectionState.selectedCells);else{if(!Q.focusedCell)return;ne=[tn(Q.focusedCell.rowIndex,Q.focusedCell.columnId)]}const ye=f.current?.getRowModel().rows;if(!ye)return;const we=[];for(const xe of ne){const{columnId:Oe}=Ho(xe);Oe&&!we.includes(Oe)&&we.push(Oe)}const Ne=new Map;for(const xe of ne){const{rowIndex:Oe,columnId:ot}=Ho(xe),Ct=ye[Oe];if(Ct){const Mt=Ct.getVisibleCells().find(ct=>ct.column.id===ot);if(Mt){const ct=Mt.getValue(),It=Mt.column.columnDef?.meta?.cell?.variant;let rt="";It==="file"||It==="multi-select"?rt=ct?JSON.stringify(ct):"":ct instanceof Date?rt=ct.toISOString():rt=String(ct??""),Ne.set(xe,rt)}}}const Pe=new Set,je=new Set;for(const xe of ne){const{rowIndex:Oe,columnId:ot}=Ho(xe);Pe.add(Oe);const Ct=we.indexOf(ot);Ct>=0&&je.add(Ct)}const Se=Array.from(Pe).sort((xe,Oe)=>xe-Oe),ke=Array.from(je).sort((xe,Oe)=>xe-Oe).map(xe=>we[xe]),Ae=Se.map(xe=>ke.map(Oe=>{const ot=`${xe}:${Oe}`;return Ne.get(ot)??""}).join(" ")).join(`
|
|
68
|
-
`);try{await navigator.clipboard.writeText(Ae),E.getState().cutCells.size>0&&E.setState("cutCells",new Set),hn.success(`${ne.length} cell${ne.length!==1?"s":""} copied`)}catch(xe){hn.error(xe instanceof Error?xe.message:"Failed to copy to clipboard")}},[E]),ge=x.useCallback(async()=>{if(w.current.readOnly)return;const Q=E.getState();let ne;if(Q.selectionState.selectedCells.size)ne=Array.from(Q.selectionState.selectedCells);else{if(!Q.focusedCell)return;ne=[tn(Q.focusedCell.rowIndex,Q.focusedCell.columnId)]}const ye=f.current?.getRowModel().rows;if(!ye)return;const we=[];for(const xe of ne){const{columnId:Oe}=Ho(xe);Oe&&!we.includes(Oe)&&we.push(Oe)}const Ne=new Map;for(const xe of ne){const{rowIndex:Oe,columnId:ot}=Ho(xe),Ct=ye[Oe];if(Ct){const Mt=Ct.getVisibleCells().find(ct=>ct.column.id===ot);if(Mt){const ct=Mt.getValue(),It=Mt.column.columnDef?.meta?.cell?.variant;let rt="";It==="file"||It==="multi-select"?rt=ct?JSON.stringify(ct):"":ct instanceof Date?rt=ct.toISOString():rt=String(ct??""),Ne.set(xe,rt)}}}const Pe=new Set,je=new Set;for(const xe of ne){const{rowIndex:Oe,columnId:ot}=Ho(xe);Pe.add(Oe);const Ct=we.indexOf(ot);Ct>=0&&je.add(Ct)}const Se=Array.from(Pe).sort((xe,Oe)=>xe-Oe),ke=Array.from(je).sort((xe,Oe)=>xe-Oe).map(xe=>we[xe]),Ae=Se.map(xe=>ke.map(Oe=>{const ot=`${xe}:${Oe}`;return Ne.get(ot)??""}).join(" ")).join(`
|
|
69
|
-
`);try{await navigator.clipboard.writeText(Ae),E.setState("cutCells",new Set(ne)),hn.success(`${ne.length} cell${ne.length!==1?"s":""} cut`)}catch(xe){hn.error(xe instanceof Error?xe.message:"Failed to cut to clipboard")}},[E,w]),se=x.useCallback(Q=>{Q&&document.activeElement!==Q&&requestAnimationFrame(()=>{Q.focus()})},[]),ve=x.useCallback(async(Q=!1)=>{if(w.current.readOnly)return;const ne=E.getState();if(!ne.focusedCell)return;const le=f.current,ye=le?.getRowModel().rows;if(ye)try{let we=ne.pasteDialog.clipboardText;if(!we&&(we=await navigator.clipboard.readText(),!we))return;const Pe=we.split(`
|
|
70
|
-
`).filter(Pt=>Pt.length>0).map(Pt=>Pt.split(" ")),je=ne.focusedCell.rowIndex,Se=V.indexOf(ne.focusedCell.columnId);if(Se===-1)return;const Re=ye.length??w.current.data.length,ke=je+Pe.length-Re;if(ke>0&&!Q&&w.current.onRowAdd&&!ne.pasteDialog.clipboardText){E.setState("pasteDialog",{open:!0,rowsNeeded:ke,clipboardText:we});return}if(Q&&ke>0){const Pt=Re+ke;if(w.current.onRowsAdd)await w.current.onRowsAdd(ke);else if(w.current.onRowAdd)for(let Qt=0;Qt<ke;Qt++)await w.current.onRowAdd();let Yn=0;const kn=50;let $n=f.current?.getRowModel().rows.length??0;for(;$n<Pt&&Yn<kn;)await new Promise(Qt=>setTimeout(Qt,100)),$n=f.current?.getRowModel().rows.length??0,Yn++}const Ae=[],xe=le?.getAllColumns()??[];let Oe=0,ot=je,Ct=Se;const It=f.current?.getRowModel().rows?.length??0;let rt=0;const mt=new Map(xe.map(Pt=>[Pt.id,Pt]));for(let Pt=0;Pt<Pe.length;Pt++){const Yn=Pe[Pt];if(!Yn)continue;const kn=je+Pt;if(kn>=It)break;for(let $n=0;$n<Yn.length;$n++){const Qt=Se+$n;if(Qt>=V.length)break;const kr=V[Qt];if(!kr)continue;const Ze=Yn[$n]??"",ir=mt.get(kr)?.columnDef?.meta?.cell,as=ir?.variant;let At=Ze,Jn=!1;switch(as){case"number":{if(!Ze)At=null;else{const Xt=Number.parseFloat(Ze);Number.isNaN(Xt)?Jn=!0:At=Xt}break}case"checkbox":{if(!Ze)At=!1;else{const Xt=Ze.toLowerCase();MW.has(Xt)?At=_W.has(Xt):Jn=!0}break}case"date":{if(!Ze)At=null;else{const Xt=new Date(Ze);Number.isNaN(Xt.getTime())?Jn=!0:At=Xt}break}case"select":{const Xt=ir?.options??[];if(!Ze)At="";else{const Nt=KS(Ze,Xt);Nt?At=Nt:Jn=!0}break}case"multi-select":{const Xt=ir?.options??[];let Nt=[];try{const Or=JSON.parse(Ze);Array.isArray(Or)&&(Nt=Or.filter(hu=>typeof hu=="string"))}catch{Nt=Ze?Ze.split(",").map(Or=>Or.trim()):[]}const ha=Nt.map(Or=>KS(Or,Xt)).filter(Boolean);Nt.length>0&&ha.length===0?Jn=!0:At=ha;break}case"file":{if(!Ze)At=[];else try{const Xt=JSON.parse(Ze);if(!Array.isArray(Xt))Jn=!0;else{const Nt=Xt.filter(WS);Xt.length>0&&Nt.length===0?Jn=!0:At=Nt}}catch{Jn=!0}break}case"url":{if(!Ze)At="";else{const Xt=Ze[0];if(Xt==="["||Xt==="{")Jn=!0;else try{new URL(Ze),At=Ze}catch{CW.test(Ze)?At=Ze:Jn=!0}}break}default:{if(!Ze){At="";break}if(EW.test(Ze)){const Nt=new Date(Ze);if(!Number.isNaN(Nt.getTime())){At=Nt.toLocaleDateString();break}}const Xt=Ze[0];if(Xt==="["||Xt==="{"||Xt==="t"||Xt==="f")try{const Nt=JSON.parse(Ze);Array.isArray(Nt)?Nt.length>0&&Nt.every(WS)?At=Nt.map(ha=>ha.name).join(", "):Nt.every(ha=>typeof ha=="string")&&(At=Nt.join(", ")):typeof Nt=="boolean"&&(At=Nt?"Checked":"Unchecked")}catch{const Nt=Ze.toLowerCase();(Nt==="true"||Nt==="false")&&(At=Nt==="true"?"Checked":"Unchecked")}}}if(Jn){rt++,ot=Math.max(ot,kn),Ct=Math.max(Ct,Qt);continue}Ae.push({rowIndex:kn,columnId:kr,value:At}),Oe++,ot=Math.max(ot,kn),Ct=Math.max(Ct,Qt)}}if(Ae.length>0){w.current.onPaste&&await w.current.onPaste(Ae);const Pt=[...Ae];if(ne.cutCells.size>0){for(const kn of ne.cutCells){const{rowIndex:$n,columnId:Qt}=Ho(kn),Ze=xe.find(ir=>ir.id===Qt)?.columnDef?.meta?.cell?.variant;let uo="";Ze==="multi-select"||Ze==="file"?uo=[]:Ze==="number"||Ze==="date"?uo=null:Ze==="checkbox"&&(uo=!1),Pt.push({rowIndex:$n,columnId:Qt,value:uo})}E.setState("cutCells",new Set)}q(Pt),rt>0?hn.success(`${Oe} cell${Oe!==1?"s":""} pasted, ${rt} skipped`):hn.success(`${Oe} cell${Oe!==1?"s":""} pasted`);const Yn=V[Ct];Yn&&ae({rowIndex:je,columnId:ne.focusedCell.columnId},{rowIndex:ot,columnId:Yn}),se(d.current)}else rt>0&&hn.error(`${rt} cell${rt!==1?"s":""} skipped pasting for invalid data`);ne.pasteDialog.open&&E.setState("pasteDialog",{open:!1,rowsNeeded:0,clipboardText:""})}catch(we){hn.error(we instanceof Error?we.message:"Failed to paste. Please try again.")}},[E,V,w,q,ae,se]),De=x.useCallback((Q=!1)=>{if(Q){C.current=!1;return}setTimeout(()=>{C.current=!1},300)},[]),Be=x.useCallback((Q,ne)=>{C.current=!0,requestAnimationFrame(()=>{const le=tn(Q,ne),ye=v.current.get(le);if(!ye){const we=d.current;we&&we.focus(),De();return}ye.focus(),De()})},[De]),Ie=x.useCallback((Q,ne)=>{E.batch(()=>{E.setState("focusedCell",{rowIndex:Q,columnId:ne}),E.setState("editingCell",null)}),!E.getState().searchOpen&&Be(Q,ne)},[E,Be]),lt=x.useCallback(async Q=>{if(w.current.readOnly||!w.current.onRowsDelete||Q.length===0)return;const le=f.current?.getRowModel().rows;if(!le||le.length===0)return;const we=E.getState().focusedCell?.columnId??V[0],Ne=Math.min(...Q),Pe=[];for(const je of Q){const Se=le[je];Se&&Pe.push(Se.original)}await w.current.onRowsDelete(Pe,Q),E.batch(()=>{E.setState("selectionState",{selectedCells:new Set,selectionRange:null,isSelecting:!1}),E.setState("rowSelection",{}),E.setState("editingCell",null)}),requestAnimationFrame(()=>{const Re=(f.current?.getRowModel().rows??[]).length??w.current.data.length;if(Re>0&&we){const ke=Math.min(Ne,Re-1);Ie(ke,we)}})},[w,E,V,Ie]),ln=x.useCallback(Q=>{const ne=E.getState();if(!ne.focusedCell)return;const{rowIndex:le,columnId:ye}=ne.focusedCell,we=V.indexOf(ye),Ne=g.current,Se=(f.current?.getRowModel().rows??[]).length??w.current.data.length;let Re=le,ke=ye;const Ae=u==="rtl";switch(Q){case"up":Re=Math.max(0,le-1);break;case"down":Re=Math.min(Se-1,le+1);break;case"left":if(Ae){if(we<V.length-1){const xe=V[we+1];xe&&(ke=xe)}}else if(we>0){const xe=V[we-1];xe&&(ke=xe)}break;case"right":if(Ae){if(we>0){const xe=V[we-1];xe&&(ke=xe)}}else if(we<V.length-1){const xe=V[we+1];xe&&(ke=xe)}break;case"home":V.length>0&&(ke=V[0]??ye);break;case"end":V.length>0&&(ke=V[V.length-1]??ye);break;case"ctrl+home":Re=0,V.length>0&&(ke=V[0]??ye);break;case"ctrl+end":Re=Math.max(0,Se-1),V.length>0&&(ke=V[V.length-1]??ye);break;case"ctrl+up":Re=0;break;case"ctrl+down":Re=Math.max(0,Se-1);break;case"pageup":if(Ne){const Oe=Ne.getVirtualItems().length??10;Re=Math.max(0,le-Oe)}else Re=Math.max(0,le-10);break;case"pagedown":if(Ne){const Oe=Ne.getVirtualItems().length??10;Re=Math.min(Se-1,le+Oe)}else Re=Math.min(Se-1,le+10);break;case"pageleft":if(we>0){const xe=Math.max(0,we-DC),Oe=V[xe];Oe&&(ke=Oe)}break;case"pageright":if(we<V.length-1){const xe=Math.min(V.length-1,we+DC),Oe=V[xe];Oe&&(ke=Oe)}break}if(Re!==le||ke!==ye){Ie(Re,ke);const xe=d.current;if(!xe)return;const Oe=p.current.get(Re),ot=tn(Re,ke),Ct=v.current.get(ot);if(!Oe){if(Ne){const Mt=Q==="up"||Q==="pageup"||Q==="ctrl+up"||Q==="ctrl+home"?"start":Q==="down"||Q==="pagedown"||Q==="ctrl+down"||Q==="ctrl+end"?"end":"center";Ne.scrollToIndex(Re,{align:Mt}),ke!==ye&&requestAnimationFrame(()=>{const ct=tn(Re,ke),It=v.current.get(ct);if(It){const rt=XS(Q);_i({container:xe,targetCell:It,tableRef:f,viewportOffset:Lo,direction:rt,isRtl:u==="rtl"})}})}else{const Mt=r0(I),ct=Re*Mt;xe.scrollTop=ct}return}Re!==le&&Oe&&requestAnimationFrame(()=>{const Mt=xe.getBoundingClientRect(),ct=m.current?.getBoundingClientRect().height??0,It=S.current?.getBoundingClientRect().height??0,rt=Mt.top+ct+Lo,mt=Mt.bottom-It-Lo,Pt=Oe.getBoundingClientRect();Pt.top>=rt&&Pt.bottom<=mt||(Q==="up"||Q==="down"||Q==="pageup"||Q==="pagedown"||Q==="ctrl+up"||Q==="ctrl+down"||Q==="ctrl+home"||Q==="ctrl+end")&&(Q==="down"||Q==="pagedown"||Q==="ctrl+down"||Q==="ctrl+end"?xe.scrollTop+=Pt.bottom-mt:xe.scrollTop-=rt-Pt.top)}),ke!==ye&&Ct&&requestAnimationFrame(()=>{const Mt=XS(Q);_i({container:xe,targetCell:Ct,tableRef:f,viewportOffset:Lo,direction:Mt,isRtl:u==="rtl"})})}},[u,E,V,Ie,w,I]),ht=x.useCallback((Q,ne)=>{w.current.readOnly||E.batch(()=>{E.setState("focusedCell",{rowIndex:Q,columnId:ne}),E.setState("editingCell",{rowIndex:Q,columnId:ne})})},[E,w]),bn=x.useCallback(Q=>{const le=E.getState().editingCell;if(E.setState("editingCell",null),Q?.moveToNextRow&&le){const{rowIndex:ye,columnId:we}=le,je=(f.current?.getRowModel().rows??[]).length??w.current.data.length,Se=ye+1;Se<je&&requestAnimationFrame(()=>{Ie(Se,we)})}else if(Q?.direction&&le){const{rowIndex:ye,columnId:we}=le;Ie(ye,we),requestAnimationFrame(()=>{ln(Q.direction??"right")})}else if(le){const{rowIndex:ye,columnId:we}=le;Be(ye,we)}},[E,w,Ie,ln,Be]),cn=x.useCallback(Q=>{if(Q){E.setState("searchOpen",!0);return}const ne=E.getState(),le=ne.matchIndex>=0&&ne.searchMatches[ne.matchIndex];E.batch(()=>{E.setState("searchOpen",!1),E.setState("searchQuery",""),E.setState("searchMatches",[]),E.setState("matchIndex",-1),le&&E.setState("focusedCell",{rowIndex:le.rowIndex,columnId:le.columnId})}),d.current&&document.activeElement!==d.current&&d.current.focus()},[E]),Vt=x.useCallback(Q=>{if(!Q.trim()){E.batch(()=>{E.setState("searchMatches",[]),E.setState("matchIndex",-1)});return}const ne=[],ye=f.current?.getRowModel().rows??[],we=Q.toLowerCase();for(let Ne=0;Ne<ye.length;Ne++){const Pe=ye[Ne];if(Pe)for(const je of z){const Se=Pe.getVisibleCells().find(Ae=>Ae.column.id===je);if(!Se)continue;const Re=Se.getValue();String(Re??"").toLowerCase().includes(we)&&ne.push({rowIndex:Ne,columnId:je})}}if(E.batch(()=>{E.setState("searchMatches",ne),E.setState("matchIndex",ne.length>0?0:-1)}),ne.length>0&&ne[0]){const Ne=ne[0];g.current?.scrollToIndex(Ne.rowIndex,{align:"center"})}},[z,E]),mn=x.useCallback(Q=>E.setState("searchQuery",Q),[E]),zt=x.useCallback(()=>{const Q=E.getState();if(Q.searchMatches.length===0)return;const ne=Q.matchIndex-1<0?Q.searchMatches.length-1:Q.matchIndex-1,le=Q.searchMatches[ne];le&&(g.current?.scrollToIndex(le.rowIndex,{align:"center"}),requestAnimationFrame(()=>{E.setState("matchIndex",ne),requestAnimationFrame(()=>{Ie(le.rowIndex,le.columnId)})}))},[E,Ie]),Nn=x.useCallback(()=>{const Q=E.getState();if(Q.searchMatches.length===0)return;const ne=(Q.matchIndex+1)%Q.searchMatches.length,le=Q.searchMatches[ne];le&&(g.current?.scrollToIndex(le.rowIndex,{align:"center"}),requestAnimationFrame(()=>{E.setState("matchIndex",ne),requestAnimationFrame(()=>{Ie(le.rowIndex,le.columnId)})}))},[E,Ie]),yn=x.useCallback((Q,ne)=>E.getState().searchMatches.some(ye=>ye.rowIndex===Q&&ye.columnId===ne),[E]),In=x.useCallback((Q,ne)=>{const le=E.getState();if(le.matchIndex<0)return!1;const ye=le.searchMatches[le.matchIndex];return ye?.rowIndex===Q&&ye?.columnId===ne},[E]),jn=x.useMemo(()=>{if(A.length===0)return null;const Q=new Map;for(const ne of A){let le=Q.get(ne.rowIndex);le||(le=new Set,Q.set(ne.rowIndex,le)),le.add(ne.columnId)}return Q},[A]),_e=x.useMemo(()=>B<0||A.length===0?null:A[B]??null,[A,B]),Ue=x.useCallback(()=>{E.getState().editingCell&&document.activeElement instanceof HTMLElement&&document.activeElement.blur(),E.batch(()=>{E.setState("focusedCell",null),E.setState("editingCell",null)})},[E]),Et=x.useCallback((Q,ne,le)=>{if(le?.button===2)return;const ye=E.getState(),we=ye.focusedCell;function Ne(){requestAnimationFrame(()=>{const Se=d.current,Re=tn(Q,ne),ke=v.current.get(Re);Se&&ke&&_i({container:Se,targetCell:ke,tableRef:f,viewportOffset:Lo,isRtl:u==="rtl"})})}if(le){if(le.ctrlKey||le.metaKey){le.preventDefault();const Se=tn(Q,ne),Re=new Set(ye.selectionState.selectedCells);Re.has(Se)?Re.delete(Se):Re.add(Se),E.setState("selectionState",{selectedCells:Re,selectionRange:null,isSelecting:!1}),Ie(Q,ne),Ne();return}if(le.shiftKey&&ye.focusedCell){le.preventDefault(),ae(ye.focusedCell,{rowIndex:Q,columnId:ne}),Ne();return}}const Pe=ye.selectionState.selectedCells.size>0,je=Object.keys(ye.rowSelection).length>0;if(Pe&&!ye.selectionState.isSelecting){const Se=tn(Q,ne);if(!ye.selectionState.selectedCells.has(Se))oe();else{Ie(Q,ne),Ne();return}}else je&&ne!=="select"&&oe();we?.rowIndex===Q&&we?.columnId===ne?ht(Q,ne):(Ie(Q,ne),Ne())},[E,Ie,ht,ae,oe,u]),Xe=x.useCallback((Q,ne,le)=>{le?.defaultPrevented||ht(Q,ne)},[ht]),at=x.useCallback((Q,ne,le)=>{if(le.button!==2&&(le.preventDefault(),!le.ctrlKey&&!le.metaKey&&!le.shiftKey)){const ye=tn(Q,ne);E.batch(()=>{E.setState("selectionState",{selectedCells:w.current.enableSingleCellSelection?new Set([ye]):new Set,selectionRange:{start:{rowIndex:Q,columnId:ne},end:{rowIndex:Q,columnId:ne}},isSelecting:!0}),E.setState("rowSelection",{})})}},[E,w]),gt=x.useCallback((Q,ne)=>{const le=E.getState();if(le.selectionState.isSelecting&&le.selectionState.selectionRange){const ye=le.selectionState.selectionRange.start,we={rowIndex:Q,columnId:ne};(le.focusedCell?.rowIndex!==ye.rowIndex||le.focusedCell?.columnId!==ye.columnId)&&Ie(ye.rowIndex,ye.columnId),ae(ye,we,!0)}},[E,ae,Ie]),qt=x.useCallback(()=>{const Q=E.getState();E.setState("selectionState",{...Q.selectionState,isSelecting:!1})},[E]),Wt=x.useCallback((Q,ne,le)=>{le.preventDefault(),le.stopPropagation();const ye=E.getState(),we=tn(Q,ne);ye.selectionState.selectedCells.has(we)||E.batch(()=>{E.setState("selectionState",{selectedCells:new Set([we]),selectionRange:{start:{rowIndex:Q,columnId:ne},end:{rowIndex:Q,columnId:ne}},isSelecting:!1}),E.setState("focusedCell",{rowIndex:Q,columnId:ne})}),E.setState("contextMenu",{open:!0,x:le.clientX,y:le.clientY})},[E]),Qn=x.useCallback(Q=>{if(!Q){const ne=E.getState().contextMenu;E.setState("contextMenu",{open:!1,x:ne.x,y:ne.y})}},[E]),_t=x.useCallback(Q=>{const ne=E.getState(),le=typeof Q=="function"?Q(ne.sorting):Q;E.setState("sorting",le),w.current.onSortingChange?.(le)},[E,w]),Ve=x.useCallback(Q=>{const ne=E.getState(),le=typeof Q=="function"?Q(ne.columnFilters):Q;E.setState("columnFilters",le),w.current.onColumnFiltersChange?.(le)},[E,w]),nt=x.useCallback(Q=>{const ne=E.getState(),le=typeof Q=="function"?Q(ne.rowSelection):Q,ye=Object.keys(le).filter(Pe=>le[Pe]),we=new Set,Ne=f.current?.getRowModel().rows??[];for(const Pe of ye){const je=Ne.findIndex(Se=>Se.id===Pe);if(je!==-1)for(const Se of z)we.add(tn(je,Se))}E.batch(()=>{E.setState("rowSelection",le),E.setState("selectionState",{selectedCells:we,selectionRange:null,isSelecting:!1}),E.setState("focusedCell",null),E.setState("editingCell",null)})},[E,z]),Ye=x.useCallback((Q,ne,le)=>{const ye=E.getState(),we=f.current?.getRowModel().rows??[],Ne=we[Q];if(Ne){if(le&&ye.lastClickedRowIndex!==null){const Pe=Math.min(ye.lastClickedRowIndex,Q),je=Math.max(ye.lastClickedRowIndex,Q),Se={...ye.rowSelection};for(let Re=Pe;Re<=je;Re++){const ke=we[Re];ke&&(Se[ke.id]=ne)}nt(Se)}else nt({...ye.rowSelection,[Ne.id]:ne});E.setState("lastClickedRowIndex",Q)}},[E,nt]),st=x.useCallback(Q=>{const ne=E.getState(),le=typeof Q=="function"?Q(ne.rowHeight):Q;E.setState("rowHeight",le),w.current.onRowHeightChange?.(le)},[E,w]),$t=x.useCallback(Q=>{if(!w.current.enableColumnSelection){oe();return}ee(Q)},[w,ee,oe]),Te=x.useCallback(Q=>{Q||E.setState("pasteDialog",{open:!1,rowsNeeded:0,clipboardText:""})},[E]),Ot=x.useMemo(()=>({minSize:wW,maxSize:SW}),[]),Kt=x.useMemo(()=>({...w.current.meta,dataGridRef:d,cellMapRef:v,get focusedCell(){return E.getState().focusedCell},get editingCell(){return E.getState().editingCell},get selectionState(){return E.getState().selectionState},get searchOpen(){return E.getState().searchOpen},get contextMenu(){return E.getState().contextMenu},get pasteDialog(){return E.getState().pasteDialog},get rowHeight(){return E.getState().rowHeight},get readOnly(){return w.current.readOnly},getIsCellSelected:J,getIsSearchMatch:yn,getIsActiveSearchMatch:In,getVisualRowIndex:P,onRowHeightChange:st,onRowSelect:Ye,onDataUpdate:q,onRowsDelete:w.current.onRowsDelete?lt:void 0,onColumnClick:$t,onCellClick:Et,onCellDoubleClick:Xe,onCellMouseDown:at,onCellMouseEnter:gt,onCellMouseUp:qt,onCellContextMenu:Wt,onCellEditingStart:ht,onCellEditingStop:bn,onCellsCopy:ce,onCellsCut:ge,onCellsPaste:ve,onSelectionClear:oe,onFilesUpload:w.current.onFilesUpload?w.current.onFilesUpload:void 0,onFilesDelete:w.current.onFilesDelete?w.current.onFilesDelete:void 0,onContextMenuOpenChange:Qn,onPasteDialogOpenChange:Te}),[w,E,J,yn,In,P,st,Ye,q,lt,$t,Et,Xe,at,gt,qt,Wt,ht,bn,ce,ge,ve,oe,Qn,Te]),un=x.useMemo(()=>Jq(),[]),Pn=x.useMemo(()=>oW(),[]),Dt=x.useMemo(()=>rW(),[]),Rn=x.useMemo(()=>({...w.current.state,sorting:U,columnFilters:Y,rowSelection:Z}),[w,U,Y,Z]),Uo=x.useMemo(()=>({...w.current,data:t,columns:e,defaultColumn:Ot,initialState:w.current.initialState,state:Rn,onRowSelectionChange:nt,onSortingChange:_t,onColumnFiltersChange:Ve,columnResizeMode:"onChange",columnResizeDirection:u,getCoreRowModel:un,getFilteredRowModel:Pn,getSortedRowModel:Dt,meta:Kt}),[w,t,e,Ot,Rn,u,nt,_t,Ve,un,Pn,Dt,Kt]),vt=aW(Uo);f.current||(f.current=vt);const Dn=x.useMemo(()=>{const Q=vt.getFlatHeaders(),ne={};for(const le of Q)ne[`--header-${le.id}-size`]=le.getSize(),ne[`--col-${le.column.id}-size`]=le.column.getSize();return ne},[vt.getState().columnSizingInfo,vt.getState().columnSizing]),Do=x.useSyncExternalStore(x.useCallback(()=>()=>{},[]),x.useCallback(()=>typeof window>"u"||typeof navigator>"u"?!1:navigator.userAgent.indexOf("Firefox")!==-1,[]),x.useCallback(()=>!1,[])),Un=x.useMemo(()=>{const Q=vt.getState().columnPinning;return Do&&((Q.left?.length??0)>0||(Q.right?.length??0)>0)},[Do,vt.getState().columnPinning]),lo=yW({count:vt.getRowModel().rows.length,getScrollElement:()=>d.current,estimateSize:()=>L,overscan:o,measureElement:Do?void 0:Q=>Q?.getBoundingClientRect().height});g.current||(g.current=lo);const Dr=x.useCallback(async Q=>{const ne=Q?.rowIndex??0,le=Q?.columnId;C.current=!0;const ye=w.current.columns.map(Pe=>{if(Pe.id)return Pe.id;if("accessorKey"in Pe)return Pe.accessorKey}).filter(Pe=>!!Pe).filter(Pe=>!kC.includes(Pe)),we=le??ye[0];if(!we){De(!0);return}async function Ne(Pe){if(!we)return;const je=w.current.data.length;if(ne>=je&&Pe>0){await new Promise(ot=>setTimeout(ot,50)),await Ne(Pe-1);return}const Se=Math.min(ne,Math.max(0,je-1)),Re=Se>je/2;lo.scrollToIndex(Se,{align:Re?"end":"start"}),await new Promise(ot=>requestAnimationFrame(ot));const ke=d.current,Ae=p.current.get(Se);if(ke&&Ae){const ot=ke.getBoundingClientRect(),Ct=m.current?.getBoundingClientRect().height??0,Mt=S.current?.getBoundingClientRect().height??0,ct=ot.top+Ct+Lo,It=ot.bottom-Mt-Lo,rt=Ae.getBoundingClientRect();rt.top>=ct&&rt.bottom<=It||(rt.top<ct?ke.scrollTop-=ct-rt.top:rt.bottom>It&&(ke.scrollTop+=rt.bottom-It))}E.batch(()=>{E.setState("focusedCell",{rowIndex:Se,columnId:we}),E.setState("editingCell",null)});const xe=tn(Se,we),Oe=v.current.get(xe);Oe?(Oe.focus(),De()):Pe>0?(await new Promise(ot=>requestAnimationFrame(ot)),await Ne(Pe-1)):(d.current?.focus(),De())}await Ne(bW)},[lo,w,E,De]),co=x.useCallback(async Q=>{if(w.current.readOnly||!w.current.onRowAdd)return;const ne=w.current.data.length;let le;try{le=await w.current.onRowAdd(Q)}catch{return}if(le===null||Q?.defaultPrevented)return;oe();const ye=le.rowIndex??ne,we=le.columnId;Dr({rowIndex:ye,columnId:we})},[w,Dr,oe]),dn=x.useCallback(Q=>{const ne=E.getState(),{key:le,ctrlKey:ye,metaKey:we,shiftKey:Ne,altKey:Pe}=Q,je=ye||we;if(w.current.enableSearch&&je&&!Ne&&le===TC){Q.preventDefault(),cn(!0);return}if(w.current.enableSearch&&ne.searchOpen&&!ne.editingCell){if(le==="Enter"){Q.preventDefault(),Ne?zt():Nn();return}if(le==="Escape"){Q.preventDefault(),cn(!1);return}return}if(ne.editingCell)return;if(je&&(le==="Backspace"||le==="Delete")&&!w.current.readOnly&&w.current.onRowsDelete){const Re=new Set;if(Object.keys(ne.rowSelection).length>0){const xe=f.current?.getRowModel().rows??[];for(const Oe of xe)ne.rowSelection[Oe.id]&&Re.add(Oe.index)}else if(ne.selectionState.selectedCells.size>0)for(const Ae of ne.selectionState.selectedCells){const{rowIndex:xe}=Ho(Ae);Re.add(xe)}else ne.focusedCell&&Re.add(ne.focusedCell.rowIndex);Re.size>0&&(Q.preventDefault(),lt(Array.from(Re)));return}if(!ne.focusedCell)return;let Se=null;if(je&&!Ne&&le==="a"){Q.preventDefault(),K();return}if(je&&!Ne&&le==="c"){Q.preventDefault(),ce();return}if(je&&!Ne&&le==="x"&&!w.current.readOnly){Q.preventDefault(),ge();return}if(w.current.enablePaste&&je&&!Ne&&le==="v"&&!w.current.readOnly){Q.preventDefault(),ve();return}if((le==="Delete"||le==="Backspace")&&!je&&!w.current.readOnly){const Re=ne.selectionState.selectedCells.size>0?Array.from(ne.selectionState.selectedCells):ne.focusedCell?[tn(ne.focusedCell.rowIndex,ne.focusedCell.columnId)]:[];if(Re.length>0){Q.preventDefault();const ke=[],xe=f.current?.getAllColumns()??[];for(const Oe of Re){const{rowIndex:ot,columnId:Ct}=Ho(Oe),ct=xe.find(rt=>rt.id===Ct)?.columnDef?.meta?.cell?.variant;let It="";ct==="multi-select"||ct==="file"?It=[]:ct==="number"||ct==="date"?It=null:ct==="checkbox"&&(It=!1),ke.push({rowIndex:ot,columnId:Ct,value:It})}q(ke),ne.selectionState.selectedCells.size>0&&oe(),ne.cutCells.size>0&&E.setState("cutCells",new Set)}return}if(le==="Enter"&&Ne&&!w.current.readOnly&&w.current.onRowAdd){Q.preventDefault();const Re=w.current.data.length,ke=ne.focusedCell.columnId;Promise.resolve(w.current.onRowAdd()).then(async Ae=>{if(Ae===null)return;oe();const xe=Ae.rowIndex??Re,Oe=Ae.columnId??ke;Dr({rowIndex:xe,columnId:Oe})}).catch(()=>{});return}switch(le){case"ArrowUp":if(Pe&&!je&&!Ne)Se="pageup";else if(je&&Ne){const Re=ne.selectionState.selectionRange?.end||ne.focusedCell,ke=V.indexOf(Re.columnId),Ae=ne.selectionState.selectionRange?.start||ne.focusedCell;ae(Ae,{rowIndex:0,columnId:V[ke]??Re.columnId});const xe=g.current;xe&&xe.scrollToIndex(0,{align:"start"}),se(d.current),Q.preventDefault();return}else je&&!Ne?Se="ctrl+up":Se="up";break;case"ArrowDown":if(Pe&&!je&&!Ne)Se="pagedown";else if(je&&Ne){const Re=f.current?.getRowModel().rows.length||w.current.data.length,ke=ne.selectionState.selectionRange?.end||ne.focusedCell,Ae=V.indexOf(ke.columnId),xe=ne.selectionState.selectionRange?.start||ne.focusedCell;ae(xe,{rowIndex:Math.max(0,Re-1),columnId:V[Ae]??ke.columnId});const Oe=g.current;Oe&&Oe.scrollToIndex(Math.max(0,Re-1),{align:"end"}),se(d.current),Q.preventDefault();return}else je&&!Ne?Se="ctrl+down":Se="down";break;case"ArrowLeft":if(je&&Ne){const Re=ne.selectionState.selectionRange?.end||ne.focusedCell,ke=ne.selectionState.selectionRange?.start||ne.focusedCell,Ae=u==="rtl"?V[V.length-1]:V[0];if(Ae){ae(ke,{rowIndex:Re.rowIndex,columnId:Ae});const xe=d.current,Oe=tn(Re.rowIndex,Ae),ot=v.current.get(Oe);xe&&ot&&_i({container:xe,targetCell:ot,tableRef:f,viewportOffset:Lo,direction:"home",isRtl:u==="rtl"}),se(xe)}Q.preventDefault();return}else je&&!Ne?Se="home":Se="left";break;case"ArrowRight":if(je&&Ne){const Re=ne.selectionState.selectionRange?.end||ne.focusedCell,ke=ne.selectionState.selectionRange?.start||ne.focusedCell,Ae=u==="rtl"?V[0]:V[V.length-1];if(Ae){ae(ke,{rowIndex:Re.rowIndex,columnId:Ae});const xe=d.current,Oe=tn(Re.rowIndex,Ae),ot=v.current.get(Oe);xe&&ot&&_i({container:xe,targetCell:ot,tableRef:f,viewportOffset:Lo,direction:"end",isRtl:u==="rtl"}),se(xe)}Q.preventDefault();return}else je&&!Ne?Se="end":Se="right";break;case"Home":Se=je?"ctrl+home":"home";break;case"End":Se=je?"ctrl+end":"end";break;case"PageUp":Se=Pe?"pageleft":"pageup";break;case"PageDown":Se=Pe?"pageright":"pagedown";break;case"Escape":Q.preventDefault(),ne.selectionState.selectedCells.size>0||Object.keys(ne.rowSelection).length>0?oe():Ue();return;case"Tab":Q.preventDefault(),u==="rtl"?Se=Q.shiftKey?"right":"left":Se=Q.shiftKey?"left":"right";break}if(Se)if(Q.preventDefault(),Ne&&le!=="Tab"&&ne.focusedCell){const Re=ne.selectionState.selectionRange?.end||ne.focusedCell,ke=V.indexOf(Re.columnId);let Ae=Re.rowIndex,xe=Re.columnId;const Oe=u==="rtl",ot=f.current?.getRowModel().rows.length||w.current.data.length;switch(Se){case"up":Ae=Math.max(0,Re.rowIndex-1);break;case"down":Ae=Math.min(ot-1,Re.rowIndex+1);break;case"left":if(Oe){if(ke<V.length-1){const mt=V[ke+1];mt&&(xe=mt)}}else if(ke>0){const mt=V[ke-1];mt&&(xe=mt)}break;case"right":if(Oe){if(ke>0){const mt=V[ke-1];mt&&(xe=mt)}}else if(ke<V.length-1){const mt=V[ke+1];mt&&(xe=mt)}break;case"home":V.length>0&&(xe=V[0]??xe);break;case"end":V.length>0&&(xe=V[V.length-1]??xe);break}const Ct=ne.selectionState.selectionRange?.start||ne.focusedCell;ae(Ct,{rowIndex:Ae,columnId:xe});const Mt=d.current,ct=p.current.get(Ae),It=tn(Ae,xe),rt=v.current.get(It);if(Ae!==Re.rowIndex&&(Se==="up"||Se==="down"))if(Mt&&ct){const mt=Mt.getBoundingClientRect(),Pt=m.current?.getBoundingClientRect().height??0,Yn=S.current?.getBoundingClientRect().height??0,kn=mt.top+Pt+Lo,$n=mt.bottom-Yn-Lo,Qt=ct.getBoundingClientRect();if(!(Qt.top>=kn&&Qt.bottom<=$n)){const Ze=Se==="down"?Qt.bottom-$n:kn-Qt.top;Se==="down"?Mt.scrollTop+=Ze:Mt.scrollTop-=Ze,se(Mt)}}else{const mt=g.current;if(mt){const Pt=Se==="up"?"start":"end";mt.scrollToIndex(Ae,{align:Pt}),se(Mt)}}xe!==Re.columnId&&(Se==="left"||Se==="right"||Se==="home"||Se==="end")&&Mt&&rt&&_i({container:Mt,targetCell:rt,tableRef:f,viewportOffset:Lo,direction:Se,isRtl:Oe})}else ne.selectionState.selectedCells.size>0&&oe(),ln(Se)},[u,E,w,Ue,ln,K,ce,ge,ve,q,oe,V,ae,cn,Nn,zt,lt,se,Dr]),Tn=x.useMemo(()=>{if(w.current.enableSearch)return{searchMatches:A,matchIndex:B,searchOpen:W,onSearchOpenChange:cn,searchQuery:k,onSearchQueryChange:mn,onSearch:Vt,onNavigateToNextMatch:Nn,onNavigateToPrevMatch:zt}},[w,A,B,W,cn,k,mn,Vt,Nn,zt]);x.useEffect(()=>{const Q=d.current;if(Q)return Q.addEventListener("keydown",dn),()=>{Q.removeEventListener("keydown",dn)}},[dn]),x.useEffect(()=>{function Q(ne){const le=d.current;if(!le)return;const ye=ne.target;if(!(ye instanceof HTMLElement))return;const{key:we,ctrlKey:Ne,metaKey:Pe,shiftKey:je}=ne,Se=Ne||Pe;if(w.current.enableSearch&&Se&&!je&&we===TC){const ke=ye.tagName==="INPUT"||ye.tagName==="TEXTAREA",Ae=le.contains(ye),xe=ye.closest('[role="search"]')!==null;if(Ae||xe||!ke){ne.preventDefault(),ne.stopPropagation();const Oe=!E.getState().searchOpen;cn(Oe),Oe&&!Ae&&!xe&&requestAnimationFrame(()=>{le.focus()});return}}if(le.contains(ye)&&we==="Escape"){const ke=E.getState();(ke.selectionState.selectedCells.size>0||Object.keys(ke.rowSelection).length>0)&&(ne.preventDefault(),ne.stopPropagation(),oe())}}return window.addEventListener("keydown",Q,!0),()=>{window.removeEventListener("keydown",Q,!0)}},[w,cn,E,oe]),x.useEffect(()=>{const Q=E.getState(),ne=w.current.autoFocus;if(ne&&t.length>0&&e.length>0&&!Q.focusedCell&&V.length>0){const le=requestAnimationFrame(()=>{if(typeof ne=="object"){const{rowIndex:we,columnId:Ne}=ne;Ne&&Ie(we??0,Ne);return}const ye=V[0];ye&&Ie(0,ye)});return()=>cancelAnimationFrame(le)}},[E,w,t,e,V,Ie]),x.useEffect(()=>{const Q=d.current;if(!Q)return;function ne(le){if(C.current)return;const ye=d.current;if(!ye)return;const we=E.getState();if(!we.focusedCell||we.editingCell)return;const Ne=le.relatedTarget,Pe=!Ne||!ye.contains(Ne),je=ZS(Ne);if(Pe&&!je){const{rowIndex:Se,columnId:Re}=we.focusedCell,ke=tn(Se,Re),Ae=v.current.get(ke);requestAnimationFrame(()=>{C.current||(Ae&&document.body.contains(Ae)?Ae.focus():ye.focus())})}}return Q.addEventListener("focusout",ne),()=>{Q.removeEventListener("focusout",ne)}},[E]),x.useEffect(()=>{function Q(ne){if(ne.button!==2&&d.current&&!d.current.contains(ne.target)&&!document.elementsFromPoint(ne.clientX,ne.clientY).some(we=>ZS(we))){Ue();const we=E.getState();(we.selectionState.selectedCells.size>0||Object.keys(we.rowSelection).length>0)&&oe()}}return document.addEventListener("mousedown",Q),()=>{document.removeEventListener("mousedown",Q)}},[E,Ue,oe]),x.useEffect(()=>{function Q(we){we.preventDefault()}function ne(we){we.preventDefault()}function le(){document.removeEventListener("selectstart",Q),document.removeEventListener("contextmenu",ne),document.body.style.userSelect=""}const ye=E.subscribe(()=>{E.getState().selectionState.isSelecting?(document.addEventListener("selectstart",Q),document.addEventListener("contextmenu",ne),document.body.style.userSelect="none"):le()});return()=>{le(),ye()}},[E]),sR(()=>{const Q=requestAnimationFrame(()=>{lo.measure()});return()=>cancelAnimationFrame(Q)},[I,vt.getState().columnFilters,vt.getState().columnOrder,vt.getState().columnPinning,vt.getState().columnSizing,vt.getState().columnVisibility,vt.getState().expanded,vt.getState().globalFilter,vt.getState().grouping,vt.getState().rowSelection,vt.getState().sorting]);const To=lo.getTotalSize(),Tr=lo.getVirtualItems(),rs=lo.measureElement;return x.useMemo(()=>({dataGridRef:d,headerRef:m,rowMapRef:p,footerRef:S,dir:u,table:vt,tableMeta:Kt,virtualTotalSize:To,virtualItems:Tr,measureElement:rs,columns:e,columnSizeVars:Dn,searchState:Tn,searchMatchesByRow:jn,activeSearchMatch:_e,cellSelectionMap:H,focusedCell:N,editingCell:D,rowHeight:I,contextMenu:G,pasteDialog:j,onRowAdd:w.current.onRowAdd?co:void 0,adjustLayout:Un}),[w,u,vt,Kt,To,Tr,rs,e,Dn,Tn,jn,_e,H,N,D,I,G,j,co,Un])}function RW(t){if(t.length===0)return[];const e=t[0];return!e||typeof e!="object"?[]:Object.keys(e)}function DW(t,e){const n=e?.length?e.map(l=>l.name).filter(l=>t.includes(l)):t,o=t.filter(l=>!n.includes(l)),a=[...n,...o],i=new Map(e?.map(l=>[l.name,l.type])??[]);return a.map(l=>({id:l,accessorKey:l,header:l,meta:{label:l,columnType:su(i.get(l))||void 0,cell:{variant:"short-text"}},size:180,minSize:80,maxSize:800}))}function TW(t){const e=be.c(22),{data:n,columns:o,height:a,width:i,readOnly:l}=t,u=a===void 0?400:a,d=l===void 0?!0:l;let f;e[0]!==n||e[1]!==o?(f=o?.length?o.map(kW):RW(n),e[0]=n,e[1]=o,e[2]=f):f=e[2];const g=f;let m;e[3]!==g||e[4]!==o?(m=DW(g,o),e[3]=g,e[4]=o,e[5]=m):m=e[5];const p=m;let v;e[6]!==p||e[7]!==n||e[8]!==d?(v={data:n,columns:p,readOnly:d,enableSearch:!0,enableColumnSelection:!1,enableSingleCellSelection:!0,enablePaste:!1},e[6]=p,e[7]=n,e[8]=d,e[9]=v):v=e[9];const S=NW(v);if(p.length===0){let w;e[10]!==u?(w={height:u},e[10]=u,e[11]=w):w=e[11];let M;e[12]===Symbol.for("react.memo_cache_sentinel")?(M=y.jsx("p",{children:"No columns to display"}),e[12]=M):M=e[12];const R=n.length===0?"No rows in this table":"Add columns to the table schema";let E;e[13]!==R?(E=y.jsx("p",{className:"text-xs mt-1",children:R}),e[13]=R,e[14]=E):E=e[14];let N;return e[15]!==w||e[16]!==E?(N=y.jsxs("div",{className:"flex flex-col items-center justify-center text-muted-foreground text-sm",style:w,children:[M,E]}),e[15]=w,e[16]=E,e[17]=N):N=e[17],N}let C;return e[18]!==S||e[19]!==u||e[20]!==i?(C=y.jsx(hq,{...S,height:u,width:i}),e[18]=S,e[19]=u,e[20]=i,e[21]=C):C=e[21],C}function kW(t){return t.name}function Qy(t){const e=be.c(10);let n,o,a;e[0]!==t?({className:n,size:a,...o}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a):(n=e[1],o=e[2],a=e[3]);const i=a===void 0?"default":a;let l;e[4]!==n?(l=Me("ring-foreground/10 bg-card text-card-foreground gap-6 overflow-hidden rounded-xl py-6 text-sm shadow-xs ring-1 has-[>img:first-child]:pt-0 data-[size=sm]:gap-4 data-[size=sm]:py-4 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl group/card flex flex-col",n),e[4]=n,e[5]=l):l=e[5];let u;return e[6]!==o||e[7]!==i||e[8]!==l?(u=y.jsx("div",{"data-slot":"card","data-size":i,className:l,...o}),e[6]=o,e[7]=i,e[8]=l,e[9]=u):u=e[9],u}function Jy(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("gap-1 rounded-t-xl px-6 group-data-[size=sm]/card:px-4 [.border-b]:pb-6 group-data-[size=sm]/card:[.border-b]:pb-4 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("div",{"data-slot":"card-header",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function ev(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("text-base leading-normal font-medium group-data-[size=sm]/card:text-sm",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("div",{"data-slot":"card-title",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function tv(t){const e=be.c(8);let n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=Me("px-6 group-data-[size=sm]/card:px-4",n),e[3]=n,e[4]=a):a=e[4];let i;return e[5]!==o||e[6]!==a?(i=y.jsx("div",{"data-slot":"card-content",className:a,...o}),e[5]=o,e[6]=a,e[7]=i):i=e[7],i}function OW(t){const e=be.c(9),{table:n}=t;let o;e[0]!==n.columns.length?(o=y.jsx(Jy,{className:"border-b shrink-0",children:y.jsxs(ev,{children:["Columns (",n.columns.length,")"]})}),e[0]=n.columns.length,e[1]=o):o=e[1];let a;e[2]!==n.columns?(a=n.columns.map(AW),e[2]=n.columns,e[3]=a):a=e[3];let i;e[4]!==a?(i=y.jsx(tv,{className:"flex-1 min-h-0 overflow-auto",children:y.jsx("div",{className:"divide-y divide-border",children:a})}),e[4]=a,e[5]=i):i=e[5];let l;return e[6]!==o||e[7]!==i?(l=y.jsxs(Qy,{className:"bg-background w-full flex flex-col flex-1 min-h-0",children:[o,i]}),e[6]=o,e[7]=i,e[8]=l):l=e[8],l}function AW(t){return y.jsxs("div",{className:"flex items-center justify-between py-4 px-2 hover:bg-accent/50 transition-colors",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"font-medium text-card-foreground",children:t.name}),y.jsxs("div",{className:"flex items-center gap-1",children:[t.isPrimaryKey&&y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500",style:{boxShadow:"0 0 4px 1px rgba(16, 185, 129, 0.6)"},title:"Primary Key"}),t.foreignKey&&y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400",style:{boxShadow:"0 0 4px 1px rgba(251, 191, 36, 0.6)"},title:"Foreign Key"})]})]}),y.jsxs("div",{className:"text-sm text-muted-foreground",children:[su(t.type),t.nullable&&y.jsx("span",{className:"ml-1 opacity-60",children:"(nullable)"})]})]},t.name)}function jW(t){const e=be.c(18),{table:n}=t;let o,a,i,l,u,d;if(e[0]!==n.columns||e[1]!==n.name||e[2]!==n.schema){const m=n.columns.filter(zW);a=Qy,u="bg-background w-full flex flex-col flex-1 min-h-0",d=y.jsx(Jy,{className:"border-b shrink-0",children:y.jsxs(ev,{children:["Foreign Keys (",m.length,")"]})}),o=tv,i="flex-1 min-h-0 overflow-auto",l=m.length===0?y.jsx("p",{className:"text-sm text-muted-foreground",children:"No foreign key relationships"}):y.jsx("div",{className:"",children:m.map(p=>y.jsxs("div",{className:"group flex items-center py-4 px-2 gap-0 w-full cursor-pointer",children:[y.jsxs("div",{className:"flex gap-4 items-center border border-border rounded-l-md py-2 px-3 shrink-0 transition-colors group-hover:border-muted-foreground/40",children:[y.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 shrink-0 transition-all duration-200 shadow-[0_0_4px_1px_rgba(251,191,36,0.6),0_0_8px_3px_rgba(251,191,36,0.3)] group-hover:bg-amber-300 group-hover:shadow-[0_0_6px_2px_rgba(252,211,77,0.7),0_0_12px_4px_rgba(252,211,77,0.4)]",title:"Foreign Key"}),y.jsxs("div",{className:"text-xs text-muted-foreground truncate",children:[n.schema,".",n.name]}),y.jsx("div",{className:"text-sm font-medium text-card-foreground truncate",children:p.name})]}),y.jsx("div",{className:"flex-1 min-w-0 h-px bg-border shrink-0 self-center transition-colors group-hover:bg-muted-foreground/40","aria-hidden":!0}),y.jsxs("div",{className:"flex gap-4 items-center border border-border rounded-r-md py-2 px-3 shrink-0 transition-colors group-hover:border-muted-foreground/40",children:[y.jsx("div",{className:"text-sm font-medium text-card-foreground truncate",children:p.foreignKey.toColumn}),y.jsx("div",{className:"text-xs text-muted-foreground truncate",children:p.foreignKey.toTable})]})]},p.name))}),e[0]=n.columns,e[1]=n.name,e[2]=n.schema,e[3]=o,e[4]=a,e[5]=i,e[6]=l,e[7]=u,e[8]=d}else o=e[3],a=e[4],i=e[5],l=e[6],u=e[7],d=e[8];let f;e[9]!==o||e[10]!==i||e[11]!==l?(f=y.jsx(o,{className:i,children:l}),e[9]=o,e[10]=i,e[11]=l,e[12]=f):f=e[12];let g;return e[13]!==a||e[14]!==u||e[15]!==d||e[16]!==f?(g=y.jsxs(a,{className:u,children:[d,f]}),e[13]=a,e[14]=u,e[15]=d,e[16]=f,e[17]=g):g=e[17],g}function zW(t){return!!t.foreignKey}function IW(t){const e=be.c(11),{policy:n,onOpenChange:o}=t,[a,i]=x.useState(!1),l=n!==null;let u;e[0]!==o?(u=m=>o(m),e[0]=o,e[1]=u):u=e[1];let d;e[2]!==a||e[3]!==n?(d=n&&y.jsxs(y.Fragment,{children:[y.jsxs(oy,{children:[y.jsx(ry,{children:n.name}),y.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:[y.jsx("span",{className:Me("text-xs px-2 py-0.5 rounded-full",n.permissive==="PERMISSIVE"?"bg-emerald-500/10 text-emerald-600":"bg-amber-500/10 text-amber-600"),children:n.permissive}),y.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-primary/10 text-primary",children:n.command}),y.jsx("span",{className:"text-xs text-muted-foreground",children:n.roles.length===0||n.roles.includes("public")?"PUBLIC":n.roles.join(", ")})]})]}),y.jsxs("div",{className:"flex-1 min-h-0 overflow-auto px-4 pb-4 space-y-4",children:[n.using&&y.jsxs("div",{children:[y.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:"USING"}),y.jsx("pre",{className:"text-xs bg-accent/50 p-2 rounded whitespace-pre-wrap break-words",children:y.jsx("code",{children:n.using})})]}),n.withCheck&&y.jsxs("div",{children:[y.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:"WITH CHECK"}),y.jsx("pre",{className:"text-xs bg-accent/50 p-2 rounded whitespace-pre-wrap break-words",children:y.jsx("code",{children:n.withCheck})})]}),!n.using&&!n.withCheck&&y.jsx("p",{className:"text-sm text-muted-foreground",children:"No USING or WITH CHECK expression for this policy."}),y.jsx(nn,{variant:"outline",size:"icon","aria-label":a?"Copied":"Copy SQL",onClick:()=>{const m=[];n.using&&m.push(`USING (${n.using})`),n.withCheck&&m.push(`WITH CHECK (${n.withCheck})`);const p=m.join(`
|
|
71
|
-
`);p&&(navigator.clipboard.writeText(p),i(!0),setTimeout(()=>i(!1),2e3),hn.success("RLS Copied"))},disabled:!n.using&&!n.withCheck,children:a?y.jsx(ns,{className:"h-4 w-4"}):y.jsx(Q0,{className:"h-4 w-4"})})]})]}),e[2]=a,e[3]=n,e[4]=d):d=e[4];let f;e[5]!==d?(f=y.jsx(ny,{className:"flex flex-col overflow-hidden sm:max-w-lg",children:d}),e[5]=d,e[6]=f):f=e[6];let g;return e[7]!==l||e[8]!==u||e[9]!==f?(g=y.jsx(ty,{open:l,onOpenChange:u,children:f}),e[7]=l,e[8]=u,e[9]=f,e[10]=g):g=e[10],g}function PW(t){const e=be.c(29),{rls:n,rlsLoading:o,rlsError:a}=t,i=n===void 0?null:n,l=o===void 0?!1:o,u=a===void 0?null:a,[d,f]=x.useState(null);if(l){let A;return e[0]===Symbol.for("react.memo_cache_sentinel")?(A=y.jsx("div",{className:"flex items-center justify-center h-full",children:y.jsx(iu,{})}),e[0]=A):A=e[0],A}if(u){let A;return e[1]!==u?(A=y.jsx("div",{className:"flex items-center justify-center h-full",children:y.jsx("p",{className:"text-destructive",children:u})}),e[1]=u,e[2]=A):A=e[2],A}const g=i?.policies.length??0;let m;e[3]!==g?(m=y.jsxs(ev,{children:["RLS Policies (",g,")"]}),e[3]=g,e[4]=m):m=e[4];const p=i?.enabled?"bg-emerald-500/20 text-emerald-400 border border-emerald-500/40 shadow-[0_0_12px_rgba(16,185,129,0.25)]":"bg-destructive/20 text-destructive border border-destructive/40 shadow-[0_0_12px_rgba(239,68,68,0.25)]";let v;e[5]!==p?(v=Me("inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-medium",p),e[5]=p,e[6]=v):v=e[6];let S;e[7]!==i?.enabled?(S=i?.enabled?y.jsx(pI,{className:"w-3.5 h-3.5 shrink-0"}):y.jsx(vI,{className:"w-3.5 h-3.5 shrink-0"}),e[7]=i?.enabled,e[8]=S):S=e[8];const C=i?.enabled?"RLS Enabled":"RLS Disabled";let w;e[9]!==v||e[10]!==S||e[11]!==C?(w=y.jsxs("span",{className:v,children:[S,C]}),e[9]=v,e[10]=S,e[11]=C,e[12]=w):w=e[12];let M;e[13]!==w||e[14]!==m?(M=y.jsxs(Jy,{className:"border-b shrink-0 flex gap-4",children:[m,w]}),e[13]=w,e[14]=m,e[15]=M):M=e[15];let R;e[16]!==i?.policies?(R=i?.policies.map(A=>y.jsxs("div",{role:"button",tabIndex:0,onClick:()=>f(A),onKeyDown:B=>B.key==="Enter"&&f(A),className:"flex items-center justify-between py-4 cursor-pointer px-2 hover:bg-accent/50 transition-colors",children:[y.jsxs("div",{className:"flex items-center justify-between gap-4",children:[y.jsx("div",{className:"text-xs text-muted-foreground",children:A.roles.length===0||A.roles.includes("public")?"PUBLIC":A.roles.join(", ")}),y.jsx("span",{className:"font-medium text-card-foreground",children:A.name})]}),y.jsxs("div",{className:"flex items-center gap-1",children:[y.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${A.permissive==="PERMISSIVE"?"bg-emerald-500/10 text-emerald-600":"bg-amber-500/10 text-amber-600"}`,children:A.permissive}),y.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-primary/10 text-primary",children:A.command})]})]},A.name)),e[16]=i?.policies,e[17]=R):R=e[17];let E;e[18]!==R?(E=y.jsx(tv,{className:"flex-1 min-h-0 overflow-auto",children:y.jsx("div",{className:"divide-y divide-border",children:R})}),e[18]=R,e[19]=E):E=e[19];let N;e[20]!==M||e[21]!==E?(N=y.jsxs(Qy,{className:"bg-background w-full flex flex-col flex-1 min-h-0",children:[M,E]}),e[20]=M,e[21]=E,e[22]=N):N=e[22];let D;e[23]===Symbol.for("react.memo_cache_sentinel")?(D=A=>!A&&f(null),e[23]=D):D=e[23];let T;e[24]!==d?(T=y.jsx(IW,{policy:d,onOpenChange:D}),e[24]=d,e[25]=T):T=e[25];let k;return e[26]!==N||e[27]!==T?(k=y.jsxs(y.Fragment,{children:[N,T]}),e[26]=N,e[27]=T,e[28]=k):k=e[28],k}const $W=[{id:"data",label:"Data"},{id:"columns",label:"Columns"},{id:"relationships",label:"Relationships"},{id:"rls",label:"RLS"}];function LW(t){const e=be.c(50),{table:n,data:o,dataLoading:a,dataError:i,rls:l,rlsLoading:u,rlsError:d}=t;let f;e[0]!==o?(f=o===void 0?[]:o,e[0]=o,e[1]=f):f=e[1];const g=f,m=a===void 0?!1:a,p=i===void 0?null:i,v=l===void 0?null:l,S=u===void 0?!1:u,C=d===void 0?null:d,[w,M]=x.useState("data"),R=x.useRef(null),[E,N]=x.useState(400),[D,T]=x.useState(void 0);let k;e[2]!==n.columns?(k=n.columns.map(HW),e[2]=n.columns,e[3]=k):k=e[3];const A=k;let B;e[4]===Symbol.for("react.memo_cache_sentinel")?(B=()=>{const q=R.current;if(!q)return;const J=new ResizeObserver(K=>{const ee=K[0];if(ee){const{width:ae,height:ce}=ee.contentRect;ce>0&&N(ce),ae>0&&T(ae)}});J.observe(q);const oe=q.getBoundingClientRect();return oe.height>0&&N(oe.height),oe.width>0&&T(oe.width),()=>J.disconnect()},e[4]=B):B=e[4];let W;e[5]!==w?(W=[w],e[5]=w,e[6]=W):W=e[6],x.useEffect(B,W);let U;e[7]===Symbol.for("react.memo_cache_sentinel")?(U=y.jsx(Jf,{className:"w-5 h-5 text-muted-foreground"}),e[7]=U):U=e[7];let Y;e[8]!==n.schema?(Y=y.jsxs("span",{className:"text-xs text-muted-foreground",children:[n.schema,"."]}),e[8]=n.schema,e[9]=Y):Y=e[9];let Z;e[10]!==n.name?(Z=y.jsx("span",{className:"font-semibold text-card-foreground",children:n.name}),e[10]=n.name,e[11]=Z):Z=e[11];let I;e[12]!==Y||e[13]!==Z?(I=y.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:[U,y.jsxs("div",{children:[Y,Z]})]}),e[12]=Y,e[13]=Z,e[14]=I):I=e[14];let G;e[15]!==w?(G=$W.map(q=>y.jsx("button",{onClick:()=>M(q.id),className:`px-4 py-2.5 text-sm font-medium border-b-2 transition-colors ${w===q.id?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-card-foreground"}`,children:q.label},q.id)),e[15]=w,e[16]=G):G=e[16];let j;e[17]!==G?(j=y.jsx("div",{className:"flex px-4",children:G}),e[17]=G,e[18]=j):j=e[18];let L;e[19]!==I||e[20]!==j?(L=y.jsxs("div",{className:"border-b border-border shrink-0",children:[I,j]}),e[19]=I,e[20]=j,e[21]=L):L=e[21];let $;e[22]!==w||e[23]!==g||e[24]!==p||e[25]!==m||e[26]!==A||e[27]!==E||e[28]!==D?($=w==="data"&&y.jsx("div",{className:"p-4 flex flex-col flex-1 min-h-0 min-w-0 overflow-hidden",children:m?y.jsx("div",{className:"flex items-center justify-center flex-1 text-muted-foreground text-sm",children:y.jsx(iu,{})}):p?y.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 text-destructive text-sm gap-2",children:[y.jsx("p",{className:"font-medium",children:"Failed to load table data"}),y.jsx("p",{className:"text-muted-foreground",children:p})]}):y.jsx("div",{ref:R,className:"flex-1 min-h-0 min-w-0 w-full max-w-full overflow-hidden",children:y.jsx(TW,{data:g,columns:A,height:E,width:D,readOnly:!0})})}),e[22]=w,e[23]=g,e[24]=p,e[25]=m,e[26]=A,e[27]=E,e[28]=D,e[29]=$):$=e[29];let H;e[30]!==w||e[31]!==n?(H=w==="columns"&&y.jsx(OW,{table:n}),e[30]=w,e[31]=n,e[32]=H):H=e[32];let X;e[33]!==w||e[34]!==n?(X=w==="relationships"&&y.jsx(jW,{table:n}),e[33]=w,e[34]=n,e[35]=X):X=e[35];let P;e[36]!==w||e[37]!==v||e[38]!==C||e[39]!==S||e[40]!==n?(P=w==="rls"&&y.jsx(PW,{table:n,rls:v,rlsLoading:S,rlsError:C}),e[36]=w,e[37]=v,e[38]=C,e[39]=S,e[40]=n,e[41]=P):P=e[41];let z;e[42]!==$||e[43]!==H||e[44]!==X||e[45]!==P?(z=y.jsxs("div",{className:"flex-1 min-h-0 min-w-0 flex flex-col overflow-hidden",children:[$,H,X,P]}),e[42]=$,e[43]=H,e[44]=X,e[45]=P,e[46]=z):z=e[46];let V;return e[47]!==L||e[48]!==z?(V=y.jsxs("div",{className:"h-full w-full min-w-0 flex flex-col",children:[L,z]}),e[47]=L,e[48]=z,e[49]=V):V=e[49],V}function HW(t){return{name:t.name,type:t.type}}function BW(t){const e=be.c(17),{openTables:n,activeTable:o,onSelectTab:a,onCloseTab:i,onPinTab:l}=t;if(n.length===0)return null;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=y.jsx("button",{className:"p-2 hover:bg-accent transition-colors border-r border-border",children:y.jsx(oM,{className:"w-4 h-4 text-muted-foreground"})}),e[0]=u):u=e[0];let d;if(e[1]!==o||e[2]!==i||e[3]!==l||e[4]!==a||e[5]!==n){let p;e[7]!==o||e[8]!==i||e[9]!==l||e[10]!==a?(p=v=>{const{table:S,isPinned:C}=v,w=`${S.schema}.${S.name}`,M=o?`${o.schema}.${o.name}`:null,R=w===M;return y.jsxs("div",{className:`group flex items-center gap-2 px-4 py-2 border-r border-border cursor-pointer transition-colors min-w-[150px] max-w-[250px] ${R?"bg-background border-t-2 border-t-primary":"hover:bg-accent/50"}`,onClick:()=>a(S),onDoubleClick:()=>l(S),children:[y.jsx(Jf,{className:"w-4 h-4 shrink-0 text-muted-foreground"}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsxs("span",{className:`text-xs text-muted-foreground ${C?"":"italic"}`,children:[S.schema,"."]}),y.jsx("span",{className:`text-sm truncate ${R?"font-medium":""} ${C?"":"italic"}`,children:S.name})]}),y.jsx("button",{onClick:E=>{E.stopPropagation(),i(S)},className:"p-0.5 rounded hover:bg-accent opacity-0 group-hover:opacity-100 transition-opacity",children:y.jsx(os,{className:"w-3.5 h-3.5 text-muted-foreground"})})]},w)},e[7]=o,e[8]=i,e[9]=l,e[10]=a,e[11]=p):p=e[11],d=n.map(p),e[1]=o,e[2]=i,e[3]=l,e[4]=a,e[5]=n,e[6]=d}else d=e[6];let f;e[12]!==d?(f=y.jsx("div",{className:"flex-1 flex overflow-x-auto",children:d}),e[12]=d,e[13]=f):f=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=y.jsx("button",{className:"p-2 hover:bg-accent transition-colors border-l border-border",children:y.jsx(ey,{className:"w-4 h-4 text-muted-foreground"})}),e[14]=g):g=e[14];let m;return e[15]!==f?(m=y.jsxs("div",{className:"flex items-center border-b border-border bg-card shrink-0",children:[u,f,g]}),e[15]=f,e[16]=m):m=e[16],m}async function VW(t,e,n,o=1e3){const a=await fetch("/api/tables/data",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionString:t,schema:e,table:n,limit:o})});if(!a.ok){let l=`HTTP error! status: ${a.status}`;try{l=(await a.json()).error||l}catch{const u=await a.text().catch(()=>"");u&&(l=u)}throw new Error(l)}const i=await a.json();if(!i.success)throw new Error(i.error||"Failed to fetch table data");return Array.isArray(i.data)?i.data:[]}async function FW(t,e,n){const o=await fetch("/api/tables/rls",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionString:t,schema:e,table:n})});if(!o.ok){let i=`HTTP error! status: ${o.status}`;try{i=(await o.json()).error||i}catch{const l=await o.text().catch(()=>"");l&&(i=l)}throw new Error(i)}const a=await o.json();if(!a.success)throw new Error(a.error||"Failed to fetch RLS info");return a.data}function UW({connection:t,table:e,limit:n=1e3}){const[o,a]=x.useState([]),[i,l]=x.useState(!1),[u,d]=x.useState(null),f=x.useCallback(async()=>{if(!t?.connectionString||!e){a([]),d(null);return}l(!0),d(null);try{const g=await VW(t.connectionString,e.schema,e.name,n);a(g)}catch(g){const m=g instanceof Error?g.message:"Failed to load table data";d(m),a([])}finally{l(!1)}},[t?.connectionString,e?.schema,e?.name,n]);return x.useEffect(()=>{f()},[f]),{data:o,loading:i,error:u,refetch:f}}function YW({connection:t,table:e}){const[n,o]=x.useState(null),[a,i]=x.useState(!1),[l,u]=x.useState(null),d=x.useCallback(async()=>{if(!t?.connectionString||!e){o(null),u(null);return}i(!0),u(null);try{const f=await FW(t.connectionString,e.schema,e.name);o(f)}catch(f){const g=f instanceof Error?f.message:"Failed to load RLS info";u(g),o(null)}finally{i(!1)}},[t?.connectionString,e?.schema,e?.name]);return x.useEffect(()=>{d()},[d]),{rls:n,loading:a,error:l,refetch:d}}const GW={pinnedTables:[],selectedSchema:"all"};function qW(){const t=be.c(54),{selectedConnection:e}=eh();let n;t[0]!==e?(n={connection:e},t[0]=e,t[1]=n):n=t[1];const{schemaData:o,loading:a,error:i}=JN(n),[l,u]=Iy("fb-table-view",GW);let d;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=[],t[2]=d):d=t[2];const[f,g]=x.useState(d),[m,p]=x.useState(null),[v,S]=x.useState(!1);let C;t[3]!==m||t[4]!==e?(C={connection:e,table:m},t[3]=m,t[4]=e,t[5]=C):C=t[5];const{data:w,loading:M,error:R}=UW(C);let E;t[6]!==m||t[7]!==e?(E={connection:e,table:m},t[6]=m,t[7]=e,t[8]=E):E=t[8];const{rls:N,loading:D,error:T}=YW(E),k=QW;let A;t[9]!==u?(A=K=>{u(ee=>({...ee,selectedSchema:K}))},t[9]=u,t[10]=A):A=t[10];const B=A;let W,U;t[11]!==v||t[12]!==o||t[13]!==l.pinnedTables?(W=()=>{if(!o||v||(S(!0),l.pinnedTables.length===0))return;const K=[];for(const ee of l.pinnedTables){const ae=o.tables.find(ce=>ce.schema===ee.schema&&ce.name===ee.name);ae&&K.push({table:ae,isPinned:!0})}K.length>0&&(g(K),p(K[0].table))},U=[o,l.pinnedTables,v],t[11]=v,t[12]=o,t[13]=l.pinnedTables,t[14]=W,t[15]=U):(W=t[14],U=t[15]),x.useEffect(W,U);let Y,Z;t[16]!==v||t[17]!==f||t[18]!==u?(Y=()=>{if(!v)return;const K=f.filter(ZW).map(XW);u(ee=>({...ee,pinnedTables:K}))},Z=[f,v,u],t[16]=v,t[17]=f,t[18]=u,t[19]=Y,t[20]=Z):(Y=t[19],Z=t[20]),x.useEffect(Y,Z);let I;t[21]===Symbol.for("react.memo_cache_sentinel")?(I=K=>{const ee=k(K);g(ae=>{if(ae.findIndex(se=>k(se.table)===ee)!==-1)return p(K),ae;const ge=ae.findIndex(KW);if(ge!==-1){const se=[...ae];return se[ge]={table:K,isPinned:!1},p(K),se}return p(K),[...ae,{table:K,isPinned:!1}]})},t[21]=I):I=t[21];const G=I;let j;t[22]===Symbol.for("react.memo_cache_sentinel")?(j=K=>{const ee=k(K);g(ae=>{const ce=ae.findIndex(se=>k(se.table)===ee);if(ce!==-1){const se=[...ae];return se[ce]={...se[ce],isPinned:!0},p(K),se}const ge=ae.findIndex(WW);if(ge!==-1){const se=[...ae];return se[ge]={table:K,isPinned:!0},p(K),se}return p(K),[...ae,{table:K,isPinned:!0}]})},t[22]=j):j=t[22];const L=j;let $;t[23]===Symbol.for("react.memo_cache_sentinel")?($=K=>{const ee=k(K);g(ae=>ae.map(ce=>k(ce.table)===ee?{...ce,isPinned:!0}:ce))},t[23]=$):$=t[23];const H=$;let X;t[24]!==m?(X=K=>{const ee=k(K),ae=m?k(m):null;g(ce=>{const ge=ce.filter(se=>k(se.table)!==ee);if(ee===ae){const se=ce.findIndex(De=>k(De.table)===ee),ve=Math.min(se,ge.length-1);p(ge[ve]?.table||null)}return ge})},t[24]=m,t[25]=X):X=t[25];const P=X;if(!e){let K;return t[26]===Symbol.for("react.memo_cache_sentinel")?(K=y.jsx("div",{className:"h-full flex items-center justify-center",children:y.jsx("p",{className:"text-muted-foreground",children:"Please select a database connection to view tables"})}),t[26]=K):K=t[26],K}if(!e.connectionString){let K;return t[27]===Symbol.for("react.memo_cache_sentinel")?(K=y.jsx("div",{className:"h-full flex items-center justify-center",children:y.jsx("p",{className:"text-muted-foreground",children:"Connection selected but missing connection string"})}),t[27]=K):K=t[27],K}if(a){let K;return t[28]===Symbol.for("react.memo_cache_sentinel")?(K=y.jsx("div",{className:"h-full flex items-center justify-center",children:y.jsx(iu,{})}),t[28]=K):K=t[28],K}if(i){let K;return t[29]!==i?(K=y.jsx("div",{className:"h-full flex items-center justify-center p-6",children:y.jsx("div",{className:"bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-md",children:i})}),t[29]=i,t[30]=K):K=t[30],K}if(!o)return null;let z;t[31]!==m||t[32]!==B||t[33]!==o.tables||t[34]!==l.selectedSchema?(z=y.jsx("div",{className:"w-64 shrink-0",children:y.jsx(QV,{tables:o.tables,selectedTable:m,selectedSchema:l.selectedSchema,onSchemaChange:B,onSingleClick:G,onDoubleClick:L})}),t[31]=m,t[32]=B,t[33]=o.tables,t[34]=l.selectedSchema,t[35]=z):z=t[35];let V;t[36]!==m||t[37]!==P||t[38]!==f?(V=y.jsx(BW,{openTables:f,activeTable:m,onSelectTab:p,onCloseTab:P,onPinTab:H}),t[36]=m,t[37]=P,t[38]=f,t[39]=V):V=t[39];let q;t[40]!==m||t[41]!==T||t[42]!==D||t[43]!==w||t[44]!==R||t[45]!==M||t[46]!==N?(q=y.jsx("div",{className:"flex-1 min-h-0 min-w-0 overflow-hidden",children:m?y.jsx(LW,{table:m,data:w,dataLoading:M,dataError:R,rls:N,rlsLoading:D,rlsError:T}):y.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-muted-foreground",children:[y.jsx(Jf,{className:"w-16 h-16 mb-4 opacity-30"}),y.jsx("p",{className:"text-lg font-medium",children:"Select a table"}),y.jsx("p",{className:"text-sm",children:"Choose a table from the list to view its details"})]})}),t[40]=m,t[41]=T,t[42]=D,t[43]=w,t[44]=R,t[45]=M,t[46]=N,t[47]=q):q=t[47];let J;t[48]!==V||t[49]!==q?(J=y.jsxs("div",{className:"flex-1 min-w-0 flex flex-col bg-background",children:[V,q]}),t[48]=V,t[49]=q,t[50]=J):J=t[50];let oe;return t[51]!==z||t[52]!==J?(oe=y.jsxs("div",{className:"h-full flex",children:[z,J]}),t[51]=z,t[52]=J,t[53]=oe):oe=t[53],oe}function WW(t){return!t.isPinned}function KW(t){return!t.isPinned}function XW(t){return{schema:t.table.schema,name:t.table.name}}function ZW(t){return t.isPinned}function QW(t){return`${t.schema}.${t.name}`}async function JW(t){const e=await fetch("/api/indexes/list",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({connectionString:t})});if(!e.ok){let o=`HTTP error! status: ${e.status}`;try{const a=await e.json();o=a.error||o,console.error("API error response:",a)}catch{const a=await e.text().catch(()=>"");console.error("Failed to parse error response. Raw response:",a)}throw new Error(o)}const n=await e.json();if(!n.success||!n.data)throw new Error(n.error||"Failed to fetch indexes data");return n.data}function eK(t){if(t===0)return"0 B";const e=1024,n=["B","KB","MB","GB","TB"],o=Math.floor(Math.log(t)/Math.log(e));return parseFloat((t/Math.pow(e,o)).toFixed(1))+" "+n[o]}function tK(t){return t.toLocaleString()}const a3=x.createContext(null);function s3(){const t=x.useContext(a3);if(!t)throw new Error("MultiSelect components must be used within MultiSelect");return t}function nK(t){const e=be.c(16),{value:n,onValueChange:o,options:a,children:i}=t;let l;e[0]!==o||e[1]!==a||e[2]!==n?(l=v=>{const S=n.length===0;if(S||n.includes(v))if(S)o(a.filter(w=>w!==v));else{const w=n.filter(M=>M!==v);o(w.length===0?a:w)}else{const w=[...n,v];o(w.length===a.length?[]:w)}},e[0]=o,e[1]=a,e[2]=n,e[3]=l):l=e[3];const u=l;let d;e[4]!==n?(d=v=>n.length===0||n.includes(v),e[4]=n,e[5]=d):d=e[5];const f=d;let g;e[6]!==f||e[7]!==u||e[8]!==a||e[9]!==n?(g={value:n,options:a,onToggle:u,isChecked:f},e[6]=f,e[7]=u,e[8]=a,e[9]=n,e[10]=g):g=e[10];let m;e[11]!==i?(m=y.jsx(ul,{modal:!0,children:i}),e[11]=i,e[12]=m):m=e[12];let p;return e[13]!==g||e[14]!==m?(p=y.jsx(a3.Provider,{value:g,children:m}),e[13]=g,e[14]=m,e[15]=p):p=e[15],p}function oK(t){const e=be.c(20);let n,o,a,i,l;e[0]!==t?({className:o,size:i,placeholder:l,children:n,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5]);const u=i===void 0?"default":i,d=l===void 0?"Select...":l,{value:f,options:g}=s3(),m=f.length===0||f.length===g.length;let p;e[6]!==m||e[7]!==n||e[8]!==d||e[9]!==f[0]||e[10]!==f.length?(p=n??y.jsx("span",{className:"truncate text-muted-foreground",children:f.length===0||m?d:f.length===1?f[0]:`${f.length} selected`}),e[6]=m,e[7]=n,e[8]=d,e[9]=f[0],e[10]=f.length,e[11]=p):p=e[11];const v=p;let S;e[12]!==o?(S=Me("border-input data-[placeholder]:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border bg-transparent py-2 pr-2 pl-2.5 text-sm shadow-xs transition-[color,box-shadow] focus-visible:ring-[3px] aria-invalid:ring-[3px] data-[size=default]:h-9 data-[size=sm]:h-8 [&_svg:not([class*='size-'])]:size-4 flex w-fit min-w-0 items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",o),e[12]=o,e[13]=S):S=e[13];let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=y.jsx(la,{className:"text-muted-foreground size-4 pointer-events-none shrink-0 ml-2"}),e[14]=C):C=e[14];let w;return e[15]!==a||e[16]!==u||e[17]!==S||e[18]!==v?(w=y.jsxs(eR,{"data-slot":"multi-select-trigger","data-size":u,className:S,...a,children:[v,C]}),e[15]=a,e[16]=u,e[17]=S,e[18]=v,e[19]=w):w=e[19],w}function rK(t){const e=be.c(14);let n,o,a,i,l;e[0]!==t?({className:o,align:i,sideOffset:l,children:n,...a}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i,e[5]=l):(n=e[1],o=e[2],a=e[3],i=e[4],l=e[5]);const u=i===void 0?"start":i,d=l===void 0?4:l;let f;e[6]!==o?(f=Me("ring-foreground/10 min-w-[var(--radix-popover-trigger-width)] max-h-[var(--radix-select-content-available-height)] overflow-y-auto rounded-md shadow-md ring-1 p-1 text-sm data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 duration-100 z-50 bg-popover text-popover-foreground outline-hidden flex flex-col gap-0.5",o),e[6]=o,e[7]=f):f=e[7];let g;return e[8]!==u||e[9]!==n||e[10]!==a||e[11]!==d||e[12]!==f?(g=y.jsx(dl,{align:u,sideOffset:d,className:f,...a,children:n}),e[8]=u,e[9]=n,e[10]=a,e[11]=d,e[12]=f,e[13]=g):g=e[13],g}function aK(t){const e=be.c(26);let n,o,a,i;e[0]!==t?({className:o,value:a,children:n,...i}=t,e[0]=t,e[1]=n,e[2]=o,e[3]=a,e[4]=i):(n=e[1],o=e[2],a=e[3],i=e[4]);const{onToggle:l,isChecked:u}=s3();let d;e[5]!==u||e[6]!==a?(d=u(a),e[5]=u,e[6]=a,e[7]=d):d=e[7];const f=d;let g;e[8]!==o?(g=Me("focus:bg-accent focus:text-accent-foreground gap-2 rounded-sm py-1 pl-2 pr-2 text-sm relative flex w-full cursor-pointer items-center outline-none select-none hover:bg-accent [&_svg]:pointer-events-none [&_svg]:shrink-0 min-h-[1.75rem]",o),e[8]=o,e[9]=g):g=e[9];let m,p;e[10]!==a||e[11]!==l?(m=()=>l(a),p=w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),l(a))},e[10]=a,e[11]=l,e[12]=m,e[13]=p):(m=e[12],p=e[13]);let v;e[14]!==f?(v=y.jsx(Py,{className:"rounded-none pointer-events-none shrink-0",checked:f,tabIndex:-1,"aria-hidden":!0}),e[14]=f,e[15]=v):v=e[15];let S;e[16]!==n?(S=y.jsx("span",{className:"flex-1 truncate",children:n}),e[16]=n,e[17]=S):S=e[17];let C;return e[18]!==f||e[19]!==i||e[20]!==g||e[21]!==m||e[22]!==p||e[23]!==v||e[24]!==S?(C=y.jsxs("div",{role:"option","aria-selected":f,"data-slot":"multi-select-item",className:g,onClick:m,onKeyDown:p,tabIndex:0,...i,children:[v,S]}),e[18]=f,e[19]=i,e[20]=g,e[21]=m,e[22]=p,e[23]=v,e[24]=S,e[25]=C):C=e[25],C}function sK(t){const e=t.isUnique?"UNIQUE ":"",n=`${t.schema}.${t.table}`,o=t.columns.length>0?t.columns.join(", "):"";return`CREATE ${e}INDEX ${t.indexName} ON ${n} USING btree (${o})`}function iK(t){const e=be.c(29),{index:n,open:o,onOpenChange:a}=t,[i,l]=x.useState(!1);let u;e[0]!==n?(u=n?sK(n):"",e[0]=n,e[1]=u):u=e[1];const d=u;let f;e[2]!==d?(f=async()=>{if(d)try{await navigator.clipboard.writeText(d),l(!0),setTimeout(()=>l(!1),2e3),hn.success("Index Copied")}catch{hn.error("Failed to copy")}},e[2]=d,e[3]=f):f=e[3];const g=f,m=n?n.indexName:"Index definition";let p;e[4]!==m?(p=y.jsx(ry,{children:m}),e[4]=m,e[5]=p):p=e[5];let v;e[6]===Symbol.for("react.memo_cache_sentinel")?(v=y.jsx("p",{className:"text-sm text-muted-foreground",children:"SQL for index definition"}),e[6]=v):v=e[6];let S;e[7]!==p?(S=y.jsxs(oy,{children:[p,v]}),e[7]=p,e[8]=S):S=e[8];let C;e[9]!==n?(C=n&&y.jsx("pre",{className:"text-xs bg-accent/50 p-2 rounded whitespace-pre-wrap break-words",children:y.jsxs("code",{children:[y.jsx("span",{className:"text-primary",children:"CREATE "}),n.isUnique&&y.jsx("span",{className:"text-primary",children:"UNIQUE "}),y.jsx("span",{className:"text-primary",children:"INDEX "}),y.jsxs("span",{className:"text-foreground",children:[n.indexName," "]}),y.jsx("span",{className:"text-primary",children:"ON "}),y.jsx("span",{className:"text-foreground",children:`${n.schema}.${n.table} `}),y.jsx("span",{className:"text-primary",children:"USING btree "}),y.jsxs("span",{className:"text-foreground",children:["(",n.columns.join(", "),")"]})]})}),e[9]=n,e[10]=C):C=e[10];let w;e[11]!==i?(w=i?y.jsx(ns,{className:"h-4 w-4"}):y.jsx(Q0,{className:"h-4 w-4"}),e[11]=i,e[12]=w):w=e[12];let M;e[13]!==g||e[14]!==w?(M=y.jsxs(nn,{variant:"outline",size:"icon",onClick:g,children:[w," "]}),e[13]=g,e[14]=w,e[15]=M):M=e[15];let R;e[16]!==C||e[17]!==M?(R=y.jsxs("div",{className:"flex-1 min-h-0 overflow-auto px-4 pb-4 space-y-4",children:[C,M]}),e[16]=C,e[17]=M,e[18]=R):R=e[18];let E;e[19]!==a?(E=y.jsx(LI,{className:"border-t border-border flex-row justify-end",children:y.jsx(nn,{variant:"outline",onClick:()=>a(!1),children:"Close"})}),e[19]=a,e[20]=E):E=e[20];let N;e[21]!==R||e[22]!==E||e[23]!==S?(N=y.jsxs(ny,{side:"right",className:"flex flex-col w-full sm:max-w-xl border-l border-border",showCloseButton:!0,children:[S,R,E]}),e[21]=R,e[22]=E,e[23]=S,e[24]=N):N=e[24];let D;return e[25]!==a||e[26]!==o||e[27]!==N?(D=y.jsx(ty,{open:o,onOpenChange:a,children:N}),e[25]=a,e[26]=o,e[27]=N,e[28]=D):D=e[28],D}const lK=["size-desc","scans-desc","scans-asc","name-asc","table-asc"],tf={selectedSchemas:[],sortBy:"scans-desc"};function Cp(t){if(!t||typeof t!="object")return tf;const e=t;let n=tf.selectedSchemas;return Array.isArray(e.selectedSchemas)&&e.selectedSchemas.every(o=>typeof o=="string")?n=e.selectedSchemas:typeof e.schemaFilter=="string"&&e.schemaFilter!=="all"&&(n=[e.schemaFilter]),{selectedSchemas:n,sortBy:lK.includes(e.sortBy)?e.sortBy:tf.sortBy}}function cK(){const t=be.c(10),[e,n]=Iy("fb-index-view",tf);let o;t[0]!==e?(o=Cp(e),t[0]=e,t[1]=o):o=t[1];const a=o;let i;t[2]!==n?(i=g=>{n(m=>{const p=Cp(m),v=typeof g=="function"?g(p.selectedSchemas):g;return{...p,selectedSchemas:v}})},t[2]=n,t[3]=i):i=t[3];const l=i;let u;t[4]!==n?(u=g=>{n(m=>({...Cp(m),sortBy:g}))},t[4]=n,t[5]=u):u=t[5];const d=u;let f;return t[6]!==l||t[7]!==d||t[8]!==a?(f={viewState:a,setSelectedSchemas:l,setSortBy:d},t[6]=l,t[7]=d,t[8]=a,t[9]=f):f=t[9],f}const uK=[{value:"size-desc",label:"Largest size"},{value:"scans-desc",label:"Most scans"},{value:"scans-asc",label:"Least scans"},{value:"name-asc",label:"Index name (A–Z)"},{value:"table-asc",label:"Table (A–Z)"}];function dK(){const{selectedConnection:t}=eh(),[e,n]=x.useState(null),[o,a]=x.useState(!1),[i,l]=x.useState(null),{viewState:u,setSelectedSchemas:d,setSortBy:f}=cK(),{selectedSchemas:g,sortBy:m}=u,[p,v]=x.useState(""),[S,C]=x.useState(null),[w,M]=x.useState(!1),R=x.useCallback(async()=>{if(!t?.connectionString){n(null),l(null);return}a(!0),l(null);try{const N=await JW(t.connectionString);n(N)}catch(N){const D=N instanceof Error?N.message:"Failed to load indexes";l(D),n(null)}finally{a(!1)}},[t?.connectionString]);x.useEffect(()=>{t?.connectionString&&R()},[t?.connectionString,R]);const E=x.useMemo(()=>{if(!e?.indexes)return[];let N=e.indexes;if(g.length>0){const T=new Set(g);N=N.filter(k=>T.has(k.schema))}if(p.trim()){const T=p.toLowerCase();N=N.filter(k=>k.indexName.toLowerCase().includes(T)||k.table.toLowerCase().includes(T)||k.columns.some(A=>A.toLowerCase().includes(T)))}const D=[...N];switch(m){case"size-desc":D.sort((T,k)=>k.sizeBytes-T.sizeBytes);break;case"scans-desc":D.sort((T,k)=>k.indexScans-T.indexScans);break;case"scans-asc":D.sort((T,k)=>T.indexScans-k.indexScans);break;case"name-asc":D.sort((T,k)=>T.indexName.localeCompare(k.indexName));break;case"table-asc":D.sort((T,k)=>T.table.localeCompare(k.table)||T.indexName.localeCompare(k.indexName));break}return D},[e?.indexes,g,p,m]);return t?o&&!e?y.jsx("div",{className:"h-full flex items-center justify-center",children:y.jsx(iu,{})}):i?y.jsx("div",{className:"h-full flex items-center justify-center p-6",children:y.jsx("div",{className:"bg-destructive/10 border border-destructive/20 text-destructive px-4 py-3 rounded-md max-w-lg",children:i})}):y.jsxs("div",{className:"p-6 h-full flex flex-col overflow-hidden pb-6",children:[y.jsxs("div",{className:"w-full max-w-7xl mx-auto flex flex-col min-h-0 flex-1",children:[y.jsxs("div",{className:"flex flex-col gap-2 shrink-0",children:[y.jsx("h1",{className:"text-2xl font-bold",children:"Indexes"}),y.jsx("p",{className:"text-muted-foreground",children:"View and manage indexes for your database"})]}),y.jsx("div",{className:"shrink-0 py-6 border-b bg-background",children:y.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[y.jsxs("div",{className:"flex items-center gap-3",children:[e?.schemas&&e.schemas.length>0&&y.jsxs(nK,{value:g,onValueChange:d,options:e.schemas,children:[y.jsx(oK,{className:"w-[180px] font-normal",placeholder:"All schemas",children:y.jsx("span",{className:"truncate text-muted-foreground",children:g.length===0||g.length===e.schemas.length?"All schemas":g.length===1?g[0]:`${g.length} schemas`})}),y.jsx(rK,{className:"w-[180px] max-h-[280px]",children:e.schemas.map(N=>y.jsx(aK,{value:N,children:N},N))})]}),y.jsxs("div",{className:"relative min-w-[240px]",children:[y.jsx(Qf,{className:"absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"}),y.jsx(Bi,{placeholder:"Search for an index",value:p,onChange:N=>v(N.target.value),className:"pl-9"})]})]}),y.jsx("div",{className:"flex items-center gap-2",children:y.jsxs($c,{value:m,onValueChange:N=>f(N),children:[y.jsx(Lc,{className:"w-[180px]",children:y.jsx(Xi,{placeholder:"Sort by"})}),y.jsx(Hc,{children:uK.map(N=>y.jsx(gr,{value:N.value,children:N.label},N.value))})]})})]})}),y.jsx("div",{className:"min-h-0 max-h-[calc(100vh-12rem)] overflow-y-auto border border-border rounded-md",children:E.length===0?y.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[300px] text-muted-foreground py-12",children:[y.jsx(iM,{className:"size-12 mb-4 opacity-30"}),y.jsx("p",{className:"text-lg font-medium",children:e?.indexes.length===0?"No indexes found":"No matching indexes"}),y.jsx("p",{className:"text-sm",children:e?.indexes.length===0?"This database has no user-created indexes.":"Try adjusting your filters or search query."})]}):y.jsxs("table",{className:"w-full text-sm",children:[y.jsx("thead",{className:"bg-background sticky top-0 z-10",children:y.jsxs("tr",{children:[y.jsx("th",{className:"text-left p-4 font-medium uppercase text-xs text-muted-foreground",children:"Table"}),y.jsx("th",{className:"text-left p-4 font-medium uppercase text-xs text-muted-foreground",children:"Columns"}),y.jsx("th",{className:"text-left p-4 font-medium uppercase text-xs text-muted-foreground",children:"Name"}),y.jsx("th",{className:"text-right p-4 font-medium uppercase text-xs text-muted-foreground",children:"Size"}),y.jsx("th",{className:"text-right p-4 font-medium uppercase text-xs text-muted-foreground",children:"Scans"})]})}),y.jsx("tbody",{children:E.map(N=>y.jsx(fK,{index:N,onSelect:()=>{C(N),M(!0)}},`${N.schema}.${N.indexName}`))})]})})]}),y.jsx(iK,{index:S,open:w,onOpenChange:M})]}):y.jsx("div",{className:"h-full flex items-center justify-center",children:y.jsx("p",{className:"text-muted-foreground",children:"Please select a database connection to view indexes"})})}function fK(t){const e=be.c(35),{index:n,onSelect:o}=t;let a;e[0]!==o?(a=M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),o?.())},e[0]=o,e[1]=a):a=e[1];let i;e[2]!==n.table?(i=y.jsx("td",{className:"p-4 font-medium",children:n.table}),e[2]=n.table,e[3]=i):i=e[3];let l;e[4]!==n.columns?(l=n.columns.length>0?n.columns.join(", "):"—",e[4]=n.columns,e[5]=l):l=e[5];let u;e[6]!==l?(u=y.jsx("td",{className:"p-4",children:y.jsx("span",{className:"text-muted-foreground line-clamp-1",children:l})}),e[6]=l,e[7]=u):u=e[7];let d;e[8]!==n.indexName?(d=y.jsx("span",{className:"font-mono text-sm",children:n.indexName}),e[8]=n.indexName,e[9]=d):d=e[9];let f;e[10]!==n.isPrimary?(f=n.isPrimary&&y.jsx("span",{className:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded",children:"PK"}),e[10]=n.isPrimary,e[11]=f):f=e[11];let g;e[12]!==n.isPrimary||e[13]!==n.isUnique?(g=n.isUnique&&!n.isPrimary&&y.jsx("span",{className:"text-xs bg-amber-500/10 text-amber-600 px-1.5 py-0.5 rounded",children:"Unique"}),e[12]=n.isPrimary,e[13]=n.isUnique,e[14]=g):g=e[14];let m;e[15]!==d||e[16]!==f||e[17]!==g?(m=y.jsx("td",{className:"p-4",children:y.jsxs("div",{className:"flex items-center gap-2",children:[d,f,g]})}),e[15]=d,e[16]=f,e[17]=g,e[18]=m):m=e[18];let p;e[19]!==n.sizeBytes?(p=eK(n.sizeBytes),e[19]=n.sizeBytes,e[20]=p):p=e[20];let v;e[21]!==p?(v=y.jsx("td",{className:"p-4 text-right font-mono text-muted-foreground text-nowrap",children:p}),e[21]=p,e[22]=v):v=e[22];let S;e[23]!==n.indexScans?(S=tK(n.indexScans),e[23]=n.indexScans,e[24]=S):S=e[24];let C;e[25]!==S?(C=y.jsx("td",{className:"p-4 text-right font-mono text-muted-foreground",children:S}),e[25]=S,e[26]=C):C=e[26];let w;return e[27]!==o||e[28]!==a||e[29]!==v||e[30]!==C||e[31]!==i||e[32]!==u||e[33]!==m?(w=y.jsxs("tr",{className:"border-b hover:bg-muted/30 transition-colors cursor-pointer",onClick:o,role:"button",tabIndex:0,onKeyDown:a,children:[i,u,m,v,C]}),e[27]=o,e[28]=a,e[29]=v,e[30]=C,e[31]=i,e[32]=u,e[33]=m,e[34]=w):w=e[34],w}function hK(){const t=be.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=y.jsx(dc,{path:"/",element:y.jsx(pT,{to:"/schema",replace:!0})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=y.jsx(dc,{path:"/schema",element:y.jsx(ZV,{})}),t[1]=n):n=t[1];let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=y.jsx(dc,{path:"/tables",element:y.jsx(qW,{})}),t[2]=o):o=t[2];let a;return t[3]===Symbol.for("react.memo_cache_sentinel")?(a=y.jsx(E7,{children:y.jsxs(vT,{children:[e,n,o,y.jsx(dc,{path:"/indexes",element:y.jsx(dK,{})})]})}),t[3]=a):a=t[3],a}b4.createRoot(document.getElementById("root")).render(y.jsx(x.StrictMode,{children:y.jsx(VT,{children:y.jsx(hK,{})})}));
|