var aj=Object.defineProperty;var oj=(e,t,n)=>t in e?aj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var mi=(e,t,n)=>oj(e,typeof t!="symbol"?t+"":t,n);function sj(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function fn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function lj(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Fp={exports:{}},_l={};/** * @license React * react-jsx-runtime.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var F0;function uj(){if(F0)return _l;F0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,o){var l=null;if(o!==void 0&&(l=""+o),i.key!==void 0&&(l=""+i.key),"key"in i){o={};for(var u in i)u!=="key"&&(o[u]=i[u])}else o=i;return i=o.ref,{$$typeof:e,type:r,key:l,ref:i!==void 0?i:null,props:o}}return _l.Fragment=t,_l.jsx=n,_l.jsxs=n,_l}var I0;function cj(){return I0||(I0=1,Fp.exports=uj()),Fp.exports}var S=cj(),Ip={exports:{}},nt={};/** * @license React * react.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var G0;function fj(){if(G0)return nt;G0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.iterator;function v(A){return A===null||typeof A!="object"?null:(A=m&&A[m]||A["@@iterator"],typeof A=="function"?A:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,x={};function k(A,H,M){this.props=A,this.context=H,this.refs=x,this.updater=M||g}k.prototype.isReactComponent={},k.prototype.setState=function(A,H){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,H,"setState")},k.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function C(){}C.prototype=k.prototype;function _(A,H,M){this.props=A,this.context=H,this.refs=x,this.updater=M||g}var T=_.prototype=new C;T.constructor=_,w(T,k.prototype),T.isPureReactComponent=!0;var N=Array.isArray,D={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function R(A,H,M,O,X,re){return M=re.ref,{$$typeof:e,type:A,key:H,ref:M!==void 0?M:null,props:re}}function U(A,H){return R(A.type,H,void 0,void 0,void 0,A.props)}function P(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function z(A){var H={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(M){return H[M]})}var V=/\/+/g;function q(A,H){return typeof A=="object"&&A!==null&&A.key!=null?z(""+A.key):H.toString(36)}function I(){}function Y(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(I,I):(A.status="pending",A.then(function(H){A.status==="pending"&&(A.status="fulfilled",A.value=H)},function(H){A.status==="pending"&&(A.status="rejected",A.reason=H)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function Z(A,H,M,O,X){var re=typeof A;(re==="undefined"||re==="boolean")&&(A=null);var ue=!1;if(A===null)ue=!0;else switch(re){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(A.$$typeof){case e:case t:ue=!0;break;case p:return ue=A._init,Z(ue(A._payload),H,M,O,X)}}if(ue)return X=X(A),ue=O===""?"."+q(A,0):O,N(X)?(M="",ue!=null&&(M=ue.replace(V,"$&/")+"/"),Z(X,H,M,"",function(Ce){return Ce})):X!=null&&(P(X)&&(X=U(X,M+(X.key==null||A&&A.key===X.key?"":(""+X.key).replace(V,"$&/")+"/")+ue)),H.push(X)),1;ue=0;var ae=O===""?".":O+":";if(N(A))for(var oe=0;oe>>1,A=B[K];if(0>>1;Ki(O,F))Xi(re,O)?(B[K]=re,B[X]=F,K=X):(B[K]=O,B[M]=F,K=M);else if(Xi(re,F))B[K]=re,B[X]=F,K=X;else break e}}return G}function i(B,G){var F=B.sortIndex-G.sortIndex;return F!==0?F:B.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var f=[],d=[],p=1,m=null,v=3,g=!1,w=!1,x=!1,k=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function T(B){for(var G=n(d);G!==null;){if(G.callback===null)r(d);else if(G.startTime<=B)r(d),G.sortIndex=G.expirationTime,t(f,G);else break;G=n(d)}}function N(B){if(x=!1,T(B),!w)if(n(f)!==null)w=!0,Y();else{var G=n(d);G!==null&&Z(N,G.startTime-B)}}var D=!1,L=-1,R=5,U=-1;function P(){return!(e.unstable_now()-UB&&P());){var K=m.callback;if(typeof K=="function"){m.callback=null,v=m.priorityLevel;var A=K(m.expirationTime<=B);if(B=e.unstable_now(),typeof A=="function"){m.callback=A,T(B),G=!0;break t}m===n(f)&&r(f),T(B)}else r(f);m=n(f)}if(m!==null)G=!0;else{var H=n(d);H!==null&&Z(N,H.startTime-B),G=!1}}break e}finally{m=null,v=F,g=!1}G=void 0}}finally{G?V():D=!1}}}var V;if(typeof _=="function")V=function(){_(z)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,I=q.port2;q.port1.onmessage=z,V=function(){I.postMessage(null)}}else V=function(){k(z,0)};function Y(){D||(D=!0,V())}function Z(B,G){L=k(function(){B(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(B){B.callback=null},e.unstable_continueExecution=function(){w||g||(w=!0,Y())},e.unstable_forceFrameRate=function(B){0>B||125K?(B.sortIndex=F,t(d,B),n(f)===null&&B===n(d)&&(x?(C(L),L=-1):x=!0,Z(N,F-K))):(B.sortIndex=A,t(f,B),w||g||(w=!0,Y())),B},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(B){var G=v;return function(){var F=v;v=G;try{return B.apply(this,arguments)}finally{v=F}}}}(Bp)),Bp}var $0;function pj(){return $0||($0=1,Up.exports=hj()),Up.exports}var $p={exports:{}},mn={};/** * @license React * react-dom.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var H0;function mj(){if(H0)return mn;H0=1;var e=Vf();function t(f){var d="https://react.dev/errors/"+f;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),$p.exports=mj(),$p.exports}/** * @license React * react-dom-client.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var q0;function gj(){if(q0)return kl;q0=1;var e=pj(),t=Vf(),n=R_();function r(a){var s="https://react.dev/errors/"+a;if(1)":-1y||W[h]!==J[y]){var me=` `+W[h].replace(" at new "," at ");return a.displayName&&me.includes("")&&(me=me.replace("",a.displayName)),me}while(1<=h&&0<=y);break}}}finally{Y=!1,Error.prepareStackTrace=c}return(c=a?a.displayName||a.name:"")?I(c):""}function B(a){switch(a.tag){case 26:case 27:case 5:return I(a.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 15:return a=Z(a.type,!1),a;case 11:return a=Z(a.type.render,!1),a;case 1:return a=Z(a.type,!0),a;default:return""}}function G(a){try{var s="";do s+=B(a),a=a.return;while(a);return s}catch(c){return` Error generating stack: `+c.message+` `+c.stack}}function F(a){var s=a,c=a;if(a.alternate)for(;s.return;)s=s.return;else{a=s;do s=a,s.flags&4098&&(c=s.return),a=s.return;while(a)}return s.tag===3?c:null}function K(a){if(a.tag===13){var s=a.memoizedState;if(s===null&&(a=a.alternate,a!==null&&(s=a.memoizedState)),s!==null)return s.dehydrated}return null}function A(a){if(F(a)!==a)throw Error(r(188))}function H(a){var s=a.alternate;if(!s){if(s=F(a),s===null)throw Error(r(188));return s!==a?null:a}for(var c=a,h=s;;){var y=c.return;if(y===null)break;var b=y.alternate;if(b===null){if(h=y.return,h!==null){c=h;continue}break}if(y.child===b.child){for(b=y.child;b;){if(b===c)return A(y),a;if(b===h)return A(y),s;b=b.sibling}throw Error(r(188))}if(c.return!==h.return)c=y,h=b;else{for(var j=!1,$=y.child;$;){if($===c){j=!0,c=y,h=b;break}if($===h){j=!0,h=y,c=b;break}$=$.sibling}if(!j){for($=b.child;$;){if($===c){j=!0,c=b,h=y;break}if($===h){j=!0,h=b,c=y;break}$=$.sibling}if(!j)throw Error(r(189))}}if(c.alternate!==h)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?a:s}function M(a){var s=a.tag;if(s===5||s===26||s===27||s===6)return a;for(a=a.child;a!==null;){if(s=M(a),s!==null)return s;a=a.sibling}return null}var O=Array.isArray,X=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},ue=[],ae=-1;function oe(a){return{current:a}}function Ce(a){0>ae||(a.current=ue[ae],ue[ae]=null,ae--)}function he(a,s){ae++,ue[ae]=a.current,a.current=s}var Ee=oe(null),we=oe(null),Pe=oe(null),Ae=oe(null);function xe(a,s){switch(he(Pe,s),he(we,a),he(Ee,null),a=s.nodeType,a){case 9:case 11:s=(s=s.documentElement)&&(s=s.namespaceURI)?h0(s):0;break;default:if(a=a===8?s.parentNode:s,s=a.tagName,a=a.namespaceURI)a=h0(a),s=p0(a,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}Ce(Ee),he(Ee,s)}function ee(){Ce(Ee),Ce(we),Ce(Pe)}function ce(a){a.memoizedState!==null&&he(Ae,a);var s=Ee.current,c=p0(s,a.type);s!==c&&(he(we,a),he(Ee,c))}function Te(a){we.current===a&&(Ce(Ee),Ce(we)),Ae.current===a&&(Ce(Ae),bl._currentValue=re)}var ge=Object.prototype.hasOwnProperty,Se=e.unstable_scheduleCallback,ie=e.unstable_cancelCallback,$e=e.unstable_shouldYield,Ge=e.unstable_requestPaint,ve=e.unstable_now,Ne=e.unstable_getCurrentPriorityLevel,te=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,Oe=e.unstable_NormalPriority,He=e.unstable_LowPriority,Ye=e.unstable_IdlePriority,vt=e.log,Mt=e.unstable_setDisableYieldValue,bt=null,rt=null;function qt(a){if(rt&&typeof rt.onCommitFiberRoot=="function")try{rt.onCommitFiberRoot(bt,a,void 0,(a.current.flags&128)===128)}catch{}}function at(a){if(typeof vt=="function"&&Mt(a),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode(bt,a)}catch{}}var At=Math.clz32?Math.clz32:xu,rn=Math.log,io=Math.LN2;function xu(a){return a>>>=0,a===0?32:31-(rn(a)/io|0)|0}var ao=128,Di=4194304;function dn(a){var s=a&42;if(s!==0)return s;switch(a&-a){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: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 a&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function oo(a,s){var c=a.pendingLanes;if(c===0)return 0;var h=0,y=a.suspendedLanes,b=a.pingedLanes,j=a.warmLanes;a=a.finishedLanes!==0;var $=c&134217727;return $!==0?(c=$&~y,c!==0?h=dn(c):(b&=$,b!==0?h=dn(b):a||(j=$&~j,j!==0&&(h=dn(j))))):($=c&~y,$!==0?h=dn($):b!==0?h=dn(b):a||(j=c&~j,j!==0&&(h=dn(j)))),h===0?0:s!==0&&s!==h&&!(s&y)&&(y=h&-h,j=s&-s,y>=j||y===32&&(j&4194176)!==0)?s:h}function Ze(a,s){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&s)===0}function gt(a,s){switch(a){case 1:case 2:case 4:case 8:return s+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 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 _t(){var a=ao;return ao<<=1,!(ao&4194176)&&(ao=128),a}function Cn(){var a=Di;return Di<<=1,!(Di&62914560)&&(Di=4194304),a}function Sn(a){for(var s=[],c=0;31>c;c++)s.push(a);return s}function Tn(a,s){a.pendingLanes|=s,s!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Zr(a,s,c,h,y,b){var j=a.pendingLanes;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=c,a.entangledLanes&=c,a.errorRecoveryDisabledLanes&=c,a.shellSuspendCounter=0;var $=a.entanglements,W=a.expirationTimes,J=a.hiddenUpdates;for(c=j&~c;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),QD=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]*$"),pb={},mb={};function JD(a){return ge.call(mb,a)?!0:ge.call(pb,a)?!1:QD.test(a)?mb[a]=!0:(pb[a]=!0,!1)}function wu(a,s,c){if(JD(s))if(c===null)a.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":a.removeAttribute(s);return;case"boolean":var h=s.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){a.removeAttribute(s);return}}a.setAttribute(s,""+c)}}function Su(a,s,c){if(c===null)a.removeAttribute(s);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(s);return}a.setAttribute(s,""+c)}}function Jr(a,s,c,h){if(h===null)a.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(c);return}a.setAttributeNS(s,c,""+h)}}function Zn(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function gb(a){var s=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function eN(a){var s=gb(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,s),h=""+a[s];if(!a.hasOwnProperty(s)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var y=c.get,b=c.set;return Object.defineProperty(a,s,{configurable:!0,get:function(){return y.call(this)},set:function(j){h=""+j,b.call(this,j)}}),Object.defineProperty(a,s,{enumerable:c.enumerable}),{getValue:function(){return h},setValue:function(j){h=""+j},stopTracking:function(){a._valueTracker=null,delete a[s]}}}}function Eu(a){a._valueTracker||(a._valueTracker=eN(a))}function vb(a){if(!a)return!1;var s=a._valueTracker;if(!s)return!0;var c=s.getValue(),h="";return a&&(h=gb(a)?a.checked?"true":"false":a.value),a=h,a!==c?(s.setValue(a),!0):!1}function _u(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var tN=/[\n"\\]/g;function Qn(a){return a.replace(tN,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Md(a,s,c,h,y,b,j,$){a.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?a.type=j:a.removeAttribute("type"),s!=null?j==="number"?(s===0&&a.value===""||a.value!=s)&&(a.value=""+Zn(s)):a.value!==""+Zn(s)&&(a.value=""+Zn(s)):j!=="submit"&&j!=="reset"||a.removeAttribute("value"),s!=null?Pd(a,j,Zn(s)):c!=null?Pd(a,j,Zn(c)):h!=null&&a.removeAttribute("value"),y==null&&b!=null&&(a.defaultChecked=!!b),y!=null&&(a.checked=y&&typeof y!="function"&&typeof y!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?a.name=""+Zn($):a.removeAttribute("name")}function yb(a,s,c,h,y,b,j,$){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(a.type=b),s!=null||c!=null){if(!(b!=="submit"&&b!=="reset"||s!=null))return;c=c!=null?""+Zn(c):"",s=s!=null?""+Zn(s):c,$||s===a.value||(a.value=s),a.defaultValue=s}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,a.checked=$?a.checked:!!h,a.defaultChecked=!!h,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(a.name=j)}function Pd(a,s,c){s==="number"&&_u(a.ownerDocument)===a||a.defaultValue===""+c||(a.defaultValue=""+c)}function fo(a,s,c,h){if(a=a.options,s){s={};for(var y=0;y=Ps),Nb=" ",Ob=!1;function jb(a,s){switch(a){case"keyup":return RN.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lb(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var go=!1;function NN(a,s){switch(a){case"compositionend":return Lb(s);case"keypress":return s.which!==32?null:(Ob=!0,Nb);case"textInput":return a=s.data,a===Nb&&Ob?null:a;default:return null}}function ON(a,s){if(go)return a==="compositionend"||!Wd&&jb(a,s)?(a=kb(),Cu=$d=Oi=null,go=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:c,offset:s-a};a=h}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Bb(c)}}function Hb(a,s){return a&&s?a===s?!0:a&&a.nodeType===3?!1:s&&s.nodeType===3?Hb(a,s.parentNode):"contains"in a?a.contains(s):a.compareDocumentPosition?!!(a.compareDocumentPosition(s)&16):!1:!1}function Vb(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var s=_u(a.document);s instanceof a.HTMLIFrameElement;){try{var c=typeof s.contentWindow.location.href=="string"}catch{c=!1}if(c)a=s.contentWindow;else break;s=_u(a.document)}return s}function Zd(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s&&(s==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||s==="textarea"||a.contentEditable==="true")}function GN(a,s){var c=Vb(s);s=a.focusedElem;var h=a.selectionRange;if(c!==s&&s&&s.ownerDocument&&Hb(s.ownerDocument.documentElement,s)){if(h!==null&&Zd(s)){if(a=h.start,c=h.end,c===void 0&&(c=a),"selectionStart"in s)s.selectionStart=a,s.selectionEnd=Math.min(c,s.value.length);else if(c=(a=s.ownerDocument||document)&&a.defaultView||window,c.getSelection){c=c.getSelection();var y=s.textContent.length,b=Math.min(h.start,y);h=h.end===void 0?b:Math.min(h.end,y),!c.extend&&b>h&&(y=h,h=b,b=y),y=$b(s,b);var j=$b(s,h);y&&j&&(c.rangeCount!==1||c.anchorNode!==y.node||c.anchorOffset!==y.offset||c.focusNode!==j.node||c.focusOffset!==j.offset)&&(a=a.createRange(),a.setStart(y.node,y.offset),c.removeAllRanges(),b>h?(c.addRange(a),c.extend(j.node,j.offset)):(a.setEnd(j.node,j.offset),c.addRange(a)))}}for(a=[],c=s;c=c.parentNode;)c.nodeType===1&&a.push({element:c,left:c.scrollLeft,top:c.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s=document.documentMode,vo=null,Qd=null,Us=null,Jd=!1;function qb(a,s,c){var h=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Jd||vo==null||vo!==_u(h)||(h=vo,"selectionStart"in h&&Zd(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}),Us&&Gs(Us,h)||(Us=h,h=hc(Qd,"onSelect"),0>=j,y-=j,ei=1<<32-At(s)+y|c<Ke?(Jt=Ve,Ve=null):Jt=Ve.sibling;var mt=le(ne,Ve,se[Ke],ye);if(mt===null){Ve===null&&(Ve=Jt);break}a&&Ve&&mt.alternate===null&&s(ne,Ve),Q=b(mt,Q,Ke),ot===null?Ie=mt:ot.sibling=mt,ot=mt,Ve=Jt}if(Ke===se.length)return c(ne,Ve),pt&&Ea(ne,Ke),Ie;if(Ve===null){for(;KeKe?(Jt=Ve,Ve=null):Jt=Ve.sibling;var Qi=le(ne,Ve,mt.value,ye);if(Qi===null){Ve===null&&(Ve=Jt);break}a&&Ve&&Qi.alternate===null&&s(ne,Ve),Q=b(Qi,Q,Ke),ot===null?Ie=Qi:ot.sibling=Qi,ot=Qi,Ve=Jt}if(mt.done)return c(ne,Ve),pt&&Ea(ne,Ke),Ie;if(Ve===null){for(;!mt.done;Ke++,mt=se.next())mt=_e(ne,mt.value,ye),mt!==null&&(Q=b(mt,Q,Ke),ot===null?Ie=mt:ot.sibling=mt,ot=mt);return pt&&Ea(ne,Ke),Ie}for(Ve=h(Ve);!mt.done;Ke++,mt=se.next())mt=pe(Ve,ne,Ke,mt.value,ye),mt!==null&&(a&&mt.alternate!==null&&Ve.delete(mt.key===null?Ke:mt.key),Q=b(mt,Q,Ke),ot===null?Ie=mt:ot.sibling=mt,ot=mt);return a&&Ve.forEach(function(ij){return s(ne,ij)}),pt&&Ea(ne,Ke),Ie}function It(ne,Q,se,ye){if(typeof se=="object"&&se!==null&&se.type===f&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case l:e:{for(var Ie=se.key;Q!==null;){if(Q.key===Ie){if(Ie=se.type,Ie===f){if(Q.tag===7){c(ne,Q.sibling),ye=y(Q,se.props.children),ye.return=ne,ne=ye;break e}}else if(Q.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===_&&ux(Ie)===Q.type){c(ne,Q.sibling),ye=y(Q,se.props),Ws(ye,se),ye.return=ne,ne=ye;break e}c(ne,Q);break}else s(ne,Q);Q=Q.sibling}se.type===f?(ye=La(se.props.children,ne.mode,ye,se.key),ye.return=ne,ne=ye):(ye=rc(se.type,se.key,se.props,null,ne.mode,ye),Ws(ye,se),ye.return=ne,ne=ye)}return j(ne);case u:e:{for(Ie=se.key;Q!==null;){if(Q.key===Ie)if(Q.tag===4&&Q.stateNode.containerInfo===se.containerInfo&&Q.stateNode.implementation===se.implementation){c(ne,Q.sibling),ye=y(Q,se.children||[]),ye.return=ne,ne=ye;break e}else{c(ne,Q);break}else s(ne,Q);Q=Q.sibling}ye=tp(se,ne.mode,ye),ye.return=ne,ne=ye}return j(ne);case _:return Ie=se._init,se=Ie(se._payload),It(ne,Q,se,ye)}if(O(se))return Ue(ne,Q,se,ye);if(L(se)){if(Ie=L(se),typeof Ie!="function")throw Error(r(150));return se=Ie.call(se),Je(ne,Q,se,ye)}if(typeof se.then=="function")return It(ne,Q,Fu(se),ye);if(se.$$typeof===g)return It(ne,Q,ec(ne,se),ye);Iu(ne,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,Q!==null&&Q.tag===6?(c(ne,Q.sibling),ye=y(Q,se),ye.return=ne,ne=ye):(c(ne,Q),ye=ep(se,ne.mode,ye),ye.return=ne,ne=ye),j(ne)):c(ne,Q)}return function(ne,Q,se,ye){try{Ys=0;var Ie=It(ne,Q,se,ye);return Eo=null,Ie}catch(Ve){if(Ve===Vs)throw Ve;var ot=or(29,Ve,null,ne.mode);return ot.lanes=ye,ot.return=ne,ot}finally{}}}var ka=cx(!0),fx=cx(!1),_o=oe(null),Gu=oe(0);function dx(a,s){a=di,he(Gu,a),he(_o,s),di=a|s.baseLanes}function sh(){he(Gu,di),he(_o,_o.current)}function lh(){di=Gu.current,Ce(_o),Ce(Gu)}var rr=oe(null),Lr=null;function Li(a){var s=a.alternate;he(Yt,Yt.current&1),he(rr,a),Lr===null&&(s===null||_o.current!==null||s.memoizedState!==null)&&(Lr=a)}function hx(a){if(a.tag===22){if(he(Yt,Yt.current),he(rr,a),Lr===null){var s=a.alternate;s!==null&&s.memoizedState!==null&&(Lr=a)}}else zi()}function zi(){he(Yt,Yt.current),he(rr,rr.current)}function ni(a){Ce(rr),Lr===a&&(Lr=null),Ce(Yt)}var Yt=oe(0);function Uu(a){for(var s=a;s!==null;){if(s.tag===13){var c=s.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||c.data==="$?"||c.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if(s.flags&128)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break;for(;s.sibling===null;){if(s.return===null||s.return===a)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var VN=typeof AbortController<"u"?AbortController:function(){var a=[],s=this.signal={aborted:!1,addEventListener:function(c,h){a.push(h)}};this.abort=function(){s.aborted=!0,a.forEach(function(c){return c()})}},qN=e.unstable_scheduleCallback,YN=e.unstable_NormalPriority,Wt={$$typeof:g,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function uh(){return{controller:new VN,data:new Map,refCount:0}}function Xs(a){a.refCount--,a.refCount===0&&qN(YN,function(){a.controller.abort()})}var Ks=null,ch=0,ko=0,Co=null;function WN(a,s){if(Ks===null){var c=Ks=[];ch=0,ko=gp(),Co={status:"pending",value:void 0,then:function(h){c.push(h)}}}return ch++,s.then(px,px),s}function px(){if(--ch===0&&Ks!==null){Co!==null&&(Co.status="fulfilled");var a=Ks;Ks=null,ko=0,Co=null;for(var s=0;sb?b:8;var j=P.T,$={};P.T=$,Th(a,!1,s,c);try{var W=y(),J=P.S;if(J!==null&&J($,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var me=XN(W,h);Js(a,s,me,Hn(a))}else Js(a,s,h,Hn(a))}catch(_e){Js(a,s,{then:function(){},status:"rejected",reason:_e},Hn())}finally{X.p=b,P.T=j}}function eO(){}function kh(a,s,c,h){if(a.tag!==5)throw Error(r(476));var y=Vx(a).queue;Hx(a,y,s,re,c===null?eO:function(){return qx(a),c(h)})}function Vx(a){var s=a.memoizedState;if(s!==null)return s;s={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ri,lastRenderedState:re},next:null};var c={};return s.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ri,lastRenderedState:c},next:null},a.memoizedState=s,a=a.alternate,a!==null&&(a.memoizedState=s),s}function qx(a){var s=Vx(a).next.queue;Js(a,s,{},Hn())}function Ch(){return pn(bl)}function Yx(){return $t().memoizedState}function Wx(){return $t().memoizedState}function tO(a){for(var s=a.return;s!==null;){switch(s.tag){case 24:case 3:var c=Hn();a=Gi(c);var h=Ui(s,a,c);h!==null&&(_n(h,s,c),nl(h,s,c)),s={cache:uh()},a.payload=s;return}s=s.return}}function nO(a,s,c){var h=Hn();c={lane:h,revertLane:0,action:c,hasEagerState:!1,eagerState:null,next:null},Ku(a)?Kx(s,c):(c=nh(a,s,c,h),c!==null&&(_n(c,a,h),Zx(c,s,h)))}function Xx(a,s,c){var h=Hn();Js(a,s,c,h)}function Js(a,s,c,h){var y={lane:h,revertLane:0,action:c,hasEagerState:!1,eagerState:null,next:null};if(Ku(a))Kx(s,y);else{var b=a.alternate;if(a.lanes===0&&(b===null||b.lanes===0)&&(b=s.lastRenderedReducer,b!==null))try{var j=s.lastRenderedState,$=b(j,c);if(y.hasEagerState=!0,y.eagerState=$,Gn($,j))return ju(a,s,y,0),Rt===null&&Ou(),!1}catch{}finally{}if(c=nh(a,s,y,h),c!==null)return _n(c,a,h),Zx(c,s,h),!0}return!1}function Th(a,s,c,h){if(h={lane:2,revertLane:gp(),action:h,hasEagerState:!1,eagerState:null,next:null},Ku(a)){if(s)throw Error(r(479))}else s=nh(a,c,h,2),s!==null&&_n(s,a,2)}function Ku(a){var s=a.alternate;return a===it||s!==null&&s===it}function Kx(a,s){To=$u=!0;var c=a.pending;c===null?s.next=s:(s.next=c.next,c.next=s),a.pending=s}function Zx(a,s,c){if(c&4194176){var h=s.lanes;h&=a.pendingLanes,c|=h,s.lanes=c,gr(a,c)}}var zr={readContext:pn,use:qu,useCallback:Gt,useContext:Gt,useEffect:Gt,useImperativeHandle:Gt,useLayoutEffect:Gt,useInsertionEffect:Gt,useMemo:Gt,useReducer:Gt,useRef:Gt,useState:Gt,useDebugValue:Gt,useDeferredValue:Gt,useTransition:Gt,useSyncExternalStore:Gt,useId:Gt};zr.useCacheRefresh=Gt,zr.useMemoCache=Gt,zr.useHostTransitionStatus=Gt,zr.useFormState=Gt,zr.useActionState=Gt,zr.useOptimistic=Gt;var Aa={readContext:pn,use:qu,useCallback:function(a,s){return Nn().memoizedState=[a,s===void 0?null:s],a},useContext:pn,useEffect:Mx,useImperativeHandle:function(a,s,c){c=c!=null?c.concat([a]):null,Wu(4194308,4,Ix.bind(null,s,a),c)},useLayoutEffect:function(a,s){return Wu(4194308,4,a,s)},useInsertionEffect:function(a,s){Wu(4,2,a,s)},useMemo:function(a,s){var c=Nn();s=s===void 0?null:s;var h=a();if(Ta){at(!0);try{a()}finally{at(!1)}}return c.memoizedState=[h,s],h},useReducer:function(a,s,c){var h=Nn();if(c!==void 0){var y=c(s);if(Ta){at(!0);try{c(s)}finally{at(!1)}}}else y=s;return h.memoizedState=h.baseState=y,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:y},h.queue=a,a=a.dispatch=nO.bind(null,it,a),[h.memoizedState,a]},useRef:function(a){var s=Nn();return a={current:a},s.memoizedState=a},useState:function(a){a=xh(a);var s=a.queue,c=Xx.bind(null,it,s);return s.dispatch=c,[a.memoizedState,c]},useDebugValue:Eh,useDeferredValue:function(a,s){var c=Nn();return _h(c,a,s)},useTransition:function(){var a=xh(!1);return a=Hx.bind(null,it,a.queue,!0,!1),Nn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,s,c){var h=it,y=Nn();if(pt){if(c===void 0)throw Error(r(407));c=c()}else{if(c=s(),Rt===null)throw Error(r(349));ht&60||xx(h,s,c)}y.memoizedState=c;var b={value:c,getSnapshot:s};return y.queue=b,Mx(Sx.bind(null,h,b,a),[a]),h.flags|=2048,Ro(9,wx.bind(null,h,b,c,s),{destroy:void 0},null),c},useId:function(){var a=Nn(),s=Rt.identifierPrefix;if(pt){var c=ti,h=ei;c=(h&~(1<<32-At(h)-1)).toString(32)+c,s=":"+s+"R"+c,c=Hu++,0 title"))),sn(b,h,c),b[hn]=a,Kt(b),h=b;break e;case"link":var j=_0("link","href",y).get(h+(c.href||""));if(j){for(var $=0;$<\/script>",a=a.removeChild(a.firstChild);break;case"select":a=typeof h.is=="string"?y.createElement("select",{is:h.is}):y.createElement("select"),h.multiple?a.multiple=!0:h.size&&(a.size=h.size);break;default:a=typeof h.is=="string"?y.createElement(c,{is:h.is}):y.createElement(c)}}a[hn]=s,a[Rn]=h;e:for(y=s.child;y!==null;){if(y.tag===5||y.tag===6)a.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===s)break e;for(;y.sibling===null;){if(y.return===null||y.return===s)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}s.stateNode=a;e:switch(sn(a,c,h),c){case"button":case"input":case"select":case"textarea":a=!!h.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&ci(s)}}return jt(s),s.flags&=-16777217,null;case 6:if(a&&s.stateNode!=null)a.memoizedProps!==h&&ci(s);else{if(typeof h!="string"&&s.stateNode===null)throw Error(r(166));if(a=Pe.current,Bs(s)){if(a=s.stateNode,c=s.memoizedProps,h=null,y=En,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}a[hn]=s,a=!!(a.nodeValue===c||h!==null&&h.suppressHydrationWarning===!0||d0(a.nodeValue,c)),a||_a(s)}else a=mc(a).createTextNode(h),a[hn]=s,s.stateNode=a}return jt(s),null;case 13:if(h=s.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(y=Bs(s),h!==null&&h.dehydrated!==null){if(a===null){if(!y)throw Error(r(318));if(y=s.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[hn]=s}else $s(),!(s.flags&128)&&(s.memoizedState=null),s.flags|=4;jt(s),y=!1}else yr!==null&&(up(yr),yr=null),y=!0;if(!y)return s.flags&256?(ni(s),s):(ni(s),null)}if(ni(s),s.flags&128)return s.lanes=c,s;if(c=h!==null,a=a!==null&&a.memoizedState!==null,c){h=s.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool);var b=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(b=h.memoizedState.cachePool.pool),b!==y&&(h.flags|=2048)}return c!==a&&c&&(s.child.flags|=8192),ic(s,s.updateQueue),jt(s),null;case 4:return ee(),a===null&&xp(s.stateNode.containerInfo),jt(s),null;case 10:return oi(s.type),jt(s),null;case 19:if(Ce(Yt),y=s.memoizedState,y===null)return jt(s),null;if(h=(s.flags&128)!==0,b=y.rendering,b===null)if(h)ul(y,!1);else{if(Ft!==0||a!==null&&a.flags&128)for(a=s.child;a!==null;){if(b=Uu(a),b!==null){for(s.flags|=128,ul(y,!1),a=b.updateQueue,s.updateQueue=a,ic(s,a),s.subtreeFlags=0,a=c,c=s.child;c!==null;)Gw(c,a),c=c.sibling;return he(Yt,Yt.current&1|2),s.child}a=a.sibling}y.tail!==null&&ve()>ac&&(s.flags|=128,h=!0,ul(y,!1),s.lanes=4194304)}else{if(!h)if(a=Uu(b),a!==null){if(s.flags|=128,h=!0,a=a.updateQueue,s.updateQueue=a,ic(s,a),ul(y,!0),y.tail===null&&y.tailMode==="hidden"&&!b.alternate&&!pt)return jt(s),null}else 2*ve()-y.renderingStartTime>ac&&c!==536870912&&(s.flags|=128,h=!0,ul(y,!1),s.lanes=4194304);y.isBackwards?(b.sibling=s.child,s.child=b):(a=y.last,a!==null?a.sibling=b:s.child=b,y.last=b)}return y.tail!==null?(s=y.tail,y.rendering=s,y.tail=s.sibling,y.renderingStartTime=ve(),s.sibling=null,a=Yt.current,he(Yt,h?a&1|2:a&1),s):(jt(s),null);case 22:case 23:return ni(s),lh(),h=s.memoizedState!==null,a!==null?a.memoizedState!==null!==h&&(s.flags|=8192):h&&(s.flags|=8192),h?c&536870912&&!(s.flags&128)&&(jt(s),s.subtreeFlags&6&&(s.flags|=8192)):jt(s),c=s.updateQueue,c!==null&&ic(s,c.retryQueue),c=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==c&&(s.flags|=2048),a!==null&&Ce(Ca),null;case 24:return c=null,a!==null&&(c=a.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),oi(Wt),jt(s),null;case 25:return null}throw Error(r(156,s.tag))}function uO(a,s){switch(ih(s),s.tag){case 1:return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 3:return oi(Wt),ee(),a=s.flags,a&65536&&!(a&128)?(s.flags=a&-65537|128,s):null;case 26:case 27:case 5:return Te(s),null;case 13:if(ni(s),a=s.memoizedState,a!==null&&a.dehydrated!==null){if(s.alternate===null)throw Error(r(340));$s()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 19:return Ce(Yt),null;case 4:return ee(),null;case 10:return oi(s.type),null;case 22:case 23:return ni(s),lh(),a!==null&&Ce(Ca),a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 24:return oi(Wt),null;case 25:return null;default:return null}}function $w(a,s){switch(ih(s),s.tag){case 3:oi(Wt),ee();break;case 26:case 27:case 5:Te(s);break;case 4:ee();break;case 13:ni(s);break;case 19:Ce(Yt);break;case 10:oi(s.type);break;case 22:case 23:ni(s),lh(),a!==null&&Ce(Ca);break;case 24:oi(Wt)}}var cO={getCacheForType:function(a){var s=pn(Wt),c=s.data.get(a);return c===void 0&&(c=a(),s.data.set(a,c)),c}},fO=typeof WeakMap=="function"?WeakMap:Map,Lt=0,Rt=null,lt=null,ht=0,Dt=0,$n=null,fi=!1,jo=!1,np=!1,di=0,Ft=0,qi=0,za=0,rp=0,sr=0,Lo=0,cl=null,Mr=null,ip=!1,ap=0,ac=1/0,oc=null,Yi=null,sc=!1,Ma=null,fl=0,op=0,sp=null,dl=0,lp=null;function Hn(){if(Lt&2&&ht!==0)return ht&-ht;if(P.T!==null){var a=ko;return a!==0?a:gp()}return cb()}function Hw(){sr===0&&(sr=!(ht&536870912)||pt?_t():536870912);var a=rr.current;return a!==null&&(a.flags|=32),sr}function _n(a,s,c){(a===Rt&&Dt===2||a.cancelPendingCommit!==null)&&(zo(a,0),hi(a,ht,sr,!1)),Tn(a,c),(!(Lt&2)||a!==Rt)&&(a===Rt&&(!(Lt&2)&&(za|=c),Ft===4&&hi(a,ht,sr,!1)),Pr(a))}function Vw(a,s,c){if(Lt&6)throw Error(r(327));var h=!c&&(s&60)===0&&(s&a.expiredLanes)===0||Ze(a,s),y=h?pO(a,s):dp(a,s,!0),b=h;do{if(y===0){jo&&!h&&hi(a,s,0,!1);break}else if(y===6)hi(a,s,0,!fi);else{if(c=a.current.alternate,b&&!dO(c)){y=dp(a,s,!1),b=!1;continue}if(y===2){if(b=s,a.errorRecoveryDisabledLanes&b)var j=0;else j=a.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){s=j;e:{var $=a;y=cl;var W=$.current.memoizedState.isDehydrated;if(W&&(zo($,j).flags|=256),j=dp($,j,!1),j!==2){if(np&&!W){$.errorRecoveryDisabledLanes|=b,za|=b,y=4;break e}b=Mr,Mr=y,b!==null&&up(b)}y=j}if(b=!1,y!==2)continue}}if(y===1){zo(a,0),hi(a,s,0,!0);break}e:{switch(h=a,y){case 0:case 1:throw Error(r(345));case 4:if((s&4194176)===s){hi(h,s,sr,!fi);break e}break;case 2:Mr=null;break;case 3:case 5:break;default:throw Error(r(329))}if(h.finishedWork=c,h.finishedLanes=s,(s&62914560)===s&&(b=ap+300-ve(),10c?32:c,P.T=null,Ma===null)var b=!1;else{c=sp,sp=null;var j=Ma,$=fl;if(Ma=null,fl=0,Lt&6)throw Error(r(331));var W=Lt;if(Lt|=4,Fw(j.current),zw(j,j.current,$,c),Lt=W,hl(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(bt,j)}catch{}b=!0}return b}finally{X.p=y,P.T=h,e0(a,s)}}return!1}function t0(a,s,c){s=er(c,s),s=Dh(a.stateNode,s,2),a=Ui(a,s,2),a!==null&&(Tn(a,2),Pr(a))}function kt(a,s,c){if(a.tag===3)t0(a,a,c);else for(;s!==null;){if(s.tag===3){t0(s,a,c);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Yi===null||!Yi.has(h))){a=er(c,a),c=iw(2),h=Ui(s,c,2),h!==null&&(aw(c,h,s,a),Tn(h,2),Pr(h));break}}s=s.return}}function hp(a,s,c){var h=a.pingCache;if(h===null){h=a.pingCache=new fO;var y=new Set;h.set(s,y)}else y=h.get(s),y===void 0&&(y=new Set,h.set(s,y));y.has(c)||(np=!0,y.add(c),a=vO.bind(null,a,s,c),s.then(a,a))}function vO(a,s,c){var h=a.pingCache;h!==null&&h.delete(s),a.pingedLanes|=a.suspendedLanes&c,a.warmLanes&=~c,Rt===a&&(ht&c)===c&&(Ft===4||Ft===3&&(ht&62914560)===ht&&300>ve()-ap?!(Lt&2)&&zo(a,0):rp|=c,Lo===ht&&(Lo=0)),Pr(a)}function n0(a,s){s===0&&(s=Cn()),a=ji(a,s),a!==null&&(Tn(a,s),Pr(a))}function yO(a){var s=a.memoizedState,c=0;s!==null&&(c=s.retryLane),n0(a,c)}function bO(a,s){var c=0;switch(a.tag){case 13:var h=a.stateNode,y=a.memoizedState;y!==null&&(c=y.retryLane);break;case 19:h=a.stateNode;break;case 22:h=a.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(s),n0(a,c)}function xO(a,s){return Se(a,s)}var cc=null,Fo=null,pp=!1,fc=!1,mp=!1,Pa=0;function Pr(a){a!==Fo&&a.next===null&&(Fo===null?cc=Fo=a:Fo=Fo.next=a),fc=!0,pp||(pp=!0,SO(wO))}function hl(a,s){if(!mp&&fc){mp=!0;do for(var c=!1,h=cc;h!==null;){if(a!==0){var y=h.pendingLanes;if(y===0)var b=0;else{var j=h.suspendedLanes,$=h.pingedLanes;b=(1<<31-At(42|a)+1)-1,b&=y&~(j&~$),b=b&201326677?b&201326677|1:b?b|2:0}b!==0&&(c=!0,a0(h,b))}else b=ht,b=oo(h,h===Rt?b:0),!(b&3)||Ze(h,b)||(c=!0,a0(h,b));h=h.next}while(c);mp=!1}}function wO(){fc=pp=!1;var a=0;Pa!==0&&(DO()&&(a=Pa),Pa=0);for(var s=ve(),c=null,h=cc;h!==null;){var y=h.next,b=r0(h,s);b===0?(h.next=null,c===null?cc=y:c.next=y,y===null&&(Fo=c)):(c=h,(a!==0||b&3)&&(fc=!0)),h=y}hl(a)}function r0(a,s){for(var c=a.suspendedLanes,h=a.pingedLanes,y=a.expirationTimes,b=a.pendingLanes&-62914561;0"u"?null:document;function x0(a,s,c){var h=Go;if(h&&typeof s=="string"&&s){var y=Qn(s);y='link[rel="'+a+'"][href="'+y+'"]',typeof c=="string"&&(y+='[crossorigin="'+c+'"]'),b0.has(y)||(b0.add(y),a={rel:a,crossOrigin:c,href:s},h.querySelector(y)===null&&(s=h.createElement("link"),sn(s,"link",a),Kt(s),h.head.appendChild(s)))}}function FO(a){pi.D(a),x0("dns-prefetch",a,null)}function IO(a,s){pi.C(a,s),x0("preconnect",a,s)}function GO(a,s,c){pi.L(a,s,c);var h=Go;if(h&&a&&s){var y='link[rel="preload"][as="'+Qn(s)+'"]';s==="image"&&c&&c.imageSrcSet?(y+='[imagesrcset="'+Qn(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(y+='[imagesizes="'+Qn(c.imageSizes)+'"]')):y+='[href="'+Qn(a)+'"]';var b=y;switch(s){case"style":b=Uo(a);break;case"script":b=Bo(a)}lr.has(b)||(a=z({rel:"preload",href:s==="image"&&c&&c.imageSrcSet?void 0:a,as:s},c),lr.set(b,a),h.querySelector(y)!==null||s==="style"&&h.querySelector(gl(b))||s==="script"&&h.querySelector(vl(b))||(s=h.createElement("link"),sn(s,"link",a),Kt(s),h.head.appendChild(s)))}}function UO(a,s){pi.m(a,s);var c=Go;if(c&&a){var h=s&&typeof s.as=="string"?s.as:"script",y='link[rel="modulepreload"][as="'+Qn(h)+'"][href="'+Qn(a)+'"]',b=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=Bo(a)}if(!lr.has(b)&&(a=z({rel:"modulepreload",href:a},s),lr.set(b,a),c.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(vl(b)))return}h=c.createElement("link"),sn(h,"link",a),Kt(h),c.head.appendChild(h)}}}function BO(a,s,c){pi.S(a,s,c);var h=Go;if(h&&a){var y=uo(h).hoistableStyles,b=Uo(a);s=s||"default";var j=y.get(b);if(!j){var $={loading:0,preload:null};if(j=h.querySelector(gl(b)))$.loading=5;else{a=z({rel:"stylesheet",href:a,"data-precedence":s},c),(c=lr.get(b))&&Rp(a,c);var W=j=h.createElement("link");Kt(W),sn(W,"link",a),W._p=new Promise(function(J,me){W.onload=J,W.onerror=me}),W.addEventListener("load",function(){$.loading|=1}),W.addEventListener("error",function(){$.loading|=2}),$.loading|=4,vc(j,s,h)}j={type:"stylesheet",instance:j,count:1,state:$},y.set(b,j)}}}function $O(a,s){pi.X(a,s);var c=Go;if(c&&a){var h=uo(c).hoistableScripts,y=Bo(a),b=h.get(y);b||(b=c.querySelector(vl(y)),b||(a=z({src:a,async:!0},s),(s=lr.get(y))&&Dp(a,s),b=c.createElement("script"),Kt(b),sn(b,"link",a),c.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},h.set(y,b))}}function HO(a,s){pi.M(a,s);var c=Go;if(c&&a){var h=uo(c).hoistableScripts,y=Bo(a),b=h.get(y);b||(b=c.querySelector(vl(y)),b||(a=z({src:a,async:!0,type:"module"},s),(s=lr.get(y))&&Dp(a,s),b=c.createElement("script"),Kt(b),sn(b,"link",a),c.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},h.set(y,b))}}function w0(a,s,c,h){var y=(y=Pe.current)?gc(y):null;if(!y)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(s=Uo(c.href),c=uo(y).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"){a=Uo(c.href);var b=uo(y).hoistableStyles,j=b.get(a);if(j||(y=y.ownerDocument||y,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(a,j),(b=y.querySelector(gl(a)))&&!b._p&&(j.instance=b,j.state.loading=5),lr.has(a)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},lr.set(a,c),b||VO(y,a,c,j.state))),s&&h===null)throw Error(r(528,""));return j}if(s&&h!==null)throw Error(r(529,""));return null;case"script":return s=c.async,c=c.src,typeof c=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Bo(c),c=uo(y).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(r(444,a))}}function Uo(a){return'href="'+Qn(a)+'"'}function gl(a){return'link[rel="stylesheet"]['+a+"]"}function S0(a){return z({},a,{"data-precedence":a.precedence,precedence:null})}function VO(a,s,c,h){a.querySelector('link[rel="preload"][as="style"]['+s+"]")?h.loading=1:(s=a.createElement("link"),h.preload=s,s.addEventListener("load",function(){return h.loading|=1}),s.addEventListener("error",function(){return h.loading|=2}),sn(s,"link",c),Kt(s),a.head.appendChild(s))}function Bo(a){return'[src="'+Qn(a)+'"]'}function vl(a){return"script[async]"+a}function E0(a,s,c){if(s.count++,s.instance===null)switch(s.type){case"style":var h=a.querySelector('style[data-href~="'+Qn(c.href)+'"]');if(h)return s.instance=h,Kt(h),h;var y=z({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return h=(a.ownerDocument||a).createElement("style"),Kt(h),sn(h,"style",y),vc(h,c.precedence,a),s.instance=h;case"stylesheet":y=Uo(c.href);var b=a.querySelector(gl(y));if(b)return s.state.loading|=4,s.instance=b,Kt(b),b;h=S0(c),(y=lr.get(y))&&Rp(h,y),b=(a.ownerDocument||a).createElement("link"),Kt(b);var j=b;return j._p=new Promise(function($,W){j.onload=$,j.onerror=W}),sn(b,"link",h),s.state.loading|=4,vc(b,c.precedence,a),s.instance=b;case"script":return b=Bo(c.src),(y=a.querySelector(vl(b)))?(s.instance=y,Kt(y),y):(h=c,(y=lr.get(b))&&(h=z({},c),Dp(h,y)),a=a.ownerDocument||a,y=a.createElement("script"),Kt(y),sn(y,"link",h),a.head.appendChild(y),s.instance=y);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&!(s.state.loading&4)&&(h=s.instance,s.state.loading|=4,vc(h,c.precedence,a));return s.instance}function vc(a,s,c){for(var h=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,b=y,j=0;j title"):null)}function qO(a,s,c){if(c===1||s.itemProp!=null)return!1;switch(a){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;switch(s.rel){case"stylesheet":return a=s.disabled,typeof s.precedence=="string"&&a==null;default:return!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 C0(a){return!(a.type==="stylesheet"&&!(a.state.loading&3))}var yl=null;function YO(){}function WO(a,s,c){if(yl===null)throw Error(r(475));var h=yl;if(s.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&!(s.state.loading&4)){if(s.instance===null){var y=Uo(c.href),b=a.querySelector(gl(y));if(b){a=b._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(h.count++,h=bc.bind(h),a.then(h,h)),s.state.loading|=4,s.instance=b,Kt(b);return}b=a.ownerDocument||a,c=S0(c),(y=lr.get(y))&&Rp(c,y),b=b.createElement("link"),Kt(b);var j=b;j._p=new Promise(function($,W){j.onload=$,j.onerror=W}),sn(b,"link",c),s.instance=b}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(s,a),(a=s.state.preload)&&!(s.state.loading&3)&&(h.count++,s=bc.bind(h),a.addEventListener("load",s),a.addEventListener("error",s))}}function XO(){if(yl===null)throw Error(r(475));var a=yl;return a.stylesheets&&a.count===0&&Np(a,a.stylesheets),0"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Gp.exports=gj(),Gp.exports}var yj=vj();const W0=e=>{let t;const n=new Set,r=(d,p)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const v=t;t=p??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(g=>g(t,v))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>f,subscribe:d=>(n.add(d),()=>n.delete(d))},f=t=e(r,i,u);return u},bj=e=>e?W0(e):W0,xj=e=>e;function wj(e,t=xj){const n=be.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return be.useDebugValue(n),n}const Sj=e=>{const t=bj(e),n=r=>wj(t,r);return Object.assign(n,t),n},Tv=e=>Sj;function D_(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const l=f=>f===null?null:JSON.parse(f,void 0),u=(o=n.getItem(i))!=null?o:null;return u instanceof Promise?u.then(l):l(u)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const bg=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return bg(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return bg(r)(n)}}}},Ej=(e,t)=>(n,r,i)=>{let o={storage:D_(()=>localStorage),partialize:x=>x,version:0,merge:(x,k)=>({...k,...x}),...t},l=!1;const u=new Set,f=new Set;let d=o.storage;if(!d)return e((...x)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...x)},r,i);const p=()=>{const x=o.partialize({...r()});return d.setItem(o.name,{state:x,version:o.version})},m=i.setState;i.setState=(x,k)=>{m(x,k),p()};const v=e((...x)=>{n(...x),p()},r,i);i.getInitialState=()=>v;let g;const w=()=>{var x,k;if(!d)return;l=!1,u.forEach(_=>{var T;return _((T=r())!=null?T:v)});const C=((k=o.onRehydrateStorage)==null?void 0:k.call(o,(x=r())!=null?x:v))||void 0;return bg(d.getItem.bind(d))(o.name).then(_=>{if(_)if(typeof _.version=="number"&&_.version!==o.version){if(o.migrate){const T=o.migrate(_.state,_.version);return T instanceof Promise?T.then(N=>[!0,N]):[!0,T]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,_.state];return[!1,void 0]}).then(_=>{var T;const[N,D]=_;if(g=o.merge(D,(T=r())!=null?T:v),n(g,!0),N)return p()}).then(()=>{C==null||C(g,void 0),g=r(),l=!0,f.forEach(_=>_(g))}).catch(_=>{C==null||C(void 0,_)})};return i.persist={setOptions:x=>{o={...o,...x},x.storage&&(d=x.storage)},clearStorage:()=>{d==null||d.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>w(),hasHydrated:()=>l,onHydrate:x=>(u.add(x),()=>{u.delete(x)}),onFinishHydration:x=>(f.add(x),()=>{f.delete(x)})},o.skipHydration||w(),g||v},_j=Ej;function N_(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const t=Tj(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const u=l.split(Av);return u[0]===""&&u.length!==1&&u.shift(),j_(u,t)||Cj(l)},getConflictingClassGroupIds:(l,u)=>{const f=n[l]||[];return u&&r[l]?[...f,...r[l]]:f}}},j_=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?j_(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(Av);return(l=t.validators.find(({validator:u})=>u(o)))==null?void 0:l.classGroupId},X0=/^\[(.+)\]$/,Cj=e=>{if(X0.test(e)){const t=X0.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Tj=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const i in n)xg(n[i],r,i,t);return r},xg=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:K0(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(Aj(i)){xg(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,l])=>{xg(l,K0(t,o),n,r)})})},K0=(e,t)=>{let n=e;return t.split(Av).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Aj=e=>e.isThemeGetter,Rj=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,l)=>{n.set(o,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let l=n.get(o);if(l!==void 0)return l;if((l=r.get(o))!==void 0)return i(o,l),l},set(o,l){n.has(o)?n.set(o,l):i(o,l)}}},wg="!",Sg=":",Dj=Sg.length,Nj=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let l=0,u=0,f=0,d;for(let w=0;wf?d-f:void 0;return{modifiers:o,hasImportantModifier:v,baseClassName:m,maybePostfixModifierPosition:g}};if(t){const i=t+Sg,o=r;r=l=>l.startsWith(i)?o(l.substring(i.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:l,maybePostfixModifierPosition:void 0}}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},Oj=e=>e.endsWith(wg)?e.substring(0,e.length-1):e.startsWith(wg)?e.substring(1):e,jj=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const i=[];let o=[];return r.forEach(l=>{l[0]==="["||t[l]?(i.push(...o.sort(),l),o=[]):o.push(l)}),i.push(...o.sort()),i}},Lj=e=>({cache:Rj(e.cacheSize),parseClassName:Nj(e),sortModifiers:jj(e),...kj(e)}),zj=/\s+/,Mj=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,l=[],u=e.trim().split(zj);let f="";for(let d=u.length-1;d>=0;d-=1){const p=u[d],{isExternal:m,modifiers:v,hasImportantModifier:g,baseClassName:w,maybePostfixModifierPosition:x}=n(p);if(m){f=p+(f.length>0?" "+f:f);continue}let k=!!x,C=r(k?w.substring(0,x):w);if(!C){if(!k){f=p+(f.length>0?" "+f:f);continue}if(C=r(w),!C){f=p+(f.length>0?" "+f:f);continue}k=!1}const _=o(v).join(":"),T=g?_+wg:_,N=T+C;if(l.includes(N))continue;l.push(N);const D=i(C,k);for(let L=0;L0?" "+f:f)}return f};function Pj(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rm(p),e());return n=Lj(d),r=n.cache.get,i=n.cache.set,o=u,u(f)}function u(f){const d=r(f);if(d)return d;const p=Mj(f,n);return i(f,p),p}return function(){return o(Pj.apply(null,arguments))}}const en=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},z_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,M_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ij=/^\d+\/\d+$/,Gj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Uj=/\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$/,Bj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,$j=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Hj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$o=e=>Ij.test(e),ct=e=>!!e&&!Number.isNaN(Number(e)),Fa=e=>!!e&&Number.isInteger(Number(e)),Z0=e=>e.endsWith("%")&&ct(e.slice(0,-1)),Ji=e=>Gj.test(e),Vj=()=>!0,qj=e=>Uj.test(e)&&!Bj.test(e),Rv=()=>!1,Yj=e=>$j.test(e),Wj=e=>Hj.test(e),Xj=e=>!Le(e)&&!ze(e),Kj=e=>ms(e,I_,Rv),Le=e=>z_.test(e),Ia=e=>ms(e,G_,qj),Hp=e=>ms(e,sL,ct),Zj=e=>ms(e,P_,Rv),Qj=e=>ms(e,F_,Wj),Jj=e=>ms(e,Rv,Yj),ze=e=>M_.test(e),Ac=e=>gs(e,G_),eL=e=>gs(e,lL),tL=e=>gs(e,P_),nL=e=>gs(e,I_),rL=e=>gs(e,F_),iL=e=>gs(e,uL,!0),ms=(e,t,n)=>{const r=z_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},gs=(e,t,n=!1)=>{const r=M_.exec(e);return r?r[1]?t(r[1]):n:!1},P_=e=>e==="position",aL=new Set(["image","url"]),F_=e=>aL.has(e),oL=new Set(["length","size","percentage"]),I_=e=>oL.has(e),G_=e=>e==="length",sL=e=>e==="number",lL=e=>e==="family-name",uL=e=>e==="shadow",cL=()=>{const e=en("color"),t=en("font"),n=en("text"),r=en("font-weight"),i=en("tracking"),o=en("leading"),l=en("breakpoint"),u=en("container"),f=en("spacing"),d=en("radius"),p=en("shadow"),m=en("inset-shadow"),v=en("drop-shadow"),g=en("blur"),w=en("perspective"),x=en("aspect"),k=en("ease"),C=en("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],N=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],L=()=>[$o,"px","full","auto",ze,Le,f],R=()=>[Fa,"none","subgrid",ze,Le],U=()=>["auto",{span:["full",Fa,ze,Le]},ze,Le],P=()=>[Fa,"auto",ze,Le],z=()=>["auto","min","max","fr",ze,Le],V=()=>[ze,Le,f],q=()=>["start","end","center","between","around","evenly","stretch","baseline"],I=()=>["start","end","center","stretch"],Y=()=>[ze,Le,f],Z=()=>["px",...Y()],B=()=>["px","auto",...Y()],G=()=>[$o,"auto","px","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",ze,Le,f],F=()=>[e,ze,Le],K=()=>[Z0,Ia],A=()=>["","none","full",d,ze,Le],H=()=>["",ct,Ac,Ia],M=()=>["solid","dashed","dotted","double"],O=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>["","none",g,ze,Le],re=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ze,Le],ue=()=>["none",ct,ze,Le],ae=()=>["none",ct,ze,Le],oe=()=>[ct,ze,Le],Ce=()=>[$o,"full","px",ze,Le,f];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ji],breakpoint:[Ji],color:[Vj],container:[Ji],"drop-shadow":[Ji],ease:["in","out","in-out"],font:[Xj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ji],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ji],shadow:[Ji],spacing:[ct],text:[Ji],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",$o,Le,ze,x]}],container:["container"],columns:[{columns:[ct,Le,ze,u]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:[...T(),Le,ze]}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[Fa,"auto",ze,Le]}],basis:[{basis:[$o,"full","auto",ze,Le,u,f]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ct,$o,"auto","initial","none",Le]}],grow:[{grow:["",ct,ze,Le]}],shrink:[{shrink:["",ct,ze,Le]}],order:[{order:[Fa,"first","last","none",ze,Le]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":z()}],"auto-rows":[{"auto-rows":z()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...q(),"normal"]}],"justify-items":[{"justify-items":[...I(),"normal"]}],"justify-self":[{"justify-self":["auto",...I()]}],"align-content":[{content:["normal",...q()]}],"align-items":[{items:[...I(),"baseline"]}],"align-self":[{self:["auto",...I(),"baseline"]}],"place-content":[{"place-content":q()}],"place-items":[{"place-items":[...I(),"baseline"]}],"place-self":[{"place-self":["auto",...I()]}],p:[{p:Z()}],px:[{px:Z()}],py:[{py:Z()}],ps:[{ps:Z()}],pe:[{pe:Z()}],pt:[{pt:Z()}],pr:[{pr:Z()}],pb:[{pb:Z()}],pl:[{pl:Z()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":Y()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Y()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],w:[{w:[u,"screen",...G()]}],"min-w":[{"min-w":[u,"screen","none",...G()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...G()]}],h:[{h:["screen",...G()]}],"min-h":[{"min-h":["screen","none",...G()]}],"max-h":[{"max-h":["screen",...G()]}],"font-size":[{text:["base",n,Ac,Ia]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ze,Hp]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Z0,Le]}],"font-family":[{font:[eL,Le,t]}],"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:[i,ze,Le]}],"line-clamp":[{"line-clamp":[ct,"none",ze,Hp]}],leading:[{leading:[ze,Le,o,f]}],"list-image":[{"list-image":["none",ze,Le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ze,Le]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:[ct,"from-font","auto",ze,Ia]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[ct,"auto",ze,Le]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:["px",...Y()]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ze,Le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ze,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:[...T(),tL,Zj]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",nL,Kj]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Fa,ze,Le],radial:["",ze,Le],conic:[Fa,ze,Le]},rL,Qj]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:A()}],"rounded-s":[{"rounded-s":A()}],"rounded-e":[{"rounded-e":A()}],"rounded-t":[{"rounded-t":A()}],"rounded-r":[{"rounded-r":A()}],"rounded-b":[{"rounded-b":A()}],"rounded-l":[{"rounded-l":A()}],"rounded-ss":[{"rounded-ss":A()}],"rounded-se":[{"rounded-se":A()}],"rounded-ee":[{"rounded-ee":A()}],"rounded-es":[{"rounded-es":A()}],"rounded-tl":[{"rounded-tl":A()}],"rounded-tr":[{"rounded-tr":A()}],"rounded-br":[{"rounded-br":A()}],"rounded-bl":[{"rounded-bl":A()}],"border-w":[{border:H()}],"border-w-x":[{"border-x":H()}],"border-w-y":[{"border-y":H()}],"border-w-s":[{"border-s":H()}],"border-w-e":[{"border-e":H()}],"border-w-t":[{"border-t":H()}],"border-w-r":[{"border-r":H()}],"border-w-b":[{"border-b":H()}],"border-w-l":[{"border-l":H()}],"divide-x":[{"divide-x":H()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":H()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...M(),"hidden","none"]}],"divide-style":[{divide:[...M(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...M(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ct,ze,Le]}],"outline-w":[{outline:["",ct,Ac,Ia]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",p,iL,Jj]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",ze,Le,m]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[ct,Ia]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":F()}],opacity:[{opacity:[ct,ze,Le]}],"mix-blend":[{"mix-blend":[...O(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":O()}],filter:[{filter:["","none",ze,Le]}],blur:[{blur:X()}],brightness:[{brightness:[ct,ze,Le]}],contrast:[{contrast:[ct,ze,Le]}],"drop-shadow":[{"drop-shadow":["","none",v,ze,Le]}],grayscale:[{grayscale:["",ct,ze,Le]}],"hue-rotate":[{"hue-rotate":[ct,ze,Le]}],invert:[{invert:["",ct,ze,Le]}],saturate:[{saturate:[ct,ze,Le]}],sepia:[{sepia:["",ct,ze,Le]}],"backdrop-filter":[{"backdrop-filter":["","none",ze,Le]}],"backdrop-blur":[{"backdrop-blur":X()}],"backdrop-brightness":[{"backdrop-brightness":[ct,ze,Le]}],"backdrop-contrast":[{"backdrop-contrast":[ct,ze,Le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ct,ze,Le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ct,ze,Le]}],"backdrop-invert":[{"backdrop-invert":["",ct,ze,Le]}],"backdrop-opacity":[{"backdrop-opacity":[ct,ze,Le]}],"backdrop-saturate":[{"backdrop-saturate":[ct,ze,Le]}],"backdrop-sepia":[{"backdrop-sepia":["",ct,ze,Le]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Y()}],"border-spacing-x":[{"border-spacing-x":Y()}],"border-spacing-y":[{"border-spacing-y":Y()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ze,Le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ct,"initial",ze,Le]}],ease:[{ease:["linear","initial",k,ze,Le]}],delay:[{delay:[ct,ze,Le]}],animate:[{animate:["none",C,ze,Le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,ze,Le]}],"perspective-origin":[{"perspective-origin":re()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[ze,Le,"","none","gpu","cpu"]}],"transform-origin":[{origin:re()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ce()}],"translate-x":[{"translate-x":Ce()}],"translate-y":[{"translate-y":Ce()}],"translate-z":[{"translate-z":Ce()}],"translate-none":["translate-none"],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"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",ze,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":Y()}],"scroll-mx":[{"scroll-mx":Y()}],"scroll-my":[{"scroll-my":Y()}],"scroll-ms":[{"scroll-ms":Y()}],"scroll-me":[{"scroll-me":Y()}],"scroll-mt":[{"scroll-mt":Y()}],"scroll-mr":[{"scroll-mr":Y()}],"scroll-mb":[{"scroll-mb":Y()}],"scroll-ml":[{"scroll-ml":Y()}],"scroll-p":[{"scroll-p":Y()}],"scroll-px":[{"scroll-px":Y()}],"scroll-py":[{"scroll-py":Y()}],"scroll-ps":[{"scroll-ps":Y()}],"scroll-pe":[{"scroll-pe":Y()}],"scroll-pt":[{"scroll-pt":Y()}],"scroll-pr":[{"scroll-pr":Y()}],"scroll-pb":[{"scroll-pb":Y()}],"scroll-pl":[{"scroll-pl":Y()}],"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",ze,Le]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[ct,Ac,Ia,Hp]}],stroke:[{stroke:["none",...F()]}],"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-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-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:["before","after","placeholder","file","marker","selection","first-line","first-letter","backdrop","*","**"]}},fL=Fj(cL);function Me(...e){return fL(O_(e))}function dL(){const e="0123456789abcdef";let t="#";for(let n=0;n<6;n++)t+=e.charAt(Math.floor(Math.random()*16));return t}function Cr(e){return e instanceof Error?e.message:`${e}`}const Dv=e=>{const t=e;t.use={};for(const n of Object.keys(t.getState()))t.use[n]=()=>t(r=>r[n]);return t},U_="",$r="ghost",hL="#B2EBF2",pL="#000",mL="#E2E2E2",gL="#EEEEEE",vL="#F57F17",yL="#969696",bL="#F57F17",Q0="#B2EBF2",Vp=20,J0=4,xL=20,wL=15,e1="*",SL={"text/plain":[".txt",".md"],"application/pdf":[".pdf"],"application/msword":[".doc"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[".pptx"]},t1={name:"LightRAG",github:"https://github.com/HKUDS/LightRAG"},EL=Tv()(_j(e=>({theme:"system",showPropertyPanel:!0,showNodeSearchBar:!0,showNodeLabel:!0,enableNodeDrag:!0,showEdgeLabel:!1,enableHideUnselectedEdges:!0,enableEdgeEvents:!1,queryLabel:e1,enableHealthCheck:!0,apiKey:null,currentTab:"documents",retrievalHistory:[],querySettings:{mode:"global",response_type:"Multiple Paragraphs",top_k:10,max_token_for_text_unit:4e3,max_token_for_global_context:4e3,max_token_for_local_context:4e3,only_need_context:!1,only_need_prompt:!1,stream:!0,history_turns:3,hl_keywords:[],ll_keywords:[]},setTheme:t=>e({theme:t}),setQueryLabel:t=>e({queryLabel:t}),setEnableHealthCheck:t=>e({enableHealthCheck:t}),setApiKey:t=>e({apiKey:t}),setCurrentTab:t=>e({currentTab:t}),setRetrievalHistory:t=>e({retrievalHistory:t}),updateQuerySettings:t=>e(n=>({querySettings:{...n.querySettings,...t}}))}),{name:"settings-storage",storage:D_(()=>localStorage),version:6,migrate:(e,t)=>(t<2&&(e.showEdgeLabel=!1),t<3&&(e.queryLabel=e1),t<4&&(e.showPropertyPanel=!0,e.showNodeSearchBar=!0,e.showNodeLabel=!0,e.enableHealthCheck=!0,e.apiKey=null),t<5&&(e.currentTab="documents"),t<6&&(e.querySettings={mode:"global",response_type:"Multiple Paragraphs",top_k:10,max_token_for_text_unit:4e3,max_token_for_global_context:4e3,max_token_for_local_context:4e3,only_need_context:!1,only_need_prompt:!1,stream:!0,history_turns:3,hl_keywords:[],ll_keywords:[]},e.retrievalHistory=[]),e)})),Qe=Dv(EL),_L={theme:"system",setTheme:()=>null},B_=E.createContext(_L);function kL({children:e,...t}){const[n,r]=E.useState(Qe.getState().theme);E.useEffect(()=>{const o=window.document.documentElement;if(o.classList.remove("light","dark"),n==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";o.classList.add(l),r(l);return}o.classList.add(n)},[n]);const i={theme:n,setTheme:o=>{Qe.getState().setTheme(o),r(o)}};return S.jsx(B_.Provider,{...t,value:i,children:e})}const n1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,r1=O_,$_=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return r1(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,l=Object.keys(i).map(d=>{const p=n==null?void 0:n[d],m=o==null?void 0:o[d];if(p===null)return null;const v=n1(p)||n1(m);return i[d][v]}),u=n&&Object.entries(n).reduce((d,p)=>{let[m,v]=p;return v===void 0||(d[m]=v),d},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,p)=>{let{class:m,className:v,...g}=p;return Object.entries(g).every(w=>{let[x,k]=w;return Array.isArray(k)?k.includes({...o,...u}[x]):{...o,...u}[x]===k})?[...d,m,v]:d},[]);return r1(e,l,f,n==null?void 0:n.class,n==null?void 0:n.className)},CL=$_("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),H_=E.forwardRef(({className:e,variant:t,...n},r)=>S.jsx("div",{ref:r,role:"alert",className:Me(CL({variant:t}),e),...n}));H_.displayName="Alert";const V_=E.forwardRef(({className:e,...t},n)=>S.jsx("h5",{ref:n,className:Me("mb-1 leading-none font-medium tracking-tight",e),...t}));V_.displayName="AlertTitle";const q_=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("text-sm [&_p]:leading-relaxed",e),...t}));q_.displayName="AlertDescription";function Y_(e,t){return function(){return e.apply(t,arguments)}}const{toString:TL}=Object.prototype,{getPrototypeOf:Nv}=Object,qf=(e=>t=>{const n=TL.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Dr=e=>(e=e.toLowerCase(),t=>qf(t)===e),Yf=e=>t=>typeof t===e,{isArray:vs}=Array,Vl=Yf("undefined");function AL(e){return e!==null&&!Vl(e)&&e.constructor!==null&&!Vl(e.constructor)&&Yn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const W_=Dr("ArrayBuffer");function RL(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&W_(e.buffer),t}const DL=Yf("string"),Yn=Yf("function"),X_=Yf("number"),Wf=e=>e!==null&&typeof e=="object",NL=e=>e===!0||e===!1,tf=e=>{if(qf(e)!=="object")return!1;const t=Nv(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},OL=Dr("Date"),jL=Dr("File"),LL=Dr("Blob"),zL=Dr("FileList"),ML=e=>Wf(e)&&Yn(e.pipe),PL=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Yn(e.append)&&((t=qf(e))==="formdata"||t==="object"&&Yn(e.toString)&&e.toString()==="[object FormData]"))},FL=Dr("URLSearchParams"),[IL,GL,UL,BL]=["ReadableStream","Request","Response","Headers"].map(Dr),$L=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ru(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),vs(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}const qa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Z_=e=>!Vl(e)&&e!==qa;function Eg(){const{caseless:e}=Z_(this)&&this||{},t={},n=(r,i)=>{const o=e&&K_(t,i)||i;tf(t[o])&&tf(r)?t[o]=Eg(t[o],r):tf(r)?t[o]=Eg({},r):vs(r)?t[o]=r.slice():t[o]=r};for(let r=0,i=arguments.length;r(ru(t,(i,o)=>{n&&Yn(i)?e[o]=Y_(i,n):e[o]=i},{allOwnKeys:r}),e),VL=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),qL=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},YL=(e,t,n,r)=>{let i,o,l;const u={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)l=i[o],(!r||r(l,e,t))&&!u[l]&&(t[l]=e[l],u[l]=!0);e=n!==!1&&Nv(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},WL=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},XL=e=>{if(!e)return null;if(vs(e))return e;let t=e.length;if(!X_(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},KL=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Nv(Uint8Array)),ZL=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},QL=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},JL=Dr("HTMLFormElement"),ez=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),i1=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),tz=Dr("RegExp"),Q_=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};ru(n,(i,o)=>{let l;(l=t(i,o,e))!==!1&&(r[o]=l||i)}),Object.defineProperties(e,r)},nz=e=>{Q_(e,(t,n)=>{if(Yn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Yn(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},rz=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return vs(e)?r(e):r(String(e).split(t)),n},iz=()=>{},az=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,qp="abcdefghijklmnopqrstuvwxyz",a1="0123456789",J_={DIGIT:a1,ALPHA:qp,ALPHA_DIGIT:qp+qp.toUpperCase()+a1},oz=(e=16,t=J_.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function sz(e){return!!(e&&Yn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const lz=e=>{const t=new Array(10),n=(r,i)=>{if(Wf(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const o=vs(r)?[]:{};return ru(r,(l,u)=>{const f=n(l,i+1);!Vl(f)&&(o[u]=f)}),t[i]=void 0,o}}return r};return n(e,0)},uz=Dr("AsyncFunction"),cz=e=>e&&(Wf(e)||Yn(e))&&Yn(e.then)&&Yn(e.catch),ek=((e,t)=>e?setImmediate:t?((n,r)=>(qa.addEventListener("message",({source:i,data:o})=>{i===qa&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),qa.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Yn(qa.postMessage)),fz=typeof queueMicrotask<"u"?queueMicrotask.bind(qa):typeof process<"u"&&process.nextTick||ek,fe={isArray:vs,isArrayBuffer:W_,isBuffer:AL,isFormData:PL,isArrayBufferView:RL,isString:DL,isNumber:X_,isBoolean:NL,isObject:Wf,isPlainObject:tf,isReadableStream:IL,isRequest:GL,isResponse:UL,isHeaders:BL,isUndefined:Vl,isDate:OL,isFile:jL,isBlob:LL,isRegExp:tz,isFunction:Yn,isStream:ML,isURLSearchParams:FL,isTypedArray:KL,isFileList:zL,forEach:ru,merge:Eg,extend:HL,trim:$L,stripBOM:VL,inherits:qL,toFlatObject:YL,kindOf:qf,kindOfTest:Dr,endsWith:WL,toArray:XL,forEachEntry:ZL,matchAll:QL,isHTMLForm:JL,hasOwnProperty:i1,hasOwnProp:i1,reduceDescriptors:Q_,freezeMethods:nz,toObjectSet:rz,toCamelCase:ez,noop:iz,toFiniteNumber:az,findKey:K_,global:qa,isContextDefined:Z_,ALPHABET:J_,generateString:oz,isSpecCompliantForm:sz,toJSONObject:lz,isAsyncFn:uz,isThenable:cz,setImmediate:ek,asap:fz};function tt(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}fe.inherits(tt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:fe.toJSONObject(this.config),code:this.code,status:this.status}}});const tk=tt.prototype,nk={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{nk[e]={value:e}});Object.defineProperties(tt,nk);Object.defineProperty(tk,"isAxiosError",{value:!0});tt.from=(e,t,n,r,i,o)=>{const l=Object.create(tk);return fe.toFlatObject(e,l,function(f){return f!==Error.prototype},u=>u!=="isAxiosError"),tt.call(l,e.message,t,n,r,i),l.cause=e,l.name=e.name,o&&Object.assign(l,o),l};const dz=null;function _g(e){return fe.isPlainObject(e)||fe.isArray(e)}function rk(e){return fe.endsWith(e,"[]")?e.slice(0,-2):e}function o1(e,t,n){return e?e.concat(t).map(function(i,o){return i=rk(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function hz(e){return fe.isArray(e)&&!e.some(_g)}const pz=fe.toFlatObject(fe,{},null,function(t){return/^is[A-Z]/.test(t)});function Xf(e,t,n){if(!fe.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=fe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,k){return!fe.isUndefined(k[x])});const r=n.metaTokens,i=n.visitor||p,o=n.dots,l=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&fe.isSpecCompliantForm(t);if(!fe.isFunction(i))throw new TypeError("visitor must be a function");function d(w){if(w===null)return"";if(fe.isDate(w))return w.toISOString();if(!f&&fe.isBlob(w))throw new tt("Blob is not supported. Use a Buffer instead.");return fe.isArrayBuffer(w)||fe.isTypedArray(w)?f&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function p(w,x,k){let C=w;if(w&&!k&&typeof w=="object"){if(fe.endsWith(x,"{}"))x=r?x:x.slice(0,-2),w=JSON.stringify(w);else if(fe.isArray(w)&&hz(w)||(fe.isFileList(w)||fe.endsWith(x,"[]"))&&(C=fe.toArray(w)))return x=rk(x),C.forEach(function(T,N){!(fe.isUndefined(T)||T===null)&&t.append(l===!0?o1([x],N,o):l===null?x:x+"[]",d(T))}),!1}return _g(w)?!0:(t.append(o1(k,x,o),d(w)),!1)}const m=[],v=Object.assign(pz,{defaultVisitor:p,convertValue:d,isVisitable:_g});function g(w,x){if(!fe.isUndefined(w)){if(m.indexOf(w)!==-1)throw Error("Circular reference detected in "+x.join("."));m.push(w),fe.forEach(w,function(C,_){(!(fe.isUndefined(C)||C===null)&&i.call(t,C,fe.isString(_)?_.trim():_,x,v))===!0&&g(C,x?x.concat(_):[_])}),m.pop()}}if(!fe.isObject(e))throw new TypeError("data must be an object");return g(e),t}function s1(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Ov(e,t){this._pairs=[],e&&Xf(e,this,t)}const ik=Ov.prototype;ik.append=function(t,n){this._pairs.push([t,n])};ik.toString=function(t){const n=t?function(r){return t.call(this,r,s1)}:s1;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function mz(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ak(e,t,n){if(!t)return e;const r=n&&n.encode||mz;fe.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(t,n):o=fe.isURLSearchParams(t)?t.toString():new Ov(t,n).toString(r),o){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class l1{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){fe.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ok={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},gz=typeof URLSearchParams<"u"?URLSearchParams:Ov,vz=typeof FormData<"u"?FormData:null,yz=typeof Blob<"u"?Blob:null,bz={isBrowser:!0,classes:{URLSearchParams:gz,FormData:vz,Blob:yz},protocols:["http","https","file","blob","url","data"]},jv=typeof window<"u"&&typeof document<"u",kg=typeof navigator=="object"&&navigator||void 0,xz=jv&&(!kg||["ReactNative","NativeScript","NS"].indexOf(kg.product)<0),wz=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Sz=jv&&window.location.href||"http://localhost",Ez=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:jv,hasStandardBrowserEnv:xz,hasStandardBrowserWebWorkerEnv:wz,navigator:kg,origin:Sz},Symbol.toStringTag,{value:"Module"})),gn={...Ez,...bz};function _z(e,t){return Xf(e,new gn.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return gn.isNode&&fe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function kz(e){return fe.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Cz(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r=n.length;return l=!l&&fe.isArray(i)?i.length:l,f?(fe.hasOwnProp(i,l)?i[l]=[i[l],r]:i[l]=r,!u):((!i[l]||!fe.isObject(i[l]))&&(i[l]=[]),t(n,r,i[l],o)&&fe.isArray(i[l])&&(i[l]=Cz(i[l])),!u)}if(fe.isFormData(e)&&fe.isFunction(e.entries)){const n={};return fe.forEachEntry(e,(r,i)=>{t(kz(r),i,n,0)}),n}return null}function Tz(e,t,n){if(fe.isString(e))try{return(t||JSON.parse)(e),fe.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const iu={transitional:ok,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=fe.isObject(t);if(o&&fe.isHTMLForm(t)&&(t=new FormData(t)),fe.isFormData(t))return i?JSON.stringify(sk(t)):t;if(fe.isArrayBuffer(t)||fe.isBuffer(t)||fe.isStream(t)||fe.isFile(t)||fe.isBlob(t)||fe.isReadableStream(t))return t;if(fe.isArrayBufferView(t))return t.buffer;if(fe.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return _z(t,this.formSerializer).toString();if((u=fe.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Xf(u?{"files[]":t}:t,f&&new f,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),Tz(t)):t}],transformResponse:[function(t){const n=this.transitional||iu.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(fe.isResponse(t)||fe.isReadableStream(t))return t;if(t&&fe.isString(t)&&(r&&!this.responseType||i)){const l=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(u){if(l)throw u.name==="SyntaxError"?tt.from(u,tt.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:gn.classes.FormData,Blob:gn.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};fe.forEach(["delete","get","head","post","put","patch"],e=>{iu.headers[e]={}});const Az=fe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Rz=e=>{const t={};let n,r,i;return e&&e.split(` `).forEach(function(l){i=l.indexOf(":"),n=l.substring(0,i).trim().toLowerCase(),r=l.substring(i+1).trim(),!(!n||t[n]&&Az[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},u1=Symbol("internals");function Cl(e){return e&&String(e).trim().toLowerCase()}function nf(e){return e===!1||e==null?e:fe.isArray(e)?e.map(nf):String(e)}function Dz(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Nz=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Yp(e,t,n,r,i){if(fe.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!fe.isString(t)){if(fe.isString(r))return t.indexOf(r)!==-1;if(fe.isRegExp(r))return r.test(t)}}function Oz(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function jz(e,t){const n=fe.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,l){return this[r].call(this,t,i,o,l)},configurable:!0})})}let zn=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(u,f,d){const p=Cl(f);if(!p)throw new Error("header name must be a non-empty string");const m=fe.findKey(i,p);(!m||i[m]===void 0||d===!0||d===void 0&&i[m]!==!1)&&(i[m||f]=nf(u))}const l=(u,f)=>fe.forEach(u,(d,p)=>o(d,p,f));if(fe.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(fe.isString(t)&&(t=t.trim())&&!Nz(t))l(Rz(t),n);else if(fe.isHeaders(t))for(const[u,f]of t.entries())o(f,u,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=Cl(t),t){const r=fe.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return Dz(i);if(fe.isFunction(n))return n.call(this,i,r);if(fe.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Cl(t),t){const r=fe.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Yp(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(l){if(l=Cl(l),l){const u=fe.findKey(r,l);u&&(!n||Yp(r,r[u],u,n))&&(delete r[u],i=!0)}}return fe.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||Yp(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return fe.forEach(this,(i,o)=>{const l=fe.findKey(r,o);if(l){n[l]=nf(i),delete n[o];return}const u=t?Oz(o):String(o).trim();u!==o&&delete n[o],n[u]=nf(i),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return fe.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&fe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[u1]=this[u1]={accessors:{}}).accessors,i=this.prototype;function o(l){const u=Cl(l);r[u]||(jz(i,l),r[u]=!0)}return fe.isArray(t)?t.forEach(o):o(t),this}};zn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);fe.reduceDescriptors(zn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});fe.freezeMethods(zn);function Wp(e,t){const n=this||iu,r=t||n,i=zn.from(r.headers);let o=r.data;return fe.forEach(e,function(u){o=u.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function lk(e){return!!(e&&e.__CANCEL__)}function ys(e,t,n){tt.call(this,e??"canceled",tt.ERR_CANCELED,t,n),this.name="CanceledError"}fe.inherits(ys,tt,{__CANCEL__:!0});function uk(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new tt("Request failed with status code "+n.status,[tt.ERR_BAD_REQUEST,tt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Lz(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function zz(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,l;return t=t!==void 0?t:1e3,function(f){const d=Date.now(),p=r[o];l||(l=d),n[i]=f,r[i]=d;let m=o,v=0;for(;m!==i;)v+=n[m++],m=m%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),d-l{n=p,i=null,o&&(clearTimeout(o),o=null),e.apply(null,d)};return[(...d)=>{const p=Date.now(),m=p-n;m>=r?l(d,p):(i=d,o||(o=setTimeout(()=>{o=null,l(i)},r-m)))},()=>i&&l(i)]}const bf=(e,t,n=3)=>{let r=0;const i=zz(50,250);return Mz(o=>{const l=o.loaded,u=o.lengthComputable?o.total:void 0,f=l-r,d=i(f),p=l<=u;r=l;const m={loaded:l,total:u,progress:u?l/u:void 0,bytes:f,rate:d||void 0,estimated:d&&u&&p?(u-l)/d:void 0,event:o,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(m)},n)},c1=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},f1=e=>(...t)=>fe.asap(()=>e(...t)),Pz=gn.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,gn.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(gn.origin),gn.navigator&&/(msie|trident)/i.test(gn.navigator.userAgent)):()=>!0,Fz=gn.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const l=[e+"="+encodeURIComponent(t)];fe.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),fe.isString(r)&&l.push("path="+r),fe.isString(i)&&l.push("domain="+i),o===!0&&l.push("secure"),document.cookie=l.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Iz(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Gz(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function ck(e,t){return e&&!Iz(t)?Gz(e,t):t}const d1=e=>e instanceof zn?{...e}:e;function Wa(e,t){t=t||{};const n={};function r(d,p,m,v){return fe.isPlainObject(d)&&fe.isPlainObject(p)?fe.merge.call({caseless:v},d,p):fe.isPlainObject(p)?fe.merge({},p):fe.isArray(p)?p.slice():p}function i(d,p,m,v){if(fe.isUndefined(p)){if(!fe.isUndefined(d))return r(void 0,d,m,v)}else return r(d,p,m,v)}function o(d,p){if(!fe.isUndefined(p))return r(void 0,p)}function l(d,p){if(fe.isUndefined(p)){if(!fe.isUndefined(d))return r(void 0,d)}else return r(void 0,p)}function u(d,p,m){if(m in t)return r(d,p);if(m in e)return r(void 0,d)}const f={url:o,method:o,data:o,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:u,headers:(d,p,m)=>i(d1(d),d1(p),m,!0)};return fe.forEach(Object.keys(Object.assign({},e,t)),function(p){const m=f[p]||i,v=m(e[p],t[p],p);fe.isUndefined(v)&&m!==u||(n[p]=v)}),n}const fk=e=>{const t=Wa({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:l,auth:u}=t;t.headers=l=zn.from(l),t.url=ak(ck(t.baseURL,t.url),e.params,e.paramsSerializer),u&&l.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let f;if(fe.isFormData(n)){if(gn.hasStandardBrowserEnv||gn.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if((f=l.getContentType())!==!1){const[d,...p]=f?f.split(";").map(m=>m.trim()).filter(Boolean):[];l.setContentType([d||"multipart/form-data",...p].join("; "))}}if(gn.hasStandardBrowserEnv&&(r&&fe.isFunction(r)&&(r=r(t)),r||r!==!1&&Pz(t.url))){const d=i&&o&&Fz.read(o);d&&l.set(i,d)}return t},Uz=typeof XMLHttpRequest<"u",Bz=Uz&&function(e){return new Promise(function(n,r){const i=fk(e);let o=i.data;const l=zn.from(i.headers).normalize();let{responseType:u,onUploadProgress:f,onDownloadProgress:d}=i,p,m,v,g,w;function x(){g&&g(),w&&w(),i.cancelToken&&i.cancelToken.unsubscribe(p),i.signal&&i.signal.removeEventListener("abort",p)}let k=new XMLHttpRequest;k.open(i.method.toUpperCase(),i.url,!0),k.timeout=i.timeout;function C(){if(!k)return;const T=zn.from("getAllResponseHeaders"in k&&k.getAllResponseHeaders()),D={data:!u||u==="text"||u==="json"?k.responseText:k.response,status:k.status,statusText:k.statusText,headers:T,config:e,request:k};uk(function(R){n(R),x()},function(R){r(R),x()},D),k=null}"onloadend"in k?k.onloadend=C:k.onreadystatechange=function(){!k||k.readyState!==4||k.status===0&&!(k.responseURL&&k.responseURL.indexOf("file:")===0)||setTimeout(C)},k.onabort=function(){k&&(r(new tt("Request aborted",tt.ECONNABORTED,e,k)),k=null)},k.onerror=function(){r(new tt("Network Error",tt.ERR_NETWORK,e,k)),k=null},k.ontimeout=function(){let N=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const D=i.transitional||ok;i.timeoutErrorMessage&&(N=i.timeoutErrorMessage),r(new tt(N,D.clarifyTimeoutError?tt.ETIMEDOUT:tt.ECONNABORTED,e,k)),k=null},o===void 0&&l.setContentType(null),"setRequestHeader"in k&&fe.forEach(l.toJSON(),function(N,D){k.setRequestHeader(D,N)}),fe.isUndefined(i.withCredentials)||(k.withCredentials=!!i.withCredentials),u&&u!=="json"&&(k.responseType=i.responseType),d&&([v,w]=bf(d,!0),k.addEventListener("progress",v)),f&&k.upload&&([m,g]=bf(f),k.upload.addEventListener("progress",m),k.upload.addEventListener("loadend",g)),(i.cancelToken||i.signal)&&(p=T=>{k&&(r(!T||T.type?new ys(null,e,k):T),k.abort(),k=null)},i.cancelToken&&i.cancelToken.subscribe(p),i.signal&&(i.signal.aborted?p():i.signal.addEventListener("abort",p)));const _=Lz(i.url);if(_&&gn.protocols.indexOf(_)===-1){r(new tt("Unsupported protocol "+_+":",tt.ERR_BAD_REQUEST,e));return}k.send(o||null)})},$z=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const o=function(d){if(!i){i=!0,u();const p=d instanceof Error?d:this.reason;r.abort(p instanceof tt?p:new ys(p instanceof Error?p.message:p))}};let l=t&&setTimeout(()=>{l=null,o(new tt(`timeout ${t} of ms exceeded`,tt.ETIMEDOUT))},t);const u=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(o):d.removeEventListener("abort",o)}),e=null)};e.forEach(d=>d.addEventListener("abort",o));const{signal:f}=r;return f.unsubscribe=()=>fe.asap(u),f}},Hz=function*(e,t){let n=e.byteLength;if(n{const i=Vz(e,t);let o=0,l,u=f=>{l||(l=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:d,value:p}=await i.next();if(d){u(),f.close();return}let m=p.byteLength;if(n){let v=o+=m;n(v)}f.enqueue(new Uint8Array(p))}catch(d){throw u(d),d}},cancel(f){return u(f),i.return()}},{highWaterMark:2})},Kf=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",dk=Kf&&typeof ReadableStream=="function",Yz=Kf&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),hk=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Wz=dk&&hk(()=>{let e=!1;const t=new Request(gn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),p1=64*1024,Cg=dk&&hk(()=>fe.isReadableStream(new Response("").body)),xf={stream:Cg&&(e=>e.body)};Kf&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!xf[t]&&(xf[t]=fe.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new tt(`Response type '${t}' is not supported`,tt.ERR_NOT_SUPPORT,r)})})})(new Response);const Xz=async e=>{if(e==null)return 0;if(fe.isBlob(e))return e.size;if(fe.isSpecCompliantForm(e))return(await new Request(gn.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(fe.isArrayBufferView(e)||fe.isArrayBuffer(e))return e.byteLength;if(fe.isURLSearchParams(e)&&(e=e+""),fe.isString(e))return(await Yz(e)).byteLength},Kz=async(e,t)=>{const n=fe.toFiniteNumber(e.getContentLength());return n??Xz(t)},Zz=Kf&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:o,timeout:l,onDownloadProgress:u,onUploadProgress:f,responseType:d,headers:p,withCredentials:m="same-origin",fetchOptions:v}=fk(e);d=d?(d+"").toLowerCase():"text";let g=$z([i,o&&o.toAbortSignal()],l),w;const x=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let k;try{if(f&&Wz&&n!=="get"&&n!=="head"&&(k=await Kz(p,r))!==0){let D=new Request(t,{method:"POST",body:r,duplex:"half"}),L;if(fe.isFormData(r)&&(L=D.headers.get("content-type"))&&p.setContentType(L),D.body){const[R,U]=c1(k,bf(f1(f)));r=h1(D.body,p1,R,U)}}fe.isString(m)||(m=m?"include":"omit");const C="credentials"in Request.prototype;w=new Request(t,{...v,signal:g,method:n.toUpperCase(),headers:p.normalize().toJSON(),body:r,duplex:"half",credentials:C?m:void 0});let _=await fetch(w);const T=Cg&&(d==="stream"||d==="response");if(Cg&&(u||T&&x)){const D={};["status","statusText","headers"].forEach(P=>{D[P]=_[P]});const L=fe.toFiniteNumber(_.headers.get("content-length")),[R,U]=u&&c1(L,bf(f1(u),!0))||[];_=new Response(h1(_.body,p1,R,()=>{U&&U(),x&&x()}),D)}d=d||"text";let N=await xf[fe.findKey(xf,d)||"text"](_,e);return!T&&x&&x(),await new Promise((D,L)=>{uk(D,L,{data:N,headers:zn.from(_.headers),status:_.status,statusText:_.statusText,config:e,request:w})})}catch(C){throw x&&x(),C&&C.name==="TypeError"&&/fetch/i.test(C.message)?Object.assign(new tt("Network Error",tt.ERR_NETWORK,e,w),{cause:C.cause||C}):tt.from(C,C&&C.code,e,w)}}),Tg={http:dz,xhr:Bz,fetch:Zz};fe.forEach(Tg,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const m1=e=>`- ${e}`,Qz=e=>fe.isFunction(e)||e===null||e===!1,pk={getAdapter:e=>{e=fe.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let o=0;o`adapter ${u} `+(f===!1?"is not supported by the environment":"is not available in the build"));let l=t?o.length>1?`since : `+o.map(m1).join(` `):" "+m1(o[0]):"as no adapter specified";throw new tt("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return r},adapters:Tg};function Xp(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ys(null,e)}function g1(e){return Xp(e),e.headers=zn.from(e.headers),e.data=Wp.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),pk.getAdapter(e.adapter||iu.adapter)(e).then(function(r){return Xp(e),r.data=Wp.call(e,e.transformResponse,r),r.headers=zn.from(r.headers),r},function(r){return lk(r)||(Xp(e),r&&r.response&&(r.response.data=Wp.call(e,e.transformResponse,r.response),r.response.headers=zn.from(r.response.headers))),Promise.reject(r)})}const mk="1.7.9",Zf={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Zf[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const v1={};Zf.transitional=function(t,n,r){function i(o,l){return"[Axios v"+mk+"] Transitional option '"+o+"'"+l+(r?". "+r:"")}return(o,l,u)=>{if(t===!1)throw new tt(i(l," has been removed"+(n?" in "+n:"")),tt.ERR_DEPRECATED);return n&&!v1[l]&&(v1[l]=!0,console.warn(i(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,l,u):!0}};Zf.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Jz(e,t,n){if(typeof e!="object")throw new tt("options must be an object",tt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],l=t[o];if(l){const u=e[o],f=u===void 0||l(u,o,e);if(f!==!0)throw new tt("option "+o+" must be "+f,tt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new tt("Unknown option "+o,tt.ERR_BAD_OPTION)}}const rf={assertOptions:Jz,validators:Zf},Fr=rf.validators;let Ya=class{constructor(t){this.defaults=t,this.interceptors={request:new l1,response:new l1}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Wa(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&rf.assertOptions(r,{silentJSONParsing:Fr.transitional(Fr.boolean),forcedJSONParsing:Fr.transitional(Fr.boolean),clarifyTimeoutError:Fr.transitional(Fr.boolean)},!1),i!=null&&(fe.isFunction(i)?n.paramsSerializer={serialize:i}:rf.assertOptions(i,{encode:Fr.function,serialize:Fr.function},!0)),rf.assertOptions(n,{baseUrl:Fr.spelling("baseURL"),withXsrfToken:Fr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=o&&fe.merge(o.common,o[n.method]);o&&fe.forEach(["delete","get","head","post","put","patch","common"],w=>{delete o[w]}),n.headers=zn.concat(l,o);const u=[];let f=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(n)===!1||(f=f&&x.synchronous,u.unshift(x.fulfilled,x.rejected))});const d=[];this.interceptors.response.forEach(function(x){d.push(x.fulfilled,x.rejected)});let p,m=0,v;if(!f){const w=[g1.bind(this),void 0];for(w.unshift.apply(w,u),w.push.apply(w,d),v=w.length,p=Promise.resolve(n);m{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const l=new Promise(u=>{r.subscribe(u),o=u}).then(i);return l.cancel=function(){r.unsubscribe(o)},l},t(function(o,l,u){r.reason||(r.reason=new ys(o,l,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new gk(function(i){t=i}),cancel:t}}};function tM(e){return function(n){return e.apply(null,n)}}function nM(e){return fe.isObject(e)&&e.isAxiosError===!0}const Ag={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ag).forEach(([e,t])=>{Ag[t]=e});function vk(e){const t=new Ya(e),n=Y_(Ya.prototype.request,t);return fe.extend(n,Ya.prototype,t,{allOwnKeys:!0}),fe.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return vk(Wa(e,i))},n}const Ut=vk(iu);Ut.Axios=Ya;Ut.CanceledError=ys;Ut.CancelToken=eM;Ut.isCancel=lk;Ut.VERSION=mk;Ut.toFormData=Xf;Ut.AxiosError=tt;Ut.Cancel=Ut.CanceledError;Ut.all=function(t){return Promise.all(t)};Ut.spread=tM;Ut.isAxiosError=nM;Ut.mergeConfig=Wa;Ut.AxiosHeaders=zn;Ut.formToJSON=e=>sk(fe.isHTMLForm(e)?new FormData(e):e);Ut.getAdapter=pk.getAdapter;Ut.HttpStatusCode=Ag;Ut.default=Ut;const{Axios:XX,AxiosError:KX,CanceledError:ZX,isCancel:QX,CancelToken:JX,VERSION:eK,all:tK,Cancel:nK,isAxiosError:rK,spread:iK,toFormData:aK,AxiosHeaders:oK,HttpStatusCode:sK,formToJSON:lK,getAdapter:uK,mergeConfig:cK}=Ut,yk="Invalid API Key",bk="API Key required",Nr=Ut.create({baseURL:U_,headers:{"Content-Type":"application/json"}});Nr.interceptors.request.use(e=>{const t=Qe.getState().apiKey;return t&&(e.headers["X-API-Key"]=t),e});Nr.interceptors.response.use(e=>e,e=>{var t;throw e.response?new Error(`${e.response.status} ${e.response.statusText} ${JSON.stringify(e.response.data)} ${(t=e.config)==null?void 0:t.url}`):e});const rM=async e=>(await Nr.get(`/graphs?label=${e}`)).data,iM=async()=>(await Nr.get("/graph/label/list")).data,aM=async()=>{try{return(await Nr.get("/health")).data}catch(e){return{status:"error",message:Cr(e)}}},oM=async()=>(await Nr.get("/documents")).data,sM=async()=>(await Nr.post("/documents/scan")).data,lM=async e=>(await Nr.post("/query",e)).data,uM=async(e,t,n)=>{try{let r="";if(await Nr.post("/query/stream",e,{responseType:"text",headers:{Accept:"application/x-ndjson"},transformResponse:[i=>{r+=i;const o=r.split(` `);r=o.pop()||"";for(const l of o)if(l.trim())try{const u=JSON.parse(l);u.response?t(u.response):u.error&&n&&n(u.error)}catch(u){console.error("Error parsing stream chunk:",u),n&&n("Error parsing server response")}return i}]}).catch(i=>{n&&n(Cr(i))}),r.trim())try{const i=JSON.parse(r);i.response?t(i.response):i.error&&n&&n(i.error)}catch(i){console.error("Error parsing final chunk:",i),n&&n("Error parsing server response")}}catch(r){const i=Cr(r);console.error("Stream request failed:",i),n&&n(i)}},cM=async(e,t)=>{const n=new FormData;return n.append("file",e),(await Nr.post("/documents/upload",n,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:t!==void 0?i=>{const o=Math.round(i.loaded*100/i.total);t(o)}:void 0})).data},fM=async()=>(await Nr.delete("/documents")).data,dM=Tv()(e=>({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:null,check:async()=>{const t=await aM();return t.status==="healthy"?(e({health:!0,message:null,messageTitle:null,lastCheckTime:Date.now(),status:t}),!0):(e({health:!1,message:t.message,messageTitle:"Backend Health Check Error!",lastCheckTime:Date.now(),status:null}),!1)},clear:()=>{e({health:!0,message:null,messageTitle:null})},setErrorMessage:(t,n)=>{e({health:!1,message:t,messageTitle:n})}})),Mn=Dv(dM);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const hM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),xk=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var pM={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"};/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mM=E.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:l,...u},f)=>E.createElement("svg",{ref:f,...pM,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:xk("lucide",i),...u},[...l.map(([d,p])=>E.createElement(d,p)),...Array.isArray(o)?o:[o]]));/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Et=(e,t)=>{const n=E.forwardRef(({className:r,...i},o)=>E.createElement(mM,{ref:o,iconNode:t,className:xk(`lucide-${hM(e)}`,r),...i}));return n.displayName=`${e}`,n};/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gM=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Lv=Et("Check",gM);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vM=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],zv=Et("ChevronDown",vM);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yM=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],wk=Et("ChevronUp",yM);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bM=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],xM=Et("ChevronsUpDown",bM);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wM=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],SM=Et("CircleAlert",wM);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const EM=[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]],Sk=Et("Eraser",EM);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _M=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],kM=Et("FileText",_M);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const CM=[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]],TM=Et("Files",CM);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const AM=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["rect",{width:"10",height:"8",x:"7",y:"8",rx:"1",key:"vys8me"}]],RM=Et("Fullscreen",AM);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const DM=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],NM=Et("Github",DM);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const OM=[["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"19",cy:"5",r:"1",key:"w8mnmm"}],["circle",{cx:"5",cy:"5",r:"1",key:"lttvr7"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}],["circle",{cx:"19",cy:"19",r:"1",key:"shf9b7"}],["circle",{cx:"5",cy:"19",r:"1",key:"bfqh0e"}]],jM=Et("Grip",OM);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const LM=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ek=Et("LoaderCircle",LM);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const zM=[["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"}]],MM=Et("Loader",zM);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const PM=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],FM=Et("Maximize",PM);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const IM=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],GM=Et("Minimize",IM);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const UM=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],BM=Et("Moon",UM);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $M=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],HM=Et("Pause",$M);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const VM=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],qM=Et("Play",VM);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const YM=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],WM=Et("RefreshCw",YM);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const XM=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],KM=Et("Search",XM);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ZM=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],QM=Et("Send",ZM);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const JM=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],eP=Et("Settings",JM);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tP=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],nP=Et("Sun",tP);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rP=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],Rg=Et("Upload",rP);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const iP=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],_k=Et("X",iP);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const aP=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],oP=Et("Zap",aP);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const sP=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],lP=Et("ZoomIn",sP);/** * @license lucide-react v0.475.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const uP=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],cP=Et("ZoomOut",uP),fP=()=>{const e=Mn.use.health(),t=Mn.use.message(),n=Mn.use.messageTitle(),[r,i]=E.useState(!1);return E.useEffect(()=>{setTimeout(()=>{i(!0)},50)},[]),S.jsxs(H_,{className:Me("bg-background/90 absolute top-12 left-1/2 flex w-auto max-w-lg -translate-x-1/2 transform items-center gap-4 shadow-md backdrop-blur-lg transition-all duration-500 ease-in-out",r?"translate-y-0 opacity-100":"-translate-y-20 opacity-0",!e&&"bg-red-700 text-white"),children:[!e&&S.jsx("div",{children:S.jsx(SM,{className:"size-4"})}),S.jsxs("div",{children:[S.jsx(V_,{className:"font-bold",children:n}),S.jsx(q_,{children:t})]})]})};function dP(e,t){const n=E.createContext(t),r=o=>{const{children:l,...u}=o,f=E.useMemo(()=>u,Object.values(u));return S.jsx(n.Provider,{value:f,children:l})};r.displayName=e+"Provider";function i(o){const l=E.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function dr(e,t=[]){let n=[];function r(o,l){const u=E.createContext(l),f=n.length;n=[...n,l];const d=m=>{var C;const{scope:v,children:g,...w}=m,x=((C=v==null?void 0:v[e])==null?void 0:C[f])||u,k=E.useMemo(()=>w,Object.values(w));return S.jsx(x.Provider,{value:k,children:g})};d.displayName=o+"Provider";function p(m,v){var x;const g=((x=v==null?void 0:v[e])==null?void 0:x[f])||u,w=E.useContext(g);if(w)return w;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[d,p]}const i=()=>{const o=n.map(l=>E.createContext(l));return function(u){const f=(u==null?void 0:u[e])||o;return E.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return i.scopeName=e,[r,hP(i,...t)]}function hP(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=r.reduce((u,{useScope:f,scopeName:d})=>{const m=f(o)[`__scope${d}`];return{...u,...m}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function y1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function kk(...e){return t=>{let n=!1;const r=e.map(i=>{const o=y1(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i{},pP=dj.useId||(()=>{}),mP=0;function bn(e){const[t,n]=E.useState(pP());return xn(()=>{n(r=>r??String(mP++))},[e]),t?`radix-${t}`:""}function un(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function _i({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=gP({defaultProp:t,onChange:n}),o=e!==void 0,l=o?e:r,u=un(n),f=E.useCallback(d=>{if(o){const m=typeof d=="function"?d(e):d;m!==e&&u(m)}else i(d)},[o,e,i,u]);return[l,f]}function gP({defaultProp:e,onChange:t}){const n=E.useState(e),[r]=n,i=E.useRef(r),o=un(t);return E.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var au=R_();const Ck=fn(au);var ua=E.forwardRef((e,t)=>{const{children:n,...r}=e,i=E.Children.toArray(n),o=i.find(vP);if(o){const l=o.props.children,u=i.map(f=>f===o?E.Children.count(l)>1?E.Children.only(null):E.isValidElement(l)?l.props.children:null:f);return S.jsx(Dg,{...r,ref:t,children:E.isValidElement(l)?E.cloneElement(l,void 0,u):null})}return S.jsx(Dg,{...r,ref:t,children:n})});ua.displayName="Slot";var Dg=E.forwardRef((e,t)=>{const{children:n,...r}=e;if(E.isValidElement(n)){const i=bP(n),o=yP(r,n.props);return n.type!==E.Fragment&&(o.ref=t?kk(t,i):i),E.cloneElement(n,o)}return E.Children.count(n)>1?E.Children.only(null):null});Dg.displayName="SlotClone";var Mv=({children:e})=>S.jsx(S.Fragment,{children:e});function vP(e){return E.isValidElement(e)&&e.type===Mv}function yP(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...u)=>{o(...u),i(...u)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function bP(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var xP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],We=xP.reduce((e,t)=>{const n=E.forwardRef((r,i)=>{const{asChild:o,...l}=r,u=o?ua:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(u,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function wP(e,t){e&&au.flushSync(()=>e.dispatchEvent(t))}function SP(e,t=globalThis==null?void 0:globalThis.document){const n=un(e);E.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var EP="DismissableLayer",Ng="dismissableLayer.update",_P="dismissableLayer.pointerDownOutside",kP="dismissableLayer.focusOutside",b1,Tk=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ou=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,onDismiss:u,...f}=e,d=E.useContext(Tk),[p,m]=E.useState(null),v=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=E.useState({}),w=dt(t,R=>m(R)),x=Array.from(d.layers),[k]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),C=x.indexOf(k),_=p?x.indexOf(p):-1,T=d.layersWithOutsidePointerEventsDisabled.size>0,N=_>=C,D=AP(R=>{const U=R.target,P=[...d.branches].some(z=>z.contains(U));!N||P||(i==null||i(R),l==null||l(R),R.defaultPrevented||u==null||u())},v),L=RP(R=>{const U=R.target;[...d.branches].some(z=>z.contains(U))||(o==null||o(R),l==null||l(R),R.defaultPrevented||u==null||u())},v);return SP(R=>{_===d.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&u&&(R.preventDefault(),u()))},v),E.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(b1=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),x1(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=b1)}},[p,v,n,d]),E.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),x1())},[p,d]),E.useEffect(()=>{const R=()=>g({});return document.addEventListener(Ng,R),()=>document.removeEventListener(Ng,R)},[]),S.jsx(We.div,{...f,ref:w,style:{pointerEvents:T?N?"auto":"none":void 0,...e.style},onFocusCapture:qe(e.onFocusCapture,L.onFocusCapture),onBlurCapture:qe(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:qe(e.onPointerDownCapture,D.onPointerDownCapture)})});ou.displayName=EP;var CP="DismissableLayerBranch",TP=E.forwardRef((e,t)=>{const n=E.useContext(Tk),r=E.useRef(null),i=dt(t,r);return E.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),S.jsx(We.div,{...e,ref:i})});TP.displayName=CP;function AP(e,t=globalThis==null?void 0:globalThis.document){const n=un(e),r=E.useRef(!1),i=E.useRef(()=>{});return E.useEffect(()=>{const o=u=>{if(u.target&&!r.current){let f=function(){Ak(_P,n,d,{discrete:!0})};const d={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=f,t.addEventListener("click",i.current,{once:!0})):f()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function RP(e,t=globalThis==null?void 0:globalThis.document){const n=un(e),r=E.useRef(!1);return E.useEffect(()=>{const i=o=>{o.target&&!r.current&&Ak(kP,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function x1(){const e=new CustomEvent(Ng);document.dispatchEvent(e)}function Ak(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?wP(i,o):i.dispatchEvent(o)}var Kp="focusScope.autoFocusOnMount",Zp="focusScope.autoFocusOnUnmount",w1={bubbles:!1,cancelable:!0},DP="FocusScope",Qf=E.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[u,f]=E.useState(null),d=un(i),p=un(o),m=E.useRef(null),v=dt(t,x=>f(x)),g=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let x=function(T){if(g.paused||!u)return;const N=T.target;u.contains(N)?m.current=N:ia(m.current,{select:!0})},k=function(T){if(g.paused||!u)return;const N=T.relatedTarget;N!==null&&(u.contains(N)||ia(m.current,{select:!0}))},C=function(T){if(document.activeElement===document.body)for(const D of T)D.removedNodes.length>0&&ia(u)};document.addEventListener("focusin",x),document.addEventListener("focusout",k);const _=new MutationObserver(C);return u&&_.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",k),_.disconnect()}}},[r,u,g.paused]),E.useEffect(()=>{if(u){E1.add(g);const x=document.activeElement;if(!u.contains(x)){const C=new CustomEvent(Kp,w1);u.addEventListener(Kp,d),u.dispatchEvent(C),C.defaultPrevented||(NP(MP(Rk(u)),{select:!0}),document.activeElement===x&&ia(u))}return()=>{u.removeEventListener(Kp,d),setTimeout(()=>{const C=new CustomEvent(Zp,w1);u.addEventListener(Zp,p),u.dispatchEvent(C),C.defaultPrevented||ia(x??document.body,{select:!0}),u.removeEventListener(Zp,p),E1.remove(g)},0)}}},[u,d,p,g]);const w=E.useCallback(x=>{if(!n&&!r||g.paused)return;const k=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,C=document.activeElement;if(k&&C){const _=x.currentTarget,[T,N]=OP(_);T&&N?!x.shiftKey&&C===N?(x.preventDefault(),n&&ia(T,{select:!0})):x.shiftKey&&C===T&&(x.preventDefault(),n&&ia(N,{select:!0})):C===_&&x.preventDefault()}},[n,r,g.paused]);return S.jsx(We.div,{tabIndex:-1,...l,ref:v,onKeyDown:w})});Qf.displayName=DP;function NP(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ia(r,{select:t}),document.activeElement!==n)return}function OP(e){const t=Rk(e),n=S1(t,e),r=S1(t.reverse(),e);return[n,r]}function Rk(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function S1(e,t){for(const n of e)if(!jP(n,{upTo:t}))return n}function jP(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function LP(e){return e instanceof HTMLInputElement&&"select"in e}function ia(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&LP(e)&&t&&e.select()}}var E1=zP();function zP(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=_1(e,t),e.unshift(t)},remove(t){var n;e=_1(e,t),(n=e[0])==null||n.resume()}}}function _1(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function MP(e){return e.filter(t=>t.tagName!=="A")}var PP="Portal",Jf=E.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[i,o]=E.useState(!1);xn(()=>o(!0),[]);const l=n||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?Ck.createPortal(S.jsx(We.div,{...r,ref:t}),l):null});Jf.displayName=PP;function FP(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var Kn=e=>{const{present:t,children:n}=e,r=IP(t),i=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),o=dt(r.ref,GP(i));return typeof n=="function"||r.isPresent?E.cloneElement(i,{ref:o}):null};Kn.displayName="Presence";function IP(e){const[t,n]=E.useState(),r=E.useRef({}),i=E.useRef(e),o=E.useRef("none"),l=e?"mounted":"unmounted",[u,f]=FP(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const d=Rc(r.current);o.current=u==="mounted"?d:"none"},[u]),xn(()=>{const d=r.current,p=i.current;if(p!==e){const v=o.current,g=Rc(d);e?f("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?f("UNMOUNT"):f(p&&v!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,f]),xn(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,m=g=>{const x=Rc(r.current).includes(g.animationName);if(g.target===t&&x&&(f("ANIMATION_END"),!i.current)){const k=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=k)})}},v=g=>{g.target===t&&(o.current=Rc(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:E.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function Rc(e){return(e==null?void 0:e.animationName)||"none"}function GP(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Qp=0;function Pv(){E.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??k1()),document.body.insertAdjacentElement("beforeend",e[1]??k1()),Qp++,()=>{Qp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Qp--}},[])}function k1(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ur=function(){return Ur=Object.assign||function(t){for(var n,r=1,i=arguments.length;r"u")return rF;var t=iF(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},oF=jk(),ts="data-scroll-locked",sF=function(e,t,n,r){var i=e.left,o=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),` .`.concat(BP,` { overflow: hidden `).concat(r,`; padding-right: `).concat(u,"px ").concat(r,`; } body[`).concat(ts,`] { overflow: hidden `).concat(r,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` padding-left: `.concat(i,`px; padding-top: `).concat(o,`px; padding-right: `).concat(l,`px; margin-left:0; margin-top:0; margin-right: `).concat(u,"px ").concat(r,`; `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),` } .`).concat(af,` { right: `).concat(u,"px ").concat(r,`; } .`).concat(of,` { margin-right: `).concat(u,"px ").concat(r,`; } .`).concat(af," .").concat(af,` { right: 0 `).concat(r,`; } .`).concat(of," .").concat(of,` { margin-right: 0 `).concat(r,`; } body[`).concat(ts,`] { `).concat($P,": ").concat(u,`px; } `)},T1=function(){var e=parseInt(document.body.getAttribute(ts)||"0",10);return isFinite(e)?e:0},lF=function(){E.useEffect(function(){return document.body.setAttribute(ts,(T1()+1).toString()),function(){var e=T1()-1;e<=0?document.body.removeAttribute(ts):document.body.setAttribute(ts,e.toString())}},[])},uF=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;lF();var o=E.useMemo(function(){return aF(i)},[i]);return E.createElement(oF,{styles:sF(o,!t,i,n?"":"!important")})},Og=!1;if(typeof window<"u")try{var Dc=Object.defineProperty({},"passive",{get:function(){return Og=!0,!0}});window.addEventListener("test",Dc,Dc),window.removeEventListener("test",Dc,Dc)}catch{Og=!1}var Ho=Og?{passive:!1}:!1,cF=function(e){return e.tagName==="TEXTAREA"},Lk=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!cF(e)&&n[t]==="visible")},fF=function(e){return Lk(e,"overflowY")},dF=function(e){return Lk(e,"overflowX")},A1=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=zk(e,r);if(i){var o=Mk(e,r),l=o[1],u=o[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},hF=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},pF=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},zk=function(e,t){return e==="v"?fF(t):dF(t)},Mk=function(e,t){return e==="v"?hF(t):pF(t)},mF=function(e,t){return e==="h"&&t==="rtl"?-1:1},gF=function(e,t,n,r,i){var o=mF(e,window.getComputedStyle(t).direction),l=o*r,u=n.target,f=t.contains(u),d=!1,p=l>0,m=0,v=0;do{var g=Mk(e,u),w=g[0],x=g[1],k=g[2],C=x-k-o*w;(w||C)&&zk(e,u)&&(m+=C,v+=w),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(p&&Math.abs(m)<1||!p&&Math.abs(v)<1)&&(d=!0),d},Nc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},R1=function(e){return[e.deltaX,e.deltaY]},D1=function(e){return e&&"current"in e?e.current:e},vF=function(e,t){return e[0]===t[0]&&e[1]===t[1]},yF=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},bF=0,Vo=[];function xF(e){var t=E.useRef([]),n=E.useRef([0,0]),r=E.useRef(),i=E.useState(bF++)[0],o=E.useState(jk)[0],l=E.useRef(e);E.useEffect(function(){l.current=e},[e]),E.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var x=UP([e.lockRef.current],(e.shards||[]).map(D1),!0).filter(Boolean);return x.forEach(function(k){return k.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),x.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=E.useCallback(function(x,k){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!l.current.allowPinchZoom;var C=Nc(x),_=n.current,T="deltaX"in x?x.deltaX:_[0]-C[0],N="deltaY"in x?x.deltaY:_[1]-C[1],D,L=x.target,R=Math.abs(T)>Math.abs(N)?"h":"v";if("touches"in x&&R==="h"&&L.type==="range")return!1;var U=A1(R,L);if(!U)return!0;if(U?D=R:(D=R==="v"?"h":"v",U=A1(R,L)),!U)return!1;if(!r.current&&"changedTouches"in x&&(T||N)&&(r.current=D),!D)return!0;var P=r.current||D;return gF(P,k,x,P==="h"?T:N)},[]),f=E.useCallback(function(x){var k=x;if(!(!Vo.length||Vo[Vo.length-1]!==o)){var C="deltaY"in k?R1(k):Nc(k),_=t.current.filter(function(D){return D.name===k.type&&(D.target===k.target||k.target===D.shadowParent)&&vF(D.delta,C)})[0];if(_&&_.should){k.cancelable&&k.preventDefault();return}if(!_){var T=(l.current.shards||[]).map(D1).filter(Boolean).filter(function(D){return D.contains(k.target)}),N=T.length>0?u(k,T[0]):!l.current.noIsolation;N&&k.cancelable&&k.preventDefault()}}},[]),d=E.useCallback(function(x,k,C,_){var T={name:x,delta:k,target:C,should:_,shadowParent:wF(C)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(N){return N!==T})},1)},[]),p=E.useCallback(function(x){n.current=Nc(x),r.current=void 0},[]),m=E.useCallback(function(x){d(x.type,R1(x),x.target,u(x,e.lockRef.current))},[]),v=E.useCallback(function(x){d(x.type,Nc(x),x.target,u(x,e.lockRef.current))},[]);E.useEffect(function(){return Vo.push(o),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:v}),document.addEventListener("wheel",f,Ho),document.addEventListener("touchmove",f,Ho),document.addEventListener("touchstart",p,Ho),function(){Vo=Vo.filter(function(x){return x!==o}),document.removeEventListener("wheel",f,Ho),document.removeEventListener("touchmove",f,Ho),document.removeEventListener("touchstart",p,Ho)}},[]);var g=e.removeScrollBar,w=e.inert;return E.createElement(E.Fragment,null,w?E.createElement(o,{styles:yF(i)}):null,g?E.createElement(uF,{gapMode:e.gapMode}):null)}function wF(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const SF=KP(Ok,xF);var td=E.forwardRef(function(e,t){return E.createElement(ed,Ur({},e,{ref:t,sideCar:SF}))});td.classNames=ed.classNames;var EF=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},qo=new WeakMap,Oc=new WeakMap,jc={},nm=0,Pk=function(e){return e&&(e.host||Pk(e.parentNode))},_F=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Pk(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},kF=function(e,t,n,r){var i=_F(t,Array.isArray(e)?e:[e]);jc[n]||(jc[n]=new WeakMap);var o=jc[n],l=[],u=new Set,f=new Set(i),d=function(m){!m||u.has(m)||(u.add(m),d(m.parentNode))};i.forEach(d);var p=function(m){!m||f.has(m)||Array.prototype.forEach.call(m.children,function(v){if(u.has(v))p(v);else try{var g=v.getAttribute(r),w=g!==null&&g!=="false",x=(qo.get(v)||0)+1,k=(o.get(v)||0)+1;qo.set(v,x),o.set(v,k),l.push(v),x===1&&w&&Oc.set(v,!0),k===1&&v.setAttribute(n,"true"),w||v.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",v,C)}})};return p(t),u.clear(),nm++,function(){l.forEach(function(m){var v=qo.get(m)-1,g=o.get(m)-1;qo.set(m,v),o.set(m,g),v||(Oc.has(m)||m.removeAttribute(r),Oc.delete(m)),g||m.removeAttribute(n)}),nm--,nm||(qo=new WeakMap,qo=new WeakMap,Oc=new WeakMap,jc={})}},Fv=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=EF(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),kF(r,i,n,"aria-hidden")):function(){return null}},Iv="Dialog",[Fk,Ik]=dr(Iv),[CF,Or]=Fk(Iv),Gk=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,u=E.useRef(null),f=E.useRef(null),[d=!1,p]=_i({prop:r,defaultProp:i,onChange:o});return S.jsx(CF,{scope:t,triggerRef:u,contentRef:f,contentId:bn(),titleId:bn(),descriptionId:bn(),open:d,onOpenChange:p,onOpenToggle:E.useCallback(()=>p(m=>!m),[p]),modal:l,children:n})};Gk.displayName=Iv;var Uk="DialogTrigger",Bk=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Or(Uk,n),o=dt(t,i.triggerRef);return S.jsx(We.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Bv(i.open),...r,ref:o,onClick:qe(e.onClick,i.onOpenToggle)})});Bk.displayName=Uk;var Gv="DialogPortal",[TF,$k]=Fk(Gv,{forceMount:void 0}),Hk=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Or(Gv,t);return S.jsx(TF,{scope:t,forceMount:n,children:E.Children.map(r,l=>S.jsx(Kn,{present:n||o.open,children:S.jsx(Jf,{asChild:!0,container:i,children:l})}))})};Hk.displayName=Gv;var wf="DialogOverlay",Vk=E.forwardRef((e,t)=>{const n=$k(wf,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Or(wf,e.__scopeDialog);return o.modal?S.jsx(Kn,{present:r||o.open,children:S.jsx(AF,{...i,ref:t})}):null});Vk.displayName=wf;var AF=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Or(wf,n);return S.jsx(td,{as:ua,allowPinchZoom:!0,shards:[i.contentRef],children:S.jsx(We.div,{"data-state":Bv(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Xa="DialogContent",qk=E.forwardRef((e,t)=>{const n=$k(Xa,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Or(Xa,e.__scopeDialog);return S.jsx(Kn,{present:r||o.open,children:o.modal?S.jsx(RF,{...i,ref:t}):S.jsx(DF,{...i,ref:t})})});qk.displayName=Xa;var RF=E.forwardRef((e,t)=>{const n=Or(Xa,e.__scopeDialog),r=E.useRef(null),i=dt(t,n.contentRef,r);return E.useEffect(()=>{const o=r.current;if(o)return Fv(o)},[]),S.jsx(Yk,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:qe(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:qe(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:qe(e.onFocusOutside,o=>o.preventDefault())})}),DF=E.forwardRef((e,t)=>{const n=Or(Xa,e.__scopeDialog),r=E.useRef(!1),i=E.useRef(!1);return S.jsx(Yk,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var f,d;(f=e.onInteractOutside)==null||f.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Yk=E.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,u=Or(Xa,n),f=E.useRef(null),d=dt(t,f);return Pv(),S.jsxs(S.Fragment,{children:[S.jsx(Qf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(ou,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Bv(u.open),...l,ref:d,onDismiss:()=>u.onOpenChange(!1)})}),S.jsxs(S.Fragment,{children:[S.jsx(OF,{titleId:u.titleId}),S.jsx(LF,{contentRef:f,descriptionId:u.descriptionId})]})]})}),Uv="DialogTitle",Wk=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Or(Uv,n);return S.jsx(We.h2,{id:i.titleId,...r,ref:t})});Wk.displayName=Uv;var Xk="DialogDescription",Kk=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Or(Xk,n);return S.jsx(We.p,{id:i.descriptionId,...r,ref:t})});Kk.displayName=Xk;var Zk="DialogClose",Qk=E.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Or(Zk,n);return S.jsx(We.button,{type:"button",...r,ref:t,onClick:qe(e.onClick,()=>i.onOpenChange(!1))})});Qk.displayName=Zk;function Bv(e){return e?"open":"closed"}var Jk="DialogTitleWarning",[NF,eC]=dP(Jk,{contentName:Xa,titleName:Uv,docsSlug:"dialog"}),OF=({titleId:e})=>{const t=eC(Jk),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return E.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},jF="DialogDescriptionWarning",LF=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${eC(jF).contentName}}.`;return E.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},$v=Gk,tC=Bk,Hv=Hk,nd=Vk,rd=qk,Vv=Wk,qv=Kk,Yv=Qk,nC="AlertDialog",[zF,fK]=dr(nC,[Ik]),Ti=Ik(),rC=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ti(t);return S.jsx($v,{...r,...n,modal:!0})};rC.displayName=nC;var MF="AlertDialogTrigger",PF=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ti(n);return S.jsx(tC,{...i,...r,ref:t})});PF.displayName=MF;var FF="AlertDialogPortal",iC=e=>{const{__scopeAlertDialog:t,...n}=e,r=Ti(t);return S.jsx(Hv,{...r,...n})};iC.displayName=FF;var IF="AlertDialogOverlay",aC=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ti(n);return S.jsx(nd,{...i,...r,ref:t})});aC.displayName=IF;var ns="AlertDialogContent",[GF,UF]=zF(ns),oC=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=Ti(n),l=E.useRef(null),u=dt(t,l),f=E.useRef(null);return S.jsx(NF,{contentName:ns,titleName:sC,docsSlug:"alert-dialog",children:S.jsx(GF,{scope:n,cancelRef:f,children:S.jsxs(rd,{role:"alertdialog",...o,...i,ref:u,onOpenAutoFocus:qe(i.onOpenAutoFocus,d=>{var p;d.preventDefault(),(p=f.current)==null||p.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[S.jsx(Mv,{children:r}),S.jsx($F,{contentRef:l})]})})})});oC.displayName=ns;var sC="AlertDialogTitle",lC=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ti(n);return S.jsx(Vv,{...i,...r,ref:t})});lC.displayName=sC;var uC="AlertDialogDescription",cC=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ti(n);return S.jsx(qv,{...i,...r,ref:t})});cC.displayName=uC;var BF="AlertDialogAction",fC=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=Ti(n);return S.jsx(Yv,{...i,...r,ref:t})});fC.displayName=BF;var dC="AlertDialogCancel",hC=E.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=UF(dC,n),o=Ti(n),l=dt(t,i);return S.jsx(Yv,{...o,...r,ref:l})});hC.displayName=dC;var $F=({contentRef:e})=>{const t=`\`${ns}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${ns}\` by passing a \`${uC}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${ns}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return E.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},HF=rC,VF=iC,pC=aC,mC=oC,gC=fC,vC=hC,yC=lC,bC=cC;const qF=["top","right","bottom","left"],ca=Math.min,qn=Math.max,Sf=Math.round,Lc=Math.floor,Hr=e=>({x:e,y:e}),YF={left:"right",right:"left",bottom:"top",top:"bottom"},WF={start:"end",end:"start"};function jg(e,t,n){return qn(e,ca(t,n))}function ki(e,t){return typeof e=="function"?e(t):e}function Ci(e){return e.split("-")[0]}function bs(e){return e.split("-")[1]}function Wv(e){return e==="x"?"y":"x"}function Xv(e){return e==="y"?"height":"width"}function fa(e){return["top","bottom"].includes(Ci(e))?"y":"x"}function Kv(e){return Wv(fa(e))}function XF(e,t,n){n===void 0&&(n=!1);const r=bs(e),i=Kv(e),o=Xv(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=Ef(l)),[l,Ef(l)]}function KF(e){const t=Ef(e);return[Lg(e),t,Lg(t)]}function Lg(e){return e.replace(/start|end/g,t=>WF[t])}function ZF(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:l;default:return[]}}function QF(e,t,n,r){const i=bs(e);let o=ZF(Ci(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(Lg)))),o}function Ef(e){return e.replace(/left|right|bottom|top/g,t=>YF[t])}function JF(e){return{top:0,right:0,bottom:0,left:0,...e}}function xC(e){return typeof e!="number"?JF(e):{top:e,right:e,bottom:e,left:e}}function _f(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function N1(e,t,n){let{reference:r,floating:i}=e;const o=fa(t),l=Kv(t),u=Xv(l),f=Ci(t),d=o==="y",p=r.x+r.width/2-i.width/2,m=r.y+r.height/2-i.height/2,v=r[u]/2-i[u]/2;let g;switch(f){case"top":g={x:p,y:r.y-i.height};break;case"bottom":g={x:p,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:m};break;case"left":g={x:r.x-i.width,y:m};break;default:g={x:r.x,y:r.y}}switch(bs(t)){case"start":g[l]-=v*(n&&d?-1:1);break;case"end":g[l]+=v*(n&&d?-1:1);break}return g}const e4=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,u=o.filter(Boolean),f=await(l.isRTL==null?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:p,y:m}=N1(d,r,f),v=r,g={},w=0;for(let x=0;x({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:l,elements:u,middlewareData:f}=t,{element:d,padding:p=0}=ki(e,t)||{};if(d==null)return{};const m=xC(p),v={x:n,y:r},g=Kv(i),w=Xv(g),x=await l.getDimensions(d),k=g==="y",C=k?"top":"left",_=k?"bottom":"right",T=k?"clientHeight":"clientWidth",N=o.reference[w]+o.reference[g]-v[g]-o.floating[w],D=v[g]-o.reference[g],L=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d));let R=L?L[T]:0;(!R||!await(l.isElement==null?void 0:l.isElement(L)))&&(R=u.floating[T]||o.floating[w]);const U=N/2-D/2,P=R/2-x[w]/2-1,z=ca(m[C],P),V=ca(m[_],P),q=z,I=R-x[w]-V,Y=R/2-x[w]/2+U,Z=jg(q,Y,I),B=!f.arrow&&bs(i)!=null&&Y!==Z&&o.reference[w]/2-(YY<=0)){var V,q;const Y=(((V=o.flip)==null?void 0:V.index)||0)+1,Z=R[Y];if(Z)return{data:{index:Y,overflows:z},reset:{placement:Z}};let B=(q=z.filter(G=>G.overflows[0]<=0).sort((G,F)=>G.overflows[1]-F.overflows[1])[0])==null?void 0:q.placement;if(!B)switch(g){case"bestFit":{var I;const G=(I=z.filter(F=>{if(L){const K=fa(F.placement);return K===_||K==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(K=>K>0).reduce((K,A)=>K+A,0)]).sort((F,K)=>F[1]-K[1])[0])==null?void 0:I[0];G&&(B=G);break}case"initialPlacement":B=u;break}if(i!==B)return{reset:{placement:B}}}return{}}}};function O1(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function j1(e){return qF.some(t=>e[t]>=0)}const r4=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=ki(e,t);switch(r){case"referenceHidden":{const o=await ql(t,{...i,elementContext:"reference"}),l=O1(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:j1(l)}}}case"escaped":{const o=await ql(t,{...i,altBoundary:!0}),l=O1(o,n.floating);return{data:{escapedOffsets:l,escaped:j1(l)}}}default:return{}}}}};async function i4(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=Ci(n),u=bs(n),f=fa(n)==="y",d=["left","top"].includes(l)?-1:1,p=o&&f?-1:1,m=ki(t,e);let{mainAxis:v,crossAxis:g,alignmentAxis:w}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof w=="number"&&(g=u==="end"?w*-1:w),f?{x:g*p,y:v*d}:{x:v*d,y:g*p}}const a4=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:l,middlewareData:u}=t,f=await i4(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+f.x,y:o+f.y,data:{...f,placement:l}}}}},o4=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:u={fn:k=>{let{x:C,y:_}=k;return{x:C,y:_}}},...f}=ki(e,t),d={x:n,y:r},p=await ql(t,f),m=fa(Ci(i)),v=Wv(m);let g=d[v],w=d[m];if(o){const k=v==="y"?"top":"left",C=v==="y"?"bottom":"right",_=g+p[k],T=g-p[C];g=jg(_,g,T)}if(l){const k=m==="y"?"top":"left",C=m==="y"?"bottom":"right",_=w+p[k],T=w-p[C];w=jg(_,w,T)}const x=u.fn({...t,[v]:g,[m]:w});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[v]:o,[m]:l}}}}}},s4=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:l}=t,{offset:u=0,mainAxis:f=!0,crossAxis:d=!0}=ki(e,t),p={x:n,y:r},m=fa(i),v=Wv(m);let g=p[v],w=p[m];const x=ki(u,t),k=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(f){const T=v==="y"?"height":"width",N=o.reference[v]-o.floating[T]+k.mainAxis,D=o.reference[v]+o.reference[T]-k.mainAxis;gD&&(g=D)}if(d){var C,_;const T=v==="y"?"width":"height",N=["top","left"].includes(Ci(i)),D=o.reference[m]-o.floating[T]+(N&&((C=l.offset)==null?void 0:C[m])||0)+(N?0:k.crossAxis),L=o.reference[m]+o.reference[T]+(N?0:((_=l.offset)==null?void 0:_[m])||0)-(N?k.crossAxis:0);wL&&(w=L)}return{[v]:g,[m]:w}}}},l4=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:l,elements:u}=t,{apply:f=()=>{},...d}=ki(e,t),p=await ql(t,d),m=Ci(i),v=bs(i),g=fa(i)==="y",{width:w,height:x}=o.floating;let k,C;m==="top"||m==="bottom"?(k=m,C=v===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(C=m,k=v==="end"?"top":"bottom");const _=x-p.top-p.bottom,T=w-p.left-p.right,N=ca(x-p[k],_),D=ca(w-p[C],T),L=!t.middlewareData.shift;let R=N,U=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(U=T),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=_),L&&!v){const z=qn(p.left,0),V=qn(p.right,0),q=qn(p.top,0),I=qn(p.bottom,0);g?U=w-2*(z!==0||V!==0?z+V:qn(p.left,p.right)):R=x-2*(q!==0||I!==0?q+I:qn(p.top,p.bottom))}await f({...t,availableWidth:U,availableHeight:R});const P=await l.getDimensions(u.floating);return w!==P.width||x!==P.height?{reset:{rects:!0}}:{}}}};function id(){return typeof window<"u"}function xs(e){return wC(e)?(e.nodeName||"").toLowerCase():"#document"}function Wn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qr(e){var t;return(t=(wC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function wC(e){return id()?e instanceof Node||e instanceof Wn(e).Node:!1}function Ar(e){return id()?e instanceof Element||e instanceof Wn(e).Element:!1}function Vr(e){return id()?e instanceof HTMLElement||e instanceof Wn(e).HTMLElement:!1}function L1(e){return!id()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Wn(e).ShadowRoot}function su(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Rr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function u4(e){return["table","td","th"].includes(xs(e))}function ad(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Zv(e){const t=Qv(),n=Ar(e)?Rr(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function c4(e){let t=da(e);for(;Vr(t)&&!ss(t);){if(Zv(t))return t;if(ad(t))return null;t=da(t)}return null}function Qv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ss(e){return["html","body","#document"].includes(xs(e))}function Rr(e){return Wn(e).getComputedStyle(e)}function od(e){return Ar(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function da(e){if(xs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||L1(e)&&e.host||qr(e);return L1(t)?t.host:t}function SC(e){const t=da(e);return ss(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vr(t)&&su(t)?t:SC(t)}function Yl(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=SC(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=Wn(i);if(o){const u=zg(l);return t.concat(l,l.visualViewport||[],su(i)?i:[],u&&n?Yl(u):[])}return t.concat(i,Yl(i,[],n))}function zg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function EC(e){const t=Rr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Vr(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,u=Sf(n)!==o||Sf(r)!==l;return u&&(n=o,r=l),{width:n,height:r,$:u}}function Jv(e){return Ar(e)?e:e.contextElement}function rs(e){const t=Jv(e);if(!Vr(t))return Hr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=EC(t);let l=(o?Sf(n.width):n.width)/r,u=(o?Sf(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const f4=Hr(0);function _C(e){const t=Wn(e);return!Qv()||!t.visualViewport?f4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function d4(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Wn(e)?!1:t}function Ka(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Jv(e);let l=Hr(1);t&&(r?Ar(r)&&(l=rs(r)):l=rs(e));const u=d4(o,n,r)?_C(o):Hr(0);let f=(i.left+u.x)/l.x,d=(i.top+u.y)/l.y,p=i.width/l.x,m=i.height/l.y;if(o){const v=Wn(o),g=r&&Ar(r)?Wn(r):r;let w=v,x=zg(w);for(;x&&r&&g!==w;){const k=rs(x),C=x.getBoundingClientRect(),_=Rr(x),T=C.left+(x.clientLeft+parseFloat(_.paddingLeft))*k.x,N=C.top+(x.clientTop+parseFloat(_.paddingTop))*k.y;f*=k.x,d*=k.y,p*=k.x,m*=k.y,f+=T,d+=N,w=Wn(x),x=zg(w)}}return _f({width:p,height:m,x:f,y:d})}function ey(e,t){const n=od(e).scrollLeft;return t?t.left+n:Ka(qr(e)).left+n}function kC(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:ey(e,r)),o=r.top+t.scrollTop;return{x:i,y:o}}function h4(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=qr(r),u=t?ad(t.floating):!1;if(r===l||u&&o)return n;let f={scrollLeft:0,scrollTop:0},d=Hr(1);const p=Hr(0),m=Vr(r);if((m||!m&&!o)&&((xs(r)!=="body"||su(l))&&(f=od(r)),Vr(r))){const g=Ka(r);d=rs(r),p.x=g.x+r.clientLeft,p.y=g.y+r.clientTop}const v=l&&!m&&!o?kC(l,f,!0):Hr(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-f.scrollLeft*d.x+p.x+v.x,y:n.y*d.y-f.scrollTop*d.y+p.y+v.y}}function p4(e){return Array.from(e.getClientRects())}function m4(e){const t=qr(e),n=od(e),r=e.ownerDocument.body,i=qn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=qn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+ey(e);const u=-n.scrollTop;return Rr(r).direction==="rtl"&&(l+=qn(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:u}}function g4(e,t){const n=Wn(e),r=qr(e),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,u=0,f=0;if(i){o=i.width,l=i.height;const d=Qv();(!d||d&&t==="fixed")&&(u=i.offsetLeft,f=i.offsetTop)}return{width:o,height:l,x:u,y:f}}function v4(e,t){const n=Ka(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Vr(e)?rs(e):Hr(1),l=e.clientWidth*o.x,u=e.clientHeight*o.y,f=i*o.x,d=r*o.y;return{width:l,height:u,x:f,y:d}}function z1(e,t,n){let r;if(t==="viewport")r=g4(e,n);else if(t==="document")r=m4(qr(e));else if(Ar(t))r=v4(t,n);else{const i=_C(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return _f(r)}function CC(e,t){const n=da(e);return n===t||!Ar(n)||ss(n)?!1:Rr(n).position==="fixed"||CC(n,t)}function y4(e,t){const n=t.get(e);if(n)return n;let r=Yl(e,[],!1).filter(u=>Ar(u)&&xs(u)!=="body"),i=null;const o=Rr(e).position==="fixed";let l=o?da(e):e;for(;Ar(l)&&!ss(l);){const u=Rr(l),f=Zv(l);!f&&u.position==="fixed"&&(i=null),(o?!f&&!i:!f&&u.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||su(l)&&!f&&CC(e,l))?r=r.filter(p=>p!==l):i=u,l=da(l)}return t.set(e,r),r}function b4(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?ad(t)?[]:y4(t,this._c):[].concat(n),r],u=l[0],f=l.reduce((d,p)=>{const m=z1(t,p,i);return d.top=qn(m.top,d.top),d.right=ca(m.right,d.right),d.bottom=ca(m.bottom,d.bottom),d.left=qn(m.left,d.left),d},z1(t,u,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function x4(e){const{width:t,height:n}=EC(e);return{width:t,height:n}}function w4(e,t,n){const r=Vr(t),i=qr(t),o=n==="fixed",l=Ka(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const f=Hr(0);if(r||!r&&!o)if((xs(t)!=="body"||su(i))&&(u=od(t)),r){const v=Ka(t,!0,o,t);f.x=v.x+t.clientLeft,f.y=v.y+t.clientTop}else i&&(f.x=ey(i));const d=i&&!r&&!o?kC(i,u):Hr(0),p=l.left+u.scrollLeft-f.x-d.x,m=l.top+u.scrollTop-f.y-d.y;return{x:p,y:m,width:l.width,height:l.height}}function rm(e){return Rr(e).position==="static"}function M1(e,t){if(!Vr(e)||Rr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return qr(e)===n&&(n=n.ownerDocument.body),n}function TC(e,t){const n=Wn(e);if(ad(e))return n;if(!Vr(e)){let i=da(e);for(;i&&!ss(i);){if(Ar(i)&&!rm(i))return i;i=da(i)}return n}let r=M1(e,t);for(;r&&u4(r)&&rm(r);)r=M1(r,t);return r&&ss(r)&&rm(r)&&!Zv(r)?n:r||c4(e)||n}const S4=async function(e){const t=this.getOffsetParent||TC,n=this.getDimensions,r=await n(e.floating);return{reference:w4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function E4(e){return Rr(e).direction==="rtl"}const _4={convertOffsetParentRelativeRectToViewportRelativeRect:h4,getDocumentElement:qr,getClippingRect:b4,getOffsetParent:TC,getElementRects:S4,getClientRects:p4,getDimensions:x4,getScale:rs,isElement:Ar,isRTL:E4};function AC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function k4(e,t){let n=null,r;const i=qr(e);function o(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),o();const d=e.getBoundingClientRect(),{left:p,top:m,width:v,height:g}=d;if(u||t(),!v||!g)return;const w=Lc(m),x=Lc(i.clientWidth-(p+v)),k=Lc(i.clientHeight-(m+g)),C=Lc(p),T={rootMargin:-w+"px "+-x+"px "+-k+"px "+-C+"px",threshold:qn(0,ca(1,f))||1};let N=!0;function D(L){const R=L[0].intersectionRatio;if(R!==f){if(!N)return l();R?l(!1,R):r=setTimeout(()=>{l(!1,1e-7)},1e3)}R===1&&!AC(d,e.getBoundingClientRect())&&l(),N=!1}try{n=new IntersectionObserver(D,{...T,root:i.ownerDocument})}catch{n=new IntersectionObserver(D,T)}n.observe(e)}return l(!0),o}function C4(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,d=Jv(e),p=i||o?[...d?Yl(d):[],...Yl(t)]:[];p.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),o&&C.addEventListener("resize",n)});const m=d&&u?k4(d,n):null;let v=-1,g=null;l&&(g=new ResizeObserver(C=>{let[_]=C;_&&_.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var T;(T=g)==null||T.observe(t)})),n()}),d&&!f&&g.observe(d),g.observe(t));let w,x=f?Ka(e):null;f&&k();function k(){const C=Ka(e);x&&!AC(x,C)&&n(),x=C,w=requestAnimationFrame(k)}return n(),()=>{var C;p.forEach(_=>{i&&_.removeEventListener("scroll",n),o&&_.removeEventListener("resize",n)}),m==null||m(),(C=g)==null||C.disconnect(),g=null,f&&cancelAnimationFrame(w)}}const T4=a4,A4=o4,R4=n4,D4=l4,N4=r4,P1=t4,O4=s4,j4=(e,t,n)=>{const r=new Map,i={platform:_4,...n},o={...i.platform,_c:r};return e4(e,t,{...i,platform:o})};var sf=typeof document<"u"?E.useLayoutEffect:E.useEffect;function kf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!kf(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!kf(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function RC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function F1(e,t){const n=RC(e);return Math.round(t*n)/n}function im(e){const t=E.useRef(e);return sf(()=>{t.current=e}),t}function L4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:u=!0,whileElementsMounted:f,open:d}=e,[p,m]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,g]=E.useState(r);kf(v,r)||g(r);const[w,x]=E.useState(null),[k,C]=E.useState(null),_=E.useCallback(F=>{F!==L.current&&(L.current=F,x(F))},[]),T=E.useCallback(F=>{F!==R.current&&(R.current=F,C(F))},[]),N=o||w,D=l||k,L=E.useRef(null),R=E.useRef(null),U=E.useRef(p),P=f!=null,z=im(f),V=im(i),q=im(d),I=E.useCallback(()=>{if(!L.current||!R.current)return;const F={placement:t,strategy:n,middleware:v};V.current&&(F.platform=V.current),j4(L.current,R.current,F).then(K=>{const A={...K,isPositioned:q.current!==!1};Y.current&&!kf(U.current,A)&&(U.current=A,au.flushSync(()=>{m(A)}))})},[v,t,n,V,q]);sf(()=>{d===!1&&U.current.isPositioned&&(U.current.isPositioned=!1,m(F=>({...F,isPositioned:!1})))},[d]);const Y=E.useRef(!1);sf(()=>(Y.current=!0,()=>{Y.current=!1}),[]),sf(()=>{if(N&&(L.current=N),D&&(R.current=D),N&&D){if(z.current)return z.current(N,D,I);I()}},[N,D,I,z,P]);const Z=E.useMemo(()=>({reference:L,floating:R,setReference:_,setFloating:T}),[_,T]),B=E.useMemo(()=>({reference:N,floating:D}),[N,D]),G=E.useMemo(()=>{const F={position:n,left:0,top:0};if(!B.floating)return F;const K=F1(B.floating,p.x),A=F1(B.floating,p.y);return u?{...F,transform:"translate("+K+"px, "+A+"px)",...RC(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:A}},[n,u,B.floating,p.x,p.y]);return E.useMemo(()=>({...p,update:I,refs:Z,elements:B,floatingStyles:G}),[p,I,Z,B,G])}const z4=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?P1({element:r.current,padding:i}).fn(n):{}:r?P1({element:r,padding:i}).fn(n):{}}}},M4=(e,t)=>({...T4(e),options:[e,t]}),P4=(e,t)=>({...A4(e),options:[e,t]}),F4=(e,t)=>({...O4(e),options:[e,t]}),I4=(e,t)=>({...R4(e),options:[e,t]}),G4=(e,t)=>({...D4(e),options:[e,t]}),U4=(e,t)=>({...N4(e),options:[e,t]}),B4=(e,t)=>({...z4(e),options:[e,t]});var $4="Arrow",DC=E.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return S.jsx(We.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});DC.displayName=$4;var H4=DC;function NC(e){const[t,n]=E.useState(void 0);return xn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let l,u;if("borderBoxSize"in o){const f=o.borderBoxSize,d=Array.isArray(f)?f[0]:f;l=d.inlineSize,u=d.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ty="Popper",[OC,ws]=dr(ty),[V4,jC]=OC(ty),LC=e=>{const{__scopePopper:t,children:n}=e,[r,i]=E.useState(null);return S.jsx(V4,{scope:t,anchor:r,onAnchorChange:i,children:n})};LC.displayName=ty;var zC="PopperAnchor",MC=E.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=jC(zC,n),l=E.useRef(null),u=dt(t,l);return E.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||l.current)}),r?null:S.jsx(We.div,{...i,ref:u})});MC.displayName=zC;var ny="PopperContent",[q4,Y4]=OC(ny),PC=E.forwardRef((e,t)=>{var ae,oe,Ce,he,Ee,we;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:v=!1,updatePositionStrategy:g="optimized",onPlaced:w,...x}=e,k=jC(ny,n),[C,_]=E.useState(null),T=dt(t,Pe=>_(Pe)),[N,D]=E.useState(null),L=NC(N),R=(L==null?void 0:L.width)??0,U=(L==null?void 0:L.height)??0,P=r+(o!=="center"?"-"+o:""),z=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},V=Array.isArray(d)?d:[d],q=V.length>0,I={padding:z,boundary:V.filter(X4),altBoundary:q},{refs:Y,floatingStyles:Z,placement:B,isPositioned:G,middlewareData:F}=L4({strategy:"fixed",placement:P,whileElementsMounted:(...Pe)=>C4(...Pe,{animationFrame:g==="always"}),elements:{reference:k.anchor},middleware:[M4({mainAxis:i+U,alignmentAxis:l}),f&&P4({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?F4():void 0,...I}),f&&I4({...I}),G4({...I,apply:({elements:Pe,rects:Ae,availableWidth:xe,availableHeight:ee})=>{const{width:ce,height:Te}=Ae.reference,ge=Pe.floating.style;ge.setProperty("--radix-popper-available-width",`${xe}px`),ge.setProperty("--radix-popper-available-height",`${ee}px`),ge.setProperty("--radix-popper-anchor-width",`${ce}px`),ge.setProperty("--radix-popper-anchor-height",`${Te}px`)}}),N&&B4({element:N,padding:u}),K4({arrowWidth:R,arrowHeight:U}),v&&U4({strategy:"referenceHidden",...I})]}),[K,A]=GC(B),H=un(w);xn(()=>{G&&(H==null||H())},[G,H]);const M=(ae=F.arrow)==null?void 0:ae.x,O=(oe=F.arrow)==null?void 0:oe.y,X=((Ce=F.arrow)==null?void 0:Ce.centerOffset)!==0,[re,ue]=E.useState();return xn(()=>{C&&ue(window.getComputedStyle(C).zIndex)},[C]),S.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:G?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:re,"--radix-popper-transform-origin":[(he=F.transformOrigin)==null?void 0:he.x,(Ee=F.transformOrigin)==null?void 0:Ee.y].join(" "),...((we=F.hide)==null?void 0:we.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:S.jsx(q4,{scope:n,placedSide:K,onArrowChange:D,arrowX:M,arrowY:O,shouldHideArrow:X,children:S.jsx(We.div,{"data-side":K,"data-align":A,...x,ref:T,style:{...x.style,animation:G?void 0:"none"}})})})});PC.displayName=ny;var FC="PopperArrow",W4={top:"bottom",right:"left",bottom:"top",left:"right"},IC=E.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=Y4(FC,r),l=W4[o.placedSide];return S.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:S.jsx(H4,{...i,ref:n,style:{...i.style,display:"block"}})})});IC.displayName=FC;function X4(e){return e!==null}var K4=e=>({name:"transformOrigin",options:e,fn(t){var k,C,_;const{placement:n,rects:r,middlewareData:i}=t,l=((k=i.arrow)==null?void 0:k.centerOffset)!==0,u=l?0:e.arrowWidth,f=l?0:e.arrowHeight,[d,p]=GC(n),m={start:"0%",center:"50%",end:"100%"}[p],v=(((C=i.arrow)==null?void 0:C.x)??0)+u/2,g=(((_=i.arrow)==null?void 0:_.y)??0)+f/2;let w="",x="";return d==="bottom"?(w=l?m:`${v}px`,x=`${-f}px`):d==="top"?(w=l?m:`${v}px`,x=`${r.floating.height+f}px`):d==="right"?(w=`${-f}px`,x=l?m:`${g}px`):d==="left"&&(w=`${r.floating.width+f}px`,x=l?m:`${g}px`),{data:{x:w,y:x}}}});function GC(e){const[t,n="center"]=e.split("-");return[t,n]}var ry=LC,sd=MC,iy=PC,ay=IC,Z4="VisuallyHidden",oy=E.forwardRef((e,t)=>S.jsx(We.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));oy.displayName=Z4;var Q4=oy,[ld,dK]=dr("Tooltip",[ws]),ud=ws(),UC="TooltipProvider",J4=700,Mg="tooltip.open",[eI,sy]=ld(UC),BC=e=>{const{__scopeTooltip:t,delayDuration:n=J4,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,[l,u]=E.useState(!0),f=E.useRef(!1),d=E.useRef(0);return E.useEffect(()=>{const p=d.current;return()=>window.clearTimeout(p)},[]),S.jsx(eI,{scope:t,isOpenDelayed:l,delayDuration:n,onOpen:E.useCallback(()=>{window.clearTimeout(d.current),u(!1)},[]),onClose:E.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>u(!0),r)},[r]),isPointerInTransitRef:f,onPointerInTransitChange:E.useCallback(p=>{f.current=p},[]),disableHoverableContent:i,children:o})};BC.displayName=UC;var cd="Tooltip",[tI,fd]=ld(cd),$C=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:l,delayDuration:u}=e,f=sy(cd,e.__scopeTooltip),d=ud(t),[p,m]=E.useState(null),v=bn(),g=E.useRef(0),w=l??f.disableHoverableContent,x=u??f.delayDuration,k=E.useRef(!1),[C=!1,_]=_i({prop:r,defaultProp:i,onChange:R=>{R?(f.onOpen(),document.dispatchEvent(new CustomEvent(Mg))):f.onClose(),o==null||o(R)}}),T=E.useMemo(()=>C?k.current?"delayed-open":"instant-open":"closed",[C]),N=E.useCallback(()=>{window.clearTimeout(g.current),g.current=0,k.current=!1,_(!0)},[_]),D=E.useCallback(()=>{window.clearTimeout(g.current),g.current=0,_(!1)},[_]),L=E.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{k.current=!0,_(!0),g.current=0},x)},[x,_]);return E.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),S.jsx(ry,{...d,children:S.jsx(tI,{scope:t,contentId:v,open:C,stateAttribute:T,trigger:p,onTriggerChange:m,onTriggerEnter:E.useCallback(()=>{f.isOpenDelayed?L():N()},[f.isOpenDelayed,L,N]),onTriggerLeave:E.useCallback(()=>{w?D():(window.clearTimeout(g.current),g.current=0)},[D,w]),onOpen:N,onClose:D,disableHoverableContent:w,children:n})})};$C.displayName=cd;var Pg="TooltipTrigger",HC=E.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=fd(Pg,n),o=sy(Pg,n),l=ud(n),u=E.useRef(null),f=dt(t,u,i.onTriggerChange),d=E.useRef(!1),p=E.useRef(!1),m=E.useCallback(()=>d.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),S.jsx(sd,{asChild:!0,...l,children:S.jsx(We.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:f,onPointerMove:qe(e.onPointerMove,v=>{v.pointerType!=="touch"&&!p.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),p.current=!0)}),onPointerLeave:qe(e.onPointerLeave,()=>{i.onTriggerLeave(),p.current=!1}),onPointerDown:qe(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:qe(e.onFocus,()=>{d.current||i.onOpen()}),onBlur:qe(e.onBlur,i.onClose),onClick:qe(e.onClick,i.onClose)})})});HC.displayName=Pg;var nI="TooltipPortal",[hK,rI]=ld(nI,{forceMount:void 0}),ls="TooltipContent",VC=E.forwardRef((e,t)=>{const n=rI(ls,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,l=fd(ls,e.__scopeTooltip);return S.jsx(Kn,{present:r||l.open,children:l.disableHoverableContent?S.jsx(qC,{side:i,...o,ref:t}):S.jsx(iI,{side:i,...o,ref:t})})}),iI=E.forwardRef((e,t)=>{const n=fd(ls,e.__scopeTooltip),r=sy(ls,e.__scopeTooltip),i=E.useRef(null),o=dt(t,i),[l,u]=E.useState(null),{trigger:f,onClose:d}=n,p=i.current,{onPointerInTransitChange:m}=r,v=E.useCallback(()=>{u(null),m(!1)},[m]),g=E.useCallback((w,x)=>{const k=w.currentTarget,C={x:w.clientX,y:w.clientY},_=lI(C,k.getBoundingClientRect()),T=uI(C,_),N=cI(x.getBoundingClientRect()),D=dI([...T,...N]);u(D),m(!0)},[m]);return E.useEffect(()=>()=>v(),[v]),E.useEffect(()=>{if(f&&p){const w=k=>g(k,p),x=k=>g(k,f);return f.addEventListener("pointerleave",w),p.addEventListener("pointerleave",x),()=>{f.removeEventListener("pointerleave",w),p.removeEventListener("pointerleave",x)}}},[f,p,g,v]),E.useEffect(()=>{if(l){const w=x=>{const k=x.target,C={x:x.clientX,y:x.clientY},_=(f==null?void 0:f.contains(k))||(p==null?void 0:p.contains(k)),T=!fI(C,l);_?v():T&&(v(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[f,p,l,d,v]),S.jsx(qC,{...e,ref:o})}),[aI,oI]=ld(cd,{isInside:!1}),qC=E.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:l,...u}=e,f=fd(ls,n),d=ud(n),{onClose:p}=f;return E.useEffect(()=>(document.addEventListener(Mg,p),()=>document.removeEventListener(Mg,p)),[p]),E.useEffect(()=>{if(f.trigger){const m=v=>{const g=v.target;g!=null&&g.contains(f.trigger)&&p()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[f.trigger,p]),S.jsx(ou,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:m=>m.preventDefault(),onDismiss:p,children:S.jsxs(iy,{"data-state":f.stateAttribute,...d,...u,ref:t,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:[S.jsx(Mv,{children:r}),S.jsx(aI,{scope:n,isInside:!0,children:S.jsx(Q4,{id:f.contentId,role:"tooltip",children:i||r})})]})})});VC.displayName=ls;var YC="TooltipArrow",sI=E.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=ud(n);return oI(YC,n).isInside?null:S.jsx(ay,{...i,...r,ref:t})});sI.displayName=YC;function lI(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function uI(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function cI(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function fI(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,l=t.length-1;or!=p>r&&n<(d-u)*(r-f)/(p-f)+u&&(i=!i)}return i}function dI(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),hI(t)}function hI(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const o=t[t.length-1],l=t[t.length-2];if((o.x-l.x)*(i.y-l.y)>=(o.y-l.y)*(i.x-l.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],l=n[n.length-2];if((o.x-l.x)*(i.y-l.y)>=(o.y-l.y)*(i.x-l.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var pI=BC,mI=$C,gI=HC,WC=VC;const XC=pI,KC=mI,ZC=gI,vI=e=>typeof e!="string"?e:e.split("\\n").map((t,n)=>S.jsxs(E.Fragment,{children:[t,nS.jsx(WC,{ref:i,sideOffset:t,className:Me("bg-popover text-popover-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=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 z-50 mx-1 max-w-sm overflow-hidden rounded-md border px-3 py-2 text-sm shadow-md",e),...r,children:typeof n=="string"?vI(n):n}));ly.displayName=WC.displayName;const Cf=$_("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"size-8"}},defaultVariants:{variant:"default",size:"default"}}),Ot=E.forwardRef(({className:e,variant:t,tooltip:n,size:r,side:i="right",asChild:o=!1,...l},u)=>{const f=o?ua:"button";return n?S.jsx(XC,{children:S.jsxs(KC,{children:[S.jsx(ZC,{asChild:!0,children:S.jsx(f,{className:Me(Cf({variant:t,size:r,className:e}),"cursor-pointer"),ref:u,...l})}),S.jsx(ly,{side:i,children:n})]})}):S.jsx(f,{className:Me(Cf({variant:t,size:r,className:e}),"cursor-pointer"),ref:u,...l})});Ot.displayName="Button";const yI=HF,bI=VF,QC=E.forwardRef(({className:e,...t},n)=>S.jsx(pC,{className:Me("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...t,ref:n}));QC.displayName=pC.displayName;const JC=E.forwardRef(({className:e,...t},n)=>S.jsxs(bI,{children:[S.jsx(QC,{}),S.jsx(mC,{ref:n,className:Me("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...t})]}));JC.displayName=mC.displayName;const eT=({className:e,...t})=>S.jsx("div",{className:Me("flex flex-col space-y-2 text-center sm:text-left",e),...t});eT.displayName="AlertDialogHeader";const tT=E.forwardRef(({className:e,...t},n)=>S.jsx(yC,{ref:n,className:Me("text-lg font-semibold",e),...t}));tT.displayName=yC.displayName;const nT=E.forwardRef(({className:e,...t},n)=>S.jsx(bC,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));nT.displayName=bC.displayName;const xI=E.forwardRef(({className:e,...t},n)=>S.jsx(gC,{ref:n,className:Me(Cf(),e),...t}));xI.displayName=gC.displayName;const wI=E.forwardRef(({className:e,...t},n)=>S.jsx(vC,{ref:n,className:Me(Cf({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));wI.displayName=vC.displayName;const Za=E.forwardRef(({className:e,type:t,...n},r)=>S.jsx("input",{type:t,className:Me("border-input file:text-foreground placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 rounded-md border bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-1 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Za.displayName="Input";var SI=e=>{switch(e){case"success":return kI;case"info":return TI;case"warning":return CI;case"error":return AI;default:return null}},EI=Array(12).fill(0),_I=({visible:e,className:t})=>be.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},be.createElement("div",{className:"sonner-spinner"},EI.map((n,r)=>be.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),kI=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.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"})),CI=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},be.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"})),TI=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.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"})),AI=be.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},be.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"})),RI=be.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"},be.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),be.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),DI=()=>{let[e,t]=be.useState(document.hidden);return be.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Fg=1,NI=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Fg++,o=this.toasts.find(u=>u.id===i),l=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(u=>u.id===i?(this.publish({...u,...e,id:i,title:n}),{...u,...e,id:i,dismissible:l,title:n}):u):this.addToast({title:n,...r,dismissible:l,id:i}),i},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),i=n!==void 0,o,l=r.then(async f=>{if(o=["resolve",f],be.isValidElement(f))i=!1,this.create({id:n,type:"default",message:f});else if(jI(f)&&!f.ok){i=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${f.status}`):t.error,p=typeof t.description=="function"?await t.description(`HTTP error! status: ${f.status}`):t.description;this.create({id:n,type:"error",message:d,description:p})}else if(t.success!==void 0){i=!1;let d=typeof t.success=="function"?await t.success(f):t.success,p=typeof t.description=="function"?await t.description(f):t.description;this.create({id:n,type:"success",message:d,description:p})}}).catch(async f=>{if(o=["reject",f],t.error!==void 0){i=!1;let d=typeof t.error=="function"?await t.error(f):t.error,p=typeof t.description=="function"?await t.description(f):t.description;this.create({id:n,type:"error",message:d,description:p})}}).finally(()=>{var f;i&&(this.dismiss(n),n=void 0),(f=t.finally)==null||f.call(t)}),u=()=>new Promise((f,d)=>l.then(()=>o[0]==="reject"?d(o[1]):f(o[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:u}:Object.assign(n,{unwrap:u})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Fg++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Ln=new NI,OI=(e,t)=>{let n=(t==null?void 0:t.id)||Fg++;return Ln.addToast({title:e,...t,id:n}),n},jI=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",LI=OI,zI=()=>Ln.toasts,MI=()=>Ln.getActiveToasts(),vn=Object.assign(LI,{success:Ln.success,info:Ln.info,warning:Ln.warning,error:Ln.error,custom:Ln.custom,message:Ln.message,promise:Ln.promise,dismiss:Ln.dismiss,loading:Ln.loading},{getHistory:zI,getToasts:MI});function PI(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}PI(`:where(html[dir="ltr"]),:where([data-sonner-toaster][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%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][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%)}:where([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:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([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);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([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 #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([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)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([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;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([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);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-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([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}:where([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}:where([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, 0px)) translate(var(--swipe-amount-x, 0px));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{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{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{0%{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-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--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-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-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-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, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--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-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-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],[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],[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],[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],[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:nth-child(1){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)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{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 zc(e){return e.label!==void 0}var FI=3,II="32px",GI="16px",I1=4e3,UI=356,BI=14,$I=20,HI=200;function wr(...e){return e.filter(Boolean).join(" ")}function VI(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var qI=e=>{var t,n,r,i,o,l,u,f,d,p,m;let{invert:v,toast:g,unstyled:w,interacting:x,setHeights:k,visibleToasts:C,heights:_,index:T,toasts:N,expanded:D,removeToast:L,defaultRichColors:R,closeButton:U,style:P,cancelButtonStyle:z,actionButtonStyle:V,className:q="",descriptionClassName:I="",duration:Y,position:Z,gap:B,loadingIcon:G,expandByDefault:F,classNames:K,icons:A,closeButtonAriaLabel:H="Close toast",pauseWhenPageIsHidden:M}=e,[O,X]=be.useState(null),[re,ue]=be.useState(null),[ae,oe]=be.useState(!1),[Ce,he]=be.useState(!1),[Ee,we]=be.useState(!1),[Pe,Ae]=be.useState(!1),[xe,ee]=be.useState(!1),[ce,Te]=be.useState(0),[ge,Se]=be.useState(0),ie=be.useRef(g.duration||Y||I1),$e=be.useRef(null),Ge=be.useRef(null),ve=T===0,Ne=T+1<=C,te=g.type,de=g.dismissible!==!1,Oe=g.className||"",He=g.descriptionClassName||"",Ye=be.useMemo(()=>_.findIndex(Ze=>Ze.toastId===g.id)||0,[_,g.id]),vt=be.useMemo(()=>{var Ze;return(Ze=g.closeButton)!=null?Ze:U},[g.closeButton,U]),Mt=be.useMemo(()=>g.duration||Y||I1,[g.duration,Y]),bt=be.useRef(0),rt=be.useRef(0),qt=be.useRef(0),at=be.useRef(null),[At,rn]=Z.split("-"),io=be.useMemo(()=>_.reduce((Ze,gt,_t)=>_t>=Ye?Ze:Ze+gt.height,0),[_,Ye]),xu=DI(),ao=g.invert||v,Di=te==="loading";rt.current=be.useMemo(()=>Ye*B+io,[Ye,io]),be.useEffect(()=>{ie.current=Mt},[Mt]),be.useEffect(()=>{oe(!0)},[]),be.useEffect(()=>{let Ze=Ge.current;if(Ze){let gt=Ze.getBoundingClientRect().height;return Se(gt),k(_t=>[{toastId:g.id,height:gt,position:g.position},..._t]),()=>k(_t=>_t.filter(Cn=>Cn.toastId!==g.id))}},[k,g.id]),be.useLayoutEffect(()=>{if(!ae)return;let Ze=Ge.current,gt=Ze.style.height;Ze.style.height="auto";let _t=Ze.getBoundingClientRect().height;Ze.style.height=gt,Se(_t),k(Cn=>Cn.find(Sn=>Sn.toastId===g.id)?Cn.map(Sn=>Sn.toastId===g.id?{...Sn,height:_t}:Sn):[{toastId:g.id,height:_t,position:g.position},...Cn])},[ae,g.title,g.description,k,g.id]);let dn=be.useCallback(()=>{he(!0),Te(rt.current),k(Ze=>Ze.filter(gt=>gt.toastId!==g.id)),setTimeout(()=>{L(g)},HI)},[g,L,k,rt]);be.useEffect(()=>{if(g.promise&&te==="loading"||g.duration===1/0||g.type==="loading")return;let Ze;return D||x||M&&xu?(()=>{if(qt.current{var gt;(gt=g.onAutoClose)==null||gt.call(g,g),dn()},ie.current)),()=>clearTimeout(Ze)},[D,x,g,te,M,xu,dn]),be.useEffect(()=>{g.delete&&dn()},[dn,g.delete]);function oo(){var Ze,gt,_t;return A!=null&&A.loading?be.createElement("div",{className:wr(K==null?void 0:K.loader,(Ze=g==null?void 0:g.classNames)==null?void 0:Ze.loader,"sonner-loader"),"data-visible":te==="loading"},A.loading):G?be.createElement("div",{className:wr(K==null?void 0:K.loader,(gt=g==null?void 0:g.classNames)==null?void 0:gt.loader,"sonner-loader"),"data-visible":te==="loading"},G):be.createElement(_I,{className:wr(K==null?void 0:K.loader,(_t=g==null?void 0:g.classNames)==null?void 0:_t.loader),visible:te==="loading"})}return be.createElement("li",{tabIndex:0,ref:Ge,className:wr(q,Oe,K==null?void 0:K.toast,(t=g==null?void 0:g.classNames)==null?void 0:t.toast,K==null?void 0:K.default,K==null?void 0:K[te],(n=g==null?void 0:g.classNames)==null?void 0:n[te]),"data-sonner-toast":"","data-rich-colors":(r=g.richColors)!=null?r:R,"data-styled":!(g.jsx||g.unstyled||w),"data-mounted":ae,"data-promise":!!g.promise,"data-swiped":xe,"data-removed":Ce,"data-visible":Ne,"data-y-position":At,"data-x-position":rn,"data-index":T,"data-front":ve,"data-swiping":Ee,"data-dismissible":de,"data-type":te,"data-invert":ao,"data-swipe-out":Pe,"data-swipe-direction":re,"data-expanded":!!(D||F&&ae),style:{"--index":T,"--toasts-before":T,"--z-index":N.length-T,"--offset":`${Ce?ce:rt.current}px`,"--initial-height":F?"auto":`${ge}px`,...P,...g.style},onDragEnd:()=>{we(!1),X(null),at.current=null},onPointerDown:Ze=>{Di||!de||($e.current=new Date,Te(rt.current),Ze.target.setPointerCapture(Ze.pointerId),Ze.target.tagName!=="BUTTON"&&(we(!0),at.current={x:Ze.clientX,y:Ze.clientY}))},onPointerUp:()=>{var Ze,gt,_t,Cn;if(Pe||!de)return;at.current=null;let Sn=Number(((Ze=Ge.current)==null?void 0:Ze.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Tn=Number(((gt=Ge.current)==null?void 0:gt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Zr=new Date().getTime()-((_t=$e.current)==null?void 0:_t.getTime()),An=O==="x"?Sn:Tn,gr=Math.abs(An)/Zr;if(Math.abs(An)>=$I||gr>.11){Te(rt.current),(Cn=g.onDismiss)==null||Cn.call(g,g),ue(O==="x"?Sn>0?"right":"left":Tn>0?"down":"up"),dn(),Ae(!0),ee(!1);return}we(!1),X(null)},onPointerMove:Ze=>{var gt,_t,Cn,Sn;if(!at.current||!de||((gt=window.getSelection())==null?void 0:gt.toString().length)>0)return;let Tn=Ze.clientY-at.current.y,Zr=Ze.clientX-at.current.x,An=(_t=e.swipeDirections)!=null?_t:VI(Z);!O&&(Math.abs(Zr)>1||Math.abs(Tn)>1)&&X(Math.abs(Zr)>Math.abs(Tn)?"x":"y");let gr={x:0,y:0};O==="y"?(An.includes("top")||An.includes("bottom"))&&(An.includes("top")&&Tn<0||An.includes("bottom")&&Tn>0)&&(gr.y=Tn):O==="x"&&(An.includes("left")||An.includes("right"))&&(An.includes("left")&&Zr<0||An.includes("right")&&Zr>0)&&(gr.x=Zr),(Math.abs(gr.x)>0||Math.abs(gr.y)>0)&&ee(!0),(Cn=Ge.current)==null||Cn.style.setProperty("--swipe-amount-x",`${gr.x}px`),(Sn=Ge.current)==null||Sn.style.setProperty("--swipe-amount-y",`${gr.y}px`)}},vt&&!g.jsx?be.createElement("button",{"aria-label":H,"data-disabled":Di,"data-close-button":!0,onClick:Di||!de?()=>{}:()=>{var Ze;dn(),(Ze=g.onDismiss)==null||Ze.call(g,g)},className:wr(K==null?void 0:K.closeButton,(i=g==null?void 0:g.classNames)==null?void 0:i.closeButton)},(o=A==null?void 0:A.close)!=null?o:RI):null,g.jsx||E.isValidElement(g.title)?g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title:be.createElement(be.Fragment,null,te||g.icon||g.promise?be.createElement("div",{"data-icon":"",className:wr(K==null?void 0:K.icon,(l=g==null?void 0:g.classNames)==null?void 0:l.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||oo():null,g.type!=="loading"?g.icon||(A==null?void 0:A[te])||SI(te):null):null,be.createElement("div",{"data-content":"",className:wr(K==null?void 0:K.content,(u=g==null?void 0:g.classNames)==null?void 0:u.content)},be.createElement("div",{"data-title":"",className:wr(K==null?void 0:K.title,(f=g==null?void 0:g.classNames)==null?void 0:f.title)},typeof g.title=="function"?g.title():g.title),g.description?be.createElement("div",{"data-description":"",className:wr(I,He,K==null?void 0:K.description,(d=g==null?void 0:g.classNames)==null?void 0:d.description)},typeof g.description=="function"?g.description():g.description):null),E.isValidElement(g.cancel)?g.cancel:g.cancel&&zc(g.cancel)?be.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||z,onClick:Ze=>{var gt,_t;zc(g.cancel)&&de&&((_t=(gt=g.cancel).onClick)==null||_t.call(gt,Ze),dn())},className:wr(K==null?void 0:K.cancelButton,(p=g==null?void 0:g.classNames)==null?void 0:p.cancelButton)},g.cancel.label):null,E.isValidElement(g.action)?g.action:g.action&&zc(g.action)?be.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||V,onClick:Ze=>{var gt,_t;zc(g.action)&&((_t=(gt=g.action).onClick)==null||_t.call(gt,Ze),!Ze.defaultPrevented&&dn())},className:wr(K==null?void 0:K.actionButton,(m=g==null?void 0:g.classNames)==null?void 0:m.actionButton)},g.action.label):null))};function G1(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function YI(e,t){let n={};return[e,t].forEach((r,i)=>{let o=i===1,l=o?"--mobile-offset":"--offset",u=o?GI:II;function f(d){["top","right","bottom","left"].forEach(p=>{n[`${l}-${p}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?f(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${l}-${d}`]=u:n[`${l}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):f(u)}),n}var WI=E.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:i=["altKey","KeyT"],expand:o,closeButton:l,className:u,offset:f,mobileOffset:d,theme:p="light",richColors:m,duration:v,style:g,visibleToasts:w=FI,toastOptions:x,dir:k=G1(),gap:C=BI,loadingIcon:_,icons:T,containerAriaLabel:N="Notifications",pauseWhenPageIsHidden:D}=e,[L,R]=be.useState([]),U=be.useMemo(()=>Array.from(new Set([r].concat(L.filter(M=>M.position).map(M=>M.position)))),[L,r]),[P,z]=be.useState([]),[V,q]=be.useState(!1),[I,Y]=be.useState(!1),[Z,B]=be.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=be.useRef(null),F=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=be.useRef(null),A=be.useRef(!1),H=be.useCallback(M=>{R(O=>{var X;return(X=O.find(re=>re.id===M.id))!=null&&X.delete||Ln.dismiss(M.id),O.filter(({id:re})=>re!==M.id)})},[]);return be.useEffect(()=>Ln.subscribe(M=>{if(M.dismiss){R(O=>O.map(X=>X.id===M.id?{...X,delete:!0}:X));return}setTimeout(()=>{Ck.flushSync(()=>{R(O=>{let X=O.findIndex(re=>re.id===M.id);return X!==-1?[...O.slice(0,X),{...O[X],...M},...O.slice(X+1)]:[M,...O]})})})}),[]),be.useEffect(()=>{if(p!=="system"){B(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?B("dark"):B("light")),typeof window>"u")return;let M=window.matchMedia("(prefers-color-scheme: dark)");try{M.addEventListener("change",({matches:O})=>{B(O?"dark":"light")})}catch{M.addListener(({matches:X})=>{try{B(X?"dark":"light")}catch(re){console.error(re)}})}},[p]),be.useEffect(()=>{L.length<=1&&q(!1)},[L]),be.useEffect(()=>{let M=O=>{var X,re;i.every(ue=>O[ue]||O.code===ue)&&(q(!0),(X=G.current)==null||X.focus()),O.code==="Escape"&&(document.activeElement===G.current||(re=G.current)!=null&&re.contains(document.activeElement))&&q(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[i]),be.useEffect(()=>{if(G.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,A.current=!1)}},[G.current]),be.createElement("section",{ref:t,"aria-label":`${N} ${F}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},U.map((M,O)=>{var X;let[re,ue]=M.split("-");return L.length?be.createElement("ol",{key:M,dir:k==="auto"?G1():k,tabIndex:-1,ref:G,className:u,"data-sonner-toaster":!0,"data-theme":Z,"data-y-position":re,"data-lifted":V&&L.length>1&&!o,"data-x-position":ue,style:{"--front-toast-height":`${((X=P[0])==null?void 0:X.height)||0}px`,"--width":`${UI}px`,"--gap":`${C}px`,...g,...YI(f,d)},onBlur:ae=>{A.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(A.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||A.current||(A.current=!0,K.current=ae.relatedTarget)},onMouseEnter:()=>q(!0),onMouseMove:()=>q(!0),onMouseLeave:()=>{I||q(!1)},onDragEnd:()=>q(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||Y(!0)},onPointerUp:()=>Y(!1)},L.filter(ae=>!ae.position&&O===0||ae.position===M).map((ae,oe)=>{var Ce,he;return be.createElement(qI,{key:ae.id,icons:T,index:oe,toast:ae,defaultRichColors:m,duration:(Ce=x==null?void 0:x.duration)!=null?Ce:v,className:x==null?void 0:x.className,descriptionClassName:x==null?void 0:x.descriptionClassName,invert:n,visibleToasts:w,closeButton:(he=x==null?void 0:x.closeButton)!=null?he:l,interacting:I,position:M,style:x==null?void 0:x.style,unstyled:x==null?void 0:x.unstyled,classNames:x==null?void 0:x.classNames,cancelButtonStyle:x==null?void 0:x.cancelButtonStyle,actionButtonStyle:x==null?void 0:x.actionButtonStyle,removeToast:H,toasts:L.filter(Ee=>Ee.position==ae.position),heights:P.filter(Ee=>Ee.position==ae.position),setHeights:z,expandByDefault:o,gap:C,loadingIcon:_,expanded:V,pauseWhenPageIsHidden:D,swipeDirections:e.swipeDirections})})):null}))});const XI=()=>{const[e,t]=E.useState(!0),n=Qe.use.apiKey(),[r,i]=E.useState(""),o=Mn.use.message();E.useEffect(()=>{i(n||"")},[n,e]),E.useEffect(()=>{o&&(o.includes(yk)||o.includes(bk))&&t(!0)},[o,t]);const l=E.useCallback(async()=>{if(Qe.setState({apiKey:r||null}),await Mn.getState().check()){t(!1);return}vn.error("API Key is invalid")},[r]),u=E.useCallback(f=>{i(f.target.value)},[i]);return S.jsx(yI,{open:e,onOpenChange:t,children:S.jsxs(JC,{children:[S.jsxs(eT,{children:[S.jsx(tT,{children:"API Key is required"}),S.jsx(nT,{children:"Please enter your API key"})]}),S.jsxs("form",{className:"flex gap-2",onSubmit:f=>f.preventDefault(),children:[S.jsx(Za,{type:"password",value:r,onChange:u,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"}),S.jsx(Ot,{onClick:l,variant:"outline",size:"sm",children:"Save"})]})]})})};var uy="Popover",[rT,pK]=dr(uy,[ws]),lu=ws(),[KI,ha]=rT(uy),iT=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!1}=e,u=lu(t),f=E.useRef(null),[d,p]=E.useState(!1),[m=!1,v]=_i({prop:r,defaultProp:i,onChange:o});return S.jsx(ry,{...u,children:S.jsx(KI,{scope:t,contentId:bn(),triggerRef:f,open:m,onOpenChange:v,onOpenToggle:E.useCallback(()=>v(g=>!g),[v]),hasCustomAnchor:d,onCustomAnchorAdd:E.useCallback(()=>p(!0),[]),onCustomAnchorRemove:E.useCallback(()=>p(!1),[]),modal:l,children:n})})};iT.displayName=uy;var aT="PopoverAnchor",ZI=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ha(aT,n),o=lu(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=i;return E.useEffect(()=>(l(),()=>u()),[l,u]),S.jsx(sd,{...o,...r,ref:t})});ZI.displayName=aT;var oT="PopoverTrigger",sT=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ha(oT,n),o=lu(n),l=dt(t,i.triggerRef),u=S.jsx(We.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":dT(i.open),...r,ref:l,onClick:qe(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:S.jsx(sd,{asChild:!0,...o,children:u})});sT.displayName=oT;var cy="PopoverPortal",[QI,JI]=rT(cy,{forceMount:void 0}),lT=e=>{const{__scopePopover:t,forceMount:n,children:r,container:i}=e,o=ha(cy,t);return S.jsx(QI,{scope:t,forceMount:n,children:S.jsx(Kn,{present:n||o.open,children:S.jsx(Jf,{asChild:!0,container:i,children:r})})})};lT.displayName=cy;var us="PopoverContent",uT=E.forwardRef((e,t)=>{const n=JI(us,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,o=ha(us,e.__scopePopover);return S.jsx(Kn,{present:r||o.open,children:o.modal?S.jsx(e3,{...i,ref:t}):S.jsx(t3,{...i,ref:t})})});uT.displayName=us;var e3=E.forwardRef((e,t)=>{const n=ha(us,e.__scopePopover),r=E.useRef(null),i=dt(t,r),o=E.useRef(!1);return E.useEffect(()=>{const l=r.current;if(l)return Fv(l)},[]),S.jsx(td,{as:ua,allowPinchZoom:!0,children:S.jsx(cT,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:qe(e.onCloseAutoFocus,l=>{var u;l.preventDefault(),o.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:qe(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,d=u.button===2||f;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:qe(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),t3=E.forwardRef((e,t)=>{const n=ha(us,e.__scopePopover),r=E.useRef(!1),i=E.useRef(!1);return S.jsx(cT,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var f,d;(f=e.onInteractOutside)==null||f.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((d=n.triggerRef.current)==null?void 0:d.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),cT=E.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,...m}=e,v=ha(us,n),g=lu(n);return Pv(),S.jsx(Qf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:S.jsx(ou,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onDismiss:()=>v.onOpenChange(!1),children:S.jsx(iy,{"data-state":dT(v.open),role:"dialog",id:v.contentId,...g,...m,ref:t,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)"}})})})}),fT="PopoverClose",n3=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=ha(fT,n);return S.jsx(We.button,{type:"button",...r,ref:t,onClick:qe(e.onClick,()=>i.onOpenChange(!1))})});n3.displayName=fT;var r3="PopoverArrow",i3=E.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,i=lu(n);return S.jsx(ay,{...i,...r,ref:t})});i3.displayName=r3;function dT(e){return e?"open":"closed"}var a3=iT,o3=sT,s3=lT,hT=uT;const dd=a3,hd=o3,uu=E.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},i)=>S.jsx(s3,{children:S.jsx(hT,{ref:i,align:t,sideOffset:n,className:Me("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 z-50 rounded-md border p-4 shadow-md outline-none",e),...r})}));uu.displayName=hT.displayName;const l3=({status:e})=>e?S.jsxs("div",{className:"min-w-[300px] space-y-3 text-sm",children:[S.jsxs("div",{className:"space-y-1",children:[S.jsx("h4",{className:"font-medium",children:"Storage Info"}),S.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[S.jsx("span",{children:"Working Directory:"}),S.jsx("span",{className:"truncate",children:e.working_directory}),S.jsx("span",{children:"Input Directory:"}),S.jsx("span",{className:"truncate",children:e.input_directory})]})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsx("h4",{className:"font-medium",children:"LLM Configuration"}),S.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[S.jsx("span",{children:"LLM Binding:"}),S.jsx("span",{children:e.configuration.llm_binding}),S.jsx("span",{children:"LLM Binding Host:"}),S.jsx("span",{children:e.configuration.llm_binding_host}),S.jsx("span",{children:"LLM Model:"}),S.jsx("span",{children:e.configuration.llm_model}),S.jsx("span",{children:"Max Tokens:"}),S.jsx("span",{children:e.configuration.max_tokens})]})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsx("h4",{className:"font-medium",children:"Embedding Configuration"}),S.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[S.jsx("span",{children:"Embedding Binding:"}),S.jsx("span",{children:e.configuration.embedding_binding}),S.jsx("span",{children:"Embedding Binding Host:"}),S.jsx("span",{children:e.configuration.embedding_binding_host}),S.jsx("span",{children:"Embedding Model:"}),S.jsx("span",{children:e.configuration.embedding_model})]})]}),S.jsxs("div",{className:"space-y-1",children:[S.jsx("h4",{className:"font-medium",children:"Storage Configuration"}),S.jsxs("div",{className:"text-muted-foreground grid grid-cols-2 gap-1",children:[S.jsx("span",{children:"KV Storage:"}),S.jsx("span",{children:e.configuration.kv_storage}),S.jsx("span",{children:"Doc Status Storage:"}),S.jsx("span",{children:e.configuration.doc_status_storage}),S.jsx("span",{children:"Graph Storage:"}),S.jsx("span",{children:e.configuration.graph_storage}),S.jsx("span",{children:"Vector Storage:"}),S.jsx("span",{children:e.configuration.vector_storage})]})]})]}):S.jsx("div",{className:"text-muted-foreground text-sm",children:"Status information unavailable"}),u3=()=>{const e=Mn.use.health(),t=Mn.use.lastCheckTime(),n=Mn.use.status(),[r,i]=E.useState(!1);return E.useEffect(()=>{i(!0);const o=setTimeout(()=>i(!1),300);return()=>clearTimeout(o)},[t]),S.jsx("div",{className:"fixed right-4 bottom-4 flex items-center gap-2 opacity-80 select-none",children:S.jsxs(dd,{children:[S.jsx(hd,{asChild:!0,children:S.jsxs("div",{className:"flex cursor-help items-center gap-2",children:[S.jsx("div",{className:Me("h-3 w-3 rounded-full transition-all duration-300","shadow-[0_0_8px_rgba(0,0,0,0.2)]",e?"bg-green-500":"bg-red-500",r&&"scale-125",r&&e&&"shadow-[0_0_12px_rgba(34,197,94,0.4)]",r&&!e&&"shadow-[0_0_12px_rgba(239,68,68,0.4)]")}),S.jsx("span",{className:"text-muted-foreground text-xs",children:e?"Connected":"Disconnected"})]})}),S.jsx(uu,{className:"w-auto",side:"top",align:"end",children:S.jsx(l3,{status:n})})]})})},pT=()=>{const e=E.useContext(B_);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function c3(){const{theme:e,setTheme:t}=pT(),n=E.useCallback(()=>t("light"),[t]),r=E.useCallback(()=>t("dark"),[t]);return e==="dark"?S.jsx(Ot,{onClick:n,variant:$r,tooltip:"Switch to light theme",size:"icon",side:"bottom",children:S.jsx(BM,{})}):S.jsx(Ot,{onClick:r,variant:$r,tooltip:"Switch to dark theme",size:"icon",side:"bottom",children:S.jsx(nP,{})})}function mT(e){const t=e+"CollectionProvider",[n,r]=dr(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=g=>{const{scope:w,children:x}=g,k=be.useRef(null),C=be.useRef(new Map).current;return S.jsx(i,{scope:w,itemMap:C,collectionRef:k,children:x})};l.displayName=t;const u=e+"CollectionSlot",f=be.forwardRef((g,w)=>{const{scope:x,children:k}=g,C=o(u,x),_=dt(w,C.collectionRef);return S.jsx(ua,{ref:_,children:k})});f.displayName=u;const d=e+"CollectionItemSlot",p="data-radix-collection-item",m=be.forwardRef((g,w)=>{const{scope:x,children:k,...C}=g,_=be.useRef(null),T=dt(w,_),N=o(d,x);return be.useEffect(()=>(N.itemMap.set(_,{ref:_,...C}),()=>void N.itemMap.delete(_))),S.jsx(ua,{[p]:"",ref:T,children:k})});m.displayName=d;function v(g){const w=o(e+"CollectionConsumer",g);return be.useCallback(()=>{const k=w.collectionRef.current;if(!k)return[];const C=Array.from(k.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((N,D)=>C.indexOf(N.ref.current)-C.indexOf(D.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:l,Slot:f,ItemSlot:m},v,r]}var f3=E.createContext(void 0);function pd(e){const t=E.useContext(f3);return e||t||"ltr"}var am="rovingFocusGroup.onEntryFocus",d3={bubbles:!1,cancelable:!0},md="RovingFocusGroup",[Ig,gT,h3]=mT(md),[p3,vT]=dr(md,[h3]),[m3,g3]=p3(md),yT=E.forwardRef((e,t)=>S.jsx(Ig.Provider,{scope:e.__scopeRovingFocusGroup,children:S.jsx(Ig.Slot,{scope:e.__scopeRovingFocusGroup,children:S.jsx(v3,{...e,ref:t})})}));yT.displayName=md;var v3=E.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...m}=e,v=E.useRef(null),g=dt(t,v),w=pd(o),[x=null,k]=_i({prop:l,defaultProp:u,onChange:f}),[C,_]=E.useState(!1),T=un(d),N=gT(n),D=E.useRef(!1),[L,R]=E.useState(0);return E.useEffect(()=>{const U=v.current;if(U)return U.addEventListener(am,T),()=>U.removeEventListener(am,T)},[T]),S.jsx(m3,{scope:n,orientation:r,dir:w,loop:i,currentTabStopId:x,onItemFocus:E.useCallback(U=>k(U),[k]),onItemShiftTab:E.useCallback(()=>_(!0),[]),onFocusableItemAdd:E.useCallback(()=>R(U=>U+1),[]),onFocusableItemRemove:E.useCallback(()=>R(U=>U-1),[]),children:S.jsx(We.div,{tabIndex:C||L===0?-1:0,"data-orientation":r,...m,ref:g,style:{outline:"none",...e.style},onMouseDown:qe(e.onMouseDown,()=>{D.current=!0}),onFocus:qe(e.onFocus,U=>{const P=!D.current;if(U.target===U.currentTarget&&P&&!C){const z=new CustomEvent(am,d3);if(U.currentTarget.dispatchEvent(z),!z.defaultPrevented){const V=N().filter(B=>B.focusable),q=V.find(B=>B.active),I=V.find(B=>B.id===x),Z=[q,I,...V].filter(Boolean).map(B=>B.ref.current);wT(Z,p)}}D.current=!1}),onBlur:qe(e.onBlur,()=>_(!1))})})}),bT="RovingFocusGroupItem",xT=E.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,...l}=e,u=bn(),f=o||u,d=g3(bT,n),p=d.currentTabStopId===f,m=gT(n),{onFocusableItemAdd:v,onFocusableItemRemove:g}=d;return E.useEffect(()=>{if(r)return v(),()=>g()},[r,v,g]),S.jsx(Ig.ItemSlot,{scope:n,id:f,focusable:r,active:i,children:S.jsx(We.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:qe(e.onMouseDown,w=>{r?d.onItemFocus(f):w.preventDefault()}),onFocus:qe(e.onFocus,()=>d.onItemFocus(f)),onKeyDown:qe(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){d.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const x=x3(w,d.orientation,d.dir);if(x!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let C=m().filter(_=>_.focusable).map(_=>_.ref.current);if(x==="last")C.reverse();else if(x==="prev"||x==="next"){x==="prev"&&C.reverse();const _=C.indexOf(w.currentTarget);C=d.loop?w3(C,_+1):C.slice(_+1)}setTimeout(()=>wT(C))}})})})});xT.displayName=bT;var y3={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function b3(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function x3(e,t,n){const r=b3(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return y3[r]}function wT(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function w3(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var S3=yT,E3=xT,fy="Tabs",[_3,mK]=dr(fy,[vT]),ST=vT(),[k3,dy]=_3(fy),ET=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:l="horizontal",dir:u,activationMode:f="automatic",...d}=e,p=pd(u),[m,v]=_i({prop:r,onChange:i,defaultProp:o});return S.jsx(k3,{scope:n,baseId:bn(),value:m,onValueChange:v,orientation:l,dir:p,activationMode:f,children:S.jsx(We.div,{dir:p,"data-orientation":l,...d,ref:t})})});ET.displayName=fy;var _T="TabsList",kT=E.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=dy(_T,n),l=ST(n);return S.jsx(S3,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:S.jsx(We.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});kT.displayName=_T;var CT="TabsTrigger",TT=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,l=dy(CT,n),u=ST(n),f=DT(l.baseId,r),d=NT(l.baseId,r),p=r===l.value;return S.jsx(E3,{asChild:!0,...u,focusable:!i,active:p,children:S.jsx(We.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":d,"data-state":p?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:f,...o,ref:t,onMouseDown:qe(e.onMouseDown,m=>{!i&&m.button===0&&m.ctrlKey===!1?l.onValueChange(r):m.preventDefault()}),onKeyDown:qe(e.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&l.onValueChange(r)}),onFocus:qe(e.onFocus,()=>{const m=l.activationMode!=="manual";!p&&!i&&m&&l.onValueChange(r)})})})});TT.displayName=CT;var AT="TabsContent",RT=E.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...l}=e,u=dy(AT,n),f=DT(u.baseId,r),d=NT(u.baseId,r),p=r===u.value,m=E.useRef(p);return E.useEffect(()=>{const v=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(v)},[]),S.jsx(Kn,{present:i||p,children:({present:v})=>S.jsx(We.div,{"data-state":p?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!v,id:d,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:v&&o})})});RT.displayName=AT;function DT(e,t){return`${e}-trigger-${t}`}function NT(e,t){return`${e}-content-${t}`}var C3=ET,OT=kT,jT=TT,LT=RT;const T3=C3,zT=E.forwardRef(({className:e,...t},n)=>S.jsx(OT,{ref:n,className:Me("bg-muted text-muted-foreground inline-flex h-10 items-center justify-center rounded-md p-1",e),...t}));zT.displayName=OT.displayName;const MT=E.forwardRef(({className:e,...t},n)=>S.jsx(jT,{ref:n,className:Me("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center rounded-sm px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm",e),...t}));MT.displayName=jT.displayName;const Pl=E.forwardRef(({className:e,...t},n)=>S.jsx(LT,{ref:n,className:Me("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...t}));Pl.displayName=LT.displayName;function Mc({value:e,currentTab:t,children:n}){return S.jsx(MT,{value:e,className:Me("cursor-pointer px-2 py-1 transition-all",t===e?"!bg-emerald-400 !text-zinc-50":"hover:bg-background/60"),children:n})}function A3(){const e=Qe.use.currentTab();return S.jsx("div",{className:"flex h-8 self-center",children:S.jsxs(zT,{className:"h-full gap-2",children:[S.jsx(Mc,{value:"documents",currentTab:e,children:"Documents"}),S.jsx(Mc,{value:"knowledge-graph",currentTab:e,children:"Knowledge Graph"}),S.jsx(Mc,{value:"retrieval",currentTab:e,children:"Retrieval"}),S.jsx(Mc,{value:"api",currentTab:e,children:"API"})]})})}function R3(){return S.jsxs("header",{className:"border-border/40 bg-background/95 supports-[backdrop-filter]:bg-background/60 sticky top-0 z-50 flex h-10 w-full border-b px-4 backdrop-blur",children:[S.jsxs("a",{href:"/",className:"mr-6 flex items-center gap-2",children:[S.jsx(oP,{className:"size-4 text-emerald-400","aria-hidden":"true"}),S.jsx("span",{className:"font-bold md:inline-block",children:t1.name})]}),S.jsx("div",{className:"flex h-10 flex-1 justify-center",children:S.jsx(A3,{})}),S.jsxs("nav",{className:"flex items-center",children:[S.jsx(Ot,{variant:"ghost",size:"icon",side:"bottom",tooltip:"Project Repository",children:S.jsx("a",{href:t1.github,target:"_blank",rel:"noopener noreferrer",children:S.jsx(NM,{className:"size-4","aria-hidden":"true"})})}),S.jsx(c3,{})]})]})}var Pc={exports:{}},U1;function D3(){if(U1)return Pc.exports;U1=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(D,L,R){return Function.prototype.apply.call(D,L,R)},n;e&&typeof e.ownKeys=="function"?n=e.ownKeys:Object.getOwnPropertySymbols?n=function(D){return Object.getOwnPropertyNames(D).concat(Object.getOwnPropertySymbols(D))}:n=function(D){return Object.getOwnPropertyNames(D)};function r(N){console&&console.warn&&console.warn(N)}var i=Number.isNaN||function(D){return D!==D};function o(){o.init.call(this)}Pc.exports=o,Pc.exports.once=C,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var l=10;function u(N){if(typeof N!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof N)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(N){if(typeof N!="number"||N<0||i(N))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+N+".");l=N}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(D){if(typeof D!="number"||D<0||i(D))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+D+".");return this._maxListeners=D,this};function f(N){return N._maxListeners===void 0?o.defaultMaxListeners:N._maxListeners}o.prototype.getMaxListeners=function(){return f(this)},o.prototype.emit=function(D){for(var L=[],R=1;R0&&(z=L[0]),z instanceof Error)throw z;var V=new Error("Unhandled error."+(z?" ("+z.message+")":""));throw V.context=z,V}var q=P[D];if(q===void 0)return!1;if(typeof q=="function")t(q,this,L);else for(var I=q.length,Y=w(q,I),R=0;R0&&z.length>U&&!z.warned){z.warned=!0;var V=new Error("Possible EventEmitter memory leak detected. "+z.length+" "+String(D)+" listeners added. Use emitter.setMaxListeners() to increase limit");V.name="MaxListenersExceededWarning",V.emitter=N,V.type=D,V.count=z.length,r(V)}return N}o.prototype.addListener=function(D,L){return d(this,D,L,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(D,L){return d(this,D,L,!0)};function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function m(N,D,L){var R={fired:!1,wrapFn:void 0,target:N,type:D,listener:L},U=p.bind(R);return U.listener=L,R.wrapFn=U,U}o.prototype.once=function(D,L){return u(L),this.on(D,m(this,D,L)),this},o.prototype.prependOnceListener=function(D,L){return u(L),this.prependListener(D,m(this,D,L)),this},o.prototype.removeListener=function(D,L){var R,U,P,z,V;if(u(L),U=this._events,U===void 0)return this;if(R=U[D],R===void 0)return this;if(R===L||R.listener===L)--this._eventsCount===0?this._events=Object.create(null):(delete U[D],U.removeListener&&this.emit("removeListener",D,R.listener||L));else if(typeof R!="function"){for(P=-1,z=R.length-1;z>=0;z--)if(R[z]===L||R[z].listener===L){V=R[z].listener,P=z;break}if(P<0)return this;P===0?R.shift():x(R,P),R.length===1&&(U[D]=R[0]),U.removeListener!==void 0&&this.emit("removeListener",D,V||L)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(D){var L,R,U;if(R=this._events,R===void 0)return this;if(R.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):R[D]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete R[D]),this;if(arguments.length===0){var P=Object.keys(R),z;for(U=0;U=0;U--)this.removeListener(D,L[U]);return this};function v(N,D,L){var R=N._events;if(R===void 0)return[];var U=R[D];return U===void 0?[]:typeof U=="function"?L?[U.listener||U]:[U]:L?k(U):w(U,U.length)}o.prototype.listeners=function(D){return v(this,D,!0)},o.prototype.rawListeners=function(D){return v(this,D,!1)},o.listenerCount=function(N,D){return typeof N.listenerCount=="function"?N.listenerCount(D):g.call(N,D)},o.prototype.listenerCount=g;function g(N){var D=this._events;if(D!==void 0){var L=D[N];if(typeof L=="function")return 1;if(L!==void 0)return L.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function w(N,D){for(var L=new Array(D),R=0;Re++}function Ei(){const e=arguments;let t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done){t=null;continue}break}while(!0);return r}}}function Ss(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class hy extends Error{constructor(t){super(),this.name="GraphError",this.message=t}}class je extends hy{constructor(t){super(t),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,je.prototype.constructor)}}class De extends hy{constructor(t){super(t),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,De.prototype.constructor)}}class Xe extends hy{constructor(t){super(t),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Xe.prototype.constructor)}}function IT(e,t){this.key=e,this.attributes=t,this.clear()}IT.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function GT(e,t){this.key=e,this.attributes=t,this.clear()}GT.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function UT(e,t){this.key=e,this.attributes=t,this.clear()}UT.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Es(e,t,n,r,i){this.key=t,this.attributes=i,this.undirected=e,this.source=n,this.target=r}Es.prototype.attach=function(){let e="out",t="in";this.undirected&&(e=t="undirected");const n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)};Es.prototype.attachMulti=function(){let e="out",t="in";const n=this.source.key,r=this.target.key;this.undirected&&(e=t="undirected");const i=this.source[e],o=i[r];if(typeof o>"u"){i[r]=this,this.undirected&&n===r||(this.target[t][n]=this);return}o.previous=this,this.next=o,i[r]=this,this.target[t][n]=this};Es.prototype.detach=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][t],delete this.target[r][e]};Es.prototype.detachMulti=function(){const e=this.source.key,t=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const BT=0,$T=1,j3=2,HT=3;function Ai(e,t,n,r,i,o,l){let u,f,d,p;if(r=""+r,n===BT){if(u=e._nodes.get(r),!u)throw new De(`Graph.${t}: could not find the "${r}" node in the graph.`);d=i,p=o}else if(n===HT){if(i=""+i,f=e._edges.get(i),!f)throw new De(`Graph.${t}: could not find the "${i}" edge in the graph.`);const m=f.source.key,v=f.target.key;if(r===m)u=f.target;else if(r===v)u=f.source;else throw new De(`Graph.${t}: the "${r}" node is not attached to the "${i}" edge (${m}, ${v}).`);d=o,p=l}else{if(f=e._edges.get(r),!f)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`);n===$T?u=f.source:u=f.target,d=i,p=o}return[u,d,p]}function L3(e,t,n){e.prototype[t]=function(r,i,o){const[l,u]=Ai(this,t,n,r,i,o);return l.attributes[u]}}function z3(e,t,n){e.prototype[t]=function(r,i){const[o]=Ai(this,t,n,r,i);return o.attributes}}function M3(e,t,n){e.prototype[t]=function(r,i,o){const[l,u]=Ai(this,t,n,r,i,o);return l.attributes.hasOwnProperty(u)}}function P3(e,t,n){e.prototype[t]=function(r,i,o,l){const[u,f,d]=Ai(this,t,n,r,i,o,l);return u.attributes[f]=d,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:f}),this}}function F3(e,t,n){e.prototype[t]=function(r,i,o,l){const[u,f,d]=Ai(this,t,n,r,i,o,l);if(typeof d!="function")throw new je(`Graph.${t}: updater should be a function.`);const p=u.attributes,m=d(p[f]);return p[f]=m,this.emit("nodeAttributesUpdated",{key:u.key,type:"set",attributes:u.attributes,name:f}),this}}function I3(e,t,n){e.prototype[t]=function(r,i,o){const[l,u]=Ai(this,t,n,r,i,o);return delete l.attributes[u],this.emit("nodeAttributesUpdated",{key:l.key,type:"remove",attributes:l.attributes,name:u}),this}}function G3(e,t,n){e.prototype[t]=function(r,i,o){const[l,u]=Ai(this,t,n,r,i,o);if(!cn(u))throw new je(`Graph.${t}: provided attributes are not a plain object.`);return l.attributes=u,this.emit("nodeAttributesUpdated",{key:l.key,type:"replace",attributes:l.attributes}),this}}function U3(e,t,n){e.prototype[t]=function(r,i,o){const[l,u]=Ai(this,t,n,r,i,o);if(!cn(u))throw new je(`Graph.${t}: provided attributes are not a plain object.`);return Xt(l.attributes,u),this.emit("nodeAttributesUpdated",{key:l.key,type:"merge",attributes:l.attributes,data:u}),this}}function B3(e,t,n){e.prototype[t]=function(r,i,o){const[l,u]=Ai(this,t,n,r,i,o);if(typeof u!="function")throw new je(`Graph.${t}: provided updater is not a function.`);return l.attributes=u(l.attributes),this.emit("nodeAttributesUpdated",{key:l.key,type:"update",attributes:l.attributes}),this}}const $3=[{name:e=>`get${e}Attribute`,attacher:L3},{name:e=>`get${e}Attributes`,attacher:z3},{name:e=>`has${e}Attribute`,attacher:M3},{name:e=>`set${e}Attribute`,attacher:P3},{name:e=>`update${e}Attribute`,attacher:F3},{name:e=>`remove${e}Attribute`,attacher:I3},{name:e=>`replace${e}Attributes`,attacher:G3},{name:e=>`merge${e}Attributes`,attacher:U3},{name:e=>`update${e}Attributes`,attacher:B3}];function H3(e){$3.forEach(function({name:t,attacher:n}){n(e,t("Node"),BT),n(e,t("Source"),$T),n(e,t("Target"),j3),n(e,t("Opposite"),HT)})}function V3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+i;if(i=arguments[2],o=fr(this,l,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return o.attributes[i]}}function q3(e,t,n){e.prototype[t]=function(r){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new Xe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+r,l=""+arguments[1];if(i=fr(this,o,l,n),!i)throw new De(`Graph.${t}: could not find an edge for the given path ("${o}" - "${l}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return i.attributes}}function Y3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+i;if(i=arguments[2],o=fr(this,l,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return o.attributes.hasOwnProperty(i)}}function W3(e,t,n){e.prototype[t]=function(r,i,o){let l;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Xe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const u=""+r,f=""+i;if(i=arguments[2],o=arguments[3],l=fr(this,u,f,n),!l)throw new De(`Graph.${t}: could not find an edge for the given path ("${u}" - "${f}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,l=this._edges.get(r),!l)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return l.attributes[i]=o,this.emit("edgeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:i}),this}}function X3(e,t,n){e.prototype[t]=function(r,i,o){let l;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Xe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const u=""+r,f=""+i;if(i=arguments[2],o=arguments[3],l=fr(this,u,f,n),!l)throw new De(`Graph.${t}: could not find an edge for the given path ("${u}" - "${f}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,l=this._edges.get(r),!l)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof o!="function")throw new je(`Graph.${t}: updater should be a function.`);return l.attributes[i]=o(l.attributes[i]),this.emit("edgeAttributesUpdated",{key:l.key,type:"set",attributes:l.attributes,name:i}),this}}function K3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+i;if(i=arguments[2],o=fr(this,l,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}return delete o.attributes[i],this.emit("edgeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:i}),this}}function Z3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+i;if(i=arguments[2],o=fr(this,l,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!cn(i))throw new je(`Graph.${t}: provided attributes are not a plain object.`);return o.attributes=i,this.emit("edgeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}function Q3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+i;if(i=arguments[2],o=fr(this,l,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(!cn(i))throw new je(`Graph.${t}: provided attributes are not a plain object.`);return Xt(o.attributes,i),this.emit("edgeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:i}),this}}function J3(e,t,n){e.prototype[t]=function(r,i){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Xe(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Xe(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const l=""+r,u=""+i;if(i=arguments[2],o=fr(this,l,u,n),!o)throw new De(`Graph.${t}: could not find an edge for the given path ("${l}" - "${u}").`)}else{if(n!=="mixed")throw new Xe(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new De(`Graph.${t}: could not find the "${r}" edge in the graph.`)}if(typeof i!="function")throw new je(`Graph.${t}: provided updater is not a function.`);return o.attributes=i(o.attributes),this.emit("edgeAttributesUpdated",{key:o.key,type:"update",attributes:o.attributes}),this}}const e5=[{name:e=>`get${e}Attribute`,attacher:V3},{name:e=>`get${e}Attributes`,attacher:q3},{name:e=>`has${e}Attribute`,attacher:Y3},{name:e=>`set${e}Attribute`,attacher:W3},{name:e=>`update${e}Attribute`,attacher:X3},{name:e=>`remove${e}Attribute`,attacher:K3},{name:e=>`replace${e}Attributes`,attacher:Z3},{name:e=>`merge${e}Attributes`,attacher:Q3},{name:e=>`update${e}Attributes`,attacher:J3}];function t5(e){e5.forEach(function({name:t,attacher:n}){n(e,t("Edge"),"mixed"),n(e,t("DirectedEdge"),"directed"),n(e,t("UndirectedEdge"),"undirected")})}const n5=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function r5(e,t,n,r){let i=!1;for(const o in t){if(o===r)continue;const l=t[o];if(i=n(l.key,l.attributes,l.source.key,l.target.key,l.source.attributes,l.target.attributes,l.undirected),e&&i)return l.key}}function i5(e,t,n,r){let i,o,l,u=!1;for(const f in t)if(f!==r){i=t[f];do{if(o=i.source,l=i.target,u=n(i.key,i.attributes,o.key,l.key,o.attributes,l.attributes,i.undirected),e&&u)return i.key;i=i.next}while(i!==void 0)}}function om(e,t){const n=Object.keys(e),r=n.length;let i,o=0;return{[Symbol.iterator](){return this},next(){do if(i)i=i.next;else{if(o>=r)return{done:!0};const l=n[o++];if(l===t){i=void 0;continue}i=e[l]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}}}}function a5(e,t,n,r){const i=t[n];if(!i)return;const o=i.source,l=i.target;if(r(i.key,i.attributes,o.key,l.key,o.attributes,l.attributes,i.undirected)&&e)return i.key}function o5(e,t,n,r){let i=t[n];if(!i)return;let o=!1;do{if(o=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),e&&o)return i.key;i=i.next}while(i!==void 0)}function sm(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};const i={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:i}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function s5(e,t){if(e.size===0)return[];if(t==="mixed"||t===e.type)return Array.from(e._edges.keys());const n=t==="undirected"?e.undirectedSize:e.directedSize,r=new Array(n),i=t==="undirected",o=e._edges.values();let l=0,u,f;for(;u=o.next(),u.done!==!0;)f=u.value,f.undirected===i&&(r[l++]=f.key);return r}function VT(e,t,n,r){if(t.size===0)return;const i=n!=="mixed"&&n!==t.type,o=n==="undirected";let l,u,f=!1;const d=t._edges.values();for(;l=d.next(),l.done!==!0;){if(u=l.value,i&&u.undirected!==o)continue;const{key:p,attributes:m,source:v,target:g}=u;if(f=r(p,m,v.key,g.key,v.attributes,g.attributes,u.undirected),e&&f)return p}}function l5(e,t){if(e.size===0)return Ss();const n=t!=="mixed"&&t!==e.type,r=t==="undirected",i=e._edges.values();return{[Symbol.iterator](){return this},next(){let o,l;for(;;){if(o=i.next(),o.done)return o;if(l=o.value,!(n&&l.undirected!==r))break}return{value:{edge:l.key,attributes:l.attributes,source:l.source.key,target:l.target.key,sourceAttributes:l.source.attributes,targetAttributes:l.target.attributes,undirected:l.undirected},done:!1}}}}function py(e,t,n,r,i,o){const l=t?i5:r5;let u;if(n!=="undirected"&&(r!=="out"&&(u=l(e,i.in,o),e&&u)||r!=="in"&&(u=l(e,i.out,o,r?void 0:i.key),e&&u))||n!=="directed"&&(u=l(e,i.undirected,o),e&&u))return u}function u5(e,t,n,r){const i=[];return py(!1,e,t,n,r,function(o){i.push(o)}),i}function c5(e,t,n){let r=Ss();return e!=="undirected"&&(t!=="out"&&typeof n.in<"u"&&(r=Ei(r,om(n.in))),t!=="in"&&typeof n.out<"u"&&(r=Ei(r,om(n.out,t?void 0:n.key)))),e!=="directed"&&typeof n.undirected<"u"&&(r=Ei(r,om(n.undirected))),r}function my(e,t,n,r,i,o,l){const u=n?o5:a5;let f;if(t!=="undirected"&&(typeof i.in<"u"&&r!=="out"&&(f=u(e,i.in,o,l),e&&f)||typeof i.out<"u"&&r!=="in"&&(r||i.key!==o)&&(f=u(e,i.out,o,l),e&&f))||t!=="directed"&&typeof i.undirected<"u"&&(f=u(e,i.undirected,o,l),e&&f))return f}function f5(e,t,n,r,i){const o=[];return my(!1,e,t,n,r,i,function(l){o.push(l)}),o}function d5(e,t,n,r){let i=Ss();return e!=="undirected"&&(typeof n.in<"u"&&t!=="out"&&r in n.in&&(i=Ei(i,sm(n.in,r))),typeof n.out<"u"&&t!=="in"&&r in n.out&&(t||n.key!==r)&&(i=Ei(i,sm(n.out,r)))),e!=="directed"&&typeof n.undirected<"u"&&r in n.undirected&&(i=Ei(i,sm(n.undirected,r))),i}function h5(e,t){const{name:n,type:r,direction:i}=t;e.prototype[n]=function(o,l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return s5(this,r);if(arguments.length===1){o=""+o;const u=this._nodes.get(o);if(typeof u>"u")throw new De(`Graph.${n}: could not find the "${o}" node in the graph.`);return u5(this.multi,r==="mixed"?this.type:r,i,u)}if(arguments.length===2){o=""+o,l=""+l;const u=this._nodes.get(o);if(!u)throw new De(`Graph.${n}: could not find the "${o}" source node in the graph.`);if(!this._nodes.has(l))throw new De(`Graph.${n}: could not find the "${l}" target node in the graph.`);return f5(r,this.multi,i,u,l)}throw new je(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function p5(e,t){const{name:n,type:r,direction:i}=t,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(d,p,m){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return m=d,VT(!1,this,r,m);if(arguments.length===2){d=""+d,m=p;const v=this._nodes.get(d);if(typeof v>"u")throw new De(`Graph.${o}: could not find the "${d}" node in the graph.`);return py(!1,this.multi,r==="mixed"?this.type:r,i,v,m)}if(arguments.length===3){d=""+d,p=""+p;const v=this._nodes.get(d);if(!v)throw new De(`Graph.${o}: could not find the "${d}" source node in the graph.`);if(!this._nodes.has(p))throw new De(`Graph.${o}: could not find the "${p}" target node in the graph.`);return my(!1,r,this.multi,i,v,p,m)}throw new je(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const l="map"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(){const d=Array.prototype.slice.call(arguments),p=d.pop();let m;if(d.length===0){let v=0;r!=="directed"&&(v+=this.undirectedSize),r!=="undirected"&&(v+=this.directedSize),m=new Array(v);let g=0;d.push((w,x,k,C,_,T,N)=>{m[g++]=p(w,x,k,C,_,T,N)})}else m=[],d.push((v,g,w,x,k,C,_)=>{m.push(p(v,g,w,x,k,C,_))});return this[o].apply(this,d),m};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(){const d=Array.prototype.slice.call(arguments),p=d.pop(),m=[];return d.push((v,g,w,x,k,C,_)=>{p(v,g,w,x,k,C,_)&&m.push(v)}),this[o].apply(this,d),m};const f="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[f]=function(){let d=Array.prototype.slice.call(arguments);if(d.length<2||d.length>4)throw new je(`Graph.${f}: invalid number of arguments (expecting 2, 3 or 4 and got ${d.length}).`);if(typeof d[d.length-1]=="function"&&typeof d[d.length-2]!="function")throw new je(`Graph.${f}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let p,m;d.length===2?(p=d[0],m=d[1],d=[]):d.length===3?(p=d[1],m=d[2],d=[d[0]]):d.length===4&&(p=d[2],m=d[3],d=[d[0],d[1]]);let v=m;return d.push((g,w,x,k,C,_,T)=>{v=p(v,g,w,x,k,C,_,T)}),this[o].apply(this,d),v}}function m5(e,t){const{name:n,type:r,direction:i}=t,o="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(f,d,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return p=f,VT(!0,this,r,p);if(arguments.length===2){f=""+f,p=d;const m=this._nodes.get(f);if(typeof m>"u")throw new De(`Graph.${o}: could not find the "${f}" node in the graph.`);return py(!0,this.multi,r==="mixed"?this.type:r,i,m,p)}if(arguments.length===3){f=""+f,d=""+d;const m=this._nodes.get(f);if(!m)throw new De(`Graph.${o}: could not find the "${f}" source node in the graph.`);if(!this._nodes.has(d))throw new De(`Graph.${o}: could not find the "${d}" target node in the graph.`);return my(!0,r,this.multi,i,m,d,p)}throw new je(`Graph.${o}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const l="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[l]=function(){const f=Array.prototype.slice.call(arguments),d=f.pop();return f.push((m,v,g,w,x,k,C)=>d(m,v,g,w,x,k,C)),!!this[o].apply(this,f)};const u="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[u]=function(){const f=Array.prototype.slice.call(arguments),d=f.pop();return f.push((m,v,g,w,x,k,C)=>!d(m,v,g,w,x,k,C)),!this[o].apply(this,f)}}function g5(e,t){const{name:n,type:r,direction:i}=t,o=n.slice(0,-1)+"Entries";e.prototype[o]=function(l,u){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Ss();if(!arguments.length)return l5(this,r);if(arguments.length===1){l=""+l;const f=this._nodes.get(l);if(!f)throw new De(`Graph.${o}: could not find the "${l}" node in the graph.`);return c5(r,i,f)}if(arguments.length===2){l=""+l,u=""+u;const f=this._nodes.get(l);if(!f)throw new De(`Graph.${o}: could not find the "${l}" source node in the graph.`);if(!this._nodes.has(u))throw new De(`Graph.${o}: could not find the "${u}" target node in the graph.`);return d5(r,i,f,u)}throw new je(`Graph.${o}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function v5(e){n5.forEach(t=>{h5(e,t),p5(e,t),m5(e,t),g5(e,t)})}const y5=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function gd(){this.A=null,this.B=null}gd.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)};gd.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function Tl(e,t,n,r,i){for(const o in r){const l=r[o],u=l.source,f=l.target,d=u===n?f:u;if(t&&t.has(d.key))continue;const p=i(d.key,d.attributes);if(e&&p)return d.key}}function gy(e,t,n,r,i){if(t!=="mixed"){if(t==="undirected")return Tl(e,null,r,r.undirected,i);if(typeof n=="string")return Tl(e,null,r,r[n],i)}const o=new gd;let l;if(t!=="undirected"){if(n!=="out"){if(l=Tl(e,null,r,r.in,i),e&&l)return l;o.wrap(r.in)}if(n!=="in"){if(l=Tl(e,o,r,r.out,i),e&&l)return l;o.wrap(r.out)}}if(t!=="directed"&&(l=Tl(e,o,r,r.undirected,i),e&&l))return l}function b5(e,t,n){if(e!=="mixed"){if(e==="undirected")return Object.keys(n.undirected);if(typeof t=="string")return Object.keys(n[t])}const r=[];return gy(!1,e,t,n,function(i){r.push(i)}),r}function Al(e,t,n){const r=Object.keys(n),i=r.length;let o=0;return{[Symbol.iterator](){return this},next(){let l=null;do{if(o>=i)return e&&e.wrap(n),{done:!0};const u=n[r[o++]],f=u.source,d=u.target;if(l=f===t?d:f,e&&e.has(l.key)){l=null;continue}}while(l===null);return{done:!1,value:{neighbor:l.key,attributes:l.attributes}}}}}function x5(e,t,n){if(e!=="mixed"){if(e==="undirected")return Al(null,n,n.undirected);if(typeof t=="string")return Al(null,n,n[t])}let r=Ss();const i=new gd;return e!=="undirected"&&(t!=="out"&&(r=Ei(r,Al(i,n,n.in))),t!=="in"&&(r=Ei(r,Al(i,n,n.out)))),e!=="directed"&&(r=Ei(r,Al(i,n,n.undirected))),r}function w5(e,t){const{name:n,type:r,direction:i}=t;e.prototype[n]=function(o){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];o=""+o;const l=this._nodes.get(o);if(typeof l>"u")throw new De(`Graph.${n}: could not find the "${o}" node in the graph.`);return b5(r==="mixed"?this.type:r,i,l)}}function S5(e,t){const{name:n,type:r,direction:i}=t,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(d,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;d=""+d;const m=this._nodes.get(d);if(typeof m>"u")throw new De(`Graph.${o}: could not find the "${d}" node in the graph.`);gy(!1,r==="mixed"?this.type:r,i,m,p)};const l="map"+n[0].toUpperCase()+n.slice(1);e.prototype[l]=function(d,p){const m=[];return this[o](d,(v,g)=>{m.push(p(v,g))}),m};const u="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[u]=function(d,p){const m=[];return this[o](d,(v,g)=>{p(v,g)&&m.push(v)}),m};const f="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[f]=function(d,p,m){if(arguments.length<3)throw new je(`Graph.${f}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let v=m;return this[o](d,(g,w)=>{v=p(v,g,w)}),v}}function E5(e,t){const{name:n,type:r,direction:i}=t,o=n[0].toUpperCase()+n.slice(1,-1),l="find"+o;e.prototype[l]=function(d,p){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;d=""+d;const m=this._nodes.get(d);if(typeof m>"u")throw new De(`Graph.${l}: could not find the "${d}" node in the graph.`);return gy(!0,r==="mixed"?this.type:r,i,m,p)};const u="some"+o;e.prototype[u]=function(d,p){return!!this[l](d,p)};const f="every"+o;e.prototype[f]=function(d,p){return!this[l](d,(v,g)=>!p(v,g))}}function _5(e,t){const{name:n,type:r,direction:i}=t,o=n.slice(0,-1)+"Entries";e.prototype[o]=function(l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return Ss();l=""+l;const u=this._nodes.get(l);if(typeof u>"u")throw new De(`Graph.${o}: could not find the "${l}" node in the graph.`);return x5(r==="mixed"?this.type:r,i,u)}}function k5(e){y5.forEach(t=>{w5(e,t),S5(e,t),E5(e,t),_5(e,t)})}function Fc(e,t,n,r,i){const o=r._nodes.values(),l=r.type;let u,f,d,p,m,v;for(;u=o.next(),u.done!==!0;){let g=!1;if(f=u.value,l!=="undirected"){p=f.out;for(d in p){m=p[d];do v=m.target,g=!0,i(f.key,v.key,f.attributes,v.attributes,m.key,m.attributes,m.undirected),m=m.next;while(m)}}if(l!=="directed"){p=f.undirected;for(d in p)if(!(t&&f.key>d)){m=p[d];do v=m.target,v.key!==d&&(v=m.source),g=!0,i(f.key,v.key,f.attributes,v.attributes,m.key,m.attributes,m.undirected),m=m.next;while(m)}}n&&!g&&i(f.key,null,f.attributes,null,null,null,null)}}function C5(e,t){const n={key:e};return FT(t.attributes)||(n.attributes=Xt({},t.attributes)),n}function T5(e,t,n){const r={key:t,source:n.source.key,target:n.target.key};return FT(n.attributes)||(r.attributes=Xt({},n.attributes)),e==="mixed"&&n.undirected&&(r.undirected=!0),r}function A5(e){if(!cn(e))throw new je('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in e))throw new je("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!cn(e.attributes)||e.attributes===null))throw new je("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function R5(e){if(!cn(e))throw new je('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in e))throw new je("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new je("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!cn(e.attributes)||e.attributes===null))throw new je("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&typeof e.undirected!="boolean")throw new je("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const D5=O3(),N5=new Set(["directed","undirected","mixed"]),$1=new Set(["domain","_events","_eventsCount","_maxListeners"]),O5=[{name:e=>`${e}Edge`,generateKey:!0},{name:e=>`${e}DirectedEdge`,generateKey:!0,type:"directed"},{name:e=>`${e}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:e=>`${e}EdgeWithKey`},{name:e=>`${e}DirectedEdgeWithKey`,type:"directed"},{name:e=>`${e}UndirectedEdgeWithKey`,type:"undirected"}],j5={allowSelfLoops:!0,multi:!1,type:"mixed"};function L5(e,t,n){if(n&&!cn(n))throw new je(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=""+t,n=n||{},e._nodes.has(t))throw new Xe(`Graph.addNode: the "${t}" node already exist in the graph.`);const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function H1(e,t,n){const r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function qT(e,t,n,r,i,o,l,u){if(!r&&e.type==="undirected")throw new Xe(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Xe(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(u&&!cn(u))throw new je(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`);if(o=""+o,l=""+l,u=u||{},!e.allowSelfLoops&&o===l)throw new Xe(`Graph.${t}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const f=e._nodes.get(o),d=e._nodes.get(l);if(!f)throw new De(`Graph.${t}: source node "${o}" not found.`);if(!d)throw new De(`Graph.${t}: target node "${l}" not found.`);const p={key:null,undirected:r,source:o,target:l,attributes:u};if(n)i=e._edgeKeyGenerator();else if(i=""+i,e._edges.has(i))throw new Xe(`Graph.${t}: the "${i}" edge already exists in the graph.`);if(!e.multi&&(r?typeof f.undirected[l]<"u":typeof f.out[l]<"u"))throw new Xe(`Graph.${t}: an edge linking "${o}" to "${l}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const m=new Es(r,i,f,d,u);e._edges.set(i,m);const v=o===l;return r?(f.undirectedDegree++,d.undirectedDegree++,v&&(f.undirectedLoops++,e._undirectedSelfLoopCount++)):(f.outDegree++,d.inDegree++,v&&(f.directedLoops++,e._directedSelfLoopCount++)),e.multi?m.attachMulti():m.attach(),r?e._undirectedSize++:e._directedSize++,p.key=i,e.emit("edgeAdded",p),i}function z5(e,t,n,r,i,o,l,u,f){if(!r&&e.type==="undirected")throw new Xe(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type==="directed")throw new Xe(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(u){if(f){if(typeof u!="function")throw new je(`Graph.${t}: invalid updater function. Expecting a function but got "${u}"`)}else if(!cn(u))throw new je(`Graph.${t}: invalid attributes. Expecting an object but got "${u}"`)}o=""+o,l=""+l;let d;if(f&&(d=u,u=void 0),!e.allowSelfLoops&&o===l)throw new Xe(`Graph.${t}: source & target are the same ("${o}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let p=e._nodes.get(o),m=e._nodes.get(l),v,g;if(!n&&(v=e._edges.get(i),v)){if((v.source.key!==o||v.target.key!==l)&&(!r||v.source.key!==l||v.target.key!==o))throw new Xe(`Graph.${t}: inconsistency detected when attempting to merge the "${i}" edge with "${o}" source & "${l}" target vs. ("${v.source.key}", "${v.target.key}").`);g=v}if(!g&&!e.multi&&p&&(g=r?p.undirected[l]:p.out[l]),g){const _=[g.key,!1,!1,!1];if(f?!d:!u)return _;if(f){const T=g.attributes;g.attributes=d(T),e.emit("edgeAttributesUpdated",{type:"replace",key:g.key,attributes:g.attributes})}else Xt(g.attributes,u),e.emit("edgeAttributesUpdated",{type:"merge",key:g.key,attributes:g.attributes,data:u});return _}u=u||{},f&&d&&(u=d(u));const w={key:null,undirected:r,source:o,target:l,attributes:u};if(n)i=e._edgeKeyGenerator();else if(i=""+i,e._edges.has(i))throw new Xe(`Graph.${t}: the "${i}" edge already exists in the graph.`);let x=!1,k=!1;p||(p=H1(e,o,{}),x=!0,o===l&&(m=p,k=!0)),m||(m=H1(e,l,{}),k=!0),v=new Es(r,i,p,m,u),e._edges.set(i,v);const C=o===l;return r?(p.undirectedDegree++,m.undirectedDegree++,C&&(p.undirectedLoops++,e._undirectedSelfLoopCount++)):(p.outDegree++,m.inDegree++,C&&(p.directedLoops++,e._directedSelfLoopCount++)),e.multi?v.attachMulti():v.attach(),r?e._undirectedSize++:e._directedSize++,w.key=i,e.emit("edgeAdded",w),[i,!0,x,k]}function Yo(e,t){e._edges.delete(t.key);const{source:n,target:r,attributes:i}=t,o=t.undirected,l=n===r;o?(n.undirectedDegree--,r.undirectedDegree--,l&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,l&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),o?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:i,source:n.key,target:r.key,undirected:o})}class St extends PT.EventEmitter{constructor(t){if(super(),t=Xt({},j5,t),typeof t.multi!="boolean")throw new je(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${t.multi}".`);if(!N5.has(t.type))throw new je(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${t.type}".`);if(typeof t.allowSelfLoops!="boolean")throw new je(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${t.allowSelfLoops}".`);const n=t.type==="mixed"?IT:t.type==="directed"?GT:UT;ur(this,"NodeDataClass",n);const r="geid_"+D5()+"_";let i=0;const o=()=>{let l;do l=r+i++;while(this._edges.has(l));return l};ur(this,"_attributes",{}),ur(this,"_nodes",new Map),ur(this,"_edges",new Map),ur(this,"_directedSize",0),ur(this,"_undirectedSize",0),ur(this,"_directedSelfLoopCount",0),ur(this,"_undirectedSelfLoopCount",0),ur(this,"_edgeKeyGenerator",o),ur(this,"_options",t),$1.forEach(l=>ur(this,l,this[l])),Sr(this,"order",()=>this._nodes.size),Sr(this,"size",()=>this._edges.size),Sr(this,"directedSize",()=>this._directedSize),Sr(this,"undirectedSize",()=>this._undirectedSize),Sr(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Sr(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Sr(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Sr(this,"multi",this._options.multi),Sr(this,"type",this._options.type),Sr(this,"allowSelfLoops",this._options.allowSelfLoops),Sr(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(t){return this._nodes.has(""+t)}hasDirectedEdge(t,n){if(this.type==="undirected")return!1;if(arguments.length===1){const r=""+t,i=this._edges.get(r);return!!i&&!i.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.out.hasOwnProperty(n):!1}throw new je(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(t,n){if(this.type==="directed")return!1;if(arguments.length===1){const r=""+t,i=this._edges.get(r);return!!i&&i.undirected}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?r.undirected.hasOwnProperty(n):!1}throw new je(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(t,n){if(arguments.length===1){const r=""+t;return this._edges.has(r)}else if(arguments.length===2){t=""+t,n=""+n;const r=this._nodes.get(t);return r?typeof r.out<"u"&&r.out.hasOwnProperty(n)||typeof r.undirected<"u"&&r.undirected.hasOwnProperty(n):!1}throw new je(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(t,n){if(this.type==="undirected")return;if(t=""+t,n=""+n,this.multi)throw new Xe("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const r=this._nodes.get(t);if(!r)throw new De(`Graph.directedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);const i=r.out&&r.out[n]||void 0;if(i)return i.key}undirectedEdge(t,n){if(this.type==="directed")return;if(t=""+t,n=""+n,this.multi)throw new Xe("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const r=this._nodes.get(t);if(!r)throw new De(`Graph.undirectedEdge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);const i=r.undirected&&r.undirected[n]||void 0;if(i)return i.key}edge(t,n){if(this.multi)throw new Xe("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.edge: could not find the "${t}" source node in the graph.`);if(!this._nodes.has(n))throw new De(`Graph.edge: could not find the "${n}" target node in the graph.`);const i=r.out&&r.out[n]||r.undirected&&r.undirected[n]||void 0;if(i)return i.key}areDirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areDirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in||n in r.out}areOutNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areOutNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.out}areInNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areInNeighbors: could not find the "${t}" node in the graph.`);return this.type==="undirected"?!1:n in r.in}areUndirectedNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areUndirectedNeighbors: could not find the "${t}" node in the graph.`);return this.type==="directed"?!1:n in r.undirected}areNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&(n in r.in||n in r.out)||this.type!=="directed"&&n in r.undirected}areInboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areInboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.in||this.type!=="directed"&&n in r.undirected}areOutboundNeighbors(t,n){t=""+t,n=""+n;const r=this._nodes.get(t);if(!r)throw new De(`Graph.areOutboundNeighbors: could not find the "${t}" node in the graph.`);return this.type!=="undirected"&&n in r.out||this.type!=="directed"&&n in r.undirected}inDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree}outDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree}directedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.directedDegree: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree}undirectedDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.undirectedDegree: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree}inboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree),r}outboundDegree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outboundDegree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.outDegree),r}degree(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.degree: could not find the "${t}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree),r}inDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree-n.directedLoops}outDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.outDegree-n.directedLoops}directedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.directedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree-n.directedLoops*2}undirectedDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree-n.undirectedLoops*2}inboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree,i+=n.directedLoops),r-i}outboundDegreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.outDegree,i+=n.directedLoops),r-i}degreeWithoutSelfLoops(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.degreeWithoutSelfLoops: could not find the "${t}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree,i+=n.directedLoops*2),r-i}source(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.source: could not find the "${t}" edge in the graph.`);return n.source.key}target(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.target: could not find the "${t}" edge in the graph.`);return n.target.key}extremities(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.extremities: could not find the "${t}" edge in the graph.`);return[n.source.key,n.target.key]}opposite(t,n){t=""+t,n=""+n;const r=this._edges.get(n);if(!r)throw new De(`Graph.opposite: could not find the "${n}" edge in the graph.`);const i=r.source.key,o=r.target.key;if(t===i)return o;if(t===o)return i;throw new De(`Graph.opposite: the "${t}" node is not attached to the "${n}" edge (${i}, ${o}).`)}hasExtremity(t,n){t=""+t,n=""+n;const r=this._edges.get(t);if(!r)throw new De(`Graph.hasExtremity: could not find the "${t}" edge in the graph.`);return r.source.key===n||r.target.key===n}isUndirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isUndirected: could not find the "${t}" edge in the graph.`);return n.undirected}isDirected(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isDirected: could not find the "${t}" edge in the graph.`);return!n.undirected}isSelfLoop(t){t=""+t;const n=this._edges.get(t);if(!n)throw new De(`Graph.isSelfLoop: could not find the "${t}" edge in the graph.`);return n.source===n.target}addNode(t,n){return L5(this,t,n).key}mergeNode(t,n){if(n&&!cn(n))throw new je(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);t=""+t,n=n||{};let r=this._nodes.get(t);return r?(n&&(Xt(r.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:t,attributes:r.attributes,data:n})),[t,!1]):(r=new this.NodeDataClass(t,n),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:n}),[t,!0])}updateNode(t,n){if(n&&typeof n!="function")throw new je(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);t=""+t;let r=this._nodes.get(t);if(r){if(n){const o=r.attributes;r.attributes=n(o),this.emit("nodeAttributesUpdated",{type:"replace",key:t,attributes:r.attributes})}return[t,!1]}const i=n?n({}):{};return r=new this.NodeDataClass(t,i),this._nodes.set(t,r),this.emit("nodeAdded",{key:t,attributes:i}),[t,!0]}dropNode(t){t=""+t;const n=this._nodes.get(t);if(!n)throw new De(`Graph.dropNode: could not find the "${t}" node in the graph.`);let r;if(this.type!=="undirected"){for(const i in n.out){r=n.out[i];do Yo(this,r),r=r.next;while(r)}for(const i in n.in){r=n.in[i];do Yo(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(const i in n.undirected){r=n.undirected[i];do Yo(this,r),r=r.next;while(r)}this._nodes.delete(t),this.emit("nodeDropped",{key:t,attributes:n.attributes})}dropEdge(t){let n;if(arguments.length>1){const r=""+arguments[0],i=""+arguments[1];if(n=fr(this,r,i,this.type),!n)throw new De(`Graph.dropEdge: could not find the "${r}" -> "${i}" edge in the graph.`)}else if(t=""+t,n=this._edges.get(t),!n)throw new De(`Graph.dropEdge: could not find the "${t}" edge in the graph.`);return Yo(this,n),this}dropDirectedEdge(t,n){if(arguments.length<2)throw new Xe("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Xe("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");t=""+t,n=""+n;const r=fr(this,t,n,"directed");if(!r)throw new De(`Graph.dropDirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Yo(this,r),this}dropUndirectedEdge(t,n){if(arguments.length<2)throw new Xe("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Xe("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const r=fr(this,t,n,"undirected");if(!r)throw new De(`Graph.dropUndirectedEdge: could not find a "${t}" -> "${n}" edge in the graph.`);return Yo(this,r),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const t=this._nodes.values();let n;for(;n=t.next(),n.done!==!0;)n.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(t){return this._attributes[t]}getAttributes(){return this._attributes}hasAttribute(t){return this._attributes.hasOwnProperty(t)}setAttribute(t,n){return this._attributes[t]=n,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}updateAttribute(t,n){if(typeof n!="function")throw new je("Graph.updateAttribute: updater should be a function.");const r=this._attributes[t];return this._attributes[t]=n(r),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:t}),this}removeAttribute(t){return delete this._attributes[t],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:t}),this}replaceAttributes(t){if(!cn(t))throw new je("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=t,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(t){if(!cn(t))throw new je("Graph.mergeAttributes: provided attributes are not a plain object.");return Xt(this._attributes,t),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:t}),this}updateAttributes(t){if(typeof t!="function")throw new je("Graph.updateAttributes: provided updater is not a function.");return this._attributes=t(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(t,n){if(typeof t!="function")throw new je("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!B1(n))throw new je("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._nodes.values();let i,o;for(;i=r.next(),i.done!==!0;)o=i.value,o.attributes=t(o.key,o.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(t,n){if(typeof t!="function")throw new je("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!B1(n))throw new je("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._edges.values();let i,o,l,u;for(;i=r.next(),i.done!==!0;)o=i.value,l=o.source,u=o.target,o.attributes=t(o.key,o.attributes,l.key,u.key,l.attributes,u.attributes,o.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(t){if(typeof t!="function")throw new je("Graph.forEachAdjacencyEntry: expecting a callback.");Fc(!1,!1,!1,this,t)}forEachAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new je("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Fc(!1,!1,!0,this,t)}forEachAssymetricAdjacencyEntry(t){if(typeof t!="function")throw new je("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Fc(!1,!0,!1,this,t)}forEachAssymetricAdjacencyEntryWithOrphans(t){if(typeof t!="function")throw new je("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Fc(!1,!0,!0,this,t)}nodes(){return Array.from(this._nodes.keys())}forEachNode(t){if(typeof t!="function")throw new je("Graph.forEachNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)i=r.value,t(i.key,i.attributes)}findNode(t){if(typeof t!="function")throw new je("Graph.findNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,t(i.key,i.attributes))return i.key}mapNodes(t){if(typeof t!="function")throw new je("Graph.mapNode: expecting a callback.");const n=this._nodes.values();let r,i;const o=new Array(this.order);let l=0;for(;r=n.next(),r.done!==!0;)i=r.value,o[l++]=t(i.key,i.attributes);return o}someNode(t){if(typeof t!="function")throw new je("Graph.someNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,t(i.key,i.attributes))return!0;return!1}everyNode(t){if(typeof t!="function")throw new je("Graph.everyNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,!t(i.key,i.attributes))return!1;return!0}filterNodes(t){if(typeof t!="function")throw new je("Graph.filterNodes: expecting a callback.");const n=this._nodes.values();let r,i;const o=[];for(;r=n.next(),r.done!==!0;)i=r.value,t(i.key,i.attributes)&&o.push(i.key);return o}reduceNodes(t,n){if(typeof t!="function")throw new je("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new je("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let r=n;const i=this._nodes.values();let o,l;for(;o=i.next(),o.done!==!0;)l=o.value,r=t(r,l.key,l.attributes);return r}nodeEntries(){const t=this._nodes.values();return{[Symbol.iterator](){return this},next(){const n=t.next();if(n.done)return n;const r=n.value;return{value:{node:r.key,attributes:r.attributes},done:!1}}}}export(){const t=new Array(this._nodes.size);let n=0;this._nodes.forEach((i,o)=>{t[n++]=C5(o,i)});const r=new Array(this._edges.size);return n=0,this._edges.forEach((i,o)=>{r[n++]=T5(this.type,o,i)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:r}}import(t,n=!1){if(t instanceof St)return t.forEachNode((f,d)=>{n?this.mergeNode(f,d):this.addNode(f,d)}),t.forEachEdge((f,d,p,m,v,g,w)=>{n?w?this.mergeUndirectedEdgeWithKey(f,p,m,d):this.mergeDirectedEdgeWithKey(f,p,m,d):w?this.addUndirectedEdgeWithKey(f,p,m,d):this.addDirectedEdgeWithKey(f,p,m,d)}),this;if(!cn(t))throw new je("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(t.attributes){if(!cn(t.attributes))throw new je("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,i,o,l,u;if(t.nodes){if(o=t.nodes,!Array.isArray(o))throw new je("Graph.import: invalid nodes. Expecting an array.");for(r=0,i=o.length;r{const o=Xt({},r.attributes);r=new n.NodeDataClass(i,o),n._nodes.set(i,r)}),n}copy(t){if(t=t||{},typeof t.type=="string"&&t.type!==this.type&&t.type!=="mixed")throw new Xe(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${t.type}" because this would mean losing information about the current graph.`);if(typeof t.multi=="boolean"&&t.multi!==this.multi&&t.multi!==!0)throw new Xe("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof t.allowSelfLoops=="boolean"&&t.allowSelfLoops!==this.allowSelfLoops&&t.allowSelfLoops!==!0)throw new Xe("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const n=this.emptyCopy(t),r=this._edges.values();let i,o;for(;i=r.next(),i.done!==!0;)o=i.value,qT(n,"copy",!1,o.undirected,o.key,o.source.key,o.target.key,Xt({},o.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const t={};this._nodes.forEach((o,l)=>{t[l]=o.attributes});const n={},r={};this._edges.forEach((o,l)=>{const u=o.undirected?"--":"->";let f="",d=o.source.key,p=o.target.key,m;o.undirected&&d>p&&(m=d,d=p,p=m);const v=`(${d})${u}(${p})`;l.startsWith("geid_")?this.multi&&(typeof r[v]>"u"?r[v]=0:r[v]++,f+=`${r[v]}. `):f+=`[${l}]: `,f+=v,n[f]=o.attributes});const i={};for(const o in this)this.hasOwnProperty(o)&&!$1.has(o)&&typeof this[o]!="function"&&typeof o!="symbol"&&(i[o]=this[o]);return i.attributes=this._attributes,i.nodes=t,i.edges=n,ur(i,"constructor",this.constructor),i}}typeof Symbol<"u"&&(St.prototype[Symbol.for("nodejs.util.inspect.custom")]=St.prototype.inspect);O5.forEach(e=>{["add","merge","update"].forEach(t=>{const n=e.name(t),r=t==="add"?qT:z5;e.generateKey?St.prototype[n]=function(i,o,l){return r(this,n,!0,(e.type||this.type)==="undirected",null,i,o,l,t==="update")}:St.prototype[n]=function(i,o,l,u){return r(this,n,!1,(e.type||this.type)==="undirected",i,o,l,u,t==="update")}})});H3(St);t5(St);v5(St);k5(St);class Wl extends St{constructor(t){const n=Xt({type:"directed"},t);if("multi"in n&&n.multi!==!1)throw new je("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new je('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class YT extends St{constructor(t){const n=Xt({type:"undirected"},t);if("multi"in n&&n.multi!==!1)throw new je("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new je('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class WT extends St{constructor(t){const n=Xt({multi:!0},t);if("multi"in n&&n.multi!==!0)throw new je("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}}class XT extends St{constructor(t){const n=Xt({type:"directed",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new je("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new je('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class KT extends St{constructor(t){const n=Xt({type:"undirected",multi:!0},t);if("multi"in n&&n.multi!==!0)throw new je("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new je('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}function _s(e){e.from=function(t,n){const r=Xt({},t.options,n),i=new e(r);return i.import(t),i}}_s(St);_s(Wl);_s(YT);_s(WT);_s(XT);_s(KT);St.Graph=St;St.DirectedGraph=Wl;St.UndirectedGraph=YT;St.MultiGraph=WT;St.MultiDirectedGraph=XT;St.MultiUndirectedGraph=KT;St.InvalidArgumentsGraphError=je;St.NotFoundGraphError=De;St.UsageGraphError=Xe;function M5(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Gl(e){var t=M5(e,"string");return typeof t=="symbol"?t:t+""}function tn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function V1(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=Array(t);n>8&255,o=n>>16&255,l=n>>24&255;return[r,i,o,l]}var um={};function nA(e){if(typeof um[e]<"u")return um[e];var t=(e&16711680)>>>16,n=(e&65280)>>>8,r=e&255,i=255,o=tA(t,n,r,i);return um[e]=o,o}function q1(e,t,n,r){return n+(t<<8)+(e<<16)}function Y1(e,t,n,r,i,o){var l=Math.floor(n/o*i),u=Math.floor(e.drawingBufferHeight/o-r/o*i),f=new Uint8Array(4);e.bindFramebuffer(e.FRAMEBUFFER,t),e.readPixels(l,u,1,1,e.RGBA,e.UNSIGNED_BYTE,f);var d=fs(f,4),p=d[0],m=d[1],v=d[2],g=d[3];return[p,m,v,g]}function ke(e,t,n){return(t=Gl(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fe(e){for(var t=1;tN){var L="…";for(d=d+L,D=e.measureText(d).width;D>N&&d.length>1;)d=d.slice(0,-2)+L,D=e.measureText(d).width;if(d.length<4)return}var R;_>0?T>0?R=Math.acos(_/N):R=Math.asin(T/N):T>0?R=Math.acos(_/N)+Math.PI:R=Math.asin(_/N)+Math.PI/2,e.save(),e.translate(k,C),e.rotate(R),e.fillText(d,-D/2,t.size/2+o),e.restore()}}}function sA(e,t,n){if(t.label){var r=n.labelSize,i=n.labelFont,o=n.labelWeight,l=n.labelColor.attribute?t[n.labelColor.attribute]||n.labelColor.color||"#000":n.labelColor.color;e.fillStyle=l,e.font="".concat(o," ").concat(r,"px ").concat(i),e.fillText(t.label,t.x+t.size+3,t.y+r/3)}}function J5(e,t,n){var r=n.labelSize,i=n.labelFont,o=n.labelWeight;e.font="".concat(o," ").concat(r,"px ").concat(i),e.fillStyle="#FFF",e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=8,e.shadowColor="#000";var l=2;if(typeof t.label=="string"){var u=e.measureText(t.label).width,f=Math.round(u+5),d=Math.round(r+2*l),p=Math.max(t.size,r/2)+l,m=Math.asin(d/2/p),v=Math.sqrt(Math.abs(Math.pow(p,2)-Math.pow(d/2,2)));e.beginPath(),e.moveTo(t.x+v,t.y+d/2),e.lineTo(t.x+p+f,t.y+d/2),e.lineTo(t.x+p+f,t.y-d/2),e.lineTo(t.x+v,t.y-d/2),e.arc(t.x,t.y,p,m,-m),e.closePath(),e.fill()}else e.beginPath(),e.arc(t.x,t.y,t.size+l,0,Math.PI*2),e.closePath(),e.fill();e.shadowOffsetX=0,e.shadowOffsetY=0,e.shadowBlur=0,sA(e,t,n)}var eG=` precision highp float; varying vec4 v_color; varying vec2 v_diffVector; varying float v_radius; uniform float u_correctionRatio; const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0); void main(void) { float border = u_correctionRatio * 2.0; float dist = length(v_diffVector) - v_radius + border; // No antialiasing for picking mode: #ifdef PICKING_MODE if (dist > border) gl_FragColor = transparent; else gl_FragColor = v_color; #else float t = 0.0; if (dist > border) t = 1.0; else if (dist > 0.0) t = dist / border; gl_FragColor = mix(v_color, transparent, t); #endif } `,tG=eG,nG=` attribute vec4 a_id; attribute vec4 a_color; attribute vec2 a_position; attribute float a_size; attribute float a_angle; uniform mat3 u_matrix; uniform float u_sizeRatio; uniform float u_correctionRatio; varying vec4 v_color; varying vec2 v_diffVector; varying float v_radius; varying float v_border; const float bias = 255.0 / 254.0; void main() { float size = a_size * u_correctionRatio / u_sizeRatio * 4.0; vec2 diffVector = size * vec2(cos(a_angle), sin(a_angle)); vec2 position = a_position + diffVector; gl_Position = vec4( (u_matrix * vec3(position, 1)).xy, 0, 1 ); v_diffVector = diffVector; v_radius = size / 2.0; #ifdef PICKING_MODE // For picking mode, we use the ID as the color: v_color = a_id; #else // For normal mode, we use the color: v_color = a_color; #endif v_color.a *= bias; } `,rG=nG,lA=WebGLRenderingContext,Q1=lA.UNSIGNED_BYTE,fm=lA.FLOAT,iG=["u_sizeRatio","u_correctionRatio","u_matrix"],fu=function(e){function t(){return tn(this,t),Pn(this,t,arguments)}return Fn(t,e),nn(t,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:rG,FRAGMENT_SHADER_SOURCE:tG,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:iG,ATTRIBUTES:[{name:"a_position",size:2,type:fm},{name:"a_size",size:1,type:fm},{name:"a_color",size:4,type:Q1,normalized:!0},{name:"a_id",size:4,type:Q1,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_angle",size:1,type:fm}],CONSTANT_DATA:[[t.ANGLE_1],[t.ANGLE_2],[t.ANGLE_3]]}}},{key:"processVisibleItem",value:function(r,i,o){var l=this.array,u=Yr(o.color);l[i++]=o.x,l[i++]=o.y,l[i++]=o.size,l[i++]=u,l[i++]=r}},{key:"setUniforms",value:function(r,i){var o=i.gl,l=i.uniformLocations,u=l.u_sizeRatio,f=l.u_correctionRatio,d=l.u_matrix;o.uniform1f(f,r.correctionRatio),o.uniform1f(u,r.sizeRatio),o.uniformMatrix3fv(d,!1,r.matrix)}}])}(vy);ke(fu,"ANGLE_1",0);ke(fu,"ANGLE_2",2*Math.PI/3);ke(fu,"ANGLE_3",4*Math.PI/3);var aG=` precision mediump float; varying vec4 v_color; void main(void) { gl_FragColor = v_color; } `,oG=aG,sG=` attribute vec2 a_position; attribute vec2 a_normal; attribute float a_radius; attribute vec3 a_barycentric; #ifdef PICKING_MODE attribute vec4 a_id; #else attribute vec4 a_color; #endif uniform mat3 u_matrix; uniform float u_sizeRatio; uniform float u_correctionRatio; uniform float u_minEdgeThickness; uniform float u_lengthToThicknessRatio; uniform float u_widenessToThicknessRatio; varying vec4 v_color; const float bias = 255.0 / 254.0; void main() { float minThickness = u_minEdgeThickness; float normalLength = length(a_normal); vec2 unitNormal = a_normal / normalLength; // These first computations are taken from edge.vert.glsl and // edge.clamped.vert.glsl. Please read it to get better comments on what's // happening: float pixelsThickness = max(normalLength / u_sizeRatio, minThickness); float webGLThickness = pixelsThickness * u_correctionRatio; float webGLNodeRadius = a_radius * 2.0 * u_correctionRatio / u_sizeRatio; float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0; float webGLArrowHeadThickness = webGLThickness * u_widenessToThicknessRatio; float da = a_barycentric.x; float db = a_barycentric.y; float dc = a_barycentric.z; vec2 delta = vec2( da * (webGLNodeRadius * unitNormal.y) + db * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y + webGLArrowHeadThickness * unitNormal.x) + dc * ((webGLNodeRadius + webGLArrowHeadLength) * unitNormal.y - webGLArrowHeadThickness * unitNormal.x), da * (-webGLNodeRadius * unitNormal.x) + db * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x + webGLArrowHeadThickness * unitNormal.y) + dc * (-(webGLNodeRadius + webGLArrowHeadLength) * unitNormal.x - webGLArrowHeadThickness * unitNormal.y) ); vec2 position = (u_matrix * vec3(a_position + delta, 1)).xy; gl_Position = vec4(position, 0, 1); #ifdef PICKING_MODE // For picking mode, we use the ID as the color: v_color = a_id; #else // For normal mode, we use the color: v_color = a_color; #endif v_color.a *= bias; } `,lG=sG,uA=WebGLRenderingContext,J1=uA.UNSIGNED_BYTE,Gc=uA.FLOAT,uG=["u_matrix","u_sizeRatio","u_correctionRatio","u_minEdgeThickness","u_lengthToThicknessRatio","u_widenessToThicknessRatio"],du={extremity:"target",lengthToThicknessRatio:2.5,widenessToThicknessRatio:2};function Tf(e){var t=Fe(Fe({},du),e||{});return function(n){function r(){return tn(this,r),Pn(this,r,arguments)}return Fn(r,n),nn(r,[{key:"getDefinition",value:function(){return{VERTICES:3,VERTEX_SHADER_SOURCE:lG,FRAGMENT_SHADER_SOURCE:oG,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:uG,ATTRIBUTES:[{name:"a_position",size:2,type:Gc},{name:"a_normal",size:2,type:Gc},{name:"a_radius",size:1,type:Gc},{name:"a_color",size:4,type:J1,normalized:!0},{name:"a_id",size:4,type:J1,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_barycentric",size:3,type:Gc}],CONSTANT_DATA:[[1,0,0],[0,1,0],[0,0,1]]}}},{key:"processVisibleItem",value:function(o,l,u,f,d){if(t.extremity==="source"){var p=[f,u];u=p[0],f=p[1]}var m=d.size||1,v=f.size||1,g=u.x,w=u.y,x=f.x,k=f.y,C=Yr(d.color),_=x-g,T=k-w,N=_*_+T*T,D=0,L=0;N&&(N=1/Math.sqrt(N),D=-T*N*m,L=_*N*m);var R=this.array;R[l++]=x,R[l++]=k,R[l++]=-D,R[l++]=-L,R[l++]=v,R[l++]=C,R[l++]=o}},{key:"setUniforms",value:function(o,l){var u=l.gl,f=l.uniformLocations,d=f.u_matrix,p=f.u_sizeRatio,m=f.u_correctionRatio,v=f.u_minEdgeThickness,g=f.u_lengthToThicknessRatio,w=f.u_widenessToThicknessRatio;u.uniformMatrix3fv(d,!1,o.matrix),u.uniform1f(p,o.sizeRatio),u.uniform1f(m,o.correctionRatio),u.uniform1f(v,o.minEdgeThickness),u.uniform1f(g,t.lengthToThicknessRatio),u.uniform1f(w,t.widenessToThicknessRatio)}}])}(cu)}Tf();var cG=` precision mediump float; varying vec4 v_color; varying vec2 v_normal; varying float v_thickness; varying float v_feather; const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0); void main(void) { // We only handle antialiasing for normal mode: #ifdef PICKING_MODE gl_FragColor = v_color; #else float dist = length(v_normal) * v_thickness; float t = smoothstep( v_thickness - v_feather, v_thickness, dist ); gl_FragColor = mix(v_color, transparent, t); #endif } `,yy=cG,fG=` attribute vec4 a_id; attribute vec4 a_color; attribute vec2 a_normal; attribute float a_normalCoef; attribute vec2 a_positionStart; attribute vec2 a_positionEnd; attribute float a_positionCoef; attribute float a_radius; attribute float a_radiusCoef; uniform mat3 u_matrix; uniform float u_zoomRatio; uniform float u_sizeRatio; uniform float u_pixelRatio; uniform float u_correctionRatio; uniform float u_minEdgeThickness; uniform float u_lengthToThicknessRatio; uniform float u_feather; varying vec4 v_color; varying vec2 v_normal; varying float v_thickness; varying float v_feather; const float bias = 255.0 / 254.0; void main() { float minThickness = u_minEdgeThickness; float radius = a_radius * a_radiusCoef; vec2 normal = a_normal * a_normalCoef; vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef; float normalLength = length(normal); vec2 unitNormal = normal / normalLength; // These first computations are taken from edge.vert.glsl. Please read it to // get better comments on what's happening: float pixelsThickness = max(normalLength, minThickness * u_sizeRatio); float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio; // Here, we move the point to leave space for the arrow head: float direction = sign(radius); float webGLNodeRadius = direction * radius * 2.0 * u_correctionRatio / u_sizeRatio; float webGLArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0; vec2 compensationVector = vec2(-direction * unitNormal.y, direction * unitNormal.x) * (webGLNodeRadius + webGLArrowHeadLength); // Here is the proper position of the vertex gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness + compensationVector, 1)).xy, 0, 1); v_thickness = webGLThickness / u_zoomRatio; v_normal = unitNormal; v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0; #ifdef PICKING_MODE // For picking mode, we use the ID as the color: v_color = a_id; #else // For normal mode, we use the color: v_color = a_color; #endif v_color.a *= bias; } `,dG=fG,cA=WebGLRenderingContext,eS=cA.UNSIGNED_BYTE,Ga=cA.FLOAT,hG=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],pG={lengthToThicknessRatio:du.lengthToThicknessRatio};function fA(e){var t=Fe(Fe({},pG),{});return function(n){function r(){return tn(this,r),Pn(this,r,arguments)}return Fn(r,n),nn(r,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:dG,FRAGMENT_SHADER_SOURCE:yy,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:hG,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Ga},{name:"a_positionEnd",size:2,type:Ga},{name:"a_normal",size:2,type:Ga},{name:"a_color",size:4,type:eS,normalized:!0},{name:"a_id",size:4,type:eS,normalized:!0},{name:"a_radius",size:1,type:Ga}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Ga},{name:"a_normalCoef",size:1,type:Ga},{name:"a_radiusCoef",size:1,type:Ga}],CONSTANT_DATA:[[0,1,0],[0,-1,0],[1,1,1],[1,1,1],[0,-1,0],[1,-1,-1]]}}},{key:"processVisibleItem",value:function(o,l,u,f,d){var p=d.size||1,m=u.x,v=u.y,g=f.x,w=f.y,x=Yr(d.color),k=g-m,C=w-v,_=f.size||1,T=k*k+C*C,N=0,D=0;T&&(T=1/Math.sqrt(T),N=-C*T*p,D=k*T*p);var L=this.array;L[l++]=m,L[l++]=v,L[l++]=g,L[l++]=w,L[l++]=N,L[l++]=D,L[l++]=x,L[l++]=o,L[l++]=_}},{key:"setUniforms",value:function(o,l){var u=l.gl,f=l.uniformLocations,d=f.u_matrix,p=f.u_zoomRatio,m=f.u_feather,v=f.u_pixelRatio,g=f.u_correctionRatio,w=f.u_sizeRatio,x=f.u_minEdgeThickness,k=f.u_lengthToThicknessRatio;u.uniformMatrix3fv(d,!1,o.matrix),u.uniform1f(p,o.zoomRatio),u.uniform1f(w,o.sizeRatio),u.uniform1f(g,o.correctionRatio),u.uniform1f(v,o.pixelRatio),u.uniform1f(m,o.antiAliasingFeather),u.uniform1f(x,o.minEdgeThickness),u.uniform1f(k,t.lengthToThicknessRatio)}}])}(cu)}fA();function mG(e){return oA([fA(),Tf(e)])}var gG=mG(),dA=gG,vG=` attribute vec4 a_id; attribute vec4 a_color; attribute vec2 a_normal; attribute float a_normalCoef; attribute vec2 a_positionStart; attribute vec2 a_positionEnd; attribute float a_positionCoef; uniform mat3 u_matrix; uniform float u_sizeRatio; uniform float u_zoomRatio; uniform float u_pixelRatio; uniform float u_correctionRatio; uniform float u_minEdgeThickness; uniform float u_feather; varying vec4 v_color; varying vec2 v_normal; varying float v_thickness; varying float v_feather; const float bias = 255.0 / 254.0; void main() { float minThickness = u_minEdgeThickness; vec2 normal = a_normal * a_normalCoef; vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef; float normalLength = length(normal); vec2 unitNormal = normal / normalLength; // We require edges to be at least "minThickness" pixels thick *on screen* // (so we need to compensate the size ratio): float pixelsThickness = max(normalLength, minThickness * u_sizeRatio); // Then, we need to retrieve the normalized thickness of the edge in the WebGL // referential (in a ([0, 1], [0, 1]) space), using our "magic" correction // ratio: float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio; // Here is the proper position of the vertex gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness, 1)).xy, 0, 1); // For the fragment shader though, we need a thickness that takes the "magic" // correction ratio into account (as in webGLThickness), but so that the // antialiasing effect does not depend on the zoom level. So here's yet // another thickness version: v_thickness = webGLThickness / u_zoomRatio; v_normal = unitNormal; v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0; #ifdef PICKING_MODE // For picking mode, we use the ID as the color: v_color = a_id; #else // For normal mode, we use the color: v_color = a_color; #endif v_color.a *= bias; } `,yG=vG,hA=WebGLRenderingContext,tS=hA.UNSIGNED_BYTE,Rl=hA.FLOAT,bG=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness"],xG=function(e){function t(){return tn(this,t),Pn(this,t,arguments)}return Fn(t,e),nn(t,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:yG,FRAGMENT_SHADER_SOURCE:yy,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:bG,ATTRIBUTES:[{name:"a_positionStart",size:2,type:Rl},{name:"a_positionEnd",size:2,type:Rl},{name:"a_normal",size:2,type:Rl},{name:"a_color",size:4,type:tS,normalized:!0},{name:"a_id",size:4,type:tS,normalized:!0}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:Rl},{name:"a_normalCoef",size:1,type:Rl}],CONSTANT_DATA:[[0,1],[0,-1],[1,1],[1,1],[0,-1],[1,-1]]}}},{key:"processVisibleItem",value:function(r,i,o,l,u){var f=u.size||1,d=o.x,p=o.y,m=l.x,v=l.y,g=Yr(u.color),w=m-d,x=v-p,k=w*w+x*x,C=0,_=0;k&&(k=1/Math.sqrt(k),C=-x*k*f,_=w*k*f);var T=this.array;T[i++]=d,T[i++]=p,T[i++]=m,T[i++]=v,T[i++]=C,T[i++]=_,T[i++]=g,T[i++]=r}},{key:"setUniforms",value:function(r,i){var o=i.gl,l=i.uniformLocations,u=l.u_matrix,f=l.u_zoomRatio,d=l.u_feather,p=l.u_pixelRatio,m=l.u_correctionRatio,v=l.u_sizeRatio,g=l.u_minEdgeThickness;o.uniformMatrix3fv(u,!1,r.matrix),o.uniform1f(f,r.zoomRatio),o.uniform1f(v,r.sizeRatio),o.uniform1f(m,r.correctionRatio),o.uniform1f(p,r.pixelRatio),o.uniform1f(d,r.antiAliasingFeather),o.uniform1f(g,r.minEdgeThickness)}}])}(cu),by=function(e){function t(){var n;return tn(this,t),n=Pn(this,t),n.rawEmitter=n,n}return Fn(t,e),nn(t)}(PT.EventEmitter),dm,nS;function Wr(){return nS||(nS=1,dm=function(t){return t!==null&&typeof t=="object"&&typeof t.addUndirectedEdgeWithKey=="function"&&typeof t.dropNode=="function"&&typeof t.multi=="boolean"}),dm}var wG=Wr();const SG=fn(wG);var EG=function(t){return t},_G=function(t){return t*t},kG=function(t){return t*(2-t)},CG=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},TG=function(t){return t*t*t},AG=function(t){return--t*t*t+1},RG=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},pA={linear:EG,quadraticIn:_G,quadraticOut:kG,quadraticInOut:CG,cubicIn:TG,cubicOut:AG,cubicInOut:RG},mA={easing:"quadraticInOut",duration:150};function DG(e,t,n,r){var i=Object.assign({},mA,n),o=typeof i.easing=="function"?i.easing:pA[i.easing],l=Date.now(),u={};for(var f in t){var d=t[f];u[f]={};for(var p in d)u[f][p]=e.getNodeAttribute(f,p)}var m=null,v=function(){m=null;var w=(Date.now()-l)/i.duration;if(w>=1){for(var x in t){var k=t[x];for(var C in k)e.setNodeAttribute(x,C,k[C])}return}w=o(w);for(var _ in t){var T=t[_],N=u[_];for(var D in T)e.setNodeAttribute(_,D,T[D]*w+N[D]*(1-w))}m=requestAnimationFrame(v)};return v(),function(){m&&cancelAnimationFrame(m)}}function Er(){return Float32Array.of(1,0,0,0,1,0,0,0,1)}function Uc(e,t,n){return e[0]=t,e[4]=typeof n=="number"?n:t,e}function rS(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[3]=-n,e[4]=r,e}function iS(e,t,n){return e[6]=t,e[7]=n,e}function ea(e,t){var n=e[0],r=e[1],i=e[2],o=e[3],l=e[4],u=e[5],f=e[6],d=e[7],p=e[8],m=t[0],v=t[1],g=t[2],w=t[3],x=t[4],k=t[5],C=t[6],_=t[7],T=t[8];return e[0]=m*n+v*o+g*f,e[1]=m*r+v*l+g*d,e[2]=m*i+v*u+g*p,e[3]=w*n+x*o+k*f,e[4]=w*r+x*l+k*d,e[5]=w*i+x*u+k*p,e[6]=C*n+_*o+T*f,e[7]=C*r+_*l+T*d,e[8]=C*i+_*u+T*p,e}function $g(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=e[0],i=e[1],o=e[3],l=e[4],u=e[6],f=e[7],d=t.x,p=t.y;return{x:d*r+p*o+u*n,y:d*i+p*l+f*n}}function NG(e,t){var n=e.height/e.width,r=t.height/t.width;return n<1&&r>1||n>1&&r<1?1:Math.min(Math.max(r,1/r),Math.max(1/n,n))}function Dl(e,t,n,r,i){var o=e.angle,l=e.ratio,u=e.x,f=e.y,d=t.width,p=t.height,m=Er(),v=Math.min(d,p)-2*r,g=NG(t,n);return i?(ea(m,iS(Er(),u,f)),ea(m,Uc(Er(),l)),ea(m,rS(Er(),o)),ea(m,Uc(Er(),d/v/2/g,p/v/2/g))):(ea(m,Uc(Er(),2*(v/d)*g,2*(v/p)*g)),ea(m,rS(Er(),-o)),ea(m,Uc(Er(),1/l)),ea(m,iS(Er(),-u,-f))),m}function OG(e,t,n){var r=$g(e,{x:Math.cos(t.angle),y:Math.sin(t.angle)},0),i=r.x,o=r.y;return 1/Math.sqrt(Math.pow(i,2)+Math.pow(o,2))/n.width}function jG(e){if(!e.order)return{x:[0,1],y:[0,1]};var t=1/0,n=-1/0,r=1/0,i=-1/0;return e.forEachNode(function(o,l){var u=l.x,f=l.y;un&&(n=u),fi&&(i=f)}),{x:[t,n],y:[r,i]}}function LG(e){if(!SG(e))throw new Error("Sigma: invalid graph instance.");e.forEachNode(function(t,n){if(!Number.isFinite(n.x)||!Number.isFinite(n.y))throw new Error("Sigma: Coordinates of node ".concat(t," are invalid. A node must have a numeric 'x' and 'y' attribute."))})}function zG(e,t,n){var r=document.createElement(e);if(t)for(var i in t)r.style[i]=t[i];if(n)for(var o in n)r.setAttribute(o,n[o]);return r}function aS(){return typeof window.devicePixelRatio<"u"?window.devicePixelRatio:1}function oS(e,t,n){return n.sort(function(r,i){var o=t(r)||0,l=t(i)||0;return ol?1:0})}function sS(e){var t=fs(e.x,2),n=t[0],r=t[1],i=fs(e.y,2),o=i[0],l=i[1],u=Math.max(r-n,l-o),f=(r+n)/2,d=(l+o)/2;(u===0||Math.abs(u)===1/0||isNaN(u))&&(u=1),isNaN(f)&&(f=0),isNaN(d)&&(d=0);var p=function(v){return{x:.5+(v.x-f)/u,y:.5+(v.y-d)/u}};return p.applyTo=function(m){m.x=.5+(m.x-f)/u,m.y=.5+(m.y-d)/u},p.inverse=function(m){return{x:f+u*(m.x-.5),y:d+u*(m.y-.5)}},p.ratio=u,p}function Hg(e){"@babel/helpers - typeof";return Hg=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hg(e)}function lS(e,t){var n=t.size;if(n!==0){var r=e.length;e.length+=n;var i=0;t.forEach(function(o){e[r+i]=o,i++})}}function hm(e){e=e||{};for(var t=0,n=arguments.length<=1?0:arguments.length-1;t1&&arguments[1]!==void 0?arguments[1]:{},l=arguments.length>2?arguments[2]:void 0;if(!l)return new Promise(function(g){return i.animate(r,o,g)});if(this.enabled){var u=Fe(Fe({},mA),o),f=this.validateState(r),d=typeof u.easing=="function"?u.easing:pA[u.easing],p=Date.now(),m=this.getState(),v=function(){var w=(Date.now()-p)/u.duration;if(w>=1){i.nextFrame=null,i.setState(f),i.animationCallback&&(i.animationCallback.call(null),i.animationCallback=void 0);return}var x=d(w),k={};typeof f.x=="number"&&(k.x=m.x+(f.x-m.x)*x),typeof f.y=="number"&&(k.y=m.y+(f.y-m.y)*x),i.enabledRotation&&typeof f.angle=="number"&&(k.angle=m.angle+(f.angle-m.angle)*x),typeof f.ratio=="number"&&(k.ratio=m.ratio+(f.ratio-m.ratio)*x),i.setState(k),i.nextFrame=requestAnimationFrame(v)};this.nextFrame?(cancelAnimationFrame(this.nextFrame),this.animationCallback&&this.animationCallback.call(null),this.nextFrame=requestAnimationFrame(v)):v(),this.animationCallback=l}}},{key:"animatedZoom",value:function(r){return r?typeof r=="number"?this.animate({ratio:this.ratio/r}):this.animate({ratio:this.ratio/(r.factor||Bc)},r):this.animate({ratio:this.ratio/Bc})}},{key:"animatedUnzoom",value:function(r){return r?typeof r=="number"?this.animate({ratio:this.ratio*r}):this.animate({ratio:this.ratio*(r.factor||Bc)},r):this.animate({ratio:this.ratio*Bc})}},{key:"animatedReset",value:function(r){return this.animate({x:.5,y:.5,ratio:1,angle:0},r)}},{key:"copy",value:function(){return t.from(this.getState())}}],[{key:"from",value:function(r){var i=new t;return i.setState(r)}}])}(by);function kr(e,t){var n=t.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function yi(e,t){var n=Fe(Fe({},kr(e,t)),{},{sigmaDefaultPrevented:!1,preventSigmaDefault:function(){n.sigmaDefaultPrevented=!0},original:e});return n}function Nl(e){var t="x"in e?e:Fe(Fe({},e.touches[0]||e.previousTouches[0]),{},{original:e.original,sigmaDefaultPrevented:e.sigmaDefaultPrevented,preventSigmaDefault:function(){e.sigmaDefaultPrevented=!0,t.sigmaDefaultPrevented=!0}});return t}function IG(e,t){return Fe(Fe({},yi(e,t)),{},{delta:gA(e)})}var GG=2;function uf(e){for(var t=[],n=0,r=Math.min(e.length,GG);n0;i.draggedEvents=0,m&&i.renderer.getSetting("hideEdgesOnMove")&&i.renderer.refresh()},0),this.emit("mouseup",yi(r,this.container))}}},{key:"handleMove",value:function(r){var i=this;if(this.enabled){var o=yi(r,this.container);if(this.emit("mousemovebody",o),(r.target===this.container||r.composedPath()[0]===this.container)&&this.emit("mousemove",o),!o.sigmaDefaultPrevented&&this.isMouseDown){this.isMoving=!0,this.draggedEvents++,typeof this.movingTimeout=="number"&&clearTimeout(this.movingTimeout),this.movingTimeout=window.setTimeout(function(){i.movingTimeout=null,i.isMoving=!1},this.settings.dragTimeout);var l=this.renderer.getCamera(),u=kr(r,this.container),f=u.x,d=u.y,p=this.renderer.viewportToFramedGraph({x:this.lastMouseX,y:this.lastMouseY}),m=this.renderer.viewportToFramedGraph({x:f,y:d}),v=p.x-m.x,g=p.y-m.y,w=l.getState(),x=w.x+v,k=w.y+g;l.setState({x,y:k}),this.lastMouseX=f,this.lastMouseY=d,r.preventDefault(),r.stopPropagation()}}}},{key:"handleLeave",value:function(r){this.emit("mouseleave",yi(r,this.container))}},{key:"handleEnter",value:function(r){this.emit("mouseenter",yi(r,this.container))}},{key:"handleWheel",value:function(r){var i=this,o=this.renderer.getCamera();if(!(!this.enabled||!o.enabledZooming)){var l=gA(r);if(l){var u=IG(r,this.container);if(this.emit("wheel",u),u.sigmaDefaultPrevented){r.preventDefault(),r.stopPropagation();return}var f=o.getState().ratio,d=l>0?1/this.settings.zoomingRatio:this.settings.zoomingRatio,p=o.getBoundedRatio(f*d),m=l>0?1:-1,v=Date.now();f!==p&&(r.preventDefault(),r.stopPropagation(),!(this.currentWheelDirection===m&&this.lastWheelTriggerTime&&v-this.lastWheelTriggerTimer.size?-1:n.sizer.key?1:-1}}])}(),dS=function(){function e(){tn(this,e),ke(this,"width",0),ke(this,"height",0),ke(this,"cellSize",0),ke(this,"columns",0),ke(this,"rows",0),ke(this,"cells",{})}return nn(e,[{key:"resizeAndClear",value:function(n,r){this.width=n.width,this.height=n.height,this.cellSize=r,this.columns=Math.ceil(n.width/r),this.rows=Math.ceil(n.height/r),this.cells={}}},{key:"getIndex",value:function(n){var r=Math.floor(n.x/this.cellSize),i=Math.floor(n.y/this.cellSize);return i*this.columns+r}},{key:"add",value:function(n,r,i){var o=new fS(n,r),l=this.getIndex(i),u=this.cells[l];u||(u=[],this.cells[l]=u),u.push(o)}},{key:"organize",value:function(){for(var n in this.cells){var r=this.cells[n];r.sort(fS.compare)}}},{key:"getLabelsToDisplay",value:function(n,r){var i=this.cellSize*this.cellSize,o=i/n/n,l=o*r/i,u=Math.ceil(l),f=[];for(var d in this.cells)for(var p=this.cells[d],m=0;m2&&arguments[2]!==void 0?arguments[2]:{};if(tn(this,t),i=Pn(this,t),ke(i,"elements",{}),ke(i,"canvasContexts",{}),ke(i,"webGLContexts",{}),ke(i,"pickingLayers",new Set),ke(i,"textures",{}),ke(i,"frameBuffers",{}),ke(i,"activeListeners",{}),ke(i,"labelGrid",new dS),ke(i,"nodeDataCache",{}),ke(i,"edgeDataCache",{}),ke(i,"nodeProgramIndex",{}),ke(i,"edgeProgramIndex",{}),ke(i,"nodesWithForcedLabels",new Set),ke(i,"edgesWithForcedLabels",new Set),ke(i,"nodeExtent",{x:[0,1],y:[0,1]}),ke(i,"nodeZExtent",[1/0,-1/0]),ke(i,"edgeZExtent",[1/0,-1/0]),ke(i,"matrix",Er()),ke(i,"invMatrix",Er()),ke(i,"correctionRatio",1),ke(i,"customBBox",null),ke(i,"normalizationFunction",sS({x:[0,1],y:[0,1]})),ke(i,"graphToViewportRatio",1),ke(i,"itemIDsIndex",{}),ke(i,"nodeIndices",{}),ke(i,"edgeIndices",{}),ke(i,"width",0),ke(i,"height",0),ke(i,"pixelRatio",aS()),ke(i,"pickingDownSizingRatio",2*i.pixelRatio),ke(i,"displayedNodeLabels",new Set),ke(i,"displayedEdgeLabels",new Set),ke(i,"highlightedNodes",new Set),ke(i,"hoveredNode",null),ke(i,"hoveredEdge",null),ke(i,"renderFrame",null),ke(i,"renderHighlightedNodesFrame",null),ke(i,"needToProcess",!1),ke(i,"checkEdgesEventsFrame",null),ke(i,"nodePrograms",{}),ke(i,"nodeHoverPrograms",{}),ke(i,"edgePrograms",{}),i.settings=FG(o),pm(i.settings),LG(n),!(r instanceof HTMLElement))throw new Error("Sigma: container should be an html element.");i.graph=n,i.container=r,i.createWebGLContext("edges",{picking:o.enableEdgeEvents}),i.createCanvasContext("edgeLabels"),i.createWebGLContext("nodes",{picking:!0}),i.createCanvasContext("labels"),i.createCanvasContext("hovers"),i.createWebGLContext("hoverNodes"),i.createCanvasContext("mouse",{style:{touchAction:"none",userSelect:"none"}}),i.resize();for(var l in i.settings.nodeProgramClasses)i.registerNodeProgram(l,i.settings.nodeProgramClasses[l],i.settings.nodeHoverProgramClasses[l]);for(var u in i.settings.edgeProgramClasses)i.registerEdgeProgram(u,i.settings.edgeProgramClasses[u]);return i.camera=new uS,i.bindCameraHandlers(),i.mouseCaptor=new $G(i.elements.mouse,i),i.mouseCaptor.setSettings(i.settings),i.touchCaptor=new qG(i.elements.mouse,i),i.touchCaptor.setSettings(i.settings),i.bindEventHandlers(),i.bindGraphHandlers(),i.handleSettingsUpdate(),i.refresh(),i}return Fn(t,e),nn(t,[{key:"registerNodeProgram",value:function(r,i,o){return this.nodePrograms[r]&&this.nodePrograms[r].kill(),this.nodeHoverPrograms[r]&&this.nodeHoverPrograms[r].kill(),this.nodePrograms[r]=new i(this.webGLContexts.nodes,this.frameBuffers.nodes,this),this.nodeHoverPrograms[r]=new(o||i)(this.webGLContexts.hoverNodes,null,this),this}},{key:"registerEdgeProgram",value:function(r,i){return this.edgePrograms[r]&&this.edgePrograms[r].kill(),this.edgePrograms[r]=new i(this.webGLContexts.edges,this.frameBuffers.edges,this),this}},{key:"unregisterNodeProgram",value:function(r){if(this.nodePrograms[r]){var i=this.nodePrograms,o=i[r],l=mm(i,[r].map(Gl));o.kill(),this.nodePrograms=l}if(this.nodeHoverPrograms[r]){var u=this.nodeHoverPrograms,f=u[r],d=mm(u,[r].map(Gl));f.kill(),this.nodePrograms=d}return this}},{key:"unregisterEdgeProgram",value:function(r){if(this.edgePrograms[r]){var i=this.edgePrograms,o=i[r],l=mm(i,[r].map(Gl));o.kill(),this.edgePrograms=l}return this}},{key:"resetWebGLTexture",value:function(r){var i=this.webGLContexts[r],o=this.frameBuffers[r],l=this.textures[r];l&&i.deleteTexture(l);var u=i.createTexture();return i.bindFramebuffer(i.FRAMEBUFFER,o),i.bindTexture(i.TEXTURE_2D,u),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,this.width,this.height,0,i.RGBA,i.UNSIGNED_BYTE,null),i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,u,0),this.textures[r]=u,this}},{key:"bindCameraHandlers",value:function(){var r=this;return this.activeListeners.camera=function(){r.scheduleRender()},this.camera.on("updated",this.activeListeners.camera),this}},{key:"unbindCameraHandlers",value:function(){return this.camera.removeListener("updated",this.activeListeners.camera),this}},{key:"getNodeAtPosition",value:function(r){var i=r.x,o=r.y,l=Y1(this.webGLContexts.nodes,this.frameBuffers.nodes,i,o,this.pixelRatio,this.pickingDownSizingRatio),u=q1.apply(void 0,cS(l)),f=this.itemIDsIndex[u];return f&&f.type==="node"?f.id:null}},{key:"bindEventHandlers",value:function(){var r=this;this.activeListeners.handleResize=function(){r.scheduleRefresh()},window.addEventListener("resize",this.activeListeners.handleResize),this.activeListeners.handleMove=function(o){var l=Nl(o),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}},f=r.getNodeAtPosition(l);if(f&&r.hoveredNode!==f&&!r.nodeDataCache[f].hidden){r.hoveredNode&&r.emit("leaveNode",Fe(Fe({},u),{},{node:r.hoveredNode})),r.hoveredNode=f,r.emit("enterNode",Fe(Fe({},u),{},{node:f})),r.scheduleHighlightedNodesRender();return}if(r.hoveredNode&&r.getNodeAtPosition(l)!==r.hoveredNode){var d=r.hoveredNode;r.hoveredNode=null,r.emit("leaveNode",Fe(Fe({},u),{},{node:d})),r.scheduleHighlightedNodesRender();return}if(r.settings.enableEdgeEvents){var p=r.hoveredNode?null:r.getEdgeAtPoint(u.event.x,u.event.y);p!==r.hoveredEdge&&(r.hoveredEdge&&r.emit("leaveEdge",Fe(Fe({},u),{},{edge:r.hoveredEdge})),p&&r.emit("enterEdge",Fe(Fe({},u),{},{edge:p})),r.hoveredEdge=p)}},this.activeListeners.handleMoveBody=function(o){var l=Nl(o);r.emit("moveBody",{event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}})},this.activeListeners.handleLeave=function(o){var l=Nl(o),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}};r.hoveredNode&&(r.emit("leaveNode",Fe(Fe({},u),{},{node:r.hoveredNode})),r.scheduleHighlightedNodesRender()),r.settings.enableEdgeEvents&&r.hoveredEdge&&(r.emit("leaveEdge",Fe(Fe({},u),{},{edge:r.hoveredEdge})),r.scheduleHighlightedNodesRender()),r.emit("leaveStage",Fe({},u))},this.activeListeners.handleEnter=function(o){var l=Nl(o),u={event:l,preventSigmaDefault:function(){l.preventSigmaDefault()}};r.emit("enterStage",Fe({},u))};var i=function(l){return function(u){var f=Nl(u),d={event:f,preventSigmaDefault:function(){f.preventSigmaDefault()}},p=r.getNodeAtPosition(f);if(p)return r.emit("".concat(l,"Node"),Fe(Fe({},d),{},{node:p}));if(r.settings.enableEdgeEvents){var m=r.getEdgeAtPoint(f.x,f.y);if(m)return r.emit("".concat(l,"Edge"),Fe(Fe({},d),{},{edge:m}))}return r.emit("".concat(l,"Stage"),d)}};return this.activeListeners.handleClick=i("click"),this.activeListeners.handleRightClick=i("rightClick"),this.activeListeners.handleDoubleClick=i("doubleClick"),this.activeListeners.handleWheel=i("wheel"),this.activeListeners.handleDown=i("down"),this.activeListeners.handleUp=i("up"),this.mouseCaptor.on("mousemove",this.activeListeners.handleMove),this.mouseCaptor.on("mousemovebody",this.activeListeners.handleMoveBody),this.mouseCaptor.on("click",this.activeListeners.handleClick),this.mouseCaptor.on("rightClick",this.activeListeners.handleRightClick),this.mouseCaptor.on("doubleClick",this.activeListeners.handleDoubleClick),this.mouseCaptor.on("wheel",this.activeListeners.handleWheel),this.mouseCaptor.on("mousedown",this.activeListeners.handleDown),this.mouseCaptor.on("mouseup",this.activeListeners.handleUp),this.mouseCaptor.on("mouseleave",this.activeListeners.handleLeave),this.mouseCaptor.on("mouseenter",this.activeListeners.handleEnter),this.touchCaptor.on("touchdown",this.activeListeners.handleDown),this.touchCaptor.on("touchdown",this.activeListeners.handleMove),this.touchCaptor.on("touchup",this.activeListeners.handleUp),this.touchCaptor.on("touchmove",this.activeListeners.handleMove),this.touchCaptor.on("tap",this.activeListeners.handleClick),this.touchCaptor.on("doubletap",this.activeListeners.handleDoubleClick),this.touchCaptor.on("touchmove",this.activeListeners.handleMoveBody),this}},{key:"bindGraphHandlers",value:function(){var r=this,i=this.graph,o=new Set(["x","y","zIndex","type"]);return this.activeListeners.eachNodeAttributesUpdatedGraphUpdate=function(l){var u,f=(u=l.hints)===null||u===void 0?void 0:u.attributes;r.graph.forEachNode(function(p){return r.updateNode(p)});var d=!f||f.some(function(p){return o.has(p)});r.refresh({partialGraph:{nodes:i.nodes()},skipIndexation:!d,schedule:!0})},this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate=function(l){var u,f=(u=l.hints)===null||u===void 0?void 0:u.attributes;r.graph.forEachEdge(function(p){return r.updateEdge(p)});var d=f&&["zIndex","type"].some(function(p){return f==null?void 0:f.includes(p)});r.refresh({partialGraph:{edges:i.edges()},skipIndexation:!d,schedule:!0})},this.activeListeners.addNodeGraphUpdate=function(l){var u=l.key;r.addNode(u),r.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.updateNodeGraphUpdate=function(l){var u=l.key;r.refresh({partialGraph:{nodes:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropNodeGraphUpdate=function(l){var u=l.key;r.removeNode(u),r.refresh({schedule:!0})},this.activeListeners.addEdgeGraphUpdate=function(l){var u=l.key;r.addEdge(u),r.refresh({partialGraph:{edges:[u]},schedule:!0})},this.activeListeners.updateEdgeGraphUpdate=function(l){var u=l.key;r.refresh({partialGraph:{edges:[u]},skipIndexation:!1,schedule:!0})},this.activeListeners.dropEdgeGraphUpdate=function(l){var u=l.key;r.removeEdge(u),r.refresh({schedule:!0})},this.activeListeners.clearEdgesGraphUpdate=function(){r.clearEdgeState(),r.clearEdgeIndices(),r.refresh({schedule:!0})},this.activeListeners.clearGraphUpdate=function(){r.clearEdgeState(),r.clearNodeState(),r.clearEdgeIndices(),r.clearNodeIndices(),r.refresh({schedule:!0})},i.on("nodeAdded",this.activeListeners.addNodeGraphUpdate),i.on("nodeDropped",this.activeListeners.dropNodeGraphUpdate),i.on("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),i.on("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),i.on("edgeAdded",this.activeListeners.addEdgeGraphUpdate),i.on("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),i.on("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),i.on("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),i.on("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),i.on("cleared",this.activeListeners.clearGraphUpdate),this}},{key:"unbindGraphHandlers",value:function(){var r=this.graph;r.removeListener("nodeAdded",this.activeListeners.addNodeGraphUpdate),r.removeListener("nodeDropped",this.activeListeners.dropNodeGraphUpdate),r.removeListener("nodeAttributesUpdated",this.activeListeners.updateNodeGraphUpdate),r.removeListener("eachNodeAttributesUpdated",this.activeListeners.eachNodeAttributesUpdatedGraphUpdate),r.removeListener("edgeAdded",this.activeListeners.addEdgeGraphUpdate),r.removeListener("edgeDropped",this.activeListeners.dropEdgeGraphUpdate),r.removeListener("edgeAttributesUpdated",this.activeListeners.updateEdgeGraphUpdate),r.removeListener("eachEdgeAttributesUpdated",this.activeListeners.eachEdgeAttributesUpdatedGraphUpdate),r.removeListener("edgesCleared",this.activeListeners.clearEdgesGraphUpdate),r.removeListener("cleared",this.activeListeners.clearGraphUpdate)}},{key:"getEdgeAtPoint",value:function(r,i){var o=Y1(this.webGLContexts.edges,this.frameBuffers.edges,r,i,this.pixelRatio,this.pickingDownSizingRatio),l=q1.apply(void 0,cS(o)),u=this.itemIDsIndex[l];return u&&u.type==="edge"?u.id:null}},{key:"process",value:function(){var r=this;this.emit("beforeProcess");var i=this.graph,o=this.settings,l=this.getDimensions();if(this.nodeExtent=jG(this.graph),!this.settings.autoRescale){var u=l.width,f=l.height,d=this.nodeExtent,p=d.x,m=d.y;this.nodeExtent={x:[(p[0]+p[1])/2-u/2,(p[0]+p[1])/2+u/2],y:[(m[0]+m[1])/2-f/2,(m[0]+m[1])/2+f/2]}}this.normalizationFunction=sS(this.customBBox||this.nodeExtent);var v=new uS,g=Dl(v.getState(),l,this.getGraphDimensions(),this.getStagePadding());this.labelGrid.resizeAndClear(l,o.labelGridCellSize);for(var w={},x={},k={},C={},_=1,T=i.nodes(),N=0,D=T.length;N1&&arguments[1]!==void 0?arguments[1]:{},o=i.tolerance,l=o===void 0?0:o,u=i.boundaries,f=Fe({},r),d=u||this.nodeExtent,p=fs(d.x,2),m=p[0],v=p[1],g=fs(d.y,2),w=g[0],x=g[1],k=[this.graphToViewport({x:m,y:w},{cameraState:r}),this.graphToViewport({x:v,y:w},{cameraState:r}),this.graphToViewport({x:m,y:x},{cameraState:r}),this.graphToViewport({x:v,y:x},{cameraState:r})],C=1/0,_=-1/0,T=1/0,N=-1/0;k.forEach(function(Y){var Z=Y.x,B=Y.y;C=Math.min(C,Z),_=Math.max(_,Z),T=Math.min(T,B),N=Math.max(N,B)});var D=_-C,L=N-T,R=this.getDimensions(),U=R.width,P=R.height,z=0,V=0;if(D>=U?_l&&(z=C-l):_>U+l?z=_-(U+l):C<-l&&(z=C+l),L>=P?Nl&&(V=T-l):N>P+l?V=N-(P+l):T<-l&&(V=T+l),z||V){var q=this.viewportToFramedGraph({x:0,y:0},{cameraState:r}),I=this.viewportToFramedGraph({x:z,y:V},{cameraState:r});z=I.x-q.x,V=I.y-q.y,f.x+=z,f.y+=V}return f}},{key:"renderLabels",value:function(){if(!this.settings.renderLabels)return this;var r=this.camera.getState(),i=this.labelGrid.getLabelsToDisplay(r.ratio,this.settings.labelDensity);lS(i,this.nodesWithForcedLabels),this.displayedNodeLabels=new Set;for(var o=this.canvasContexts.labels,l=0,u=i.length;lthis.width+QG||v<-50||v>this.height+JG)){this.displayedNodeLabels.add(f);var w=this.settings.defaultDrawNodeLabel,x=this.nodePrograms[d.type],k=(x==null?void 0:x.drawLabel)||w;k(o,Fe(Fe({key:f},d),{},{size:g,x:m,y:v}),this.settings)}}}return this}},{key:"renderEdgeLabels",value:function(){if(!this.settings.renderEdgeLabels)return this;var r=this.canvasContexts.edgeLabels;r.clearRect(0,0,this.width,this.height);var i=ZG({graph:this.graph,hoveredNode:this.hoveredNode,displayedNodeLabels:this.displayedNodeLabels,highlightedNodes:this.highlightedNodes});lS(i,this.edgesWithForcedLabels);for(var o=new Set,l=0,u=i.length;lthis.nodeZExtent[1]&&(this.nodeZExtent[1]=o.zIndex))}},{key:"updateNode",value:function(r){this.addNode(r);var i=this.nodeDataCache[r];this.normalizationFunction.applyTo(i)}},{key:"removeNode",value:function(r){delete this.nodeDataCache[r],delete this.nodeProgramIndex[r],this.highlightedNodes.delete(r),this.hoveredNode===r&&(this.hoveredNode=null),this.nodesWithForcedLabels.delete(r)}},{key:"addEdge",value:function(r){var i=Object.assign({},this.graph.getEdgeAttributes(r));this.settings.edgeReducer&&(i=this.settings.edgeReducer(r,i));var o=tU(this.settings,r,i);this.edgeDataCache[r]=o,this.edgesWithForcedLabels.delete(r),o.forceLabel&&!o.hidden&&this.edgesWithForcedLabels.add(r),this.settings.zIndex&&(o.zIndexthis.edgeZExtent[1]&&(this.edgeZExtent[1]=o.zIndex))}},{key:"updateEdge",value:function(r){this.addEdge(r)}},{key:"removeEdge",value:function(r){delete this.edgeDataCache[r],delete this.edgeProgramIndex[r],this.hoveredEdge===r&&(this.hoveredEdge=null),this.edgesWithForcedLabels.delete(r)}},{key:"clearNodeIndices",value:function(){this.labelGrid=new dS,this.nodeExtent={x:[0,1],y:[0,1]},this.nodeDataCache={},this.edgeProgramIndex={},this.nodesWithForcedLabels=new Set,this.nodeZExtent=[1/0,-1/0]}},{key:"clearEdgeIndices",value:function(){this.edgeDataCache={},this.edgeProgramIndex={},this.edgesWithForcedLabels=new Set,this.edgeZExtent=[1/0,-1/0]}},{key:"clearIndices",value:function(){this.clearEdgeIndices(),this.clearNodeIndices()}},{key:"clearNodeState",value:function(){this.displayedNodeLabels=new Set,this.highlightedNodes=new Set,this.hoveredNode=null}},{key:"clearEdgeState",value:function(){this.displayedEdgeLabels=new Set,this.highlightedNodes=new Set,this.hoveredEdge=null}},{key:"clearState",value:function(){this.clearEdgeState(),this.clearNodeState()}},{key:"addNodeToProgram",value:function(r,i,o){var l=this.nodeDataCache[r],u=this.nodePrograms[l.type];if(!u)throw new Error('Sigma: could not find a suitable program for node type "'.concat(l.type,'"!'));u.process(i,o,l),this.nodeProgramIndex[r]=o}},{key:"addEdgeToProgram",value:function(r,i,o){var l=this.edgeDataCache[r],u=this.edgePrograms[l.type];if(!u)throw new Error('Sigma: could not find a suitable program for edge type "'.concat(l.type,'"!'));var f=this.graph.extremities(r),d=this.nodeDataCache[f[0]],p=this.nodeDataCache[f[1]];u.process(i,o,d,p,l),this.edgeProgramIndex[r]=o}},{key:"getRenderParams",value:function(){return{matrix:this.matrix,invMatrix:this.invMatrix,width:this.width,height:this.height,pixelRatio:this.pixelRatio,zoomRatio:this.camera.ratio,cameraAngle:this.camera.angle,sizeRatio:1/this.scaleSize(),correctionRatio:this.correctionRatio,downSizingRatio:this.pickingDownSizingRatio,minEdgeThickness:this.settings.minEdgeThickness,antiAliasingFeather:this.settings.antiAliasingFeather}}},{key:"getStagePadding",value:function(){var r=this.settings,i=r.stagePadding,o=r.autoRescale;return o&&i||0}},{key:"createLayer",value:function(r,i){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.elements[r])throw new Error('Sigma: a layer named "'.concat(r,'" already exists'));var l=zG(i,{position:"absolute"},{class:"sigma-".concat(r)});return o.style&&Object.assign(l.style,o.style),this.elements[r]=l,"beforeLayer"in o&&o.beforeLayer?this.elements[o.beforeLayer].before(l):"afterLayer"in o&&o.afterLayer?this.elements[o.afterLayer].after(l):this.container.appendChild(l),l}},{key:"createCanvas",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.createLayer(r,"canvas",i)}},{key:"createCanvasContext",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.createCanvas(r,i),l={preserveDrawingBuffer:!1,antialias:!1};return this.canvasContexts[r]=o.getContext("2d",l),this}},{key:"createWebGLContext",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=(i==null?void 0:i.canvas)||this.createCanvas(r,i);i.hidden&&o.remove();var l=Fe({preserveDrawingBuffer:!1,antialias:!1},i),u;u=o.getContext("webgl2",l),u||(u=o.getContext("webgl",l)),u||(u=o.getContext("experimental-webgl",l));var f=u;if(this.webGLContexts[r]=f,f.blendFunc(f.ONE,f.ONE_MINUS_SRC_ALPHA),i.picking){this.pickingLayers.add(r);var d=f.createFramebuffer();if(!d)throw new Error("Sigma: cannot create a new frame buffer for layer ".concat(r));this.frameBuffers[r]=d}return f}},{key:"killLayer",value:function(r){var i=this.elements[r];if(!i)throw new Error("Sigma: cannot kill layer ".concat(r,", which does not exist"));if(this.webGLContexts[r]){var o,l=this.webGLContexts[r];(o=l.getExtension("WEBGL_lose_context"))===null||o===void 0||o.loseContext(),delete this.webGLContexts[r]}else this.canvasContexts[r]&&delete this.canvasContexts[r];return i.remove(),delete this.elements[r],this}},{key:"getCamera",value:function(){return this.camera}},{key:"setCamera",value:function(r){this.unbindCameraHandlers(),this.camera=r,this.bindCameraHandlers()}},{key:"getContainer",value:function(){return this.container}},{key:"getGraph",value:function(){return this.graph}},{key:"setGraph",value:function(r){r!==this.graph&&(this.hoveredNode&&!r.hasNode(this.hoveredNode)&&(this.hoveredNode=null),this.hoveredEdge&&!r.hasEdge(this.hoveredEdge)&&(this.hoveredEdge=null),this.unbindGraphHandlers(),this.checkEdgesEventsFrame!==null&&(cancelAnimationFrame(this.checkEdgesEventsFrame),this.checkEdgesEventsFrame=null),this.graph=r,this.bindGraphHandlers(),this.refresh())}},{key:"getMouseCaptor",value:function(){return this.mouseCaptor}},{key:"getTouchCaptor",value:function(){return this.touchCaptor}},{key:"getDimensions",value:function(){return{width:this.width,height:this.height}}},{key:"getGraphDimensions",value:function(){var r=this.customBBox||this.nodeExtent;return{width:r.x[1]-r.x[0]||1,height:r.y[1]-r.y[0]||1}}},{key:"getNodeDisplayData",value:function(r){var i=this.nodeDataCache[r];return i?Object.assign({},i):void 0}},{key:"getEdgeDisplayData",value:function(r){var i=this.edgeDataCache[r];return i?Object.assign({},i):void 0}},{key:"getNodeDisplayedLabels",value:function(){return new Set(this.displayedNodeLabels)}},{key:"getEdgeDisplayedLabels",value:function(){return new Set(this.displayedEdgeLabels)}},{key:"getSettings",value:function(){return Fe({},this.settings)}},{key:"getSetting",value:function(r){return this.settings[r]}},{key:"setSetting",value:function(r,i){var o=Fe({},this.settings);return this.settings[r]=i,pm(this.settings),this.handleSettingsUpdate(o),this.scheduleRefresh(),this}},{key:"updateSetting",value:function(r,i){return this.setSetting(r,i(this.settings[r])),this}},{key:"setSettings",value:function(r){var i=Fe({},this.settings);return this.settings=Fe(Fe({},this.settings),r),pm(this.settings),this.handleSettingsUpdate(i),this.scheduleRefresh(),this}},{key:"resize",value:function(r){var i=this.width,o=this.height;if(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.pixelRatio=aS(),this.width===0)if(this.settings.allowInvalidContainer)this.width=1;else throw new Error("Sigma: Container has no width. You can set the allowInvalidContainer setting to true to stop seeing this error.");if(this.height===0)if(this.settings.allowInvalidContainer)this.height=1;else throw new Error("Sigma: Container has no height. You can set the allowInvalidContainer setting to true to stop seeing this error.");if(!r&&i===this.width&&o===this.height)return this;for(var l in this.elements){var u=this.elements[l];u.style.width=this.width+"px",u.style.height=this.height+"px"}for(var f in this.canvasContexts)this.elements[f].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[f].setAttribute("height",this.height*this.pixelRatio+"px"),this.pixelRatio!==1&&this.canvasContexts[f].scale(this.pixelRatio,this.pixelRatio);for(var d in this.webGLContexts){this.elements[d].setAttribute("width",this.width*this.pixelRatio+"px"),this.elements[d].setAttribute("height",this.height*this.pixelRatio+"px");var p=this.webGLContexts[d];if(p.viewport(0,0,this.width*this.pixelRatio,this.height*this.pixelRatio),this.pickingLayers.has(d)){var m=this.textures[d];m&&p.deleteTexture(m)}}return this.emit("resize"),this}},{key:"clear",value:function(){return this.emit("beforeClear"),this.webGLContexts.nodes.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.nodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.edges.bindFramebuffer(WebGLRenderingContext.FRAMEBUFFER,null),this.webGLContexts.edges.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.webGLContexts.hoverNodes.clear(WebGLRenderingContext.COLOR_BUFFER_BIT),this.canvasContexts.labels.clearRect(0,0,this.width,this.height),this.canvasContexts.hovers.clearRect(0,0,this.width,this.height),this.canvasContexts.edgeLabels.clearRect(0,0,this.width,this.height),this.emit("afterClear"),this}},{key:"refresh",value:function(r){var i=this,o=(r==null?void 0:r.skipIndexation)!==void 0?r==null?void 0:r.skipIndexation:!1,l=(r==null?void 0:r.schedule)!==void 0?r.schedule:!1,u=!r||!r.partialGraph;if(u)this.clearEdgeIndices(),this.clearNodeIndices(),this.graph.forEachNode(function(N){return i.addNode(N)}),this.graph.forEachEdge(function(N){return i.addEdge(N)});else{for(var f,d,p=((f=r.partialGraph)===null||f===void 0?void 0:f.nodes)||[],m=0,v=(p==null?void 0:p.length)||0;m1&&arguments[1]!==void 0?arguments[1]:{},o=!!i.cameraState||!!i.viewportDimensions||!!i.graphDimensions,l=i.matrix?i.matrix:o?Dl(i.cameraState||this.camera.getState(),i.viewportDimensions||this.getDimensions(),i.graphDimensions||this.getGraphDimensions(),i.padding||this.getStagePadding()):this.matrix,u=$g(l,r);return{x:(1+u.x)*this.width/2,y:(1-u.y)*this.height/2}}},{key:"viewportToFramedGraph",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=!!i.cameraState||!!i.viewportDimensions||!i.graphDimensions,l=i.matrix?i.matrix:o?Dl(i.cameraState||this.camera.getState(),i.viewportDimensions||this.getDimensions(),i.graphDimensions||this.getGraphDimensions(),i.padding||this.getStagePadding(),!0):this.invMatrix,u=$g(l,{x:r.x/this.width*2-1,y:1-r.y/this.height*2});return isNaN(u.x)&&(u.x=0),isNaN(u.y)&&(u.y=0),u}},{key:"viewportToGraph",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.normalizationFunction.inverse(this.viewportToFramedGraph(r,i))}},{key:"graphToViewport",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.framedGraphToViewport(this.normalizationFunction(r),i)}},{key:"getGraphToViewportRatio",value:function(){var r={x:0,y:0},i={x:1,y:1},o=Math.sqrt(Math.pow(r.x-i.x,2)+Math.pow(r.y-i.y,2)),l=this.graphToViewport(r),u=this.graphToViewport(i),f=Math.sqrt(Math.pow(l.x-u.x,2)+Math.pow(l.y-u.y,2));return f/o}},{key:"getBBox",value:function(){return this.nodeExtent}},{key:"getCustomBBox",value:function(){return this.customBBox}},{key:"setCustomBBox",value:function(r){return this.customBBox=r,this.scheduleRender(),this}},{key:"kill",value:function(){this.emit("kill"),this.removeAllListeners(),this.unbindCameraHandlers(),window.removeEventListener("resize",this.activeListeners.handleResize),this.mouseCaptor.kill(),this.touchCaptor.kill(),this.unbindGraphHandlers(),this.clearIndices(),this.clearState(),this.nodeDataCache={},this.edgeDataCache={},this.highlightedNodes.clear(),this.renderFrame&&(cancelAnimationFrame(this.renderFrame),this.renderFrame=null),this.renderHighlightedNodesFrame&&(cancelAnimationFrame(this.renderHighlightedNodesFrame),this.renderHighlightedNodesFrame=null);for(var r=this.container;r.firstChild;)r.removeChild(r.firstChild);this.canvasContexts={},this.webGLContexts={},this.elements={};for(var i in this.nodePrograms)this.nodePrograms[i].kill();for(var o in this.nodeHoverPrograms)this.nodeHoverPrograms[o].kill();for(var l in this.edgePrograms)this.edgePrograms[l].kill();this.nodePrograms={},this.nodeHoverPrograms={},this.edgePrograms={};for(var u in this.elements)this.killLayer(u)}},{key:"scaleSize",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.camera.ratio;return r/this.settings.zoomToSizeRatioFunction(i)*(this.getSetting("itemSizesReference")==="positions"?i*this.graphToViewportRatio:1)}},{key:"getCanvases",value:function(){var r={};for(var i in this.elements)this.elements[i]instanceof HTMLCanvasElement&&(r[i]=this.elements[i]);return r}}])}(by);const yA=E.createContext(null),rU=yA.Provider;function wy(){const e=E.useContext(yA);if(e==null)throw new Error("No context provided: useSigmaContext() can only be used in a descendant of ");return e}function hr(){return wy().sigma}function bA(){const{sigma:e}=wy();return E.useCallback(t=>{e&&Object.keys(t).forEach(n=>{e.setSetting(n,t[n])})},[e])}function vd(e){return new Set(Object.keys(e))}const hS=vd({clickNode:!0,rightClickNode:!0,downNode:!0,enterNode:!0,leaveNode:!0,doubleClickNode:!0,wheelNode:!0,clickEdge:!0,rightClickEdge:!0,downEdge:!0,enterEdge:!0,leaveEdge:!0,doubleClickEdge:!0,wheelEdge:!0,clickStage:!0,rightClickStage:!0,downStage:!0,doubleClickStage:!0,wheelStage:!0,beforeRender:!0,afterRender:!0,kill:!0,upStage:!0,upEdge:!0,upNode:!0,enterStage:!0,leaveStage:!0,resize:!0,afterClear:!0,afterProcess:!0,beforeClear:!0,beforeProcess:!0,moveBody:!0}),pS=vd({click:!0,rightClick:!0,doubleClick:!0,mouseup:!0,mousedown:!0,mousemove:!0,mousemovebody:!0,mouseleave:!0,mouseenter:!0,wheel:!0}),mS=vd({touchup:!0,touchdown:!0,touchmove:!0,touchmovebody:!0,tap:!0,doubletap:!0}),gS=vd({updated:!0});function xA(){const e=hr(),t=bA(),[n,r]=E.useState({});return E.useEffect(()=>{if(!e||!n)return;const i=n,o=Object.keys(i);return o.forEach(l=>{const u=i[l];hS.has(l)&&e.on(l,u),pS.has(l)&&e.getMouseCaptor().on(l,u),mS.has(l)&&e.getTouchCaptor().on(l,u),gS.has(l)&&e.getCamera().on(l,u)}),()=>{e&&o.forEach(l=>{const u=i[l];hS.has(l)&&e.off(l,u),pS.has(l)&&e.getMouseCaptor().off(l,u),mS.has(l)&&e.getTouchCaptor().off(l,u),gS.has(l)&&e.getCamera().off(l,u)})}},[e,n,t]),r}function iU(){const e=hr();return E.useCallback((t,n=!0)=>{e&&t&&(n&&e.getGraph().order>0&&e.getGraph().clear(),e.getGraph().import(t),e.refresh())},[e])}function hu(e,t){if(e===t)return!0;if(typeof e=="object"&&e!=null&&typeof t=="object"&&t!=null){if(Object.keys(e).length!=Object.keys(t).length)return!1;for(const n in e)if(!Object.hasOwn(t,n)||!hu(e[n],t[n]))return!1;return!0}return!1}function wA(e){const t=hr(),[n,r]=E.useState(e||{});E.useEffect(()=>{r(d=>hu(d,e||{})?d:e||{})},[e]);const i=E.useCallback(d=>{t.getCamera().animatedZoom(Object.assign(Object.assign({},n),d))},[t,n]),o=E.useCallback(d=>{t.getCamera().animatedUnzoom(Object.assign(Object.assign({},n),d))},[t,n]),l=E.useCallback(d=>{t.getCamera().animatedReset(Object.assign(Object.assign({},n),d))},[t,n]),u=E.useCallback((d,p)=>{t.getCamera().animate(d,Object.assign(Object.assign({},n),p))},[t,n]),f=E.useCallback((d,p)=>{const m=t.getNodeDisplayData(d);m?t.getCamera().animate(m,Object.assign(Object.assign({},n),p)):console.warn(`Node ${d} not found`)},[t,n]);return{zoomIn:i,zoomOut:o,reset:l,goto:u,gotoNode:f}}function aU(e){const t=wy(),[n,r]=E.useState(!1),[i,o]=E.useState(t.container),l=E.useCallback(()=>r(u=>!u),[]);return E.useEffect(()=>(document.addEventListener("fullscreenchange",l),()=>document.removeEventListener("fullscreenchange",l)),[l]),E.useEffect(()=>{o(t.container)},[e,t.container]),{toggle:E.useCallback(()=>{var u;u=i,document.fullscreenElement!==u?u.requestFullscreen():document.exitFullscreen&&document.exitFullscreen()},[i]),isFullScreen:n}}const oU=E.forwardRef(({graph:e,id:t,className:n,style:r,settings:i={},children:o},l)=>{const u=E.useRef(null),f=E.useRef(null),d={className:`react-sigma ${n||""}`,id:t,style:r},[p,m]=E.useState(null),[v,g]=E.useState(i);E.useEffect(()=>{g(k=>hu(k,i)?k:i)},[i]),E.useEffect(()=>{m(k=>{let C=null;if(f.current!==null){let _=new St;e&&(_=typeof e=="function"?new e:e);let T=null;k&&(T=k.getCamera().getState(),k.kill()),C=new nU(_,f.current,v),T&&C.getCamera().setState(T)}return C})},[f,e,v]),E.useImperativeHandle(l,()=>p,[p]);const w=E.useMemo(()=>p&&u.current?{sigma:p,container:u.current}:null,[p,u]),x=w!==null?be.createElement(rU,{value:w},o):null;return be.createElement("div",Object.assign({},d,{ref:u}),be.createElement("div",{className:"sigma-container",ref:f}),x)});var sU=` precision mediump float; varying vec4 v_color; varying float v_border; const float radius = 0.5; const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0); void main(void) { vec2 m = gl_PointCoord - vec2(0.5, 0.5); float dist = radius - length(m); // No antialiasing for picking mode: #ifdef PICKING_MODE if (dist > v_border) gl_FragColor = v_color; else gl_FragColor = transparent; #else float t = 0.0; if (dist > v_border) t = 1.0; else if (dist > 0.0) t = dist / v_border; gl_FragColor = mix(transparent, v_color, t); #endif } `,lU=sU,uU=` attribute vec4 a_id; attribute vec4 a_color; attribute vec2 a_position; attribute float a_size; uniform float u_sizeRatio; uniform float u_pixelRatio; uniform mat3 u_matrix; varying vec4 v_color; varying float v_border; const float bias = 255.0 / 254.0; void main() { gl_Position = vec4( (u_matrix * vec3(a_position, 1)).xy, 0, 1 ); // Multiply the point size twice: // - x SCALING_RATIO to correct the canvas scaling // - x 2 to correct the formulae gl_PointSize = a_size / u_sizeRatio * u_pixelRatio * 2.0; v_border = (0.5 / a_size) * u_sizeRatio; #ifdef PICKING_MODE // For picking mode, we use the ID as the color: v_color = a_id; #else // For normal mode, we use the color: v_color = a_color; #endif v_color.a *= bias; } `,cU=uU,SA=WebGLRenderingContext,vS=SA.UNSIGNED_BYTE,yS=SA.FLOAT,fU=["u_sizeRatio","u_pixelRatio","u_matrix"],dU=function(e){function t(){return tn(this,t),Pn(this,t,arguments)}return Fn(t,e),nn(t,[{key:"getDefinition",value:function(){return{VERTICES:1,VERTEX_SHADER_SOURCE:cU,FRAGMENT_SHADER_SOURCE:lU,METHOD:WebGLRenderingContext.POINTS,UNIFORMS:fU,ATTRIBUTES:[{name:"a_position",size:2,type:yS},{name:"a_size",size:1,type:yS},{name:"a_color",size:4,type:vS,normalized:!0},{name:"a_id",size:4,type:vS,normalized:!0}]}}},{key:"processVisibleItem",value:function(r,i,o){var l=this.array;l[i++]=o.x,l[i++]=o.y,l[i++]=o.size,l[i++]=Yr(o.color),l[i++]=r}},{key:"setUniforms",value:function(r,i){var o=r.sizeRatio,l=r.pixelRatio,u=r.matrix,f=i.gl,d=i.uniformLocations,p=d.u_sizeRatio,m=d.u_pixelRatio,v=d.u_matrix;f.uniform1f(m,l),f.uniform1f(p,o),f.uniformMatrix3fv(v,!1,u)}}])}(vy),hU=` attribute vec4 a_id; attribute vec4 a_color; attribute vec2 a_normal; attribute float a_normalCoef; attribute vec2 a_positionStart; attribute vec2 a_positionEnd; attribute float a_positionCoef; attribute float a_sourceRadius; attribute float a_targetRadius; attribute float a_sourceRadiusCoef; attribute float a_targetRadiusCoef; uniform mat3 u_matrix; uniform float u_zoomRatio; uniform float u_sizeRatio; uniform float u_pixelRatio; uniform float u_correctionRatio; uniform float u_minEdgeThickness; uniform float u_lengthToThicknessRatio; uniform float u_feather; varying vec4 v_color; varying vec2 v_normal; varying float v_thickness; varying float v_feather; const float bias = 255.0 / 254.0; void main() { float minThickness = u_minEdgeThickness; vec2 normal = a_normal * a_normalCoef; vec2 position = a_positionStart * (1.0 - a_positionCoef) + a_positionEnd * a_positionCoef; float normalLength = length(normal); vec2 unitNormal = normal / normalLength; // These first computations are taken from edge.vert.glsl. Please read it to // get better comments on what's happening: float pixelsThickness = max(normalLength, minThickness * u_sizeRatio); float webGLThickness = pixelsThickness * u_correctionRatio / u_sizeRatio; // Here, we move the point to leave space for the arrow heads: // Source arrow head float sourceRadius = a_sourceRadius * a_sourceRadiusCoef; float sourceDirection = sign(sourceRadius); float webGLSourceRadius = sourceDirection * sourceRadius * 2.0 * u_correctionRatio / u_sizeRatio; float webGLSourceArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0; vec2 sourceCompensationVector = vec2(-sourceDirection * unitNormal.y, sourceDirection * unitNormal.x) * (webGLSourceRadius + webGLSourceArrowHeadLength); // Target arrow head float targetRadius = a_targetRadius * a_targetRadiusCoef; float targetDirection = sign(targetRadius); float webGLTargetRadius = targetDirection * targetRadius * 2.0 * u_correctionRatio / u_sizeRatio; float webGLTargetArrowHeadLength = webGLThickness * u_lengthToThicknessRatio * 2.0; vec2 targetCompensationVector = vec2(-targetDirection * unitNormal.y, targetDirection * unitNormal.x) * (webGLTargetRadius + webGLTargetArrowHeadLength); // Here is the proper position of the vertex gl_Position = vec4((u_matrix * vec3(position + unitNormal * webGLThickness + sourceCompensationVector + targetCompensationVector, 1)).xy, 0, 1); v_thickness = webGLThickness / u_zoomRatio; v_normal = unitNormal; v_feather = u_feather * u_correctionRatio / u_zoomRatio / u_pixelRatio * 2.0; #ifdef PICKING_MODE // For picking mode, we use the ID as the color: v_color = a_id; #else // For normal mode, we use the color: v_color = a_color; #endif v_color.a *= bias; } `,pU=hU,EA=WebGLRenderingContext,bS=EA.UNSIGNED_BYTE,gi=EA.FLOAT,mU=["u_matrix","u_zoomRatio","u_sizeRatio","u_correctionRatio","u_pixelRatio","u_feather","u_minEdgeThickness","u_lengthToThicknessRatio"],gU={lengthToThicknessRatio:du.lengthToThicknessRatio};function _A(e){var t=Fe(Fe({},gU),{});return function(n){function r(){return tn(this,r),Pn(this,r,arguments)}return Fn(r,n),nn(r,[{key:"getDefinition",value:function(){return{VERTICES:6,VERTEX_SHADER_SOURCE:pU,FRAGMENT_SHADER_SOURCE:yy,METHOD:WebGLRenderingContext.TRIANGLES,UNIFORMS:mU,ATTRIBUTES:[{name:"a_positionStart",size:2,type:gi},{name:"a_positionEnd",size:2,type:gi},{name:"a_normal",size:2,type:gi},{name:"a_color",size:4,type:bS,normalized:!0},{name:"a_id",size:4,type:bS,normalized:!0},{name:"a_sourceRadius",size:1,type:gi},{name:"a_targetRadius",size:1,type:gi}],CONSTANT_ATTRIBUTES:[{name:"a_positionCoef",size:1,type:gi},{name:"a_normalCoef",size:1,type:gi},{name:"a_sourceRadiusCoef",size:1,type:gi},{name:"a_targetRadiusCoef",size:1,type:gi}],CONSTANT_DATA:[[0,1,-1,0],[0,-1,1,0],[1,1,0,1],[1,1,0,1],[0,-1,1,0],[1,-1,0,-1]]}}},{key:"processVisibleItem",value:function(o,l,u,f,d){var p=d.size||1,m=u.x,v=u.y,g=f.x,w=f.y,x=Yr(d.color),k=g-m,C=w-v,_=u.size||1,T=f.size||1,N=k*k+C*C,D=0,L=0;N&&(N=1/Math.sqrt(N),D=-C*N*p,L=k*N*p);var R=this.array;R[l++]=m,R[l++]=v,R[l++]=g,R[l++]=w,R[l++]=D,R[l++]=L,R[l++]=x,R[l++]=o,R[l++]=_,R[l++]=T}},{key:"setUniforms",value:function(o,l){var u=l.gl,f=l.uniformLocations,d=f.u_matrix,p=f.u_zoomRatio,m=f.u_feather,v=f.u_pixelRatio,g=f.u_correctionRatio,w=f.u_sizeRatio,x=f.u_minEdgeThickness,k=f.u_lengthToThicknessRatio;u.uniformMatrix3fv(d,!1,o.matrix),u.uniform1f(p,o.zoomRatio),u.uniform1f(w,o.sizeRatio),u.uniform1f(g,o.correctionRatio),u.uniform1f(v,o.pixelRatio),u.uniform1f(m,o.antiAliasingFeather),u.uniform1f(x,o.minEdgeThickness),u.uniform1f(k,t.lengthToThicknessRatio)}}])}(cu)}_A();function vU(e){return oA([_A(),Tf(e),Tf(Fe(Fe({},e),{},{extremity:"source"}))])}vU();function yU(e){if(Array.isArray(e))return e}function bU(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,l,u=[],f=!0,d=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(f=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);f=!0);}catch(p){d=!0,i=p}finally{try{if(!f&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(d)throw i}}return u}}function Vg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n v_radius) gl_FragColor = transparent; else { gl_FragColor = v_color; gl_FragColor.a *= bias; } #else // Sizes: `).concat(t.flatMap(function(i,o){var l=i.size;if("fill"in l)return[];l=l;var u="attribute"in l?"v_borderSize_".concat(o+1):K1(l.value),f=(l.mode||OU)==="pixels"?"u_correctionRatio":"v_radius";return[" float borderSize_".concat(o+1," = ").concat(f," * ").concat(u,";")]}).join(` `),` // Now, let's split the remaining space between "fill" borders: float fillBorderSize = (v_radius - (`).concat(t.flatMap(function(i,o){var l=i.size;return"fill"in l?[]:["borderSize_".concat(o+1)]}).join(" + "),") ) / ").concat(n,`; `).concat(t.flatMap(function(i,o){var l=i.size;return"fill"in l?[" float borderSize_".concat(o+1," = fillBorderSize;")]:[]}).join(` `),` // Finally, normalize all border sizes, to start from the full size and to end with the smallest: float adjustedBorderSize_0 = v_radius; `).concat(t.map(function(i,o){return" float adjustedBorderSize_".concat(o+1," = adjustedBorderSize_").concat(o," - borderSize_").concat(o+1,";")}).join(` `),` // Colors: vec4 borderColor_0 = transparent; `).concat(t.map(function(i,o){var l=i.color,u=[];return"attribute"in l?u.push(" vec4 borderColor_".concat(o+1," = v_borderColor_").concat(o+1,";")):"transparent"in l?u.push(" vec4 borderColor_".concat(o+1," = vec4(0.0, 0.0, 0.0, 0.0);")):u.push(" vec4 borderColor_".concat(o+1," = u_borderColor_").concat(o+1,";")),u.push(" borderColor_".concat(o+1,".a *= bias;")),u.push(" if (borderSize_".concat(o+1," <= 1.0 * u_correctionRatio) { borderColor_").concat(o+1," = borderColor_").concat(o,"; }")),u.join(` `)}).join(` `),` if (dist > adjustedBorderSize_0) { gl_FragColor = borderColor_0; } else `).concat(t.map(function(i,o){return"if (dist > adjustedBorderSize_".concat(o,` - aaBorder) { gl_FragColor = mix(borderColor_`).concat(o+1,", borderColor_").concat(o,", (dist - adjustedBorderSize_").concat(o,` + aaBorder) / aaBorder); } else if (dist > adjustedBorderSize_`).concat(o+1,`) { gl_FragColor = borderColor_`).concat(o+1,`; } else `)}).join(""),` { /* Nothing to add here */ } #endif } `);return r}function MU(e){var t=e.borders,n=` attribute vec2 a_position; attribute float a_size; attribute float a_angle; uniform mat3 u_matrix; uniform float u_sizeRatio; uniform float u_correctionRatio; varying vec2 v_diffVector; varying float v_radius; #ifdef PICKING_MODE attribute vec4 a_id; varying vec4 v_color; #else `.concat(t.flatMap(function(r,i){var o=r.size;return"attribute"in o?["attribute float a_borderSize_".concat(i+1,";"),"varying float v_borderSize_".concat(i+1,";")]:[]}).join(` `),` `).concat(t.flatMap(function(r,i){var o=r.color;return"attribute"in o?["attribute vec4 a_borderColor_".concat(i+1,";"),"varying vec4 v_borderColor_".concat(i+1,";")]:[]}).join(` `),` #endif const float bias = 255.0 / 254.0; const vec4 transparent = vec4(0.0, 0.0, 0.0, 0.0); void main() { float size = a_size * u_correctionRatio / u_sizeRatio * 4.0; vec2 diffVector = size * vec2(cos(a_angle), sin(a_angle)); vec2 position = a_position + diffVector; gl_Position = vec4( (u_matrix * vec3(position, 1)).xy, 0, 1 ); v_radius = size / 2.0; v_diffVector = diffVector; #ifdef PICKING_MODE v_color = a_id; #else `).concat(t.flatMap(function(r,i){var o=r.size;return"attribute"in o?[" v_borderSize_".concat(i+1," = a_borderSize_").concat(i+1,";")]:[]}).join(` `),` `).concat(t.flatMap(function(r,i){var o=r.color;return"attribute"in o?[" v_borderColor_".concat(i+1," = a_borderColor_").concat(i+1,";")]:[]}).join(` `),` #endif } `);return n}var AA=WebGLRenderingContext,SS=AA.UNSIGNED_BYTE,$c=AA.FLOAT;function PU(e){var t,n=wS(wS({},jU),{}),r=n.borders,i=n.drawLabel,o=n.drawHover,l=["u_sizeRatio","u_correctionRatio","u_matrix"].concat(gm(r.flatMap(function(u,f){var d=u.color;return"value"in d?["u_borderColor_".concat(f+1)]:[]})));return t=function(u){AU(f,u);function f(){var d;SU(this,f);for(var p=arguments.length,m=new Array(p),v=0;ve.length)&&(t=e.length);for(var n=0,r=Array(t);nO){var X="…";for(x=x+X,M=o.measureText(x).width;M>O&&x.length>1;)x=x.slice(0,-2)+X,M=o.measureText(x).width;if(x.length<4)return}for(var re={},ue=0,ae=x.length;ue{const n=this.nodeIdMap[t];if(n!==void 0)return this.nodes[n]});mi(this,"getEdge",(t,n=!0)=>{const r=n?this.edgeDynamicIdMap[t]:this.edgeIdMap[t];if(r!==void 0)return this.edges[r]});mi(this,"buildDynamicMap",()=>{this.edgeDynamicIdMap={};for(let t=0;t({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null,moveToSelectedNode:!1,rawGraph:null,sigmaGraph:null,setSelectedNode:(t,n)=>e({selectedNode:t,moveToSelectedNode:n}),setFocusedNode:t=>e({focusedNode:t}),setSelectedEdge:t=>e({selectedEdge:t}),setFocusedEdge:t=>e({focusedEdge:t}),clearSelection:()=>e({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null}),reset:()=>e({selectedNode:null,focusedNode:null,selectedEdge:null,focusedEdge:null,rawGraph:null,sigmaGraph:null,moveToSelectedNode:!1}),setRawGraph:t=>e({rawGraph:t}),setSigmaGraph:t=>e({sigmaGraph:t}),setMoveToSelectedNode:t=>e({moveToSelectedNode:t})})),yt=Dv(iB),aB=({node:e,move:t})=>{const n=hr(),{gotoNode:r}=wA();return E.useEffect(()=>{if(e)return n.getGraph().setNodeAttribute(e,"highlighted",!0),t&&(r(e),yt.getState().setMoveToSelectedNode(!1)),()=>{n.getGraph().setNodeAttribute(e,"highlighted",!1)}},[e,t,n,r]),null};function ks(e,t){const n=hr(),r=E.useRef(t);return hu(r.current,t)||(r.current=t),{positions:E.useCallback(()=>r.current?e(n.getGraph(),r.current):{},[n,r,e]),assign:E.useCallback(()=>{r.current&&e.assign(n.getGraph(),r.current)},[n,r,e])}}function Ey(e,t){const n=hr(),[r,i]=E.useState(!1),[o,l]=E.useState(null),u=E.useRef(t);return hu(u.current,t)||(u.current=t),E.useEffect(()=>{i(!1);let f=null;return u.current&&(f=new e(n.getGraph(),u.current)),l(f),()=>{f!==null&&f.kill()}},[n,u,l,i,e]),{stop:E.useCallback(()=>{o&&(o.stop(),i(!1))},[o,i]),start:E.useCallback(()=>{o&&(o.start(),i(!0))},[o,i]),kill:E.useCallback(()=>{o&&o.kill(),i(!1)},[o,i]),isRunning:r}}var ym,kS;function pu(){if(kS)return ym;kS=1;function e(n){return!n||typeof n!="object"||typeof n=="function"||Array.isArray(n)||n instanceof Set||n instanceof Map||n instanceof RegExp||n instanceof Date}function t(n,r){n=n||{};var i={};for(var o in r){var l=n[o],u=r[o];if(!e(u)){i[o]=t(l,u);continue}l===void 0?i[o]=u:i[o]=l}return i}return ym=t,ym}var bm,CS;function oB(){if(CS)return bm;CS=1;function e(n){return function(r,i){return r+Math.floor(n()*(i-r+1))}}var t=e(Math.random);return t.createRandom=e,bm=t,bm}var xm,TS;function sB(){if(TS)return xm;TS=1;var e=oB().createRandom;function t(r){var i=e(r);return function(o){for(var l=o.length,u=l-1,f=-1;++f0},i.prototype.addChild=function(R,U){this.children[R]=U,++this.countChildren},i.prototype.getChild=function(R){if(!this.children.hasOwnProperty(R)){var U=new i;this.children[R]=U,++this.countChildren}return this.children[R]},i.prototype.applyPositionToChildren=function(){if(this.hasChildren()){var R=this;for(var U in R.children){var P=R.children[U];P.x+=R.x,P.y+=R.y,P.applyPositionToChildren()}}};function o(R,U,P){for(var z in U.children){var V=U.children[z];V.hasChildren()?o(R,V,P):P[V.id]={x:V.x,y:V.y}}}function l(R,U){var P=R.r-U.r,z=U.x-R.x,V=U.y-R.y;return P<0||P*P0&&P*P>z*z+V*V}function f(R,U){for(var P=0;PZ?(V=(B+Z-q)/(2*B),Y=Math.sqrt(Math.max(0,Z/B-V*V)),P.x=R.x-V*z-Y*I,P.y=R.y-V*I+Y*z):(V=(B+q-Z)/(2*B),Y=Math.sqrt(Math.max(0,q/B-V*V)),P.x=U.x+V*z-Y*I,P.y=U.y+V*I+Y*z)):(P.x=U.x+P.r,P.y=U.y)}function C(R,U){var P=R.r+U.r-1e-6,z=U.x-R.x,V=U.y-R.y;return P>0&&P*P>z*z+V*V}function _(R,U){var P=R.length;if(P===0)return 0;var z,V,q,I,Y,Z,B,G,F,K;if(z=R[0],z.x=0,z.y=0,P<=1)return z.r;if(V=R[1],z.x=-V.r,V.x=z.r,V.y=0,P<=2)return z.r+V.r;q=R[2],k(V,z,q),z=new i(null,null,null,null,z),V=new i(null,null,null,null,V),q=new i(null,null,null,null,q),z.next=q.previous=V,V.next=z.previous=q,q.next=V.previous=z;e:for(Z=3;Z"u"?i:d};typeof i=="function"&&(l=i);var u=function(d){return l(d[r])},f=function(){return l(void 0)};return typeof r=="string"?(o.fromAttributes=u,o.fromGraph=function(d,p){return u(d.getNodeAttributes(p))},o.fromEntry=function(d,p){return u(p)}):typeof r=="function"?(o.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},o.fromGraph=function(d,p){return l(r(p,d.getNodeAttributes(p)))},o.fromEntry=function(d,p){return l(r(d,p))}):(o.fromAttributes=f,o.fromGraph=f,o.fromEntry=f),o}function n(r,i){var o={},l=function(d){return typeof d>"u"?i:d};typeof i=="function"&&(l=i);var u=function(d){return l(d[r])},f=function(){return l(void 0)};return typeof r=="string"?(o.fromAttributes=u,o.fromGraph=function(d,p){return u(d.getEdgeAttributes(p))},o.fromEntry=function(d,p){return u(p)},o.fromPartialEntry=o.fromEntry,o.fromMinimalEntry=o.fromEntry):typeof r=="function"?(o.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},o.fromGraph=function(d,p){var m=d.extremities(p);return l(r(p,d.getEdgeAttributes(p),m[0],m[1],d.getNodeAttributes(m[0]),d.getNodeAttributes(m[1]),d.isUndirected(p)))},o.fromEntry=function(d,p,m,v,g,w,x){return l(r(d,p,m,v,g,w,x))},o.fromPartialEntry=function(d,p,m,v){return l(r(d,p,m,v))},o.fromMinimalEntry=function(d,p){return l(r(d,p))}):(o.fromAttributes=f,o.fromGraph=f,o.fromEntry=f,o.fromMinimalEntry=f),o}return jl.createNodeValueGetter=t,jl.createEdgeValueGetter=n,jl.createEdgeWeightGetter=function(r){return n(r,e)},jl}var Em,NS;function MA(){if(NS)return Em;NS=1;const{createNodeValueGetter:e,createEdgeValueGetter:t}=_y();return Em=function(r,i,o){const{nodeXAttribute:l,nodeYAttribute:u}=o,{attraction:f,repulsion:d,gravity:p,inertia:m,maxMove:v}=o.settings;let{shouldSkipNode:g,shouldSkipEdge:w,isNodeFixed:x}=o;x=e(x),g=e(g,!1),w=t(w,!1);const k=r.filterNodes((T,N)=>!g.fromEntry(T,N)),C=k.length;for(let T=0;T{if(D===L||g.fromEntry(D,R)||g.fromEntry(L,U)||w.fromEntry(T,N,D,L,R,U,P))return;const z=i[D],V=i[L],q=V.x-z.x,I=V.y-z.y,Y=Math.sqrt(q*q+I*I)||1,Z=f*Y*q,B=f*Y*I;z.dx+=Z,z.dy+=B,V.dx-=Z,V.dy-=B}),p)for(let T=0;Tv&&(D.dx*=v/L,D.dy*=v/L),x.fromGraph(r,N)?D.fixed=!0:(D.x+=D.dx,D.y+=D.dy,D.fixed=!1)}return{converged:_}},Em}var Hc={},OS;function PA(){return OS||(OS=1,Hc.assignLayoutChanges=function(e,t,n){const{nodeXAttribute:r,nodeYAttribute:i}=n;e.updateEachNodeAttributes((o,l)=>{const u=t[o];return!u||u.fixed||(l[r]=u.x,l[i]=u.y),l},{attributes:["x","y"]})},Hc.collectLayoutChanges=function(e){const t={};for(const n in e){const r=e[n];t[n]={x:r.x,y:r.y}}return t}),Hc}var _m,jS;function FA(){return jS||(jS=1,_m={nodeXAttribute:"x",nodeYAttribute:"y",isNodeFixed:"fixed",shouldSkipNode:null,shouldSkipEdge:null,settings:{attraction:5e-4,repulsion:.1,gravity:1e-4,inertia:.6,maxMove:200}}),_m}var km,LS;function gB(){if(LS)return km;LS=1;const e=Wr(),t=pu(),n=MA(),r=PA(),i=FA();function o(u,f,d){if(!e(f))throw new Error("graphology-layout-force: the given graph is not a valid graphology instance.");typeof d=="number"?d={maxIterations:d}:d=d||{};const p=d.maxIterations;if(d=t(d,i),typeof p!="number"||p<=0)throw new Error("graphology-layout-force: you should provide a positive number of maximum iterations.");const m={};let v=null,g;for(g=0;gthis.runFrame())},o.prototype.stop=function(){return this.running=!1,this.frameID!==null&&(window.cancelAnimationFrame(this.frameID),this.frameID=null),this},o.prototype.start=function(){if(this.killed)throw new Error("graphology-layout-force/worker.start: layout was killed.");this.running||(this.running=!0,this.runFrame())},o.prototype.kill=function(){this.stop(),delete this.nodeStates,this.killed=!0},Cm=o,Cm}var xB=bB();const wB=fn(xB);function SB(e={maxIterations:100}){return ks(yB,e)}function EB(e={}){return Ey(wB,e)}var Tm,MS;function _B(){if(MS)return Tm;MS=1;var e=0,t=1,n=2,r=3,i=4,o=5,l=6,u=7,f=8,d=9,p=0,m=1,v=2,g=0,w=1,x=2,k=3,C=4,_=5,T=6,N=7,D=8,L=3,R=10,U=3,P=9,z=10;return Tm=function(q,I,Y){var Z,B,G,F,K,A,H,M,O,X,re=I.length,ue=Y.length,ae=q.adjustSizes,oe=q.barnesHutTheta*q.barnesHutTheta,Ce,he,Ee,we,Pe,Ae,xe,ee=[];for(G=0;GNe?(ge-=(ve-Ne)/2,Se=ge+ve):(ce-=(Ne-ve)/2,Te=ce+Ne),ee[0+g]=-1,ee[0+w]=(ce+Te)/2,ee[0+x]=(ge+Se)/2,ee[0+k]=Math.max(Te-ce,Se-ge),ee[0+C]=-1,ee[0+_]=-1,ee[0+T]=0,ee[0+N]=0,ee[0+D]=0,Z=1,G=0;G=0){I[G+e]=0)if(Ae=Math.pow(I[G+e]-ee[B+N],2)+Math.pow(I[G+t]-ee[B+D],2),X=ee[B+k],4*X*X/Ae0?(xe=he*I[G+l]*ee[B+T]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae<0&&(xe=-he*I[G+l]*ee[B+T]/Math.sqrt(Ae),I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae>0&&(xe=he*I[G+l]*ee[B+T]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe),B=ee[B+C],B<0)break;continue}else{B=ee[B+_];continue}else{if(A=ee[B+g],A>=0&&A!==G&&(Ee=I[G+e]-I[A+e],we=I[G+t]-I[A+t],Ae=Ee*Ee+we*we,ae===!0?Ae>0?(xe=he*I[G+l]*I[A+l]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae<0&&(xe=-he*I[G+l]*I[A+l]/Math.sqrt(Ae),I[G+n]+=Ee*xe,I[G+r]+=we*xe):Ae>0&&(xe=he*I[G+l]*I[A+l]/Ae,I[G+n]+=Ee*xe,I[G+r]+=we*xe)),B=ee[B+C],B<0)break;continue}else for(he=q.scalingRatio,F=0;F0?(xe=he*I[F+l]*I[K+l]/Ae/Ae,I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe):Ae<0&&(xe=100*he*I[F+l]*I[K+l],I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe)):(Ae=Math.sqrt(Ee*Ee+we*we),Ae>0&&(xe=he*I[F+l]*I[K+l]/Ae/Ae,I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe));for(O=q.gravity/q.scalingRatio,he=q.scalingRatio,G=0;G0&&(xe=he*I[G+l]*O):Ae>0&&(xe=he*I[G+l]*O/Ae),I[G+n]-=Ee*xe,I[G+r]-=we*xe;for(he=1*(q.outboundAttractionDistribution?Ce:1),H=0;H0&&(xe=-he*Pe*Math.log(1+Ae)/Ae/I[F+l]):Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae):q.outboundAttractionDistribution?Ae>0&&(xe=-he*Pe/I[F+l]):Ae>0&&(xe=-he*Pe)):(Ae=Math.sqrt(Math.pow(Ee,2)+Math.pow(we,2)),q.linLogMode?q.outboundAttractionDistribution?Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae/I[F+l]):Ae>0&&(xe=-he*Pe*Math.log(1+Ae)/Ae):q.outboundAttractionDistribution?(Ae=1,xe=-he*Pe/I[F+l]):(Ae=1,xe=-he*Pe)),Ae>0&&(I[F+n]+=Ee*xe,I[F+r]+=we*xe,I[K+n]-=Ee*xe,I[K+r]-=we*xe);var te,de,Oe,He,Ye,vt;if(ae===!0)for(G=0;Gz&&(I[G+n]=I[G+n]*z/te,I[G+r]=I[G+r]*z/te),de=I[G+l]*Math.sqrt((I[G+i]-I[G+n])*(I[G+i]-I[G+n])+(I[G+o]-I[G+r])*(I[G+o]-I[G+r])),Oe=Math.sqrt((I[G+i]+I[G+n])*(I[G+i]+I[G+n])+(I[G+o]+I[G+r])*(I[G+o]+I[G+r]))/2,He=.1*Math.log(1+Oe)/(1+Math.sqrt(de)),Ye=I[G+e]+I[G+n]*(He/q.slowDown),I[G+e]=Ye,vt=I[G+t]+I[G+r]*(He/q.slowDown),I[G+t]=vt);else for(G=0;G=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in n&&typeof n.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in n&&!(typeof n.gravity=="number"&&n.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in n&&!(typeof n.slowDown=="number"||n.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in n&&typeof n.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in n&&!(typeof n.barnesHutTheta=="number"&&n.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},vi.graphToByteArrays=function(n,r){var i=n.order,o=n.size,l={},u,f=new Float32Array(i*e),d=new Float32Array(o*t);return u=0,n.forEachNode(function(p,m){l[p]=u,f[u]=m.x,f[u+1]=m.y,f[u+2]=0,f[u+3]=0,f[u+4]=0,f[u+5]=0,f[u+6]=1,f[u+7]=1,f[u+8]=m.size||1,f[u+9]=m.fixed?1:0,u+=e}),u=0,n.forEachEdge(function(p,m,v,g,w,x,k){var C=l[v],_=l[g],T=r(p,m,v,g,w,x,k);f[C+6]+=T,f[_+6]+=T,d[u]=C,d[u+1]=_,d[u+2]=T,u+=t}),{nodes:f,edges:d}},vi.assignLayoutChanges=function(n,r,i){var o=0;n.updateEachNodeAttributes(function(l,u){return u.x=r[o],u.y=r[o+1],o+=e,i?i(l,u):u})},vi.readGraphPositions=function(n,r){var i=0;n.forEachNode(function(o,l){r[i]=l.x,r[i+1]=l.y,i+=e})},vi.collectLayoutChanges=function(n,r,i){for(var o=n.nodes(),l={},u=0,f=0,d=r.length;u2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(d)}}var u=o.bind(null,!1);return u.assign=o.bind(null,!0),u.inferSettings=l,Rm=u,Rm}var CB=kB();const TB=fn(CB);var Dm,GS;function AB(){return GS||(GS=1,Dm=function(){var t,n,r={};(function(){var o=0,l=1,u=2,f=3,d=4,p=5,m=6,v=7,g=8,w=9,x=0,k=1,C=2,_=0,T=1,N=2,D=3,L=4,R=5,U=6,P=7,z=8,V=3,q=10,I=3,Y=9,Z=10;r.exports=function(G,F,K){var A,H,M,O,X,re,ue,ae,oe,Ce,he=F.length,Ee=K.length,we=G.adjustSizes,Pe=G.barnesHutTheta*G.barnesHutTheta,Ae,xe,ee,ce,Te,ge,Se,ie=[];for(M=0;MYe?(ve-=(He-Ye)/2,Ne=ve+He):($e-=(Ye-He)/2,Ge=$e+Ye),ie[0+_]=-1,ie[0+T]=($e+Ge)/2,ie[0+N]=(ve+Ne)/2,ie[0+D]=Math.max(Ge-$e,Ne-ve),ie[0+L]=-1,ie[0+R]=-1,ie[0+U]=0,ie[0+P]=0,ie[0+z]=0,A=1,M=0;M=0){F[M+o]=0)if(ge=Math.pow(F[M+o]-ie[H+P],2)+Math.pow(F[M+l]-ie[H+z],2),Ce=ie[H+D],4*Ce*Ce/ge0?(Se=xe*F[M+m]*ie[H+U]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge<0&&(Se=-xe*F[M+m]*ie[H+U]/Math.sqrt(ge),F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge>0&&(Se=xe*F[M+m]*ie[H+U]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se),H=ie[H+L],H<0)break;continue}else{H=ie[H+R];continue}else{if(re=ie[H+_],re>=0&&re!==M&&(ee=F[M+o]-F[re+o],ce=F[M+l]-F[re+l],ge=ee*ee+ce*ce,we===!0?ge>0?(Se=xe*F[M+m]*F[re+m]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge<0&&(Se=-xe*F[M+m]*F[re+m]/Math.sqrt(ge),F[M+u]+=ee*Se,F[M+f]+=ce*Se):ge>0&&(Se=xe*F[M+m]*F[re+m]/ge,F[M+u]+=ee*Se,F[M+f]+=ce*Se)),H=ie[H+L],H<0)break;continue}else for(xe=G.scalingRatio,O=0;O0?(Se=xe*F[O+m]*F[X+m]/ge/ge,F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se):ge<0&&(Se=100*xe*F[O+m]*F[X+m],F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se)):(ge=Math.sqrt(ee*ee+ce*ce),ge>0&&(Se=xe*F[O+m]*F[X+m]/ge/ge,F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se));for(oe=G.gravity/G.scalingRatio,xe=G.scalingRatio,M=0;M0&&(Se=xe*F[M+m]*oe):ge>0&&(Se=xe*F[M+m]*oe/ge),F[M+u]-=ee*Se,F[M+f]-=ce*Se;for(xe=1*(G.outboundAttractionDistribution?Ae:1),ue=0;ue0&&(Se=-xe*Te*Math.log(1+ge)/ge/F[O+m]):ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge):G.outboundAttractionDistribution?ge>0&&(Se=-xe*Te/F[O+m]):ge>0&&(Se=-xe*Te)):(ge=Math.sqrt(Math.pow(ee,2)+Math.pow(ce,2)),G.linLogMode?G.outboundAttractionDistribution?ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge/F[O+m]):ge>0&&(Se=-xe*Te*Math.log(1+ge)/ge):G.outboundAttractionDistribution?(ge=1,Se=-xe*Te/F[O+m]):(ge=1,Se=-xe*Te)),ge>0&&(F[O+u]+=ee*Se,F[O+f]+=ce*Se,F[X+u]-=ee*Se,F[X+f]-=ce*Se);var vt,Mt,bt,rt,qt,at;if(we===!0)for(M=0;MZ&&(F[M+u]=F[M+u]*Z/vt,F[M+f]=F[M+f]*Z/vt),Mt=F[M+m]*Math.sqrt((F[M+d]-F[M+u])*(F[M+d]-F[M+u])+(F[M+p]-F[M+f])*(F[M+p]-F[M+f])),bt=Math.sqrt((F[M+d]+F[M+u])*(F[M+d]+F[M+u])+(F[M+p]+F[M+f])*(F[M+p]+F[M+f]))/2,rt=.1*Math.log(1+bt)/(1+Math.sqrt(Mt)),qt=F[M+o]+F[M+u]*(rt/G.slowDown),F[M+o]=qt,at=F[M+l]+F[M+f]*(rt/G.slowDown),F[M+l]=at);else for(M=0;M1&&Ee.has(Se))&&(F>1&&Ee.add(Se),xe=f[Pe+e],ce=f[Pe+t],ge=f[Pe+n],ie=xe-Ae,$e=ce-ee,Ge=Math.sqrt(ie*ie+$e*$e),ve=Ge0?(R[Pe]+=ie/Ge*(1+Te),U[Pe]+=$e/Ge*(1+Te)):(R[Pe]+=I*o(),U[Pe]+=Y*o())));for(w=0,x=0;w1&&xe.has(ve))&&(M>1&&xe.add(ve),ge=v[ce+i],ie=v[ce+o],Ge=v[ce+l],Ne=ge-Te,te=ie-Se,de=Math.sqrt(Ne*Ne+te*te),Oe=de<$e*w+g+(Ge*w+g),Oe&&(U=!1,ce=ce/u|0,de>0?(V[ce]+=Ne/de*(1+$e),q[ce]+=te/de*(1+$e)):(V[ce]+=G*d(),q[ce]+=F*d())));for(_=0,T=0;_=0;)m=Kg(e,t,n,r,d+1,o+1,l),m>p&&(d===i?m*=XS:QB.test(e.charAt(d-1))?(m*=WB,g=e.slice(i,d-1).match(JB),g&&i>0&&(m*=Math.pow(Im,g.length))):e6.test(e.charAt(d-1))?(m*=YB,w=e.slice(i,d-1).match(HA),w&&i>0&&(m*=Math.pow(Im,w.length))):(m*=XB,i>0&&(m*=Math.pow(Im,d-i))),e.charAt(d)!==t.charAt(o)&&(m*=KB)),(mm&&(m=v*Fm)),m>p&&(p=m),d=n.indexOf(f,d+1);return l[u]=p,p}function KS(e){return e.toLowerCase().replace(HA," ")}function t6(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Kg(e,t,KS(e),KS(t),0,0,{})}var Gm={exports:{}},Um={};/** * @license React * use-sync-external-store-shim.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ZS;function n6(){if(ZS)return Um;ZS=1;var e=Vf();function t(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function u(m,v){var g=v(),w=r({inst:{value:g,getSnapshot:v}}),x=w[0].inst,k=w[1];return o(function(){x.value=g,x.getSnapshot=v,f(x)&&k({inst:x})},[m,g,v]),i(function(){return f(x)&&k({inst:x}),m(function(){f(x)&&k({inst:x})})},[m]),l(g),g}function f(m){var v=m.getSnapshot;m=m.value;try{var g=v();return!n(m,g)}catch{return!0}}function d(m,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:u;return Um.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Um}var QS;function r6(){return QS||(QS=1,Gm.exports=n6()),Gm.exports}var i6=r6(),Ll='[cmdk-group=""]',Bm='[cmdk-group-items=""]',a6='[cmdk-group-heading=""]',ky='[cmdk-item=""]',JS=`${ky}:not([aria-disabled="true"])`,Zg="cmdk-item-select",$a="data-value",o6=(e,t,n)=>t6(e,t,n),VA=E.createContext(void 0),mu=()=>E.useContext(VA),qA=E.createContext(void 0),Cy=()=>E.useContext(qA),YA=E.createContext(void 0),WA=E.forwardRef((e,t)=>{let n=Qo(()=>{var M,O;return{search:"",value:(O=(M=e.value)!=null?M:e.defaultValue)!=null?O:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=Qo(()=>new Set),i=Qo(()=>new Map),o=Qo(()=>new Map),l=Qo(()=>new Set),u=XA(e),{label:f,children:d,value:p,onValueChange:m,filter:v,shouldFilter:g,loop:w,disablePointerSelection:x=!1,vimBindings:k=!0,...C}=e,_=bn(),T=bn(),N=bn(),D=E.useRef(null),L=v6();Qa(()=>{if(p!==void 0){let M=p.trim();n.current.value=M,R.emit()}},[p]),Qa(()=>{L(6,I)},[]);let R=E.useMemo(()=>({subscribe:M=>(l.current.add(M),()=>l.current.delete(M)),snapshot:()=>n.current,setState:(M,O,X)=>{var re,ue,ae;if(!Object.is(n.current[M],O)){if(n.current[M]=O,M==="search")q(),z(),L(1,V);else if(M==="value"&&(X||L(5,I),((re=u.current)==null?void 0:re.value)!==void 0)){let oe=O??"";(ae=(ue=u.current).onValueChange)==null||ae.call(ue,oe);return}R.emit()}},emit:()=>{l.current.forEach(M=>M())}}),[]),U=E.useMemo(()=>({value:(M,O,X)=>{var re;O!==((re=o.current.get(M))==null?void 0:re.value)&&(o.current.set(M,{value:O,keywords:X}),n.current.filtered.items.set(M,P(O,X)),L(2,()=>{z(),R.emit()}))},item:(M,O)=>(r.current.add(M),O&&(i.current.has(O)?i.current.get(O).add(M):i.current.set(O,new Set([M]))),L(3,()=>{q(),z(),n.current.value||V(),R.emit()}),()=>{o.current.delete(M),r.current.delete(M),n.current.filtered.items.delete(M);let X=Y();L(4,()=>{q(),(X==null?void 0:X.getAttribute("id"))===M&&V(),R.emit()})}),group:M=>(i.current.has(M)||i.current.set(M,new Set),()=>{o.current.delete(M),i.current.delete(M)}),filter:()=>u.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:_,inputId:N,labelId:T,listInnerRef:D}),[]);function P(M,O){var X,re;let ue=(re=(X=u.current)==null?void 0:X.filter)!=null?re:o6;return M?ue(M,n.current.search,O):0}function z(){if(!n.current.search||u.current.shouldFilter===!1)return;let M=n.current.filtered.items,O=[];n.current.filtered.groups.forEach(re=>{let ue=i.current.get(re),ae=0;ue.forEach(oe=>{let Ce=M.get(oe);ae=Math.max(Ce,ae)}),O.push([re,ae])});let X=D.current;Z().sort((re,ue)=>{var ae,oe;let Ce=re.getAttribute("id"),he=ue.getAttribute("id");return((ae=M.get(he))!=null?ae:0)-((oe=M.get(Ce))!=null?oe:0)}).forEach(re=>{let ue=re.closest(Bm);ue?ue.appendChild(re.parentElement===ue?re:re.closest(`${Bm} > *`)):X.appendChild(re.parentElement===X?re:re.closest(`${Bm} > *`))}),O.sort((re,ue)=>ue[1]-re[1]).forEach(re=>{var ue;let ae=(ue=D.current)==null?void 0:ue.querySelector(`${Ll}[${$a}="${encodeURIComponent(re[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function V(){let M=Z().find(X=>X.getAttribute("aria-disabled")!=="true"),O=M==null?void 0:M.getAttribute($a);R.setState("value",O||void 0)}function q(){var M,O,X,re;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ue=0;for(let ae of r.current){let oe=(O=(M=o.current.get(ae))==null?void 0:M.value)!=null?O:"",Ce=(re=(X=o.current.get(ae))==null?void 0:X.keywords)!=null?re:[],he=P(oe,Ce);n.current.filtered.items.set(ae,he),he>0&&ue++}for(let[ae,oe]of i.current)for(let Ce of oe)if(n.current.filtered.items.get(Ce)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=ue}function I(){var M,O,X;let re=Y();re&&(((M=re.parentElement)==null?void 0:M.firstChild)===re&&((X=(O=re.closest(Ll))==null?void 0:O.querySelector(a6))==null||X.scrollIntoView({block:"nearest"})),re.scrollIntoView({block:"nearest"}))}function Y(){var M;return(M=D.current)==null?void 0:M.querySelector(`${ky}[aria-selected="true"]`)}function Z(){var M;return Array.from(((M=D.current)==null?void 0:M.querySelectorAll(JS))||[])}function B(M){let O=Z()[M];O&&R.setState("value",O.getAttribute($a))}function G(M){var O;let X=Y(),re=Z(),ue=re.findIndex(oe=>oe===X),ae=re[ue+M];(O=u.current)!=null&&O.loop&&(ae=ue+M<0?re[re.length-1]:ue+M===re.length?re[0]:re[ue+M]),ae&&R.setState("value",ae.getAttribute($a))}function F(M){let O=Y(),X=O==null?void 0:O.closest(Ll),re;for(;X&&!re;)X=M>0?m6(X,Ll):g6(X,Ll),re=X==null?void 0:X.querySelector(JS);re?R.setState("value",re.getAttribute($a)):G(M)}let K=()=>B(Z().length-1),A=M=>{M.preventDefault(),M.metaKey?K():M.altKey?F(1):G(1)},H=M=>{M.preventDefault(),M.metaKey?B(0):M.altKey?F(-1):G(-1)};return E.createElement(We.div,{ref:t,tabIndex:-1,...C,"cmdk-root":"",onKeyDown:M=>{var O;if((O=C.onKeyDown)==null||O.call(C,M),!M.defaultPrevented)switch(M.key){case"n":case"j":{k&&M.ctrlKey&&A(M);break}case"ArrowDown":{A(M);break}case"p":case"k":{k&&M.ctrlKey&&H(M);break}case"ArrowUp":{H(M);break}case"Home":{M.preventDefault(),B(0);break}case"End":{M.preventDefault(),K();break}case"Enter":if(!M.nativeEvent.isComposing&&M.keyCode!==229){M.preventDefault();let X=Y();if(X){let re=new Event(Zg);X.dispatchEvent(re)}}}}},E.createElement("label",{"cmdk-label":"",htmlFor:U.inputId,id:U.labelId,style:b6},f),yd(e,M=>E.createElement(qA.Provider,{value:R},E.createElement(VA.Provider,{value:U},M))))}),s6=E.forwardRef((e,t)=>{var n,r;let i=bn(),o=E.useRef(null),l=E.useContext(YA),u=mu(),f=XA(e),d=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:l==null?void 0:l.forceMount;Qa(()=>{if(!d)return u.item(i,l==null?void 0:l.id)},[d]);let p=KA(i,o,[e.value,e.children,o],e.keywords),m=Cy(),v=Ja(L=>L.value&&L.value===p.current),g=Ja(L=>d||u.filter()===!1?!0:L.search?L.filtered.items.get(i)>0:!0);E.useEffect(()=>{let L=o.current;if(!(!L||e.disabled))return L.addEventListener(Zg,w),()=>L.removeEventListener(Zg,w)},[g,e.onSelect,e.disabled]);function w(){var L,R;x(),(R=(L=f.current).onSelect)==null||R.call(L,p.current)}function x(){m.setState("value",p.current,!0)}if(!g)return null;let{disabled:k,value:C,onSelect:_,forceMount:T,keywords:N,...D}=e;return E.createElement(We.div,{ref:Xl([o,t]),...D,id:i,"cmdk-item":"",role:"option","aria-disabled":!!k,"aria-selected":!!v,"data-disabled":!!k,"data-selected":!!v,onPointerMove:k||u.getDisablePointerSelection()?void 0:x,onClick:k?void 0:w},e.children)}),l6=E.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...o}=e,l=bn(),u=E.useRef(null),f=E.useRef(null),d=bn(),p=mu(),m=Ja(g=>i||p.filter()===!1?!0:g.search?g.filtered.groups.has(l):!0);Qa(()=>p.group(l),[]),KA(l,u,[e.value,e.heading,f]);let v=E.useMemo(()=>({id:l,forceMount:i}),[i]);return E.createElement(We.div,{ref:Xl([u,t]),...o,"cmdk-group":"",role:"presentation",hidden:m?void 0:!0},n&&E.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),yd(e,g=>E.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},E.createElement(YA.Provider,{value:v},g))))}),u6=E.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=E.useRef(null),o=Ja(l=>!l.search);return!n&&!o?null:E.createElement(We.div,{ref:Xl([i,t]),...r,"cmdk-separator":"",role:"separator"})}),c6=E.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,o=Cy(),l=Ja(p=>p.search),u=Ja(p=>p.value),f=mu(),d=E.useMemo(()=>{var p;let m=(p=f.listInnerRef.current)==null?void 0:p.querySelector(`${ky}[${$a}="${encodeURIComponent(u)}"]`);return m==null?void 0:m.getAttribute("id")},[]);return E.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),E.createElement(We.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":d,id:f.inputId,type:"text",value:i?e.value:l,onChange:p=>{i||o.setState("search",p.target.value),n==null||n(p.target.value)}})}),f6=E.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,o=E.useRef(null),l=E.useRef(null),u=mu();return E.useEffect(()=>{if(l.current&&o.current){let f=l.current,d=o.current,p,m=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let v=f.offsetHeight;d.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return m.observe(f),()=>{cancelAnimationFrame(p),m.unobserve(f)}}},[]),E.createElement(We.div,{ref:Xl([o,t]),...i,"cmdk-list":"",role:"listbox","aria-label":r,id:u.listId},yd(e,f=>E.createElement("div",{ref:Xl([l,u.listInnerRef]),"cmdk-list-sizer":""},f)))}),d6=E.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:l,...u}=e;return E.createElement($v,{open:n,onOpenChange:r},E.createElement(Hv,{container:l},E.createElement(nd,{"cmdk-overlay":"",className:i}),E.createElement(rd,{"aria-label":e.label,"cmdk-dialog":"",className:o},E.createElement(WA,{ref:t,...u}))))}),h6=E.forwardRef((e,t)=>Ja(n=>n.filtered.count===0)?E.createElement(We.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),p6=E.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...o}=e;return E.createElement(We.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},yd(e,l=>E.createElement("div",{"aria-hidden":!0},l)))}),In=Object.assign(WA,{List:f6,Item:s6,Input:c6,Group:l6,Separator:u6,Dialog:d6,Empty:h6,Loading:p6});function m6(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function g6(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function XA(e){let t=E.useRef(e);return Qa(()=>{t.current=e}),t}var Qa=typeof window>"u"?E.useEffect:E.useLayoutEffect;function Qo(e){let t=E.useRef();return t.current===void 0&&(t.current=e()),t}function Xl(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Ja(e){let t=Cy(),n=()=>e(t.snapshot());return i6.useSyncExternalStore(t.subscribe,n,n)}function KA(e,t,n,r=[]){let i=E.useRef(),o=mu();return Qa(()=>{var l;let u=(()=>{var d;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(d=p.current.textContent)==null?void 0:d.trim():i.current}})(),f=r.map(d=>d.trim());o.value(e,u,f),(l=t.current)==null||l.setAttribute($a,u),i.current=u}),i}var v6=()=>{let[e,t]=E.useState(),n=Qo(()=>new Map);return Qa(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function y6(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function yd({asChild:e,children:t},n){return e&&E.isValidElement(t)?E.cloneElement(y6(t),{ref:t.ref},n(t.props.children)):n(t)}var b6={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const ZA=$v,QA=tC,x6=Hv,JA=E.forwardRef(({className:e,...t},n)=>S.jsx(nd,{ref:n,className:Me("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...t}));JA.displayName=nd.displayName;const Ty=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(x6,{children:[S.jsx(JA,{}),S.jsxs(rd,{ref:r,className:Me("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",e),...n,children:[t,S.jsxs(Yv,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[S.jsx(_k,{className:"h-4 w-4"}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ty.displayName=rd.displayName;const Ay=({className:e,...t})=>S.jsx("div",{className:Me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ay.displayName="DialogHeader";const Ry=E.forwardRef(({className:e,...t},n)=>S.jsx(Vv,{ref:n,className:Me("text-lg leading-none font-semibold tracking-tight",e),...t}));Ry.displayName=Vv.displayName;const Dy=E.forwardRef(({className:e,...t},n)=>S.jsx(qv,{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));Dy.displayName=qv.displayName;const bd=E.forwardRef(({className:e,...t},n)=>S.jsx(In,{ref:n,className:Me("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));bd.displayName=In.displayName;const Ny=E.forwardRef(({className:e,...t},n)=>S.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[S.jsx(KM,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),S.jsx(In.Input,{ref:n,className:Me("placeholder:text-muted-foreground flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));Ny.displayName=In.Input.displayName;const xd=E.forwardRef(({className:e,...t},n)=>S.jsx(In.List,{ref:n,className:Me("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));xd.displayName=In.List.displayName;const Oy=E.forwardRef((e,t)=>S.jsx(In.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));Oy.displayName=In.Empty.displayName;const Cs=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Group,{ref:n,className: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",e),...t}));Cs.displayName=In.Group.displayName;const w6=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Separator,{ref:n,className:Me("bg-border -mx-1 h-px",e),...t}));w6.displayName=In.Separator.displayName;const Ts=E.forwardRef(({className:e,...t},n)=>S.jsx(In.Item,{ref:n,className:Me("data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));Ts.displayName=In.Item.displayName;const S6=({layout:e,autoRunFor:t})=>{const n=hr(),{stop:r,start:i,isRunning:o}=e;return E.useEffect(()=>{if(!n)return;let l=null;return t!==void 0&&t>-1&&n.getGraph().order>0&&(i(),l=t>0?window.setTimeout(()=>{r()},t):null),()=>{r(),l&&clearTimeout(l)}},[t,i,r,n]),S.jsx(Ot,{size:"icon",onClick:()=>o?r():i(),tooltip:o?"Stop the layout animation":"Start the layout animation",variant:$r,children:o?S.jsx(HM,{}):S.jsx(qM,{})})},E6=()=>{const e=hr(),[t,n]=E.useState("Circular"),[r,i]=E.useState(!1),o=mB(),l=fB(),u=qB(),f=UB({settings:{margin:1}}),d=SB({maxIterations:20}),p=UA({iterations:20}),m=BB(),v=EB(),g=OB(),w=E.useMemo(()=>({Circular:{layout:o},Circlepack:{layout:l},Random:{layout:u},Noverlaps:{layout:f,worker:m},"Force Directed":{layout:d,worker:v},"Force Atlas":{layout:p,worker:g}}),[l,o,d,p,f,u,v,m,g]),x=E.useCallback(k=>{console.debug(k);const{positions:C}=w[k].layout;DG(e.getGraph(),C(),{duration:500}),n(k)},[w,e]);return S.jsxs(S.Fragment,{children:[S.jsx("div",{children:w[t]&&"worker"in w[t]&&S.jsx(S6,{layout:w[t].worker})}),S.jsx("div",{children:S.jsxs(dd,{open:r,onOpenChange:i,children:[S.jsx(hd,{asChild:!0,children:S.jsx(Ot,{size:"icon",variant:$r,onClick:()=>i(k=>!k),tooltip:"Layout Graph",children:S.jsx(jM,{})})}),S.jsx(uu,{side:"right",align:"center",className:"p-1",children:S.jsx(bd,{children:S.jsx(xd,{children:S.jsx(Cs,{children:Object.keys(w).map(k=>S.jsx(Ts,{onSelect:()=>{x(k)},className:"cursor-pointer text-xs",children:k},k))})})})})]})})]})};var cf={exports:{}},_6=cf.exports,eE;function k6(){return eE||(eE=1,function(e){(function(t,n,r){function i(f){var d=this,p=u();d.next=function(){var m=2091639*d.s0+d.c*23283064365386963e-26;return d.s0=d.s1,d.s1=d.s2,d.s2=m-(d.c=m|0)},d.c=1,d.s0=p(" "),d.s1=p(" "),d.s2=p(" "),d.s0-=p(f),d.s0<0&&(d.s0+=1),d.s1-=p(f),d.s1<0&&(d.s1+=1),d.s2-=p(f),d.s2<0&&(d.s2+=1),p=null}function o(f,d){return d.c=f.c,d.s0=f.s0,d.s1=f.s1,d.s2=f.s2,d}function l(f,d){var p=new i(f),m=d&&d.state,v=p.next;return v.int32=function(){return p.next()*4294967296|0},v.double=function(){return v()+(v()*2097152|0)*11102230246251565e-32},v.quick=v,m&&(typeof m=="object"&&o(m,p),v.state=function(){return o(p,{})}),v}function u(){var f=4022871197,d=function(p){p=String(p);for(var m=0;m>>0,v-=f,v*=f,f=v>>>0,v-=f,f+=v*4294967296}return(f>>>0)*23283064365386963e-26};return d}n&&n.exports?n.exports=l:this.alea=l})(_6,e)}(cf)),cf.exports}var ff={exports:{}},C6=ff.exports,tE;function T6(){return tE||(tE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.x=0,f.y=0,f.z=0,f.w=0,f.next=function(){var m=f.x^f.x<<11;return f.x=f.y,f.y=f.z,f.z=f.w,f.w^=f.w>>>19^m^m>>>8},u===(u|0)?f.x=u:d+=u;for(var p=0;p>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=l:this.xor128=l})(C6,e)}(ff)),ff.exports}var df={exports:{}},A6=df.exports,nE;function R6(){return nE||(nE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.next=function(){var m=f.x^f.x>>>2;return f.x=f.y,f.y=f.z,f.z=f.w,f.w=f.v,(f.d=f.d+362437|0)+(f.v=f.v^f.v<<4^(m^m<<1))|0},f.x=0,f.y=0,f.z=0,f.w=0,f.v=0,u===(u|0)?f.x=u:d+=u;for(var p=0;p>>4),f.next()}function o(u,f){return f.x=u.x,f.y=u.y,f.z=u.z,f.w=u.w,f.v=u.v,f.d=u.d,f}function l(u,f){var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=l:this.xorwow=l})(A6,e)}(df)),df.exports}var hf={exports:{}},D6=hf.exports,rE;function N6(){return rE||(rE=1,function(e){(function(t,n,r){function i(u){var f=this;f.next=function(){var p=f.x,m=f.i,v,g;return v=p[m],v^=v>>>7,g=v^v<<24,v=p[m+1&7],g^=v^v>>>10,v=p[m+3&7],g^=v^v>>>3,v=p[m+4&7],g^=v^v<<7,v=p[m+7&7],v=v^v<<13,g^=v^v<<9,p[m]=g,f.i=m+1&7,g};function d(p,m){var v,g=[];if(m===(m|0))g[0]=m;else for(m=""+m,v=0;v0;--v)p.next()}d(f,u)}function o(u,f){return f.x=u.x.slice(),f.i=u.i,f}function l(u,f){u==null&&(u=+new Date);var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(p.x&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=l:this.xorshift7=l})(D6,e)}(hf)),hf.exports}var pf={exports:{}},O6=pf.exports,iE;function j6(){return iE||(iE=1,function(e){(function(t,n,r){function i(u){var f=this;f.next=function(){var p=f.w,m=f.X,v=f.i,g,w;return f.w=p=p+1640531527|0,w=m[v+34&127],g=m[v=v+1&127],w^=w<<13,g^=g<<17,w^=w>>>15,g^=g>>>12,w=m[v]=w^g,f.i=v,w+(p^p>>>16)|0};function d(p,m){var v,g,w,x,k,C=[],_=128;for(m===(m|0)?(g=m,m=null):(m=m+"\0",g=0,_=Math.max(_,m.length)),w=0,x=-32;x<_;++x)m&&(g^=m.charCodeAt((x+32)%m.length)),x===0&&(k=g),g^=g<<10,g^=g>>>15,g^=g<<4,g^=g>>>13,x>=0&&(k=k+1640531527|0,v=C[x&127]^=g+k,w=v==0?w+1:0);for(w>=128&&(C[(m&&m.length||0)&127]=-1),w=127,x=4*128;x>0;--x)g=C[w+34&127],v=C[w=w+1&127],g^=g<<13,v^=v<<17,g^=g>>>15,v^=v>>>12,C[w]=g^v;p.w=k,p.X=C,p.i=w}d(f,u)}function o(u,f){return f.i=u.i,f.w=u.w,f.X=u.X.slice(),f}function l(u,f){u==null&&(u=+new Date);var d=new i(u),p=f&&f.state,m=function(){return(d.next()>>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(p.X&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=l:this.xor4096=l})(O6,e)}(pf)),pf.exports}var mf={exports:{}},L6=mf.exports,aE;function z6(){return aE||(aE=1,function(e){(function(t,n,r){function i(u){var f=this,d="";f.next=function(){var m=f.b,v=f.c,g=f.d,w=f.a;return m=m<<25^m>>>7^v,v=v-g|0,g=g<<24^g>>>8^w,w=w-m|0,f.b=m=m<<20^m>>>12^v,f.c=v=v-g|0,f.d=g<<16^v>>>16^w,f.a=w-m|0},f.a=0,f.b=0,f.c=-1640531527,f.d=1367130551,u===Math.floor(u)?(f.a=u/4294967296|0,f.b=u|0):d+=u;for(var p=0;p>>0)/4294967296};return m.double=function(){do var v=d.next()>>>11,g=(d.next()>>>0)/4294967296,w=(v+g)/(1<<21);while(w===0);return w},m.int32=d.next,m.quick=m,p&&(typeof p=="object"&&o(p,d),m.state=function(){return o(d,{})}),m}n&&n.exports?n.exports=l:this.tychei=l})(L6,e)}(mf)),mf.exports}var gf={exports:{}};const M6={},P6=Object.freeze(Object.defineProperty({__proto__:null,default:M6},Symbol.toStringTag,{value:"Module"})),F6=lj(P6);var I6=gf.exports,oE;function G6(){return oE||(oE=1,function(e){(function(t,n,r){var i=256,o=6,l=52,u="random",f=r.pow(i,o),d=r.pow(2,l),p=d*2,m=i-1,v;function g(N,D,L){var R=[];D=D==!0?{entropy:!0}:D||{};var U=C(k(D.entropy?[N,T(n)]:N??_(),3),R),P=new w(R),z=function(){for(var V=P.g(o),q=f,I=0;V=p;)V/=2,q/=2,I>>>=1;return(V+I)/q};return z.int32=function(){return P.g(4)|0},z.quick=function(){return P.g(4)/4294967296},z.double=z,C(T(P.S),n),(D.pass||L||function(V,q,I,Y){return Y&&(Y.S&&x(Y,P),V.state=function(){return x(P,{})}),I?(r[u]=V,q):V})(z,U,"global"in D?D.global:this==r,D.state)}function w(N){var D,L=N.length,R=this,U=0,P=R.i=R.j=0,z=R.S=[];for(L||(N=[L++]);U{if(!e||!Array.isArray(e.nodes)||!Array.isArray(e.edges))return!1;for(const t of e.nodes)if(!t.id||!t.labels||!t.properties)return!1;for(const t of e.edges)if(!t.id||!t.source||!t.target)return!1;for(const t of e.edges){const n=e.getNode(t.source),r=e.getNode(t.target);if(n==null||r==null)return!1}return!0},V6=async e=>{let t=null;try{t=await rM(e)}catch(r){return Mn.getState().setErrorMessage(Cr(r),"Query Graphs Error!"),null}let n=null;if(t){const r={},i={};for(let f=0;f0){const f=xL-J0;for(const d of t.nodes)d.size=Math.round(J0+f*Math.pow((d.degree-o)/u,.5))}n=new rB,n.nodes=t.nodes,n.edges=t.edges,n.nodeIdMap=r,n.edgeIdMap=i,H6(n)||(n=null,console.error("Invalid graph data")),console.log("Graph data loaded")}return n},q6=e=>{const t=new Wl;for(const n of(e==null?void 0:e.nodes)??[])t.addNode(n.id,{label:n.labels.join(", "),color:n.color,x:n.x,y:n.y,size:n.size,borderColor:gL,borderSize:.2});for(const n of(e==null?void 0:e.edges)??[])n.dynamicId=t.addDirectedEdge(n.source,n.target,{label:n.type||void 0});return t},lE={label:""},eR=()=>{const e=Qe.use.queryLabel(),t=yt.use.rawGraph(),n=yt.use.sigmaGraph(),r=E.useCallback(l=>(t==null?void 0:t.getNode(l))||null,[t]),i=E.useCallback((l,u=!0)=>(t==null?void 0:t.getEdge(l,u))||null,[t]);return E.useEffect(()=>{if(e){if(lE.label!==e){lE.label=e;const l=yt.getState();l.reset(),V6(e).then(u=>{l.setSigmaGraph(q6(u)),u==null||u.buildDynamicMap(),l.setRawGraph(u)})}}else{const l=yt.getState();l.reset(),l.setSigmaGraph(new Wl)}},[e]),{lightrageGraph:E.useCallback(()=>{if(n)return n;const l=new Wl;return yt.getState().setSigmaGraph(l),l},[n]),getNode:r,getEdge:i}},Vc=e=>!!(e.type.startsWith("mouse")&&e.buttons!==0),Y6=({disableHoverEffect:e})=>{const{lightrageGraph:t}=eR(),n=hr(),r=xA(),i=bA(),o=iU(),{assign:l}=UA({iterations:20}),{theme:u}=pT(),f=Qe.use.enableHideUnselectedEdges(),d=yt.use.selectedNode(),p=yt.use.focusedNode(),m=yt.use.selectedEdge(),v=yt.use.focusedEdge();return E.useEffect(()=>{const g=t();o(g),g.__force_applied||(l(),Object.assign(g,{__force_applied:!0}));const{setFocusedNode:w,setSelectedNode:x,setFocusedEdge:k,setSelectedEdge:C,clearSelection:_}=yt.getState();r({enterNode:T=>{Vc(T.event.original)||w(T.node)},leaveNode:T=>{Vc(T.event.original)||w(null)},clickNode:T=>{x(T.node),C(null)},clickEdge:T=>{C(T.edge),x(null)},enterEdge:T=>{Vc(T.event.original)||k(T.edge)},leaveEdge:T=>{Vc(T.event.original)||k(null)},clickStage:()=>_()})},[l,o,r,t]),E.useEffect(()=>{const g=u==="dark",w=g?hL:void 0,x=g?yL:void 0;i({nodeReducer:(k,C)=>{const _=n.getGraph(),T={...C,highlighted:C.highlighted||!1,labelColor:w};if(!e){T.highlighted=!1;const N=p||d,D=v||m;if(N)(k===N||_.neighbors(N).includes(k))&&(T.highlighted=!0,k===d&&(T.borderColor=vL));else if(D)_.extremities(D).includes(k)&&(T.highlighted=!0,T.size=3);else return T;T.highlighted?g&&(T.labelColor=pL):T.color=mL}return T},edgeReducer:(k,C)=>{const _=n.getGraph(),T={...C,hidden:!1,labelColor:w,color:x};if(!e){const N=p||d;N?f?_.extremities(k).includes(N)||(T.hidden=!0):_.extremities(k).includes(N)&&(T.color=Q0):(v||m)&&(k===m?T.color=bL:k===v?T.color=Q0:f&&(T.hidden=!0))}return T}})},[d,p,m,v,i,n,e,u,f]),null},W6=()=>{const{zoomIn:e,zoomOut:t,reset:n}=wA({duration:200,factor:1.5}),r=E.useCallback(()=>e(),[e]),i=E.useCallback(()=>t(),[t]),o=E.useCallback(()=>n(),[n]);return S.jsxs(S.Fragment,{children:[S.jsx(Ot,{variant:$r,onClick:r,tooltip:"Zoom In",size:"icon",children:S.jsx(lP,{})}),S.jsx(Ot,{variant:$r,onClick:i,tooltip:"Zoom Out",size:"icon",children:S.jsx(cP,{})}),S.jsx(Ot,{variant:$r,onClick:o,tooltip:"Reset Zoom",size:"icon",children:S.jsx(RM,{})})]})},X6=()=>{const{isFullScreen:e,toggle:t}=aU();return S.jsx(S.Fragment,{children:e?S.jsx(Ot,{variant:$r,onClick:t,tooltip:"Windowed",size:"icon",children:S.jsx(GM,{})}):S.jsx(Ot,{variant:$r,onClick:t,tooltip:"Full Screen",size:"icon",children:S.jsx(FM,{})})})};function tR(e){const t=E.useRef({value:e,previous:e});return E.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var jy="Checkbox",[K6,gK]=dr(jy),[Z6,Q6]=K6(jy),nR=E.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:l,disabled:u,value:f="on",onCheckedChange:d,form:p,...m}=e,[v,g]=E.useState(null),w=dt(t,N=>g(N)),x=E.useRef(!1),k=v?p||!!v.closest("form"):!0,[C=!1,_]=_i({prop:i,defaultProp:o,onChange:d}),T=E.useRef(C);return E.useEffect(()=>{const N=v==null?void 0:v.form;if(N){const D=()=>_(T.current);return N.addEventListener("reset",D),()=>N.removeEventListener("reset",D)}},[v,_]),S.jsxs(Z6,{scope:n,state:C,disabled:u,children:[S.jsx(We.button,{type:"button",role:"checkbox","aria-checked":sa(C)?"mixed":C,"aria-required":l,"data-state":aR(C),"data-disabled":u?"":void 0,disabled:u,value:f,...m,ref:w,onKeyDown:qe(e.onKeyDown,N=>{N.key==="Enter"&&N.preventDefault()}),onClick:qe(e.onClick,N=>{_(D=>sa(D)?!0:!D),k&&(x.current=N.isPropagationStopped(),x.current||N.stopPropagation())})}),k&&S.jsx(J6,{control:v,bubbles:!x.current,name:r,value:f,checked:C,required:l,disabled:u,form:p,style:{transform:"translateX(-100%)"},defaultChecked:sa(o)?!1:o})]})});nR.displayName=jy;var rR="CheckboxIndicator",iR=E.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=Q6(rR,n);return S.jsx(Kn,{present:r||sa(o.state)||o.state===!0,children:S.jsx(We.span,{"data-state":aR(o.state),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});iR.displayName=rR;var J6=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:i,...o}=e,l=E.useRef(null),u=tR(n),f=NC(t);E.useEffect(()=>{const p=l.current,m=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(m,"checked").set;if(u!==n&&g){const w=new Event("click",{bubbles:r});p.indeterminate=sa(n),g.call(p,sa(n)?!1:n),p.dispatchEvent(w)}},[u,n,r]);const d=E.useRef(sa(n)?!1:n);return S.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??d.current,...o,tabIndex:-1,ref:l,style:{...e.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function sa(e){return e==="indeterminate"}function aR(e){return sa(e)?"indeterminate":e?"checked":"unchecked"}var oR=nR,e$=iR;const Ul=E.forwardRef(({className:e,...t},n)=>S.jsx(oR,{ref:n,className:Me("peer border-primary ring-offset-background focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground h-4 w-4 shrink-0 rounded-sm border focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:S.jsx(e$,{className:Me("flex items-center justify-center text-current"),children:S.jsx(Lv,{className:"h-4 w-4"})})}));Ul.displayName=oR.displayName;var t$="Separator",uE="horizontal",n$=["horizontal","vertical"],sR=E.forwardRef((e,t)=>{const{decorative:n,orientation:r=uE,...i}=e,o=r$(r)?r:uE,u=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return S.jsx(We.div,{"data-orientation":o,...u,...i,ref:t})});sR.displayName=t$;function r$(e){return n$.includes(e)}var lR=sR;const Fl=E.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},i)=>S.jsx(lR,{ref:i,decorative:n,orientation:t,className:Me("bg-border shrink-0",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Fl.displayName=lR.displayName;const na=({checked:e,onCheckedChange:t,label:n})=>S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ul,{checked:e,onCheckedChange:t}),S.jsx("label",{htmlFor:"terms",className:"text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:n})]});function i$(){const[e,t]=E.useState(!1),[n,r]=E.useState(""),i=Qe.use.showPropertyPanel(),o=Qe.use.showNodeSearchBar(),l=Qe.use.showNodeLabel(),u=Qe.use.enableEdgeEvents(),f=Qe.use.enableNodeDrag(),d=Qe.use.enableHideUnselectedEdges(),p=Qe.use.showEdgeLabel(),m=Qe.use.enableHealthCheck(),v=Qe.use.apiKey();E.useEffect(()=>{r(v||"")},[v,e]);const g=E.useCallback(()=>Qe.setState(R=>({enableNodeDrag:!R.enableNodeDrag})),[]),w=E.useCallback(()=>Qe.setState(R=>({enableEdgeEvents:!R.enableEdgeEvents})),[]),x=E.useCallback(()=>Qe.setState(R=>({enableHideUnselectedEdges:!R.enableHideUnselectedEdges})),[]),k=E.useCallback(()=>Qe.setState(R=>({showEdgeLabel:!R.showEdgeLabel})),[]),C=E.useCallback(()=>Qe.setState(R=>({showPropertyPanel:!R.showPropertyPanel})),[]),_=E.useCallback(()=>Qe.setState(R=>({showNodeSearchBar:!R.showNodeSearchBar})),[]),T=E.useCallback(()=>Qe.setState(R=>({showNodeLabel:!R.showNodeLabel})),[]),N=E.useCallback(()=>Qe.setState(R=>({enableHealthCheck:!R.enableHealthCheck})),[]),D=E.useCallback(async()=>{Qe.setState({apiKey:n||null}),await Mn.getState().check(),t(!1)},[n]),L=E.useCallback(R=>{r(R.target.value)},[r]);return S.jsxs(dd,{open:e,onOpenChange:t,children:[S.jsx(hd,{asChild:!0,children:S.jsx(Ot,{variant:$r,tooltip:"Settings",size:"icon",children:S.jsx(eP,{})})}),S.jsx(uu,{side:"right",align:"start",className:"mb-2 p-2",onCloseAutoFocus:R=>R.preventDefault(),children:S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx(na,{checked:i,onCheckedChange:C,label:"Show Property Panel"}),S.jsx(na,{checked:o,onCheckedChange:_,label:"Show Search Bar"}),S.jsx(Fl,{}),S.jsx(na,{checked:l,onCheckedChange:T,label:"Show Node Label"}),S.jsx(na,{checked:f,onCheckedChange:g,label:"Node Draggable"}),S.jsx(Fl,{}),S.jsx(na,{checked:p,onCheckedChange:k,label:"Show Edge Label"}),S.jsx(na,{checked:d,onCheckedChange:x,label:"Hide Unselected Edges"}),S.jsx(na,{checked:u,onCheckedChange:w,label:"Edge Events"}),S.jsx(Fl,{}),S.jsx(na,{checked:m,onCheckedChange:N,label:"Health Check"}),S.jsx(Fl,{}),S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-sm font-medium",children:"API Key"}),S.jsxs("form",{className:"flex h-6 gap-2",onSubmit:R=>R.preventDefault(),children:[S.jsx("div",{className:"w-0 flex-1",children:S.jsx(Za,{type:"password",value:n,onChange:L,placeholder:"Enter your API key",className:"max-h-full w-full min-w-0",autoComplete:"off"})}),S.jsx(Ot,{onClick:D,variant:"outline",size:"sm",className:"max-h-full shrink-0",children:"Save"})]})]})]})})]})}function vf(e,t,n,r){function i(o){return o instanceof n?o:new n(function(l){l(o)})}return new(n||(n=Promise))(function(o,l){function u(p){try{d(r.next(p))}catch(m){l(m)}}function f(p){try{d(r.throw(p))}catch(m){l(m)}}function d(p){p.done?o(p.value):i(p.value).then(u,f)}d((r=r.apply(e,[])).next())})}const a$="ENTRIES",uR="KEYS",cR="VALUES",ln="";class Hm{constructor(t,n){const r=t._tree,i=Array.from(r.keys());this.set=t,this._type=n,this._path=i.length>0?[{node:r,keys:i}]:[]}next(){const t=this.dive();return this.backtrack(),t}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:t,keys:n}=Wo(this._path);if(Wo(n)===ln)return{done:!1,value:this.result()};const r=t.get(Wo(n));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const t=Wo(this._path).keys;t.pop(),!(t.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:t})=>Wo(t)).filter(t=>t!==ln).join("")}value(){return Wo(this._path).node.get(ln)}result(){switch(this._type){case cR:return this.value();case uR:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const Wo=e=>e[e.length-1],o$=(e,t,n)=>{const r=new Map;if(t===void 0)return r;const i=t.length+1,o=i+n,l=new Uint8Array(o*i).fill(n+1);for(let u=0;u{const f=o*l;e:for(const d of e.keys())if(d===ln){const p=i[f-1];p<=n&&r.set(u,[e.get(d),p])}else{let p=o;for(let m=0;mn)continue e}fR(e.get(d),t,n,r,i,p,l,u+d)}};class oa{constructor(t=new Map,n=""){this._size=void 0,this._tree=t,this._prefix=n}atPrefix(t){if(!t.startsWith(this._prefix))throw new Error("Mismatched prefix");const[n,r]=Nf(this._tree,t.slice(this._prefix.length));if(n===void 0){const[i,o]=Ly(r);for(const l of i.keys())if(l!==ln&&l.startsWith(o)){const u=new Map;return u.set(l.slice(o.length),i.get(l)),new oa(u,t)}}return new oa(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(t){return this._size=void 0,s$(this._tree,t)}entries(){return new Hm(this,a$)}forEach(t){for(const[n,r]of this)t(n,r,this)}fuzzyGet(t,n){return o$(this._tree,t,n)}get(t){const n=Qg(this._tree,t);return n!==void 0?n.get(ln):void 0}has(t){const n=Qg(this._tree,t);return n!==void 0&&n.has(ln)}keys(){return new Hm(this,uR)}set(t,n){if(typeof t!="string")throw new Error("key must be a string");return this._size=void 0,Vm(this._tree,t).set(ln,n),this}get size(){if(this._size)return this._size;this._size=0;const t=this.entries();for(;!t.next().done;)this._size+=1;return this._size}update(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=Vm(this._tree,t);return r.set(ln,n(r.get(ln))),this}fetch(t,n){if(typeof t!="string")throw new Error("key must be a string");this._size=void 0;const r=Vm(this._tree,t);let i=r.get(ln);return i===void 0&&r.set(ln,i=n()),i}values(){return new Hm(this,cR)}[Symbol.iterator](){return this.entries()}static from(t){const n=new oa;for(const[r,i]of t)n.set(r,i);return n}static fromObject(t){return oa.from(Object.entries(t))}}const Nf=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(const r of e.keys())if(r!==ln&&t.startsWith(r))return n.push([e,r]),Nf(e.get(r),t.slice(r.length),n);return n.push([e,t]),Nf(void 0,"",n)},Qg=(e,t)=>{if(t.length===0||e==null)return e;for(const n of e.keys())if(n!==ln&&t.startsWith(n))return Qg(e.get(n),t.slice(n.length))},Vm=(e,t)=>{const n=t.length;e:for(let r=0;e&&r{const[n,r]=Nf(e,t);if(n!==void 0){if(n.delete(ln),n.size===0)dR(r);else if(n.size===1){const[i,o]=n.entries().next().value;hR(r,i,o)}}},dR=e=>{if(e.length===0)return;const[t,n]=Ly(e);if(t.delete(n),t.size===0)dR(e.slice(0,-1));else if(t.size===1){const[r,i]=t.entries().next().value;r!==ln&&hR(e.slice(0,-1),r,i)}},hR=(e,t,n)=>{if(e.length===0)return;const[r,i]=Ly(e);r.set(i+t,n),r.delete(i)},Ly=e=>e[e.length-1],zy="or",pR="and",l$="and_not";class la{constructor(t){if((t==null?void 0:t.fields)==null)throw new Error('MiniSearch: option "fields" must be provided');const n=t.autoVacuum==null||t.autoVacuum===!0?Wm:t.autoVacuum;this._options=Object.assign(Object.assign(Object.assign({},Ym),t),{autoVacuum:n,searchOptions:Object.assign(Object.assign({},cE),t.searchOptions||{}),autoSuggestOptions:Object.assign(Object.assign({},h$),t.autoSuggestOptions||{})}),this._index=new oa,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=ev,this.addFields(this._options.fields)}add(t){const{extractField:n,tokenize:r,processTerm:i,fields:o,idField:l}=this._options,u=n(t,l);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${l}"`);if(this._idToShortId.has(u))throw new Error(`MiniSearch: duplicate ID ${u}`);const f=this.addDocumentId(u);this.saveStoredFields(f,t);for(const d of o){const p=n(t,d);if(p==null)continue;const m=r(p.toString(),d),v=this._fieldIds[d],g=new Set(m).size;this.addFieldLength(f,v,this._documentCount-1,g);for(const w of m){const x=i(w,d);if(Array.isArray(x))for(const k of x)this.addTerm(v,f,k);else x&&this.addTerm(v,f,x)}}}addAll(t){for(const n of t)this.add(n)}addAllAsync(t,n={}){const{chunkSize:r=10}=n,i={chunk:[],promise:Promise.resolve()},{chunk:o,promise:l}=t.reduce(({chunk:u,promise:f},d,p)=>(u.push(d),(p+1)%r===0?{chunk:[],promise:f.then(()=>new Promise(m=>setTimeout(m,0))).then(()=>this.addAll(u))}:{chunk:u,promise:f}),i);return l.then(()=>this.addAll(o))}remove(t){const{tokenize:n,processTerm:r,extractField:i,fields:o,idField:l}=this._options,u=i(t,l);if(u==null)throw new Error(`MiniSearch: document does not have ID field "${l}"`);const f=this._idToShortId.get(u);if(f==null)throw new Error(`MiniSearch: cannot remove document with ID ${u}: it is not in the index`);for(const d of o){const p=i(t,d);if(p==null)continue;const m=n(p.toString(),d),v=this._fieldIds[d],g=new Set(m).size;this.removeFieldLength(f,v,this._documentCount,g);for(const w of m){const x=r(w,d);if(Array.isArray(x))for(const k of x)this.removeTerm(v,f,k);else x&&this.removeTerm(v,f,x)}}this._storedFields.delete(f),this._documentIds.delete(f),this._idToShortId.delete(u),this._fieldLength.delete(f),this._documentCount-=1}removeAll(t){if(t)for(const n of t)this.remove(n);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new oa,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(t){const n=this._idToShortId.get(t);if(n==null)throw new Error(`MiniSearch: cannot discard document with ID ${t}: it is not in the index`);this._idToShortId.delete(t),this._documentIds.delete(n),this._storedFields.delete(n),(this._fieldLength.get(n)||[]).forEach((r,i)=>{this.removeFieldLength(n,i,this._documentCount,r)}),this._fieldLength.delete(n),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:t,minDirtCount:n,batchSize:r,batchWait:i}=this._options.autoVacuum;this.conditionalVacuum({batchSize:r,batchWait:i},{minDirtCount:n,minDirtFactor:t})}discardAll(t){const n=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const r of t)this.discard(r)}finally{this._options.autoVacuum=n}this.maybeAutoVacuum()}replace(t){const{idField:n,extractField:r}=this._options,i=r(t,n);this.discard(i),this.add(t)}vacuum(t={}){return this.conditionalVacuum(t)}conditionalVacuum(t,n){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&n,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const r=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=ev,this.performVacuuming(t,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(n)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(t),this._currentVacuum)}performVacuuming(t,n){return vf(this,void 0,void 0,function*(){const r=this._dirtCount;if(this.vacuumConditionsMet(n)){const i=t.batchSize||Jg.batchSize,o=t.batchWait||Jg.batchWait;let l=1;for(const[u,f]of this._index){for(const[d,p]of f)for(const[m]of p)this._documentIds.has(m)||(p.size<=1?f.delete(d):p.delete(m));this._index.get(u).size===0&&this._index.delete(u),l%i===0&&(yield new Promise(d=>setTimeout(d,o))),l+=1}this._dirtCount-=r}yield null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null})}vacuumConditionsMet(t){if(t==null)return!0;let{minDirtCount:n,minDirtFactor:r}=t;return n=n||Wm.minDirtCount,r=r||Wm.minDirtFactor,this.dirtCount>=n&&this.dirtFactor>=r}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(t){return this._idToShortId.has(t)}getStoredFields(t){const n=this._idToShortId.get(t);if(n!=null)return this._storedFields.get(n)}search(t,n={}){const{searchOptions:r}=this._options,i=Object.assign(Object.assign({},r),n),o=this.executeQuery(t,n),l=[];for(const[u,{score:f,terms:d,match:p}]of o){const m=d.length||1,v={id:this._documentIds.get(u),score:f*m,terms:Object.keys(p),queryTerms:d,match:p};Object.assign(v,this._storedFields.get(u)),(i.filter==null||i.filter(v))&&l.push(v)}return t===la.wildcard&&i.boostDocument==null||l.sort(dE),l}autoSuggest(t,n={}){n=Object.assign(Object.assign({},this._options.autoSuggestOptions),n);const r=new Map;for(const{score:o,terms:l}of this.search(t,n)){const u=l.join(" "),f=r.get(u);f!=null?(f.score+=o,f.count+=1):r.set(u,{score:o,terms:l,count:1})}const i=[];for(const[o,{score:l,terms:u,count:f}]of r)i.push({suggestion:o,terms:u,score:l/f});return i.sort(dE),i}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(t,n){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(t),n)}static loadJSONAsync(t,n){return vf(this,void 0,void 0,function*(){if(n==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(t),n)})}static getDefault(t){if(Ym.hasOwnProperty(t))return qm(Ym,t);throw new Error(`MiniSearch: unknown option "${t}"`)}static loadJS(t,n){const{index:r,documentIds:i,fieldLength:o,storedFields:l,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=qc(i),f._fieldLength=qc(o),f._storedFields=qc(l);for(const[d,p]of f._documentIds)f._idToShortId.set(p,d);for(const[d,p]of r){const m=new Map;for(const v of Object.keys(p)){let g=p[v];u===1&&(g=g.ds),m.set(parseInt(v,10),qc(g))}f._index.set(d,m)}return f}static loadJSAsync(t,n){return vf(this,void 0,void 0,function*(){const{index:r,documentIds:i,fieldLength:o,storedFields:l,serializationVersion:u}=t,f=this.instantiateMiniSearch(t,n);f._documentIds=yield Yc(i),f._fieldLength=yield Yc(o),f._storedFields=yield Yc(l);for(const[p,m]of f._documentIds)f._idToShortId.set(m,p);let d=0;for(const[p,m]of r){const v=new Map;for(const g of Object.keys(m)){let w=m[g];u===1&&(w=w.ds),v.set(parseInt(g,10),yield Yc(w))}++d%1e3===0&&(yield mR(0)),f._index.set(p,v)}return f})}static instantiateMiniSearch(t,n){const{documentCount:r,nextId:i,fieldIds:o,averageFieldLength:l,dirtCount:u,serializationVersion:f}=t;if(f!==1&&f!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const d=new la(n);return d._documentCount=r,d._nextId=i,d._idToShortId=new Map,d._fieldIds=o,d._avgFieldLength=l,d._dirtCount=u||0,d._index=new oa,d}executeQuery(t,n={}){if(t===la.wildcard)return this.executeWildcardQuery(n);if(typeof t!="string"){const v=Object.assign(Object.assign(Object.assign({},n),t),{queries:void 0}),g=t.queries.map(w=>this.executeQuery(w,v));return this.combineResults(g,v.combineWith)}const{tokenize:r,processTerm:i,searchOptions:o}=this._options,l=Object.assign(Object.assign({tokenize:r,processTerm:i},o),n),{tokenize:u,processTerm:f}=l,m=u(t).flatMap(v=>f(v)).filter(v=>!!v).map(d$(l)).map(v=>this.executeQuerySpec(v,l));return this.combineResults(m,l.combineWith)}executeQuerySpec(t,n){const r=Object.assign(Object.assign({},this._options.searchOptions),n),i=(r.fields||this._options.fields).reduce((x,k)=>Object.assign(Object.assign({},x),{[k]:qm(r.boost,k)||1}),{}),{boostDocument:o,weights:l,maxFuzzy:u,bm25:f}=r,{fuzzy:d,prefix:p}=Object.assign(Object.assign({},cE.weights),l),m=this._index.get(t.term),v=this.termResults(t.term,t.term,1,t.termBoost,m,i,o,f);let g,w;if(t.prefix&&(g=this._index.atPrefix(t.term)),t.fuzzy){const x=t.fuzzy===!0?.2:t.fuzzy,k=x<1?Math.min(u,Math.round(t.term.length*x)):x;k&&(w=this._index.fuzzyGet(t.term,k))}if(g)for(const[x,k]of g){const C=x.length-t.term.length;if(!C)continue;w==null||w.delete(x);const _=p*x.length/(x.length+.3*C);this.termResults(t.term,x,_,t.termBoost,k,i,o,f,v)}if(w)for(const x of w.keys()){const[k,C]=w.get(x);if(!C)continue;const _=d*x.length/(x.length+C);this.termResults(t.term,x,_,t.termBoost,k,i,o,f,v)}return v}executeWildcardQuery(t){const n=new Map,r=Object.assign(Object.assign({},this._options.searchOptions),t);for(const[i,o]of this._documentIds){const l=r.boostDocument?r.boostDocument(o,"",this._storedFields.get(i)):1;n.set(i,{score:l,terms:[],match:{}})}return n}combineResults(t,n=zy){if(t.length===0)return new Map;const r=n.toLowerCase(),i=u$[r];if(!i)throw new Error(`Invalid combination operator: ${n}`);return t.reduce(i)||new Map}toJSON(){const t=[];for(const[n,r]of this._index){const i={};for(const[o,l]of r)i[o]=Object.fromEntries(l);t.push([n,i])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:t,serializationVersion:2}}termResults(t,n,r,i,o,l,u,f,d=new Map){if(o==null)return d;for(const p of Object.keys(l)){const m=l[p],v=this._fieldIds[p],g=o.get(v);if(g==null)continue;let w=g.size;const x=this._avgFieldLength[v];for(const k of g.keys()){if(!this._documentIds.has(k)){this.removeTerm(v,k,n),w-=1;continue}const C=u?u(this._documentIds.get(k),n,this._storedFields.get(k)):1;if(!C)continue;const _=g.get(k),T=this._fieldLength.get(k)[v],N=f$(_,w,this._documentCount,T,x,f),D=r*i*m*C*N,L=d.get(k);if(L){L.score+=D,p$(L.terms,t);const R=qm(L.match,n);R?R.push(p):L.match[n]=[p]}else d.set(k,{score:D,terms:[t],match:{[n]:[p]}})}}return d}addTerm(t,n,r){const i=this._index.fetch(r,hE);let o=i.get(t);if(o==null)o=new Map,o.set(n,1),i.set(t,o);else{const l=o.get(n);o.set(n,(l||0)+1)}}removeTerm(t,n,r){if(!this._index.has(r)){this.warnDocumentChanged(n,t,r);return}const i=this._index.fetch(r,hE),o=i.get(t);o==null||o.get(n)==null?this.warnDocumentChanged(n,t,r):o.get(n)<=1?o.size<=1?i.delete(t):o.delete(n):o.set(n,o.get(n)-1),this._index.get(r).size===0&&this._index.delete(r)}warnDocumentChanged(t,n,r){for(const i of Object.keys(this._fieldIds))if(this._fieldIds[i]===n){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(t)} has changed before removal: term "${r}" was not present in field "${i}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(t){const n=this._nextId;return this._idToShortId.set(t,n),this._documentIds.set(n,t),this._documentCount+=1,this._nextId+=1,n}addFields(t){for(let n=0;nObject.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,u$={[zy]:(e,t)=>{for(const n of t.keys()){const r=e.get(n);if(r==null)e.set(n,t.get(n));else{const{score:i,terms:o,match:l}=t.get(n);r.score=r.score+i,r.match=Object.assign(r.match,l),fE(r.terms,o)}}return e},[pR]:(e,t)=>{const n=new Map;for(const r of t.keys()){const i=e.get(r);if(i==null)continue;const{score:o,terms:l,match:u}=t.get(r);fE(i.terms,l),n.set(r,{score:i.score+o,terms:i.terms,match:Object.assign(i.match,u)})}return n},[l$]:(e,t)=>{for(const n of t.keys())e.delete(n);return e}},c$={k:1.2,b:.7,d:.5},f$=(e,t,n,r,i,o)=>{const{k:l,b:u,d:f}=o;return Math.log(1+(n-t+.5)/(t+.5))*(f+e*(l+1)/(e+l*(1-u+u*r/i)))},d$=e=>(t,n,r)=>{const i=typeof e.fuzzy=="function"?e.fuzzy(t,n,r):e.fuzzy||!1,o=typeof e.prefix=="function"?e.prefix(t,n,r):e.prefix===!0,l=typeof e.boostTerm=="function"?e.boostTerm(t,n,r):1;return{term:t,fuzzy:i,prefix:o,termBoost:l}},Ym={idField:"id",extractField:(e,t)=>e[t],tokenize:e=>e.split(m$),processTerm:e=>e.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(e,t)=>{typeof(console==null?void 0:console[e])=="function"&&console[e](t)},autoVacuum:!0},cE={combineWith:zy,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:c$},h$={combineWith:pR,prefix:(e,t,n)=>t===n.length-1},Jg={batchSize:1e3,batchWait:10},ev={minDirtFactor:.1,minDirtCount:20},Wm=Object.assign(Object.assign({},Jg),ev),p$=(e,t)=>{e.includes(t)||e.push(t)},fE=(e,t)=>{for(const n of t)e.includes(n)||e.push(n)},dE=({score:e},{score:t})=>t-e,hE=()=>new Map,qc=e=>{const t=new Map;for(const n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},Yc=e=>vf(void 0,void 0,void 0,function*(){const t=new Map;let n=0;for(const r of Object.keys(e))t.set(parseInt(r,10),e[r]),++n%1e3===0&&(yield mR(0));return t}),mR=e=>new Promise(t=>setTimeout(t,e)),m$=/[\n\r\p{Z}\p{P}]+/u,g$={index:new la({fields:[]})};E.createContext(g$);const tv=({label:e,color:t,hidden:n,labels:r={}})=>be.createElement("div",{className:"node"},be.createElement("span",{className:"render "+(n?"circle":"disc"),style:{backgroundColor:t||"#000"}}),be.createElement("span",{className:`label ${n?"text-muted":""} ${e?"":"text-italic"}`},e||r.no_label||"No label")),v$=({id:e,labels:t})=>{const n=hr(),r=E.useMemo(()=>{const i=n.getGraph().getNodeAttributes(e),o=n.getSetting("nodeReducer");return Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},i),o?o(e,i):{})},[n,e]);return be.createElement(tv,Object.assign({},r,{labels:t}))},y$=({label:e,color:t,source:n,target:r,hidden:i,directed:o,labels:l={}})=>be.createElement("div",{className:"edge"},be.createElement(tv,Object.assign({},n,{labels:l})),be.createElement("div",{className:"body"},be.createElement("div",{className:"render"},be.createElement("span",{className:i?"dotted":"dash",style:{borderColor:t||"#000"}})," ",o&&be.createElement("span",{className:"arrow",style:{borderTopColor:t||"#000"}})),be.createElement("span",{className:`label ${i?"text-muted":""} ${e?"":"fst-italic"}`},e||l.no_label||"No label")),be.createElement(tv,Object.assign({},r,{labels:l}))),b$=({id:e,labels:t})=>{const n=hr(),r=E.useMemo(()=>{const i=n.getGraph().getEdgeAttributes(e),o=n.getSetting("nodeReducer"),l=n.getSetting("edgeReducer"),u=n.getGraph().getNodeAttributes(n.getGraph().source(e)),f=n.getGraph().getNodeAttributes(n.getGraph().target(e));return Object.assign(Object.assign(Object.assign({color:n.getSetting("defaultEdgeColor"),directed:n.getGraph().isDirected(e)},i),l?l(e,i):{}),{source:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},u),o?o(e,u):{}),target:Object.assign(Object.assign({color:n.getSetting("defaultNodeColor")},f),o?o(e,f):{})})},[n,e]);return be.createElement(y$,Object.assign({},r,{labels:t}))};function My(e,t){const[n,r]=E.useState(e);return E.useEffect(()=>{const i=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(i)}},[e,t]),n}function x$({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:i,notFound:o,loadingSkeleton:l,label:u,placeholder:f="Select...",value:d,onChange:p,onFocus:m,disabled:v=!1,className:g,noResultsMessage:w}){const[x,k]=E.useState(!1),[C,_]=E.useState(!1),[T,N]=E.useState([]),[D,L]=E.useState(!1),[R,U]=E.useState(null),[P,z]=E.useState(d),[V,q]=E.useState(null),[I,Y]=E.useState(""),Z=My(I,t?0:150),[B,G]=E.useState([]);E.useEffect(()=>{k(!0),z(d)},[d]),E.useEffect(()=>{x||(async()=>{try{L(!0),U(null);const H=d!==null?await e(d):[];G(H),N(H)}catch(H){U(H instanceof Error?H.message:"Failed to fetch options")}finally{L(!1)}})()},[x,e,d]),E.useEffect(()=>{const A=async()=>{try{L(!0),U(null);const H=await e(Z);G(H),N(H)}catch(H){U(H instanceof Error?H.message:"Failed to fetch options")}finally{L(!1)}};x&&t?t&&N(Z?B.filter(H=>n?n(H,Z):!0):B):A()},[e,Z,x,t,n]);const F=E.useCallback(A=>{A!==P&&(z(A),p(A)),_(!1)},[P,z,_,p]),K=E.useCallback(A=>{A!==V&&(q(A),m(A))},[V,q,m]);return S.jsx("div",{className:Me(v&&"cursor-not-allowed opacity-50",g),onFocus:()=>{_(!0)},onBlur:()=>_(!1),children:S.jsxs(bd,{shouldFilter:!1,className:"bg-transparent",children:[S.jsxs("div",{children:[S.jsx(Ny,{placeholder:f,value:I,className:"max-h-8",onValueChange:A=>{Y(A),A&&!C&&_(!0)}}),D&&T.length>0&&S.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:S.jsx(Ek,{className:"h-4 w-4 animate-spin"})})]}),S.jsxs(xd,{hidden:!C||Z.length===0,children:[R&&S.jsx("div",{className:"text-destructive p-4 text-center",children:R}),D&&T.length===0&&(l||S.jsx(w$,{})),!D&&!R&&T.length===0&&(o||S.jsx(Oy,{children:w??`No ${u.toLowerCase()} found.`})),S.jsx(Cs,{children:T.map((A,H)=>S.jsxs(S.Fragment,{children:[S.jsx(Ts,{value:i(A),onSelect:F,onMouseEnter:()=>K(i(A)),className:"truncate",children:r(A)},i(A)+`${H}`),H!==T.length-1&&S.jsx("div",{className:"bg-foreground/10 h-[1px]"},H)]}))})]})]})})}function w$(){return S.jsx(Cs,{children:S.jsx(Ts,{disabled:!0,children:S.jsxs("div",{className:"flex w-full items-center gap-2",children:[S.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),S.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[S.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),S.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}function S$(e){return S.jsxs("div",{children:[e.type==="nodes"&&S.jsx(v$,{id:e.id}),e.type==="edges"&&S.jsx(b$,{id:e.id}),e.type==="message"&&S.jsx("div",{children:e.message})]})}const Xm="__message_item",Wc={graph:null,searchEngine:null},E$=({onChange:e,onFocus:t,value:n})=>{const r=yt.use.sigmaGraph(),i=E.useMemo(()=>{if(Wc.graph==r)return Wc.searchEngine;if(!r||r.nodes().length==0)return;Wc.graph=r;const l=new la({idField:"id",fields:["label"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}}),u=r.nodes().map(f=>({id:f,label:r.getNodeAttribute(f,"label")}));return l.addAll(u),Wc.searchEngine=l,l},[r]),o=E.useCallback(async l=>{if(t&&t(null),!l||!i)return[];const u=i.search(l).map(f=>({id:f.id,type:"nodes"}));return u.length<=Vp?u:[...u.slice(0,Vp),{type:"message",id:Xm,message:`And ${u.length-Vp} others`}]},[i,t]);return S.jsx(x$,{className:"bg-background/60 w-24 rounded-xl border-1 opacity-60 backdrop-blur-lg transition-all hover:w-fit hover:opacity-100",fetcher:o,renderOption:S$,getOptionValue:l=>l.id,value:n&&n.type!=="message"?n.id:null,onChange:l=>{l!==Xm&&e(l?{id:l,type:"nodes"}:null)},onFocus:l=>{l!==Xm&&t&&t(l?{id:l,type:"nodes"}:null)},label:"item",placeholder:"Search nodes..."})},_$=({...e})=>S.jsx(E$,{...e});function k$({fetcher:e,preload:t,filterFn:n,renderOption:r,getOptionValue:i,getDisplayValue:o,notFound:l,loadingSkeleton:u,label:f,placeholder:d="Select...",value:p,onChange:m,disabled:v=!1,className:g,triggerClassName:w,searchInputClassName:x,noResultsMessage:k,triggerTooltip:C,clearable:_=!0}){const[T,N]=E.useState(!1),[D,L]=E.useState(!1),[R,U]=E.useState([]),[P,z]=E.useState(!1),[V,q]=E.useState(null),[I,Y]=E.useState(p),[Z,B]=E.useState(null),[G,F]=E.useState(""),K=My(G,t?0:150),[A,H]=E.useState([]);E.useEffect(()=>{N(!0),Y(p)},[p]),E.useEffect(()=>{if(p&&R.length>0){const O=R.find(X=>i(X)===p);O&&B(O)}},[p,R,i]),E.useEffect(()=>{T||(async()=>{try{z(!0),q(null);const X=await e(p);H(X),U(X)}catch(X){q(X instanceof Error?X.message:"Failed to fetch options")}finally{z(!1)}})()},[T,e,p]),E.useEffect(()=>{const O=async()=>{try{z(!0),q(null);const X=await e(K);H(X),U(X)}catch(X){q(X instanceof Error?X.message:"Failed to fetch options")}finally{z(!1)}};T&&t?t&&U(K?A.filter(X=>n?n(X,K):!0):A):O()},[e,K,T,t,n]);const M=E.useCallback(O=>{const X=_&&O===I?"":O;Y(X),B(R.find(re=>i(re)===X)||null),m(X),L(!1)},[I,m,_,R,i]);return S.jsxs(dd,{open:D,onOpenChange:L,children:[S.jsx(hd,{asChild:!0,children:S.jsxs(Ot,{variant:"outline",role:"combobox","aria-expanded":D,className:Me("justify-between",v&&"cursor-not-allowed opacity-50",w),disabled:v,tooltip:C,side:"bottom",children:[Z?o(Z):d,S.jsx(xM,{className:"opacity-50",size:10})]})}),S.jsx(uu,{className:Me("p-0",g),onCloseAutoFocus:O=>O.preventDefault(),children:S.jsxs(bd,{shouldFilter:!1,children:[S.jsxs("div",{className:"relative w-full border-b",children:[S.jsx(Ny,{placeholder:`Search ${f.toLowerCase()}...`,value:G,onValueChange:O=>{F(O)},className:x}),P&&R.length>0&&S.jsx("div",{className:"absolute top-1/2 right-2 flex -translate-y-1/2 transform items-center",children:S.jsx(Ek,{className:"h-4 w-4 animate-spin"})})]}),S.jsxs(xd,{children:[V&&S.jsx("div",{className:"text-destructive p-4 text-center",children:V}),P&&R.length===0&&(u||S.jsx(C$,{})),!P&&!V&&R.length===0&&(l||S.jsx(Oy,{children:k??`No ${f.toLowerCase()} found.`})),S.jsx(Cs,{children:R.map(O=>S.jsxs(Ts,{value:i(O),onSelect:M,className:"truncate",children:[r(O),S.jsx(Lv,{className:Me("ml-auto h-3 w-3",I===i(O)?"opacity-100":"opacity-0")})]},i(O)))})]})]})})]})}function C$(){return S.jsx(Cs,{children:S.jsx(Ts,{disabled:!0,children:S.jsxs("div",{className:"flex w-full items-center gap-2",children:[S.jsx("div",{className:"bg-muted h-6 w-6 animate-pulse rounded-full"}),S.jsxs("div",{className:"flex flex-1 flex-col gap-1",children:[S.jsx("div",{className:"bg-muted h-4 w-24 animate-pulse rounded"}),S.jsx("div",{className:"bg-muted h-3 w-16 animate-pulse rounded"})]})]})})})}const T$=()=>{const e=Qe.use.queryLabel(),[t,n]=E.useState({labels:[],searchEngine:null}),[r,i]=E.useState(!1),o=E.useCallback(async u=>{let f=t.labels,d=t.searchEngine;if(!r||!d){f=["*"].concat(await iM()),f.includes(Qe.getState().queryLabel)||Qe.getState().setQueryLabel(f[0]),d=new la({idField:"id",fields:["value"],searchOptions:{prefix:!0,fuzzy:.2,boost:{label:2}}});const p=f.map((m,v)=>({id:v,value:m}));d.addAll(p),n({labels:f,searchEngine:d}),i(!0)}return u?d.search(u).map(p=>f[p.id]):f},[t,r,n,i]),l=E.useCallback(u=>{Qe.getState().setQueryLabel(u)},[]);return S.jsx(k$,{className:"ml-2",triggerClassName:"max-h-8",searchInputClassName:"max-h-8",triggerTooltip:"Select query label",fetcher:o,renderOption:u=>S.jsx("div",{children:u}),getOptionValue:u=>u,getDisplayValue:u=>S.jsx("div",{children:u}),notFound:S.jsx("div",{className:"py-6 text-center text-sm",children:"No labels found"}),label:"Label",placeholder:"Search labels...",value:e!==null?e:"",onChange:l})},jn=({text:e,className:t,tooltipClassName:n,tooltip:r,side:i,onClick:o})=>r?S.jsx(XC,{delayDuration:200,children:S.jsxs(KC,{children:[S.jsx(ZC,{asChild:!0,children:S.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e})}),S.jsx(ly,{side:i,className:n,children:r})]})}):S.jsx("label",{className:Me(t,o!==void 0?"cursor-pointer":void 0),onClick:o,children:e}),A$=()=>{const{getNode:e,getEdge:t}=eR(),n=yt.use.selectedNode(),r=yt.use.focusedNode(),i=yt.use.selectedEdge(),o=yt.use.focusedEdge(),[l,u]=E.useState(null),[f,d]=E.useState(null);return E.useEffect(()=>{let p=null,m=null;r?(p="node",m=e(r)):n?(p="node",m=e(n)):o?(p="edge",m=t(o,!0)):i&&(p="edge",m=t(i,!0)),m?(p=="node"?u(R$(m)):u(D$(m)),d(p)):(u(null),d(null))},[r,n,o,i,u,d,e,t]),l?S.jsx("div",{className:"bg-background/80 max-w-xs rounded-lg border-2 p-2 text-xs backdrop-blur-lg",children:f=="node"?S.jsx(N$,{node:l}):S.jsx(O$,{edge:l})}):S.jsx(S.Fragment,{})},R$=e=>{const t=yt.getState(),n=[];if(t.sigmaGraph&&t.rawGraph)for(const r of t.sigmaGraph.edges(e.id)){const i=t.rawGraph.getEdge(r,!0);if(i){const o=e.id===i.source,l=o?i.target:i.source,u=t.rawGraph.getNode(l);u&&n.push({type:o?"Target":"Source",id:l,label:u.labels.join(", ")})}}return{...e,relationships:n}},D$=e=>{var i,o;const t=yt.getState(),n=(i=t.rawGraph)==null?void 0:i.getNode(e.source),r=(o=t.rawGraph)==null?void 0:o.getNode(e.target);return{...e,sourceNode:n,targetNode:r}},Br=({name:e,value:t,onClick:n,tooltip:r})=>S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("label",{className:"text-primary/60 tracking-wide",children:e}),":",S.jsx(jn,{className:"hover:bg-primary/20 rounded p-1 text-ellipsis",tooltipClassName:"max-w-80",text:t,tooltip:r||t,side:"left",onClick:n})]}),N$=({node:e})=>S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-sky-300",children:"Node"}),S.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[S.jsx(Br,{name:"Id",value:e.id}),S.jsx(Br,{name:"Labels",value:e.labels.join(", "),onClick:()=>{yt.getState().setSelectedNode(e.id,!0)}}),S.jsx(Br,{name:"Degree",value:e.degree})]}),S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>S.jsx(Br,{name:t,value:e.properties[t]},t))}),e.relationships.length>0&&S.jsxs(S.Fragment,{children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600/90",children:"Relationships"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:e.relationships.map(({type:t,id:n,label:r})=>S.jsx(Br,{name:t,value:r,onClick:()=>{yt.getState().setSelectedNode(n,!0)}},n))})]})]}),O$=({edge:e})=>S.jsxs("div",{className:"flex flex-col gap-2",children:[S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-teal-600",children:"Relationship"}),S.jsxs("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:[S.jsx(Br,{name:"Id",value:e.id}),e.type&&S.jsx(Br,{name:"Type",value:e.type}),S.jsx(Br,{name:"Source",value:e.sourceNode?e.sourceNode.labels.join(", "):e.source,onClick:()=>{yt.getState().setSelectedNode(e.source,!0)}}),S.jsx(Br,{name:"Target",value:e.targetNode?e.targetNode.labels.join(", "):e.target,onClick:()=>{yt.getState().setSelectedNode(e.target,!0)}})]}),S.jsx("label",{className:"text-md pl-1 font-bold tracking-wide text-yellow-400/90",children:"Properties"}),S.jsx("div",{className:"bg-primary/5 max-h-96 overflow-auto rounded p-1",children:Object.keys(e.properties).sort().map(t=>S.jsx(Br,{name:t,value:e.properties[t]},t))})]}),pE={allowInvalidContainer:!0,defaultNodeType:"default",defaultEdgeType:"curvedArrow",renderEdgeLabels:!1,edgeProgramClasses:{arrow:dA,curvedArrow:nB,curvedNoArrow:tB},nodeProgramClasses:{default:FU,circel:fu,point:dU},labelGridCellSize:60,labelRenderedSizeThreshold:12,enableEdgeEvents:!0,labelColor:{color:"#000",attribute:"labelColor"},edgeLabelColor:{color:"#000",attribute:"labelColor"},edgeLabelSize:8,labelSize:12},j$=()=>{const e=xA(),t=hr(),[n,r]=E.useState(null);return E.useEffect(()=>{e({downNode:i=>{r(i.node),t.getGraph().setNodeAttribute(i.node,"highlighted",!0)},mousemovebody:i=>{if(!n)return;const o=t.viewportToGraph(i);t.getGraph().setNodeAttribute(n,"x",o.x),t.getGraph().setNodeAttribute(n,"y",o.y),i.preventSigmaDefault(),i.original.preventDefault(),i.original.stopPropagation()},mouseup:()=>{n&&(r(null),t.getGraph().removeNodeAttribute(n,"highlighted"))},mousedown:()=>{t.getCustomBBox()||t.setCustomBBox(t.getBBox())}})},[e,t,n]),null},L$=()=>{const[e,t]=E.useState(pE),n=yt.use.selectedNode(),r=yt.use.focusedNode(),i=yt.use.moveToSelectedNode(),o=Qe.use.showPropertyPanel(),l=Qe.use.showNodeSearchBar(),u=Qe.use.showNodeLabel(),f=Qe.use.enableEdgeEvents(),d=Qe.use.enableNodeDrag(),p=Qe.use.showEdgeLabel();E.useEffect(()=>{t({...pE,enableEdgeEvents:f,renderEdgeLabels:p,renderLabels:u})},[u,f,p]);const m=E.useCallback(x=>{x===null?yt.getState().setFocusedNode(null):x.type==="nodes"&&yt.getState().setFocusedNode(x.id)},[]),v=E.useCallback(x=>{x===null?yt.getState().setSelectedNode(null):x.type==="nodes"&&yt.getState().setSelectedNode(x.id,!0)},[]),g=E.useMemo(()=>r??n,[r,n]),w=E.useMemo(()=>n?{type:"nodes",id:n}:null,[n]);return S.jsxs(oU,{settings:e,className:"!bg-background !size-full overflow-hidden",children:[S.jsx(Y6,{}),d&&S.jsx(j$,{}),S.jsx(aB,{node:g,move:i}),S.jsxs("div",{className:"absolute top-2 left-2 flex items-start gap-2",children:[S.jsx(T$,{}),l&&S.jsx(_$,{value:w,onFocus:m,onChange:v})]}),S.jsxs("div",{className:"bg-background/60 absolute bottom-2 left-2 flex flex-col rounded-xl border-2 backdrop-blur-lg",children:[S.jsx(i$,{}),S.jsx(W6,{}),S.jsx(E6,{}),S.jsx(X6,{})]}),o&&S.jsx("div",{className:"absolute top-2 right-2",children:S.jsx(A$,{})})]})},gR=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{className:"relative w-full overflow-auto",children:S.jsx("table",{ref:n,className:Me("w-full caption-bottom text-sm",e),...t})}));gR.displayName="Table";const vR=E.forwardRef(({className:e,...t},n)=>S.jsx("thead",{ref:n,className:Me("[&_tr]:border-b",e),...t}));vR.displayName="TableHeader";const yR=E.forwardRef(({className:e,...t},n)=>S.jsx("tbody",{ref:n,className:Me("[&_tr:last-child]:border-0",e),...t}));yR.displayName="TableBody";const z$=E.forwardRef(({className:e,...t},n)=>S.jsx("tfoot",{ref:n,className:Me("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));z$.displayName="TableFooter";const nv=E.forwardRef(({className:e,...t},n)=>S.jsx("tr",{ref:n,className:Me("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));nv.displayName="TableRow";const bi=E.forwardRef(({className:e,...t},n)=>S.jsx("th",{ref:n,className:Me("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));bi.displayName="TableHead";const xi=E.forwardRef(({className:e,...t},n)=>S.jsx("td",{ref:n,className:Me("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));xi.displayName="TableCell";const M$=E.forwardRef(({className:e,...t},n)=>S.jsx("caption",{ref:n,className:Me("text-muted-foreground mt-4 text-sm",e),...t}));M$.displayName="TableCaption";const Kl=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("bg-card text-card-foreground rounded-xl border shadow",e),...t}));Kl.displayName="Card";const Of=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("flex flex-col space-y-1.5 p-6",e),...t}));Of.displayName="CardHeader";const Zl=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("leading-none font-semibold tracking-tight",e),...t}));Zl.displayName="CardTitle";const wd=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("text-muted-foreground text-sm",e),...t}));wd.displayName="CardDescription";const jf=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("p-6 pt-0",e),...t}));jf.displayName="CardContent";const P$=E.forwardRef(({className:e,...t},n)=>S.jsx("div",{ref:n,className:Me("flex items-center p-6 pt-0",e),...t}));P$.displayName="CardFooter";function F$({title:e,description:t,icon:n=TM,action:r,className:i,...o}){return S.jsxs(Kl,{className:Me("flex w-full flex-col items-center justify-center space-y-6 bg-transparent p-16",i),...o,children:[S.jsx("div",{className:"mr-4 shrink-0 rounded-full border border-dashed p-4",children:S.jsx(n,{className:"text-muted-foreground size-8","aria-hidden":"true"})}),S.jsxs("div",{className:"flex flex-col items-center gap-1.5 text-center",children:[S.jsx(Zl,{children:e}),t?S.jsx(wd,{children:t}):null]}),r||null]})}var Km={exports:{}},Zm,mE;function I$(){if(mE)return Zm;mE=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Zm=e,Zm}var Qm,gE;function G$(){if(gE)return Qm;gE=1;var e=I$();function t(){}function n(){}return n.resetWarningCache=t,Qm=function(){function r(l,u,f,d,p,m){if(m!==e){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Qm}var vE;function U$(){return vE||(vE=1,Km.exports=G$()()),Km.exports}var B$=U$();const Ct=fn(B$),$$=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function ds(e,t,n){const r=H$(e),{webkitRelativePath:i}=e,o=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&yE(r,"path",o),yE(r,"relativePath",o),r}function H$(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=$$.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function yE(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const V$=[".DS_Store","Thumbs.db"];function q$(e){return no(this,void 0,void 0,function*(){return Lf(e)&&Y$(e.dataTransfer)?Z$(e.dataTransfer,e.type):W$(e)?X$(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?K$(e):[]})}function Y$(e){return Lf(e)}function W$(e){return Lf(e)&&Lf(e.target)}function Lf(e){return typeof e=="object"&&e!==null}function X$(e){return rv(e.target.files).map(t=>ds(t))}function K$(e){return no(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>ds(n))})}function Z$(e,t){return no(this,void 0,void 0,function*(){if(e.items){const n=rv(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(Q$));return bE(bR(r))}return bE(rv(e.files).map(n=>ds(n)))})}function bE(e){return e.filter(t=>V$.indexOf(t.name)===-1)}function rv(e){if(e===null)return[];const t=[];for(let n=0;n[...t,...Array.isArray(n)?bR(n):[n]],[])}function xE(e,t){return no(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const o=yield e.getAsFileSystemHandle();if(o===null)throw new Error(`${e} is not a File`);if(o!==void 0){const l=yield o.getFile();return l.handle=o,ds(l)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return ds(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function J$(e){return no(this,void 0,void 0,function*(){return e.isDirectory?xR(e):eH(e)})}function xR(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function o(){t.readEntries(l=>no(this,void 0,void 0,function*(){if(l.length){const u=Promise.all(l.map(J$));i.push(u),o()}else try{const u=yield Promise.all(i);n(u)}catch(u){r(u)}}),l=>{r(l)})}o()})}function eH(e){return no(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=ds(r,e.fullPath);t(i)},r=>{n(r)})})})}var Xc={},wE;function tH(){return wE||(wE=1,Xc.__esModule=!0,Xc.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(l){var u=l.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?o===u.replace(/\/.*$/,""):i===u})}return!0}),Xc}var nH=tH();const Jm=fn(nH);function SE(e){return aH(e)||iH(e)||SR(e)||rH()}function rH(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iH(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function aH(e){if(Array.isArray(e))return iv(e)}function EE(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _E(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:cH,message:"File type must be ".concat(r)}},kE=function(t){return{code:fH,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},CE=function(t){return{code:dH,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},mH={code:hH,message:"Too many files"};function ER(e,t){var n=e.type==="application/x-moz-file"||uH(e,t);return[n,n?null:pH(t)]}function _R(e,t,n){if(Ha(e.size))if(Ha(t)&&Ha(n)){if(e.size>n)return[!1,kE(n)];if(e.sizen)return[!1,kE(n)]}return[!0,null]}function Ha(e){return e!=null}function gH(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,l=e.maxFiles,u=e.validator;return!o&&t.length>1||o&&l>=1&&t.length>l?!1:t.every(function(f){var d=ER(f,n),p=Ql(d,1),m=p[0],v=_R(f,r,i),g=Ql(v,1),w=g[0],x=u?u(f):null;return m&&w&&!x})}function zf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Kc(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function TE(e){e.preventDefault()}function vH(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function yH(e){return e.indexOf("Edge/")!==-1}function bH(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return vH(e)||yH(e)}function Ir(){for(var e=arguments.length,t=new Array(e),n=0;n1?i-1:0),l=1;le.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function MH(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}var Sd=E.forwardRef(function(e,t){var n=e.children,r=Mf(e,kH),i=PH(r),o=i.open,l=Mf(i,CH);return E.useImperativeHandle(t,function(){return{open:o}},[o]),be.createElement(E.Fragment,null,n(zt(zt({},l),{},{open:o})))});Sd.displayName="Dropzone";var AR={disabled:!1,getFilesFromEvent:q$,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};Sd.defaultProps=AR;Sd.propTypes={children:Ct.func,accept:Ct.objectOf(Ct.arrayOf(Ct.string)),multiple:Ct.bool,preventDropOnDocument:Ct.bool,noClick:Ct.bool,noKeyboard:Ct.bool,noDrag:Ct.bool,noDragEventsBubbling:Ct.bool,minSize:Ct.number,maxSize:Ct.number,maxFiles:Ct.number,disabled:Ct.bool,getFilesFromEvent:Ct.func,onFileDialogCancel:Ct.func,onFileDialogOpen:Ct.func,useFsAccessApi:Ct.bool,autoFocus:Ct.bool,onDragEnter:Ct.func,onDragLeave:Ct.func,onDragOver:Ct.func,onDrop:Ct.func,onDropAccepted:Ct.func,onDropRejected:Ct.func,onError:Ct.func,validator:Ct.func};var sv={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function PH(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=zt(zt({},AR),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,l=t.minSize,u=t.multiple,f=t.maxFiles,d=t.onDragEnter,p=t.onDragLeave,m=t.onDragOver,v=t.onDrop,g=t.onDropAccepted,w=t.onDropRejected,x=t.onFileDialogCancel,k=t.onFileDialogOpen,C=t.useFsAccessApi,_=t.autoFocus,T=t.preventDropOnDocument,N=t.noClick,D=t.noKeyboard,L=t.noDrag,R=t.noDragEventsBubbling,U=t.onError,P=t.validator,z=E.useMemo(function(){return SH(n)},[n]),V=E.useMemo(function(){return wH(n)},[n]),q=E.useMemo(function(){return typeof k=="function"?k:RE},[k]),I=E.useMemo(function(){return typeof x=="function"?x:RE},[x]),Y=E.useRef(null),Z=E.useRef(null),B=E.useReducer(FH,sv),G=eg(B,2),F=G[0],K=G[1],A=F.isFocused,H=F.isFileDialogActive,M=E.useRef(typeof window<"u"&&window.isSecureContext&&C&&xH()),O=function(){!M.current&&H&&setTimeout(function(){if(Z.current){var Ne=Z.current.files;Ne.length||(K({type:"closeDialog"}),I())}},300)};E.useEffect(function(){return window.addEventListener("focus",O,!1),function(){window.removeEventListener("focus",O,!1)}},[Z,H,I,M]);var X=E.useRef([]),re=function(Ne){Y.current&&Y.current.contains(Ne.target)||(Ne.preventDefault(),X.current=[])};E.useEffect(function(){return T&&(document.addEventListener("dragover",TE,!1),document.addEventListener("drop",re,!1)),function(){T&&(document.removeEventListener("dragover",TE),document.removeEventListener("drop",re))}},[Y,T]),E.useEffect(function(){return!r&&_&&Y.current&&Y.current.focus(),function(){}},[Y,_,r]);var ue=E.useCallback(function(ve){U?U(ve):console.error(ve)},[U]),ae=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve),X.current=[].concat(RH(X.current),[ve.target]),Kc(ve)&&Promise.resolve(i(ve)).then(function(Ne){if(!(zf(ve)&&!R)){var te=Ne.length,de=te>0&&gH({files:Ne,accept:z,minSize:l,maxSize:o,multiple:u,maxFiles:f,validator:P}),Oe=te>0&&!de;K({isDragAccept:de,isDragReject:Oe,isDragActive:!0,type:"setDraggedFiles"}),d&&d(ve)}}).catch(function(Ne){return ue(Ne)})},[i,d,ue,R,z,l,o,u,f,P]),oe=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve);var Ne=Kc(ve);if(Ne&&ve.dataTransfer)try{ve.dataTransfer.dropEffect="copy"}catch{}return Ne&&m&&m(ve),!1},[m,R]),Ce=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve);var Ne=X.current.filter(function(de){return Y.current&&Y.current.contains(de)}),te=Ne.indexOf(ve.target);te!==-1&&Ne.splice(te,1),X.current=Ne,!(Ne.length>0)&&(K({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Kc(ve)&&p&&p(ve))},[Y,p,R]),he=E.useCallback(function(ve,Ne){var te=[],de=[];ve.forEach(function(Oe){var He=ER(Oe,z),Ye=eg(He,2),vt=Ye[0],Mt=Ye[1],bt=_R(Oe,l,o),rt=eg(bt,2),qt=rt[0],at=rt[1],At=P?P(Oe):null;if(vt&&qt&&!At)te.push(Oe);else{var rn=[Mt,at];At&&(rn=rn.concat(At)),de.push({file:Oe,errors:rn.filter(function(io){return io})})}}),(!u&&te.length>1||u&&f>=1&&te.length>f)&&(te.forEach(function(Oe){de.push({file:Oe,errors:[mH]})}),te.splice(0)),K({acceptedFiles:te,fileRejections:de,isDragReject:de.length>0,type:"setFiles"}),v&&v(te,de,Ne),de.length>0&&w&&w(de,Ne),te.length>0&&g&&g(te,Ne)},[K,u,z,l,o,f,v,g,w,P]),Ee=E.useCallback(function(ve){ve.preventDefault(),ve.persist(),Se(ve),X.current=[],Kc(ve)&&Promise.resolve(i(ve)).then(function(Ne){zf(ve)&&!R||he(Ne,ve)}).catch(function(Ne){return ue(Ne)}),K({type:"reset"})},[i,he,ue,R]),we=E.useCallback(function(){if(M.current){K({type:"openDialog"}),q();var ve={multiple:u,types:V};window.showOpenFilePicker(ve).then(function(Ne){return i(Ne)}).then(function(Ne){he(Ne,null),K({type:"closeDialog"})}).catch(function(Ne){EH(Ne)?(I(Ne),K({type:"closeDialog"})):_H(Ne)?(M.current=!1,Z.current?(Z.current.value=null,Z.current.click()):ue(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):ue(Ne)});return}Z.current&&(K({type:"openDialog"}),q(),Z.current.value=null,Z.current.click())},[K,q,I,C,he,ue,V,u]),Pe=E.useCallback(function(ve){!Y.current||!Y.current.isEqualNode(ve.target)||(ve.key===" "||ve.key==="Enter"||ve.keyCode===32||ve.keyCode===13)&&(ve.preventDefault(),we())},[Y,we]),Ae=E.useCallback(function(){K({type:"focus"})},[]),xe=E.useCallback(function(){K({type:"blur"})},[]),ee=E.useCallback(function(){N||(bH()?setTimeout(we,0):we())},[N,we]),ce=function(Ne){return r?null:Ne},Te=function(Ne){return D?null:ce(Ne)},ge=function(Ne){return L?null:ce(Ne)},Se=function(Ne){R&&Ne.stopPropagation()},ie=E.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=ve.refKey,te=Ne===void 0?"ref":Ne,de=ve.role,Oe=ve.onKeyDown,He=ve.onFocus,Ye=ve.onBlur,vt=ve.onClick,Mt=ve.onDragEnter,bt=ve.onDragOver,rt=ve.onDragLeave,qt=ve.onDrop,at=Mf(ve,TH);return zt(zt(ov({onKeyDown:Te(Ir(Oe,Pe)),onFocus:Te(Ir(He,Ae)),onBlur:Te(Ir(Ye,xe)),onClick:ce(Ir(vt,ee)),onDragEnter:ge(Ir(Mt,ae)),onDragOver:ge(Ir(bt,oe)),onDragLeave:ge(Ir(rt,Ce)),onDrop:ge(Ir(qt,Ee)),role:typeof de=="string"&&de!==""?de:"presentation"},te,Y),!r&&!D?{tabIndex:0}:{}),at)}},[Y,Pe,Ae,xe,ee,ae,oe,Ce,Ee,D,L,r]),$e=E.useCallback(function(ve){ve.stopPropagation()},[]),Ge=E.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ne=ve.refKey,te=Ne===void 0?"ref":Ne,de=ve.onChange,Oe=ve.onClick,He=Mf(ve,AH),Ye=ov({accept:z,multiple:u,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:ce(Ir(de,Ee)),onClick:ce(Ir(Oe,$e)),tabIndex:-1},te,Z);return zt(zt({},Ye),He)}},[Z,n,u,Ee,r]);return zt(zt({},F),{},{isFocused:A&&!r,getRootProps:ie,getInputProps:Ge,rootRef:Y,inputRef:Z,open:ce(we)})}function FH(e,t){switch(t.type){case"focus":return zt(zt({},e),{},{isFocused:!0});case"blur":return zt(zt({},e),{},{isFocused:!1});case"openDialog":return zt(zt({},sv),{},{isFileDialogActive:!0});case"closeDialog":return zt(zt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return zt(zt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return zt(zt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return zt({},sv);default:return e}}function RE(){}var Py="Progress",Fy=100,[IH,vK]=dr(Py),[GH,UH]=IH(Py),RR=E.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:o=BH,...l}=e;(i||i===0)&&!DE(i)&&console.error($H(`${i}`,"Progress"));const u=DE(i)?i:Fy;r!==null&&!NE(r,u)&&console.error(HH(`${r}`,"Progress"));const f=NE(r,u)?r:null,d=Pf(f)?o(f,u):void 0;return S.jsx(GH,{scope:n,value:f,max:u,children:S.jsx(We.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":Pf(f)?f:void 0,"aria-valuetext":d,role:"progressbar","data-state":OR(f,u),"data-value":f??void 0,"data-max":u,...l,ref:t})})});RR.displayName=Py;var DR="ProgressIndicator",NR=E.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=UH(DR,n);return S.jsx(We.div,{"data-state":OR(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});NR.displayName=DR;function BH(e,t){return`${Math.round(e/t*100)}%`}function OR(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Pf(e){return typeof e=="number"}function DE(e){return Pf(e)&&!isNaN(e)&&e>0}function NE(e,t){return Pf(e)&&!isNaN(e)&&e<=t&&e>=0}function $H(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Fy}\`.`}function HH(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: - a positive number - less than the value passed to \`max\` (or ${Fy} if no \`max\` prop is set) - \`null\` or \`undefined\` if the progress is indeterminate. Defaulting to \`null\`.`}var jR=RR,VH=NR;const LR=E.forwardRef(({className:e,value:t,...n},r)=>S.jsx(jR,{ref:r,className:Me("bg-secondary relative h-4 w-full overflow-hidden rounded-full",e),...n,children:S.jsx(VH,{className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));LR.displayName=jR.displayName;function lv(e,[t,n]){return Math.min(n,Math.max(t,e))}function qH(e,t){return E.useReducer((n,r)=>t[n][r]??n,e)}var Iy="ScrollArea",[zR,yK]=dr(Iy),[YH,pr]=zR(Iy),MR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:o=600,...l}=e,[u,f]=E.useState(null),[d,p]=E.useState(null),[m,v]=E.useState(null),[g,w]=E.useState(null),[x,k]=E.useState(null),[C,_]=E.useState(0),[T,N]=E.useState(0),[D,L]=E.useState(!1),[R,U]=E.useState(!1),P=dt(t,V=>f(V)),z=pd(i);return S.jsx(YH,{scope:n,type:r,dir:z,scrollHideDelay:o,scrollArea:u,viewport:d,onViewportChange:p,content:m,onContentChange:v,scrollbarX:g,onScrollbarXChange:w,scrollbarXEnabled:D,onScrollbarXEnabledChange:L,scrollbarY:x,onScrollbarYChange:k,scrollbarYEnabled:R,onScrollbarYEnabledChange:U,onCornerWidthChange:_,onCornerHeightChange:N,children:S.jsx(We.div,{dir:z,...l,ref:P,style:{position:"relative","--radix-scroll-area-corner-width":C+"px","--radix-scroll-area-corner-height":T+"px",...e.style}})})});MR.displayName=Iy;var PR="ScrollAreaViewport",FR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...o}=e,l=pr(PR,n),u=E.useRef(null),f=dt(t,u,l.onViewportChange);return S.jsxs(S.Fragment,{children:[S.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),S.jsx(We.div,{"data-radix-scroll-area-viewport":"",...o,ref:f,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:S.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});FR.displayName=PR;var Xr="ScrollAreaScrollbar",Gy=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=pr(Xr,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:l}=i,u=e.orientation==="horizontal";return E.useEffect(()=>(u?o(!0):l(!0),()=>{u?o(!1):l(!1)}),[u,o,l]),i.type==="hover"?S.jsx(WH,{...r,ref:t,forceMount:n}):i.type==="scroll"?S.jsx(XH,{...r,ref:t,forceMount:n}):i.type==="auto"?S.jsx(IR,{...r,ref:t,forceMount:n}):i.type==="always"?S.jsx(Uy,{...r,ref:t}):null});Gy.displayName=Xr;var WH=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=pr(Xr,e.__scopeScrollArea),[o,l]=E.useState(!1);return E.useEffect(()=>{const u=i.scrollArea;let f=0;if(u){const d=()=>{window.clearTimeout(f),l(!0)},p=()=>{f=window.setTimeout(()=>l(!1),i.scrollHideDelay)};return u.addEventListener("pointerenter",d),u.addEventListener("pointerleave",p),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",d),u.removeEventListener("pointerleave",p)}}},[i.scrollArea,i.scrollHideDelay]),S.jsx(Kn,{present:n||o,children:S.jsx(IR,{"data-state":o?"visible":"hidden",...r,ref:t})})}),XH=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=pr(Xr,e.__scopeScrollArea),o=e.orientation==="horizontal",l=_d(()=>f("SCROLL_END"),100),[u,f]=qH("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return E.useEffect(()=>{if(u==="idle"){const d=window.setTimeout(()=>f("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(d)}},[u,i.scrollHideDelay,f]),E.useEffect(()=>{const d=i.viewport,p=o?"scrollLeft":"scrollTop";if(d){let m=d[p];const v=()=>{const g=d[p];m!==g&&(f("SCROLL"),l()),m=g};return d.addEventListener("scroll",v),()=>d.removeEventListener("scroll",v)}},[i.viewport,o,f,l]),S.jsx(Kn,{present:n||u!=="hidden",children:S.jsx(Uy,{"data-state":u==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:qe(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:qe(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),IR=E.forwardRef((e,t)=>{const n=pr(Xr,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,l]=E.useState(!1),u=e.orientation==="horizontal",f=_d(()=>{if(n.viewport){const d=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,i=pr(Xr,e.__scopeScrollArea),o=E.useRef(null),l=E.useRef(0),[u,f]=E.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=HR(u.viewport,u.content),p={...r,sizes:u,onSizesChange:f,hasThumb:d>0&&d<1,onThumbChange:v=>o.current=v,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:v=>l.current=v};function m(v,g){return t9(v,l.current,u,g)}return n==="horizontal"?S.jsx(KH,{...p,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollLeft,g=OE(v,u,i.dir);o.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:v=>{i.viewport&&(i.viewport.scrollLeft=v)},onDragScroll:v=>{i.viewport&&(i.viewport.scrollLeft=m(v,i.dir))}}):n==="vertical"?S.jsx(ZH,{...p,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const v=i.viewport.scrollTop,g=OE(v,u);o.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:v=>{i.viewport&&(i.viewport.scrollTop=v)},onDragScroll:v=>{i.viewport&&(i.viewport.scrollTop=m(v))}}):null}),KH=E.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=pr(Xr,e.__scopeScrollArea),[l,u]=E.useState(),f=E.useRef(null),d=dt(t,f,o.onScrollbarXChange);return E.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),S.jsx(UR,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Ed(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,m)=>{if(o.viewport){const v=o.viewport.scrollLeft+p.deltaX;e.onWheelScroll(v),qR(v,m)&&p.preventDefault()}},onResize:()=>{f.current&&o.viewport&&l&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:If(l.paddingLeft),paddingEnd:If(l.paddingRight)}})}})}),ZH=E.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,o=pr(Xr,e.__scopeScrollArea),[l,u]=E.useState(),f=E.useRef(null),d=dt(t,f,o.onScrollbarYChange);return E.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),S.jsx(UR,{"data-orientation":"vertical",...i,ref:d,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Ed(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,m)=>{if(o.viewport){const v=o.viewport.scrollTop+p.deltaY;e.onWheelScroll(v),qR(v,m)&&p.preventDefault()}},onResize:()=>{f.current&&o.viewport&&l&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:If(l.paddingTop),paddingEnd:If(l.paddingBottom)}})}})}),[QH,GR]=zR(Xr),UR=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:l,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:d,onWheelScroll:p,onResize:m,...v}=e,g=pr(Xr,n),[w,x]=E.useState(null),k=dt(t,P=>x(P)),C=E.useRef(null),_=E.useRef(""),T=g.viewport,N=r.content-r.viewport,D=un(p),L=un(f),R=_d(m,10);function U(P){if(C.current){const z=P.clientX-C.current.left,V=P.clientY-C.current.top;d({x:z,y:V})}}return E.useEffect(()=>{const P=z=>{const V=z.target;(w==null?void 0:w.contains(V))&&D(z,N)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[T,w,N,D]),E.useEffect(L,[r,L]),hs(w,R),hs(g.content,R),S.jsx(QH,{scope:n,scrollbar:w,hasThumb:i,onThumbChange:un(o),onThumbPointerUp:un(l),onThumbPositionChange:L,onThumbPointerDown:un(u),children:S.jsx(We.div,{...v,ref:k,style:{position:"absolute",...v.style},onPointerDown:qe(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),C.current=w.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),U(P))}),onPointerMove:qe(e.onPointerMove,U),onPointerUp:qe(e.onPointerUp,P=>{const z=P.target;z.hasPointerCapture(P.pointerId)&&z.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=_.current,g.viewport&&(g.viewport.style.scrollBehavior=""),C.current=null})})})}),Ff="ScrollAreaThumb",BR=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=GR(Ff,e.__scopeScrollArea);return S.jsx(Kn,{present:n||i.hasThumb,children:S.jsx(JH,{ref:t,...r})})}),JH=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,o=pr(Ff,n),l=GR(Ff,n),{onThumbPositionChange:u}=l,f=dt(t,m=>l.onThumbChange(m)),d=E.useRef(void 0),p=_d(()=>{d.current&&(d.current(),d.current=void 0)},100);return E.useEffect(()=>{const m=o.viewport;if(m){const v=()=>{if(p(),!d.current){const g=n9(m,u);d.current=g,u()}};return u(),m.addEventListener("scroll",v),()=>m.removeEventListener("scroll",v)}},[o.viewport,p,u]),S.jsx(We.div,{"data-state":l.hasThumb?"visible":"hidden",...i,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:qe(e.onPointerDownCapture,m=>{const g=m.target.getBoundingClientRect(),w=m.clientX-g.left,x=m.clientY-g.top;l.onThumbPointerDown({x:w,y:x})}),onPointerUp:qe(e.onPointerUp,l.onThumbPointerUp)})});BR.displayName=Ff;var By="ScrollAreaCorner",$R=E.forwardRef((e,t)=>{const n=pr(By,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?S.jsx(e9,{...e,ref:t}):null});$R.displayName=By;var e9=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=pr(By,n),[o,l]=E.useState(0),[u,f]=E.useState(0),d=!!(o&&u);return hs(i.scrollbarX,()=>{var m;const p=((m=i.scrollbarX)==null?void 0:m.offsetHeight)||0;i.onCornerHeightChange(p),f(p)}),hs(i.scrollbarY,()=>{var m;const p=((m=i.scrollbarY)==null?void 0:m.offsetWidth)||0;i.onCornerWidthChange(p),l(p)}),d?S.jsx(We.div,{...r,ref:t,style:{width:o,height:u,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function If(e){return e?parseInt(e,10):0}function HR(e,t){const n=e/t;return isNaN(n)?0:n}function Ed(e){const t=HR(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function t9(e,t,n,r="ltr"){const i=Ed(n),o=i/2,l=t||o,u=i-l,f=n.scrollbar.paddingStart+l,d=n.scrollbar.size-n.scrollbar.paddingEnd-u,p=n.content-n.viewport,m=r==="ltr"?[0,p]:[p*-1,0];return VR([f,d],m)(e)}function OE(e,t,n="ltr"){const r=Ed(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,l=t.content-t.viewport,u=o-r,f=n==="ltr"?[0,l]:[l*-1,0],d=lv(e,f);return VR([0,l],[0,u])(d)}function VR(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function qR(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const o={left:e.scrollLeft,top:e.scrollTop},l=n.left!==o.left,u=n.top!==o.top;(l||u)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function _d(e,t){const n=un(e),r=E.useRef(0);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),E.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function hs(e,t){const n=un(t);xn(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}var YR=MR,r9=FR,i9=$R;const WR=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(YR,{ref:r,className:Me("relative overflow-hidden",e),...n,children:[S.jsx(r9,{className:"h-full w-full rounded-[inherit]",children:t}),S.jsx(XR,{}),S.jsx(i9,{})]}));WR.displayName=YR.displayName;const XR=E.forwardRef(({className:e,orientation:t="vertical",...n},r)=>S.jsx(Gy,{ref:r,orientation:t,className:Me("flex touch-none transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:S.jsx(BR,{className:"bg-border relative flex-1 rounded-full"})}));XR.displayName=Gy.displayName;function uv(e,t={}){const{decimals:n=0,sizeType:r="normal"}=t,i=["Bytes","KB","MB","GB","TB"],o=["Bytes","KiB","MiB","GiB","TiB"];if(e===0)return"0 Byte";const l=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,l)).toFixed(n)} ${r==="accurate"?o[l]??"Bytes":i[l]??"Bytes"}`}function a9(e){const{value:t,onValueChange:n,onUpload:r,progresses:i,accept:o=SL,maxSize:l=1024*1024*200,maxFileCount:u=1,multiple:f=!1,disabled:d=!1,description:p,className:m,...v}=e,[g,w]=_i({prop:t,onChange:n}),x=E.useCallback((_,T)=>{if(!f&&u===1&&_.length>1){vn.error("Cannot upload more than 1 file at a time");return}if(((g==null?void 0:g.length)??0)+_.length>u){vn.error(`Cannot upload more than ${u} files`);return}const N=_.map(L=>Object.assign(L,{preview:URL.createObjectURL(L)})),D=g?[...g,...N]:N;if(w(D),T.length>0&&T.forEach(({file:L})=>{vn.error(`File ${L.name} was rejected`)}),r&&D.length>0&&D.length<=u){const L=D.length>0?`${D.length} files`:"file";vn.promise(r(D),{loading:`Uploading ${L}...`,success:()=>(w([]),`${L} uploaded`),error:`Failed to upload ${L}`})}},[g,u,f,r,w]);function k(_){if(!g)return;const T=g.filter((N,D)=>D!==_);w(T),n==null||n(T)}E.useEffect(()=>()=>{g&&g.forEach(_=>{KR(_)&&URL.revokeObjectURL(_.preview)})},[]);const C=d||((g==null?void 0:g.length)??0)>=u;return S.jsxs("div",{className:"relative flex flex-col gap-6 overflow-hidden",children:[S.jsx(Sd,{onDrop:x,accept:o,maxSize:l,maxFiles:u,multiple:u>1||f,disabled:C,children:({getRootProps:_,getInputProps:T,isDragActive:N})=>S.jsxs("div",{..._(),className:Me("group border-muted-foreground/25 hover:bg-muted/25 relative grid h-52 w-full cursor-pointer place-items-center rounded-lg border-2 border-dashed px-5 py-2.5 text-center transition","ring-offset-background focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",N&&"border-muted-foreground/50",C&&"pointer-events-none opacity-60",m),...v,children:[S.jsx("input",{...T()}),N?S.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[S.jsx("div",{className:"rounded-full border border-dashed p-3",children:S.jsx(Rg,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),S.jsx("p",{className:"text-muted-foreground font-medium",children:"Drop the files here"})]}):S.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 sm:px-5",children:[S.jsx("div",{className:"rounded-full border border-dashed p-3",children:S.jsx(Rg,{className:"text-muted-foreground size-7","aria-hidden":"true"})}),S.jsxs("div",{className:"flex flex-col gap-px",children:[S.jsx("p",{className:"text-muted-foreground font-medium",children:"Drag and drop files here, or click to select files"}),p?S.jsx("p",{className:"text-muted-foreground/70 text-sm",children:p}):S.jsxs("p",{className:"text-muted-foreground/70 text-sm",children:["You can upload",u>1?` ${u===1/0?"multiple":u} files (up to ${uv(l)} each)`:` a file with ${uv(l)}`,"Supported formats: TXT, MD, DOC, PDF, PPTX"]})]})]})]})}),g!=null&&g.length?S.jsx(WR,{className:"h-fit w-full px-3",children:S.jsx("div",{className:"flex max-h-48 flex-col gap-4",children:g==null?void 0:g.map((_,T)=>S.jsx(o9,{file:_,onRemove:()=>k(T),progress:i==null?void 0:i[_.name]},T))})}):null]})}function o9({file:e,progress:t,onRemove:n}){return S.jsxs("div",{className:"relative flex items-center gap-2.5",children:[S.jsxs("div",{className:"flex flex-1 gap-2.5",children:[KR(e)?S.jsx(s9,{file:e}):null,S.jsxs("div",{className:"flex w-full flex-col gap-2",children:[S.jsxs("div",{className:"flex flex-col gap-px",children:[S.jsx("p",{className:"text-foreground/80 line-clamp-1 text-sm font-medium",children:e.name}),S.jsx("p",{className:"text-muted-foreground text-xs",children:uv(e.size)})]}),t?S.jsx(LR,{value:t}):null]})]}),S.jsx("div",{className:"flex items-center gap-2",children:S.jsxs(Ot,{type:"button",variant:"outline",size:"icon",className:"size-7",onClick:n,children:[S.jsx(_k,{className:"size-4","aria-hidden":"true"}),S.jsx("span",{className:"sr-only",children:"Remove file"})]})})]})}function KR(e){return"preview"in e&&typeof e.preview=="string"}function s9({file:e}){return e.type.startsWith("image/")?S.jsx("div",{className:"aspect-square shrink-0 rounded-md object-cover"}):S.jsx(kM,{className:"text-muted-foreground size-10","aria-hidden":"true"})}function l9(){const[e,t]=E.useState(!1),[n,r]=E.useState(!1),[i,o]=E.useState({}),l=E.useCallback(async u=>{r(!0);try{await Promise.all(u.map(async f=>{try{const d=await cM(f,p=>{console.debug(`Uploading ${f.name}: ${p}%`),o(m=>({...m,[f.name]:p}))});d.status==="success"?vn.success(`Upload Success: ${f.name} uploaded successfully`):vn.error(`Upload Failed: ${f.name} ${d.message}`)}catch(d){vn.error(`Upload Failed: ${f.name} ${Cr(d)}`)}}))}catch(f){vn.error(`Upload Failed `+Cr(f))}finally{r(!1)}},[r,o]);return S.jsxs(ZA,{open:e,onOpenChange:u=>{n&&!u||t(u)},children:[S.jsx(QA,{asChild:!0,children:S.jsxs(Ot,{variant:"default",side:"bottom",tooltip:"Upload documents",size:"sm",children:[S.jsx(Rg,{})," Upload"]})}),S.jsxs(Ty,{className:"sm:max-w-xl",onCloseAutoFocus:u=>u.preventDefault(),children:[S.jsxs(Ay,{children:[S.jsx(Ry,{children:"Upload documents"}),S.jsx(Dy,{children:"Drag and drop your documents here or click to browse."})]}),S.jsx(a9,{maxFileCount:1/0,maxSize:200*1024*1024,description:"supported types: TXT, MD, DOC, PDF, PPTX",onUpload:l,progresses:i,disabled:n})]})]})}function u9(){const[e,t]=E.useState(!1),n=E.useCallback(async()=>{try{const r=await fM();r.status==="success"?(vn.success("Documents cleared successfully"),t(!1)):vn.error(`Clear Documents Failed: ${r.message}`)}catch(r){vn.error(`Clear Documents Failed: `+Cr(r))}},[t]);return S.jsxs(ZA,{open:e,onOpenChange:t,children:[S.jsx(QA,{asChild:!0,children:S.jsxs(Ot,{variant:"outline",side:"bottom",tooltip:"Clear documents",size:"sm",children:[S.jsx(Sk,{})," Clear"]})}),S.jsxs(Ty,{className:"sm:max-w-xl",onCloseAutoFocus:r=>r.preventDefault(),children:[S.jsxs(Ay,{children:[S.jsx(Ry,{children:"Clear documents"}),S.jsx(Dy,{children:"Do you really want to clear all documents?"})]}),S.jsx(Ot,{variant:"destructive",onClick:n,children:"YES"})]})]})}function c9(){const e=Mn.use.health(),[t,n]=E.useState(null),r=E.useCallback(async()=>{try{const o=await oM();o&&o.statuses&&Object.values(o.statuses).reduce((u,f)=>u+f.length,0)>0?n(o):n(null)}catch(o){vn.error(`Failed to load documents `+Cr(o))}},[n]);E.useEffect(()=>{r()},[]);const i=E.useCallback(async()=>{try{const{status:o}=await sM();vn.message(o)}catch(o){vn.error(`Failed to load documents `+Cr(o))}},[]);return E.useEffect(()=>{const o=setInterval(async()=>{if(e)try{await r()}catch(l){vn.error(`Failed to get scan progress `+Cr(l))}},5e3);return()=>clearInterval(o)},[e,r]),S.jsxs(Kl,{className:"!size-full !rounded-none !border-none",children:[S.jsx(Of,{children:S.jsx(Zl,{className:"text-lg",children:"Document Management"})}),S.jsxs(jf,{className:"space-y-4",children:[S.jsxs("div",{className:"flex gap-2",children:[S.jsxs(Ot,{variant:"outline",onClick:i,side:"bottom",tooltip:"Scan documents",size:"sm",children:[S.jsx(WM,{})," Scan"]}),S.jsx("div",{className:"flex-1"}),S.jsx(u9,{}),S.jsx(l9,{})]}),S.jsxs(Kl,{children:[S.jsxs(Of,{children:[S.jsx(Zl,{children:"Uploaded documents"}),S.jsx(wd,{children:"view the uploaded documents here"})]}),S.jsxs(jf,{children:[!t&&S.jsx(F$,{title:"No documents uploaded",description:"upload documents to see them here"}),t&&S.jsxs(gR,{children:[S.jsx(vR,{children:S.jsxs(nv,{children:[S.jsx(bi,{children:"ID"}),S.jsx(bi,{children:"Summary"}),S.jsx(bi,{children:"Status"}),S.jsx(bi,{children:"Length"}),S.jsx(bi,{children:"Chunks"}),S.jsx(bi,{children:"Created"}),S.jsx(bi,{children:"Updated"}),S.jsx(bi,{children:"Metadata"})]})}),S.jsx(yR,{className:"text-sm",children:Object.entries(t.statuses).map(([o,l])=>l.map(u=>S.jsxs(nv,{children:[S.jsx(xi,{className:"truncate font-mono",children:u.id}),S.jsx(xi,{className:"max-w-xs min-w-24 truncate",children:S.jsx(jn,{text:u.content_summary,tooltip:u.content_summary,tooltipClassName:"max-w-none overflow-visible block"})}),S.jsxs(xi,{children:[o==="processed"&&S.jsx("span",{className:"text-green-600",children:"Completed"}),o==="processing"&&S.jsx("span",{className:"text-blue-600",children:"Processing"}),o==="pending"&&S.jsx("span",{className:"text-yellow-600",children:"Pending"}),o==="failed"&&S.jsx("span",{className:"text-red-600",children:"Failed"}),u.error&&S.jsx("span",{className:"ml-2 text-red-500",title:u.error,children:"⚠️"})]}),S.jsx(xi,{children:u.content_length??"-"}),S.jsx(xi,{children:u.chunks_count??"-"}),S.jsx(xi,{className:"truncate",children:new Date(u.created_at).toLocaleString()}),S.jsx(xi,{className:"truncate",children:new Date(u.updated_at).toLocaleString()}),S.jsx(xi,{className:"max-w-xs truncate",children:u.metadata?JSON.stringify(u.metadata):"-"})]},u.id)))})]})]})]})]})]})}function ZR(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=u?i=i+jE("0",l-u):i=(i.substring(0,l)||"0")+"."+i.substring(l),n+i}function LE(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=$y(e),o=i.beforeDecimal,l=i.afterDecimal,u=i.hasNegation,f=parseFloat("0."+(l||"0")),d=l.length<=t?"0."+l:f.toFixed(t),p=d.split("."),m=o;o&&Number(p[0])&&(m=o.split("").reverse().reduce(function(x,k,C){return x.length>C?(Number(x[0])+Number(k)).toString()+x.substring(1,x.length):k+x},p[0]));var v=e2(p[1]||"",t,n),g=u?"-":"",w=r?".":"";return""+g+m+w+v}function Va(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var n2=f9(function(e,t){for(var n=0,r=0,i=e.length,o=t.length;e[n]===t[n]&&nn&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:o-r}}}),v9=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function y9(e,t,n){return Math.min(Math.max(e,t),n)}function tg(e){return Math.max(e.selectionStart,e.selectionEnd)}function b9(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function x9(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function w9(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function S9(e,t,n,r,i,o,l){l===void 0&&(l=w9);var u=i.findIndex(function(N){return N}),f=e.slice(0,u);!t&&!n.startsWith(f)&&(t=f,n=f+n,r=r+f.length);for(var d=n.length,p=e.length,m={},v=new Array(d),g=0;g0&&v[C]===-1;)C--;var T=C===-1||v[C]===-1?0:v[C]+1;return T>_?_:r-T<_-r?T:_}function zE(e,t,n,r){var i=e.length;if(t=y9(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function E9(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;nR.length-l.length||LV||m>e.length-l.length)&&(z=m),e=e.substring(0,z),e=T9(T?"-"+e:e,i),e=(e.match(A9(w))||[]).join("");var q=e.indexOf(w);e=e.replace(new RegExp(JR(w),"g"),function(G,F){return F===q?".":""});var I=$y(e,i),Y=I.beforeDecimal,Z=I.afterDecimal,B=I.addNegation;return d.end-d.startH?!1:A>=re.start&&A{const[x,k]=E.useState(v??r),C=E.useCallback(()=>{k(D=>D===void 0?e??1:Math.min(D+(e??1),o))},[e,o]),_=E.useCallback(()=>{k(D=>D===void 0?-(e??1):Math.max(D-(e??1),i))},[e,i]);E.useEffect(()=>{v!==void 0&&k(v)},[v]);const T=D=>{const L=D.floatValue===void 0?void 0:D.floatValue;k(L),l&&l(L)},N=()=>{x!==void 0&&(xo&&(k(o),w.current.value=String(o)))};return S.jsxs("div",{className:"relative flex",children:[S.jsx(L9,{value:x,onValueChange:T,thousandSeparator:t,decimalScale:f,fixedDecimalScale:u,allowNegative:i<0,valueIsNumericString:!0,onBlur:N,max:o,min:i,suffix:p,prefix:m,customInput:D=>S.jsx(Za,{...D,className:Me("w-full",d)}),placeholder:n,className:"[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",getInputRef:w,...g}),S.jsxs("div",{className:"absolute top-0 right-0 bottom-0 flex flex-col",children:[S.jsx(Ot,{"aria-label":"Increase value",className:"border-input h-1/2 rounded-l-none rounded-br-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:C,disabled:x===o,children:S.jsx(wk,{size:15})}),S.jsx(Ot,{"aria-label":"Decrease value",className:"border-input h-1/2 rounded-l-none rounded-tr-none border-b border-l px-2 focus-visible:relative",variant:"outline",onClick:_,disabled:x===i,children:S.jsx(zv,{size:15})})]})]})});Jo.displayName="NumberInput";var z9=[" ","Enter","ArrowUp","ArrowDown"],M9=[" ","Enter"],gu="Select",[Cd,Td,P9]=mT(gu),[As,bK]=dr(gu,[P9,ws]),Ad=ws(),[F9,pa]=As(gu),[I9,G9]=As(gu),i2=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:u,onValueChange:f,dir:d,name:p,autoComplete:m,disabled:v,required:g,form:w}=e,x=Ad(t),[k,C]=E.useState(null),[_,T]=E.useState(null),[N,D]=E.useState(!1),L=pd(d),[R=!1,U]=_i({prop:r,defaultProp:i,onChange:o}),[P,z]=_i({prop:l,defaultProp:u,onChange:f}),V=E.useRef(null),q=k?w||!!k.closest("form"):!0,[I,Y]=E.useState(new Set),Z=Array.from(I).map(B=>B.props.value).join(";");return S.jsx(ry,{...x,children:S.jsxs(F9,{required:g,scope:t,trigger:k,onTriggerChange:C,valueNode:_,onValueNodeChange:T,valueNodeHasChildren:N,onValueNodeHasChildrenChange:D,contentId:bn(),value:P,onValueChange:z,open:R,onOpenChange:U,dir:L,triggerPointerDownPosRef:V,disabled:v,children:[S.jsx(Cd.Provider,{scope:t,children:S.jsx(I9,{scope:e.__scopeSelect,onNativeOptionAdd:E.useCallback(B=>{Y(G=>new Set(G).add(B))},[]),onNativeOptionRemove:E.useCallback(B=>{Y(G=>{const F=new Set(G);return F.delete(B),F})},[]),children:n})}),q?S.jsxs(D2,{"aria-hidden":!0,required:g,tabIndex:-1,name:p,autoComplete:m,value:P,onChange:B=>z(B.target.value),disabled:v,form:w,children:[P===void 0?S.jsx("option",{value:""}):null,Array.from(I)]},Z):null]})})};i2.displayName=gu;var a2="SelectTrigger",o2=E.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Ad(n),l=pa(a2,n),u=l.disabled||r,f=dt(t,l.onTriggerChange),d=Td(n),p=E.useRef("touch"),[m,v,g]=N2(x=>{const k=d().filter(T=>!T.disabled),C=k.find(T=>T.value===l.value),_=O2(k,x,C);_!==void 0&&l.onValueChange(_.value)}),w=x=>{u||(l.onOpenChange(!0),g()),x&&(l.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return S.jsx(sd,{asChild:!0,...o,children:S.jsx(We.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":R2(l.value)?"":void 0,...i,ref:f,onClick:qe(i.onClick,x=>{x.currentTarget.focus(),p.current!=="mouse"&&w(x)}),onPointerDown:qe(i.onPointerDown,x=>{p.current=x.pointerType;const k=x.target;k.hasPointerCapture(x.pointerId)&&k.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(w(x),x.preventDefault())}),onKeyDown:qe(i.onKeyDown,x=>{const k=m.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&v(x.key),!(k&&x.key===" ")&&z9.includes(x.key)&&(w(),x.preventDefault())})})})});o2.displayName=a2;var s2="SelectValue",l2=E.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...u}=e,f=pa(s2,n),{onValueNodeHasChildrenChange:d}=f,p=o!==void 0,m=dt(t,f.onValueNodeChange);return xn(()=>{d(p)},[d,p]),S.jsx(We.span,{...u,ref:m,style:{pointerEvents:"none"},children:R2(f.value)?S.jsx(S.Fragment,{children:l}):o})});l2.displayName=s2;var U9="SelectIcon",u2=E.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return S.jsx(We.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});u2.displayName=U9;var B9="SelectPortal",c2=e=>S.jsx(Jf,{asChild:!0,...e});c2.displayName=B9;var eo="SelectContent",f2=E.forwardRef((e,t)=>{const n=pa(eo,e.__scopeSelect),[r,i]=E.useState();if(xn(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?au.createPortal(S.jsx(d2,{scope:e.__scopeSelect,children:S.jsx(Cd.Slot,{scope:e.__scopeSelect,children:S.jsx("div",{children:e.children})})}),o):null}return S.jsx(h2,{...e,ref:t})});f2.displayName=eo;var _r=10,[d2,ma]=As(eo),$9="SelectContentImpl",h2=E.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:u,sideOffset:f,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:v,collisionPadding:g,sticky:w,hideWhenDetached:x,avoidCollisions:k,...C}=e,_=pa(eo,n),[T,N]=E.useState(null),[D,L]=E.useState(null),R=dt(t,ae=>N(ae)),[U,P]=E.useState(null),[z,V]=E.useState(null),q=Td(n),[I,Y]=E.useState(!1),Z=E.useRef(!1);E.useEffect(()=>{if(T)return Fv(T)},[T]),Pv();const B=E.useCallback(ae=>{const[oe,...Ce]=q().map(we=>we.ref.current),[he]=Ce.slice(-1),Ee=document.activeElement;for(const we of ae)if(we===Ee||(we==null||we.scrollIntoView({block:"nearest"}),we===oe&&D&&(D.scrollTop=0),we===he&&D&&(D.scrollTop=D.scrollHeight),we==null||we.focus(),document.activeElement!==Ee))return},[q,D]),G=E.useCallback(()=>B([U,T]),[B,U,T]);E.useEffect(()=>{I&&G()},[I,G]);const{onOpenChange:F,triggerPointerDownPosRef:K}=_;E.useEffect(()=>{if(T){let ae={x:0,y:0};const oe=he=>{var Ee,we;ae={x:Math.abs(Math.round(he.pageX)-(((Ee=K.current)==null?void 0:Ee.x)??0)),y:Math.abs(Math.round(he.pageY)-(((we=K.current)==null?void 0:we.y)??0))}},Ce=he=>{ae.x<=10&&ae.y<=10?he.preventDefault():T.contains(he.target)||F(!1),document.removeEventListener("pointermove",oe),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[T,F,K]),E.useEffect(()=>{const ae=()=>F(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[F]);const[A,H]=N2(ae=>{const oe=q().filter(Ee=>!Ee.disabled),Ce=oe.find(Ee=>Ee.ref.current===document.activeElement),he=O2(oe,ae,Ce);he&&setTimeout(()=>he.ref.current.focus())}),M=E.useCallback((ae,oe,Ce)=>{const he=!Z.current&&!Ce;(_.value!==void 0&&_.value===oe||he)&&(P(ae),he&&(Z.current=!0))},[_.value]),O=E.useCallback(()=>T==null?void 0:T.focus(),[T]),X=E.useCallback((ae,oe,Ce)=>{const he=!Z.current&&!Ce;(_.value!==void 0&&_.value===oe||he)&&V(ae)},[_.value]),re=r==="popper"?cv:p2,ue=re===cv?{side:u,sideOffset:f,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:v,collisionPadding:g,sticky:w,hideWhenDetached:x,avoidCollisions:k}:{};return S.jsx(d2,{scope:n,content:T,viewport:D,onViewportChange:L,itemRefCallback:M,selectedItem:U,onItemLeave:O,itemTextRefCallback:X,focusSelectedItem:G,selectedItemText:z,position:r,isPositioned:I,searchRef:A,children:S.jsx(td,{as:ua,allowPinchZoom:!0,children:S.jsx(Qf,{asChild:!0,trapped:_.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:qe(i,ae=>{var oe;(oe=_.trigger)==null||oe.focus({preventScroll:!0}),ae.preventDefault()}),children:S.jsx(ou,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>_.onOpenChange(!1),children:S.jsx(re,{role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:ae=>ae.preventDefault(),...C,...ue,onPlaced:()=>Y(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:qe(C.onKeyDown,ae=>{const oe=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!oe&&ae.key.length===1&&H(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let he=q().filter(Ee=>!Ee.disabled).map(Ee=>Ee.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const Ee=ae.target,we=he.indexOf(Ee);he=he.slice(we+1)}setTimeout(()=>B(he)),ae.preventDefault()}})})})})})})});h2.displayName=$9;var H9="SelectItemAlignedPosition",p2=E.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=pa(eo,n),l=ma(eo,n),[u,f]=E.useState(null),[d,p]=E.useState(null),m=dt(t,R=>p(R)),v=Td(n),g=E.useRef(!1),w=E.useRef(!0),{viewport:x,selectedItem:k,selectedItemText:C,focusSelectedItem:_}=l,T=E.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&d&&x&&k&&C){const R=o.trigger.getBoundingClientRect(),U=d.getBoundingClientRect(),P=o.valueNode.getBoundingClientRect(),z=C.getBoundingClientRect();if(o.dir!=="rtl"){const Ee=z.left-U.left,we=P.left-Ee,Pe=R.left-we,Ae=R.width+Pe,xe=Math.max(Ae,U.width),ee=window.innerWidth-_r,ce=lv(we,[_r,Math.max(_r,ee-xe)]);u.style.minWidth=Ae+"px",u.style.left=ce+"px"}else{const Ee=U.right-z.right,we=window.innerWidth-P.right-Ee,Pe=window.innerWidth-R.right-we,Ae=R.width+Pe,xe=Math.max(Ae,U.width),ee=window.innerWidth-_r,ce=lv(we,[_r,Math.max(_r,ee-xe)]);u.style.minWidth=Ae+"px",u.style.right=ce+"px"}const V=v(),q=window.innerHeight-_r*2,I=x.scrollHeight,Y=window.getComputedStyle(d),Z=parseInt(Y.borderTopWidth,10),B=parseInt(Y.paddingTop,10),G=parseInt(Y.borderBottomWidth,10),F=parseInt(Y.paddingBottom,10),K=Z+B+I+F+G,A=Math.min(k.offsetHeight*5,K),H=window.getComputedStyle(x),M=parseInt(H.paddingTop,10),O=parseInt(H.paddingBottom,10),X=R.top+R.height/2-_r,re=q-X,ue=k.offsetHeight/2,ae=k.offsetTop+ue,oe=Z+B+ae,Ce=K-oe;if(oe<=X){const Ee=V.length>0&&k===V[V.length-1].ref.current;u.style.bottom="0px";const we=d.clientHeight-x.offsetTop-x.offsetHeight,Pe=Math.max(re,ue+(Ee?O:0)+we+G),Ae=oe+Pe;u.style.height=Ae+"px"}else{const Ee=V.length>0&&k===V[0].ref.current;u.style.top="0px";const Pe=Math.max(X,Z+x.offsetTop+(Ee?M:0)+ue)+Ce;u.style.height=Pe+"px",x.scrollTop=oe-X+x.offsetTop}u.style.margin=`${_r}px 0`,u.style.minHeight=A+"px",u.style.maxHeight=q+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[v,o.trigger,o.valueNode,u,d,x,k,C,o.dir,r]);xn(()=>T(),[T]);const[N,D]=E.useState();xn(()=>{d&&D(window.getComputedStyle(d).zIndex)},[d]);const L=E.useCallback(R=>{R&&w.current===!0&&(T(),_==null||_(),w.current=!1)},[T,_]);return S.jsx(q9,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:g,onScrollButtonChange:L,children:S.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:S.jsx(We.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});p2.displayName=H9;var V9="SelectPopperPosition",cv=E.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=_r,...o}=e,l=Ad(n);return S.jsx(iy,{...l,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.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)"}})});cv.displayName=V9;var[q9,Hy]=As(eo,{}),fv="SelectViewport",m2=E.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=ma(fv,n),l=Hy(fv,n),u=dt(t,o.onViewportChange),f=E.useRef(0);return S.jsxs(S.Fragment,{children:[S.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:r}),S.jsx(Cd.Slot,{scope:n,children:S.jsx(We.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:qe(i.onScroll,d=>{const p=d.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:v}=l;if(v!=null&&v.current&&m){const g=Math.abs(f.current-p.scrollTop);if(g>0){const w=window.innerHeight-_r*2,x=parseFloat(m.style.minHeight),k=parseFloat(m.style.height),C=Math.max(x,k);if(C0?N:0,m.style.justifyContent="flex-end")}}}f.current=p.scrollTop})})})]})});m2.displayName=fv;var g2="SelectGroup",[Y9,W9]=As(g2),v2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=bn();return S.jsx(Y9,{scope:n,id:i,children:S.jsx(We.div,{role:"group","aria-labelledby":i,...r,ref:t})})});v2.displayName=g2;var y2="SelectLabel",b2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=W9(y2,n);return S.jsx(We.div,{id:i.id,...r,ref:t})});b2.displayName=y2;var Gf="SelectItem",[X9,x2]=As(Gf),w2=E.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,u=pa(Gf,n),f=ma(Gf,n),d=u.value===r,[p,m]=E.useState(o??""),[v,g]=E.useState(!1),w=dt(t,_=>{var T;return(T=f.itemRefCallback)==null?void 0:T.call(f,_,r,i)}),x=bn(),k=E.useRef("touch"),C=()=>{i||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A 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 S.jsx(X9,{scope:n,value:r,disabled:i,textId:x,isSelected:d,onItemTextChange:E.useCallback(_=>{m(T=>T||((_==null?void 0:_.textContent)??"").trim())},[]),children:S.jsx(Cd.ItemSlot,{scope:n,value:r,disabled:i,textValue:p,children:S.jsx(We.div,{role:"option","aria-labelledby":x,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:w,onFocus:qe(l.onFocus,()=>g(!0)),onBlur:qe(l.onBlur,()=>g(!1)),onClick:qe(l.onClick,()=>{k.current!=="mouse"&&C()}),onPointerUp:qe(l.onPointerUp,()=>{k.current==="mouse"&&C()}),onPointerDown:qe(l.onPointerDown,_=>{k.current=_.pointerType}),onPointerMove:qe(l.onPointerMove,_=>{var T;k.current=_.pointerType,i?(T=f.onItemLeave)==null||T.call(f):k.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:qe(l.onPointerLeave,_=>{var T;_.currentTarget===document.activeElement&&((T=f.onItemLeave)==null||T.call(f))}),onKeyDown:qe(l.onKeyDown,_=>{var N;((N=f.searchRef)==null?void 0:N.current)!==""&&_.key===" "||(M9.includes(_.key)&&C(),_.key===" "&&_.preventDefault())})})})})});w2.displayName=Gf;var Il="SelectItemText",S2=E.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=pa(Il,n),u=ma(Il,n),f=x2(Il,n),d=G9(Il,n),[p,m]=E.useState(null),v=dt(t,C=>m(C),f.onItemTextChange,C=>{var _;return(_=u.itemTextRefCallback)==null?void 0:_.call(u,C,f.value,f.disabled)}),g=p==null?void 0:p.textContent,w=E.useMemo(()=>S.jsx("option",{value:f.value,disabled:f.disabled,children:g},f.value),[f.disabled,f.value,g]),{onNativeOptionAdd:x,onNativeOptionRemove:k}=d;return xn(()=>(x(w),()=>k(w)),[x,k,w]),S.jsxs(S.Fragment,{children:[S.jsx(We.span,{id:f.textId,...o,ref:v}),f.isSelected&&l.valueNode&&!l.valueNodeHasChildren?au.createPortal(o.children,l.valueNode):null]})});S2.displayName=Il;var E2="SelectItemIndicator",_2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return x2(E2,n).isSelected?S.jsx(We.span,{"aria-hidden":!0,...r,ref:t}):null});_2.displayName=E2;var dv="SelectScrollUpButton",k2=E.forwardRef((e,t)=>{const n=ma(dv,e.__scopeSelect),r=Hy(dv,e.__scopeSelect),[i,o]=E.useState(!1),l=dt(t,r.onScrollButtonChange);return xn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=f.scrollTop>0;o(d)};const f=n.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?S.jsx(T2,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});k2.displayName=dv;var hv="SelectScrollDownButton",C2=E.forwardRef((e,t)=>{const n=ma(hv,e.__scopeSelect),r=Hy(hv,e.__scopeSelect),[i,o]=E.useState(!1),l=dt(t,r.onScrollButtonChange);return xn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=f.scrollHeight-f.clientHeight,p=Math.ceil(f.scrollTop)f.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?S.jsx(T2,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=n;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});C2.displayName=hv;var T2=E.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=ma("SelectScrollButton",n),l=E.useRef(null),u=Td(n),f=E.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return E.useEffect(()=>()=>f(),[f]),xn(()=>{var p;const d=u().find(m=>m.ref.current===document.activeElement);(p=d==null?void 0:d.ref.current)==null||p.scrollIntoView({block:"nearest"})},[u]),S.jsx(We.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:qe(i.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:qe(i.onPointerMove,()=>{var d;(d=o.onItemLeave)==null||d.call(o),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:qe(i.onPointerLeave,()=>{f()})})}),K9="SelectSeparator",A2=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return S.jsx(We.div,{"aria-hidden":!0,...r,ref:t})});A2.displayName=K9;var pv="SelectArrow",Z9=E.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Ad(n),o=pa(pv,n),l=ma(pv,n);return o.open&&l.position==="popper"?S.jsx(ay,{...i,...r,ref:t}):null});Z9.displayName=pv;function R2(e){return e===""||e===void 0}var D2=E.forwardRef((e,t)=>{const{value:n,...r}=e,i=E.useRef(null),o=dt(t,i),l=tR(n);return E.useEffect(()=>{const u=i.current,f=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(f,"value").set;if(l!==n&&p){const m=new Event("change",{bubbles:!0});p.call(u,n),u.dispatchEvent(m)}},[l,n]),S.jsx(oy,{asChild:!0,children:S.jsx("select",{...r,ref:o,defaultValue:n})})});D2.displayName="BubbleSelect";function N2(e){const t=un(e),n=E.useRef(""),r=E.useRef(0),i=E.useCallback(l=>{const u=n.current+l;t(u),function f(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>f(""),1e3))}(u)},[t]),o=E.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function O2(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=Q9(e,Math.max(o,0));i.length===1&&(l=l.filter(d=>d!==n));const f=l.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return f!==n?f:void 0}function Q9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var J9=i2,j2=o2,e8=l2,t8=u2,n8=c2,L2=f2,r8=m2,i8=v2,z2=b2,M2=w2,a8=S2,o8=_2,P2=k2,F2=C2,I2=A2;const PE=J9,FE=i8,IE=e8,mv=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(j2,{ref:r,className:Me("border-input bg-background ring-offset-background placeholder:text-muted-foreground focus:ring-ring flex h-10 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,S.jsx(t8,{asChild:!0,children:S.jsx(zv,{className:"h-4 w-4 opacity-50"})})]}));mv.displayName=j2.displayName;const G2=E.forwardRef(({className:e,...t},n)=>S.jsx(P2,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(wk,{className:"h-4 w-4"})}));G2.displayName=P2.displayName;const U2=E.forwardRef(({className:e,...t},n)=>S.jsx(F2,{ref:n,className:Me("flex cursor-default items-center justify-center py-1",e),...t,children:S.jsx(zv,{className:"h-4 w-4"})}));U2.displayName=F2.displayName;const gv=E.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>S.jsx(n8,{children:S.jsxs(L2,{ref:i,className:Me("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",n==="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",e),position:n,...r,children:[S.jsx(G2,{}),S.jsx(r8,{className:Me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),S.jsx(U2,{})]})}));gv.displayName=L2.displayName;const s8=E.forwardRef(({className:e,...t},n)=>S.jsx(z2,{ref:n,className:Me("py-1.5 pr-2 pl-8 text-sm font-semibold",e),...t}));s8.displayName=z2.displayName;const wi=E.forwardRef(({className:e,children:t,...n},r)=>S.jsxs(M2,{ref:r,className:Me("focus:bg-accent focus:text-accent-foreground relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[S.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:S.jsx(o8,{children:S.jsx(Lv,{className:"h-4 w-4"})})}),S.jsx(a8,{children:t})]}));wi.displayName=M2.displayName;const l8=E.forwardRef(({className:e,...t},n)=>S.jsx(I2,{ref:n,className:Me("bg-muted -mx-1 my-1 h-px",e),...t}));l8.displayName=I2.displayName;function u8(){var n,r;const e=Qe(i=>i.querySettings),t=E.useCallback((i,o)=>{Qe.getState().updateQuerySettings({[i]:o})},[]);return S.jsxs(Kl,{className:"flex shrink-0 flex-col",children:[S.jsxs(Of,{className:"px-4 pt-4 pb-2",children:[S.jsx(Zl,{children:"Parameters"}),S.jsx(wd,{children:"Configure your query parameters"})]}),S.jsx(jf,{className:"m-0 flex grow flex-col p-0 text-xs",children:S.jsx("div",{className:"relative size-full",children:S.jsxs("div",{className:"absolute inset-0 flex flex-col gap-2 overflow-auto px-2",children:[S.jsxs(S.Fragment,{children:[S.jsx(jn,{className:"ml-1",text:"Query Mode",tooltip:"Select the retrieval strategy:\\n• Naive: Basic search without advanced techniques\\n• Local: Context-dependent information retrieval\\n• Global: Utilizes global knowledge base\\n• Hybrid: Combines local and global retrieval\\n• Mix: Integrates knowledge graph with vector retrieval",side:"left"}),S.jsxs(PE,{value:e.mode,onValueChange:i=>t("mode",i),children:[S.jsx(mv,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:S.jsx(IE,{})}),S.jsx(gv,{children:S.jsxs(FE,{children:[S.jsx(wi,{value:"naive",children:"Naive"}),S.jsx(wi,{value:"local",children:"Local"}),S.jsx(wi,{value:"global",children:"Global"}),S.jsx(wi,{value:"hybrid",children:"Hybrid"}),S.jsx(wi,{value:"mix",children:"Mix"})]})})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(jn,{className:"ml-1",text:"Response Format",tooltip:"Defines the response format. Examples:\\n• Multiple Paragraphs\\n• Single Paragraph\\n• Bullet Points",side:"left"}),S.jsxs(PE,{value:e.response_type,onValueChange:i=>t("response_type",i),children:[S.jsx(mv,{className:"hover:bg-primary/5 h-9 cursor-pointer focus:ring-0 focus:ring-offset-0 focus:outline-0 active:right-0",children:S.jsx(IE,{})}),S.jsx(gv,{children:S.jsxs(FE,{children:[S.jsx(wi,{value:"Multiple Paragraphs",children:"Multiple Paragraphs"}),S.jsx(wi,{value:"Single Paragraph",children:"Single Paragraph"}),S.jsx(wi,{value:"Bullet Points",children:"Bullet Points"})]})})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(jn,{className:"ml-1",text:"Top K Results",tooltip:"Number of top items to retrieve. Represents entities in 'local' mode and relationships in 'global' mode",side:"left"}),S.jsx(Jo,{id:"top_k",stepper:1,value:e.top_k,onValueChange:i=>t("top_k",i),min:1,placeholder:"Number of results"})]}),S.jsxs(S.Fragment,{children:[S.jsxs(S.Fragment,{children:[S.jsx(jn,{className:"ml-1",text:"Max Tokens for Text Unit",tooltip:"Maximum number of tokens allowed for each retrieved text chunk",side:"left"}),S.jsx(Jo,{id:"max_token_for_text_unit",stepper:500,value:e.max_token_for_text_unit,onValueChange:i=>t("max_token_for_text_unit",i),min:1,placeholder:"Max tokens for text unit"})]}),S.jsxs(S.Fragment,{children:[S.jsx(jn,{text:"Max Tokens for Global Context",tooltip:"Maximum number of tokens allocated for relationship descriptions in global retrieval",side:"left"}),S.jsx(Jo,{id:"max_token_for_global_context",stepper:500,value:e.max_token_for_global_context,onValueChange:i=>t("max_token_for_global_context",i),min:1,placeholder:"Max tokens for global context"})]}),S.jsxs(S.Fragment,{children:[S.jsx(jn,{className:"ml-1",text:"Max Tokens for Local Context",tooltip:"Maximum number of tokens allocated for entity descriptions in local retrieval",side:"left"}),S.jsx(Jo,{id:"max_token_for_local_context",stepper:500,value:e.max_token_for_local_context,onValueChange:i=>t("max_token_for_local_context",i),min:1,placeholder:"Max tokens for local context"})]})]}),S.jsxs(S.Fragment,{children:[S.jsx(jn,{className:"ml-1",text:"History Turns",tooltip:"Number of complete conversation turns (user-assistant pairs) to consider in the response context",side:"left"}),S.jsx(Jo,{className:"!border-input",id:"history_turns",stepper:1,type:"text",value:e.history_turns,onValueChange:i=>t("history_turns",i),min:0,placeholder:"Number of history turns"})]}),S.jsxs(S.Fragment,{children:[S.jsxs(S.Fragment,{children:[S.jsx(jn,{className:"ml-1",text:"High-Level Keywords",tooltip:"List of high-level keywords to prioritize in retrieval. Separate with commas",side:"left"}),S.jsx(Za,{id:"hl_keywords",type:"text",value:(n=e.hl_keywords)==null?void 0:n.join(", "),onChange:i=>{const o=i.target.value.split(",").map(l=>l.trim()).filter(l=>l!=="");t("hl_keywords",o)},placeholder:"Enter keywords"})]}),S.jsxs(S.Fragment,{children:[S.jsx(jn,{className:"ml-1",text:"Low-Level Keywords",tooltip:"List of low-level keywords to refine retrieval focus. Separate with commas",side:"left"}),S.jsx(Za,{id:"ll_keywords",type:"text",value:(r=e.ll_keywords)==null?void 0:r.join(", "),onChange:i=>{const o=i.target.value.split(",").map(l=>l.trim()).filter(l=>l!=="");t("ll_keywords",o)},placeholder:"Enter keywords"})]})]}),S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(jn,{className:"ml-1",text:"Only Need Context",tooltip:"If True, only returns the retrieved context without generating a response",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Ul,{className:"mr-1 cursor-pointer",id:"only_need_context",checked:e.only_need_context,onCheckedChange:i=>t("only_need_context",i)})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(jn,{className:"ml-1",text:"Only Need Prompt",tooltip:"If True, only returns the generated prompt without producing a response",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Ul,{className:"mr-1 cursor-pointer",id:"only_need_prompt",checked:e.only_need_prompt,onCheckedChange:i=>t("only_need_prompt",i)})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(jn,{className:"ml-1",text:"Stream Response",tooltip:"If True, enables streaming output for real-time responses",side:"left"}),S.jsx("div",{className:"grow"}),S.jsx(Ul,{className:"mr-1 cursor-pointer",id:"stream",checked:e.stream,onCheckedChange:i=>t("stream",i)})]})]})]})})})]})}function c8(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const f8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,d8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,h8={};function GE(e,t){return(h8.jsx?d8:f8).test(e)}const p8=/[ \t\n\f\r]/g;function m8(e){return typeof e=="object"?e.type==="text"?UE(e.value):!1:UE(e)}function UE(e){return e.replace(p8,"")===""}class vu{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}vu.prototype.property={};vu.prototype.normal={};vu.prototype.space=null;function B2(e,t){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&x8.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace($E,_8);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!$E.test(o)){let l=o.replace(w8,E8);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Vy}return new i(r,t)}function E8(e){return"-"+e.toLowerCase()}function _8(e){return e.charAt(1).toUpperCase()}const k8={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},C8=B2([V2,H2,W2,X2,y8],"html"),qy=B2([V2,H2,W2,X2,b8],"svg");function T8(e){return e.join(" ").trim()}var Xo={},rg,HE;function A8(){if(HE)return rg;HE=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,f=` `,d="/",p="*",m="",v="comment",g="declaration";rg=function(x,k){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];k=k||{};var C=1,_=1;function T(I){var Y=I.match(t);Y&&(C+=Y.length);var Z=I.lastIndexOf(f);_=~Z?I.length-Z:_+I.length}function N(){var I={line:C,column:_};return function(Y){return Y.position=new D(I),U(),Y}}function D(I){this.start=I,this.end={line:C,column:_},this.source=k.source}D.prototype.content=x;function L(I){var Y=new Error(k.source+":"+C+":"+_+": "+I);if(Y.reason=I,Y.filename=k.source,Y.line=C,Y.column=_,Y.source=x,!k.silent)throw Y}function R(I){var Y=I.exec(x);if(Y){var Z=Y[0];return T(Z),x=x.slice(Z.length),Y}}function U(){R(n)}function P(I){var Y;for(I=I||[];Y=z();)Y!==!1&&I.push(Y);return I}function z(){var I=N();if(!(d!=x.charAt(0)||p!=x.charAt(1))){for(var Y=2;m!=x.charAt(Y)&&(p!=x.charAt(Y)||d!=x.charAt(Y+1));)++Y;if(Y+=2,m===x.charAt(Y-1))return L("End of comment missing");var Z=x.slice(2,Y-2);return _+=2,T(Z),x=x.slice(Y),_+=2,I({type:v,comment:Z})}}function V(){var I=N(),Y=R(r);if(Y){if(z(),!R(i))return L("property missing ':'");var Z=R(o),B=I({type:g,property:w(Y[0].replace(e,m)),value:Z?w(Z[0].replace(e,m)):m});return R(l),B}}function q(){var I=[];P(I);for(var Y;Y=V();)Y!==!1&&(I.push(Y),P(I));return I}return U(),q()};function w(x){return x?x.replace(u,m):m}return rg}var VE;function R8(){if(VE)return Xo;VE=1;var e=Xo&&Xo.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.default=n;var t=e(A8());function n(r,i){var o=null;if(!r||typeof r!="string")return o;var l=(0,t.default)(r),u=typeof i=="function";return l.forEach(function(f){if(f.type==="declaration"){var d=f.property,p=f.value;u?i(d,p,f):p&&(o=o||{},o[d]=p)}}),o}return Xo}var D8=R8();const qE=fn(D8),N8=qE.default||qE,K2=Z2("end"),Yy=Z2("start");function Z2(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function O8(e){const t=Yy(e),n=K2(e);if(t&&n)return{start:t,end:n}}function Bl(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?YE(e.position):"start"in e||"end"in e?YE(e):"line"in e||"column"in e?bv(e):""}function bv(e){return WE(e&&e.line)+":"+WE(e&&e.column)}function YE(e){return bv(e&&e.start)+"-"+bv(e&&e.end)}function WE(e){return e&&typeof e=="number"?e:1}class wn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?o.ruleId=r:(o.source=r.slice(0,f),o.ruleId=r.slice(f+1))}if(!o.place&&o.ancestors&&o.ancestors){const f=o.ancestors[o.ancestors.length-1];f&&(o.place=f.position)}const u=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=u?u.line:void 0,this.name=Bl(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}wn.prototype.file="";wn.prototype.name="";wn.prototype.reason="";wn.prototype.message="";wn.prototype.stack="";wn.prototype.column=void 0;wn.prototype.line=void 0;wn.prototype.ancestors=void 0;wn.prototype.cause=void 0;wn.prototype.fatal=void 0;wn.prototype.place=void 0;wn.prototype.ruleId=void 0;wn.prototype.source=void 0;const Wy={}.hasOwnProperty,j8=new Map,L8=/[A-Z]/g,z8=/-([a-z])/g,M8=new Set(["table","tbody","thead","tfoot","tr"]),P8=new Set(["td","th"]),Q2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function J2(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=V8(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=H8(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?qy:C8,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=eD(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function eD(e,t,n){if(t.type==="element")return F8(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return I8(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return U8(e,t,n);if(t.type==="mdxjsEsm")return G8(e,t);if(t.type==="root")return B8(e,t,n);if(t.type==="text")return $8(e,t)}function F8(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=qy,e.schema=i),e.ancestors.push(t);const o=nD(e,t.tagName,!1),l=q8(e,t);let u=Ky(e,t);return M8.has(t.tagName)&&(u=u.filter(function(f){return typeof f=="string"?!m8(f):!0})),tD(e,l,o,t),Xy(l,u),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function I8(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}tu(e,t.position)}function G8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);tu(e,t.position)}function U8(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=qy,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:nD(e,t.name,!0),l=Y8(e,t),u=Ky(e,t);return tD(e,l,o,t),Xy(l,u),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function B8(e,t,n){const r={};return Xy(r,Ky(e,t)),e.create(t,e.Fragment,r,n)}function $8(e,t){return t.value}function tD(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Xy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function H8(e,t,n){return r;function r(i,o,l,u){const d=Array.isArray(l.children)?n:t;return u?d(o,l,u):d(o,l)}}function V8(e,t){return n;function n(r,i,o,l){const u=Array.isArray(o.children),f=Yy(r);return t(i,o,l,u,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function q8(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Wy.call(t.properties,i)){const o=W8(e,i,t.properties[i]);if(o){const[l,u]=o;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&P8.has(t.tagName)?r=u:n[l]=u}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Y8(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const u=l.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else tu(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,o=e.evaluater.evaluateExpression(u.expression)}else tu(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Ky(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:j8;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o0?(Xn(e,e.length,0,t),e):t}const ZE={}.hasOwnProperty;function iD(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Tr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kn=ga(/[A-Za-z]/),yn=ga(/[\dA-Za-z]/),i7=ga(/[#-'*+\--9=?A-Z^-~]/);function Uf(e){return e!==null&&(e<32||e===127)}const xv=ga(/\d/),a7=ga(/[\dA-Fa-f]/),o7=ga(/[!-/:-@[-`{-~]/);function Be(e){return e!==null&&e<-2}function Tt(e){return e!==null&&(e<0||e===32)}function ut(e){return e===-2||e===-1||e===32}const Rd=ga(new RegExp("\\p{P}|\\p{S}","u")),to=ga(/\s/);function ga(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ds(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const u=e.charCodeAt(n+1);o<56320&&u>56319&&u<57344?(l=String.fromCharCode(o,u),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function st(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(f){return ut(f)?(e.enter(n),u(f)):t(f)}function u(f){return ut(f)&&o++l))return;const R=t.events.length;let U=R,P,z;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(P){z=t.events[U][1].end;break}P=!0}for(C(r),L=R;LT;){const D=n[N];t.containerState=D[1],D[0].exit.call(t,e)}n.length=T}function _(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function f7(e,t,n){return st(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ps(e){if(e===null||Tt(e)||to(e))return 1;if(Rd(e))return 2}function Dd(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},v={...e[n][1].start};JE(m,-f),JE(v,f),l={type:f>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},u={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},o={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:f>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[r][1].end={...l.start},e[n][1].start={...u.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=cr(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=cr(d,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),d=cr(d,Dd(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=cr(d,[["exit",o,t],["enter",u,t],["exit",u,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,d=cr(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Xn(e,r-1,n-r+3,d),n=r+d.length-p-2;break}}for(n=-1;++n0&&ut(L)?st(e,_,"linePrefix",o+1)(L):_(L)}function _(L){return L===null||Be(L)?e.check(e_,x,N)(L):(e.enter("codeFlowValue"),T(L))}function T(L){return L===null||Be(L)?(e.exit("codeFlowValue"),_(L)):(e.consume(L),T)}function N(L){return e.exit("codeFenced"),t(L)}function D(L,R,U){let P=0;return z;function z(Z){return L.enter("lineEnding"),L.consume(Z),L.exit("lineEnding"),V}function V(Z){return L.enter("codeFencedFence"),ut(Z)?st(L,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):q(Z)}function q(Z){return Z===u?(L.enter("codeFencedFenceSequence"),I(Z)):U(Z)}function I(Z){return Z===u?(P++,L.consume(Z),I):P>=l?(L.exit("codeFencedFenceSequence"),ut(Z)?st(L,Y,"whitespace")(Z):Y(Z)):U(Z)}function Y(Z){return Z===null||Be(Z)?(L.exit("codeFencedFence"),R(Z)):U(Z)}}}function E7(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const ag={name:"codeIndented",tokenize:k7},_7={partial:!0,tokenize:C7};function k7(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),st(e,o,"linePrefix",5)(d)}function o(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?l(d):n(d)}function l(d){return d===null?f(d):Be(d)?e.attempt(_7,l,f)(d):(e.enter("codeFlowValue"),u(d))}function u(d){return d===null||Be(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),u)}function f(d){return e.exit("codeIndented"),t(d)}}function C7(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):Be(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):st(e,o,"linePrefix",5)(l)}function o(l){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):Be(l)?i(l):n(l)}}const T7={name:"codeText",previous:R7,resolve:A7,tokenize:D7};function A7(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&zl(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),zl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),zl(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function cD(e,t,n,r,i,o,l,u,f){const d=f||Number.POSITIVE_INFINITY;let p=0;return m;function m(C){return C===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(C),e.exit(o),v):C===null||C===32||C===41||Uf(C)?n(C):(e.enter(r),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),x(C))}function v(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),g(C))}function g(C){return C===62?(e.exit("chunkString"),e.exit(u),v(C)):C===null||C===60||Be(C)?n(C):(e.consume(C),C===92?w:g)}function w(C){return C===60||C===62||C===92?(e.consume(C),g):g(C)}function x(C){return!p&&(C===null||C===41||Tt(C))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(r),t(C)):p999||g===null||g===91||g===93&&!f||g===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?n(g):g===93?(e.exit(o),e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):Be(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===null||g===91||g===93||Be(g)||u++>999?(e.exit("chunkString"),p(g)):(e.consume(g),f||(f=!ut(g)),g===92?v:m)}function v(g){return g===91||g===92||g===93?(e.consume(g),u++,m):m(g)}}function dD(e,t,n,r,i,o){let l;return u;function u(v){return v===34||v===39||v===40?(e.enter(r),e.enter(i),e.consume(v),e.exit(i),l=v===40?41:v,f):n(v)}function f(v){return v===l?(e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):(e.enter(o),d(v))}function d(v){return v===l?(e.exit(o),f(l)):v===null?n(v):Be(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),st(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===l||v===null||Be(v)?(e.exit("chunkString"),d(v)):(e.consume(v),v===92?m:p)}function m(v){return v===l||v===92?(e.consume(v),p):p(v)}}function $l(e,t){let n;return r;function r(i){return Be(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ut(i)?st(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const F7={name:"definition",tokenize:G7},I7={partial:!0,tokenize:U7};function G7(e,t,n){const r=this;let i;return o;function o(g){return e.enter("definition"),l(g)}function l(g){return fD.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function u(g){return i=Tr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),f):n(g)}function f(g){return Tt(g)?$l(e,d)(g):d(g)}function d(g){return cD(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function p(g){return e.attempt(I7,m,m)(g)}function m(g){return ut(g)?st(e,v,"whitespace")(g):v(g)}function v(g){return g===null||Be(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function U7(e,t,n){return r;function r(u){return Tt(u)?$l(e,i)(u):n(u)}function i(u){return dD(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function o(u){return ut(u)?st(e,l,"whitespace")(u):l(u)}function l(u){return u===null||Be(u)?t(u):n(u)}}const B7={name:"hardBreakEscape",tokenize:$7};function $7(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return Be(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const H7={name:"headingAtx",resolve:V7,tokenize:q7};function V7(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Xn(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function q7(e,t,n){let r=0;return i;function i(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),l(p)}function l(p){return p===35&&r++<6?(e.consume(p),l):p===null||Tt(p)?(e.exit("atxHeadingSequence"),u(p)):n(p)}function u(p){return p===35?(e.enter("atxHeadingSequence"),f(p)):p===null||Be(p)?(e.exit("atxHeading"),t(p)):ut(p)?st(e,u,"whitespace")(p):(e.enter("atxHeadingText"),d(p))}function f(p){return p===35?(e.consume(p),f):(e.exit("atxHeadingSequence"),u(p))}function d(p){return p===null||p===35||Tt(p)?(e.exit("atxHeadingText"),u(p)):(e.consume(p),d)}}const Y7=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],n_=["pre","script","style","textarea"],W7={concrete:!0,name:"htmlFlow",resolveTo:Z7,tokenize:Q7},X7={partial:!0,tokenize:eV},K7={partial:!0,tokenize:J7};function Z7(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Q7(e,t,n){const r=this;let i,o,l,u,f;return d;function d(O){return p(O)}function p(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),m}function m(O){return O===33?(e.consume(O),v):O===47?(e.consume(O),o=!0,x):O===63?(e.consume(O),i=3,r.interrupt?t:A):kn(O)?(e.consume(O),l=String.fromCharCode(O),k):n(O)}function v(O){return O===45?(e.consume(O),i=2,g):O===91?(e.consume(O),i=5,u=0,w):kn(O)?(e.consume(O),i=4,r.interrupt?t:A):n(O)}function g(O){return O===45?(e.consume(O),r.interrupt?t:A):n(O)}function w(O){const X="CDATA[";return O===X.charCodeAt(u++)?(e.consume(O),u===X.length?r.interrupt?t:q:w):n(O)}function x(O){return kn(O)?(e.consume(O),l=String.fromCharCode(O),k):n(O)}function k(O){if(O===null||O===47||O===62||Tt(O)){const X=O===47,re=l.toLowerCase();return!X&&!o&&n_.includes(re)?(i=1,r.interrupt?t(O):q(O)):Y7.includes(l.toLowerCase())?(i=6,X?(e.consume(O),C):r.interrupt?t(O):q(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):o?_(O):T(O))}return O===45||yn(O)?(e.consume(O),l+=String.fromCharCode(O),k):n(O)}function C(O){return O===62?(e.consume(O),r.interrupt?t:q):n(O)}function _(O){return ut(O)?(e.consume(O),_):z(O)}function T(O){return O===47?(e.consume(O),z):O===58||O===95||kn(O)?(e.consume(O),N):ut(O)?(e.consume(O),T):z(O)}function N(O){return O===45||O===46||O===58||O===95||yn(O)?(e.consume(O),N):D(O)}function D(O){return O===61?(e.consume(O),L):ut(O)?(e.consume(O),D):T(O)}function L(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),f=O,R):ut(O)?(e.consume(O),L):U(O)}function R(O){return O===f?(e.consume(O),f=null,P):O===null||Be(O)?n(O):(e.consume(O),R)}function U(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Tt(O)?D(O):(e.consume(O),U)}function P(O){return O===47||O===62||ut(O)?T(O):n(O)}function z(O){return O===62?(e.consume(O),V):n(O)}function V(O){return O===null||Be(O)?q(O):ut(O)?(e.consume(O),V):n(O)}function q(O){return O===45&&i===2?(e.consume(O),B):O===60&&i===1?(e.consume(O),G):O===62&&i===4?(e.consume(O),H):O===63&&i===3?(e.consume(O),A):O===93&&i===5?(e.consume(O),K):Be(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(X7,M,I)(O)):O===null||Be(O)?(e.exit("htmlFlowData"),I(O)):(e.consume(O),q)}function I(O){return e.check(K7,Y,M)(O)}function Y(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),Z}function Z(O){return O===null||Be(O)?I(O):(e.enter("htmlFlowData"),q(O))}function B(O){return O===45?(e.consume(O),A):q(O)}function G(O){return O===47?(e.consume(O),l="",F):q(O)}function F(O){if(O===62){const X=l.toLowerCase();return n_.includes(X)?(e.consume(O),H):q(O)}return kn(O)&&l.length<8?(e.consume(O),l+=String.fromCharCode(O),F):q(O)}function K(O){return O===93?(e.consume(O),A):q(O)}function A(O){return O===62?(e.consume(O),H):O===45&&i===2?(e.consume(O),A):q(O)}function H(O){return O===null||Be(O)?(e.exit("htmlFlowData"),M(O)):(e.consume(O),H)}function M(O){return e.exit("htmlFlow"),t(O)}}function J7(e,t,n){const r=this;return i;function i(l){return Be(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function eV(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(yu,t,n)}}const tV={name:"htmlText",tokenize:nV};function nV(e,t,n){const r=this;let i,o,l;return u;function u(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),f}function f(A){return A===33?(e.consume(A),d):A===47?(e.consume(A),D):A===63?(e.consume(A),T):kn(A)?(e.consume(A),U):n(A)}function d(A){return A===45?(e.consume(A),p):A===91?(e.consume(A),o=0,w):kn(A)?(e.consume(A),_):n(A)}function p(A){return A===45?(e.consume(A),g):n(A)}function m(A){return A===null?n(A):A===45?(e.consume(A),v):Be(A)?(l=m,G(A)):(e.consume(A),m)}function v(A){return A===45?(e.consume(A),g):m(A)}function g(A){return A===62?B(A):A===45?v(A):m(A)}function w(A){const H="CDATA[";return A===H.charCodeAt(o++)?(e.consume(A),o===H.length?x:w):n(A)}function x(A){return A===null?n(A):A===93?(e.consume(A),k):Be(A)?(l=x,G(A)):(e.consume(A),x)}function k(A){return A===93?(e.consume(A),C):x(A)}function C(A){return A===62?B(A):A===93?(e.consume(A),C):x(A)}function _(A){return A===null||A===62?B(A):Be(A)?(l=_,G(A)):(e.consume(A),_)}function T(A){return A===null?n(A):A===63?(e.consume(A),N):Be(A)?(l=T,G(A)):(e.consume(A),T)}function N(A){return A===62?B(A):T(A)}function D(A){return kn(A)?(e.consume(A),L):n(A)}function L(A){return A===45||yn(A)?(e.consume(A),L):R(A)}function R(A){return Be(A)?(l=R,G(A)):ut(A)?(e.consume(A),R):B(A)}function U(A){return A===45||yn(A)?(e.consume(A),U):A===47||A===62||Tt(A)?P(A):n(A)}function P(A){return A===47?(e.consume(A),B):A===58||A===95||kn(A)?(e.consume(A),z):Be(A)?(l=P,G(A)):ut(A)?(e.consume(A),P):B(A)}function z(A){return A===45||A===46||A===58||A===95||yn(A)?(e.consume(A),z):V(A)}function V(A){return A===61?(e.consume(A),q):Be(A)?(l=V,G(A)):ut(A)?(e.consume(A),V):P(A)}function q(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),i=A,I):Be(A)?(l=q,G(A)):ut(A)?(e.consume(A),q):(e.consume(A),Y)}function I(A){return A===i?(e.consume(A),i=void 0,Z):A===null?n(A):Be(A)?(l=I,G(A)):(e.consume(A),I)}function Y(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||Tt(A)?P(A):(e.consume(A),Y)}function Z(A){return A===47||A===62||Tt(A)?P(A):n(A)}function B(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function G(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),F}function F(A){return ut(A)?st(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):K(A)}function K(A){return e.enter("htmlTextData"),l(A)}}const Jy={name:"labelEnd",resolveAll:oV,resolveTo:sV,tokenize:lV},rV={tokenize:uV},iV={tokenize:cV},aV={tokenize:fV};function oV(e){let t=-1;const n=[];for(;++t=3&&(d===null||Be(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===i?(e.consume(d),r++,f):(e.exit("thematicBreakSequence"),ut(d)?st(e,u,"whitespace")(d):u(d))}}const On={continuation:{tokenize:wV},exit:EV,name:"list",tokenize:xV},yV={partial:!0,tokenize:_V},bV={partial:!0,tokenize:SV};function xV(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return u;function u(g){const w=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:xv(g)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(yf,n,d)(g):d(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(g)}return n(g)}function f(g){return xv(g)&&++l<10?(e.consume(g),f):(!r.interrupt||l<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),d(g)):n(g)}function d(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(yu,r.interrupt?n:p,e.attempt(yV,v,m))}function p(g){return r.containerState.initialBlankLine=!0,o++,v(g)}function m(g){return ut(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),v):n(g)}function v(g){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function wV(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yu,i,o);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,st(e,t,"listItemIndent",r.containerState.size+1)(u)}function o(u){return r.containerState.furtherBlankLines||!ut(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(bV,t,l)(u))}function l(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,st(e,e.attempt(On,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function SV(e,t,n){const r=this;return st(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function EV(e){e.exit(this.containerState.type)}function _V(e,t,n){const r=this;return st(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!ut(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const r_={name:"setextUnderline",resolveTo:kV,tokenize:CV};function kV(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function CV(e,t,n){const r=this;let i;return o;function o(d){let p=r.events.length,m;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){m=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),i=d,l(d)):n(d)}function l(d){return e.enter("setextHeadingLineSequence"),u(d)}function u(d){return d===i?(e.consume(d),u):(e.exit("setextHeadingLineSequence"),ut(d)?st(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||Be(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const TV={tokenize:AV};function AV(e){const t=this,n=e.attempt(yu,r,e.attempt(this.parser.constructs.flowInitial,i,st(e,e.attempt(this.parser.constructs.flow,i,e.attempt(j7,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const RV={resolveAll:pD()},DV=hD("string"),NV=hD("text");function hD(e){return{resolveAll:pD(e==="text"?OV:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,u);return l;function l(p){return d(p)?o(p):u(p)}function u(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),f}function f(p){return d(p)?(n.exit("data"),o(p)):(n.consume(p),f)}function d(p){if(p===null)return!0;const m=i[p];let v=-1;if(m)for(;++v-1){const u=l[0];typeof u=="string"?l[0]=u.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function VV(e,t){let n=-1;const r=[];let i;for(;++n0){const vt=Oe.tokenStack[Oe.tokenStack.length-1];(vt[1]||a_).call(Oe,void 0,vt[0])}for(de.position={start:ra(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:ra(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Ye=-1;++Ye1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);const d={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,d),e.applyData(t,d)}function lq(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uq(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function vD(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function cq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return vD(e,t);const i={src:Ds(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function fq(e,t){const n={src:Ds(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function dq(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function hq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return vD(e,t);const i={href:Ds(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function pq(e,t){const n={href:Ds(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function mq(e,t,n){const r=e.all(t),i=n?gq(n):yD(t),o={},l=[];if(typeof t.checked=="boolean"){const p=r[0];let m;p&&p.type==="element"&&p.tagName==="p"?m=p:(m={type:"element",tagName:"p",properties:{},children:[]},r.unshift(m)),m.children.length>0&&m.children.unshift({type:"text",value:" "}),m.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let u=-1;for(;++u1}function vq(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=Yy(t.children[1]),f=K2(t.children[t.children.length-1]);u&&f&&(l.position={start:u,end:f}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function Sq(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,u=l?l.length:t.children.length;let f=-1;const d=[];for(;++f0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(l_(t.slice(i),i>0,!1)),o.join("")}function l_(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===o_||o===s_;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===o_||o===s_;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function kq(e,t){const n={type:"text",value:_q(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Cq(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Tq={blockquote:nq,break:rq,code:iq,delete:aq,emphasis:oq,footnoteReference:sq,heading:lq,html:uq,imageReference:cq,image:fq,inlineCode:dq,linkReference:hq,link:pq,listItem:mq,list:vq,paragraph:yq,root:bq,strong:xq,table:wq,tableCell:Eq,tableRow:Sq,text:kq,thematicBreak:Cq,toml:Zc,yaml:Zc,definition:Zc,footnoteDefinition:Zc};function Zc(){}const bD=-1,Nd=0,Hl=1,Bf=2,eb=3,tb=4,nb=5,rb=6,xD=7,wD=8,u_=typeof self=="object"?self:globalThis,Aq=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=t[i];switch(o){case Nd:case bD:return n(l,i);case Hl:{const u=n([],i);for(const f of l)u.push(r(f));return u}case Bf:{const u=n({},i);for(const[f,d]of l)u[r(f)]=r(d);return u}case eb:return n(new Date(l),i);case tb:{const{source:u,flags:f}=l;return n(new RegExp(u,f),i)}case nb:{const u=n(new Map,i);for(const[f,d]of l)u.set(r(f),r(d));return u}case rb:{const u=n(new Set,i);for(const f of l)u.add(r(f));return u}case xD:{const{name:u,message:f}=l;return n(new u_[u](f),i)}case wD:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:u}=new Uint8Array(l);return n(new DataView(u),l)}}return n(new u_[o](l),i)};return r},c_=e=>Aq(new Map,e)(0),Ko="",{toString:Rq}={},{keys:Dq}=Object,Ml=e=>{const t=typeof e;if(t!=="object"||!e)return[Nd,t];const n=Rq.call(e).slice(8,-1);switch(n){case"Array":return[Hl,Ko];case"Object":return[Bf,Ko];case"Date":return[eb,Ko];case"RegExp":return[tb,Ko];case"Map":return[nb,Ko];case"Set":return[rb,Ko];case"DataView":return[Hl,n]}return n.includes("Array")?[Hl,n]:n.includes("Error")?[xD,n]:[Bf,n]},Qc=([e,t])=>e===Nd&&(t==="function"||t==="symbol"),Nq=(e,t,n,r)=>{const i=(l,u)=>{const f=r.push(l)-1;return n.set(u,f),f},o=l=>{if(n.has(l))return n.get(l);let[u,f]=Ml(l);switch(u){case Nd:{let p=l;switch(f){case"bigint":u=wD,p=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);p=null;break;case"undefined":return i([bD],l)}return i([u,p],l)}case Hl:{if(f){let v=l;return f==="DataView"?v=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(v=new Uint8Array(l)),i([f,[...v]],l)}const p=[],m=i([u,p],l);for(const v of l)p.push(o(v));return m}case Bf:{if(f)switch(f){case"BigInt":return i([f,l.toString()],l);case"Boolean":case"Number":case"String":return i([f,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const p=[],m=i([u,p],l);for(const v of Dq(l))(e||!Qc(Ml(l[v])))&&p.push([o(v),o(l[v])]);return m}case eb:return i([u,l.toISOString()],l);case tb:{const{source:p,flags:m}=l;return i([u,{source:p,flags:m}],l)}case nb:{const p=[],m=i([u,p],l);for(const[v,g]of l)(e||!(Qc(Ml(v))||Qc(Ml(g))))&&p.push([o(v),o(g)]);return m}case rb:{const p=[],m=i([u,p],l);for(const v of l)(e||!Qc(Ml(v)))&&p.push(o(v));return m}}const{message:d}=l;return i([u,{name:f,message:d}],l)};return o},f_=(e,{json:t,lossy:n}={})=>{const r=[];return Nq(!(t||n),!!t,new Map,r)(e),r},$f=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?c_(f_(e,t)):structuredClone(e):(e,t)=>c_(f_(e,t));function Oq(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function jq(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Lq(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Oq,r=e.options.footnoteBackLabel||jq,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let f=-1;for(;++f0&&w.push({type:"text",value:" "});let _=typeof n=="string"?n:n(f,g);typeof _=="string"&&(_={type:"text",value:_}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,g),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const k=p[p.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const _=k.children[k.children.length-1];_&&_.type==="text"?_.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...w)}else p.push(...w);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(p,!0)};e.patch(d,C),u.push(C)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...$f(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:` `}]}}const Od=function(e){if(e==null)return Fq;if(typeof e=="function")return jd(e);if(typeof e=="object")return Array.isArray(e)?zq(e):Mq(e);if(typeof e=="string")return Pq(e);throw new Error("Expected function, string, or object as test")};function zq(e){const t=[];let n=-1;for(;++n":""))+")"})}return v;function v(){let g=SD,w,x,k;if((!t||o(f,d,p[p.length-1]||void 0))&&(g=Bq(n(f,p)),g[0]===Sv))return g;if("children"in f&&f.children){const C=f;if(C.children&&g[0]!==Uq)for(x=(r?C.children.length:-1)+l,k=p.concat(C);x>-1&&x0&&n.push({type:"text",value:` `}),n}function d_(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function h_(e,t){const n=Hq(e,t),r=n.one(e,void 0),i=Lq(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` `},i),o}function Xq(e,t){return e&&"run"in e?async function(n,r){const i=h_(n,{file:r,...t});await e.run(i,r)}:function(n,r){return h_(n,{file:r,...e||t})}}function p_(e){if(e)throw e}var sg,m_;function Kq(){if(m_)return sg;m_=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},o=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var p=e.call(d,"constructor"),m=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!p&&!m)return!1;var v;for(v in d);return typeof v>"u"||e.call(d,v)},l=function(d,p){n&&p.name==="__proto__"?n(d,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):d[p.name]=p.newValue},u=function(d,p){if(p==="__proto__")if(e.call(d,p)){if(r)return r(d,p).value}else return;return d[p]};return sg=function f(){var d,p,m,v,g,w,x=arguments[0],k=1,C=arguments.length,_=!1;for(typeof x=="boolean"&&(_=x,x=arguments[1]||{},k=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});kl.length;let f;u&&l.push(i);try{f=e.apply(this,l)}catch(d){const p=d;if(u&&n)throw p;return i(p)}u||(f&&f.then&&typeof f.then=="function"?f.then(o,i):f instanceof Error?i(f):o(f))}function i(l,...u){n||(n=!0,t(l,...u))}function o(l){i(null,l)}}const Gr={basename:eY,dirname:tY,extname:nY,join:rY,sep:"/"};function eY(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');bu(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else l<0&&(o=!0,l=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(r=i):(u=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function tY(e){if(bu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function nY(e){bu(e);let t=e.length,n=-1,r=0,i=-1,o=0,l;for(;t--;){const u=e.codePointAt(t);if(u===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),u===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function rY(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function aY(e,t){let n="",r=0,i=-1,o=0,l=-1,u,f;for(;++l<=e.length;){if(l2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),i=l,o=0;continue}}else if(n.length>0){n="",r=0,i=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,o=0}else u===46&&o>-1?o++:o=-1}return n}function bu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const oY={cwd:sY};function sY(){return"/"}function kv(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function lY(e){if(typeof e=="string")e=new URL(e);else if(!kv(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return uY(e)}function uY(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[g,...w]=p;const x=r[v][1];_v(x)&&_v(g)&&(g=lg(!0,x,g)),r[v]=[d,g,...w]}}}}const hY=new ab().freeze();function dg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function pg(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function v_(e){if(!_v(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function y_(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Jc(e){return pY(e)?e:new _D(e)}function pY(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function mY(e){return typeof e=="string"||gY(e)}function gY(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const vY="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",b_=[],x_={allowDangerousHtml:!0},yY=/^(https?|ircs?|mailto|xmpp)$/i,bY=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function xY(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,l=e.disallowedElements,u=e.rehypePlugins||b_,f=e.remarkPlugins||b_,d=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...x_}:x_,p=e.skipHtml,m=e.unwrapDisallowed,v=e.urlTransform||wY,g=hY().use(tq).use(f).use(Xq,d).use(u),w=new _D;typeof r=="string"&&(w.value=r);for(const _ of bY)Object.hasOwn(e,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+vY+_.id,void 0);const x=g.parse(w);let k=g.runSync(x,w);return i&&(k={type:"element",tagName:"div",properties:{className:i},children:k.type==="root"?k.children:[k]}),ib(k,C),J2(k,{Fragment:S.Fragment,components:o,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function C(_,T,N){if(_.type==="raw"&&N&&typeof T=="number")return p?N.children.splice(T,1):N.children[T]={type:"text",value:_.value},T;if(_.type==="element"){let D;for(D in ig)if(Object.hasOwn(ig,D)&&Object.hasOwn(_.properties,D)){const L=_.properties[D],R=ig[D];(R===null||R.includes(_.tagName))&&(_.properties[D]=v(String(L||""),D,_))}}if(_.type==="element"){let D=t?!t.includes(_.tagName):l?l.includes(_.tagName):!1;if(!D&&n&&typeof T=="number"&&(D=!n(_,T,N)),D&&N&&typeof T=="number")return m&&_.children?N.children.splice(T,1,..._.children):N.children.splice(T,1),T}}}function wY(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||yY.test(e.slice(0,t))?e:""}function w_(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function SY(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function EY(e,t,n){const i=Od((n||{}).ignore||[]),o=_Y(t);let l=-1;for(;++l0?{type:"text",value:L}:void 0),L===!1?v.lastIndex=N+1:(w!==N&&_.push({type:"text",value:d.value.slice(w,N)}),Array.isArray(L)?_.push(...L):L&&_.push(L),w=N+T[0].length,C=!0),!v.global)break;T=v.exec(d.value)}return C?(w?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=w_(e,"(");let o=w_(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function kD(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||to(n)||Rd(n))&&(!t||n!==47)}CD.peek=YY;function IY(){this.buffer()}function GY(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function UY(){this.buffer()}function BY(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function $Y(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function HY(e){this.exit(e)}function VY(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Tr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function qY(e){this.exit(e)}function YY(){return"["}function CD(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const l=n.enter("footnoteReference"),u=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),u(),l(),o+=i.move("]"),o}function WY(){return{enter:{gfmFootnoteCallString:IY,gfmFootnoteCall:GY,gfmFootnoteDefinitionLabelString:UY,gfmFootnoteDefinition:BY},exit:{gfmFootnoteCallString:$Y,gfmFootnoteCall:HY,gfmFootnoteDefinitionLabelString:VY,gfmFootnoteDefinition:qY}}}function XY(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:CD},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,l){const u=o.createTracker(l);let f=u.move("[^");const d=o.enter("footnoteDefinition"),p=o.enter("label");return f+=u.move(o.safe(o.associationId(r),{before:f,after:"]"})),p(),f+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),f+=u.move((t?` `:" ")+o.indentLines(o.containerFlow(r,u.current()),t?TD:KY))),d(),f}}function KY(e,t,n){return t===0?e:TD(e,t,n)}function TD(e,t,n){return(n?"":" ")+e}const ZY=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];AD.peek=nW;function QY(){return{canContainEols:["delete"],enter:{strikethrough:eW},exit:{strikethrough:tW}}}function JY(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:ZY}],handlers:{delete:AD}}}function eW(e){this.enter({type:"delete",children:[]},e)}function tW(e){this.exit(e)}function AD(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let l=i.move("~~");return l+=n.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),o(),l}function nW(){return"~"}function rW(e){return e.length}function iW(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||rW,o=[],l=[],u=[],f=[];let d=0,p=-1;for(;++pd&&(d=e[p].length);++Cf[C])&&(f[C]=T)}x.push(_)}l[p]=x,u[p]=k}let m=-1;if(typeof r=="object"&&"length"in r)for(;++mf[m]&&(f[m]=_),g[m]=_),v[m]=T}l.splice(1,0,v),u.splice(1,0,g),p=-1;const w=[];for(;++p "),o.shift(2);const l=n.indentLines(n.containerFlow(e,o.current()),sW);return i(),l}function sW(e,t,n){return">"+(n?"":" ")+e}function lW(e,t){return E_(e,t.inConstruct,!0)&&!E_(e,t.notInConstruct,!1)}function E_(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++rl&&(l=o):o=1,i=r+t.length,r=n.indexOf(t,i);return l}function uW(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function cW(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function fW(e,t,n,r){const i=cW(n),o=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(uW(e,n)){const m=n.enter("codeIndented"),v=n.indentLines(o,dW);return m(),v}const u=n.createTracker(r),f=i.repeat(Math.max(RD(o,i)+1,3)),d=n.enter("codeFenced");let p=u.move(f);if(e.lang){const m=n.enter(`codeFencedLang${l}`);p+=u.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...u.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${l}`);p+=u.move(" "),p+=u.move(n.safe(e.meta,{before:p,after:` `,encode:["`"],...u.current()})),m()}return p+=u.move(` `),o&&(p+=u.move(o+` `)),p+=u.move(f),d(),p}function dW(e,t,n){return(n?"":" ")+e}function ob(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function hW(e,t,n,r){const i=ob(n),o=i==='"'?"Quote":"Apostrophe",l=n.enter("definition");let u=n.enter("label");const f=n.createTracker(r);let d=f.move("[");return d+=f.move(n.safe(n.associationId(e),{before:d,after:"]",...f.current()})),d+=f.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(u=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":` `,...f.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=f.move(" "+i),d+=f.move(n.safe(e.title,{before:d,after:i,...f.current()})),d+=f.move(i),u()),l(),d}function pW(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function nu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Hf(e,t,n){const r=ps(e),i=ps(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}DD.peek=mW;function DD(e,t,n,r){const i=pW(n),o=n.enter("emphasis"),l=n.createTracker(r),u=l.move(i);let f=l.move(n.containerPhrasing(e,{after:i,before:u,...l.current()}));const d=f.charCodeAt(0),p=Hf(r.before.charCodeAt(r.before.length-1),d,i);p.inside&&(f=nu(d)+f.slice(1));const m=f.charCodeAt(f.length-1),v=Hf(r.after.charCodeAt(0),m,i);v.inside&&(f=f.slice(0,-1)+nu(m));const g=l.move(i);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},u+f+g}function mW(e,t,n){return n.options.emphasis||"*"}function gW(e,t){let n=!1;return ib(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Sv}),!!((!e.depth||e.depth<3)&&Zy(e)&&(t.options.setext||n))}function vW(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(gW(e,n)){const p=n.enter("headingSetext"),m=n.enter("phrasing"),v=n.containerPhrasing(e,{...o.current(),before:` `,after:` `});return m(),p(),v+` `+(i===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(` `))+1))}const l="#".repeat(i),u=n.enter("headingAtx"),f=n.enter("phrasing");o.move(l+" ");let d=n.containerPhrasing(e,{before:"# ",after:` `,...o.current()});return/^[\t ]/.test(d)&&(d=nu(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),f(),u(),d}ND.peek=yW;function ND(e){return e.value||""}function yW(){return"<"}OD.peek=bW;function OD(e,t,n,r){const i=ob(n),o=i==='"'?"Quote":"Apostrophe",l=n.enter("image");let u=n.enter("label");const f=n.createTracker(r);let d=f.move("![");return d+=f.move(n.safe(e.alt,{before:d,after:"]",...f.current()})),d+=f.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(u=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":")",...f.current()}))),u(),e.title&&(u=n.enter(`title${o}`),d+=f.move(" "+i),d+=f.move(n.safe(e.title,{before:d,after:i,...f.current()})),d+=f.move(i),u()),d+=f.move(")"),l(),d}function bW(){return"!"}jD.peek=xW;function jD(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let l=n.enter("label");const u=n.createTracker(r);let f=u.move("![");const d=n.safe(e.alt,{before:f,after:"]",...u.current()});f+=u.move(d+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...u.current()});return l(),n.stack=p,o(),i==="full"||!d||d!==m?f+=u.move(m+"]"):i==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function xW(){return"!"}LD.peek=wW;function LD(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o\u007F]/.test(e.url))}MD.peek=SW;function MD(e,t,n,r){const i=ob(n),o=i==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let u,f;if(zD(e,n)){const p=n.stack;n.stack=[],u=n.enter("autolink");let m=l.move("<");return m+=l.move(n.containerPhrasing(e,{before:m,after:">",...l.current()})),m+=l.move(">"),u(),n.stack=p,m}u=n.enter("link"),f=n.enter("label");let d=l.move("[");return d+=l.move(n.containerPhrasing(e,{before:d,after:"](",...l.current()})),d+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),d+=l.move("<"),d+=l.move(n.safe(e.url,{before:d,after:">",...l.current()})),d+=l.move(">")):(f=n.enter("destinationRaw"),d+=l.move(n.safe(e.url,{before:d,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${o}`),d+=l.move(" "+i),d+=l.move(n.safe(e.title,{before:d,after:i,...l.current()})),d+=l.move(i),f()),d+=l.move(")"),u(),d}function SW(e,t,n){return zD(e,n)?"<":"["}PD.peek=EW;function PD(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let l=n.enter("label");const u=n.createTracker(r);let f=u.move("[");const d=n.containerPhrasing(e,{before:f,after:"]",...u.current()});f+=u.move(d+"]["),l();const p=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...u.current()});return l(),n.stack=p,o(),i==="full"||!d||d!==m?f+=u.move(m+"]"):i==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function EW(){return"["}function sb(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function _W(e){const t=sb(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function kW(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function FD(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function CW(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let l=e.ordered?kW(n):sb(n);const u=e.ordered?l==="."?")":".":_W(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),FD(n)===l&&p){let m=-1;for(;++m-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const u=n.createTracker(r);u.move(o+" ".repeat(l-o.length)),u.shift(l);const f=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,u.current()),p);return f(),d;function p(m,v,g){return v?(g?"":" ".repeat(l))+m:(g?o:o+" ".repeat(l-o.length))+m}}function RW(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,r);return o(),i(),l}const DW=Od(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function NW(e,t,n,r){return(e.children.some(function(l){return DW(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function OW(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ID.peek=jW;function ID(e,t,n,r){const i=OW(n),o=n.enter("strong"),l=n.createTracker(r),u=l.move(i+i);let f=l.move(n.containerPhrasing(e,{after:i,before:u,...l.current()}));const d=f.charCodeAt(0),p=Hf(r.before.charCodeAt(r.before.length-1),d,i);p.inside&&(f=nu(d)+f.slice(1));const m=f.charCodeAt(f.length-1),v=Hf(r.after.charCodeAt(0),m,i);v.inside&&(f=f.slice(0,-1)+nu(m));const g=l.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},u+f+g}function jW(e,t,n){return n.options.strong||"*"}function LW(e,t,n,r){return n.safe(e.value,r)}function zW(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function MW(e,t,n){const r=(FD(n)+(n.options.ruleSpaces?" ":"")).repeat(zW(n));return n.options.ruleSpaces?r.slice(0,-1):r}const GD={blockquote:oW,break:__,code:fW,definition:hW,emphasis:DD,hardBreak:__,heading:vW,html:ND,image:OD,imageReference:jD,inlineCode:LD,link:MD,linkReference:PD,list:CW,listItem:AW,paragraph:RW,root:NW,strong:ID,text:LW,thematicBreak:MW};function PW(){return{enter:{table:FW,tableData:k_,tableHeader:k_,tableRow:GW},exit:{codeText:UW,table:IW,tableData:yg,tableHeader:yg,tableRow:yg}}}function FW(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function IW(e){this.exit(e),this.data.inTable=void 0}function GW(e){this.enter({type:"tableRow",children:[]},e)}function yg(e){this.exit(e)}function k_(e){this.enter({type:"tableCell",children:[]},e)}function UW(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,BW));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function BW(e,t){return t==="|"?t:e}function $W(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:l,tableCell:f,tableRow:u}};function l(g,w,x,k){return d(p(g,x,k),g.align)}function u(g,w,x,k){const C=m(g,x,k),_=d([C]);return _.slice(0,_.indexOf(` `))}function f(g,w,x,k){const C=x.enter("tableCell"),_=x.enter("phrasing"),T=x.containerPhrasing(g,{...k,before:o,after:o});return _(),C(),T}function d(g,w){return iW(g,{align:w,alignDelimiters:r,padding:n,stringLength:i})}function p(g,w,x){const k=g.children;let C=-1;const _=[],T=w.enter("table");for(;++C0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const sX={tokenize:mX,partial:!0};function lX(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:dX,continuation:{tokenize:hX},exit:pX}},text:{91:{name:"gfmFootnoteCall",tokenize:fX},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:uX,resolveTo:cX}}}}function uX(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const f=r.events[i][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return u;function u(f){if(!l||!l._balanced)return n(f);const d=Tr(r.sliceSerialize({start:l.end,end:r.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function cX(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function fX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return u;function u(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),f}function f(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(m){if(o>999||m===93&&!l||m===null||m===91||Tt(m))return n(m);if(m===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return i.includes(Tr(r.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return Tt(m)||(l=!0),o++,e.consume(m),m===92?p:d}function p(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function dX(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,u;return f;function f(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(w)}function p(w){if(l>999||w===93&&!u||w===null||w===91||Tt(w))return n(w);if(w===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return o=Tr(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return Tt(w)||(u=!0),l++,e.consume(w),w===92?m:p}function m(w){return w===91||w===92||w===93?(e.consume(w),l++,p):p(w)}function v(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),i.includes(o)||i.push(o),st(e,g,"gfmFootnoteDefinitionWhitespace")):n(w)}function g(w){return t(w)}}function hX(e,t,n){return e.check(yu,t,e.attempt(sX,t,n))}function pX(e){e.exit("gfmFootnoteDefinition")}function mX(e,t,n){const r=this;return st(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):n(o)}}function gX(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,u){let f=-1;for(;++f1?f(w):(l.consume(w),m++,g);if(m<2&&!n)return f(w);const k=l.exit("strikethroughSequenceTemporary"),C=ps(w);return k._open=!C||C===2&&!!x,k._close=!x||x===2&&!!C,u(w)}}}class vX{constructor(){this.map=[]}add(t,n,r){yX(this,t,n,r)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function yX(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){const Y=r.events[V][1].type;if(Y==="lineEnding"||Y==="linePrefix")V--;else break}const q=V>-1?r.events[V][1].type:null,I=q==="tableHead"||q==="tableRow"?L:f;return I===L&&r.parser.lazy[r.now().line]?n(z):I(z)}function f(z){return e.enter("tableHead"),e.enter("tableRow"),d(z)}function d(z){return z===124||(l=!0,o+=1),p(z)}function p(z){return z===null?n(z):Be(z)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),g):n(z):ut(z)?st(e,p,"whitespace")(z):(o+=1,l&&(l=!1,i+=1),z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),l=!0,p):(e.enter("data"),m(z)))}function m(z){return z===null||z===124||Tt(z)?(e.exit("data"),p(z)):(e.consume(z),z===92?v:m)}function v(z){return z===92||z===124?(e.consume(z),m):m(z)}function g(z){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(z):(e.enter("tableDelimiterRow"),l=!1,ut(z)?st(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):w(z))}function w(z){return z===45||z===58?k(z):z===124?(l=!0,e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),x):D(z)}function x(z){return ut(z)?st(e,k,"whitespace")(z):k(z)}function k(z){return z===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),C):z===45?(o+=1,C(z)):z===null||Be(z)?N(z):D(z)}function C(z){return z===45?(e.enter("tableDelimiterFiller"),_(z)):D(z)}function _(z){return z===45?(e.consume(z),_):z===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(z))}function T(z){return ut(z)?st(e,N,"whitespace")(z):N(z)}function N(z){return z===124?w(z):z===null||Be(z)?!l||i!==o?D(z):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(z)):D(z)}function D(z){return n(z)}function L(z){return e.enter("tableRow"),R(z)}function R(z){return z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),R):z===null||Be(z)?(e.exit("tableRow"),t(z)):ut(z)?st(e,R,"whitespace")(z):(e.enter("data"),U(z))}function U(z){return z===null||z===124||Tt(z)?(e.exit("data"),R(z)):(e.consume(z),z===92?P:U)}function P(z){return z===92||z===124?(e.consume(z),U):U(z)}}function SX(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],l=[0,0,0,0],u=!1,f=0,d,p,m;const v=new vX;for(;++nn[2]+1){const w=n[2]+1,x=n[3]-n[2]-1;e.add(w,x,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return i!==void 0&&(o.end=Object.assign({},es(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function T_(e,t,n,r,i){const o=[],l=es(t.events,n);i&&(i.end=Object.assign({},l),o.push(["exit",i,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(n+1,0,o)}function es(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const EX={name:"tasklistCheck",tokenize:kX};function _X(){return{text:{91:EX}}}function kX(e,t,n){const r=this;return i;function i(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),o)}function o(f){return Tt(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(f)}function u(f){return Be(f)?t(f):ut(f)?e.check({tokenize:CX},t,n)(f):n(f)}}function CX(e,t,n){return st(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function TX(e){return iD([QW(),lX(),gX(e),xX(),_X()])}const AX={};function RX(e){const t=this,n=e||AX,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(TX(n)),o.push(WW()),l.push(XW(n))}function DX(e){const t=this;t.compiler=n;function n(r,i){return J2(r,{filePath:i.path,...e})}}function NX(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:u,mathText:l,mathTextData:u}};function e(f){const d={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[d]}},f)}function t(){this.buffer()}function n(){const f=this.resume(),d=this.stack[this.stack.length-1];d.type,d.meta=f}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(f){const d=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];p.type,this.exit(f),p.value=d;const m=p.data.hChildren[0];m.type,m.tagName,m.children.push({type:"text",value:d}),this.data.mathFlowInside=void 0}function o(f){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},f),this.buffer()}function l(f){const d=this.resume(),p=this.stack[this.stack.length-1];p.type,this.exit(f),p.value=d,p.data.hChildren.push({type:"text",value:d})}function u(f){this.config.enter.data.call(this,f),this.config.exit.data.call(this,f)}}function OX(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),r.peek=i,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:` `,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:r}};function n(o,l,u,f){const d=o.value||"",p=u.createTracker(f),m="$".repeat(Math.max(RD(d,"$")+1,2)),v=u.enter("mathFlow");let g=p.move(m);if(o.meta){const w=u.enter("mathFlowMeta");g+=p.move(u.safe(o.meta,{after:` `,before:g,encode:["$"],...p.current()})),w()}return g+=p.move(` `),d&&(g+=p.move(d+` `)),g+=p.move(m),v(),g}function r(o,l,u){let f=o.value||"",d=1;for(t||d++;new RegExp("(^|[^$])"+"\\$".repeat(d)+"([^$]|$)").test(f);)d++;const p="$".repeat(d);/[^ \r\n]/.test(f)&&(/^[ \r\n]/.test(f)&&/[ \r\n]$/.test(f)||/^\$|\$$/.test(f))&&(f=" "+f+" ");let m=-1;for(;++mS.jsx(xY,{className:"prose lg:prose-xs dark:prose-invert max-w-none text-base",remarkPlugins:[RX,UX],rehypePlugins:[DX],skipHtml:!1,children:e.content});function $X(){const[e,t]=E.useState(()=>Qe.getState().retrievalHistory||[]),[n,r]=E.useState(""),[i,o]=E.useState(!1),l=E.useRef(null),u=E.useCallback(()=>{var m;(m=l.current)==null||m.scrollIntoView({behavior:"smooth"})},[]),f=E.useCallback(async m=>{if(m.preventDefault(),!n.trim()||i)return;const v={content:n,role:"user"},g={content:"",role:"assistant"},w=[...e];t([...w,v,g]),r(""),o(!0);const x=(_,T)=>{g.content+=_,t(N=>{const D=[...N],L=D[D.length-1];return L.role==="assistant"&&(L.content=g.content,L.isError=T),D})},k=Qe.getState(),C={...k.querySettings,query:v.content,conversation_history:w.filter(_=>_.isError!==!0).map(_=>({role:_.role,content:_.content}))};try{if(k.querySettings.stream){let _="";await uM(C,x,T=>{_+=T}),_&&(g.content&&(_=g.content+` `+_),x(_,!0))}else{const _=await lM(C);x(_.response)}}catch(_){x(`Error: Failed to get response ${Cr(_)}`,!0)}finally{o(!1),Qe.getState().setRetrievalHistory([...w,v,g])}},[n,i,e,t]),d=My(e,100);E.useEffect(()=>u(),[d,u]);const p=E.useCallback(()=>{t([]),Qe.getState().setRetrievalHistory([])},[t]);return S.jsxs("div",{className:"flex size-full gap-2 px-2 pb-12",children:[S.jsxs("div",{className:"flex grow flex-col gap-4",children:[S.jsx("div",{className:"relative grow",children:S.jsx("div",{className:"bg-primary-foreground/60 absolute inset-0 flex flex-col overflow-auto rounded-lg border p-2",children:S.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-2",children:[e.length===0?S.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center text-lg",children:"Start a retrieval by typing your query below"}):e.map((m,v)=>S.jsx("div",{className:`flex ${m.role==="user"?"justify-end":"justify-start"}`,children:S.jsxs("div",{className:`max-w-[80%] rounded-lg px-4 py-2 ${m.role==="user"?"bg-primary text-primary-foreground":m.isError?"bg-red-100 text-red-600 dark:bg-red-950 dark:text-red-400":"bg-muted"}`,children:[S.jsx("pre",{className:"break-words whitespace-pre-wrap",children:S.jsx(BX,{message:m})}),m.content.length===0&&S.jsx(MM,{className:"animate-spin duration-2000"})]})},v)),S.jsx("div",{ref:l,className:"pb-1"})]})})}),S.jsxs("form",{onSubmit:f,className:"flex shrink-0 items-center gap-2",children:[S.jsxs(Ot,{type:"button",variant:"outline",onClick:p,disabled:i,size:"sm",children:[S.jsx(Sk,{}),"Clear"]}),S.jsx(Za,{className:"flex-1",value:n,onChange:m=>r(m.target.value),placeholder:"Type your query...",disabled:i}),S.jsxs(Ot,{type:"submit",variant:"default",disabled:i,size:"sm",children:[S.jsx(QM,{}),"Send"]})]})]}),S.jsx(u8,{})]})}function HX(){return S.jsx("iframe",{src:U_+"/docs",className:"size-full"})}function VX(){const e=Mn.use.message(),t=Qe.use.enableHealthCheck(),[n]=E.useState(()=>Qe.getState().currentTab),[r,i]=E.useState(!1);E.useEffect(()=>{if(!t)return;Mn.getState().check();const l=setInterval(async()=>{await Mn.getState().check()},wL*1e3);return()=>clearInterval(l)},[t]);const o=E.useCallback(l=>Qe.getState().setCurrentTab(l),[]);return E.useEffect(()=>{if(e&&(e.includes(yk)||e.includes(bk))){i(!0);return}i(!1)},[e,i]),S.jsx(kL,{children:S.jsxs("main",{className:"flex h-screen w-screen overflow-x-hidden",children:[S.jsxs(T3,{defaultValue:n,className:"!m-0 flex grow flex-col !p-0",onValueChange:o,children:[S.jsx(R3,{}),S.jsxs("div",{className:"relative grow",children:[S.jsx(Pl,{value:"documents",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(c9,{})}),S.jsx(Pl,{value:"knowledge-graph",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(L$,{})}),S.jsx(Pl,{value:"retrieval",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx($X,{})}),S.jsx(Pl,{value:"api",className:"absolute top-0 right-0 bottom-0 left-0",children:S.jsx(HX,{})})]})]}),t&&S.jsx(u3,{}),e!==null&&!r&&S.jsx(fP,{}),r&&S.jsx(XI,{}),S.jsx(WI,{})]})})}yj.createRoot(document.getElementById("root")).render(S.jsx(E.StrictMode,{children:S.jsx(VX,{})}));